* so the display routine needs to not do any work. (The
* parent object takes care of the display)
*
- * @var boolean
+ * @var bool
*/
protected $_embedded = FALSE;
* Useful when we run form in non civicrm context
* and we need to transfer control back.(eg. drupal)
*
- * @var boolean
+ * @var bool
*/
protected $_skipRedirection = FALSE;
* Are we in print mode? if so we need to modify the display
* functionality to do a minimal display :)
*
- * @var boolean
+ * @var bool
*/
public $_print = 0;
/**
* Should we generate a qfKey, true by default
*
- * @var boolean
+ * @var bool
*/
public $_generateQFKey = TRUE;
/**
* The destination if set will override the destination the code wants to send it to.
*
- * @var string;
+ * @var string
*/
public $_destination = NULL;
* Should we add a unique sequence number to the end of the key.
* @param bool $ignoreKey
* Should we not set a qfKey for this controller (for standalone forms).
+ *
+ * @throws \CRM_Core_Exception
*/
public function __construct(
$title = NULL,
// only use the civicrm cache if we have a valid key
// else we clash with other users CRM-7059
if (!empty($this->_key)) {
- CRM_Core_Session::registerAndRetrieveSessionObjects(array(
+ CRM_Core_Session::registerAndRetrieveSessionObjects([
"_{$name}_container",
- array('CiviCRM', $this->_scope),
- ));
+ ['CiviCRM', $this->_scope],
+ ]);
}
parent::__construct($name, $modal);
$this->_print = CRM_Core_Smarty::PRINT_NOFORM;
}
// Respond with JSON if in AJAX context (also support legacy value '6')
- elseif (in_array($snippet, array(CRM_Core_Smarty::PRINT_JSON, 6))) {
+ elseif (in_array($snippet, [CRM_Core_Smarty::PRINT_JSON, 6])) {
$this->_print = CRM_Core_Smarty::PRINT_JSON;
$this->_QFResponseType = 'json';
}
}
public function fini() {
- CRM_Core_BAO_Cache::storeSessionToCache(array(
- "_{$this->_name}_container",
- array('CiviCRM', $this->_scope),
- ),
- TRUE
- );
+ CRM_Core_BAO_Cache::storeSessionToCache([
+ "_{$this->_name}_container",
+ ['CiviCRM', $this->_scope],
+ ], TRUE);
}
/**
* @param array $uploadNames for the various upload buttons (note u can have more than 1 upload)
*/
public function addActions($uploadDirectory = NULL, $uploadNames = NULL) {
- $names = array(
+ $names = [
'display' => 'CRM_Core_QuickForm_Action_Display',
'next' => 'CRM_Core_QuickForm_Action_Next',
'back' => 'CRM_Core_QuickForm_Action_Back',
'done' => 'CRM_Core_QuickForm_Action_Done',
'jump' => 'CRM_Core_QuickForm_Action_Jump',
'submit' => 'CRM_Core_QuickForm_Action_Submit',
- );
+ ];
foreach ($names as $name => $classPath) {
$action = new $classPath($this->_stateMachine);
* @return array
*/
public function wizardHeader($currentPageName) {
- $wizard = array();
- $wizard['steps'] = array();
+ $wizard = [];
+ $wizard['steps'] = [];
$count = 0;
foreach ($this->_pages as $name => $page) {
$count++;
- $wizard['steps'][] = array(
+ $wizard['steps'][] = [
'name' => $name,
'title' => $page->getTitle(),
//'link' => $page->getLink ( ),
'valid' => TRUE,
'stepNumber' => $count,
'collapsed' => FALSE,
- );
+ ];
if ($name == $currentPageName) {
$wizard['currentStepNumber'] = $count;
* @param array $wizard
*/
public function addWizardStyle(&$wizard) {
- $wizard['style'] = array(
+ $wizard['style'] = [
'barClass' => '',
'stepPrefixCurrent' => '»',
'stepPrefixPast' => '✔',
'subStepPrefixPast' => ' ',
'subStepPrefixFuture' => ' ',
'showTitle' => 1,
- );
+ ];
}
/**