Changeset 274

Show
Ignore:
Timestamp:
02/22/08 22:39:23 (8 months ago)
Author:
aarkerio
Message:

Update karamelo to 1.2 cake version

Location:
trunk/app
Files:
9 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/controllers/colleges_controller.php

    r247 r274  
    4040        $this->set('data', $this->College->find($conditions, $fields)); 
    4141         
    42         //$this->set('Element', $this->Portal->statics()); // Charge Portal components aka Sidebars 
     42        $this->Portal->statics();  // Charge Portal components aka Sidebars 
    4343 } 
    4444       
  • trunk/app/controllers/components/edublog.php

    r151 r274  
    88 */ 
    99 
    10 loadModel('User'); 
     10App::import('Model','User'); 
    1111 
    1212class EdublogComponent extends Object 
  • trunk/app/controllers/components/portal.php

    r175 r274  
    11<?php  
    22/** 
    3  * Portal component By Manuel Montoya. 
     3 * Portal component By Manuel Montoya. Chipotle Software 2002-2008 
    44 * comments, bug reports are welcome:     manuel _AT_ mononeurona _DOT_ org 
    55 * @author aarkerio 
    6  * @version 0.1 
     6 * @version 0.2 
    77 * @license GPLv3 
    8  */ 
    9  
    10 loadModel('Section'); 
    11 loadModel('Entry'); 
    12 loadModel('Quote'); 
    13 loadModel('News'); 
    14 loadModel('Page'); 
    15 loadModel('Poll'); 
    16 loadModel('Banner'); 
    17 loadModel('User'); 
    18  
     8 **/ 
     9App::import('Model', 'Section'); 
     10App::import('Model', 'Entry'); 
     11App::import('Model', 'Quote'); 
     12App::import('Model', 'News'); 
     13App::import('Model', 'Page'); 
     14App::import('Model', 'Poll'); 
     15App::import('Model', 'Banner'); 
     16App::import('Model', 'User'); 
     17  
    1918class PortalComponent extends Object { 
    2019  
    21  public function startup(&$controller) { 
     20 public function startup(&$controller)  
     21 { 
    2222        // This method takes a reference to the controller which is loading it. 
    2323        // Perform controller initialization here. 
    2424        $this->controller = $controller; 
    25          
    26         $this->User = new User; 
    2725 } 
    2826  
     
    3533     $Element["rankPages"] = $this->rankPages(); 
    3634     $Element["Poll"]      = $this->poll(); 
    37      return $Element; 
     35     $this->controller->set('Element', $Element); 
     36 
     37     return true; 
    3838 } 
    39  
    4039  
    41  private function sections() { 
     40 private function sections()  
     41 { 
    4242    
    4343   $conditions = null; 
  • trunk/app/controllers/pollrows_controller.php

    r247 r274  
    77 
    88class PollrowsController extends AppController 
    9 { 
    10   public $name          = 'Pollrows'; 
    11    
     9 
    1210  public $helpers       = array('Ajax'); 
    13    
     11 
     12  public function beforeFiler() 
     13  { 
     14    $this->Auth->allow('vote'); 
     15    parent::beforeFilter(); 
     16  }   
    1417  public function isAuthorized() 
    1518  { 
  • trunk/app/controllers/users_controller.php

    r247 r274  
    1313  public $helpers          = array('Ajax', 'Fck', 'Gags'); 
    1414     
    15   //public $components       = array('Security', 'Edublog', 'Portal', 'Email', 'Adds'); 
     15  public $components       = array('Edublog', 'Portal', 'Email', 'Adds'); 
     16  public function beforeFiler() 
     17  { 
     18    $this->Auth->allow( array('entry', 'about') ); 
     19    parent::beforeFilter(); 
     20  }   
    1621 
    1722  public function isAuthorized()  
     
    175180        $this->set('cover', $this->Cover->findAll($conditions, $fields, $order, $limit)); 
    176181         
    177         $this->set('Element', $this->Portal->statics()); // Using Portal component 
     182        $this->Portal->statics(); // Using Portal component 
    178183    } 
    179184     
     
    193198        $this->set('cover', $this->Cover->findAll($conditions, $fields, $order, $limit)); 
    194199 
    195         $this->set('Element', $this->Portal->statics()); // Using Portal component 
    196          
    197          
     200        $this->Portal->statics(); // Using Portal component 
    198201    } 
    199202 
     
    273276        $this->pageTitle = 'Recover password :: Karamelo E-learning on Web 2.0'; 
    274277         
    275         $this->set('Element', $this->Portal->statics()); // Using Portal component 
    276          
     278        $this->Portal->statics(); // Using Portal component  
     279 
    277280        $this->layout    = 'portal'; 
    278281 } 
     
    294297 public function login() 
    295298 { 
    296     $this->layout    = 'portal'; 
    297         
    298     $this->pageTitle = 'Login :: Karamelo E-learning'; 
    299         
    300     //$this->set('Element', $this->Portal->statics()); // Using Portal component 
    301      
    302299    if ($this->Auth->user())  
    303300    { 
     
    319316 
    320317            $this->redirect($this->Auth->redirect()); 
     318    } 
     319    else 
     320    { 
     321          $this->Portal->statics(); // Using Portal component 
     322 
     323          $this->layout    = 'portal'; 
     324        
     325          $this->pageTitle = 'Login :: Karamelo E-learning'; 
    321326    } 
    322327 } 
  • trunk/app/views/colleges/view.ctp

    r251 r274  
    55echo '<div style="padding:5px;">'. $data['College']['description'] .'</div>'; 
    66 
    7 echo '<p>'. $html->linkEmail('Contact us',  $data['College']['email'])          .'</p>'; 
     7echo '<p>'. $html->link('Contact us',  'mailto:'.$data['College']['email'])          .'</p>'; 
    88 
    99?> 
  • trunk/app/views/elements/poll.ctp

    r240 r274  
    4242  else // the user has voted, just print the poll result 
    4343  { 
    44        echo $html->formTag('#','post', array("onsubmit"=>"return false;")); 
     44    echo $ajax->form(); 
    4545     
    4646    $array   = array(); 
     
    4848    echo "<p><b>" . $Element["Poll"]['Poll']['question'] ."</b></p>"; 
    4949     
    50     echo $html->hiddenTag('Pollrow/poll_id', $Element["Poll"]['Poll']['id']);  // Poll_id 
     50    echo $form->hidden('Pollrow.poll_id', $Element["Poll"]['Poll']['id']);  // Poll_id 
    5151     
    5252    foreach ($Element["Poll"]['Pollrow'] as $key=>$val) 
     
    5656     
    5757    echo '<span style="font-size:7pt">'; 
    58         echo $html->radio('Pollrow/id', $array, '<br />');  //print the answers 
     58        echo $form->radio('Pollrow.id', $array, array('separator'=>'<br />'));  //print the answers 
    5959    echo '<br />'; 
    6060     
  • trunk/app/views/layouts/portal.ctp

    r246 r274  
    4242  
    4343 echo $html->link('Home', '/') . ' | '; 
    44  echo $html->link('About College', '/colleges/about') . ' | '; 
     44 echo $html->link('About College', '/colleges/view') . ' | '; 
    4545 echo $html->link('Contact', '/messages/contact') . ' | '; 
    4646?> 
     
    7070   } 
    7171 
    72 // echo  $this->renderElement('lastentries', $Element["Lentry"]); 
     72  echo  $this->renderElement('lastentries', $Element["Lentry"]); 
    7373   echo  '<br />';    
    74 //echo  $this->renderElement('poll',       $Element["Poll"]);  
     74   echo  $this->renderElement('poll',       $Element["Poll"]);  
    7575         
    76 // echo $this->renderElement('subjects');  
     76  echo $this->renderElement('subjects');  
    7777?> 
    7878       <ul>    
  • trunk/app/views/users/entry.ctp

    r264 r274  
    1313    $pl = 'Permalink: http://' . $_SERVER['SERVER_NAME'] . '/users/entry/'.$blog["User"]["username"].'/'.$entry_id; 
    1414     
    15     echo '<p><a style="font-size:7pt" href="/users/entry/'.$blog["User"]["username"].'/'.$entry_id.'">'.$pl.'</a></p>'; 
     15    echo $html->para(null, $html->link($pl, '/users/entry/'.$blog["User"]["username"].'/'.$entry_id)); 
    1616     
    1717    if ( $discution == 1 )  
     
    2626    if ( $discution == 1 )  //is the comments in this entry actived by blogger? 
    2727    { 
    28         if ( !$othAuth->sessionValid() )  // if user logged, anchor to textarea 
     28        if ( !isset( $cU['User'] ) )  // if user logged, anchor to textarea 
    2929        { 
    3030                 echo '<div id="comments">' . $html->image('static/comment.gif', array("alt"=>"Comments")) . ' Comments:</div>'; 
     
    5353         
    5454         
    55         echo $html->formTag('/comments/add/','post', array("onsubmit"=>"return chkForm()")); 
    56         echo $html->hiddenTag('Comment/redirect_to', '/users/entry/'.$blog["User"]["username"].'/'.$entry_id); 
    57         echo $html->hiddenTag('Comment/entry_id', $entry_id); 
     55        echo $form->create('Comments', array("onsubmit"=>"return chkForm()", "action"=>"add")); 
     56        echo $form->hidden('Comment.redirect_to', '/users/entry/'.$blog["User"]["username"].'/'.$entry_id); 
     57        echo $form->hidden('Comment.entry_id', $entry_id); 
    5858         
    59         if ( $othAuth->sessionValid() ) 
     59        if ( isset( $cU['User']['id'] ) ) 
    6060        { 
    6161?> 
     
    6363         <legend id="new_comment">New Comment</legend> 
    6464         <?php 
    65             echo $html->hidden('Comment/user_id', array("value"=>$othAuth->user('id'))); 
    66             echo $html->hidden('Comment/username', array("value"=>$othAuth->user('username'))); 
    67             echo $othAuth->user('username') . "  writes:"; 
     65            echo $html->hidden('Comment.user_id', array("value"=>$cU['User']['id'] )); 
     66            echo $html->hidden('Comment.username', array("value"=>$cU['User']['username'])); 
     67            echo $cU['User']['username'] . "  writes:"; 
    6868         ?> 
    6969         <p> 
    70          <?php echo $form->labelTag('Comment/comment', 'Comment:' );?><br /> 
    71          <?php echo $html->textarea('Comment/comment', array("rows" => 10, "cols" => 50)); ?> 
    72          <?php echo $html->tagErrorMsg('Comment/comment', 'A comment is required.'); ?> 
     70         <?php echo $form->labelTag('Comment.comment', 'Comment:' );?><br /> 
     71         <?php echo $form->textarea('Comment.comment', array("rows" => 10, "cols" => 50)); ?> 
     72         <?php echo $form->error('Comment.comment', 'A comment is required.'); ?> 
    7373         </p> 
    7474         <br /> 
    75          <?php echo $html->submit('Send') ?> 
     75         <?php echo $form->end('Send') ?> 
    7676         </fieldset> 
    7777         </form> 
     
    8080         else 
    8181         { 
    82             echo '<p>' . $html->link('You must be logged to write a comment', '/users/login'). '</p>'; 
     82            echo $html->para(null, $html->link('You must be logged to write a comment', '/users/login')); 
    8383         } 
    8484