|
From: <bi...@us...> - 2013-06-07 04:35:46
|
Revision: 11637
http://sourceforge.net/p/xoops/svn/11637
Author: bitc3r0
Date: 2013-06-07 04:35:43 +0000 (Fri, 07 Jun 2013)
Log Message:
-----------
Fixed some minor issues with new GUI features.
Improving blocks manager by adding drag and drop.
Modified Paths:
--------------
RMC/rmcommon/trunk/rmcommon/ajax/blocks.php
RMC/rmcommon/trunk/rmcommon/blocks.php
RMC/rmcommon/trunk/rmcommon/css/blocks.css
RMC/rmcommon/trunk/rmcommon/images.php
RMC/rmcommon/trunk/rmcommon/include/js/blocks.js
RMC/rmcommon/trunk/rmcommon/index.php
RMC/rmcommon/trunk/rmcommon/menu.php
RMC/rmcommon/trunk/rmcommon/templates/rmc_blocks.php
RMC/rmcommon/trunk/rmcommon/templates/rmc_comments.php
RMC/rmcommon/trunk/rmcommon/templates/rmc_dashboard.php
RMC/rmcommon/trunk/rmcommon/themes/twop6/class/twop6functions.class.php
RMC/rmcommon/trunk/rmcommon/themes/twop6/theme.php
RMC/rmcommon/trunk/rmcommon/xoops_version.php
Added Paths:
-----------
RMC/rmcommon/trunk/rmcommon/include/js/jquery.nestable.js
Removed Paths:
-------------
RMC/rmcommon/trunk/rmcommon/themes/twop6/css/rmcommon/imgmgr.css
Modified: RMC/rmcommon/trunk/rmcommon/ajax/blocks.php
===================================================================
--- RMC/rmcommon/trunk/rmcommon/ajax/blocks.php 2013-06-07 04:30:16 UTC (rev 11636)
+++ RMC/rmcommon/trunk/rmcommon/ajax/blocks.php 2013-06-07 04:35:43 UTC (rev 11637)
@@ -92,6 +92,8 @@
$result = $db->query($sql);
if ($result)
list($canvas, $canvas_name) = $db->fetchRow($result);
+ else
+ $canvas = '';
}
$block->setReadGroups(array(0));
Modified: RMC/rmcommon/trunk/rmcommon/blocks.php
===================================================================
--- RMC/rmcommon/trunk/rmcommon/blocks.php 2013-06-07 04:30:16 UTC (rev 11636)
+++ RMC/rmcommon/trunk/rmcommon/blocks.php 2013-06-07 04:35:43 UTC (rev 11637)
@@ -95,12 +95,12 @@
while ($row = $db->fetchArray($result)) {
$mod = RMFunctions::load_module($row['element']);
if(!$mod) continue;
- $used_blocks[] = array(
- 'id' => $row['bid'],
+ $used_blocks[$row['canvas']][] = array(
+ 'id' => $row['bid'],
'title' => $row['name'],
- 'module' => array('id' => $mod->mid(), 'dir' => $mod->dirname(), 'name' => $mod->name()),
- 'canvas' => $bpos[$row['canvas']],
- 'weight' => $row['weight'],
+ 'module' => array('id' => $mod->mid(), 'dir' => $mod->dirname(), 'name' => $mod->name()),
+ 'canvas' => $bpos[$row['canvas']],
+ 'weight' => $row['weight'],
'visible'=>$row['visible'],
'active'=>$row['isactive'],
'type'=>$row['type'],
@@ -108,7 +108,7 @@
'description'=>$row['description']
);
}
-
+
// ** API **
// Event for manege the used widgets list
$used_blocks = RMEvents::get()->run_event('rmcommon.used.blocks.list', $used_blocks);
@@ -124,11 +124,9 @@
}
$positions = RMEvents::get()->run_event('rmcommon.block.positions.list', $positions);
-
- if(rmc_server_var($_REQUEST, 'pos', '')!=''){
- RMTemplate::get()->add_local_script('jquery.sort.js', 'rmcommon', 'include');
- }
+ RMTemplate::get()->add_local_script('jquery.nestable.js', 'rmcommon', 'include');
+
RMBreadCrumb::get()->add_crumb(__('Blocks Management','rmcommon'));
$rmTpl->assign('xoops_pagetitle', __('Blocks Management','rmcommon'));
@@ -150,8 +148,6 @@
var lang_positions = "'.__('Show Positions','rmcommon').'";
var lang_blocks = "'.__('Show Blocks','rmcommon').'";</script>');
- RMFunctions::create_toolbar();
-
xoops_cp_header();
// Available Widgets
Modified: RMC/rmcommon/trunk/rmcommon/css/blocks.css
===================================================================
--- RMC/rmcommon/trunk/rmcommon/css/blocks.css 2013-06-07 04:30:16 UTC (rev 11636)
+++ RMC/rmcommon/trunk/rmcommon/css/blocks.css 2013-06-07 04:35:43 UTC (rev 11637)
@@ -1,11 +1,120 @@
-.rmc_blocks_options{
- padding: 5px 0;
- overflow: hidden;
+.rmc-position-item{
+ width: 300px;
+ border: 1px solid #CCC;
+ border: 1px solid rgba(0,0,0,0.1);
+ border-radius: 2px;
+ -moz-border-radius: 2px;
+ -webkit-border-radius: 2px;
+ display: inline-block;
+ vertical-align: text-top;
+ padding: 1px;
+ background-color: #fafafa;
}
-.rmc_blocks_options input,
-.rmc_blocks_options select{
- margin: 3px 0 0 0;
+.rmc-position-item h3{
+ margin: 0;
+ padding: 5px;
+ font-size: 1.1em;
+ color: #333;
+ color: rgba(0,0,0,0.5);
+ border-radius: 2px 2px 0 0;
+ -moz-border-radius: 2px 2px 0 0;
+ -webkit-border-radius: 2px 2px 0 0;
+ border-bottom: 1px solid rgba(0,0,0,0.1);
+ text-shadow: 1px 1px 0 rgba(255,255,255,0.5);
+ background-color: #ebebeb;
+ background-color: rgba(0,0,0,0.05);
}
+.rmc-position-item ol{
+ list-style: none;
+ padding: 5px;
+ margin: 0;
+}
+.rmc-position-item ol li{
+ border: 1px solid #ddd;
+ border-radius: 2px;
+ -moz-border-radius: 2px;
+ -webkit-border-radius: 2px;
+ margin: 0 0 6px 0;
+ background-color: #fff;
+}
+.rmc-position-item ol li > .dd-handle > a{
+ display: inline-block;
+ line-height: 30px;
+ padding: 0 7px;
+ border-left: 1px solid #ddd;
+ box-shadow: inset 1px 1px 1px rgba(255,255,255,0.5);
+}
+.rmc-position-item ol li > .dd-handle > a:last-child{
+ border-radius: 0 0 0 2px;
+}
+.rmc-position-item ol li > .dd-handle > a:hover{
+ background-color: rgba(255,255,255,0.5);
+ text-decoration: none;
+}
+.rmc-position-item ol li > .dd-handle{
+ border-bottom: 1px solid #ddd;
+ box-shadow: 0 1px 1px rgba(255,255,255,0.5);
+ border-radius: 2px 2px 0 0;
+ background: #ffffff; /* Old browsers */
+ background: -moz-linear-gradient(top, #ffffff 0%, #e5e5e5 100%); /* FF3.6+ */
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#e5e5e5)); /* Chrome,Safari4+ */
+ background: -webkit-linear-gradient(top, #ffffff 0%,#e5e5e5 100%); /* Chrome10+,Safari5.1+ */
+ background: -o-linear-gradient(top, #ffffff 0%,#e5e5e5 100%); /* Opera 11.10+ */
+ background: -ms-linear-gradient(top, #ffffff 0%,#e5e5e5 100%); /* IE10+ */
+ background: linear-gradient(to bottom, #ffffff 0%,#e5e5e5 100%); /* W3C */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#e5e5e5',GradientType=0 ); /* IE6-9 */
+}
+.rmc-position-item ol li > .dd-handle > strong{
+ line-height: 30px;
+ display: inline-block;
+ padding: 0 5px;
+ max-width: 190px;
+ text-shadow: 1px 1px 0 rgba(255,255,255,0.5);
+ font-size: 1.1em;
+ cursor: move;
+}
+.rmc-position-item ol li > .block-data{
+ line-height: 18px;
+ text-shadow: 1px 1px 0 rgba(255,255,255,0.5);
+ padding: 5px;
+}
+.rmc-position-item ol li > .block-data > p{
+ font-size: 12px;
+ color: #666;
+ margin: 0;
+}
+.rmc-position-item ol li i{
+ font-size: 14px;
+}
+
+#bks-and-pos{
+ display: none;
+}
+
+/* NESTABLE */
+.dd-item,
+.dd-empty,
+.dd-placeholder { display: block; position: relative; margin: 0; padding: 0; min-height: 20px; font-size: 13px; line-height: 20px; }
+.dd-list { display: block; position: relative; margin: 0; padding: 0; list-style: none; }
+.dd-placeholder,
+.dd-empty {
+ margin: 5px 0;
+ padding: 0;
+ min-height: 30px;
+ background: #f2fbff;
+ border: 1px dashed #b6bcbf;
+ box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ text-align: center;
+}
+
+.dd-dragel { position: absolute; pointer-events: none; z-index: 9999; }
+.dd-dragel > .dd-item .dd-handle { margin-top: 0; }
+.dd-dragel .dd-handle {
+ -webkit-box-shadow: 2px 4px 6px 0 rgba(0,0,0,.1);
+ box-shadow: 2px 4px 6px 0 rgba(0,0,0,.1);
+}
+
.disabled{
font-style: italic;
background: url(../images/modbk.png) no-repeat left;
Modified: RMC/rmcommon/trunk/rmcommon/images.php
===================================================================
--- RMC/rmcommon/trunk/rmcommon/images.php 2013-06-07 04:30:16 UTC (rev 11636)
+++ RMC/rmcommon/trunk/rmcommon/images.php 2013-06-07 04:35:43 UTC (rev 11637)
@@ -307,9 +307,9 @@
RMFunctions::create_toolbar();
RMBreadCrumb::get()->add_crumb(__('Images Manager','rmcommon'),'images.php');
- RMBreadCrumb::get()->add_crumb(__('Add Category','rmcommon'));
+ RMBreadCrumb::get()->add_crumb($edit ? __('Edit Category','rmcommon') : __('Add Category','rmcommon'));
- $rmTpl->assign('xoops_pagetitle', __('Images Manager: Add category','rmcommon'));
+ $rmTpl->assign('xoops_pagetitle', sprintf(__('Images Manager: %s','rmcommon'), $edit ? __('Edit Category','rmcommon') : __('Add category','rmcommon')));
xoops_cp_header();
Modified: RMC/rmcommon/trunk/rmcommon/include/js/blocks.js
===================================================================
--- RMC/rmcommon/trunk/rmcommon/include/js/blocks.js 2013-06-07 04:30:16 UTC (rev 11636)
+++ RMC/rmcommon/trunk/rmcommon/include/js/blocks.js 2013-06-07 04:35:43 UTC (rev 11637)
@@ -176,17 +176,27 @@
jkmegamenu.definemenu("newban", "megamenu1", "click")
$("#newpos").click(function(){
- $("#form-pos").toggle('slow', function(){
- if($(this).is(":visible")){
- $("#form-pos").effect('highlight', {}, 1000);
+
+ if($("#bks-and-pos").is(":visible")){
+
+ $("#bks-and-pos").fadeOut('fast', function(){
+
+ $("#blocks-list").fadeIn('fast');
+ $("#newpos").html(lang_positions);
+
+ });
+
+ } else {
+
+ $("#blocks-list").fadeOut('fast', function(){
+
+ $("#bks-and-pos").fadeIn('fast');
$("#newpos").html(lang_blocks);
- } else {
- $("#newpos").html(lang_positions);
- }
- });
- $("#blocks-positions").slideToggle(500);
- $("#blocks-list").slideToggle(500);
- $("#blocks-modpos").fadeToggle(500);
+
+ });
+
+ }
+
return false;
});
@@ -213,7 +223,7 @@
}
$.post('ajax/blocks.php', params, function(data){
-
+
$("#wait-buttons").fadeOut('slow');
if(data.error){
@@ -271,8 +281,9 @@
});
- $("a.bk_edit").click(function(){
- var id = $(this).attr("id").replace("edit-",'');
+ $("li.dd-item .dd-handle a").click(function(){
+
+ alert($(this).data("block")); return;
blocksAjax.loadForm(id,'');
return false;
@@ -393,89 +404,7 @@
});
});
-
- $("a.sort_blocks").click(function(){
-
- $("#bks-and-pos").fadeOut('fast', function(){
- $("#bk-sorts").fadeIn('fast');
- });
-
- });
-
- if($("#bk-sorts").length>0){
-
- $("ol.bk-sort").nestedSortable({
- disableNesting: 'no-nest',
- forcePlaceholderSize: true,
- handle: 'div',
- helper: 'clone',
- items: 'li',
- maxLevels: 1,
- opacity: .6,
- placeholder: 'placeholder',
- revert: 250,
- tabSize: 25,
- tolerance: 'pointer',
- toleranceElement: '> div',
- axis: 'y'
- });
-
- $("a.cancel-order").click(function(){
-
- $("#bk-sorts").fadeOut('fast', function(){
- $("#bks-and-pos").fadeIn('fast');
- });
-
- })
-
- $("a.save-order").click(function(){
-
- s = $("ol.bk-sort").nestedSortable('serialize');
- $(".bk_waiting").fadeIn('fast');
-
- params = {
- XOOPS_TOKEN_REQUEST: $("#XOOPS_TOKEN_REQUEST").val(),
- action: 'save_orders',
- items: s
- };
-
-
- $.post("ajax/blocks.php", params, function(data){
-
- if(data.error){
- $("#bk-messages").removeClass("infoMsg");
- $("#bk-messages .msg").html(data.message);
- $("#bk-messages").addClass("errorMsg");
- $("#bk-messages").slideDown('slow');
- if(data.token==null || data.token==''){
- window.location.href = 'blocks.php';
- } else {
- $("#XOOPS_TOKEN_REQUEST").val(data.token)
- }
- return false;
- }
-
- if(data.message!=null && data.message!=''){
- $("#bk-messages").removeClass("errorMsg");
- $("#bk-messages .msg").html(data.message);
- $("#bk-messages").addClass("infoMsg");
- $("#bk-messages").slideDown('slow');
- }
- if(data.token==null || data.token==''){
- window.location.href = 'blocks.php';
- } else {
- $("#XOOPS_TOKEN_REQUEST").val(data.token);
- }
-
- window.location.href = 'blocks.php?mid='+$("select[name='mid']").val()+"&pos="+$("select[name='pos']").val()+'&visible='+$("select[name='visible']").val();
-
- }, 'json');
-
- });
-
- }
-
});
function before_submit(id){
Added: RMC/rmcommon/trunk/rmcommon/include/js/jquery.nestable.js
===================================================================
--- RMC/rmcommon/trunk/rmcommon/include/js/jquery.nestable.js (rev 0)
+++ RMC/rmcommon/trunk/rmcommon/include/js/jquery.nestable.js 2013-06-07 04:35:43 UTC (rev 11637)
@@ -0,0 +1,485 @@
+/*!
+ * Nestable jQuery Plugin - Copyright (c) 2012 David Bushell - http://dbushell.com/
+ * Dual-licensed under the BSD or MIT licenses
+ */
+;(function($, window, document, undefined)
+{
+ var hasTouch = 'ontouchstart' in window;
+
+ /**
+ * Detect CSS pointer-events property
+ * events are normally disabled on the dragging element to avoid conflicts
+ * https://github.com/ausi/Feature-detection-technique-for-pointer-events/blob/master/modernizr-pointerevents.js
+ */
+ var hasPointerEvents = (function()
+ {
+ var el = document.createElement('div'),
+ docEl = document.documentElement;
+ if (!('pointerEvents' in el.style)) {
+ return false;
+ }
+ el.style.pointerEvents = 'auto';
+ el.style.pointerEvents = 'x';
+ docEl.appendChild(el);
+ var supports = window.getComputedStyle && window.getComputedStyle(el, '').pointerEvents === 'auto';
+ docEl.removeChild(el);
+ return !!supports;
+ })();
+
+ var eStart = hasTouch ? 'touchstart' : 'mousedown',
+ eMove = hasTouch ? 'touchmove' : 'mousemove',
+ eEnd = hasTouch ? 'touchend' : 'mouseup';
+ eCancel = hasTouch ? 'touchcancel' : 'mouseup';
+
+ var defaults = {
+ listNodeName : 'ol',
+ itemNodeName : 'li',
+ rootClass : 'dd',
+ listClass : 'dd-list',
+ itemClass : 'dd-item',
+ dragClass : 'dd-dragel',
+ handleClass : 'dd-handle',
+ collapsedClass : 'dd-collapsed',
+ placeClass : 'dd-placeholder',
+ noDragClass : 'dd-nodrag',
+ emptyClass : 'dd-empty',
+ expandBtnHTML : '<button data-action="expand" type="button">Expand</button>',
+ collapseBtnHTML : '<button data-action="collapse" type="button">Collapse</button>',
+ group : 0,
+ maxDepth : 5,
+ threshold : 20
+ };
+
+ function Plugin(element, options)
+ {
+ this.w = $(window);
+ this.el = $(element);
+ this.options = $.extend({}, defaults, options);
+ this.init();
+ }
+
+ Plugin.prototype = {
+
+ init: function()
+ {
+ var list = this;
+
+ list.reset();
+
+ list.el.data('nestable-group', this.options.group);
+
+ list.placeEl = $('<div class="' + list.options.placeClass + '"/>');
+
+ $.each(this.el.find(list.options.itemNodeName), function(k, el) {
+ list.setParent($(el));
+ });
+
+ list.el.on('click', 'button', function(e) {
+ if (list.dragEl || (!hasTouch && e.button !== 0)) {
+ return;
+ }
+ var target = $(e.currentTarget),
+ action = target.data('action'),
+ item = target.parent(list.options.itemNodeName);
+ if (action === 'collapse') {
+ list.collapseItem(item);
+ }
+ if (action === 'expand') {
+ list.expandItem(item);
+ }
+ });
+
+ var onStartEvent = function(e)
+ {
+ var handle = $(e.target);
+ if (!handle.hasClass(list.options.handleClass)) {
+ if (handle.closest('.' + list.options.noDragClass).length) {
+ return;
+ }
+ handle = handle.closest('.' + list.options.handleClass);
+ }
+ if (!handle.length || list.dragEl || (!hasTouch && e.button !== 0) || (hasTouch && e.touches.length !== 1)) {
+ return;
+ }
+ e.preventDefault();
+ list.dragStart(hasTouch ? e.touches[0] : e);
+ };
+
+ var onMoveEvent = function(e)
+ {
+ if (list.dragEl) {
+ e.preventDefault();
+ list.dragMove(hasTouch ? e.touches[0] : e);
+ }
+ };
+
+ var onEndEvent = function(e)
+ {
+ if (list.dragEl) {
+ e.preventDefault();
+ list.dragStop(hasTouch ? e.touches[0] : e);
+ }
+ };
+
+ if (hasTouch) {
+ list.el[0].addEventListener(eStart, onStartEvent, false);
+ window.addEventListener(eMove, onMoveEvent, false);
+ window.addEventListener(eEnd, onEndEvent, false);
+ window.addEventListener(eCancel, onEndEvent, false);
+ } else {
+ list.el.on(eStart, onStartEvent);
+ list.w.on(eMove, onMoveEvent);
+ list.w.on(eEnd, onEndEvent);
+ }
+
+ },
+
+ serialize: function()
+ {
+ var data,
+ depth = 0,
+ list = this;
+ step = function(level, depth)
+ {
+ var array = [ ],
+ items = level.children(list.options.itemNodeName);
+ items.each(function()
+ {
+ var li = $(this),
+ item = $.extend({}, li.data()),
+ sub = li.children(list.options.listNodeName);
+ if (sub.length) {
+ item.children = step(sub, depth + 1);
+ }
+ array.push(item);
+ });
+ return array;
+ };
+ data = step(list.el.find(list.options.listNodeName).first(), depth);
+ return data;
+ },
+
+ serialise: function()
+ {
+ return this.serialize();
+ },
+
+ reset: function()
+ {
+ this.mouse = {
+ offsetX : 0,
+ offsetY : 0,
+ startX : 0,
+ startY : 0,
+ lastX : 0,
+ lastY : 0,
+ nowX : 0,
+ nowY : 0,
+ distX : 0,
+ distY : 0,
+ dirAx : 0,
+ dirX : 0,
+ dirY : 0,
+ lastDirX : 0,
+ lastDirY : 0,
+ distAxX : 0,
+ distAxY : 0
+ };
+ this.moving = false;
+ this.dragEl = null;
+ this.dragRootEl = null;
+ this.dragDepth = 0;
+ this.hasNewRoot = false;
+ this.pointEl = null;
+ },
+
+ expandItem: function(li)
+ {
+ li.removeClass(this.options.collapsedClass);
+ li.children('[data-action="expand"]').hide();
+ li.children('[data-action="collapse"]').show();
+ li.children(this.options.listNodeName).show();
+ },
+
+ collapseItem: function(li)
+ {
+ var lists = li.children(this.options.listNodeName);
+ if (lists.length) {
+ li.addClass(this.options.collapsedClass);
+ li.children('[data-action="collapse"]').hide();
+ li.children('[data-action="expand"]').show();
+ li.children(this.options.listNodeName).hide();
+ }
+ },
+
+ expandAll: function()
+ {
+ var list = this;
+ list.el.find(list.options.itemNodeName).each(function() {
+ list.expandItem($(this));
+ });
+ },
+
+ collapseAll: function()
+ {
+ var list = this;
+ list.el.find(list.options.itemNodeName).each(function() {
+ list.collapseItem($(this));
+ });
+ },
+
+ setParent: function(li)
+ {
+ if (li.children(this.options.listNodeName).length) {
+ li.prepend($(this.options.expandBtnHTML));
+ li.prepend($(this.options.collapseBtnHTML));
+ }
+ li.children('[data-action="expand"]').hide();
+ },
+
+ unsetParent: function(li)
+ {
+ li.removeClass(this.options.collapsedClass);
+ li.children('[data-action]').remove();
+ li.children(this.options.listNodeName).remove();
+ },
+
+ dragStart: function(e)
+ {
+ var mouse = this.mouse,
+ target = $(e.target),
+ dragItem = target.closest(this.options.itemNodeName);
+
+ this.placeEl.css('height', dragItem.height());
+
+ mouse.offsetX = e.offsetX !== undefined ? e.offsetX : e.pageX - target.offset().left;
+ mouse.offsetY = e.offsetY !== undefined ? e.offsetY : e.pageY - target.offset().top;
+ mouse.startX = mouse.lastX = e.pageX;
+ mouse.startY = mouse.lastY = e.pageY;
+
+ this.dragRootEl = this.el;
+
+ this.dragEl = $(document.createElement(this.options.listNodeName)).addClass(this.options.listClass + ' ' + this.options.dragClass);
+ this.dragEl.css('width', dragItem.width());
+
+ // fix for zepto.js
+ //dragItem.after(this.placeEl).detach().appendTo(this.dragEl);
+ dragItem.after(this.placeEl);
+ dragItem[0].parentNode.removeChild(dragItem[0]);
+ dragItem.appendTo(this.dragEl);
+
+ $(document.body).append(this.dragEl);
+ this.dragEl.css({
+ 'left' : e.pageX - mouse.offsetX,
+ 'top' : e.pageY - mouse.offsetY
+ });
+ // total depth of dragging item
+ var i, depth,
+ items = this.dragEl.find(this.options.itemNodeName);
+ for (i = 0; i < items.length; i++) {
+ depth = $(items[i]).parents(this.options.listNodeName).length;
+ if (depth > this.dragDepth) {
+ this.dragDepth = depth;
+ }
+ }
+ },
+
+ dragStop: function(e)
+ {
+ // fix for zepto.js
+ //this.placeEl.replaceWith(this.dragEl.children(this.options.itemNodeName + ':first').detach());
+ var el = this.dragEl.children(this.options.itemNodeName).first();
+ el[0].parentNode.removeChild(el[0]);
+ this.placeEl.replaceWith(el);
+
+ this.dragEl.remove();
+ this.el.trigger('change');
+ if (this.hasNewRoot) {
+ this.dragRootEl.trigger('change');
+ }
+ this.reset();
+ },
+
+ dragMove: function(e)
+ {
+ var list, parent, prev, next, depth,
+ opt = this.options,
+ mouse = this.mouse;
+
+ this.dragEl.css({
+ 'left' : e.pageX - mouse.offsetX,
+ 'top' : e.pageY - mouse.offsetY
+ });
+
+ // mouse position last events
+ mouse.lastX = mouse.nowX;
+ mouse.lastY = mouse.nowY;
+ // mouse position this events
+ mouse.nowX = e.pageX;
+ mouse.nowY = e.pageY;
+ // distance mouse moved between events
+ mouse.distX = mouse.nowX - mouse.lastX;
+ mouse.distY = mouse.nowY - mouse.lastY;
+ // direction mouse was moving
+ mouse.lastDirX = mouse.dirX;
+ mouse.lastDirY = mouse.dirY;
+ // direction mouse is now moving (on both axis)
+ mouse.dirX = mouse.distX === 0 ? 0 : mouse.distX > 0 ? 1 : -1;
+ mouse.dirY = mouse.distY === 0 ? 0 : mouse.distY > 0 ? 1 : -1;
+ // axis mouse is now moving on
+ var newAx = Math.abs(mouse.distX) > Math.abs(mouse.distY) ? 1 : 0;
+
+ // do nothing on first move
+ if (!mouse.moving) {
+ mouse.dirAx = newAx;
+ mouse.moving = true;
+ return;
+ }
+
+ // calc distance moved on this axis (and direction)
+ if (mouse.dirAx !== newAx) {
+ mouse.distAxX = 0;
+ mouse.distAxY = 0;
+ } else {
+ mouse.distAxX += Math.abs(mouse.distX);
+ if (mouse.dirX !== 0 && mouse.dirX !== mouse.lastDirX) {
+ mouse.distAxX = 0;
+ }
+ mouse.distAxY += Math.abs(mouse.distY);
+ if (mouse.dirY !== 0 && mouse.dirY !== mouse.lastDirY) {
+ mouse.distAxY = 0;
+ }
+ }
+ mouse.dirAx = newAx;
+
+ /**
+ * move horizontal
+ */
+ if (mouse.dirAx && mouse.distAxX >= opt.threshold) {
+ // reset move distance on x-axis for new phase
+ mouse.distAxX = 0;
+ prev = this.placeEl.prev(opt.itemNodeName);
+ // increase horizontal level if previous sibling exists and is not collapsed
+ if (mouse.distX > 0 && prev.length && !prev.hasClass(opt.collapsedClass)) {
+ // cannot increase level when item above is collapsed
+ list = prev.find(opt.listNodeName).last();
+ // check if depth limit has reached
+ depth = this.placeEl.parents(opt.listNodeName).length;
+ if (depth + this.dragDepth <= opt.maxDepth) {
+ // create new sub-level if one doesn't exist
+ if (!list.length) {
+ list = $('<' + opt.listNodeName + '/>').addClass(opt.listClass);
+ list.append(this.placeEl);
+ prev.append(list);
+ this.setParent(prev);
+ } else {
+ // else append to next level up
+ list = prev.children(opt.listNodeName).last();
+ list.append(this.placeEl);
+ }
+ }
+ }
+ // decrease horizontal level
+ if (mouse.distX < 0) {
+ // we can't decrease a level if an item preceeds the current one
+ next = this.placeEl.next(opt.itemNodeName);
+ if (!next.length) {
+ parent = this.placeEl.parent();
+ this.placeEl.closest(opt.itemNodeName).after(this.placeEl);
+ if (!parent.children().length) {
+ this.unsetParent(parent.parent());
+ }
+ }
+ }
+ }
+
+ var isEmpty = false;
+
+ // find list item under cursor
+ if (!hasPointerEvents) {
+ this.dragEl[0].style.visibility = 'hidden';
+ }
+ this.pointEl = $(document.elementFromPoint(e.pageX - document.body.scrollLeft, e.pageY - (window.pageYOffset || document.documentElement.scrollTop)));
+ if (!hasPointerEvents) {
+ this.dragEl[0].style.visibility = 'visible';
+ }
+ if (this.pointEl.hasClass(opt.handleClass)) {
+ this.pointEl = this.pointEl.parent(opt.itemNodeName);
+ }
+ if (this.pointEl.hasClass(opt.emptyClass)) {
+ isEmpty = true;
+ }
+ else if (!this.pointEl.length || !this.pointEl.hasClass(opt.itemClass)) {
+ return;
+ }
+
+ // find parent list of item under cursor
+ var pointElRoot = this.pointEl.closest('.' + opt.rootClass),
+ isNewRoot = this.dragRootEl.data('nestable-id') !== pointElRoot.data('nestable-id');
+
+ /**
+ * move vertical
+ */
+ if (!mouse.dirAx || isNewRoot || isEmpty) {
+ // check if groups match if dragging over new root
+ if (isNewRoot && opt.group !== pointElRoot.data('nestable-group')) {
+ return;
+ }
+ // check depth limit
+ depth = this.dragDepth - 1 + this.pointEl.parents(opt.listNodeName).length;
+ if (depth > opt.maxDepth) {
+ return;
+ }
+ var before = e.pageY < (this.pointEl.offset().top + this.pointEl.height() / 2);
+ parent = this.placeEl.parent();
+ // if empty create new list to replace empty placeholder
+ if (isEmpty) {
+ list = $(document.createElement(opt.listNodeName)).addClass(opt.listClass);
+ list.append(this.placeEl);
+ this.pointEl.replaceWith(list);
+ }
+ else if (before) {
+ this.pointEl.before(this.placeEl);
+ }
+ else {
+ this.pointEl.after(this.placeEl);
+ }
+ if (!parent.children().length) {
+ this.unsetParent(parent.parent());
+ }
+ if (!this.dragRootEl.find(opt.itemNodeName).length) {
+ this.dragRootEl.append('<div class="' + opt.emptyClass + '"/>');
+ }
+ // parent root list has changed
+ if (isNewRoot) {
+ this.dragRootEl = pointElRoot;
+ this.hasNewRoot = this.el[0] !== this.dragRootEl[0];
+ }
+ }
+ }
+
+ };
+
+ $.fn.nestable = function(params)
+ {
+ var lists = this,
+ retval = this;
+
+ lists.each(function()
+ {
+ var plugin = $(this).data("nestable");
+
+ if (!plugin) {
+ $(this).data("nestable", new Plugin(this, params));
+ $(this).data("nestable-id", new Date().getTime());
+ } else {
+ if (typeof params === 'string' && typeof plugin[params] === 'function') {
+ retval = plugin[params]();
+ }
+ }
+ });
+
+ return retval || lists;
+ };
+
+})(window.jQuery || window.Zepto, window, document);
Modified: RMC/rmcommon/trunk/rmcommon/index.php
===================================================================
--- RMC/rmcommon/trunk/rmcommon/index.php 2013-06-07 04:30:16 UTC (rev 11636)
+++ RMC/rmcommon/trunk/rmcommon/index.php 2013-06-07 04:35:43 UTC (rev 11637)
@@ -78,7 +78,7 @@
$donateButton = '<form id="paypal-form" name="_xclick" action="https://www.paypal.com/fr/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="oh...@re...">
- <input type="hidden" name="item_name" value="D-Transport">
+ <input type="hidden" name="item_name" value="Common Utilities Support">
<input type="hidden" name="amount" value=0>
<input type="hidden" name="currency_code" value="USD">
<img src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" onclick="$(\'#paypal-form\').submit()" alt="PayPal - The safer, easier way to pay online!" />
Modified: RMC/rmcommon/trunk/rmcommon/menu.php
===================================================================
--- RMC/rmcommon/trunk/rmcommon/menu.php 2013-06-07 04:30:16 UTC (rev 11636)
+++ RMC/rmcommon/trunk/rmcommon/menu.php 2013-06-07 04:35:43 UTC (rev 11637)
@@ -38,8 +38,18 @@
'icon' => 'images/users.png',
'location' => 'users',
'options' => array(
- array('title'=>__('All users','rmcommon'),'link'=>'users.php','selected'=>'allusers'),
- array('title'=>__('New user','rmcommon'),'link'=>'users.php?action=new','selected'=>'newuser'),
+ array(
+ 'title' => __('All users','rmcommon'),
+ 'link' => 'users.php',
+ 'selected' => 'allusers',
+ 'icon' => 'images/users.png',
+ ),
+ array(
+ 'title' => __('New user','rmcommon'),
+ 'link' => 'users.php?action=new',
+ 'selected' => 'newuser',
+ 'icon' => 'images/user_add.png',
+ ),
)
);
@@ -51,19 +61,23 @@
'options' => array(0 => array(
'title' => __('Categories','rmcommon'),
'link' => 'images.php?action=showcats',
- 'selected' => 'rmc_imgcats' // RMSUBLOCATION constant defines wich submenu options is selected
+ 'selected' => 'rmc_imgcats',
+ 'icon' => 'images/category.png',
), 1 => array(
'title' => __('New category','rmcommon'),
'link' => 'images.php?action=newcat',
- 'selected' => 'rmc_imgnewcat' // RMSUBLOCATION constant defines wich submenu options is selected
+ 'selected' => 'rmc_imgnewcat',
+ 'icon' => 'images/category_add.png',
), 2 => array(
'title' => __('Images','rmcommon'),
'link' => 'images.php',
- 'selected' => 'rmc_images' // RMSUBLOCATION constant defines wich submenu options is selected
+ 'selected' => 'rmc_images',
+ 'icon' => 'images/image.png'
), 4 => array(
'title' => __('Add images','rmcommon'),
'link' => 'images.php?action=new',
- 'selected' => 'rmc_newimages' // RMSUBLOCATION constant defines wich submenu options is selected
+ 'selected' => 'rmc_newimages',
+ 'icon' => 'images/image_add.png',
)
)
);
Modified: RMC/rmcommon/trunk/rmcommon/templates/rmc_blocks.php
===================================================================
--- RMC/rmcommon/trunk/rmcommon/templates/rmc_blocks.php 2013-06-07 04:30:16 UTC (rev 11636)
+++ RMC/rmcommon/trunk/rmcommon/templates/rmc_blocks.php 2013-06-07 04:35:43 UTC (rev 11637)
@@ -1,29 +1,6 @@
<h1 class="rmc_titles"><?php _e('Blocks Administration','rmcommon'); ?></h1>
<?php $from = rmc_server_var($_REQUEST,'from', '')=='positions'?true:false; ?>
-<div class="rmc_blocks_options">
- <div id="blocks-modpos"<?php echo $from ? ' style="display: none;"' : ''; ?>>
- <form name="frmModpos" method="get" action="blocks.php">
- <select name="mid" onchange="submit();">
- <option value=""<?php echo $mid==0?' selected="selected"' : ''; ?>><?php _e('All modules','rmcommon'); ?></option>
- <?php foreach($modules as $mod): ?>
- <option value="<?php echo $mod['mid']; ?>"<?php echo $mid==$mod['mid']?' selected="selected"' : ''; ?>><?php echo $mod['name']; ?></option>
- <?php endforeach; ?>
- </select>
- <select name="pos" onchange="submit();">
- <option value="0"<?php echo $pid==0?' selected="selected"':''; ?>><?php _e('All positions','rmcommon'); ?></option>
- <?php foreach($positions as $pos): ?>
- <option value="<?php echo $pos['id']; ?>"<?php echo $pid==$pos['id']?' selected="selected"':''; ?>><?php echo $pos['name']; ?></option>
- <?php endforeach; ?>
- </select>
-
- <select name="visible" onchange="submit();">
- <option value="-1"<?php echo $visible==-1?' selected="selected"':''; ?>><?php _e('All blocks...','rmcommon'); ?></option>
- <option value="0"<?php echo $visible==0?' selected="selected"':''; ?>><?php _e('Hidden blocks...','rmcommon'); ?></option>
- <option value="1"<?php echo $visible==1?' selected="selected"':''; ?>><?php _e('Visible blocks...','rmcommon'); ?></option>
- </select>
- </form>
- </div>
-
+<div class="rmc_blocks_options row-fluid">
<a href="#" id="newban" class="rmc_menus"><?php _e('Add New Block','rmcommon'); ?></a>
<div id="megamenu1" class="megamenu">
<div class="menucont">
@@ -44,11 +21,47 @@
</div>
<a href="#" id="newpos" class="rmc_menus"><?php _e('Show Positions','rmcommon'); ?></a>
</div>
+
<div id="bk-messages" style="display: none;">
<span class="msg-close"></span>
<span class="msg"></span>
</div>
+<!-- Positions Grid -->
+<div class="row-fluid" id="blocks-list">
+ <?php foreach($positions as $pos): ?>
+ <div id="position-<?php echo $pos['id']; ?>" class="dd rmc-position-item <?php echo tpl_cycle("green,blue,gold,orange"); ?>">
+ <h3><?php echo $pos['name']; ?></h3>
+ <?php if(!isset($used_blocks[$pos['id']])): ?>
+ <div class="dd-empty"><?php _e('Drag and drop blocks here','rmcommon'); ?></div>
+ <?php else: ?>
+ <ol class="dd-list">
+ <?php foreach($used_blocks[$pos['id']] as $block): ?>
+ <li class="dd-item" data-id="<?php echo $block['id']; ?>">
+ <div class="row-fluid">
+ <strong class="dd-handle"><?php echo $block['title']; ?></strong>
+ <a href="#" class="pull-right text-error" data-block="<?php echo $block['id']; ?>" title="<?php _e('Delete Block','rmcommon'); ?>"><i class="icon-remove-sign"></i></a>
+ <?php if($block['visible']): ?>
+ <a href="#" class="pull-right text-warning" data-block="<?php echo $block['id']; ?>" title="<?php _e('Hide block','rmcommon'); ?>"><i class="icon-eye-close"></i></a>
+ <?php else: ?>
+ <a href="#" class="pull-right text-success" data-block="<?php echo $block['id']; ?>" title="<?php _e('Show block','rmcommon'); ?>"><i class="icon-eye-open"></i></a>
+ <?php endif; ?>
+ <a href="#" class="pull-right" data-block="<?php echo $block['id']; ?>" title="<?php _e('Block Settings','rmcommon'); ?>"><i class="icon-wrench"></i></a>
+ </div>
+ <div class="row-fluid block-data">
+ <span class="text-info"><?php echo $block['module']['name']; ?></span>
+ <p><?php echo $block['description']; ?></p>
+ </div>
+ </li>
+ <?php endforeach; ?>
+ </ol>
+ <?php endif; ?>
+
+ </div>
+ <?php endforeach; ?>
+</div>
+<!--// End positions grid -->
+
<div id="bks-and-pos">
<div id="form-pos" class="bkbk_forms"<?php echo $from ? ' style="display: block;"' : ''; ?>>
<div class="formposcontainer">
@@ -74,82 +87,6 @@
</div>
</div>
-<div style="overflow: hidden;<?php echo $from ? ' display: none;' : ''; ?>" id="blocks-list">
- <form name="frmblocks" id="frm-blocks" method="post" action="blocks.php">
-
- <div class="rmc_bulkactions">
- <select name="action" id="bulk-top">
- <option value=""><?php _e('Bulk actions...','rmcommon'); ?></option>
- <option value="visible"><?php _e('Visible','rmcommon'); ?></option>
- <option value="hidden"><?php _e('Hidden','rmcommon'); ?></option>
- <option value="delete"><?php _e('Delete','rmcommon'); ?></option>
- </select>
- <input type="button" id="the-op-top" value="<?php _e('Apply','bxpress'); ?>" onclick="before_submit('frm-blocks');" />
-
- <?php if($the_position!=''): ?><a href="#" class="sort_blocks"><?php _e('Sort Blocks','rmcommon'); ?></a><?php endif; ?>
- </div>
-
-<div id="table-blocks-container">
- <table class="outer" border="0" id="table-blocks">
- <thead>
- <tr>
- <th width="30"><input type="checkbox" id="checkall" onclick="$('#frm-blocks').toggleCheckboxes(':not(#checkall)');" /></th>
- <th align="left"><?php _e('Block','rmcommon'); ?></th>
- <th width="100"><?php _e('Module','rmcommon'); ?></th>
- <th align="center"><?php _e('Position','rmcommon'); ?></th>
- <th align="center"><?php _e('Active','rmcommon'); ?></th>
- <th align="center" width="20"><?php _e('Order','rmcommon'); ?></th>
- </tr>
- </thead>
- <tfoot>
- <tr>
- <th width="30"><input type="checkbox" id="checkallb" onclick="$('#frm-blocks').toggleCheckboxes(':not(#checkallb)');" /></th>
- <th align="left"><?php _e('Block','rmcommon'); ?></th>
- <th><?php _e('Module','rmcommon'); ?></th>
- <th align="center"><?php _e('Position','rmcommon'); ?></th>
- <th align="center"><?php _e('Active','rmcommon'); ?></th>
- <th align="center" width="20"><?php _e('Order','rmcommon'); ?></th>
- </tr>
- </tfoot>
- <tbody>
- <?php if(empty($used_blocks)): ?>
- <tr class="even" align="center" id="tr-empty">
- <td colspan="5"><?php _e('There are not blocks configured with these options.','rmcommon'); ?></td>
- </tr>
- <?php endif; ?>
- <?php foreach($used_blocks as $block): ?>
- <tr valign="top" class="<?php echo tpl_cycle("even,odd"); ?>" id="tr-<?php echo $block['id']; ?>">
- <td align="center"><input type="checkbox" name="ids[]" id="item-<?php echo $block['id']; ?>" value="<?php echo $block['id']; ?>" /></td>
- <td>
- <strong><?php echo $block['title']; ?></strong>
- <span class="description"><?php echo $block['description']; ?></span>
- <span class="rmc_options">
- <a class="bk_edit" href="#" id="edit-<?php echo $block['id']; ?>"><?php _e('Settings','rmcommon'); ?></a> |
- <a href="#" onclick="select_option(<?php echo $block['id']; ?>,'delete','frm-blocks');"><?php _e('Delete','rmcommon'); ?></a>
- </span>
- </td>
- <td align="center"><?php echo $block['module']['name']; ?></td>
- <td align="center"><?php echo $block['canvas']['name']; ?></td>
- <td align="center"><img src="images/<?php echo $block['visible']?'done.png':'closeb.png'; ?>" alt="" /></td>
- <td align="center"><?php echo $block['weight']; ?></td>
- </tr>
- <?php endforeach; ?>
- </tbody>
- </table>
-</div>
- <div class="rmc_bulkactions">
- <select name="actionb" id="bulk-bottom">
- <option value=""><?php _e('Bulk actions...','rmcommon'); ?></option>
- <option value="visible"><?php _e('Visible','rmcommon'); ?></option>
- <option value="hidden"><?php _e('Hidden','rmcommon'); ?></option>
- <option value="delete"><?php _e('Delete','rmcommon'); ?></option>
- </select>
- <input type="button" id="the-op-bottom" value="<?php _e('Apply','bxpress'); ?>" onclick="before_submit('frm-blocks');" />
- </div>
- <?php echo $xoopsSecurity->getTokenHTML(); ?>
- </form>
-</div>
-
<!-- Positions -->
<div id="blocks-positions" style="overflow: hidden;<?php echo $from ? ' display: block;' : 'display: none;'; ?>">
<form name="formPos" id="frm-positions" method="post" action="blocks.php">
@@ -218,26 +155,19 @@
</div>
<!--/ Positions -->
-<!-- Sort -->
-<?php if($the_position!=0): ?>
-<div id="bk-sorts">
- <a href="#" class="save-order"><?php _e('Save Order','rmcommon'); ?></a>
- <span class="bk_waiting"><img src="images/wait.gif" alt="" /> <?php _e('Saving...','rmcommon'); ?></span>
- <a href="#" class="cancel-order"><?php _e('Cancel','rmcommon'); ?></a>
- <ol class="bk-sort">
- <?php foreach($used_blocks as $block): ?>
- <li id="item_<?php echo $block['id']; ?>"><div><?php echo $block['title']; ?></div></li>
- <?php endforeach; ?>
- </ol>
- <a href="#" class="save-order"><?php _e('Save Order','rmcommon'); ?></a>
- <span class="bk_waiting"><img src="images/wait.gif" alt="" /> <?php _e('Saving...','rmcommon'); ?></span>
- <a href="#" class="cancel-order"><?php _e('Cancel','rmcommon'); ?></a>
-</div>
-<?php endif; ?>
-<!--// Sort -->
-
<div id="blocker"></div>
<div id="loading"><img src="images/loadinga.gif" width="16" height="16" alt="<?php _e('Loading','rmcomon'); ?>" /><?php _e('Loading data...','rmcommon'); ?></div>
<div id="form-window">
</div>
+
+<script type="text/javascript">
+ $(document).ready(function(){
+ <?php foreach($positions as $pos): ?>
+ $("#position-<?php echo $pos['id']; ?>").nestable({
+ group: 1,
+ maxDepth: 1
+ });
+ <?php endforeach; ?>
+ });
+</script>
Modified: RMC/rmcommon/trunk/rmcommon/templates/rmc_comments.php
===================================================================
--- RMC/rmcommon/trunk/rmcommon/templates/rmc_comments.php 2013-06-07 04:30:16 UTC (rev 11636)
+++ RMC/rmcommon/trunk/rmcommon/templates/rmc_comments.php 2013-06-07 04:35:43 UTC (rev 11637)
@@ -58,7 +58,7 @@
<tbody>
<?php if(count($comments)<=0): ?>
<tr class="head">
- <td colspan="5" align="center"><?php _e('There are not comments yet!','rmcommon'); ?></td>
+ <td colspan="6" align="center"><span class="text-error"><?php _e('There are not comments yet!','rmcommon'); ?></span></td>
</tr>
<?php else: ?>
<?php foreach ($comments as $com): ?>
Modified: RMC/rmcommon/trunk/rmcommon/templates/rmc_dashboard.php
===================================================================
--- RMC/rmcommon/trunk/rmcommon/templates/rmc_dashboard.php 2013-06-07 04:30:16 UTC (rev 11636)
+++ RMC/rmcommon/trunk/rmcommon/templates/rmc_dashboard.php 2013-06-07 04:35:43 UTC (rev 11637)
@@ -35,7 +35,7 @@
</div>
<?php endforeach; ?>
<span class="description">
- <?php _e('If you wish to manage or install new modules please go to Modules Management.','rmcommon'); ?><br />
+ <?php _e('If you want to manage or install new modules please go to Modules Management.','rmcommon'); ?><br />
<a href="<?php echo XOOPS_URL; ?>/modules/system/admin.php?fct=modulesadmin"><?php _e('Modules management', 'rmcommon'); ?></a>
</span>
</div>
Modified: RMC/rmcommon/trunk/rmcommon/themes/twop6/class/twop6functions.class.php
===================================================================
--- RMC/rmcommon/trunk/rmcommon/themes/twop6/class/twop6functions.class.php 2013-06-07 04:30:16 UTC (rev 11636)
+++ RMC/rmcommon/trunk/rmcommon/themes/twop6/class/twop6functions.class.php 2013-06-07 04:35:43 UTC (rev 11637)
@@ -55,7 +55,7 @@
}
if($mod->hasconfig()){
- $rmTpl->add_menu(__('Settings','rmcommon'), XOOPS_URL.'/modules/system/admin.php?fct=preferences&op=showmod&mod='.$mod->mid(), 'option','');
+ $rmTpl->add_menu(__('Preferences','rmcommon'), XOOPS_URL.'/modules/system/admin.php?fct=preferences&op=showmod&mod='.$mod->mid(), 'option','');
}
}
@@ -84,6 +84,7 @@
if(!$xoopsUser->isAdmin($mod->mid())) return false;
$amenu = $mod->getAdminMenu();
+
$amenu = RMEvents::get()->run_event($mod->dirname().'.module.menu', $amenu);
if(empty($amenu)) return false;
@@ -95,13 +96,13 @@
'link' => strpos($menu['link'], 'http://')!==FALSE && strpos($menu['link'], 'ftp://')!==FALSE ? $menu['link'] : XOOPS_URL.'/modules/'.$mod->getVar('dirname','n').'/'.$menu['link'],
'icon' => isset($menu['icon']) ? (strpos($menu['icon'], 'http://')!==FALSE ? $menu['icon'] : XOOPS_URL.'/modules/'.$mod->dirname().'/'.$menu['icon']) : '',
'location' => isset($menu['location']) ? $menu['location'] : '',
- 'options' => isset($menu['options']) ? self::moduleSubmenu($menu['options'], $mod) : null
+ 'options' => isset($menu['options']) ? self::moduleSubmenu($menu['options'], $mod) : ($m=='system' && $menu['title']==_AM_SYSTEM_PREF ? self::systemPreferences() : null)
);
}
if($mod->hasconfig()){
$return_menu[] = array(
- 'title' => __('Settings','rmcommon'),
+ 'title' => __('Preferences','rmcommon'),
'link' => XOOPS_URL.'/modules/system/admin.php?fct=preferences&op=showmod&mod='.$mod->mid(),
'icon' => '',
'type' => 1
@@ -116,19 +117,88 @@
* Prepare menu options
*/
public function moduleSubmenu($submenu, $mod){
-
+
if(!is_array($submenu)) return array();
-
+
foreach($submenu as $i => $menu){
+ if($menu=='divider') continue;
$submenu[$i]['link'] = strpos($menu['link'], 'http://')!==FALSE && strpos($menu['link'], 'ftp://')!==FALSE ? $menu['link'] : XOOPS_URL.'/modules/'.$mod->getVar('dirname','n').'/'.$menu['link'];
}
return $submenu;
}
-
-
+
/**
+ * Preferences menu for System module
+ * @return array
+ */
+ public function systemPreferences(){
+
+ include_once XOOPS_ROOT_PATH.'/modules/system/include/functions.php';
+ $confcat_handler = xoops_gethandler('configcategory');
+ $confcats = $confcat_handler->getObjects();
+ $image = system_adminVersion('preferences', 'configcat');
+
+ $options = array();
+
+ foreach ( array_keys($confcats) as $i ) {
+ $options[] = array(
+ 'title' => self::getPreferenceData(system_AdminIcons( 'xoops/' . $image[$i]), 'title'),
+ 'link' => 'admin.php?fct=preferences&op=show&confcat_id='.$confcats[$i]->getVar('confcat_id'),
+ 'icon' => self::getPreferenceData(system_AdminIcons( 'xoops/' . $image[$i]), 'icon'),
+ );
+ }
+
+ return $options;
+
+ }
+
+ /**
+ * Get the icon for preferences categories
+ * @param string Original image path
+ * @param string Data type to return
+ * @return string with required data
+ */
+ public function getPreferenceData($image, $data){
+
+ $id = preg_replace("/^.*\/system_(.*)\.png$/i","$1",$image);
+
+ $replacements_icons = array(
+ 'main' => 'icon-cogs',
+ 'user' => 'icon-user',
+ 'meta' => 'icon-info-sign',
+ 'word' => 'icon-filter',
+ 'search' => 'icon-search',
+ 'mail' => 'icon-envelope',
+ 'auth' => 'icon-key',
+ 'mods' => 'icon-cog',
+ );
+
+ $replacements_titles = array(
+ 'main' => __('General Settings','twop6'),
+ 'user' => __('User Info Settings','twop6'),
+ 'meta' => __('Meta Tags and Footer','twop6'),
+ 'word' => __('Word Censoring','twop6'),
+ 'search' => __('Search Options','twop6'),
+ 'mail' => __('Email Setup','twop6'),
+ 'auth' => __('Authentication Options','twop6'),
+ 'mods' => __('System Module Settings','twop6'),
+ );
+
+ switch($data){
+ case 'icon':
+ $icon = isset($replacements_icons[$id]) ? '<i class="'.$replacements_icons[$id].'"></i>' : '';;
+ return $icon;
+
+ case 'title':
+ $title = isset($replacements_titles[$id]) ? $replacements_titles[$id] : '';
+ return $title;
+ }
+
+ }
+
+ /**
* Get the module icon
*/
public function moduleIcon($module, $size = '16'){
Deleted: RMC/rmcommon/trunk/rmcommon/themes/twop6/css/rmcommon/imgmgr.css
===================================================================
--- RMC/rmcommon/trunk/rmcommon/themes/twop6/css/rmcommon/imgmgr.css 2013-06-07 04:30:16 UTC (rev 11636)
+++ RMC/rmcommon/trunk/rmcommon/themes/twop6/css/rmcommon/imgmgr.css 2013-06-07 04:35:43 UTC (rev 11637)
@@ -1,124 +0,0 @@
-a.delsize{
- float: right;
- font-weight: normal;
- background: url(../images/delete.png) no-repeat left;
- padding: 3px 3px 3px 19px;
-}
-td#sizes-container-all{
- overflow: hidden;
-}
-td#sizes-container-all table.outer{
- width: 435px;
- float: left;
-}
-td#sizes-container-all table{
- margin: 5px;
-}
-td#sizes-container-all div.new_container{
- clear: both;
- margin-top: 10px;
- text-align: center;
-}
-td.sizes_data{
- font-size: 0.9em;
- color: #666;
-}
-td.sizes_data em{
- font-style: normal;
- color: #800000;
-}
-
-/** IMAGES **/
-div.select_image_cat{
- padding: 4px;
- border: 1px solid #CCC;
- margin: 0 auto;
- background: #ebebeb;
- font-weight: bold;
- text-align: center;
- margin-bottom: 10px;
-}
-#upload-errors{
- padding: 10px;
- margin: 10px 0;
- float: right;
- width: 300px;
-}
-#upload-errors span.failed{
- background: url(../images/error.png) no-repeat left;
- padding: 5px 0 5px 19px;
- color: #f00;
- margin: 2px 0;
- display: block;
-}
-#upload-errors span.done{
- background: url(../images/done.png) no-repeat left;
- padding: 5px 0 5px 19px;
- margin: 2px 0;
- display: block;
-}
-#resizer-bar{
- text-align: center;
- font-size: 0.9em;
- color: #666;
- display: none;
-}
-#resizer-bar span.message{
- display: block;
- float: left;
- color: #008000;
-}
-#resizer-bar span.message span{
- color: #F00;
-}
-#resizer-bar .thebar{
- background: #999;
- height: 16px;
- border: 1px inset #666;
- margin: 5px;
- clear: both;
-}
-#resizer-bar .thebar .indicator{
- background: #ff4400;
- color: #FFF;
- font-weight: bold;
- height: 16px;
- width: 0;
- text-align: right;
- position: relative;
-}
-div.donebutton{
- display: none;
- margin: 10px 0;
-}
-div#gen-thumbnails img{
- width: 90px;
- height: 70px;
- margin: 4px;
- padding: 1px;
- border: 1px solid #666;
-}
-.even .description, .odd .description{
- font-size: 0.9em;
- display: block;
- padding: 2px 0;
- font-style: italic;
- color: #666;
-}
-.rmc_pages_navigation_container{
- float: right;
-}
-#image-loader{
- display: none;
- position: absolute;
- padding: 10px;
- background: #fff;
- top: 50%;
- left: 50%;
- -moz-box-shadow: 0 0 20px #000;
- -webkit-box-shadow: 0 0 20px #000;
- box-shadow: 0 0 20px #000;
-}
-#upload-controls input{
- float: none;
-}
\ No newline at end of file
Modified: RMC/rmcommon/trunk/rmcommon/themes/twop6/theme.php
===================================================================
--- RMC/rmcommon/trunk/rmcommon/themes/twop6/theme.php 2013-06-07 04:30:16 UTC (rev 11636)
+++ RMC/rmcommon/trunk/rmcommon/themes/twop6/theme.php 2013-06-07 04:35:43 UTC (rev 11637)
@@ -52,7 +52,12 @@
<?php if(isset($menu['options'])): ?>
<ul class="dropdown-menu">
<?php foreach($menu['options'] as $sub): ?>
- <li><a href="<?php echo $sub['link']; ?>"><?php echo $sub['title']; ?></a></li>
+ <li>
+ <a href="<?php echo $sub['link']; ?>">
+ <?php echo $xoFunc->submenuIcon($sub, 'rmcommon'); ?>
+ <?php echo $sub['title']; ?>
+ </a>
+ </li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
@@ -79,7 +84,12 @@
<?php if(isset($menu['options'])): ?>
<ul class="dropdown-menu">
<?php foreach($menu['options'] as $sub): ?>
- <li><a href="<?php echo $sub['link']; ?>"><?php echo $sub['title']; ?></a></li>
+ <li>
+ <a href="<?php echo $sub['link']; ?>">
+ <?php echo $sub['icon']; ?>
+ <?php echo $sub['title']; ?>
+ </a>
+ </li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
@@ -146,12 +156,16 @@
<?php if(isset($sub['options'])): ?>
<ul class="dropdown-menu">
<?php foreach($sub['options'] as $subsub): ?>
- <li>
- <a href="<?php echo $subsub['link']; ?>">
- <?php echo $xoFunc->submenuIcon($subsub, $mod['dirname']); ?>
- <?php echo $subsub['title']; ?>
- </a>
- </li>
+ <?php if($subsub=='divider'): ?>
+ <li class="divider"></li>
+ <?php else: ?>
+ <li>
+ <a href="<?php echo $subsub['link']; ?>">
+ <?php echo $xoFunc->submenuIcon($subsub, $mod['dirname']); ?>
+ <?php echo $subsub['title']; ?>
+ </a>
+ </li>
+ <?php endif; ?>
<?php endforeach; ?>
</ul>
<?php endif; ?>
@@ -279,19 +293,23 @@
<?php if(isset($menu['options']) && $menu['options']): ?>
<ul class="dropdown-menu">
<?php foreach($menu['options'] as $sub): ?>
- <li<?php if(isset($sub['options']) && $sub['options']): ?> class="dropdown-submenu"<?php endif; ?>>
- <a href="<?php echo strpos($sub['link'], 'http://')===FALSE ? XOOPS_URL.'/m...
[truncated message content] |