- Symphony 2.2.2
-
› assets
11 -
› boot
9 -
› core
22 -
› email-gateways
3 -
› toolkit
67 -
› Unknown
33 - Delegates87
- Deprecated30
Versions
- 2.7.9
- 2.7.8
- 2.7.7
- 2.7.6
- 2.7.5
- 2.7.3
- 2.7.2
- 2.7.10
- 2.7.1
- 2.7.0
- 2.6.9
- 2.6.8
- 2.6.7
- 2.6.6
- 2.6.5
- 2.6.4
- 2.6.3
- 2.6.2
- 2.6.11
- 2.6.10
- 2.6.1
- 2.6.0
- 2.5.3
- 2.5.2
- 2.5.1
- 2.5.0
- 2.4
- 2.3.6
- 2.3.5
- 2.3.4
- 2.3.3
- 2.3.2
- 2.3.1
- 2.3
- 2.2.5
- 2.2.4
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2
Options
Page HTMLPage AdministrationPage
public class AdministrationPage extends HTMLPage
class.administrationpage.php #18The AdministrationPage class represents a Symphony backend page. It extends the HTMLPage class and unlike the Frontend, is generated using a number XMLElement objects. Instances of this class override the view, switchboard and action functions to construct the page. These functions act as pseudo MVC, with the switchboard being controller, and the view/action being the view.
Properties
Alert $Alert
An instance of the Alert class. Used to display page level messages to Symphony users.
XMLElement $Contents
A <div>
that contains the content of a Symphony backend page.
XMLElement $Header
A <div>
that contains the header of a Symphony backend page, which
typically contains the Site title and the navigation.
XMLElement $Wrapper
As the name suggests, a <div>
that holds the following $Header
,
$Contents
and $Footer
.
Administration $_Parent
An instance of the Administration class
See Also
array $_context
An associative array describing this pages context. This can include the section handle, the current entry_id, the page name and any flags such as 'saved' or 'created'. This variable often provided in delegates so extensions can manipulate based off the current context or add new keys.
Methods
void __construct(Administration $parent)
Constructor takes the Administration instance and sets it
to be the $this->_Parent
. Calls the parent constructor to set up
the basic HTML, Head and Body XMLElements. This function
also sets the XMLElement type to be HTML, instead of XML
Parameters
array __fetchAvailablePageTypes(XMLElement $wrapper)
$context,
Returns all the page types that exist in this Symphony install. There are 5 default system page types, and new types can be added by Developers via the Page Editor.
Returns
An array of strings of the page types used in this Symphony install. At the minimum, this will be an array with the values 'index', 'XML', 'admin', '404' and '403'.
void __switchboard(
$type)
The __switchboard
function acts as a controller to display content
based off the $type. By default, the $type
is 'view' but it can be set
also set to 'action'. The $type
is prepended by __ and the context is
append to the $type to create the name of the function that will provide
that logic. For example, if the $type was action and the context of the
current page was new, the resulting function to be called would be named
__actionNew()
. If an action function is not provided by the Page, this function
returns nothing, however if a view function is not provided, a 404 page
will be returned.
Parameters
void action()
This function is called when $_REQUEST
contains a key of 'action'.
Any logic that needs to occur immediately for the action to complete
should be contained within this function. By default this calls the
__switchboard
with the type set to 'action'.
See Also
void appendAlert()
If $this->Alert
is set, it will be prepended to the Form of this page.
A delegate is fired here to allow extensions to provide their
their own Alert messages to the page. Note that only one Alert
is allowed per page at any one time.
Uses
void appendSubheading(
$value, $html)
Appends the heading of this Symphony page to the Form element.
If a link is provided, it will be append to $value
Parameters
void build(
$context)
This function initialises a lot of the basic elements that make up a Symphony
backend page such as the default stylesheets and scripts, the navigation and
the footer. Any alerts are also appended by this function. view() is called to
build the actual content of the page. Delegates fire to allow extensions to add
elements to the <head>
and footer.
Uses
Parameters
See Also
boolean canAccessPage(
$context)
Checks the current Symphony Author can access the current page. This includes the check to ensure that an Author cannot access a hidden section.
Returns
True if the Author can access the current page, false otherwise
string generate()
Appends the $this->Header
, $this->Contents
and $this->Footer
to $this->Wrapper
before adding the ID and class attributes for
the <body>
element. After this has completed the parent's generate
function is called which will convert the XMLElement
's into strings
ready for output
See Also
void pageAlert(
$message, $type)
Sets this page's $Alert
to an instance of the Alert class of a
given Alter type. Unless the Alert is an Error, it is required
the a message be passed to this function.
Parameters
void setBodyClass(
$class)
Setter function to set the class attribute on the <body>
element.
This function will respect any previous classes that have been added
to this <body>
Parameters
void setPageType(
$type)
Adds either the tables or forms stylesheet to the page. By default
this is forms, but can be override by passing 'table' to the function.
The stylesheets reside in the ASSETS
folder
Parameters
void view()
Called to build the content for the page. This function immediately calls
__switchboard()
which acts a bit of a controller to show content based on
off a type, such as 'view' or 'action'. AdministrationPages
can override this
function to just display content if they do not need the switchboard functionality
See Also
void wrapFormElementWithError(XMLElement $element, $message)
Will wrap a <div>
around a desired element to trigger the default
Symphony error styling.
Parameters
See Also
Deprecated
This function is deprecated and will be removed in the next version of Symphony. This preferred way to wrap an element with an error is using Widget::wrapFormElementWithError