mirror of
https://github.com/e107inc/e107.git
synced 2025-08-06 06:38:00 +02:00
Removed old tree_menu plugin.
This commit is contained in:
@@ -1,87 +0,0 @@
|
|||||||
<?php
|
|
||||||
/*
|
|
||||||
* e107 website system
|
|
||||||
*
|
|
||||||
* Copyright (C) 2008-2013 e107 Inc (e107.org)
|
|
||||||
* Released under the terms and conditions of the
|
|
||||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
|
||||||
*
|
|
||||||
* Plugin Administration - Tree menu
|
|
||||||
*
|
|
||||||
* $URL$
|
|
||||||
* $Id$
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
$eplug_admin = TRUE;
|
|
||||||
require_once('../../class2.php');
|
|
||||||
include_lan(e_PLUGIN.'tree_menu/languages/'.e_LANGUAGE.'.php');
|
|
||||||
|
|
||||||
if (!getperms('4'))
|
|
||||||
{
|
|
||||||
header('location:'.e_BASE.'index.php');
|
|
||||||
exit ;
|
|
||||||
}
|
|
||||||
require_once(e_ADMIN.'auth.php');
|
|
||||||
$mes = e107::getMessage();
|
|
||||||
$frm = e107::getForm();
|
|
||||||
|
|
||||||
$menu_pref = e107::getConfig('menu')->getPref('');
|
|
||||||
|
|
||||||
if (isset($_POST['update_menu']))
|
|
||||||
{
|
|
||||||
$temp = array();
|
|
||||||
foreach($_POST as $key => $value)
|
|
||||||
{
|
|
||||||
if ($value != TREE_L2)
|
|
||||||
{
|
|
||||||
$temp[$key] = $value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($admin_log->logArrayDiffs($temp,$menu_pref,'MISC_01'))
|
|
||||||
{
|
|
||||||
$menuPref = e107::getConfig('menu');
|
|
||||||
foreach ($temp as $k => $v)
|
|
||||||
{
|
|
||||||
$menuPref->setPref($k, $v);
|
|
||||||
}
|
|
||||||
$menuPref->save(false, true, false);
|
|
||||||
}
|
|
||||||
$ns->tablerender($caption, $mes->render() . $text);
|
|
||||||
}
|
|
||||||
|
|
||||||
$text = "
|
|
||||||
<form method='post' action='".e_SELF."?".e_QUERY."' name='menu_conf_form'>
|
|
||||||
<table class='table adminform'>
|
|
||||||
<colgroup span='2'>
|
|
||||||
<col class='col-label' />
|
|
||||||
<col class='col-control' />
|
|
||||||
</colgroup>
|
|
||||||
<tr>
|
|
||||||
<td>".TREE_L6."</td>
|
|
||||||
<td><input class='tbox' type='text' name='tm_class1' size='40' value='".$menu_pref['tm_class1']."' maxlength='20' /></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>".TREE_L7."</td>
|
|
||||||
<td><input class='tbox' type='text' name='tm_class2' size='40' value='".$menu_pref['tm_class2']."' maxlength='20' /></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>".TREE_L8."</td>
|
|
||||||
<td><input class='tbox' type='text' name='tm_class3' size='40' value='".$menu_pref['tm_class3']."' maxlength='20' /></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>".TREE_L9."</td>
|
|
||||||
<td>".$frm->radio_switch('tm_spacer', $menu_pref['tm_spacer'], LAN_YES, LAN_NO)."</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<div class='buttons-bar center'>
|
|
||||||
".$frm->admin_button('update_menu', LAN_UPDATE, 'update')."
|
|
||||||
</div>
|
|
||||||
</form>";
|
|
||||||
|
|
||||||
$ns->tablerender(TREE_L1, $text);
|
|
||||||
|
|
||||||
require_once(e_ADMIN."footer.php");
|
|
||||||
|
|
||||||
?>
|
|
@@ -1,24 +0,0 @@
|
|||||||
<?php
|
|
||||||
/*
|
|
||||||
* e107 website system
|
|
||||||
*
|
|
||||||
* Copyright (C) 2008-2013 e107 Inc (e107.org)
|
|
||||||
* Released under the terms and conditions of the
|
|
||||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
|
||||||
*
|
|
||||||
* $URL$
|
|
||||||
* $Id$
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
define("TREE_L1", "Tree Menu");
|
|
||||||
//define("TREE_L2", "Update Tree Menu Settings");
|
|
||||||
//define("TREE_L3", "Tree Menu configuration saved.");
|
|
||||||
//define("TREE_L4", "On");
|
|
||||||
//define("TREE_L5", "Off");
|
|
||||||
define("TREE_L6", "CSS class to use for non-openable links");
|
|
||||||
define("TREE_L7", "CSS class to use for openable links");
|
|
||||||
define("TREE_L8", "CSS class to use for opened links");
|
|
||||||
define("TREE_L9", "Use spacer class between main links");
|
|
||||||
|
|
||||||
?>
|
|
@@ -1,193 +0,0 @@
|
|||||||
<?php
|
|
||||||
/*
|
|
||||||
* e107 website system
|
|
||||||
*
|
|
||||||
* Copyright (C) 2008-2010 e107 Inc (e107.org)
|
|
||||||
* Released under the terms and conditions of the
|
|
||||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
|
||||||
*
|
|
||||||
* Tree menu
|
|
||||||
*
|
|
||||||
* $URL$
|
|
||||||
* $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (!defined('e107_INIT')) { exit; }
|
|
||||||
|
|
||||||
/* Modification to keep menu status during navigation on the site
|
|
||||||
- Call the language file (only used for title !!! Maybe this title can be included in the default language file)
|
|
||||||
- Add a HTML id to the span tags (menus) : span_$link_name
|
|
||||||
- Add a javascript function to write a cookie when menu is opened (updatecook)
|
|
||||||
- Add a javascript function if menu is closed or no subitem (clearcook)
|
|
||||||
- Add event onclick for div without subitem, and modify the existing events for items WITH subitems
|
|
||||||
- Add a PHP function to read cookie (if existing) when page is loaded and restore menu status (writing or not window.onload js function)
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* e107 Tree menu plugin
|
|
||||||
*
|
|
||||||
* Provides alternative menu style
|
|
||||||
*
|
|
||||||
* @package e107_plugins
|
|
||||||
* @subpackage tree_menu
|
|
||||||
* @version $Id$;
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
global $tp;
|
|
||||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE."/lan_sitelinks.php");
|
|
||||||
|
|
||||||
// Many thanks to Lolo Irie for fixing the javascript that drives this menu item
|
|
||||||
unset($text);
|
|
||||||
|
|
||||||
$query = "SELECT * FROM #links WHERE link_class IN (".USERCLASS_LIST.") ORDER BY link_order ASC";
|
|
||||||
$sql -> db_Select_gen($query);
|
|
||||||
$linkArray = $sql->db_getList();
|
|
||||||
|
|
||||||
// all main links now held in array, we now need to loop through them and assign the sublinks to the correct parent links ...
|
|
||||||
|
|
||||||
$mainLinkArray = array();
|
|
||||||
foreach($linkArray as $links)
|
|
||||||
{
|
|
||||||
// Updated to stop using the deprecated method of splitting the link-name in 3.
|
|
||||||
// Now uses uses the link parent to determine the 'tree'.
|
|
||||||
|
|
||||||
extract ($links);
|
|
||||||
if ($link_parent == 0)
|
|
||||||
{
|
|
||||||
// main link - add to main array ...
|
|
||||||
$mainLinkArray[$link_id]['id'] = $link_id;
|
|
||||||
$mainLinkArray[$link_id]['name'] = $tp->toHtml(strip_tags($link_name),"","defs");
|
|
||||||
$mainLinkArray[$link_id]['url'] = $link_url;
|
|
||||||
$mainLinkArray[$link_id]['description'] = $link_description;
|
|
||||||
$mainLinkArray[$link_id]['image'] = $link_button;
|
|
||||||
$mainLinkArray[$link_id]['openMethod'] = $link_open;
|
|
||||||
$mainLinkArray[$link_id]['class'] = $link_class;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// submenu - add to parent's array entry ...
|
|
||||||
$tmp = explode(".", $link_name);
|
|
||||||
$submenu_name = ($tmp[2]) ? $tmp[2] : $link_name;
|
|
||||||
|
|
||||||
$mainLinkArray[$link_parent]['sublink'][$link_id]['parent_name'] = $link_parent;
|
|
||||||
$mainLinkArray[$link_parent]['sublink'][$link_id]['id'] = $link_id;
|
|
||||||
$mainLinkArray[$link_parent]['sublink'][$link_id]['name'] = $tp->toHtml(strip_tags($submenu_name),"","defs");
|
|
||||||
$mainLinkArray[$link_parent]['sublink'][$link_id]['url'] = $link_url;
|
|
||||||
$mainLinkArray[$link_parent]['sublink'][$link_id]['description'] = $links['link_description'];
|
|
||||||
$mainLinkArray[$link_parent]['sublink'][$link_id]['image'] = $link_button;
|
|
||||||
$mainLinkArray[$link_parent]['sublink'][$link_id]['openMethod'] = $link_open;
|
|
||||||
$mainLinkArray[$link_parent]['sublink'][$link_id]['class'] = $link_class;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// ok, now all mainlinks and sublinks are held in the array, now we have to loop through and build the text to send to screen ...
|
|
||||||
|
|
||||||
$text = "";
|
|
||||||
foreach($mainLinkArray as $links) {
|
|
||||||
extract ($links);
|
|
||||||
if (array_key_exists("sublink", $links) && $links['name'] != "") {
|
|
||||||
// sublinks found ...
|
|
||||||
|
|
||||||
$url = "javascript:void(0);";
|
|
||||||
$spanName = $id;
|
|
||||||
$image = ($image ? "<img src='".e_IMAGE_ABS."icons/".$image."' alt='' style='vertical-align:middle;' />" : "»");
|
|
||||||
$plink = "<div".(varsettrue($menu_pref['tm_class2']) ? " class='{$menu_pref['tm_class2']}'" : "")." style='width:100%; cursor: pointer;' onclick='expandit(\"span_".$spanName."\");updatecook(\"".$spanName."\");'>".$image." ".setLink($name, $url, $openMethod, $description)."</div>\n";
|
|
||||||
$text .= (varsettrue($menu_pref['tm_spacer']) ? "<div class='spacer'>\n".$plink."\n</div>\n" : $plink);
|
|
||||||
} else {
|
|
||||||
// no sublinks found ...
|
|
||||||
if($links['name'])
|
|
||||||
{
|
|
||||||
$linkName = $url;
|
|
||||||
$spanName = "";
|
|
||||||
$image = ($image ? "<img src='".e_IMAGE_ABS."icons/".$image."' alt='' style='vertical-align:middle;' />" : "·");
|
|
||||||
$plink = "<div".(varsettrue($menu_pref['tm_class1']) ? " class='{$menu_pref['tm_class1']}'" : "")." style='width:100%; cursor: pointer;'>".$image." ".setLink($name, $url, $openMethod, $description)."</div>";
|
|
||||||
$text .= (varsettrue($menu_pref['tm_spacer']) ? "<div class='spacer'>\n".$plink."\n</div>\n" : $plink);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$c = 0;
|
|
||||||
if (array_key_exists("sublink", $links) && $links['name'] != "" ) {
|
|
||||||
|
|
||||||
$text .= "\n<span style=\"display:none\" id=\"span_".$spanName."\">\n";
|
|
||||||
foreach($sublink as $link) {
|
|
||||||
extract($link);
|
|
||||||
$image = ($image ? "<img src='".e_IMAGE_ABS."icons/".$image."' alt='' style='vertical-align:middle' /> " : "· ");
|
|
||||||
$spanName = $parent_name;
|
|
||||||
|
|
||||||
$plink = $image." ".setLink($name, $url, $openMethod, $description)."<br />\n";
|
|
||||||
$text .=(varsettrue($menu_pref['tm_class3']) ? "<span".(varsettrue($menu_pref['tm_class3']) ? " class='{$menu_pref['tm_class3']}'" : "").">".$plink."</span>\n\n" : $plink);
|
|
||||||
}
|
|
||||||
$text .= "</span>\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function setlink($link_name, $link_url, $link_open, $link_description)
|
|
||||||
{
|
|
||||||
global $tp;
|
|
||||||
if (strpos($link_url, '://') === FALSE && strpos($link_url, 'mailto:') !== 0 && !strstr($link_url, "void"))
|
|
||||||
{
|
|
||||||
$link_url = SITEURL.$link_url;
|
|
||||||
}
|
|
||||||
$link_url = $tp->replaceConstants($link_url, $nonrelative = TRUE, $all = false);
|
|
||||||
$href = " href='".$link_url."'";
|
|
||||||
switch ($link_open)
|
|
||||||
{
|
|
||||||
case 1:
|
|
||||||
$link_append = " rel='external'";
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
$link_append = "";
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
$link_append = "";
|
|
||||||
break;
|
|
||||||
case 4 :
|
|
||||||
case 5 :
|
|
||||||
$dimen = ($link_open == 4) ? '600,400' : '800,600';
|
|
||||||
$href = " href=\"javascript:open_window('".$link_url."',{$dimen})\"";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$link_append = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
$link = "<a style='text-decoration:none' title='".$link_description."'{$link_append}{$href} >".$link_name."</a>\n";
|
|
||||||
return $link;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(isset($_COOKIE["treemenustatus"]) && $_COOKIE["treemenustatus"]) ? $treemenustatus = $_COOKIE["treemenustatus"] : $treemenustatus = "0";
|
|
||||||
$text .= "
|
|
||||||
<script type='text/javascript'>
|
|
||||||
<!--
|
|
||||||
function updatecook(itemmenu){
|
|
||||||
cookitem='span_'+itemmenu;
|
|
||||||
if (document.getElementById(cookitem).style.display!='none'){
|
|
||||||
var expireDate = new Date;
|
|
||||||
expireDate.setMinutes(expireDate.getMinutes()+10);
|
|
||||||
document.cookie = \"treemenustatus=\" + itemmenu + \"; expires=\" + expireDate.toGMTString()+\";path=/\";
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
clearcook();
|
|
||||||
}
|
|
||||||
}\n
|
|
||||||
|
|
||||||
function clearcook(){
|
|
||||||
var expireDate = new Date;
|
|
||||||
expireDate.setMinutes(expireDate.getMinutes()+10);
|
|
||||||
document.cookie = \"treemenustatus=\" + \"0\" + \"; expires=\" + expireDate.toGMTString();
|
|
||||||
}\n
|
|
||||||
//-->\n
|
|
||||||
";
|
|
||||||
|
|
||||||
(($treemenustatus != "0" && isset($treemenustatus))?$text .= "window.onload=document.getElementById('span_".$treemenustatus."').style.display=''":"");
|
|
||||||
|
|
||||||
$text .= "</script>
|
|
||||||
";
|
|
||||||
$ns->tablerender(LAN_SITELINKS_183, $text, 'tree_menu');
|
|
||||||
|
|
||||||
?>
|
|
Reference in New Issue
Block a user