Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

admin/surveylist.php
Go to the documentation of this file.
1 <?php
4 // include_once( "classes/INIFile.php" );
5 // include_once( "classes/eztemplate.php" );
6
7 // include_once( "ezsurvey/classes/ezsurvey.php" );
8 // include_once( "classes/ezlist.php" );
9
10 $ini =& eZINI::instance( 'site.ini' );
11 $Language = $ini->variable( "eZSurveyMain", "Language" );
12
13 $t = new eZTemplate( "kernel/ezsurvey/admin/" . $ini->variable( "eZSurveyMain", "AdminTemplateDir" ),
14 "kernel/ezsurvey/admin/intl", $Language, "surveylist.php" );
15 $t->setAllStrings();
16
17 $t->set_file( "surveylist_tpl", "surveylist.tpl" );
18 $t->set_block( "surveylist_tpl", "survey_list_tpl", "survey_list" );
19 $t->set_block( "survey_list_tpl", "survey_item_tpl", "survey_item" );
20 $t->set_block( "survey_item_tpl", "survey_item_stats_tpl", "survey_item_stats" );
21
22 $t->set_var( "survey_list", "" );
23
24 $surveyListLimit = $ini->variable( "eZSurveyMain", "SurveyListLimit" );
25
26 $offset = $url_array[4];
27
28 // Eliminar surveys
29 if ( isset( $DeleteSelected ) && isset( $formDelete ) )
30 {
31 foreach( $formDelete as $formDelete )
32 {
33 $survey = new eZSurvey( $formDelete );
34 $survey->delete();
35 }
36 $offset = 0;
37 }
38
39 $surveyCount = eZSurvey::numberOfSurveys();
40
41 if ( ! is_numeric($offset) )
42 {
43 $offset = 0;
44 }
45
46 $surveyList = eZSurvey::getAll( "ID", $offset, $surveyListLimit );
47
48 if ( count($surveyList) == 0 )
49 {
50 $t->set_var( "survey_list", "" );
51 }
52 else
53 {
54 $i = 0;
55 foreach ( $surveyList as $surveyItem )
56 {
57 if ($i++ % 2)
58 $t->set_var( "td_class", "bgdark" );
59 else
60 $t->set_var( "td_class", "bglight" );
61
62 $t->set_var( "survey_id", $surveyItem->id() );
63 $t->set_var( "survey_title", $surveyItem->title() );
64 $t->set_var( "survey_status", $surveyItem->status() );
65
66 if ( $surveyItem->status() == "ACTIVE" )
67 $t->parse( "survey_item_stats", "survey_item_stats_tpl" );
68 else
69 $t->set_var( "survey_item_stats", "" );
70
71 $t->parse( "survey_item", "survey_item_tpl", true );
72 }
73 $t->parse( "survey_list", "survey_list_tpl" );
74 }
75
76 eZList::drawNavigator( $t, $surveyCount, $surveyListLimit, $offset, "surveylist_tpl" );
77
78 $t->pparse( "output", "surveylist_tpl" );
79
80 ?>
$i
$i
Definition: admin/adlist.php:91
$t
$t
Definition: admin/surveylist.php:13
$Language
$Language
Definition: admin/surveylist.php:11
$ini
$ini
Definition: admin/surveylist.php:10
$surveyCount
if(isset( $DeleteSelected) &&isset( $formDelete)) $surveyCount
Definition: admin/surveylist.php:39
$surveyListLimit
$surveyListLimit
Definition: admin/surveylist.php:24
$offset
$offset
Definition: admin/surveylist.php:26
$surveyList
if(! is_numeric($offset)) $surveyList
Definition: admin/surveylist.php:46
eZList\drawNavigator
static drawNavigator(&$t, $total_types, $max_types, $index, $parent=false, $variables=false)
Definition: ezlist.php:401
eZSurvey
Definition: ezsurvey.php:8
eZSurvey\numberOfSurveys
static numberOfSurveys()
Definition: ezsurvey.php:276
eZSurvey\getAll
static getAll( $OrderBy="ID", $LimitStart="None", $LimitBy="None")
Definition: ezsurvey.php:68
eZTemplate
Definition: eztemplate.php:107
$url_array
$url_array
Definition: ezaddress/admin/datasupplier.php:34
$survey
if( $Page=="") if(isset( $OK)) if(isset( $NextPage)) if(isset( $PreviousPage)) $survey
Definition: preview.php:72
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.