tiki-list_submissions.php 2.12 KB
Newer Older
1
<?php
2
// (c) Copyright 2002-2011 by authors of the Tiki Wiki CMS Groupware Project
changi67's avatar
changi67 committed
3
// 
4 5
// 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.
6
// $Id$
changi67's avatar
changi67 committed
7

8
$section = 'cms';
9 10
require_once ('tiki-setup.php');
include_once ('lib/articles/artlib.php');
11
$access->check_feature('feature_submissions');
12
if (isset($_REQUEST["remove"])) {
lphuberdeau's avatar
lphuberdeau committed
13
	$access->check_permission('tiki_p_remove_submission');
14 15
	$access->check_authenticity();
	$artlib->remove_submission($_REQUEST["remove"]);
16
}
17
if (isset($_REQUEST["approve"])) {
18
	check_ticket('list-submissions');
19
	$access->check_permission('tiki_p_approve_submission');
20 21
	$artlib->approve_submission($_REQUEST["approve"]);
}
22 23 24 25
// This script can receive the thresold
// 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
26 27
if (!isset($_REQUEST["sort_mode"])) {
	$sort_mode = 'publishDate_desc';
28
} else {
29 30 31
	$sort_mode = $_REQUEST["sort_mode"];
}
$smarty->assign_by_ref('sort_mode', $sort_mode);
32 33 34
// 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
35 36
if (!isset($_REQUEST["offset"])) {
	$offset = 0;
37
} else {
38
	$offset = $_REQUEST["offset"];
39
}
40
$smarty->assign_by_ref('offset', $offset);
changi67's avatar
changi67 committed
41 42 43 44 45 46 47 48
if (($tiki_p_admin == 'y') || ($tiki_p_admin_cms == 'y')) {
	$pdate = '';
} elseif (isset($_SESSION["thedate"])) {
	if ($_SESSION["thedate"] < $tikilib->now) {
		$pdate = $_SESSION["thedate"];
	} else {
		$pdate = $tikilib->now;
	}
49
} else {
changi67's avatar
changi67 committed
50
	$pdate = $tikilib->now;
51
}
52 53
if (isset($_REQUEST["find"])) {
	$find = $_REQUEST["find"];
54
} else {
55
	$find = '';
56
}
57
$smarty->assign('find', $find);
58
$listpages = $artlib->list_submissions($offset, $maxRecords, $sort_mode, $find, $pdate);
59
$smarty->assign_by_ref('cant_pages', $listpages["cant"]);
60
include_once ('tiki-section_options.php');
61
$smarty->assign_by_ref('listpages', $listpages["data"]);
62
ask_ticket('list-submissions');
63
// Display the template
64
$smarty->assign('mid', 'tiki-list_submissions.tpl');
65
$smarty->display("tiki.tpl");