Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

eznewsfeed/admin/categoryedit.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: categoryedit.php 8504 2001-11-19 09:46:46Z jhe $
5 //
6 // Created on: <16-Nov-2000 13:02:32 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/eztemplate.php" );
29 // include_once( "classes/ezlocale.php" );
30 // include_once( "classes/ezhttptool.php" );
31
32 // include_once( "eznewsfeed/classes/eznews.php" );
33
34 // include_once( "classes/ezdatetime.php" );
35
36 // include_once( "eznewsfeed/classes/eznews.php" );
37 // include_once( "eznewsfeed/classes/eznewscategory.php" );
38
39 if ( $Action == "Insert" )
40 {
41 $category = new eZNewsCategory();
42 $category->setName( $CategoryName );
43 $category->setDescription( $CategoryDescription );
44 $category->store();
45
46 eZHTTPTool::header( "Location: /newsfeed/archive/" );
47 exit();
48 }
49
50 if ( $Action == "Update" )
51 {
52 $category = new eZNewsCategory( $CategoryID );
53 $category->setName( $CategoryName );
54 $category->setDescription( $CategoryDescription );
55 $category->store();
56
57 eZHTTPTool::header( "Location: /newsfeed/archive/" );
58 exit();
59 }
60
61 if ( $Action == "Delete" )
62 {
63 $category = new eZNewsCategory( $CategoryID );
64 $category->delete();
65
66 eZHTTPTool::header( "Location: /newsfeed/archive/" );
67 exit();
68 }
69 $news = new eZNews();
70
71 $ini = eZINI::instance( 'site.ini' );
72
73 $Language = $ini->variable( "eZNewsFeedMain", "Language" );
74 $ImageDir = $ini->variable( "eZNewsFeedMain", "ImageDir" );
75
76 $t = new eZTemplate( "kernel/eznewsfeed/admin/" . $ini->variable( "eZNewsFeedMain", "AdminTemplateDir" ),
77 "kernel/eznewsfeed/admin/intl/", $Language, "categoryedit.php" );
78
79 $t->setAllStrings();
80
81 $t->set_file( array(
82 "category_edit_page_tpl" => "categoryedit.tpl"
83 ) );
84
85 // $t->set_block( "news_edit_page_tpl", "news_edit_tpl", "head_line" );
86
87 $t->set_var( "category_name_value", "" );
88 $t->set_var( "category_description_value", "" );
89 $t->set_var( "action_value", "Insert" );
90 $t->set_var( "category_id", "" );
91
92 if ( $Action == "Edit" )
93 {
94 $category = new eZNewsCategory( $CategoryID );
95 $t->set_var( "action_value", "Update" );
96 $t->set_var( "category_id", $category->id() );
97
98 $t->set_var( "category_name_value", $category->name() );
99 $t->set_var( "category_description_value", $category->description() );
100 }
101
102
103 $t->pparse( "output", "category_edit_page_tpl" );
104
105 ?>
$category
if( $Action=="Edit") $category
Definition: adedit.php:378
$CategoryID
$CategoryID
Definition: admin/articleedit.php:53
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZNewsCategory
Definition: eznewscategory.php:42
eZNews
Definition: eznews.php:63
eZTemplate
Definition: eztemplate.php:107
$Action
$Action
Definition: companysearch.php:80
$news
if( $Action=="Insert") if( $Action=="Update") if( $Action=="Delete") $news
Definition: eznewsfeed/admin/categoryedit.php:69
$ImageDir
$ImageDir
Definition: eznewsfeed/admin/categoryedit.php:74
$t
$t
Definition: eznewsfeed/admin/categoryedit.php:76
$Language
$Language
Definition: eznewsfeed/admin/categoryedit.php:73
$ini
$ini
Definition: eznewsfeed/admin/categoryedit.php:71
exit
exit
Definition: folder.php:81
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.