X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FShowHideBlocks.php;h=96707ae28e68f672a70168df504232c53e9db32b;hb=ff7da3a6508d0a7059c6527216920b2efb896b93;hp=3da48f4844254529d37c1f11d3012689fc57db36;hpb=fe6a56117db7e9dada18e60f91de717a89013d86;p=civicrm-core.git diff --git a/CRM/Core/ShowHideBlocks.php b/CRM/Core/ShowHideBlocks.php index 3da48f4844..96707ae28e 100644 --- a/CRM/Core/ShowHideBlocks.php +++ b/CRM/Core/ShowHideBlocks.php @@ -1,7 +1,7 @@ _show = $show; } @@ -83,10 +85,8 @@ class CRM_Core_ShowHideBlocks { * Load icon vars used in hide and show links * * @return void - * @access public - * @static */ - static function setIcons() { + public static function setIcons() { if (!isset(self::$_showIcon)) { $config = CRM_Core_Config::singleton(); self::$_showIcon = '' . ts('show field or section') . ''; @@ -98,9 +98,8 @@ class CRM_Core_ShowHideBlocks { * Add the values from this class to the template * * @return void - * @access public */ - function addToTemplate() { + public function addToTemplate() { $hide = $show = ''; $first = TRUE; @@ -129,12 +128,12 @@ class CRM_Core_ShowHideBlocks { /** * Add a value to the show array * - * @param string $name id to be added + * @param string $name + * Id to be added. * * @return void - * @access public */ - function addShow($name) { + public function addShow($name) { $this->_show[$name] = 1; if (array_key_exists($name, $this->_hide)) { unset($this->_hide[$name]); @@ -144,12 +143,12 @@ class CRM_Core_ShowHideBlocks { /** * Add a value to the hide array * - * @param string $name id to be added + * @param string $name + * Id to be added. * * @return void - * @access public */ - function addHide($name) { + public function addHide($name) { $this->_hide[$name] = 1; if (array_key_exists($name, $this->_show)) { unset($this->_show[$name]); @@ -159,39 +158,42 @@ class CRM_Core_ShowHideBlocks { /** * Create a well formatted html link from the smaller pieces * - * @param string $name name of the link + * @param string $name + * Name of the link. * @param string $href * @param string $text * @param string $js * - * @return string the formatted html link - * @access public + * @return string + * the formatted html link */ - static function linkHtml($name, $href, $text, $js) { + public static function linkHtml($name, $href, $text, $js) { return '$text"; } /** * Create links that we can use in the form * - * @param CRM_Core_Form $form the form object - * @param string $prefix the attribute that we are referencing - * @param string $showLinkText the text to be shown for the show link - * @param string $hideLinkText the text to be shown for the hide link + * @param CRM_Core_Form $form + * The form object. + * @param string $prefix + * The attribute that we are referencing. + * @param string $showLinkText + * The text to be shown for the show link. + * @param string $hideLinkText + * The text to be shown for the hide link. * * @param bool $assign * - * @static * * @return void - * @access public */ - static function links(&$form, $prefix, $showLinkText, $hideLinkText, $assign = TRUE) { + public static function links(&$form, $prefix, $showLinkText, $hideLinkText, $assign = TRUE) { $showCode = "cj('#id_{$prefix}').show(); cj('#id_{$prefix}_show').hide();"; $hideCode = "cj('#id_{$prefix}').hide(); cj('#id_{$prefix}_show').show(); return false;"; self::setIcons(); - $values = array(); + $values = array(); $values['show'] = self::linkHtml("${prefix}_show", "#${prefix}_hide", self::$_showIcon . $showLinkText, "onclick=\"$showCode\""); $values['hide'] = self::linkHtml("${prefix}_hide", "#${prefix}", self::$_hideIcon . $hideLinkText, "onclick=\"$hideCode\""); @@ -206,19 +208,26 @@ class CRM_Core_ShowHideBlocks { /** * Create html link elements that we can use in the form * - * @param CRM_Core_Form $form the form object - * @param int $index the current index of the element being processed - * @param int $maxIndex the max number of elements that will be processed - * @param string $prefix the attribute that we are referencing - * @param string $showLinkText the text to be shown for the show link - * @param string $hideLinkText the text to be shown for the hide link - * @param string $elementType the set the class - * @param string $hideLink the hide block string + * @param CRM_Core_Form $form + * The form object. + * @param int $index + * The current index of the element being processed. + * @param int $maxIndex + * The max number of elements that will be processed. + * @param string $prefix + * The attribute that we are referencing. + * @param string $showLinkText + * The text to be shown for the show link. + * @param string $hideLinkText + * The text to be shown for the hide link. + * @param string $elementType + * The set the class. + * @param string $hideLink + * The hide block string. * * @return void - * @access public */ - function linksForArray(&$form, $index, $maxIndex, $prefix, $showLinkText, $hideLinkText, $elementType = NULL, $hideLink = NULL) { + public function linksForArray(&$form, $index, $maxIndex, $prefix, $showLinkText, $hideLinkText, $elementType = NULL, $hideLink = NULL) { $showHidePrefix = str_replace(array("]", "["), array("", "_"), $prefix); $showHidePrefix = "id_" . $showHidePrefix; if ($index == $maxIndex) { @@ -259,5 +268,5 @@ class CRM_Core_ShowHideBlocks { ); } } -} +}