1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 20:30:39 +02:00

Site Prefs, core administration changes - work in progress

This commit is contained in:
secretr
2008-12-18 16:55:46 +00:00
parent 315c9fe811
commit 582bc4df97
11 changed files with 373 additions and 122 deletions

View File

@@ -9,8 +9,8 @@
* Administration Area - Emotions Settings & Packs * Administration Area - Emotions Settings & Packs
* *
* $Source: /cvs_backup/e107_0.8/e107_admin/emoticon.php,v $ * $Source: /cvs_backup/e107_0.8/e107_admin/emoticon.php,v $
* $Revision: 1.11 $ * $Revision: 1.12 $
* $Date: 2008-12-15 11:35:33 $ * $Date: 2008-12-18 16:55:45 $
* $Author: secretr $ * $Author: secretr $
* *
*/ */
@@ -135,7 +135,6 @@ class emotec
global $e107, $emessage, $fl, $pref; global $e107, $emessage, $fl, $pref;
$text = " $text = "
".$emessage->render()."
<div class='admintabs' id='tab-container'> <div class='admintabs' id='tab-container'>
<ul class='e-tabs' id='core-emote-tabs'> <ul class='e-tabs' id='core-emote-tabs'>
<li id='tab-activate'><a href='#emoticon-activate'>".EMOLAN_1."</a></li> <li id='tab-activate'><a href='#emoticon-activate'>".EMOLAN_1."</a></li>
@@ -249,7 +248,7 @@ class emotec
</div> </div>
"; ";
$e107->ns->tablerender(EMOLAN_PAGE_TITLE, $text); $e107->ns->tablerender(EMOLAN_PAGE_TITLE, $emessage->render().$text);
} }
@@ -373,7 +372,7 @@ class emotec
if (is_file($backname)) unlink($backname); // Delete any old backup if (is_file($backname)) unlink($backname); // Delete any old backup
if (is_file($fname)) rename($fname,$backname); if (is_file($fname)) rename($fname,$backname);
//XXX message handler
if (file_put_contents($fname,$f_string) === FALSE) if (file_put_contents($fname,$f_string) === FALSE)
{ {
$emessage->add('<strong>'.EMOLAN_30.'</strong>'.str_replace(e_IMAGE, e_IMAGE_ABS, $fname), E_MESSAGE_WARNING); $emessage->add('<strong>'.EMOLAN_30.'</strong>'.str_replace(e_IMAGE, e_IMAGE_ABS, $fname), E_MESSAGE_WARNING);
@@ -397,11 +396,11 @@ class emotec
if ($sql->db_Select("core", "*", "e107_name='emote_".$packID."'")) if ($sql->db_Select("core", "*", "e107_name='emote_".$packID."'"))
{ {
admin_update($sql->db_Update("core", "`e107_value`='{$tmp}' WHERE `e107_name`='emote_".$packID."' "), 'update', EMOLAN_16); admin_update($sql->db_Update("core", "`e107_value`='{$tmp}' WHERE `e107_name`='emote_".$packID."' "), 'update', EMOLAN_16, false, false);
} }
else else
{ {
admin_update($sql->db_Insert("core", "'emote_".$packID."', '$tmp' "), 'insert', EMOLAN_16); admin_update($sql->db_Insert("core", "'emote_".$packID."', '$tmp' "), 'insert', EMOLAN_16, false, false);
} }
} }

View File

@@ -12,8 +12,8 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_admin/header.php,v $ | $Source: /cvs_backup/e107_0.8/e107_admin/header.php,v $
| $Revision: 1.22 $ | $Revision: 1.23 $
| $Date: 2008-12-17 17:27:07 $ | $Date: 2008-12-18 16:55:45 $
| $Author: secretr $ | $Author: secretr $
+---------------------------------------------------------------+ +---------------------------------------------------------------+
*/ */
@@ -325,9 +325,124 @@ if ($e107_popup != 1) {
$ns = new e107table; $ns = new e107table;
$e107_var = array(); $e107_var = array();
function e_admin_menu($title, $active_page, $e107_vars, $tmpl = FALSE, $sub_link = FALSE, $sortlist = FALSE)
{
global $E_ADMIN_MENU, $e107;
if(!$tmpl) $tmpl = $E_ADMIN_MENU;
/*
* Search for id
*/
$temp = explode('--id--', $title, 2);
$title = $temp[0];
$id = str_replace(array(' ', '_'), '-',varset($temp[1]));
unset($temp);
/*
* SORT
*/
if ($sortlist == TRUE)
{
$temp = $e107_vars;
unset($e107_vars);
$func_list = array();
foreach (array_keys($temp) as $key)
{
$func_list[] = $temp[$key]['text'];
}
usort($func_list, 'strcoll');
foreach ($func_list as $func_text)
{
foreach (array_keys($temp) as $key)
{
if ($temp[$key]['text'] == $func_text)
{
$e107_vars[] = $temp[$key];
}
}
}
unset($temp);
}
$kpost = '';
$text = '';
if($sub_link)
{
$kpost = '_sub';
}
else $text = $tmpl['start'];
//FIXME - e_parse::array2sc()
$search = array();
$search[0] = '/\{LINK_TEXT\}(.*?)/si';
$search[1] = '/\{LINK_URL\}(.*?)/si';
$search[2] = '/\{ONCLICK\}(.*?)/si';
$search[3] = '/\{SUB_HEAD\}(.*?)/si';
$search[4] = '/\{SUB_MENU\}(.*?)/si';
$search[5] = '/\{ID\}(.*?)/si';
$search[6] = '/\{SUB_ID\}(.*?)/si';
$search[7] = '/\{LINK_CLASS\}(.*?)/si';
$search[8] = '/\{SUB_CLASS\}(.*?)/si';
foreach (array_keys($e107_vars) as $act)
{
$replace = array();
if ($active_page == $act || (str_replace("?", "", e_PAGE.e_QUERY) == str_replace("?", "", $act)))
{
$temp = $tmpl['button_active'.$kpost];
}
else
{
$temp = $tmpl['button'.$kpost];
}
$replace[0] = str_replace(" ", "&nbsp;", $e107_vars[$act]['text']);
$replace[1] = varsettrue($e107_vars[$act]['link'], "#{$act}");
$replace[2] = '';
if (varsettrue($e107_vars[$act]['include']))
{
$replace[2] = $e107_vars[$act]['include'];
//$replace[2] = $js ? " onclick=\"showhideit('".$act."');\"" : " onclick=\"document.location='".$e107_vars[$act]['link']."'; disabled=true;\"";
}
$replace[3] = $title;
$replace[4] = '';
$rid = str_replace(array(' ', '_'), '-', $act).($id ? "-{$id}" : '');
$replace[5] = $id ? " id='eplug-nav-{$rid}'" : '';
$replace[6] = '';
$replace[7] = '';
$replace[8] = '';
if(varsettrue($e107_vars[$act]['sub']))
{
$replace[6] = $id ? " id='eplug-nav-{$rid}-sub'" : '';
$replace[7] = ' e-expandit';
$replace[8] = ' e-hideme e-expandme';
$replace[4] = preg_replace($search, $replace, $tmpl['start_sub']);
$replace[4] .= e_admin_menu(false, $active_page, $e107_vars[$act]['sub'], $tmpl, true, (isset($e107_vars[$act]['sort']) ? $e107_vars[$act]['sort'] : $sortlist));
$replace[4] .= $tmpl['end_sub'];
}
$text .= preg_replace($search, $replace, $temp);
}
$text .= !$sub_link ? $tmpl['end'] : '';
if($sub_link || empty($title)) return $text;
$e107->ns->tablerender($title, $text, array('id' => $id, 'style' => 'button_menu'));
}
if (!function_exists('show_admin_menu')) { if (!function_exists('show_admin_menu')) {
function show_admin_menu($title, $active_page, $e107_vars, $js = FALSE, $sub_link = FALSE, $sortlist = FALSE) { function show_admin_menu($title, $active_page, $e107_vars, $js = FALSE, $sub_link = FALSE, $sortlist = FALSE) {
global $ns, $BUTTON, $BUTTON_OVER, $BUTTONS_START, $BUTTONS_END, $SUB_BUTTON, $SUB_BUTTON_OVER, $SUB_BUTTONS_START, $SUB_BUTTONS_END; global $ns, $BUTTON, $BUTTON_OVER, $BUTTONS_START, $BUTTONS_END, $SUB_BUTTON, $SUB_BUTTON_OVER, $SUB_BUTTONS_START, $SUB_BUTTONS_END;
e_admin_menu($title, $active_page, $e107_vars, false, false, $sortlist);
return;
$id_title = "yop_".str_replace(" ", "", $title); $id_title = "yop_".str_replace(" ", "", $title);
if (!isset($BUTTONS_START)) { if (!isset($BUTTONS_START)) {
$BUTTONS_START = "<div style='text-align:center; width:100%'><table class='fborder' style='width:98%;'>\n"; $BUTTONS_START = "<div style='text-align:center; width:100%'><table class='fborder' style='width:98%;'>\n";
@@ -383,13 +498,13 @@ if (!function_exists('show_admin_menu')) {
if ($sub_link) { if ($sub_link) {
$replace[0] = ''; $replace[0] = '';
$replace[1] = ''; $replace[1] = '#';
$replace[2] = ''; $replace[2] = '';
$replace[3] = $title; $replace[3] = $title;
$replace[4] = $id_title; $replace[4] = $id_title;
$text = preg_replace($search, $replace, $SUB_BUTTONS_START); $text = preg_replace($search, $replace, $SUB_BUTTONS_START);
} else { } else {
$text = $BUTTONS_START; $text = $BUTTONS_START.'';
} }
foreach (array_keys($e107_vars) as $act) { foreach (array_keys($e107_vars) as $act) {
@@ -411,7 +526,7 @@ if (!function_exists('show_admin_menu')) {
$text .= preg_replace($search, $replace, $BUTTON_TEMPLATE); $text .= preg_replace($search, $replace, $BUTTON_TEMPLATE);
} }
} }
$text .= $sub_link ? $SUB_BUTTONS_END : $BUTTONS_END; $text .= $sub_link ? $SUB_BUTTONS_END : ''.$BUTTONS_END;
if ($title == "" || $sub_link) { if ($title == "" || $sub_link) {
return $text; return $text;
@@ -441,44 +556,35 @@ if (!function_exists("parse_admin")) {
} }
} }
function admin_update($update, $type = 'update', $success = false, $failed = false) { function admin_update($update, $type = 'update', $success = false, $failed = false, $output = true) {
global $e107;
require_once(e_HANDLER."message_handler.php"); require_once(e_HANDLER."message_handler.php");
$emessage = &eMessage::getInstance(); $emessage = &eMessage::getInstance();
if (($type == 'update' && $update) || ($type == 'insert' && $update !== false)) { if (($type == 'update' && $update) || ($type == 'insert' && $update !== false)) {
//$caption = LAN_UPDATE;
//$text = "<b>".($success ? $success : LAN_UPDATED)."</b>";
$emessage->add(($success ? $success : LAN_UPDATED), E_MESSAGE_SUCCESS); $emessage->add(($success ? $success : LAN_UPDATED), E_MESSAGE_SUCCESS);
} }
elseif ($type == 'delete' && $update) elseif ($type == 'delete' && $update)
{ {
//$caption = LAN_DELETE;
//$text = "<b>".($success ? $success : LAN_DELETED)."</b>";
$emessage->add(($success ? $success : LAN_DELETED), E_MESSAGE_SUCCESS); $emessage->add(($success ? $success : LAN_DELETED), E_MESSAGE_SUCCESS);
} }
elseif (!mysql_errno()) elseif (!mysql_errno())
{ {
if ($type == 'update') if ($type == 'update')
{ {
//$caption = LAN_UPDATED_FAILED;
//$text = "<b>".LAN_NO_CHANGE."<br />".LAN_TRY_AGAIN."</b>";
$emessage->add(LAN_NO_CHANGE.' '.LAN_TRY_AGAIN, E_MESSAGE_INFO); $emessage->add(LAN_NO_CHANGE.' '.LAN_TRY_AGAIN, E_MESSAGE_INFO);
} elseif ($type == 'delete') }
elseif ($type == 'delete')
{ {
//$caption = LAN_DELETE;
//$text = "<b>".LAN_DELETED_FAILED.".<br />".LAN_TRY_AGAIN."</b>";
$emessage->add(LAN_DELETED_FAILED.' '.LAN_TRY_AGAIN, E_MESSAGE_INFO); $emessage->add(LAN_DELETED_FAILED.' '.LAN_TRY_AGAIN, E_MESSAGE_INFO);
} }
} }
else else
{ {
//$caption = LAN_UPDATED_FAILED;
$text = ($failed ? $failed : LAN_UPDATED_FAILED." - ".LAN_TRY_AGAIN)."<br />".LAN_ERROR." ".mysql_errno().": ".mysql_error(); $text = ($failed ? $failed : LAN_UPDATED_FAILED." - ".LAN_TRY_AGAIN)."<br />".LAN_ERROR." ".mysql_errno().": ".mysql_error();
$emessage->add($text, E_MESSAGE_ERROR); $emessage->add($text, E_MESSAGE_ERROR);
} }
//$e107->ns->tablerender($caption, "<div style='text-align:center'>".$text."</div>");
echo $emessage->render(); if($output) echo $emessage->render();
return $update; return $update;
} }

View File

@@ -9,8 +9,8 @@
* Administration - Site Preferences * Administration - Site Preferences
* *
* $Source: /cvs_backup/e107_0.8/e107_admin/prefs.php,v $ * $Source: /cvs_backup/e107_0.8/e107_admin/prefs.php,v $
* $Revision: 1.18 $ * $Revision: 1.19 $
* $Date: 2008-12-17 17:27:07 $ * $Date: 2008-12-18 16:55:45 $
* $Author: secretr $ * $Author: secretr $
* *
*/ */
@@ -180,30 +180,6 @@ $text = "
<script type=\"text/javascript\"> <script type=\"text/javascript\">
<!-- <!--
var e107Admin.AdminMenu = {
init: function() {
this.location = document.location.hash.substring(1);
this.activeTab = \$(this.location);
if(this.activeTab) {
this.activeTab.show();
}
this->_observer = this.observe.bindAsEventListener();
},
switch: function(show) {
show = \$(show);
if(!show) return;
if(this.activeTab && this.activeTab.identify() != show.identify()) {
this.activeTab.hide();
this.activeTab = show.show();
}
},
observe: function(event) {
}
}
var hideid=\"core-prefs-main\"; var hideid=\"core-prefs-main\";
function showhideit(showid){ function showhideit(showid){
if (hideid!=showid){ if (hideid!=showid){
@@ -218,7 +194,7 @@ $text = "
</script> </script>
<div id='core-prefs'> <div id='core-prefs'>
<form method='post' action='".e_SELF."'> <form method='post' action='".e_SELF."'>
<fieldset id='core-prefs-main'> <fieldset class='e-hideme' id='core-prefs-main'>
<legend class='e-hideme'>".PRFLAN_1."</legend> <legend class='e-hideme'>".PRFLAN_1."</legend>
<table cellpadding='0' cellspacing='0' class='adminform'> <table cellpadding='0' cellspacing='0' class='adminform'>
<colgroup span='2'> <colgroup span='2'>
@@ -1162,6 +1138,25 @@ function prefs_adminmenu()
$var['core-prefs-security']['text'] = PRFLAN_47; $var['core-prefs-security']['text'] = PRFLAN_47;
$var['core-prefs-comments']['text'] = PRFLAN_87; $var['core-prefs-comments']['text'] = PRFLAN_87;
$var['core-prefs-advanced']['text'] = PRFLAN_149; $var['core-prefs-advanced']['text'] = PRFLAN_149;
show_admin_menu(LAN_OPTIONS, '', $var, TRUE); show_admin_menu(LAN_OPTIONS.'--id--prev_nav', 'core-prefs-main', $var, TRUE);
}
/**
* Handle page DOM within the page header
*
* @return string JS source
*/
function headerjs()
{
require_once(e_HANDLER.'js_helper.php');
$ret = "
<script type='text/javascript'>
//add required core lan - delete confirm message
(".e_jshelper::toString(LAN_JSCONFIRM).").addModLan('core', 'delete_confirm');
</script>
<script type='text/javascript' src='".e_FILE_ABS."jslib/core/admin.js'></script>
";
return $ret;
} }
?> ?>

View File

@@ -8,13 +8,24 @@
* e107 Admin Helper * e107 Admin Helper
* *
* $Source: /cvs_backup/e107_0.8/e107_files/jslib/core/admin.js,v $ * $Source: /cvs_backup/e107_0.8/e107_files/jslib/core/admin.js,v $
* $Revision: 1.5 $ * $Revision: 1.6 $
* $Date: 2008-12-16 14:22:01 $ * $Date: 2008-12-18 16:55:46 $
* $Author: secretr $ * $Author: secretr $
* *
*/ */
e107Admin = {} if(typeof e107Admin == 'undefined') var e107Admin = {}
/**
* OnLoad Init Control
*/
if(!e107Admin['initRules']) {
e107Admin.initRules = {
'Helper': true,
'AdminMenu': true
}
}
e107Admin.Helper = { e107Admin.Helper = {
/** /**
@@ -154,4 +165,78 @@ e107Admin.Helper = {
} }
} }
e107.runOnLoad(e107Admin.Helper.init.bind(e107Admin.Helper), document, true); if(e107Admin.initRules.Helper)
e107.runOnLoad(e107Admin.Helper.init.bind(e107Admin.Helper), document, true);
/**
* Admin Menu Class
*/
e107Admin.AdminMenu = {
init: function(id, selection) {
if(!id) {
id = 'plugin-navigation';
selection = $$('ul.plugin-navigation', 'ul.plugin-navigation-sub');
}
selection = $A(selection);
if(this._track.get(id) || !selection) return false;
this._track.set(id, selection);
this.location = document.location.hash.substring(1);
this.activeTab = null;
this.activeBar = null;
if(this.location) {
this.activeTab = $(this.location);
if(this.activeTab) {
this.activeTab.show();
}
}
selection.each( function(element, i) {
if(0 === i && !this.activeTab) { //no page hash
if(!this.activeTab) {
var check = element.select('a[href^=#]:not([href=#])');
if(check[0]) {
this.switchTab(check[0].hash.substr(1), element);
}
}
} else if(!this.activeBar && this.activeTab) {//there is page hash
var h = this.activeTab;
this.activeBar = element.select('a[href^=#]:not([href=#])').find( function(el){
return h = el.hash.substr(1);
});
}
element.select('a[href^=#]:not([href=#])').invoke('observe', 'click', this.observe.bindAsEventListener(this, element));
}.bind(this));
return true;
},
switchTab: function(show, container) {
show = $(show);
if(!show) return false;
if(this.activeTab && this.activeTab.identify() != show.identify()) {
//console.log(this.activeTab , container, this.activeTab.identify(), show.identify());
if(container) $(container).select('a.link-active[href^=#])').invoke('removeClassName', 'link-active');
this.activeTab.hide().removeClassName('link-active');
this.activeTab = show.show().addClassName('link-active');
} else if(!this.activeTab) {
//init
if(container) $(container).select('a.link-active[href^=#])').invoke('removeClassName', 'link-active');
this.activeTab = show.show().addClassName('link-active');
}
return true;
},
observe: function(event, cont) {
if(this.switchTab(event.element().hash.substr(1)), cont)
event.stop();
},
_track: $H()
}
if(e107Admin.initRules.AdminMenu)
document.observe( 'dom:loaded', function() { e107Admin.AdminMenu.init() });

View File

@@ -11,8 +11,8 @@
* (unobtrusive Javascript) * (unobtrusive Javascript)
* *
* $Source: /cvs_backup/e107_0.8/e107_files/jslib/core/tabs.js,v $ * $Source: /cvs_backup/e107_0.8/e107_files/jslib/core/tabs.js,v $
* $Revision: 1.2 $ * $Revision: 1.3 $
* $Date: 2008-11-21 16:26:15 $ * $Date: 2008-12-18 16:55:46 $
* $Author: secretr $ * $Author: secretr $
* *
*/ */
@@ -21,6 +21,7 @@
* Global prefs * Global prefs
*/ */
e107Base.setPrefs('core-tabs', { e107Base.setPrefs('core-tabs', {
tabsClassName: 'e-tabs',
bookmarkFix: true, bookmarkFix: true,
historyNavigation: false, historyNavigation: false,
pageOverlay: false, pageOverlay: false,
@@ -30,9 +31,9 @@ e107Base.setPrefs('core-tabs', {
e107Widgets.Tabs = Class.create(e107WidgetAbstract, { e107Widgets.Tabs = Class.create(e107WidgetAbstract, {
Version: '1.0',
initialize: function(container, options) { initialize: function(container, options) {
this.Version = '1.0';
this.events = new e107EventManager(this); this.events = new e107EventManager(this);
var optHandlers = { var optHandlers = {
show: this.show, show: this.show,
@@ -72,7 +73,13 @@ e107Widgets.Tabs = Class.create(e107WidgetAbstract, {
container: celement, container: celement,
list: $A() list: $A()
} }
celement.select('ul.e-tabs > li').inject(this.tabData.list, function(arr, elitem, i) {
if(celement.nodeName.toLowerCase != 'ul')
var celements = celement.select('ul.' + this.options.tabsClassName + ' > li');
else
var celements = $$('body')[0].select(cstring + ' > li');
celements.inject(this.tabData.list, function(arr, elitem, i) {
var mid = elitem.identify(), var mid = elitem.identify(),
a = elitem.select('a')[0], a = elitem.select('a')[0],
act = a.hash.substr(1), act = a.hash.substr(1),

View File

@@ -8,8 +8,8 @@
* e107 Javascript API * e107 Javascript API
* *
* $Source: /cvs_backup/e107_0.8/e107_files/jslib/e107.js.php,v $ * $Source: /cvs_backup/e107_0.8/e107_files/jslib/e107.js.php,v $
* $Revision: 1.15 $ * $Revision: 1.16 $
* $Date: 2008-12-16 11:05:36 $ * $Date: 2008-12-18 16:55:45 $
* $Author: secretr $ * $Author: secretr $
* *
*/ */
@@ -779,6 +779,7 @@ Object.extend(e107Helper, {
* This method will be rewritten after the core is cleaned up. After this point * This method will be rewritten after the core is cleaned up. After this point
* the target element will be auto-hidden (no need of class="e-hideme") * the target element will be auto-hidden (no need of class="e-hideme")
*/ */
if(false === Object.isString(el) || ( if(false === Object.isString(el) || (
($(el) && $(el).nodeName.toLowerCase() == 'a' && $(el).readAttribute('href')) ($(el) && $(el).nodeName.toLowerCase() == 'a' && $(el).readAttribute('href'))
|| ||
@@ -786,9 +787,9 @@ Object.extend(e107Helper, {
)) { )) {
eltoggle = (function(el) { eltoggle = (function(el) {
return Try.these( return Try.these(
function() { var ret= $(el.readAttribute('href').hash.substr(1)); if(ret) { return ret; } throw 'Error';}, //This will be the only valid case in the near future function() { var ret = $(el.readAttribute('href').hash.substr(1)); if(ret) { return ret; } throw 'Error';}, //This will be the only valid case in the near future
function() { var ret=el.next('.e-expandme'); if(ret) { return ret; } throw 'Error';}, function() { var ret = el.next('.e-expandme'); if(ret) { return ret; } throw 'Error';},// maybe this too?
function() { var ret=el.next('div'); if(ret) { return ret; } throw 'Error'; }, //backward compatibality - DEPRECATED function() { var ret = el.next('div'); if(ret) { return ret; } throw 'Error'; }, //backward compatibality - DEPRECATED
function() { return null; } //break function() { return null; } //break
) || false; ) || false;
})($(el)); })($(el));
@@ -796,7 +797,7 @@ Object.extend(e107Helper, {
var eltoggle = $(el); var eltoggle = $(el);
} }
if(!eltoggle) return; if(!eltoggle) return false;
var fx = varset(arguments[1], null); var fx = varset(arguments[1], null);
@@ -804,6 +805,8 @@ Object.extend(e107Helper, {
this.fxToggle(eltoggle, fx || {}); this.fxToggle(eltoggle, fx || {});
else else
$(eltoggle).toggle(); $(eltoggle).toggle();
return true;
}, },
/** /**
@@ -822,10 +825,9 @@ Object.extend(e107Helper, {
toggleObserver: function(event) { toggleObserver: function(event) {
var expandthem = event.memo.element ? $(event.memo.element) : $$('body')[0]; var expandthem = event.memo.element ? $(event.memo.element) : $$('body')[0];
expandthem.select('.e-expandit').invoke('observe', 'click', function(e) { expandthem.select('.e-expandit').invoke('observe', 'click', function(e) {
e.stop();
var element = e.findElement('a'); var element = e.findElement('a');
if(!element) element = e.element(); if(!element) element = e.element();
this.toggle(element, {}); if(this.toggle(element, {})) e.stop();
}.bindAsEventListener(e107Helper)); }.bindAsEventListener(e107Helper));
}, },

View File

@@ -1,10 +1,13 @@
/* /*
* e107 website system (c) 2001-2008 Steve Dunstan (e107.org) * e107 website system (c) 2001-2008 Steve Dunstan (e107.org)
* $Id: admin_nav.sc,v 1.6 2008-12-08 21:45:12 e107steved Exp $ * $Id: admin_nav.sc,v 1.7 2008-12-18 16:55:46 secretr Exp $
*/ */
if (ADMIN) if (ADMIN)
{ {
global $ns, $pref, $array_functions, $tp; global $ns, $pref, $array_functions, $tp;
$e107_var = array();
if (strstr(e_SELF, "/admin.php")) if (strstr(e_SELF, "/admin.php"))
{ {
$active_page = 'x'; $active_page = 'x';
@@ -13,23 +16,26 @@ if (ADMIN)
{ {
$active_page = time(); $active_page = time();
} }
$e107_var['x']['text']=ADLAN_52; $e107_var['x']['text'] = ADLAN_52;
$e107_var['x']['link']=e_ADMIN.'admin.php'; $e107_var['x']['link'] = e_ADMIN.'admin.php';
$e107_var['y']['text']=ADLAN_53; $e107_var['y']['text'] = ADLAN_53;
$e107_var['y']['link']=e_BASE."index.php"; $e107_var['y']['link'] = e_BASE."index.php";
$text .= show_admin_menu("",$active_page,$e107_var); //$text .= show_admin_menu("",$active_page,$e107_var);
$e107_var['afuncs']['text'] = ADLAN_93;
$e107_var['afuncs']['link'] = '';
unset($e107_var); /* SUBLINKS */
$tmp = array();
foreach ($array_functions as $links_key => $links_value) foreach ($array_functions as $links_key => $links_value)
{ {
$e107_var[$links_key]['text'] = $links_value[1]; $tmp[$links_key]['text'] = $links_value[1];
$e107_var[$links_key]['link'] = $links_value[0]; $tmp[$links_key]['link'] = $links_value[0];
} }
$text .= show_admin_menu(ADLAN_93, time(), $e107_var, FALSE, TRUE, TRUE); $e107_var['afuncs']['sub'] = $tmp;
unset($e107_var); /* SUBLINKS END */
// Plugin links menu
// Plugin links menu
require_once(e_HANDLER.'xml_class.php'); require_once(e_HANDLER.'xml_class.php');
$xml = new xmlClass; // We're going to have some plugins with plugin.xml files, surely? So create XML object now $xml = new xmlClass; // We're going to have some plugins with plugin.xml files, surely? So create XML object now
$xml->filter = array('@attributes' => FALSE, 'administration' => FALSE); // .. and they're all going to need the same filter $xml->filter = array('@attributes' => FALSE, 'administration' => FALSE); // .. and they're all going to need the same filter
@@ -37,10 +43,15 @@ if (ADMIN)
$nav_sql = new db; $nav_sql = new db;
if ($nav_sql -> db_Select("plugin", "*", "plugin_installflag=1")) if ($nav_sql -> db_Select("plugin", "*", "plugin_installflag=1"))
{ {
$tmp = array();
$e107_var['plugs']['text'] = ADLAN_95;
$e107_var['plugs']['link'] = '';
/* SUBLINKS */
//Link Plugin Manager //Link Plugin Manager
$e107_var['x']['text'] = "<b>".ADLAN_98."</b>"; $tmp['plugm']['text'] = "<strong>".ADLAN_98."</strong>";
$e107_var['x']['link'] = e_ADMIN."plugin.php"; $tmp['plugm']['link'] = e_ADMIN."plugin.php";
$e107_var['x']['perm'] = "P"; $tmp['plugm']['perm'] = "P";
while($rowplug = $nav_sql -> db_Fetch()) while($rowplug = $nav_sql -> db_Fetch())
{ {
@@ -61,20 +72,23 @@ if (ADMIN)
// Links Plugins // Links Plugins
if ($eplug_conffile) if ($eplug_conffile)
{ {
$e107_var['x'.$plugin_id]['text'] = $eplug_caption; $tmp['plug_'.$plugin_id]['text'] = $eplug_caption;
$e107_var['x'.$plugin_id]['link'] = e_PLUGIN.$plugin_path."/".$eplug_conffile; $tmp['plug_'.$plugin_id]['link'] = e_PLUGIN.$plugin_path."/".$eplug_conffile;
$e107_var['x'.$plugin_id]['perm'] = "P".$plugin_id; $tmp['plug_'.$plugin_id]['perm'] = "P".$plugin_id;
} }
unset($eplug_conffile, $eplug_name, $eplug_caption); unset($eplug_conffile, $eplug_name, $eplug_caption);
} }
$e107_var['plugm']['sub'] = $tmp;
$text .= show_admin_menu(ADLAN_95, time(), $e107_var, FALSE, TRUE, TRUE); $e107_var['plugm']['sort'] = true;
unset($e107_var); /* SUBLINKS END */
//$text .= show_admin_menu(ADLAN_95, time(), $e107_var, FALSE, TRUE, TRUE);
unset($tmp);
} }
unset($e107_var);
$e107_var['x']['text']=ADLAN_46; $e107_var['lout']['text']=ADLAN_46;
$e107_var['x']['link']=e_ADMIN."admin.php?logout"; $e107_var['lout']['link']=e_ADMIN."admin.php?logout";
$text .= show_admin_menu("",$act,$e107_var);
$text = e_admin_menu('', '', $e107_var);
return $ns -> tablerender(LAN_head_1, $text, array('id' => 'admin_nav', 'style' => 'button_menu'), TRUE); return $ns -> tablerender(LAN_head_1, $text, array('id' => 'admin_nav', 'style' => 'button_menu'), TRUE);
} }

View File

@@ -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.11 2008-12-10 16:59:19 secretr Exp $ * $Id: lan_admin.php,v 1.12 2008-12-18 16:55:46 secretr Exp $
* *
* Admin Language File * Admin Language File
*/ */
@@ -216,6 +216,7 @@ define("LAN_SAVE","Save");
define("LAN_SAVED","Saved"); define("LAN_SAVED","Saved");
define("LAN_SETSAVED","Your settings have been saved"); define("LAN_SETSAVED","Your settings have been saved");
define("LAN_CONFIRMDEL","Please confirm you wish to delete"); define("LAN_CONFIRMDEL","Please confirm you wish to delete");
define("LAN_JSCONFIRM","Please confirm you wish to delete");
define("LAN_OPTIONS","Options"); define("LAN_OPTIONS","Options");
define("LAN_PREFS","Preferences"); define("LAN_PREFS","Preferences");
define("LAN_DELETED","Successfully deleted"); define("LAN_DELETED","Successfully deleted");

View File

@@ -352,10 +352,10 @@ ul.plugin-navigation li { padding: 0px 10px 0px; }
ul.plugin-navigation a.link {} ul.plugin-navigation a.link {}
ul.plugin-navigation a.link-active {font-weight: bold;} ul.plugin-navigation a.link-active {font-weight: bold;}
ul.plugin-navigation ul.sub-nav {} ul.plugin-navigation ul.plugin-navigation-sub {}
ul.plugin-navigation ul.sub-nav li { padding: 0px 10px 0px; } ul.plugin-navigation ul.plugin-navigation-sub li { padding: 0px 10px 0px; }
ul.plugin-navigation ul.sub-nav a.link {} ul.plugin-navigation ul.plugin-navigation-sub a.link {}
ul.plugin-navigation ul.sub-nav a.link-active {font-weight: bold;} ul.plugin-navigation ul.plugin-navigation-sub a.link-active {font-weight: bold;}
/******** Block Elements */ /******** Block Elements */

View File

@@ -9,8 +9,8 @@
* Admin template - _blank theme * Admin template - _blank theme
* *
* $Source: /cvs_backup/e107_0.8/e107_themes/_blank/admin_template.php,v $ * $Source: /cvs_backup/e107_0.8/e107_themes/_blank/admin_template.php,v $
* $Revision: 1.7 $ * $Revision: 1.8 $
* $Date: 2008-12-17 17:27:07 $ * $Date: 2008-12-18 16:55:45 $
* $Author: secretr $ * $Author: secretr $
* *
*/ */
@@ -68,7 +68,7 @@ $ADMIN_FOOTER = "
{SETSTYLE=admin_menu} {SETSTYLE=admin_menu}
{ADMIN_MENU} {ADMIN_MENU}
{ADMIN_NAV}
{SETSTYLE=none} {SETSTYLE=none}
{ADMIN_PWORD} {ADMIN_PWORD}
@@ -98,13 +98,55 @@ $ADMIN_FOOTER = "
* function show_admin_menu() in e107_admin/header.php * function show_admin_menu() in e107_admin/header.php
*/ */
$E_ADMIN_MENU['start'] = '
<ul class="plugin-navigation">
';
$E_ADMIN_MENU['button'] = '
<li>
<a class="link{LINK_CLASS}" href="{LINK_URL}"{ID}{ONCLICK}>&raquo;&nbsp;{LINK_TEXT}</a>
{SUB_MENU}
</li>
';
$E_ADMIN_MENU['button_active'] = '
<li>
<a class="link-active{LINK_CLASS}" href="{LINK_URL}"{ID}{ONCLICK}>&raquo;&nbsp;{LINK_TEXT}</a>
{SUB_MENU}
</li>
';
$E_ADMIN_MENU['start_sub'] = '
<ul class="plugin-navigation-sub{SUB_CLASS}"{SUB_ID}>
';
$E_ADMIN_MENU['button_sub'] = '
<li>
<a class="link" href="{LINK_URL}">&raquo;&nbsp;{LINK_TEXT}</a>
{SUB_MENU}
</li>
';
$E_ADMIN_MENU['button_active_sub'] = '
<li>
<a class="link-active" href="{LINK_URL}">&raquo;&nbsp;{LINK_TEXT}</a>
{SUB_MENU}
</li>
';
$E_ADMIN_MENU['end_sub'] = '
</ul>
';
$E_ADMIN_MENU['end'] = '
</ul>
';
/*
$BUTTONS_START = ' $BUTTONS_START = '
<ul class="plugin-navigation"> <ul class="plugin-navigation">
'; ';
$BUTTON = ' $BUTTON = '
<li> <li>
<a class="link" href="{LINK_URL}"{ONCLICK}>&raquo;&nbsp;{LINK_TEXT}</a> <a class="link" href="{LINK_URL}"{ONCLICK}>&raquo;&nbsp;{LINK_TEXT}</a>
{SUB_LINK}
</li> </li>
'; ';
$BUTTON_OVER = ' $BUTTON_OVER = '
@@ -115,8 +157,8 @@ $BUTTON_OVER = '
$SUB_BUTTONS_START = ' $SUB_BUTTONS_START = '
<ul class="plugin-navigation"> <ul class="plugin-navigation">
<li> <li>
<a class="link" href="{LINK_URL}"onclick="expandit(\'{SUB_HEAD_ID}\');" >&raquo;&nbsp;{SUB_HEAD}</a> <a class="link" href="{LINK_URL}" onclick="expandit(\'{SUB_HEAD_ID}\');" >&raquo;&nbsp;{SUB_HEAD}</a>
<ul class="sub-nav" id="{SUB_HEAD_ID}" style="display: none"> <ul class="plugin-navigation-sub" id="{SUB_HEAD_ID}" style="display: none">
'; ';
$SUB_BUTTON = ' $SUB_BUTTON = '
<li> <li>
@@ -136,6 +178,6 @@ $SUB_BUTTONS_END = '
$BUTTONS_END = ' $BUTTONS_END = '
</ul> </ul>
'; ';
*/
?> ?>

View File

@@ -41,14 +41,14 @@ function theme_head() {
return $ret; return $ret;
} }
function tablestyle($caption, $text){ function tablestyle($caption, $text, $mod) {
global $style; global $style;
switch($style) { switch($style) {
case 'admin_menu' : case 'admin_menu' :
echo ' echo '
<div class="block"> <div class="block">
<h4>'.$caption.'</h4> <h4 class="caption">'.$caption.'</h4>
'.$text.' '.$text.'
</div> </div>
'; ';
@@ -57,7 +57,7 @@ function tablestyle($caption, $text){
case 'site_info' : case 'site_info' :
echo ' echo '
<div class="block"> <div class="block">
<h4>'.$caption.'</h4> <h4 class="caption">'.$caption.'</h4>
<div class="block-text"> <div class="block-text">
'.$text.' '.$text.'
</div> </div>
@@ -68,7 +68,7 @@ function tablestyle($caption, $text){
case 'admin_content': case 'admin_content':
echo ' echo '
<div class="block"> <div class="block">
<h2>'.$caption.'</h2> <h2 class="caption">'.$caption.'</h2>
<div class="block-text"> <div class="block-text">
'.$text.' '.$text.'
</div> </div>