1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 12:48:24 +01:00

Menu-Manager rewrite complete, debug mode only.

This commit is contained in:
Cameron 2017-01-02 19:13:48 -08:00
parent 9681816eb9
commit 9dd717cba8
5 changed files with 113 additions and 52 deletions

View File

@ -32,6 +32,50 @@ else
}
require_once("../class2.php");
if(empty($_GET['configure']) )
{
if(e_DEBUG_MENUMANAGER === true)
{
e107::css('inline', '
body { overflow:hidden }
');
}
else
{
e107::js('footer-inline',"
$('#menu_iframe').attr('scrolling','no');
$('#menu_iframe').load(function() {
// $('#menu_iframe').bind('load', function() {
var height = this.contentWindow.document.body.offsetHeight + 400 + 'px';
// $(this).css('overflow-y','visible');
$(this).css('height',height);
// alert(this.style.height);
});
");
}
}
if (!getperms("2"))
{
e107::redirect('admin');
@ -46,6 +90,8 @@ e107::coreLan('admin', true);
e107::css('inline',"
.menu-manager-items { padding-right:15px}
.menu-manager-items div.item { padding:5px; margin:5px 0; border:1px solid rgba(255,255,255,0.3); border-radius:3px; cursor: move }
.menu-manager-sticky {
@ -66,12 +112,18 @@ top: 60px;
.menu-selector ul li {
background-color: rgba(255,255,255,0.1);
padding: 5px 30px;
padding-right:2px;
margin-bottom:2px;
}
.menu-selector ul li:nth-child(odd){ background-color:rgba(0,0,0,0.2) }
.menu-selector { height:400px; display:block; padding-bottom:50px; overflow-y:scroll; margin-bottom:10px }
.menu-selector { height:330px; display:block; padding-bottom:50px; overflow-y:scroll; margin-bottom:10px }
@media all and (min-height: 1019px) {
.menu-selector { height:550px }
}
ul.dropdown-menu.e-mm-selector { padding: 10px; margin-top: -2px; margin-right:-2px; }
@ -573,6 +625,12 @@ else
$(window).scroll(function() { // and run it again every time you scroll
stickyNav();
});
});
@ -594,7 +652,7 @@ else
/*
if($_SERVER['E_DEV_MENU'] == 'true')
{
if(isset($_GET['configure']) || isset($_GET['iframe']))
@ -608,23 +666,11 @@ if($_SERVER['E_DEV_MENU'] == 'true')
require_once("auth.php");
require_once("footer.php");
exit;
}
}*/
// if($_SERVER['E_DEV_MENU'] == 'true')
//{
function countThemeMenus()
{
}
function e_help()
@ -892,8 +938,8 @@ class e_menu_layout
foreach($pageMenu as $row)
{
$menuInf = (!is_numeric($row['menu_path'])) ? ' ('.substr($row['menu_path'],0,-1).')' : " ( #".$row['menu_path']." )";
$tab1 .= "<li>".$frm->checkbox('menuselect[]',$row['menu_id'],'',array('label'=>$row['menu_name'].$menuInf))."</li>";
$menuInf = (!is_numeric($row['menu_path'])) ? ' ('.substr($row['menu_path'],0,-1).')' : " (#".$row['menu_path'].")";
$tab1 .= "<li>".$frm->checkbox('menuselect[]',$row['menu_id'],'',array('label'=>$row['menu_name']."<small>".$menuInf."</small>"))."</li>";
}
$tab1 .= '</ul></div>';
@ -901,15 +947,15 @@ class e_menu_layout
$tab2 = '<div class="menu-selector"><ul class=" list-unstyled">';
foreach($pluginMenu as $row)
{
$menuInf = (!is_numeric($row['menu_path'])) ? ' ('.substr($row['menu_path'],0,-1).')' : " ( #".$row['menu_path']." )";
$menuInf = (!is_numeric($row['menu_path'])) ? ' ('.substr($row['menu_path'],0,-1).')' : " (#".$row['menu_path'].")";
$tab2 .= "<li>".$frm->checkbox('menuselect[]',$row['menu_id'],'',array('label'=>$row['menu_name']."<small>".$menuInf."</small>"))."</li>";
}
$tab2 .= '</ul></div>';
$tabs = array(
'custom' => array('caption'=>MENLAN_49, 'text'=>$tab1),
'plugin' => array('caption'=>ADLAN_CL_7, 'text'=>$tab2)
'custom' => array('caption'=>'<i title="'.MENLAN_49.'" class="S16 e-custom-16"></i>', 'text'=>$tab1),
'plugin' => array('caption'=>'<i title="'.ADLAN_CL_7.'" class="S16 e-plugins-16"></i>', 'text'=>$tab2)
);
@ -960,7 +1006,18 @@ class e_menu_layout
$text .= '</form>';
return array('caption'=>MENLAN_22,'text'=>$text);
$tp = e107::getParser();
$caption = MENLAN_22;
;
$diz = "The Menu-Manager allows you to place and arrange your menus within your theme template. Hover over the sub-areas to modify existing menu items. ";
$caption .= "<span class='pull-right'><a class='e-tip' title=\"".$tp->toAttribute($diz)."\">".ADMIN_INFO_ICON."</a></span>";
return array('caption'=>$caption,'text'=>$text);
@ -1765,8 +1822,7 @@ if($_POST)
@ -1789,6 +1845,7 @@ if($_POST)
}
else // Within the IFrame.
{
$men->menuRenderPage();
}
@ -1808,7 +1865,7 @@ if($_POST)
// -----------------------------------------------------------------------------
require_once("footer.php");
require_once("footer.php");
// -----------------------------------------------------------------------

View File

@ -4,7 +4,7 @@ function wmessage_shortcode($parm='')
{
if($parm == 'hide')
{
return;
return null;
}
$e107 = e107::getInstance();
@ -43,6 +43,8 @@ function wmessage_shortcode($parm='')
if (strpos($front_url, 'http') === FALSE) $front_url = SITEURL.$front_url;
if (deftrue('e_FRONTPAGE') || ($parm == 'force') || ((e_SELF == $front_url) && (($parm == 'ignore_query') || (e_QUERY == $front_qry))))
{
// Actually want to display a welcome message here
@ -52,8 +54,7 @@ function wmessage_shortcode($parm='')
if($cacheData = $e107cache->retrieve('wmessage'))
{
echo $cacheData;
return;
return $cacheData;
}
if (!defined('WMFLAG'))
@ -80,7 +81,7 @@ function wmessage_shortcode($parm='')
if (isset($wmessage) && $wmessage)
{
ob_start();
$cache_data = '';
if(intval($pref['wm_enclose']) === 2) // carousel
{
$carousel= array();
@ -89,22 +90,24 @@ function wmessage_shortcode($parm='')
$carousel['slide-'.$k] = array('caption'=>$wmessageCaption[$k], 'text'=>$ns->tablerender($wmessageCaption[$k],$v, 'wm',true));
}
echo e107::getForm()->carousel('wmessage-carousel',$carousel);
$cache_data = e107::getForm()->carousel('wmessage-carousel',$carousel);
}
elseif(intval($pref['wm_enclose']) === 1)
{
$ns->tablerender($wmcaption, implode("<br />",$wmessage), 'wm');
$cache_data = $ns->tablerender($wmcaption, implode("<br />",$wmessage), 'wm', true);
}
else
{
echo "<div class='wmessage'>";
echo ($wmcaption) ? $wmcaption.'<br />' : '';
echo implode('<br />',$wmessage);
echo "</div>";
$text = "<div class='wmessage'>";
$text .= ($wmcaption) ? $wmcaption.'<br />' : '';
$text .= implode('<br />',$wmessage);
$text .= "</div>";
$cache_data = $text;
}
$cache_data = ob_get_flush();
$e107cache->set('wmessage', $cache_data);
return $cache_data;
}
}
}

View File

@ -100,6 +100,8 @@ class e_menuManager {
$menu_array = $this->parseheader($HEADER.$FOOTER, 'check');
if($menu_array)
{
sort($menu_array, SORT_NUMERIC);
@ -204,7 +206,7 @@ class e_menuManager {
// $cnt = $sql->select("menus", "*", "menu_location > 0 AND menu_layout = '$curLayout' ORDER BY menu_name "); // calculate height to remove vertical scroll-bar.
// $text = "<object class='well' type='text/html' id='menu_iframe' data='".$url."' width='100%' style='overflow:auto;width: 100%; height: ".(($cnt*90)+600)."px; border: 0px' ></object>";
$text = "<iframe class='well' id='menu_iframe' name='e-mm-iframe' src='".$url."' width='100%' scrolling='no' style='width: 100%; height: 100vh; border: 0px' ></iframe>";
$text = "<iframe class='well' id='menu_iframe' name='e-mm-iframe' src='".$url."' width='100%' style='width: 100%; height: 90vh; border: 0px' ></iframe>";
return $text;
}
@ -1141,9 +1143,8 @@ class e_menuManager {
$tp = e107::getParser();
//FIXME - XHTML cleanup, front-end standards (elist, forms etc)
echo "<div id='portal'>";
// echo "<div id='portal'>";
$this->parseheader($HEADER); // $layouts_str;
$layout = ($this->curLayout);
@ -1275,7 +1276,7 @@ class e_menuManager {
{
echo "<div id='debug' style='margin-left:0px;border:1px solid silver; overflow:scroll;height:250px'> &nbsp;</div>";
}
echo "</div>";
// echo "</div>";
}
@ -1323,6 +1324,7 @@ class e_menuManager {
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
function parseheader($LAYOUT, $check = FALSE)
{
// $tmp = explode("\n", $LAYOUT);
// Split up using the same function as the shortcode handler
$tmp = preg_split('#(\{\S[^\x02]*?\S\})#', $LAYOUT, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
@ -1417,12 +1419,12 @@ class e_menuManager {
// {
// echo "[SiteLinks]";
// }
elseif(strstr($str, "NAVIGATION"))
{
$cust = preg_replace("/\W*\{NAVIGATION(.*?)(\+.*)?\}\W*/si", "\\1", $str);
$tp->parseTemplate("{NAVIGATION".$cust."}",true);
// elseif(strstr($str, "NAVIGATION"))
// {
// $cust = preg_replace("/\W*\{NAVIGATION(.*?)(\+.*)?\}\W*/si", "\\1", $str);
// $tp->parseTemplate("{NAVIGATION".$cust."}",true);
// echo "<span class='label label-info'>Navigation Area</span>";
}
// }
elseif(strstr($str, "ALERT"))
{
//echo "[Navigation Area]";

View File

@ -16,6 +16,12 @@ if (!getperms("2"))
exit;
}
if(e_DEBUG_MENUMANAGER === true)
{
return;
}
$sql = e107::getDb();
$tp = e107::getParser();
$frm = e107::getForm();

View File

@ -667,14 +667,7 @@ $(document).ready(function()
$("#menu_iframe").attr("src",link);
return false;
});
$('#menu_iframe').load(function() {
this.style.height = this.contentWindow.document.body.offsetHeight + 400 + 'px';
// alert(this.style.height);
// this.style.height = '100vh';
});
$("a.e-mm-selector").click(function(e){