<?php
-
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.6 |
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
* The list of recently viewed items
*
* @var array
- * @static
*/
static private $_recent = NULL;
* Initialize this class and set the static variables
*
* @return void
- * @static
*/
public static function initialize() {
if (!self::$_recent) {
/**
* Return the recently viewed array
*
- * @return array the recently viewed array
- * @static
+ * @return array
+ * the recently viewed array
*/
public static function &get() {
self::initialize();
/**
* Add an item to the recent stack
*
- * @param string $title the title to display
- * @param string $url the link for the above title
- * @param string $id object id
+ * @param string $title
+ * The title to display.
+ * @param string $url
+ * The link for the above title.
+ * @param string $id
+ * Object id.
* @param $type
* @param int $contactId
* @param string $contactName
* @param array $others
*
* @return void
- * @static
*/
- static function add($title,
+ public static function add(
+ $title,
$url,
$id,
$type,
/**
* Delete an item from the recent stack
*
- * @param array $recentItem array of the recent Item to be removed
+ * @param array $recentItem
+ * Array of the recent Item to be removed.
*
* @return void
- * @static
*/
public static function del($recentItem) {
self::initialize();
// make sure item is not already present in list
for ($i = 0; $i < count($tempRecent); $i++) {
if (!($tempRecent[$i]['id'] == $recentItem['id'] &&
- $tempRecent[$i]['type'] == $recentItem['type']
- )) {
+ $tempRecent[$i]['type'] == $recentItem['type']
+ )
+ ) {
self::$_recent[] = $tempRecent[$i];
}
}
/**
* Delete an item from the recent stack
*
- * @param string $id contact id that had to be removed
+ * @param string $id
+ * Contact id that had to be removed.
*
* @return void
- * @static
*/
public static function delContact($id) {
self::initialize();
$session = CRM_Core_Session::singleton();
$session->set(self::STORE_NAME, self::$_recent);
}
+
}