diff --git a/e107_admin/theme.php b/e107_admin/theme.php index 266e9953d..e8f14420c 100644 --- a/e107_admin/theme.php +++ b/e107_admin/theme.php @@ -72,8 +72,9 @@ if(e_AJAX_REQUEST) if(e_AJAX_REQUEST) -{ - $data = $themec->getThemeInfo('jayya'); +{ + $tm = (string) $_GET['id']; + $data = $themec->getThemeInfo($tm); echo $themec->renderThemeInfo($data); exit; diff --git a/e107_handlers/theme_handler.php b/e107_handlers/theme_handler.php index b0377b19d..1823f37ca 100644 --- a/e107_handlers/theme_handler.php +++ b/e107_handlers/theme_handler.php @@ -533,9 +533,7 @@ class themeHandler function renderThemeInfo($theme) { - - // TO-DO : This SHOULD be loaded by ajax before release. - + global $pref; $author = ($theme['email'] ? "".$theme['author']."" : $theme['author']); $website = ($theme['website'] ? "".$theme['website']."" : ""); @@ -543,7 +541,9 @@ class themeHandler $text = "
".$theme['name']." | |
---|---|
".TPVLAN_4.": | ".$author." |
".TPVLAN_5.": | ".$website." |
".TPVLAN_6.": | ".$theme['date']." | ";
- $itext .= ($val['@attributes']['previewFull']) ? "" : "";
+ // $itext .= ($val['@attributes']['previewFull']) ? "" : "";
$itext .= $val['@attributes']['title'];
- $itext .= ($val['@attributes']['previewFull']) ? "" : "";
+ // $itext .= ($val['@attributes']['previewFull']) ? "" : "";
$custompage_count = (isset($pref['sitetheme_custompages'][$key])) ? " [".count($pref['sitetheme_custompages'][$key])."]" : "";
$custompage_diz = "";
@@ -1325,8 +1331,6 @@ class themeHandler
$lays['legacyDefault']['@attributes'] = array('title'=>'Default',
- 'preview'=>'',
- 'previewFull'=>'',
'plugins'=>'',
'default'=>'true');
@@ -1352,8 +1356,6 @@ class themeHandler
{
$themeArray['custompages']['legacyCustom'] = explode(" ", $CUSTOMPAGES);
$lays['legacyCustom']['@attributes'] = array('title'=>'Custom',
- 'preview'=>'',
- 'previewFull'=>'',
'plugins'=>'');
}
@@ -1361,22 +1363,28 @@ class themeHandler
foreach($customHeaderArray as $tm)
{
$lays[$tm]['@attributes'] = array('title'=>str_replace("_"," ",$tm),
- 'preview'=>'',
- 'previewFull'=>'',
'plugins'=>'');
}
foreach($customFooterArray as $tm)
{
$lays[$tm]['@attributes'] = array('title'=>str_replace("_"," ",$tm),
- 'preview'=>'',
- 'previewFull'=>'',
'plugins'=>'');
}
}
$themeArray['path'] = $path;
$themeArray['layouts'] = $lays;
+
+ if(file_exists(e_THEME.$path."/preview.jpg"))
+ {
+ $themeArray['preview'] = array("preview.jpg");
+ }
+
+ if(file_exists(e_THEME.$path."/preview.png"))
+ {
+ $themeArray['preview'] = array("preview.png");
+ }
// echo "".$themeArray['name'].""; // print_a($lays); @@ -1390,8 +1398,10 @@ class themeHandler // loadLanFiles($path, 'admin'); // Look for LAN files on default paths // layout should always be an array. - $xml->setOptArrayTags('layout'); + $xml->setOptArrayTags('layout,screenshots/image'); $xml->setOptStringTags('menuPresets,customPages'); + + $vars = $xml->loadXMLfile(e_THEME.$path.'/theme.xml', true, true); $vars['name'] = varset($vars['@attributes']['name']); @@ -1408,8 +1418,9 @@ class themeHandler $vars['csscompliant'] = varset($vars['compliance']['@attributes']['css']); $vars['path'] = $path; $vars['@attributes']['default'] = (varset($vars['@attributes']['default']) && strtolower($vars['@attributes']['default']) == 'true') ? 1 : 0; + $vars['preview'] = varset($vars['screenshots']['image']); - unset($vars['authorEmail'], $vars['authorUrl'], $vars['xhtmlCompliant'], $vars['cssCompliant'], $vars['description']); + unset($vars['authorEmail'], $vars['authorUrl'], $vars['xhtmlCompliant'], $vars['cssCompliant'], $vars['description'],$vars['screenshots']); // Compile layout information into a more usable format. @@ -1434,17 +1445,17 @@ class themeHandler $vars['path'] = $path; $vars['custompages'] = $custom; - /* + /* $mes = e107::getMessage(); - - if($path == "bootstrap") + + if($path == "bootstrap" || $path == "jayya") { $mes->addDebug("".$path.""); $mes->addDebug(print_a($vars,true)); $mes->addDebug(""); } - */ - + + */ return $vars; } diff --git a/e107_handlers/xml_class.php b/e107_handlers/xml_class.php index 3ee349e6a..cba96a362 100644 --- a/e107_handlers/xml_class.php +++ b/e107_handlers/xml_class.php @@ -620,15 +620,28 @@ class xmlClass { return $vars; } - - - foreach($this->arrayTags as $vl) + + + foreach($this->arrayTags as $p) { - + + list($vl,$sub) = explode("/",$p); + + if($sub) + { + if(isset($vars[$vl][$sub]) && is_string($vars[$vl][$sub])) + { + $vars[$vl][$sub] = array($vars[$vl][$sub]); + } + + continue; + } + + if(isset($vars[$vl]) && is_array($vars[$vl]) && !varset($vars[$vl][0])) { - - $vars[$vl] = array($vars[$vl]); + + $vars[$vl] = array($vars[$vl]); } } diff --git a/e107_themes/_blank/theme.xml b/e107_themes/_blank/theme.xml index a179759e6..ab12e9dc8 100644 --- a/e107_themes/_blank/theme.xml +++ b/e107_themes/_blank/theme.xml @@ -7,8 +7,11 @@ |