phpDocumentor pond
[ class tree: pond ] [ index: pond ] [ all elements ]

Class: AdminUI_general

Source Location: /qp_view_admin/_adminUI_general.class.php

Class AdminUI_general

Descendants
Child Class Description
We define a special template for the main menu.

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From Menu

Menu::$_menus

Inherited From Widget

Widget::$global_icons
Widget::$params

Inherited From Menu

Menu::add_menu_entries()
Add menu entries to the list of entries for a given path.
Menu::get_html_menu()
Get the HTML for the menu entries of a specific path.
Menu::get_menu_entries()
Get menu entries for a given path.
Menu::get_node_by_path()
Get the reference of a node from the menu entries using a path.
Menu::get_selected()
Get the key of a selected entry for a path.
Menu::get_template()
Get a template by name.

Inherited From Widget

Widget::Widget()
Constructor
Widget::disp_template_raw()
Display a template param without replacing variables
Widget::disp_template_replaced()
Display a template param with its variables replaced
Widget::gen_global_icons()
Generate img tags for registered icons, through global_icon().
Widget::global_icon()
Registers a global action icon
Widget::replace_callback()
Callback function used to replace only necessary values in template.
Widget::replace_callback_wrapper()
This is an additional wrapper to replace_vars() that allows to react on the return value of it.
Widget::replace_vars()
Replaces $vars$ with appropriate values.

[ Top ]
Property Summary
string   $coll_list_all_title   Collection List buttons: title for 'all' button
string   $coll_list_all_url   Collection List buttons: url for 'all' button
string   $coll_list_onclick   Collection List buttons: javascript to execute on click of a button
mixed   $coll_list_permlevel   Collection List buttons: minimum level required to display button
string   $coll_list_permname   Collection List buttons: permission name to test on to decide wether or not to display buttons
array   $coll_list_url_params   Collection List buttons: params of the url used for the buttons
array   $path   The path of the current selected menu entry.
array   $pathProps   The properties of the path entries.
string   $pathSeparator   Visual path seperator (used in html title, ..)
string   $title   The explicit title for the page.
string   $title_titlearea   The explicit title for the titlearea (<h1>).
mixed   $title_titlearea_appendix  

[ Top ]
Method Summary
AdminUI_general   AdminUI_general()   Constructor.
void   append_path_level()   Append a selected menu entry to the current path of selected entries.
void   append_to_titlearea()   Append a string at the end of the existing titlearea.
void   disp_body_top()   Dsiplay the top of the HTML <body>...
void   disp_global_footer()   Display body bottom, debug info and close </html>
void   disp_html_head()   Display doctype + <head>...</head> section
void   disp_payload_begin()   Display the start of a payload block
void   disp_payload_end()   Display the end of a payload block
void   disp_view()   Display a view
string   get_bloglist_buttons()   Returns list of buttons for available Collections (aka Blogs) to work on.
string   get_body_bottom()   Get the end of the HTML <body>. Close open divs, etc...
string   get_body_top()   Get the top of the HTML <body>.
string   get_color()   Get colors for page elements that can't be controlled by CSS (charts)
string   get_footer_contents()   Get the footer text
string   get_html_title()   Get the title for HTML <title> tag.
string   get_page_head()   GLOBAL HEADER - APP TITLE, LOGOUT, ETC.
string|array|false   get_path()   Get a path key by numeric key. Starts with 0.
array   get_path_range()   Get the list of path keys in a given range.
array   get_properties_for_path()   Get a list of properties for a given path for a set of property names to check.
mixed|false   get_prop_for_node()   Get a property of a node, given by path.
mixed|false   get_prop_for_path()   Get a property for a specific path entry.
array   get_template()   Get a template by name.
string   get_title()   Get the <title> of the page.
string   get_title_for_titlearea()   Get the title for the titlearea (<h1>).
void   init_menus()   Init the menus.
void   init_templates()   This function should init the templates - like adding Javascript through the add_headline() method.
void   set_coll_list_params()   Set params for blog list.
void   set_path()   Set the full selected path.
boolean   set_path_level()   Set a specific path level (specific depth).
void   unshift_menu_entries()   Add menu entries to the beginning of the list for given path.

[ Top ]
Properties
string   $coll_list_all_title = NULL [line 103]

Collection List buttons: title for 'all' button


[ Top ]
string   $coll_list_all_url = '' [line 108]

Collection List buttons: url for 'all' button


[ Top ]
string   $coll_list_onclick = NULL [line 128]

Collection List buttons: javascript to execute on click of a button


[ Top ]
mixed   $coll_list_permlevel = 1 [line 118]

Collection List buttons: minimum level required to display button


[ Top ]
string   $coll_list_permname = NULL [line 113]

Collection List buttons: permission name to test on to decide wether or not to display buttons


[ Top ]
array   $coll_list_url_params = array() [line 123]

Collection List buttons: params of the url used for the buttons


[ Top ]
array   $path = array() [line 71]

The path of the current selected menu entry.

Array of strings. The top level entry is at position 0. Selected submenu entries follow.

Use get_path() or get_path_range() to access it. Use set_path(), append_path_level() or set_path_level() to set it.

API Tags:
Access:  protected


[ Top ]
array   $pathProps = array() [line 84]

The properties of the path entries.

Numbered Array of arrays. The top level entry is at position 0. Selected submenu entries follow.

Use get_prop_for_path() or get_properties_for_path() to access it Use set_path(), append_path_level() or set_path_level() to set it.

API Tags:
Access:  protected


[ Top ]
string   $pathSeparator = ' &rsaquo; ' [line 55]

Visual path seperator (used in html title, ..)


[ Top ]
string   $title [line 90]

The explicit title for the page.


Redefinition of:
Widget::$title
Title of the widget (to be displayed)

[ Top ]
string   $title_titlearea [line 96]

The explicit title for the titlearea (<h1>).


[ Top ]
mixed   $title_titlearea_appendix = '' [line 97]

[ Top ]
Methods
Constructor AdminUI_general  [line 134]

  AdminUI_general AdminUI_general( )

Constructor.



[ Top ]
append_path_level  [line 1093]

  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: 


[ Top ]
append_to_titlearea  [line 235]

  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


[ Top ]
disp_body_top  [line 367]

  void disp_body_top( [boolean $display_messages = true]  )

Dsiplay the top of the HTML <body>...

Typically includes title, menu, messages, etc.

Parameters:
boolean   $display_messages:  Whether to display messages.


[ Top ]
disp_global_footer  [line 411]

  void disp_global_footer( )

Display body bottom, debug info and close </html>



[ Top ]
disp_html_head  [line 353]

  void disp_html_head( )

Display doctype + <head>...</head> section



[ Top ]
disp_payload_begin  [line 427]

  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:
See:  AdminUI_general::disp_payload_end()


[ Top ]
disp_payload_end  [line 459]

  void disp_payload_end( )

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:
See:  AdminUI_general::disp_payload_begin()


[ Top ]
disp_view  [line 489]

  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)


[ Top ]
get_bloglist_buttons  [line 533]

  string get_bloglist_buttons( [ $title = '']  )

Returns list of buttons for available Collections (aka Blogs) to work on.

Parameters:
   $title: 

API Tags:
Return:  HTML


[ Top ]
get_body_bottom  [line 1208]

  string get_body_bottom( )

Get the end of the HTML <body>. Close open divs, etc...



Redefined in descendants as:

[ Top ]
get_body_top  [line 1197]

  string get_body_top( )

Get the top of the HTML <body>.



Redefined in descendants as:

[ Top ]
get_color  [line 1276]

  string get_color( $what  )

Get colors for page elements that can't be controlled by CSS (charts)

Parameters:
   $what: 


[ Top ]
get_footer_contents  [line 1249]

  string get_footer_contents( )

Get the footer text



Redefined in descendants as:

[ Top ]
get_html_title  [line 248]

  string get_html_title( )

Get the title for HTML <title> tag.

If no explicit title has been specified, auto construct one from path.



[ Top ]
get_page_head  [line 1219]

  string get_page_head( )

GLOBAL HEADER - APP TITLE, LOGOUT, ETC.



Redefined in descendants as:

[ Top ]
get_path  [line 994]

  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)


[ Top ]
get_path_range  [line 1024]

  array get_path_range( integer $start, [integer|NULL $end = NULL]  )

Get the 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.


[ Top ]
get_properties_for_path  [line 280]

  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.


[ Top ]
get_prop_for_node  [line 310]

  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.


[ Top ]
get_prop_for_path  [line 333]

  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


[ Top ]
get_template  [line 661]

  array get_template( string $name, [integer $level = 0]  )

Get a template by name.

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   $level:  Nesting level (start at 0)

API Tags:
Return:  Associative array which defines layout and optionally properties.


Redefinition of:
Menu::get_template()
Get a template by name.

[ Top ]
get_title  [line 182]

  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


[ Top ]
get_title_for_titlearea  [line 207]

  string get_title_for_titlearea( )

Get the title for the titlearea (<h1>).

This is the current path in the site structure



[ Top ]
init_menus  [line 1170]

  void init_menus( )

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.

Note: The menu structure is determined by the modules and the plugins. Individual Admin templates can still override the whole menu. In a cumbersome way though.



[ Top ]
init_templates  [line 148]

  void init_templates( )

This function should init the templates - like adding Javascript through the add_headline() method.



Redefined in descendants as:

[ Top ]
set_coll_list_params  [line 516]

  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)


[ Top ]
set_path  [line 1122]

  void set_path( string|array,... 0  )

Set the full selected path.

For example, this selects the tab/submenu 'plugins' in the main menu 'options':

  1.  set_path'options''plugins' );

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).


[ Top ]
set_path_level  [line 1062]

  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).


[ Top ]
unshift_menu_entries  [line 160]

  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:
Uses:  Menu::add_menu_entries()


[ Top ]