Comments: on this page. Click to read or post your own.

Class LeftAndMain

Description

LeftAndMain is the parent class of all the two-pane views in the CMS.

If you are wanting to add more areas to the CMS, you can do it by subclassing LeftAndMain.

This is essentially an abstract class which should be subclassed. See CMSMain for a good example.

Located in /cms/code/LeftAndMain.php (line 12)

Object
   |
   --ViewableData
      |
      --RequestHandlingData
         |
         --Controller
            |
            --LeftAndMain
Direct descendents
Class Description
CommentAdmin Comment administration system within the CMS
SecurityAdmin Security section of the CMS
GenericDataAdmin Provides a common interface for searching, viewing and editing DataObjects.
ReportAdmin Reports section of the CMS.
AssetAdmin AssetAdmin is the 'file store' section of the CMS.
CMSMain The main "content" area of the CMS.
ModelAdmin Generates a three-pane UI for editing model classes, with an automatically generated search panel, tabular results and edit forms.
Variable Summary
static mixed $allowed_actions
static mixed $application_link
static unknown_type $application_logo
static String $application_logo_style
static String $application_logo_text
static String $application_name
static array $extra_requirements
static mixed $ForceReload
static mixed $loading_image
static array $menu_items
static mixed $tree_class
Method Summary
static boolean add_menu_item (string $code, string $menuTitle, string $url, [string $controllerClass = null])
static void clear_menu ()
static void ForceReload ()
static array get_menu_item (string $code)
static array get_menu_items ()
static void populate_default_menu ()
static void remove_menu_item (string $code)
static boolean replace_menu_item (string $code, string $menuTitle, string $url, [string $controllerClass = null])
static void require_css ($file $file, [$media $media = null])
static void require_javascript ( $file)
static void require_themed_css ($name $name, [$media $media = null])
static void setApplicationName ( $name, [ $logoText = null], [ $link = null])
static void setLogo (String $logo, String $logoStyle)
static void set_loading_image ( $loadingImage)
void addTreeNodeJS ( $page, [ $select = false])
void ajaxupdatesort ()
void ApplicationLink ()
void callPageMethod ( $data,  $form)
void canAccessCMS ()
void canAdminCMS ()
void CMSVersion ()
void currentPage ()
void currentPageID ()
void deleteitems ()
void deleteTreeNodeJS ( $page)
void EditForm ()
void EditorToolbar ()
void getActionUpdateJS ( $record)
String getApplicationName ()
void getitem ()
void getLastFormIn ( $html)
void getRecord ( $id, [ $className = null])
void getSiteTreeFor ( $className, [ $rootID = null])
void getsubtree ()
void getTemplatesWithSuffix ( $suffix)
void init ()
void isCurrentPage ( $page)
void Left ()
string Link ()
void LoadingImage ()
void LogoStyle ()
void MceRoot ()
void myprofile ()
void printable ()
void returnItemToUser ( $p)
void Right ()
void RightBottom ()
void save ( $urlParams,  $form)
void SectionTitle ()
void setCurrentPageID ( $id)
void show ( $params)
Variables
static mixed $allowed_actions = array(
'ajaxupdateparent',
'ajaxupdatesort',
'callPageMethod',
'deleteitems',
'getitem',
'getsubtree',
'myprofile',
'printable',
'save',
'show',
'Member_ProfileForm',
'EditorToolbar',
'EditForm',

)
(line 27)

Redefinition of:
Controller::$allowed_actions

Redefined in descendants as:
static mixed $application_link = "http://www.silverstripe.com/" (line 861)

Set the application name, and the logo text.

static unknown_type $application_logo = 'cms/images/mainmenu/logo.gif' (line 905)

The application logo path. Customisable by calling LeftAndMain::setLogo() - the first parameter.

static String $application_logo_style = '' (line 913)

The application logo style. Customisable by calling LeftAndMain::setLogo() - the second parameter.

static String $application_logo_text = 'SilverStripe' (line 853)

The application logo text. Customisable by calling LeftAndMain::setApplicationName() - the second parameter.

static String $application_name = 'SilverStripe CMS' (line 845)

The application name. Customisable by calling LeftAndMain::setApplicationName() - the first parameter.

static array $extra_requirements = array(
'javascript' => array(),'css'=>array(),'themedcss'=>array(),)
(line 51)

Register additional requirements through the class.

Used mainly to work around the missing "lazy loading" functionality for getting css/javascript required after an ajax-call (e.g. loading the editform).

  • access: protected
static mixed $ForceReload (line 25)
static mixed $loading_image = 'cms/images/loading.gif' (line 928)
  • access: protected
static array $menu_items = array() (line 23)

Default menu items for the core cms functionality, set in cms/_config.php.

  • access: protected
static mixed $tree_class = null (line 14)

Redefined in descendants as:

Inherited Variables

Inherited from Controller

Controller::$action
Controller::$baseInitCalled
Controller::$basicAuthEnabled
Controller::$controller_stack
Controller::$request
Controller::$requestParams
Controller::$response
Controller::$session
Controller::$urlParams
Controller::$url_handlers

Inherited from ViewableData

ViewableData::$casting
ViewableData::$castingHelperPair_cache
ViewableData::$customisedObj
ViewableData::$failover
ViewableData::$iteratorPos
ViewableData::$iteratorTotalItems
ViewableData::$namedAs
ViewableData::$parent
ViewableData::$_natural_cache
ViewableData::$_object_cache
ViewableData::$_xml_cache

Inherited from Object

Object::$builtInMethods
Object::$class
Object::$classConstructed
Object::$extensions
Object::$extension_instances
Object::$extraMethods
Object::$extraStatics
Object::$statics
Object::$static_cached
Methods
static method add_menu_item (line 1017)

Add a navigation item to the main administration menu showing in the top bar.

  • return: Success
  • access: public
static boolean add_menu_item (string $code, string $menuTitle, string $url, [string $controllerClass = null])
  • string $code: Unique identifier for this menu item (e.g. used by replace_menu_item() and remove_menu_item. Also used as a CSS-class for icon customization.
  • string $menuTitle: Localized title showing in the menu bar
  • string $url: A relative URL that will be linked in the menu bar. Make sure to add a matching route via Director::addRules() to this url.
  • string $controllerClass: The controller class for this menu, used to check permisssions. If blank, it's assumed that this is public, and always shown to users who have the rights to access some other part of the admin area.
static method clear_menu (line 1073)

Clears the entire menu

  • access: public
static void clear_menu ()
static method ForceReload (line 629)

Sets a static variable on this class which means the panel will be reloaded.

static void ForceReload ()
static method get_menu_item (line 1039)

Get a single menu item by its code value.

  • access: public
static array get_menu_item (string $code)
  • string $code
static method get_menu_items (line 1049)

Get all menu entries.

  • access: public
static array get_menu_items ()
static method populate_default_menu (line 964)

Generate the default entries for the CMS main menu.

  • access: public
static void populate_default_menu ()
static method remove_menu_item (line 1058)

Removes an existing item from the menu.

  • access: public
static void remove_menu_item (string $code)
  • string $code: Unique identifier for this menu item
static method replace_menu_item (line 1094)

Replace a navigation item to the main administration menu showing in the top bar.

  • return: Success
  • access: public
static boolean replace_menu_item (string $code, string $menuTitle, string $url, [string $controllerClass = null])
  • string $code: Unique identifier for this menu item (e.g. used by replace_menu_item() and remove_menu_item. Also used as a CSS-class for icon customization.
  • string $menuTitle: Localized title showing in the menu bar
  • string $url: A relative URL that will be linked in the menu bar. Make sure to add a matching route via Director::addRules() to this url.
  • string $controllerClass: The controller class for this menu, used to check permisssions. If blank, it's assumed that this is public, and always shown to users who have the rights to access some other part of the admin area.
static method require_css (line 1125)

Register the given stylesheet file as required.

static void require_css ($file $file, [$media $media = null])
  • $file $file: String Filenames should be relative to the base, eg, THIRDPARTY_DIR . '/tree/tree.css'
  • $media $media: String Comma-separated list of media-types (e.g. "screen,projector")
static method require_javascript (line 1114)

Register the given javascript file as required in the CMS.

Filenames should be relative to the base, eg, SAPPHIRE_DIR . '/javascript/loader.js'

  • access: public
static void require_javascript ( $file)
  • $file
static method require_themed_css (line 1137)

Register the given "themeable stylesheet" as required.

Themeable stylesheets have globally unique names, just like templates and PHP files. Because of this, they can be replaced by similarly named CSS files in the theme directory.

static void require_themed_css ($name $name, [$media $media = null])
  • $name $name: String The identifier of the file. For example, css/MyFile.css would have the identifier "MyFile"
  • $media $media: String Comma-separated list of media-types (e.g. "screen,projector")
static method setApplicationName (line 862)
static void setApplicationName ( $name, [ $logoText = null], [ $link = null])
  • $name
  • $logoText
  • $link
static method setLogo (line 922)

Set the CMS application logo.

static void setLogo (String $logo, String $logoStyle)
  • String $logo: Relative path to the logo
  • String $logoStyle: Custom CSS styles for the logo e.g. "border: 1px solid red; padding: 5px;"
static method set_loading_image (line 933)

Set the image shown when the CMS is loading.

static void set_loading_image ( $loadingImage)
  • $loadingImage
addTreeNodeJS (line 602)

Return JavaScript code to generate a tree node for the given page, if visible

  • access: public
void addTreeNodeJS ( $page, [ $select = false])
  • $page
  • $select
ajaxupdateparent (line 636)

Ajax handler for updating the parent of a tree node

  • access: public
void ajaxupdateparent ()
ajaxupdatesort (line 677)

Ajax handler for updating the order of a number of tree nodes

$_GET[ID]: An array of node ids in the correct order $_GET[MovedNodeID]: The node that actually got moved

  • access: public
void ajaxupdatesort ()
ApplicationLink (line 883)
void ApplicationLink ()
callPageMethod (line 955)

Use this as an action handler for custom CMS buttons.

void callPageMethod ( $data,  $form)
  • $data
  • $form
canAccessCMS (line 230)

Returns true if the current user can access the CMS

void canAccessCMS ()
canAdminCMS (line 246)

Returns true if the current user has administrative rights in the CMS

void canAdminCMS ()
CMSVersion (line 806)

Return the version number of this application

  • access: public
void CMSVersion ()
currentPage (line 785)
  • access: public
void currentPage ()
currentPageID (line 769)
  • access: public
void currentPageID ()

Redefined in descendants as:
deleteitems (line 724)

Delete a number of items

  • access: public
void deleteitems ()

Redefined in descendants as:
deleteTreeNodeJS (line 616)

Return JavaScript code to remove a tree node for the given page, if it exists.

  • access: public
void deleteTreeNodeJS ( $page)
  • $page
EditForm (line 739)
  • access: public
void EditForm ()

Redefined in descendants as:
EditorToolbar (line 799)

Return the CMS's HTML-editor toolbar

  • access: public
void EditorToolbar ()
getActionUpdateJS (line 585)

Return a piece of javascript that will update the actions of the main form

  • access: public
void getActionUpdateJS ( $record)
  • $record
getApplicationLogoText (line 880)

Get the application logo text.

String getApplicationLogoText ()
getApplicationName (line 872)

Get the application name.

String getApplicationName ()
getitem (line 278)
  • access: public
void getitem ()
getLastFormIn (line 287)
  • access: public
void getLastFormIn ( $html)
  • $html
getRecord (line 369)
  • access: public
void getRecord ( $id, [ $className = null])
  • $id
  • $className

Redefined in descendants as:
getSiteTreeFor (line 374)
void getSiteTreeFor ( $className, [ $rootID = null])
  • $className
  • $rootID
getsubtree (line 404)
  • access: public
void getsubtree ()

Redefined in descendants as:
getTemplatesWithSuffix (line 347)

Return a list of appropriate templates for this class, with the given suffix

  • access: protected
void getTemplatesWithSuffix ( $suffix)
  • $suffix
init (line 57)
void init ()

Redefinition of:
Controller::init()
Initialisation function that is run before any action on the controller is called.

Redefined in descendants as:
isCurrentPage (line 792)
  • access: public
void isCurrentPage ( $page)
Left (line 356)
  • access: public
void Left ()
Link (line 259)

You should implement a Link() function in your subclass of LeftAndMain, to point to the URL of that particular controller.

  • access: public
string Link ()

Redefined in descendants as:
LoadingImage (line 937)
void LoadingImage ()
LogoStyle (line 941)
void LogoStyle ()
MainMenu (line 301)

Returns the main menu of the CMS. This is also used by init() to work out which sections the user has access to.

  • access: public
DataObjectSet MainMenu ()
MceRoot (line 948)

Return the base directory of the tiny_mce codebase

void MceRoot ()
Member_ProfileForm (line 751)
  • access: public
void Member_ProfileForm ()
myprofile (line 744)
  • access: public
void myprofile ()
printable (line 755)
  • access: public
void printable ()
returnItemToUser (line 413)

Allows you to returns a new data object to the tree (subclass of sitetree) and updates the tree via javascript.

  • access: public
void returnItemToUser ( $p)
  • $p

Redefined in descendants as:
Right (line 359)
  • access: public
void Right ()
RightBottom (line 362)
  • access: public
void RightBottom ()
save (line 440)

Save and Publish page handler

  • access: public
void save ( $urlParams,  $form)
  • $urlParams
  • $form

Redefined in descendants as:
SectionTitle (line 890)

Return the title of the current section, as shown on the main menu

void SectionTitle ()
setCurrentPageID (line 781)
  • access: public
void setCurrentPageID ( $id)
  • $id
show (line 263)
  • access: public
void show ( $params)
  • $params

Redefined in descendants as:

Inherited Methods

Inherited From Controller

Controller::AbsoluteLink()
Controller::can()
Controller::curr()
Controller::currentController()
Controller::CurrentMember()
Controller::defaultAction()
Controller::disableBasicAuth()
Controller::getAction()
Controller::getFormOwner()
Controller::getRequest()
Controller::getResponse()
Controller::getSession()
Controller::getURLParams()
Controller::getViewer()
Controller::handleAction()
Controller::handleRequest()
Controller::has_curr()
Controller::init()
Controller::isAjax()
Controller::join_links()
Controller::LinkTo()
Controller::Now()
Controller::PastMember()
Controller::PastVisitor()
Controller::popCurrent()
Controller::pushCurrent()
Controller::redirect()
Controller::redirectedTo()
Controller::render()
Controller::setSession()
Controller::setURLParams()

Inherited From RequestHandlingData

RequestHandlingData::checkAccessAction()
RequestHandlingData::getRequest()
RequestHandlingData::handleRequest()
RequestHandlingData::httpError()

Inherited From ViewableData

ViewableData::ATT_val()
ViewableData::BaseHref()
ViewableData::buildCastingHelperCache()
ViewableData::cachedCall()
ViewableData::castingHelper()
ViewableData::castingHelperPair()
ViewableData::castingObjectCreator()
ViewableData::castingObjectCreatorPair()
ViewableData::CSSClasses()
ViewableData::CurrentMember()
ViewableData::CurrentPage()
ViewableData::customise()
ViewableData::Debug()
ViewableData::defineMethods()
ViewableData::escapeTypeForField()
ViewableData::Even()
ViewableData::EvenOdd()
ViewableData::First()
ViewableData::FirstLast()
ViewableData::getField()
ViewableData::getIterator()
ViewableData::getXMLValues()
ViewableData::hasField()
ViewableData::HasPerm()
ViewableData::hasValue()
ViewableData::i18nLocale()
ViewableData::IsAjax()
ViewableData::iteratorProperties()
ViewableData::JS_val()
ViewableData::Last()
ViewableData::Me()
ViewableData::Middle()
ViewableData::MiddleString()
ViewableData::obj()
ViewableData::Odd()
ViewableData::Pos()
ViewableData::RAW_val()
ViewableData::renderWith()
ViewableData::SecurityID()
ViewableData::setCustomisedObj()
ViewableData::setField()
ViewableData::SQL_val()
ViewableData::ThemeDir()
ViewableData::Top()
ViewableData::TotalItems()
ViewableData::val()
ViewableData::XML_val()
ViewableData::__get()
ViewableData::__isset()
ViewableData::__set()

Inherited From Object

Object::__construct()
Object::addMethodsFrom()
Object::addStaticVars()
Object::addWrapperMethod()
Object::add_extension()
Object::allMethodNames()
Object::buildMethodList()
Object::cacheToFile()
Object::cacheToFileWithArgs()
Object::create()
Object::createMethod()
Object::defineMethods()
Object::exists()
Object::extend()
Object::extInstance()
Object::getCustomClass()
Object::hasExtension()
Object::hasMethod()
Object::invokeWithExtensions()
Object::is_a()
Object::loadCache()
Object::parentClass()
Object::sanitiseCachename()
Object::saveCache()
Object::set_stat()
Object::set_uninherited()
Object::stat()
Object::strong_create()
Object::uninherited()
Object::useCustomClass()
Object::__call()
Object::__toString()
blog comments powered by Disqus

Documentation generated on Tue, 07 Oct 2008 15:58:28 +1300 by phpDocumentor 1.3.2