CMS  Version 3.9
approve.inc
Go to the documentation of this file.
1 <?php
2 Fakoli::using("versioned_content");
3 
4 $class = checkIdentifier($_GET["target"]);
5 $itemID = checkNumeric($_GET["item_id"]);
6 
7 if (!$class || !$itemID)
8 {
9  Fakoli::end("Missing Parameter");
10 }
11 
13 
14 if (!checkRole($adminAccess))
15 {
16  Fakoli::end("Permission Denied");
17 }
18 
20 $target->load($itemID);
21 
22 try
23 {
25 
26  Fakoli::notifyOnNextPage($target->prettifyClassName()." Approved");
27  Fakoli::end("OK");
28 }
29 catch(Exception $e)
30 {
31  Fakoli::end($e->getMessage());
32 }
$class
Definition: approve.inc:4
if(! $class||! $itemID) $adminAccess
Definition: approve.inc:12
if(!checkRole($adminAccess)) $target
Definition: approve.inc:19
$itemID
Definition: approve.inc:5
static notifyOnNextPage($message, $blocking=false, $button="OK", $onClick="null")
Schedules a notification message to be displayed to the user at the next full page load.
Definition: core.inc:1223
static getAdminAccessRoles()
Returns the user roles that have access to the admin section.
Definition: core.inc:1074
static using()
Import the datamodels, views and manifest for the specified component(s).
Definition: core.inc:116
static end($message="")
Use this method to terminate execution of a script instead of using the php keywords exit() or die().
Definition: core.inc:1149