links(); foreach ($link as $action => $item) { if ($match & $action) { return $item[$attribute]; } } return NULL; } /** * This is a static virtual function returning reference on links array. Each * inherited class must redefine this function * * links is an array of associative arrays. Each element of the array * has at least 3 fields * * name : the name of the link * url : the URI to be used for this link * qs : the parameters to the above url along with any dynamic substitutions * title : A more descriptive name, typically used in breadcrumbs / navigation */ static function &links() { return NULL; } /** * compose the template file name from the class name * * @param string $action the action being performed * * @return string template file name * @access public */ function getTemplateFileName($action = NULL) { return (str_replace('_', DIRECTORY_SEPARATOR, CRM_Utils_System::getClassName($this)) . ".tpl"); } /** * getter for the sorting direction for the fields which will be displayed on the form. * * @param string action the action being performed * * @return array the elements that can be sorted along with their properties * @access public */ function &getSortOrder($action) { $columnHeaders = &$this->getColumnHeaders(NULL); if (!isset($this->_order)) { $this->_order = array(); $start = 2; $firstElementNotFound = TRUE; if (!empty($columnHeaders)) { foreach ($columnHeaders as $k => $header) { $header = &$columnHeaders[$k]; if (array_key_exists('sort', $header)) { if ($firstElementNotFound && $header['direction'] != CRM_Utils_Sort::DONTCARE) { $this->_order[1] = &$header; $firstElementNotFound = FALSE; } else { $this->_order[$start++] = &$header; } } unset($header); } } if ($firstElementNotFound) { // CRM_Core_Error::fatal( "Could not find a valid sort directional element" ); } } return $this->_order; } /** * setter for permission * * @var string * @access public */ public function setPermission($permission) { $this->_permission = $permission; } /** * get the display text in plain language for the search * to display on the results page * * @return string * @access public */ public function getQill() { return NULL; } /** * @return null */ public function getSummary() { return NULL; } /** * @param $key */ public function setKey($key) { $this->_key = $key; } /** * @return string */ public function getKey() { return $this->_key; } }