diff --git a/class2.php b/class2.php
index 3adac550c..fcd4bec2c 100644
--- a/class2.php
+++ b/class2.php
@@ -9,8 +9,8 @@
* General purpose file
*
* $Source: /cvs_backup/e107_0.8/class2.php,v $
-* $Revision: 1.103 $
-* $Date: 2009-07-08 01:28:55 $
+* $Revision: 1.104 $
+* $Date: 2009-07-09 08:31:36 $
* $Author: e107coders $
*
*/
@@ -940,23 +940,32 @@ if(!defined("THEME_LAYOUT"))
{
if ($kpage && (strstr(e_SELF, $kpage) || strstr(e_SELF."?".e_QUERY,$kpage)))
{
- $def = ($lyout) ? $lyout : "no_array";
+ // $def = ($lyout) ? $lyout : "legacyCustom";
+ $def = $lyout;
break;
}
}
}
}
+
+ if(strpos(e_SELF.'?'.e_QUERY, $ADMIN_DIRECTORY. 'menus.php?configure')!==FALSE)
+ {
+ $menus_equery = explode('.', e_QUERY);
+ $def = $menus_equery[1];
+ }
+
if($def) // custom-page layout.
{
define("THEME_LAYOUT",$def);
}
else // default layout.
{
- $deflayout = (!isset($user_pref['sitetheme_deflayout'])) ? varset($pref['sitetheme_deflayout']) : $user_pref['sitetheme_deflayout'];
+ $deflayout = (!isset($user_pref['sitetheme_deflayout'])) ? varset($pref['sitetheme_deflayout']) : $user_pref['sitetheme_deflayout'];
define("THEME_LAYOUT",$deflayout); // default layout.
}
- unset($def,$lyout,$cusPagePref);
+
+ unset($def,$lyout,$cusPagePref,$menus_equery,$deflayout);
}
diff --git a/e107_admin/ad_links.php b/e107_admin/ad_links.php
index 2d584d787..510be70bf 100644
--- a/e107_admin/ad_links.php
+++ b/e107_admin/ad_links.php
@@ -9,8 +9,8 @@
* Admin Navigation
*
* $Source: /cvs_backup/e107_0.8/e107_admin/ad_links.php,v $
- * $Revision: 1.10 $
- * $Date: 2009-07-09 02:47:09 $
+ * $Revision: 1.11 $
+ * $Date: 2009-07-09 08:31:37 $
* $Author: e107coders $
*/
@@ -554,7 +554,7 @@ $array_functions = array(
12 => array(e_ADMIN.'links.php', ADLAN_138, ADLAN_139, 'I', 1, E_16_LINKS, E_32_LINKS),
13 => array(e_ADMIN.'wmessage.php', ADLAN_28, ADLAN_29, 'M', 3, E_16_WELCOME, E_32_WELCOME),
14 => array(e_ADMIN.'ugflag.php', ADLAN_40, ADLAN_41, '9', 4, E_16_MAINTAIN, E_32_MAINTAIN),
- 15 => array(e_ADMIN.'menus.php', ADLAN_6, ADLAN_7, '2', 3, E_16_MENUS, E_32_MENUS),
+ 15 => array(e_ADMIN.'menus.php', ADLAN_6, ADLAN_7, '2', 5, E_16_MENUS, E_32_MENUS),
16 => array(e_ADMIN.'meta.php', ADLAN_66, ADLAN_67, 'T', 1, E_16_META, E_32_META),
17 => array(e_ADMIN.'newspost.php', ADLAN_0, ADLAN_1, 'H', 3, E_16_NEWS, E_32_NEWS),
18 => array(e_ADMIN.'phpinfo.php', ADLAN_68, ADLAN_69, '0', 20, E_16_PHP, E_32_PHP),
diff --git a/e107_admin/menus.php b/e107_admin/menus.php
index 89e88888b..a3641d30d 100644
--- a/e107_admin/menus.php
+++ b/e107_admin/menus.php
@@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_admin/menus.php,v $
-| $Revision: 1.21 $
-| $Date: 2009-07-08 06:58:00 $
+| $Revision: 1.22 $
+| $Date: 2009-07-09 08:31:37 $
| $Author: e107coders $
+----------------------------------------------------------------------------+
*/
@@ -46,18 +46,16 @@ if (isset($_POST['custom_select']))
}
else if (!isset($curLayout))
{
- $curLayout = '';
+ $curLayout = $pref['sitetheme_deflayout'];
}
-
-
-if ($curLayout == '' || $curLayout == 'default_layout')
+/*if ($curLayout == '' || $curLayout == 'default_layout')
{
$menus_header = is_array($HEADER) ? $HEADER[$pref['sitetheme_deflayout']] : $HEADER;
$menus_footer = is_array($FOOTER) ? $FOOTER[$pref['sitetheme_deflayout']] : $FOOTER;
}
-else if ($curLayout == 'no_array')
+else if ($curLayout == 'legacyCustom')
{
$menus_header = $CUSTOMHEADER ? $CUSTOMHEADER : $HEADER;
$menus_footer = $CUSTOMFOOTER ? $CUSTOMFOOTER : $FOOTER;
@@ -78,47 +76,52 @@ 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')
+ {
+ $HEADER = ($CUSTOMHEADER) ? $CUSTOMHEADER : $HEADER;
+ $FOOTER = ($CUSTOMFOOTER) ? $CUSTOMFOOTER : $FOOTER;
+ }
+ }
+ elseif($curLayout && $curLayout != "legacyCustom" && (isset($CUSTOMHEADER[$curLayout]) || isset($CUSTOMHEADER[$curLayout]))) // 0.7 themes
+ {
+ // echo " MODE 0.7";
+ $HEADER = ($CUSTOMHEADER[$curLayout]) ? $CUSTOMHEADER[$curLayout] : $HEADER;
+ $FOOTER = ($CUSTOMFOOTER[$curLayout]) ? $CUSTOMFOOTER[$curLayout] : $FOOTER;
+ }
+ elseif($curLayout && isset($HEADER[$curLayout]) && isset($FOOTER[$curLayout])) // 0.8 themes - we use only $HEADER and $FOOTER arrays.
+ {
+ // echo " MODE 0.8";
+ $HEADER = $HEADER[$curLayout];
+ $FOOTER = $FOOTER[$curLayout];
+ }
+
+ if (e_PAGE == 'news.php' && isset($NEWSHEADER))
+ {
+ // parseheader($NEWSHEADER);
+ }
+ else
+ {
+ // parseheader($HEADER);
+ }
-// $layouts_str = $HEADER.$FOOTER;
-$layouts_str = $menus_header.$menus_footer;
+ $layouts_str = $HEADER.$FOOTER;
+ $menus_header = $HEADER;
+ $menus_footer = $FOOTER;
+
if ($NEWSHEADER)
{
$layouts_str .= $NEWSHEADER;
}
-/*if ($CUSTOMPAGES)
-{
- if (is_array($CUSTOMPAGES))
- {
- foreach ($CUSTOMPAGES as $custom_extract_key => $custom_extract_value)
- {
- if ($CUSTOMHEADER[$custom_extract_key])
- {
- $layouts_str .= $CUSTOMHEADER[$custom_extract_key];
- }
- if ($CUSTOMFOOTER[$custom_extract_key])
- {
- $layouts_str .= $CUSTOMFOOTER[$custom_extract_key];
- }
- }
- }
- else
- {
- if ($CUSTOMHEADER)
- {
- $layouts_str .= $CUSTOMHEADER;
- }
- if ($CUSTOMFOOTER)
- {
- $layouts_str .= $CUSTOMFOOTER;
- }
- }
-}*/
-
-
$menu_array = parseheader($layouts_str, 'check');
+
+
sort($menu_array, SORT_NUMERIC);
$menu_check = 'set';
foreach ($menu_array as $menu_value)
@@ -142,94 +145,7 @@ if($_POST['menuSetCustomPages'])
menuSetCustomPages($_POST['custompages']);
}
-function menuActivate()
-{
- global $sql, $admin_log, $pref;
- $location = key($_POST['menuActivate']);
-
- $layout = ($_POST['curLayout'] != $pref['sitetheme_deflayout']) ? $_POST['curLayout'] : "";
-
- $menu_count = $sql->db_Count("menus", "(*)", " WHERE menu_location=".$location." AND menu_layout = '$layout' ");
-
- foreach($_POST['menuselect'] as $sel_mens)
- {
- //Get info from menu being activated
- if($sql->db_Select("menus", 'menu_name, menu_path' , "menu_id = ".$sel_mens." "))
- {
- $row=$sql->db_Fetch();
- //If menu is not already activated in that area, add the record.
-
- if(!$sql->db_Select('menus', 'menu_name,menu_path', " menu_name='".$row['menu_name']."' AND menu_layout = '$layout' AND menu_location = ".$location." LIMIT 1 "))
- {
- $qry = "
- INSERT into #menus
- (`menu_name`, `menu_location`, `menu_order`, `menu_pages`, `menu_path`, `menu_layout`)
- VALUES ('{$row['menu_name']}', {$location}, {$menu_count}, '', '{$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,'');
- $menu_count++;
- }
- }
- }
-}
-
-function menuSetCustomPages($array)
-{
- global $pref;
- $key = key($array);
- $pref['sitetheme_custompages'][$key] = array_filter(explode(" ",$array[$key]));
- save_prefs();
-}
-
-function getMenuPreset($layout)
-{
- global $pref;
-
- // print_a($pref['sitetheme_layouts'][$layout]['menuPresets']);
- if(!isset($pref['sitetheme_layouts'][$layout]['menuPresets']))
- {
- return;
- }
-
- $temp = $pref['sitetheme_layouts'][$layout]['menuPresets']['area'];
-
- foreach($temp as $key=>$val)
- {
- $iD = $val['@attributes']['id'];
- foreach($val['menu'] as $k=>$v)
- {
- $uclass = (defined(trim($v['@attributes']['userclass']))) ? constant(trim($v['@attributes']['userclass'])) : 0;
- $menuArea[] = array(
- 'menu_location' => $iD,
- 'menu_order' => $k,
- 'menu_name' => $v['@attributes']['name']."_menu",
- 'menu_class' => intval($uclass)
- );
- }
- }
-
- return $menuArea;
-
-}
-
-function checkMenuPreset($array,$name)
-{
- if(!is_array($array))
- {
- return;
- }
- foreach($array as $key=>$val)
- {
- if($val['menu_name']==$name)
- {
- return $val['menu_location'];
- }
- }
-
- return FALSE;
-}
@@ -288,113 +204,36 @@ if ($menu_act == 'config')
}
$newurl = $PLUGINS_DIRECTORY.$location."/{$position}{$newloc}.php";
$newurl = SITEURL.str_replace("//", "/", $newurl);
- echo " ";
+ echo " ";
exit;
}
if ($menu_act == "adv")
{
- showVisibility();
+ menuVisibilityOptions();
}
-function showVisibility()
-{
- global $sql,$ns;
- require_once(e_HANDLER."userclass_class.php");
- $sql->db_Select("menus", "*", "menu_id=".$id);
- $row = $sql->db_Fetch();
- $listtype = substr($row['menu_pages'], 0, 1);
- $menu_pages = substr($row['menu_pages'], 2);
- $menu_pages = str_replace("|", "\n", $menu_pages);
- $text = "
";
- $caption = MENLAN_7." ".$row['menu_name'];
- $ns->tablerender($caption, $text);
-
-
-
-}
unset($message);
if ($menu_act == "sv")
{
- $pagelist = explode("\r\n", $_POST['pagelist']);
- for ($i = 0 ; $i < count($pagelist) ; $i++)
- {
- $pagelist[$i] = trim($pagelist[$i]);
- }
- $plist = implode("|", $pagelist);
- $pageparms = $_POST['listtype'].'-'.$plist;
- $pageparms = preg_replace("#\|$#", "", $pageparms);
- $pageparms = (trim($_POST['pagelist']) == '') ? '' : $pageparms;
- $sql->db_Update("menus", "menu_class='".$_POST['menu_class']."', menu_pages='{$pageparms}' WHERE menu_id=".intval($id));
- $admin_log->log_event('MENU_02',$_POST['menu_class'].'[!br!]'.$pageparms.'[!br!]'.$id,E_LOG_INFORMATIVE,'');
- $message = "
".MENLAN_8."
";
+ menuSaveVisibility();
+
}
+
+
+
if ($menu_act == "move")
{
- // Get current menu name
- if($sql->db_Select('menus', 'menu_name', 'menu_id='.$id, 'default'))
- {
- $row = $sql->db_Fetch();
- //Check to see if menu is already active in the new area, if not then move it
- if(!$sql->db_Select('menus', 'menu_id', "menu_name='{$row['menu_name']}' AND menu_location = ".$newloc))
- {
- $menu_count = $sql->db_Count("menus", "(*)", " WHERE menu_location=".$newloc);
- $sql->db_Update("menus", "menu_location='{$newloc}', menu_order=".($menu_count+1)." WHERE menu_id=".$id);
- $sql->db_Update("menus", "menu_order=menu_order-1 WHERE menu_location='{$location}' AND menu_order > {$position}");
- }
- $admin_log->log_event('MENU_03',$row['menu_name'].'[!br!]'.$newloc.'[!br!]'.$id,E_LOG_INFORMATIVE,'');
- }
+ menuMove();
}
if ($menu_act == "deac")
{
- // Get current menu name
- if($sql->db_Select('menus', 'menu_name', 'menu_id='.$id, 'default'))
- {
- $row = $sql->db_Fetch();
- //Check to see if there is already a menu with location = 0 (to maintain BC)
- if($sql->db_Select('menus', 'menu_id', "menu_name='{$row['menu_name']}' AND menu_location = 0"))
- {
- //menu_location=0 already exists, we can just delete this record
- $sql->db_Delete('menus', 'menu_id='.$id);
- }
- else
- {
- //menu_location=0 does NOT exist, let's just convert this to it
- $sql->db_Update("menus", "menu_location=0, menu_order=0, menu_class=0, menu_pages='' WHERE menu_id=".$id);
- }
- //Move all other menus up
- $sql->db_Update("menus", "menu_order=menu_order-1 WHERE menu_location={$location} AND menu_order > {$position}");
- $admin_log->log_event('MENU_04',$row['menu_name'].'[!br!]'.$location.'[!br!]'.$position.'[!br!]'.$id,E_LOG_INFORMATIVE,'');
- }
+ menuDeactivate();
}
if ($menu_act == "bot")
@@ -509,11 +348,237 @@ if (strpos(e_QUERY, 'configure') === FALSE)
else // Within the IFrame.
{
- echo layout_list();
+ echo menuSelectLayout();
menuRenderPage();
}
+
+// ---------------------------------------------------------------------------
+
+function menuVisibilityOptions()
+{
+ global $sql,$ns,$id;
+ require_once(e_HANDLER."userclass_class.php");
+ $sql->db_Select("menus", "*", "menu_id=".$id);
+ $row = $sql->db_Fetch();
+ $listtype = substr($row['menu_pages'], 0, 1);
+ $menu_pages = substr($row['menu_pages'], 2);
+ $menu_pages = str_replace("|", "\n", $menu_pages);
+
+ $text = "";
+ $caption = MENLAN_7." ".$row['menu_name'];
+ $ns->tablerender($caption, $text);
+
+
+
+}
+
+function menuActivate()
+{
+ global $sql, $admin_log, $pref;
+
+ $location = key($_POST['menuActivate']);
+
+ $layout = ($_POST['curLayout'] != $pref['sitetheme_deflayout']) ? $_POST['curLayout'] : "";
+
+ $menu_count = $sql->db_Count("menus", "(*)", " WHERE menu_location=".$location." AND menu_layout = '$layout' ");
+
+ foreach($_POST['menuselect'] as $sel_mens)
+ {
+ //Get info from menu being activated
+ if($sql->db_Select("menus", 'menu_name, menu_path' , "menu_id = ".$sel_mens." "))
+ {
+ $row=$sql->db_Fetch();
+ //If menu is not already activated in that area, add the record.
+
+ if(!$sql->db_Select('menus', 'menu_name,menu_path', " menu_name='".$row['menu_name']."' AND menu_layout = '$layout' AND menu_location = ".$location." LIMIT 1 "))
+ {
+ $qry = "
+ INSERT into #menus
+ (`menu_name`, `menu_location`, `menu_order`, `menu_pages`, `menu_path`, `menu_layout`)
+ VALUES ('{$row['menu_name']}', {$location}, {$menu_count}, '', '{$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,'');
+ $menu_count++;
+ }
+ }
+ }
+}
+
+function menuSetCustomPages($array)
+{
+ global $pref;
+ $key = key($array);
+ $pref['sitetheme_custompages'][$key] = array_filter(explode(" ",$array[$key]));
+ save_prefs();
+}
+
+function getMenuPreset($layout)
+{
+ global $pref;
+
+ // print_a($pref['sitetheme_layouts'][$layout]['menuPresets']);
+ if(!isset($pref['sitetheme_layouts'][$layout]['menuPresets']))
+ {
+ return;
+ }
+
+ $temp = $pref['sitetheme_layouts'][$layout]['menuPresets']['area'];
+
+ foreach($temp as $key=>$val)
+ {
+ $iD = $val['@attributes']['id'];
+ foreach($val['menu'] as $k=>$v)
+ {
+ $uclass = (defined(trim($v['@attributes']['userclass']))) ? constant(trim($v['@attributes']['userclass'])) : 0;
+ $menuArea[] = array(
+ 'menu_location' => $iD,
+ 'menu_order' => $k,
+ 'menu_name' => $v['@attributes']['name']."_menu",
+ 'menu_class' => intval($uclass)
+ );
+ }
+ }
+
+ return $menuArea;
+
+}
+
+function checkMenuPreset($array,$name)
+{
+ if(!is_array($array))
+ {
+ return;
+ }
+ foreach($array as $key=>$val)
+ {
+ if($val['menu_name']==$name)
+ {
+ return $val['menu_location'];
+ }
+ }
+
+ return FALSE;
+}
+
+
+
+
+
+
+
+// --------------------------------------------------------------------------
+
+function menuSaveVisibility()
+{
+ global $sql, $admin_log,$id;
+ $pagelist = explode("\r\n", $_POST['pagelist']);
+ for ($i = 0 ; $i < count($pagelist) ; $i++)
+ {
+ $pagelist[$i] = trim($pagelist[$i]);
+ }
+ $plist = implode("|", $pagelist);
+ $pageparms = $_POST['listtype'].'-'.$plist;
+ $pageparms = preg_replace("#\|$#", "", $pageparms);
+ $pageparms = (trim($_POST['pagelist']) == '') ? '' : $pageparms;
+
+ if($sql->db_Update("menus", "menu_class='".$_POST['menu_class']."', menu_pages='{$pageparms}' WHERE menu_id=".intval($id)))
+ {
+ $admin_log->log_event('MENU_02',$_POST['menu_class'].'[!br!]'.$pageparms.'[!br!]'.$id,E_LOG_INFORMATIVE,'');
+ $message = "
".MENLAN_8."
";
+ }
+ else
+ {
+ $message = "the update failed";
+
+ }
+
+ echo $message;
+
+}
+
+
+
+// -----------------------------------------------------------------------
+
+function menuDeactivate()
+{ // Get current menu name
+ global $sql,$admin_log,$id,$curLayout;
+
+ if($sql->db_Select('menus', 'menu_name', 'menu_id='.$id, 'default'))
+ {
+ $row = $sql->db_Fetch();
+ //Check to see if there is already a menu with location = 0 (to maintain BC)
+ if($sql->db_Select('menus', 'menu_id', "menu_name='{$row['menu_name']}' AND menu_location = 0 AND menu_layout ='".$curLayout."' LIMIT 1"))
+ {
+ //menu_location=0 already exists, we can just delete this record
+ $sql->db_Delete('menus', 'menu_id='.$id);
+ }
+ else
+ {
+ //menu_location=0 does NOT exist, let's just convert this to it
+ if(!$sql->db_Update("menus", "menu_location=0, menu_order=0, menu_class=0, menu_pages='' WHERE menu_id=".$id))
+ {
+ $message = "FAILED";
+ }
+ }
+ //Move all other menus up
+ $sql->db_Update("menus", "menu_order=menu_order-1 WHERE menu_location={$location} AND menu_order > {$position} AND menu_layout = '".$curLayout."' ");
+ $admin_log->log_event('MENU_04',$row['menu_name'].'[!br!]'.$location.'[!br!]'.$position.'[!br!]'.$id,E_LOG_INFORMATIVE,'');
+ }
+
+ echo $message;
+}
+
+
+// ----------------------------------------------------------------------
+
+function menuMove()
+{// Get current menu name
+
+ global $id,$admin_log,$sql,$newloc, $curLayout;
+
+ if($sql->db_Select('menus', 'menu_name', 'menu_id='.$id, 'default'))
+ {
+ $row = $sql->db_Fetch();
+ //Check to see if menu is already active in the new area, if not then move it
+ if(!$sql->db_Select('menus', 'menu_id', "menu_name='{$row['menu_name']}' AND menu_location = ".$newloc." AND menu_layout='".$curLayout ."' LIMIT 1"))
+ {
+ $menu_count = $sql->db_Count("menus", "(*)", " WHERE menu_location=".$newloc);
+ $sql->db_Update("menus", "menu_location='{$newloc}', menu_order=".($menu_count+1)." WHERE menu_id=".$id);
+ $sql->db_Update("menus", "menu_order=menu_order-1 WHERE menu_location='{$location}' AND menu_order > {$position} AND menu_layout='".$curLayout ."' ");
+ }
+ $admin_log->log_event('MENU_03',$row['menu_name'].'[!br!]'.$newloc.'[!br!]'.$id,E_LOG_INFORMATIVE,'');
+ }
+}
+
+
// =-----------------------------------------------------------------------------
@@ -596,17 +661,30 @@ function menuRenderPage()
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-function layout_list()
+function menuSelectLayout()
{
global $frm, $curLayout, $menus_equery, $pref, $HEADER, $CUSTOMHEADER, $CUSTOMFOOTER, $CUSTOMPAGES;
-
$text .= "";
+ return $text;
+
+
if(is_array($HEADER))
{
foreach($HEADER as $key=>$val)
@@ -624,12 +702,12 @@ function layout_list()
if($CUSTOMHEADER && !is_array($CUSTOMHEADER))
{
- $CUSTOMHEADER = array('no_array'=>$CUSTOMHEADER);
+ $CUSTOMHEADER = array('legacyCustom'=>$CUSTOMHEADER);
}
if($CUSTOMFOOTER && !is_array($CUSTOMFOOTER))
{
- $CUSTOMFOOTER = array('no_array'=> $CUSTOMFOOTER);
+ $CUSTOMFOOTER = array('legacyCustom'=> $CUSTOMFOOTER);
}
@@ -640,7 +718,7 @@ function layout_list()
{
$selected = ($curLayout == $key || $curLayout == 'default_layout' ) ? "selected='selected'" : "";
$deftext = ($key==$pref['sitetheme_deflayout']) ? " (".MENLAN_31.")" : "";
- $diz = ($key == "no_array") ? MENLAN_33 : str_replace("_"," ",$key);
+ $diz = ($key == "legacyCustom") ? MENLAN_33 : str_replace("_"," ",$key);
$text .= "\n";
// $text .= $frm->form_option(ucwords($diz).$deftext, $default, $key);
}
@@ -651,7 +729,7 @@ function layout_list()
$text .= "";
// TO-DO Saving of the custompage preference for each layout.
-
+ /*
if($curLayout && ($curLayout != $pref['sitetheme_deflayout']))
{
@@ -661,7 +739,7 @@ function layout_list()
{
$custPages = $pref['sitetheme_layouts'][$curLayout]['customPages'];
}
- elseif(isset($CUSTOMPAGES[$curLayout]) && $curLayout !='no_array')
+ elseif(isset($CUSTOMPAGES[$curLayout]) && $curLayout !='legacyCustom')
{
$custPages = $CUSTOMPAGES[$curLayout];
}
@@ -681,7 +759,7 @@ function layout_list()
$text .= "Displays on these pages:
";
- }
+ }*/
$text .= "
";
return $text;
@@ -727,7 +805,7 @@ function parseheader($LAYOUT, $check = FALSE)
function checklayout($str,$curLayout)
{ // Displays a basic representation of the theme
- global $pref, $menu_areas, $ns, $PLUGINS_DIRECTORY, $frm, $sc_style, $tp, $menus_equery;
+ global $pref, $menu_areas, $ns, $PLUGINS_DIRECTORY, $frm, $sc_style, $tp, $menu_order, $menus_equery;
$menuLayout = ($curLayout != $pref['sitetheme_deflayout']) ? $curLayout : "";
diff --git a/e107_files/shortcode/batch/admin_shortcodes_class.php b/e107_files/shortcode/batch/admin_shortcodes_class.php
index c292cac38..0ca6bacd2 100644
--- a/e107_files/shortcode/batch/admin_shortcodes_class.php
+++ b/e107_files/shortcode/batch/admin_shortcodes_class.php
@@ -1,7 +1,7 @@
";
+ $menu_vars['home']['image_src'] = ADLAN_151;
+ $menu_vars['home']['perm'] = '';
+
+ $menu_vars['logout']['text'] = ADLAN_46;
+ $menu_vars['logout']['link'] = e_ADMIN_ABS.'admin.php?logout';
+ $menu_vars['logout']['image'] = "
";
+ $menu_vars['logout']['image_src'] = ADLAN_46;
+ $menu_vars['logout']['perm'] = '';
+
+ // $text .= adnav_cat(ADLAN_53, e_BASE.'index.php', E_16_NAV_LEAV);
+ // $text .= adnav_cat(ADLAN_46, e_ADMIN.'admin.php?logout', E_16_NAV_LGOT);
+
+
+
+
+
return e_admin_menu('', '', $menu_vars, $$tmpl, false, false);
}
diff --git a/e107_handlers/theme_handler.php b/e107_handlers/theme_handler.php
index 1a4b79d31..d9e8eab60 100644
--- a/e107_handlers/theme_handler.php
+++ b/e107_handlers/theme_handler.php
@@ -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.28 $
-| $Date: 2009-07-09 02:47:12 $
+| $Revision: 1.29 $
+| $Date: 2009-07-09 08:31:38 $
| $Author: e107coders $
+----------------------------------------------------------------------------+
*/
@@ -73,9 +73,12 @@ class themeHandler{
{
$this -> id = $_POST['curTheme'];
$this -> setStyle();
+ $this -> SetCustomPages($_POST['custompages']);
}
+
+
}
function getThemes($mode=FALSE)
@@ -394,6 +397,7 @@ class themeHandler{
function renderThemeConfig() // process custom theme configuration - TODO.
{
+ global $frm;
$confile = e_THEME.$this->id."/".$this->id."_config.php";
if(is_readable($confile))
{
@@ -465,7 +469,16 @@ class themeHandler{
return $text;
}
- $this->id = $theme['path'];
+ $this->id = $theme['path'];
+ $menuPresetCount = 0;
+ foreach($theme['layouts'] as $key=>$val)
+ {
+ if($val['menuPresets'])
+ {
+ $menuPresetCount++;
+ }
+ }
+
$text = "
".$theme['name']."
@@ -477,39 +490,71 @@ class themeHandler{
$text .= "
".TPVLAN_4.": | ".$author." |
";
$text .= "
".TPVLAN_5.": | ".$website." |
";
$text .= "
".TPVLAN_6.": | ".$theme['date']." |
";
- $text .= "
".TPVLAN_49.": |
+
+ $text .= "
".TPVLAN_7.": | ".$theme['info']." |
";
+
+ $text .= "
".TPVLAN_49.": |
XHTML ";
$text .= ($theme['xhtmlcompliant']) ? ADMIN_TRUE_ICON : "X";
$text .= " CSS ";
$text .= ($theme['csscompliant']) ? ADMIN_TRUE_ICON : "X";
$text .= " |
";
- $text .= "
".TPVLAN_7.": | ".$theme['info']." |
- ";
+
if($mode == 1)
{
- $text .= "
+
+ $text .= "
- ".TPVLAN_30." |
+ ".TPVLAN_53." |
+ ";
+
+ foreach($theme['layouts'] as $key=>$val)
+ {
+ $text .= $this->renderPlugins($val['@attributes']['plugins']);
+ $text .= " ";
+ }
+
+ $text .= " |
+
";
+
+ $text .= "
+
+ ".TPVLAN_54." |
+ ".$menuPresetCount." |
+
";
+
+ $text .= "
+
+ ".TPVLAN_30." |
".TPVLAN_28."
".TPVLAN_29."
|
";
+
+
}
+
+
if($theme['layouts'] && $mode==1) // New in 0.8 ----
{
+
+
+
+
+
$itext .= "
".TPVLAN_50.": |
";
- $itext .= ($mode == 1) ? "".TPVLAN_55." | " : "";
+ $itext .= ($mode == 1) ? "".TPVLAN_55." | " : "";
$itext .= "
- ".TPVLAN_52." |
- ".TPVLAN_53." |
- ".TPVLAN_54." |
+ ".TPVLAN_52." |
+ ".TPVLAN_56." |
+
\n";
@@ -534,12 +579,12 @@ class themeHandler{
$itext .= ($val['@attributes']['previewFull']) ? "" : "";
$itext .= $val['@attributes']['title'];
$itext .= ($val['@attributes']['previewFull']) ? "" : "";
- $itext .= ($pref['sitetheme_deflayout'] == $key) ? " (default)" : "";
+
+ $itext .= "
+ ";
+ $itext .= ($pref['sitetheme_deflayout'] != $key) ? "\n" : TPVLAN_55; // Default
+
$itext .= " |
- ".$this->renderPlugins($val['@attributes']['plugins'])." |
- ";
- $itext .= ($val['menuPresets']) ? ADMIN_TRUE_ICON : " ";
- $itext .= " |
";
}
@@ -558,9 +603,9 @@ class themeHandler{
".TPVLAN_22.": |
- ".TPVLAN_55." |
- ".TPVLAN_52." |
- ".TPVLAN_7." |
+ ".TPVLAN_55." |
+ ".TPVLAN_52." |
+ ".TPVLAN_7." |
\n";
foreach($theme['css'] as $css)
@@ -669,13 +714,13 @@ class themeHandler{
$plug = trim($plug);
if(plugInstalled($plug))
{
- $text .= ADMIN_TRUE_ICON.$plug;
+ $text .= $plug." ".ADMIN_TRUE_ICON;
}
else
{
- $text .= ADMIN_FALSE_ICON."".$plug."";
+ $text .= "".$plug." ".ADMIN_FALSE_ICON;
}
- $text .= " ";
+ $text .= " ";
}
return $text;
@@ -782,6 +827,19 @@ class themeHandler{
$ns->tablerender(TPVLAN_36, "
".TPVLAN_43.". ");
}
+ function SetCustomPages($array)
+ {
+ global $pref;
+ $key = key($array);
+ $pref['sitetheme_custompages'][$key] = array_filter(explode(" ",$array[$key]));
+
+ if($pref['sitetheme_deflayout'] == 'legacyCustom')
+ {
+ $pref['sitetheme_custompages']['legacyCustom'] = array();
+ }
+ save_prefs();
+ }
+
// Log event to admin log
function theme_adminlog($msg_num='00', $woffle='')
@@ -831,7 +889,7 @@ class themeHandler{
}
// echo " ".$path." ";
-
+ $lays['legacyDefault']['@attributes'] = array('title'=>'Default','preview'=>'','previewFull'=>'','plugins'=>'', 'default'=>'true');
foreach($themeContentsArray as $line)
{
@@ -849,10 +907,12 @@ class themeHandler{
}
elseif($CUSTOMPAGES)
{
- $themeArray['custompages']['no_array'] = explode(" ",$CUSTOMPAGES);
+ $themeArray['custompages']['legacyCustom'] = explode(" ",$CUSTOMPAGES);
+ $lays['legacyCustom']['@attributes'] = array('title'=>'Custom','preview'=>'','previewFull'=>'','plugins'=>'');
}
$themeArray['path'] = $path;
+ $themeArray['layouts'] = $lays;
return $themeArray;
}
diff --git a/e107_languages/English/admin/lan_theme.php b/e107_languages/English/admin/lan_theme.php
index f523eb04f..59f570d45 100644
--- a/e107_languages/English/admin/lan_theme.php
+++ b/e107_languages/English/admin/lan_theme.php
@@ -4,8 +4,8 @@
| e107 website system - Language File.
|
| $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/lan_theme.php,v $
-| $Revision: 1.6 $
-| $Date: 2009-07-06 09:28:02 $
+| $Revision: 1.7 $
+| $Date: 2009-07-09 08:31:38 $
| $Author: e107coders $
+----------------------------------------------------------------------------+
*/
@@ -71,9 +71,9 @@ define("TPVLAN_50", "Layouts");
define("TPVLAN_51", "Change Theme");
define("TPVLAN_52", "Name");
define("TPVLAN_53", "Suggested Plugins");
-define("TPVLAN_54", "Menu Preset");
+define("TPVLAN_54", "Menu Presets");
define("TPVLAN_55", "Default");
-
+define("TPVLAN_56", "Visibility Filter");
diff --git a/e107_themes/jayya/style.css b/e107_themes/jayya/style.css
index 597fac3dc..6ff09dfc2 100644
--- a/e107_themes/jayya/style.css
+++ b/e107_themes/jayya/style.css
@@ -726,12 +726,14 @@ ul.plugin-navigation ul.plugin-navigation-sub a.link-active {font-weight: bold;}
/******** Block Elements */
.block { border: 1px solid #DDDDDD; margin-bottom: 10px;}
.block-text { padding: 10px 10px 10px; }
-.block h2.caption, .block h4.caption { padding: 5px 10px 5px; border-bottom: 1px solid #DDDDDD; }
+.block h2.caption, .block h4.caption { padding: 5px 10px 5px; border-bottom: 1px solid #DDDDDD; }
.page-info { border: 1px solid #DDDDDD; margin-bottom: 10px; }
.page-info p { padding: 10px; }
/***** Admin Info Panel Buttons **/
+h2.caption { font-size: 200%; font-weight:bold; }
+
.core-mainpanel-block { text-align:center; width:100px; float:left; height:48px; display:block;margin:15px; }
.core-mainpanel-link-text { font-weight:bold; text-decoration: none; padding:3px }
diff --git a/e107_themes/templates/header_default.php b/e107_themes/templates/header_default.php
index a0f3d95b8..85d967605 100644
--- a/e107_themes/templates/header_default.php
+++ b/e107_themes/templates/header_default.php
@@ -6,8 +6,8 @@
| Released under the terms and conditions of the GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_themes/templates/header_default.php,v $
-| $Revision: 1.32 $
-| $Date: 2009-07-07 16:04:51 $
+| $Revision: 1.33 $
+| $Date: 2009-07-09 08:31:38 $
| $Author: e107coders $
+-----------------------------------------------------------------------------------------------+
*/
@@ -448,17 +448,19 @@ if ($e107_popup != 1) {
// ---------- New in 0.8 -------------------------------------------------------
- $def = THEME_LAYOUT;
+ $def = THEME_LAYOUT; // The active layout based on custompage matches.
- // echo "DEF = ".$def;
+ // echo "DEF = ".$def." ";
- if(($def == 'no_array') && (isset($CUSTOMHEADER) || isset($CUSTOMFOOTER)) ) // 0.6 themes.
+ if(($def == 'legacyCustom' || $def=='legacyDefault') && (isset($CUSTOMHEADER) || isset($CUSTOMFOOTER)) ) // 0.6 themes.
{
- // echo " MODE 0.6";
- $HEADER = ($CUSTOMHEADER) ? $CUSTOMHEADER : $HEADER;
- $FOOTER = ($CUSTOMFOOTER) ? $CUSTOMFOOTER : $FOOTER;
+ if($def == 'legacyCustom')
+ {
+ $HEADER = ($CUSTOMHEADER) ? $CUSTOMHEADER : $HEADER;
+ $FOOTER = ($CUSTOMFOOTER) ? $CUSTOMFOOTER : $FOOTER;
+ }
}
- elseif($def && $def != "no_array" && (isset($CUSTOMHEADER[$def]) || isset($CUSTOMHEADER[$def]))) // 0.7 themes
+ elseif($def && $def != "legacyCustom" && (isset($CUSTOMHEADER[$def]) || isset($CUSTOMHEADER[$def]))) // 0.7 themes
{
// echo " MODE 0.7";
$HEADER = ($CUSTOMHEADER[$def]) ? $CUSTOMHEADER[$def] : $HEADER;
| |