getHTML($record); if($text) $items .= $text; $newMessage = $obj->getMessage($record); if($newMessage) $message = $newMessage; } return array( 'items' => $items, 'message' => $message ); } } /** * Navigator items are links that appear in the $SilverStripeNavigator bar. * To add an item, extends this class. * * @package cms * @subpackage content */ class SilverStripeNavigatorItem extends Object { function getHTML($controller) {} function getMessage($controller) {} } /** * @package cms * @subpackage content */ class SilverStripeNavigatorItem_CMSLink extends SilverStripeNavigatorItem { static $priority = 10; function getHTML($controller) { if(is_a(Controller::curr(), 'CMSMain')) { return 'CMS'; } else { $cmsLink = 'admin/show/' . $controller->ID; $cmsLink = "". _t('ContentController.CMS', 'CMS') .""; return $cmsLink; } } function getLink($page) { if(is_a(Controller::curr(), 'CMSMain')) { return Controller::curr()->AbsoluteLink() . 'show/' . $page->ID; } } } /** * @package cms * @subpackage content */ class SilverStripeNavigatorItem_StageLink extends SilverStripeNavigatorItem { static $priority = 20; function getHTML($controller) { if(Versioned::current_stage() == 'Stage' && !(ClassInfo::exists('SiteTreeFutureState') && SiteTreeFutureState::get_future_datetime())) { return "". _t('ContentController.DRAFTSITE', 'Draft Site') .""; } else { $thisPage = $controller->Link(); return "". _t('ContentController.DRAFTSITE', 'Draft Site') .""; } } function getMessage($controller) { if(Versioned::current_stage() == 'Stage') { return "
"; } } } /** * @package cms * @subpackage content */ class SilverStripeNavigatorItem_LiveLink extends SilverStripeNavigatorItem { static $priority = 30; function getHTML($controller) { if(Versioned::current_stage() == 'Live') { return "". _t('ContentController.PUBLISHEDSITE', 'Published Site') .""; } else { $thisPage = $controller->Link(); return "". _t('ContentController.PUBLISHEDSITE', 'Published Site') .""; } } function getMessage($controller) { if(Versioned::current_stage() == 'Live') { return " "; } } } /** * @package cms * @subpackage content */ class SilverStripeNavigatorItem_ArchiveLink extends SilverStripeNavigatorItem { static $priority = 40; function getHTML($controller) { if(Versioned::current_archived_date()) { return "". _t('ContentController.ARCHIVEDSITE', 'Archived Site') .""; } } function getMessage($controller) { if($date = Versioned::current_archived_date()) { $dateObj = Object::create('Datetime', $date, null); return " "; } } } ?>