Source for file jSelectorForm.class.php

Documentation is available at jSelectorForm.class.php

  1. <?php
  2. /**
  3. * see jISelector.iface.php for documentation about selectors. Here abstract class for many selectors
  4. *
  5. @package     jelix
  6. @subpackage  core_selector
  7. @author      Laurent Jouanneau
  8. @copyright   2005-2012 Laurent Jouanneau
  9. @link        http://www.jelix.org
  10. @licence    GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html
  11. */
  12.  
  13. /**
  14.  * Form selector
  15.  *
  16.  * syntax : "module~formName".
  17.  * file : forms/formName.form.xml .
  18.  * @package    jelix
  19.  * @subpackage core_selector
  20.  */
  21. class jSelectorForm extends jSelectorModule {
  22.     protected $type = 'form';
  23.     protected $_where;
  24.     protected $_dirname = 'forms/';
  25.     protected $_suffix = '.form.xml';
  26.  
  27.     function __construct($sel){
  28.  
  29.         $this->_compiler='jFormsCompiler';
  30.         $this->_compilerPath=JELIX_LIB_PATH.'forms/jFormsCompiler.class.php';
  31.  
  32.         parent::__construct($sel);
  33.     }
  34.  
  35.     public function getClass(){
  36.         return 'cForm_'.$this->module.'_Jx_'.$this->resource;
  37.     }
  38.  
  39.  
  40.     protected function _createPath(){
  41.         if(!isset(jApp::config()->_modulesPathList[$this->module])){
  42.             throw new jExceptionSelector('jelix~errors.selector.module.unknown'$this->toString(true));
  43.         }
  44.  
  45.         // we see if the forms have been redefined
  46.         $overloadedPath jApp::varPath('overloads/'.$this->module.'/'.$this->_dirname.$this->resource.$this->_suffix);
  47.         if (is_readable ($overloadedPath)){
  48.            $this->_path = $overloadedPath;
  49.            $this->_where = 'overloaded/';
  50.            return;
  51.         }
  52.  
  53.         $this->_path = jApp::config()->_modulesPathList[$this->module].$this->_dirname.$this->resource.$this->_suffix;
  54.         if (!is_readable ($this->_path)){
  55.             throw new jExceptionSelector('jelix~errors.selector.invalid.target'array($this->toString()$this->type));
  56.         }
  57.         $this->_where = 'modules/';
  58.     }
  59.  
  60.     protected function _createCachePath(){
  61.         // don't share the same cache for all the possible dirs
  62.         // in case of overload removal
  63.         $this->_cachePath = jApp::tempPath('compiled/'.$this->_dirname.$this->_where.$this->module.'~'.$this->resource.'_15'.$this->_cacheSuffix);
  64.     }
  65.  
  66.     public function getCompiledBuilderFilePath ($type){
  67.         return jApp::tempPath('compiled/'.$this->_dirname.$this->_where.$this->module.'~'.$this->resource.'_builder_'.$type.$this->_cacheSuffix);
  68.     }
  69.  
  70. }

Documentation generated on Wed, 04 Jan 2017 22:56:41 +0100 by phpDocumentor 1.4.3