Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

menuedit.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: menuedit.php 7507 2001-09-27 10:43:55Z ce $
5 //
6 // Created on: <27-Sep-2001 12:38:58 ce>
7 //
8 // This source file is part of Exponential Basic, publishing software.
9 //
10 // Copyright (C) 1999-2001 eZ Systems. All rights reserved.
11 //
12 // This program is free software; you can redistribute it and/or
13 // modify it under the terms of the GNU General Public License
14 // as published by the Free Software Foundation; either version 2
15 // of the License, or (at your option) any later version.
16 //
17 // This program is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program; if not, write to the Free Software
24 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
25 //
26
27 // include_once( "classes/INIFile.php" );
28 // include_once( "classes/eztemplate.php" );
29 // include_once( "classes/ezhttptool.php" );
30
31 // include_once( "ezsitemanager/classes/ezmenu.php" );
32
33 if ( isset ( $OK ) )
34 {
35 $Action = "Insert";
36 }
37 if ( isset ( $Delete ) )
38 {
39 $Action = "Delete";
40 }
41 if ( isset ( $Cancel ) )
42 {
43 eZHTTPTool::header( "Location: /sitemanager/menu/list/" );
44 exit();
45 }
46
47 $ini =& eZINI::instance( 'site.ini' );
48 $Language = $ini->variable( "eZSiteManagerMain", "Language" );
49
50 $t = new eZTemplate( "kernel/ezsitemanager/admin/" . $ini->variable( "eZSiteManagerMain", "AdminTemplateDir" ),
51 "kernel/ezsitemanager/admin/" . "/intl", $Language, "menuedit.php" );
52 $t->setAllStrings();
53
54 $t->set_file( array(
55 "menu_edit_page" => "menuedit.tpl"
56 ) );
57
58 $t->set_block( "menu_edit_page", "menu_item_tpl", "menu_item" );
59
60 $t->set_var( "menu_item", "" );
61 $t->set_var( "menu_name", "" );
62 $t->set_var( "menu_link", "" );
63
64 if ( ( isset( $Action ) && $Action == "Insert" ) || ( isset( $Action ) && $Action == "Update" ) && ( $user ) )
65 {
66 if ( is_numeric( $MenuID ) )
67 $menu = new eZMenu( $MenuID );
68 else
69 $menu = new eZMenu();
70
71 $menu->setName( $Name );
72 $menu->setLink( $Link );
73 $menu->setParent( $ParentID );
74 if( isset( $Type ) )
75 $menu->setType( $Type );
76
77 $menu->store();
78
79 eZHTTPTool::header( "Location: /sitemanager/menu/list/" );
80 exit();
81 }
82
83 if ( isset( $Action ) && $Action == "Delete" )
84 {
85 if ( count ( $MenuArrayID ) > 0 )
86 {
87 foreach( $MenuArrayID as $MenuID )
88 {
89 $menu = new eZMenu( $MenuID );
90 $menu->delete();
91 }
92 }
93 eZHTTPTool::header( "Location: /sitemanager/menu/list/" );
94 exit();
95 }
96
97 if ( isset( $MenuID ) && is_numeric( $MenuID ) )
98 {
99 $menu = new eZMenu( $MenuID );
100
101 $t->set_var( "menu_id", $menu->id() );
102 $t->set_var( "menu_name", $menu->name() );
103 $t->set_var( "menu_link", $menu->link() );
104
105 if ( $menu->type() == 1 )
106 $t->set_var( "1_checked", "checked" );
107 else
108 $t->set_var( "2_checked", "checked" );
109 $parent = $menu->parent();
110
111 }
112 else
113 {
114 $t->set_var( "menu_id", '');
115 }
116
117 $menuList =& eZMenu::getAll();
118
119 foreach( $menuList as $menuItem )
120 {
121 $t->set_var( "select_id", $menuItem->id() );
122 $t->set_var( "select_name", $menuItem->name() );
123
124
125 if ( isset( $parent ) && $parent )
126 {
127 if ( $parent->id() == $menuItem->id() )
128 {
129 $t->set_var( "selected", "selected" );
130 }
131 else
132 {
133 $t->set_var( "selected", "" );
134 }
135 }
136 else
137 $t->set_var( "root_select", "selected" );
138
139 if ( $MenuID != $menuItem->id() )
140 $t->parse( "menu_item", "menu_item_tpl", true );
141 }
142
143 $t->pparse( "output", "menu_edit_page" );
144
145 ?>
$Link
$Link
Definition: articlelistrss.php:37
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZMenu
Definition: ezmenu.php:45
eZMenu\getAll
static & getAll( $offset=0, $limit=20)
Definition: ezmenu.php:180
eZTemplate
Definition: eztemplate.php:107
$Action
$Action
Definition: companysearch.php:80
$ParentID
$ParentID
Definition: eztrade/admin/categorylist.php:171
exit
exit
Definition: folder.php:81
$t
$t
Definition: menuedit.php:50
$Language
$Language
Definition: menuedit.php:48
$menuList
$menuList
Definition: menuedit.php:117
$ini
if(isset( $OK)) if(isset( $Delete)) if(isset( $Cancel)) $ini
Definition: menuedit.php:47
$menu
$menu
Definition: menulist.php:61
$Name
$Name
Definition: polledit.php:250
$user
$user
Definition: user/adlist.php:39
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.