tiki-old_polls.php 1.57 KB
Newer Older
lrargerich's avatar
lrargerich committed
1
<?php
changi67's avatar
changi67 committed
2 3 4
/**
 * @package tikiwiki
 */
5
// (c) Copyright 2002-2016 by authors of the Tiki Wiki CMS Groupware Project
rjsmelo's avatar
rjsmelo committed
6
//
7 8
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
9
// $Id$
changi67's avatar
changi67 committed
10

rjsmelo's avatar
rjsmelo committed
11
require_once('tiki-setup.php');
12
$polllib = TikiLib::lib('poll');
13 14
$access->check_feature('feature_polls');
$access->check_permission('tiki_p_view_poll_results');
marclaporte's avatar
marclaporte committed
15
// This script can receive the threshold
lrargerich's avatar
lrargerich committed
16 17 18
// for the information as the number of
// days to get in the log 1,3,4,etc
// it will default to 1 recovering information for today
rjsmelo's avatar
rjsmelo committed
19
if (! isset($_REQUEST["sort_mode"])) {
20
	$sort_mode = 'publishDate_desc';
lrargerich's avatar
lrargerich committed
21
} else {
22 23 24
	$sort_mode = $_REQUEST["sort_mode"];
}
$smarty->assign_by_ref('sort_mode', $sort_mode);
lrargerich's avatar
lrargerich committed
25 26 27
// If offset is set use it if not then use offset =0
// use the maxRecords php variable to set the limit
// if sortMode is not set then use lastModif_desc
rjsmelo's avatar
rjsmelo committed
28
if (! isset($_REQUEST["offset"])) {
29
	$offset = 0;
lrargerich's avatar
lrargerich committed
30
} else {
31
	$offset = $_REQUEST["offset"];
lrargerich's avatar
lrargerich committed
32
}
33 34 35
$smarty->assign_by_ref('offset', $offset);
if (isset($_REQUEST["find"])) {
	$find = $_REQUEST["find"];
lrargerich's avatar
lrargerich committed
36
} else {
37
	$find = '';
lrargerich's avatar
lrargerich committed
38
}
39
$smarty->assign('find', $find);
lrargerich's avatar
lrargerich committed
40
// Get a list of last changes to the Wiki database
41
$listpages = $polllib->list_all_polls($offset, $maxRecords, $sort_mode, $find);
lrargerich's avatar
lrargerich committed
42
// If there're more records then assign next_offset
43
$smarty->assign_by_ref('cant_pages', $listpages["cant"]);
44
$smarty->assign_by_ref('listpages', $listpages["data"]);
lrargerich's avatar
lrargerich committed
45
// Display the template
46
$smarty->assign('mid', 'tiki-old_polls.tpl');
47
$smarty->display("tiki.tpl");