Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

categorytypeedit.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: categorytypeedit.php 6232 2001-07-20 11:36:07Z jakobn $
5 //
6 // Created on: <18-Oct-2000 15:04:39 bf>
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/ezhttptool.php" );
29 // include_once( "classes/eztemplate.php" );
30
31 // include_once( "ezuser/classes/ezuser.php" );
32 // include_once( "ezuser/classes/ezusergroup.php" );
33 // include_once( "ezuser/classes/ezmodule.php" );
34 // include_once( "ezuser/classes/ezpermission.php" );
35
36 // include_once( "eztodo/classes/ezcategory.php" );
37
38 $ini =& eZINI::instance( 'site.ini' );
39 $Language = $ini->variable( "eZTodoMain", "Language" );
40 $DOC_ROOT = $ini->variable( "eZTodoMain", "DocumentRoot" );
41
42 if ( isset( $Cancel ) )
43 {
44 eZHTTPTool::header( "Location: /todo/categorytypelist/" );
45 exit();
46 }
47
48 if ( isset( $Action ) && $Action == "insert" )
49 {
50 $type = new eZCategory();
51 $type->setName( $Name );
52 $type->store();
53
54 eZHTTPTool::header( "Location: /todo/categorytypelist/" );
55 exit();
56 }
57
58 // Update a category.
59 if ( isset( $Action ) && $Action == "update" )
60 {
61 $type = new eZCategory();
62 $type->get( $CategoryID );
63 $type->setName( $Name );
64 $type->store();
65
66 eZHTTPTool::header( "Location: /todo/categorytypelist/" );
67 exit();
68 }
69
70 // Delete a category.
71 if ( isset( $Action ) && $Action == "delete" )
72 {
73
74 $type = new eZCategory();
75 $type->get( $CategoryID );
76 $type->delete();
77
78 eZHTTPTool::header( "Location: /todo/categorytypelist/" );
79 exit();
80 }
81
82 $t = new eZTemplate( "kernel/eztodo/admin/" . $ini->variable( "eZTodoMain", "AdminTemplateDir" ),
83 "kernel/eztodo/admin/intl", $Language, "categorytypeedit.php" );
84 $t->set_file( array(
85 "categorytypeedit" => "categorytypeedit.tpl"
86 ) );
87
88 $t->setAllStrings();
89
90 $t->set_var( "action_value", "insert" );
91
92 // Edit a category.
93 if ( isset( $Action ) && $Action == "edit" )
94 {
95 $type = new eZCategory();
96 $type->get( $CategoryID );
97
98 $CategoryName = $type->name();
99
100 {
101 $type_array = $type->get( $CategoryID );
102 if ( is_bool( $type_array ) )
103 $type_array = array();
104
105 for ( $i=0; $i<count( $type_array); $i++ )
106 {
107 print( $type_array[$i][ "Name" ] );
108 }
109 }
110
111 $t->set_var( "category_type_id", $CategoryID );
112 $t->set_var( "action_value", "update" );
113 }
114
115 $t->set_var( "category_type_name", $CategoryName );
116 $t->set_var( "document_root", $DOC_ROOT );
117
118 $t->pparse( "output", "categorytypeedit" );
119
120 ?>
$i
$i
Definition: admin/adlist.php:91
$CategoryID
$CategoryID
Definition: admin/articleedit.php:53
$DOC_ROOT
$DOC_ROOT
Definition: categorytypeedit.php:40
$t
if(isset( $Cancel)) if(isset( $Action) && $Action=="insert") if(isset( $Action) && $Action=="update") if(isset( $Action) && $Action=="delete") $t
Definition: categorytypeedit.php:82
$Language
$Language
Definition: categorytypeedit.php:39
$ini
$ini
Definition: categorytypeedit.php:38
eZCategory
Definition: ezcategory.php:36
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZTemplate
Definition: eztemplate.php:107
$type
$type
Definition: classes/admin/linkselect.php:220
$Action
$Action
Definition: companysearch.php:80
exit
exit
Definition: folder.php:81
$Name
$Name
Definition: polledit.php:250
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.