mirror of
https://github.com/e107inc/e107.git
synced 2025-08-07 23:26:41 +02:00
Menu Manager Enhancements. And removal of the deprecated 'preview' button on the newspost page.
This commit is contained in:
@@ -62,7 +62,7 @@ if(strpos(e_QUERY, 'configure') !== FALSE || vartrue($_GET['enc']))
|
|||||||
|
|
||||||
// e107::css('core', 'core/admin.css', 'jquery');
|
// e107::css('core', 'core/admin.css', 'jquery');
|
||||||
// e107::js('core', 'core/admin.jquery.js', 'jquery', 4);
|
// e107::js('core', 'core/admin.jquery.js', 'jquery', 4);
|
||||||
// e107::js('core','bootstrap/js/bootstrap.min.js');
|
e107::js('core','bootstrap/js/bootstrap-tooltip.js');
|
||||||
// e107::css('core','bootstrap/css/bootstrap.min.css');
|
// e107::css('core','bootstrap/css/bootstrap.min.css');
|
||||||
e107::js('inline', "
|
e107::js('inline', "
|
||||||
$(function() {
|
$(function() {
|
||||||
@@ -219,21 +219,47 @@ if(strpos(e_QUERY, 'configure') !== FALSE || vartrue($_GET['enc']))
|
|||||||
select.menu-btn { text-align:left }
|
select.menu-btn { text-align:left }
|
||||||
|
|
||||||
label { font-size: 12px; line-height:14px }
|
label { font-size: 12px; line-height:14px }
|
||||||
|
label.input {margin-right:10px }
|
||||||
|
|
||||||
#core-menumanager-main { width:100%; margin-left:auto; margin-right:auto }
|
#core-menumanager-main { width:100%; margin-left:auto; margin-right:auto }
|
||||||
|
|
||||||
|
|
||||||
table.table { width: 95% ; margin-left:auto; margin-right:auto; }
|
table.table { width: 95% ; margin-left:auto; margin-right:auto; }
|
||||||
|
|
||||||
label.selection-row { padding:6px ; cursor: pointer; width:90%}
|
label.selection-row { padding:6px ; cursor: pointer; width:90%}
|
||||||
|
|
||||||
|
table.table tbody > tr >td { }
|
||||||
|
table.table tbody > tr >td label { padding:15px; display:block; cursor: pointer; font-size:14px ; }
|
||||||
|
table.table tbody > tr >td label > input { margin-right: 10px; }
|
||||||
|
|
||||||
table.table tbody > tr >td { }
|
|
||||||
table.table tbody > tr >td label { padding:15px; display:block; cursor: pointer; font-size:14px ; }
|
|
||||||
|
|
||||||
.table-striped tbody > tr:nth-child(2n+1) > td, .table-striped tbody > tr:nth-child(2n+1) > th {
|
.table-striped tbody > tr:nth-child(2n+1) > td, .table-striped tbody > tr:nth-child(2n+1) > th {
|
||||||
background-color: rgb(249, 249, 249);
|
background-color: rgb(249, 249, 249);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.menu-panel {
|
||||||
|
min-height: 20px;
|
||||||
|
padding: 19px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
background-color: rgb(245, 245, 245);
|
||||||
|
border: 1px solid rgb(227, 227, 227);
|
||||||
|
border-radius: 4px 4px 4px 4px;
|
||||||
|
box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.05) inset;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-panel-header
|
||||||
|
{
|
||||||
|
display: block;
|
||||||
|
padding: 3px 15px;
|
||||||
|
font-size: 11px;
|
||||||
|
font-weight: bold;
|
||||||
|
line-height: 20px;
|
||||||
|
color: rgb(153, 153, 153);
|
||||||
|
text-shadow: 0px 1px 0px rgba(255, 255, 255, 0.5);
|
||||||
|
text-transform: uppercase;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
",'jquery');
|
",'jquery');
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1930,10 +1930,10 @@ class admin_newspost
|
|||||||
$frm = e107::getForm();
|
$frm = e107::getForm();
|
||||||
|
|
||||||
$text = '';
|
$text = '';
|
||||||
if (isset($_POST['preview']))
|
/// if (isset($_POST['preview'])) // Deprecated
|
||||||
{
|
// {
|
||||||
$text = $this->preview_item($this->getId());
|
// $text = $this->preview_item($this->getId());
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
$sub_action = $this->getSubAction();
|
$sub_action = $this->getSubAction();
|
||||||
@@ -2387,9 +2387,11 @@ class admin_newspost
|
|||||||
</table>
|
</table>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
<div class='buttons-bar center'>
|
<div class='buttons-bar center'>";
|
||||||
".$frm->admin_button('preview', isset($_POST['preview']) ? NWSLAN_24 : NWSLAN_27 , 'other')."
|
|
||||||
".$frm->admin_button('submit_news', ($id && $sub_action != "sn" && $sub_action != "upload") ? NWSLAN_25 : NWSLAN_26 , 'update')."
|
// ".$frm->admin_button('preview', isset($_POST['preview']) ? NWSLAN_24 : NWSLAN_27 , 'other')."
|
||||||
|
|
||||||
|
$text .= $frm->admin_button('submit_news', ($id && $sub_action != "sn" && $sub_action != "upload") ? NWSLAN_25 : NWSLAN_26 , 'update')."
|
||||||
".$frm->checkbox('create_edit_stay', 1, isset($_POST['create_edit_stay'])).$frm->label(LAN_NEWS_54, 'create_edit_stay', 1)."
|
".$frm->checkbox('create_edit_stay', 1, isset($_POST['create_edit_stay'])).$frm->label(LAN_NEWS_54, 'create_edit_stay', 1)."
|
||||||
<input type='hidden' name='news_id' value='{$id}' />
|
<input type='hidden' name='news_id' value='{$id}' />
|
||||||
</div>
|
</div>
|
||||||
|
@@ -259,7 +259,7 @@ class e_menuManager {
|
|||||||
|
|
||||||
if ($menu_act == "bot")
|
if ($menu_act == "bot")
|
||||||
{
|
{
|
||||||
$menu_count = $sql->db_Count("menus", "(*)", " WHERE menu_location='{$location}' AND menu_layout = '".$this->dbLayout."' ");
|
$menu_count = $sql->count("menus", "(*)", " WHERE menu_location='{$location}' AND menu_layout = '".$this->dbLayout."' ");
|
||||||
$sql->db_Update("menus", "menu_order=".($menu_count+1)." WHERE menu_order='{$position}' AND menu_location='{$location}' AND menu_layout = '$this->dbLayout' ");
|
$sql->db_Update("menus", "menu_order=".($menu_count+1)." WHERE menu_order='{$position}' AND menu_location='{$location}' 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."' ");
|
$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_06',$location.'[!br!]'.$position.'[!br!]'.$this->menuId,E_LOG_INFORMATIVE,'');
|
$admin_log->log_event('MENU_06',$location.'[!br!]'.$position.'[!br!]'.$this->menuId,E_LOG_INFORMATIVE,'');
|
||||||
@@ -363,7 +363,7 @@ class e_menuManager {
|
|||||||
$file['path'] = str_replace(e_PLUGIN,"",$file['path']);
|
$file['path'] = str_replace(e_PLUGIN,"",$file['path']);
|
||||||
$file['fname'] = str_replace(".php","",$file['fname']);
|
$file['fname'] = str_replace(".php","",$file['fname']);
|
||||||
$valid_menu = FALSE;
|
$valid_menu = FALSE;
|
||||||
$existing_menu = $sql->db_Count("menus", "(*)", "WHERE menu_name='{$file['fname']}'");
|
$existing_menu = $sql->count("menus", "(*)", "WHERE menu_name='{$file['fname']}'");
|
||||||
if (file_exists(e_PLUGIN.$parent_dir.'/plugin.xml') || file_exists(e_PLUGIN.$parent_dir.'/plugin.php'))
|
if (file_exists(e_PLUGIN.$parent_dir.'/plugin.xml') || file_exists(e_PLUGIN.$parent_dir.'/plugin.php'))
|
||||||
{
|
{
|
||||||
if (e107::isInstalled($parent_dir))
|
if (e107::isInstalled($parent_dir))
|
||||||
@@ -476,7 +476,7 @@ class e_menuManager {
|
|||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
Parameters (query string format):
|
Parameters (query string format):
|
||||||
".$frm->text('menu_parms', $row['menu_parms'], 900, 'class=e-save span8')."
|
".$frm->text('menu_parms', $row['menu_parms'], 900, 'class=e-save span7')."
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>";
|
</table>";
|
||||||
@@ -597,7 +597,7 @@ class e_menuManager {
|
|||||||
|
|
||||||
$location = $this->menuActivateLoc;
|
$location = $this->menuActivateLoc;
|
||||||
|
|
||||||
$menu_count = $sql->db_Count("menus", "(*)", " WHERE menu_location=".$location." AND menu_layout = '".$this->dbLayout."' ");
|
$menu_count = $sql->count("menus", "(*)", " WHERE menu_location=".$location." AND menu_layout = '".$this->dbLayout."' ");
|
||||||
|
|
||||||
foreach($this->menuActivateIds as $sel_mens)
|
foreach($this->menuActivateIds as $sel_mens)
|
||||||
{
|
{
|
||||||
@@ -839,7 +839,7 @@ class e_menuManager {
|
|||||||
//Check to see if menu is already active in the new area, if not then move it
|
//Check to see if menu is already active in the new area, if not then move it
|
||||||
if(!$sql->select('menus', 'menu_id', "menu_name='{$row['menu_name']}' AND menu_location = ".$this->menuNewLoc." AND menu_layout='".$this->dbLayout ."' LIMIT 1"))
|
if(!$sql->select('menus', 'menu_id', "menu_name='{$row['menu_name']}' AND menu_location = ".$this->menuNewLoc." AND menu_layout='".$this->dbLayout ."' LIMIT 1"))
|
||||||
{
|
{
|
||||||
$menu_count = $sql->db_Count("menus", "(*)", " WHERE menu_location=".$this->menuNewLoc);
|
$menu_count = $sql->count("menus", "(*)", " WHERE menu_location=".$this->menuNewLoc);
|
||||||
$sql->db_Update("menus", "menu_location='{$this->menuNewLoc}', menu_order=".($menu_count+1)." WHERE menu_id=".$this->menuId);
|
$sql->db_Update("menus", "menu_location='{$this->menuNewLoc}', menu_order=".($menu_count+1)." WHERE menu_id=".$this->menuId);
|
||||||
$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 ."' ");
|
||||||
}
|
}
|
||||||
@@ -905,7 +905,7 @@ class e_menuManager {
|
|||||||
$row['menu_name'] = preg_replace("#_menu$#i", "", $row['menu_name']);
|
$row['menu_name'] = preg_replace("#_menu$#i", "", $row['menu_name']);
|
||||||
if($pnum = $this->checkMenuPreset($menuPreset,$row['menu_name'].'_menu'))
|
if($pnum = $this->checkMenuPreset($menuPreset,$row['menu_name'].'_menu'))
|
||||||
{
|
{
|
||||||
$pdeta = MENLAN_39." {$pnum}";
|
$pdeta = MENLAN_39." {$pnum}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1067,10 +1067,20 @@ class e_menuManager {
|
|||||||
$ret[] = $match;
|
$ret[] = $match;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function renderPanel($caption,$text)
|
||||||
|
{
|
||||||
|
$plugtext = "<div class='menu-panel'>";
|
||||||
|
$plugtext .= "<div class='menu-panel-header' title=\"".MENLAN_34."\">".$caption."</div>";
|
||||||
|
$plugtext .= $text;
|
||||||
|
$plugtext .= "</div>";
|
||||||
|
return $plugtext;
|
||||||
|
}
|
||||||
|
|
||||||
function checklayout($str)
|
function checklayout($str)
|
||||||
{ // Displays a basic representation of the theme
|
{ // Displays a basic representation of the theme
|
||||||
global $PLUGINS_DIRECTORY, $rs, $sc_style, $menu_order;
|
global $PLUGINS_DIRECTORY, $rs, $sc_style, $menu_order;
|
||||||
|
$PLUGINS_DIRECTORY = e107::getFolder('PLUGINS');
|
||||||
$pref = e107::getPref();
|
$pref = e107::getPref();
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
$ns = e107::getRender();
|
$ns = e107::getRender();
|
||||||
@@ -1118,9 +1128,13 @@ class e_menuManager {
|
|||||||
$link = e_PLUGIN . $plug . "/config.php";
|
$link = e_PLUGIN . $plug . "/config.php";
|
||||||
}
|
}
|
||||||
|
|
||||||
$plugtext = ($link) ? "(" . MENLAN_34 . ":<a href='$link' title='" . LAN_CONFIGURE . "'>" . LAN_CONFIGURE . "</a>)" : "(" . MENLAN_34 . ")";
|
// $plugtext = "<div class='menu-panel'>";
|
||||||
|
// $plugtext .= "<div class='menu-panel-header' title=\"".MENLAN_34."\">".$plug."</div>";
|
||||||
|
$plugtext = ($link) ? "(" . MENLAN_34 . ":<a href='$link btn-menu' title='" . LAN_CONFIGURE . "'>" . LAN_CONFIGURE . "</a>)" : "";
|
||||||
|
// $plugtext .= "</div>";
|
||||||
echo "<br />";
|
echo "<br />";
|
||||||
$ns->tablerender($plug, $plugtext);
|
echo $this->renderPanel($plug, $plugtext);
|
||||||
|
// $ns->tablerender($plug, $plugtext);
|
||||||
}
|
}
|
||||||
else if(strstr($str, "MENU"))
|
else if(strstr($str, "MENU"))
|
||||||
{
|
{
|
||||||
@@ -1137,25 +1151,16 @@ class e_menuManager {
|
|||||||
$menuText .= $sc_style['MENU']['pre'];
|
$menuText .= $sc_style['MENU']['pre'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ---------------
|
// ---------------
|
||||||
$menuText .= "\n\n<!-- START AREA ".$menu." -->";
|
$menuText .= "\n\n<!-- START AREA ".$menu." -->";
|
||||||
$menuText .= "
|
$menuText .= "<div id='start-area-".$menu."' class='menu-panel'>";
|
||||||
<div id='start-area-".$menu."'>";
|
|
||||||
|
$menuText .= "<div class='menu-panel-header' >" . MENLAN_14 . " " . $menu . "</div>\n\n";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$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');
|
// $sql9 = e107::getDb('sql9');
|
||||||
if($sql9->db_Count("menus", "(*)", " WHERE menu_location='$menu' AND menu_layout = '" . $this->dbLayout . "' "))
|
if($sql9->count("menus", "(*)", " WHERE menu_location='$menu' AND menu_layout = '" . $this->dbLayout . "' "))
|
||||||
{
|
{
|
||||||
unset($text);
|
unset($text);
|
||||||
$menuText .= $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));
|
||||||
@@ -1325,7 +1330,7 @@ class e_menuManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$editLink = e_SELF."?enc=".base64_encode('lay='.$this->curLayout.'&parmsId='.$menu_id.'&iframe=1');
|
$editLink = e_SELF."?enc=".base64_encode('lay='.$this->curLayout.'&parmsId='.$menu_id.'&iframe=1');
|
||||||
$text .= '<a class="e-menumanager-option menu-btn" target="_top" href="'.$editLink.'" title="Configure parameters">'.ADMIN_EDIT_ICON.'</a>';
|
$text .= '<a class="e-menumanager-option menu-btn e-tip" target="_top" href="'.$editLink.'" title="Configure parameters">'.ADMIN_EDIT_ICON.'</a>';
|
||||||
|
|
||||||
$text .= '<a title="'.LAN_DELETE.'" id="remove-'.$menu_id.'-'.$menu_location.'" class="e-tip delete e-menumanager-delete menu-btn" href="'.e_SELF.'?configure='.$this->curLayout.'&mode=deac&id='.$menu_id.'">'.ADMIN_DELETE_ICON.'</a>
|
$text .= '<a title="'.LAN_DELETE.'" id="remove-'.$menu_id.'-'.$menu_location.'" class="e-tip delete e-menumanager-delete menu-btn" href="'.e_SELF.'?configure='.$this->curLayout.'&mode=deac&id='.$menu_id.'">'.ADMIN_DELETE_ICON.'</a>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user