Changeset 456
- Timestamp:
- 06/02/10 16:14:29 (20 months ago)
- Location:
- trunk
- Files:
-
- 15 edited
-
controllers/todos_controller.php (modified) (6 diffs)
-
controllers/topics_controller.php (modified) (3 diffs)
-
controllers/users_controller.php (modified) (4 diffs)
-
controllers/waydings_controller.php (modified) (1 diff)
-
index.php (modified) (1 diff)
-
views/elements/admin_menu.ctp (modified) (1 diff)
-
views/elements/themes_top.ctp (modified) (2 diffs)
-
views/elements/todos.ctp (modified) (1 diff)
-
views/layouts/portal.ctp (modified) (2 diffs)
-
views/todos/admin_edit.ctp (modified) (1 diff)
-
views/todos/admin_listing.ctp (modified) (5 diffs)
-
views/todos/updated.ctp (modified) (1 diff)
-
webroot/css.php (modified) (6 diffs)
-
webroot/index.php (modified) (1 diff)
-
webroot/test.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/controllers/todos_controller.php
r424 r456 38 38 } 39 39 40 /** 41 * Cron reminder 42 * @return void 43 * @accesss public 44 */ 40 45 public function reminders() # crontab every six hours: 1 6,12 * * * lynx -dum htt://server/todos/reminders > /dev/null 41 46 { … … 45 50 $data = $this->Todo->find('all', $params); 46 51 47 //exit(print_r($data));52 #exit(print_r($data)); 48 53 $k = 0; 49 54 foreach ($data as $val): 50 //echo print_r($val);51 $this->sendMail($val);55 # echo print_r($val); 56 $this->sendMail($val); 52 57 endforeach; 53 58 } … … 56 61 * Feeder 57 62 * @access public 63 * @return void 58 64 */ 59 65 public function rss($username) 60 66 { 61 $this->layout = 'rss';67 $this->layout = 'rss'; 62 68 63 69 $user_id = (int) $this->Todo->User->field('id', array('User.username'=>$username)); … … 100 106 $this->layout = 'ajax'; 101 107 if (!empty($this->data['Todo'])): 102 $this->data['Todo']['user_id'] = (int) $this->Auth->user('id'); 108 $this->data['Todo']['user_id'] = (int) $this->Auth->user('id'); 103 109 if ( $this->Todo->save($this->data)): 104 110 $params = array( … … 116 122 public function admin_listing($order_field = 'id') 117 123 { 118 $this->layout = 'admin'; 119 $this->pageTitle = $this->Auth->user('username') . 'TODOs'; 124 $this->layout = 'admin'; 120 125 $params = array( 121 126 'conditions' => array('Todo.user_id' => $this->Auth->user('id')), … … 158 163 if ($this->Todo->save($this->data)): 159 164 $this->msgFlash('ToDo has been changed','/admin/todos/listing'); 160 exit();165 return True; 161 166 endif; 162 167 } 163 168 169 /** 170 * Remove todo 171 * @return void 172 * @access public 173 */ 164 174 public function admin_delete($id) 165 175 { 166 if (isset($this->data['Todo']['get'])) // get indicate shows edit form action 167 { 168 $this->Todo->delete($id); 169 } 170 else 171 { 172 $this->Todo->delete($id); 173 $this->msgFlash('Todo has been deleted!', '/admin/todos/listing'); 174 exit(); 175 } 176 if ( $this->Todo->delete($id) ): 177 $msg = 'Todo has been deleted!'; 178 else: 179 $msg = 'Todo has NOT been deleted!'; 180 endif; 181 $this->msgFlash($msg, '/admin/todos/listing'); 176 182 } 177 183 } 178 # ? > 184 # ? > EOF -
trunk/controllers/topics_controller.php
r386 r456 199 199 } 200 200 } 201 /****=== 202 ADMIN SECTION 203 ==== ****/ 201 /****=== ADMIN SECTION ==== ****/ 204 202 205 203 public function admin_listing($order = null) … … 233 231 } 234 232 } 235 233 234 /** 235 * 236 */ 236 237 public function admin_delete($topic_id) 237 238 { … … 248 249 } 249 250 250 # ? > 251 # ? > EOF -
trunk/controllers/users_controller.php
r448 r456 222 222 $this->set(compact('data')); 223 223 } 224 224 225 /** 226 * Remove user 227 * @access public 228 * @return void 229 */ 225 230 public function admin_delete($user_id) 226 231 { 227 232 if ($this->User->delete($user_id) ): 228 $this->msgFlash('User deleted', '/admin/users/listing'); 233 $msg = 'User deleted'; 234 else: 235 $msg = 'User NOT deleted'; 229 236 endif; 237 $this->msgFlash($msg, '/admin/users/listing'); 230 238 } 231 239 … … 245 253 $this->User->id = (int) $user_id; 246 254 if ($this->User->saveField('active', $new_status)): 247 $this->msgFlash('User status changed', '/admin/users/listing/'); 248 endif; 249 } 250 251 /**** AVATAR ***/ 255 $this->msgFlash('User status changed', '/admin/users/listing/'); 256 endif; 257 } 258 259 /** 260 * AVATAR 261 ***/ 252 262 public function admin_avatar() 253 263 { 254 //die(print_r($this->data));264 #die(print_r($this->data)); 255 265 $this->layout = 'admin'; 256 266 if (!empty($this->data) && is_uploaded_file($this->data['User']['file']['tmp_name'])): 257 267 $this->flash('Error uploading image, please contact the support team', '/admin/users/edit'); 258 268 endif; 259 #Sanitize::clean($this->data); //Hopefully this is enough260 269 261 270 /** SUBMITTED INFORMATION - use what you need … … 285 294 286 295 if ( $imgfile_size > $maxfilesize): 287 $msg = "ERROR The image is too big. Bigger than 2.0 MB Current size: " . $imgfile_size;288 /** delete uploaded file */289 unlink($imgfile);290 die( $this->flash($msg,'/users/edit/'.$this->Auth->user('id')) );296 $msg = "ERROR The image is too big. Bigger than 2.0 MB Current size: " . $imgfile_size; 297 /** delete uploaded file */ 298 unlink($imgfile); 299 die( $this->flash($msg,'/users/edit/'.$this->Auth->user('id')) ); 291 300 endif; 292 301 … … 319 328 } 320 329 } 321 # ? > 330 # ? > EOF -
trunk/controllers/waydings_controller.php
r386 r456 135 135 public function admin_delete($wayd_id) 136 136 { 137 //deletes task from database137 # deletes task from database 138 138 if ($this->Wayding->delete($wayd_id)): 139 $this->msgFlash('Data removed', '/admin/waydings/listing'); 139 $msg = 'Data removed'; 140 else: 141 $msg = 'Data NOT removed'; 140 142 endif; 141 } 143 $this->msgFlash($msg, '/admin/waydings/listing'); 144 } 142 145 } 143 # ? > 146 147 # ? > EOF -
trunk/index.php
r379 r456 17 17 */ 18 18 require 'webroot' . DIRECTORY_SEPARATOR . 'index.php'; 19 ?> -
trunk/views/elements/admin_menu.ctp
r450 r456 6 6 $this->Html->link(__('Podcasts', True), '/admin/podcasts/listing'), 7 7 $this->Html->link(__('Bookmarks', True), '/admin/bookmarks/listing'), 8 $this->Html->link('Mis pendientes', '/admin/todos/listing'), 8 9 $this->Html->link(__('Google Maps', True), '/admin/markers/index') 9 10 ), -
trunk/views/elements/themes_top.ctp
r399 r456 1 1 <?php 2 2 # Chipotle Software GPLv3 2002-2010 3 if ($ session->read('Auth.User.username')): # User is logged in3 if ($this->Session->read('Auth.User.username')): # User is logged in 4 4 $list = array($this->Html->link('MyMONO', '/admin/entries/start') => array( 5 5 $this->Html->link(__('New blog Entry', true), '/admin/entries/edit'), 6 6 $this->Html->link(__('Submit Quick', true), '/admin/quicks/listing'), 7 7 $this->Html->link(__('Submit New', true), '/admin/news/edit'), 8 $this->Html->link(__(' Quotes', true), '/admin/quotes/listing'),8 $this->Html->link(__('Cosas pendientes', true), '/admin/todos/listing'), 9 9 $this->Html->link(__('Images', true), '/admin/images/listing'), 10 10 $this->Html->link(__('Shares', true), '/admin/shares/listing'), … … 25 25 array_push($list, $more); 26 26 echo $this->Html->nestedList($list, array('id'=>'navmenu')); 27 # ? > 27 28 # ? > EOF -
trunk/views/elements/todos.ctp
r422 r456 12 12 <?php 13 13 $todos = $this->requestAction('todos/chkTodos'); 14 echo $this->Html->div('element', Null, array('style'=>'background:#fff;')); 15 echo$this->Js->link($this->Html->image('static/todos.jpg', array('alt'=>__('Publish Quick New', True), 'title'=>__('Publish Quick New', True))), 16 '/admin/todos/new', 17 array('update' => '#ts', 18 'evalScripts' => True, 19 'escape' => False, 20 'before' => $gags->ajaxBefore('ts', 'lquick'), 21 'complete' => $gags->ajaxComplete('ts', 'lquick') 22 )); 23 echo $gags->ajaxDiv('ts', array('style'=>'padding:3px')).$gags->divEnd('ts'); 24 echo $gags->imgLoad('lquick'); 14 15 echo $this->Html->div('element', Null, array('style'=>'background:#fff;padding:5px;margin:6px')); 16 echo $this->Html->image('static/todos.jpg', array('alt'=>'My TODOs', 'title'=>'My TODOs')); 25 17 #die(debug($todos)); 26 18 foreach ($todos as $v): 27 echo $ gags->ajaxDiv('td'.$v['Todo']['id'], array('class'=>'editable_textarea')).$v['Todo']['name'].$gags->divEnd('td'.$v['Todo']['id']);19 echo $this->Html->div('todo_'.$v['Todo']['priority'], $v['Todo']['name'], array('id'=>'td'.$v['Todo']['id'])); 28 20 endforeach; 21 22 echo $this->Html->link('Agregar pendiente', '/admin/todos/listing', array('style'=>'font-size:7pt;padding:6px;')); 29 23 echo '</div>'; 30 24 31 echo $this->Js->writeBuffer(); 32 # ? > 25 # ? > EOF -
trunk/views/layouts/portal.ctp
r451 r456 39 39 <div style="text-align:center;margin:3px 0 3px 0;padding:2px;"> 40 40 <?php 41 echo $this->Html->div('sidepanel', $this->element('lastentries'));42 echo $this->element('adsense');43 41 if ( $session->check('Auth.User') ): 44 42 echo $this->element('todos'); … … 46 44 echo $this->element('login', array('cache' => True)); 47 45 endif; 46 echo $this->Html->div('sidepanel', $this->element('lastentries')); 47 echo $this->element('adsense'); 48 48 echo $this->Html->div('sidepanel', $this->element('lastdownloads'));/*, array('cache' => True));*/ 49 49 -
trunk/views/todos/admin_edit.ctp
r393 r456 1 <?php 2 //exit(print_r($data));3 echo $this->Form->create('/admin/todos/edit/','post');4 echo $this->Form->hidden('Todo/id');1 <?php 2 #exit(print_r($data)); 3 echo $this->Form->create('Todo'); 4 echo $this->Form->hidden('Todo.id'); 5 5 ?> 6 7 6 <fieldset style="width:370px;background-color:transparent"> 8 7 <legend>Edit TODO</legend> 9 8 <table> 9 <?php 10 echo $this->Form->input('Todo.name', array('size' => 25, 'maxlength' => 80)); 11 echo $this->Form->input('Todo.deadline', array('type'=>'date','label'=>__('Dead line', True), 'dateFormat'=>'DMY')); 12 echo $this->Form->input('Todo.priority', array('options'=>range(0,5))); 13 echo $this->Form->input('Todo.task', array('cols'=>33, 'rows'=>7)); 14 echo $this->Form->input('Todo.completed', array('value'=>'1', 'type'=>'checkbox')); 15 echo $this->Form->end('Save'); 16 echo '</fieldset>'; 10 17 11 <?php 12 echo $this->Form->label('Todo/name', 'Name:' ); 13 echo $this->Form->input('Todo/name', array('size' => 25, 'maxlength' => 80)); 14 echo $this->Form->error('Todo/name', 'Title is required.'); 15 16 echo $this->Form->label('Todo/priority', 'Priority:' ); 17 18 $priorities = array("1"=>"1", "2"=>"2", "3"=>"3", "4"=>"4", "5"=>"5"); 19 20 echo $this->Html->selectTag('Todo/priority', $priorities, null, null, null, false); 21 22 echo $this->Form->label('Todo/task', 'Task:'); 23 echo $this->Form->textarea('Todo/task', array("cols"=>33, "rows"=>7)); 24 echo $this->Form->error('Todo/task', 'Task is required.'); 25 26 echo $this->Form->label('Todo/completed', 'Completed:' ) . $this->Form->checkbox('Todo/completed', array('value'=>'1')); 27 28 echo $this->Form->end('Save'); 29 ?> 30 </fieldset> 31 </form> 32 <p style="text-align:center"> 33 <?php echo $this->Html->link('Cancel', '#', array("onclick"=>"javascript:getElementById('editTodoDiv').style.display = \"none\";"));?> 34 </p> 18 echo $this->Html->link('Cancel', '#', array('onclick'=>"javascript:getElementById('editTodoDiv').style.display = \"none\";")); 35 19 20 # ? > EOF 21 22 -
trunk/views/todos/admin_listing.ctp
r424 r456 1 1 <?php 2 $this->set('title_for_layout', 'My TODOs'); 2 3 echo $this->Html->div('title_section', 'My TO-DOs'); 3 4 … … 6 7 '/todos/rss/'.$session->read('Auth.User.username'), array('escape'=>False)); 7 8 8 echo $gags->imgLoad( );9 echo $gags->imgLoad('loading'); 9 10 10 11 echo '</div>'; … … 29 30 endif; 30 31 31 echo $this->Form->create(); 32 echo $this->Form->create(); 32 33 ?> 33 34 <fieldset> 34 35 <legend>Quick add</legend> 35 <?php36 <?php 36 37 echo $this->Form->input('Todo.name', array('size' => 35, 'maxlength'=>80)); 37 echo $this->Js->submit('Save', array('url' => '/admin/todos/ edit/',38 echo $this->Js->submit('Save', array('url' => '/admin/todos/add/', 38 39 'update' => '#todolist', 39 40 'evalScripts' => True, … … 48 49 <table class="tbadmin" style="width:100%"> 49 50 <?php 50 $th = array ('Edit', 'Name', 'Priority', 'Deadline', 'Completed', 'Created', 'Delete');51 $th = array('Edit', 'Name', 'Priority', 'Deadline', 'Completed', 'Created', 'Delete'); 51 52 echo $this->Html->tableHeaders($th); 52 53 foreach ($data as $val): … … 82 83 <?php 83 84 echo $gags->ajaxDiv('editTodoDiv', array('class'=>'box', 'style'=>'display:none;')).$gags->divEnd('editTodoDiv'); 84 ?> 85 # ? > EOF -
trunk/views/todos/updated.ctp
r416 r456 4 4 echo $this->Html->tableHeaders($th); 5 5 foreach ($data as $val): 6 $completed = ($val['Todo']['completed'] == 1) ? 'Completed' : 'Pending';7 $tr = array(8 $this->Form->create( null,'post') . $this->Form->hidden('Todo/id', array('value'=>$val['Todo']['id'])) . $this->Form->hidden('Todo/get', array("value" => 1)).6 $completed = ($val['Todo']['completed'] == 1) ? 'Completed' : 'Pending'; 7 $tr = array( 8 $this->Form->create('Todo').$this->Form->hidden('Todo.id',array('value'=>$val['Todo']['id'])).$this->Form->hidden('Todo.get',array('value'=>1)). 9 9 $this->Js->submit('Edit', array('url' => '/admin/todos/edit/', 10 10 'update' => '#editTodoDiv', 11 11 'evalScripts' => True, 12 'before' => $gags->ajaxBefore('editTodoDiv', 'charging'), 13 'complete' => $gags->ajaxComplete())); 12 'before' => $gags->ajaxBefore('todolist'), 13 'complete' => $gags->ajaxComplete('todolist'))), 14 15 $val['Todo']['name'], 16 $val['Todo']['priority'], 17 $val['Todo']['deadline'], 18 $html->link($completed,'/admin/todos/change/'.$val['Todo']['id'].'/'.$val['Todo']['completed']), 19 $val['Todo']['created'], 20 $gags->confirmDel($val['Todo']['id'], 'todos') ); 21 22 echo $html->tableCells($tr,$gags->aRow, $gags->eRow); 14 23 endforeach; 15 ?> 16 </table> 24 echo '</table>'; 17 25 26 echo $this->Js->writeBuffer(); 27 # ? > EOF -
trunk/webroot/css.php
r383 r456 1 1 <?php 2 2 /** 3 * Short description for file.3 * CSS helping functions 4 4 * 5 5 * PHP versions 4 and 5 … … 24 24 25 25 /** 26 * En ter description here...26 * Ensure required classes are available. 27 27 */ 28 28 if (!class_exists('File')) { 29 require LIBS . 'file.php';29 uses('file'); 30 30 } 31 31 32 32 /** 33 * Enter description here...33 * Make clean CSS 34 34 * 35 35 * @param unknown_type $path … … 46 46 return $output; 47 47 } 48 49 48 /** 50 * Enter description here...49 * Write CSS cache 51 50 * 52 51 * @param unknown_type $path … … 63 62 64 63 if (preg_match('|\.\.|', $url) || !preg_match('|^ccss/(.+)$|i', $url, $regs)) { 65 exit('Wrong file name.');64 die('Wrong file name.'); 66 65 } 67 66 … … 71 70 72 71 if (!file_exists($filepath)) { 73 exit('Wrong file name.');72 die('Wrong file name.'); 74 73 } 75 74 … … 92 91 header("Date: " . date("D, j M Y G:i:s ", $templateModified) . 'GMT'); 93 92 header("Content-Type: text/css"); 94 header("Expires: " . gmdate("D, jM Y H:i:s", time() + DAY) . " GMT");93 header("Expires: " . gmdate("D, d M Y H:i:s", time() + DAY) . " GMT"); 95 94 header("Cache-Control: max-age=86400, must-revalidate"); // HTTP/1.1 96 95 header("Pragma: cache"); // HTTP/1.0 97 96 print $output; 98 ?> -
trunk/webroot/index.php
r433 r456 83 83 $Dispatcher->dispatch(); 84 84 } 85 if (Configure::read() > 0) {86 echo "<!-- " . round(getMicrotime() - $TIME_START, 4) . "s -->";87 }88 ?> -
trunk/webroot/test.php
r383 r456 5 5 * PHP versions 4 and 5 6 6 * 7 * CakePHP(tm) Tests <http s://trac.cakephp.org/wiki/Developement/TestSuite>8 * Copyright 2005-20 09, Cake Software Foundation, Inc. (http://cakefoundation.org)7 * CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing> 8 * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) 9 9 * 10 10 * Licensed under The Open Group Test Suite License 11 11 * Redistributions of files must retain the above copyright notice. 12 12 * 13 * @copyright Copyright 2005-20 09, Cake Software Foundation, Inc. (http://cakefoundation.org)14 * @link http s://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests13 * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) 14 * @link http://book.cakephp.org/view/1196/Testing 15 15 * @package cake 16 * @subpackage cake. cake.tests.libs16 * @subpackage cake.app.webroot 17 17 * @since CakePHP(tm) v 1.2.0.4433 18 18 * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License … … 51 51 */ 52 52 if (!defined('CAKE_CORE_INCLUDE_PATH')) { 53 define('CAKE_CORE_INCLUDE_PATH', DS . 'myDocs' . DS . 'devels');53 define('CAKE_CORE_INCLUDE_PATH', ROOT); 54 54 } 55 55 … … 93 93 $Dispatcher = new CakeTestSuiteDispatcher(); 94 94 $Dispatcher->dispatch(); 95 96 ?>
Note: See TracChangeset
for help on using the changeset viewer.
