mirror of
https://github.com/e107inc/e107.git
synced 2025-08-05 22:27:34 +02:00
Menu-Manager drag-N-drop support.
This commit is contained in:
@@ -84,7 +84,7 @@ else
|
|||||||
$admin_log->e_log_event(4, __FILE__."|".__FUNCTION__."@".__LINE__, "LOGIN", LAN_ROLL_LOG_11, "U: ".$tp->toDB($_POST['authname']), FALSE, LOG_TO_ROLLING);
|
$admin_log->e_log_event(4, __FILE__."|".__FUNCTION__."@".__LINE__, "LOGIN", LAN_ROLL_LOG_11, "U: ".$tp->toDB($_POST['authname']), FALSE, LOG_TO_ROLLING);
|
||||||
echo "<script type='text/javascript'>document.location.href='../index.php'</script>\n";
|
echo "<script type='text/javascript'>document.location.href='../index.php'</script>\n";
|
||||||
// header("location: ../index.php");
|
// header("location: ../index.php");
|
||||||
e107::getRedirect()->redirect('../index.php');
|
e107::getRedirect()->redirect('admin.php?failed');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -156,7 +156,9 @@ class auth
|
|||||||
|
|
||||||
$incChap = (vartrue($pref['password_CHAP'], 0)) ? " onsubmit='hashLoginPassword(this)'" : "";
|
$incChap = (vartrue($pref['password_CHAP'], 0)) ? " onsubmit='hashLoginPassword(this)'" : "";
|
||||||
|
|
||||||
$text = "<div style='padding:20px;text-align:center'>
|
$class = (e_QUERY == 'failed') ? "class='e-shake'" : "";
|
||||||
|
|
||||||
|
$text = "<div {$class} style='padding:20px;text-align:center'>
|
||||||
<form method='post' action='".e_SELF."' {$incChap} >
|
<form method='post' action='".e_SELF."' {$incChap} >
|
||||||
<table style='width:50%' class='fborder'>
|
<table style='width:50%' class='fborder'>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -196,6 +198,7 @@ class auth
|
|||||||
</form>
|
</form>
|
||||||
</div>";
|
</div>";
|
||||||
|
|
||||||
|
// echo $text;
|
||||||
e107::getRender()->tablerender(ADLAN_92, $text);
|
e107::getRender()->tablerender(ADLAN_92, $text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -31,6 +31,49 @@ if (!getperms("2"))
|
|||||||
e107::coreLan('menus', true);
|
e107::coreLan('menus', true);
|
||||||
e107::coreLan('admin', true);
|
e107::coreLan('admin', true);
|
||||||
|
|
||||||
|
if(strpos(e_QUERY, 'configure') !== FALSE )
|
||||||
|
{
|
||||||
|
|
||||||
|
e107::js('core', 'colorbox/jquery.colorbox-min.js', 'jquery', 2);
|
||||||
|
e107::css('core', 'colorbox/colorbox.css', 'jquery');
|
||||||
|
|
||||||
|
e107::js('core', 'core/jquery.elastic.source.js', 'jquery', 2);
|
||||||
|
|
||||||
|
e107::js('core', 'plupload/plupload.full.js', 'jquery', 2);
|
||||||
|
e107::css('core', 'plupload/jquery.plupload.queue/css/jquery.plupload.queue.css', 'jquery');
|
||||||
|
e107::js('core', 'plupload/jquery.plupload.queue/jquery.plupload.queue.js', 'jquery', 2);
|
||||||
|
|
||||||
|
e107::css('core', 'chosen/chosen.css', 'jquery');
|
||||||
|
e107::js('core', 'chosen/chosen.jquery.min.js', 'jquery', 2);
|
||||||
|
|
||||||
|
e107::css('core', 'password/style.css', 'jquery');
|
||||||
|
e107::js('core', 'password/jquery.pwdMeter.js', 'jquery', 2);
|
||||||
|
//
|
||||||
|
e107::js("core", "plupload/customUpload.js","jquery",3);
|
||||||
|
|
||||||
|
e107::js("core", "core/mediaManager.js","jquery",3);
|
||||||
|
|
||||||
|
|
||||||
|
e107::css('core', 'core/admin.css', 'jquery');
|
||||||
|
e107::js('core', 'core/admin.jquery.js', 'jquery', 4);
|
||||||
|
|
||||||
|
|
||||||
|
e107::css('inline'," .column { width: 170px; float: left; padding-bottom: 100px; }
|
||||||
|
.portlet { margin: 0 1em 1em 0; }
|
||||||
|
.portlet-header { margin: 0.3em; padding-bottom: 4px; padding-left: 0.2em; cursor:move }
|
||||||
|
.portlet-header .ui-icon { float: right; }
|
||||||
|
.portlet-content { padding: 10px; }
|
||||||
|
.ui-sortable-placeholder { border: 1px dotted black; visibility: visible !important; height: 50px !important; }
|
||||||
|
.ui-sortable-placeholder * { visibility: hidden; }
|
||||||
|
",'jquery');
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$e_sub_cat = 'menus';
|
$e_sub_cat = 'menus';
|
||||||
|
|
||||||
require_once(e_HANDLER."file_class.php");
|
require_once(e_HANDLER."file_class.php");
|
||||||
@@ -41,7 +84,7 @@ require_once(e_HANDLER."menumanager_class.php");
|
|||||||
|
|
||||||
$rs = new form;
|
$rs = new form;
|
||||||
$frm = new e_form();
|
$frm = new e_form();
|
||||||
$men = new e_menuManager(); // use 1 for dragdrop.
|
$men = new e_menuManager(0); // use 1 for dragdrop.
|
||||||
|
|
||||||
|
|
||||||
if(e_AJAX_REQUEST)
|
if(e_AJAX_REQUEST)
|
||||||
@@ -96,6 +139,8 @@ require_once("footer.php");
|
|||||||
|
|
||||||
function headerjs()
|
function headerjs()
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
|
||||||
global $sql,$pref,$men;
|
global $sql,$pref,$men;
|
||||||
|
|
||||||
if(!$men->dragDrop)
|
if(!$men->dragDrop)
|
||||||
|
@@ -557,7 +557,7 @@ class e_menuManager {
|
|||||||
foreach($this->menuActivateIds as $sel_mens)
|
foreach($this->menuActivateIds as $sel_mens)
|
||||||
{
|
{
|
||||||
//Get info from menu being activated
|
//Get info from menu being activated
|
||||||
if($sql->db_Select("menus", 'menu_name, menu_path' , "menu_id = ".$sel_mens." "))
|
if($sql->db_Select("menus", 'menu_name, menu_path' , "menu_id = ".intval($sel_mens)." "))
|
||||||
{
|
{
|
||||||
$row=$sql->db_Fetch();
|
$row=$sql->db_Fetch();
|
||||||
//If menu is not already activated in that area, add the record.
|
//If menu is not already activated in that area, add the record.
|
||||||
@@ -726,6 +726,8 @@ class e_menuManager {
|
|||||||
{ // Get current menu name
|
{ // Get current menu name
|
||||||
global $sql,$admin_log;
|
global $sql,$admin_log;
|
||||||
|
|
||||||
|
//echo "FOUND= ".$this->menuId;
|
||||||
|
|
||||||
if($sql->db_Select('menus', 'menu_name', 'menu_id='.$this->menuId, 'default'))
|
if($sql->db_Select('menus', 'menu_name', 'menu_id='.$this->menuId, 'default'))
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -734,7 +736,10 @@ class e_menuManager {
|
|||||||
if($sql->db_Select('menus', 'menu_id', "menu_name='{$row['menu_name']}' AND menu_location = 0 AND menu_layout ='".$this->dbLayout."' LIMIT 1"))
|
if($sql->db_Select('menus', 'menu_id', "menu_name='{$row['menu_name']}' AND menu_location = 0 AND menu_layout ='".$this->dbLayout."' LIMIT 1"))
|
||||||
{
|
{
|
||||||
//menu_location=0 already exists, we can just delete this record
|
//menu_location=0 already exists, we can just delete this record
|
||||||
$sql->db_Delete('menus', 'menu_id='.$this->menuId);
|
if(!$sql->db_Delete('menus', 'menu_id='.$this->menuId))
|
||||||
|
{
|
||||||
|
$message = "Deletion Failed";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -748,6 +753,10 @@ class e_menuManager {
|
|||||||
$sql->db_Update("menus", "menu_order=menu_order-1 WHERE menu_location={$location} AND menu_order > {$position} AND menu_layout = '".$this->dbLayout."' ");
|
$sql->db_Update("menus", "menu_order=menu_order-1 WHERE menu_location={$location} AND menu_order > {$position} AND menu_layout = '".$this->dbLayout."' ");
|
||||||
$admin_log->log_event('MENU_04',$row['menu_name'].'[!br!]'.$location.'[!br!]'.$position.'[!br!]'.$this->menuId,E_LOG_INFORMATIVE,'');
|
$admin_log->log_event('MENU_04',$row['menu_name'].'[!br!]'.$location.'[!br!]'.$position.'[!br!]'.$this->menuId,E_LOG_INFORMATIVE,'');
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$message = "NO CHANGES MADE";
|
||||||
|
}
|
||||||
|
|
||||||
echo $message;
|
echo $message;
|
||||||
}
|
}
|
||||||
@@ -802,13 +811,13 @@ class e_menuManager {
|
|||||||
|
|
||||||
if(!$this->dragDrop)
|
if(!$this->dragDrop)
|
||||||
{
|
{
|
||||||
$text .= "<div class='portal-column' id='portal-column-block-list' style='border:1px inset black;height:200px;display:block;overflow:auto;margin-bottom:20px'>";
|
$text .= "<div class='column' id='portal-column-block-list' style='border:1px inset black;height:200px;display:block;overflow:auto;margin-bottom:20px'>";
|
||||||
$text .= "<table id='core-menumanager-main' style='width:100%;margin-left:auto;margin-right:auto' cellspacing='0' cellpadding='0'>\n";
|
$text .= "<table id='core-menumanager-main' style='width:100%;margin-left:auto;margin-right:auto' cellspacing='0' cellpadding='0'>\n";
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$text .= "<div class='portal-column' id='portal-column-block-list' style='border:1px solid silver'>\n";
|
$text .= "<div class='column' id='remove' style='border:1px solid silver'>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$color = "";
|
$color = "";
|
||||||
@@ -839,12 +848,10 @@ class e_menuManager {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$text .= "<div class='block block-archive' id='block-archive-".$row['menu_id']."--".$this->dbLayout."' style='border:1px outset black;text-align:left;color:black'>
|
// Menu Choices box.
|
||||||
|
$text .= "<div class='portlet block block-archive' id='block-".$row['menu_id']."' style='border:1px outset black;text-align:left;color:black'>";
|
||||||
<div class='block-toggle'><input type='checkbox' name='menuselect[]' value='{$row['menu_id']}' />".$row['menu_name']." {$pdeta}</div>
|
$text .= $this->menuRenderMenu($row, $menu_count,true);
|
||||||
<div class='content'>";
|
$text .= "</div>\n";
|
||||||
$text .= $this->menuRenderMenu($row, $menu_count);
|
|
||||||
$text .= "</div></div>\n";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$text .= (!$this->dragDrop) ? "</table>" : "";
|
$text .= (!$this->dragDrop) ? "</table>" : "";
|
||||||
@@ -866,7 +873,7 @@ class e_menuManager {
|
|||||||
}
|
}
|
||||||
$text .= "<input type='hidden' name='curLayout' value='".$layout."' />";
|
$text .= "<input type='hidden' name='curLayout' value='".$layout."' />";
|
||||||
}
|
}
|
||||||
|
$text .= "<input type='hidden' id='dbLayout' value='".$this->dbLayout."' />";
|
||||||
$text .= "</td>";
|
$text .= "</td>";
|
||||||
|
|
||||||
$text .= "</tr></table>";
|
$text .= "</tr></table>";
|
||||||
@@ -893,14 +900,11 @@ class e_menuManager {
|
|||||||
{
|
{
|
||||||
global $rs, $pref;
|
global $rs, $pref;
|
||||||
|
|
||||||
|
// onchange=\"urljump(this.options[selectedIndex].value);\"
|
||||||
|
|
||||||
$text .= "<form method='post' action='".e_SELF."?configure=".$this->curLayout."'>";
|
$text .= "<form method='post' action='".e_SELF."?configure=".$this->curLayout."'>";
|
||||||
// color:white;background-color:black;width:98%;display:block;padding:15px;text-align:center
|
|
||||||
$text .= "<div class='buttons-bar center'>".MENLAN_30." ";
|
$text .= "<div class='buttons-bar center'>".MENLAN_30." ";
|
||||||
// $text .= "<select style='color:black' name='custom_select' onchange=\"this.form.submit();\">\n"; // window.frames['menu_iframe'].location=this.options[selectedIndex].value ???
|
$text .= "<select name='custom_select' id='menuManagerSelect' >\n"; // window.frames['menu_iframe'].location=this.options[selectedIndex].value ???
|
||||||
|
|
||||||
// $text .= "<select style='color:black' name='custom_select' onchange=\"document.getElementById('menu_iframe').data=this.options[selectedIndex].value;\">\n"; // window.frames['menu_iframe'].location=this.options[selectedIndex].value ???
|
|
||||||
|
|
||||||
$text .= "<select name='custom_select' onchange=\"urljump(this.options[selectedIndex].value);\">\n"; // window.frames['menu_iframe'].location=this.options[selectedIndex].value ???
|
|
||||||
|
|
||||||
|
|
||||||
$search = array("_","legacyDefault","legacyCustom");
|
$search = array("_","legacyDefault","legacyCustom");
|
||||||
@@ -914,8 +918,10 @@ class e_menuManager {
|
|||||||
$layoutName .=($key==$pref['sitetheme_deflayout']) ? " (".MENLAN_31.")" : "";
|
$layoutName .=($key==$pref['sitetheme_deflayout']) ? " (".MENLAN_31.")" : "";
|
||||||
$selected = ($this->curLayout == $key || ($key==$pref['sitetheme_deflayout'] && $this->curLayout=='')) ? "selected='selected'" : FALSE;
|
$selected = ($this->curLayout == $key || ($key==$pref['sitetheme_deflayout'] && $this->curLayout=='')) ? "selected='selected'" : FALSE;
|
||||||
|
|
||||||
$url = e_SELF."?lay=";
|
// $url = e_SELF."?lay=".$key;
|
||||||
$url .= $key;
|
|
||||||
|
$url = e_SELF."?configure=".$key;
|
||||||
|
|
||||||
$text .= "<option value='$url' {$selected}>".$layoutName."</option>";
|
$text .= "<option value='$url' {$selected}>".$layoutName."</option>";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1032,54 +1038,83 @@ class e_menuManager {
|
|||||||
$matches = array();
|
$matches = array();
|
||||||
if(preg_match_all("/\{MENU=([\d]{1,3})(:[\w\d]*)?\}/", $str, $matches))
|
if(preg_match_all("/\{MENU=([\d]{1,3})(:[\w\d]*)?\}/", $str, $matches))
|
||||||
{
|
{
|
||||||
|
$menuText = "";
|
||||||
foreach($matches[1] as $menu)
|
foreach($matches[1] as $menu)
|
||||||
{
|
{
|
||||||
$menu = preg_replace("/\{MENU=(.*?)(:.*?)?\}/si", "\\1", $str);
|
$menu = preg_replace("/\{MENU=(.*?)(:.*?)?\}/si", "\\1", $str);
|
||||||
if(isset($sc_style['MENU']['pre']) && strpos($str, 'ret') !== false)
|
if(isset($sc_style['MENU']['pre']) && strpos($str, 'ret') !== false)
|
||||||
{
|
{
|
||||||
echo $sc_style['MENU']['pre'];
|
$menuText .= $sc_style['MENU']['pre'];
|
||||||
}
|
}
|
||||||
echo "
|
|
||||||
<div class='portal-column' id='portal-column-" . $menu . "'>
|
|
||||||
|
|
||||||
<div style='text-align:center; font-size:14px' class='fborder'>
|
|
||||||
|
|
||||||
<div class='forumheader'><b>" . MENLAN_14 . " " . $menu . "</b></div></div><br />";
|
// ---------------
|
||||||
$text = " ";
|
$menuText .= "\n\n<!-- START AREA ".$menu." -->";
|
||||||
|
$menuText .= "
|
||||||
|
<div id='start-area-".$menu."'>";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$menuText .= "<div class='fborder forumheader' style='font-weight:bold;display:block;text-align:center; font-size:14px' >
|
||||||
|
" . MENLAN_14 . " " . $menu . "
|
||||||
|
</div>
|
||||||
|
\n\n";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$sql9 = new db();
|
$sql9 = new db();
|
||||||
|
// $sql9 = e107::getDb('sql9');
|
||||||
if($sql9->db_Count("menus", "(*)", " WHERE menu_location='$menu' AND menu_layout = '" . $this->dbLayout . "' "))
|
if($sql9->db_Count("menus", "(*)", " WHERE menu_location='$menu' AND menu_layout = '" . $this->dbLayout . "' "))
|
||||||
{
|
{
|
||||||
unset($text);
|
unset($text);
|
||||||
echo $rs->form_open("post", e_SELF . "?configure=" . $this->curLayout, "frm_menu_" . intval($menu));
|
$menuText .= $rs->form_open("post", e_SELF . "?configure=" . $this->curLayout, "frm_menu_" . intval($menu));
|
||||||
|
|
||||||
$MODE = 1;
|
$MODE = 1;
|
||||||
|
|
||||||
$sql9->db_Select("menus", "*", "menu_location='$menu' AND menu_layout='" . $this->dbLayout . "' ORDER BY menu_order");
|
$sql9->db_Select("menus", "*", "menu_location='$menu' AND menu_layout='" . $this->dbLayout . "' ORDER BY menu_order");
|
||||||
$menu_count = $sql9->db_Rows();
|
$menu_count = $sql9->db_Rows();
|
||||||
|
|
||||||
|
$menuText .= "\n<div class='column' id='area-".$menu."'>\n\n";
|
||||||
while($row = $sql9->db_Fetch(MYSQL_ASSOC))
|
while($row = $sql9->db_Fetch(MYSQL_ASSOC))
|
||||||
{
|
{
|
||||||
echo "\n\n\n <!-- Menu Start -->\n\n
|
$menuText .= "\n\n\n <!-- Menu Start ".$row['menu_name']. "-->\n";
|
||||||
<div class='block' id='block-" . $row['menu_id'] . "--" . $this->dbLayout . "'>
|
$menuText .= "<div class='portlet' id='block-".$row['menu_id']."-".$menu."'>\n";
|
||||||
|
|
||||||
<div class='content'>";
|
// echo "<div class='ggportal'>";
|
||||||
|
|
||||||
echo $this->menuRenderMenu($row, $menu_count);
|
// $menuText .= "hi there";
|
||||||
|
$menuText .= $this->menuRenderMenu($row, $menu_count);
|
||||||
|
|
||||||
echo "\n</div></div>";
|
// echo "\n</div>";
|
||||||
echo "\n\n\n<!-- Menu end -->\n\n\n";
|
$menuText .= "\n</div>\n";
|
||||||
echo "<div><br /></div>";
|
$menuText .= "<!-- Menu end -->\n\n\n";
|
||||||
|
// echo "<div><br /></div>";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
$menuText .= "\n\n</div>\n\n"; // End Column
|
||||||
echo $rs->form_close();
|
$menuText .= $rs->form_close();
|
||||||
}
|
}
|
||||||
echo "</div>";
|
else
|
||||||
|
{ // placeholder
|
||||||
|
$menuText .= "<div class='column' id='area-" . $menu . "'><!-- --></div>";
|
||||||
|
}
|
||||||
|
|
||||||
|
$menuText .= "</div><!-- END OF AREA -->\n\n";
|
||||||
|
|
||||||
|
// ---------------
|
||||||
|
|
||||||
|
|
||||||
if(isset($sc_style['MENU']['post']) && strpos($str, 'ret') !== false)
|
if(isset($sc_style['MENU']['post']) && strpos($str, 'ret') !== false)
|
||||||
{
|
{
|
||||||
echo $sc_style['MENU']['post'];
|
$menuText .= $sc_style['MENU']['post'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
echo $menuText;
|
||||||
}
|
}
|
||||||
else if(strstr($str, "SETSTYLE"))
|
else if(strstr($str, "SETSTYLE"))
|
||||||
{
|
{
|
||||||
@@ -1093,7 +1128,7 @@ class e_menuManager {
|
|||||||
}
|
}
|
||||||
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
|
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||||
|
|
||||||
function menuRenderMenu($row,$menu_count )
|
function menuRenderMenu($row,$menu_count,$rep = FALSE)
|
||||||
{
|
{
|
||||||
global $ns,$rs,$menu,$menu_info,$menu_act;
|
global $ns,$rs,$menu,$menu_info,$menu_act;
|
||||||
// $menu_count is empty in here
|
// $menu_count is empty in here
|
||||||
@@ -1130,6 +1165,8 @@ class e_menuManager {
|
|||||||
$conf = "{$menu_path}config";
|
$conf = "{$menu_path}config";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!$this->dragDrop)
|
||||||
|
{
|
||||||
$text .= "<select id='menuAct_".$menu_id."' name='menuAct[$menu_id]' class='tbox' onchange='this.form.submit()' >";
|
$text .= "<select id='menuAct_".$menu_id."' name='menuAct[$menu_id]' class='tbox' onchange='this.form.submit()' >";
|
||||||
$text .= $rs->form_option(MENLAN_25, TRUE, " ");
|
$text .= $rs->form_option(MENLAN_25, TRUE, " ");
|
||||||
// $text .= $rs->form_option(MENLAN_15, "", "deac.{$menu_info}");
|
// $text .= $rs->form_option(MENLAN_15, "", "deac.{$menu_info}");
|
||||||
@@ -1160,28 +1197,35 @@ class e_menuManager {
|
|||||||
// Visibility is an action icon now
|
// Visibility is an action icon now
|
||||||
//$text .= $rs->form_option(MENLAN_20, "", "adv.{$menu_info}");
|
//$text .= $rs->form_option(MENLAN_20, "", "adv.{$menu_info}");
|
||||||
$text .= $rs->form_select_close();
|
$text .= $rs->form_select_close();
|
||||||
|
}
|
||||||
|
|
||||||
|
if($rep == true)
|
||||||
|
{
|
||||||
|
$text .= "<div id='check-".$menu_id."'><input type='checkbox' name='menuselect[]' value='{$menu_id}' />".$menu_id." {$pdeta}</div>
|
||||||
|
<div id='option-".$menu_id."' style='display:none'>";
|
||||||
|
}
|
||||||
|
|
||||||
//DEBUG remove inline style, switch to simple quoted string for title text value
|
//DEBUG remove inline style, switch to simple quoted string for title text value
|
||||||
//TODO hardcoded text
|
//TODO hardcoded text
|
||||||
$text .= '<div class="right">
|
$text .= '<div class="center">
|
||||||
<a target="_top" href="'.e_SELF.'?lay='.$this->curLayout.'&vis='.$menu_id.'" title="'.MENLAN_20.'">
|
<a target="_top" href="'.e_SELF.'?lay='.$this->curLayout.'&vis='.$menu_id.'" title="'.MENLAN_20.'">'.ADMIN_VIEW_ICON.'</a>';
|
||||||
'.ADMIN_VIEW_ICON.'
|
|
||||||
</a>';
|
|
||||||
|
|
||||||
if($conf)
|
if($conf)
|
||||||
{
|
{
|
||||||
$text .= '<a target="_top" href="'.e_SELF.'?lay='.$this->curLayout.'&mode=conf&path='.urlencode($conf).'&id='.$menu_id.'" title="Configure menu">
|
$text .= '<a target="_top" href="'.e_SELF.'?lay='.$this->curLayout.'&mode=conf&path='.urlencode($conf).'&id='.$menu_id.'"
|
||||||
'.ADMIN_CONFIGURE_ICON.'
|
title="Configure menu">'.ADMIN_CONFIGURE_ICON.'</a>';
|
||||||
</a>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$text .= '<a target="_top" href="'.e_SELF.'?lay='.$this->curLayout.'&parmsId='.$menu_id.'" title="Configure parameters">
|
$text .= '<a target="_top" href="'.e_SELF.'?lay='.$this->curLayout.'&parmsId='.$menu_id.'"
|
||||||
'._ITAG('edit', 16, 'icon action S16').'
|
title="Configure parameters">'.ADMIN_EDIT_ICON.'</a>';
|
||||||
</a>';
|
|
||||||
|
|
||||||
$text .= '<a class="delete" href="'.e_SELF.'?configure='.$this->curLayout.'&mode=deac&id='.$menu_id.'">'.ADMIN_DELETE_ICON.'
|
$text .= '<a title="'.LAN_DELETE.'" id="remove-'.$menu_id.'-'.$menu_location.'" class="delete e-menumanager-delete" href="'.e_SELF.'?configure='.$this->curLayout.'&mode=deac&id='.$menu_id.'">'.ADMIN_DELETE_ICON.'</a>
|
||||||
</a>
|
|
||||||
|
<span id="status-'.$menu_id.'" style="display:none">'.($rep == true ? "" : "insert").'</span>
|
||||||
</div>';
|
</div>';
|
||||||
|
|
||||||
|
$text .= ($rep == true) ? "</div>" : "";
|
||||||
|
/*
|
||||||
if($this->dragDrop)
|
if($this->dragDrop)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -1197,60 +1241,92 @@ class e_menuManager {
|
|||||||
</div>
|
</div>
|
||||||
</div>';
|
</div>';
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
if(!$this->dragDrop)
|
||||||
|
{
|
||||||
ob_start();
|
ob_start();
|
||||||
|
|
||||||
$ns->tablerender($caption, $text);
|
$ns->tablerender($caption, $text);
|
||||||
$THEX = ob_get_contents();
|
$THEX = ob_get_contents();
|
||||||
|
|
||||||
ob_end_clean();
|
ob_end_clean();
|
||||||
|
|
||||||
return $THEX;
|
return $THEX;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return "
|
||||||
|
<div class='portlet-header'>".$caption."</div>
|
||||||
|
<div class='portlet-content'>".$text."</div>";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function menuSaveAjax()
|
function menuSaveAjax()
|
||||||
{
|
{
|
||||||
if(!$this->dragDrop){ return; }
|
|
||||||
|
|
||||||
|
$this->debug = TRUE;
|
||||||
|
|
||||||
global $sql;
|
global $sql;
|
||||||
|
|
||||||
|
|
||||||
|
list($tmp,$area) = explode("-",$_POST['area']);
|
||||||
|
|
||||||
list($area,$blockList) = explode(':', $_POST['value']);
|
if($_POST['area'] == 'remove')
|
||||||
$loc = intval(str_replace('portal-column-','',$area));
|
|
||||||
|
|
||||||
// list($e_block,$e_layout) = explode("--",$_POST['value']);
|
|
||||||
$blockArray = explode(",",$blockList);
|
|
||||||
|
|
||||||
$srch = array('block-archive-','block-');
|
|
||||||
$repl = array('','');
|
|
||||||
|
|
||||||
foreach($blockArray as $val)
|
|
||||||
{
|
{
|
||||||
list($b,$layout) = explode("--",$val);
|
list($tmp,$deleteID) = explode("-",$_POST['removeid']);
|
||||||
|
$this->menuId = $deleteID;
|
||||||
if(strpos($b,"block-archive")!==FALSE)
|
$this->menuDeactivate();
|
||||||
{
|
echo "Removed {$deleteId}";
|
||||||
$insert[] = str_replace($srch,$repl,$b);
|
return;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$update[] = str_replace($srch,$repl,$b); // not really accurate.
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Would be good if the ajax sent a query specific to 'moves'.
|
// Allow deletion by ajax, but not the rest when drag/drop disabled.
|
||||||
|
|
||||||
$this -> dbLayout = $layout;
|
if(!$this->dragDrop){ return; }
|
||||||
|
|
||||||
$this->menuActivateLoc = $loc; // location
|
$this -> dbLayout = $_POST['layout'];
|
||||||
|
list($tmp,$insertID) = explode("-",$_POST['insert']);
|
||||||
|
$insert[] = $insertID;
|
||||||
|
|
||||||
|
print_r($_POST);
|
||||||
|
|
||||||
|
if($_POST['mode'] == 'insert' && count($insert) && $area) // clear out everything before rewriting everything to db.
|
||||||
|
{
|
||||||
|
$this->menuActivateLoc = $area; // location
|
||||||
$this->menuActivateIds = $insert; // array of ids, in order.
|
$this->menuActivateIds = $insert; // array of ids, in order.
|
||||||
$this->menuActivate(); // Activate will not deal with menu Moving - need a way to determine if a move has occurred.
|
$this->menuActivate();
|
||||||
|
|
||||||
|
}
|
||||||
|
elseif($_POST['mode'] == 'update')
|
||||||
|
{
|
||||||
|
$sql->db_Update("menus","menu_location = ".intval($area)." WHERE menu_id = ".intval($insertID)." LIMIT 1",$this->debug);
|
||||||
|
}
|
||||||
|
|
||||||
|
$c = 0;
|
||||||
|
|
||||||
|
if(count($_POST['list'])<2)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// resort the menus in this 'Area"
|
||||||
|
foreach($_POST['list'] as $val)
|
||||||
|
{
|
||||||
|
list($b,$id) = explode("-",$val);
|
||||||
|
$order[] = $id;
|
||||||
|
$sql->db_Update("menus","menu_order = ".$c." WHERE menu_id = ".intval($id)." LIMIT 1",$this->debug);
|
||||||
|
$c++;
|
||||||
|
}
|
||||||
|
|
||||||
// same for delete etc.
|
// same for delete etc.
|
||||||
|
|
||||||
echo "<hr />";
|
// echo "<hr />";
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -71,9 +71,17 @@ e107::js('inline',"
|
|||||||
$$('a.e-dialog-close').invoke('observe', 'click', function(ev) {
|
$$('a.e-dialog-close').invoke('observe', 'click', function(ev) {
|
||||||
parent.e107Widgets.DialogManagerDefault.getWindow('e-dialog').close();
|
parent.e107Widgets.DialogManagerDefault.getWindow('e-dialog').close();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Menu Manager Layout drop-down options
|
||||||
|
|
||||||
|
$$('#menuManagerSelect').invoke('observe', 'change', function(ev) {
|
||||||
|
var link = ev.element().value;
|
||||||
|
$('menu_iframe').writeAttribute('data', link);
|
||||||
|
});
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
|
// alert('fix me : jayya/admin_theme.php (inline js)');
|
||||||
}, document, true);
|
}, document, true);
|
||||||
"
|
"
|
||||||
,'prototype');
|
,'prototype');
|
||||||
|
Reference in New Issue
Block a user