Changeset 265
- Timestamp:
- 06/24/07 12:14:06 (1 year ago)
- Files:
-
- trunk/script/generators/AkelosGenerator.php (modified) (3 diffs)
- trunk/script/generators/scaffold/scaffold_generator.php (modified) (2 diffs)
- trunk/script/generators/scaffold/sintags_templates (added)
- trunk/script/generators/scaffold/sintags_templates/controller.php (added)
- trunk/script/generators/scaffold/sintags_templates/form.tpl (added)
- trunk/script/generators/scaffold/sintags_templates/form_scaffolding.tpl (added)
- trunk/script/generators/scaffold/sintags_templates/helper.php (added)
- trunk/script/generators/scaffold/sintags_templates/installer.tpl (added)
- trunk/script/generators/scaffold/sintags_templates/installer_fixture.tpl (added)
- trunk/script/generators/scaffold/sintags_templates/layout.tpl (added)
- trunk/script/generators/scaffold/sintags_templates/model.tpl (added)
- trunk/script/generators/scaffold/sintags_templates/model_fixture.tpl (added)
- trunk/script/generators/scaffold/sintags_templates/model_unit_test.tpl (added)
- trunk/script/generators/scaffold/sintags_templates/style.css (added)
- trunk/script/generators/scaffold/sintags_templates/view_add.tpl (added)
- trunk/script/generators/scaffold/sintags_templates/view_destroy.tpl (added)
- trunk/script/generators/scaffold/sintags_templates/view_edit.tpl (added)
- trunk/script/generators/scaffold/sintags_templates/view_listing.tpl (added)
- trunk/script/generators/scaffold/sintags_templates/view_show.tpl (added)
- trunk/script/generators/scaffold/templates/form.tpl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/script/generators/AkelosGenerator.php
r2 r265 78 78 { 79 79 $i = 0; 80 $extra_commands = array(); 81 $unnamed_commands = array(); 80 82 foreach ($commands as $param=>$value){ 83 if($value[0] == '-'){ 84 $next_is_value_for = trim($value,'- '); 85 $extra_commands[$next_is_value_for] = true; 86 continue; 87 } 88 89 if(isset($next_is_value_for)){ 90 $extra_commands[$next_is_value_for] = trim($value,'- '); 91 unset($next_is_value_for); 92 continue; 93 } 94 81 95 if(is_numeric($param)){ 82 96 if(!empty($this->command_values[$i])){ … … 84 98 if(substr($this->command_values[$i],0,7) == '(array)'){ 85 99 $index =substr($this->command_values[$i],7); 86 $ commands[$index][] = $value;100 $unnamed_commands[$index][] = $value; 87 101 $i--; 88 102 }else{ 89 $ commands[$index] = $value;103 $unnamed_commands[$index] = $value; 90 104 } 91 105 } … … 93 107 } 94 108 } 95 } 96 97 function render($template) 109 $commands = array_merge($extra_commands, $unnamed_commands); 110 } 111 112 function render($template, $sintags_version = false) 98 113 { 99 114 extract($this->_template_vars); 100 115 101 116 ob_start(); 102 include(AK_SCRIPT_DIR.DS.'generators'.DS.$this->type.DS. 'templates'.DS.(strstr($template,'.') ? $template : $template.'.tpl'));117 include(AK_SCRIPT_DIR.DS.'generators'.DS.$this->type.DS.($sintags_version?'sintags_':'').'templates'.DS.(strstr($template,'.') ? $template : $template.'.tpl')); 103 118 $result = ob_get_contents(); 104 119 ob_end_clean(); trunk/script/generators/scaffold/scaffold_generator.php
r232 r265 83 83 foreach ($model_files as $template=>$file_path){ 84 84 if(!file_exists($file_path)){ 85 $this->save($file_path, $this->render($template ));85 $this->save($file_path, $this->render($template, !empty($this->sintags))); 86 86 } 87 87 } … … 129 129 $this->_template_vars = (array)$this; 130 130 foreach ($this->files as $template=>$file_path){ 131 $this->save($file_path, $this->render($template ));131 $this->save($file_path, $this->render($template, !empty($this->sintags))); 132 132 } 133 133 foreach ($this->user_actions as $action=>$file_path){ 134 134 $this->assignVarToTemplate('action',$action); 135 $this->save($file_path, $this->render('view' ));135 $this->save($file_path, $this->render('view', !empty($this->sintags))); 136 136 } 137 137 trunk/script/generators/scaffold/templates/form.tpl
r155 r265 5 5 <?php else : 6 6 foreach ($content_columns as $column=>$details){ 7 if($column == 'id'){ 8 continue; 9 } 7 10 echo " 8 11 <p>
