Browse Source

Minor - format code

jmontoyaa 8 years ago
parent
commit
2a48183ba8

+ 18 - 18
main/inc/lib/formvalidator/Element/SelectLanguage.php

@@ -7,22 +7,22 @@
  */
 class SelectLanguage extends HTML_QuickForm_select
 {
-	/**
-	 * Class constructor
-	 */
-	public function __construct($elementName = null, $elementLabel = null, $options = null, $attributes = null)
-	{
-		parent::__construct($elementName, $elementLabel, $options, $attributes);
-		// Get all languages
-		$languages = api_get_languages();
-		$this->_options = array();
-		$this->_values = array();
-		foreach ($languages['name'] as $index => $name) {
-			if ($languages['folder'][$index] == api_get_setting('platformLanguage')) {
-				$this->addOption($name, $languages['folder'][$index], array('selected'=>'selected'));
-			} else {
-				$this->addOption($name, $languages['folder'][$index]);
-			}
-		}
-	}
+    /**
+     * Class constructor
+     */
+    public function __construct($elementName = null, $elementLabel = null, $options = null, $attributes = null)
+    {
+        parent::__construct($elementName, $elementLabel, $options, $attributes);
+        // Get all languages
+        $languages = api_get_languages();
+        $this->_options = array();
+        $this->_values = array();
+        foreach ($languages['name'] as $index => $name) {
+            if ($languages['folder'][$index] == api_get_setting('platformLanguage')) {
+                $this->addOption($name, $languages['folder'][$index], array('selected'=>'selected'));
+            } else {
+                $this->addOption($name, $languages['folder'][$index]);
+            }
+        }
+    }
 }

+ 19 - 15
main/inc/lib/formvalidator/Element/SelectTheme.php

@@ -6,19 +6,23 @@
 */
 class SelectTheme extends HTML_QuickForm_select
 {
-	/**
-	 * Class constructor
-	 */
-	public function __construct($elementName=null, $elementLabel=null, $options=null, $attributes=null)
-	{
-		parent::__construct($elementName, $elementLabel, $options, $attributes);
-		// Get all languages
-		$themes = api_get_themes();
-		$this->_options = array();
-		$this->_values = array();
-		$this->addOption('--',''); // no theme select
-		for ($i=0; $i< count($themes[0]); $i++) {
-			$this->addOption($themes[1][$i],$themes[0][$i]);
-		}
-	}
+    /**
+     * Class constructor
+     */
+    public function __construct(
+        $elementName = null,
+        $elementLabel = null,
+        $options = null,
+        $attributes = null
+    ) {
+        parent::__construct($elementName, $elementLabel, $options, $attributes);
+        // Get all languages
+        $themes = api_get_themes();
+        $this->_options = array();
+        $this->_values = array();
+        $this->addOption('--', ''); // no theme select
+        for ($i = 0; $i < count($themes[0]); $i++) {
+            $this->addOption($themes[1][$i], $themes[0][$i]);
+        }
+    }
 }

+ 4 - 4
main/inc/lib/formvalidator/Element/Url.php

@@ -9,10 +9,10 @@
 class Url extends HTML_QuickForm_text
 {
     /**
-     * Constructor of Url class
-     * @param type $elementName
-     * @param type $elementLabel
-     * @param type $attributes
+     * Url constructor.
+     * @param string $elementName
+     * @param string $elementLabel
+     * @param array $attributes
      */
     public function __construct($elementName = null, $elementLabel = null, $attributes = null)
     {

+ 3 - 2
main/inc/lib/formvalidator/Element/receivers.php

@@ -37,6 +37,7 @@ class HTML_QuickForm_receivers extends HTML_QuickForm_group
 		$this->_appendName = true;
 		$this->_type = 'receivers';
 	}
+
 	/**
 	 * Create the form elements to build this element group
 	 */
@@ -48,6 +49,7 @@ class HTML_QuickForm_receivers extends HTML_QuickForm_group
 		$this->_elements[] = new HTML_QuickForm_advmultiselect('to', '', $this->receivers);
 		$this->_elements[2]->setSelected($this->receivers_selected);
 	}
+
 	/**
 	 * HTML representation
 	 */
@@ -91,5 +93,4 @@ class HTML_QuickForm_receivers extends HTML_QuickForm_group
 	{
 		$renderer->renderElement($this, $required, $error);
 	}
-}
-?>
+}

+ 9 - 9
main/inc/lib/formvalidator/Rule/Date.php

@@ -7,16 +7,16 @@
  */
 class HTML_QuickForm_Rule_Date extends HTML_QuickForm_Rule
 {
-	/**
-	 * Check a date
-	 * @see HTML_QuickForm_Rule
-	 * @param string $date example 2014-04-30
+    /**
+     * Check a date
+     * @see HTML_QuickForm_Rule
+     * @param string $date example 2014-04-30
      * @param array $options
      *
-	 * @return boolean True if date is valid
-	 */
-	public function validate($date, $options)
-	{
+     * @return boolean True if date is valid
+     */
+    public function validate($date, $options)
+    {
         return api_is_valid_date($date, 'Y-m-d');
-	}
+    }
 }

+ 14 - 15
main/inc/lib/formvalidator/Rule/FileName.php

@@ -8,19 +8,18 @@
  */
 class HTML_QuickForm_Rule_FileName extends HTML_QuickForm_Rule
 {
-
-	/**
-	 * @param $value array     Uploaded file info (from $_FILES)
-	 * @param null $options
-	 * @return bool
-	 */
-	public function validate($value, $options = null)
-	{
-		if ((isset($elementValue['error']) && $elementValue['error'] == 0) ||
-			(!empty($elementValue['tmp_name']) && $elementValue['tmp_name'] != 'none')) {
-			return is_uploaded_file($elementValue['tmp_name']);
-		} else {
-			return false;
-		}
-	}
+    /**
+     * @param $value array     Uploaded file info (from $_FILES)
+     * @param null $options
+     * @return bool
+     */
+    public function validate($value, $options = null)
+    {
+        if ((isset($elementValue['error']) && $elementValue['error'] == 0) ||
+            (!empty($elementValue['tmp_name']) && $elementValue['tmp_name'] != 'none')) {
+            return is_uploaded_file($elementValue['tmp_name']);
+        } else {
+            return false;
+        }
+    }
 }