X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FForm.php;h=6d59fd537f61a5baeb38737d22faecabf078c84e;hb=ad761ffeb995231339bdb775980618122cd09f39;hp=d3e8a94306b98b9d2d4678de16219a6bf3df01a6;hpb=dbfb218a8dea40fa76379fe4453e4bbf3434d158;p=civicrm-core.git diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php index d3e8a94306..6d59fd537f 100644 --- a/CRM/Core/Form.php +++ b/CRM/Core/Form.php @@ -611,11 +611,11 @@ class CRM_Core_Form extends HTML_QuickForm_Page { /** * This virtual function is used to set the default values of various form elements. * - * @return array|NULL + * @return array * reference to the array of default values */ public function setDefaultValues() { - return NULL; + return []; } /** @@ -719,7 +719,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { // our ensured variables get blown away, so we need to set them even if // it's already been initialized. self::$_template->ensureVariablesAreAssigned($this->expectedSmartyVariables); - + self::$_template->addExpectedTabHeaderKeys(); } /** @@ -1113,6 +1113,18 @@ class CRM_Core_Form extends HTML_QuickForm_Page { $this->expectedSmartyVariables[] = $elementName; } + /** + * Add an expected smarty variable to the array. + * + * @param array $elementNames + */ + public function addExpectedSmartyVariables(array $elementNames): void { + foreach ($elementNames as $elementName) { + // Duplicates don't actually matter.... + $this->addExpectedSmartyVariable($elementName); + } + } + /** * Render form and return contents. *