Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

password-field.inc.php

Go to the documentation of this file.
00001 <?php
00048 class PasswordField extends TextField
00049 {
00050     protected $encCallback; 
00051 
00055     public function drawInput()
00056     {
00057         $attr = $this->extrasAsAttributes();
00058         
00059         if ($this->width)
00060             $style = "style=\"width: $this->width;\"";
00061 
00062         if($this->hasError)
00063             $css = ' class="errorinput" ';
00064 
00065         echo "<input type=\"password\" name=\"$this->name\" value=\"$this->value\" $css $attr $style/>";
00066     }
00067 
00072     public function getData()
00073     {
00074         return $this->doEncCallback($noQuote);
00075     }
00076 
00081     public function getSqlImpl()
00082     {
00083         $noQuote = false;
00084         $val = $this->doEncCallback($noQuote);
00085 
00086         return ( "$this->name = " . ($noQuote ? $val : "'$val'"));
00087     }
00088 
00093     protected function doEncCallback(&$noQuote)
00094     {
00095         $noQuote = false;
00096 
00097         if($this->encCallback)
00098         {
00099             if(!is_callable($this->encCallback))
00100                 throw new InvalidCallbackException($this->encCallback); 
00101                 
00102             return call_user_func_array($this->encCallback, array($this->value, &$noQuote)); // _array flavor used to preserve references   
00103         }
00104 
00105         return $this->value;
00106     }
00107 
00108 }
00109 ?>

Generated on Fri Oct 27 12:26:39 2006 for BaseJumper by doxygen 1.3.9.1