mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 13:47:31 +02:00
Bootstrap 4 'Cards' support. New setContent() method added for breakdown of $text into separate elements for use by tablestyle() when available.
This commit is contained in:
33
class2.php
33
class2.php
@@ -916,6 +916,8 @@ if (!class_exists('e107table', false))
|
|||||||
private $adminThemeClass = '';
|
private $adminThemeClass = '';
|
||||||
public $frontend = null;
|
public $frontend = null;
|
||||||
private $uniqueId = null;
|
private $uniqueId = null;
|
||||||
|
private $content = array();
|
||||||
|
private $contentTypes = array('header','footer','text','title','image');
|
||||||
|
|
||||||
|
|
||||||
function __construct()
|
function __construct()
|
||||||
@@ -944,6 +946,23 @@ if (!class_exists('e107table', false))
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set Advanced Menu content (beyond just $caption and $text)
|
||||||
|
* @param string $type header|footer|text|title|image
|
||||||
|
* @param string $val
|
||||||
|
*/
|
||||||
|
public function setContent($type, $val)
|
||||||
|
{
|
||||||
|
if(!in_array($type,$this->contentTypes))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->content[$type] = (string) $val;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $caption string caption text
|
* @param $caption string caption text
|
||||||
* @param $text string
|
* @param $text string
|
||||||
@@ -1017,17 +1036,27 @@ if (!class_exists('e107table', false))
|
|||||||
{
|
{
|
||||||
$thm = new $this->themeClass();
|
$thm = new $this->themeClass();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$options = $this->content;
|
||||||
|
|
||||||
|
$options['uniqueId'] = $this->uniqueId;
|
||||||
|
$options['menuArea'] = $this->eMenuArea;
|
||||||
|
$options['menuCount'] = $this->eMenuCount;
|
||||||
|
$options['menuTotal'] = varset($this->eMenuTotal[$this->eMenuArea]);
|
||||||
|
$options['setStyle'] = $this->eSetStyle;
|
||||||
|
|
||||||
|
|
||||||
if(is_object(vartrue($thm)))
|
if(is_object(vartrue($thm)))
|
||||||
{
|
{
|
||||||
$thm->tablestyle($caption, $text, $mode, array('uniqueId'=>$this->uniqueId, 'menuArea'=>$this->eMenuArea, 'menuCount'=>$this->eMenuCount, 'menuTotal'=>varset($this->eMenuTotal[$this->eMenuArea]), 'setStyle'=>$this->eSetStyle));
|
$thm->tablestyle($caption, $text, $mode, $options);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
tablestyle($caption, $text, $mode, array('uniqueId'=>$this->uniqueId, 'menuArea'=>$this->eMenuArea,'menuCount'=>$this->eMenuCount,'menuTotal'=>varset($this->eMenuTotal[$this->eMenuArea]),'setStyle'=>$this->eSetStyle));
|
tablestyle($caption, $text, $mode, $options);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->uniqueId = null;
|
$this->uniqueId = null;
|
||||||
|
$this->content = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user