';
$text .= "
";
$text .= '
';
if(is_array($xdata['data'] ))
{
$text .= '
';
$slides = array();
foreach($xdata['data'] as $r)
{
if(E107_DBG_PATH)
{
$mes->addDebug(print_a($r,true));
}
$theme = array(
'id' => $r['params']['id'],
'type' => 'theme',
'mode' => $r['params']['mode'],
'name' => stripslashes($r['name']),
'category' => $r['category'],
'preview' => varset($r['screenshots']['image']),
'date' => $r['date'],
'version' => $r['version'],
'thumbnail' => $r['thumbnail'],
'url' => $r['urlView'],
'author' => $r['author'],
'website' => $r['authorUrl'],
'compatibility' => $r['compatibility'],
'description' => $r['description'],
'price' => $r['price'],
'livedemo' => $r['livedemo'],
);
$text .= $this->renderTheme(FALSE, $theme);
$c++;
if($c == 19)
{
$text .= '
';
$slides[] = 1;
$c = 1;
}
}
$text .= "
";
$text .= "
";
$text .= "
";
}
else
{
$mes->addInfo(TPVLAN_80);
}
$indicators = '
';
foreach($slides as $key=>$v)
{
$id = $key + 1;
$indicators .= '';
}
$indicators .= '
';
$text = str_replace("{CAROUSEL_INDICATORS}",$indicators,$text);
$text .= "";
$ns->tablerender(TPVLAN_26.SEP.TPVLAN_69, $mes->render().$text);
}
*/
/*
function showThemes($mode = 'main')
{
global $pref;
$mes = e107::getMessage();
$ns = e107::getRender();
$tp = e107::getParser();
$frm = e107::getForm();
echo "
";
if($mode == "main" || !$mode) // Show Main Configuration
{
foreach ($this->themeArray as $key=>$theme)
{
if($key == $pref['sitetheme'])
{
$text = $this->renderTheme(1, $theme);
}
}
echo "
";
}
// Show Admin Configuration
if($mode == "admin")
{
foreach ($this->themeArray as $key=>$theme)
{
if($key == $pref['admintheme'])
{
$text = $this->renderTheme(2, $theme);
}
}
echo "
";
}
// Show Upload Form
if($mode == "upload")
{
$this->renderUploadForm();
}
// Show All Themes
if($mode == "choose")
{
$text = "";
foreach ($this->themeArray as $key=>$theme)
{
$text .= $this->renderTheme(FALSE, $theme);
// print_a($theme);
}
$text .= "
";
echo "
";
}
if($mode == "online")
{
$this->renderOnline();
}
echo "
\n";
}
*/
/*
function renderUploadForm()
{
$mes = e107::getMessage();
$ns = e107::getRender();
$sql = e107::getDb();
$frm = e107::getForm();
if(!is_writable(e_THEME))
{
$ns->tablerender(TPVLAN_16, TPVLAN_15);
$text = "";
}
else
{
require_once(e_HANDLER.'upload_handler.php');
$max_file_size = get_user_max_upload();
$text = "
";
}
$ns->tablerender(TPVLAN_26.SEP.TPVLAN_38, $mes->render().$text);
}
*/
/**
* @param $theme
* @return string|null
*/
function renderThemeInfo($theme)
{
if(empty($theme))
{
return null;
}
if(!empty($theme['compatibility']) && $theme['compatibility'] == 2)
{
$theme['compatibility'] = '2.0';
}
$version = e107::getParser()->filter(e_VERSION,'version');
$compatLabel = TPVLAN_77;
$compatLabelType = 'warning';
if(version_compare($theme['compatibility'],$version, '<=') === false)
{
$compatLabelType = 'danger';
$compatLabel = defset('TPVLAN_97', "This theme requires a newer version of e107.");
}
global $pref;
$author = !empty($theme['email']) ? "
".$theme['author']."" : $theme['author'];
$website = !empty($theme['website']) ? "
".$theme['website']."" : "";
// $preview = "
".($theme['preview'] ? "" : "")."";
$description = vartrue($theme['description']);
$compat = (version_compare(1.9,$theme['compatibility'],'<')) ? "
".$theme['compatibility']." ".$compatLabel."": vartrue($theme['compatibility'],'1.0');
$price = (!empty($theme['price'])) ? "
".$theme['price']."" : "
".TPVLAN_76."";
$text = e107::getForm()->open('theme-info','post');
$text .= "
";
// $text .= "".$theme['name']." ".$theme['version']." |
";
$text .= "".TPVLAN_75.": | ".$price." |
";
$text .= ($author) ? "".LAN_AUTHOR.": | ".$author." |
" : "";
$text .= ($website) ? "".TPVLAN_5.": | ".$website." |
" : "";
$text .= !empty($theme['date']) ? "".TPVLAN_6.": | ".$theme['date']." |
" : "";
$text .= $compat ? "".TPVLAN_57.": | ".$compat." |
" : "";
$text .= !empty($description) ? "".LAN_DESCRIPTION.": | ".$description." |
" : "";
// $text .= "".TPVLAN_49.": |
// XHTML ";
// $text .= ($theme['xhtmlcompliant']) ? ADMIN_TRUE_ICON : ADMIN_FALSE_ICON;
// $text .= " CSS ";
// $text .= ($theme['csscompliant']) ? ADMIN_TRUE_ICON : ADMIN_FALSE_ICON;
// $text .= " |
";
if(!empty($theme['category']))
{
$text .= "".LAN_CATEGORY." | ".$theme['category']." |
";
}
if(is_dir(e_THEME.$theme['path']."/.git"))
{
$text .= "Developer |
".$this->frm->admin_button('git_pull', $theme['path'], 'primary', e107::getParser()->toGlyph('fa-refresh'). "Git Sync")." |
";
}
$itext = '';
if(!empty($theme['layouts']))
{
$itext .= "
".TPVLAN_50.": |
|
";
}
// $text .= "".TPVLAN_22.": | ";
// foreach ($theme['css'] as $val)
// {
// $text .= $val['name']." ";
// }
// $text .= " |
";
$text .= $itext."
";
$text .= e107::getForm()->close();
if(count($theme['preview']))
{
$text .= "
";
foreach($theme['preview'] as $pic)
{
$picFull = (strpos($pic, 'http') === 0) ? $pic : e_THEME.$theme['path']."/".$pic;
$text .= "
";
}
$text .= "
";
// $text .= "
// ";
}
// $text .= "
";
//if(E107_DEBUG_LEVEL > 0)
// {
// $text .= print_a($theme, true);
// }
return $text;
}
/**
* @return void
*/
function loadThemeConfig()
{
$mes = e107::getMessage();
$newConfile = e_THEME.$this->id."/theme_config.php";
$legacyConfile = e_THEME.$this->id."/".$this->id."_config.php"; // @Deprecated
if(is_readable($newConfile))
{
$confile = $newConfile;
}
elseif(is_readable($legacyConfile))// TODO Eventually remove it.
{
// NOTE: this is debug info.. do not translate.
e107::getMessage()->addDebug("Deprecated Theme Config File found! Rename
".$this->id."_config.php. to
theme_config.php to correct this issue. .");
$confile = $legacyConfile;
}
else
{
return;
}
if(($this->themeConfigObj === null) )
{
e107::getDebug()->log("Loading : ".$confile);
include ($confile);
$className = 'theme_'.$this->id;
if(class_exists('theme_config')) // new v2.1.4 theme_config is the class name.
{
$this->themeConfigObj = new theme_config();
if(!$this->themeConfigObj instanceof e_theme_config)
{
// debug - no need to translate.
e107::getMessage()->addWarning("class
theme_config is missing 'implements e_theme_config'");
}
if(class_exists('theme_config_form')) // new v2.1.7
{
$this->themeConfigFormObj = new theme_config_form();
}
}
elseif(class_exists($className)) // old way.
{
$this->themeConfigObj = new $className();
}
else
{
$this->themeConfigObj = false;
}
}
}
// TODO process custom theme configuration - .
/**
* @return string|void
*/
function renderThemeConfig()
{
$mes = e107::getMessage();
$frm = ($this->themeConfigFormObj !== null) ? $this->themeConfigFormObj : e107::getForm();
$pref = e107::getConfig()->getPref();
e107::getDebug()->log("Rendering Theme Config");
$this->loadThemeConfig();
$value = e107::getThemeConfig($this->id)->getPref();
if(empty($value) && !empty($pref['sitetheme_pref']))
{
$value = $pref['sitetheme_pref'];
}
if($this->themeConfigObj)
{
$var = call_user_func(array(&$this->themeConfigObj, 'config'));
$text = ''; // avoid notice
foreach ($var as $field=>$val)
{
if(is_numeric($field))
{
$text .= "
".$val['caption'].": | ".$val['html']." ".$val['help']." |
";
}
else
{
if(!empty($val['multilan']) && isset($value[$field][e_LANGUAGE]))
{
$value[$field] = varset($value[$field][e_LANGUAGE]);
}
$tdClass = !empty($val['writeParms']['post']) ? 'form-inline' : '';
$text .= "
".$val['title'].": | ".$frm->renderElement($field, varset($value[$field]), $val)." ".varset($val['help'])." |
";
}
}
return $text;
}
}
/**
* @return false|mixed|void
*/
function renderThemeHelp()
{
if($this->themeConfigObj)
{
return call_user_func(array(&$this->themeConfigObj, 'help'));
}
}
/**
* @return bool|mixed|void
*/
function setThemeConfig()
{
$this->loadThemeConfig();
if($this->themeConfigObj)
{
$name = get_class($this->themeConfigObj);
if($name === 'theme_config') // v2.1.4 - don't use process() method.
{
$pref = e107::getThemeConfig();
$values = e107::getThemeConfig($this->id)->getPref();
$fields = call_user_func(array(&$this->themeConfigObj, 'config'));
foreach($fields as $field=>$data)
{
if(!empty($data['multilan']))
{
$values[$field][e_LANGUAGE] = $_POST[$field][e_LANGUAGE];
} else {
$values[$field] = $_POST[$field];
}
}
if($pref->setPref($values)->save(true,true,false))
{
$siteThemePref = e107::getConfig()->get('sitetheme_pref');
if(!empty($siteThemePref))
{
e107::getConfig()->set('sitetheme_pref')->save(false,true,false); // remove old theme pref
}
}
// if($pref->dataHasChanged())
{
e107::getCache()->clearAll('library'); // Need to clear cache in order to refresh library information.
}
return true;
}
e107::getCache()->clearAll('library');
return call_user_func(array(&$this->themeConfigObj, 'process')); //pre v2.1.4
}
}
/**
mode = 0 :: normal
mode = 1 :: selected site theme
mode = 2 :: selected admin theme
*/
function renderTheme($mode = 0, $theme = array())
{
$ns = e107::getRender();
$pref = e107::getPref();
$frm = e107::getForm();
$tp = e107::getParser();
$author = ($theme['email'] ? "
".$theme['author']."" : $theme['author']);
$website = ($theme['website'] ? "
".$theme['website']."" : "");
// $preview = "
".($theme['preview'] ? "" : "")."";
// $main_icon = ($pref['sitetheme'] != $theme['path']) ? "
" : "
";
// $info_icon = "
";
// $info_icon = "
".$tp->toGlyph('fa-info-circle',array('size'=>'2x'))."";
// $preview_icon = "
".E_32_SEARCH."";
// $admin_icon = ($pref['admintheme'] != $theme['path'] ) ? "
" : "
";
$theme['css'] = $this->filterStylesheets($mode, $theme);
$price = '';
if(strpos($theme['thumbnail'],'http') === 0)
{
$thumbPath = $theme['thumbnail'];
$previewPath = $theme['preview'][0];
}
elseif(!empty($theme['thumbnail']))
{
$thumbPath = e_THEME.$theme['path'] ."/".$theme['thumbnail'];
$previewPath = e_THEME.$theme['path'] ."/".$theme['thumbnail'];
$class = 'admin-theme-preview';
}
else
{
$thumbPath = e_IMAGE_ABS."admin_images/nopreview.png";
$previewPath = e_BASE."index.php?themepreview.".$theme['id'];
$class = 'admin-theme-nopreview';
}
if($mode === self::RENDER_ADMINPREFS)
{
foreach($theme['css'] as $val)
{
if(($pref['admincss'] === $val['name']) && !empty($val['thumbnail']) )
{
$thumbPath = e_THEME.$theme['path'] ."/".$val['thumbnail'];
$previewPath = $thumbPath;
$class = 'admin-theme-preview';
break;
}
}
}
$thumbnail = "
";
$preview_icon = "
".$tp->toGlyph('fa-search',array('size'=>'2x'))."";
// Choose a Theme to Install.
$this->id = $theme['path'];
// load customn theme configuration fields.
$this->loadThemeConfig();
$text = '
';
$text .= "
- ".LAN_CONFIGURE."
";
if($this->themeConfigObj && call_user_func(array(&$this->themeConfigObj, 'config')) && $mode == self::RENDER_SITEPREFS)
{
$text .= "- ".LAN_PREFS."
\n";
}
if($this->themeConfigObj && call_user_func(array(&$this->themeConfigObj, 'help')))
{
$text .= "- ".LAN_HELP."
\n";
}
$text .= "
".$this->renderThemeHelp()."
";
if($mode == self::RENDER_ADMINPREFS) // admin
{
$mainid = "selectmain[".$theme['id']."]";
$text .= $this->frm->admin_button('submit_adminstyle', TPVLAN_35, 'update');
//$text .= $this->frm->admin_button($mainid, TPVLAN_10, 'other');
}
else // main
{
$adminid = "selectadmin[".$theme['id']."]";
$text .= $this->frm->admin_button('submit_style', TPVLAN_35, 'update');
//$text .= $this->frm->admin_button($adminid, TPVLAN_32, 'other');
}
$text .= "";
$text .= "
\n";
return $text;
}
/**
* @param $mode
* @param $theme
* @return array|false
*/
private function filterStylesheets($mode, $theme)
{
$detected = array();
if($mode == self::RENDER_SITEPREFS)
{
$detected = e107::getTheme()->getScope('css', 'front');
$all = e107::getTheme()->getScope('css', 'all');
foreach($theme['css'] as $k=>$v) // check if wildcard is present.
{
if($v['name'] == '*')
{
foreach($theme['files'] as $val) // get wildcard list of css files.
{
if(isset($detected[$val]) || isset($all[$val]))
{
continue;
}
if(substr($val,-4) === '.css' && strpos($val, "admin_") !== 0)
{
$detected[$val] = array('name'=>$val, 'info'=>'User-added Stylesheet', 'nonadmin'=>1);
}
}
break;
}
}
}
elseif($mode === self::RENDER_ADMINPREFS)
{
$detected = e107::getTheme('admin')->getScope('css', 'admin');
}
return $detected;
}
/**
* @param $key
* @return string
*/
function renderPresets($key)
{
require_once (e_HANDLER."menumanager_class.php");
$frm = e107::getForm();
$men = new e_menuManager();
$men->curLayout = $key;
$preset = $men->getMenuPreset();
// print_a($preset);
//TODO LAN
$text = "
".$frm->admin_button("setMenuPreset[".$key."]", TPVLAN_73,'other');
$text .= '
";
return $text;
}
/**
* @param $pluginOpts
* @return string
*/
function renderPlugins($pluginOpts)
{
// if there is 1 entry, then it's not the same array.
// $tmp = (varset($pluginOpts['plugin'][1])) ? $pluginOpts['plugin'] : $pluginOpts;
$text = "";
$frm = e107::getForm();
$sql = e107::getDb();
foreach ($pluginOpts as $p)
{
$plug = trim($p['@attributes']['name']);
if(e107::isInstalled($plug))
{
$text .= $plug." ".ADMIN_TRUE_ICON;
}
else
{
// echo $plug;
if($sql->select("plugin", "plugin_id", " plugin_path = '".$plug."' LIMIT 1 "))
{
$row = $sql->fetch();
$name = "installplugin[".$row['plugin_id']."]";
$text .= $this->frm->admin_button($name, ADLAN_121." ".$plug."", 'delete');
}
else
{
$text .= (varset($p['@attributes']['url']) && ($p['@attributes']['url'] != 'core')) ? "
".$plug." " : "
".$plug."";
$text .= ADMIN_FALSE_ICON;
}
}
$text .= " ";
}
return $text;
}
/**
* @param $page
* @return void
*/
function refreshPage($page = e_QUERY )
{
header("Location: ".e_SELF."?".$page);
exit;
}
/**
* @return void
*/
function themePreview()
{
echo "\n";
exit;
}
/**
* Set Theme as Main Theme.
*
* @param string $name [optional] name (folder) of the theme to set.
* @return boolean TRUE on success, FALSE otherwise
*/
function setTheme($name = '', $contentCheck = true)
{
$core = e107::getConfig();
$sql = e107::getDb();
$mes = e107::getMessage();
$themeArray = e107::getTheme()->getList("id");
$name = ($name) ? $name : vartrue($themeArray[$this->id]);
$layout = $pref['sitetheme_layouts'] = is_array($this->themeArray[$name]['layouts']) ? $this->themeArray[$name]['layouts'] : array();
$deflayout = $this->findDefault($name);
$customPages = $this->themeArray[$name]['custompages'];
$version = $this->themeArray[$name]['version'];
$glyphs = $this->themeArray[$name]['glyphs'];
$style = $this->findDefaultCSS($name);
$core->set('sitetheme', $name);
$core->set('themecss', $style);
$core->set('sitetheme_layouts', $layout);
$core->set('sitetheme_deflayout', $deflayout);
$core->set('sitetheme_custompages', $customPages);
$core->set('sitetheme_glyphicons', $glyphs);
$core->set('sitetheme_version', $version);
if(!empty($this->themeArray[$name]['preferences']))
{
$themePrefs = $this->themeArray[$name]['preferences'];
e107::getMessage()->addDebug("ThemePrefs found in theme.xml");
$this->id = $name;
$this->loadThemeConfig();
$className = '';
if(!empty($this->themeConfigObj))
{
$className = get_class($this->themeConfigObj);
}
if($className === 'theme_config') // new way. 2.1.4
{
$themeConfig = e107::getThemeConfig($name);
e107::getMessage()->addDebug("Saving theme prefs to their own row: ".print_r($themePrefs,true));
foreach($themePrefs as $key=>$val)
{
$themeConfig->add($key,$val);
}
$themeConfig->save(false,true,false);
}
else // old way.
{
e107::getMessage()->addDebug("Saving theme prefs to sitetheme_ref");
$core->set('sitetheme_pref', $this->themeArray[$name]['preferences']);
}
}
if($contentCheck === true)
{
$sql->delete("menus", "menu_layout !='' ");
$this->installContentCheck($name);
}
e107::getCache()->clear();
e107::getCache()->clearAll('js');
e107::getCache()->clearAll('css');
e107::getCache()->clearAll('library');
e107::getCache()->clearAll('browser');
if($core->save(true,false,false))
{
$mes->addDebug("Default Layout: ".$deflayout);
$mes->addDebug("Custom Pages: ".print_a($customPages,true));
$med = e107::getMedia();
$med->import('_common_image', e_THEME.$name, "^.*?logo.*?(\.png|\.jpeg|\.jpg|\.JPG|\.GIF|\.PNG)$");
$med->import('_common_image', e_THEME.$name, '', 'min-size=20000');
$this->theme_adminlog('01', $name.', style.css');
return true;
}
else
{
// $mes->add(TPVLAN_3."
'".$name."'", E_MESSAGE_ERROR);
return true;
}
}
/**
* @param $name
* @return false|void
*/
function installContentCheck($name)
{
$file = e_THEME.$name."/install/install.xml";
$frm = e107::getForm();
$tp = e107::getParser();
if(!is_readable($file))
{
return false;
}
$mes = e107::getMessage();
$xmlArray = e107::getXml()->loadXMLfile($file, 'advanced');
$text = "
";
// $text .= print_a($xmlArray, true);
$mes->addInfo($text);
}
/**
* @param $name
* @return void
*/
function installContent($name)
{
$mes = e107::getMessage();
$file = e_THEME.$name."/install/install.xml";
e107::getXml()->e107Import($file, 'replace', true, false); // Overwrite specific core pref and tables entries.
$mes->addSuccess(LAN_UPDATED);
}
/**
* Find the default layout as marked in theme.xml
* @param $theme
* @return int|string
*/
function findDefault($theme)
{
if(!empty($_POST['layout_default']))
{
return e107::getParser()->filter($_POST['layout_default'], 'w');
}
// $l = $this->themeArray[$theme];
// if(!$l)
{
$l = e107::getTheme($theme)->get(); // $this->getThemeInfo($theme);
}
if(!empty($l['layouts']))
{
foreach ($l['layouts'] as $key=>$val)
{
if(isset($val['@attributes']['default']) && ($val['@attributes']['default'] == "true"))
{
return $key;
}
}
}
else
{
return "";
}
}
/**
* Find the default css style as defined in theme.xml. When not found, use 'style.css'.
* @param string $theme theme-folder name.
* @return string
*/
function findDefaultCSS($theme)
{
$l = e107::getTheme($theme)->get();
if(empty($l['css']))
{
return 'style.css';
}
foreach($l['css'] as $item)
{
if(!empty($item['default']) && $item['default'] === 'true')
{
return $item['name'];
}
}
return 'style.css';
}
/*
function setAdminTheme()
{
global $pref,$e107cache;
$ns = e107::getRender();
$mes = e107::getMessage();
$themeArray = e107::getTheme()->getList('id'); // $this->getThemes("id");
$pref['admintheme'] = $themeArray[$this->id];
$pref['admincss'] = file_exists(e_THEME.$pref['admintheme'].'/admin_dark.css') ? 'admin_dark.css' : 'admin_light.css';
$e107cache->clear_sys();
if(save_prefs())
{
// Default Message
$mes->add(TPVLAN_40."
'".$themeArray[$this->id]."'", E_MESSAGE_SUCCESS);
$this->theme_adminlog('02', $pref['admintheme'].', '.$pref['admincss']);
}
// $ns->tablerender("Admin Message", "
".TPVLAN_40." '".$themeArray[$this -> id]."'.
");
// $this->showThemes('admin');
}*/
/**
* @todo add admin log
*/
function setStyle()
{
global $pref,$e107cache;
$sql = e107::getDb();
$ns = e107::getRender();
$mes = e107::getMessage();
$themeCSS = vartrue($_POST['themecss'],'style.css');
$themeLayout = vartrue($_POST['layout_default'], 'default');
e107::getConfig()->setPosted('themecss',$themeCSS)->setPosted('sitetheme_deflayout', $themeLayout);
$msg = $this->setThemeConfig();
if($msg)
{
$mes->add(TPVLAN_37, E_MESSAGE_SUCCESS);
if(is_array($msg))
$mes->add($msg[0], $msg[1]);
}
}
/**
* @return void
*/
function setAdminStyle()
{
//TODO adminlog
$config = e107::getConfig();
if(!empty($_POST['admincss']))
{
$config->setPosted('admincss', $_POST['admincss']);
}
$config->setPosted('adminstyle', $_POST['adminstyle'])
->setPosted('adminpref', varset($_POST['adminpref'], 0))->save(true,true);
e107::redirect(e_REQUEST_URI);
/*return (e107::getConfig()->dataHasChangedFor('admincss')
|| e107::getConfig()->dataHasChangedFor('adminstyle')
|| e107::getConfig()->dataHasChangedFor('adminpref'));*/
}
/**
* @param $array
* @return void
*/
function SetCustomPages($array)
{
if(!is_array($array))
{
return;
}
$newprefs = array();
foreach ($array as $key => $newpref)
{
$newpref = trim(str_replace("\r\n", "\n", $newpref));
$newprefs[$key] = array_filter(explode("\n", $newpref));
$newprefs[$key] = array_unique($newprefs[$key]);
}
if(e107::getPref('sitetheme_deflayout') == 'legacyCustom')
{
$newprefs['legacyCustom'] = array();
}
//setPosted couldn't be used here - sitetheme_custompages structure is not defined
e107::getConfig()->set('sitetheme_custompages', e107::getParser()->toDB($newprefs));
}
/**
* Set the Theme layouts, as found in theme.xml
*/
function setLayouts()
{
$name = $this->id;
$layout = is_array($this->themeArray[$name]['layouts']) ? $this->themeArray[$name]['layouts'] : array();
e107::getConfig()->set('sitetheme_layouts', $layout);
}
// Log event to admin log
/**
* @param $msg_num
* @param $woffle
* @return void
*/
function theme_adminlog($msg_num = '00', $woffle = '')
{
if($this->noLog)
{
return;
}
global $pref,$admin_log;
// if (!varset($pref['admin_log_log']['admin_banlist'],0)) return;
e107::getLog()->add('THEME_'.$msg_num, $woffle);
}
/*
function parse_theme_php($path)
{
return e_theme::parse_theme_php($path);
}
function parse_theme_xml($path)
{
return e_theme::parse_theme_xml($path);
}
*/
/**
* @param array $theme
* @param string $mode
* @param mixed $value
* @return array
*/
private static function renderSkin($theme, $mode, $pref)
{
$parms = [];
$parms['path'] = e_THEME . $theme['path'] . '/';
$parms['block-class'] = 'admin-css-selector col-md-3';
foreach($theme['css'] as $val)
{
if(empty($val['thumbnail']))
{
continue;
}
$kid = $val['name'];
// $val['description'];
$parms['optArray'][$kid] = array(
'thumbnail' => $val['thumbnail'],
'label' => $val['info'] . "
" . $val['description'] . "",
);
}
if(empty($parms['optArray']))
{
return '';
}
$text = "
" . TPVLAN_95 . ": |
";
$css = ($mode === self::RENDER_ADMINPREFS) ? 'admincss' : 'themecss';
$text .= e107::getForm()->radioImage($css, vartrue($pref[$css]), $parms);
$text .= " |
";
return $text;
}
}
/**
*
*/
interface e_theme_config
{
/**
* Triggered on theme settings submit
* Catch and save theme configuration
*/
// public function process();
/**
* Theme configuration user interface
* Print out config fields
*/
public function config(); // only config() is absolutely required.
/**
* Theme help tab
* Print out theme help content
*/
// public function help();
}
/**
* Interface e_theme_render
* @see e107_themes/bootstrap3/theme.php
* @see e107_themes/bootstrap3/admin_theme.php
*/
interface e_theme_render
{
/**
* @return mixed
*/
public function init();
/**
* @param $caption
* @param $text
* @param $mode
* @param $data
* @return mixed
*/
public function tablestyle($caption, $text, $mode='', $data=array());
}
/**
* Interface e_theme_library
*//*
interface e_theme_library
{
public function config();
}*/