3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
17 class CRM_Core_ShowHideBlocks
{
20 * The array of ids of blocks that will be shown.
27 * The array of ids of blocks that will be hidden.
37 * Initial value of show array.
39 * Initial value of hide array.
41 * @return \CRM_Core_ShowHideBlocks the newly created object
43 public function __construct($show = NULL, $hide = NULL) {
60 * Add the values from this class to the template.
62 public function addToTemplate() {
66 foreach (array_keys($this->_hide
) as $h) {
75 foreach (array_keys($this->_show
) as $s) {
83 $template = CRM_Core_Smarty
::singleton();
84 $template->assign_by_ref('hideBlocks', $hide);
85 $template->assign_by_ref('showBlocks', $show);
89 * Add a value to the show array.
94 public function addShow($name) {
95 $this->_show
[$name] = 1;
96 if (array_key_exists($name, $this->_hide
)) {
97 unset($this->_hide
[$name]);
102 * Add a value to the hide array.
104 * @param string $name
107 public function addHide($name) {
108 $this->_hide
[$name] = 1;
109 if (array_key_exists($name, $this->_show
)) {
110 unset($this->_show
[$name]);