"Datetime", "Author" => "Text", "Tags" => "Text" ); static $casting = array( "Date" => "Date" ); static $defaults = array( "ProvideComments" => true ); static $allowed_children = "none"; /** * overload so that the default date is today. */ public function populateDefaults(){ parent::populateDefaults(); $this->Date = date("d/m/Y H:i:s",time()); } /** * Ensures the most recent article edited on the same day is shown first. */ public function setDate($val){ $datepart = date("Y-m-d",strtotime($val)); $minutepart = date("H:i:s",time()); $date = $datepart . " " . $minutepart; return $this->setField("Date",$date); } function getCMSFields() { Requirements::javascript('blog/javascript/bbcodehelp.js'); Requirements::css('blog/css/bbcodehelp.css'); $firstName = Member::CurrentMember() ? Member::currentMember()->FirstName : ''; $codeparser = new BBCodeParser(); $fields = parent::getCMSFields(); $fields->removeFieldFromTab("Root.Content.Main","Content"); $fields->addFieldToTab("Root.Content.Main", new TextareaField("Content", "Content", 20)); $fields->addFieldToTab("Root.Content.Main", new CalendarDateField("Date", "Date"),"Content"); $fields->addFieldToTab("Root.Content.Main", new TextField("Author", "Author", $firstName),"Content"); $fields->addFieldToTab("Root.Content.Main", new LiteralField("BBCodeHelper", "
" . "BBCode help" . "
")); $fields->addFieldToTab("Root.Content.Main", new TextField("Tags", "Tags (comma sep.)"),"Content"); return $fields; } function Tags() { $theseTags = split(" *, *", trim($this->Tags)); $output = new DataObjectSet(); foreach($theseTags as $tag) { $output->push(new ArrayData(array( "Tag" => $tag, "Link" => $this->getParent()->Link() . '?tag=' . urlencode($tag) ))); } if($this->Tags){ return $output; } } function SideBar() { return $this->getParent()->SideBar(); } function ParagraphSummary(){ $content = new Text('Content'); $content->value = Convert::raw2xml($this->Content); $parser = new BBCodeParser($content->FirstParagraph()); return $parser->parse(); } function ParsedContent() { $parser = new BBCodeParser($this->Content); $content = new Text('Content'); $content->value =$parser->parse(); return $content; } function EditURL(){ return $this->getParent()->Link('post')."/".$this->ID."/"; } } class BlogEntry_Controller extends Page_Controller { function init() { parent::init(); Requirements::themedCSS("blog"); } function unpublishPost(){ if(!Permission::check('ADMIN')){ Security::permissionFailure($this, "Unpublishing blogs is an administrator task. Please log in."); } else{ $SQL_id = Convert::raw2sql($this->ID); $page = DataObject::get_by_id("SiteTree", $SQL_id); $page->deleteFromStage('Live'); $page->flushCache(); $page = DataObject::get_by_id("SiteTree", $SQL_id); $page->Status = "Unpublished"; Director::redirect($this->getParent()->Link()); } } } ?> "WidgetArea" ); static $allowed_children = array( 'BlogEntry' ); function getCMSFields() { $fields = parent::getCMSFields(); $fields->removeFieldFromTab("Root.Content.Main","Content"); $fields->addFieldToTab("Root.Content.Widgets", new WidgetAreaEditor("SideBar")); return $fields; } public function BlogEntries($limit = 10) { $start = isset($_GET['start']) ? (int)$_GET['start'] : 0; $tagCheck = ''; $dateCheck = ""; if(isset($_GET['tag'])) { $tag = addslashes($_GET['tag']); $tag = str_replace(array("\\",'_','%',"'"), array("\\\\","\\_","\\%","\\'"), $tag); $tagCheck = "AND `BlogEntry`.Tags LIKE '%$tag%'"; } if(Director::urlParams()){ $year = Director::urlParam('Action'); $month = Director::urlParam('ID'); if(is_numeric($month) && is_numeric($month)){ $dateCheck = "AND Date BETWEEN '$year-$month-1' AND '$year-$month-31'"; } else if(isset($year)){ $dateCheck = "AND Date BETWEEN '$year-1-1' AND '$year-12-31'"; } } return DataObject::get("Page","`ParentID` = $this->ID AND ShowInMenus = 1 $tagCheck $dateCheck","`BlogEntry`.Date DESC",'',"$start, $limit"); } function Tag() { return isset($_GET['tag']) ? $_GET['tag'] : false; } function BlogEntryForm(){ Requirements::javascript('jsparty/behaviour.js'); Requirements::javascript('jsparty/prototype.js'); Requirements::javascript('jsparty/scriptaculous/effects.js'); Requirements::javascript('cms/javascript/PageCommentInterface.js'); Requirements::javascript('blog/javascript/bbcodehelp.js'); $id = 0; if(Director::urlParam('ID')){ $id = Director::urlParam('ID'); } $codeparser = new BBCodeParser(); $membername = Member::currentMember() ? Member::currentMember()->getName() : ""; $fields = new FieldSet( new HiddenField("ParentID", "ParentID", $this->ID), new HiddenField("ID","ID"), new HiddenField("Date","Date"), new TextField("Title","Subject"), new TextField("Author","Author",$membername), new CompositeField( new LiteralField("BBCodeHelper","BBCode help
" ), new TextareaField("Content", "Content",20), new LiteralField("BBCodeTags","") ), new TextField("Tags","Tags"), new LiteralField("Tagsnote"," ") ); $submitAction = new FormAction('postblog', 'Post blog entry'); $actions = new FieldSet($submitAction); $validator = new RequiredFields('Title','Content'); $form = new BlogEntry_Form($this, 'BlogEntryForm',$fields, $actions,$validator); if($id != 0){ $form->loadNonBlankDataFrom(DataObject::get_by_id('BlogEntry',$id)); }else{ $form->loadNonBlankDataFrom(array("Author" => Cookie::get("BlogHolder_Name"))); } return $form; } function isPost(){ return Director::urlParam('Action') == 'post'; } function postURL(){ return $this->Link('post'); } function requireDefaultRecords() { parent::requireDefaultRecords(); if(!DataObject::get_one('BlogHolder')) { $blogholder = new BlogHolder(); $blogholder->Title = "Blog"; $blogholder->URLSegment = "blog"; $blogholder->Status = "Published"; $widgetarea = new WidgetArea(); $widgetarea->write(); $blogholder->SideBarID = $widgetarea->ID; $blogholder->write(); $blogholder->publish("Stage", "Live"); $managementwidget = new BlogManagementWidget(); $managementwidget->ParentID = $widgetarea->ID; $managementwidget->write(); $tagcloudwidget = new TagCloudWidget(); $tagcloudwidget->ParentID = $widgetarea->ID; $tagcloudwidget->write(); $archivewidget = new ArchiveWidget(); $archivewidget->ParentID = $widgetarea->ID; $archivewidget->write(); $widgetarea->write(); $blog = new BlogEntry(); $blog->Title = "SilverStripe blog module successfully installed"; $blog->URLSegment = 'sample-blog-entry'; $blog->setDate(date("Y-m-d H:i:s",time())); $blog->Tags = "silverstripe, blog"; $blog->Content = "Congratulations, the SilverStripe blog module has been successfully installed. This blog entry can be safely deleted. You can configure aspects of your blog (such as the widgets displayed in the sidebar) in [url=admin]the CMS[/url]."; $blog->Status = "Published"; $blog->ParentID = $blogholder->ID; $blog->write(); $blog->publish("Stage", "Live"); Database::alteration_message("Blog page created","created"); } } } class BlogHolder_Controller extends Page_Controller { function init() { parent::init(); // This will create a tag point to the RSS feed RSSFeed::linkToFeed($this->Link() . "rss", "RSS feed of this blog"); Requirements::themedCSS("blog"); Requirements::themedCSS("bbcodehelp"); } function showarchive() { $month = addslashes($this->urlParams['ID']); return array( "Children" => DataObject::get('SiteTree', "ParentID = $this->ID AND DATE_FORMAT(`BlogEntry`.`Date`, '%Y-%M') = '$month'"), ); } function ArchiveMonths() { $months = DB::query("SELECT DISTINCT DATE_FORMAT(`BlogEntry`.`Date`, '%M') AS `Month`, DATE_FORMAT(`BlogEntry`.`Date`, '%Y') AS `Year` FROM `BlogEntry` ORDER BY `BlogEntry`.`Date` DESC"); $output = new DataObjectSet(); foreach($months as $month) { $month['Link'] = $this->Link() . "showarchive/$month[Year]-$month[Month]"; $output->push(new ArrayData($month)); } return $output; } function rss() { global $project; $rss = new RSSFeed($this->Children(), $this->Link(), $project . " blog", "", "Title", "ParsedContent"); $rss->outputToBrowser(); } function BBTags() { return BBCodeParser::usable_tags(); } function post(){ if(!Permission::check('ADMIN')){ Security::permissionFailure($this, "Posting blogs is an administrator task. Please log in."); } return array(); } } class BlogEntry_Form extends Form { function postblog($data) { Cookie::set("BlogHolder_Name", $data['Author']); $blogentry = new BlogEntry(); $this->saveInto($blogentry); if($data['ID'] != 0){ //new post $blogentry = DataObject::get_by_id("BlogEntry",$data['ID']); $this->saveInto($blogentry); $blogentry->setDate($data['Date']); }else{ $blogentry->setDate(date("Y-m-d H:i:s",time())); $blogentry->URLSegment = $data['Title']; } $blogentry->Status = "Published"; $blogentry->writeToStage("Stage"); $blogentry->publish("Stage", "Live"); Director::redirect(Director::currentURLSegment()); } } ?>removeFieldFromTab("Root.Content.Main","Content"); return $fields; } public function News($limit = 10) { $start = isset($_GET['start']) ? (int)$_GET['start'] : 0; $dateCheck = ""; if(Director::urlParams()){ $year = Director::urlParam('Action'); $month = Director::urlParam('ID'); if(is_numeric($month) && is_numeric($month)){ $dateCheck = "AND Date BETWEEN '$year-$month-1' AND '$year-$month-31'"; } else if(isset($year)){ $dateCheck = "AND Date BETWEEN '$year-1-1' AND '$year-12-31'"; } } return DataObject::get("Page","`ParentID` = $this->ID AND ShowInMenus = 1 $dateCheck","`NewsPage`.Date DESC",'',"$start, $limit"); } } class NewsHolder_Controller extends Page_Controller { } ?> 'Date', "Author" => "Text" ); static $casting = array( "Date" => "Date" ); static $has_one = array( ); /** * overload so that the default date is today. */ public function populateDefaults(){ parent::populateDefaults(); $this->Date = date("d/m/Y H:i:s",time()); } /** * Ensures the most recent article edited on the same day is shown first. */ public function setDate($val){ $datepart = date("Y-m-d",strtotime($val)); $minutepart = date("H:i:s",time()); $date = $datepart . " " . $minutepart; return $this->setField("Date",$date); } function getCMSFields() { $fields = parent::getCMSFields(); $fields->removeFieldFromTab("Root.Content.Main","Content"); $fields->addFieldToTab("Root.Content.Main", new HTMLEditorField("Content", "Content", 20)); $fields->addFieldToTab("Root.Content.Main", new CalendarDateField("Date", "Date"),"Content"); $fields->addFieldToTab('Root.Content.Main', new TextField('Author'), 'Content'); return $fields; } function ParagraphSummary(){ $content = new Text('Content'); $content->value = Convert::html2raw($this->Content); return $content->FirstParagraph(); } } class NewsPage_Controller extends GeneralPage_Controller { } ?> doc-rt_menu | Digicrafts Flash Components for Carousel Menu, Cover Flow Gallery, Slideshow, FLV Player, Banner Rotator

Reference for RotationMenu

Method

Description

start() This function is use to start the menu. You can set the parameter in action script and use this function to start the menu.
getItems() To get the array of the menu item object.
getItemAt() To get the menu item object as specified ID..
nextItem() Tell the menu goto next item. This only work with enableMouseScroll set to false.
prevItem() Tell the menu goto prev item. This only work with enableMouseScroll set to false.
gotoItem() Tell the menu goto the item with ID. This only work with enableMouseScroll set to false.

 

RTMenuLite.getItems()

Availability Flash Player 8.

Edition Flash 8.

Usage RTMenuLite.getItems()

Returns Array; Object array of the menu items.

Description Method; get the Object array of the menu items.

Code Example :

var item_array = menu_mc.getItems();  
for(i=0;i<item_array.length;i++) {
trace(item_array.id);
}

 

RTMenuLite.getItemAt()

Availability Flash Player 8.

Edition Flash 8.

Usage RTMenuLite.getItemAt(id)

Parameters

id: Number: id of the menu item.

Returns MoiveClip; Object reference of the menu item.

Description Method; Get the object reference of the menu item by specified id.

Code Example :

for(i=0;i<item_max_id.length;i++) {         
var item_array = menu_mc.getItemAt(i);
trace(item_array.id); }

 

RTMenuLite.nextItem()

Availability Flash Player 8.

Edition Flash 8.

Usage RTMenuLite.nextItem()

Returns None

Description Method; Move to next item.

Code Example :

//Action Script in a button 
on(press) {
RTMenuLite_mc.nextItem();//Move to next item
}

 

RTMenuLite.prevItem()

Availability Flash Player 8.

Edition Flash 8.

Usage RTMenuLite.prevItem()

Returns None

Description Method; Move to previous item.

Code Example :

//Action Script in a button 
on(press) {
RTMenuLite_mc.prevItem();//Move to previous item
}

 

RTMenuLite.gotoItem()

Availability Flash Player 8.

Edition Flash 8.

Usage RTMenuLite.gotoItem(id)

Parameters

id: id number of each item. From left to right, 0 to item max.

Returns None

Description Method; Goto the item with specified id.

Code Example :

//Action Script in a button 
on(press) {
RTMenuLite_mc.gotoItem(10);//Goto the item with id 10
}

Event

Description

onItemClick()

Broadcast when mouse clicked on the item.

onItemRollOver() Broadcast when mouse over on the item.
onItemRollOut() Broadcast when mouse move outside the item after mouse over.
onItemSelected Broadcast when the item moved to the center (i.e. move to center mean selected).


Code Example :

//Define Event Listener Object 
var menuListener = new Object();
//Event for item clicked
menuListener.onItemPress= function(eventObj) {
trace(eventObj.selectedItem.id);//Ouput the id of the item
trace(eventObj.selectedItem.url);//Ouput the url of the item url array
trace(eventObj.selectedItem.target);//Ouput the target of the item target array
} //Event for roll over an item
menuListener .onItemRollOver = function(eventObj) {
trace(eventObj.selectedItem.id);//Ouput the id of the item }
//Event for roll out an item
menuListener.onItemRollOut = function(eventObj) {
trace(eventObj.selectedItem.id);//Ouput the id of the item
}

//Event when item selected (i.e. goto center)
menuListener.onItemSelected = function(eventObj) {
trace(eventObj.selectedItem.id);//Ouput the id of the item
}

//Add Event Listener
RTMenu_mc.addEventListener("onItemPress",menuListener );
RTMenu_mc.addEventListener("onItemRollOver",menuListener );
RTMenu_mc.addEventListener("onItemRollOut",menuListener );
RTMenu_mc.addEventListener("onItemSelected",menuListener );

Property

Type

Description

Default Value

Possible Value

autoStart
Boolean
The parameter determine if you want the menu to autostart.
true
true/false
blurEffect
Boolean
The parameter determine where the blur effect active or not. This effect is only supported in Flash Player version 8+.
true
true/false
enableGetUrl Boolean Enable/disable getURL action of the items .
false
true/false
enableItemEvent Boolean Enable/disable events of the items .
true
true/false
enableMouseScroll Boolean Enable/disable mouse scrolling.
true
true/false
globalScale
Number
Specfiy the scale of the item appear in the menu relative to it's orginal size.
1
Number > 1
fcLink String Instance name of other component which supported fcLINK. (needed to set in component inspector)   Any instance name, _root.abc_mc or _parent.xyz_mc
instanceNameArray
Array
A array define the identifier name array of the symbols which use for create the menu.
[]
Any string
itemLinkArray
Array
A array define the url link for each item in the menu. If you don't want the menu item appeared as a link or you want to define your action in your item, leave this array blank.
[]
Any valid URL,
product.html or other vaild url
itemLinkTargetArray
Array
A array define the url link traget for each item in the menu. If you don't want the menu item appeared as a link or you want to define your action in your item, leave this array blank.
[]
_blank, _self, _parent, or other name
menuAlignment
String
Determine the alighment of the menu item. The item can be align for top, middle or bottom.
middle
top / middle / bottom
menuOrientation
String
Determine the orientation of the rotation menu. The menu can be in horizontal or vertical.
horizontal
horizontal / vertical
mirrorEffect
Boolean
The parameter determine where the mirror effect active or not. This effect is only supported in Flash Player version 8+.
true
true/false
perspectiveScaling
Boolean
The parameter determine where the perpective scaling effect active or not.
true
true/false
perspectiveTransform
Boolean
The parameter determine where the perpective transform effect active or not.
true
true/false
rotationDirection
String
The parameter determine where the behaviour of the menu to the mouse gesture.
Opposite Mouse
Opposite Mouse / Follow Mouse
rotationSpeed
Number
The parameter determine where the perpective transform effect active or not. This parameter accepts values from 1 to 100.
50
1 - 150
rotationSpeedLimit
Number
The parameter determine the speed limit of the rotation. The speed is measured in angle rotated per frame.
10
1 - 360
enabled
Boolean
Determines whether the component is enabled or not.
true
true
visible
Boolean
Determines the visibility of the component.
true
true
 
Item Parameter Name Description
1 autoStart The parameter determine if you want the menu to autostart when load.
2 menuOrientation Determine the orientation of the rotation menu. The menu can be in horizontal or vertical.
3 menuAlignment Determine the alighment of the menu item. The item can be align to top, middle or bottom.
4 globalScale Specfiy the scale of the item appear in the menu relative to it's orginal size.
5 instanceNameArray A array define the identifier name array of the symbols which use for create the menu.
6 itemLinkArray A array define the url link for each item in the menu. If you don't want the menu item appeared as a link or you want to define your action in your item, leave this array blank.
7 itemLinkTargetArray A array define the url link traget for each item in the menu. If you don't want the menu item appeared as a link or you want to define your action in your item, leave this array blank.
8 blurEffect The parameter determine where the blur effect active or not. This effect is only supported in Flash Player version 8+.
9 perspectiveScaling The parameter determine where the perpective scaling effect active or not.
10 mirrorEffect The parameter determine where the mirror effect active or not. This effect is only supported in Flash Player version 8+.
11 perspectiveTransform The parameter determine where the perpective transform effect active or not.
     
 
Item Parameter Name Description
1 enableItemEvent Enable/disable events of the items .
2 enableGetUrl Enable/disable getURL action of the items .
3 enableMouseScroll Enable/disable mouse scrolling.
4 rotationSpeed The parameter determine where the perpective transform effect active or not. This parameter accepts values from 1 to 100.
5 rotationSpeedLimit The parameter determine the speed limit of the rotation. The speed is measured in angle rotated per frame.
6 enabled Determines whether the component is enabled or not.
7 fcLink Instance name of other component which supported fcLINK. (needed to set in component inspector)