Changeset 4578 for trunk/core/viewhelper/smarty/resource.make_template.php
- Timestamp:
- 08/15/10 18:45:12 (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/core/viewhelper/smarty/resource.make_template.php
r4359 r4578 1 1 <?php 2 2 3 function smarty_make_template($resource_type, $resource_name, &$template_source, &$template_timestamp, $smarty_obj) 3 4 { 4 if( $resource_type == 'file' ) { 5 if ( ! is_readable ( $resource_name )) { 6 // create the template file, return contents. 5 if($resource_type == 'file') 6 { 7 if(false === is_readable($resource_name)) 8 { 9 # create the template file, return contents. 7 10 $template_source = "This is a new template."; 8 if( !function_exists('smarty_core_write_file') ) { include SMARTY_CORE_DIR . 'core.write_file.php' ); } 9 smarty_core_write_file( array( 'filename'=>$smarty_obj->template_dir . DIRECTORY_SEPARATOR . $resource_name, 'contents'=>$template_source ), $smarty_obj ); 11 12 if(false === function_exists('smarty_core_write_file')) 13 { 14 include SMARTY_CORE_DIR . 'core.write_file.php'; 15 } 16 17 smarty_core_write_file(array('filename' => $smarty_obj->template_dir . DIRECTORY_SEPARATOR . $resource_name, 18 'contents' => $template_source), $smarty_obj); 10 19 return true; 11 20 } 12 } else { 13 // not a file 21 } 22 else # not a file 23 { 14 24 return false; 15 25 }
Note: See TracChangeset
for help on using the changeset viewer.
