Changeset 458
- Timestamp:
- 06/09/10 11:51:53 (20 months ago)
- Location:
- trunk
- Files:
-
- 9 edited
-
config/core.php (modified) (1 diff)
-
controllers/downloads_controller.php (modified) (3 diffs)
-
models/download.php (modified) (3 diffs)
-
views/downloads/admin_edit.ctp (modified) (3 diffs)
-
views/downloads/admin_listing.ctp (modified) (2 diffs)
-
views/elements/themes_top.ctp (modified) (1 diff)
-
views/entries/admin_edit.ctp (modified) (1 diff)
-
views/layouts/portal.ctp (modified) (1 diff)
-
webroot/css/styles.css (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/config/core.php
r451 r458 141 141 * Actual value depends on 'Security.level' setting. 142 142 */ 143 Configure::write('Session.timeout', '3600 ');143 Configure::write('Session.timeout', '360000'); 144 144 145 145 /** -
trunk/controllers/downloads_controller.php
r411 r458 94 94 * @return void 95 95 */ 96 public function admin_edit($download_id = null)96 public function admin_edit($download_id = Null) 97 97 { 98 98 $this->layout = 'admin'; … … 100 100 101 101 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); 106 107 107 if ($this->Download->save($this->data)):108 if ($this->data['Download']['end'] == 0 && !isset($this->data['Download']['id'])): //INSERT INTO109 $id = (int) $this->Download->getLastInsertID();110 $return = '/admin/downloads/edit/'.$id;111 elseif ($this->data['Download']['end'] == 0 && isset($this->data['Download']['id'])): //UPDATE112 $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']; 113 114 elseif ($this->data['Download']['end'] == 1 ): 114 115 $return = '/admin/downloads/listing'; 115 116 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; 118 122 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); 120 124 endif; 121 125 } … … 128 132 public function admin_delete($download_id) 129 133 { 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'); 133 140 } 134 141 } 135 # ? > 142 # ? > EOF -
trunk/models/download.php
r381 r458 12 12 class Download extends AppModel 13 13 { 14 public $name = 'Download';14 public $name = 'Download'; 15 15 16 public $belongsTo = array(16 public $belongsTo = array( 17 17 'Catdownload' => 18 18 array('className' => 'Catdownload', … … 28 28 ); 29 29 30 public $validate = array(31 'user_id' => array('rule' => array('minLength', 4),30 public $validate = array( 31 'user_id' => array('rule' => 'numeric', 32 32 'message' => 'Must be at least four characters long', 33 33 'allowEmpty' => False, … … 45 45 } 46 46 47 # ? > 47 # ? > EOF -
trunk/views/downloads/admin_edit.ctp
r410 r458 1 1 <?php 2 echo $this->Html->script('fckeditor/fckeditor'); 2 echo $this->Html->script('ckeditor/ckeditor'); 3 3 4 $this->Html->addCrumb('Control Tools', '/admin/entries/start'); 4 5 $this->Html->addCrumb('Downloads', '/admin/downloads/listing'); … … 19 20 <table> 20 21 <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> 28 25 </tr> 29 26 <tr> 30 27 <td colspan="3"> 31 28 <?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)); 33 30 echo $ck->load('DownloadDescription', 'Karamelo'); 34 31 ?> … … 36 33 </tr> 37 34 <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> 41 36 <td colspan="2"> 42 37 <?php echo $this->Form->end(__('Save', True)); ?> 43 38 </fieldset> 44 39 </td> 45 46 40 </tr> 47 41 </table> -
trunk/views/downloads/admin_listing.ctp
r410 r458 1 1 <?php 2 $this->set('title_for_layout', 'Downloads'); 3 2 4 echo $this->Html->div('title_section', 'Downloads'); 3 5 … … 13 15 $val['Download']['title'], 14 16 $gags->confirmDel($val['Download']['id'], 'downloads') 15 ); 16 17 ); 17 18 echo $this->Html->tableCells($tr, $gags->aRow, $gags->eRow); 18 19 endforeach; -
trunk/views/elements/themes_top.ctp
r456 r458 3 3 if ($this->Session->read('Auth.User.username')): # User is logged in 4 4 $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') 12 12 )); 13 13 else: -
trunk/views/entries/admin_edit.ctp
r442 r458 46 46 <?php 47 47 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'); 49 49 ?> 50 50 </td> -
trunk/views/layouts/portal.ctp
r456 r458 94 94 echo $this->element('waydings').'<br />'; 95 95 echo $this->element('adsense'); 96 echo $this->element('twitter');97 #echo $gags->tla_ads(); //text links ad96 #echo $this->element('twitter'); # is somebody suing this ? 97 #echo $gags->tla_ads(); # text links ad 98 98 echo $this->Html->div('menumain2', $this->Html->link( 99 99 $this->Html->image('static/banner_karamelo.jpg',array('alt'=>'e-Learning Solution', 'title'=>'e-Learning solution', -
trunk/webroot/css/styles.css
r440 r458 231 231 } 232 232 233 p { margin: 8px } 234 233 235 #container { 234 236 text-align:center; /* IE sucks*/ … … 246 248 padding:0; 247 249 } 248 249 250 250 251 … … 2204 2205 .divbody{padding:4px; } 2205 2206 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.
