1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-29 10:38:08 +01:00

Revert changes by infopanel, and introduce flexpanel, which extends infopanel funcionality.

This commit is contained in:
lonalore 2016-11-07 14:12:19 +01:00
parent 6d96cdbeab
commit 3a3734ef86
9 changed files with 504 additions and 219 deletions

View File

@ -31,18 +31,19 @@ if (varset($pref['adminstyle'])=='cascade' || varset($pref['adminstyle'])=='begi
$pref['adminstyle'] = 'infopanel';
}
if(strpos($pref['adminstyle'], 'infopanel') === 0)
if(in_array($pref['adminstyle'], array('infopanel', 'flexpanel')))
{
// Define constant for using custom template on the dashboard.
define('e_DASHBOARD', true);
require_once(e_ADMIN . 'includes/' . $pref['adminstyle'] . '.php');
require_once(e_ADMIN.'includes/'.$pref['adminstyle'].'.php');
$_class = 'adminstyle_'.$pref['adminstyle'];
$_class = 'adminstyle_' . $pref['adminstyle'];
if(class_exists($_class, false))
{
$adp = new $_class;
$adp = new $_class;
}
else
{
$adp = new adminstyle_infopanel;
}
else $adp = new adminstyle_infopanel;
}
@ -399,7 +400,7 @@ function render_clean() // still used by classis, tabbed etc.
if(is_object($adp))
{
$adp->render();
$adp->render();
}
else
{

View File

@ -19,7 +19,7 @@ if (!defined('e107_INIT'))
}
$In_e107_Footer = TRUE; // For registered shutdown function
global $error_handler,$db_time,$ADMIN_FOOTER,$ADMIN_FOOTER_DASHBOARD;
global $error_handler,$db_time,$ADMIN_FOOTER;
// Legacy fix - call header if not already done, mainly fixing left side menus to work proper
if(!deftrue('e_ADMIN_UI') && !deftrue('ADMIN_AREA'))
@ -98,15 +98,7 @@ if (varset($e107_popup) != 1)
//NEW - Iframe mod
if (!deftrue('e_IFRAME'))
{
// Dashboard uses its own template.
if (deftrue('e_DASHBOARD', false) === true)
{
parse_admin($ADMIN_FOOTER_DASHBOARD);
}
else
{
parse_admin($ADMIN_FOOTER);
}
parse_admin($ADMIN_FOOTER);
}
$eTimingStop = microtime();

View File

@ -295,15 +295,17 @@ echo "\n<!-- footer_other_css -->\n";
$e_js->renderJs('core_css', false, 'css', false);
echo "\n<!-- footer_core_css -->\n";
// Plugin CSS
$e_js->renderJs('plugin_css', false, 'css', false);
echo "\n<!-- footer_plugin_css -->\n";
// Theme CSS
//echo "<!-- Theme css -->\n";
$e_js->renderJs('theme_css', false, 'css', false);
echo "\n<!-- footer_theme_css -->\n";
// Plugin CSS
$e_js->renderJs('plugin_css', false, 'css', false);
echo "\n<!-- footer_plugin_css -->\n";
// Inline CSS - not sure if this should stay at all!
$e_js->renderJs('inline_css', false, 'css', false);
echo "\n<!-- footer_inline_css -->\n";
@ -589,10 +591,10 @@ if ($e107_popup != 1)
{
//removed check strpos(e_SELF.'?'.e_QUERY, 'menus.php?configure') === FALSE
// Dashboard uses its own template.
if (deftrue('e_DASHBOARD', false) === true)
// "flexpanel" style uses its own template!!!
if(defset('e_PAGE') == 'admin.php' && varset($pref['adminstyle']) == 'flexpanel')
{
parse_admin($ADMIN_HEADER_DASHBOARD);
parse_admin($ADMIN_HEADER_FLEXPANEL);
}
else
{

View File

@ -0,0 +1,262 @@
<?php
/**
* @file
*
*/
if(!defined('e107_INIT'))
{
exit;
}
// Flexpanel uses infopanel's methods to avoid code duplication.
e107_require_once(e_ADMIN . 'includes/infopanel.php');
/**
* Class adminstyle_flexpanel.
*/
class adminstyle_flexpanel extends adminstyle_infopanel
{
private $iconlist = array();
/**
* Constructor.
*/
public function __construct()
{
parent::__construct();
$this->iconlist = $this->getIconList();
e107::js('core', 'core/admin.flexpanel.js', 'jquery', 4);
}
/**
* Render contents.
*/
public function render()
{
$admin_sc = e107::getScBatch('admin');
$tp = e107::getParser();
$ns = e107::getRender();
$mes = e107::getMessage();
$pref = e107::getPref();
$frm = e107::getForm();
global $user_pref;
$panels = array(
'Area01' => '', // Sidebar.
'Area02' => '',
'Area03' => '',
'Area04' => '',
'Area05' => '',
'Area06' => '',
'Area07' => '', // Content left.
'Area08' => '', // Content right.
'Area09' => '',
'Area10' => '',
'Area11' => '',
'Area12' => '',
'Area13' => '',
);
// "Help" box.
$panels['Area01'] .= $tp->parseTemplate('{SETSTYLE=site_info}{ADMIN_HELP}', true, $admin_sc);
// "Latest" box.
$panels['Area01'] .= $tp->parseTemplate('{SETSTYLE=admin_menu}{ADMIN_LATEST=infopanel}', true, $admin_sc);
// "Status" box.
$panels['Area01'] .= $tp->parseTemplate('{SETSTYLE=admin_menu}{ADMIN_STATUS=infopanel}', true, $admin_sc);
// --------------------- Personalized Panel -----------------------
if(getperms('0') && !vartrue($user_pref['core-infopanel-mye107'])) // Set default icons.
{
$defArray = array(
0 => 'e-administrator',
1 => 'e-cpage',
2 => 'e-frontpage',
3 => 'e-mailout',
4 => 'e-image',
5 => 'e-menus',
6 => 'e-meta',
7 => 'e-newspost',
8 => 'e-plugin',
9 => 'e-prefs',
10 => 'e-links',
11 => 'e-theme',
12 => 'e-userclass2',
13 => 'e-users',
14 => 'e-wmessage'
);
$user_pref['core-infopanel-mye107'] = vartrue($pref['core-infopanel-default'], $defArray);
}
$tp->parseTemplate("{SETSTYLE=core-infopanel}");
$mainPanel = "<div id='core-infopanel_mye107'>";
$mainPanel .= "<div class='left'>";
foreach($this->iconlist as $key => $val)
{
if(!vartrue($user_pref['core-infopanel-mye107']) || in_array($key, $user_pref['core-infopanel-mye107']))
{
$mainPanel .= e107::getNav()->renderAdminButton($val['link'], $val['title'], $val['caption'], $val['perms'], $val['icon_32'], "div");
}
}
$mainPanel .= "</div></div>";
// Rendering the saved configuration.
$tp->parseTemplate("{SETSTYLE=core-infopanel}");
$caption = $tp->lanVars(LAN_CONTROL_PANEL, ucwords(USERNAME));
$coreInfoPanelMyE107 = $ns->tablerender($caption, $mainPanel, "core-infopanel_mye107", true);
$panels['Area07'] .= $coreInfoPanelMyE107;
// --------------------- e107 News --------------------------------
$newsTabs = array();
$newsTabs['coreFeed'] = array('caption' => LAN_GENERAL, 'text' => "<div id='e-adminfeed' style='min-height:300px'></div><div class='right'><a rel='external' href='" . ADMINFEEDMORE . "'>" . LAN_MORE . "</a></div>");
$newsTabs['pluginFeed'] = array('caption' => LAN_PLUGIN, 'text' => "<div id='e-adminfeed-plugin'></div>");
$newsTabs['themeFeed'] = array('caption' => LAN_THEMES, 'text' => "<div id='e-adminfeed-theme'></div>");
$coreInfoPanelNews = $ns->tablerender(LAN_LATEST_e107_NEWS, e107::getForm()->tabs($newsTabs, array('active' => 'coreFeed')), "core-infopanel_news", true);
$panels['Area08'] .= $coreInfoPanelNews;
// --------------------- Website Status ---------------------------
$coreInfoPanelWebsiteStatus = $ns->tablerender(LAN_WEBSITE_STATUS, $this->renderWebsiteStatus(), "", true);
$panels['Area08'] .= $coreInfoPanelWebsiteStatus;
// --------------------- Latest Comments --------------------------
$panels['Area01'] .= $this->renderLatestComments();
// --------------------- User Selected Menus ----------------------
if(varset($user_pref['core-infopanel-menus']))
{
foreach($user_pref['core-infopanel-menus'] as $val)
{
$inc = $tp->parseTemplate("{PLUGIN=$val|TRUE}");
$panels['Area01'] .= $inc;
}
}
// Sidebar.
echo '<div class="row">';
echo '<div class="col-md-3 col-lg-2" id="left-panel">';
echo '<div class="draggable-panels" id="menu-area-01">';
echo $panels['Area01'];
echo '</div>';
echo '</div>';
echo '<div class="col-md-9 col-lg-10" id="right-panel">';
if(vartrue($_GET['mode']) != 'customize')
{
echo '<div class="row">';
echo '<div class="col-sm-12">';
echo $mes->render();
echo '</div>';
echo '</div>';
echo '<div class="row">';
echo '<div class="col-sm-12">';
echo '<div class="draggable-panels" id="menu-area-02">';
echo $panels['Area02'];
echo '</div>';
echo '</div>';
echo '</div>';
echo '<div class="row">';
echo '<div class="col-sm-4">';
echo '<div class="draggable-panels" id="menu-area-03">';
echo $panels['Area03'];
echo '</div>';
echo '</div>';
echo '<div class="col-sm-4">';
echo '<div class="draggable-panels" id="menu-area-04">';
echo $panels['Area04'];
echo '</div>';
echo '</div>';
echo '<div class="col-sm-4">';
echo '<div class="draggable-panels" id="menu-area-05">';
echo $panels['Area05'];
echo '</div>';
echo '</div>';
echo '</div>';
echo '<div class="row">';
echo '<div class="col-sm-12">';
echo '<div class="draggable-panels" id="menu-area-06">';
echo $panels['Area06'];
echo '</div>';
echo '</div>';
echo '</div>';
echo '<div class="row">';
echo '<div class="col-sm-6">';
echo '<div class="draggable-panels" id="menu-area-07">';
echo $panels['Area07'];
echo '</div>';
echo '</div>';
echo '<div class="col-sm-6">';
echo '<div class="draggable-panels" id="menu-area-08">';
echo $panels['Area08'];
echo '</div>';
echo '</div>';
echo '</div>';
echo '<div class="row">';
echo '<div class="col-sm-12">';
echo '<div class="draggable-panels" id="menu-area-09">';
echo $panels['Area09'];
echo '</div>';
echo '</div>';
echo '</div>';
echo '<div class="row">';
echo '<div class="col-sm-4">';
echo '<div class="draggable-panels" id="menu-area-10">';
echo $panels['Area10'];
echo '</div>';
echo '</div>';
echo '<div class="col-sm-4">';
echo '<div class="draggable-panels" id="menu-area-11">';
echo $panels['Area11'];
echo '</div>';
echo '</div>';
echo '<div class="col-sm-4">';
echo '<div class="draggable-panels" id="menu-area-12">';
echo $panels['Area12'];
echo '</div>';
echo '</div>';
echo '</div>';
echo '<div class="row">';
echo '<div class="col-sm-12">';
echo '<div class="draggable-panels" id="menu-area-13">';
echo $panels['Area13'];
echo '</div>';
echo '</div>';
echo '</div>';
}
else
{
echo $frm->open('infopanel', 'post', e_SELF);
echo $this->render_infopanel_options(true);
echo $frm->close();
}
echo '</div>';
echo '</div>';
}
}

View File

@ -57,12 +57,9 @@ class adminstyle_infopanel
{
$user_pref['core-infopanel-mye107'] = $_POST['e-mye107'];
$user_pref['core-infopanel-menus'] = $_POST['e-mymenus'];
save_prefs('user');
$pref['core-infopanel-menus'] = $_POST['e-mymenus'];
save_prefs();
}
@ -72,6 +69,15 @@ class adminstyle_infopanel
$this->iconlist = e107::getNav()->adminLinks();
}
/**
* Allow to get Icon List.
*/
function getIconList()
{
return $this->iconlist;
}
function render()
@ -82,23 +88,53 @@ class adminstyle_infopanel
$mes = e107::getMessage();
$pref = e107::getPref();
$frm = e107::getForm();
// XXX Check Bootstrap bug is fixed.
/*
echo '
<ul class="thumbnails">
<li class="span4">
<a href="#" class="thumbnail">
<img src="http://placehold.it/360x270" alt="">
</a>
</li>
<li class="span4">
<a href="#" class="thumbnail">
<img src="http://placehold.it/360x270" alt="">
</a>
</li>
<li class="span4">
<a href="#" class="thumbnail">
<img src="http://placehold.it/360x270" alt="">
</a>
</li>
<li class="span4">
<a href="#" class="thumbnail">
<img src="http://placehold.it/360x270" alt="">
</a>
</li>
<li class="span4">
<a href="#" class="thumbnail">
<img src="http://placehold.it/360x270" alt="">
</a>
</li>
<li class="span4">
<a href="#" class="thumbnail">
<img src="http://placehold.it/360x270" alt="">
</a>
</li>
</ul>
$droppableAreaContent1 = '';
$droppableAreaContent2 = '';
$droppableAreaContent3 = '';
$droppableAreaContent4 = '';
$droppableAreaContent5 = '';
$droppableAreaContent6 = '';
$droppableAreaContent7 = '';
$droppableAreaContent8 = '';
$droppableAreaContent9 = '';
$droppableAreaContent10 = '';
// TODO LANs throughout.
';
*/
//TODO LANs throughout.
global $style, $user_pref;
// ---------------------- Start Panel -----------------------------
// ---------------------- Start Panel --------------------------------
// $text = "<div >";
if (getperms('0') && !vartrue($user_pref['core-infopanel-mye107'])) // Set default icons.
{
$defArray = array (
@ -117,136 +153,156 @@ class adminstyle_infopanel
12 => 'e-userclass2',
13 => 'e-users',
14 => 'e-wmessage'
);
);
$user_pref['core-infopanel-mye107'] = vartrue($pref['core-infopanel-default'],$defArray);
}
// "<form method='post' action='".e_SELF."?".e_QUERY."'>";
$tp->parseTemplate("{SETSTYLE=core-infopanel}");
// --------------------- Personalized Panel -----------------------
// Personalized Panel
// Rendering the saved configuration.
$mainPanel = "<div id='core-infopanel_mye107'>";
$mainPanel .= "<div class='left'>";
foreach ($this->iconlist as $key=>$val)
{
if (!vartrue($user_pref['core-infopanel-mye107']) || in_array($key, $user_pref['core-infopanel-mye107']))
$mainPanel = "
<div id='core-infopanel_mye107' >
";
/*
$mainPanel .= '<span class="pull-right">
<span class="options">
<div class="btn-group">
<a class="dropdown-toggle" data-toggle="dropdown"><i class="icon-cog"></i></a>
<ul class="dropdown-menu black-box-dropdown dropdown-right">
<li>'.$this->render_infopanel_icons().'</li>
</ul>
</div>
</span>
</span>';
*/
// print_a($user_pref['core-infopanel-mye107']);
$mainPanel .= "
<div class='left'>";
foreach ($this->iconlist as $key=>$val)
{
$mainPanel .= e107::getNav()->renderAdminButton($val['link'], $val['title'], $val['caption'], $val['perms'], $val['icon_32'], "div");
if (!vartrue($user_pref['core-infopanel-mye107']) || in_array($key, $user_pref['core-infopanel-mye107']))
{
$mainPanel .= e107::getNav()->renderAdminButton($val['link'], $val['title'], $val['caption'], $val['perms'], $val['icon_32'], "div");
}
}
}
$mainPanel .= "</div></div>";
// $mainPanel .= "<div class='clear'>&nbsp;</div>";
$mainPanel .= "</div>
</div>";
$caption = $tp->lanVars(LAN_CONTROL_PANEL, ucwords(USERNAME));
$coreInfoPanelMyE107 = $ns->tablerender($caption, $mainPanel, "core-infopanel_mye107",true);
$droppableAreaContent1 .= $coreInfoPanelMyE107;
$text = $ns->tablerender($caption, $mainPanel, "core-infopanel_mye107",true);
// --------------------- e107 News --------------------------------
// ------------------------------- e107 News --------------------------------
$newsTabs = array();
$newsTabs['coreFeed'] = array('caption'=>LAN_GENERAL,'text'=>"<div id='e-adminfeed' style='min-height:300px'></div><div class='right'><a rel='external' href='".ADMINFEEDMORE."'>".LAN_MORE."</a></div>");
$newsTabs['pluginFeed'] = array('caption'=>LAN_PLUGIN,'text'=>"<div id='e-adminfeed-plugin'></div>");
$newsTabs['themeFeed'] = array('caption'=>LAN_THEMES,'text'=>"<div id='e-adminfeed-theme'></div>");
$coreInfoPanelNews = $ns->tablerender(LAN_LATEST_e107_NEWS,e107::getForm()->tabs($newsTabs, array('active'=>'coreFeed')),"core-infopanel_news",true);
$droppableAreaContent2 .= $coreInfoPanelNews;
$text2 = $ns->tablerender(LAN_LATEST_e107_NEWS,e107::getForm()->tabs($newsTabs, array('active'=>'coreFeed')),"core-infopanel_news",true);
// ---------------------Latest Stuff ---------------------------
//require_once (e_CORE."shortcodes/batch/admin_shortcodes.php");
e107::getScBatch('admin');
// --------------------- Website Status ---------------------------
$coreInfoPanelWebsiteStatus = $ns->tablerender(LAN_WEBSITE_STATUS, $this->renderWebsiteStatus(),"",true);
$droppableAreaContent2 .= $coreInfoPanelWebsiteStatus;
// --------------------- Latest Comments --------------------------
$droppableAreaContent1 .= $this->renderLatestComments();
// --------------------- User Selected Menus ----------------------
$text2 .= $ns->tablerender(LAN_WEBSITE_STATUS, $this->renderWebsiteStatus(),"",true);
// $text .= $ns->tablerender(ADLAN_LAT_1,$tp->parseTemplate("{ADMIN_LATEST=norender}"),"core-infopanel_latest",true);
// $text .= $ns->tablerender(LAN_STATUS,$tp->parseTemplate("{ADMIN_STATUS=norender}"),"core-infopanel_latest",true);
/*
$text .= "<li class='span6'>
".$tp->parseTemplate("{ADMIN_LATEST=norender}").
$tp->parseTemplate("{ADMIN_STATUS=norender}")."
</div>";
*/
$text .= $this->renderLatestComments();
// ---------------------- Who's Online ------------------------
// TODO Could use a new _menu item instead.
// $text2 .= $ns->tablerender('Visitors Online : '.vartrue($nOnline), $panelOnline,'core-infopanel_online',true);
// --------------------- User Selected Menus -------------------
if (varset($pref['core-infopanel-menus']))
{
foreach ($pref['core-infopanel-menus'] as $val)
{
$id = $frm->name2id('core-infopanel_'.$val);
$inc = $tp->parseTemplate("{PLUGIN=$val|TRUE}");
$droppableAreaContent1 .= $inc;
$text .= $inc;
// $text .= $ns->tablerender("", $inc, $id,true);
}
}
$droppableAreaContent1 .= $this->render_infopanel_options();
// $text .= "<div class='clear'>&nbsp;</div>";
$text .= $this->render_infopanel_options();
// $text .= "</div>";
if(vartrue($_GET['mode']) != 'customize')
{
echo '<div class="row">';
echo '<div class="col-sm-12">';
echo $mes->render();
echo '</div>';
echo '</div>';
// $ns->tablerender(ADLAN_47." ".ADMINNAME, $emessage->render().$text);
echo $mes->render().'
echo '<div class="row">';
echo '<div class="col-sm-12">';
echo '<div class="draggable-panels" id="droppable-area-content-4">';
echo $droppableAreaContent4;
echo '</div>';
echo '</div>';
echo '</div>';
<!-- INFOPANEL -->
<div class="row">
<div class="span6 col-md-6">
'.$text.'
</div>
echo '<div class="row">';
echo '<div class="col-sm-4">';
echo '<div class="draggable-panels" id="droppable-area-content-5">';
echo $droppableAreaContent5;
echo '</div>';
echo '</div>';
echo '<div class="col-sm-4">';
echo '<div class="draggable-panels" id="droppable-area-content-6">';
echo $droppableAreaContent6;
echo '</div>';
echo '</div>';
echo '<div class="col-sm-4">';
echo '<div class="draggable-panels" id="droppable-area-content-7">';
echo $droppableAreaContent7;
echo '</div>';
echo '</div>';
echo '</div>';
echo '<div class="row">';
echo '<div class="col-sm-6">';
echo '<div class="draggable-panels" id="droppable-area-content-1">';
echo $droppableAreaContent1; // Control Panel
echo '</div>';
echo '</div>';
echo '<div class="col-sm-6">';
echo '<div class="draggable-panels" id="droppable-area-content-2">';
echo $droppableAreaContent2; // Latest e107 News
echo '</div>';
echo '</div>';
echo '</div>';
echo '<div class="row">';
echo '<div class="col-sm-4">';
echo '<div class="draggable-panels" id="droppable-area-content-8">';
echo $droppableAreaContent8;
echo '</div>';
echo '</div>';
echo '<div class="col-sm-4">';
echo '<div class="draggable-panels" id="droppable-area-content-9">';
echo $droppableAreaContent9;
echo '</div>';
echo '</div>';
echo '<div class="col-sm-4">';
echo '<div class="draggable-panels" id="droppable-area-content-10">';
echo $droppableAreaContent10;
echo '</div>';
echo '</div>';
echo '</div>';
echo '<div class="row">';
echo '<div class="col-sm-12">';
echo '<div class="draggable-panels" id="droppable-area-content-3">';
echo $droppableAreaContent3; // Website Status
echo '</div>';
echo '</div>';
echo '</div>';
<div class="span6 col-md-6">
'.$text2.'
</div>
</div>
<!-- -->
';
}
else
{

View File

@ -411,12 +411,11 @@ class admin_shortcodes
function sc_admin_latest($parm)
{
if($parm == 'infopanel' && e_PAGE != 'admin.php')
if(($parm == 'infopanel' || $parm == 'flexpanel') && e_PAGE != 'admin.php')
{
return;
}
if (ADMIN) {
if (!function_exists('admin_latest')) //XXX Is this still necessary?
{
@ -1095,7 +1094,7 @@ class admin_shortcodes
function sc_admin_status($parm)
{
if($parm == 'infopanel' && e_PAGE != 'admin.php')
if(($parm == 'infopanel' || $parm == 'flexpanel') && e_PAGE != 'admin.php')
{
return;
}

View File

@ -208,6 +208,7 @@ $ADMIN_MODAL = '<div id="uiModal" class="modal hide fade" tabindex="-1" role="d
</div>';*/
// TODO - LANs
$ADMIN_MODAL = '
<div id="uiModal" class="modal fade">
<div id="admin-ui-modal" class="modal-dialog modal-lg">
@ -224,12 +225,13 @@ $ADMIN_MODAL = '
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->';
</div>
</div>
</div>
';
$ADMIN_HEADER_DASHBOARD = $ADMIN_HEADER = $ADMIN_MODAL . '
// TODO - LANs
$ADMIN_HEADER_FLEXPANEL = $ADMIN_HEADER = $ADMIN_MODAL . '
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
@ -239,12 +241,12 @@ $ADMIN_HEADER_DASHBOARD = $ADMIN_HEADER = $ADMIN_MODAL . '
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="brand navbar-brand" href="' . e_ADMIN_ABS . 'admin.php" title="Return to Front Panel">
<img class="admin-logo" src="' . e_THEME_ABS . 'bootstrap3/images/e107_adminlogo.png" alt="e107"/>
<a class="brand navbar-brand" href="'.e_ADMIN_ABS.'admin.php" title="Return to Front Panel">
<img class="admin-logo" src="'.e_THEME_ABS.'bootstrap3/images/e107_adminlogo.png" alt="e107"/>
</a>
</div>
<div class="navbar-collapse collapse">
{ADMIN_NAVIGATION=no-main}
{ADMIN_NAVIGATION=no-main}
<div>
{ADMIN_NAVIGATION=logout}
{ADMIN_NAVIGATION=language}
@ -252,88 +254,57 @@ $ADMIN_HEADER_DASHBOARD = $ADMIN_HEADER = $ADMIN_MODAL . '
{ADMIN_PM}
{ADMIN_DEBUG}
</div>
</div><!--/.navbar-collapse -->
</div>
</div>
</div>
';
$ADMIN_HEADER_DASHBOARD .= '
<div class="container-fluid">
<div class="row">
<div class="col-md-2" id="left-panel">
<div class="draggable-panels" id="droppable-area-sidebar">
{SETSTYLE=admin_menu}
{ADMIN_MENU}
{ADMIN_PWORD}
{ADMIN_MENUMANAGER}
{SETSTYLE=site_info}
{ADMINUI_HELP}
{ADMIN_HELP}
{ADMIN_SITEINFO=creditsonly}
{SETSTYLE=admin_menu}
{ADMIN_LATEST=infopanel}
{ADMIN_STATUS=infopanel}
{ADMIN_LOG=request}
{ADMIN_MSG=request}
{ADMIN_PLUGINS}
{SETSTYLE=default}
</div>
</div>
<div class="col-md-10" id="right-panel">
<div class="sidebar-toggle">
<a href="#" title="Toggle Sidebar" data-toggle-sidebar="true">&nbsp;</a>
</div>
<div>
';
$ADMIN_FOOTER_DASHBOARD = '
</div>
</div><!--/span-->
</div><!--/row-->
</div><!--/.fluid-container-->
<footer class="center mute">
Copyright &copy; 2008-2015 e107 Inc (e107.org)<br />
</footer>
';
$ADMIN_HEADER .= '
<div class="container-fluid">
<div class="row">
';
$ADMIN_HEADER_FLEXPANEL .= '
<div class="col-sm-12">
<div class="admin-main-content">
';
// TODO - LANs
$ADMIN_HEADER .= '
<div class="col-md-3 col-lg-2" id="left-panel">
{SETSTYLE=admin_menu}
{ADMIN_MENU}
{ADMIN_PWORD}
{ADMIN_MENUMANAGER}
<div class="e-scroll-fixed">
{SETSTYLE=site_info}
{ADMINUI_HELP}
{ADMIN_HELP}
</div>
{ADMIN_SITEINFO=creditsonly}
{SETSTYLE=admin_menu}
{ADMIN_LATEST=infopanel}
{ADMIN_STATUS=infopanel}
{ADMIN_LOG=request}
{ADMIN_MSG=request}
{ADMIN_PLUGINS}
{SETSTYLE=default}
{SETSTYLE=default}
</div>
<div class="col-md-9 col-lg-10" id="right-panel">
<div class="sidebar-toggle">
<a href="#" title="Toggle Sidebar" data-toggle-sidebar="true">&nbsp;</a>
</div>
<div>
<div class="admin-main-content">
';
// TODO - LANs
$ADMIN_FOOTER = '
</div><!--/row-->
</div><!--/span-->
</div><!--/row-->
</div>
</div>
</div><!--/.row-->
</div><!--/.fluid-container-->
<footer class="center mute">

View File

@ -5,7 +5,7 @@ define("SEP"," <span class='fa fa-play e-breadcrumb'></span> ");
define("BOOTSTRAP", 3);
define('FONTAWESOME', 4);
e107::js("theme", "js/bootstrap3.js", 'jquery');
// e107::js("url", "https://netdna.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js",'jquery', 2);
// e107::css('url', 'http://netdna.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css');

View File

@ -4,7 +4,9 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
{
'use strict';
e107.settings.draggablePanels = {
e107.callbacks = e107.callbacks || {};
e107.settings.flexPanel = {
selector: '.draggable-panels',
items: '> .panel'
};
@ -12,12 +14,12 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
/**
* Behavior to initialize draggable panels on the dashboard.
*
* @type {{attach: e107.behaviors.adminDashboardDraggablePanels.attach}}
* @type {{attach: e107.behaviors.flexPanelDraggablePanels.attach}}
*/
e107.behaviors.adminDashboardDraggablePanels = {
e107.behaviors.flexPanelDraggablePanels = {
attach: function (context, settings)
{
var selector = e107.settings.draggablePanels.selector;
var selector = e107.settings.flexPanel.selector;
var onceKey = 'admin-dashboard-draggable-panels';
$(context).find(selector).once(onceKey).each(function ()
@ -26,9 +28,9 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
$panel.sortable({
connectWith: selector,
items: e107.settings.draggablePanels.items,
items: e107.settings.flexPanel.items,
handle: '.panel-heading',
accept: e107.settings.draggablePanels.selector,
accept: e107.settings.flexPanel.selector,
cursor: 'move',
placeholder: 'draggable-placeholder',
forcePlaceholderSize: true,
@ -39,7 +41,7 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
start: function (event, ui)
{
var $placeholders = $('.draggable-placeholder');
var $draggablePanels = $(e107.settings.draggablePanels.selector);
var $draggablePanels = $(e107.settings.flexPanel.selector);
$placeholders.css('margin', '15px');
$placeholders.css('background-color', '#337ab7');
@ -52,21 +54,21 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
},
stop: function (event, ui)
{
var $draggablePanels = $(e107.settings.draggablePanels.selector);
var $draggablePanels = $(e107.settings.flexPanel.selector);
$draggablePanels.css('min-height', '0');
$draggablePanels.css('border', 'none');
$draggablePanels.css('margin-bottom', '0');
e107.callbacks.adminDashboardSavePanelOrder();
e107.callbacks.flexPanelSavePanelOrder();
}
});
});
}
};
e107.callbacks.adminDashboardSavePanelOrder = function ()
e107.callbacks.flexPanelSavePanelOrder = function ()
{
var selector = e107.settings.draggablePanels.selector;
var selector = e107.settings.flexPanel.selector;
var NewOrder = [];
$(selector).each(function ()
@ -78,7 +80,7 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
{
NewOrder[key] = [];
$('#' + key + ' ' + e107.settings.draggablePanels.items).each(function ()
$('#' + key + ' ' + e107.settings.flexPanel.items).each(function ()
{
var $item = $(this);
var title = $item.find('.panel-title').eq(0).text();
@ -89,6 +91,6 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
});
console.log(NewOrder);
}
};
})(jQuery);