Changeset 701 for trunk/app/views/news

Show
Ignore:
Timestamp:
08/08/08 16:03:49 (4 months ago)
Author:
aarkerio
Message:

New validates

Location:
trunk/app/views/news
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/views/news/admin_add.ctp

    r620 r701  
    66   echo $html->addCrumb(__('News', true), '/admin/news/listing'); 
    77   echo $html->getCrumbs(' / '); 
    8    echo $form->create('News', array('onsubmit'=>'return validateNew()'));  
     8   echo $form->create('News');  
    99 
    1010   echo $html->div('title_section', __('Add new', true)); 
     
    1212<table> 
    1313<tr> 
     14<td><?php  echo $form->input('News.title', array('size' => 40, 'maxlength' => 120));  ?> </td> 
    1415<td> 
    15  <?php  
    16       echo $form->input('News.title', array('size' => 40, 'maxlength' => 120)); 
    17       echo $form->error('News.title', 'Title is required.');  
    18  ?> 
    19 </td><td> 
    2016 <?php  
    2117    echo $form->label('News.theme_id', __('Theme', true)); 
    2218    echo $form->select('News.theme_id', $themes, null, null, null, false, false);       
    2319  ?> 
    24 </td><td> 
    25 <?php  
    26    echo $form->input('News.reference', array('size'=> 30, 'maxlength'=> 250, 'value'=>'http://'));  
    27  ?> 
    28 </td><td> 
    29  <?php echo $html->link($html->image('admin/myimages.jpg', array("alt"=>"My Images", "title"=>"My Images")), '#', array("onclick"=>"javascript:window.open('/admin/images/listing/set', 'blank', 'toolbar=no, scrollbars=yes,width=700,height=500')"), null, false) ?></p> 
     20</td> 
     21<td><?php echo $form->input('News.reference', array('size'=> 30, 'maxlength'=> 340));  ?></td> 
     22<td> 
     23 <?php echo $html->link($html->image('admin/myimages.jpg', array('alt'=>__('My Images', true), 'title'=>__('My Images', true))), '#', array("onclick"=>"javascript:window.open('/admin/images/listing/set', 'blank', 'toolbar=no, scrollbars=yes,width=700,height=500')"), null, false) ?></p> 
    3024</td></tr> 
    31  
    3225<tr><td colspan="4"> 
    3326  <?php  
    34      echo $form->label('News.Body', 'Body:').'<br />'; 
     27     echo $form->error('News.body').'<br />'; 
    3528     echo $form->textarea('News.body', array('cols'=>80, 'rows'=>35)); 
    3629     echo $fck->load('NewsBody', 'Karamelo');  
     
    3932<tr><td> 
    4033  <?php  
    41      echo $form->label('News.status', 'Published:' ); 
     34     echo $form->label('News.status', __('Published', true) ); 
    4235     echo $form->checkbox('News.status', array('value'=>1));  
    4336  ?> 
    4437</td><td> 
    4538  <?php  
    46      echo $form->label('News.comments', 'Comments actived:' ); 
     39     echo $form->label('News.comments', __('Allow comments', true) ); 
    4740     echo $form->checkbox('News.comments', array('value'=>1));  
    4841  ?> 
     
    5043<td  colspan="2"> 
    5144   <?php  
    52      echo $form->label('News.end', 'Finish editing:'); 
     45     echo $form->label('News.end', __('Finish edition', true)); 
    5346     echo $form->checkbox('News.end', array('value'=>1));  
    5447    ?> 
    5548</td> 
    5649</tr> 
    57    
    58 <tr><td colspan="4">  <?php echo $form->end(__('Save', true)); ?> </td></tr> 
    59  
     50  <tr><td colspan="4">  <?php echo $form->end(__('Save', true)); ?> </td></tr> 
    6051</table> 
     52</fieldset> 
  • trunk/app/views/news/admin_edit.ctp

    r620 r701  
    55  echo $html->getCrumbs(' / ');  
    66 
    7   echo $html->para(null, $html->link($html->image('actions/new.png', array("alt"=>"Add new", "title"=>"Add new")), '/admin/news/add', null, false, false)); 
     7  echo $html->para(null, $html->link($html->image('actions/new.png', array('alt'=>__('Add new', true), 'title'=>__('Add new',true))), '/admin/news/add', null, false, false)); 
    88 
    9   echo $form->create('News', array('onsubmit'=>'return validateNew()'));  
     9  echo $form->create('News');  
    1010  echo $form->hidden('News.id'); 
    1111?> 
    1212<table> 
    1313<tr> 
    14 <td> 
    15 <?php  
    16   echo $form->input('News.title', array('size' => 40, 'maxlength' => 120, 'label'=>__('Title', true))); 
    17   echo $form->error('News.title', 'Title is required.');  
    18 ?> 
    19 </td> 
     14<td> <?php echo $form->input('News.title', array('size' => 40, 'maxlength' => 120, 'label'=>__('Title', true))); ?></td> 
    2015<td> 
    2116  <?php  
    22     echo $form->label('News.theme_id', 'Theme:' ); 
     17    echo $form->label('News.theme_id', __('Theme', true)); 
    2318    echo $form->select('News.theme_id', $themes, null, null, false);       
    2419  ?> 
    2520</td> 
    26 <td> 
    27   <?php echo $form->input('News.reference', array("size" => 30, "maxlength" => 250, 'value'=>'http://'));  ?> 
    28 </td> 
     21<td><?php  echo $form->input('News.reference', array('size'=> 30, 'maxlength' => 340)); ?></td> 
    2922<td> 
    3023  <?php echo $html->link($html->image('admin/myimages.jpg', array("alt"=>"My Images", "title"=>"My Images")), '#', array("onclick"=>"javascript:window.open('/admin/images/listing/set', 'blank', 'toolbar=no, scrollbars=yes,width=700,height=500')"), null, false) ?></p> 
     
    3326<tr><td colspan="4"> 
    3427  <?php  
    35      echo $form->label('News.Body', 'Body:') . '<br />'; 
     28     echo $form->error('News.body'); 
    3629     echo $form->textarea('News.body', array('cols'=>90, 'rows'=>35));  
    3730     echo $fck->load('NewsBody', 'Karamelo');  
     
    4134  <td> 
    4235 <?php  
    43      echo $form->label('News.status', 'Published:'); 
    44      echo $form->checkbox('News.status', array("value"=>1));  
     36     echo $form->label('News.status', __('Published', true)); 
     37     echo $form->checkbox('News.status', array('value'=>1));  
    4538  ?> 
    4639</td> 
    4740<td> 
    4841 <?php  
    49      echo $form->label('News.comments', 'Allow comments:' ); 
    50      echo $form->checkbox('News.comments', array("value"=>1));  
     42     echo $form->label('News.comments', __('Allow comments', true)); 
     43     echo $form->checkbox('News.comments', array('value'=>1));  
    5144 ?> 
    5245</td> 
    5346 <td colspan="2"> 
    5447 <?php  
    55       echo $form->label('News.end', 'Finish editing:'); 
    56       echo $form->checkbox('News.end', array("value"=>1));  
     48    echo $form->label('News.end', __('Finish edition', true)); 
     49    echo $form->checkbox('News.end', array('value'=>1));  
    5750 ?> 
    5851</td> 
     
    6053<tr><td colspan="4"> <?php echo $form->end(__('Save', true)); ?></td></tr> 
    6154</table> 
     55</fieldset> 
  • trunk/app/views/news/admin_listing.ctp

    r653 r701  
    11<?php 
    2 //die(debug($data)); 
    32  echo $html->div('title_section', __('News', true)); 
    43  echo $html->link($html->image('actions/new.png', array('alt'=>__('Add new', true), 'title'=>__('Add new', true))), '/admin/news/add', null, false, false); 
    54  echo '&nbsp;&nbsp;&nbsp;';  
    6   echo $html->link($html->image('static/forum.gif', array("alt"=>"See comments", "title"=>"See comments")), '/admin/discussions/listing', null, false, false); 
     5  echo $html->link($html->image('static/forum.gif', array('alt'=>__('See comments', true),'title'=>__('See comments', true))), '/admin/discussions/listing', null, false, false); 
    76?> 
    87<table class="tbadmin"> 
    98<?php 
    10  
    119$th = array(__('Edit', true), __('Title', true), __('Author', true), __('Status', true), __('Delete', true)); 
    1210echo $html->tableHeaders($th);   
     
    2523     
    2624endforeach; 
    27 ?> 
    28 </table> 
    2925 
    30 <?php  
     26echo '</table>'; 
     27 
    3128$t  = $html->div(null,$paginator->prev('« '.__('Previous', true). ' ',null,null,array('class'=>'disabled')),array('style'=>'width:100px;float:left')); 
    3229$t .= $html->div(null, $paginator->next(' '.__('Next', true). ' »', null, null, array('class' => 'disabled')),array('style'=>'width:100px;float:right'));