@@ -60,7 +60,7 @@ |
||
60 | 60 | * @return void |
61 | 61 | * @throws |
62 | 62 | */ |
63 | - function HTML_QuickForm_link($elementName=null, $elementLabel=null, $href=null, $text=null, $attributes=null) |
|
63 | + function HTML_QuickForm_link($elementName = null, $elementLabel = null, $href = null, $text = null, $attributes = null) |
|
64 | 64 | { |
65 | 65 | parent::__construct($elementName, $elementLabel, $attributes); |
66 | 66 | $this->_persistantFreeze = false; |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | $sort = null |
281 | 281 | ) { |
282 | 282 | $opts = $options; |
283 | - $options = null; // prevent to use the default select element load options |
|
283 | + $options = null; // prevent to use the default select element load options |
|
284 | 284 | |
285 | 285 | parent::__construct($elementName, $elementLabel, $options, $attributes); |
286 | 286 | |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | |
312 | 312 | //$this->_tableAttributes = $this->_getAttrString($attr); |
313 | 313 | $this->removeAttribute('class'); |
314 | - $this->setAttribute('class','form-control'); |
|
314 | + $this->setAttribute('class', 'form-control'); |
|
315 | 315 | |
316 | 316 | // set default add button attributes |
317 | 317 | $this->setButtonAttributes('add'); |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | function setButtonAttributes($button, $attributes = null) |
401 | 401 | { |
402 | 402 | if (!is_string($button)) { |
403 | - return PEAR::throwError('Argument 1 of HTML_QuickForm_advmultiselect::' . |
|
403 | + return PEAR::throwError('Argument 1 of HTML_QuickForm_advmultiselect::'. |
|
404 | 404 | 'setButtonAttributes is not a string', |
405 | 405 | HTML_QUICKFORM_ADVMULTISELECT_ERROR_INVALID_INPUT, |
406 | 406 | array('level' => 'exception')); |
@@ -514,7 +514,7 @@ discard block |
||
514 | 514 | } |
515 | 515 | break; |
516 | 516 | default; |
517 | - return PEAR::throwError('Argument 1 of HTML_QuickForm_advmultiselect::' . |
|
517 | + return PEAR::throwError('Argument 1 of HTML_QuickForm_advmultiselect::'. |
|
518 | 518 | 'setButtonAttributes has unexpected value', |
519 | 519 | HTML_QUICKFORM_ADVMULTISELECT_ERROR_INVALID_INPUT, |
520 | 520 | array('level' => 'error')); |
@@ -580,12 +580,12 @@ discard block |
||
580 | 580 | $css = str_replace('{id}', $id, $this->_elementCSS); |
581 | 581 | |
582 | 582 | if ($raw !== true) { |
583 | - $css = '<style type="text/css">' . PHP_EOL |
|
583 | + $css = '<style type="text/css">'.PHP_EOL |
|
584 | 584 | // Modified by Chamilo team, 16-MAR-2010. |
585 | 585 | //. '<!--' . $css . '// -->' . PHP_EOL |
586 | - . '/*<![CDATA[*/' . PHP_EOL |
|
587 | - . $css . PHP_EOL |
|
588 | - . '/*]]>*/' . PHP_EOL |
|
586 | + . '/*<![CDATA[*/'.PHP_EOL |
|
587 | + . $css.PHP_EOL |
|
588 | + . '/*]]>*/'.PHP_EOL |
|
589 | 589 | // |
590 | 590 | . '</style>'; |
591 | 591 | } |
@@ -609,9 +609,9 @@ discard block |
||
609 | 609 | $tab = $this->_getTab(); |
610 | 610 | |
611 | 611 | $selectId = $this->getName(); |
612 | - $selectName = $this->getName() . '[]'; |
|
613 | - $selectNameFrom = $this->getName() . '-f[]'; |
|
614 | - $selectNameTo = $this->getName() . '-t[]'; |
|
612 | + $selectName = $this->getName().'[]'; |
|
613 | + $selectNameFrom = $this->getName().'-f[]'; |
|
614 | + $selectNameTo = $this->getName().'-t[]'; |
|
615 | 615 | $selected_count = 0; |
616 | 616 | |
617 | 617 | // placeholder {unselected} existence determines if we will render |
@@ -621,7 +621,7 @@ discard block |
||
621 | 621 | |
622 | 622 | $id = $this->getAttribute('name'); |
623 | 623 | |
624 | - $strHtmlSelected = $tab . '<div id="qfams_'.$id.'">' . PHP_EOL; |
|
624 | + $strHtmlSelected = $tab.'<div id="qfams_'.$id.'">'.PHP_EOL; |
|
625 | 625 | $unselected_count = count($this->_options); |
626 | 626 | $checkbox_id_suffix = 0; |
627 | 627 | |
@@ -637,7 +637,7 @@ discard block |
||
637 | 637 | } |
638 | 638 | |
639 | 639 | if (is_array($this->_values) |
640 | - && in_array((string)$option['attr']['value'], $this->_values)) { |
|
640 | + && in_array((string) $option['attr']['value'], $this->_values)) { |
|
641 | 641 | // The items is *selected* |
642 | 642 | $checked = ' checked="checked"'; |
643 | 643 | $selected_count++; |
@@ -648,16 +648,16 @@ discard block |
||
648 | 648 | $checkbox_id_suffix++; |
649 | 649 | $strHtmlSelected .= $tab |
650 | 650 | . '<label' |
651 | - . $this->_getAttrString($labelAttributes) .'>' |
|
651 | + . $this->_getAttrString($labelAttributes).'>' |
|
652 | 652 | . '<input type="checkbox"' |
653 | - . ' id="'.$selectId . $checkbox_id_suffix.'"' |
|
653 | + . ' id="'.$selectId.$checkbox_id_suffix.'"' |
|
654 | 654 | . ' name="'.$selectName.'"' |
655 | 655 | . $checked |
656 | 656 | . $this->_getAttrString($option['attr']) |
657 | - . ' />' . $option['text'] . '</label>' |
|
657 | + . ' />'.$option['text'].'</label>' |
|
658 | 658 | . PHP_EOL; |
659 | 659 | } |
660 | - $strHtmlSelected .= $tab . '</div>'. PHP_EOL; |
|
660 | + $strHtmlSelected .= $tab.'</div>'.PHP_EOL; |
|
661 | 661 | |
662 | 662 | $strHtmlHidden = ''; |
663 | 663 | $strHtmlUnselected = ''; |
@@ -665,25 +665,25 @@ discard block |
||
665 | 665 | $strHtmlRemove = ''; |
666 | 666 | |
667 | 667 | // build the select all button with all its attributes |
668 | - $jsName = $this->_jsPrefix . $this->_jsPostfix; |
|
669 | - $attributes = array('onclick' => $jsName ."('". $selectId ."', 1);"); |
|
668 | + $jsName = $this->_jsPrefix.$this->_jsPostfix; |
|
669 | + $attributes = array('onclick' => $jsName."('".$selectId."', 1);"); |
|
670 | 670 | $this->_allButtonAttributes = array_merge($this->_allButtonAttributes, $attributes); |
671 | 671 | $attrStrAll = $this->_getAttrString($this->_allButtonAttributes); |
672 | - $strHtmlAll = "<input$attrStrAll />". PHP_EOL; |
|
672 | + $strHtmlAll = "<input$attrStrAll />".PHP_EOL; |
|
673 | 673 | |
674 | 674 | // build the select none button with all its attributes |
675 | - $attributes = array('onclick' => $jsName ."('". $selectId ."', 0);"); |
|
675 | + $attributes = array('onclick' => $jsName."('".$selectId."', 0);"); |
|
676 | 676 | $this->_noneButtonAttributes |
677 | 677 | = array_merge($this->_noneButtonAttributes, $attributes); |
678 | 678 | $attrStrNone = $this->_getAttrString($this->_noneButtonAttributes); |
679 | - $strHtmlNone = "<input$attrStrNone />". PHP_EOL; |
|
679 | + $strHtmlNone = "<input$attrStrNone />".PHP_EOL; |
|
680 | 680 | |
681 | 681 | // build the toggle selection button with all its attributes |
682 | - $attributes = array('onclick' => $jsName . |
|
683 | - "('". $selectId ."', 2);"); |
|
682 | + $attributes = array('onclick' => $jsName. |
|
683 | + "('".$selectId."', 2);"); |
|
684 | 684 | $this->_toggleButtonAttributes = array_merge($this->_toggleButtonAttributes, $attributes); |
685 | 685 | $attrStrToggle = $this->_getAttrString($this->_toggleButtonAttributes); |
686 | - $strHtmlToggle = "<input$attrStrToggle />". PHP_EOL; |
|
686 | + $strHtmlToggle = "<input$attrStrToggle />".PHP_EOL; |
|
687 | 687 | |
688 | 688 | $strHtmlMoveUp = ''; |
689 | 689 | $strHtmlMoveDown = ''; |
@@ -691,21 +691,21 @@ discard block |
||
691 | 691 | $strHtmlMoveBottom = ''; |
692 | 692 | |
693 | 693 | // default selection counters |
694 | - $strHtmlSelectedCount = $selected_count . '/' . $unselected_count; |
|
694 | + $strHtmlSelectedCount = $selected_count.'/'.$unselected_count; |
|
695 | 695 | } else { |
696 | 696 | // ... or a dual multi-select |
697 | 697 | $this->_jsPostfix = 'moveSelection'; |
698 | - $jsName = $this->_jsPrefix . $this->_jsPostfix; |
|
698 | + $jsName = $this->_jsPrefix.$this->_jsPostfix; |
|
699 | 699 | |
700 | 700 | // set name of Select From Box |
701 | 701 | $this->_attributesUnselected |
702 | - = array('id' => $selectId . '-f', |
|
702 | + = array('id' => $selectId.'-f', |
|
703 | 703 | 'name' => $selectNameFrom, |
704 | - 'ondblclick' => $jsName . |
|
704 | + 'ondblclick' => $jsName. |
|
705 | 705 | "('{$selectId}', ". |
706 | - "this.form.elements['" . $selectNameFrom . "'], " . |
|
707 | - "this.form.elements['" . $selectNameTo . "'], " . |
|
708 | - "this.form.elements['" . $selectName . "'], " . |
|
706 | + "this.form.elements['".$selectNameFrom."'], ". |
|
707 | + "this.form.elements['".$selectNameTo."'], ". |
|
708 | + "this.form.elements['".$selectName."'], ". |
|
709 | 709 | "'add', '{$this->_sort}')"); |
710 | 710 | $this->_attributesUnselected |
711 | 711 | = array_merge($this->_attributes, $this->_attributesUnselected); |
@@ -713,13 +713,13 @@ discard block |
||
713 | 713 | |
714 | 714 | // set name of Select To Box |
715 | 715 | $this->_attributesSelected |
716 | - = array('id' => $selectId . '-t', |
|
716 | + = array('id' => $selectId.'-t', |
|
717 | 717 | 'name' => $selectNameTo, |
718 | - 'ondblclick' => $jsName . |
|
719 | - "('{$selectId}', " . |
|
720 | - "this.form.elements['" . $selectNameFrom . "'], " . |
|
721 | - "this.form.elements['" . $selectNameTo . "'], ". |
|
722 | - "this.form.elements['" . $selectName . "'], " . |
|
718 | + 'ondblclick' => $jsName. |
|
719 | + "('{$selectId}', ". |
|
720 | + "this.form.elements['".$selectNameFrom."'], ". |
|
721 | + "this.form.elements['".$selectNameTo."'], ". |
|
722 | + "this.form.elements['".$selectName."'], ". |
|
723 | 723 | "'remove', '{$this->_sort}')"); |
724 | 724 | $this->_attributesSelected |
725 | 725 | = array_merge($this->_attributes, $this->_attributesSelected); |
@@ -728,7 +728,7 @@ discard block |
||
728 | 728 | // set name of Select hidden Box |
729 | 729 | $this->_attributesHidden |
730 | 730 | = array('name' => $selectName, |
731 | - 'style' => 'overflow: hidden; visibility: hidden; ' . |
|
731 | + 'style' => 'overflow: hidden; visibility: hidden; '. |
|
732 | 732 | 'width: 1px; height: 0;'); |
733 | 733 | $this->_attributesHidden |
734 | 734 | = array_merge($this->_attributes, $this->_attributesHidden); |
@@ -749,7 +749,7 @@ discard block |
||
749 | 749 | |
750 | 750 | foreach ($this->_options as $option) { |
751 | 751 | if (is_array($this->_values) |
752 | - && in_array((string)$option['attr']['value'], |
|
752 | + && in_array((string) $option['attr']['value'], |
|
753 | 753 | $this->_values)) { |
754 | 754 | // Get the post order |
755 | 755 | $key = array_search($option['attr']['value'], |
@@ -787,13 +787,13 @@ discard block |
||
787 | 787 | = array_merge($this->_attributes, $this->_attributesUnselected); |
788 | 788 | $attrUnselected = $this->_getAttrString($this->_attributesUnselected); |
789 | 789 | } |
790 | - $strHtmlUnselected = "<select$attrUnselected>". PHP_EOL; |
|
790 | + $strHtmlUnselected = "<select$attrUnselected>".PHP_EOL; |
|
791 | 791 | if ($unselected_count > 0) { |
792 | 792 | foreach ($arrHtmlUnselected as $data) { |
793 | 793 | $strHtmlUnselected |
794 | - .= $tabs . $tab |
|
795 | - . '<option' . $this->_getAttrString($data['attr']) . '>' |
|
796 | - . $data['text'] . '</option>' . PHP_EOL; |
|
794 | + .= $tabs.$tab |
|
795 | + . '<option'.$this->_getAttrString($data['attr']).'>' |
|
796 | + . $data['text'].'</option>'.PHP_EOL; |
|
797 | 797 | } |
798 | 798 | } else { |
799 | 799 | $strHtmlUnselected .= '<option value=""> </option>'; |
@@ -813,19 +813,19 @@ discard block |
||
813 | 813 | $strHtmlSelected = "<select$attrSelected>"; |
814 | 814 | if ($selected_count > 0) { |
815 | 815 | foreach ($arrHtmlSelected as $data) { |
816 | - $attribute = null; |
|
816 | + $attribute = null; |
|
817 | 817 | if (isset($data['attr'])) { |
818 | 818 | $attribute = $this->_getAttrString($data['attr']); |
819 | 819 | } |
820 | 820 | |
821 | - $text = null; |
|
821 | + $text = null; |
|
822 | 822 | if (isset($data['text'])) { |
823 | 823 | $text = $data['text']; |
824 | 824 | } |
825 | 825 | $strHtmlSelected |
826 | - .= $tabs . $tab |
|
827 | - . '<option' . $attribute. '>' |
|
828 | - . $text . '</option>'; |
|
826 | + .= $tabs.$tab |
|
827 | + . '<option'.$attribute.'>' |
|
828 | + . $text.'</option>'; |
|
829 | 829 | } |
830 | 830 | } else { |
831 | 831 | $strHtmlSelected .= '<option value=""> </option>'; |
@@ -835,32 +835,32 @@ discard block |
||
835 | 835 | $strHtmlSelected = '<input placeholder="'.get_lang('Search').'" id="'.$selectId.'-t-filter" type="text" class="form-control search-query select_class_filter"><br />'.$strHtmlSelected; |
836 | 836 | |
837 | 837 | // The 'hidden' multi-select |
838 | - $strHtmlHidden = "<select$attrHidden>". PHP_EOL; |
|
838 | + $strHtmlHidden = "<select$attrHidden>".PHP_EOL; |
|
839 | 839 | if (count($arrHtmlHidden) > 0) { |
840 | 840 | foreach ($arrHtmlHidden as $data) { |
841 | - $attribute = null; |
|
841 | + $attribute = null; |
|
842 | 842 | if (isset($data['attr'])) { |
843 | 843 | $attribute = $this->_getAttrString($data['attr']); |
844 | 844 | } |
845 | - $text = null; |
|
845 | + $text = null; |
|
846 | 846 | if (isset($data['text'])) { |
847 | 847 | $text = $data['text']; |
848 | 848 | } |
849 | 849 | $strHtmlHidden |
850 | - .= $tabs . $tab |
|
851 | - . '<option' . $attribute . '>' |
|
852 | - . $text . '</option>' . PHP_EOL; |
|
850 | + .= $tabs.$tab |
|
851 | + . '<option'.$attribute.'>' |
|
852 | + . $text.'</option>'.PHP_EOL; |
|
853 | 853 | } |
854 | 854 | } |
855 | 855 | $strHtmlHidden .= '</select>'; |
856 | 856 | |
857 | 857 | // build the remove button with all its attributes |
858 | 858 | $attributes |
859 | - = array('onclick' => $jsName . |
|
860 | - "('{$selectId}', " . |
|
861 | - "this.form.elements['" . $selectNameFrom . "'], " . |
|
862 | - "this.form.elements['" . $selectNameTo . "'], " . |
|
863 | - "this.form.elements['" . $selectName . "'], " . |
|
859 | + = array('onclick' => $jsName. |
|
860 | + "('{$selectId}', ". |
|
861 | + "this.form.elements['".$selectNameFrom."'], ". |
|
862 | + "this.form.elements['".$selectNameTo."'], ". |
|
863 | + "this.form.elements['".$selectName."'], ". |
|
864 | 864 | "'remove', '{$this->_sort}'); return false;"); |
865 | 865 | $this->_removeButtonAttributes |
866 | 866 | = array_merge($this->_removeButtonAttributes, $attributes); |
@@ -869,11 +869,11 @@ discard block |
||
869 | 869 | |
870 | 870 | // build the add button with all its attributes |
871 | 871 | $attributes |
872 | - = array('onclick' => $jsName . |
|
873 | - "('{$selectId}', " . |
|
874 | - "this.form.elements['" . $selectNameFrom . "'], " . |
|
875 | - "this.form.elements['" . $selectNameTo . "'], " . |
|
876 | - "this.form.elements['" . $selectName . "'], " . |
|
872 | + = array('onclick' => $jsName. |
|
873 | + "('{$selectId}', ". |
|
874 | + "this.form.elements['".$selectNameFrom."'], ". |
|
875 | + "this.form.elements['".$selectNameTo."'], ". |
|
876 | + "this.form.elements['".$selectName."'], ". |
|
877 | 877 | "'add', '{$this->_sort}'); return false;"); |
878 | 878 | $this->_addButtonAttributes = array_merge($this->_addButtonAttributes, $attributes); |
879 | 879 | $attrStrAdd = $this->_getAttrString($this->_addButtonAttributes); |
@@ -881,93 +881,93 @@ discard block |
||
881 | 881 | |
882 | 882 | // build the select all button with all its attributes |
883 | 883 | $attributes |
884 | - = array('onclick' => $jsName . |
|
885 | - "('{$selectId}', " . |
|
886 | - "this.form.elements['" . $selectNameFrom . "'], " . |
|
887 | - "this.form.elements['" . $selectNameTo . "'], " . |
|
888 | - "this.form.elements['" . $selectName . "'], " . |
|
884 | + = array('onclick' => $jsName. |
|
885 | + "('{$selectId}', ". |
|
886 | + "this.form.elements['".$selectNameFrom."'], ". |
|
887 | + "this.form.elements['".$selectNameTo."'], ". |
|
888 | + "this.form.elements['".$selectName."'], ". |
|
889 | 889 | "'all', '{$this->_sort}'); return false;"); |
890 | 890 | $this->_allButtonAttributes = array_merge($this->_allButtonAttributes, $attributes); |
891 | 891 | $attrStrAll = $this->_getAttrString($this->_allButtonAttributes); |
892 | - $strHtmlAll = "<input$attrStrAll />". PHP_EOL; |
|
892 | + $strHtmlAll = "<input$attrStrAll />".PHP_EOL; |
|
893 | 893 | |
894 | 894 | // build the select none button with all its attributes |
895 | 895 | $attributes |
896 | - = array('onclick' => $jsName . |
|
897 | - "('{$selectId}', " . |
|
898 | - "this.form.elements['" . $selectNameFrom . "'], " . |
|
899 | - "this.form.elements['" . $selectNameTo . "'], " . |
|
900 | - "this.form.elements['" . $selectName . "'], " . |
|
896 | + = array('onclick' => $jsName. |
|
897 | + "('{$selectId}', ". |
|
898 | + "this.form.elements['".$selectNameFrom."'], ". |
|
899 | + "this.form.elements['".$selectNameTo."'], ". |
|
900 | + "this.form.elements['".$selectName."'], ". |
|
901 | 901 | "'none', '{$this->_sort}'); return false;"); |
902 | 902 | $this->_noneButtonAttributes |
903 | 903 | = array_merge($this->_noneButtonAttributes, $attributes); |
904 | 904 | $attrStrNone = $this->_getAttrString($this->_noneButtonAttributes); |
905 | - $strHtmlNone = "<input$attrStrNone />". PHP_EOL; |
|
905 | + $strHtmlNone = "<input$attrStrNone />".PHP_EOL; |
|
906 | 906 | |
907 | 907 | // build the toggle button with all its attributes |
908 | 908 | $attributes |
909 | - = array('onclick' => $jsName . |
|
910 | - "('{$selectId}', " . |
|
911 | - "this.form.elements['" . $selectNameFrom . "'], " . |
|
912 | - "this.form.elements['" . $selectNameTo . "'], " . |
|
913 | - "this.form.elements['" . $selectName . "'], " . |
|
909 | + = array('onclick' => $jsName. |
|
910 | + "('{$selectId}', ". |
|
911 | + "this.form.elements['".$selectNameFrom."'], ". |
|
912 | + "this.form.elements['".$selectNameTo."'], ". |
|
913 | + "this.form.elements['".$selectName."'], ". |
|
914 | 914 | "'toggle', '{$this->_sort}'); return false;"); |
915 | 915 | $this->_toggleButtonAttributes |
916 | 916 | = array_merge($this->_toggleButtonAttributes, $attributes); |
917 | 917 | $attrStrToggle = $this->_getAttrString($this->_toggleButtonAttributes); |
918 | - $strHtmlToggle = "<input$attrStrToggle />". PHP_EOL; |
|
918 | + $strHtmlToggle = "<input$attrStrToggle />".PHP_EOL; |
|
919 | 919 | |
920 | 920 | // build the move up button with all its attributes |
921 | 921 | $attributes |
922 | - = array('onclick' => "{$this->_jsPrefix}moveUp" . |
|
923 | - "(this.form.elements['" . $selectNameTo . "'], " . |
|
924 | - "this.form.elements['" . $selectName . "']); " . |
|
922 | + = array('onclick' => "{$this->_jsPrefix}moveUp". |
|
923 | + "(this.form.elements['".$selectNameTo."'], ". |
|
924 | + "this.form.elements['".$selectName."']); ". |
|
925 | 925 | "return false;"); |
926 | 926 | $this->_upButtonAttributes |
927 | 927 | = array_merge($this->_upButtonAttributes, $attributes); |
928 | 928 | $attrStrUp = $this->_getAttrString($this->_upButtonAttributes); |
929 | - $strHtmlMoveUp = "<input$attrStrUp />". PHP_EOL; |
|
929 | + $strHtmlMoveUp = "<input$attrStrUp />".PHP_EOL; |
|
930 | 930 | |
931 | 931 | // build the move down button with all its attributes |
932 | 932 | $attributes |
933 | - = array('onclick' => "{$this->_jsPrefix}moveDown" . |
|
934 | - "(this.form.elements['" . $selectNameTo . "'], " . |
|
935 | - "this.form.elements['" . $selectName . "']); " . |
|
933 | + = array('onclick' => "{$this->_jsPrefix}moveDown". |
|
934 | + "(this.form.elements['".$selectNameTo."'], ". |
|
935 | + "this.form.elements['".$selectName."']); ". |
|
936 | 936 | "return false;"); |
937 | 937 | $this->_downButtonAttributes |
938 | 938 | = array_merge($this->_downButtonAttributes, $attributes); |
939 | 939 | $attrStrDown = $this->_getAttrString($this->_downButtonAttributes); |
940 | - $strHtmlMoveDown = "<input$attrStrDown />". PHP_EOL; |
|
940 | + $strHtmlMoveDown = "<input$attrStrDown />".PHP_EOL; |
|
941 | 941 | |
942 | 942 | // build the move top button with all its attributes |
943 | 943 | $attributes |
944 | - = array('onclick' => "{$this->_jsPrefix}moveTop" . |
|
945 | - "(this.form.elements['" . $selectNameTo . "'], " . |
|
946 | - "this.form.elements['" . $selectName . "']); " . |
|
944 | + = array('onclick' => "{$this->_jsPrefix}moveTop". |
|
945 | + "(this.form.elements['".$selectNameTo."'], ". |
|
946 | + "this.form.elements['".$selectName."']); ". |
|
947 | 947 | "return false;"); |
948 | 948 | $this->_topButtonAttributes |
949 | 949 | = array_merge($this->_topButtonAttributes, $attributes); |
950 | 950 | $attrStrTop = $this->_getAttrString($this->_topButtonAttributes); |
951 | - $strHtmlMoveTop = "<input$attrStrTop />". PHP_EOL; |
|
951 | + $strHtmlMoveTop = "<input$attrStrTop />".PHP_EOL; |
|
952 | 952 | |
953 | 953 | // build the move bottom button with all its attributes |
954 | 954 | $attributes |
955 | - = array('onclick' => "{$this->_jsPrefix}moveBottom" . |
|
956 | - "(this.form.elements['" . $selectNameTo . "'], " . |
|
957 | - "this.form.elements['" . $selectName . "']); " . |
|
955 | + = array('onclick' => "{$this->_jsPrefix}moveBottom". |
|
956 | + "(this.form.elements['".$selectNameTo."'], ". |
|
957 | + "this.form.elements['".$selectName."']); ". |
|
958 | 958 | "return false;"); |
959 | 959 | $this->_bottomButtonAttributes |
960 | 960 | = array_merge($this->_bottomButtonAttributes, $attributes); |
961 | 961 | $attrStrBottom = $this->_getAttrString($this->_bottomButtonAttributes); |
962 | - $strHtmlMoveBottom = "<input$attrStrBottom />". PHP_EOL; |
|
962 | + $strHtmlMoveBottom = "<input$attrStrBottom />".PHP_EOL; |
|
963 | 963 | |
964 | 964 | // default selection counters |
965 | 965 | $strHtmlSelectedCount = $selected_count; |
966 | 966 | } |
967 | 967 | $strHtmlUnselectedCount = $unselected_count; |
968 | 968 | |
969 | - $strHtmlSelectedCountId = $selectId .'_selected'; |
|
970 | - $strHtmlUnselectedCountId = $selectId .'_unselected'; |
|
969 | + $strHtmlSelectedCountId = $selectId.'_selected'; |
|
970 | + $strHtmlUnselectedCountId = $selectId.'_unselected'; |
|
971 | 971 | |
972 | 972 | // render all part of the multi select component with the template |
973 | 973 | $strHtml = $this->_elementTemplate; |
@@ -980,7 +980,7 @@ discard block |
||
980 | 980 | // render extra labels, if any |
981 | 981 | if (is_array($labels)) { |
982 | 982 | foreach ($labels as $key => $text) { |
983 | - $key = is_int($key)? $key + 2: $key; |
|
983 | + $key = is_int($key) ? $key + 2 : $key; |
|
984 | 984 | $strHtml = str_replace("{label_{$key}}", $text, $strHtml); |
985 | 985 | $strHtml = str_replace("<!-- BEGIN label_{$key} -->", '', $strHtml); |
986 | 986 | $strHtml = str_replace("<!-- END label_{$key} -->", '', $strHtml); |
@@ -1051,7 +1051,7 @@ discard block |
||
1051 | 1051 | $comment = $this->getComment(); |
1052 | 1052 | |
1053 | 1053 | if (!empty($comment)) { |
1054 | - $strHtml = $tabs . '<!-- ' . $comment . " //-->" . PHP_EOL . $strHtml; |
|
1054 | + $strHtml = $tabs.'<!-- '.$comment." //-->".PHP_EOL.$strHtml; |
|
1055 | 1055 | } |
1056 | 1056 | |
1057 | 1057 | |
@@ -1087,10 +1087,10 @@ discard block |
||
1087 | 1087 | |
1088 | 1088 | if ($raw !== true) { |
1089 | 1089 | $js = '<script type="text/javascript">' |
1090 | - . PHP_EOL . '//<![CDATA[' |
|
1091 | - . PHP_EOL . $js |
|
1092 | - . PHP_EOL . '//]]>' |
|
1093 | - . PHP_EOL . '</script>' |
|
1090 | + . PHP_EOL.'//<![CDATA[' |
|
1091 | + . PHP_EOL.$js |
|
1092 | + . PHP_EOL.'//]]>' |
|
1093 | + . PHP_EOL.'</script>' |
|
1094 | 1094 | . PHP_EOL; |
1095 | 1095 | } |
1096 | 1096 | |
@@ -1144,7 +1144,7 @@ discard block |
||
1144 | 1144 | function loadArray($arr, $values = null) |
1145 | 1145 | { |
1146 | 1146 | if (!is_array($arr)) { |
1147 | - return PEAR::throwError('Argument 1 of HTML_QuickForm_advmultiselect::' . |
|
1147 | + return PEAR::throwError('Argument 1 of HTML_QuickForm_advmultiselect::'. |
|
1148 | 1148 | 'loadArray is not a valid array', |
1149 | 1149 | HTML_QUICKFORM_ADVMULTISELECT_ERROR_INVALID_INPUT, |
1150 | 1150 | array('level' => 'exception')); |
@@ -1181,7 +1181,7 @@ discard block |
||
1181 | 1181 | function setPersistantOptions($optionValues, $persistant = true) |
1182 | 1182 | { |
1183 | 1183 | if (!is_bool($persistant)) { |
1184 | - return PEAR::throwError('Argument 2 of HTML_QuickForm_advmultiselect::' . |
|
1184 | + return PEAR::throwError('Argument 2 of HTML_QuickForm_advmultiselect::'. |
|
1185 | 1185 | 'setPersistantOptions is not a boolean', |
1186 | 1186 | HTML_QUICKFORM_ADVMULTISELECT_ERROR_INVALID_INPUT, |
1187 | 1187 | array('level' => 'exception')); |
@@ -1190,7 +1190,7 @@ discard block |
||
1190 | 1190 | $optionValues = array($optionValues); |
1191 | 1191 | } |
1192 | 1192 | if (!is_array($optionValues)) { |
1193 | - return PEAR::throwError('Argument 1 of HTML_QuickForm_advmultiselect::' . |
|
1193 | + return PEAR::throwError('Argument 1 of HTML_QuickForm_advmultiselect::'. |
|
1194 | 1194 | 'setPersistantOptions is not a valid array', |
1195 | 1195 | HTML_QUICKFORM_ADVMULTISELECT_ERROR_INVALID_INPUT, |
1196 | 1196 | array('level' => 'exception')); |
@@ -156,12 +156,12 @@ discard block |
||
156 | 156 | // }}} |
157 | 157 | // {{{ setValue() |
158 | 158 | |
159 | - /** |
|
160 | - * Sets the element's value |
|
161 | - * |
|
162 | - * @param mixed Element's value |
|
163 | - * @access public |
|
164 | - */ |
|
159 | + /** |
|
160 | + * Sets the element's value |
|
161 | + * |
|
162 | + * @param mixed Element's value |
|
163 | + * @access public |
|
164 | + */ |
|
165 | 165 | function setValue($value) |
166 | 166 | { |
167 | 167 | $this->setChecked(isset($this->_values[1]) && $value == $this->_values[1]); |
@@ -171,12 +171,12 @@ discard block |
||
171 | 171 | // }}} |
172 | 172 | // {{{ getValue() |
173 | 173 | |
174 | - /** |
|
175 | - * Returns the element's value |
|
176 | - * |
|
177 | - * @access public |
|
178 | - * @return mixed |
|
179 | - */ |
|
174 | + /** |
|
175 | + * Returns the element's value |
|
176 | + * |
|
177 | + * @access public |
|
178 | + * @return mixed |
|
179 | + */ |
|
180 | 180 | function getValue() |
181 | 181 | { |
182 | 182 | if (is_array($this->_values)) { |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | 'type' => 'hidden', |
206 | 206 | 'name' => $this->getName(), |
207 | 207 | 'value' => $this->_values[0] |
208 | - )) . ' />' . parent::toHtml(); |
|
208 | + )) . ' />' . parent::toHtml(); |
|
209 | 209 | |
210 | 210 | } |
211 | 211 | } //end func toHtml |
@@ -213,14 +213,14 @@ discard block |
||
213 | 213 | // }}} |
214 | 214 | // {{{ getFrozenHtml() |
215 | 215 | |
216 | - /** |
|
217 | - * Unlike checkbox, this has to append a hidden input in both |
|
218 | - * checked and non-checked states |
|
219 | - */ |
|
216 | + /** |
|
217 | + * Unlike checkbox, this has to append a hidden input in both |
|
218 | + * checked and non-checked states |
|
219 | + */ |
|
220 | 220 | function getFrozenHtml() |
221 | 221 | { |
222 | 222 | return ($this->getChecked()? '<tt>[x]</tt>': '<tt>[ ]</tt>') . |
223 | - $this->_getPersistantData(); |
|
223 | + $this->_getPersistantData(); |
|
224 | 224 | } |
225 | 225 | |
226 | 226 | // }}} |
@@ -262,10 +262,10 @@ discard block |
||
262 | 262 | // }}} |
263 | 263 | // {{{ exportValue() |
264 | 264 | |
265 | - /** |
|
266 | - * This element has a value even if it is not checked, thus we override |
|
267 | - * checkbox's behaviour here |
|
268 | - */ |
|
265 | + /** |
|
266 | + * This element has a value even if it is not checked, thus we override |
|
267 | + * checkbox's behaviour here |
|
268 | + */ |
|
269 | 269 | function exportValue(&$submitValues, $assoc) |
270 | 270 | { |
271 | 271 | $value = $this->_findValue($submitValues); |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | * @access public |
82 | 82 | * @return void |
83 | 83 | */ |
84 | - function HTML_QuickForm_advcheckbox($elementName=null, $elementLabel=null, $text=null, $attributes=null, $values=null) |
|
84 | + function HTML_QuickForm_advcheckbox($elementName = null, $elementLabel = null, $text = null, $attributes = null, $values = null) |
|
85 | 85 | { |
86 | 86 | $this->HTML_QuickForm_checkbox($elementName, $elementLabel, $text, $attributes); |
87 | 87 | $this->setValues($values); |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | function getValue() |
181 | 181 | { |
182 | 182 | if (is_array($this->_values)) { |
183 | - return $this->_values[$this->getChecked()? 1: 0]; |
|
183 | + return $this->_values[$this->getChecked() ? 1 : 0]; |
|
184 | 184 | } else { |
185 | 185 | return null; |
186 | 186 | } |
@@ -201,11 +201,11 @@ discard block |
||
201 | 201 | if ($this->_flagFrozen) { |
202 | 202 | return parent::toHtml(); |
203 | 203 | } else { |
204 | - return '<input' . $this->_getAttrString(array( |
|
204 | + return '<input'.$this->_getAttrString(array( |
|
205 | 205 | 'type' => 'hidden', |
206 | 206 | 'name' => $this->getName(), |
207 | 207 | 'value' => $this->_values[0] |
208 | - )) . ' />' . parent::toHtml(); |
|
208 | + )).' />'.parent::toHtml(); |
|
209 | 209 | |
210 | 210 | } |
211 | 211 | } //end func toHtml |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | */ |
220 | 220 | function getFrozenHtml() |
221 | 221 | { |
222 | - return ($this->getChecked()? '<tt>[x]</tt>': '<tt>[ ]</tt>') . |
|
222 | + return ($this->getChecked() ? '<tt>[x]</tt>' : '<tt>[ ]</tt>'). |
|
223 | 223 | $this->_getPersistantData(); |
224 | 224 | } |
225 | 225 |
@@ -60,7 +60,7 @@ |
||
60 | 60 | * Freeze the element so that only its value is returned |
61 | 61 | * |
62 | 62 | * @access public |
63 | - * @return void |
|
63 | + * @return boolean |
|
64 | 64 | */ |
65 | 65 | function freeze() |
66 | 66 | { |
@@ -37,26 +37,26 @@ |
||
37 | 37 | class HTML_QuickForm_html extends HTML_QuickForm_static |
38 | 38 | { |
39 | 39 | |
40 | - /** |
|
41 | - * Class constructor |
|
42 | - * |
|
43 | - * @param string $text raw HTML to add |
|
44 | - * @access public |
|
45 | - * @return void |
|
46 | - */ |
|
40 | + /** |
|
41 | + * Class constructor |
|
42 | + * |
|
43 | + * @param string $text raw HTML to add |
|
44 | + * @access public |
|
45 | + * @return void |
|
46 | + */ |
|
47 | 47 | public function __construct($text = null) |
48 | 48 | { |
49 | 49 | parent::__construct(null, null, $text); |
50 | 50 | $this->_type = 'html'; |
51 | 51 | } |
52 | 52 | |
53 | - /** |
|
54 | - * Accepts a renderer |
|
55 | - * |
|
56 | - * @param HTML_QuickForm_Renderer renderer object (only works with Default renderer!) |
|
57 | - * @access public |
|
58 | - * @return void |
|
59 | - */ |
|
53 | + /** |
|
54 | + * Accepts a renderer |
|
55 | + * |
|
56 | + * @param HTML_QuickForm_Renderer renderer object (only works with Default renderer!) |
|
57 | + * @access public |
|
58 | + * @return void |
|
59 | + */ |
|
60 | 60 | public function accept(&$renderer, $required = false, $error = null) |
61 | 61 | { |
62 | 62 | $renderer->renderHtml($this); |
@@ -91,6 +91,6 @@ |
||
91 | 91 | { |
92 | 92 | $value = $this->getValue(); |
93 | 93 | return ('' != $value? '**********': ' ') . |
94 | - $this->_getPersistantData(); |
|
94 | + $this->_getPersistantData(); |
|
95 | 95 | } |
96 | 96 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | * @access public |
47 | 47 | * @throws |
48 | 48 | */ |
49 | - public function __construct($elementName=null, $elementLabel=null, $attributes=null) |
|
49 | + public function __construct($elementName = null, $elementLabel = null, $attributes = null) |
|
50 | 50 | { |
51 | 51 | $attributes['class'] = isset($attributes['class']) ? $attributes['class'] : 'form-control'; |
52 | 52 | parent::__construct($elementName, $elementLabel, $attributes); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | public function getFrozenHtml() |
91 | 91 | { |
92 | 92 | $value = $this->getValue(); |
93 | - return ('' != $value? '**********': ' ') . |
|
93 | + return ('' != $value ? '**********' : ' '). |
|
94 | 94 | $this->_getPersistantData(); |
95 | 95 | } |
96 | 96 | } |
@@ -100,9 +100,9 @@ |
||
100 | 100 | // }}} |
101 | 101 | // {{{ accept() |
102 | 102 | |
103 | - /** |
|
104 | - * This is essentially a hidden element and should be rendered as one |
|
105 | - */ |
|
103 | + /** |
|
104 | + * This is essentially a hidden element and should be rendered as one |
|
105 | + */ |
|
106 | 106 | function accept(&$renderer) |
107 | 107 | { |
108 | 108 | $renderer->renderHidden($this); |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | * @access public |
52 | 52 | * @return void |
53 | 53 | */ |
54 | - function HTML_QuickForm_hiddenselect($elementName=null, $elementLabel=null, $options=null, $attributes=null) |
|
54 | + function HTML_QuickForm_hiddenselect($elementName = null, $elementLabel = null, $options = null, $attributes = null) |
|
55 | 55 | { |
56 | 56 | parent::__construct($elementName, $elementLabel, $attributes); |
57 | 57 | $this->_persistantFreeze = true; |
@@ -85,11 +85,11 @@ discard block |
||
85 | 85 | foreach ($this->_values as $key => $val) { |
86 | 86 | for ($i = 0, $optCount = count($this->_options); $i < $optCount; $i++) { |
87 | 87 | if ($val == $this->_options[$i]['attr']['value']) { |
88 | - $strHtml .= $tabs . '<input' . $this->_getAttrString(array( |
|
88 | + $strHtml .= $tabs.'<input'.$this->_getAttrString(array( |
|
89 | 89 | 'type' => 'hidden', |
90 | 90 | 'name' => $name, |
91 | 91 | 'value' => $val |
92 | - )) . " />\n" ; |
|
92 | + ))." />\n"; |
|
93 | 93 | } |
94 | 94 | } |
95 | 95 | } |
@@ -183,9 +183,9 @@ |
||
183 | 183 | return true; |
184 | 184 | } |
185 | 185 | |
186 | - /** |
|
187 | - * We don't need values from button-type elements (except submit) and files |
|
188 | - */ |
|
186 | + /** |
|
187 | + * We don't need values from button-type elements (except submit) and files |
|
188 | + */ |
|
189 | 189 | function exportValue(&$submitValues, $assoc = false) |
190 | 190 | { |
191 | 191 | $type = $this->getType(); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * @access public |
48 | 48 | * @return void |
49 | 49 | */ |
50 | - public function __construct($elementName=null, $elementLabel=null, $attributes=null) |
|
50 | + public function __construct($elementName = null, $elementLabel = null, $attributes = null) |
|
51 | 51 | { |
52 | 52 | parent::__construct($elementName, $elementLabel, $attributes); |
53 | 53 | } //end constructor |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | if ($this->_flagFrozen) { |
147 | 147 | return $this->getFrozenHtml(); |
148 | 148 | } else { |
149 | - return $this->_getTabs() . '<input' . $this->_getAttrString($this->_attributes) . ' />'; |
|
149 | + return $this->_getTabs().'<input'.$this->_getAttrString($this->_attributes).' />'; |
|
150 | 150 | } |
151 | 151 | } //end func toHtml |
152 | 152 |
@@ -60,7 +60,7 @@ |
||
60 | 60 | * Freeze the element so that only its value is returned |
61 | 61 | * |
62 | 62 | * @access public |
63 | - * @return void |
|
63 | + * @return boolean |
|
64 | 64 | */ |
65 | 65 | function freeze() |
66 | 66 | { |
@@ -184,9 +184,9 @@ |
||
184 | 184 | // }}} |
185 | 185 | // {{{ exportValue() |
186 | 186 | |
187 | - /** |
|
188 | - * We override this here because we don't want any values from static elements |
|
189 | - */ |
|
187 | + /** |
|
188 | + * We override this here because we don't want any values from static elements |
|
189 | + */ |
|
190 | 190 | function exportValue(&$submitValues, $assoc = false) |
191 | 191 | { |
192 | 192 | return null; |
@@ -131,7 +131,7 @@ |
||
131 | 131 | */ |
132 | 132 | public function toHtml() |
133 | 133 | { |
134 | - return $this->_getTabs() . $this->_text; |
|
134 | + return $this->_getTabs().$this->_text; |
|
135 | 135 | } //end func toHtml |
136 | 136 | |
137 | 137 | // }}} |
@@ -60,7 +60,7 @@ |
||
60 | 60 | * Freeze the element so that only its value is returned |
61 | 61 | * |
62 | 62 | * @access public |
63 | - * @return void |
|
63 | + * @return boolean |
|
64 | 64 | */ |
65 | 65 | function freeze() |
66 | 66 | { |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | { |
176 | 176 | if ($this->getChecked()) { |
177 | 177 | return '<code>[x]</code>' . |
178 | - $this->_getPersistantData(); |
|
178 | + $this->_getPersistantData(); |
|
179 | 179 | } else { |
180 | 180 | return '<code>[ ]</code>'; |
181 | 181 | } |
@@ -288,9 +288,9 @@ discard block |
||
288 | 288 | // }}} |
289 | 289 | // {{{ exportValue() |
290 | 290 | |
291 | - /** |
|
292 | - * Return true if the checkbox is checked, null if it is not checked (getValue() returns false) |
|
293 | - */ |
|
291 | + /** |
|
292 | + * Return true if the checkbox is checked, null if it is not checked (getValue() returns false) |
|
293 | + */ |
|
294 | 294 | function exportValue(&$submitValues, $assoc = false) |
295 | 295 | { |
296 | 296 | $value = $this->_findValue($submitValues); |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | */ |
125 | 125 | function getChecked() |
126 | 126 | { |
127 | - return (bool)$this->getAttribute('checked'); |
|
127 | + return (bool) $this->getAttribute('checked'); |
|
128 | 128 | } //end func getChecked |
129 | 129 | |
130 | 130 | // }}} |
@@ -147,9 +147,9 @@ discard block |
||
147 | 147 | $labelClass = $this->labelClass; |
148 | 148 | $checkboxClass = $this->checkboxClass; |
149 | 149 | |
150 | - $label =' |
|
150 | + $label = ' |
|
151 | 151 | <div class="'.$checkboxClass.'"> |
152 | - <label class="'.$labelClass.'">' . |
|
152 | + <label class="'.$labelClass.'">'. |
|
153 | 153 | HTML_QuickForm_input::toHtml().$this->_text. |
154 | 154 | '</label> |
155 | 155 | </div> |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | return $label; |
159 | 159 | } |
160 | 160 | |
161 | - return HTML_QuickForm_input::toHtml() . $label; |
|
161 | + return HTML_QuickForm_input::toHtml().$label; |
|
162 | 162 | } //end func toHtml |
163 | 163 | |
164 | 164 | // }}} |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | function getFrozenHtml() |
175 | 175 | { |
176 | 176 | if ($this->getChecked()) { |
177 | - return '<code>[x]</code>' . |
|
177 | + return '<code>[x]</code>'. |
|
178 | 178 | $this->_getPersistantData(); |
179 | 179 | } else { |
180 | 180 | return '<code>[ ]</code>'; |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | { |
296 | 296 | $value = $this->_findValue($submitValues); |
297 | 297 | if (null === $value) { |
298 | - $value = $this->getChecked()? true: null; |
|
298 | + $value = $this->getChecked() ? true : null; |
|
299 | 299 | } |
300 | 300 | return $this->_prepareValue($value, $assoc); |
301 | 301 | } |
@@ -60,7 +60,7 @@ |
||
60 | 60 | * Freeze the element so that only its value is returned |
61 | 61 | * |
62 | 62 | * @access public |
63 | - * @return void |
|
63 | + * @return boolean |
|
64 | 64 | */ |
65 | 65 | function freeze() |
66 | 66 | { |