Changeset 458


Ignore:
Timestamp:
06/09/10 11:51:53 (20 months ago)
Author:
aarkerio
Message:

Little improvements

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/config/core.php

    r451 r458  
    141141 * Actual value depends on 'Security.level' setting. 
    142142 */ 
    143   Configure::write('Session.timeout', '3600'); 
     143  Configure::write('Session.timeout', '360000'); 
    144144 
    145145/** 
  • trunk/controllers/downloads_controller.php

    r411 r458  
    9494 *  @return void 
    9595 */ 
    96  public function admin_edit($download_id = null) 
     96 public function admin_edit($download_id = Null) 
    9797 { 
    9898  $this->layout    = 'admin';    
     
    100100 
    101101  if (!empty($this->data['Download'])): 
    102     if ( !isset($this->data['Download']['id']) ):  // new download 
    103            $this->data['Download']['user_id'] = (int) $this->Auth->user('id'); 
    104     endif; 
    105     $this->data['Download']['title']   = Sanitize::paranoid($this->data['Download']['title'], $this->para_allowed); 
     102      if ( !isset($this->data['Download']['id']) ):  // new download 
     103          $this->data['Download']['user_id'] = (int) $this->Auth->user('id'); 
     104      endif; 
     105      #die(debug($this->data)); 
     106      $this->data['Download']['title']   = Sanitize::paranoid($this->data['Download']['title'], $this->para_allowed); 
    106107           
    107     if ($this->Download->save($this->data)): 
    108           if ($this->data['Download']['end'] == 0 && !isset($this->data['Download']['id'])):  // INSERT INTO 
    109                   $id = (int) $this->Download->getLastInsertID(); 
    110                   $return = '/admin/downloads/edit/'.$id;     
    111               elseif ($this->data['Download']['end'] == 0 && isset($this->data['Download']['id'])):  // UPDATE  
    112                   $return = '/admin/downloads/edit/'.$this->data['Download']['id']; 
     108      if ($this->Download->save($this->data)): 
     109          if ($this->data['Download']['end'] == 0 && !isset($this->data['Download']['id'])):  # INSERT INTO 
     110              $id = (int) $this->Download->getLastInsertID(); 
     111              $return = '/admin/downloads/edit/'.$id;     
     112              elseif ($this->data['Download']['end'] == 0 && isset($this->data['Download']['id'])):  # UPDATE  
     113              $return = '/admin/downloads/edit/'.$this->data['Download']['id']; 
    113114              elseif ($this->data['Download']['end'] == 1 ): 
    114115                  $return = '/admin/downloads/listing'; 
    115116              endif; 
    116     $this->msgFlash(__('Data saved', True),$return); 
    117     endif; 
     117          $this->msgFlash(__('Data saved', True),$return); 
     118          return True; 
     119      else: 
     120          die(debug($this->Download->validationErrors)); 
     121      endif; 
    118122  elseif($download_id != null && intval($download_id)):   
    119         $this->data = $this->Download->read(null, $download_id);  
     123      $this->data = $this->Download->read(null, $download_id);  
    120124  endif; 
    121125 } 
     
    128132 public function admin_delete($download_id) 
    129133 { 
    130    if ( $this->Download->delete($download_id) ): 
    131        $this->msgFlash(__('Data removed', True),'/admin/downloads/listing'); 
    132    endif; 
     134  if ( $this->Download->delete($download_id) ): 
     135      $msg = __('Data removed', True); 
     136  else: 
     137      $msg = __('Data NOT removed', True); 
     138  endif; 
     139  $this->msgFlash($msg,'/admin/downloads/listing'); 
    133140 } 
    134141} 
    135 # ? > 
     142# ? > EOF 
  • trunk/models/download.php

    r381 r458  
    1212class Download extends AppModel 
    1313{ 
    14     public $name      = 'Download'; 
     14 public $name      = 'Download'; 
    1515     
    16     public $belongsTo  = array( 
     16 public $belongsTo  = array( 
    1717                            'Catdownload' => 
    1818                                           array('className'  => 'Catdownload', 
     
    2828                       ); 
    2929     
    30     public $validate = array( 
    31                              'user_id' => array('rule'    => array('minLength', 4), 
     30 public $validate = array( 
     31                             'user_id' => array('rule'    => 'numeric', 
    3232                                             'message'    => 'Must be at least four characters long', 
    3333                                             'allowEmpty' => False, 
     
    4545} 
    4646 
    47 # ? > 
     47# ? > EOF 
  • trunk/views/downloads/admin_edit.ctp

    r410 r458  
    11<?php  
    2 echo $this->Html->script('fckeditor/fckeditor');  
     2echo $this->Html->script('ckeditor/ckeditor'); 
     3 
    34$this->Html->addCrumb('Control Tools', '/admin/entries/start');  
    45$this->Html->addCrumb('Downloads', '/admin/downloads/listing');  
     
    1920<table> 
    2021<tr> 
    21   <td><?php echo $this->Form->input('Download.title', array('size' => 40, 'maxlength' => 80)); ?></td> 
    22   <td> 
    23   <?php echo $this->Form->select('Download.catdownload_id', array('options'=>$catdownloads));   ?> 
    24   </td> 
    25     <td> 
    26      <?php echo $this->Form->input('Download.url', array('size' => 40, 'maxlength' => 200)); ?> 
    27   </td> 
     22  <td><?php echo $this->Form->input('Download.title', array('size' => 40, 'maxlength' => 80));   ?></td> 
     23  <td><?php echo $this->Form->input('Download.catdownload_id', array('options'=>$catdownloads)); ?></td> 
     24  <td><?php echo $this->Form->input('Download.url', array('size' => 40, 'maxlength' => 200));    ?></td> 
    2825</tr> 
    2926<tr> 
    3027<td colspan="3"> 
    3128 <?php  
    32   echo $this->Form->input('Download.description', array('cols'=>80, 'rows'=>45));  
     29  echo $this->Form->input('Download.description', array('cols'=>80, 'rows'=>25, 'label'=>False));  
    3330  echo $ck->load('DownloadDescription', 'Karamelo'); 
    3431  ?> 
     
    3633</tr> 
    3734<tr> 
    38 <td> 
    39  <?php echo $this->Form->input('Download.end', array('input'=>'checkbox', 'value' => '1')); ?> 
    40 </td> 
     35<td> <?php echo $this->Form->input('Download.end', array('type'=>'checkbox', 'value' => '1')); ?></td> 
    4136<td colspan="2"> 
    4237  <?php echo $this->Form->end(__('Save', True)); ?> 
    4338</fieldset> 
    4439</td> 
    45  
    4640</tr> 
    4741</table> 
  • trunk/views/downloads/admin_listing.ctp

    r410 r458  
    11<?php  
     2$this->set('title_for_layout', 'Downloads'); 
     3 
    24echo $this->Html->div('title_section', 'Downloads'); 
    35     
     
    1315        $val['Download']['title'], 
    1416        $gags->confirmDel($val['Download']['id'], 'downloads') 
    15         ); 
    16         
     17        );        
    1718    echo $this->Html->tableCells($tr,  $gags->aRow, $gags->eRow); 
    1819endforeach; 
  • trunk/views/elements/themes_top.ctp

    r456 r458  
    33if ($this->Session->read('Auth.User.username')): # User is logged in 
    44    $list = array($this->Html->link('MyMONO', '/admin/entries/start') => array( 
    5                                                                $this->Html->link(__('New blog Entry', true), '/admin/entries/edit'), 
    6                                                $this->Html->link(__('Submit Quick', true), '/admin/quicks/listing'), 
    7                                    $this->Html->link(__('Submit New', true), '/admin/news/edit'), 
    8                                    $this->Html->link(__('Cosas pendientes', true), '/admin/todos/listing'), 
    9                                    $this->Html->link(__('Images', true), '/admin/images/listing'), 
    10                                    $this->Html->link(__('Shares', true), '/admin/shares/listing'), 
    11                                    $this->Html->link(__('Logout', true), '/users/logout') 
     5                                                               $this->Html->link(__('New blog Entry', True), '/admin/entries/edit'), 
     6                                               $this->Html->link(__('Submit Quick', True), '/admin/quicks/listing'), 
     7                                   $this->Html->link(__('Submit New', True), '/admin/news/edit'), 
     8                                   $this->Html->link(__('Pending stuff', True), '/admin/todos/listing'), 
     9                                   $this->Html->link(__('Images', True), '/admin/images/listing'), 
     10                                   $this->Html->link(__('Shares', True), '/admin/shares/listing'), 
     11                                   $this->Html->link(__('Logout', True), '/users/logout') 
    1212                                                                          )); 
    1313else: 
  • trunk/views/entries/admin_edit.ctp

    r442 r458  
    4646<?php  
    4747      echo $this->Form->input('Entry.body', array('cols'=>90, 'rows'=>35, 'label'=>False)); 
    48    echo $ck->load('EntryBody', 'Karamelo');  
     48      echo $ck->load('EntryBody', 'Karamelo'); 
    4949?> 
    5050</td> 
  • trunk/views/layouts/portal.ctp

    r456 r458  
    9494  echo $this->element('waydings').'<br />'; 
    9595  echo $this->element('adsense'); 
    96   echo $this->element('twitter'); 
    97   #echo  $gags->tla_ads();   // text links ad 
     96  #echo $this->element('twitter'); # is somebody suing this ? 
     97  #echo  $gags->tla_ads();   # text links ad 
    9898  echo  $this->Html->div('menumain2', $this->Html->link( 
    9999                    $this->Html->image('static/banner_karamelo.jpg',array('alt'=>'e-Learning Solution', 'title'=>'e-Learning solution',  
  • trunk/webroot/css/styles.css

    r440 r458  
    231231} 
    232232 
     233p { margin: 8px } 
     234 
    233235#container { 
    234236    text-align:center;  /* IE sucks*/ 
     
    246248  padding:0; 
    247249} 
    248  
    249250 
    250251 
     
    22042205.divbody{padding:4px; } 
    22052206 
    2206 .divbody p{margin:12px 0;text-align:justify;} 
    2207  
    2208 #quicks{ 
    2209 /* background-color: #DDF1FF;*/ 
    2210 } 
    2211  
    2212  /* .quicks{   border:2px solid blue;} 
    2213  
     2207.divbody p {margin:12px 0;text-align:justify;padding:3px;} 
     2208 
     2209/* #quicks{ 
     2210 background-color: #DDF1FF; 
     2211}*/ 
     2212 
     2213/* .quicks{   border:2px solid blue;} */ 
     2214 
Note: See TracChangeset for help on using the changeset viewer.