Changeset 3249 for trunk/modules
- Timestamp:
- 08/02/2008 06:05:58 AM (4 months ago)
- Location:
- trunk/modules/smarty
- Files:
-
- 5 modified
-
config/smarty.php (modified) (2 diffs)
-
controllers/smarty_demo.php (modified) (1 diff)
-
libraries/MY_Controller.php (modified) (4 diffs)
-
libraries/MY_Smarty.php (modified) (5 diffs)
-
libraries/MY_View.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/smarty/config/smarty.php
r2532 r3249 19 19 ( 20 20 MODPATH.'smarty/views' 21 ), 21 ), 22 22 'if_funcs' => array // We'll allow these functions in if statement 23 23 ( 24 'array', 'list', 'trim', 'isset', 'empty', 24 'array', 'list', 'trim', 'isset', 'empty', 25 25 'sizeof', 'in_array', 'is_array', 'true', 'false', 26 26 'null', 'reset', 'array_keys', 'end', 'count' … … 38 38 'trimwhitespace' 39 39 ), 40 'pre_filters' => array 40 'pre_filters' => array 41 41 ( 42 ), 42 ), 43 43 'escape_exclude_list' => array 44 44 ( -
trunk/modules/smarty/controllers/smarty_demo.php
r3168 r3249 4 4 { 5 5 // Do not allow to run in production 6 const ALLOW_PRODUCTION = FALSE; 6 const ALLOW_PRODUCTION = FALSE; 7 7 8 8 public function index() -
trunk/modules/smarty/libraries/MY_Controller.php
r3163 r3249 6 6 { 7 7 parent::__construct(); 8 8 9 9 if (Kohana::config('smarty.integration') == TRUE) 10 10 { … … 12 12 } 13 13 } 14 14 15 15 public function _kohana_load_view($template, $vars) 16 16 { … … 18 18 return; 19 19 20 if (substr(strrchr($template, '.'), 1) === Kohana::config('smarty.templates_ext')) 20 if (substr(strrchr($template, '.'), 1) === Kohana::config('smarty.templates_ext')) 21 21 { 22 22 // Assign variables to the template 23 if (is_array($vars) AND count($vars) > 0) 23 if (is_array($vars) AND count($vars) > 0) 24 24 { 25 25 foreach ($vars AS $key => $val) … … 34 34 // Fetch the output 35 35 $output = $this->MY_Smarty->fetch($template); 36 37 } 38 else 36 37 } 38 else 39 39 { 40 40 $output = parent::_kohana_load_view($template, $vars); -
trunk/modules/smarty/libraries/MY_Smarty.php
r3188 r3249 8 8 { 9 9 // Check if we should use smarty or not 10 if (Kohana::config('smarty.integration') == FALSE) 10 if (Kohana::config('smarty.integration') == FALSE) 11 11 return; 12 12 … … 30 30 // check if smarty_compile directory is exists 31 31 $this->checkDirectory($this->compile_dir); 32 32 33 33 // check if smarty_cache directory is exists 34 34 $this->checkDirectory($this->cache_dir); … … 42 42 $this->security_settings['IF_FUNCS'] = Kohana::config('smarty.if_funcs'); 43 43 $this->security_settings['MODIFIER_FUNCS'] = Kohana::config('smarty.modifier_funcs'); 44 } 45 44 } 45 46 46 // Autoload filters 47 47 $this->autoload_filters = array('pre' => Kohana::config('smarty.pre_filters'), … … 57 57 } 58 58 } 59 59 60 60 public function checkDirectory($directory) 61 61 { 62 if ((! file_exists($directory) AND ! @mkdir($directory, 0755)) OR ! is_writable($directory) OR !is_executable($directory)) 62 if ((! file_exists($directory) AND ! @mkdir($directory, 0755)) OR ! is_writable($directory) OR !is_executable($directory)) 63 63 { 64 64 $error = 'Compile/Cache directory "%s" is not writeable/executable'; … … 67 67 throw new Kohana_User_Exception('Compile/Cache directory is not writeable/executable', $error); 68 68 } 69 69 70 70 return TRUE; 71 71 } -
trunk/modules/smarty/libraries/MY_View.php
r3163 r3249 11 11 $type = empty($type) ? Kohana::config('smarty.templates_ext') : $type; 12 12 } 13 13 14 14 parent::__construct($name, $data, $type); 15 15 }
