Umfragen
edit.radioButtonList.handle.php
Go to the documentation of this file.
1 <?php
2 /*
3  * edit.radioButtonList.handle.php
4  *
5  * Copyright 2012 Johannes <jojo@jojo-42>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
20  * MA 02110-1301, USA.
21  *
22  *
23  */
24 if ( (isset($widget)) ){
25  $all_err_reason = array();
26 
27  $r = $widget->handle_option_list_edit();
28  if($r !== true){
29  $all_err_reason[] = $r;
30  }else{
31  $widget->save_option_list($db);
32  }
33 
34  $r = $widget->handle_dispName_edit();
35  if($r !== true){
36  $all_err_reason[] = $r;
37  }else{
38  $widget->save_dispName($db);
39  }
40 
41  $r = $widget->handle_required_edit();
42  if($r !== true){
43  $all_err_reason[] = $r;
44  }else{
45  $widget->save_required($db);
46  }
47 
48  $r = $widget->handle_display_as_drop_down_edit();
49  if($r !== true){
50  $all_err_reason[] = $r;
51  }else{
52  $widget->serialize_config();
53  $db->update_widget_field($widget , "config" , $widget->config);
54  $widget->unserialize_config();
55  }
56 
57  $r = $widget->handle_chartType_edit();
58  if($r !== true){
59  $all_err_reason[] = $r;
60  }
61 
62  $r = $widget->handle_show_charts_edit();
63  if($r !== true){
64  $all_err_reason[] = $r;
65  }
66 
67  $r = $widget->handle_columns_edit();
68  if($r !== true){
69  $all_err_reason[] = $r;
70  }
71 
72  $widget->save_config($db);
73 
74  if( $poll->type == POLLTYPE_ADVANCED ){
75  $old_name = $widget->name;
76  $r = $widget->handle_name_edit();
77  $names = $db->get_widget_names($widget->pollID);
78  foreach($names as $row){
79  if( ($row["name"] == $_POST["widget_name"]) AND ($old_name != $widget->name) ){
80  $r ="Dieser Datenbankname ist bereits vergeben. Bitte einen anderen Wählen.";
81  }
82  }
83 
84  if( $r !== true ){
85  $all_err_reason[] = $r;
86  }else{
87  $db->rename_result_column($widget->pollID,$widget->typ,$old_name,$widget->name);
88  $db->update_widget_field($widget,"name",$widget->name);
89  }
90  }
91 
92 
93 
94 }
95 ?>
96