diff --git a/e107_plugins/poll/admin_config.php b/e107_plugins/poll/admin_config.php index f1d5d2709..1050dd778 100644 --- a/e107_plugins/poll/admin_config.php +++ b/e107_plugins/poll/admin_config.php @@ -2,16 +2,12 @@ /* * e107 website system * - * Copyright (C) 2008-2009 e107 Inc (e107.org) + * Copyright (C) 2008-2013 e107 Inc (e107.org) * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * - * - * - * $Source: /cvs_backup/e107_0.8/e107_plugins/poll/admin_config.php,v $ - * $Revision$ - * $Date$ - * $Author$ + * $URL$ + * $Id$ */ require_once("../../class2.php"); @@ -27,6 +23,7 @@ include_lan(e_PLUGIN.'poll/languages/'.e_LANGUAGE.'_admin_poll.php'); require_once(e_ADMIN."auth.php"); require_once(e_PLUGIN."poll/poll_class.php"); require_once(e_HANDLER."form_handler.php"); +require_once(e_HANDLER."message_handler.php"); require_once(e_HANDLER."userclass_class.php"); if(isset($_POST)) @@ -36,6 +33,8 @@ if(isset($_POST)) $rs = new form; $poll = new poll; +$frm = e107::getForm(); +$mes = e107::getMessage(); if (isset($_POST['reset'])) { @@ -43,12 +42,13 @@ if (isset($_POST['reset'])) define("RESET", TRUE); } - - $emessage = eMessage::getInstance(); +//$emessage = eMessage::getInstance(); if (varset($_POST['delete'])) { - $message = $poll->delete_poll(key($_POST['delete'])); + //$message = $poll->delete_poll(key($_POST['delete'])); + $poll->delete_poll(key($_POST['delete'])); // TODO check security? + $mes->addSuccess(LAN_DELETED); unset($poll_id, $_POST['poll_title'], $_POST['poll_option'], $_POST['activate']); $_GET['mode']='list'; } @@ -59,12 +59,15 @@ if (isset($_POST['submit'])) if($_POST['poll_title']) { define("POLLID",$_POST['poll_id']); - $emessage->add($poll -> submit_poll(), E_MESSAGE_SUCCESS); + //$emessage->add($poll -> submit_poll(), E_MESSAGE_SUCCESS); + $poll -> submit_poll(); + $mes->addSuccess(LAN_CREATED); unset($_POST['poll_title'], $_POST['poll_option'], $_POST['activate'], $_POST['poll_comment']); } else { - $emessage->add(POLLAN_46, E_MESSAGE_SUCCESS); + //$emessage->add(POLLAN_46, E_MESSAGE_SUCCESS); + $mes->addError(LAN_REQUIRED_BLANK); } $_GET['mode']='list'; @@ -88,16 +91,17 @@ if (varset($_POST['edit']) || varset($_GET['mode'])=='create' && !varset($_POST[ $poll_total = $sql->db_Select("polls"); $text = $poll -> renderPollForm(); - $ns->tablerender(POLLAN_MENU_CAPTION." :: ".POLLAN_2, $text); + $ns->tablerender(POLLAN_MENU_CAPTION." - ".POLLAN_2, $mes->render() . $text); } - +/* if (isset($message)) { $emessage->add($message, E_MESSAGE_SUCCESS); } +*/ if(!varset($_POST['edit']) && ($_GET['mode']=="list" || !$_GET['mode'])) { @@ -159,8 +163,8 @@ function poll_list() $sql = e107::getDb(); $ns = e107::getRender(); $tp = e107::getParser(); - $frm = new e_form(true); - + $frm = e107::getForm(); + $mes = e107::getMessage(); global $user_pref; if(isset($_POST['etrigger_ecolumns'])) //TODO User @@ -173,7 +177,7 @@ function poll_list() //TODO Add more column options. $fields = array( - 'poll_id' => array('title'=> ID, 'width'=>'5%', 'forced'=> TRUE), + 'poll_id' => array('title'=> LAN_ID, 'width'=>'5%', 'forced'=> TRUE), 'poll_title' => array('title'=> POLLAN_3, 'width'=>'auto'), 'poll_options' => array('title'=> POLLAN_4, 'type' => 'text', 'width' => 'auto', 'thclass' => 'center' ), // No real vetting // 'poll_start_datestamp' => array('title'=> LAN_AUTHOR, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left first'), // Display name @@ -189,7 +193,7 @@ function poll_list() - $text = "