Changeset 117 for trunk/trax/vendor/trax/templates
- Timestamp:
- 01/18/06 18:45:19 (6 years ago)
- Location:
- trunk/trax/vendor/trax/templates
- Files:
-
- 16 modified
-
controller.php (modified) (1 diff)
-
error.phtml (modified) (2 diffs)
-
helper.php (modified) (1 diff)
-
model.php (modified) (1 diff)
-
scaffolds/add.phtml (modified) (1 diff)
-
scaffolds/edit.phtml (modified) (1 diff)
-
scaffolds/generator_templates/controller.php (modified) (3 diffs)
-
scaffolds/generator_templates/form_scaffolding.phtml (modified) (1 diff)
-
scaffolds/generator_templates/layout.phtml (modified) (2 diffs)
-
scaffolds/generator_templates/view_add.phtml (modified) (1 diff)
-
scaffolds/generator_templates/view_edit.phtml (modified) (1 diff)
-
scaffolds/generator_templates/view_index.phtml (modified) (1 diff)
-
scaffolds/generator_templates/view_show.phtml (modified) (1 diff)
-
scaffolds/index.phtml (modified) (1 diff)
-
scaffolds/layout.phtml (modified) (1 diff)
-
scaffolds/show.phtml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
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")) ?>
