Changeset 239
- Timestamp:
- 03/17/09 14:07:03 (3 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 9 edited
-
controllers/confirms_controller.php (modified) (2 diffs)
-
controllers/helps_controller.php (modified) (4 diffs)
-
controllers/users_controller.php (modified) (1 diff)
-
views/elements/admin_menu.ctp (added)
-
views/elements/themes_top.ctp (modified) (1 diff)
-
views/helps/admin_newticket.ctp (added)
-
views/helps/index.ctp (added)
-
views/layouts/admin.ctp (modified) (2 diffs)
-
views/layouts/help.ctp (added)
-
views/layouts/portal.ctp (modified) (1 diff)
-
webroot/css/cpanel.css (modified) (1 diff)
-
webroot/js/admin.js (modified) (1 diff)
-
webroot/js/myfunctions.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/controllers/confirms_controller.php
r238 r239 22 22 $this->pageTitle = 'Centauro Confirm'; 23 23 $this->layout = 'portal'; 24 $conditions = array(' secret'=>trim($secret));24 $conditions = array('Confirm.secret'=>trim($secret)); 25 25 $fields = array('Confirm.id', 'Confirm.user_id'); 26 26 $data = $this->Confirm->find($conditions, $fields); … … 29 29 $this->Confirm->User->id = (int) $data['Confirm']['user_id']; 30 30 31 if ( $this->Confirm->User->saveField('status', 1) ): 31 if ( $this->Confirm->User->saveField('active', 1) ): 32 $this->Confirm->del($data['Confirm']['id']); 32 33 $msg = 'The registration process has finished succesfully'; 33 34 else: 34 35 $msg = 'The registration process has failed miserably'; 35 36 endif; 36 $this->Confirm->del($data['Confirm']['id']);37 37 endif; 38 38 -
trunk/controllers/helps_controller.php
r137 r239 2 2 /** 3 3 * Chipotle Software 4 * Manuel Montoya 2002-200 74 * Manuel Montoya 2002-2009 5 5 * GPL manuel<at>mononeurona<dot>org 6 6 */ … … 10 10 class HelpsController extends AppController 11 11 { 12 public $helpers = array('Javascript', ' Ajax', 'Form', 'Fck');12 public $helpers = array('Javascript', 'Fck'); 13 13 14 public $components = array(' Security');14 public $components = array('Email'); 15 15 16 16 public function beforeFilter() 17 17 { 18 18 parent::beforeFilter(); 19 $this->Auth->allow(array('display', 'view', 'tour' ));19 $this->Auth->allow(array('display', 'view', 'tour', 'index')); 20 20 } 21 22 21 23 22 public function tour() … … 26 25 $this->pageTitle = 'Tu portal::MonoNeurona'; 27 26 } 27 28 public function display($a, $b, $c) 29 { 30 $url = '/'.$a .'/'.$b .'/'.$c; 31 $lang = $this->Auth->user('lang'); 32 33 $lang = !$lang ? 'en' : 'es'; 34 35 $this->layout = 'help'; 36 $this->pageTitle = 'Karamelo ' . __('Help', true); 37 $conditions = array('url'=>$url, 'lang'=> $lang); 38 $fields = array('help', 'title', 'url', 'lang'); 39 $this->set('data', $this->Help->find($conditions, $fields)); 40 } 41 42 public function index($set=null) 43 { 44 $lang = (Configure::read('Config.language')) ? Configure::read('Config.language') : 'en'; 45 $this->layout = ( isset($set) ) ? 'admin' : 'help'; //small window or admin panel? 46 $this->pageTitle = 'Karamelo '. __('Help', true); 47 $conditions = array('lang'=>$lang); 48 $fields = array('id','title','url'); 49 $order = 'title'; 50 $this->set('data', $this->Help->findAll($conditions, $fields, $order)); 51 } 52 53 public function view($help_id, $set = null) 54 { 55 $lang = (Configure::read('Config.language')) ? Configure::read('Config.language') : 'en'; 56 $this->layout = ( $set !== null) ? 'admin' : 'help'; //small window or admin panel? 57 $this->pageTitle = 'Karamelo '. __('Help', true); 58 $conditions = array('Help.id'=>$help_id); 59 $fields = array('id','title', 'help', 'lang'); 60 $this->set('data', $this->Help->find($conditions, $fields)); 61 } 62 28 63 29 64 /***=== ADMIN SECTION===**/ 65 //bug report 66 public function admin_newticket() 67 { 68 $this->layout = 'admin'; 69 $this->pageTitle = 'Centauro Bug Report'; 70 $conditions = array('lang'=>'en'); 71 $fields = array('help', 'url', 'lang'); 72 $this->set('data', $this->Help->findAll($conditions, $fields)); 73 } 74 75 public function admin_submit() 76 { 77 if ( !empty( $this->data['Help'] ) ): 78 $this->data['Help']['report'] = Sanitize::paranoid($this->data['Help']['report']); 79 $report = $this->Auth->user('username') .' with email '. $this->Auth->user('email') .', wrote: '; 80 81 $report .= $this->data['Help']['report'] .'. Kind: ' . $this->data['Help']['kind']; 82 83 if ( $this->__sendNewReport( $report ) ): 84 $this->msgFlash(__('Email sent, Thanks!', true), '/admin/entries/start'); 85 endif; 86 endif; 87 } 88 30 89 public function admin_display($path = null) 31 90 { … … 39 98 } 40 99 41 public function admin_add() 42 { 43 // adds new classroom to database 44 if (!empty($this->params['data'])) 45 { 46 47 48 Sanitize::clean($this->params['data']); //Hopefully this is enough 49 50 if ($this->Help->save($this->params['data'])) 51 { 52 //$this->set('data', $this->Help->index()); 53 $this->flash('Your classroom has been saved.','/vclassrooms/listing'); 54 } 55 } 56 else 57 { 58 $this->layout = 'admin'; 59 60 $this->Subject = new Subject; 61 62 $this->set('subjects', $this->Subject->generateList(null, 'title')); 63 64 $conditions = array("status"=>1); 65 66 $order = "order DESC"; 67 68 $O = $this->Help->field('order', $conditions, $order); 69 70 $Order = $O + 1; 71 72 $this->set('Order', $Order); 73 } 74 100 public function admin_edit($help_id = null) 101 { 102 $this->__chkGroup(); // admin user? 103 $this->layout = 'admin'; 104 if (!empty($this->data['Help'])): 105 $this->data['Help']['url'] = Sanitize::paranoid($this->data['Help']['url'], $this->para_allowed); 106 $this->data['Help']['title'] = Sanitize::paranoid($this->data['Help']['title'], $this->para_allowed); 107 108 if ( $this->Help->save($this->data) ): 109 if ($this->data['Help']['end'] == 0 && !isset($this->data['Help']['id'])): 110 $id = $this->Help->getLastInsertID(); 111 $return = '/admin/helps/edit/'.$id; 112 elseif ($this->data['Help']['end'] == 0 && isset($this->data['Help']['id'])): 113 $return = '/admin/helps/edit/'.$this->data['Help']['id']; 114 elseif($this->data['Help']['end'] == 1): 115 $return = '/admin/helps/listing'; 116 endif; 117 $this->msgFlash(__('Data saved', true), $return); 118 endif; 119 elseif($help_id != null && intval($help_id)): 120 $this->data = $this->Help->read(null, $help_id); 121 endif; 75 122 } 76 123 77 public function admin_edit($id = null) 78 { 79 80 if (empty($this->data)) 81 { 82 $this->layout = 'admin'; 83 84 $this->Help->id = $id; 85 86 $this->Subject = new Subject; 87 88 $this->set('subjects', $this->Subject->generateList()); 89 90 $this->data = $this->Help->read(); 91 } 92 else 93 { 94 if ($this->Help->save($this->data['Vclassroom'])) 95 { 96 $this->flash('Your virtual classroom has been updated.','/vclassrooms/listing'); 97 } 98 } 99 } 100 101 public function admin_delete($id) 102 { 103 // deletes task from database 104 $this->Help->del($id); 105 $this->flash('Your virtual classroom has been updated.','/vclassrooms/listing'); 106 } 124 public function admin_delete($help_id) 125 { 126 if ( $this->Help->del($help_id) ): 127 $this->msgFlash(__('Data removed', true),'/admin/helps/listing'); 128 endif; 129 } 130 131 // deliver a bug report 132 private function __sendNewReport($report) 133 { 134 $this->Email->to = 'mmontoya@gmail.com'; 135 $this->Email->bcc = array('contact@chipotle-software.com'); // note 136 // this could be just a string too 137 $this->Email->subject = 'Karamelo e-Learning:: bug report'; 138 $this->Email->replyTo = 'support@karamelo.org'; 139 $this->Email->from = 'Chipotle-software.com'; 140 $this->Email->template = 'report'; // note no '.ctp' 141 //Send as 'html', 'text' or 'both' (default is 'text') 142 $this->Email->sendAs = 'text'; // because we like to send pretty mail 143 //Set view variables as normal 144 $this->set('report', $report); 145 //Do not pass any args to send() 146 if ( $this->Email->send() ): 147 return true; 148 else: 149 return false; 150 endif; 151 } 107 152 108 153 } -
trunk/controllers/users_controller.php
r238 r239 72 72 public function register() 73 73 { 74 if ( $this->Auth->user('id')): 75 $this->msgFlash('You are already logged in', '/'); 76 endif; 74 77 $this->layout = 'portal'; 78 75 79 } 76 80 -
trunk/views/elements/themes_top.ctp
r178 r239 8 8 $html->link(__('Quotes', true), '/admin/quotes/listing'), 9 9 $html->link(__('Images', true), '/admin/images/listing'), 10 $html->link(__('Shares', true), '/admin/shares/listing') 10 $html->link(__('Shares', true), '/admin/shares/listing'), 11 $html->link(__('Logout', true), '/users/logout') 11 12 )); 12 13 else: -
trunk/views/layouts/admin.ctp
r213 r239 45 45 ?> 46 46 </div> 47 <div style="margin:0 0 0 60px;text-align:left;"> 48 <?php echo $this->element('admin_menu'); ?> 49 </div> 47 50 <div id="container"> 48 51 <div id="main-section" class="clearfix"> 49 <?php echo $content_for_layout ?> 52 <?php 53 echo $content_for_layout; 54 ?> 50 55 </div> 51 56 <div style="clear:both"></div> … … 56 61 </body> 57 62 </html> 58 -
trunk/views/layouts/portal.ctp
r225 r239 24 24 </head> 25 25 <body> 26 <?php $session->flash(); ?> 27 <script type="text/javascript"> 28 window.onload = timedMsg; 29 </script> 26 30 <?php echo $this->element('themes_top'); ?> 27 31 <table id="maintable"> -
trunk/webroot/css/cpanel.css
r213 r239 988 988 } 989 989 990 /* NAVIGATION MENU */ 991 992 /* Root = Horizontal, Secondary = Vertical */ 993 ul#navmenu { 994 margin: 0; 995 border: 0 none; 996 padding: 0; 997 width: 800px; /*For KHTML*/ 998 list-style: none; 999 height: 24px; 1000 } 1001 1002 ul#navmenu li { 1003 margin: 0; 1004 border: 0 none; 1005 padding: 0; 1006 float: left; /*For Gecko*/ 1007 display: inline; 1008 list-style: none; 1009 position: relative; 1010 height: 24px; 1011 } 1012 1013 ul#navmenu ul { 1014 margin: 0; 1015 border: 0 none; 1016 padding: 0; 1017 width: 160px; 1018 list-style: none; 1019 display: none; 1020 position: absolute; 1021 top: 24px; 1022 left: 0; 1023 } 1024 1025 ul#navmenu ul:after /*From IE 7 lack of compliance*/{ 1026 clear: both; 1027 display: block; 1028 font: 1px/0px serif; 1029 content: "."; 1030 height: 0; 1031 visibility: hidden; 1032 } 1033 1034 ul#navmenu ul li { 1035 width: 160px; 1036 float: left; /*For IE 7 lack of compliance*/ 1037 display: block !important; 1038 display: inline; /*For IE*/ 1039 } 1040 1041 /* Root Menu */ 1042 ul#navmenu a { 1043 border: 1px solid #FFF; 1044 border-right-color: #CCC; 1045 border-bottom-color: #CCC; 1046 padding: 0 6px; 1047 float: none !important; /*For Opera*/ 1048 float: left; /*For IE*/ 1049 display: block; 1050 background: #EEE; 1051 color: #666; 1052 font: bold 10px/22px Verdana, Arial, Helvetica, sans-serif; 1053 text-decoration: none; 1054 height: auto !important; 1055 height: 1%; /*For IE*/ 1056 } 1057 1058 /* Root Menu Hover Persistence */ 1059 ul#navmenu a:hover, 1060 ul#navmenu li:hover a, 1061 ul#navmenu li.iehover a { 1062 background: #CCC; 1063 color: #FFF; 1064 } 1065 1066 /* 2nd Menu */ 1067 ul#navmenu li:hover li a, 1068 ul#navmenu li.iehover li a { 1069 float: none; 1070 background: #EEE; 1071 color: #666; 1072 } 1073 1074 /* 2nd Menu Hover Persistence */ 1075 ul#navmenu li:hover li a:hover, 1076 ul#navmenu li:hover li:hover a, 1077 ul#navmenu li.iehover li a:hover, 1078 ul#navmenu li.iehover li.iehover a { 1079 background: #CCC; 1080 color: #FFF; 1081 } 1082 1083 /* 3rd Menu */ 1084 ul#navmenu li:hover li:hover li a, 1085 ul#navmenu li.iehover li.iehover li a { 1086 background: #EEE; 1087 color: #666; 1088 } 1089 1090 /* 3rd Menu Hover Persistence */ 1091 ul#navmenu li:hover li:hover li a:hover, 1092 ul#navmenu li:hover li:hover li:hover a, 1093 ul#navmenu li.iehover li.iehover li a:hover, 1094 ul#navmenu li.iehover li.iehover li.iehover a { 1095 background: #CCC; 1096 color: #FFF; 1097 } 1098 1099 /* 4th Menu */ 1100 ul#navmenu li:hover li:hover li:hover li a, 1101 ul#navmenu li.iehover li.iehover li.iehover li a { 1102 background: #EEE; 1103 color: #666; 1104 } 1105 1106 /* 4th Menu Hover */ 1107 ul#navmenu li:hover li:hover li:hover li a:hover, 1108 ul#navmenu li.iehover li.iehover li.iehover li a:hover { 1109 background: #CCC; 1110 color: #FFF; 1111 } 1112 1113 ul#navmenu ul ul, 1114 ul#navmenu ul ul ul { 1115 display: none; 1116 position: absolute; 1117 top: 0; 1118 left: 160px; 1119 } 1120 1121 /* Do Not Move - Must Come Before display:block for Gecko */ 1122 ul#navmenu li:hover ul ul, 1123 ul#navmenu li:hover ul ul ul, 1124 ul#navmenu li.iehover ul ul, 1125 ul#navmenu li.iehover ul ul ul { 1126 display: none; 1127 } 1128 1129 ul#navmenu li:hover ul, 1130 ul#navmenu ul li:hover ul, 1131 ul#navmenu ul ul li:hover ul, 1132 ul#navmenu li.iehover ul, 1133 ul#navmenu ul li.iehover ul, 1134 ul#navmenu ul ul li.iehover ul { 1135 display: block; 1136 } -
trunk/webroot/js/admin.js
r173 r239 95 95 var t=setTimeout("document.getElementById('flashMessage').style.display = 'none'", 2000); 96 96 } 97 -
trunk/webroot/js/myfunctions.js
r139 r239 2 2 window.onload = init; 3 3 var logged = false; 4 5 function timedMsg() 6 { 7 if (document.getElementById('flashMessage')) 8 var t=setTimeout("document.getElementById('flashMessage').style.display = 'none'", 2000); 9 } 4 10 5 11 function init() {
Note: See TracChangeset
for help on using the changeset viewer.
