Changeset 117
- Timestamp:
- 01/18/06 18:45:19 (6 years ago)
- Location:
- trunk
- Files:
-
- 44 modified
-
public/dispatch.php (modified) (1 diff)
-
trax/app/application_mailer.php (modified) (1 diff)
-
trax/app/controllers/application.php (modified) (1 diff)
-
trax/app/helpers/application_helper.php (modified) (1 diff)
-
trax/config/environments/development.php (modified) (1 diff)
-
trax/config/environments/production.php (modified) (1 diff)
-
trax/config/environments/test.php (modified) (1 diff)
-
trax/config/routes.php (modified) (1 diff)
-
trax/script/generate.php (modified) (1 diff)
-
trax/vendor/trax/action_controller.php (modified) (6 diffs)
-
trax/vendor/trax/action_mailer.php (modified) (1 diff)
-
trax/vendor/trax/action_view.php (modified) (2 diffs)
-
trax/vendor/trax/action_view/helpers.php (modified) (3 diffs)
-
trax/vendor/trax/action_view/helpers/active_record_helper.php (modified) (1 diff)
-
trax/vendor/trax/action_view/helpers/date_helper.php (modified) (1 diff)
-
trax/vendor/trax/action_view/helpers/form_helper.php (modified) (1 diff)
-
trax/vendor/trax/action_view/helpers/form_options_helper.php (modified) (1 diff)
-
trax/vendor/trax/action_view/helpers/form_tag_helper.php (modified) (1 diff)
-
trax/vendor/trax/action_view/helpers/url_helper.php (modified) (2 diffs)
-
trax/vendor/trax/active_record.php (modified) (1 diff)
-
trax/vendor/trax/dispatcher.php (modified) (1 diff)
-
trax/vendor/trax/inflector.php (modified) (1 diff)
-
trax/vendor/trax/input_filter.php (modified) (1 diff)
-
trax/vendor/trax/router.php (modified) (1 diff)
-
trax/vendor/trax/scaffold_controller.php (modified) (1 diff)
-
trax/vendor/trax/session.php (modified) (2 diffs)
-
trax/vendor/trax/templates/controller.php (modified) (1 diff)
-
trax/vendor/trax/templates/error.phtml (modified) (2 diffs)
-
trax/vendor/trax/templates/helper.php (modified) (1 diff)
-
trax/vendor/trax/templates/model.php (modified) (1 diff)
-
trax/vendor/trax/templates/scaffolds/add.phtml (modified) (1 diff)
-
trax/vendor/trax/templates/scaffolds/edit.phtml (modified) (1 diff)
-
trax/vendor/trax/templates/scaffolds/generator_templates/controller.php (modified) (3 diffs)
-
trax/vendor/trax/templates/scaffolds/generator_templates/form_scaffolding.phtml (modified) (1 diff)
-
trax/vendor/trax/templates/scaffolds/generator_templates/layout.phtml (modified) (2 diffs)
-
trax/vendor/trax/templates/scaffolds/generator_templates/view_add.phtml (modified) (1 diff)
-
trax/vendor/trax/templates/scaffolds/generator_templates/view_edit.phtml (modified) (1 diff)
-
trax/vendor/trax/templates/scaffolds/generator_templates/view_index.phtml (modified) (1 diff)
-
trax/vendor/trax/templates/scaffolds/generator_templates/view_show.phtml (modified) (1 diff)
-
trax/vendor/trax/templates/scaffolds/index.phtml (modified) (1 diff)
-
trax/vendor/trax/templates/scaffolds/layout.phtml (modified) (1 diff)
-
trax/vendor/trax/templates/scaffolds/show.phtml (modified) (1 diff)
-
trax/vendor/trax/trax_exceptions.php (modified) (1 diff)
-
trax/vendor/trax/trax_generator.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/public/dispatch.php
r1 r117 1 <? 1 <?php 2 2 3 3 require_once("environment.php"); -
trunk/trax/app/application_mailer.php
r1 r117 1 <? 1 <?php 2 2 # The filters added to this controller will be run for all controllers in the application. 3 3 # Likewise will all the methods added be available for all controllers. -
trunk/trax/app/controllers/application.php
r1 r117 1 <? 1 <?php 2 2 # The filters added to this controller will be run for all controllers in the application. 3 3 # Likewise will all the methods added be available for all controllers. -
trunk/trax/app/helpers/application_helper.php
r1 r117 1 <? 1 <?php 2 2 # Anything added to this helper will be available to all templates in the application. 3 3 -
trunk/trax/config/environments/development.php
r1 r117 1 <? 1 <?php 2 2 // put all the global 'development' settings for this application in this file 3 3 -
trunk/trax/config/environments/production.php
r1 r117 1 <? 1 <?php 2 2 // put all the global 'production' settings for this application in this file 3 3 -
trunk/trax/config/environments/test.php
r1 r117 1 <? 1 <?php 2 2 // put all the global 'test' settings for this application in this file 3 3 -
trunk/trax/config/routes.php
r4 r117 1 <? 1 <?php 2 2 # Add your own custom routes here. 3 3 # The priority is based upon order of creation: first created -> highest priority. -
trunk/trax/script/generate.php
r76 r117 1 1 #! /usr/local/bin/php 2 <? 2 <?php 3 3 # $Id$ 4 4 # -
trunk/trax/vendor/trax/action_controller.php
r113 r117 1 <? 1 <?php 2 2 # $Id$ 3 3 # … … 187 187 $GLOBALS['current_controller_path'] = "$this->added_path/$this->controller"; 188 188 $GLOBALS['current_controller_name'] = $this->controller; 189 $GLOBALS['current_controller_object'] = $this->controller_object;189 $GLOBALS['current_controller_object'] =& $this->controller_object; 190 190 } 191 191 … … 198 198 if(file_exists(TRAX_LIB_ROOT."/scaffold_controller.php")) { 199 199 include_once(TRAX_LIB_ROOT."/scaffold_controller.php"); 200 $GLOBALS['current_controller_object'] = $this->controller_object = new ScaffoldController($scaffold); 200 $this->controller_object = new ScaffoldController($scaffold); 201 $GLOBALS['current_controller_object'] =& $this->controller_object; 201 202 if($this->action) { 202 203 $this->view_file = TRAX_LIB_ROOT . "/templates/scaffolds/".$this->action.".phtml"; … … 350 351 function add_before_filter($filter_function_name) { 351 352 if(is_string($filter_function_name) && !empty($filter_function_name)) { 352 $this->before_filters[] = $filter_function_name; 353 if(!in_array($filter_function_name, $this->before_filters)) { 354 $this->before_filters[] = $filter_function_name; 355 } 353 356 } elseif(is_array($filter_function_name)) { 354 357 if(count($this->before_filters) > 0) { … … 372 375 function add_after_filter($filter_function_name) { 373 376 if(is_string($filter_function_name) && !empty($filter_function_name)) { 374 $this->after_filters[] = $filter_function_name; 377 if(!in_array($filter_function_name, $this->after_filters)) { 378 $this->after_filters[] = $filter_function_name; 379 } 375 380 } elseif(is_array($filter_function_name)) { 376 381 if(count($this->after_filters) > 0) { … … 383 388 384 389 function add_helper($helper_name) { 385 $this->helpers[] = $helper_name; 386 } 387 388 function render_partial($path) { 390 if(!in_array($helper_name, $this->helpers)) { 391 $this->helpers[] = $helper_name; 392 } 393 } 394 395 function render_partial($path, $options = array()) { 389 396 if(strstr($path, "/")) { 390 397 $file = substr(strrchr($path, "/"), 1); 391 398 $path = substr($path, 0, strripos($path, "/")); 392 $ path_with_file= TRAX_ROOT.$GLOBALS['TRAX_INCLUDES']['views']."/".$path."/_".$file.".".$this->views_file_extention;399 $file_with_path = TRAX_ROOT.$GLOBALS['TRAX_INCLUDES']['views']."/".$path."/_".$file.".".$this->views_file_extention; 393 400 } else { 394 $path_with_file = $this->views_path."/_".$path.".".$this->views_file_extention; 395 } 396 397 if(file_exists($path_with_file)) { 401 $file = $path; 402 $file_with_path = $this->views_path."/_".$file.".".$this->views_file_extention; 403 } 404 405 if(file_exists($file_with_path)) { 406 407 if(array_key_exists("spacer_template", $options)) { 408 $spacer_path = $options['spacer_template']; 409 if(strstr($spacer_path, "/")) { 410 $spacer_file = substr(strrchr($spacer_path, "/"), 1); 411 $spacer_path = substr($spacer_path, 0, strripos($spacer_path, "/")); 412 $spacer_file_with_file = TRAX_ROOT.$GLOBALS['TRAX_INCLUDES']['views']."/".$spacer_path."/_".$spacer_file.".".$this->views_file_extention; 413 } else { 414 $spacer_file = $spacer_path; 415 $spacer_file_with_file = $this->views_path."/_".$spacer_file.".".$this->views_file_extention; 416 } 417 if(file_exists($spacer_file_with_file)) { 418 $add_spacer = true; 419 } 420 } 421 398 422 # Pull all the class vars out and turn them from $this->var to $var 399 423 extract(get_object_vars($this->controller_object)); 400 include($path_with_file); 424 if(array_key_exists("collection", $options)) { 425 foreach($options['collection'] as $tmp_value) { 426 ${$file."_counter"}++; 427 ${$file} = $tmp_value; 428 unset($tmp_value); 429 include($file_with_path); 430 if($add_spacer && (${$file."_counter"} < count($options['collection']))) { 431 include($spacer_file_with_file); 432 } 433 } 434 } else { 435 if(array_key_exists("locals", $options)) { 436 foreach($options['locals'] as $tmp_key => $tmp_value) { 437 ${$tmp_key} = $tmp_value; 438 } 439 unset($tmp_key); 440 unset($tmp_value); 441 } 442 include($path_with_file); 443 } 401 444 } 402 445 } -
trunk/trax/vendor/trax/action_mailer.php
r83 r117 1 <? 1 <?php 2 2 # $Id$ 3 3 # -
trunk/trax/vendor/trax/action_view.php
r116 r117 1 <? 1 <?php 2 2 # $Id$ 3 3 # … … 31 31 include_once(TRAX_LIB_ROOT . "/action_view/helpers/form_options_helper.php"); 32 32 include_once(TRAX_LIB_ROOT . "/action_view/helpers/date_helper.php"); 33 #include_once(TRAX_LIB_ROOT . "/action_view/helpers/text_helper.php");34 33 include_once(TRAX_LIB_ROOT . "/action_view/helpers/active_record_helper.php"); 35 34 -
trunk/trax/vendor/trax/action_view/helpers.php
r116 r117 1 <? 2 1 <?php 3 2 # $Id$ 4 3 # … … 117 116 } 118 117 118 119 ################################################################################################ 120 ## Avialble functions for use in views 121 ################################################################################################ 119 122 function content_tag() { 120 123 $helper = new Helpers(); … … 123 126 } 124 127 128 function url_for($options = array()) { 129 $helper = new Helpers(); 130 return $helper->url_for($options); 131 } 132 125 133 ?> -
trunk/trax/vendor/trax/action_view/helpers/active_record_helper.php
r113 r117 1 1 <?php 2 2 # $Id$ 3 # 4 # Copyright (c) 2005 John Peterson 5 # 6 # Permission is hereby granted, free of charge, to any person obtaining 7 # a copy of this software and associated documentation files (the 8 # "Software"), to deal in the Software without restriction, including 9 # without limitation the rights to use, copy, modify, merge, publish, 10 # distribute, sublicense, and/or sell copies of the Software, and to 11 # permit persons to whom the Software is furnished to do so, subject to 12 # the following conditions: 13 # 14 # The above copyright notice and this permission notice shall be 15 # included in all copies or substantial portions of the Software. 16 # 17 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 21 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 22 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 23 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 3 24 4 25 class ActiveRecordHelper extends Helpers { -
trunk/trax/vendor/trax/action_view/helpers/date_helper.php
r113 r117 1 <? 2 1 <?php 3 2 # $Id$ 4 3 # -
trunk/trax/vendor/trax/action_view/helpers/form_helper.php
r113 r117 1 <? 2 1 <?php 3 2 # $Id$ 4 3 # -
trunk/trax/vendor/trax/action_view/helpers/form_options_helper.php
r116 r117 1 <? 2 1 <?php 3 2 # $Id$ 4 3 # -
trunk/trax/vendor/trax/action_view/helpers/form_tag_helper.php
r106 r117 1 <? 2 1 <?php 3 2 # $Id$ 4 3 # -
trunk/trax/vendor/trax/action_view/helpers/url_helper.php
r107 r117 1 <? 2 1 <?php 3 2 # $Id$ 4 3 # … … 140 139 } 141 140 142 function url_for($options = array()) {143 $url_helper = new UrlHelper();144 return $url_helper->url_for($options);145 }146 147 141 ?> -
trunk/trax/vendor/trax/active_record.php
r112 r117 1 <? 1 <?php 2 2 # $Id$ 3 3 # -
trunk/trax/vendor/trax/dispatcher.php
r107 r117 1 <? 1 <?php 2 2 # $Id$ 3 3 # -
trunk/trax/vendor/trax/inflector.php
r72 r117 1 <? 2 # $Id : inflector.php 55 2005-11-11 22:38:37Z john$1 <?php 2 # $Id$ 3 3 # 4 4 # Copyright (c) 2005 John Peterson -
trunk/trax/vendor/trax/input_filter.php
r107 r117 12 12 */ 13 13 class InputFilter { 14 14 15 static protected $tagsArray = array(); // default = empty array 15 16 static protected $attrArray = array(); // default = empty array -
trunk/trax/vendor/trax/router.php
r72 r117 1 <? 2 # $Id : router.php 51 2005-10-29 14:40:42Z john$1 <?php 2 # $Id$ 3 3 # 4 4 # Copyright (c) 2005 John Peterson -
trunk/trax/vendor/trax/scaffold_controller.php
r113 r117 1 <? 1 <?php 2 2 # $Id $ 3 3 # -
trunk/trax/vendor/trax/session.php
r101 r117 1 1 <?php 2 3 2 # $Id$ 4 3 # … … 83 82 84 83 function start() { 84 85 $session_name = defined("TRAX_SESSION_NAME") ? TRAX_SESSION_NAME : self::TRAX_SESSION_NAME; 86 $session_lifetime = defined("TRAX_SESSION_LIFETIME") ? TRAX_SESSION_LIFETIME : self::TRAX_SESSION_LIFETIME; 87 $session_maxlifetime_minutes = defined("TRAX_SESSION_MAXLIFETIME_MINUTES") ? TRAX_SESSION_MAXLIFETIME_MINUTES : self::TRAX_SESSION_MAXLIFETIME_MINUTES; 88 85 89 # set the session default for this app 86 ini_set('session.name', TRAX_SESSION_NAME);87 ini_set('session.cookie_lifetime', TRAX_SESSION_LIFETIME);90 ini_set('session.name', $session_name); 91 ini_set('session.cookie_lifetime', $session_lifetime); 88 92 ini_set('session.gc_probability', 1); 89 ini_set('session.gc_maxlifetime', TRAX_SESSION_MAXLIFETIME_MINUTES* 60);93 ini_set('session.gc_maxlifetime', $session_maxlifetime_minutes * 60); 90 94 91 95 header('P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"'); -
trunk/trax/vendor/trax/templates/controller.php
r72 r117 1 <? 1 <?php 2 2 3 3 class [class_name]Controller extends ApplicationController { -
trunk/trax/vendor/trax/templates/error.phtml
r72 r117 1 1 <html> 2 2 <head> 3 <title><? =$error_heading?></title>3 <title><?php echo $error_heading ?></title> 4 4 <style> 5 5 body { background-color: #fff; color: #333; } … … 40 40 <body> 41 41 42 <h1><? =$error_heading?></h1>42 <h1><?php echo $error_heading ?></h1> 43 43 44 <p><pre><? =$error_message?></pre></p>44 <p><pre><?php echo $error_message ?></pre></p> 45 45 46 <? if($trace): ?>46 <?php if($trace): ?> 47 47 <a href="#" onclick="expandContract('framework_trace')">Show framework trace</a> 48 <pre id="framework_trace" style="display:none"><code><? =$trace?></code></pre>49 <? endif; ?>48 <pre id="framework_trace" style="display:none"><code><?php echo $trace ?></code></pre> 49 <?php endif; ?> 50 50 51 51 <p><a href="#" onclick="expandContract('session_dump')">Show $_SESSION dump</a></p> 52 52 <div id="session_dump" style="display:none"><pre class='debug_dump'> 53 <? = print_r($_SESSION, true)?>53 <?php echo print_r($_SESSION, true) ?> 54 54 </pre></div> 55 55 56 56 <p><a href="#" onclick="expandContract('get_dump')">Show $_GET dump</a></p> 57 57 <div id="get_dump" style="display:none"><pre class='debug_dump'> 58 <? = print_r($_GET, true)?>58 <?php echo print_r($_GET, true) ?> 59 59 </pre></div> 60 60 61 61 <p><a href="#" onclick="expandContract('post_dump')">Show $_POST dump</a></p> 62 62 <div id="post_dump" style="display:none"><pre class='debug_dump'> 63 <? = print_r($_POST, true)?>63 <?php echo print_r($_POST, true) ?> 64 64 </pre></div> 65 65 66 66 <p><a href="#" onclick="expandContract('cookie_dump')">Show $_COOKIE dump</a></p> 67 67 <div id="cookie_dump" style="display:none"><pre class='debug_dump'> 68 <? = print_r($_COOKIE, true)?>68 <?php echo print_r($_COOKIE, true) ?> 69 69 </pre></div> 70 70 71 71 <p><a href="#" onclick="expandContract('file_dump')">Show $_FILES dump</a></p> 72 72 <div id="file_dump" style="display:none"><pre class='debug_dump'> 73 <? = print_r($_FILES, true)?>73 <?php echo print_r($_FILES, true) ?> 74 74 </pre></div> 75 75 -
trunk/trax/vendor/trax/templates/helper.php
r72 r117 1 <? 1 <?php 2 2 # Anything added to this helper will be available to all templates in the [class_name]Controller. 3 3 -
trunk/trax/vendor/trax/templates/model.php
r72 r117 1 <? 1 <?php 2 2 3 3 class [class_name] extends ActiveRecord { -
trunk/trax/vendor/trax/templates/scaffolds/add.phtml
r113 r117 1 <h1>New <? =$model_object_name ?></h1>1 <h1>New <?php echo $model_object_name ?></h1> 2 2 3 <? =error_messages_for($model_object_name) ?>4 <? = form($model_object_name, array(":action" => "add",'submit_value'=> "Create")) ?>3 <?php echo error_messages_for($model_object_name) ?> 4 <?php echo form($model_object_name, array(":action" => "add", "submit_value" => "Create")) ?> 5 5 6 <? =link_to("Back", array(":action" => "index")) ?>6 <?php echo link_to("Back", array(":action" => "index")) ?> -
trunk/trax/vendor/trax/templates/scaffolds/edit.phtml
r113 r117 1 <h1>Editing <? =$model_object_name ?></h1>1 <h1>Editing <?php echo $model_object_name ?></h1> 2 2 3 <? =error_messages_for($model_object_name) ?>4 <? = form($model_object_name, array(":action" => "edit",'submit_value'=> "Update")) ?>3 <?php echo error_messages_for($model_object_name) ?> 4 <?php echo form($model_object_name, array(":action" => "edit", "submit_value" => "Update")) ?> 5 5 6 <? =link_to("Show", array(":action" => "show", ":id" => $$model_object_name->id)) ?> |7 <? =link_to("Back", array(":action" => "index")) ?>6 <?php echo link_to("Show", array(":action" => "show", ":id" => $$model_object_name->id)) ?> | 7 <?php echo link_to("Back", array(":action" => "index")) ?> -
trunk/trax/vendor/trax/templates/scaffolds/generator_templates/controller.php
r113 r117 1 < ? 1 < ?php 2 2 3 class <? =$controller_class_name ?>Controller extends ApplicationController {3 class <?php echo $controller_class_name ?>Controller extends ApplicationController { 4 4 5 <? foreach($non_scaffolded_actions as $action): ?>6 function <? =$action ?>() {5 <?php foreach($non_scaffolded_actions as $action): ?> 6 function <?php echo $action ?>() { 7 7 } 8 8 9 <? endforeach; ?>9 <?php endforeach; ?> 10 10 function index() { 11 $<? =$singluar_model_name?> = new <?=$model_class_name?>();12 $this-><? =$plural_model_name?> = $<?=$singluar_model_name?>->find_all();13 $this->content_columns = $<? =$singluar_model_name?>->content_columns;11 $<?php echo $singluar_model_name ?> = new <?php echo $model_class_name ?>(); 12 $this-><?php echo $plural_model_name ?> = $<?php echo $singluar_model_name ?>->find_all(); 13 $this->content_columns = $<?php echo $singluar_model_name ?>->content_columns; 14 14 } 15 15 16 16 function show() { 17 $<? =$singluar_model_name?> = new <?=$model_class_name?>();18 $this-><? =$singluar_model_name?> = $<?=$singluar_model_name?>->find($_REQUEST['id']);17 $<?php echo $singluar_model_name ?> = new <?php echo $model_class_name ?>(); 18 $this-><?php echo $singluar_model_name ?> = $<?php echo $singluar_model_name ?>->find($_REQUEST['id']); 19 19 } 20 20 21 21 function add() { 22 $this-><? =$singluar_model_name?> = new <?=$model_class_name?>($_REQUEST['<?=$singluar_model_name?>']);22 $this-><?php echo $singluar_model_name ?> = new <?php echo $model_class_name ?>($_REQUEST['<?php echo $singluar_model_name ?>']); 23 23 if($_POST) { 24 if($this-><? =$singluar_model_name?>->save($_POST['<?=$singluar_model_name?>'])) {25 Session::flash('notice', "<? =$human_model_name?> was successfully created.");24 if($this-><?php echo $singluar_model_name ?>->save($_POST['<?php echo $singluar_model_name ?>'])) { 25 Session::flash('notice', "<?php echo $human_model_name ?> was successfully created."); 26 26 $this->redirect_to = url_for(array(":action" => "index")); 27 27 } else { 28 Session::flash('error', "Error adding <? =$singluar_model_name?> to the database.");28 Session::flash('error', "Error adding <?php echo $singluar_model_name ?> to the database."); 29 29 } 30 30 } … … 32 32 33 33 function edit() { 34 $<? =$singluar_model_name?> = new <?=$model_class_name?>();35 $this-><? =$singluar_model_name?> = $<?=$singluar_model_name?>->find($_REQUEST['id']);34 $<?php echo $singluar_model_name ?> = new <?php echo $model_class_name ?>(); 35 $this-><?php echo $singluar_model_name ?> = $<?php echo $singluar_model_name ?>->find($_REQUEST['id']); 36 36 if($_POST) { 37 if($this-><? =$singluar_model_name?>->save($_POST['<?=$singluar_model_name?>'])) {38 Session::flash('notice', "<? =$human_model_name?> was successfully updated.");39 $this->redirect_to = url_for(array(":action" => "show", ":id" => $this-><? =$singluar_model_name?>));37 if($this-><?php echo $singluar_model_name ?>->save($_POST['<?php echo $singluar_model_name ?>'])) { 38 Session::flash('notice', "<?php echo $human_model_name ?> was successfully updated."); 39 $this->redirect_to = url_for(array(":action" => "show", ":id" => $this-><?php echo $singluar_model_name ?>)); 40 40 } else { 41 Session::flash('error', "Error saving <? =$singluar_model_name?> to the database.");41 Session::flash('error', "Error saving <?php echo $singluar_model_name ?> to the database."); 42 42 } 43 43 } … … 46 46 function delete() { 47 47 if($_REQUEST['id'] > 0) { 48 $<? =$singluar_model_name?> = new <?=$model_class_name?>();49 $<? =$singluar_model_name?> = $<?=$singluar_model_name?>->find($_REQUEST['id']);50 if($<? =$singluar_model_name?>->delete()) {51 Session::flash('notice', "<? =$human_model_name?> was successfully deleted.");48 $<?php echo $singluar_model_name ?> = new <?php echo $model_class_name ?>(); 49 $<?php echo $singluar_model_name ?> = $<?php echo $singluar_model_name ?>->find($_REQUEST['id']); 50 if($<?php echo $singluar_model_name ?>->delete()) { 51 Session::flash('notice', "<?php echo $human_model_name ?> was successfully deleted."); 52 52 } else { 53 Session::flash('error', "Error deleting <? =$singluar_model_name?> from the database.");53 Session::flash('error', "Error deleting <?php echo $singluar_model_name ?> from the database."); 54 54 } 55 55 } -
trunk/trax/vendor/trax/templates/scaffolds/generator_templates/form_scaffolding.phtml
r113 r117 1 < ? = error_messages_for("<?=$singluar_model_name ?>") ? >1 < ?php echo error_messages_for("<?php echo $singluar_model_name ?>") ? > 2 2 3 <!--[form:<? =$singluar_model_name ?>]-->4 <? 3 <!--[form:<?php echo $singluar_model_name ?>]--> 4 <?php 5 5 $ar_helper = new ActiveRecordHelper(); 6 6 $ar_helper->scaffolding = true; 7 7 echo $ar_helper->all_input_tags($this->{$singluar_model_name}, $singluar_model_name, array()); 8 8 ?> 9 <!--[eoform:<? =$singluar_model_name ?>]-->9 <!--[eoform:<?php echo $singluar_model_name ?>]--> -
trunk/trax/vendor/trax/templates/scaffolds/generator_templates/layout.phtml
r113 r117 3 3 <html> 4 4 <head> 5 <title>Scaffolding : <? =$controller_name ?></title>5 <title>Scaffolding : <?php echo $controller_name ?></title> 6 6 <style> 7 7 body { background-color: #fff; color: #333; } … … 82 82 <body> 83 83 84 < ? if(Session::isset_flash("notice")): ? >85 <p style="color: green">< ? =Session::flash("notice") ? ></p>86 < ? elseif(Session::isset_flash("error")): ? >87 <p style="color: red">< ? =Session::flash("error") ? ></p>88 < ? endif; ? >84 < ?php if(Session::isset_flash("notice")): ? > 85 <p style="color: green">< ?php echo Session::flash("notice") ? ></p> 86 < ?php elseif(Session::isset_flash("error")): ? > 87 <p style="color: red">< ?php echo Session::flash("error") ? ></p> 88 < ?php endif; ? > 89 89 90 < ? =$content_for_layout ? >90 < ?php echo $content_for_layout ? > 91 91 92 92 </body> -
trunk/trax/vendor/trax/templates/scaffolds/generator_templates/view_add.phtml
r113 r117 1 <h1>New <? =$singluar_model_name ?></h1>1 <h1>New <?php echo $singluar_model_name ?></h1> 2 2 3 < ? =start_form_tag(array(":action" => "add")) ? >4 < ? =$this->render_partial("form") ? ><br>5 < ? =submit_tag("Create") ? >6 < ? =end_form_tag() ? >3 < ?php echo start_form_tag(array(":action" => "add")) ? > 4 < ?php echo $this->render_partial("form") ? ><br> 5 < ?php echo submit_tag("Create") ? > 6 < ?php echo end_form_tag() ? > 7 7 8 8 <br> 9 9 10 < ? =link_to("Back", array(":action" => "index")) ? >10 < ?php echo link_to("Back", array(":action" => "index")) ? > -
trunk/trax/vendor/trax/templates/scaffolds/generator_templates/view_edit.phtml
r113 r117 1 <h1>Editing <? =$singluar_model_name ?></h1>1 <h1>Editing <?php echo $singluar_model_name ?></h1> 2 2 3 < ? = start_form_tag(array(":action" => "edit", ":id" => $<?=$singluar_model_name ?>)) ? >4 < ? =$this->render_partial("form") ? ><br>5 < ? =submit_tag("Edit") ? >6 < ? =end_form_tag() ? >3 < ?php echo start_form_tag(array(":action" => "edit", ":id" => $<?php echo $singluar_model_name ?>)) ? > 4 < ?php echo $this->render_partial("form") ? ><br> 5 < ?php echo submit_tag("Edit") ? > 6 < ?php echo end_form_tag() ? > 7 7 8 8 <br> 9 9 10 < ? = link_to("Show", array(":action" => "show", ":id" => $<?=$singluar_model_name ?>)) ? > |11 < ? =link_to("Back", array(":action" => "index")) ? >10 < ?php echo link_to("Show", array(":action" => "show", ":id" => $<?php echo $singluar_model_name ?>)) ? > | 11 < ?php echo link_to("Back", array(":action" => "index")) ? > -
trunk/trax/vendor/trax/templates/scaffolds/generator_templates/view_index.phtml
r113 r117 1 <h1>Listing <? =$plural_model_name ?></h1>1 <h1>Listing <?php echo $plural_model_name ?></h1> 2 2 3 3 <table border="0" cellpadding="2" cellspacing="2"> 4 < ? if(count($<?=$plural_model_name?>)): ? >4 < ?php if(count($<?php echo $plural_model_name ?>)): ? > 5 5 <tr> 6 < ? foreach($content_columns as $column): ? >7 <th>< ? =$column['human_name'] ? ></th>8 < ? endforeach; ? >6 < ?php foreach($content_columns as $column): ? > 7 <th>< ?php echo $column['human_name'] ? ></th> 8 < ?php endforeach; ? > 9 9 </tr> 10 10 11 < ? foreach($<?=$plural_model_name?> as $<?=$singluar_model_name?>): ? >11 < ?php foreach($<?php echo $plural_model_name ?> as $<?php echo $singluar_model_name ?>): ? > 12 12 <tr> 13 < ? foreach($<?=$singluar_model_name?>->content_columns as $column): ? >14 <td>< ? = $<?=$singluar_model_name?>->send($column['name']) ? ></td>15 < ? endforeach; ? >16 <td>< ? = link_to('Show', array(":action" => 'show', ":id" => $<?=$singluar_model_name?>)) ? ></td>17 <td>< ? = link_to('Edit', array(":action" => 'edit', ":id" => $<?=$singluar_model_name?>)) ? ></td>18 <td>< ? = link_to('Delete', array(":action" => 'delete', ":id" => $<?=$singluar_model_name?>), array("confirm" => "Are you sure?")) ? ></td>13 < ?php foreach($<?php echo $singluar_model_name ?>->content_columns as $column): ? > 14 <td>< ?php echo $<?php echo $singluar_model_name ?>->send($column['name']) ? ></td> 15 < ?php endforeach; ? > 16 <td>< ?php echo link_to("Show", array(":action" => "show", ":id" => $<?php echo $singluar_model_name ?>)) ? ></td> 17 <td>< ?php echo link_to("Edit", array(":action" => "edit", ":id" => $<?php echo $singluar_model_name ?>)) ? ></td> 18 <td>< ?php echo link_to("Delete", array(":action" => "delete", ":id" => $<?php echo $singluar_model_name ?>), array("confirm" => "Are you sure?")) ? ></td> 19 19 </tr> 20 < ? endforeach; ? >21 < ? else: ? >20 < ?php endforeach; ? > 21 < ?php else: ? > 22 22 <tr> 23 <td>No <? =$plural_model_name ?> found.</td>23 <td>No <?php echo $plural_model_name ?> found.</td> 24 24 </tr> 25 < ? endif; ? >25 < ?php endif; ? > 26 26 </table> 27 27 28 28 <br> 29 29 30 < ? =link_to("New post", array(":action" => "add")) ? >30 < ?php echo link_to("New post", array(":action" => "add")) ? > -
trunk/trax/vendor/trax/templates/scaffolds/generator_templates/view_show.phtml
r113 r117 1 < ? if(count($<?=$singluar_model_name?>->content_columns)): ? >2 < ? foreach($<?=$singluar_model_name?>->content_columns as $column): ? >1 < ?php if(count($<?php echo $singluar_model_name ?>->content_columns)): ? > 2 < ?php foreach($<?php echo $singluar_model_name ?>->content_columns as $column): ? > 3 3 <p> 4 <b>< ? =$column['human_name'] ? >:</b>5 < ? = $<?=$singluar_model_name?>->send($column['name']) ? >4 <b>< ?php echo $column['human_name'] ? >:</b> 5 < ?php echo $<?php echo $singluar_model_name ?>->send($column['name']) ? > 6 6 </p> 7 < ? endforeach; ? >8 < ? else: ? >7 < ?php endforeach; ? > 8 < ?php else: ? > 9 9 no table info found. 10 < ? endif; ? >10 < ?php endif; ? > 11 11 12 12 <br> 13 13 14 < ? = link_to("Edit", array(":action" => "edit", ":id" => $<?=$singluar_model_name ?>)) ? > |15 < ? =link_to("Back", array(":action" => "index")) ? >14 < ?php echo link_to("Edit", array(":action" => "edit", ":id" => $<?php echo $singluar_model_name ?>)) ? > | 15 < ?php echo link_to("Back", array(":action" => "index")) ? > -
trunk/trax/vendor/trax/templates/scaffolds/index.phtml
r113 r117 1 <h1>Listing <? =$model_name_plural ?></h1>1 <h1>Listing <?php echo $model_name_plural ?></h1> 2 2 3 3 <table border="0" cellpadding="2" cellspacing="2"> 4 <? if(count($models)): ?>4 <?php if(count($models)): ?> 5 5 <tr> 6 <? foreach($content_columns as $column): ?> 7 <th><?= $column['human_name'] ?></th> 8 <? endforeach; ?> 6 <?php foreach($content_columns as $column): ?> 7 <th><?php echo $column['human_name'] ?></th> 8 <?php endforeach; ?> 9 </tr> 10 <?php foreach($models as $model): ?> 11 <tr> 12 <?php foreach($model->content_columns as $column): ?> 13 <td><?php echo $model->send($column['name']) ?></td> 14 <?php endforeach; ?> 15 <td><?php echo link_to("Show", array(":action" => "show", ":id" => $model)) ?></td> 16 <td><?php echo link_to("Edit", array(":action" => "edit", ":id" => $model)) ?></td> 17 <td><?php echo link_to("Delete", array(":action" => "delete", ":id" => $model), array("confirm" => "Are you sure?")) ?></td> 18 </tr> 19 <?php endforeach; ?> 20 <?php else: ?> 21 <tr> 22 <td>No <?php echo $model_name_plural ?> found.</td> 9 23 </tr> 10 11 <? foreach($models as $model): ?> 12 <tr> 13 <? foreach($model->content_columns as $column): ?> 14 <td><?= $model->send($column['name']) ?></td> 15 <? endforeach; ?> 16 <td><?= link_to('Show', array(":action" => 'show', ":id" => $model)) ?></td> 17 <td><?= link_to('Edit', array(":action" => 'edit', ":id" => $model)) ?></td> 18 <td><?= link_to('Delete', array(":action" => 'delete', ":id" => $model), array("confirm" => "Are you sure?")) ?></td> 19 </tr> 20 <? endforeach; ?> 21 <? else: ?> 22 <tr> 23 <td>No <?= $model_name_plural ?> found.</td> 24 </tr> 25 <? endif; ?> 24 <?php endif; ?> 26 25 </table> 27 26 28 27 <br /> 29 28 30 <? = link_to('New '.$model_object_name, array(":action" => 'add')) ?>29 <?php echo link_to("New ".$model_object_name, array(":action" => "add")) ?> -
trunk/trax/vendor/trax/templates/scaffolds/layout.phtml
r106 r117 82 82 <body> 83 83 84 <? if(Session::isset_flash("notice")): ?>85 <p style="color: green"><? =Session::flash("notice") ?></p>86 <? elseif(Session::isset_flash("error")): ?>87 <p style="color: red"><? =Session::flash("error") ?></p>88 <? endif; ?>84 <?php if(Session::isset_flash("notice")): ?> 85 <p style="color: green"><?php echo Session::flash("notice") ?></p> 86 <?php elseif(Session::isset_flash("error")): ?> 87 <p style="color: red"><?php echo Session::flash("error") ?></p> 88 <?php endif; ?> 89 89 90 <? =$content_for_layout ?>90 <?php echo $content_for_layout ?> 91 91 92 92 </body> -
trunk/trax/vendor/trax/templates/scaffolds/show.phtml
r109 r117 1 <? if(count($$model_object_name->content_columns)): ?>2 <? foreach($$model_object_name->content_columns as $column): ?>1 <?php if(count($$model_object_name->content_columns)): ?> 2 <?php foreach($$model_object_name->content_columns as $column): ?> 3 3 <p> 4 <b><? = $column['human_name'] ?>:</b>5 <? =$$model_object_name->$column['name'] ?>4 <b><?php echo $column['human_name'] ?>:</b> 5 <?php echo $$model_object_name->$column['name'] ?> 6 6 </p> 7 <? endforeach; ?>8 <? else: ?>7 <?php endforeach; ?> 8 <?php else: ?> 9 9 no table info found.<br> 10 <? endif; ?>10 <?php endif; ?> 11 11 <br> 12 <? =link_to("Edit", array(":action" => "edit", ":id" => $$model_object_name)) ?> |13 <? =link_to("Back", array(":action" => "index")) ?>12 <?php echo link_to("Edit", array(":action" => "edit", ":id" => $$model_object_name)) ?> | 13 <?php echo link_to("Back", array(":action" => "index")) ?> -
trunk/trax/vendor/trax/trax_exceptions.php
r62 r117 1 <? 1 <?php 2 2 # $Id: trax_exceptions.php 53 2005-10-29 14:49:53Z john $ 3 3 # -
trunk/trax/vendor/trax/trax_generator.php
r113 r117 1 <? 1 <?php 2 2 # $Id$ 3 3 # … … 77 77 } 78 78 } 79 $this->generate_controller($command_name, $views);79 $this->generate_controller($command_name, $views); 80 80 } 81 81 break; … … 97 97 } 98 98 } 99 $this->generate_scaffold($command_name, $controller_name,$views);99 $this->generate_scaffold($command_name, $controller_name, $views); 100 100 } 101 101 break; … … 415 415 416 416 function fix_php_brackets($string) { 417 return str_replace("? >", "?>", str_replace("< ? ", "<?", $string));417 return str_replace("? >", "?>", str_replace("< ?php", "<?php", $string)); 418 418 } 419 419
