Ejemplo n.º 1
0
    $smarty->display("error.tpl");
    die;
}
$smarty->assign('pollId', $_REQUEST["pollId"]);
$menu_info = $polllib->get_poll($_REQUEST["pollId"]);
$smarty->assign('menu_info', $menu_info);
if (!isset($_REQUEST["optionId"])) {
    $_REQUEST["optionId"] = 0;
}
if (isset($_REQUEST["remove"])) {
    $access->check_authenticity();
    $polllib->remove_poll_option($_REQUEST["remove"]);
}
if (isset($_REQUEST["save"])) {
    check_ticket('admin-poll-options');
    $polllib->replace_poll_option($_REQUEST["pollId"], $_REQUEST["optionId"], $_REQUEST["title"], $_REQUEST['position']);
    $_REQUEST["optionId"] = 0;
}
$smarty->assign('optionId', $_REQUEST["optionId"]);
if ($_REQUEST["optionId"]) {
    $info = $polllib->get_poll_option($_REQUEST["optionId"]);
} else {
    $info = array();
    $info["title"] = '';
    $info["votes"] = 0;
    $info["position"] = '';
}
$smarty->assign('title', $info["title"]);
$smarty->assign('votes', $info["votes"]);
$channels = $polllib->list_poll_options($_REQUEST["pollId"]);
$smarty->assign('ownurl', $tikilib->httpPrefix() . $_SERVER["REQUEST_URI"]);
Ejemplo n.º 2
0
}
$gBitSmarty->assign('option_id', $_REQUEST["option_id"]);
if ($_REQUEST["option_id"]) {
    $info = $polllib->get_poll_option($_REQUEST["option_id"]);
} else {
    $info = array();
    $info["title"] = '';
    $info["votes"] = 0;
}
$gBitSmarty->assign('title', $info["title"]);
$gBitSmarty->assign('votes', $info["votes"]);
if (isset($_REQUEST["remove"])) {
    $polllib->remove_poll_option($_REQUEST["remove"]);
}
if (isset($_REQUEST["save"])) {
    $polllib->replace_poll_option($_REQUEST["poll_id"], $_REQUEST["option_id"], $_REQUEST["title"]);
}
if (empty($_REQUEST["sort_mode"])) {
    $sort_mode = 'poll_id_asc';
} else {
    $sort_mode = $_REQUEST["sort_mode"];
}
if (!isset($_REQUEST["offset"])) {
    $offset = 0;
} else {
    $offset = $_REQUEST["offset"];
}
$gBitSmarty->assign_by_ref('offset', $offset);
if (isset($_REQUEST["find"])) {
    $find = $_REQUEST["find"];
} else {
Ejemplo n.º 3
0
	}
	$publishDate = $tikilib->make_time($_REQUEST["Time_Hour"], $_REQUEST["Time_Minute"], 0, $_REQUEST["Date_Month"], $_REQUEST["Date_Day"], $_REQUEST["Date_Year"]);
	if (!isset($_REQUEST['voteConsiderationSpan'])) $_REQUEST['voteConsiderationSpan'] = 0;
	$pid = $polllib->replace_poll($_REQUEST["pollId"], $_REQUEST["title"], $_REQUEST["active"], $publishDate, $_REQUEST['voteConsiderationSpan']);
	$position = 0;
	if (isset($_REQUEST['options']) && is_array($_REQUEST['options'])) {
		//TODO insert options into poll
		check_ticket('admin-poll-options');
		foreach ($_REQUEST['options'] as $i => $option) {
			//continue;
			if ($option == "") {
				if (isset($_REQUEST['optionsId']) && isset($_REQUEST['optionsId'][$i])) $polllib->remove_poll_option($_REQUEST['optionsId'][$i]);
				continue;
			}
			$oid = isset($_REQUEST['optionsId']) && isset($_REQUEST['optionsId'][$i]) ? $_REQUEST['optionsId'][$i] : null;
			$polllib->replace_poll_option($pid, $oid, $option, $position++);
		}
	}
	$cat_type = 'poll';
	$cat_objid = $pid;
	$cat_desc = substr($_REQUEST["title"], 0, 200);
	$cat_name = $_REQUEST["title"];
	$cat_href = "tiki-poll_results.php?pollId=" . $cat_objid;
	include_once ("categorize.php");
}
if (isset($_REQUEST['addPoll']) && !empty($_REQUEST['poll_template']) && !empty($_REQUEST['pages'])) {
	global $wikilib;
	include_once ('lib/wiki/wikilib.php');
	global $categlib;
	include_once ('lib/categories/categlib.php');
	$cat_type = 'wiki page';