Changeset 737

Show
Ignore:
Timestamp:
08/25/08 16:39:15 (3 months ago)
Author:
aarkerio
Message:

Little bugs fixed

Location:
trunk/app
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/controllers/ecourses_controller.php

    r697 r737  
    7373             $this->msgFlash(__('Status modified', true), '/admin/ecourses/listing/'); 
    7474    endif; 
    75   } 
    76   public function admin_add()  
    77   {    
    78     $this->layout    = 'admin';  
     75 } 
     76 public function admin_add()  
     77 {    
     78  $this->layout    = 'admin';  
    7979    
    80     $this->set('subjects', Set::combine($this->Ecourse->Subject->find('all', array('order' => 'title')), "{n}.Subject.id","{n}.Subject.title")); 
     80  $this->set('subjects', Set::combine($this->Ecourse->Subject->find('all', array('order' => 'title')), "{n}.Subject.id","{n}.Subject.title")); 
    8181     
    82     $this->set('langs', Set::combine($this->Ecourse->Lang->find('all', array('order' => 'lang')), "{n}.Lang.id","{n}.Lang.lang")); 
    83      
    84     if (!empty($this->data['Ecourse'])): 
     82  $this->set('langs', Set::combine($this->Ecourse->Lang->find('all', array('order' => 'lang')), "{n}.Lang.id","{n}.Lang.lang")); 
     83    
     84  if (!empty($this->data['Ecourse'])): 
    8585        $this->Sanitize = new Sanitize; 
    8686         
    87         $this->Sanitize->clean($this->data["Ecourse"]); 
     87        $this->Sanitize->clean($this->data['Ecourse']); 
    8888         
    8989        $this->data['Ecourse']['user_id'] = $this->Auth->user('id'); 
     
    9191        $this->Ecourse->create(); 
    9292         
    93         if ($this->Ecourse->save($this->data['Ecourse'])): 
    94                 $this->msgFlash('Course saved', '/admin/ecourses/edit/'.$this->Ecourse->getLastInsertID()); 
     93        if ($this->Ecourse->save($this->data)): 
     94                $this->msgFlash(__('Data saved', true), '/admin/ecourses/edit/'.$this->Ecourse->getLastInsertID()); 
    9595    endif; 
    9696   endif; 
     
    106106     
    107107    if ( empty($this->data['Ecourse']) ): 
    108          
    109108       $this->data = $this->Ecourse->read(null, $ecourse_id); 
    110        
    111109    else: 
    112110       
     
    115113        $this->Sanitize->html($this->data['Ecourse']['description']); 
    116114         
    117         if ($this->Ecourse->save($this->data['Ecourse'])): 
    118              $this->msgFlash('eCourse saved', '/admin/ecourses/edit/'.$this->data["Ecourse"]['id']); 
     115        if ($this->Ecourse->save($this->data)): 
     116             $this->msgFlash(__('Data saved', true), '/admin/ecourses/edit/'.$this->data["Ecourse"]['id']); 
    119117    endif; 
    120118    endif; 
     
    123121 public function admin_delete($id) 
    124122 { 
    125     if ( $this->Ecourse->del($id)) 
    126     { 
    127         $this->msgFlash('Course deleted', '/admin/ecourses/listing'); 
    128     } 
     123  if ( $this->Ecourse->del($id)): 
     124      $this->msgFlash(__('Data removed', true), '/admin/ecourses/listing'); 
     125  endif; 
    129126 }  
    130127} 
  • trunk/app/models/ecourse.php

    r617 r737  
    4141                'rule' => array('minLength', 4), 
    4242                'required' => true, 
    43                 'allowEmpty' => false, 
     43        'allowEmpty' => false, 
    4444                'message' => 'Mimimum 4 characters long in title' 
    4545                ) 
     
    4747        'description' => array( 
    4848            'rule' => array('minLength', 20), 
    49             'allowEmpty' => false, 
     49        'allowEmpty' => false, 
    5050            'message' => 'Mimimum 8 characters long' 
    5151        ), 
  • trunk/app/views/ecourses/admin_add.ctp

    r697 r737  
    2222<tr><td colspan="3"> 
    2323 <?php  
    24     echo $form->label('Ecourse.description', __('Description', true)); 
    25     echo $form->textarea('Ecourse.description', array('cols'=>40, 'rows'=>4)); 
    26     echo $fck->load('EcourseDescription', 'Karamelo'); 
     24  echo $form->label('Ecourse.description', __('Description', true)); 
     25  echo $form->error('Ecourse.description'); 
     26  echo $form->textarea('Ecourse.description', array('cols'=>40, 'rows'=>4)); 
     27  echo $fck->load('EcourseDescription', 'Karamelo'); 
    2728 ?> 
    2829</td></tr> 
    2930<tr><td> 
    3031<?php 
    31  e($form->input('Ecourse.code', array("size" => 12, "maxlenght" => 12, 'title'=>' max. 12 characters. Example: ROM2121'))); 
     32 e($form->input('Ecourse.code', array('size'=>12, 'maxlenght'=>12, 'title'=>'max. 12 characters. Example: ROM2121'))); 
    3233?> 
    3334</td><td colspan="2"> 
    3435  <?php 
    3536     echo $form->label('Ecourse.status', __('Enabled', true)); 
    36      echo $form->checkbox('Ecourse.status', array('value'=>1, 'title'=>'Enabled course'));  
    37   ?></fieldset> 
     37     echo $form->checkbox('Ecourse.status', array('value'=>1, 'title'=>__('Enabled', true)));  
     38  ?> 
    3839</td></tr> 
    39  
    4040<tr><td colspan="3"> 
    41   <?php echo $form->end(__('Save', true)); ?> 
     41<?php echo $form->end(__('Save', true)); ?> 
    4242</td></tr> 
    4343</table> 
    44  
     44</fieldset> 
    4545<script type="text/javascript"> 
    4646/* <![CDATA[ */ 
  • trunk/app/views/ecourses/admin_edit.ctp

    r697 r737  
    4545  </td></tr> 
    4646  <tr><td colspan="3"> 
    47  <?php echo $form->end(__('Save', true)); ?> 
    48  </fieldset> 
    49 </td></tr> 
     47   <?php echo $form->end(__('Save', true)); ?> 
     48 </td></tr> 
    5049</table> 
     50</fieldset> 
    5151<script type="text/javascript"> 
    5252/* <![CDATA[ */ 
  • trunk/app/views/images/admin_listing.ctp

    r626 r737  
    22//popup or full window ? 
    33if ( $set == null ): 
    4     echo $html->addCrumb('Control Panel', '/admin/entries/start');  
    5     echo $html->addCrumb(__('Images', true), '#');  
     4    echo $html->addCrumb('Control Panel', '/admin/entries/start'); 
    65    echo $html->getCrumbs(' / '); 
    76    echo $html->div('title_section', __('Images', true)); 
     
    2120  <fieldset> 
    2221     <legend><?php echo __('Upload Image'); ?></legend> 
    23       
    2422     <?php echo $form->label('Image.file', __('File', true)); 
    2523           echo $form->file('Image.file');  
    26            echo $form->error('Image.file', 'File is required.'); 
     24           echo $form->error('Image.file'); 
    2725           echo $form->end(__('Upload', true));  
    2826      ?> 
     
    3533$counter = 0; // five images in one row 
    3634 
    37 foreach ($data as $val)  
    38  
    39    $counter++; 
    40     
    41    $image_stats = getimagesize('img/imgusers/'.$val['Image']['file']); 
    42     
    43    if ( $counter == 1 ): // open new row 
     35foreach ($data as $val): 
     36 $counter++; 
     37 $image_stats = getimagesize('img/imgusers/'.$val['Image']['file']); 
     38 if ( $counter == 1 ): // open new row 
    4439        echo "<tr>"; 
    45    endif; 
     40 endif; 
    4641?> 
    4742<td style="text-align:center;padding:3px;vertical-align:top;"><span style="font-size:8px;"><?php echo '/img/imgusers/'.$val['Image']['file']; ?></span><br /><br /> 
     
    6863        $counter = 0; //reset counter 
    6964    endif; 
    70   } 
     65 endforeach; 
    7166     
    7267 if ( $counter < 5 ): 
    7368       $colspan = (5 - $counter); 
    74        print '<td colspan="'.$colspan.'">&nbsp;</td></tr>';  // fill the row with column 
     69       print '<td colspan="'.$colspan.'">&nbsp;</td></tr>';  // fill the row with column(s) 
    7570       
    7671  endif; 
  • trunk/app/views/quotes/admin_listing.ctp

    r736 r737  
    2424<table style="width:100%"> 
    2525<?php 
    26 $th = array ('Edit', 'Quote', 'Author', 'Delete'); 
     26$th = array (__('Edit', true), __('Quote', true), __('Author', true), __('Delete', true)); 
     27 
    2728echo $html->tableHeaders($th); 
    2829