private $_chainSelectFields = array();
/**
- * Constructor for the basic form page
+ * Constructor for the basic form page.
*
* We should not use QuickForm directly. This class provides a lot
* of default convenient functions, rules and buttons
}
/**
- * The postProcess hook is typically called by the framework
+ * The postProcess hook is typically called by the framework.
* However in a few cases, the form exits or redirects early in which
* case it needs to call this function so other modules can do the needful
* Calling this function directly should be avoided if possible. In general a
*
* access public
*
- * @return array
+ * @return array|NULL
* reference to the array of default values
*/
public function setDefaultValues() {
+ return NULL;
}
/**
/**
* Performs the server side validation
* @since 1.0
- * @return boolean
+ * @return bool
* true if no error found
* @throws HTML_QuickForm_Error
*/
/**
* Add default Next / Back buttons
*
- * @param array array of associative arrays in the order in which the buttons should be
- * displayed. The associate array has 3 fields: 'type', 'name' and 'isDefault'
- * The base form class will define a bunch of static arrays for commonly used
- * formats
+ * @param array $params
+ * Array of associative arrays in the order in which the buttons should be
+ * displayed. The associate array has 3 fields: 'type', 'name' and 'isDefault'
+ * The base form class will define a bunch of static arrays for commonly used
+ * formats.
*
* @return void
*/
foreach ($params as $button) {
$attrs = array('class' => 'crm-form-submit') + (array) CRM_Utils_Array::value('js', $button);
+ if (!empty($button['class'])) {
+ $attrs['class'] .= ' ' . $button['class'];
+ }
+
if (!empty($button['isDefault'])) {
$attrs['class'] .= ' default';
}
/**
* Setter function for options
*
- * @param mixed
+ * @param mixed $options
*
* @return void
*/
/**
* Boolean function to determine if this is a one form page
*
- * @return boolean
+ * @return bool
*/
public function isSimpleForm() {
return $this->_state->getType() & (CRM_Core_State::START | CRM_Core_State::FINISH);
/**
* Setter function for Form Action
*
- * @param string
+ * @param string $action
*
* @return void
*/
$tplname = $ext->getTemplatePath(CRM_Utils_System::getClassName($this)) . DIRECTORY_SEPARATOR . $filename;
}
else {
- $tplname = str_replace('_',
- DIRECTORY_SEPARATOR,
- CRM_Utils_System::getClassName($this)
- ) . '.tpl';
+ $tplname = strtr(
+ CRM_Utils_System::getClassName($this),
+ array(
+ '_' => DIRECTORY_SEPARATOR,
+ '\\' => DIRECTORY_SEPARATOR,
+ )
+ ) . '.tpl';
}
return $tplname;
}
/**
* Store the variable with the value in the form scope
*
- * @param string name : name of the variable
- * @param mixed value : value of the variable
- *
+ * @param string $name
+ * Name of the variable.
+ * @param mixed $value
+ * Value of the variable.
*
* @return void
*/
/**
* Get the variable from the form scope
*
- * @param string name : name of the variable
- *
+ * @param string $name
+ * Name of the variable
*
* @return mixed
*/
/**
* Add date
- * @param string $name
- * Name of the element.
- * @param string $label
- * Label of the element.
- * @param array $attributes
- * Key / value pair.
*
+ * @code
* // if you need time
* $attributes = array(
* 'addTime' => true,
* 'formatType' => 'relative' or 'birth' etc check advanced date settings
* );
+ * @endcode
+ *
+ * @param string $name
+ * Name of the element.
+ * @param string $label
+ * Label of the element.
* @param bool $required
* True if required.
+ * @param array $attributes
+ * Key / value pair.
*/
public function addDate($name, $label, $required = FALSE, $attributes = NULL) {
if (!empty($attributes['formatType'])) {
* - cid from the url if the caller has ACL permission to view
* - fallback is logged in user (or ? NULL if no logged in user) (@todo wouldn't 0 be more intuitive?)
*
- * @return NULL|integer
+ * @return NULL|int
*/
public function getContactID() {
$tempID = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
* that small pieces of duplication are not being refactored into separate functions because their only shared parent
* is this form. Inserting a class FrontEndForm.php between the contribution & event & this class would allow functions like this
* and a dozen other small ones to be refactored into a shared parent with the reduction of much code duplication
+ *
+ * @param $onlinePaymentProcessorEnabled
*/
public function addCIDZeroOptions($onlinePaymentProcessorEnabled) {
$this->assign('nocid', TRUE);