mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 13:47:31 +02:00
More theme manager and menu manager refinements
This commit is contained in:
@@ -11,8 +11,8 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_admin/menus.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_admin/menus.php,v $
|
||||||
| $Revision: 1.22 $
|
| $Revision: 1.23 $
|
||||||
| $Date: 2009-07-09 08:31:37 $
|
| $Date: 2009-07-09 11:37:36 $
|
||||||
| $Author: e107coders $
|
| $Author: e107coders $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
@@ -35,49 +35,18 @@ if($_POST)
|
|||||||
$e107cache->clear_sys("menus_");
|
$e107cache->clear_sys("menus_");
|
||||||
}
|
}
|
||||||
|
|
||||||
$menus_equery = explode('.', e_QUERY);
|
$tmp = explode('.', e_QUERY);
|
||||||
$curLayout = $menus_equery[1];
|
$curLayout = ($tmp[1]) ? $tmp[1] : $pref['sitetheme_deflayout'] ;
|
||||||
|
|
||||||
if(isset($_POST['custom_select']))
|
if(isset($_POST['custom_select']))
|
||||||
{
|
{
|
||||||
$curLayout = $_POST['custom_select'];
|
$curLayout = $_POST['custom_select'];
|
||||||
//header("location:".e_SELF."?".$_POST['custom_select']);
|
|
||||||
//exit;
|
|
||||||
}
|
|
||||||
else if (!isset($curLayout))
|
|
||||||
{
|
|
||||||
$curLayout = $pref['sitetheme_deflayout'];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*if ($curLayout == '' || $curLayout == 'default_layout')
|
// Almost the same code as found in templates/header_default.php ---------
|
||||||
{
|
|
||||||
$menus_header = is_array($HEADER) ? $HEADER[$pref['sitetheme_deflayout']] : $HEADER;
|
|
||||||
$menus_footer = is_array($FOOTER) ? $FOOTER[$pref['sitetheme_deflayout']] : $FOOTER;
|
|
||||||
}
|
|
||||||
else if ($curLayout == 'legacyCustom')
|
|
||||||
{
|
|
||||||
$menus_header = $CUSTOMHEADER ? $CUSTOMHEADER : $HEADER;
|
|
||||||
$menus_footer = $CUSTOMFOOTER ? $CUSTOMFOOTER : $FOOTER;
|
|
||||||
}
|
|
||||||
else if ($curLayout == 'newsheader_layout')
|
|
||||||
{
|
|
||||||
$menus_header = $NEWSHEADER ? $NEWSHEADER : $HEADER;
|
|
||||||
$menus_footer = $FOOTER;
|
|
||||||
}
|
|
||||||
elseif(is_array($HEADER) || is_array($FOOTER)) // 0.8 themes
|
|
||||||
{
|
|
||||||
$menus_header = (is_array($HEADER) && isset($HEADER[$curLayout])) ? $HEADER[$curLayout] : $HEADER;
|
|
||||||
$menus_footer = (is_array($FOOTER) && isset($FOOTER[$curLayout])) ? $FOOTER[$curLayout] : $FOOTER;
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$menus_header = $CUSTOMHEADER[$curLayout] ? $CUSTOMHEADER[$curLayout] : $HEADER;
|
|
||||||
$menus_footer = $CUSTOMFOOTER[$curLayout] ? $CUSTOMFOOTER[$curLayout] : $FOOTER;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
// Almost the same code as found in templates/header_default.php
|
|
||||||
if(($curLayout == 'legacyCustom' || $curLayout=='legacyDefault') && (isset($CUSTOMHEADER) || isset($CUSTOMFOOTER)) ) // 0.6 themes.
|
if(($curLayout == 'legacyCustom' || $curLayout=='legacyDefault') && (isset($CUSTOMHEADER) || isset($CUSTOMFOOTER)) ) // 0.6 themes.
|
||||||
{
|
{
|
||||||
if($curLayout == 'legacyCustom')
|
if($curLayout == 'legacyCustom')
|
||||||
@@ -99,19 +68,10 @@ else
|
|||||||
$FOOTER = $FOOTER[$curLayout];
|
$FOOTER = $FOOTER[$curLayout];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e_PAGE == 'news.php' && isset($NEWSHEADER))
|
// ------------------------------------------------------------------------
|
||||||
{
|
|
||||||
// parseheader($NEWSHEADER);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// parseheader($HEADER);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$layouts_str = $HEADER.$FOOTER;
|
$layouts_str = $HEADER.$FOOTER;
|
||||||
$menus_header = $HEADER;
|
|
||||||
$menus_footer = $FOOTER;
|
|
||||||
|
|
||||||
|
|
||||||
if ($NEWSHEADER)
|
if ($NEWSHEADER)
|
||||||
@@ -145,45 +105,13 @@ if($_POST['menuSetCustomPages'])
|
|||||||
menuSetCustomPages($_POST['custompages']);
|
menuSetCustomPages($_POST['custompages']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(isset($_POST['menuUsePreset']) && $_POST['curLayout'])
|
if(isset($_POST['menuUsePreset']) && $_POST['curLayout'])
|
||||||
{
|
{
|
||||||
global $pref;
|
|
||||||
$layout = ($_POST['curLayout'] != $pref['sitetheme_deflayout']) ? $_POST['curLayout'] : "";
|
|
||||||
$menuAreas = getMenuPreset($_POST['curLayout']);
|
|
||||||
|
|
||||||
$sql->db_Update("menus", "menu_location='0' WHERE menu_layout = '$layout' "); // Clear All existing.
|
menuSetPreset();
|
||||||
foreach($menuAreas as $val)
|
|
||||||
{
|
|
||||||
|
|
||||||
if($sql->db_Select("menus", 'menu_name, menu_path' , "menu_name = '".$val['menu_name']."' LIMIT 1"))
|
|
||||||
{
|
|
||||||
$row=$sql->db_Fetch();
|
|
||||||
|
|
||||||
if(!$sql->db_Update('menus', "menu_order='{$val['menu_order']}', menu_location = ".$val['menu_location'].", menu_class= ".$val['menu_class']." WHERE menu_name='".$val['menu_name']."' AND menu_layout = '$layout' LIMIT 1 "))
|
|
||||||
{
|
|
||||||
$qry = "
|
|
||||||
INSERT into #menus
|
|
||||||
(`menu_name`, `menu_location`, `menu_order`, `menu_pages`,`menu_class`, `menu_path`, `menu_layout`)
|
|
||||||
VALUES ('{$val['menu_name']}', {$val['menu_location']}, {$val['menu_order']}, '', '{$val['menu_class']}', '{$row['menu_path']}', '{$layout}')
|
|
||||||
";
|
|
||||||
$sql->db_Select_gen($qry);
|
|
||||||
$admin_log->log_event('MENU_01',$row['menu_name'].'[!br!]'.$location.'[!br!]'.$menu_count.'[!br!]'.$row['menu_path'],E_LOG_INFORMATIVE,'');
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// =============
|
|
||||||
|
|
||||||
if (isset($_POST['menuAct']))
|
if (isset($_POST['menuAct']))
|
||||||
{
|
{
|
||||||
foreach ($_POST['menuAct'] as $k => $v)
|
foreach ($_POST['menuAct'] as $k => $v)
|
||||||
@@ -223,9 +151,6 @@ if ($menu_act == "sv")
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ($menu_act == "move")
|
if ($menu_act == "move")
|
||||||
{
|
{
|
||||||
menuMove();
|
menuMove();
|
||||||
@@ -267,6 +192,71 @@ if ($menu_act == "inc")
|
|||||||
|
|
||||||
if (strpos(e_QUERY, 'configure') === FALSE)
|
if (strpos(e_QUERY, 'configure') === FALSE)
|
||||||
{ // Scan plugin directories to see if menus to add
|
{ // Scan plugin directories to see if menus to add
|
||||||
|
menuScanMenus();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($message != "")
|
||||||
|
{
|
||||||
|
echo $ns -> tablerender('Updated', "<div style='text-align:center'><b>".$message."</b></div><br /><br />");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (strpos(e_QUERY, 'configure') === FALSE)
|
||||||
|
{
|
||||||
|
$cnt = $sql->db_Select("menus", "*", "menu_location > 0 AND menu_layout = '$curLayout' ORDER BY menu_name "); // calculate height to remove vertical scroll-bar.
|
||||||
|
$text = "<iframe id='menu_iframe' src='".e_SELF."?configure.$curLayout' width='100%' style='width: 100%; height: ".(($cnt*90)+600)."px; border: 0px' frameborder='0' scrolling='auto' ></iframe>";
|
||||||
|
$ns -> tablerender(MENLAN_35, $text, 'menus_config');
|
||||||
|
}
|
||||||
|
else // Within the IFrame.
|
||||||
|
{
|
||||||
|
|
||||||
|
echo menuSelectLayout();
|
||||||
|
menuRenderPage();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
function menuSetPreset()
|
||||||
|
{
|
||||||
|
global $pref,$sql,$location,$admin_log;
|
||||||
|
$layout = ($_POST['curLayout'] != $pref['sitetheme_deflayout']) ? $_POST['curLayout'] : "";
|
||||||
|
$menuAreas = getMenuPreset($_POST['curLayout']);
|
||||||
|
|
||||||
|
$sql->db_Update("menus", "menu_location='0' WHERE menu_layout = '$layout' "); // Clear All existing.
|
||||||
|
foreach($menuAreas as $val)
|
||||||
|
{
|
||||||
|
|
||||||
|
if($sql->db_Select("menus", 'menu_name, menu_path' , "menu_name = '".$val['menu_name']."' LIMIT 1"))
|
||||||
|
{
|
||||||
|
$row=$sql->db_Fetch();
|
||||||
|
|
||||||
|
if(!$sql->db_Update('menus', "menu_order='{$val['menu_order']}', menu_location = ".$val['menu_location'].", menu_class= ".$val['menu_class']." WHERE menu_name='".$val['menu_name']."' AND menu_layout = '$layout' LIMIT 1 "))
|
||||||
|
{
|
||||||
|
$qry = "
|
||||||
|
INSERT into #menus
|
||||||
|
(`menu_name`, `menu_location`, `menu_order`, `menu_pages`,`menu_class`, `menu_path`, `menu_layout`)
|
||||||
|
VALUES ('{$val['menu_name']}', {$val['menu_location']}, {$val['menu_order']}, '', '{$val['menu_class']}', '{$row['menu_path']}', '{$layout}')
|
||||||
|
";
|
||||||
|
$sql->db_Select_gen($qry);
|
||||||
|
$admin_log->log_event('MENU_01',$row['menu_name'].'[!br!]'.$location.'[!br!]'.$menu_count.'[!br!]'.$row['menu_path'],E_LOG_INFORMATIVE,'');
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
function menuScanMenus()
|
||||||
|
{
|
||||||
|
global $sql, $sql2, $menu_areas;
|
||||||
|
|
||||||
$efile = new e_file;
|
$efile = new e_file;
|
||||||
$efile->dirFilter = array('/', 'CVS', '.svn', 'languages');
|
$efile->dirFilter = array('/', 'CVS', '.svn', 'languages');
|
||||||
$fileList = $efile->get_files(e_PLUGIN,"_menu\.php$",'standard',2);
|
$fileList = $efile->get_files(e_PLUGIN,"_menu\.php$",'standard',2);
|
||||||
@@ -329,36 +319,15 @@ if (strpos(e_QUERY, 'configure') === FALSE)
|
|||||||
$message .= "<b>".MENLAN_11." - ".$menu_name."</b><br />";
|
$message .= "<b>".MENLAN_11." - ".$menu_name."</b><br />";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
echo $message;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($message != "")
|
|
||||||
{
|
|
||||||
echo $ns -> tablerender('Updated', "<div style='text-align:center'><b>".$message."</b></div><br /><br />");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (strpos(e_QUERY, 'configure') === FALSE)
|
|
||||||
{
|
|
||||||
$cnt = $sql->db_Select("menus", "*", "menu_location > 0 AND menu_layout = '$curLayout' ORDER BY menu_name "); // calculate height to remove vertical scroll-bar.
|
|
||||||
$text .= "COUNT = ".$cnt;
|
|
||||||
|
|
||||||
$text = "<iframe id='menu_iframe' src='".e_SELF."?configure.$curLayout' width='100%' style='width: 100%; height: ".(($cnt*80)+600)."px; border: 0px' frameborder='0' scrolling='auto' ></iframe>";
|
|
||||||
echo $ns -> tablerender(MENLAN_35, $text, 'menus_config');
|
|
||||||
}
|
|
||||||
else // Within the IFrame.
|
|
||||||
{
|
|
||||||
|
|
||||||
echo menuSelectLayout();
|
|
||||||
menuRenderPage();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
function menuVisibilityOptions()
|
function menuVisibilityOptions()
|
||||||
{
|
{
|
||||||
global $sql,$ns,$id;
|
global $sql,$ns,$id,$curLayout;
|
||||||
require_once(e_HANDLER."userclass_class.php");
|
require_once(e_HANDLER."userclass_class.php");
|
||||||
$sql->db_Select("menus", "*", "menu_id=".$id);
|
$sql->db_Select("menus", "*", "menu_id=".$id);
|
||||||
$row = $sql->db_Fetch();
|
$row = $sql->db_Fetch();
|
||||||
@@ -393,11 +362,13 @@ function menuVisibilityOptions()
|
|||||||
</div>";
|
</div>";
|
||||||
$caption = MENLAN_7." ".$row['menu_name'];
|
$caption = MENLAN_7." ".$row['menu_name'];
|
||||||
$ns->tablerender($caption, $text);
|
$ns->tablerender($caption, $text);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
function menuActivate()
|
function menuActivate()
|
||||||
{
|
{
|
||||||
global $sql, $admin_log, $pref;
|
global $sql, $admin_log, $pref;
|
||||||
@@ -431,6 +402,11 @@ function menuActivate()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
function menuSetCustomPages($array)
|
function menuSetCustomPages($array)
|
||||||
{
|
{
|
||||||
global $pref;
|
global $pref;
|
||||||
@@ -439,6 +415,9 @@ function menuSetCustomPages($array)
|
|||||||
save_prefs();
|
save_prefs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------
|
||||||
|
|
||||||
function getMenuPreset($layout)
|
function getMenuPreset($layout)
|
||||||
{
|
{
|
||||||
global $pref;
|
global $pref;
|
||||||
@@ -470,6 +449,9 @@ function getMenuPreset($layout)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------
|
||||||
|
|
||||||
function checkMenuPreset($array,$name)
|
function checkMenuPreset($array,$name)
|
||||||
{
|
{
|
||||||
if(!is_array($array))
|
if(!is_array($array))
|
||||||
@@ -489,10 +471,6 @@ function checkMenuPreset($array,$name)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
function menuSaveVisibility()
|
function menuSaveVisibility()
|
||||||
@@ -584,9 +562,9 @@ function menuMove()
|
|||||||
|
|
||||||
function menuRenderPage()
|
function menuRenderPage()
|
||||||
{
|
{
|
||||||
global $sql, $ns, $menus_header, $menus_footer, $frm, $curLayout, $pref, $tp, $menu_areas;
|
global $sql, $ns, $HEADER, $FOOTER, $frm, $curLayout, $pref, $tp, $menu_areas;
|
||||||
|
|
||||||
parseheader($menus_header); // $layouts_str;
|
parseheader($HEADER); // $layouts_str;
|
||||||
|
|
||||||
$layout = ($curLayout) ? $curLayout : $pref['sitetheme_deflayout'];
|
$layout = ($curLayout) ? $curLayout : $pref['sitetheme_deflayout'];
|
||||||
$menuPreset = getMenuPreset($layout);
|
$menuPreset = getMenuPreset($layout);
|
||||||
@@ -653,7 +631,7 @@ function menuRenderPage()
|
|||||||
echo $frm->form_close();
|
echo $frm->form_close();
|
||||||
echo "</div>";
|
echo "</div>";
|
||||||
|
|
||||||
parseheader($menus_footer);
|
parseheader($FOOTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -663,10 +641,10 @@ function menuRenderPage()
|
|||||||
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
|
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||||
function menuSelectLayout()
|
function menuSelectLayout()
|
||||||
{
|
{
|
||||||
global $frm, $curLayout, $menus_equery, $pref, $HEADER, $CUSTOMHEADER, $CUSTOMFOOTER, $CUSTOMPAGES;
|
global $frm, $curLayout, $pref, $HEADER, $CUSTOMHEADER, $CUSTOMFOOTER, $CUSTOMPAGES;
|
||||||
|
|
||||||
$text .= "<form method='post' action='".e_SELF."?configure.".$curLayout."'>";
|
$text .= "<form method='post' action='".e_SELF."?configure.".$curLayout."'>";
|
||||||
$text .= "<div style='color:white;background-color:black;width:99%;left:0px;position:relative;display:block;padding:15px;text-align:center'>".MENLAN_30." ";
|
$text .= "<div style='color:white;background-color:black;width:98%;display:block;padding:15px;text-align:center'>".MENLAN_30." ";
|
||||||
$text .= "<select style='color:black' name='custom_select' onchange=\"this.form.submit()\">\n";
|
$text .= "<select style='color:black' name='custom_select' onchange=\"this.form.submit()\">\n";
|
||||||
|
|
||||||
$search = array("_","legacyDefault","legacyCustom");
|
$search = array("_","legacyDefault","legacyCustom");
|
||||||
@@ -805,7 +783,7 @@ function parseheader($LAYOUT, $check = FALSE)
|
|||||||
|
|
||||||
function checklayout($str,$curLayout)
|
function checklayout($str,$curLayout)
|
||||||
{ // Displays a basic representation of the theme
|
{ // Displays a basic representation of the theme
|
||||||
global $pref, $menu_areas, $ns, $PLUGINS_DIRECTORY, $frm, $sc_style, $tp, $menu_order, $menus_equery;
|
global $pref, $menu_areas, $ns, $PLUGINS_DIRECTORY, $frm, $sc_style, $tp, $menu_order;
|
||||||
|
|
||||||
$menuLayout = ($curLayout != $pref['sitetheme_deflayout']) ? $curLayout : "";
|
$menuLayout = ($curLayout != $pref['sitetheme_deflayout']) ? $curLayout : "";
|
||||||
|
|
||||||
|
@@ -11,8 +11,8 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_admin/theme.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_admin/theme.php,v $
|
||||||
| $Revision: 1.2 $
|
| $Revision: 1.3 $
|
||||||
| $Date: 2009-07-06 05:59:42 $
|
| $Date: 2009-07-09 11:37:36 $
|
||||||
| $Author: e107coders $
|
| $Author: e107coders $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
@@ -29,7 +29,7 @@ require_once("auth.php");
|
|||||||
require_once(e_HANDLER."theme_handler.php");
|
require_once(e_HANDLER."theme_handler.php");
|
||||||
$themec = new themeHandler;
|
$themec = new themeHandler;
|
||||||
|
|
||||||
$mode = e_QUERY;
|
$mode = (e_QUERY) ? e_QUERY :"main" ;
|
||||||
|
|
||||||
if($_POST['selectadmin'])
|
if($_POST['selectadmin'])
|
||||||
{
|
{
|
||||||
@@ -44,8 +44,11 @@ if($_POST['selectmain'])
|
|||||||
$themec -> showThemes($mode);
|
$themec -> showThemes($mode);
|
||||||
|
|
||||||
|
|
||||||
|
require_once("footer.php");
|
||||||
|
|
||||||
function theme_adminmenu()
|
function theme_adminmenu()
|
||||||
{
|
{
|
||||||
|
global $mode;
|
||||||
$e107 = &e107::getInstance();
|
$e107 = &e107::getInstance();
|
||||||
|
|
||||||
$var['main']['text'] = TPVLAN_33;
|
$var['main']['text'] = TPVLAN_33;
|
||||||
@@ -63,10 +66,10 @@ function theme_adminmenu()
|
|||||||
$selected = (e_QUERY) ? e_QUERY : "main";
|
$selected = (e_QUERY) ? e_QUERY : "main";
|
||||||
|
|
||||||
|
|
||||||
e_admin_menu(TPVLAN_26, $selected, $var);
|
e_admin_menu(TPVLAN_26, $mode, $var);
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once("footer.php");
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -11,8 +11,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.29 $
|
| $Revision: 1.30 $
|
||||||
| $Date: 2009-07-09 08:31:38 $
|
| $Date: 2009-07-09 11:37:36 $
|
||||||
| $Author: e107coders $
|
| $Author: e107coders $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
@@ -33,12 +33,16 @@ class themeHandler{
|
|||||||
require_once(e_HANDLER."form_handler.php");
|
require_once(e_HANDLER."form_handler.php");
|
||||||
$this->frm = new e_form(); //enable inner tabindex counter
|
$this->frm = new e_form(); //enable inner tabindex counter
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (isset($_POST['upload'])) {
|
if (isset($_POST['upload'])) {
|
||||||
$this -> themeUpload();
|
$this -> themeUpload();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this -> themeArray = $this -> getThemes();
|
$this -> themeArray = $this -> getThemes();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
foreach($_POST as $key => $post)
|
foreach($_POST as $key => $post)
|
||||||
{
|
{
|
||||||
if(strstr($key,"preview"))
|
if(strstr($key,"preview"))
|
||||||
@@ -62,6 +66,7 @@ class themeHandler{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(isset($_POST['submit_adminstyle']))
|
if(isset($_POST['submit_adminstyle']))
|
||||||
{
|
{
|
||||||
$this -> id = $_POST['curTheme'];
|
$this -> id = $_POST['curTheme'];
|
||||||
@@ -395,13 +400,22 @@ class themeHandler{
|
|||||||
return $text;
|
return $text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function loadThemeConfig()
|
||||||
|
{
|
||||||
|
$confile = e_THEME.$this->id."/".$this->id."_config.php";
|
||||||
|
|
||||||
|
if(is_readable($confile) && !function_exists($this->id."_config"))
|
||||||
|
{
|
||||||
|
include($confile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function renderThemeConfig() // process custom theme configuration - TODO.
|
function renderThemeConfig() // process custom theme configuration - TODO.
|
||||||
{
|
{
|
||||||
global $frm;
|
global $frm;
|
||||||
$confile = e_THEME.$this->id."/".$this->id."_config.php";
|
|
||||||
if(is_readable($confile))
|
|
||||||
{
|
|
||||||
include_once($confile);
|
|
||||||
if(function_exists($this->id."_config"))
|
if(function_exists($this->id."_config"))
|
||||||
{
|
{
|
||||||
$var = call_user_func($this->id."_config");
|
$var = call_user_func($this->id."_config");
|
||||||
@@ -411,14 +425,28 @@ class themeHandler{
|
|||||||
}
|
}
|
||||||
return $text;
|
return $text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function renderThemeHelp()
|
||||||
|
{
|
||||||
|
|
||||||
|
if(function_exists($this->id."_help"))
|
||||||
|
{
|
||||||
|
return call_user_func($this->id."_help");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function setThemeConfig()
|
function setThemeConfig()
|
||||||
{
|
{
|
||||||
|
global $theme_pref;
|
||||||
|
$this -> loadThemeConfig();
|
||||||
|
|
||||||
$confile = e_THEME.$this->id."/".$this->id."_config.php";
|
$confile = e_THEME.$this->id."/".$this->id."_config.php";
|
||||||
|
|
||||||
include($confile);
|
|
||||||
if(function_exists($this->id."_process"))
|
if(function_exists($this->id."_process"))
|
||||||
{
|
{
|
||||||
$text = call_user_func($this->id."_process");
|
$text = call_user_func($this->id."_process");
|
||||||
@@ -470,6 +498,9 @@ class themeHandler{
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->id = $theme['path'];
|
$this->id = $theme['path'];
|
||||||
|
|
||||||
|
$this->loadThemeConfig(); // load customn theme configuration fieldss.
|
||||||
|
|
||||||
$menuPresetCount = 0;
|
$menuPresetCount = 0;
|
||||||
foreach($theme['layouts'] as $key=>$val)
|
foreach($theme['layouts'] as $key=>$val)
|
||||||
{
|
{
|
||||||
@@ -480,8 +511,21 @@ class themeHandler{
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$text = "<div class='block' >
|
$text = "
|
||||||
<h2 class='caption'>".$theme['name']."</h2>
|
<h2 class='caption'>".$theme['name']."</h2>
|
||||||
|
<div class='admintabs' id='tab-container'>";
|
||||||
|
|
||||||
|
if(function_exists($theme['name']."_help"))
|
||||||
|
{
|
||||||
|
$text .= "
|
||||||
|
<ul class='e-tabs e-hideme' id='core-thememanager-tabs'>
|
||||||
|
<li id='tab-thememanager-configure'><a href='#core-thememanager-configure'>".LAN_CONFIGURE."</a></li>
|
||||||
|
<li id='tab-thememanager-help'><a href='#core-thememanager-help'>".LAN_HELP."</a></li>
|
||||||
|
</ul>";
|
||||||
|
}
|
||||||
|
|
||||||
|
$text .= "
|
||||||
|
<div id='core-thememanager-configure'>
|
||||||
<table class='adminlist'>
|
<table class='adminlist'>
|
||||||
<tr><td colspan='3'></td></tr>
|
<tr><td colspan='3'></td></tr>
|
||||||
<tr><td><b>".TPVLAN_11."</b></td><td>".$theme['version']."</td>
|
<tr><td><b>".TPVLAN_11."</b></td><td>".$theme['version']."</td>
|
||||||
@@ -538,13 +582,9 @@ class themeHandler{
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
if($theme['layouts'] && $mode==1) // New in 0.8 ----
|
if(count($theme['layouts'])>1 && $mode==1) // New in 0.8 ----
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$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>
|
||||||
<td colspan='2' style='vertical-align:top'>
|
<td colspan='2' style='vertical-align:top'>
|
||||||
@@ -699,7 +739,13 @@ class themeHandler{
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>\n";
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div id='core-thememanager-help' >".$this->renderThemeHelp()."</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
\n";
|
||||||
|
|
||||||
return $text;
|
return $text;
|
||||||
}
|
}
|
||||||
@@ -718,7 +764,7 @@ class themeHandler{
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$text .= "<a href='".e_ADMIN."plugin.php'>".$plug."</a> ".ADMIN_FALSE_ICON;
|
$text .= "<a href='".e_ADMIN."plugin.php?avail'>".$plug."</a> ".ADMIN_FALSE_ICON;
|
||||||
}
|
}
|
||||||
$text .= " ";
|
$text .= " ";
|
||||||
}
|
}
|
||||||
@@ -809,9 +855,9 @@ class themeHandler{
|
|||||||
|
|
||||||
$e107cache->clear_sys();
|
$e107cache->clear_sys();
|
||||||
save_prefs();
|
save_prefs();
|
||||||
$custom_message = $this -> setThemeConfig();
|
$this -> setThemeConfig();
|
||||||
$this->theme_adminlog('03',$pref['image_preload'].', '.$pref['themecss']);
|
$this->theme_adminlog('03',$pref['image_preload'].', '.$pref['themecss']);
|
||||||
$ns->tablerender(TPVLAN_36, "<br /><div style='text-align:center;'>".TPVLAN_37.".<br />".$custom_message."</div><br />");
|
$ns->tablerender(TPVLAN_36, "<br /><div style='text-align:center;'>".TPVLAN_37.".<br /></div><br />");
|
||||||
}
|
}
|
||||||
|
|
||||||
function setAdminStyle()
|
function setAdminStyle()
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* Copyright e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
|
* Copyright e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
|
||||||
* $Id: lan_admin.php,v 1.18 2009-07-09 02:47:12 e107coders Exp $
|
* $Id: lan_admin.php,v 1.19 2009-07-09 11:37:36 e107coders Exp $
|
||||||
*
|
*
|
||||||
* Admin Language File
|
* Admin Language File
|
||||||
*/
|
*/
|
||||||
@@ -12,7 +12,7 @@ define("ADLAN_3", "News items List");
|
|||||||
define("ADLAN_3a", "News Settings");
|
define("ADLAN_3a", "News Settings");
|
||||||
define("ADLAN_4", "Preferences");
|
define("ADLAN_4", "Preferences");
|
||||||
define("ADLAN_5", "Edit Site Preferences");
|
define("ADLAN_5", "Edit Site Preferences");
|
||||||
define("ADLAN_6", "Menus");
|
define("ADLAN_6", "Menu Manager");
|
||||||
define("ADLAN_7", "Alter the order of your menus");
|
define("ADLAN_7", "Alter the order of your menus");
|
||||||
define("ADLAN_8", "Administrators");
|
define("ADLAN_8", "Administrators");
|
||||||
define("ADLAN_9", "Add/delete site administrators");
|
define("ADLAN_9", "Add/delete site administrators");
|
||||||
@@ -292,5 +292,7 @@ define("LAN_USERCLASS", "Userclass");
|
|||||||
define("LAN_AUTHOR", "Author");
|
define("LAN_AUTHOR", "Author");
|
||||||
define("LAN_CATEGORY", "Category");
|
define("LAN_CATEGORY", "Category");
|
||||||
|
|
||||||
|
define("LAN_HELP", "Help");
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
Reference in New Issue
Block a user