File: D:/HostingSpaces/PvdBoogaard/indoorski.nl/backup/oude-site/cms/lib/class.permissionoption.php
<?php
define('PermissionOptionError', 1);
define('PermissionOptionWarning', 2);
define('PermissionOptionNotice', 3);
class PermissionOption extends iwp_base
{
/**
* Localised language text for this option. Should be populated as needed before showing data in a view or returning via xhttp.
*
* @var String
*/
public $LangText;
/**
* True if this permission allows for a granularity option. This will produce an all / own / own+specific / specific selector in the control panel.
*
* @var Boolean
*/
public $Granular;
/**
* True if this permission allows for 'own' options in it's granularity. As some managable items aren't 'owned' by anyone, it makes little sense to present this as an option.
*
* @var Boolean
*/
public $GranularOwn;
/**
* True if this permission allows for a deny option.
*
* @var Boolean
*/
public $GranularCategories;
/**
* __construct - sets defaults
*
* @param boolean $granular Defines if this permission option has a granular option list.
* @param boolean $granularOwn Defines if this permission option can have the granular 'own' option item.
* @param boolean $granularCategories Defines if this permission option can have a granular option list powered by categories.
* @return PermissionOption
*/
public function __construct ($granular = false, $granularOwn = true, $granularCategories = true)
{
// set defaults
$this->Granular = $granular;
$this->GranularOwn = $granularOwn;
$this->GranularCategories = $granularCategories;
}
public static function GetScopeItemList ()
{
throw new PermissionOptionException('PermissionOptionClass::GetScopeItemList should be defined by the implementation-specific extendee.', PermissionOptionError);
}
public static function GetScopeList ()
{
throw new PermissionOptionException('PermissionOptionClass::GetScopeList should be defined by the implementation-specific extendee.', PermissionOptionError);
}
}
class PermissionOptionException extends Exception
{
/**
* A variable to hold the severity of the error
*
* @var String $severity
*/
private $severity;
/**
* Changing the constructor to handle the severity
*
* @param String $message The exception message being thrown
* @param Integer $severity The degree of severity for this exception
*/
public function __construct ($message, $severity)
{
$this->message = $message;
$this->severity = $severity;
}
/**
* Will retrieve the severity that was placed for this exception
*
* @return Integer The severity of the exception
*/
public function getSeverity ()
{
return $this->severity;
}
}