b2evolution

Multilingual multiuser multiblog engine

b2evolution Technical Documentation (Version 1.10) [ class tree: admin ] [ index: admin ] [ all elements ]

Class: AdminUI_general

Source Location: /blogs/skins_adm/_adminUI_general.class.php

Class AdminUI_general

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

[ Top ]
Property Summary
string   $admin_logo   The Logo for the admin.
array   $headlines   List of the headlines to output.
array   $path   The path of the current selected menu entry.
array   $pathProps   The properties of the path entries.
string   $pathSeperator   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  
array   $_menus   The menus.

[ Top ]
Method Summary
AdminUI_general   AdminUI_general()   Constructor.
void   add_headline()   Add a headline for HTML <head>.
void   add_menu_entries()   Add menu entries to the list of entries for a given path.
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.
boolean   check_perm()   Checks if $current_User has needed perms on a menu entry.
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 (from the inc/VIEWS/ hierarchy )
string   get_bloglist_buttons()  
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_headlines()   Get the headlines for HTML <head> (CSS files especially).
string   get_head_info()   Get default head info (local time, GMT, Login).
string   get_html_collection_list()   Returns the list of available Collections (aka Blogs) to work on.
void   get_html_menu()   Get a menu, any level.
string   get_html_menu_entries()   Get the HTML for the menu entries of a specific path.
string   get_html_title()   Get the title for HTML <title> tag.
array   get_menu_entries()   Get menu entries for a given path.
array|false   &get_node_by_path()   Get the reference of a node from the menu entries using a path.
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 tghe 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.
string|false   get_selected()   Get the key of a selected entry for a path.
array   get_template()   Get a template by name and depth.
string   get_title()   Get the <title> of the page.
string   get_title_for_titlearea()   Get the title for the titlearea (<h1>).
void   init_templates()   This function should init the templates - like adding Javascript through the add_headline() method.
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   $admin_logo [line 67]

The Logo for the admin.

Defaults to $app_admin_logo if not set.


[ Top ]
array   $headlines = array() [line 51]

List of the headlines to output.


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

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 106]

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   $pathSeperator [line 58]

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


[ Top ]
string   $title [line 112]

The explicit title for the page.


[ Top ]
string   $title_titlearea [line 118]

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


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

[ Top ]
array   $_menus = array() [line 80]

The menus.

Use add_menu_entries() to add them here.

API Tags:
Access:  protected


[ Top ]
Methods
Constructor AdminUI_general  [line 125]

  AdminUI_general AdminUI_general( )

Constructor.



[ Top ]
add_headline  [line 994]

  void add_headline( string $headline  )

Add a headline for HTML <head>.

Parameters:
string   $headline:  The line that should be added to <head>.


[ Top ]
add_menu_entries  [line 173]

  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. 'perm_name': permission name to check. 'perm_level': permission level that must be granted. 'perm_eval': This gets evaluated and must return true for the entry to be accessible. 'text_noperm': Text to display if no permission granted. 'entries': array of sub-entries

API Tags:
Usedby:  AdminUI_general::unshift_menu_entries()


[ Top ]
append_path_level  [line 1150]

  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 274]

  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 ]
check_perm  [line 1302]

  boolean check_perm( array $perminfo  )

Checks if $current_User has needed perms on a menu entry.

Parameters:
array   $perminfo:  Path properties: An array, where 'perm_name' and/or 'perm_eval' might be set. 'perm_level' (used with 'perm_name') defaults to 'any' if not given.


[ Top ]
disp_body_top  [line 424]

  void disp_body_top( )

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

Typically includes title, menu, messages, etc.



[ Top ]
disp_global_footer  [line 434]

  void disp_global_footer( )

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



[ Top ]
disp_html_head  [line 411]

  void disp_html_head( )

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



[ Top ]
disp_payload_begin  [line 451]

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

Information Tags:
Todo:  check if the plugin event is appropriate. Maybe it should rather go as 'AdminAfterBodyTop' or sth like this.

[ Top ]
disp_payload_end  [line 485]

  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 515]

  void disp_view( string $view_name, [array $view_params = array()]  )

Display a view (from the inc/VIEWS/ hierarchy )

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 1022]

  string get_bloglist_buttons( [ $before = ''], [ $after = '']  )

Parameters:
   $before: 
   $after: 

Information Tags:
Todo:  Move generation of blog list to this class!

[ Top ]
get_body_bottom  [line 1232]

  string get_body_bottom( )

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



Redefined in descendants as:

[ Top ]
get_body_top  [line 1221]

  string get_body_top( )

Get the top of the HTML <body>.



Redefined in descendants as:

[ Top ]
get_headlines  [line 1008]

  string get_headlines( )

Get the headlines for HTML <head> (CSS files especially).

To define headlines for a derived skin, add entries to $headlines and "return parent::get_headlines();".


API Tags:
Return:  The concatenated headlines to output in HTML <head>.


Redefined in descendants as:

[ Top ]
get_head_info  [line 1276]

  string get_head_info( )

Get default head info (local time, GMT, Login).



[ Top ]
get_html_collection_list  [line 551]

  string get_html_collection_list( [string $permname = 'blog_ismember'], [string $permlevel = 1], [string $url_format = '?blog=%d'], [string $all_title = NULL], [string $all_url = ''], [string $onclick = NULL], [string $name = NULL]  )

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

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_format:  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 %d for blog number.
string   $name:  name attribute for each button (%d for blog number)

API Tags:
Return:  HTML

Information Tags:
Todo:  Use BlogCache(?)
Todo:  Use a template (i wanna make an UL/LI/A list structure in newer skins)

[ Top ]
get_html_menu  [line 396]

  void get_html_menu( [NULL|string|array $path = NULL], [string $template = 'main']  )

Get a menu, any level.

Parameters:
NULL|string|array   $path:  The path. See get_node_by_path().
string   $template:  The template name, see get_template().


[ Top ]
get_html_menu_entries  [line 612]

  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:
NULL|string|array   $path:  The path. See get_node_by_path().
string   $template:  Template name, see get_template().
int   $depth:  Depth (recursion)

API Tags:
Return:  The HTML for the menu.


[ Top ]
get_html_title  [line 287]

  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_menu_entries  [line 718]

  array get_menu_entries( NULL|string|array $path  )

Get menu entries for a given path.

Parameters:
NULL|string|array   $path:  The path. See get_node_by_path().

API Tags:
Return:  The menu entries (may be empty).


[ Top ]
get_node_by_path  [line 754]

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


[ Top ]
get_page_head  [line 1243]

  string get_page_head( )

GLOBAL HEADER - APP TITLE, LOGOUT, ETC.



Redefined in descendants as:

[ Top ]
get_path  [line 1040]

  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 1070]

  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.


[ Top ]
get_properties_for_path  [line 319]

  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 349]

  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 372]

  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_selected  [line 732]

  string|false get_selected( NULL|string|array $path  )

Get the key of a selected entry for a path.

Parameters:
NULL|string|array   $path:  The path. See get_node_by_path().


[ Top ]
get_template  [line 799]

  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. fp>>I'm not so sure about this... feels a little bloated... gotta think about it..

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:
  • : Get a template by name and depth.

[ Top ]
get_title  [line 221]

  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 246]

  string get_title_for_titlearea( )

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

This is the current path in the site structure



[ Top ]
init_templates  [line 151]

  void init_templates( )

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



[ Top ]
set_path  [line 1179]

  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 1110]

  boolean set_path_level( integer $level, array $pathKey, [array $pathProps = array()], [boolean $die_if_no_perm = true]  )

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.
boolean   $die_if_no_perm:  Exit script when the user has no permissions to this path and text_noperm is not set for the path?

API Tags:
Return:  True if perm granted, false if not (and we're not exiting).


[ Top ]
unshift_menu_entries  [line 199]

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


[ Top ]

Documentation generated on Tue, 20 May 2008 01:37:22 +0200 by phpDocumentor 1.4.2