mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 21:57:51 +02:00
Improved Menu-Manager navigation
This commit is contained in:
@@ -31,6 +31,14 @@ if (!getperms("2"))
|
||||
e107::coreLan('menus', true);
|
||||
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 }
|
||||
|
||||
");
|
||||
|
||||
|
||||
|
||||
|
||||
if(strpos(e_QUERY, 'configure') !== FALSE || vartrue($_GET['enc']))
|
||||
@@ -383,7 +391,10 @@ TEMPL;
|
||||
.regularMenu { cursor:move; border-bottom:1px dotted silver; margin-bottom:6px; padding-left:3px; padding-right:3px; padding-top:10px; padding-bottom:10px;background-color: #E0EBF1; border-radius: 5px; }
|
||||
.regularMenu span {padding:3px; font-weight:bold; color:#2F2F2F;text-align:left; }
|
||||
.ui-draggable { background-color: rgb(245, 245, 245); min-width:100px;}
|
||||
|
||||
|
||||
.regularMenu:hover { background-color: #B1D7EA; }
|
||||
|
||||
|
||||
",'jquery');
|
||||
|
||||
|
||||
@@ -1397,11 +1408,12 @@ if($_POST)
|
||||
{
|
||||
// $men->menuScanMenus(); // - Runs 2x - Is already called by menuModify() in menumanager_class.php
|
||||
$text = $men->menuRenderMessage();
|
||||
$text .= $men->menuSelectLayout();
|
||||
// $text .= $men->menuSelectLayout();
|
||||
$text .= $men->menuVisibilityOptions();
|
||||
$text .= $men->menuInstanceParameters();
|
||||
$text .= $men->menuRenderIframe();
|
||||
$ns -> tablerender(ADLAN_6.SEP.LAN_MENULAYOUT, e107::getMessage()->render(). $text, 'menus_config');
|
||||
echo $text;
|
||||
// $ns -> tablerender(ADLAN_6.SEP.LAN_MENULAYOUT, e107::getMessage()->render(). $text, 'menus_config');
|
||||
}
|
||||
else // Within the IFrame.
|
||||
{
|
||||
|
@@ -1814,10 +1814,90 @@ Inverse 10 <span class="badge badge-inverse">10</span>
|
||||
|
||||
function sc_admin_menumanager() // List all menu-configs for easy-navigation
|
||||
{
|
||||
global $pref;
|
||||
$action = "";
|
||||
if(strpos(e_REQUEST_URI,e_ADMIN_ABS."menus.php")===false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return ;
|
||||
|
||||
$pref = e107::getPref();
|
||||
|
||||
|
||||
|
||||
$search = array("_","legacyDefault","legacyCustom");
|
||||
$replace = array(" ",MENLAN_31,MENLAN_33);
|
||||
|
||||
$var = array();
|
||||
|
||||
foreach($pref['sitetheme_layouts'] as $key=>$val)
|
||||
{
|
||||
$layoutName = str_replace($search,$replace,$key);
|
||||
$layoutName .=($key==$pref['sitetheme_deflayout']) ? " (".LAN_DEFAULT.")" : "";
|
||||
// $selected = ($this->curLayout == $key || ($key==$pref['sitetheme_deflayout'] && $this->curLayout=='')) ? "selected='selected'" : FALSE;
|
||||
|
||||
|
||||
//$url = e_SELF."?configure=".$key;
|
||||
$url = e_SELF."?configure=".$key;
|
||||
|
||||
// $text .= "<option value='".$url."' {$selected}>".$layoutName."</option>";
|
||||
$var[$key]['text'] = str_replace(":"," / ",$layoutName);
|
||||
$var[$key]['link'] = '#'.$key;
|
||||
$var[$key]['link_class'] = ' menuManagerSelect';
|
||||
$var[$key]['active'] = ($key==$pref['sitetheme_deflayout']) ? true: false;
|
||||
$var[$key]['include'] = "data-url='".$url = e_SELF."?configure=".$key."'";
|
||||
}
|
||||
$action = $pref['sitetheme_deflayout'];
|
||||
|
||||
$defLayout = $pref['sitetheme_deflayout'];
|
||||
|
||||
$var = array($defLayout => $var[$defLayout]) + $var;
|
||||
|
||||
e107::getNav()->admin(ADLAN_6,$action, $var);
|
||||
|
||||
return null;
|
||||
|
||||
// TODO: Move to another shortcode.
|
||||
// TODO: Get drag-n-drop working.
|
||||
|
||||
$sql = e107::getDb();
|
||||
|
||||
|
||||
$sql->select("menus", "menu_name, menu_id, menu_pages, menu_path", "1 GROUP BY menu_name ORDER BY menu_name ASC");
|
||||
|
||||
while ($row = $sql->fetch())
|
||||
{
|
||||
if(is_numeric($row['menu_path']))
|
||||
{
|
||||
$pageMenu[] = $row;
|
||||
}
|
||||
else
|
||||
{
|
||||
$pluginMenu[] = $row;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$text = "<div class='menu-manager-items' style='height:700px;overflow-y:scroll'>";
|
||||
$text .= "<h4>Your Menus</h4>";
|
||||
|
||||
foreach($pageMenu as $row)
|
||||
{
|
||||
$text .= "<div class='item' >".$row['menu_name']."</div>";
|
||||
|
||||
}
|
||||
|
||||
$text .= "<h4>Plugin Menus</h4>";
|
||||
foreach($pluginMenu as $row)
|
||||
{
|
||||
$text .= "<div class='item' data-menu-id='".$row['menu_id']."'>".substr($row['menu_name'],0,-5)."</div>";
|
||||
}
|
||||
|
||||
$text .= "</div>";
|
||||
|
||||
|
||||
return e107::getRender()->tablerender("Menus", $text, null, true);
|
||||
|
||||
/*
|
||||
|
||||
$var['menumanager']['text'] = LAN_MENULAYOUT;
|
||||
$var['menumanager']['link'] = e_ADMIN_ABS.'menus.php';
|
||||
@@ -1850,7 +1930,9 @@ Inverse 10 <span class="badge badge-inverse">10</span>
|
||||
// $action = (in_array($this->action,$keys)) ? $this->action : "installed";
|
||||
|
||||
e107::getNav()->admin("Menu Manager",$action, $var);
|
||||
// e_admin/_menu(ADLAN_6,$action, $var);
|
||||
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@@ -20,6 +20,7 @@ class news_menu
|
||||
function __construct()
|
||||
{
|
||||
// e107::lan('news','admin', 'true');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -92,10 +93,12 @@ class news_menu_form extends e_form
|
||||
public function layout($curVal)
|
||||
{
|
||||
|
||||
// class='alert alert-info'
|
||||
|
||||
$arr = array(
|
||||
"col-md-6" => "<div class='row'><div class='col-md-6'><div class='alert alert-info'>1/2</div></div><div class='col-md-6'><div class='alert alert-info'>1/2</div></div></div>",
|
||||
"col-md-4" => "<div class='row'><div class='col-md-4'><div class='alert alert-info'>1/3</div></div><div class='col-md-4'><div class='alert alert-info'>1/3</div></div><div class='col-md-4'><div class='alert alert-info'>1/3</div></div></div>",
|
||||
"col-md-3" => "<div class='row'><div class='col-md-3 '><div class='alert alert-info'>1/4</div></div><div class='col-md-3'><div class='alert alert-info'>1/4</div></div><div class='col-md-3'><div class='alert alert-info'>1/4</div></div><div class='col-md-3'><div class='alert alert-info'>1/4</div></div></div>",
|
||||
"col-md-6" => "<div class='row'><div class='col-md-6'><div {STYLE}>1/2</div></div><div class='col-md-6'><div {STYLE}>1/2</div></div></div>",
|
||||
"col-md-4" => "<div class='row'><div class='col-md-4'><div {STYLE}>1/3</div></div><div class='col-md-4'><div {STYLE}>1/3</div></div><div class='col-md-4'><div {STYLE}>1/3</div></div></div>",
|
||||
"col-md-3" => "<div class='row'><div class='col-md-3 '><div {STYLE}>1/4</div></div><div class='col-md-3'><div {STYLE}>1/4</div></div><div class='col-md-3'><div {STYLE}>1/4</div></div><div class='col-md-3'><div {STYLE}>1/4</div></div></div>",
|
||||
);
|
||||
|
||||
$text = '<table class="table news-menu-shade">';
|
||||
@@ -103,7 +106,7 @@ class news_menu_form extends e_form
|
||||
foreach($arr as $k=>$v)
|
||||
{
|
||||
|
||||
$text .= "<tr><td>".$this->radio('layout', $k, $curVal, array('label'=>$k))."</td><td>".$v."</td></tr>";
|
||||
$text .= "<tr><td>".$this->radio('layout', $k, $curVal, array('label'=>$k))."</td><td>".str_replace('{STYLE}',"class='alert alert-info' style='margin-bottom:0;text-align:center' ",$v)."</td></tr>";
|
||||
}
|
||||
|
||||
$text .= "</table>";
|
||||
|
@@ -115,6 +115,9 @@ table input.form-control, table textarea.form-control, table select.form-contro
|
||||
width:530px
|
||||
}
|
||||
|
||||
.plugin-navigation li a { outline: 0; }
|
||||
.plugin-navigation li a.link-active:before { content: "\f054"; font-family:FontAwesome; margin-left:-10px }
|
||||
|
||||
table textarea.input-block-level,
|
||||
input.input-block-level,
|
||||
input.form-control.input-block-level,
|
||||
|
@@ -418,7 +418,7 @@ $E_ADMIN_MENU['button'] = '
|
||||
';
|
||||
$E_ADMIN_MENU['button_active'] = '
|
||||
<li class="active">
|
||||
<a class="link-active{LINK_CLASS}" href="{LINK_URL}"{ID}{ONCLICK}><i class="fa fa-chevron-right"></i> {LINK_TEXT}</a>
|
||||
<a class="link-active{LINK_CLASS}" href="{LINK_URL}"{ID}{ONCLICK}> {LINK_TEXT}</a>
|
||||
{SUB_MENU}
|
||||
</li>
|
||||
';
|
||||
|
@@ -623,8 +623,23 @@ $(document).ready(function()
|
||||
|
||||
|
||||
|
||||
$("a.menuManagerSelect").click(function(e){
|
||||
|
||||
|
||||
var link = $(this).attr('data-url');
|
||||
var text = $(this).text();
|
||||
$(this).html(text + ' <i class="e-mm-select-loading fa fa-spin fa-spinner"></i>');
|
||||
|
||||
$("#menu_iframe").attr("src",link);
|
||||
|
||||
$("#menu_iframe").on("load", function () {
|
||||
$('.e-mm-select-loading').hide();
|
||||
});
|
||||
|
||||
$(this).preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
// Menu Manager Layout drop-down options
|
||||
$("#menuManagerSelect").change(function(){
|
||||
|
Reference in New Issue
Block a user