mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 20:00:37 +02:00
Upgraded userclass admin area to use renderHelp() and gave it its own shortcode {ADMINUI_HELP}
This commit is contained in:
@@ -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', ),
|
'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_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_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_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', 'width' => 'auto', 'thclass' => 'left', 'writeParms'=>array('size'=>'xxlarge')),
|
'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_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_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'),
|
'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()
|
public function optionsPage()
|
||||||
{
|
{
|
||||||
$mes = e107::getMessage();
|
$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();
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -131,6 +131,17 @@ class admin_shortcodes
|
|||||||
return $ns -> tablerender(FOOTLAN_14,$text, array('id' => 'admin_docs', 'style' => 'button_menu'), TRUE);
|
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()
|
function sc_admin_help()
|
||||||
{
|
{
|
||||||
if (!ADMIN) { return ''; }
|
if (!ADMIN) { return ''; }
|
||||||
@@ -138,11 +149,6 @@ class admin_shortcodes
|
|||||||
$ns = e107::getRender();
|
$ns = e107::getRender();
|
||||||
$pref = e107::getPref();
|
$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.
|
if(function_exists('e_help') && ($tmp = e_help())) // new in v2.x for non-admin-ui admin pages.
|
||||||
{
|
{
|
||||||
|
@@ -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>';
|
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();
|
$tp = e107::getParser();
|
||||||
e107::getBB()->setClass("news"); // For automatic bbcode image resizing.
|
e107::getBB()->setClass("news"); // For automatic bbcode image resizing.
|
||||||
@@ -81,7 +81,7 @@ class news_shortcodes extends e_shortcode
|
|||||||
return $news_body;
|
return $news_body;
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_newsicon($parm)
|
function sc_newsicon($parm=null)
|
||||||
{
|
{
|
||||||
|
|
||||||
return $this->sc_newscaticon('url');
|
return $this->sc_newscaticon('url');
|
||||||
@@ -103,7 +103,7 @@ class news_shortcodes extends e_shortcode
|
|||||||
return "<a href='http://e107.org'>e107</a>";
|
return "<a href='http://e107.org'>e107</a>";
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_newscomments($parm)
|
function sc_newscomments($parm=null)
|
||||||
{
|
{
|
||||||
|
|
||||||
$pref = e107::getPref();
|
$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') );
|
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;
|
global $pref;
|
||||||
if(!vartrue($pref['trackbackEnabled'])) { return ''; }
|
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: items=category} // News items for current category.
|
||||||
* @example {NEWSNAVLINK: text=myCaption} // Default News item view. ie. news.php
|
* @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
|
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');
|
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_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'] );
|
$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}
|
* {NEWSCOMMENTLINK: glyph=comments&class=btn btn-default btn-sm}
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function sc_newscommentlink($parm='')
|
function sc_newscommentlink($parm=null)
|
||||||
{
|
{
|
||||||
|
|
||||||
if($this->commentsDisabled)
|
if($this->commentsDisabled)
|
||||||
@@ -274,7 +274,7 @@ class news_shortcodes extends e_shortcode
|
|||||||
/**
|
/**
|
||||||
* {NEWSCOMMENTCOUNT: glyph=x}
|
* {NEWSCOMMENTCOUNT: glyph=x}
|
||||||
*/
|
*/
|
||||||
function sc_newscommentcount($parm='')
|
function sc_newscommentcount($parm=null)
|
||||||
{
|
{
|
||||||
if($this->commentsDisabled || ($this->commentsEngine != 'e107'))
|
if($this->commentsDisabled || ($this->commentsEngine != 'e107'))
|
||||||
{
|
{
|
||||||
@@ -754,7 +754,7 @@ class news_shortcodes extends e_shortcode
|
|||||||
* @param string $parm
|
* @param string $parm
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function sc_newsitem_schook($parm)
|
function sc_newsitem_schook($parm='')
|
||||||
{
|
{
|
||||||
$parm = explode('|', $parm, 2);
|
$parm = explode('|', $parm, 2);
|
||||||
$parm[1] = 'news_id='.$this->news_item['news_id'].(varset($parm[1]) ? '&'.$parm[1] : '');
|
$parm[1] = 'news_id='.$this->news_item['news_id'].(varset($parm[1]) ? '&'.$parm[1] : '');
|
||||||
|
@@ -1218,9 +1218,14 @@ class user_class_admin extends user_class
|
|||||||
$this->class_tree[$parent]['userclass_accum'] = $imp_rights;
|
$this->class_tree[$parent]['userclass_accum'] = $imp_rights;
|
||||||
if (!isset($this->class_tree[$cp]['change_flag'])) $this->class_tree[$parent]['change_flag'] = 'UPDATE';
|
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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -202,7 +202,8 @@ $ADMIN_HEADER .= '<div class="container-fluid">
|
|||||||
|
|
||||||
{ADMIN_PWORD}
|
{ADMIN_PWORD}
|
||||||
{SETSTYLE=site_info}
|
{SETSTYLE=site_info}
|
||||||
|
|
||||||
|
{ADMINUI_HELP}
|
||||||
{ADMIN_HELP}
|
{ADMIN_HELP}
|
||||||
{ADMIN_SITEINFO=creditsonly}
|
{ADMIN_SITEINFO=creditsonly}
|
||||||
{SETSTYLE=admin_menu}
|
{SETSTYLE=admin_menu}
|
||||||
|
Reference in New Issue
Block a user