Example #1
0
 /**
  * delete an item from the recent stack
  *
  * @param string $id  contact id that had to be removed
  *
  * @return void
  * @access public
  * @static
  */
 function del($id)
 {
     CRM_Utils_Recent::initialize();
     $tempRecent = $GLOBALS['_CRM_UTILS_RECENT']['_recent'];
     $GLOBALS['_CRM_UTILS_RECENT']['_recent'] = '';
     // make sure item is not already present in list
     for ($i = 0; $i < count($tempRecent); $i++) {
         if ($tempRecent[$i]['id'] != $id) {
             $GLOBALS['_CRM_UTILS_RECENT']['_recent'][] = $tempRecent[$i];
         }
     }
     $session =& CRM_Core_Session::singleton();
     $session->set(CRM_UTILS_RECENT_STORE_NAME, $GLOBALS['_CRM_UTILS_RECENT']['_recent']);
 }