1
0
mirror of https://github.com/e107inc/e107.git synced 2025-06-02 00:45:03 +02:00

General cleanup for left-side admin-menu navigation

This commit is contained in:
CaMer0n 2012-05-23 13:59:12 +00:00
parent e7c33909a4
commit c5e60dd7f2
17 changed files with 86 additions and 381 deletions

View File

@ -801,9 +801,9 @@ class page_admin_ui extends e_admin_ui
}
require_once('auth.php');
new page_admin();
new page_admin();
require_once('auth.php');
e107::getAdminUI()->runPage();
@ -1011,38 +1011,13 @@ class page
*/
}
/*
function cpage_adminmenu()
{
global $page;
global $action;
$page->show_options($action);
// $page->show_options($action);
}
*/
/**
* Handle page DOM within the page header
*
* @return string JS source
*/
function headerjs()
{
return;
require_once(e_HANDLER.'js_helper.php');
$ret = "
<script type='text/javascript'>
if(typeof e107Admin == 'undefined') var e107Admin = {}
/**
* OnLoad Init Control
*/
e107Admin.initRules = {
'Helper': true,
'AdminMenu': false
}
</script>
<script type='text/javascript' src='".e_FILE_ABS."jslib/core/admin.js'></script>
";
return $ret;
}
?>

View File

@ -263,7 +263,7 @@ class media_admin_ui extends e_admin_ui
protected $fields = array(
'checkboxes' => array('title'=> '', 'type' => null, 'data'=> null, 'width' =>'5%', 'forced'=> TRUE, 'thclass'=>'center', 'class'=>'center'),
'media_id' => array('title'=> LAN_ID, 'type' => 'number', 'data'=> 'int', 'width' =>'5%', 'forced'=> TRUE, 'nolist'=>TRUE),
'media_url' => array('title'=> 'Preview', 'type' => 'image', 'data'=> 'str', 'thclass' => 'center', 'class'=>'center', 'readParms'=>'thumb=60&thumb_urlraw=0&thumb_aw=60','readonly'=>TRUE, 'writeParams' => 'path={e_MEDIA}', 'width' => '110px'),
'media_url' => array('title'=> 'Preview', 'type' => 'image', 'data'=> 'str', 'thclass' => 'center', 'class'=>'center', 'readParms'=>'thumb=60&thumb_urlraw=0&thumb_aw=60','readonly'=>TRUE, 'writeParms'=>'thumb=180&thumb_urlraw=0&thumb_aw=180', 'width' => '110px'),
'media_category' => array('title'=> LAN_CATEGORY, 'type' => 'method', 'data'=> 'str', 'width' => 'auto', 'filter' => true, 'batch' => true,'writeParms'=>'multiple=1'),
// Upload should be managed completely separately via upload-handler.

View File

@ -81,12 +81,15 @@ if (isset ($_POST['updateRanks']))
updateRanks();
}
$e_sub_cat = 'users';
require_once ('auth.php');
$user = new users;
require_once (e_HANDLER.'form_handler.php');
require_once (e_HANDLER.'userclass_class.php');
include_once (e_HANDLER.'user_extended_class.php');
require_once (e_HANDLER.'validator_class.php');
$user = new users;
require_once ('auth.php');
// require_once (e_HANDLER.'user_handler.php');
// $userMethods = new UserHandler;
// $colList = $userMethods->getNiceNames(TRUE);
@ -2189,7 +2192,7 @@ function users_adminmenu()
{
global $user;
global $action;
$user->show_options($action);
$user->show_options($action); // FIXME
}

View File

Before

Width:  |  Height:  |  Size: 112 B

After

Width:  |  Height:  |  Size: 112 B

View File

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

Before

Width:  |  Height:  |  Size: 157 B

After

Width:  |  Height:  |  Size: 157 B

View File

Before

Width:  |  Height:  |  Size: 182 B

After

Width:  |  Height:  |  Size: 182 B

View File

@ -1364,7 +1364,7 @@ class e_form
if(vartrue($parms['sort']))//FIXME use a global variable such as $fieldpref
{
$value .= "<a class='e-sort' style='cursor:move' href='".e_SELF."?".(e_QUERY ? e_QUERY."&amp;ajax_used=1" : "ajax_used=1")."' title='Re-order'><img class='icon action S16' src='".ADMIN_SORT_ICON_PATH."' alt='' title='Re-Order' /></a> ";
$value .= "<a class='e-sort' style='cursor:move' href='".e_SELF."?".(e_QUERY ? e_QUERY."&amp;ajax_used=1" : "ajax_used=1")."' title='Re-order'>".ADMIN_SORT_ICON."</a> ";
}
$value .= "<a href='".e_SELF."?{$query}' title='".LAN_EDIT."'><img class='icon action edit list' src='".ADMIN_EDIT_ICON_PATH."' alt='".LAN_EDIT."' /></a>";
@ -1732,6 +1732,10 @@ class e_form
// Two modes of read-only. 1 = read-only, but only when there is a value, 2 = read-only regardless.
if(vartrue($attributes['readonly']) && (vartrue($value) || vartrue($attributes['readonly'])==2)) // quick fix (maybe 'noedit'=>'readonly'?)
{
if(vartrue($attributes['writeParms'])) // eg. different size thumbnail on the edit page.
{
$attributes['readParms'] = $attributes['writeParms'];
}
return $this->renderValue($key, $value, $attributes).$this->hidden($key, $value); //
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 848 B

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@ -45,9 +45,31 @@ $ADMIN_HEADER = "
<div class='admin-page-body'>
<table class='main-table'>
<tr>
<!--
<td class='col-left'></td>
-->
<td class='col-left'>
{SETSTYLE=admin_menu}
{ADMIN_MENU}
{ADMIN_MENUMANAGER}
{ADMIN_PRESET}
{ADMIN_LANG}
{SETSTYLE=none}
{ADMIN_PWORD}
{ADMIN_STATUS=request}
{ADMIN_LATEST=request}
{ADMIN_LOG=request}
{ADMIN_MSG}
{ADMIN_PLUGINS}
{ADMIN_UPDATE}
{SETSTYLE=site_info}
{ADMIN_SITEINFO}
{ADMIN_HELP}
</td>
<td>
<div class='col-main'>
<div class='inner-wrapper'>
@ -68,29 +90,15 @@ $ADMIN_FOOTER = "
</div>
</div>
</td>
<!--
<td class='col-right'>
<div class='col-right'>
{SETSTYLE=admin_menu}
{ADMIN_MENU}
{ADMIN_MENUMANAGER}
{ADMIN_PRESET}
{SETSTYLE=none}
{ADMIN_PWORD}
{ADMIN_STATUS=request}
{ADMIN_LATEST=request}
{ADMIN_LOG=request}
{ADMIN_MSG}
{ADMIN_PLUGINS}
{ADMIN_UPDATE}
{SETSTYLE=site_info}
{ADMIN_HELP}
</div>
</td>
-->
</tr>
</table>
</div>

View File

@ -5,11 +5,32 @@ define('STANDARDS_MODE', TRUE);
include_lan(e_THEME."_blank/languages/".e_LANGUAGE.".php");
//temporary fixed - awaiting theme.xml addition
e107::getJs()->requireCoreLib(array(
'core/decorate.js' => 2,
'core/tabs.js' => 2
));
// jQUERY scripts
e107::js('core', 'colorbox/jquery.colorbox-min.js', 'jquery', 2);
e107::css('core', 'colorbox/colorbox.css', 'jquery');
e107::js('core', 'core/jquery.elastic.source.js', 'jquery', 2);
e107::js('core', 'plupload/plupload.full.js', 'jquery', 2);
e107::css('core', 'plupload/jquery.plupload.queue/css/jquery.plupload.queue.css', 'jquery');
e107::js('core', 'plupload/jquery.plupload.queue/jquery.plupload.queue.js', 'jquery', 2);
e107::css('core', 'chosen/chosen.css', 'jquery');
e107::js('core', 'chosen/chosen.jquery.min.js', 'jquery', 2);
e107::css('core', 'password/style.css', 'jquery');
e107::js('core', 'password/jquery.pwdMeter.js', 'jquery', 2);
//
e107::js("core", "plupload/customUpload.js","jquery",3);
e107::js("core", "core/mediaManager.js","jquery",3);
e107::css('core', 'core/admin.css', 'jquery');
e107::js('core', 'core/admin.jquery.js', 'jquery', 4);
$register_sc[]='FS_ADMIN_ALT_NAV';
$no_core_css = TRUE;
@ -71,6 +92,8 @@ $no_core_css = TRUE;
define("ADMIN_EXECUTE_ICON", "<img class='icon action S32' src='".e_IMAGE_ABS."admin_images/execute_32.png' alt='' title='".LAN_EXECUTE."' />");
define("ADMIN_EXECUTE_ICON_PATH", e_IMAGE."admin_images/execute_32.png");
define("ADMIN_SORT_ICON", "<img class='icon action S32' src='".e_IMAGE_ABS."admin_images/sort_32.png' alt='' title='Re-Sort' />");
define("ADMIN_SORT_ICON_PATH", e_IMAGE."admin_images/sort_32.png");
function theme_head() {
@ -94,38 +117,6 @@ function theme_head() {
<script type="text/javascript" src="'.THEME_ABS.'menu/menu.js"></script>
<![endif]-->
';
$ret .= "
<script type='text/javascript'>
/**
* Decorate all tables having e-list class
* TODO: add 'adminlist' class to all list core tables, allow theme decorate.
*/
e107.runOnLoad( function(event) {
var element = event.memo['element'] ? $(event.memo.element) : $$('body')[0];
element.select('table.adminlist:not(.no-decorate)').each(function(element) {
e107Utils.Decorate.table(element, {tr_td: 'first last'});
});
element.select('table.fborder:not(.no-decorate)').each(function(element) {
e107Utils.Decorate.table(element, {tr_td: 'first last'});
});
element.select('div.admintabs').each(function(element) {
//show tab navaigation
element.select('ul.e-tabs').each( function(el){
el.show();
el.removeClassName('e-hideme');//prevent hideme re-register (e.g. ajax load)
});
//init tabs
new e107Widgets.Tabs(element);
//hide legends if any
element.select('legend').invoke('hide');
});
}, document, true);
</script>";
return $ret;
}

View File

@ -95,306 +95,30 @@ e107::css('inline',"/******** Tabs JS */
// jQUERY scripts
e107::js('core', 'core/colorbox/jquery.colorbox-min.js', 'jquery', 2);
e107::css('core', 'core/colorbox/colorbox.css', 'jquery');
e107::js('core', 'core/jquery.elastic.source.js', 'jquery', 2);
e107::js('core', 'colorbox/jquery.colorbox-min.js', 'jquery', 2);
e107::css('core', 'colorbox/colorbox.css', 'jquery');
// e107::js('url', 'http://bp.yahooapis.com/2.4.21/browserplus-min.js', 'jquery', 2);
e107::js('core', 'core/jquery.elastic.source.js', 'jquery', 2);
//e107::css('core', 'plupload/jquery.ui.plupload/css/jquery.ui.plupload.css', 'jquery');
e107::js('core', 'plupload/plupload.full.js', 'jquery', 2);
e107::css('core', 'plupload/jquery.plupload.queue/css/jquery.plupload.queue.css', 'jquery');
e107::js('core', 'plupload/jquery.plupload.queue/jquery.plupload.queue.js', 'jquery', 2);
e107::css('core', 'chosen/chosen.css', 'jquery');
e107::js('core', 'chosen/chosen.jquery.min.js', 'jquery', 2);
e107::js('core', 'plupload/plupload.full.js', 'jquery', 2);
//e107::js('core', 'plupload/jquery.ui.plupload/jquery.ui.plupload.js','jquery',2);
e107::css('core', 'plupload/jquery.plupload.queue/css/jquery.plupload.queue.css', 'jquery');
e107::js('core', 'plupload/jquery.plupload.queue/jquery.plupload.queue.js', 'jquery', 2);
e107::css('core', 'chosen/chosen.css', 'jquery');
e107::js('core', 'chosen/chosen.jquery.min.js', 'jquery', 2);
e107::css('core', 'password/style.css', 'jquery');
e107::js('core', 'password/jquery.pwdMeter.js', 'jquery', 2);
e107::css('core', 'password/style.css', 'jquery');
e107::js('core', 'password/jquery.pwdMeter.js', 'jquery', 2);
//
e107::js("core", "plupload/customUpload.js","jquery",3);
e107::js("core", "core/mediaManager.js","jquery",3);
e107::css('core', 'core/admin.css', 'jquery');
e107::js('core', 'core/admin.jquery.js', 'jquery', 4);
e107::js('inline','
$(document).ready(function()
{
$(".e-hideme").hide();
$(".e-expandit").show();
$(".e-expandit").click(function () {
var id = $(this).attr("href");
$(id).toggle("slow");
});
// Date
$(function() {
$( ".e-date" ).datepicker();
});
// Tabs
$(function() {
$( "#tab-container" ).tabs();
});
// Tabs
$(function() {
$( ".e-tabs" ).tabs();
});
$(".e-multiselect").chosen();
// Password
$(function() {
$("#password1").pwdMeter({
minLength: 6,
displayGeneratePassword: true,
generatePassText: "Generate",
randomPassLength: 12
});
});
// Decorate
$(".adminlist tr:even").addClass("even");
$(".adminlist tr:odd").addClass("odd");
$(".adminlist tr:first").addClass("first");
$(".adminlist tr:last").addClass("last");
// Character Counter
$("textarea").before("<p class=\"remainingCharacters\" id=\"" + $("textarea").attr("name")+ "-remainingCharacters\">&nbsp;</p>");
$("textarea").keyup(function(){
// var max=$(this).attr("maxlength");
var max = 100;
var el = "#" + $(this).attr("name") + "-remainingCharacters";
var valLen=$(this).val().length;
$(el).text( valLen + " characters")
});
// Text-area AutoGrow
$("textarea.e-autoheight").elastic();
// Dialog
$("a.e-dialog").colorbox({
iframe:true,
width:"60%",
height:"65%",
speed:100
});
$(".e-dialog-close").click(function () {
parent.$.colorbox.close()
});
// Modal Box - uses inline hidden content
$(".e-modal").click(function () {
var id = $(this).attr("href");
$(id).dialog({
minWidth: 800,
maxHeight: 700,
modal: true
});
});
// Modal Box - uses inline hidden content // NEEDS work - see customize link for admin-infopanel.
$(".e-modal-iframe").click(function (e) {
var id = $(this).attr("href");
e.preventDefault();
var page = $(this).attr("href")
var pagetitle = $(this).attr("title")
var $dialog = $("<div></div>")
.html("<iframe style=\"border: 0px; \" src=\"" + page + "\" width=\"100%\" height=\"100%\"></iframe>")
.dialog({
autoOpen: false,
modal: true,
width:800,
height: 700,
minWidth: 800,
minHeight: 700,
maxHeight: 700,
title: pagetitle
});
$dialog.dialog("open");
});
// Admin Prefs Navigation
$(".plugin-navigation a").click(function () {
$(".plugin-navigation a").each(function(index) {
var ot = $(this).attr("href");
$(ot).hide();
$(this).closest("li").removeClass("active");
$(this).switchClass( "link-active", "link", 0 );
});
var id = $(this).attr("href");
$(this).switchClass( "link", "link-active", 30 );
$(this).closest("li").addClass("active");
$(id).show({
effect: "slide"
});
});
// Sorting
var fixHelper = function(e, ui) {
ui.closest("tr").switchClass( "odd", "highlight-odd", 0 );
ui.closest("tr").switchClass( "even", "highlight-even", 0 );
ui.children().each(function() {
$(this).width($(this).width());
// $(this).closest("tr").switchClass( "odd", "highlight-odd", 0 );
// $(this).closest("tr").switchClass( "even", "highlight-even", 0 );
});
return ui;
};
$("#e-sort").sortable({
helper: fixHelper,
cursor: "move",
opacity: 0.9,
handle: ".e-sort",
distance: 20,
containment: "parent",
stop: function(e,ui) {
var allItems = $(this).sortable("toArray");
var newSortValue = allItems.indexOf( $(ui.item).attr("id") );
// alert($(ui.item).attr("id") + " was moved to index " + newSortValue);
$(".highlight-even").switchClass( "highlight-even", "even", 600 );
$(".highlight-odd").switchClass( "highlight-odd", "odd", 600 );
},
update: function(event, ui) {
var allItems = $(this).sortable("toArray");
// console.log(allItems);
var neworder = allItems.indexOf( $(ui.item).attr("id") );
var linkid = $(ui.item).attr("id");
// $("td").removeClass("e-moving","slow");
var script = $(".e-sort:first").attr("href");
// alert(script);
$.ajax({
type: "POST",
url: script,
data: { all: allItems, linkid: linkid, neworder: neworder }
// data: { linkid: linkid, neworder: neworder }
}).done(function( msg ) {
// alert("Posted: "+allItems+" Updated: "+ msg );
});
}
}).disableSelection();
// Check-All
$("input.toggle-all").click(function(evt){
if($(this).is(":checked")){
$("input[type=\"checkbox\"].checkbox").attr("checked", "checked");
}
else{
$("input[type=\"checkbox\"].checkbox").removeAttr("checked");
}
});
// highlight checked row
$(".adminlist input[type=\"checkbox\"].checkbox").click(function(evt){
if(this.checked)
{
$(this).closest("tr").switchClass( "odd", "highlight-odd", 0 );
$(this).closest("tr").switchClass( "even", "highlight-even", 0 );
}
else
{
$(this).closest("tr").switchClass( "highlight-even", "even", 300 );
$(this).closest("tr").switchClass( "highlight-odd", "odd", 300 );
}
});
// Basic Delete Confirmation
$("input.delete").click(function(){
var answer = confirm($(this).attr("title")+ " ?");
return answer // answer is a boolean
});
$(".e-dialog-close").click(function () {
parent.$.colorbox.close()
});
})
// BC Expandit() function
function expandit(e) {
var href = $(e).attr("href");
if(href === "#" || href == "")
{
idt = $(e).next("div");
$(idt).toggle("slow");
return false;;
}
var id = "#" + e;
$(id).toggle("slow");
return false;
};
','jquery');
e107::js("core","plupload/customUpload.js","jquery",3);
e107::js("core","core/mediaManager.js","jquery",3);
e107::css('inline',"
.e-moving { background-color:silver; }
tr.highlight-even { background-color:silver; }
tr.highlight-odd { background-color:silver; }
legend { display: none; }
",'jquery');
// [layout]
$layout = "_default";