Changeset 43
- Timestamp:
- 07/17/07 12:42:52 (18 months ago)
- Location:
- trunk/app
- Files:
-
- 5 added
- 6 modified
-
controllers/components/search.php (modified) (3 diffs)
-
controllers/entries_controller.php (modified) (3 diffs)
-
controllers/helps_controller.php (modified) (5 diffs)
-
controllers/users_controller.php (modified) (1 diff)
-
views/helps/admin_add.thtml (added)
-
views/helps/admin_display.thtml (added)
-
views/helps/admin_edit.thtml (added)
-
views/helps/admin_listing.thtml (added)
-
views/layouts/portal.thtml (modified) (1 diff)
-
views/users/entry.thtml (added)
-
webroot/img/themes/theme-history.png (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/controllers/components/search.php
r41 r43 28 28 switch ($matchType) 29 29 { 30 case ANYWHERE:30 case 'ANYWHERE': 31 31 $conditions .= "$searchField LIKE '%$keywords[$k]%'"; 32 32 break; 33 case EXACT:33 case 'EXACT': 34 34 $conditions .= "$searchField = '$keywords[$k]'"; 35 35 break; 36 case ENDS_WITH:36 case 'ENDS_WITH': 37 37 $conditions .= "$searchFields LIKE '%$keywords[$k]'"; 38 38 break; 39 case STARTS_WITH:39 case 'STARTS_WITH': 40 40 $conditions .= "$searchField LIKE '$keywords[$k]%'"; 41 41 break; … … 54 54 switch ($multipleKeywords) 55 55 { 56 case ANY:56 case 'ANY': 57 57 $conditions .= ") OR ("; 58 58 break; 59 case ALL:59 case 'ALL': 60 60 $conditions .= ") AND ("; 61 61 break; … … 73 73 } 74 74 ?> 75 -
trunk/app/controllers/entries_controller.php
r41 r43 14 14 public $helpers = array('Ajax', 'Form', 'Fck'); 15 15 16 public $components = array('Edublog', 'Portal' );16 public $components = array('Edublog', 'Portal', 'Search'); 17 17 18 18 public function results($string) … … 25 25 } 26 26 27 public function rss($user_id) 27 public function rss($user_id) 28 28 { 29 29 $this->layout = 'rss'; … … 49 49 $searchFields = array('Entry.title', 'Entry.body', 'News.body', 'Page.body'); 50 50 51 $this->set('data', $this->Search->query($this-> Product, $keywords, $searchFields, ALL, ANYWHERE));51 $this->set('data', $this->Search->query($this->Entry, $keywords, $searchFields, 'ALL', 'ANYWHERE')); 52 52 } 53 53 -
trunk/app/controllers/helps_controller.php
r31 r43 1 1 <?php 2 2 /** 3 * Karamelo eLearning Platform3 * Chipotle Software 4 4 * Manuel Montoya 2002-2007 5 * GPL manuel<at>mononeurona .org5 * GPL manuel<at>mononeurona<dot>org 6 6 */ 7 7 … … 10 10 class HelpsController extends AppController 11 11 { 12 public $helpers = array(' Ajax', 'Form', 'Fck');12 public $helpers = array('Javascript', 'Ajax', 'Form', 'Fck'); 13 13 14 public $components = array(' Edublog', 'Portal');14 public $components = array('Security'); 15 15 16 public function listing() 16 public function tour() 17 { 18 $this->layout = 'tour'; 19 $this->pageTitle = 'Karamelo'; 20 } 21 22 /**=== ADMIN METHODS === */ 23 public function admin_display($path = null) 24 { 25 $this->layout = 'popup'; 26 27 $url = str_replace('-', '/', $path); 28 29 echo $url; 30 31 $conditions = array("url"=>$url); 32 33 $fields = array("id", "url", "help"); 34 35 $this->pageTitle = 'Centauro Help'; 36 37 $this->set('data', $this->Help->find($conditions, $fields)); 38 } 39 40 public function admin_listing() 17 41 { 18 42 $this->layout = 'admin'; … … 27 51 } 28 52 29 public function tour() { 30 $this->layout = 'tour'; 31 } 32 33 public function display($lang = null, $id = null) { 34 35 $this->set('subjects', $this->Portal->cms()); // Using Portal component 36 37 $this->set('randomQuote', $this->Portal->quote()); // quote footer 38 39 $conditions = array(); 40 41 if ($id != null) 42 { 43 $conditions["id"] = $id; 44 } 45 46 if ($lang != null) 47 { 48 $conditions["lang"] = $id; 49 } 50 51 $fields = array("id", "url", "help"); 52 53 $this->pageTitle = 'Karamelo LMS'; 54 55 $this->set('data', $this->Help->findAll($conditions, $fields)); 56 } 57 58 public function add() { 53 public function admin_add() { 59 54 60 55 // adds new classroom to database … … 65 60 $this->Sanitize->cleanArray($this->params['data']); //Hopefully this is enough 66 61 67 if ($this->Help->save($this->params['data'])) 68 { 69 //$this->set('data', $this->Help->index()); 70 $this->flash('Your classroom has been saved.','/vclassrooms/listing'); 71 //$this->render('todo', 'ajax'); 72 } 73 } else { 74 $this->layout = 'admin'; 75 76 $this->Subject = new Subject; 77 78 $this->set('subjects', $this->Subject->generateList(null, 'title')); 79 80 $conditions = array("status"=>1); 81 82 $order = "order DESC"; 83 84 $O = $this->Help->field('order', $conditions, $order); 85 86 $Order = $O + 1; 87 88 $this->set('Order', $Order); 62 if ($this->Help->save($this->params['data'])) 63 { 64 //$this->set('data', $this->Help->index()); 65 $this->flash('Your classroom has been saved.','/vclassrooms/listing'); 66 } 67 } 68 else 69 { 70 $this->layout = 'admin'; 71 72 $this->Subject = new Subject; 73 74 $this->set('subjects', $this->Subject->generateList(null, 'title')); 75 76 $conditions = array("status"=>1); 77 78 $order = "order DESC"; 79 80 $O = $this->Help->field('order', $conditions, $order); 81 82 $Order = $O + 1; 83 84 $this->set('Order', $Order); 89 85 } 90 86 91 87 } 92 88 93 public function edit($id = null)89 public function admin_edit($id = null) 94 90 { 95 91 … … 115 111 } 116 112 117 public function delete($id)113 public function admin_delete($id) 118 114 { 119 115 // deletes task from database -
trunk/app/controllers/users_controller.php
r42 r43 76 76 } 77 77 78 public function about($user_id) 79 { 80 81 $this->pageTitle = 'About me'; 78 public function entry($username = null, $Entry_id = null) 79 { 80 if ($Entry_id == null) 81 { 82 $this->redirect('/blog/'.$username); 83 exit; 84 } 85 86 $this->layout = 'blog'; 87 $this->pageTitle = $username . '\'s Blog'; 88 //exit($username); 89 $this->Entry = new Entry; 90 91 $user_id = $this->User->field("id", array("username"=>$username)); 92 93 //exit($user_id); 94 95 if ($username == null || $user_id == null) 96 { 97 $this->redirect("/"); 98 } 99 100 $order = "Entry.id DESC"; 101 102 $fields = array("Entry.title", "Entry.body", "Entry.created", "Entry.user_id", "Entry.discution", "Entry.themeblog_id", "Entry.id", "User.username", "Themeblog.title", "Themeblog.id"); 103 104 if ( $Entry_id != null && is_numeric( $Entry_id ) ) // show only one new 105 { 106 $limit = 1; 107 108 $conditions = array("Entry.user_id"=>$user_id, "Entry.id"=>$Entry_id); 109 } 110 111 $this->set('data', $this->Entry->find($conditions, $fields)); 112 113 $this->set('Element', $this->Blog->bloggerStuff($user_id)); // Charge Blog components aka Sidebars 114 115 $this->set('Entry_id', $Entry_id); 116 117 $this->set('style', $this->Blog->getStyle($user_id)); 118 } 119 120 public function about($username) 121 { 122 $this->pageTitle = 'About ' . $username; 123 124 $user_id = $this->User->field("id", array("username"=>$username)); 82 125 83 126 $this->layout = $this->Edublog->layout($user_id); -
trunk/app/views/layouts/portal.thtml
r30 r43 38 38 } 39 39 ?> 40 <a href="/" title="Home">Home</a> | 41 <a href="/helps/themes/" title="Faq">Help</a> | 40 <a href="/" title="Home">Home</a> | 42 41 <a href="/pages/sitemap/" title="Site">SiteMap</a> | 43 42 <a href="/messages/contact" title="Site">Contact</a> |
