Changeset 199 for trunk/trax/vendor/trax/templates
- Timestamp:
- 05/04/06 19:52:43 (6 years ago)
- Location:
- trunk/trax/vendor/trax/templates/scaffolds
- Files:
-
- 8 modified
-
generator_templates/controller.php (modified) (3 diffs)
-
generator_templates/form_scaffolding.phtml (modified) (1 diff)
-
generator_templates/layout.phtml (modified) (1 diff)
-
generator_templates/view_add.phtml (modified) (1 diff)
-
generator_templates/view_edit.phtml (modified) (2 diffs)
-
generator_templates/view_index.phtml (modified) (1 diff)
-
generator_templates/view_show.phtml (modified) (2 diffs)
-
layout.phtml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/trax/vendor/trax/templates/scaffolds/generator_templates/controller.php
r198 r199 9 9 <?php endforeach; ?> 10 10 function index() { 11 $<?php echo $sing luar_model_name ?> = new <?php echo $model_class_name ?>();12 $this-><?php echo $plural_model_name ?> = $<?php echo $sing luar_model_name ?>->find_all();13 $this->content_columns = $<?php echo $sing luar_model_name ?>->content_columns;11 $<?php echo $singular_model_name ?> = new <?php echo $model_class_name ?>(); 12 $this-><?php echo $plural_model_name ?> = $<?php echo $singular_model_name ?>->find_all(); 13 $this->content_columns = $<?php echo $singular_model_name ?>->content_columns; 14 14 } 15 15 16 16 function show() { 17 $<?php echo $sing luar_model_name ?> = new <?php echo $model_class_name ?>();18 $this-><?php echo $sing luar_model_name ?> = $<?php echo $singluar_model_name ?>->find($_REQUEST['id']);17 $<?php echo $singular_model_name ?> = new <?php echo $model_class_name ?>(); 18 $this-><?php echo $singular_model_name ?> = $<?php echo $singular_model_name ?>->find($_REQUEST['id']); 19 19 } 20 20 21 21 function add() { 22 $this-><?php echo $sing luar_model_name ?> = new <?php echo $model_class_name ?>(array_key_exists('<?php echo $singluar_model_name ?>',$_REQUEST) ? $_REQUEST['<?php echo $singluar_model_name ?>'] : null );22 $this-><?php echo $singular_model_name ?> = new <?php echo $model_class_name ?>(array_key_exists('<?php echo $singular_model_name ?>',$_REQUEST) ? $_REQUEST['<?php echo $singular_model_name ?>'] : null ); 23 23 if($_POST) { 24 if($this-><?php echo $sing luar_model_name ?>->save($_POST['<?php echo $singluar_model_name ?>'])) {24 if($this-><?php echo $singular_model_name ?>->save($_POST['<?php echo $singular_model_name ?>'])) { 25 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 <?php echo $sing luar_model_name ?> to the database.");28 Session::flash('error', "Error adding <?php echo $singular_model_name ?> to the database."); 29 29 } 30 30 } … … 32 32 33 33 function edit() { 34 $<?php echo $sing luar_model_name ?> = new <?php echo $model_class_name ?>();35 $this-><?php echo $sing luar_model_name ?> = $<?php echo $singluar_model_name ?>->find($_REQUEST['id']);34 $<?php echo $singular_model_name ?> = new <?php echo $model_class_name ?>(); 35 $this-><?php echo $singular_model_name ?> = $<?php echo $singular_model_name ?>->find($_REQUEST['id']); 36 36 if($_POST) { 37 if($this-><?php echo $sing luar_model_name ?>->save($_POST['<?php echo $singluar_model_name ?>'])) {37 if($this-><?php echo $singular_model_name ?>->save($_POST['<?php echo $singular_model_name ?>'])) { 38 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 $sing luar_model_name ?>));39 $this->redirect_to = url_for(array(":action" => "show", ":id" => $this-><?php echo $singular_model_name ?>)); 40 40 } else { 41 Session::flash('error', "Error saving <?php echo $sing luar_model_name ?> to the database.");41 Session::flash('error', "Error saving <?php echo $singular_model_name ?> to the database."); 42 42 } 43 43 } … … 46 46 function delete() { 47 47 if($_REQUEST['id'] > 0) { 48 $<?php echo $sing luar_model_name ?> = new <?php echo $model_class_name ?>();49 $<?php echo $sing luar_model_name ?> = $<?php echo $singluar_model_name ?>->find($_REQUEST['id']);50 if($<?php echo $sing luar_model_name ?>->delete()) {48 $<?php echo $singular_model_name ?> = new <?php echo $model_class_name ?>(); 49 $<?php echo $singular_model_name ?> = $<?php echo $singular_model_name ?>->find($_REQUEST['id']); 50 if($<?php echo $singular_model_name ?>->delete()) { 51 51 Session::flash('notice', "<?php echo $human_model_name ?> was successfully deleted."); 52 52 } else { 53 Session::flash('error', "Error deleting <?php echo $sing luar_model_name ?> from the database.");53 Session::flash('error', "Error deleting <?php echo $singular_model_name ?> from the database."); 54 54 } 55 55 } -
trunk/trax/vendor/trax/templates/scaffolds/generator_templates/form_scaffolding.phtml
r117 r199 1 < ?php echo error_messages_for("<?php echo $sing luar_model_name ?>") ? >1 < ?php echo error_messages_for("<?php echo $singular_model_name ?>") ? > 2 2 3 <!--[form:<?php echo $sing luar_model_name ?>]-->3 <!--[form:<?php echo $singular_model_name ?>]--> 4 4 <?php 5 5 $ar_helper = new ActiveRecordHelper(); 6 6 $ar_helper->scaffolding = true; 7 echo $ar_helper->all_input_tags($this->{$sing luar_model_name}, $singluar_model_name, array());7 echo $ar_helper->all_input_tags($this->{$singular_model_name}, $singular_model_name, array()); 8 8 ?> 9 <!--[eoform:<?php echo $sing luar_model_name ?>]-->9 <!--[eoform:<?php echo $singular_model_name ?>]--> -
trunk/trax/vendor/trax/templates/scaffolds/generator_templates/layout.phtml
r117 r199 4 4 <head> 5 5 <title>Scaffolding : <?php echo $controller_name ?></title> 6 <style> 7 body { background-color: #fff; color: #333; } 8 9 body, p, ol, ul, td { 10 font-family: verdana, arial, helvetica, sans-serif; 11 font-size: 13px; 12 line-height: 18px; 13 } 14 15 pre { 16 background-color: #eee; 17 padding: 10px; 18 font-size: 11px; 19 } 20 21 a { color: #000; } 22 a:visited { color: #666; } 23 a:hover { color: #fff; background-color:#000; } 24 25 .fieldWithErrors { 26 padding: 2px; 27 background-color: red; 28 display: table; 29 } 30 31 #ErrorExplanation { 32 width: 400px; 33 border: 2px solid 'red'; 34 padding: 7px; 35 padding-bottom: 12px; 36 margin-bottom: 20px; 37 background-color: #f0f0f0; 38 } 39 40 #ErrorExplanation h2 { 41 text-align: left; 42 font-weight: bold; 43 padding: 5px 5px 5px 15px; 44 font-size: 12px; 45 margin: -7px; 46 background-color: #c00; 47 color: #fff; 48 } 49 50 #ErrorExplanation p { 51 color: #333; 52 margin-bottom: 0; 53 padding: 5px; 54 } 55 56 #ErrorExplanation ul li { 57 font-size: 12px; 58 list-style: square; 59 } 60 61 div.uploadStatus { 62 margin: 5px; 63 } 64 65 div.progressBar { 66 margin: 5px; 67 } 68 69 div.progressBar div.border { 70 background-color: #fff; 71 border: 1px solid grey; 72 width: 100%; 73 } 74 75 div.progressBar div.background { 76 background-color: #333; 77 height: 18px; 78 width: 0%; 79 } 80 </style> 6 < ?php echo stylesheet_link_tag("scaffold", array("media" => "all")) ? > 81 7 </head> 82 8 <body> -
trunk/trax/vendor/trax/templates/scaffolds/generator_templates/view_add.phtml
r117 r199 1 <h1>New <?php echo $sing luar_model_name ?></h1>1 <h1>New <?php echo $singular_model_name ?></h1> 2 2 3 3 < ?php echo start_form_tag(array(":action" => "add")) ? > -
trunk/trax/vendor/trax/templates/scaffolds/generator_templates/view_edit.phtml
r117 r199 1 <h1>Editing <?php echo $sing luar_model_name ?></h1>1 <h1>Editing <?php echo $singular_model_name ?></h1> 2 2 3 < ?php echo start_form_tag(array(":action" => "edit", ":id" => $<?php echo $sing luar_model_name ?>)) ? >3 < ?php echo start_form_tag(array(":action" => "edit", ":id" => $<?php echo $singular_model_name ?>)) ? > 4 4 < ?php echo $this->render_partial("form") ? ><br> 5 5 < ?php echo submit_tag("Edit") ? > … … 8 8 <br> 9 9 10 < ?php echo link_to("Show", array(":action" => "show", ":id" => $<?php echo $sing luar_model_name ?>)) ? > |10 < ?php echo link_to("Show", array(":action" => "show", ":id" => $<?php echo $singular_model_name ?>)) ? > | 11 11 < ?php echo link_to("Back", array(":action" => "index")) ? > -
trunk/trax/vendor/trax/templates/scaffolds/generator_templates/view_index.phtml
r117 r199 9 9 </tr> 10 10 11 < ?php foreach($<?php echo $plural_model_name ?> as $<?php echo $sing luar_model_name ?>): ? >11 < ?php foreach($<?php echo $plural_model_name ?> as $<?php echo $singular_model_name ?>): ? > 12 12 <tr> 13 < ?php foreach($<?php echo $sing luar_model_name ?>->content_columns as $column): ? >14 <td>< ?php echo $<?php echo $sing luar_model_name ?>->send($column['name']) ? ></td>13 < ?php foreach($<?php echo $singular_model_name ?>->content_columns as $column): ? > 14 <td>< ?php echo $<?php echo $singular_model_name ?>->send($column['name']) ? ></td> 15 15 < ?php endforeach; ? > 16 <td>< ?php echo link_to("Show", array(":action" => "show", ":id" => $<?php echo $sing luar_model_name ?>)) ? ></td>17 <td>< ?php echo link_to("Edit", array(":action" => "edit", ":id" => $<?php echo $sing luar_model_name ?>)) ? ></td>18 <td>< ?php echo link_to("Delete", array(":action" => "delete", ":id" => $<?php echo $sing luar_model_name ?>), array("confirm" => "Are you sure?")) ? ></td>16 <td>< ?php echo link_to("Show", array(":action" => "show", ":id" => $<?php echo $singular_model_name ?>)) ? ></td> 17 <td>< ?php echo link_to("Edit", array(":action" => "edit", ":id" => $<?php echo $singular_model_name ?>)) ? ></td> 18 <td>< ?php echo link_to("Delete", array(":action" => "delete", ":id" => $<?php echo $singular_model_name ?>), array("confirm" => "Are you sure?")) ? ></td> 19 19 </tr> 20 20 < ?php endforeach; ? > -
trunk/trax/vendor/trax/templates/scaffolds/generator_templates/view_show.phtml
r117 r199 1 < ?php if(count($<?php echo $sing luar_model_name ?>->content_columns)): ? >2 < ?php foreach($<?php echo $sing luar_model_name ?>->content_columns as $column): ? >1 < ?php if(count($<?php echo $singular_model_name ?>->content_columns)): ? > 2 < ?php foreach($<?php echo $singular_model_name ?>->content_columns as $column): ? > 3 3 <p> 4 4 <b>< ?php echo $column['human_name'] ? >:</b> 5 < ?php echo $<?php echo $sing luar_model_name ?>->send($column['name']) ? >5 < ?php echo $<?php echo $singular_model_name ?>->send($column['name']) ? > 6 6 </p> 7 7 < ?php endforeach; ? > … … 12 12 <br> 13 13 14 < ?php echo link_to("Edit", array(":action" => "edit", ":id" => $<?php echo $sing luar_model_name ?>)) ? > |14 < ?php echo link_to("Edit", array(":action" => "edit", ":id" => $<?php echo $singular_model_name ?>)) ? > | 15 15 < ?php echo link_to("Back", array(":action" => "index")) ? > -
trunk/trax/vendor/trax/templates/scaffolds/layout.phtml
r117 r199 4 4 <head> 5 5 <title>Scaffolding: </title> 6 <style> 7 body { background-color: #fff; color: #333; } 8 9 body, p, ol, ul, td { 10 font-family: verdana, arial, helvetica, sans-serif; 11 font-size: 13px; 12 line-height: 18px; 13 } 14 15 pre { 16 background-color: #eee; 17 padding: 10px; 18 font-size: 11px; 19 } 20 21 a { color: #000; } 22 a:visited { color: #666; } 23 a:hover { color: #fff; background-color:#000; } 24 25 .fieldWithErrors { 26 padding: 2px; 27 background-color: red; 28 display: table; 29 } 30 31 #ErrorExplanation { 32 width: 400px; 33 border: 2px solid 'red'; 34 padding: 7px; 35 padding-bottom: 12px; 36 margin-bottom: 20px; 37 background-color: #f0f0f0; 38 } 39 40 #ErrorExplanation h2 { 41 text-align: left; 42 font-weight: bold; 43 padding: 5px 5px 5px 15px; 44 font-size: 12px; 45 margin: -7px; 46 background-color: #c00; 47 color: #fff; 48 } 49 50 #ErrorExplanation p { 51 color: #333; 52 margin-bottom: 0; 53 padding: 5px; 54 } 55 56 #ErrorExplanation ul li { 57 font-size: 12px; 58 list-style: square; 59 } 60 61 div.uploadStatus { 62 margin: 5px; 63 } 64 65 div.progressBar { 66 margin: 5px; 67 } 68 69 div.progressBar div.border { 70 background-color: #fff; 71 border: 1px solid grey; 72 width: 100%; 73 } 74 75 div.progressBar div.background { 76 background-color: #333; 77 height: 18px; 78 width: 0%; 79 } 80 </style> 6 <?php echo stylesheet_link_tag("scaffold" array("media" => "all")) ?> 81 7 </head> 82 8 <body>
