1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 20:00:37 +02:00

Warning removal in class2.php and I modified the theme.xml spec, so that one can specify exactly which version of XHTML and CSS the theme is compliant with. ie. true/false has been replaced with (Xhtml) 1.1, (Css) 2.1 etc. Pre-0.8 themes will default to this when 'true' is found.

This commit is contained in:
CaMer0n
2009-07-24 12:54:39 +00:00
parent c539f13b36
commit 6a504ac0d4
5 changed files with 38 additions and 20 deletions

View File

@@ -9,9 +9,9 @@
* General purpose file * General purpose file
* *
* $Source: /cvs_backup/e107_0.8/class2.php,v $ * $Source: /cvs_backup/e107_0.8/class2.php,v $
* $Revision: 1.115 $ * $Revision: 1.116 $
* $Date: 2009-07-23 15:29:07 $ * $Date: 2009-07-24 12:54:36 $
* $Author: secretr $ * $Author: e107coders $
* *
*/ */
// //
@@ -1006,10 +1006,8 @@ if(!defined("THEME_LAYOUT"))
$def = ""; // no custom pages found yet. $def = ""; // no custom pages found yet.
$cusPagePref = (is_array($user_pref['sitetheme_custompages'])) ? $user_pref['sitetheme_custompages'] : $pref['sitetheme_custompages']; $cusPagePref = (is_array($user_pref['sitetheme_custompages'])) ? $user_pref['sitetheme_custompages'] : $pref['sitetheme_custompages'];
if(is_array($cusPagePref)) // check if we match a page in layout custompages. if(is_array($cusPagePref) && count($cusPagePref)>0) // check if we match a page in layout custompages.
{ {
// print_r($cusPagePref);
foreach($cusPagePref as $lyout=>$cusPageArray) foreach($cusPagePref as $lyout=>$cusPageArray)
{ {
foreach($cusPageArray as $kpage) foreach($cusPageArray as $kpage)

View File

@@ -10,8 +10,8 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_handlers/theme_handler.php,v $ | $Source: /cvs_backup/e107_0.8/e107_handlers/theme_handler.php,v $
| $Revision: 1.39 $ | $Revision: 1.40 $
| $Date: 2009-07-18 03:41:49 $ | $Date: 2009-07-24 12:54:38 $
| $Author: e107coders $ | $Author: e107coders $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -643,10 +643,9 @@ class themeHandler{
$text .= "<tr><td style='vertical-align:top; width:25%'><b>".TPVLAN_7."</b>:</td><td style='vertical-align:top'>".$theme['info']."</td></tr>"; $text .= "<tr><td style='vertical-align:top; width:25%'><b>".TPVLAN_7."</b>:</td><td style='vertical-align:top'>".$theme['info']."</td></tr>";
$text .= "<tr><td style='vertical-align:top; width:25%'><b>".TPVLAN_49."</b>:</td> $text .= "<tr><td style='vertical-align:top; width:25%'><b>".TPVLAN_49."</b>:</td>
<td style='vertical-align:top'>XHTML "; <td style='vertical-align:top'>";
$text .= ($theme['xhtmlcompliant']) ? ADMIN_TRUE_ICON : "X"; $text .= ($theme['xhtmlcompliant']) ? "W3C XHTML ".$theme['xhtmlcompliant'] : "Not Specified";
$text .= " &nbsp;&nbsp; CSS "; $text .= ($theme['csscompliant']) ? " &amp; CSS ".$theme['csscompliant'] : "";
$text .= ($theme['csscompliant']) ? ADMIN_TRUE_ICON : "X";
$text .= "</td></tr>"; $text .= "</td></tr>";
@@ -728,9 +727,30 @@ class themeHandler{
$itext .= ($val['@attributes']['previewFull']) ? "</a>" : ""; $itext .= ($val['@attributes']['previewFull']) ? "</a>" : "";
$custompage_count = (isset($pref['sitetheme_custompages'][$key])) ? " [".count($pref['sitetheme_custompages'][$key])."]" : ""; $custompage_count = (isset($pref['sitetheme_custompages'][$key])) ? " [".count($pref['sitetheme_custompages'][$key])."]" : "";
$custompage_diz = "";
$count = 1;
if(isset($pref['sitetheme_custompages'][$key]) && count($pref['sitetheme_custompages'][$key]) > 0)
{
foreach($pref['sitetheme_custompages'][$key] as $cp)
{
$custompage_diz .= "<a href='#element-to-be-shown' class='e-expandit'>".trim($cp)."</a>&nbsp;";
if($count > 4)
{
$custompage_diz .= "...";
break;
}
$count++;
}
}
else
{
$custompage_diz = "<a href='#element-to-be-shown' class='e-expandit'>None</a> ";
}
$itext .= "</td> $itext .= "</td>
<td style='vertical-align:top'>"; <td style='vertical-align:top'>";
$itext .= ($pref['sitetheme_deflayout'] != $key) ? "<a href='#element-to-be-shown' class='e-expandit'>".ADMIN_EDIT_ICON."</a>".$custompage_count."<div class='e-hideme' id='element-to-be-shown'><textarea style='width:97%' rows='6' cols='20' name='custompages[".$key."]' >".(isset($pref['sitetheme_custompages'][$key]) ? implode("\n",$pref['sitetheme_custompages'][$key]) : "")."</textarea></div>\n" : TPVLAN_55; // Default $itext .= ($pref['sitetheme_deflayout'] != $key) ? $custompage_diz."<div class='e-hideme' id='element-to-be-shown'><textarea style='width:97%' rows='6' cols='20' name='custompages[".$key."]' >".(isset($pref['sitetheme_custompages'][$key]) ? implode("\n",$pref['sitetheme_custompages'][$key]) : "")."</textarea></div>\n" : TPVLAN_55; // Default
$itext .= "</td>"; $itext .= "</td>";
@@ -1095,11 +1115,11 @@ class themeHandler{
$themeArray['info'] = varset($match[3],''); $themeArray['info'] = varset($match[3],'');
preg_match('/xhtmlcompliant(\s*?=\s*?)(\S*?);/si', $themeContents, $match); preg_match('/xhtmlcompliant(\s*?=\s*?)(\S*?);/si', $themeContents, $match);
$xhtml = strtolower($match[2]); $xhtml = strtolower($match[2]);
$themeArray['xhtmlcompliant'] = ($xhtml == "true" ? true : false); $themeArray['xhtmlcompliant'] = ($xhtml == "true" ? "1.1" : false);
preg_match('/csscompliant(\s*?=\s*?)(\S*?);/si', $themeContents, $match); preg_match('/csscompliant(\s*?=\s*?)(\S*?);/si', $themeContents, $match);
$css = strtolower($match[2]); $css = strtolower($match[2]);
$themeArray['csscompliant'] = ($css == "true" ? true : false); $themeArray['csscompliant'] = ($css == "true" ? "2.1" : false);
/* preg_match('/CUSTOMPAGES(\s*?=\s*?)("|\')(.*?)("|\');/si', $themeContents, $match); /* preg_match('/CUSTOMPAGES(\s*?=\s*?)("|\')(.*?)("|\');/si', $themeContents, $match);
$themeArray['custompages'] = array_filter(explode(" ",$match[3]));*/ $themeArray['custompages'] = array_filter(explode(" ",$match[3]));*/
@@ -1159,8 +1179,8 @@ class themeHandler{
$vars['website'] = varset($vars['author']['@attributes']['url']); $vars['website'] = varset($vars['author']['@attributes']['url']);
$vars['author'] = varset($vars['author']['@attributes']['name']); $vars['author'] = varset($vars['author']['@attributes']['name']);
$vars['info'] = $vars['description']; $vars['info'] = $vars['description'];
$vars['xhtmlcompliant'] = (strtolower($vars['compliance']['@attributes']['xhtml']) == 'true' ? 1 : 0); $vars['xhtmlcompliant'] = varset($vars['compliance']['@attributes']['xhtml']);
$vars['csscompliant'] = (strtolower($vars['compliance']['@attributes']['css']) == 'true' ? 1 : 0); $vars['csscompliant'] = varset($vars['compliance']['@attributes']['css']);
$vars['path'] = $path; $vars['path'] = $path;
$vars['@attributes']['default'] = (strtolower($vars['@attributes']['default'])=='true') ? 1 : 0; $vars['@attributes']['default'] = (strtolower($vars['@attributes']['default'])=='true') ? 1 : 0;

View File

@@ -2,7 +2,7 @@
<e107Theme name="blank" version="0.1" date="2008-12-01" compatibility="0.8"> <e107Theme name="blank" version="0.1" date="2008-12-01" compatibility="0.8">
<author name ="Desislav Yosifov [SonicE]" email="support@free-source.net" url="http://free-source.net" /> <author name ="Desislav Yosifov [SonicE]" email="support@free-source.net" url="http://free-source.net" />
<description>Blank e107 admin theme</description> <description>Blank e107 admin theme</description>
<compliance xhtml="true" css="true" /> <compliance xhtml="1.1" css="2.1" />
<layouts> <layouts>
<layout name='default' title='3 Columns' preview='preview.jpg' previewFull='preview_full.png' default='true' > <layout name='default' title='3 Columns' preview='preview.jpg' previewFull='preview_full.png' default='true' >

View File

@@ -2,7 +2,7 @@
<e107Theme name="e107.v4" version="3.0" date="2003-06-11" compatibility="0.8"> <e107Theme name="e107.v4" version="3.0" date="2003-06-11" compatibility="0.8">
<author name ="Steve Dunstan [jalist]" email="jalist@e107.org" url="http://e107.org" /> <author name ="Steve Dunstan [jalist]" email="jalist@e107.org" url="http://e107.org" />
<description>Classic e107 theme</description> <description>Classic e107 theme</description>
<compliance xhtml="true" css="true" /> <compliance xhtml="1.1" css="2.1" />
<pluginOptions> <pluginOptions>
<plugin name='chatbox_menu' url='core' /> <plugin name='chatbox_menu' url='core' />
<plugin name='poll' url='core' /> <plugin name='poll' url='core' />

View File

@@ -2,7 +2,7 @@
<e107Theme name="Jayya" version="2.0" date="2009-06-11" compatibility="0.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/" /> <author name ="e107Developers" email="security@e107.org" url="http://e107.org/" />
<description>Classic e107 theme</description> <description>Classic e107 theme</description>
<compliance xhtml="true" css="true" /> <compliance xhtml="1.1" css="2.1" />
<layouts> <layouts>
<layout name='3_column' title='3 Columns' preview='preview.jpg' default='true' > <layout name='3_column' title='3 Columns' preview='preview.jpg' default='true' >
</layout> </layout>