cvs: pear /HTML_QuickForm_advmultiselect advmultiselect.php

[email protected] ("Laurent Laville")
Newsgroups php.pear.cvs
Message-ID <cvsfarell1209212496@cvsserver>
farell		Sat Apr 26 12:21:36 2008 UTC

  Modified files:              
    /pear/HTML_QuickForm_advmultiselect	advmultiselect.php 
  Log:
  - removed support of PHP_EOL constant wrapper (need at least PHP 4.3.10 now to work)
  - replaced $this->getName() by $selectId variable (code factorized)
  
http://cvs.php.net/viewvc.cgi/pear/HTML_QuickForm_advmultiselect/advmultiselect.php?r1=1.15&r2=1.16&diff_format=u
Index: pear/HTML_QuickForm_advmultiselect/advmultiselect.php
diff -u pear/HTML_QuickForm_advmultiselect/advmultiselect.php:1.15 pear/HTML_QuickForm_advmultiselect/advmultiselect.php:1.16
--- pear/HTML_QuickForm_advmultiselect/advmultiselect.php:1.15	Sat Apr 26 12:16:09 2008
+++ pear/HTML_QuickForm_advmultiselect/advmultiselect.php	Sat Apr 26 12:21:36 2008
@@ -36,7 +36,7 @@
  * @author    Laurent Laville <[email protected]>
  * @copyright 2005-2008 Laurent Laville
  * @license   http://www.opensource.org/licenses/bsd-license.php  BSD
- * @version   CVS: $Id: advmultiselect.php,v 1.15 2008/04/26 12:16:09 farell Exp $
+ * @version   CVS: $Id: advmultiselect.php,v 1.16 2008/04/26 12:21:36 farell Exp $
  * @link      http://pear.php.net/package/HTML_QuickForm_advmultiselect
  * @since     File available since Release 0.4.0
  */
@@ -44,33 +44,6 @@
 require_once 'HTML/QuickForm/select.php';
 
 /**
- * Replace PHP_EOL constant
- *
- *  category    PHP
- *  package     PHP_Compat
- * @link        http://php.net/reserved.constants.core
- * @author      Aidan Lister <[email protected]>
- * @since       PHP 5.0.2
- */
-if (!defined('PHP_EOL')) {
-    switch (strtoupper(substr(PHP_OS, 0, 3))) {
-    // Windows
-    case 'WIN':
-        define('PHP_EOL', "\r\n");
-        break;
-
-    // Mac
-    case 'DAR':
-        define('PHP_EOL', "\r");
-        break;
-
-    // Unix
-    default:
-        define('PHP_EOL', "\n");
-    }
-}
-
-/**
  * Element for HTML_QuickForm that emulate a multi-select.
  *
  * The HTML_QuickForm_advmultiselect package adds an element to the
@@ -609,7 +582,7 @@
                                  .  '<label'
                                  .  $this->_getAttrString($labelAttributes) .'>'
                                  .  '<input type="checkbox"'
-                                 .  ' id="'.$this->getName().'"'
+                                 .  ' id="'.$selectId.'"'
                                  .  ' name="'.$selectName.'"'
                                  .  $checked
                                  .  $this->_getAttrString($option['attr'])
@@ -626,7 +599,7 @@
             // build the select all button with all its attributes
             $jsName     = $this->_jsPrefix . $this->_jsPostfix;
             $attributes = array('onclick' => $jsName .
-                                             "('". $this->getName() ."', 1);");
+                                             "('". $selectId ."', 1);");
             $this->_allButtonAttributes
                         = array_merge($this->_allButtonAttributes, $attributes);
             $attrStrAll = $this->_getAttrString($this->_allButtonAttributes);
@@ -634,7 +607,7 @@
 
             // build the select none button with all its attributes
             $attributes = array('onclick' => $jsName .
-                                             "('". $this->getName() ."', 0);");
+                                             "('". $selectId ."', 0);");
             $this->_noneButtonAttributes
                          = array_merge($this->_noneButtonAttributes, $attributes);
             $attrStrNone = $this->_getAttrString($this->_noneButtonAttributes);
@@ -642,7 +615,7 @@
 
             // build the toggle selection button with all its attributes
             $attributes = array('onclick' => $jsName .
-                                             "('". $this->getName() ."', 2);");
+                                             "('". $selectId ."', 2);");
             $this->_toggleButtonAttributes
                            = array_merge($this->_toggleButtonAttributes,
                                  $attributes);
@@ -867,8 +840,8 @@
         }
         $strHtmlUnselectedCount = $unselected_count;
 
-        $strHtmlSelectedCountId   = $this->getName() .'_selected';
-        $strHtmlUnselectedCountId = $this->getName() .'_unselected';
+        $strHtmlSelectedCountId   = $selectId .'_selected';
+        $strHtmlUnselectedCountId = $selectId .'_unselected';
 
         // render all part of the multi select component with the template
         $strHtml = $this->_elementTemplate;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.