mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 11:50:30 +02:00
Protect admin-area tablerender() from conflicts.
This commit is contained in:
76
class2.php
76
class2.php
@@ -780,27 +780,29 @@ if (!class_exists('e107table', false))
|
||||
class e107table
|
||||
{
|
||||
|
||||
public $eMenuCount = 0;
|
||||
public $eMenuArea;
|
||||
public $eMenuTotal = array();
|
||||
public $eSetStyle;
|
||||
public $eMenuCount = 0;
|
||||
public $eMenuArea;
|
||||
public $eMenuTotal = array();
|
||||
public $eSetStyle;
|
||||
private $themeClass = '';
|
||||
private $adminThemeClass = '';
|
||||
|
||||
|
||||
function __construct()
|
||||
{
|
||||
// $this->themeClass = e107::getPref('sitetheme')."_theme"; // disabled at the moment.
|
||||
$this->adminThemeClass = e107::getPref('admintheme')."_admintheme"; // Check for a class.
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $caption
|
||||
* @param $text
|
||||
* @param $mode
|
||||
* @param $caption string caption text
|
||||
* @param $text body text
|
||||
* @param $mode unique identifier
|
||||
* @param $return boolean : return the html instead of echo it.
|
||||
* @return null
|
||||
*/
|
||||
function tablerender($caption, $text, $mode = 'default', $return = false)
|
||||
public function tablerender($caption, $text, $mode = 'default', $return = false)
|
||||
{
|
||||
|
||||
/*
|
||||
# Render style table
|
||||
# - parameter #1: string $caption, caption text
|
||||
# - parameter #2: string $text, body text
|
||||
# - return null
|
||||
# - scope public
|
||||
*/
|
||||
$override_tablerender = e107::getSingleton('override', e_HANDLER.'override_class.php')->override_check('tablerender');
|
||||
|
||||
if ($override_tablerender)
|
||||
@@ -820,8 +822,9 @@ if (!class_exists('e107table', false))
|
||||
{
|
||||
$this->eMenuCount++;
|
||||
}
|
||||
|
||||
ob_start();
|
||||
tablestyle($caption, $text, $mode, array('menuArea'=>$this->eMenuArea, 'menuCount'=>$this->eMenuCount, 'menuTotal'=>varset($this->eMenuTotal[$this->eMenuArea]), 'setStyle'=>$this->eSetStyle));
|
||||
$this->tablestyle($caption, $text, $mode);
|
||||
$ret=ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
@@ -834,11 +837,48 @@ if (!class_exists('e107table', false))
|
||||
{
|
||||
$this->eMenuCount++;
|
||||
}
|
||||
tablestyle($caption, $text, $mode, array('menuArea'=>$this->eMenuArea,'menuCount'=>$this->eMenuCount,'menuTotal'=>varset($this->eMenuTotal[$this->eMenuArea]),'setStyle'=>$this->eSetStyle));
|
||||
|
||||
$this->tablestyle($caption, $text, $mode);
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Output the styled template.
|
||||
* @param $caption
|
||||
* @param $text
|
||||
* @param $mode
|
||||
*/
|
||||
private function tablestyle($caption, $text, $mode)
|
||||
{
|
||||
|
||||
if(class_exists($this->adminThemeClass))
|
||||
{
|
||||
$thm = new $this->adminThemeClass();
|
||||
}
|
||||
elseif(class_exists($this->themeClass)) // disabled at the moment.
|
||||
{
|
||||
$thm = new $this->themeClass();
|
||||
}
|
||||
|
||||
if(is_object($thm))
|
||||
{
|
||||
$thm->tablestyle($caption, $text, $mode, array('menuArea'=>$this->eMenuArea, 'menuCount'=>$this->eMenuCount, 'menuTotal'=>varset($this->eMenuTotal[$this->eMenuArea]), 'setStyle'=>$this->eSetStyle));
|
||||
}
|
||||
else
|
||||
{
|
||||
tablestyle($caption, $text, $mode, array('menuArea'=>$this->eMenuArea,'menuCount'=>$this->eMenuCount,'menuTotal'=>varset($this->eMenuTotal[$this->eMenuArea]),'setStyle'=>$this->eSetStyle));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
//#############################################################
|
||||
|
||||
|
@@ -48,160 +48,165 @@ else
|
||||
$no_core_css = TRUE;
|
||||
|
||||
|
||||
function tablestyle($caption, $text, $mode)
|
||||
class bootstrap_admintheme
|
||||
{
|
||||
global $style;
|
||||
|
||||
$class = '';
|
||||
|
||||
|
||||
|
||||
|
||||
if(is_string($mode) && $mode == 'admin_help') $class = ' '.str_replace('_', '-', $mode);
|
||||
function tablestyle($caption, $text, $mode)
|
||||
{
|
||||
global $style;
|
||||
|
||||
$class = '';
|
||||
|
||||
if($mode == 'e_help')
|
||||
{
|
||||
$style = 'admin_menu';
|
||||
}
|
||||
|
||||
if($mode == 'core-infopanel_latest' || $mode == 'core-infopanel_status')
|
||||
{
|
||||
//return;
|
||||
echo '
|
||||
<!-- Start Mode: '.$mode.' -->
|
||||
<li class="span6 '.$mode.'" >
|
||||
|
||||
<div class="well" style="padding:10px;min-height:220px;" >
|
||||
<div class="nav-header">'.$caption.'</div>
|
||||
<!-- Content Start -->
|
||||
'.$text.'
|
||||
<!-- Content End -->
|
||||
</div>
|
||||
|
||||
</li>
|
||||
<!-- End Mode: '.$mode.' -->
|
||||
';
|
||||
return;
|
||||
}
|
||||
|
||||
if($mode == 'personalize')
|
||||
{
|
||||
echo '
|
||||
<!-- Mode: '.$mode.' -->
|
||||
<div class="well" style="padding:10px">
|
||||
<div class="nav-header">'.$caption.'</div>
|
||||
<!-- Content Start -->
|
||||
'.$text.'
|
||||
<!-- Content End -->
|
||||
</div>
|
||||
<!-- End Mode: '.$mode.' -->
|
||||
';
|
||||
|
||||
|
||||
if(is_string($mode) && $mode == 'admin_help') $class = ' '.str_replace('_', '-', $mode);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if($style == 'core-infopanel')
|
||||
{
|
||||
echo '
|
||||
<!-- Start Style: '.$style.' -->
|
||||
if($mode == 'e_help')
|
||||
{
|
||||
$style = 'admin_menu';
|
||||
}
|
||||
|
||||
<li class="span12">
|
||||
|
||||
<div class="well" >
|
||||
<div class="nav-header">'.$caption.'</div>
|
||||
<!-- Content Start -->
|
||||
'.$text.'
|
||||
<!-- Content End -->
|
||||
</div>
|
||||
|
||||
</li>
|
||||
<!-- End Style: '.$style.' -->
|
||||
';
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(deftrue('e_IFRAME'))
|
||||
{
|
||||
echo '
|
||||
<div class="block">
|
||||
<div class="block-text">
|
||||
if($mode == 'core-infopanel_latest' || $mode == 'core-infopanel_status')
|
||||
{
|
||||
//return;
|
||||
echo '
|
||||
<!-- Start Mode: '.$mode.' -->
|
||||
<li class="span6 '.$mode.'" >
|
||||
|
||||
<div class="well" style="padding:10px;min-height:220px;" >
|
||||
<div class="nav-header">'.$caption.'</div>
|
||||
<!-- Content Start -->
|
||||
'.$text.'
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
|
||||
return;
|
||||
}
|
||||
<!-- Content End -->
|
||||
</div>
|
||||
|
||||
</li>
|
||||
<!-- End Mode: '.$mode.' -->
|
||||
';
|
||||
return;
|
||||
}
|
||||
|
||||
if(trim($caption) == '')
|
||||
{
|
||||
$style = 'no_caption';
|
||||
}
|
||||
|
||||
|
||||
switch(varset($style, 'admin_content'))
|
||||
{
|
||||
|
||||
case 'admin_menu' :
|
||||
if($mode == 'personalize')
|
||||
{
|
||||
echo '
|
||||
<!-- Mode: '.$mode.' -->
|
||||
<div class="well" style="padding:10px">
|
||||
<div class="nav-header">'.$caption.'</div>
|
||||
<!-- Content Start -->
|
||||
'.$text.'
|
||||
<!-- Content End -->
|
||||
</div>
|
||||
<!-- End Mode: '.$mode.' -->
|
||||
';
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if($style == 'core-infopanel')
|
||||
{
|
||||
echo '
|
||||
<!-- Start Style: '.$style.' -->
|
||||
|
||||
<li class="span12">
|
||||
|
||||
<div class="well" >
|
||||
<div class="nav-header">'.$caption.'</div>
|
||||
<!-- Content Start -->
|
||||
'.$text.'
|
||||
<!-- Content End -->
|
||||
</div>
|
||||
|
||||
</li>
|
||||
<!-- End Style: '.$style.' -->
|
||||
';
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(deftrue('e_IFRAME'))
|
||||
{
|
||||
echo '
|
||||
<div class="block">
|
||||
<div class="block-text">
|
||||
'.$text.'
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if(trim($caption) == '')
|
||||
{
|
||||
$style = 'no_caption';
|
||||
}
|
||||
|
||||
|
||||
switch(varset($style, 'admin_content'))
|
||||
{
|
||||
|
||||
case 'admin_menu' :
|
||||
echo '
|
||||
<div class="well sidebar-nav" >
|
||||
<div class="nav-header">'.$caption.'</div>
|
||||
'.$text.'
|
||||
</div>
|
||||
';
|
||||
break;
|
||||
|
||||
case 'site_info' :
|
||||
echo '
|
||||
<div class="well sidebar-nav" >
|
||||
<div class="nav-header">'.$caption.'</div>
|
||||
'.$text.'
|
||||
</div>
|
||||
';
|
||||
break;
|
||||
|
||||
case 'site_info' :
|
||||
echo '
|
||||
<div class="well sidebar-nav" >
|
||||
<div class="nav-header">'.$caption.'</div>
|
||||
<p style="padding:10px">
|
||||
'.$text.'
|
||||
</p>
|
||||
</div>
|
||||
';
|
||||
break;
|
||||
/*
|
||||
case 'admin_content':
|
||||
echo '
|
||||
<div class="block">
|
||||
<h2 class="caption">'.$caption.'</h2>
|
||||
<div class="block-text">
|
||||
'.$text.'
|
||||
<div class="nav-header">'.$caption.'</div>
|
||||
<p style="padding:10px">
|
||||
'.$text.'
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
break;
|
||||
*/
|
||||
|
||||
case 'no_caption' :
|
||||
echo '
|
||||
<div class="block">
|
||||
<div class="block-text">
|
||||
'.$text.'
|
||||
';
|
||||
break;
|
||||
/*
|
||||
case 'admin_content':
|
||||
echo '
|
||||
<div class="block">
|
||||
<h2 class="caption">'.$caption.'</h2>
|
||||
<div class="block-text">
|
||||
'.$text.'
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
echo '
|
||||
<div class="block">
|
||||
<h4 class="caption">'.$caption.'</h4>
|
||||
<div class="block-text">
|
||||
'.$text.'
|
||||
';
|
||||
break;
|
||||
*/
|
||||
|
||||
case 'no_caption' :
|
||||
echo '
|
||||
<div class="block">
|
||||
<div class="block-text">
|
||||
'.$text.'
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
break;
|
||||
';
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
echo '
|
||||
<div class="block">
|
||||
<h4 class="caption">'.$caption.'</h4>
|
||||
<div class="block-text">
|
||||
'.$text.'
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$HEADER = '';
|
||||
$FOOTER = '';
|
||||
|
||||
|
Reference in New Issue
Block a user