tangra logo
   
[ class tree: tangra_lib ] [ index: tangra_lib ] [ all elements ]
 

Source for file form_field_file_view.class.php

Documentation is available at form_field_file_view.class.php

  1. <?php
  2. // *** Tangra (Application Framework and Tools for PHP)
  3. //  $Id$
  4. //
  5.  
  6. /**
  7.  * Contains class Form_Field_File_View
  8.  *
  9.  * @package tangra_lib
  10.  * @subpackage form
  11.  */
  12.  
  13. /**
  14.  *
  15.  */
  16. require_once(TANGRA_MAIN_DIR.'form/fields/form_field_view.class.php');
  17. /**
  18.  *
  19.  */
  20. require_once(TANGRA_MAIN_DIR.'form/fields/file/form_field_file.class.php');
  21.  
  22.  
  23. /**
  24.  * View class for Form_Field_File
  25.  *
  26.  * @package tangra_lib
  27.  * @subpackage form
  28.  */
  29.     /**
  30.      * Constructor
  31.      *
  32.      * @param string $tpl_name Field name for template
  33.      * @param Form_Field_File $field 
  34.      */
  35.     function __construct($tpl_nameForm_Field_File $field{
  36.         parent::__construct($tpl_name$field);
  37.     }
  38.  
  39.  
  40.     /**
  41.      * Returns TPLE exports
  42.      *
  43.      * @return TPLE_Exports 
  44.      */
  45.     public function get_tple_exports({
  46.         $exports new Tple_Exports();
  47.  
  48.         $exports->add_pair($this->get_tpl_name().'_mfs'$this->field->get_max_file_size());
  49.         if ($this->is_field_in_error()) {
  50.             $exports->add_pair($this->get_tpl_name().'_has_error'1);
  51.             foreach($this->field->get_errors(as $err{
  52.                 $exports->add_pair($this->get_tpl_name().'_error_'.$err1);
  53.             }
  54.         }
  55.  
  56.         return $exports;
  57.     }
  58. }