DLCleanAdmin

Manage the clean admin site.

Summary
DLCleanAdminManage the clean admin site.
Member Data
$default_content(string) The default content of the default page.
$pagesAn associative array containing the pages in this clean admin site.
Class Construction
__constructCreate a new clean admin site.
Output
OutputAsAJAXOutput the given data so that it can be read by JavaScript.
OutputSiteOutput the site but outputting the index page.
Page Management
AddPageAdd a new page to the clean admin site.
GetBreadcrumbRetrieve the breadcrumb for a clean admin page.
OverwriteDefaultPageOverwrite the default page content.

Member Data

$default_content

private $default_content

(string) The default content of the default page.

$pages

private $pages

An associative array containing the pages in this clean admin site.

The structure of this array should look like the following

array(
    array(
        title => {(string) The title of the page.},
        url => {(string) The URL of the page.}
    ),
    ...
)

Class Construction

__construct

public function __construct()

Create a new clean admin site.

Returns

(DLCleanAdmin) An instance of DLCleanAdmin.

Output

OutputAsAJAX

public function OutputAsAJAX($action,
$data)

Output the given data so that it can be read by JavaScript.

Parameters

$action(string) The action to return.
$data(array) An associative array containing the data to be sent back to the clean admin page.

OutputSite

public function OutputSite($title,  
$options =  array())

Output the site but outputting the index page.

Parameters

$title(string) The title of the site.
$options(array) An associative array containing various options used by this method.  Defaults to an empty array.

The structure of the $options parameter, if given, should look like the following:

array(
    css => array(
        {(string) URL to a CSS file.},
        ...
    ),
    javascript => array(
        {(string) URL to a JavaScript file.},
        ...
    ),
    logo => {
        (string) The URL to image to be used as the logo. The image
        must have a dimension of 180x180 pixels. If this is an
        empty string, it will randomly select one of the default
        logos. Defaults to an empty string.
    }
)

Page Management

AddPage

public function AddPage($url,
$title)

Add a new page to the clean admin site.

Parameters

$url(string) The URL of the page.
$title(string) The title of the page.

GetBreadcrumb

public function GetBreadcrumb($data)

Retrieve the breadcrumb for a clean admin page.

Parameters

$data(array) An array of pages containing the breadcrumb information.

The structure of the $data parameter, if given, should look like the following:

array(
    array(
        url => {
            (string) The URL of the page. This can be an empty
            string in which case, no link is created.
        },
        text => {
            (string) The title of the page.
        }
    ),
    ...
)

Returns

(string) The HTML for the breadcrumb.

OverwriteDefaultPage

public function OverwriteDefaultPage($content)

Overwrite the default page content.

Parameters

$content(string) The HTML for the default page.
private $default_content
(string) The default content of the default page.
private $pages
An associative array containing the pages in this clean admin site.
public function __construct()
Create a new clean admin site.
public function OutputAsAJAX($action,
$data)
Output the given data so that it can be read by JavaScript.
public function OutputSite($title,  
$options =  array())
Output the site but outputting the index page.
public function AddPage($url,
$title)
Add a new page to the clean admin site.
public function GetBreadcrumb($data)
Retrieve the breadcrumb for a clean admin page.
public function OverwriteDefaultPage($content)
Overwrite the default page content.