1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-30 19:30:25 +02:00

Upgraded userclass admin area to use renderHelp() and gave it its own shortcode {ADMINUI_HELP}

This commit is contained in:
Cameron
2015-04-09 11:13:26 -07:00
parent 72a112fb4b
commit b749bdb707
5 changed files with 43 additions and 42 deletions

View File

@@ -93,8 +93,8 @@ include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
'checkboxes' => array ( 'title' => '', 'type' => null, 'data' => null, 'width' => '5%', 'thclass' => 'center', 'forced' => '1', 'class' => 'center', 'toggle' => 'e-multiselect', ),
'userclass_id' => array('title'=> LAN_ID, 'type' =>'hidden', 'data'=>'int', 'width' => '5%', 'thclass' => 'left'),
'userclass_icon' => array('title'=> UCSLAN_68, 'type' => 'icon', 'data'=>'str', 'width' => '5%', 'thclass' => 'left', 'class' => 'center'),
'userclass_name' => array('title'=> UCSLAN_12, 'type' => 'text', 'data'=>'str', 'width' => 'auto', 'thclass' => 'left'),
'userclass_description' => array('title'=> UCSLAN_13, 'type' => 'text', 'data'=>'str', 'width' => 'auto', 'thclass' => 'left', 'writeParms'=>array('size'=>'xxlarge')),
'userclass_name' => array('title'=> UCSLAN_12, 'type' => 'text', 'data'=>'str', 'inline'=>true, 'width' => 'auto', 'thclass' => 'left'),
'userclass_description' => array('title'=> UCSLAN_13, 'type' => 'text', 'data'=>'str', 'inline'=>true,'width' => 'auto', 'thclass' => 'left', 'writeParms'=>array('size'=>'xxlarge')),
'userclass_type' => array('title'=> UCSLAN_79, 'type' => 'dropdown', 'data'=>'int', 'width' => '10%', 'thclass' => 'left', 'class'=>'left' ),
'userclass_editclass' => array('title'=> UCSLAN_24, 'type' => 'userclass', 'data'=>'int', 'width' => 'auto', 'thclass' => 'left', 'writeParms'=>array('classlist'=>'nobody,public,main,admin,classes,matchclass,member, no-excludes')),
'userclass_visibility' => array('title'=> UCSLAN_34, 'type' => 'userclass', 'data'=>'int', 'width' => 'auto', 'thclass' => 'left'),
@@ -166,6 +166,17 @@ include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
}
function renderHelp()
{
$e_userclass = e107::getSingleton('user_class_admin'); // Admin functions - should just obliterate any previous object created in class2.php
$e_userclass->calc_tree();
$text = "<div id='userclass-tree-structure'>".$e_userclass->show_graphical_tree()."</div>";
return array('caption'=>'Class Structure', 'text' => $text);
// $text .= $e_userclass->show_graphical_tree();
}
public function optionsPage()
{
$mes = e107::getMessage();
@@ -1382,28 +1393,6 @@ function userclass2_adminmenu()
*/
function e_help()
{
// require_once(e_HANDLER.'userclass_class.php'); // Modified class handler
// $e_userclass = new user_class_admin;
$e_userclass = e107::getSingleton('user_class_admin'); // Admin functions - should just obliterate any previous object created in class2.php
$e_userclass->calc_tree();
$text2 = "<div id='userclass-tree-structure'>".$e_userclass->show_graphical_tree()."</div>";
$help = e_LANGUAGEDIR.e_LANGUAGE.'/admin/help/userclass2.php';
if(is_readable($help))
{
require_once($help);
}
// require_once(e_LANGUAGEDIR.e_LANGUAGE.'/admin/help/userclass2.php');
return array('caption'=>'Class Structure', 'text' => $text2);
// $text .= $e_userclass->show_graphical_tree();
}
/*

View File

@@ -131,6 +131,17 @@ class admin_shortcodes
return $ns -> tablerender(FOOTLAN_14,$text, array('id' => 'admin_docs', 'style' => 'button_menu'), TRUE);
}
function sc_adminui_help()
{
if (!ADMIN) { return ''; }
if($tmp = e107::getRegistry('core/e107/adminui/help'))
{
return e107::getRender()->tablerender($tmp['caption'],$tmp['text'],'e_help',true);
}
}
function sc_admin_help()
{
if (!ADMIN) { return ''; }
@@ -138,11 +149,6 @@ class admin_shortcodes
$ns = e107::getRender();
$pref = e107::getPref();
if($tmp = e107::getRegistry('core/e107/adminui/help'))
{
return $ns->tablerender($tmp['caption'],$tmp['text'],'e_help',true);
}
if(function_exists('e_help') && ($tmp = e_help())) // new in v2.x for non-admin-ui admin pages.
{

View File

@@ -63,7 +63,7 @@ class news_shortcodes extends e_shortcode
return '<a href="'.$this->sc_newsurl().'" title="'.preg_replace('/\'|"|<|>/s', '', $this->news_item['news_title']).'">'.$title.'</a>';
}
function sc_newsbody($parm)
function sc_newsbody($parm=null)
{
$tp = e107::getParser();
e107::getBB()->setClass("news"); // For automatic bbcode image resizing.
@@ -81,7 +81,7 @@ class news_shortcodes extends e_shortcode
return $news_body;
}
function sc_newsicon($parm)
function sc_newsicon($parm=null)
{
return $this->sc_newscaticon('url');
@@ -103,7 +103,7 @@ class news_shortcodes extends e_shortcode
return "<a href='http://e107.org'>e107</a>";
}
function sc_newscomments($parm)
function sc_newscomments($parm=null)
{
$pref = e107::getPref();
@@ -155,7 +155,7 @@ class news_shortcodes extends e_shortcode
return (!$news_item['news_allow_comments'] ? ''.($pref['comments_icon'] ? $NEWIMAGE.' ' : '')."<a title='Comments' href='".e107::getUrl()->create('news/view/item', $news_item)."'>".$param['commentlink'].intval($news_item['news_comment_total']).'</a>' : vartrue($param['commentoffstring'],'Disabled') );
}
function sc_trackback($parm)
function sc_trackback($parm=null)
{
global $pref;
if(!vartrue($pref['trackbackEnabled'])) { return ''; }
@@ -175,7 +175,7 @@ class news_shortcodes extends e_shortcode
* @example {NEWSNAVLINK: items=category} // News items for current category.
* @example {NEWSNAVLINK: text=myCaption} // Default News item view. ie. news.php
*/
function sc_newsnavlink($parm='') //TODO add more options.
function sc_newsnavlink($parm=null) //TODO add more options.
{
if(varset($parm['list']) == 'all') // A list of all items - usually headings and thumbnails
@@ -208,13 +208,13 @@ class news_shortcodes extends e_shortcode
function sc_newsheader($parm)
function sc_newsheader($parm=null)
{
return $this->sc_newscaticon('src');
}
function sc_newscategory($parm)
function sc_newscategory($parm=null)
{
$category_name = e107::getParser()->toHTML($this->news_item['category_name'], FALSE ,'defs');
$category = array('id' => $this->news_item['category_id'], 'name' => $this->news_item['category_sef'] );
@@ -256,7 +256,7 @@ class news_shortcodes extends e_shortcode
* {NEWSCOMMENTLINK: glyph=comments&class=btn btn-default btn-sm}
*
*/
function sc_newscommentlink($parm='')
function sc_newscommentlink($parm=null)
{
if($this->commentsDisabled)
@@ -274,7 +274,7 @@ class news_shortcodes extends e_shortcode
/**
* {NEWSCOMMENTCOUNT: glyph=x}
*/
function sc_newscommentcount($parm='')
function sc_newscommentcount($parm=null)
{
if($this->commentsDisabled || ($this->commentsEngine != 'e107'))
{
@@ -754,7 +754,7 @@ class news_shortcodes extends e_shortcode
* @param string $parm
* @return string
*/
function sc_newsitem_schook($parm)
function sc_newsitem_schook($parm='')
{
$parm = explode('|', $parm, 2);
$parm[1] = 'news_id='.$this->news_item['news_id'].(varset($parm[1]) ? '&'.$parm[1] : '');

View File

@@ -1218,9 +1218,14 @@ class user_class_admin extends user_class
$this->class_tree[$parent]['userclass_accum'] = $imp_rights;
if (!isset($this->class_tree[$cp]['change_flag'])) $this->class_tree[$parent]['change_flag'] = 'UPDATE';
}
foreach ($this->class_tree[$parent]['class_children'] as $cc)
if(!empty($this->class_tree[$parent]['class_children']))
{
$this->rebuild_tree($cc,$rights); // Recursive call
foreach ($this->class_tree[$parent]['class_children'] as $cc)
{
$this->rebuild_tree($cc,$rights); // Recursive call
}
}
}

View File

@@ -202,7 +202,8 @@ $ADMIN_HEADER .= '<div class="container-fluid">
{ADMIN_PWORD}
{SETSTYLE=site_info}
{ADMINUI_HELP}
{ADMIN_HELP}
{ADMIN_SITEINFO=creditsonly}
{SETSTYLE=admin_menu}