Merge pull request #24162 from colemanw/savedSearchLabel
[civicrm-core.git] / CRM / Core / Page.php
index e0d43bb9414558ca4e6d920b0c12fc42f5ed8b27..a252b994247321b4faa21117dd0b44de835f5b8c 100644 (file)
@@ -129,6 +129,9 @@ class CRM_Core_Page {
     // Required for footer.tpl,
     // See ExampleHookTest:testPageOutput.
     'footer_status_severity',
+    // in 'body.tpl
+    'suppressForm',
+    'beginHookFormElements',
   ];
 
   /**
@@ -196,6 +199,8 @@ class CRM_Core_Page {
     $pageTemplateFile = $this->getHookedTemplateFileName();
     self::$_template->assign('tplFile', $pageTemplateFile);
 
+    self::$_template->addExpectedTabHeaderKeys();
+
     // invoke the pagRun hook, CRM-3906
     CRM_Utils_Hook::pageRun($this);
 
@@ -506,7 +511,7 @@ class CRM_Core_Page {
     $attribs = array_merge($standardAttribs, $attribs);
     foreach ($attribs as $attrib => $val) {
       if (strlen($val)) {
-        $val = htmlspecialchars($val);
+        $val = htmlspecialchars($val, ENT_COMPAT);
         $attribString .= " $attrib=\"$val\"";
       }
     }
@@ -514,4 +519,25 @@ class CRM_Core_Page {
     return "<i$attribString></i>$sr";
   }
 
+  /**
+   * Add an expected smarty variable to the array.
+   *
+   * @param string $elementName
+   */
+  public function addExpectedSmartyVariable(string $elementName): void {
+    $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);
+    }
+  }
+
 }