Changeset 340


Ignore:
Timestamp:
02/27/10 15:20:15 (2 years ago)
Author:
aarkerio
Message:

News controller improved

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/app_controller.php

    r321 r340  
    2323 
    2424 # allowed characters in paranoid Sanitize 
    25  public $para_allowed = array('.', ',', '-','_','@',' ','(', ')',"+","\n", "/", "ñ", "á", "é", "í", "ó", "ú", "Á", "É", "Í", "Ó", "Ú", '"',"'", "?", ";", ":"); 
     25 public $para_allowed = array('.', ',', '-','_','@',' ','(', ')',"+","\n", "/", "ñ", "á", "é", "í", "ó", "ú", "Á", "É", "Í", "Ó", "Ú", '"',"'","¿" ,"?", ";", ":"); 
    2626 # Use :  Sanitize::paranoid($this->data['Model']['title'], $this->para_allowed); 
    2727 
  • trunk/controllers/users_controller.php

    r337 r340  
    196196        #die(debug( $this->data['User'])); 
    197197        unset($this->data['User']['username']); #do not save this 
    198         unset($this->data['User']['email']); 
     198      #  unset($this->data['User']['email']); 
     199  // if($this->User->validates()) 
     200  //{ 
    199201        if ($this->User->save($this->data)): 
    200202            $this->msgFlash('Profile has been saved','/admin/users/edit/'); 
     
    202204             die(debug($this->User->validationErrors)); 
    203205        endif; 
    204   endif;    
     206  
     207        //} 
     208        //else 
     209        //{ 
     210 
     211    //debug($this->User->validationErrors); 
     212        //} 
     213 endif;    
    205214 } 
    206215 
  • trunk/models/user.php

    r275 r340  
    6969  'email' => array( 
    7070                              array( 
    71                             'rule'       => array('minLength', 8), 
    72                             'message'    => 'Email must be at least 8 characters long', 
    73                                 'allowEmpty' => false, 
    74                             'on'         => 'create', // but not on update 
     71                            'rule'       => array('email'), 
     72                            'message'    => 'Please supply a valid email address.', 
     73                                'allowEmpty' => false, // but not on update 
    7574                                    'required'   => true 
    7675                                         ), 
  • trunk/views/elements/new.ctp

    r312 r340  
    33echo $html->div('titnew'); 
    44echo $html->div('img_new',$html->link( 
    5                       $html->image('themes/'.$val['Theme']['img'], array('style'=>'height:35px;border:1px solid white;','alt'=>$val['Theme']['theme'], 'title'=>$val['Theme']['theme'])),  
    6                            '/news/category/' .$val['News']['theme_id'],  
    7                       null, null, false)); 
    8 //--SI ES ESPAM 
     5                      $html->image('themes/'.$val['Theme']['img'], array('style'=>'height:35px;border:1px solid white;','alt'=>$val['Theme']['theme'], 'title'=>$val['Theme']['theme'])),  '/news/category/' .$val['News']['theme_id'], Null, False, False)); 
     6# --SI ES ESPAM 
    97if ($session->read('Auth.User.group_id')=='1'): 
    108 echo  $html->link($html->image('images/nospam.png', array('style'=>'height:22px; border:1px solid white','width'=>'22px', 'alt'=>'NoSpam', 'title'=>'NoSpam')), '/admin/news/spam/'.$val['News']['id'],null, null, false);  
     
    3028     $down = $h['vote']  < 0  ? 'adownmod.gif' : 'adowngray.gif'; 
    3129     echo $html->image('static/'.$up,array('alt'=>'Vote')).$html->div('score',$votes).$html->image('static/'.$down,array('alt'=>'Vote')); 
    32 elseif( !$already && $session->read('Auth.User')):  
     30 elseif ( !$already && $session->read('Auth.User')): 
    3331     echo $ajax->link($html->image('static/aupgray.gif', array('alt'=>'Vote')), '/quicks/vote/up/'.$q['Quick']['id'], 
    3432                   array('update'   => $ajax_update, 
     
    6866 ?> 
    6967 <br /><br /> 
    70  <b>Reference:</b> 
    71  <?php echo $html->link( 
    72                         $html->image('admin/newwindow.gif', array('alt'=>"Abre Ventana", 'title'=>"Abre Ventana")), 
    73                         $val['News']['reference'], 
    74                         array("onclick"=>"window.open(this.href,'_help','status,scrollbars,resizable,width=800,height=600,left=10,top=10,menubar,toolbar')"),  
    75                         null,  
    76                         null,  
    77                         false). "&nbsp;"; 
     68<?php 
     69if ( strlen($val['News']['reference'])  > 10) : 
     70   echo $html->para(null, __('Reference', true). ' ' .$html->link( 
     71                           $html->image('admin/newwindow.gif', array('alt'=>'Open new window', 'title'=>'Open new window')), 
     72                           '#new'.$val['News']['id'], 
     73                           array('onclick'=>"window.open('".h($val['News']['reference'])."', '_help', 'status,scrollbars,resizable,width=800,height=600,left=10,top=10,menubar,toolbar')"), Null, False, False)); 
     74endif;     
    7875                           
    7976if ( $frontend == True):     
    80    if ( $val['News']['comments'] == 1 ):  // comments enabled 
     77   if ( $val['News']['comments'] == 1 ):  # comments enabled 
    8178      $num_coment = count($val['Comentnews']); 
    8279      if ( $num_coment > 0 ): 
     
    8986 
    9087 else: # showin permalink 
    91    if ( $data['News']['comments'] == 1 ):  // comments are enabled 
     88   if ( $data['News']['comments'] == 1 ):  # comments are enabled 
    9289        $i = 1; 
    9390        echo $html->div('cnews'); 
    9491        foreach($val['Comentnews'] as $v): 
    9592              $bg = ($i%2==0) ? '#e2e2e2' : '#fff'; 
    96               if ( $v['user_id'] != 0 ):   // 0 = anonymous comment 
     93              if ( $v['user_id'] != 0 ):   # 0 = anonymous comment 
    9794                          $avatar = $html->image('avatars/'.$v['User']['avatar'],  
    9895                            array('alt'=>$v['User']['username'], 'title'=>$v['User']['username'],  'height'=>20, 'width'=>20)); 
  • trunk/views/helpers/gags.php

    r243 r340  
    7373                     google_color_border = "FFFFFF"; 
    7474                     google_color_bg = "FFFFFF"; 
    75                      google_color_link = "b70909"; 
     75                     google_color_link = "177477"; 
    7676                     google_color_text = "000000"; 
    77                      google_color_url = "b70909"; 
     77                     google_color_url = "177477"; 
    7878                     //--> 
    7979                     </script> 
     
    104104       google_color_border = "FFFFFF"; 
    105105       google_color_bg = "FFFFFF"; 
    106        google_color_link = "b70909"; 
     106       google_color_link = "177477"; 
    107107       google_color_text = "000000"; 
    108        google_color_url = "b70909"; 
     108       google_color_url = "177477"; 
    109109       //--></script> 
    110110       <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> 
     
    124124        google_color_border = "FFFFFF"; 
    125125        google_color_bg = "FFFFFF"; 
    126         google_color_link = "b70909"; 
     126        google_color_link = "177477"; 
    127127        google_color_text = "000000"; 
    128         google_color_url = "b70909"; 
     128        google_color_url = "177477"; 
    129129        //--> 
    130130        </script> 
  • trunk/views/layouts/portal.ctp

    r329 r340  
    101101                                          $html->image('static/banner_karamelo.jpg',array('alt'=>'e-Learning Solution', 'title'=>'e-Learning solution',  
    102102                                           'style'=>'border:1px solid black')),  
    103                                           'http://www.chipotle-software.com', array(), false, false)); 
    104 ?> 
    105 <br /> 
    106 <script type="text/javascript" src="http://www.ohloh.net/p/16759/widgets/project_partner_badge.js"></script> 
    107 <?php  
    108   echo  $this->element('poll'); 
    109   echo  $this->element('rankpages'); 
     103                                          'http://www.chipotle-software.com', Null, False, False)); 
     104  echo $this->element('poll'); 
     105  echo $this->element('rankpages'); 
    110106  echo $this->element('adsense'); 
    111107 ?> 
     
    113109</tr> 
    114110<tr><td colspan="3" style="margin-top:30px;"><br /> 
    115 <?php  echo $html->link($html->image('static/top.png', array('alt'=>'Go top', 'title'=>'Go Top')), '#maintable', null, null, false); ?> 
     111<?php  echo $html->link($html->image('static/top.png', array('alt'=>'Go top', 'title'=>'Go Top')), '#maintable', Null, False, False); ?> 
    116112</td></tr> 
    117113<tr><td colspan="3" id="footer"> 
     
    122118<div style="margin:20px auto 20px auto;width:800px;text-align:center;"> 
    123119<?php 
    124    echo $html->link($html->image("static/debian-80x15.gif", array('alt'=>"The Queen is here", 'title'=>"The Queen is here")),  
    125         'http://www.debian.org/', null, null, false) . "&nbsp;"; 
     120   echo $html->link($html->image('static/debian-80x15.gif', array('alt'=>'The Queen is here', 'title'=>'The Queen is here')),  
     121        'http://www.debian.org/', Null, False, False) . "&nbsp;"; 
    126122 
    127123   echo $html->link($html->image("static/firefox-80x15.png", array('alt'=>"Mozilla Firefox", 'title'=>"Mozilla Firefox")),  
    128         'http://www.mozilla.org/products/firefox/', null, null, false) . "&nbsp;"; 
     124        'http://www.mozilla.org/products/firefox/', Null, False, False) . "&nbsp;"; 
    129125    
    130126   echo $html->link($html->image("static/pgsql-80x15.png", array('alt'=>"The Best DataBase", 'title'=>"The Best DataBase")),  
    131         'http://www.postgresql.org/', null, null, false) . "&nbsp;"; 
     127        'http://www.postgresql.org/', Null, False, False) . "&nbsp;"; 
    132128    
    133129   echo $html->link($html->image("static/cakephp-80x15.png", array('alt'=>"CakePHP Framework", 'title'=>"CakePHP Framework")),  
    134         'http://www.cakephp.org/', null, null, false) . "&nbsp;"; 
     130        'http://www.cakephp.org/', Null, False, False) . "&nbsp;"; 
    135131    
    136132   echo $html->link($html->image("static/valid_xhtml10_80x15_22.png", array('alt'=>"XHTML", 'title'=>"XHTML")),  
     
    138134    
    139135   echo $html->link($html->image("static/hacker-80x15.png", array('alt'=>"GNU Hacker", 'title'=>"GNU Hacker")),  
    140         'http://www.fsfla.org/', null, null, false) . "&nbsp;"; 
     136        'http://www.fsfla.org/', Null, False, False) . "&nbsp;"; 
    141137                   
    142138   echo $html->link($html->image('static/chipotle80x15.png', array('alt'=>'Chipotle Software', 'title'=>'Chipotle Software')),  
    143         'http://www.chipotle-software.com', null, null, false); 
     139        'http://www.chipotle-software.com', Null, False, False); 
    144140    
    145141 echo '</div>';  
  • trunk/views/pages/display.ctp

    r304 r340  
    1111 echo $html->link($html->image('secs/'.$data['Section']['img'],  
    1212        array('alt'=>$data['Section']['description'], 'title'=>$data['Section']['description'], 'class'=>'imgborder')),  
    13         '/pages/section/'.$data['Section']['id'], null, null, false); 
     13        '/pages/section/'.$data['Section']['id'], Null, False, False); 
    1414echo '</div>'; 
    1515 
  • trunk/views/users/admin_edit.ctp

    r296 r340  
    2424  echo $form->input('User.newsletter', array('type'=>'checkbox','label'=> __('Subscribe to newsletter', True).': '));  
    2525  echo $form->input('User.fck', array('type'=>'checkbox','label'=> __('Active HTML editor', True)));  
    26  
     26  echo  $form->input('User.email', array('size'=>35, 'maxlength'=>50)); 
    2727  echo $html->div(null, $form->input('User.pwd', array('size'=>9, 'maxlength'=>9, 'value'=>'', 'label'=>__('Password', true))) . '  '.__('Left empty if you do not want to change', true), array('style'=>'clear:both;margin:25px 0 16px 0;')); 
    2828   
Note: See TracChangeset for help on using the changeset viewer.