AdminUI_general AdminUI_general(
)
|
|
Constructor.
void add_menu_entries(
NULL|string|array
$path, array
$entries
)
|
|
Add menu entries to the list of entries for a given path.
Parameters:
|
NULL|string|array |
$path: |
The path to add the entries to. See get_node_by_path(). |
|
array |
$entries: |
Menu entries to add (key (string) => entry (array)). An entry can have the following keys: 'text': Text/Caption for this entry. 'href': The link for this entry. 'style': CSS style for this entry. 'onclick': onclick property for this entry. 'name': name attribute of the link/entry. 'entries': array of sub-entries |
API Tags:
void append_path_level(
string|array
$path, [
$pathProps = array()]
)
|
|
Append a selected menu entry to the current path of selected entries.
Parameters:
|
string|array |
$path: |
Either the key of the path or an array(keyname, propsArray). |
|
|
$pathProps: |
|
void append_to_titlearea(
string
$string
)
|
|
Append a string at the end of the existing titlearea.
We actually keep the appended stuff separate from the main title, because the main title might in some occasions not be known immediately.
Parameters:
|
string |
$string: |
What to append to the titlearea |
Dsiplay the top of the HTML <body>...
Typically includes title, menu, messages, etc.
void disp_global_footer(
)
|
|
Display body bottom, debug info and close </html>
Display doctype + <head>...</head> section
Redefined in descendants as:
void disp_payload_begin(
)
|
|
Display the start of a payload block
Note: it is possible to display several payload blocks on a single page. The first block uses the "sub" template, the others "block".
API Tags:
Information Tags:
| Todo: | check if the plugin event is appropriate. Maybe it should rather go as 'AdminAfterBodyTop' or sth like this. |
Display the end of a payload block
Note: it is possible to display several payload blocks on a single page. The first block uses the "sub" template, the others "block".
API Tags:
void disp_view(
string
$view_name, [array
$view_params = array()]
)
|
|
Display a view
Note: doing the require inside of a function has the side effect of forcing the view to declare any global object it wants to use. This can be a little tedious but on the other hand it has the advantage of clearly showing what objects are used and makes it easier to audit the views in order to determine if they include more business logic than they ought to.
Parameters:
|
string |
$view_name: |
|
|
array |
$view_params: |
params to be used in the view (optional) |
string get_bloglist_buttons(
[
$title = '']
)
|
|
Returns list of buttons for available Collections (aka Blogs) to work on.
Parameters:
API Tags:
string get_body_bottom(
)
|
|
Get the end of the HTML <body>. Close open divs, etc...
Redefined in descendants as:
Get the top of the HTML <body>.
Redefined in descendants as:
Get colors for page elements that can't be controlled by CSS (charts)
Parameters:
Redefined in descendants as:
void get_footer_contents(
)
|
|
Get the footer text
Redefined in descendants as:
void get_html_menu(
[NULL|string|array
$path = NULL], [string
$template = 'main']
)
|
|
Get a menu, any level.
Parameters:
string get_html_menu_entries(
NULL|string|array
$path, string
$template, [int
$depth = 0]
)
|
|
Get the HTML for the menu entries of a specific path.
Parameters:
API Tags:
| Return: | The HTML for the menu. |
Get the title for HTML <title> tag.
If no explicit title has been specified, auto construct one from path.
array get_menu_entries(
NULL|string|array
$path
)
|
|
Get menu entries for a given path.
Parameters:
API Tags:
| Return: | The menu entries (may be empty). |
array|false &get_node_by_path(
array|string|NULL
$path, [boolean
$createIfNotExisting = false]
)
|
|
Get the reference of a node from the menu entries using a path.
Parameters:
|
array|string|NULL |
$path: |
The path. NULL means root, string means child of root, array means path below root. (eg array('options', 'general')
). |
|
boolean |
$createIfNotExisting: |
Should the node be created if it does not exist already? |
API Tags:
| Return: | The node as array or false, if the path does not exist (and we do not $createIfNotExisting). |
GLOBAL HEADER - APP TITLE, LOGOUT, ETC.
Redefined in descendants as:
string|array|false get_path(
integer
$which, [boolean
$withProps = false]
)
|
|
Get a path key by numeric key. Starts with 0.
Parameters:
|
integer |
$which: |
The numeric index of the path (0 is first). |
|
boolean |
$withProps: |
Also return properties? |
API Tags:
| Return: | (depends on $withProps) |
array get_path_range(
integer
$start, [integer|NULL
$end = NULL]
)
|
|
Get tghe list of path keys in a given range.
Parameters:
|
integer |
$start: |
start index |
|
integer|NULL |
$end: |
end index (NULL means same as start index) |
API Tags:
| Return: | List of path keys. |
array get_properties_for_path(
string|array
$path, array
$prop_by_pref
)
|
|
Get a list of properties for a given path for a set of property names to check.
The result is a list of properties for each node down the path.
The property names must be given in $prop_by_ref, ordered by preference.
Parameters:
|
string|array |
$path: |
The path. See get_node_by_path(). |
|
array |
$prop_by_pref: |
Alternative names of the property to receive (ordered by priority). |
API Tags:
| Return: | List of the properties. |
mixed|false get_prop_for_node(
string|array
$path, array
$prop_by_pref
)
|
|
Get a property of a node, given by path.
Parameters:
|
string|array |
$path: |
The path. See get_node_by_path(). |
|
array |
$prop_by_pref: |
Alternative names of the property to receive (ordered by priority). |
API Tags:
| Return: | False if property is not set for the node, otherwise its value. |
mixed|false get_prop_for_path(
int
$depth, array
$prop_by_pref
)
|
|
Get a property for a specific path entry.
Parameters:
|
int |
$depth: |
The numeric index of the path entry to query (0 is first). |
|
array |
$prop_by_pref: |
A list of properties to check, ordered by priority. |
API Tags:
| Return: | The first found property or false if it does not exist |
string|false get_selected(
NULL|string|array
$path
)
|
|
Get the key of a selected entry for a path.
Parameters:
array get_template(
string
$name, [integer
$depth = 0]
)
|
|
Get a template by name and depth.
Templates can handle multiple depth levels
This is a method (and not a member array) to allow dynamic generation and T_()
Parameters:
|
string |
$name: |
Name of the template ('main', 'sub') |
|
integer |
$depth: |
Nesting level (start at 0) |
API Tags:
| Return: | Associative array which defines layout and optionally properties. |
Redefined in descendants as:
string get_title(
[boolean
$reversedDefault = false]
)
|
|
Get the <title> of the page.
This is either $title or will be constructed from title/text properties of the path entries.
Parameters:
|
boolean |
$reversedDefault: |
If true, the fallback will be in reversed order |
string get_title_for_titlearea(
)
|
|
Get the title for the titlearea (<h1>).
This is the current path in the site structure
Init the menus.
Do this as late as possible. Especially after determining the blog ID we work on. This allows to check for proper permissions and build correct cross navigation links.
This function should init the templates - like adding Javascript through the add_headline() method.
void set_coll_list_params(
[string
$permname = 'blog_ismember'], [string
$permlevel = 1], [string
$url_params = array()], [string
$all_title = NULL], [string
$all_url = ''], [string
$onclick = NULL]
)
|
|
Set params for blog list.
Parameters:
|
string |
$permname: |
name of required permission needed to display the blog in the list |
|
string |
$permlevel: |
level of required permission needed to display the blog in the list |
|
string |
$url_params: |
Url format string for elements, with %d for blog number. |
|
string |
$all_title: |
Title for "all" button |
|
string |
$all_url: |
URL for "all" button |
|
string |
$onclick: |
onclick attribute format string, with %s for blog number. (NOTE: %s so that we can use this.value when selected through list) |
void set_path(
string|array,...
0
)
|
|
Set the full selected path.
For example, this selects the tab/submenu 'plugins' in the main menu 'options':
Use append_path_level() to append a single path element.
This is an easy stub for set_path_level().
Parameters:
|
string|array,... |
0: |
VARIABLE NUMBER OF ARGUMENTS. Each is either the key of a path entry or an array(keyname, propsArray). |
boolean set_path_level(
integer
$level, array
$pathKey, [array
$pathProps = array()]
)
|
|
Set a specific path level (specific depth).
First level is 0, then the first subpath/submenu is level 1, etc.
E.g., if plugins.php gets called, there could be a call to $AdminUI->set_path_level( 0, 'plugins' ), which selects this entry from the menu. If a specific tab is called inside of plugins.php, there could be a call to $AdminUI->set_path_level( 1, $tab )
Though, it is recommended to call the wrapper functions:
This also marks the parent node as selected and checks for permissions.
Parameters:
|
integer |
$level: |
Path level to set (starts at 0) |
|
array |
$pathKey: |
Either the key of the path or an array(keyname, propsArray). |
|
array |
$pathProps: |
Properties for this path entry. |
API Tags:
| Return: | DEPRECATED True if perm granted, false if not (and we're not exiting). |
void unshift_menu_entries(
NULL|string|array
$path, array
$entries
)
|
|
Add menu entries to the beginning of the list for given path.
Parameters:
|
NULL|string|array |
$path: |
The path to add the entries to. |
|
array |
$entries: |
Menu entries to add (key (string) => entry (array)). |
API Tags: