+--------------------------------------------------------------------+
| CiviCRM version 4.6 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
* The core concept of the system is an action performed on an object. Typically this will be a "data model" object
* and similar across all objects (thus providing both reuse and standards)
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
* $Id$
*
*/
RENEW = 32768,
DETACH = 65536,
REVERT = 131072,
- CLOSE = 262144,
- REOPEN = 524288,
- MAX_ACTION = 1048575;
+ CLOSE = 262144,
+ REOPEN = 524288,
+ MAX_ACTION = 1048575;
//make sure MAX_ACTION = 2^n - 1 ( n = total number of actions )
* bit manipulation operations so we can perform multiple
* actions on the same object if needed
*
- * @var array $_names type of variable name to action constant
+ * @var array $_names type of variable name to action constant
*
- * @static
*/
static $_names = array(
'add' => self::ADD,
'renew' => self::RENEW,
'detach' => self::DETACH,
'revert' => self::REVERT,
- 'close' => self::CLOSE,
- 'reopen' => self::REOPEN,
+ 'close' => self::CLOSE,
+ 'reopen' => self::REOPEN,
);
/**
* The flipped version of the names array, initialized when used
*
* @var array
- * @static
*/
static $_description;
/**
- * Called by the request object to translate a string into a mask
+ * Called by the request object to translate a string into a mask.
*
* @param string $str
* The action to be resolved.
*
* @return int
* the action mask corresponding to the input string
- * @static
*/
public static function resolve($str) {
$action = 0;
*
* @return int
* the action mask corresponding to the input args
- * @static
*/
public static function map($item) {
$mask = 0;
}
/**
- * Given a string determine the bitmask for this specific string
+ * Given a string determine the bitmask for this specific string.
*
* @param string $item
* The input action to process.
*
* @return int
* the action mask corresponding to the input string
- * @static
*/
public static function mapItem($item) {
$mask = CRM_Utils_Array::value(trim($item), self::$_names);
*
* @return string
* the corresponding action description
- * @static
*/
public static function description($mask) {
if (!isset($_description)) {
*
* @return string
* the html string
- * @static
*/
- static function formLink(
+ public static function formLink(
$links,
$mask,
$values,
*
* @return string
* the substituted string
- * @static
*/
public static function &replace(&$str, &$values) {
foreach ($values as $n => $v) {
/**
* Get the mask for a permission (view, edit or null)
*
- * @param string the permission
- *
* @return int
* the mask for the above permission
- * @static
*/
public static function mask($permissions) {
$mask = NULL;
return $mask;
}
+
}