Changeset 454


Ignore:
Timestamp:
05/29/10 19:09:34 (21 months ago)
Author:
aarkerio
Message:

Little changes

Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/controllers/entries_controller.php

    r450 r454  
    99 */ 
    1010# File: /app/controllers/images_controller.php 
    11  
    1211 
    1312App::import('Sanitize'); 
     
    5958 public function display($username)  
    6059 { 
    61   $this->pageTitle = $username . '\'s Blog';       
    6260  $this->layout = 'blog'; 
    6361  $this->Blog->setUserId($username);  
     
    8280 { 
    8381  $this->layout    = 'blog'; 
    84   $this->pageTitle = $username . '\'s Blog'; 
    8582  $this->Blog->setUserId($username);   # set blog sidebars 
    8683  $user_id = $this->Blog->getUserId(); 
  • trunk/controllers/news_controller.php

    r387 r454  
    193193 */ 
    194194 public function admin_spam($new_id) 
    195  { 
    196   
     195 {  
    197196  $status = 0; 
    198197  $this->News->id = (int) $new_id; 
     
    201200      $this->msgFlash(__('Noticia eliminada por SPAM', true),'/news/view'); 
    202201  endif; 
    203  
    204202 } 
    205203 
     
    230228  public function admin_edit($news_id = null) 
    231229  { 
     230    if ( !$this->Auth->user('id') ): 
     231        $this->redirect('/'); 
     232        return False; 
     233    endif; 
    232234    $this->layout = 'admin';    
    233235    $this->set('themes',Set::combine($this->News->Theme->find('all',array('order'=>'theme')),"{n}.Theme.id","{n}.Theme.theme")); 
    234236    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'); 
    236238        if ($this->News->save($this->data)): 
    237239            if ($this->data['News']['end'] == 0 && !isset($this->data['News']['id'])): 
     
    275277 } 
    276278} 
    277 # ? > 
     279# ? > EOF 
  • trunk/controllers/quicks_controller.php

    r430 r454  
    7373                        ); 
    7474       
    75     $this->Quick->unbindAll();      
     75    $this->Quick->contain(); 
    7676    
    7777    $params = array('fields' => array('Quick.id', 'Quick.title', 'Quick.reference'), 
     
    8585 
    8686/** 
    87  *  
     87 * Vote 
    8888 * @access public 
    8989 * @return void 
     
    101101      $this->data['QuicksVote']['vote']     = (int) $new_vote; 
    102102      $this->Quick->QuicksVote->save($this->data); 
     103      $params = array('conditions'=>array('quick_id'=>$quick_id)); 
     104      $new_vote = $this->Quick->QuicksVote->find('count', $params); 
    103105      $this->set('votes', $new_vote); 
    104106      $this->set('karma',$karma); 
     
    260262        $this->data['Quick']['user_id'] = (int) $this->Auth->user('id'); 
    261263            if ($this->Quick->save($this->data)): 
    262                  $this->msgFlash('Data saved', '/admin/quicks/listing');  
     264                $this->msgFlash('Data saved', '/admin/quicks/listing');  
    263265        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'); 
    266268            endif; 
    267269    endif; 
     
    318320  } 
    319321} 
    320 # ? > 
     322# ? > EOF 
  • trunk/controllers/themeblogs_controller.php

    r386 r454  
    2222   $this->Auth->allow(array('display', 'vote')); 
    2323 } 
    24  /** Admin section ***/   
     24/**======= Admin section ===========0***/   
    2525/** 
    2626 * Listing 
     
    4949   if ( !empty($this->data['Themeblog']) ): 
    5050       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'); 
    5252       endif; 
    5353       if ( $this->Themeblog->save($this->data) ): 
     54           #die(debug($this->data)); 
    5455           $return = '/admin/themeblogs/listing'; 
    5556           $this->msgFlash(__('Data saved', True), $return);    
     
    6768} 
    6869 
    69 # ? > 
     70# ? > EOF 
  • trunk/models/quick.php

    r423 r454  
    4040 public $validate = array( 
    4141  'title' => array( 
    42                     'rule'       => array('minLength', 4), 
    43                     'message'    => 'Title must be at least four characters long', 
    44                             'allowEmpty' => False, 
    45                     'required'   => True  
     42                   'rule'       => array('minLength', 4), 
     43                   'message'    => 'Title must be at least four characters long', 
     44                           'allowEmpty' => False, 
     45                   'required'   => True  
    4646                    ), 
    4747       
    4848  'reference' => array( 
    4949                       array( 
    50                'rule'       => 'url', 
    51                'message'    => 'Does not look like a valid URL', 
    52                        'allowEmpty' => False, 
    53                        'required'   => True 
     50                   'rule'       => 'url', 
     51                   'message'    => 'Does not look like a valid URL', 
     52                           'allowEmpty' => False, 
     53                           'required'   => True 
    5454                             ) , 
    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.' 
    5858                       ) 
    5959                    ), 
    6060  'user_id' => array( 
    61                      'rule'       => 'numeric', 
    62              'allowEmpty' => False, 
    63              'on' => 'create', # but not on update 
    64                      'required'   => true  
     61                           'rule'       => 'numeric', 
     62                   'allowEmpty' => False, 
     63                   'on'        => 'create', # but not on update 
     64                   'required'   => true  
    6565                     ), 
    6666  'theme_id' => array( 
    67                      'rule'       => 'numeric', 
    68                      'allowEmpty' => false, 
    69                      'on' => 'create', # but not on update 
    70                      'required'   => true  
     67                   'rule'       => 'numeric', 
     68                   'allowEmpty' => False, 
     69                   'on'        => 'create', # but not on update 
     70                   'required'   => True  
    7171                     ) 
    7272   ); 
     
    7474 public function validateUrl($data)  
    7575 { 
    76    return (filter_var($data['reference'], FILTER_VALIDATE_URL)) ? true : false; 
     76   return (filter_var($data['reference'], FILTER_VALIDATE_URL)) ? True : False; 
    7777 } 
    7878} 
    79 # ? > 
     79# ? > EOF 
  • trunk/models/themeblog.php

    r382 r454  
    2727 */ 
    2828public $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', 
    3931                                       'required'   => True, 
    4032                                       'allowEmpty' => False), 
    4133                    '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  
    4537                                       ) 
    4638   ); 
    4739} 
    48 # ? > 
     40# ? > EOF 
  • trunk/views/entries/display.ctp

    r444 r454  
    11<?php 
    22#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 
     5foreach ($data as $val):   
     6    $user_id   =  $val['Entry']['user_id']; 
    47    $link      =  '/entries/view/'.$blogger['User']['username'].'/'.$val['Entry']['id']; 
    58    echo '<h3>'.$this->Html->link($val['Entry']['title'],$link,array('class'=>'title')) . '</h3>'; 
     
    2528$t .= $this->Html->div(null,$this->Paginator->counter(), array('style'=>'width:200px;float:center')); 
    2629echo  $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  
    11<?php 
    2 #exit(debug($Element)); 
    3      
     2$this->set('title_for_layout',  $blogger['User']['username'] . '\'s Blog'); 
     3 
     4#exit(debug($Element));     
    45$discution =  $data['Entry']['discution']; 
    56$entry_id  =  $data['Entry']['id']; 
  • trunk/views/quicks/admin_listing.ctp

    r412 r454  
    11<?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')), '#',  
     2echo $this->Html->div('title_section','Quick News'); 
     3echo $this->Html->para(null, $this->Html->link($this->Html->image('admin/new.gif', array('alt'=>'Add new', 'title'=>'Add new')), '#',  
    44                                                 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');  
     5echo $this->Html->div(Null, Null, array('style'=>'text-align:left;display:none;width:100%', 'id'=>'trh')); 
     6echo $this->Form->create('Quick', array('action'=>'add'));  
    77?> 
    88 <fieldset> 
    99    <legend>Add Quick new</legend> 
    1010<?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');  
    1515?> 
    1616</fieldset> 
  • trunk/views/quicks/voted.ctp

    r392 r454  
    33  $down = $karma == 'down' ? 'adownmod.gif' : 'adowngray.gif'; 
    44  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  
    11<?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');  
     4echo $this->Html->getCrumbs(' > '); 
     5 
     6echo $this->Form->create('Themeblog', array('action'=>'edit'));  
     7 echo $this->Form->input('Themeblog.id', array('type' => 'hidden')); 
    48?> 
    59<fieldset> 
  • trunk/views/themeblogs/admin_listing.ctp

    r410 r454  
    1313  echo "</fieldset></div>"; 
    1414 
    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')); 
    1616  foreach ($data as $val): 
    1717      echo $this->Html->div(null); 
  • trunk/views/users/admin_edit.ctp

    r393 r454  
    1313?> 
    1414<fieldset> 
    15 <?php 
    16   
     15<?php  
    1716  echo '<legend>'.$session->read('Auth.User.username') .'\'s '.__('profile', true).'</legend>'; 
    1817  echo $this->Html->div(null, '<b>'.$this->data['User']['email'].'</b>'); 
Note: See TracChangeset for help on using the changeset viewer.