/** * Function to set the form title based on action and data coming in * * @access protected */ protected function setFormTitle() { $title = 'CiviRules ' . ucfirst(CRM_Core_Action::description($this->_action)) . ' Rule'; CRM_Utils_System::setTitle($title); }
/** * Based on form action, return a string representing the api action. * Used by addField method. * * Return string */ private function getApiAction() { $action = $this->getAction(); if ($action & CRM_Core_Action::UPDATE + CRM_Core_Action::ADD) { return 'create'; } if ($action & CRM_Core_Action::BROWSE + CRM_Core_Action::BASIC + CRM_Core_Action::ADVANCED + CRM_Core_Action::PREVIEW) { return 'get'; } // If you get this exception try adding more cases above. throw new Exception("Cannot determine api action for " . get_class($this) . '.' . 'CRM_Core_Action "' . CRM_Core_Action::description($action) . '" not recognized.'); }