";
foreach($this->iconlist as $key => $val)
@@ -116,10 +132,12 @@ class adminstyle_flexpanel extends adminstyle_infopanel
// Rendering the saved configuration.
$tp->parseTemplate("{SETSTYLE=flexpanel}");
-
+
$caption = $tp->lanVars(LAN_CONTROL_PANEL, ucwords(USERNAME));
- $coreInfoPanelMyE107 = $ns->tablerender($caption, $mainPanel, "core-my-e107", true);
- $panels['Area07'] .= $coreInfoPanelMyE107;
+ $ns->setUniqueId('core-infopanel_mye107');
+ $coreInfoPanelMyE107 = $ns->tablerender($caption, $mainPanel, "core-infopanel_mye107", true);
+ $info = $this->getMenuPosition('core-infopanel_mye107');
+ $panels[$info['area']][$info['weight']] .= $coreInfoPanelMyE107;
// --------------------- e107 News --------------------------------
@@ -127,14 +145,17 @@ class adminstyle_flexpanel extends adminstyle_infopanel
$newsTabs['coreFeed'] = array('caption' => LAN_GENERAL, 'text' => "
");
$newsTabs['pluginFeed'] = array('caption' => LAN_PLUGIN, 'text' => "
");
$newsTabs['themeFeed'] = array('caption' => LAN_THEMES, 'text' => "
");
-
- $coreInfoPanelNews = $ns->tablerender(LAN_LATEST_e107_NEWS, e107::getForm()->tabs($newsTabs, array('active' => 'coreFeed')), "core-e107-news", true);
- $panels['Area08'] .= $coreInfoPanelNews;
+ $ns->setUniqueId('core-infopanel_news');
+ $coreInfoPanelNews = $ns->tablerender(LAN_LATEST_e107_NEWS, e107::getForm()->tabs($newsTabs, array('active' => 'coreFeed')), "core-infopanel_news", true);
+ $info = $this->getMenuPosition('core-infopanel_news');
+ $panels[$info['area']][$info['weight']] .= $coreInfoPanelNews;
// --------------------- Website Status ---------------------------
- $coreInfoPanelWebsiteStatus = $ns->tablerender(LAN_WEBSITE_STATUS, $this->renderWebsiteStatus(), "core-website-status", true);
- $panels['Area08'] .= $coreInfoPanelWebsiteStatus;
+ $ns->setUniqueId('core-infopanel_website_status');
+ $coreInfoPanelWebsiteStatus = $ns->tablerender(LAN_WEBSITE_STATUS, $this->renderWebsiteStatus(), "core-infopanel_website_status", true);
+ $info = $this->getMenuPosition('core-infopanel_website_status');
+ $panels[$info['area']][$info['weight']] .= $coreInfoPanelWebsiteStatus;
// --------------------- Latest Comments --------------------------
@@ -149,22 +170,40 @@ class adminstyle_flexpanel extends adminstyle_infopanel
// Custom menu.
if(is_numeric($val))
{
+ $menu = e107::getDb()->retrieve('page', 'menu_name', 'page_id = ' . (int) $val);
+ $id = 'cmenu-' . $menu;
$inc = e107::getMenu()->renderMenu($val, null, null, true);
}
else
{
+ $id = $frm->name2id($val);
$inc = $tp->parseTemplate("{PLUGIN=$val|TRUE}");
}
- $panels['Area01'] .= $inc;
+ $info = $this->getMenuPosition($id);
+ $panels[$info['area']][$info['weight']] .= $inc;
}
}
+ ksort($panels['menu-area-01']);
+ ksort($panels['menu-area-02']);
+ ksort($panels['menu-area-03']);
+ ksort($panels['menu-area-04']);
+ ksort($panels['menu-area-05']);
+ ksort($panels['menu-area-06']);
+ ksort($panels['menu-area-07']);
+ ksort($panels['menu-area-08']);
+ ksort($panels['menu-area-09']);
+ ksort($panels['menu-area-10']);
+ ksort($panels['menu-area-11']);
+ ksort($panels['menu-area-12']);
+ ksort($panels['menu-area-13']);
+
// Sidebar.
echo '
';
echo '
';
echo '';
echo '
';
echo '
';
@@ -182,7 +221,7 @@ class adminstyle_flexpanel extends adminstyle_infopanel
echo '
';
echo '
';
echo '';
echo '
';
echo '
';
@@ -191,17 +230,17 @@ class adminstyle_flexpanel extends adminstyle_infopanel
echo '
';
echo '
';
echo '';
echo '
';
echo '
';
echo '';
echo '
';
echo '
';
echo '';
echo '
';
echo '
';
@@ -210,7 +249,7 @@ class adminstyle_flexpanel extends adminstyle_infopanel
echo '
';
echo '
';
echo '';
echo '
';
echo '
';
@@ -219,12 +258,12 @@ class adminstyle_flexpanel extends adminstyle_infopanel
echo '
';
echo '
';
echo '';
echo '
';
echo '
';
echo '';
echo '
';
echo '
';
@@ -233,7 +272,7 @@ class adminstyle_flexpanel extends adminstyle_infopanel
echo '
';
echo '
';
echo '';
echo '
';
echo '
';
@@ -242,17 +281,17 @@ class adminstyle_flexpanel extends adminstyle_infopanel
echo '
';
echo '
';
echo '';
echo '
';
echo '
';
echo '';
echo '
';
echo '
';
echo '';
echo '
';
echo '
';
@@ -261,7 +300,7 @@ class adminstyle_flexpanel extends adminstyle_infopanel
echo '
';
echo '
';
echo '';
echo '
';
echo '
';
@@ -277,4 +316,58 @@ class adminstyle_flexpanel extends adminstyle_infopanel
echo '
';
}
+
+ function getMenuPosition($id)
+ {
+ global $user_pref;
+
+ if(varset($user_pref['core-flexpanel-order'][$id]))
+ {
+ return $user_pref['core-flexpanel-order'][$id];
+ }
+
+ $default = array(
+ 'area' => 'menu-area-01',
+ 'weight' => 1000,
+ );
+
+ if($id == 'core-infopanel_help')
+ {
+ $default['area'] = 'menu-area-01';
+ $default['weight'] = 0;
+ }
+
+ if($id == 'e-latest-list')
+ {
+ $default['area'] = 'menu-area-01';
+ $default['weight'] = 1;
+ }
+
+ if($id == 'e-status-list')
+ {
+ $default['area'] = 'menu-area-01';
+ $default['weight'] = 2;
+ }
+
+ if($id == 'core-infopanel_mye107')
+ {
+ $default['area'] = 'menu-area-07';
+ $default['weight'] = 0;
+ }
+
+ if($id == 'core-infopanel_news')
+ {
+ $default['area'] = 'menu-area-08';
+ $default['weight'] = 0;
+ }
+
+ if($id == 'core-infopanel_website_status')
+ {
+ $default['area'] = 'menu-area-08';
+ $default['weight'] = 1;
+ }
+
+ return $default;
+ }
+
}
diff --git a/e107_handlers/menu_class.php b/e107_handlers/menu_class.php
index 59405a8a5..b0fadeb0a 100644
--- a/e107_handlers/menu_class.php
+++ b/e107_handlers/menu_class.php
@@ -542,8 +542,12 @@ class e_menu
//{
// $mpath .= '/';
//}
-
+
$mpath = trim($mpath, '/').'/'; // faster...
+
+ $id = e107::getForm()->name2id($mpath . $mname);
+ $ns->setUniqueId($id);
+
$e107_debug ? include(e_PLUGIN.$mpath.$mname.'.php') : @include(e_PLUGIN.$mpath.$mname.'.php');
}
e107::getDB()->db_Mark_Time("(After ".$mname.")");
diff --git a/e107_themes/bootstrap3/admin_theme.php b/e107_themes/bootstrap3/admin_theme.php
index e8a97f818..e370ba7f9 100644
--- a/e107_themes/bootstrap3/admin_theme.php
+++ b/e107_themes/bootstrap3/admin_theme.php
@@ -164,7 +164,7 @@ class bootstrap3_admintheme
switch(varset($style, 'admin_content'))
{
case 'flexpanel':
- echo '
+ echo '
' . $caption . '
diff --git a/e107_web/js/core/admin.flexpanel.js b/e107_web/js/core/admin.flexpanel.js
index 849a47350..2573589ff 100644
--- a/e107_web/js/core/admin.flexpanel.js
+++ b/e107_web/js/core/admin.flexpanel.js
@@ -69,28 +69,32 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
e107.callbacks.flexPanelSavePanelOrder = function ()
{
var selector = e107.settings.flexPanel.selector;
- var NewOrder = [];
+ var NewOrder = {};
$(selector).each(function ()
{
var $this = $(this);
- var key = $this.attr('id');
+ var area = $this.attr('id');
+ var weight = 0;
- if(key)
+ if(area)
{
- NewOrder[key] = [];
-
- $('#' + key + ' ' + e107.settings.flexPanel.items).each(function ()
+ $('#' + area + ' ' + e107.settings.flexPanel.items).each(function ()
{
var $item = $(this);
- var title = $item.find('.panel-title').eq(0).text();
+ var panelID = $item.attr('id');
- NewOrder[key].push(title);
+ NewOrder[panelID] = {
+ area: area,
+ weight: weight
+ };
+
+ weight++;
});
}
});
-
- console.log(NewOrder);
+
+ $.post(window.location.href, {'core-flexpanel-order': NewOrder});
};
})(jQuery);