1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-03 13:17:24 +02:00

more formatting

This commit is contained in:
marj
2009-10-28 23:52:56 +00:00
parent bc7669ed4c
commit a2d4367d95

View File

@@ -9,8 +9,8 @@
* e107 Admin Theme Handler * e107 Admin Theme Handler
* *
* $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.56 $ * $Revision: 1.57 $
* $Date: 2009-10-28 23:45:46 $ * $Date: 2009-10-28 23:52:56 $
* $Author: marj_nl_fr $ * $Author: marj_nl_fr $
*/ */
@@ -60,7 +60,8 @@ class themeHandler
global $emessage,$e107cache,$pref; global $emessage,$e107cache,$pref;
require_once (e_HANDLER."form_handler.php"); require_once (e_HANDLER."form_handler.php");
$this->frm = new e_form(); //enable inner tabindex counter //enable inner tabindex counter
$this->frm = new e_form();
$this->fl = e107::getFile(); $this->fl = e107::getFile();
@@ -138,7 +139,8 @@ class themeHandler
require_once (e_HANDLER."menumanager_class.php"); require_once (e_HANDLER."menumanager_class.php");
$men = new e_menuManager(); $men = new e_menuManager();
$men->curLayout = $key; $men->curLayout = $key;
$men->dbLayout = ($men->curLayout != $pref['sitetheme_deflayout']) ? $men->curLayout : ""; //menu_layout is left blank when it's default. //menu_layout is left blank when it's default.
$men->dbLayout = ($men->curLayout != $pref['sitetheme_deflayout']) ? $men->curLayout : "";
if($areas = $men->menuSetPreset()) if($areas = $men->menuSetPreset())
{ {
@@ -421,7 +423,8 @@ class themeHandler
$ns->tablerender(TPVLAN_26." :: ".TPVLAN_33, $emessage->render().$text); $ns->tablerender(TPVLAN_26." :: ".TPVLAN_33, $emessage->render().$text);
} }
if($mode == "admin") // Show Admin Configuration // Show Admin Configuration
if($mode == "admin")
{ {
foreach ($this->themeArray as $key=>$theme) foreach ($this->themeArray as $key=>$theme)
@@ -434,14 +437,14 @@ class themeHandler
$ns->tablerender(TPVLAN_26." :: ".TPVLAN_34, $emessage->render().$text); $ns->tablerender(TPVLAN_26." :: ".TPVLAN_34, $emessage->render().$text);
} }
// Show Upload Form
if($mode == "upload") // Show Upload Form if($mode == "upload")
{ {
$this->renderUploadForm(); $this->renderUploadForm();
} }
// Show All Themes
if($mode == "choose") // Show All Themes if($mode == "choose")
{ {
$text = ""; $text = "";
foreach ($this->themeArray as $key=>$theme) foreach ($this->themeArray as $key=>$theme)
@@ -529,7 +532,8 @@ class themeHandler
$text .= ($theme['csscompliant']) ? ADMIN_TRUE_ICON : ADMIN_FALSE_ICON; $text .= ($theme['csscompliant']) ? ADMIN_TRUE_ICON : ADMIN_FALSE_ICON;
$text .= "</td></tr>"; $text .= "</td></tr>";
if($theme['layouts']) // New in 0.8 WORK IN PROGRESS ---- // New in 0.8 WORK IN PROGRESS ----
if($theme['layouts'])
{ {
$itext .= "<tr> $itext .= "<tr>
<td style='vertical-align:top; width:24%'><b>".TPVLAN_50."</b>:</td> <td style='vertical-align:top; width:24%'><b>".TPVLAN_50."</b>:</td>
@@ -608,8 +612,8 @@ class themeHandler
} }
// TODO process custom theme configuration - .
function renderThemeConfig() // process custom theme configuration - TODO. function renderThemeConfig()
{ {
global $frm; global $frm;
@@ -671,8 +675,8 @@ class themeHandler
$newpreview = "<a href='".e_BASE."news.php?themepreview.".$theme['id']."' title='".TPVLAN_9."' >".($theme['preview'] ? "<img src='".$theme['preview']."' style='width:200px; height:160px;' alt='' />" : "<img src='".e_IMAGE_ABS."admin_images/nopreview.png' style='width:200px;height:160px;' title='".TPVLAN_12."' alt='' />")."</a>"; $newpreview = "<a href='".e_BASE."news.php?themepreview.".$theme['id']."' title='".TPVLAN_9."' >".($theme['preview'] ? "<img src='".$theme['preview']."' style='width:200px; height:160px;' alt='' />" : "<img src='".e_IMAGE_ABS."admin_images/nopreview.png' style='width:200px;height:160px;' title='".TPVLAN_12."' alt='' />")."</a>";
// Choose a Theme to Install.
if(!$mode) // Choose a Theme to Install. if(!$mode)
{ {
// styles NEED to be put into style.css // styles NEED to be put into style.css
@@ -689,7 +693,8 @@ class themeHandler
$this->id = $theme['path']; $this->id = $theme['path'];
$this->loadThemeConfig(); // load customn theme configuration fieldss. // load customn theme configuration fields.
$this->loadThemeConfig();
$text = " $text = "
<h2 class='caption'>".$theme['name']."</h2> <h2 class='caption'>".$theme['name']."</h2>
@@ -730,8 +735,8 @@ class themeHandler
$text .= ($theme['csscompliant']) ? " &amp; CSS ".$theme['csscompliant'] : ""; $text .= ($theme['csscompliant']) ? " &amp; CSS ".$theme['csscompliant'] : "";
$text .= "</td></tr>"; $text .= "</td></tr>";
// site theme..
if($mode == 1) // site theme.. if($mode == 1)
{ {
$text .= " $text .= "
@@ -761,8 +766,8 @@ class themeHandler
</tr>"; </tr>";
} }
// New in 0.8 ---- site theme.
if($mode == 1) // New in 0.8 ---- site theme. if($mode == 1)
{ {
$itext = "<tr> $itext = "<tr>
@@ -831,8 +836,9 @@ class themeHandler
$itext .= "</td> $itext .= "</td>
<td style='vertical-align:top'>"; <td style='vertical-align:top'>";
// 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", $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 $pref['sitetheme_custompages'][$key]) : "")."</textarea></div>\n" : TPVLAN_55;
$itext .= "</td>"; $itext .= "</td>";
@@ -980,7 +986,8 @@ class themeHandler
{ {
global $frm,$sql; global $frm,$sql;
$tmp = (varset($pluginOpts['plugin'][1])) ? $pluginOpts['plugin'] : $pluginOpts; // if there is 1 entry, then it's not the same array. // if there is 1 entry, then it's not the same array.
$tmp = (varset($pluginOpts['plugin'][1])) ? $pluginOpts['plugin'] : $pluginOpts;
$text = ""; $text = "";
foreach ($tmp as $p) foreach ($tmp as $p)
@@ -1123,7 +1130,8 @@ class themeHandler
$e107cache->clear_sys(); $e107cache->clear_sys();
if(save_prefs()) if(save_prefs())
{ {
$emessage->add(TPVLAN_40." <b>'".$themeArray[$this->id]."'</b>", E_MESSAGE_SUCCESS); // Default Message // Default Message
$emessage->add(TPVLAN_40." <b>'".$themeArray[$this->id]."'</b>", E_MESSAGE_SUCCESS);
$this->theme_adminlog('02', $pref['admintheme'].', '.$pref['admincss']); $this->theme_adminlog('02', $pref['admintheme'].', '.$pref['admincss']);
} }
@@ -1253,7 +1261,8 @@ class themeHandler
'plugins'=>'', 'plugins'=>'',
'default'=>'true'); 'default'=>'true');
if(!file_exists(e_THEME.$path."theme.xml")) // load custompages from theme.php only when theme.xml doesn't exist. // load custompages from theme.php only when theme.xml doesn't exist.
if(!file_exists(e_THEME.$path."theme.xml"))
{ {
foreach ($themeContentsArray as $line) foreach ($themeContentsArray as $line)
{ {
@@ -1291,7 +1300,8 @@ class themeHandler
// loadLanFiles($path, 'admin'); // Look for LAN files on default paths // loadLanFiles($path, 'admin'); // Look for LAN files on default paths
require_once (e_HANDLER.'xml_class.php'); require_once (e_HANDLER.'xml_class.php');
$xml = new xmlClass; $xml = new xmlClass;
$xml->setOptArrayTags('layout'); // layout should always be an array. // layout should always be an array.
$xml->setOptArrayTags('layout');
$xml->setOptStringTags('menuPresets,customPages'); $xml->setOptStringTags('menuPresets,customPages');
$vars = $xml->loadXMLfile(e_THEME.$path.'/theme.xml', true, true); $vars = $xml->loadXMLfile(e_THEME.$path.'/theme.xml', true, true);