Changeset 454
- Timestamp:
- 05/29/10 19:09:34 (21 months ago)
- Location:
- trunk
- Files:
-
- 13 edited
-
controllers/entries_controller.php (modified) (3 diffs)
-
controllers/news_controller.php (modified) (4 diffs)
-
controllers/quicks_controller.php (modified) (5 diffs)
-
controllers/themeblogs_controller.php (modified) (3 diffs)
-
models/quick.php (modified) (2 diffs)
-
models/themeblog.php (modified) (1 diff)
-
views/entries/display.ctp (modified) (2 diffs)
-
views/entries/view.ctp (modified) (1 diff)
-
views/quicks/admin_listing.ctp (modified) (1 diff)
-
views/quicks/voted.ctp (modified) (1 diff)
-
views/themeblogs/admin_edit.ctp (modified) (1 diff)
-
views/themeblogs/admin_listing.ctp (modified) (1 diff)
-
views/users/admin_edit.ctp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/controllers/entries_controller.php
r450 r454 9 9 */ 10 10 # File: /app/controllers/images_controller.php 11 12 11 13 12 App::import('Sanitize'); … … 59 58 public function display($username) 60 59 { 61 $this->pageTitle = $username . '\'s Blog';62 60 $this->layout = 'blog'; 63 61 $this->Blog->setUserId($username); … … 82 80 { 83 81 $this->layout = 'blog'; 84 $this->pageTitle = $username . '\'s Blog';85 82 $this->Blog->setUserId($username); # set blog sidebars 86 83 $user_id = $this->Blog->getUserId(); -
trunk/controllers/news_controller.php
r387 r454 193 193 */ 194 194 public function admin_spam($new_id) 195 { 196 195 { 197 196 $status = 0; 198 197 $this->News->id = (int) $new_id; … … 201 200 $this->msgFlash(__('Noticia eliminada por SPAM', true),'/news/view'); 202 201 endif; 203 204 202 } 205 203 … … 230 228 public function admin_edit($news_id = null) 231 229 { 230 if ( !$this->Auth->user('id') ): 231 $this->redirect('/'); 232 return False; 233 endif; 232 234 $this->layout = 'admin'; 233 235 $this->set('themes',Set::combine($this->News->Theme->find('all',array('order'=>'theme')),"{n}.Theme.id","{n}.Theme.theme")); 234 236 if (!empty($this->data['News'])): 235 $this->data['News']['user_id'] = (int) $this->Auth->user('id'); 237 $this->data['News']['user_id'] = (int) $this->Auth->user('id'); 236 238 if ($this->News->save($this->data)): 237 239 if ($this->data['News']['end'] == 0 && !isset($this->data['News']['id'])): … … 275 277 } 276 278 } 277 # ? > 279 # ? > EOF -
trunk/controllers/quicks_controller.php
r430 r454 73 73 ); 74 74 75 $this->Quick-> unbindAll();75 $this->Quick->contain(); 76 76 77 77 $params = array('fields' => array('Quick.id', 'Quick.title', 'Quick.reference'), … … 85 85 86 86 /** 87 * 87 * Vote 88 88 * @access public 89 89 * @return void … … 101 101 $this->data['QuicksVote']['vote'] = (int) $new_vote; 102 102 $this->Quick->QuicksVote->save($this->data); 103 $params = array('conditions'=>array('quick_id'=>$quick_id)); 104 $new_vote = $this->Quick->QuicksVote->find('count', $params); 103 105 $this->set('votes', $new_vote); 104 106 $this->set('karma',$karma); … … 260 262 $this->data['Quick']['user_id'] = (int) $this->Auth->user('id'); 261 263 if ($this->Quick->save($this->data)): 262 $this->msgFlash('Data saved', '/admin/quicks/listing');264 $this->msgFlash('Data saved', '/admin/quicks/listing'); 263 265 else: 264 $msg =implode('<br />',$this->Quick->validationErrors);265 $this->msgFlash($msg, '/admin/quicks/listing');266 $msg =implode('<br />',$this->Quick->validationErrors); 267 $this->msgFlash($msg, '/admin/quicks/listing'); 266 268 endif; 267 269 endif; … … 318 320 } 319 321 } 320 # ? > 322 # ? > EOF -
trunk/controllers/themeblogs_controller.php
r386 r454 22 22 $this->Auth->allow(array('display', 'vote')); 23 23 } 24 /** Admin section***/24 /**======= Admin section ===========0***/ 25 25 /** 26 26 * Listing … … 49 49 if ( !empty($this->data['Themeblog']) ): 50 50 if ( !isset($this->data['Themeblog']['id']) ): 51 $this->data['Themeblog']['user_id'] = (int) $this->Auth->user('id');51 $this->data['Themeblog']['user_id'] = (int) $this->Auth->user('id'); 52 52 endif; 53 53 if ( $this->Themeblog->save($this->data) ): 54 #die(debug($this->data)); 54 55 $return = '/admin/themeblogs/listing'; 55 56 $this->msgFlash(__('Data saved', True), $return); … … 67 68 } 68 69 69 # ? > 70 # ? > EOF -
trunk/models/quick.php
r423 r454 40 40 public $validate = array( 41 41 'title' => array( 42 'rule' => array('minLength', 4),43 'message' => 'Title must be at least four characters long',44 'allowEmpty' => False,45 'required' => True42 'rule' => array('minLength', 4), 43 'message' => 'Title must be at least four characters long', 44 'allowEmpty' => False, 45 'required' => True 46 46 ), 47 47 48 48 'reference' => array( 49 49 array( 50 'rule' => 'url',51 'message' => 'Does not look like a valid URL',52 'allowEmpty' => False,53 'required' => True50 'rule' => 'url', 51 'message' => 'Does not look like a valid URL', 52 'allowEmpty' => False, 53 'required' => True 54 54 ) , 55 array(56 'rule'=> 'isUnique',57 'message'=> 'This URL has already been taken.'55 array( 56 'rule' => 'isUnique', 57 'message' => 'This URL has already been taken.' 58 58 ) 59 59 ), 60 60 'user_id' => array( 61 'rule' => 'numeric',62 'allowEmpty' => False,63 'on'=> 'create', # but not on update64 'required' => true61 'rule' => 'numeric', 62 'allowEmpty' => False, 63 'on' => 'create', # but not on update 64 'required' => true 65 65 ), 66 66 'theme_id' => array( 67 'rule' => 'numeric',68 'allowEmpty' => false,69 'on'=> 'create', # but not on update70 'required' => true67 'rule' => 'numeric', 68 'allowEmpty' => False, 69 'on' => 'create', # but not on update 70 'required' => True 71 71 ) 72 72 ); … … 74 74 public function validateUrl($data) 75 75 { 76 return (filter_var($data['reference'], FILTER_VALIDATE_URL)) ? true : false;76 return (filter_var($data['reference'], FILTER_VALIDATE_URL)) ? True : False; 77 77 } 78 78 } 79 # ? > 79 # ? > EOF -
trunk/models/themeblog.php
r382 r454 27 27 */ 28 28 public $validate = array( 29 'name' => array('rule' => array('minLength', 4), 30 'message' => 'Minimum 8 characters long', 31 'required' => True, 32 'allowEmpty' => False), 33 'descrip' => array('rule' => array('minLength', 4), 34 'message' => 'Minimum 8 characters long', 35 'required' => True, 36 'allowEmpty' => False), 37 'image' => array('rule' => array('minLength', 4), 38 'message' => 'Minimum 8 characters long', 29 'title' => array('rule' => array('minLength', 2), 30 'message' => 'Minimum 2 characters long', 39 31 'required' => True, 40 32 'allowEmpty' => False), 41 33 'user_id' => array('rule' => 'numeric', 42 'allowEmpty' => False,43 'required' => True,44 'on' => 'create'34 'allowEmpty' => False, 35 'required' => True, 36 'on' => 'create' # but not on update 45 37 ) 46 38 ); 47 39 } 48 # ? > 40 # ? > EOF -
trunk/views/entries/display.ctp
r444 r454 1 1 <?php 2 2 #exit(debug($data)); 3 foreach ($data as $val): $user_id = $val['Entry']['user_id']; 3 $this->set('title_for_layout', $blogger['User']['username'] . '\'s Blog'); 4 5 foreach ($data as $val): 6 $user_id = $val['Entry']['user_id']; 4 7 $link = '/entries/view/'.$blogger['User']['username'].'/'.$val['Entry']['id']; 5 8 echo '<h3>'.$this->Html->link($val['Entry']['title'],$link,array('class'=>'title')) . '</h3>'; … … 25 28 $t .= $this->Html->div(null,$this->Paginator->counter(), array('style'=>'width:200px;float:center')); 26 29 echo $this->Html->div(null,$t, array('style'=>'font-size:9pt;width:400px;margin:15px auto;')); 27 # ? > 30 # ? > EOF -
trunk/views/entries/view.ctp
r407 r454 1 1 <?php 2 #exit(debug($Element)); 3 2 $this->set('title_for_layout', $blogger['User']['username'] . '\'s Blog'); 3 4 #exit(debug($Element)); 4 5 $discution = $data['Entry']['discution']; 5 6 $entry_id = $data['Entry']['id']; -
trunk/views/quicks/admin_listing.ctp
r412 r454 1 1 <?php 2 echo $this->Html->div('title_section','Quick News');3 echo $this->Html->para(null, $this->Html->link($this->Html->image('admin/new.gif', array('alt'=>'Add new', 'title'=>'Add new')), '#',2 echo $this->Html->div('title_section','Quick News'); 3 echo $this->Html->para(null, $this->Html->link($this->Html->image('admin/new.gif', array('alt'=>'Add new', 'title'=>'Add new')), '#', 4 4 array('onclick'=>'hU()', 'escape'=>False))); 5 echo $this->Html->div(Null, Null, array('style'=>'text-align:left;display:none;width:100%', 'id'=>'trh'));6 echo $this->Form->create('Quick');5 echo $this->Html->div(Null, Null, array('style'=>'text-align:left;display:none;width:100%', 'id'=>'trh')); 6 echo $this->Form->create('Quick', array('action'=>'add')); 7 7 ?> 8 8 <fieldset> 9 9 <legend>Add Quick new</legend> 10 10 <?php 11 echo $this->Form->input('Quick.title', array('size'=>40, 'maxlength'=>100));12 echo $this->Form->input('Quick.reference', array('size'=>70, 'maxlength'=>300, 'value'=>'http://'));13 echo $this->Form->select('Quick.theme_id', array('options'=>$themes));14 echo $this->Form->end('Send');11 echo $this->Form->input('Quick.title', array('size'=>40, 'maxlength'=>100)); 12 echo $this->Form->input('Quick.reference', array('size'=>70, 'maxlength'=>300, 'value'=>'http://')); 13 echo $this->Form->input('Quick.theme_id', array('options'=>$themes)); 14 echo $this->Form->end('Send'); 15 15 ?> 16 16 </fieldset> -
trunk/views/quicks/voted.ctp
r392 r454 3 3 $down = $karma == 'down' ? 'adownmod.gif' : 'adowngray.gif'; 4 4 echo $this->Html->image('static/'.$up,array('alt'=>'Vote')).$this->Html->div('score',$votes).$this->Html->image('static/'.$down,array('alt'=>'Vote')); 5 ?> 5 # ? > EOF -
trunk/views/themeblogs/admin_edit.ctp
r393 r454 1 1 <?php 2 echo $this->Form->create('Themeblog', array('action'=>'edit')); 3 echo $this->Form->input('Themeblog.id', array('type' => 'hidden')); 2 $this->Html->addCrumb('Control Tools', '/admin/entries/start'); 3 $this->Html->addCrumb('Entries', '/admin/themeblogs/listing'); 4 echo $this->Html->getCrumbs(' > '); 5 6 echo $this->Form->create('Themeblog', array('action'=>'edit')); 7 echo $this->Form->input('Themeblog.id', array('type' => 'hidden')); 4 8 ?> 5 9 <fieldset> -
trunk/views/themeblogs/admin_listing.ctp
r410 r454 13 13 echo "</fieldset></div>"; 14 14 15 echo $gags->ajaxDiv('container', array('style'=>'border:1px dotted green;padding:8px;width:600px'));15 echo $gags->ajaxDiv('container', array('style'=>'border:1px dotted green;padding:8px;width:600px')); 16 16 foreach ($data as $val): 17 17 echo $this->Html->div(null); -
trunk/views/users/admin_edit.ctp
r393 r454 13 13 ?> 14 14 <fieldset> 15 <?php 16 15 <?php 17 16 echo '<legend>'.$session->read('Auth.User.username') .'\'s '.__('profile', true).'</legend>'; 18 17 echo $this->Html->div(null, '<b>'.$this->data['User']['email'].'</b>');
Note: See TracChangeset
for help on using the changeset viewer.
