Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

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