1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 12:20:44 +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:
Cameron
2017-01-14 10:42:21 -08:00
parent ad84ba1edb
commit 4765d19024

View File

@@ -916,6 +916,8 @@ if (!class_exists('e107table', false))
private $adminThemeClass = '';
public $frontend = null;
private $uniqueId = null;
private $content = array();
private $contentTypes = array('header','footer','text','title','image');
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 $text string
@@ -1017,17 +1036,27 @@ if (!class_exists('e107table', false))
{
$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)))
{
$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
{
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->content = array();
}