Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

page4.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: page4.php 6212 2001-07-19 12:48:35Z jakobn $
5 //
6 // Created on: <22-Jun-2001 13:24:18 br>
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 the class files.
28
29 // include_once( "classes/eztemplate.php" );
30 // include_once( "ezexample/classes/ezexample.php" );
31
32 $ini =& eZINI::instance( 'site.ini' );
33 $Language = $ini->variable( "eZExampleMain", "Language" );
34
35 $tpl = new eZTemplate( "kernel/ezexample/admin/" . $ini->variable( "eZExampleMain", "AdminTemplateDir" ),
36 "kernel/ezexample/admin/" . "intl", $Language, "page4.php" );
37 $tpl->setAllStrings();
38
39 // Check which button is pressed.
40
41 if ( isset( $New ) )
42 {
43 $exmpl = new eZExample( );
44 $exmpl->setText( "" );
45 $exmpl->store();
46 updateValues( $IDArray, $TextArray );
47 }
48
49 if ( isset( $Update ) )
50 {
51 updateValues( $IDArray, $TextArray );
52 }
53
54 if ( isset( $Delete ) )
55 {
56 foreach( $DeleteArrayID as $id )
57 {
58 eZExample::delete( $id );
59 }
60 }
61
62 // get all fields from the database.
63
64 $textfield = new eZExample( );
65 $textfieldArray =& $textfield->getAll();
66
67 $tpl->set_file( "page4_tpl", "page4.tpl" );
68 $tpl->set_block( "page4_tpl", "row_tpl", "row" );
69 $tpl->set_var( "row", "" );
70
71 for( $i=0; $i< count($textfieldArray); $i++ )
72 {
73 $tpl->set_var( "row_text", $textfieldArray[$i]->Text() );
74 $tpl->set_var( "row_id", $textfieldArray[$i]->id() );
75 $tpl->parse( "row", "row_tpl", true );
76 }
77
78 $tpl->pparse( "output", "page4_tpl" );
79
83 function updateValues( $idArray, $textArray )
84 {
85 $i=0;
86 if ( count( $idArray ) > 0 )
87 foreach( $idArray as $id )
88 {
89 $exmpl = new eZExample( );
90 if ( $exmpl->get( $id ) )
91 {
92 $exmpl->setText( $textArray[ $i ] );
93 $exmpl->store();
94 }
95 $i++;
96 }
97 }
98 ?>
$i
$i
Definition: admin/adlist.php:91
eZExample
Definition: ezexample.php:32
eZExample\delete
delete( $id)
Definition: ezexample.php:141
eZTemplate
Definition: eztemplate.php:107
$id
$id
Definition: companytypelist.php:193
$tpl
$tpl
Definition: page4.php:35
$textfieldArray
$textfieldArray
Definition: page4.php:65
$Language
$Language
Definition: page4.php:33
$ini
$ini
Definition: page4.php:32
$textfield
if(isset( $New)) if(isset( $Update)) if(isset( $Delete)) $textfield
Definition: page4.php:64
updateValues
updateValues( $idArray, $textArray)
Definition: page4.php:83
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.