1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 04:38:27 +01:00

Fix for different theme.xml setups. theme.xml added to Jayya.

This commit is contained in:
CaMer0n 2009-07-06 08:45:19 +00:00
parent 7d3cfef795
commit 4d68afc0f6
4 changed files with 132 additions and 46 deletions

View File

@ -9,8 +9,8 @@
* General purpose file
*
* $Source: /cvs_backup/e107_0.8/class2.php,v $
* $Revision: 1.98 $
* $Date: 2009-07-06 05:59:42 $
* $Revision: 1.99 $
* $Date: 2009-07-06 08:45:19 $
* $Author: e107coders $
*
*/
@ -1049,21 +1049,6 @@ elseif (!in_array('lan_'.e_PAGE,$exclude_lan) && !$isPluginDir)
e107_include_once(e_LANGUAGEDIR.'English/lan_'.e_PAGE);
}
if(!defined('IMODE')) { define('IMODE', 'lite'); }
if (IMODE == 'lite')
{
$imode = 'nuvola_light';
}
else if (IMODE == 'dark')
{
$imode = 'nuvola_dark';
}
else
{
$imode = IMODE;
}
if ($pref['anon_post'] ? define('ANON', true) : define('ANON', false));
if (empty($pref['newsposts']) ? define('ITEMVIEW', 15) : define('ITEMVIEW', $pref['newsposts']));

View File

@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_handlers/theme_handler.php,v $
| $Revision: 1.19 $
| $Date: 2009-07-06 06:46:12 $
| $Revision: 1.20 $
| $Date: 2009-07-06 08:45:19 $
| $Author: e107coders $
+----------------------------------------------------------------------------+
*/
@ -135,21 +135,27 @@ class themeHandler{
// Load Theme information and merge with existing array. theme.xml (0.8 themes) is given priority over theme.php (0.7).
if(in_array("theme.xml",$themeArray[$file]['files']) )
{
$themeArray[$file] = array_merge($themeArray[$file], $this->parse_theme_xml($file));
$themeArray[$file] = array_merge($themeArray[$file], $this->parse_theme_xml($file));
}
elseif(in_array("theme.php",$themeArray[$file]['files']))
{
$themeArray[$file] = array_merge($themeArray[$file], $this->parse_theme_php($file));
}
}
}
}
}
closedir($handle);
/*echo "<pre>";
/*
echo "<table><tr><td>";
echo "<pre>";
print_r($themeArray['jayya']);
echo "</pre>";
echo "</td><td>";
echo "<pre>";
print_r($themeArray['e107v4a']);
echo "</pre>";
*/
echo "</td></tr></table>";*/
return $themeArray;
}
@ -492,7 +498,6 @@ class themeHandler{
</tr>";
}
if($theme['layouts']) // New in 0.8 ----
{
$itext .= "<tr>
@ -507,6 +512,7 @@ class themeHandler{
<td class='fcaption' style='text-align:center;width:100px'>".TPVLAN_54."</td>
</tr>\n";
foreach($theme['layouts'] as $key=>$val)
{
$itext .= "
@ -530,7 +536,7 @@ class themeHandler{
$itext .= ($val['@attributes']['previewFull']) ? "</a>" : "";
$itext .= ($pref['sitetheme_deflayout'] == $key) ? " (default)" : "";
$itext .= "</td>
<td style='vertical-align:top'>".$val['@attributes']['requiredPlugins']."&nbsp;</td>
<td style='vertical-align:top'>".$this->renderRequiredPlugins($val['@attributes']['requiredPlugins'])."&nbsp;</td>
<td style='vertical-align:top;text-align:center'>";
$itext .= ($val['menuPresets']) ? ADMIN_TRUE_ICON : "&nbsp;";
$itext .= "</td>
@ -616,8 +622,11 @@ class themeHandler{
\n";
}
$text .= $this->renderThemeConfig();
if($mode == 1)
{
$text .= $this->renderThemeConfig();
}
$text .= "</table>
@ -650,6 +659,29 @@ class themeHandler{
return $text;
}
function renderRequiredPlugins($val)
{
$tmp = explode(",",$val);
$tmp = array_filter($tmp);
foreach($tmp as $plug)
{
$plug = trim($plug);
if(plugInstalled($plug))
{
$text .= ADMIN_TRUE_ICON.$plug;
}
else
{
$text .= ADMIN_FALSE_ICON."<a href='".e_ADMIN."plugin.php'>".$plug."</a>";
}
}
return $text;
}
function themePreview()
{
echo "<script type='text/javascript'>document.location.href='".e_BASE."index.php?themepreview.".$this -> id."'</script>\n";
@ -815,17 +847,28 @@ class themeHandler{
unset($vars['authorEmail'],$vars['authorUrl'],$vars['xhtmlCompliant'],$vars['cssCompliant'],$vars['description']);
// Compile layout information into a more usable format.
foreach($vars['layouts'] as $layout)
{
foreach($layout as $key=>$val)
if(is_array($layout[0]))
{
$name = $val['@attributes']['name'];
unset($val['@attributes']['name']);
$lays[$name] = $val;
}
}
foreach($layout as $key=>$val)
{
$vars['layouts'] = $lays;
$name = $val['@attributes']['name'];
unset($val['@attributes']['name']);
$lays[$name] = $val;
}
}
else
{
$name = $layout['@attributes']['name'];
unset($layout['@attributes']['name']);
$lays[$name] = $layout;
}
}
$vars['layouts'] = $lays;
$vars['path'] = $path;
return $vars;
}

View File

@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_themes/jayya/theme.php,v $
| $Revision: 1.7 $
| $Date: 2009-07-06 05:59:42 $
| $Revision: 1.8 $
| $Date: 2009-07-06 08:45:19 $
| $Author: e107coders $
+----------------------------------------------------------------------------+
*/
@ -27,15 +27,7 @@ include_lan(e_THEME."jayya/languages/".e_LANGUAGE.".php");
// [theme]
$themename = "Jayya";
$themeversion = "1.0";
$themeauthor = "e107devs";
$themedate = "";
$themeinfo = "";
$xhtmlcompliant = TRUE;
$csscompliant = TRUE;
define("THEME_DISCLAIMER", "");
define("IMODE", "lite");
define("STANDARDS_MODE", TRUE);
// [dont render core style sheet link]
@ -45,7 +37,7 @@ define("STANDARDS_MODE", TRUE);
$layout = "_default";
$HEADER = "<table class='page_container'>
$HEADER['3_column'] = "<table class='page_container'>
<tr>
<td>
@ -87,7 +79,7 @@ $HEADER = "<table class='page_container'>
{WMESSAGE}
";
$FOOTER = "<br />
$FOOTER['3_column'] = "<br />
</td>
<td class='right_menu'>
@ -108,7 +100,61 @@ $FOOTER = "<br />
</table>
";
$HEADER['2_column'] = "<table class='page_container'>
<tr>
<td>
<table class='top_section'>
<tr>
<td class='top_section_left' style='width: 190px; padding-left: 5px; padding-right: 5px'>
{LOGO}
</td>
<td class='top_section_mid'>
{BANNER}
</td>
<td class='top_section_right' style='padding: 0px; white-space: nowrap; width: 170px'>
{CUSTOM=search+default}
</td>
</tr>
</table>
<div>
{SITELINKS_ALT=".THEME_ABS."images/arrow.png+noclick}
</div>
<table class='main_section'>
<colgroup>
<col style='width: 170px' />
<col style='width: auto' />
</colgroup>
<tr>
<td class='left_menu'>
<table class='menus_container'><tr><td>
{SETSTYLE=leftmenu}
{MENU=1}
{MENU=2}
</td></tr></table>
</td>
<td class='default_menu'>
{SETSTYLE=default}
{WMESSAGE}
";
$FOOTER['2_column'] = "<br />
</td>
</tr>
</table>
<div style='text-align:center'>
<br />
{SITEDISCLAIMER}
<br /><br />
</div>
</td>
</tr>
</table>
";
// [linkstyle]
define('PRELINK', '');

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<e107Theme name="Jayya" version="2.0" date="2009-06-11" compatibility="0.8">
<author name ="e107Developers" email="security@e107.org" url="http://e107.org"/>
<description>Classic e107 theme</description>
<compliance xhtml="true" css="true"/>
<layouts>
<layout name='3_column' title='3 Columns' preview='preview.jpg' default='true' >
</layout>
<layout name='2_column' title='2 Columns' preview='preview.jpg' >
</layout>
</layouts>
</e107Theme>