Changeset 274
- Timestamp:
- 02/22/08 22:39:23 (8 months ago)
- Location:
- trunk/app
- Files:
-
- 9 modified
-
controllers/colleges_controller.php (modified) (1 diff)
-
controllers/components/edublog.php (modified) (1 diff)
-
controllers/components/portal.php (modified) (2 diffs)
-
controllers/pollrows_controller.php (modified) (1 diff)
-
controllers/users_controller.php (modified) (6 diffs)
-
views/colleges/view.ctp (modified) (1 diff)
-
views/elements/poll.ctp (modified) (3 diffs)
-
views/layouts/portal.ctp (modified) (2 diffs)
-
views/users/entry.ctp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/controllers/colleges_controller.php
r247 r274 40 40 $this->set('data', $this->College->find($conditions, $fields)); 41 41 42 //$this->set('Element', $this->Portal->statics());// Charge Portal components aka Sidebars42 $this->Portal->statics(); // Charge Portal components aka Sidebars 43 43 } 44 44 -
trunk/app/controllers/components/edublog.php
r151 r274 8 8 */ 9 9 10 loadModel('User');10 App::import('Model','User'); 11 11 12 12 class EdublogComponent extends Object -
trunk/app/controllers/components/portal.php
r175 r274 1 1 <?php 2 2 /** 3 * Portal component By Manuel Montoya. 3 * Portal component By Manuel Montoya. Chipotle Software 2002-2008 4 4 * comments, bug reports are welcome: manuel _AT_ mononeurona _DOT_ org 5 5 * @author aarkerio 6 * @version 0. 16 * @version 0.2 7 7 * @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 **/ 9 App::import('Model', 'Section'); 10 App::import('Model', 'Entry'); 11 App::import('Model', 'Quote'); 12 App::import('Model', 'News'); 13 App::import('Model', 'Page'); 14 App::import('Model', 'Poll'); 15 App::import('Model', 'Banner'); 16 App::import('Model', 'User'); 17 19 18 class PortalComponent extends Object { 20 19 21 public function startup(&$controller) { 20 public function startup(&$controller) 21 { 22 22 // This method takes a reference to the controller which is loading it. 23 23 // Perform controller initialization here. 24 24 $this->controller = $controller; 25 26 $this->User = new User;27 25 } 28 26 … … 35 33 $Element["rankPages"] = $this->rankPages(); 36 34 $Element["Poll"] = $this->poll(); 37 return $Element; 35 $this->controller->set('Element', $Element); 36 37 return true; 38 38 } 39 40 39 41 private function sections() { 40 private function sections() 41 { 42 42 43 43 $conditions = null; -
trunk/app/controllers/pollrows_controller.php
r247 r274 7 7 8 8 class PollrowsController extends AppController 9 { 10 public $name = 'Pollrows'; 11 9 { 12 10 public $helpers = array('Ajax'); 13 11 12 public function beforeFiler() 13 { 14 $this->Auth->allow('vote'); 15 parent::beforeFilter(); 16 } 14 17 public function isAuthorized() 15 18 { -
trunk/app/controllers/users_controller.php
r247 r274 13 13 public $helpers = array('Ajax', 'Fck', 'Gags'); 14 14 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 } 16 21 17 22 public function isAuthorized() … … 175 180 $this->set('cover', $this->Cover->findAll($conditions, $fields, $order, $limit)); 176 181 177 $this-> set('Element', $this->Portal->statics()); // Using Portal component182 $this->Portal->statics(); // Using Portal component 178 183 } 179 184 … … 193 198 $this->set('cover', $this->Cover->findAll($conditions, $fields, $order, $limit)); 194 199 195 $this->set('Element', $this->Portal->statics()); // Using Portal component 196 197 200 $this->Portal->statics(); // Using Portal component 198 201 } 199 202 … … 273 276 $this->pageTitle = 'Recover password :: Karamelo E-learning on Web 2.0'; 274 277 275 $this-> set('Element', $this->Portal->statics()); // Using Portal component276 278 $this->Portal->statics(); // Using Portal component 279 277 280 $this->layout = 'portal'; 278 281 } … … 294 297 public function login() 295 298 { 296 $this->layout = 'portal';297 298 $this->pageTitle = 'Login :: Karamelo E-learning';299 300 //$this->set('Element', $this->Portal->statics()); // Using Portal component301 302 299 if ($this->Auth->user()) 303 300 { … … 319 316 320 317 $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'; 321 326 } 322 327 } -
trunk/app/views/colleges/view.ctp
r251 r274 5 5 echo '<div style="padding:5px;">'. $data['College']['description'] .'</div>'; 6 6 7 echo '<p>'. $html->link Email('Contact us',$data['College']['email']) .'</p>';7 echo '<p>'. $html->link('Contact us', 'mailto:'.$data['College']['email']) .'</p>'; 8 8 9 9 ?> -
trunk/app/views/elements/poll.ctp
r240 r274 42 42 else // the user has voted, just print the poll result 43 43 { 44 echo $html->formTag('#','post', array("onsubmit"=>"return false;"));44 echo $ajax->form(); 45 45 46 46 $array = array(); … … 48 48 echo "<p><b>" . $Element["Poll"]['Poll']['question'] ."</b></p>"; 49 49 50 echo $ html->hiddenTag('Pollrow/poll_id', $Element["Poll"]['Poll']['id']); // Poll_id50 echo $form->hidden('Pollrow.poll_id', $Element["Poll"]['Poll']['id']); // Poll_id 51 51 52 52 foreach ($Element["Poll"]['Pollrow'] as $key=>$val) … … 56 56 57 57 echo '<span style="font-size:7pt">'; 58 echo $ html->radio('Pollrow/id', $array, '<br />'); //print the answers58 echo $form->radio('Pollrow.id', $array, array('separator'=>'<br />')); //print the answers 59 59 echo '<br />'; 60 60 -
trunk/app/views/layouts/portal.ctp
r246 r274 42 42 43 43 echo $html->link('Home', '/') . ' | '; 44 echo $html->link('About College', '/colleges/ about') . ' | ';44 echo $html->link('About College', '/colleges/view') . ' | '; 45 45 echo $html->link('Contact', '/messages/contact') . ' | '; 46 46 ?> … … 70 70 } 71 71 72 //echo $this->renderElement('lastentries', $Element["Lentry"]);72 echo $this->renderElement('lastentries', $Element["Lentry"]); 73 73 echo '<br />'; 74 //echo $this->renderElement('poll', $Element["Poll"]);74 echo $this->renderElement('poll', $Element["Poll"]); 75 75 76 //echo $this->renderElement('subjects');76 echo $this->renderElement('subjects'); 77 77 ?> 78 78 <ul> -
trunk/app/views/users/entry.ctp
r264 r274 13 13 $pl = 'Permalink: http://' . $_SERVER['SERVER_NAME'] . '/users/entry/'.$blog["User"]["username"].'/'.$entry_id; 14 14 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)); 16 16 17 17 if ( $discution == 1 ) … … 26 26 if ( $discution == 1 ) //is the comments in this entry actived by blogger? 27 27 { 28 if ( ! $othAuth->sessionValid() ) // if user logged, anchor to textarea28 if ( !isset( $cU['User'] ) ) // if user logged, anchor to textarea 29 29 { 30 30 echo '<div id="comments">' . $html->image('static/comment.gif', array("alt"=>"Comments")) . ' Comments:</div>'; … … 53 53 54 54 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); 58 58 59 if ( $othAuth->sessionValid() )59 if ( isset( $cU['User']['id'] ) ) 60 60 { 61 61 ?> … … 63 63 <legend id="new_comment">New Comment</legend> 64 64 <?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:"; 68 68 ?> 69 69 <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.'); ?> 73 73 </p> 74 74 <br /> 75 <?php echo $ html->submit('Send') ?>75 <?php echo $form->end('Send') ?> 76 76 </fieldset> 77 77 </form> … … 80 80 else 81 81 { 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')); 83 83 } 84 84
