Source for file _adminUI_general.class.php
Documentation is available at _adminUI_general.class.php
* This file implements the Admin UI class.
* Admin skins should derive from this class and override {@link get_template()}
* This file is part of the b2evolution/evocms project - {@link http://b2evolution.net/}.
* See also {@link http://sourceforge.net/projects/evocms/}.
* @copyright (c)2003-2006 by Francois PLANQUE - {@link http://fplanque.net/}.
* Parts of this file are copyright (c)2005 by Daniel HAHLER - {@link http://thequod.de/contact}.
* @license http://b2evolution.net/about/license.html GNU General Public License (GPL)
* {@internal Open Source relicensing agreement:
* Daniel HAHLER grants Francois PLANQUE the right to license
* Daniel HAHLER's contributions to this file and the b2evolution project
* under any OSI approved OSS license (http://www.opensource.org/licenses/).
* {@internal Below is a list of authors who have contributed to design/coding of this file: }}
* @author blueyed: Daniel HAHLER
* @author fplanque: Francois PLANQUE.
* @todo Refactor to allow easier contributions! (blueyed)
* @version $Id: _adminUI_general.class.php,v 1.25.2.6 2006/11/27 19:11:12 fplanque Exp $
if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
* The general Admin UI class. It provides functions to handle the UI part of the
* Admin skins should derive from this class and override {@link get_template()}
* @todo CODE DOCUMENTATION!!!
* List of the headlines to output.
* Visual path seperator (used in html title, ..)
* The Logo for the admin.
* Defaults to {@link $app_admin_logo} if not set.
/*-------------------------------------------------------------------*/
/*- The members below should not get overridden in a derived class. -*/
* Use {@link add_menu_entries()} to add them here.
* The path of the current selected menu entry.
* The top level entry is at position 0. Selected submenu entries follow.
* Use {@link get_path()} or {@link get_path_range()} to access it.
* Use {@link set_path()}, {@link append_path_level()} or {@link set_path_level()} to set it.
* The properties of the path entries.
* Numbered Array of arrays.
* The top level entry is at position 0. Selected submenu entries follow.
* Use {@link get_prop_for_path()} or {@link get_properties_for_path()} to access it
* Use {@link set_path()}, {@link append_path_level()} or {@link set_path_level()} to set it.
* The explicit title for the page.
* The explicit title for the titlearea (<h1>).
global $mode; // TODO: make it a real property
global $htsrv_url, $baseurl;
global $admin_path_seprator;
* This function should init the templates - like adding Javascript through the {@link add_headline()} method.
* Add menu entries to the list of entries for a given path.
* @param NULL|string|arrayThe path to add the entries to. See {@link get_node_by_path()}.
* @param array 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
// Get a reference to the node in the menu list.
debug_die( 'add_menu_entries() with non-existing path!' );
foreach( $entries as $l_key =>
$l_menu_props )
$node['entries'][$l_key] =
$l_menu_props;
* Add menu entries to the beginning of the list for given path.
* @param NULL|string|arrayThe path to add the entries to.
* @param array Menu entries to add (key (string) => entry (array)).
* @uses add_menu_entries()
// Get a reference to the node in the menu list.
* Get the <title> of the page.
* This is either {@link $title} or will be constructed from title/text properties
* @param boolean If true, the fallback will be in reversed order
function get_title( $reversedDefault =
false )
if( isset
($this->title) )
{ // Explicit title has been set:
{ // Fallback: implode title/text properties of the path
{ // We have asked for reverse order of the path elements:
* Get the title for the titlearea (<h1>).
* This is the current path in the site structure
foreach( $this->path as $i =>
$lPath )
if( false !==
($title_text =
$this->get_prop_for_path( $i, array( 'title', 'text' ) )) )
$titles[] =
'<a href="'.
$this->get_prop_for_path( $i, array( 'href' ) ).
'">'.
$title_text.
'</a>';
* 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.
* @param string What to append to the titlearea
* Get the title for HTML <title> tag.
* If no explicit title has been specified, auto construct one from path.
{ // Explicit htmltitle set:
{ // No explicit title set, construct Title from path
$r .=
#preg_replace( '/:$/', '',
* 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.
* @param string|arrayThe path. See {@link get_node_by_path()}.
* @param array Alternative names of the property to receive (ordered by priority).
* @return array List of the properties.
foreach( $path as $i =>
$lPath )
* Get a property of a node, given by path.
* @param string|arrayThe path. See {@link get_node_by_path()}.
* @param array Alternative names of the property to receive (ordered by priority).
* @return mixed|falseFalse if property is not set for the node, otherwise its value.
foreach( $prop_by_pref as $lProp )
if( isset
($node[$lProp]) )
* Get a property for a specific path entry.
* @param int The numeric index of the path entry to query (0 is first).
* @param array A list of properties to check, ordered by priority.
* @return mixed|falseThe first found property or false if it does not exist
if( $pathWithProps =
$this->get_path( $depth, true ) )
foreach( $prop_by_pref as $lProp )
if( isset
($pathWithProps['props'][$lProp]) )
// echo "<br>path depth $depth property $lProp = ".$pathWithProps['props'][$lProp];
return $pathWithProps['props'][$lProp];
* @param NULL|string|arrayThe path. See {@link get_node_by_path()}.
* @param string The template name, see {@link get_template()}.
$r .= $this->get_html_menu_entries( $path, $template );
* Display doctype + <head>...</head> section
require
$view_path.
'_menutop.php';
* Dsiplay the top of the HTML <body>...
* Typically includes title, menu, messages, etc.
* Display body bottom, debug info and close </html>
require
$view_path.
'_footer.php';
* 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".
* @see disp_payload_end()
* @todo check if the plugin event is appropriate. Maybe it should rather go as 'AdminAfterBodyTop' or sth like this.
if( empty($this->displayed_sub_begin) )
$Plugins->trigger_event( 'AdminBeginPayload' );
// Display submenu (this also opens a div class="panelblock" or class="panelblocktabs")
//echo ' disp_submenu-BEGIN ';
//echo ' disp_submenu-END ';
$this->displayed_sub_begin =
1;
* 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".
* @see disp_payload_begin()
if( empty($this->displayed_sub_end) )
$this->displayed_sub_end =
1;
* 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
* @param array params to be used in the view (optional)
function disp_view( $view_name, $view_params =
array() )
// THESE ARE THE GLOBALS WE WANT TO MAKE AVAILABLE TO ALL VIEWS:
global $DB; // Note: not sure it's agood idea to let the views hit on the db...
global $model_path; // TEMP (for object inclusion)
require
$view_path.
$view_name;
* Returns the list of available Collections (aka Blogs) to work on.
* @todo Use a template (i wanna make an UL/LI/A list structure in newer skins)
* @param string name of required permission needed to display the blog in the list
* @param string level of required permission needed to display the blog in the list
* @param string Url format string for elements, with %d for blog number.
* @param string Title for "all" button
* @param string URL for "all" button
* @param string onclick attribute format string, with %d for blog number.
* @param string name attribute for each button (%d for blog number)
$all_title =
NULL, $all_url =
'', $onclick =
NULL, $name =
NULL )
global $current_User, $blog;
$r =
$template['before'];
{ // We want to add an "all" button
$r .=
$template[ $blog ==
0 ?
'beforeEachSel' :
'beforeEach' ];
$r .=
'<a href="'.
$all_url
.
'" class="'.
( $blog ==
0 ?
'CurrentBlog' :
'OtherBlog' ).
'">'
$r .=
$template[ $blog ==
0 ?
'afterEachSel' :
'afterEach' ];
if( ! $current_User->check_perm( $permname, $permlevel, false, $curr_blog_ID ) )
{ // Current user doesn't have required permission on this blog...
$r .=
$template[ $curr_blog_ID ==
$blog ?
'beforeEachSel' :
'beforeEach' ];
$r .=
'<a href="'.
sprintf( $url_format, $curr_blog_ID )
.
'" class="'.
( $curr_blog_ID ==
$blog ?
'CurrentBlog' :
'OtherBlog' ).
'"';
{ // We want to include an onclick attribute:
$r .=
' onclick="'.
sprintf( $onclick, $curr_blog_ID ).
'"';
{ // We want to include a name attribute:
$r .=
' name="'.
sprintf( $name, $curr_blog_ID ).
'"';
$r .=
$template[ $curr_blog_ID ==
$blog ?
'afterEachSel' :
'afterEach' ];
$r .=
$template['after'];
* Get the HTML for the menu entries of a specific path.
* @param NULL|string|arrayThe path. See {@link get_node_by_path()}.
* @param string Template name, see {@link get_template()}.
* @param int Depth (recursion)
* @return string The HTML for the menu.
$templateForLevel =
$this->get_template( $template, $depth );
{ // No menu entries at this level
if( isset
($templateForLevel['empty']) )
$r .=
$templateForLevel['empty'];
{ // There are entries to display:
$r .=
$templateForLevel['before'];
foreach( $menuEntries as $loop_key =>
$loop_details )
$perm =
true; // By default
if( ! ($perm =
$this->check_perm( $loop_details )) &&
! isset
($loop_details['text_noperm']) )
{ // If permission requested but not granted, and we have no alt text, display no tab:
if( isset
( $loop_details['href'] ) )
$anchor .=
$loop_details['href'];
elseif( !empty($loop_details['href_eval']) )
{ // Useful for passing dynamic context vars (fp>> I AM using it)
$anchor .= eval
( $loop_details['href_eval'] );
if( isset
($loop_details['style']) )
$anchor .=
' style="'.
$loop_details['style'].
'"';
if( isset
($loop_details['onclick']) )
$anchor .=
' onclick="'.
$loop_details['onclick'].
'"';
if( isset
($loop_details['name']) )
$anchor .=
' name="'.
$loop_details['name'].
'"';
$anchor .=
'>'.
format_to_output( $perm ?
$loop_details['text'] :
$loop_details['text_noperm'], 'htmlbody' )
if( $loop_key ==
$selected )
{ // Highlight selected entry
if( !empty( $templateForLevel['_props']['recurseSelected'] )
$r .= isset
($templateForLevel['beforeEachSelWithSub'])
?
$templateForLevel['beforeEachSelWithSub']
:
$templateForLevel['beforeEachSel'];
$r .= isset
($templateForLevel['afterEachSelWithSub'])
?
$templateForLevel['afterEachSelWithSub']
:
$templateForLevel['afterEachSel'];
$r .=
$templateForLevel['beforeEachSel'];
$r .=
$templateForLevel['afterEachSel'];
$r .=
$templateForLevel['beforeEach'];
$r .=
$templateForLevel['afterEach'];
$r .=
$templateForLevel['after'];
* Get menu entries for a given path.
* @param NULL|string|arrayThe path. See {@link get_node_by_path()}.
* @return array The menu entries (may be empty).
return isset
( $node['entries'] ) ?
$node['entries'] :
array();
* Get the key of a selected entry for a path.
* @param NULL|string|arrayThe path. See {@link get_node_by_path()}.
if( isset
($node['selected']) )
return $node['selected'];
* Get the reference of a node from the menu entries using a path.
* @param array|string|NULLThe path. NULL means root, string means child of root,
* array means path below root.
* (eg <code>array('options', 'general')</code>).
* @param boolean Should the node be created if it does not exist already?
* @return array|falseThe node as array or false, if the path does not exist (and we do not $createIfNotExisting).
foreach( $path as $lStep )
if( ! isset
($node['entries'][$lStep]) )
if( $createIfNotExisting )
$node['entries'][$lStep] =
array();
$node =
& $node['entries'][$lStep];
* 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..
* @param string Name of the template ('main', 'sub')
* @param integer Nesting level (start at 0)
* @return array Associative array which defines layout and optionally properties.
global $app_shortname, $app_version;
'before' =>
'<div id="mainmenu"><ul>',
'after' =>
"</ul>\n<p class=\"center\">$app_shortname v <strong>$app_version</strong></p>\n</div>",
'beforeEachSel' =>
'<li class="current">',
'afterEachSel' =>
'</li>',
'beforeEachSelWithSub' =>
'<li class="parent">',
'afterEachSelWithSub' =>
'</li>',
* @todo Move to new skin (recurse for subentries if an entry is selected)
'recurseSelected' => true,
'before' =>
'<ul class="submenu">',
'beforeEachSel' =>
'<li class="current">',
'afterEachSel' =>
'</li>',
// submenu, we support just one sub-level (by default)
'before' =>
'<div class="pt">'
.
"\n".
'<ul class="hack">'
.
"\n<li><!-- Yes, this empty UL is needed! It's a DOUBLE hack for correct CSS display --></li>"
// TODO: this hack MAY NOT be needed when not using pixels instead of decimal ems or exs in the CSS
.
"\n".
'<div class="panelblocktabs">'
.
"\n".
'<ul class="tabs">',
'after' =>
"</ul>\n</div>\n</div>"
.
"\n".
'<div class="tabbedpanelblock">',
'empty' =>
'<div class="panelblock">',
'beforeEachSel' =>
'<li class="current">',
'afterEachSel' =>
'</li>',
'end' =>
'</div>', // used to end payload block that opened submenu
// a payload block, anywhere "below" submenu. Gets used by disp_payload_begin()/disp_payload_end()
'begin' =>
'<div class="panelblock">',
// Template for a list of Collections (Blogs)
// fp>> I'll use the following as soon as I have time to play with the CSS:
'before' =>
'<ul class="submenu">',
'beforeEachSel' =>
'<li class="current">',
'afterEachSel' =>
'</li>',
'before' =>
'<div class="results">',
'header_start' =>
'<div class="results_nav">',
'header_text' =>
'<strong>'.
T_('Pages').
'</strong>: $prev$ $first$ $list_prev$ $list$ $list_next$ $last$ $next$',
'header_text_single' =>
'',
'header_end' =>
'</div>',
'list_start' =>
'<table class="grouped" cellspacing="0">'.
"\n\n",
'head_start' =>
"<thead><tr>\n",
'head_title' =>
'<th colspan="$nb_cols$"><span style="float:right">$global_icons$</span>$title$</th></tr>'
'filters_start' =>
'<tr class="filters"><td colspan="$nb_cols$">',
'filters_end' =>
'</td></tr>',
'line_start_head' =>
'<tr>', // TODO: fusionner avec colhead_start_first; mettre à jour admin_UI_general; utiliser colspan="$headspan$"
'colhead_start' =>
'<th $class_attrib$>',
'colhead_start_first' =>
'<th class="firstcol $class$">',
'colhead_start_last' =>
'<th class="lastcol $class$">',
'colhead_end' =>
"</th>\n",
'sort_asc_off' =>
'<img src="../admin/img/grey_arrow_up.gif" alt="A" title="'.
T_('Ascending order')
.
'" height="12" width="11" />',
'sort_asc_on' =>
'<img src="../admin/img/black_arrow_up.gif" alt="A" title="'.
T_('Ascending order')
.
'" height="12" width="11" />',
'sort_desc_off' =>
'<img src="../admin/img/grey_arrow_down.gif" alt="D" title="'.
T_('Descending order')
.
'" height="12" width="11" />',
'sort_desc_on' =>
'<img src="../admin/img/black_arrow_down.gif" alt="D" title="'.
T_('Descending order')
.
'" height="12" width="11" />',
'basic_sort_asc' =>
get_icon( 'ascending' ),
'basic_sort_desc' =>
get_icon( 'descending' ),
'head_end' =>
"</tr></thead>\n\n",
'tfoot_start' =>
"<tfoot>\n",
'tfoot_end' =>
"</tfoot>\n\n",
'body_start' =>
"<tbody>\n",
'line_start' =>
"<tr>\n",
'line_start_odd' =>
'<tr class="odd">'.
"\n",
'line_start_last' =>
'<tr class="lastline">'.
"\n",
'line_start_odd_last' =>
'<tr class="odd lastline">'.
"\n",
'col_start' =>
'<td $class_attrib$>',
'col_start_first' =>
'<td class="firstcol $class$">',
'col_start_last' =>
'<td class="lastcol $class$">',
'line_end' =>
"</tr>\n\n",
'grp_line_start' =>
'<tr class="group">'.
"\n",
'grp_line_start_odd' =>
'<tr class="odd">'.
"\n",
'grp_line_start_last' =>
'<tr class="lastline">'.
"\n",
'grp_line_start_odd_last' =>
'<tr class="odd lastline">'.
"\n",
'grp_col_start' =>
'<td $class_attrib$ $colspan_attrib$>',
'grp_col_start_first' =>
'<td class="firstcol $class$" $colspan_attrib$>',
'grp_col_start_last' =>
'<td class="lastcol $class$" $colspan_attrib$>',
'grp_col_end' =>
"</td>\n",
'grp_line_end' =>
"</tr>\n\n",
'body_end' =>
"</tbody>\n\n",
'total_line_start' =>
'<tr class="total">'.
"\n",
'total_col_start' =>
'<td $class_attrib$>',
'total_col_start_first' =>
'<td class="firstcol $class$">',
'total_col_start_last' =>
'<td class="lastcol $class$">',
'total_col_end' =>
"</td>\n",
'total_line_end' =>
"</tr>\n\n",
'list_end' =>
"</table>\n\n",
'footer_start' =>
'<div class="results_nav">',
'footer_text' =>
'<strong>'.
T_('Pages').
'</strong>: $prev$ $first$ $list_prev$ $list$ $list_next$ $last$ $next$'
/* T_('Page $scroll_list$ out of $total_pages$ $prev$ | $next$<br />'. */
/* '<strong>$total_pages$ Pages</strong> : $prev$ $list$ $next$' */
/* .' <br />$first$ $list_prev$ $list$ $list_next$ $last$ :: $prev$ | $next$') */,
'footer_text_single' =>
T_('1 page'),
'footer_text_no_limit' =>
'', // Text if theres no LIMIT and therefor only one page anyway
'prev_text' =>
T_('Previous'),
'next_text' =>
T_('Next'),
'list_prev_text' =>
T_('...'),
'list_next_text' =>
T_('...'),
'scroll_list_range' =>
5,
'footer_end' =>
"</div>\n\n",
'no_results_start' =>
'<table class="grouped clear" cellspacing="0">'.
"\n\n"
.
'<th><span style="float:right">$global_icons$</span>'
.
'$title$</th></tr>'.
"\n",
'no_results_end' =>
'<tr class="lastline"><td class="firstcol lastcol">'.
T_('No results.').
'</td></tr>'
// Default Form settings:
// TODO: add default settings for 'table', 'fieldset', etc...
debug_die( 'Unknown $name for AdminUI::get_template(): '.
var_export($name, true) /* PHP 4.2 ! */ );
* Add a headline for HTML <head>.
* @param string The line that should be added to <head>.
* Get the headlines for HTML <head> (CSS files especially).
* To define headlines for a derived skin, add entries to
* {@link $headlines} and "return parent::get_headlines();".
* @return string The concatenated headlines to output in HTML <head>.
* @todo Move generation of blog list to this class!
if( !empty($blogListButtons) )
return $before.
$blogListButtons.
$after;
* Get a path key by numeric key. Starts with 0.
* @param integer The numeric index of the path (0 is first).
* @param boolean Also return properties?
* @return string|array|false(depends on $withProps)
function get_path( $which, $withProps =
false )
if( !isset
($this->path[$which]) )
'path' =>
$this->path[$which],
return $this->path[$which];
* Get tghe list of path keys in a given range.
* @param integer start index
* @param integer|NULLend index (NULL means same as start index)
* @return array List of path keys.
for( $i =
$start; $i <=
$end; $i++
)
$r[] = isset
($this->path[$i]) ?
$this->path[$i] :
NULL;
* 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:
* - {@link append_path_level()}
* This also marks the parent node as selected and checks for permissions.
* @param integer Path level to set (starts at 0)
* @param array Either the key of the path or an array(keyname, propsArray).
* @param array Properties for this path entry.
* @param boolean Exit script when the user has no permissions to this path and
* text_noperm is not set for the path?
* @return boolean True if perm granted, false if not (and we're not exiting).
function set_path_level( $level, $pathKey, $pathProps =
array(), $die_if_no_perm =
true )
// Get the parent node (the level above this one):
{ // first level in menu-path: parent node is NULL
{ // parent node is the trunk from root to previous level
{ // parent node does not exist:
// Store the selected entry name in the parent node:
$parentNode['selected'] =
$pathKey;
$this->path[$level] =
$pathKey;
// FP> WHY ON EARTH would we want to do that? $this->pathProps[$level] = array_merge( $parentNode, $pathProps );
// pre_dump( 'set_path_level: ', $level, $pathKey, $this->pathProps[$level] );
if( ! $perm &&
empty($pathProps['text_noperm']) &&
$die_if_no_perm )
debug_die( T_('Permission denied!').
' (set_path_level: '.
$level.
'/'.
$pathKey.
')' );
* Append a selected menu entry to the current path of selected entries.
* @param string|arrayEither the key of the path or an array(keyname, propsArray).
$search_path =
$this->path;
// auto-detect path props from menu entries
// Set the path level right after the last existing one:
* Set the full selected path.
* For example, this selects the tab/submenu 'plugins' in the main menu 'options':
* set_path( 'options', 'plugins' );
* Use {@link append_path_level()} to append a single path element.
* This is an easy stub for {@link set_path_level()}.
* @param string|array,...VARIABLE NUMBER OF ARGUMENTS. Each is either the key of a path entry or an array(keyname, propsArray).
$prevPath =
array(); // Remember the path we have walked through
// Loop though all path levels to set:
{ // Path name and properties given
list
( $pathName, $pathProps ) =
$arg;
{ // the node exists in the menu entries: merge the properties
* Get the top of the HTML <body>.
* Get the end of the HTML <body>. Close open divs, etc...
* GLOBAL HEADER - APP TITLE, LOGOUT, ETC.
global $app_shortname, $app_version, $current_User, $htsrv_url_sensitive, $admin_url, $baseurl, $rsc_url;
<span id="headfunctions">'
// Note: if we log in with another user, we may not have the perms to come back to the same place any more, thus: redirect to admin home.
<img src="'.
$rsc_url.
'icons/close.gif" width="14" height="14" border="0" class="top" alt="" title="'
'.
$app_shortname.
' v <strong>'.
$app_version.
'</strong>
* Get default head info (local time, GMT, Login).
global $pagenow, $obhandler_debug, $localtimenow, $servertimenow, $current_User;
{ // don't display changing time when we want to test obhandler
.
' · <acronym title="'.
T_('Greenwich Mean Time').
'">'
.
/* TRANS: short for Greenwich Mean Time */ T_('GMT:').
'</acronym> <strong>'.
gmdate( locale_timefmt(), $servertimenow).
'</strong>'
.
' · '.
T_('Logged in as:').
' <strong><a href="'.
$pagenow.
'?ctrl=users&user_ID='.
$current_User->ID.
'">'.
$current_User->dget('login').
'</a></strong>'
* Checks if {@link $current_User the current User} has needed perms on a menu entry.
* @param array 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.
if( isset
($perminfo['perm_name']) )
{ // 'perm_name' given, check it together with 'perm_level' (which defaults to 'any')
$perm_level = isset
( $perminfo['perm_level'] ) ?
$perminfo['perm_level'] :
'any';
if( ! $current_User->check_perm( $perminfo['perm_name'], $perm_level ) )
if( isset
($perminfo['perm_eval']) )
{ // also check for 'perm_eval'
if( ! eval
($perminfo['perm_eval']) )
* $Log: _adminUI_general.class.php,v $
* Revision 1.25.2.6 2006/11/27 19:11:12 fplanque
* Revision 1.25.2.5 2006/11/04 19:55:15 fplanque
* Reinjected old Log blocks. Removing them from CVS was a bad idea -- especially since Daniel has decided branch 1.9 was his HEAD...
* Revision 1.25 2006/07/12 20:17:13 fplanque
* Revision 1.24 2006/07/08 22:33:43 blueyed
* Integrated "simple edit form".
* Revision 1.23 2006/07/08 17:04:19 fplanque
* Revision 1.21 2006/06/25 23:34:15 blueyed
* Revision 1.20 2006/06/25 23:23:38 blueyed
* Revision 1.19 2006/06/22 22:30:05 blueyed
* htsrv url for password related scripts (login, register and profile update)
* Revision 1.18 2006/06/22 19:23:01 blueyed
* Text for fotter, if no LIMIT
* Revision 1.17 2006/06/22 18:37:48 fplanque
* Revision 1.16 2006/06/14 17:03:59 fplanque
* A little better logout from admin... useful for bozos.
* Revision 1.15 2006/06/13 21:49:16 blueyed
* Revision 1.13.2.3 2006/06/12 20:00:57 fplanque
* one too many massive syncs...
* Revision 1.13 2006/05/12 21:53:38 blueyed
* Fixes, cleanup, translation for plugins
* Revision 1.12 2006/05/02 18:15:20 fplanque
* Revision 1.11 2006/04/27 18:28:33 fplanque
* moved Blog specific stuff out of evocore
* Revision 1.10 2006/04/24 20:43:43 blueyed
* Exit to selected blog, if any
* Revision 1.9 2006/04/19 17:17:19 blueyed
* Revision 1.8 2006/04/19 12:54:41 fplanque
* not using exit links any more because it won't translate
* Revision 1.7 2006/04/14 19:25:32 fplanque
* evocore merge with work app
* Revision 1.6 2006/04/12 15:16:54 fplanque
* Revision 1.5 2006/04/11 21:56:27 blueyed
* Revision 1.4 2006/04/04 21:54:23 blueyed
* Revision 1.2 2006/03/12 23:09:30 fplanque
* Revision 1.1 2006/02/23 21:12:51 fplanque
* File reorganization to MVC (Model View Controller) architecture.
* See index.hml files in folders.
* (Sorry for all the remaining bugs induced by the reorg... :/)
* Revision 1.52 2006/02/03 21:58:04 fplanque
* Too many merges, too little time. I can hardly keep up. I'll try to check/debug/fine tune next week...
* Revision 1.51 2006/02/01 20:06:15 blueyed
* die_if_no_perm re-enabled
* Revision 1.50 2006/01/30 19:49:17 fplanque
* Fixed the 3 broken check_perm() features! 1) text_no_perm 2) perm_eval 3) average user trying to edit his profile
* Revision 1.49 2006/01/30 16:09:33 blueyed
* Revision 1.47 2006/01/26 23:08:35 blueyed
* Revision 1.46 2006/01/26 20:27:45 blueyed
* Revision 1.45 2006/01/25 18:24:21 fplanque
* hooked bozo validator in several different places
* Revision 1.44 2006/01/23 23:29:49 blueyed
* Added permission checks when setting a path
* Revision 1.43 2006/01/10 19:03:16 blueyed
* Use $app_shortname in get_page_head()
* Revision 1.42 2005/12/12 19:21:20 fplanque
* big merge; lots of small mods; hope I didn't make to many mistakes :]
* Revision 1.41 2005/12/08 22:54:02 blueyed
* Revision 1.40 2005/11/25 03:57:57 blueyed
* Revision 1.39 2005/11/17 17:39:55 blueyed
* Removed trailing whitespace in T_() for acronym title
* Revision 1.38 2005/11/03 18:23:43 fplanque
* Revision 1.37 2005/10/30 23:42:46 blueyed
* Refactored get_head_links() into existing get_headlines(); doc
* Revision 1.36 2005/10/28 20:08:46 blueyed
* Revision 1.35 2005/10/26 23:08:28 blueyed
* Revision 1.34 2005/10/12 18:24:37 fplanque
* Revision 1.33 2005/09/06 17:13:53 fplanque
* stop processing early if referer spam has been detected
* Revision 1.32 2005/08/31 19:06:41 fplanque
* Revision 1.30 2005/07/18 14:21:37 fplanque
* Use a default Form layout which can be skin dependant
* Revision 1.29 2005/07/15 16:41:50 fplanque
* Revision 1.28 2005/07/14 21:03:31 blueyed
* Fixed notice with array_merge() again.
* Revision 1.27 2005/07/10 00:09:06 blueyed
* renamed getNode() to get_node_by_path(), fixed array_merge() notice for PHP5
* Revision 1.26 2005/06/23 18:43:06 blueyed
* Fixed constructor's name.
* Revision 1.25 2005/06/22 17:21:39 blueyed
* Revision 1.24 2005/06/03 20:14:37 fplanque
* started input validation framework
* Revision 1.22 2005/05/02 19:06:44 fplanque
* started paging of user list..
* Revision 1.21 2005/04/28 20:44:17 fplanque
* Revision 1.20 2005/04/21 18:01:28 fplanque
* Revision 1.19 2005/04/15 18:02:57 fplanque
* finished implementation of properties/meta data editor
* started implementation of files to items linking
* Revision 1.18 2005/03/21 17:37:47 fplanque
* results/table layout refactoring
* Revision 1.17 2005/03/18 00:24:04 blueyed
* Revision 1.16 2005/03/17 14:06:37 fplanque
* put back page titles in logical order
* Revision 1.15 2005/03/16 19:58:13 fplanque
* small AdminUI cleanup tasks
* Revision 1.14 2005/03/16 16:05:09 fplanque
* Revision 1.13 2005/03/13 19:46:53 blueyed
* application config layer
* Revision 1.12 2005/03/11 12:40:15 fplanque
* multiple browsing views, part ONE