"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-rotation_menu3d_cs | Digicrafts Flash Components for Carousel Menu, Cover Flow Gallery, Slideshow, FLV Player, Banner Rotator

Reference for PageTurn 3D CS

Method

Description

gotoItem()

Move to item with specify item index. Start with zero.

(Work only when mouse scroll disabled)

nextItem()

Move to next item.

(Work only when mouse scroll disabled)

prevItem()

Move to previous item.

(Work only when mouse scroll disabled)

load()Load xml source.
start() Start the book.
stop() Stop the book.

 

RotationMenu3D.gotoItem()

Availability Flash Player 9.

Edition Flash CS3.

Usage RotationMenu3D.gotoItem(index)

Parameters

index: index of the page. Start from zero

Returns None

Description Method; Move to page with specify index.

Code Example :

RotationMenu3D_mc.gotoItem(10); //goto item with index 10

 

RotationMenu3D.nextItem()

Availability Flash Player 9.

Edition Flash CS3.

Usage RotationMenu3D.nextItem()

Returns None

Description Method; Move to next page.

Code Example :

RotationMenu3D_mc.nextItem();

 

RotationMenu3D.prevItem()

Availability Flash Player 9.

Edition Flash CS3.

Usage RotationMenu3D.prevItem()

Returns None

Description Method; Move to previous page.

Code Example :

RotationMenu3D_mc.prevItem();

 

RotationMenu3D.load()

Availability Flash Player 9.

Edition Flash CS3.

Usage RotationMenu3D.load(xml)

Parameters

xml: URL of external xml file. Or XML object.

Returns None

Description Method; Load the xml source and setup RotationMenu3D

Code Example :

//Load the source xml named books.xml.  
RotationMenu3D_mc.load("books.xml");

 

RotationMenu3D.start()

Availability Flash Player 9.

Edition Flash CS3.

Usage RotationMenu3D.start()

Returns None

Description Method; Start the component if xml is loaded and the component not started yet.

Code Example :

//Load the xml 
RotationMenu3D_mc.load("photo.xml");
//Start
RotationMenu3D_mc.start();

 

RotationMenu3D.stop()

Availability Flash Player 9.

Edition Flash CS3.

Usage RotationMenu3D.start()

Returns None

Description Method; Stop the component when the component is in started state.

Code Example :


RotationMenu3D_mc.stop();

To use event, you need to import the library:

import com.digicrafts.events.*;

Event

Object

Description

itemClickItemEvent.CLICK

Broadcast when mouse clicked on the item.

itemMouseOverItemEvent.MOUSE_OVERBroadcast when mouse over on the item.
itemMouseOutItemEvent.MOUSE_OUTBroadcast when mouse move outside the item after mouse over.
completeItemEvent.COMPLETEBroadcast when the all buffer images loaded.
selectItemEvent.SELECT Broadcast when the item move to center.
popupOpen ItemEvent.OPEN Broadcast when the popup opened.
popupClose ItemEvent.CLOSE Broadcast when the closed after open.


Code Example :

import com.digicrafts.events.*;    
function itemH(event:ItemEvent):void {
switch(event.type) {
//Mouse Over Event
case ItemEvent.MOUSE_OVER:
//do something when mouse over an item
//You can get the item item by
trace(event.index);
//You can get the data object by
trace(event.item);
// You can get parameter inside data object by
trace(event.item.source);
trace(event.item.title);
trace(event.item.description);
trace(event.item.link);
trace(event.item.width);
trace(event.item.height);
break;
//Mouse Out Event
case ItemEvent.MOUSE_OUT:
//do something when mouse out an item
break;
//Mouse Click Event
case ItemEvent.CLICK:
//do something when mouse click an item
break;
//Thumbnail Move Complete
case ItemEvent.SELECT:
//do something when the thumbnail move to center
break;
}
}
menu_mc.addEventListener(ItemEvent.MOUSE_OVER,itemH);
menu_mc.addEventListener(ItemEvent.MOUSE_OUT,itemH);
menu_mc.addEventListener(ItemEvent.CLICK,itemH);
menu_mc.addEventListener(ItemEvent.SELECT,itemH);

Property

Type

Description

Default Value

Possible Value

dataProvider
DataProvider
Get the DataProvider for the components 
sourceString The path to the xml generate by Photoshop Web Gallery Function, Flickr rss, Youtube rss, or custom xml.
photo/photos.xml
url to the xml file
bufferCount Number The number of image buffer before start. ( -1 = Load all images) -1 Positive Number
useThumbnailBooleanDetermine the use of thumbnail image in the xml source as image. truetrue/false
proxyStringThe proxy script for cross domain issue.  url to the proxy script
autostartBooleanEnable auto start when xml and image loaded
true
true/false
itemWidthNumber The width of each item. This value is the actual value when zoom. 200 Positive Number
itemHeightNumber The height of each item. This value is the actual value when zoom. 200 Positive Number
radius Number The radius of the rotation menu 800 Positive Number
itemDepth Number The default depth of each item. 200 Positive Number
cameraAngle Number Angle pan for the camera view 20 -45 - 45
cameraZoom Number Set the camera zoom value. 1 Positive Number
itemMirror Number Value of mirror effect .5 0 - 1
itemShadow Number Value of shadow effect .5 0 - 1
itemAlphaNumber Value of depth of field alpha effect. .5 0 - 1
transitionTimeNumberThe transition time of the animation. ( in seconds)1 secPositive Number
transitionTypeStringThe transition type of the animation.easeOutSineAny String
keyboardControlEnabledBooleanEnable/Disable the keyboard control.truetrue/false
touchScrollDirection Boolean Enable/Disable the reverse touch scroll control. true true/false
touchScrollEnabledBooleanEnable/Disable the touch scroll control.truetrue/false
mouseScrollDirection Boolean Enable/Disable the reverse mouse scroll control. true true/false
mouseScrollEnabled Boolean Enable/Disable the touch mouse control. false true/false
wheelScrollEnabledBooleanEnable/Disable the mouse wheel control.truetrue/false
itemClickActionStringDetermine the action do when mouse click on the items. "GOTO,POPUP" "POPUP,GETURL,GOTO"
nextButtonTargetNameStringThe instance name of Button/SimpleButton use to control the move to next item Any instance name of Button/ SimpleButton
prevButtonTargetNameStringThe instance name of Button/SimpleButton use to control the move to previous item Any instance name of Button/ SimpleButton
scrollBarTargetNameStringThe instance name of UIScrollbar/Slider use to control the menu movement Any instance name of Button/ SimpleButton
loaderSkinStringThe class name use of the skin for the loading animation  Any class name of movieclip symbol

Read Only Properties

Property

Type

Description

started Boolean Determine about the components if it is started.
length Number Length of the current datasource.
Item Parameter Name Description
1 source The path to the xml generate by Photoshop Web Gallery Function, Flickr rss or Youtube rss.
2 useThumbnail Enable/disable using thumbnail image defined in the xml for image source.
3 autostart Enable auto start when xml and image loaded
4 proxy The proxy script for cross domain issue.
5 bufferCount The number of image buffer before start. ( -1 = Load all images)

 

Item Parameter Name Description
1   Position Setting
2   Dimension Setting
3 radius Radius of the rotation menu.
4 cameraAngle Angle of view of the camera.
5 cameraZoom Camera zoom value.
6 itemLockOrientation Lock the orientation of the items.

 

Item Parameter Name Description
1 itemWidth The prefered width of each item
2 itemHeight The prefered height of each item
3 itemDepth The prefered depth of each item
4 itemBaseColor Set the base color of item.
5-9 defaultMaterial Set the default material for the item. The items will use these materila if no material specify in the xml. Format of the object { back:"xxx.jpg", top:"xxx.jpg", bottom:"xxx.jpg", left:"xxx.jpg", right:"xxx.jpg"}

 

Item Parameter Name Description
1 itemOverAction Enable/disable glow effect when mouse over.
2 itemOverColor Set the color of glow when mouse over.
3 itemOverColorSize Set the size of color glow when mouse over.
4 itemClickAction Enable/disable getURL action when click on item. Default will link to the image. It will link to url specify in xml <link> tag if <link> is not empty .
5 This enable item goto center when click on item.
6 This enable item popup when click on item.
7 popupMotion Set the rotation of popup item.
8 Set the scale of popup item.
9 transitionType The transition type of the animation.
10 transitionTime The transition time of the animation. ( in seconds)

 

 

Item Parameter Name Description
1 keyboardControlEnabled Enable/Disable the keyboard control.
2 touchScrollEnabled Enable/Disable the touch scroll control.
3 touchScrollDirection Enable/Disable revers direction of touchscroll
4 wheelScrollEnabled Enable/Disable the mouse wheel control.
5 mouseScrollEnabled Enable/Disable the mouse over scrollcontrol.
6    
7 nextButtonTargetName The instance name of Button/SimpleButton use to control the move to next item
6 prevButtonTargetName The instance name of Button/SimpleButton use to control the move to previous item
9 scrollBarTargetName The instance name of UIScrollbar/Slider use to control the menu movement

 

Item Parameter Name Description
1 itemAlpha The value of alpha effect for the side item.
2 itemShadow The value of shadow effect.
3 itemMirror The value of mirror effect.
4 loaderSkin The class name use of the skin for the loading animation