45 require_once(
"../config.php");
46 require_once(
"../inc/user.class.php");
47 require_once(
"../inc/tools.php");
48 require_once(
"../inc/check_login.php");
50 require_once(
"../inc/db.class.php");
51 require_once(
"../inc/config.class.php");
52 require_once(
"../inc/auth.class.php");
54 require_once(
"../inc/poll.class.php");
55 require_once(
"../inc/messages.class.php");
56 require_once(
"../inc/html.class.php");
58 $db=
new db( DB_USER, DB_PASS, DB_DATABASE, DB_HOST );
68 if ( (isset($_GET[
"pollID"])) AND
69 (is_numeric($_GET[
"pollID"])) AND
70 ($_GET[
"pollID"] !=
"")
74 if (!$poll->load_from_id(
$db, intval($_GET[
"pollID"]) ) ){
75 die(
"Umfrage existiert nicht.");
78 if ( (isset($_GET[
"widgetID"])) AND ($_GET[
"widgetID"] !=
"") AND (is_numeric($_GET[
"widgetID"])) ){
79 $widget = $poll->get_widget_by_id( intval($_GET[
"widgetID"]) );
87 if ( (isset($_GET[
"optionID"])) AND ($_GET[
"optionID"] !=
"") AND (is_numeric($_GET[
"optionID"])) ){
88 $option =
$widget->get_widget_by_id( intval($_GET[
"optionID"]) );
95 header(
"Location: index.php");
103 if( (intval($_SESSION[
"user"]->ID) !== intval($poll->owner) ) AND
104 ( !in_array(
"{$_SESSION["user"]->ID}",explode(
",",SUPER_ADMIN) )) ){
105 die(
"Umfrage Bearbeiten nicht erlaubt.");
109 if( isset($_GET[
"action"]) ){
114 if(
$edit ==
"poll" ){
115 $extra =
"<script src='".APP_ROOT.
"/JS/edit.poll.js'></script>";
119 $navbar = array( 0 => array(
"name"=>
"Backend",
"href"=>
"index.php",
"onclick"=>
"") );
121 if( (isset(
$widget)) AND (isset($option)) ){
122 $navbar[] = array(
"name"=>
"Umfrage {$poll->ID} Bearbeiten" ,
"href"=>
"edit.php?pollID={$poll->ID}" ,
"onclick"=>
"");
123 $navbar[] = array(
"name"=>
"Frage {$widget->ID} Bearbeiten" ,
"href"=>
"edit.php?pollID={$poll->ID}&widgetID={$widget->ID}" ,
"onclick"=>
"");
124 $navbar[] = array(
"name"=>
"Option {$option->ID} Bearbeiten" ,
"href"=>
"" ,
"onclick"=>
"");
126 $navbar[] = array(
"name"=>
"Umfrage {$poll->ID} Bearbeiten" ,
"href"=>
"edit.php?pollID={$poll->ID}" ,
"onclick"=>
"");
127 $navbar[] = array(
"name"=>
"Frage {$widget->ID} Bearbeiten" ,
"href"=>
"" ,
"onclick"=>
"");
129 $navbar[] = array(
"name"=>
"Umfrage {$poll->ID} Bearbeiten" ,
"href"=>
"" ,
"onclick"=>
"");
138 if (
$edit !=
"poll"){
143 if (
$edit ==
"poll"){
144 include(
INCLUDE_DIR.
"/backend/pages/edit.poll.php");
147 }
else if (
$edit ==
"widget"){
148 echo
"<div class='widget_edit_container'>";
153 }
else if(
$edit ==
"option"){
154 echo
"<div class='widget_edit_container'>";
155 if( $option instanceof
label ){
156 include(
INCLUDE_DIR.
"/backend/pages/edit.label.child.php");