Модуль Опросы | Голосование v1.26.1a
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

101 lines
2.3 KiB

<?php
if(!defined('BASE_DIR')) exit;
function mod_poll($poll_id)
{
require_once(BASE_DIR . '/modules/poll/class/poll.php');
require_once(BASE_DIR . '/modules/poll/funcs/func.rewrite.php');
$poll = new Poll;
$tpl_dir = BASE_DIR . '/modules/poll/templates/';
$lang_file = BASE_DIR . '/modules/poll/lang/' . $_SESSION['user_language'] . '.txt';
$poll->pollShow($tpl_dir, $lang_file, stripslashes($poll_id));
}
if (!defined('ACP')
&& isset($_REQUEST['module']) && $_REQUEST['module'] == 'poll'
&& isset($_REQUEST['action']))
{
require_once(BASE_DIR . '/modules/poll/class/poll.php');
require_once(BASE_DIR . '/modules/poll/funcs/func.rewrite.php');
$poll = new Poll;
$tpl_dir = BASE_DIR . '/modules/poll/templates/';
$lang_file = BASE_DIR . '/modules/poll/lang/' . $_SESSION['user_language'] . '.txt';
switch ($_REQUEST['action'])
{
case 'result':
$poll->pollResultShow($tpl_dir, $lang_file, (int)$_REQUEST['pid']);
break;
case 'vote':
$poll->pollVote((int)$_REQUEST['pid']);
break;
case 'archive':
$poll->pollArchiveShow($tpl_dir, $lang_file);
break;
case 'form':
$poll->pollCommentShow($tpl_dir, $lang_file, (int)$_REQUEST['pid'], THEME_FOLDER);
break;
case 'comment':
$poll->pollCommentNew($tpl_dir, $lang_file, (int)$_REQUEST['pid']);
break;
}
}
if (defined('ACP') && !empty($_REQUEST['moduleaction']))
{
require_once(BASE_DIR . '/modules/poll/class/poll.php');
require_once(BASE_DIR . '/modules/poll/funcs/func.rewrite.php');
$poll = new Poll;
$adm_dir = BASE_DIR . '/modules/poll/admin/';
$lang_file = BASE_DIR . '/modules/poll/lang/' . $_SESSION['user_language'] . '.txt';
switch ($_REQUEST['moduleaction'])
{
case '1':
$poll->pollList($adm_dir, $lang_file);
break;
case 'new':
$poll->pollNew($adm_dir, $lang_file);
break;
case 'save_new':
$poll->pollNewItemSave((int)$_REQUEST['id']);
break;
case 'edit':
$poll->pollEdit($adm_dir, $lang_file, (int)$_REQUEST['id']);
break;
case 'save':
$poll->pollSave((int)$_REQUEST['id']);
break;
case 'delete':
$poll->pollDelete((int)$_REQUEST['id']);
break;
case 'comments':
$poll->pollCommentEdit($adm_dir, $lang_file, (int)$_REQUEST['id']);
break;
case 'sort':
$poll->pollSort((array)$_REQUEST['sort']);
exit;
}
}
?>