diff --git a/src/javascript/helpers/bootstrap-zikula.js b/src/javascript/helpers/bootstrap-zikula.js index e17f45ebd8..90b4f8779f 100644 --- a/src/javascript/helpers/bootstrap-zikula.js +++ b/src/javascript/helpers/bootstrap-zikula.js @@ -58,8 +58,9 @@ $(document).ready(function() { - jQuery('input:radio').data('state', 'hh'); - + // remove class hide because bootstrap is using important, that is not + // working with jQuery.show(); + $('.hide').hide().removeClass('hide'); /** * Input switch container. diff --git a/src/system/Zikula/Module/AdminModule/Controller/AdminController.php b/src/system/Zikula/Module/AdminModule/Controller/AdminController.php index e1578143cc..ed1db5331a 100644 --- a/src/system/Zikula/Module/AdminModule/Controller/AdminController.php +++ b/src/system/Zikula/Module/AdminModule/Controller/AdminController.php @@ -516,7 +516,8 @@ public function categorymenuAction($args) 'menutexttitle' => $menutexttitle, 'modname' => $adminmodule['name'], 'order' => $order, - 'id' => $adminmodule['id'] + 'id' => $adminmodule['id'], + 'icon' => ModUtil::getModuleImagePath($adminmodule['name']) ); } } diff --git a/src/system/Zikula/Module/AdminModule/Resources/public/css/style.css b/src/system/Zikula/Module/AdminModule/Resources/public/css/style.css index d3cd1617ff..a06f5aac6a 100644 --- a/src/system/Zikula/Module/AdminModule/Resources/public/css/style.css +++ b/src/system/Zikula/Module/AdminModule/Resources/public/css/style.css @@ -1,25 +1,3 @@ -/****************************************************************************** -* Admin breadcrumbs -******************************************************************************/ - -#z-maincontent .z-admin-breadcrumbs { - color: #777; - font-size: 0.95em; - margin-bottom: 1em; -} - -#z-maincontent .z-admin-breadcrumbs a { - color: #555; -} - -#z-maincontent .z-admin-breadcrumbs .sub { - color: #999; -} - -#z-maincontent .z-admin-breadcrumbs .z-breadcrumb { - padding: 0 0.2em; -} - /****************************************************************************** * Admin area (introduced in Core 1.3) * This single container replaces the old 'z-adminbox' and 'z-admincontainer' @@ -110,75 +88,6 @@ border-bottom: 1px solid #eee; } -/****************************************************************************** -* Styling for module icon list in the admin panel -******************************************************************************/ - -#z-adminiconlist { - margin: 5px; -} - -#z-adminiconlist .z-adminfloat { - float: left; -} - -#z-adminiconlist .z-adminiconcontainer { - float: left; - padding: 0.75em 0; -} - -#z-adminiconlist .z-adminmodtitle { - font-weight: bold; - overflow: hidden; -} - -#z-adminiconlist .z-adminiconrow .z-adminiconcontainer .z-adminicon { - /* only for admin_admin_adminpanel_inc1.tpl */ - margin-right: 5px; -} - -#z-adminiconlist .z-adminiconcontainer .z-adminicon img { - background: inherit; - border-color: #D9E0E6 #C8CDD2 #C8CDD2 #D9E0E6; - border-style: solid; - border-width: 1px; - padding: 4px; -} - -#z-adminiconlist .z-adminiconcontainer .z-adminicon img:hover { - border: 1px solid #aaa; -} - -#z-adminiconlist .z-adminlinkheader { - white-space: nowrap; -} - -#z-adminiconlist .z-adminlinkheader img { - vertical-align: middle; -} - -#z-adminiconlist .z-dragicon { - cursor: move; -} - -.module-context { - color: #808080; - border: 1px solid transparent; - cursor: pointer; - height: 1em; - margin-left: 0; - padding: 0 5px; - width: 1em; -} - -.module-context:hover { - color: black; - border: 1px solid #999; - -webkit-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3); - -moz-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3); - box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3); -} - /****************************************************************************** * Styling for status security analyzer, update checker and more ******************************************************************************/ @@ -205,17 +114,8 @@ border: 2px solid #990000; } -div#z-developernotices strong, -div#z-securityanalyzer strong, -div#z-updatechecker strong { - display: block; - font-size: 1.2em; - font-weight: bold; - margin: 0; - padding: 0.25em; -} - div#z-developernotices strong:hover, +div#z-developernotices span:hover, div#z-securityanalyzer strong:hover, div#z-updatechecker strong:hover { text-decoration: underline; @@ -291,6 +191,7 @@ div.z-admincategorydescription { color: #999; font-size: 0.9em; margin: 0 0 1.25em; + text-align: right; } /****************************************************************************** @@ -404,174 +305,76 @@ div.z-admincontainer { } /****************************************************************************** -* Admin tabs +* Admin tab ******************************************************************************/ -ul#admintabs { - background: url("../images/tab_bottom.gif") repeat-x scroll center bottom transparent; - margin: 0 !important; - padding: 0 !important; - width: 100%; - list-style: none outside none !important; +.nav-tabs-admin > li > a { + padding: 5px 10px; + color: black; } -ul#admintabs li { - background: none repeat scroll 0 0 #F3F3F3 !important; - border: 1px solid #CCCCCC; - float: left; - margin: 0 5px 0 0; - padding: 0; - z-index: 1000; - -webkit-border-radius: 5px 5px 0 0; - -moz-border-radius: 5px 5px 0 0; - border-radius: 5px 5px 0 0; +.nav-tabs-admin > li { + margin: 0 2px -1px 0; } -ul#admintabs li > a { - border-right: 1px solid transparent; - color: #666666; - float: left; +.nav-tabs-admin > .active { font-weight: bold; - padding: 5px; - position: relative; - text-decoration: none !important; -} - -ul#admintabs li > a:hover { - background: #FFFFFF !important; - border-right: 1px solid #ccc; - color: #000; - text-decoration: none !important; - -webkit-border-radius: 5px 0 0 0; - -moz-border-radius: 5px 0 0 0; - border-radius: 5px 0 0 0; -} - -ul#admintabs li.active { - background: none repeat scroll 0 0 #fff !important; - border-bottom: 1px solid #fff; - z-index: 2000; } -ul#admintabs li.active a:hover { - border-right: 1px solid transparent; -} -ul#admintabs li#addcat > a:hover { - border-right: 1px solid transparent; +.nav-tabs-admin .popover { + width:300px; } -ul#admintabs li#addcat #addcatlink { - width: 28px; - height:27px; - padding-left:8px; -} -ul#admintabs li#addcat a#addcatlink:hover { - -webkit-border-radius: 5px 5px 0 0; - -moz-border-radius: 5px 5px 0 0; - border-radius: 5px 5px 0 0; +.admintab-dropover { + background-color: orange!important } -ul#admintabs li > .z-admindrop { - background: url("../../../../../../../images/global/arrow_down_grey.png") no-repeat scroll 50% 50% transparent; - border-left: 1px solid transparent; - cursor: pointer; - float: left; - padding: 5px 4px; - position: relative; - width: 7px; - -webkit-box-sizing: content-box; - box-sizing: content-box; -} -ul#admintabs li > .z-admindrop:hover { - background: url("../../../../../../../images/global/arrow_down_black.png") no-repeat scroll 50% 50% #FFFFFF; - border-left: 1px solid #CCCCCC; - -webkit-border-radius: 0 5px 0 0; - -moz-border-radius: 0 5px 0 0; - border-radius: 0 5px 0 0; -} +/****************************************************************************** +* Module list +******************************************************************************/ -ul#admintabs li.active > .z-admindrop:hover { - background: url("../../../../../../../images/global/arrow_down_black.png") no-repeat scroll 50% 50% transparent; - border-left: 1px solid transparent; - -webkit-border-radius: 0 5px 0 0; - -moz-border-radius: 0 5px 0 0; - border-radius: 0 5px 0 0; +#modulelist { + padding-left: 0; + padding-bottom: 0px; + margin-bottom: 20px; + list-style: none; + overflow: hidden; } -ul#admintabs li a.ajaxhover { - background: #FFFFB2 !important; - border-right: 1px solid #ccc; - color: #000; - -webkit-border-radius: 5px 0 0 0; - -moz-border-radius: 5px 0 0 0; - border-radius: 5px 0 0 0; +#modulelist > li { + float: left; + width: 100%; + padding: 10px; + margin: 0 -1px 10px 0; + font-size: 12px; + line-height: 1.4; } -ul#admintabs #ajaxNewCatForm { - background-color: #FFFFB2; - display: block; +#modulelist img { float: left; - font-weight: bold; - padding: 5px; - position: relative; - text-decoration: none; - z-index: 1000; - -webkit-border-radius: 5px 5px 0 0; - -moz-border-radius: 5px 5px 0 0; - border-radius: 5px 5px 0 0; -} - -ul#admintabs #ajaxNewCatForm input.ajaxNewCat { - background-color: #fff; - border: none; - color: #333; - float: left; - font-weight: bold; - margin: 0; - max-width: 8em; - padding: 0; -} - -ul#admintabs #ajaxNewCatForm a.ajaxCatImage { - background-color: transparent; - border: medium none; - margin: 0; - padding: 0; - text-decoration: none; + background: inherit; + border-color: #D9E0E6 #C8CDD2 #C8CDD2 #D9E0E6; + border-style: solid; + border-width: 1px; + padding: 4px; } -ul#admintabs #ajaxNewCatForm a.ajaxCatImage img { - background-color: transparent; - border: medium none; - margin-left: 3px; - padding: 0; - text-decoration: none; +#modulelist div { + margin-left: 65px; + text-align: left; } -form.inplaceeditor-form { - background-color: #FFFFB2; - border-right: 1px solid #ccc; - color: #666666; - display: block; - float: left; - margin-right: 0.5em; - padding: 5px 10px; - text-decoration: none; - -webkit-border-radius: 5px 0 0 0; - -moz-border-radius: 5px 0 0 0; - border-radius: 5px 0 0 0; +@media (min-width: 550px) { + #modulelist > li { + width: 50%; + } } -form.inplaceeditor-form input[type="text"] { - font-weight: bold; - background-color: #FFF; - border: none; - color: #333; - margin: 0 !important; - padding: 0 !important; - max-width: 8em; - outline: medium none; -} +@media (min-width: 950px) { + #modulelist > li { + width: 33%; + } +} \ No newline at end of file diff --git a/src/system/Zikula/Module/AdminModule/Resources/public/js/admin_admin_admintab.js b/src/system/Zikula/Module/AdminModule/Resources/public/js/admin_admin_admintab.js new file mode 100644 index 0000000000..4ba279de90 --- /dev/null +++ b/src/system/Zikula/Module/AdminModule/Resources/public/js/admin_admin_admintab.js @@ -0,0 +1,219 @@ +// Copyright Zikula Foundation 2013 - license GNU/LGPLv3 (or at your option, any later version). + +( function($) {$(document).ready(function() { + +/******************************************************************************* + * Sort admin tabs +*******************************************************************************/ + +$('#admintab').sortable({ + cursor: 'move', + containment: 'parent', + update: function( event, ui ) { + var tab = new Array(); + $('#admintab li').each( function() { + var catid = $(this).data('catid'); + if (catid !== undefined) { + tab.push($(this).data('catid')); + } + }); + + $.ajax({ + url: 'index.php?module=adminpanel&type=ajax&func=sortCategories', + data: {admintabs: tab}, + error: function (response) { + alert($.parseJSON(response.responseText).core.statusmsg); + } + }); + }, +}); + +/**a**************************************************************************** + * Sort admin tabs +*******************************************************************************/ + +$('#admintab').sortable({ + cursor: 'move', + containment: 'parent', + update: function(event, ui) { + var tabs = new Array(); + $('#admintab li').each( function() { + var catid = $(this).data('catid'); + if (catid !== undefined) { + tabs.push(catid); + } + }); + $.ajax({ + url: "index.php?module=adminpanel&type=ajax&func=sortCategories", + data: {admintabs: tabs}, + error: function (response) { + alert($.parseJSON(response.responseText).core.statusmsg); + } + }); + }, +}); + +/******************************************************************************* + * Add admin tab +*******************************************************************************/ + +$('#admintab-addcat-link').popover({ + content: function(ele) { return $('#admintab-addcat-popover').html(); }, + html: true + }); + +$(document).on('click', '#admintab-addcat-link', function (e) { + e.preventDefault(); + $('#admintab-addcat-name').focus(); +}); + +$(document).on('click', '#admintab-addcat-cancel', function (e) { + $('#admintab-addcat-link').popover('hide') +}); + +$(document).on('click', '#admintab-addcat-save', function (e) { + $('#admintab-addcat-link').popover('hide') + var name = $('#admintab-addcat-name').val(); + if (name === '') { + alert(('You must enter a name for the new category')); + } + $.ajax({ + url: 'index.php?module=ZikulaAdminModule&type=ajax&func=addCategory', + data: { + name: name + }, + success: function(response) { + console.log(response); + var newtab = ''; + $('#admintab li').last().before(newtab); + $('#admintab-addcat-link').popover('hide'); + }, + error: function (response) { + alert($.parseJSON(response.responseText).core.statusmsg); + } + }) +}); + +/******************************************************************************* + * Drag and drop modules to admin tabs +*******************************************************************************/ + +// dragable +$('.draggable').draggable({ + revert: 'invalid', + containment: 'document', + helper: 'clone', + cursor: 'move', + handle: 'span.modulelist-drag', +}); + +$('.droppable').droppable({ + over: function( event, ui ) { + $(this).find('a:first').addClass('admintab-dropover'); + }, + out: function( event, ui ) { + $(this).find('a:first').removeClass('admintab-dropover'); + }, + accept: '.draggable', + tolerance: 'pointer', + drop: function( event, ui ) { + // prevent mouse over + $('ul.nav-mouseover li.dropdown').unbind('hover'); + $(this).off('click').on('mouseout', function rebindNavMouseOver() { + $('ul.nav-mouseover li.dropdown').hover(function() { + $(this).find('.dropdown-menu').stop(true, true).delay(200).fadeIn(); + }, function() { + $(this).find('.dropdown-menu').stop(true, true).delay(200).fadeOut(); + }); + }); + $(this).find('a:first').removeClass('admintab-dropover'); + + // do nothing is icon was moved to the current category + var categoryId = $(this).data('catid'); + var currentCategoryId = $('#admintab li.active').data('catid'); + if (categoryId === currentCategoryId) { + return false; + } + + $.ajax({ + url: 'index.php?module=adminpanel&type=ajax&func=changeModuleCategory', + data: { + modid: ui.draggable.data('modid'), + cat: categoryId + }, + success: function(response) { + ui.draggable.remove(); + }, + error: function (response) { + alert($.parseJSON(response.responseText).core.statusmsg); + } + }); + } +}); + +/******************************************************************************* + * Sort modules +*******************************************************************************/ + +$('#modulelist').sortable({ + cursor: 'move', + containment: 'parent', + handle: 'span.modulelist-sort', + update: function(event, ui) { + var modules = new Array(); + $('#modulelist li').each( function() { + var modid = $(this).data('modid'); + if (modid !== undefined) { + modules.push($(this).data('modid')); + } + }); + $.ajax({ + url: 'index.php?module=adminpanel&type=ajax&func=sortModules', + data: {modules: modules}, + error: function (response) { + alert($.parseJSON(response.responseText).core.statusmsg); + } + }); + }, +}); + +/******************************************************************************* + * Module functions dropdown +*******************************************************************************/ + +$('.dropdown-toggle').click( function() { + var container = $(this).parent().parent().parent().parent(); + var containerTop = container.position().top; + var itemTop = $(this).parent().position().top; + var avaibleHeight = container.height() - (itemTop-containerTop); + var neededHeight = $(this).parent().find('ul').height(); + if (neededHeight > avaibleHeight) { + container.height(container.height() + neededHeight - avaibleHeight + 5); + } +}); + +/******************************************************************************* + * Toggle developer notices +*******************************************************************************/ + +$(document).on('click', '#z-developernotices strong', function(e) { + var ul = $('#z-developernotices ul'); + var span = $('#z-developernotices span'); + if( $('#z-developernotices ul').is(':visible') ) { + ul.slideUp(); + span.removeClass('icon-caret-down'); + span.addClass('icon-caret-right'); + } else { + ul.slideDown(); + span.removeClass('icon-caret-right'); + span.addClass('icon-caret-down'); + } +}); + + +});})(jQuery); \ No newline at end of file diff --git a/src/system/Zikula/Module/AdminModule/Resources/views/admin_admin_adminpanel.tpl b/src/system/Zikula/Module/AdminModule/Resources/views/admin_admin_adminpanel.tpl index 1cd38e26db..c655e09249 100644 --- a/src/system/Zikula/Module/AdminModule/Resources/views/admin_admin_adminpanel.tpl +++ b/src/system/Zikula/Module/AdminModule/Resources/views/admin_admin_adminpanel.tpl @@ -3,45 +3,58 @@

{$category.name|safetext}

{$category.description|safetext}
- {if !empty($adminlinks)} - -
- {assign var="moduleid" value="0"} + {if !empty($adminlinks)} + + +
- {else} -

{gt text="There are currently no modules in this category."}

- {/if} + {else} +

{gt text="There are currently no modules in this category."}

+ {/if} +
-
Zikula {$coredata.version_num}
\ No newline at end of file +
Zikula {$coredata.version_num}
+ + diff --git a/src/system/Zikula/Module/AdminModule/Resources/views/admin_admin_categorymenu.tpl b/src/system/Zikula/Module/AdminModule/Resources/views/admin_admin_categorymenu.tpl index e9f557b036..d7a46e504f 100644 --- a/src/system/Zikula/Module/AdminModule/Resources/views/admin_admin_categorymenu.tpl +++ b/src/system/Zikula/Module/AdminModule/Resources/views/admin_admin_categorymenu.tpl @@ -1,4 +1,6 @@ -{ajaxheader modname='ZikulaAdminModule' filename='admin_admin_ajax.js' ui=true} +{pageaddvar name='javascript' value='system/Zikula/Module/AdminModule/Resources/public/js/admin_admin_admintab.js'} +{pageaddvar name='javascript' value='jquery-ui'} +