]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
fixed notices caused by some input views
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 17 Dec 2009 12:45:45 +0000 (12:45 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 17 Dec 2009 12:45:45 +0000 (12:45 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@3766 36083f99-b078-4883-b0ff-0f9b5a30f544

views/default/input/button.php
views/default/input/form.php
views/default/input/submit.php
views/default/input/text.php

index 0a65feb82a425ca173c09d16f5b0acca5a12e143..0ad19a43243f1153ef63ddd607c336f366a0b9ec 100644 (file)
@@ -1,8 +1,9 @@
 <?php
 /**
  * Create a input button
- * Use this view for forms rather than creating a submit/reset button tag in the wild as it provides
- * extra security which help prevent CSRF attacks.
+ * Use this view or submit view for forms rather than creating a 
+ * submit/reset button tag in the wild as it provides extra security 
+ * which help prevent CSRF attacks.
  *
  * @package Elgg
  * @subpackage Core
@@ -21,11 +22,11 @@ global $CONFIG;
 
 if (isset($vars['class'])) {
        $class = $vars['class'];
-}
-if (!$class) {
+} else {
        $class = "submit_button";
 }
 
+// defaults to submit button
 if (isset($vars['type'])) {
        $type = strtolower($vars['type']);
 } else {
index 11fb485da9caa96d176dea061b1bb5e329180bf8..b5db3e55f66b66846be5bd83fbe3ed73ae037693 100644 (file)
@@ -44,7 +44,7 @@ $method = strtolower($method);
 
 // Generate a security header
 $security_header = "";
-if ($vars['disable_security']!=true) {
+if (!isset($vars['disable_security']) || $vars['disable_security'] != true) {
        $security_header = elgg_view('input/securitytoken');
 }
 ?>
index b0c72791f786dae1d5197137fdd013fe47af2dde..377a86c8f862609e46965da77528a042361275c4 100644 (file)
@@ -19,8 +19,7 @@
 $vars['type'] = 'submit';
 if (isset($vars['class'])) {
        $class = $vars['class'];
-}
-if (!$class) {
+} else {
        $class = "submit_button";
 }
 $vars['class'] = $class;
index 1814e580167e0c846222eca786b7ae1c4e5eb5ad..e4d39e0bae8bc5cca1dbbd98fc06cd38fd1a1c1b 100644 (file)
  */
 
 
-$class = $vars['class'];
-if (!$class) {
+if (isset($vars['class'])) {
+       $class = $vars['class'];
+} else {
        $class = "input-text";
 }
 
+$disabled = false;
+if (isset($vars['disabled'])) {
+       $disabled = $vars['disabled'];
+}
+
 ?>
 
-<input type="text" <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> <?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?> value="<?php echo htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); ?>" class="<?php echo $class ?>"/>
\ No newline at end of file
+<input type="text" <?php if ($disabled) echo ' disabled="yes" '; ?> <?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?> value="<?php echo htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); ?>" class="<?php echo $class ?>"/>
\ No newline at end of file