Changeset ee4c2b7fedeac65c7bf3af2de933963981702433
- Timestamp:
- 01/28/12 16:33:14 (4 months ago)
- Children:
- a42ace5079b711cff1c0078740ad0bb7a735e0fc
- Parents:
- 0fb8d7c9464f805d666366ee2f31f047ee138b3a
- git-committer:
- Xemle <xemle@phtagr.org> / 2012-01-28T16:33:14Z+0100
- Files:
-
- 74 modified
-
Controller/AppController.php (modified) (1 diff)
-
Controller/BrowserController.php (modified) (19 diffs)
-
Controller/CommentsController.php (modified) (8 diffs)
-
Controller/Component/BaseFilterComponent.php (modified) (1 diff)
-
Controller/Component/FileManagerComponent.php (modified) (8 diffs)
-
Controller/Component/FilterManagerComponent.php (modified) (6 diffs)
-
Controller/Component/GpsFilterComponent.php (modified) (3 diffs)
-
Controller/Component/ImageFilterComponent.php (modified) (7 diffs)
-
Controller/Component/MenuComponent.php (modified) (1 diff)
-
Controller/Component/SimpleImageFilterComponent.php (modified) (3 diffs)
-
Controller/Component/UploadComponent.php (modified) (1 diff)
-
Controller/Component/VideoFilterComponent.php (modified) (12 diffs)
-
Controller/Component/WebdavServerComponent.php (modified) (3 diffs)
-
Controller/ExplorerController.php (modified) (35 diffs)
-
Controller/GroupsController.php (modified) (15 diffs)
-
Controller/GuestsController.php (modified) (12 diffs)
-
Controller/HomeController.php (modified) (1 diff)
-
Controller/ImagesController.php (modified) (10 diffs)
-
Controller/OptionsController.php (modified) (5 diffs)
-
Controller/SetupController.php (modified) (9 diffs)
-
Controller/SystemController.php (modified) (5 diffs)
-
Controller/UsersController.php (modified) (24 diffs)
-
Model/AppModel.php (modified) (1 diff)
-
Model/MyFile.php (modified) (1 diff)
-
View/Browser/folder.ctp (modified) (1 diff)
-
View/Browser/sync.ctp (modified) (1 diff)
-
View/Browser/upload.ctp (modified) (1 diff)
-
View/Comments/index.ctp (modified) (4 diffs)
-
View/Comments/rss.ctp (modified) (1 diff)
-
View/Elements/Explorer/description.ctp (modified) (1 diff)
-
View/Elements/Explorer/media.ctp (modified) (1 diff)
-
View/Elements/Explorer/menu.ctp (modified) (4 diffs)
-
View/Elements/comment.ctp (modified) (3 diffs)
-
View/Elements/footer.ctp (modified) (1 diff)
-
View/Elements/single_acl_form.ctp (modified) (1 diff)
-
View/Elements/single_meta_form.ctp (modified) (1 diff)
-
View/Explorer/autocomplete.ctp (modified) (1 diff)
-
View/Explorer/editacl.ctp (modified) (1 diff)
-
View/Explorer/editmeta.ctp (modified) (1 diff)
-
View/Explorer/index.ctp (modified) (3 diffs)
-
View/Explorer/media.ctp (modified) (1 diff)
-
View/Explorer/points.ctp (modified) (1 diff)
-
View/Explorer/quicksearch.ctp (modified) (5 diffs)
-
View/Explorer/rss.ctp (modified) (1 diff)
-
View/Explorer/updatemeta.ctp (modified) (1 diff)
-
View/Groups/autocomplete.ctp (modified) (1 diff)
-
View/Groups/create.ctp (modified) (1 diff)
-
View/Groups/dashboard_create.ctp (modified) (6 diffs)
-
View/Groups/dashboard_index.ctp (modified) (6 diffs)
-
View/Groups/dashboard_manage.ctp (modified) (12 diffs)
-
View/Groups/dashboard_search.ctp (modified) (6 diffs)
-
View/Groups/edit.ctp (modified) (1 diff)
-
View/Groups/index.ctp (modified) (3 diffs)
-
View/Groups/listmembers.ctp (modified) (4 diffs)
-
View/Groups/view.ctp (modified) (9 diffs)
-
View/Guests/autocomplete.ctp (modified) (1 diff)
-
View/Guests/edit.ctp (modified) (5 diffs)
-
View/Guests/index.ctp (modified) (3 diffs)
-
View/Guests/links.ctp (modified) (3 diffs)
-
View/Helper/ExplorerMenuHelper.php (modified) (2 diffs)
-
View/Helper/FlowplayerHelper.php (modified) (1 diff)
-
View/Helper/ImageDataHelper.php (modified) (3 diffs)
-
View/Helper/SearchHelper.php (modified) (1 diff)
-
View/Images/view.ctp (modified) (6 diffs)
-
View/Options/rss.ctp (modified) (1 diff)
-
View/System/delete_unused_meta_data.ctp (modified) (1 diff)
-
View/Users/admin_edit.ctp (modified) (3 diffs)
-
View/Users/admin_index.ctp (modified) (2 diffs)
-
View/Users/admin_password.ctp (modified) (1 diff)
-
View/Users/admin_path.ctp (modified) (3 diffs)
-
View/Users/admin_register.ctp (modified) (1 diff)
-
View/Users/index.ctp (modified) (2 diffs)
-
View/Users/view.ctp (modified) (5 diffs)
-
View/home/index.ctp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
Controller/AppController.php
r3605ef4 ree4c2b7f 38 38 parent::beforeFilter(); 39 39 $this->_checkSession(); 40 $this->Feed->add('/explorer/rss', array('title' => __('Recent photos' , true)));41 $this->Feed->add('/explorer/media', array('title' => __('Media RSS of recent photos' , true), 'id' => 'gallery'));42 $this->Feed->add('/comment/rss', array('title' => __('Recent comments' , true)));40 $this->Feed->add('/explorer/rss', array('title' => __('Recent photos'))); 41 $this->Feed->add('/explorer/media', array('title' => __('Media RSS of recent photos'), 'id' => 'gallery')); 42 $this->Feed->add('/comment/rss', array('title' => __('Recent comments'))); 43 43 44 44 $this->_configureEmail(); -
Controller/BrowserController.php
r3605ef4 ree4c2b7f 36 36 parent::beforeFilter(); 37 37 $this->subMenu = array( 38 'import' => __("Import Files" , true),39 'upload' => __("Upload" , true),40 'sync' => __("Meta Data Sync" , true),38 'import' => __("Import Files"), 39 'upload' => __("Upload"), 40 'sync' => __("Meta Data Sync"), 41 41 ); 42 42 … … 53 53 } 54 54 55 $this->pageTitle = __('My Files' , true);55 $this->pageTitle = __('My Files'); 56 56 $this->layout = 'backend'; 57 57 } … … 265 265 function import() { 266 266 $path = $this->_getPathFromUrl(); 267 if (empty($this-> data)) {267 if (empty($this->request->data)) { 268 268 Logger::warn("Empty post data"); 269 269 $this->redirect('index/'.$path); … … 274 274 $files = array(); 275 275 $toRead = array(); 276 foreach ($this-> data['Browser']['import'] as $file) {276 foreach ($this->request->data['Browser']['import'] as $file) { 277 277 if (!$file) { 278 278 continue; … … 298 298 } 299 299 } 300 $this->Session->setFlash( sprintf(__("Imported %d files (%d) errors)", true), $readCount, $errorCount));300 $this->Session->setFlash(__("Imported %d files (%d) errors)", $readCount, $errorCount)); 301 301 302 302 $this->redirect('index/'.$path); … … 313 313 Logger::warn("Deny access to file: $fsPath"); 314 314 } else { 315 $this->Session->setFlash( sprintf(__("Media %d was unlinked successfully", true), $file['File']['media_id']));315 $this->Session->setFlash(__("Media %d was unlinked successfully", $file['File']['media_id'])); 316 316 $this->Media->unlinkFile($file['File']['media_id'], $file['File']['id']); 317 317 } … … 330 330 if ($this->FileManager->delete($fsPath)) { 331 331 if ($isDir) { 332 $this->Session->setFlash(__('Deleted directory successfully' , true));332 $this->Session->setFlash(__('Deleted directory successfully')); 333 333 } else { 334 $this->Session->setFlash(__('Deleted file successfully' , true));334 $this->Session->setFlash(__('Deleted file successfully')); 335 335 } 336 336 } else { 337 $this->Session->setFlash(__('Could not delete file or directory' , true));337 $this->Session->setFlash(__('Could not delete file or directory')); 338 338 } 339 339 } … … 385 385 $data['unsynced'] = $this->Media->find('count', array('conditions' => $conditions)); 386 386 } 387 $this-> data = $data;387 $this->request->data = $data; 388 388 } 389 389 … … 391 391 $user = $this->getUser(); 392 392 $userId = $this->getUserId(); 393 $this-> data = $user;393 $this->request->data = $user; 394 394 $external = (FILE_FLAG_EXTERNAL); 395 395 … … 419 419 if (!$fsPath) { 420 420 Logger::warn("Invalid path to create folder"); 421 $this->Session->setFlash(__("Invalid path to create folder" , true));421 $this->Session->setFlash(__("Invalid path to create folder")); 422 422 $this->redirect("index"); 423 423 } 424 424 if ($this->FileManager->isExternal($fsPath)) { 425 $this->Session->setFlash( sprintf(__("Could not create folder here: %s", true), $path));425 $this->Session->setFlash(__("Could not create folder here: %s", $path)); 426 426 Logger::warn("Could not create folder in external path: $fsPath"); 427 427 $this->redirect("index/".$path); 428 428 } 429 429 430 if (!empty($this-> data['Folder']['name'])) {430 if (!empty($this->request->data['Folder']['name'])) { 431 431 $folder = new Folder($fsPath); 432 $name = $this-> data['Folder']['name'];432 $name = $this->request->data['Folder']['name']; 433 433 434 434 $newFolder = Folder::slashTerm($fsPath).$name; … … 439 439 } else { 440 440 Logger::err("Could not create folder $name in $fsPath"); 441 $this->Session->setFlash(__("Could not create folder" , true));441 $this->Session->setFlash(__("Could not create folder")); 442 442 $this->redirect('folder/'.$path); 443 443 } … … 456 456 return false; 457 457 } elseif (!$this->FileManager->canWrite($this->Upload->getSize())) { 458 $this->Session->setFlash(__("Your upload quota is exceeded" , true));458 $this->Session->setFlash(__("Your upload quota is exceeded")); 459 459 Logger::warn("User upload quota exceeded. Upload denied."); 460 460 return false; … … 563 563 if (!$fsPath) { 564 564 Logger::warn("Invalid path for upload"); 565 $this->Session->setFlash(__("Invalid path for upload" , true));565 $this->Session->setFlash(__("Invalid path for upload")); 566 566 $this->redirect("index"); 567 567 } 568 568 // Check for internal path 569 569 if ($this->FileManager->isExternal($fsPath)) { 570 $this->Session->setFlash( sprintf(__("Could not upload here: %s", true), $path));570 $this->Session->setFlash(__("Could not upload here: %s", $path)); 571 571 Logger::warn("Could not upload in external path: $fsPath"); 572 572 $this->redirect("index/".$path); 573 573 } 574 if (!empty($this-> data) && $this->Upload->isUpload()) {574 if (!empty($this->request->data) && $this->Upload->isUpload()) { 575 575 $files = $this->_upload($fsPath); 576 576 577 577 $fileCount = count($files); 578 578 $extractedCount = 0; 579 if ($this-> data['File']['extract']) {579 if ($this->request->data['File']['extract']) { 580 580 $zips = $this->_extract($fsPath, $files); 581 581 if ($zips) { … … 589 589 } 590 590 if ($extractedCount) { 591 $this->Session->setFlash( sprintf(__("Uploaded %d and %d extraced file(s)", true), $fileCount, $extractedCount));591 $this->Session->setFlash(__("Uploaded %d and %d extraced file(s)", $fileCount, $extractedCount)); 592 592 } else { 593 $this->Session->setFlash( sprintf(__("Uploaded %d file(s)", true), $fileCount));593 $this->Session->setFlash(__("Uploaded %d file(s)", $fileCount)); 594 594 } 595 595 } … … 602 602 if (!$root) { 603 603 Logger::err("Invalid user upload directory"); 604 $this->Session->setFlash(__("Error: Invalid upload directory" , true));604 $this->Session->setFlash(__("Error: Invalid upload directory")); 605 605 return false; 606 606 } … … 610 610 if (!$folder) { 611 611 Logger::err("Daily upload directory not created"); 612 $this->Session->setFlash(__("Error: Invalid upload directory" , true));612 $this->Session->setFlash(__("Error: Invalid upload directory")); 613 613 return false; 614 614 } … … 617 617 618 618 function quickupload() { 619 if (!empty($this-> data)) {619 if (!empty($this->request->data)) { 620 620 if (!$this->Upload->isUpload()) { 621 621 Logger::info("No upload data"); 622 $this->Session->setFlash(__("No files uploaded or upload errors" , true));622 $this->Session->setFlash(__("No files uploaded or upload errors")); 623 623 $this->redirect($this->action); 624 624 } … … 637 637 } 638 638 if (!$files) { 639 $this->Session->setFlash(__("No files uploaded" , true));639 $this->Session->setFlash(__("No files uploaded")); 640 640 $this->redirect($this->action); 641 641 } else { … … 645 645 $readed = $this->FilterManager->readFiles($files); 646 646 $errors = $this->FilterManager->errors; 647 $this->Session->setFlash( sprintf(__("Uploaded %d files with %d errors.", true), count($readed), count($errors)));647 $this->Session->setFlash(__("Uploaded %d files with %d errors.", count($readed), count($errors))); 648 648 $this->set('imports', $readed); 649 649 $this->set('errors', $errors); -
Controller/CommentsController.php
r1a41cea ree4c2b7f 55 55 function view($id = null) { 56 56 if (!$id) { 57 $this->Session->setFlash(__('Invalid Comment.' , true));57 $this->Session->setFlash(__('Invalid Comment.')); 58 58 $this->redirect(array('action'=>'index')); 59 59 } … … 62 62 63 63 function add() { 64 if (!empty($this-> data) && isset($this->data['Media']['id'])) {65 $mediaId = intval($this-> data['Media']['id']);64 if (!empty($this->request->data) && isset($this->request->data['Media']['id'])) { 65 $mediaId = intval($this->request->data['Media']['id']); 66 66 $user = $this->getUser(); 67 67 $userId = $this->getUserId(); … … 78 78 79 79 // Check capatcha if required 80 if (($auth & COMMENT_AUTH_CAPTCHA) > 0 && (!$this->Session->check('captcha') || $this-> data['Captcha']['verification'] != $this->Session->read('captcha'))) {80 if (($auth & COMMENT_AUTH_CAPTCHA) > 0 && (!$this->Session->check('captcha') || $this->request->data['Captcha']['verification'] != $this->Session->read('captcha'))) { 81 81 $this->Session->setFlash("Verification failed"); 82 Logger::warn("Captcha verification failed: ".$this-> data['Captcha']['verification']." != ".$this->Session->read('captcha'));82 Logger::warn("Captcha verification failed: ".$this->request->data['Captcha']['verification']." != ".$this->Session->read('captcha')); 83 83 $this->Session->delete('captcha'); 84 $this->Session->write('Comment.data', $this-> data);84 $this->Session->write('Comment.data', $this->request->data); 85 85 $this->Session->write('Comment.validationErrors', $this->Comment->validationErrors); 86 86 $this->redirect("/images/view/$mediaId/{$this->namedArgs}"); … … 102 102 103 103 $this->Comment->create(); 104 $this-> data['Comment']['media_id'] = $mediaId;105 $this-> data['Comment']['date'] = date("Y-m-d H:i:s", time());104 $this->request->data['Comment']['media_id'] = $mediaId; 105 $this->request->data['Comment']['date'] = date("Y-m-d H:i:s", time()); 106 106 uses('Sanitize'); 107 $this-> data['Comment']['text'] = Sanitize::html($this->data['Comment']['text']);107 $this->request->data['Comment']['text'] = Sanitize::html($this->request->data['Comment']['text']); 108 108 if (($auth & COMMENT_AUTH_NAME) == 0) { 109 $this-> data['Comment']['user_id'] = $user['User']['id'];110 $this-> data['Comment']['name'] = $user['User']['username'];111 $this-> data['Comment']['email'] = $user['User']['email'];112 } 113 if ($this->Comment->save($this-> data)) {109 $this->request->data['Comment']['user_id'] = $user['User']['id']; 110 $this->request->data['Comment']['name'] = $user['User']['username']; 111 $this->request->data['Comment']['email'] = $user['User']['email']; 112 } 113 if ($this->Comment->save($this->request->data)) { 114 114 $commentId = $this->Comment->getLastInsertID(); 115 $this->Session->setFlash(__('The Comment has been saved' , true));115 $this->Session->setFlash(__('The Comment has been saved')); 116 116 Logger::info("New comment of media $mediaId"); 117 117 // Send email notification of other media owners … … 121 121 $this->_sendNotifies($mediaId, $commentId); 122 122 } else { 123 $this->Session->setFlash(__('The Comment could not be saved. Please, try again.' , true));123 $this->Session->setFlash(__('The Comment could not be saved. Please, try again.')); 124 124 Logger::err("Could not save comment to media $mediaId"); 125 125 Logger::trace($this->Comment->validationErrors); 126 $this->Session->write('Comment.data', $this-> data);126 $this->Session->write('Comment.data', $this->request->data); 127 127 $this->Session->write('Comment.validationErrors', $this->Comment->validationErrors); 128 128 } … … 219 219 function delete($id = null) { 220 220 if (!$id) { 221 $this->Session->setFlash(__('Invalid id for Comment' , true));221 $this->Session->setFlash(__('Invalid id for Comment')); 222 222 $this->redirect("/explorer"); 223 223 } … … 233 233 if ((isset($comment['User']['id']) && $comment['User']['id'] == $userId) || ($comment['Media']['user_id'] == $userId) || ($this->getUserRole() == ROLE_ADMIN)) { 234 234 if ($this->Comment->delete($id)) { 235 $this->Session->setFlash(__('Comment deleted' , true));235 $this->Session->setFlash(__('Comment deleted')); 236 236 Logger::info("Delete comment {$comment['Comment']['id']} of media {$comment['Media']['id']}"); 237 237 } … … 250 250 $this->layoutPath = 'rss'; 251 251 $conditions = $this->Media->buildAclConditions($this->getUser()); 252 $this-> data = $this->Comment->find('all', array('conditions' => $conditions, 'order' => 'Comment.date DESC', 'limit' => 20));252 $this->request->data = $this->Comment->find('all', array('conditions' => $conditions, 'order' => 'Comment.date DESC', 'limit' => 20)); 253 253 254 254 if (Configure::read('debug') > 1) { -
Controller/Component/BaseFilterComponent.php
r3605ef4 ree4c2b7f 40 40 } 41 41 $this->Manager =& $manager; 42 $this->Media =& $manager->controller->Media; 43 $this->MyFile =& $manager->controller->MyFile; 42 44 return true; 43 45 } -
Controller/Component/FileManagerComponent.php
r3605ef4 ree4c2b7f 33 33 $this->MyFile = $controller->MyFile; 34 34 } else { 35 App:: import('model', 'MyFile');35 App::uses('Model', 'MyFile'); 36 36 $this->MyFile = new MyFile(); 37 37 } … … 58 58 } 59 59 60 $id = $this-> MyFile->fileExists($filename);60 $id = $this->controller->MyFile->fileExists($filename); 61 61 if ($id) { 62 62 Logger::verbose("File $filename already exists (id $id)"); … … 67 67 $flag |= FILE_FLAG_EXTERNAL; 68 68 } 69 $file = $this-> MyFile->create($filename, $userId, $flag);70 71 if ($this-> MyFile->save($file)) {72 $id = $this-> MyFile->getLastInsertID();69 $file = $this->controller->MyFile->create($filename, $userId, $flag); 70 71 if ($this->controller->MyFile->save($file)) { 72 $id = $this->controller->MyFile->getLastInsertID(); 73 73 Logger::verbose("Insert file $filename to database (id $id)"); 74 74 return $id; … … 87 87 if (is_dir($file)) { 88 88 $deleteFolder = !$this->isExternal($file); 89 return $this-> MyFile->deletePath($file, $deleteFolder);90 } 91 $id = $this-> MyFile->fileExists($file);89 return $this->controller->MyFile->deletePath($file, $deleteFolder); 90 } 91 $id = $this->controller->MyFile->fileExists($file); 92 92 if (!$id) { 93 93 Logger::warn("Could not find file $file"); … … 102 102 return false; 103 103 } 104 return $this-> MyFile->delete($id);104 return $this->controller->MyFile->delete($id); 105 105 } 106 106 … … 164 164 } 165 165 166 $current = $this-> MyFile->countBytes($user['User']['id'], false);166 $current = $this->controller->MyFile->countBytes($user['User']['id'], false); 167 167 $quota = $user['User']['quota']; 168 168 if ($current + $size <= $quota) { … … 213 213 } else { 214 214 // Copy all properties 215 $srcFile = $this-> MyFile->findByFilename($file);215 $srcFile = $this->controller->MyFile->findByFilename($file); 216 216 if (!$srcFile) { 217 217 Logger::warn("Could not found source '$file' in database"); … … 241 241 return false; 242 242 } 243 return $this-> MyFile->move($src, $dst);243 return $this->controller->MyFile->move($src, $dst); 244 244 } 245 245 -
Controller/Component/FilterManagerComponent.php
r3605ef4 ree4c2b7f 21 21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 22 */ 23 24 if (!App::import('Component', 'BaseFilter')) { 25 Logger::error("Could not load BaseFilter"); 26 } 23 27 24 28 class FilterManagerComponent extends Component { … … 43 47 function initialize(&$controller) { 44 48 $this->controller =& $controller; 45 if (!App::import('Component', 'BaseFilter')) {46 Logger::err("Could not find filter with name 'BaseFilter'");47 return false;48 }49 49 if (!isset($controller->MyFile) || !isset($controller->Media)) { 50 50 Logger::err("Model MyFile and Media is not found"); … … 273 273 return false; 274 274 } 275 if (!$this-> MyFile->fileExists($filename) && !$this->FileManager->add($filename)) {275 if (!$this->controller->MyFile->fileExists($filename) && !$this->FileManager->add($filename)) { 276 276 Logger::err("Could not add file $filename"); 277 277 $this->addError($filename, 'FileAddError'); … … 279 279 } 280 280 281 $file = $this->MyFile->findByFilename($filename); 281 $file = $this->controller->MyFile->findByFilename($filename); 282 if (!$file) { 283 Logger::err("Could not find file with filename: " . $filename); 284 } 282 285 283 286 // Check changes … … 292 295 } 293 296 294 if ($this-> MyFile->hasMedia($file)) {295 $media = $this-> Media->findById($file['File']['media_id']);297 if ($this->controller->MyFile->hasMedia($file)) { 298 $media = $this->controller->Media->findById($file['File']['media_id']); 296 299 $readed = strtotime($file['File']['readed']); 297 300 if ($readed && !$forceRead) { … … 319 322 $filterMissing = false; 320 323 foreach ($media['File'] as $file) { 321 $file = $this-> MyFile->findById($file['id']);322 $filename = $this-> MyFile->getFilename($file);324 $file = $this->controller->MyFile->findById($file['id']); 325 $filename = $this->controller->MyFile->getFilename($file); 323 326 $filter = $this->getFilterByExtension($filename); 324 327 if (!$filter) { -
Controller/Component/GpsFilterComponent.php
r1a41cea ree4c2b7f 55 55 //Logger::trace($options); 56 56 57 $filename = $this-> MyFile->getFilename($file);57 $filename = $this->controller->MyFile->getFilename($file); 58 58 if (!$this->Nmea->readFile($filename)) { 59 59 Logger::warn('Could not read file $filename'); … … 80 80 } 81 81 Logger::trace($conditions); 82 $this-> Media->unbindAll();83 $mediaSet = $this-> Media->find('all', array('conditions' => $conditions));82 $this->controller->Media->unbindAll(); 83 $mediaSet = $this->controller->Media->find('all', array('conditions' => $conditions)); 84 84 if (!count($mediaSet)) { 85 85 Logger::info("No images found for GPS interval"); … … 100 100 $media['Media']['longitude'] = $position['longitude']; 101 101 $media['Media']['flag'] |= MEDIA_FLAG_DIRTY; 102 if ($this-> Media->save($media['Media'], true, array('latitude', 'longitude', 'flag'))) {102 if ($this->controller->Media->save($media['Media'], true, array('latitude', 'longitude', 'flag'))) { 103 103 Logger::debug("Update GPS position of image {$media['Media']['id']} to {$position['latitude']}/{$position['longitude']}"); 104 104 } else { -
Controller/Component/ImageFilterComponent.php
re449ecc0 ree4c2b7f 32 32 LOCATION_COUNTRY => 'Country-PrimaryLocationName'); 33 33 34 function initialize(&$controller) {35 $this->controller =& $controller;36 }37 38 34 function getName() { 39 35 return "Image"; … … 75 71 $user = $this->controller->getUser(); 76 72 } 77 $media = $this-> Media->addDefaultAcl(&$media, &$user);73 $media = $this->controller->Media->addDefaultAcl(&$media, &$user); 78 74 79 75 $isNew = true; … … 106 102 if ($isNew) { 107 103 $mediaId = $this->Media->getLastInsertID(); 108 if (!$this-> MyFile->setMedia($file, $mediaId)) {104 if (!$this->controller->MyFile->setMedia($file, $mediaId)) { 109 105 $this->Media->delete($mediaId); 110 106 $this->FilterManager->addError($filename, 'FileSaveError'); … … 117 113 Logger::verbose("Updated media (id ".$media['Media']['id'].")"); 118 114 } 119 $this-> MyFile->updateReaded($file);120 $this-> MyFile->setFlag($file, FILE_FLAG_DEPENDENT);115 $this->controller->MyFile->updateReaded($file); 116 $this->controller->MyFile->setFlag($file, FILE_FLAG_DEPENDENT); 121 117 return $media; 122 118 } … … 327 323 $v['model'] = $this->_extract($data, 'jpg/exif/IFD0/Model', null); 328 324 $v['iso'] = $this->_extract($data, 'jpg/exif/EXIF/ISOSpeedRatings', null); 329 Logger::debug($data);325 //Logger::debug($data); 330 326 $v['caption'] = $this->_extract($data, 'jpg/exif/EXIF/ISOSpeedRatings', null); 331 327 … … 385 381 return false; 386 382 } 387 $filename = $this-> MyFile->getFilename($file);383 $filename = $this->controller->MyFile->getFilename($file); 388 384 if (!file_exists($filename) || !is_writeable(dirname($filename)) || !is_writeable($filename)) { 389 385 $id = isset($media['Media']['id']) ? $media['Media']['id'] : 0; … … 430 426 } 431 427 432 $this-> MyFile->update($file);428 $this->controller->MyFile->update($file); 433 429 if (!$this->Media->deleteFlag($media, MEDIA_FLAG_DIRTY)) { 434 430 $this->controller->warn("Could not update image data of media {$media['Media']['id']}"); -
Controller/Component/MenuComponent.php
r3605ef4 ree4c2b7f 44 44 function setBasicMainMenu() { 45 45 $controllers = array( 46 'options' => __('Account Settings' , true),47 'groups' => __('Groups' , true),48 'users' => __('Users' , true),49 'guests' => __('Guests' , true),50 'browser' => __('Media Files' , true)46 'options' => __('Account Settings'), 47 'groups' => __('Groups'), 48 'users' => __('Users'), 49 'guests' => __('Guests'), 50 'browser' => __('Media Files') 51 51 ); 52 52 if ($this->controller->hasRole(ROLE_SYSOP)) { 53 $controllers['system'] = __("System" , true);53 $controllers['system'] = __("System"); 54 54 } 55 55 -
Controller/Component/SimpleImageFilterComponent.php
r1a41cea ree4c2b7f 45 45 function read($file, &$media, $options = array()) { 46 46 $options = am(array('noSave' => false), $options); 47 $filename = $this-> MyFile->getFilename($file);47 $filename = $this->controller->MyFile->getFilename($file); 48 48 49 49 $isNew = false; 50 50 if (!$media) { 51 $media = $this-> Media->create(array(51 $media = $this->controller->Media->create(array( 52 52 'type' => MEDIA_TYPE_IMAGE, 53 53 ), true); 54 54 if ($this->controller->getUserId() != $file['File']['user_id']) { 55 $user = $this-> Media->User->findById($file['File']['user_id']);55 $user = $this->controller->Media->User->findById($file['File']['user_id']); 56 56 } else { 57 57 $user = $this->controller->getUser(); 58 58 } 59 $media = $this-> Media->addDefaultAcl(&$media, &$user);59 $media = $this->controller->Media->addDefaultAcl(&$media, &$user); 60 60 61 61 $isNew = true; … … 79 79 if ($options['noSave']) { 80 80 return $media; 81 } elseif (!$this-> Media->save($media)) {81 } elseif (!$this->controller->Media->save($media)) { 82 82 Logger::err("Could not save Media"); 83 83 Logger::trace($media); … … 86 86 } 87 87 if ($isNew) { 88 $mediaId = $this-> Media->getLastInsertID();89 if (!$this-> MyFile->setMedia($file, $mediaId)) {90 $this-> Media->delete($mediaId);88 $mediaId = $this->controller->Media->getLastInsertID(); 89 if (!$this->controller->MyFile->setMedia($file, $mediaId)) { 90 $this->controller->Media->delete($mediaId); 91 91 $this->FilterManager->addError($filename, 'FileSaveError'); 92 92 return false; 93 93 } else { 94 94 Logger::info("Created new Media (id $mediaId)"); 95 $media = $this-> Media->findById($mediaId);95 $media = $this->controller->Media->findById($mediaId); 96 96 } 97 97 } else { 98 98 Logger::verbose("Updated media (id ".$media['Media']['id'].")"); 99 99 } 100 $this-> MyFile->updateReaded($file);101 $this-> MyFile->setFlag($file, FILE_FLAG_DEPENDENT);100 $this->controller->MyFile->updateReaded($file); 101 $this->controller->MyFile->setFlag($file, FILE_FLAG_DEPENDENT); 102 102 return $media; 103 103 } -
Controller/Component/UploadComponent.php
r3605ef4 ree4c2b7f 102 102 } 103 103 104 if (!$data && $this->controller-> data) {105 $data =& $this->controller-> data;104 if (!$data && $this->controller->request->data) { 105 $data =& $this->controller->request->data; 106 106 } 107 107 -
Controller/Component/VideoFilterComponent.php
re449ecc0 ree4c2b7f 74 74 75 75 function _readThumb($file, &$media) { 76 $filename = $this-> MyFile->getFilename($file);76 $filename = $this->controller->MyFile->getFilename($file); 77 77 if (!$media) { 78 78 $video = $this->_findVideo($file); … … 82 82 return false; 83 83 } 84 $media = $this-> Media->findById($video['File']['media_id']);84 $media = $this->controller->Media->findById($video['File']['media_id']); 85 85 if (!$media) { 86 86 $this->FilterManager->addError($filename, "MediaNotFound"); … … 103 103 // restore overwritten values 104 104 $media['Media'] = am($media['Media'], $tmp); 105 if (!$this-> Media->save($media)) {105 if (!$this->controller->Media->save($media)) { 106 106 $this->FilterManager->addError($filename, "MediaSaveError"); 107 107 Logger::err("Could not save media"); 108 108 return false; 109 109 } 110 $this-> MyFile->setMedia($file, $media['Media']['id']);111 $this-> MyFile->updateReaded($file);110 $this->controller->MyFile->setMedia($file, $media['Media']['id']); 111 $this->controller->MyFile->updateReaded($file); 112 112 Logger::verbose("Updated media from thumb file"); 113 return $this-> Media->findById($media['Media']['id']);113 return $this->controller->Media->findById($media['Media']['id']); 114 114 } 115 115 … … 118 118 * @return True, false on error */ 119 119 function read(&$file, &$media, $options = array()) { 120 $filename = $this-> MyFile->getFilename($file);121 122 if ($this-> MyFile->isType($file, FILE_TYPE_VIDEOTHUMB)) {120 $filename = $this->controller->MyFile->getFilename($file); 121 122 if ($this->controller->MyFile->isType($file, FILE_TYPE_VIDEOTHUMB)) { 123 123 return $this->_readThumb($file, &$media); 124 } elseif (!$this-> MyFile->isType($file, FILE_TYPE_VIDEO)) {124 } elseif (!$this->controller->MyFile->isType($file, FILE_TYPE_VIDEO)) { 125 125 $this->FilterManager->addError($filename, "FileNotSupported"); 126 Logger::err("File type is not supported: ".$this-> MyFile->getFilename($file));126 Logger::err("File type is not supported: ".$this->controller->MyFile->getFilename($file)); 127 127 return false; 128 128 } … … 130 130 $isNew = false; 131 131 if (!$media) { 132 $media = $this-> Media->create(array(132 $media = $this->controller->Media->create(array( 133 133 'type' => MEDIA_TYPE_VIDEO, 134 134 'date' => date('Y-m-d H:i:s', time()), … … 137 137 ), true); 138 138 if ($this->controller->getUserId() != $file['File']['user_id']) { 139 $user = $this-> Media->User->findById($file['File']['user_id']);139 $user = $this->controller->Media->User->findById($file['File']['user_id']); 140 140 } else { 141 141 $user = $this->controller->getUser(); 142 142 } 143 $media = $this-> Media->addDefaultAcl(&$media, &$user);143 $media = $this->controller->Media->addDefaultAcl(&$media, &$user); 144 144 145 145 $isNew = true; … … 153 153 $media = $this->_readGetId3(&$media, $filename); 154 154 } 155 if (!$media || !$this-> Media->save($media)) {155 if (!$media || !$this->controller->Media->save($media)) { 156 156 $this->FilterManager->addError($filename, "MediaSaveError"); 157 157 Logger::err("Could not save media"); … … 160 160 161 161 $mediaId = $media['Media']['id']; 162 if ($isNew || !$this-> MyFile->hasMedia($file)) {163 $mediaId = $isNew ? $this-> Media->getLastInsertID() : $data['id'];164 if (!$this-> MyFile->setMedia($file, $mediaId)) {162 if ($isNew || !$this->controller->MyFile->hasMedia($file)) { 163 $mediaId = $isNew ? $this->controller->Media->getLastInsertID() : $data['id']; 164 if (!$this->controller->MyFile->setMedia($file, $mediaId)) { 165 165 Logger::err("File was not saved: " . $filename); 166 166 $this->FilterManager->addError($filename, "FileSaveError"); 167 $this-> Media->delete($mediaId);167 $this->controller->Media->delete($mediaId); 168 168 return false; 169 169 } 170 $media = $this-> Media->findById($mediaId);171 } 172 173 $this-> MyFile->updateReaded($file);174 $this-> MyFile->setFlag($file, FILE_FLAG_DEPENDENT);175 176 return $this-> Media->findById($mediaId);170 $media = $this->controller->Media->findById($mediaId); 171 } 172 173 $this->controller->MyFile->updateReaded($file); 174 $this->controller->MyFile->setFlag($file, FILE_FLAG_DEPENDENT); 175 176 return $this->controller->Media->findById($mediaId); 177 177 } 178 178 … … 277 277 // Check for video thumb 278 278 function _hasThumb($media) { 279 $thumb = $this-> Media->getFile($media, FILE_TYPE_VIDEOTHUMB);279 $thumb = $this->controller->Media->getFile($media, FILE_TYPE_VIDEOTHUMB); 280 280 if ($thumb) { 281 281 return true; … … 286 286 287 287 function _createThumb($media) { 288 $video = $this-> Media->getFile($media, FILE_TYPE_VIDEO);288 $video = $this->controller->Media->getFile($media, FILE_TYPE_VIDEO); 289 289 if (!$video) { 290 290 Logger::err("Media {$media['Media']['id']} has no video"); 291 291 return false; 292 292 } 293 if (!is_writable(dirname($this-> MyFile->getFilename($video)))) {293 if (!is_writable(dirname($this->controller->MyFile->getFilename($video)))) { 294 294 Logger::warn("Cannot create video thumb. Directory of video is not writeable"); 295 295 } … … 305 305 $id = $this->_createThumb($media); 306 306 if ($id) { 307 $file = $this-> MyFile->findById($id);308 $this-> MyFile->setMedia($file, $media['Media']['id']);309 $media = $this-> Media->findById($media['Media']['id']);307 $file = $this->controller->MyFile->findById($id); 308 $this->controller->MyFile->setMedia($file, $media['Media']['id']); 309 $media = $this->controller->Media->findById($media['Media']['id']); 310 310 $this->write($file, $media); 311 311 } 312 312 } 313 if ($this-> MyFile->isType($file, FILE_TYPE_VIDEOTHUMB)) {313 if ($this->controller->MyFile->isType($file, FILE_TYPE_VIDEOTHUMB)) { 314 314 $imageFilter = $this->FilterManager->getFilter('Image'); 315 315 if (!$imageFilter) { … … 317 317 return false; 318 318 } 319 $filename = $this-> MyFile->getFilename($file);319 $filename = $this->controller->MyFile->getFilename($file); 320 320 Logger::debug("Write video thumbnail by ImageFilter: $filename"); 321 321 return $imageFilter->write(&$file, &$media); -
Controller/Component/WebdavServerComponent.php
r1a41cea ree4c2b7f 979 979 $options["props"][$key]['status']="403 Forbidden"; 980 980 } else { 981 $property = $this->controller->Property->find( array('Property.file_id' => $fileId, 'Property.name' => $prop['name'], 'Property.ns' => $prop['ns']));981 $property = $this->controller->Property->find('first', array('conditions' => array('Property.file_id' => $fileId, 'Property.name' => $prop['name'], 'Property.ns' => $prop['ns']))); 982 982 if (isset($prop["val"])) { 983 983 if (!$property) { … … 1037 1037 1038 1038 if (isset($options["update"])) { // Lock Update 1039 $lock = $this->controller->Lock->find( array('Lock.file_id' => $fileId, 'Lock.token' => $options['update']));1039 $lock = $this->controller->Lock->find('first' => array('conditions' => array('Lock.file_id' => $fileId, 'Lock.token' => $options['update']))); 1040 1040 1041 1041 if ($lock) { … … 1088 1088 return "409 Conflict"; 1089 1089 } 1090 $lock = $this->controller->Lock->find( array('Lock.file_id' => $fileId, 'Lock.token' => $options['token']));1090 $lock = $this->controller->Lock->find('first', array('conditions' => array('Lock.file_id' => $fileId, 'Lock.token' => $options['token']))); 1091 1091 if (!$lock) { 1092 1092 Logger::err("Could not find lock token '{$options['token']}' for file $fileId"); -
Controller/ExplorerController.php
r1a41cea ree4c2b7f 26 26 var $components = array('RequestHandler', 'FilterManager', 'Search', 'QueryBuilder', 'FastFileResponder', 'Feed', 'FileCache'); 27 27 var $uses = array('Media', 'MyFile', 'Group', 'Tag', 'Category', 'Location'); 28 var $helpers = array('Form', 'Html', ' Ajax', 'ImageData', 'Time', 'ExplorerMenu', 'Rss', 'Search', 'Navigator', 'Tab', 'Breadcrumb', 'Autocomplete');28 var $helpers = array('Form', 'Html', 'ImageData', 'Time', 'ExplorerMenu', 'Rss', 'Search', 'Navigator', 'Tab', 'Breadcrumb', 'Autocomplete'); 29 29 30 30 var $crumbs = array(); … … 43 43 $paginateActions = array('category', 'date', 'edit', 'group', 'index', 'location', 'query', 'tag', 'user', 'view'); 44 44 if (in_array($this->action, $paginateActions)) { 45 $this-> data = $this->Search->paginateByCrumbs($this->crumbs);46 $this->FastFileResponder->addAll($this-> data, 'thumb');45 $this->request->data = $this->Search->paginateByCrumbs($this->crumbs); 46 $this->FastFileResponder->addAll($this->request->data, 'thumb'); 47 47 48 48 if ($this->hasRole(ROLE_USER)) { … … 50 50 $groupSelect = Set::combine($groups, '{n}.Group.id', '{n}.Group.name'); 51 51 asort($groupSelect); 52 $groupSelect[0] = __('[Keep]' , true);53 $groupSelect[-1] = __('[No Group]' , true);52 $groupSelect[0] = __('[Keep]'); 53 $groupSelect[-1] = __('[No Group]'); 54 54 $this->set('groups', $groupSelect); 55 55 } else { … … 59 59 $this->set('crumbs', $this->crumbs); 60 60 $this->params['crumbs'] = $this->crumbs; 61 $this->Feed->add('/explorer/media/' . join('/', $this->Search->encodeCrumbs($this->crumbs)), array('title' => __('Slideshow Media RSS' , true), 'id' => 'slideshow'));61 $this->Feed->add('/explorer/media/' . join('/', $this->Search->encodeCrumbs($this->crumbs)), array('title' => __('Slideshow Media RSS'), 'id' => 'slideshow')); 62 62 parent::beforeRender(); 63 63 } … … 68 68 69 69 function view() { 70 if (!empty($this-> data)) {71 $crumbs = split('/', $this-> data['Breadcrumb']['current']);72 $crumbs[] = $this-> data['Breadcrumb']['input'];70 if (!empty($this->request->data)) { 71 $crumbs = split('/', $this->request->data['Breadcrumb']['current']); 72 $crumbs[] = $this->request->data['Breadcrumb']['input']; 73 73 $this->crumbs = $crumbs; 74 74 } … … 80 80 if ($type == 'tag' || $type == 'category') { 81 81 $field = Inflector::camelize($type); 82 $value = $this-> data[$field]['names'];82 $value = $this->request->data[$field]['names']; 83 83 } else { 84 $value = $this-> data['Location'][$type];85 } 86 $this-> data = $this->_getAssociation($type, $value);84 $value = $this->request->data['Location'][$type]; 85 } 86 $this->request->data = $this->_getAssociation($type, $value); 87 87 } elseif ($type == 'crumb') { 88 88 $queryMap = array( … … 106 106 } 107 107 $queryTypes = array_keys($queryMap); 108 $input = trim($this-> data['Breadcrumb']['input']);108 $input = trim($this->request->data['Breadcrumb']['input']); 109 109 // cut input to maximum of 64 chars 110 110 if (strlen($input) > 64) { 111 111 $input = substr($input, 0, 64); 112 112 } 113 $this-> data = array();113 $this->request->data = array(); 114 114 if (strpos($input, ':') === false) { 115 115 // Search for crumb type … … 118 118 foreach ($queryTypes as $types) { 119 119 if ($input == '' || strpos($types, $input) === 0) { 120 $this-> data[] = $types . ':';120 $this->request->data[] = $types . ':'; 121 121 } 122 122 } … … 142 142 } 143 143 foreach ($data as $value) { 144 $this-> data[] = "$crumbType:$exclude$value";144 $this->request->data[] = "$crumbType:$exclude$value"; 145 145 } 146 146 } … … 173 173 ))); 174 174 foreach ($tags as $tag) { 175 $this-> data[] = 'tag:' . $prefix . $tag;175 $this->request->data[] = 'tag:' . $prefix . $tag; 176 176 } 177 177 $categories = Set::extract('/Category/name', $this->Media->Category->find( … … 179 179 ))); 180 180 foreach ($categories as $category) { 181 $this-> data[] = 'category:' . $prefix . $category;181 $this->request->data[] = 'category:' . $prefix . $category; 182 182 } 183 183 $locations = array_unique(Set::extract('/Location/name', $this->Media->Location->find( … … 185 185 )))); 186 186 foreach ($locations as $location) { 187 $this-> data[] = 'location:' . $prefix . $location;187 $this->request->data[] = 'location:' . $prefix . $location; 188 188 } 189 189 $groups = Set::extract('/Group/name', $this->Media->Group->find( … … 191 191 ))); 192 192 foreach ($groups as $group) { 193 $this-> data[] = 'group:' . $prefix . $group;193 $this->request->data[] = 'group:' . $prefix . $group; 194 194 } 195 195 $users = Set::extract('/User/username', $this->Media->User->find( … … 198 198 foreach ($users as $user) { 199 199 // TODO excluding of users are currently not supported 200 $this-> data[] = 'user:' . $user;200 $this->request->data[] = 'user:' . $user; 201 201 } 202 202 … … 209 209 foreach ($values as $value) { 210 210 if (substr(strtolower($value), 0, $len) == $needle) { 211 $this-> data[] = $type . ':' . $value;211 $this->request->data[] = $type . ':' . $value; 212 212 } 213 213 } … … 309 309 310 310 function quicksearch($quicksearch = false) { 311 if (!empty($this-> data) && isset($this->data['Media']['quicksearch'])) {312 $quicksearch = $this-> data['Media']['quicksearch'];311 if (!empty($this->request->data) && isset($this->request->data['Media']['quicksearch'])) { 312 $quicksearch = $this->request->data['Media']['quicksearch']; 313 313 } 314 314 315 315 if ($quicksearch) { 316 $this-> data = $this->Search->quicksearch($quicksearch, 6);316 $this->request->data = $this->Search->quicksearch($quicksearch, 6); 317 317 } 318 318 $this->set('quicksearch', $quicksearch); … … 320 320 321 321 function query() { 322 if (!empty($this-> data)) {323 $this->Search->addTags(preg_split('/\s*,\s*/', trim($this-> data['Media']['tags'])));324 $this->Search->setTagOp($this-> data['Media']['tag_op']);325 326 $this->Search->addCategories(preg_split('/\s*,\s*/', trim($this-> data['Media']['categories'])));327 $this->Search->setCategoryOp($this-> data['Media']['category_op']);328 329 $this->Search->addLocations(preg_split('/\s*,\s*/', trim($this-> data['Media']['locations'])));330 $this->Search->setLocationOp($this-> data['Media']['location_op']);331 $this->Search->setOperand($this-> data['Media']['operand']);332 333 $this->Search->setFrom($this-> data['Media']['from']);334 $this->Search->setTo($this-> data['Media']['to']);335 336 $this->Search->setShow($this-> data['Option']['show']);337 $this->Search->setSort($this-> data['Option']['sort']);322 if (!empty($this->request->data)) { 323 $this->Search->addTags(preg_split('/\s*,\s*/', trim($this->request->data['Media']['tags']))); 324 $this->Search->setTagOp($this->request->data['Media']['tag_op']); 325 326 $this->Search->addCategories(preg_split('/\s*,\s*/', trim($this->request->data['Media']['categories']))); 327 $this->Search->setCategoryOp($this->request->data['Media']['category_op']); 328 329 $this->Search->addLocations(preg_split('/\s*,\s*/', trim($this->request->data['Media']['locations']))); 330 $this->Search->setLocationOp($this->request->data['Media']['location_op']); 331 $this->Search->setOperand($this->request->data['Media']['operand']); 332 333 $this->Search->setFrom($this->request->data['Media']['from']); 334 $this->Search->setTo($this->request->data['Media']['to']); 335 336 $this->Search->setShow($this->request->data['Option']['show']); 337 $this->Search->setSort($this->request->data['Option']['sort']); 338 338 if ($this->hasRole(ROLE_GUEST)) { 339 $this->Search->setName($this-> data['Media']['name']);340 $this->Search->setType($this-> data['Media']['type']);339 $this->Search->setName($this->request->data['Media']['name']); 340 $this->Search->setType($this->request->data['Media']['type']); 341 341 // Allow to search for my images 342 if ($this-> data['User']['username'] == $this->getUserId()) {343 $this->Search->setUser($this-> data['User']['username']);342 if ($this->request->data['User']['username'] == $this->getUserId()) { 343 $this->Search->setUser($this->request->data['User']['username']); 344 344 } 345 345 } 346 346 347 347 if ($this->hasRole(ROLE_USER)) { 348 $this->Search->setVisibility($this-> data['Media']['visibility']);349 350 $this->Search->setUser($this-> data['User']['username']);351 $this->Search->addGroup($this-> data['Group']['name']);348 $this->Search->setVisibility($this->request->data['Media']['visibility']); 349 350 $this->Search->setUser($this->request->data['User']['username']); 351 $this->Search->addGroup($this->request->data['Group']['name']); 352 352 } 353 353 $this->crumbs = $this->Search->convertToCrumbs(); … … 393 393 } else { 394 394 Logger::info(sprintf("Invalid root %s or folder %s", $fsRoot, $fsFolder)); 395 $this->Session->setFlash( sprintf(__("Invalid folder: %s", true), $folder));395 $this->Session->setFlash(__("Invalid folder: %s", $folder)); 396 396 } 397 397 } else { … … 482 482 483 483 function edit() { 484 if (isset($this-> data)) {485 $ids = preg_split('/\s*,\s*/', $this-> data['Media']['ids']);484 if (isset($this->request->data)) { 485 $ids = preg_split('/\s*,\s*/', $this->request->data['Media']['ids']); 486 486 $ids = array_unique($ids); 487 487 if (!count($ids)) { … … 490 490 491 491 $user = $this->getUser(); 492 $this->Media->prepareGroupData(&$this-> data, &$user);493 $editData = $this->Media->prepareMultiEditData(&$this-> data);492 $this->Media->prepareGroupData(&$this->request->data, &$user); 493 $editData = $this->Media->prepareMultiEditData(&$this->request->data); 494 494 495 495 $allMedia = $this->Media->find('all', array('conditions' => array('Media.id' => $ids))); … … 520 520 } 521 521 } 522 $this-> data = array();522 $this->request->data = array(); 523 523 } 524 524 $this->redirect('view/' . implode('/', $this->Search->encodeCrumbs($this->crumbs))); … … 542 542 $this->redirect(null, '403'); 543 543 } 544 $this-> data = $media;544 $this->request->data = $media; 545 545 $this->layout='bare'; 546 546 $this->render('editmeta'); … … 560 560 $user = $this->getUser(); 561 561 $username = $user['User']['username']; 562 if (isset($this-> data)) {562 if (isset($this->request->data)) { 563 563 $media = $this->Media->findById($id); 564 564 $this->Media->setAccessFlags(&$media, $user); … … 569 569 Logger::warn("User '{$username}' ({$user['User']['id']}) has no previleges to change tags of image ".$id); 570 570 } else { 571 $this->Media->prepareGroupData(&$this-> data, &$user);572 $tmp = $this->Media->editSingle(&$media, &$this-> data);571 $this->Media->prepareGroupData(&$this->request->data, &$user); 572 $tmp = $this->Media->editSingle(&$media, &$this->request->data); 573 573 if (!$this->Media->save($tmp)) { 574 574 Logger::warn("Could not save media"); … … 585 585 $media = $this->Media->findById($id); 586 586 $this->Media->setAccessFlags(&$media, $user); 587 $this-> data = $media;587 $this->request->data = $media; 588 588 $this->Search->parseArgs(); 589 589 $this->Search->setUser($user['User']['username']); … … 624 624 $media = $this->Media->findById($id); 625 625 $this->Media->setAccessFlags(&$media, $user); 626 $this-> data = $media;626 $this->request->data = $media; 627 627 $this->layout='bare'; 628 628 if ($this->Media->checkAccess(&$media, &$user, 1, 0)) { … … 630 630 $groups = Set::combine($groups, '{n}.Group.id', '{n}.Group.name'); 631 631 asort($groups); 632 $groups[-1] = __('[No Group]' , true);632 $groups[-1] = __('[No Group]'); 633 633 $this->set('groups', $groups); 634 634 } else { … … 646 646 $id = intval($id); 647 647 $this->layout='bare'; 648 if (isset($this-> data)) {648 if (isset($this->request->data)) { 649 649 // Call find() instead of read(). read() populates resultes to the model, 650 650 // which causes problems at save() … … 656 656 Logger::warn("User '{$user['User']['username']}' ({$user['User']['id']}) has no previleges to change ACL of image ".$id); 657 657 } else { 658 $this->Media->prepareGroupData(&$this-> data, &$user);658 $this->Media->prepareGroupData(&$this->request->data, &$user); 659 659 $tmp = array('Media' => array('id' => $id)); 660 $this->Media->updateAcl(&$tmp, &$media, &$this-> data);660 $this->Media->updateAcl(&$tmp, &$media, &$this->request->data); 661 661 $this->Media->save($tmp, true); 662 662 Logger::info("Changed acl of media $id"); … … 665 665 $media = $this->Media->findById($id); 666 666 $this->Media->setAccessFlags(&$media, $this->getUser()); 667 $this-> data = $media;667 $this->request->data = $media; 668 668 $this->layout='bare'; 669 669 $this->Search->parseArgs(); … … 714 714 'description' => "Recently Published Images" ) 715 715 ); 716 $this-> data = $this->Search->paginateByCrumbs($this->crumbs);716 $this->request->data = $this->Search->paginateByCrumbs($this->crumbs); 717 717 } 718 718 … … 722 722 Configure::write('debug', 1); 723 723 } 724 $this-> data = $this->Search->paginateByCrumbs($this->crumbs);724 $this->request->data = $this->Search->paginateByCrumbs($this->crumbs); 725 725 } 726 726 … … 728 728 $this->Search->setSort('random'); 729 729 730 $this-> data = array();730 $this->request->data = array(); 731 731 732 732 $north = floatval($north); … … 749 749 //Logger::trace("Found ".count($points)." points"); 750 750 if ($points) { 751 $this-> data = am($points, $this->data);751 $this->request->data = am($points, $this->request->data); 752 752 } 753 753 $lng += $stepLng; … … 757 757 758 758 $this->layout = 'xml'; 759 Logger::trace("Search points of N:$north, S:$south, W:$west, E:$east: Found ".count($this-> data)." points");760 $this->FastFileResponder->addAll($this-> data, 'mini');759 Logger::trace("Search points of N:$north, S:$south, W:$west, E:$east: Found ".count($this->request->data)." points"); 760 $this->FastFileResponder->addAll($this->request->data, 'mini'); 761 761 if (Configure::read('debug') > 1) { 762 762 Configure::write('debug', 1); -
Controller/GroupsController.php
r1a41cea ree4c2b7f 25 25 var $uses = array('Group', 'User', 'Media'); 26 26 var $components = array('RequestHandler', 'Security', 'Email', 'Search'); 27 var $helpers = array('Form', ' Ajax', 'ImageData', 'Text');27 var $helpers = array('Form', 'ImageData', 'Text'); 28 28 var $subMenu = false; 29 29 … … 31 31 parent::beforeFilter(); 32 32 $this->subMenu = array( 33 'index' => __("List Group" , true),34 'create' => __("Create Group" , true),33 'index' => __("List Group"), 34 'create' => __("Create Group"), 35 35 ); 36 36 $this->requireRole(ROLE_USER); … … 49 49 function fail() { 50 50 Logger::err("The security component denied the form input"); 51 Logger::debug($this-> data);51 Logger::debug($this->request->data); 52 52 $this->redirect('index'); 53 53 } … … 56 56 $userId = $this->getUserId(); 57 57 if ($this->hasRole(ROLE_ADMIN)) { 58 $this-> data = $this->Group->find('all', array('order' => 'Group.name'));59 } else { 60 $this-> data = $this->Group->find('all', array('conditions' => (array('OR' => array('User.id' => $userId, 'Group.is_hidden' => false))), 'order' => 'Group.name'));58 $this->request->data = $this->Group->find('all', array('order' => 'Group.name')); 59 } else { 60 $this->request->data = $this->Group->find('all', array('conditions' => (array('OR' => array('User.id' => $userId, 'Group.is_hidden' => false))), 'order' => 'Group.name')); 61 61 } 62 62 } 63 63 64 64 function view($name) { 65 $this-> data = $this->Group->findByName($name);66 if (!$this-> data) {67 $this->Session->setFlash( sprintf(__("%s not found", true), __("Group", true)));65 $this->request->data = $this->Group->findByName($name); 66 if (!$this->request->data) { 67 $this->Session->setFlash(__("%s not found", true, __("Group"))); 68 68 $this->redirect('index'); 69 69 } 70 $this->Group->setAdmin(&$this-> data, $this->getUser());71 $this->set('mediaCount', $this->Media->countByGroupId($this-> data['Group']['id']));70 $this->Group->setAdmin(&$this->request->data, $this->getUser()); 71 $this->set('mediaCount', $this->Media->countByGroupId($this->request->data['Group']['id'])); 72 72 73 73 $this->Search->addGroup($name); … … 77 77 78 78 function create() { 79 if (!empty($this-> data)) {79 if (!empty($this->request->data)) { 80 80 $user = $this->getUser(); 81 $this-> data['Group']['user_id'] = $user['User']['id'];82 if (!$this->Group->isNameUnique($this-> data)) {83 $this->Session->setFlash( sprintf(__("%s already exists", true), __('Group', true)));84 } elseif ($this->Group->save($this-> data)) {81 $this->request->data['Group']['user_id'] = $user['User']['id']; 82 if (!$this->Group->isNameUnique($this->request->data)) { 83 $this->Session->setFlash(__("%s already exists", true, __('Group'))); 84 } elseif ($this->Group->save($this->request->data)) { 85 85 $groupId = $this->Group->getLastInsertID(); 86 86 $group = $this->Group->findById($groupId); 87 87 $user = $this->getUser(); 88 88 Logger::info("User '{$user['User']['username']}' ({$user['User']['id']}) created group '{$group['Group']['name']}' ({$group['Group']['id']})"); 89 $this->Session->setFlash( sprintf(__("Add successfully group '%s'", true), $this->data['Group']['name']));89 $this->Session->setFlash(__("Add successfully group '%s'", $this->request->data['Group']['name'])); 90 90 $this->redirect("view/{$group['Group']['name']}"); 91 91 } else { 92 $this->Session->setFlash( sprintf(__("Could not create group '%s'", true), $this->data['Group']['name']));92 $this->Session->setFlash(__("Could not create group '%s'", $this->request->data['Group']['name'])); 93 93 } 94 94 } … … 110 110 Logger::err($this->Email->smtpError); 111 111 } 112 $this->Session->setFlash(__('Mail could not be sent' , true));112 $this->Session->setFlash(__('Mail could not be sent')); 113 113 return false; 114 114 } 115 115 Logger::info("Sent group subscribe request of user {$user['User']['username']} for group {$group['Group']['name']} to {$group['User']['username']}"); 116 $this->Session->setFlash(__("Group subscription request was sent to the group owner" , true));116 $this->Session->setFlash(__("Group subscription request was sent to the group owner")); 117 117 return true; 118 118 } … … 176 176 $group = $this->Group->findByName($name); 177 177 if (!$group) { 178 $this->Session->setFlash( sprintf(__("%s not found", true), __("Group", true)));178 $this->Session->setFlash(__("%s not found", true, __("Group"))); 179 179 $this->redirect('index'); 180 180 } … … 201 201 $conditions['Group.user_id'] = $this->getUserId(); 202 202 } 203 $group = $this->Group->find( $conditions);203 $group = $this->Group->find('all', array('conditions' => $conditions)); 204 204 $user = $this->User->findByUsername($userName); 205 205 $userId = ($user) ? $user['User']['id'] : false; … … 232 232 $group = $this->Group->findById($id); 233 233 if (!$this->Group->isAdmin(&$group, $this->getUser())) { 234 $this->Session->setFlash(__("You are not authorized to perform this action" , true));234 $this->Session->setFlash(__("You are not authorized to perform this action")); 235 235 $this->redirect("view/{$group['Group']['name']}"); 236 236 } 237 $user = $this->User->findByUsername($this-> data['Member']['new']);237 $user = $this->User->findByUsername($this->request->data['Member']['new']); 238 238 if (!$user) { 239 $this->Session->setFlash(__("%s not found", true), __("User" , true));239 $this->Session->setFlash(__("%s not found", true), __("User")); 240 240 $this->redirect("view/{$group['Group']['name']}"); 241 241 } … … 244 244 $this->redirect("index"); 245 245 } elseif ($result['code'] == 201) { 246 $this->Session->setFlash( sprintf(__("User %s is now subscribe to this group", true), $this->data['Member']['new']));246 $this->Session->setFlash(__("User %s is now subscribe to this group", $this->request->data['Member']['new'])); 247 247 } 248 248 $this->redirect("view/{$group['Group']['name']}"); … … 252 252 $group = $this->Group->findByName($groupName); 253 253 if (!$this->Group->isAdmin(&$group, $this->getUser())) { 254 $this->Session->setFlash(__("You are not authorized to perform this action" , true));254 $this->Session->setFlash(__("You are not authorized to perform this action")); 255 255 $this->redirect("view/{$group['Group']['name']}"); 256 256 } 257 257 $user = $this->User->findByUsername($userName); 258 258 if (!$user) { 259 $this->Session->setFlash(__("%s not found", true), __("User" , true));259 $this->Session->setFlash(__("%s not found", true), __("User")); 260 260 $this->redirect("view/{$group['Group']['name']}"); 261 261 } … … 264 264 $this->redirect("index"); 265 265 } elseif ($result['code'] == 201) { 266 $this->Session->setFlash( sprintf(__("User %s is now unsubscribe from this group", true), $userName));266 $this->Session->setFlash(__("User %s is now unsubscribe from this group", $userName)); 267 267 } 268 268 $this->redirect("view/{$group['Group']['name']}"); … … 270 270 271 271 function edit($groupName) { 272 if (!empty($this-> data)) {273 if ($this-> data['Group']['name'] != $groupName && !$this->Group->isNameUnique($this->data)) {274 $this->Session->setFlash( sprintf(__("%s already exists", true), __('Group', true)));275 } elseif (!$this->Group->save($this-> data)) {276 $this->Session->setFlash( sprintf(__("Could not save %s", true), __('Group', true)));272 if (!empty($this->request->data)) { 273 if ($this->request->data['Group']['name'] != $groupName && !$this->Group->isNameUnique($this->request->data)) { 274 $this->Session->setFlash(__("%s already exists", true, __('Group'))); 275 } elseif (!$this->Group->save($this->request->data)) { 276 $this->Session->setFlash(__("Could not save %s", true, __('Group'))); 277 277 } else { 278 $this->Session->setFlash( sprintf(__("%s updated", true), __('Group', true)));279 if ($groupName != $this-> data['Group']['name']) {280 $this->redirect("edit/{$this-> data['Group']['name']}");278 $this->Session->setFlash(__("%s updated", true, __('Group'))); 279 if ($groupName != $this->request->data['Group']['name']) { 280 $this->redirect("edit/{$this->request->data['Group']['name']}"); 281 281 } 282 282 } … … 286 286 $conditions['Group.user_id'] = $this->getUserId(); 287 287 } 288 $this-> data = $this->Group->find($conditions);289 if (!$this-> data) {290 $this->Session->setFlash(__("Could not find group" , true));288 $this->request->data = $this->Group->find('all', array('conditions' => $conditions)); 289 if (!$this->request->data) { 290 $this->Session->setFlash(__("Could not find group")); 291 291 $this->redirect("index"); 292 292 } … … 298 298 function delete($groupId) { 299 299 $userId = $this->getUserId(); 300 $group = $this->Group->find( array('Group.id' => $groupId, 'Group.user_id' => $userId));300 $group = $this->Group->find('first', array('conditions' => array('Group.id' => $groupId, 'Group.user_id' => $userId))); 301 301 if ($group) { 302 302 $this->Group->delete($groupId); 303 303 $user = $this->getUser(); 304 304 Logger::info("User '{$user['User']['username']}' ({$user['User']['id']}) deleted group '{$group['Group']['name']}' ({$group['Group']['id']})"); 305 $this->Session->setFlash( sprintf(__("Successfully deleted group '%s'", true), $group['Group']['name']));306 } else { 307 $this->Session->setFlash(__("Could not find group" , true));305 $this->Session->setFlash(__("Successfully deleted group '%s'", $group['Group']['name'])); 306 } else { 307 $this->Session->setFlash(__("Could not find group")); 308 308 } 309 309 $this->redirect("index"); -
Controller/GuestsController.php
r1a41cea ree4c2b7f 25 25 var $uses = array('Group', 'User', 'Guest'); 26 26 var $components = array('RequestHandler'); 27 var $helpers = array('Form', 'A jax');27 var $helpers = array('Form', 'Autocomplete'); 28 28 var $subMenu = false; 29 29 … … 33 33 $this->requireRole(ROLE_USER); 34 34 $this->subMenu = array( 35 'create' => __('New Guest' , true)35 'create' => __('New Guest') 36 36 ); 37 37 } … … 43 43 function index() { 44 44 $userId = $this->getUserId(); 45 $this-> data = $this->Guest->find('all', array('conditions' => array('Guest.creator_id' => $userId)));45 $this->request->data = $this->Guest->find('all', array('conditions' => array('Guest.creator_id' => $userId))); 46 46 } 47 47 … … 53 53 uses('sanitize'); 54 54 $sanitize = new Sanitize(); 55 $escName = $sanitize->escape($this-> data['Group']['name']);55 $escName = $sanitize->escape($this->request->data['Group']['name']); 56 56 $groups = $this->Group->find('all', array('conditions' => "Group.user_id = $userId AND Group.name LIKE '%$escName%'")); 57 $this-> data = $groups;57 $this->request->data = $groups; 58 58 $this->layout = "bare"; 59 59 } 60 60 61 61 function create() { 62 if (!empty($this-> data)) {62 if (!empty($this->request->data)) { 63 63 $userId = $this->getUserId(); 64 $this-> data['Guest']['creator_id'] = $userId;65 $this-> data['Guest']['role'] = ROLE_GUEST;66 if ($this->Guest->hasAny(array("Guest.username" => $this-> data['Guest']['username']))) {67 $this->Session->setFlash(__("Sorry. Username is already taken" , true));68 } elseif ($this->Guest->save($this-> data, true, array('username', 'password', 'role', 'creator_id', 'email', 'quota'))) {64 $this->request->data['Guest']['creator_id'] = $userId; 65 $this->request->data['Guest']['role'] = ROLE_GUEST; 66 if ($this->Guest->hasAny(array("Guest.username" => $this->request->data['Guest']['username']))) { 67 $this->Session->setFlash(__("Sorry. Username is already taken")); 68 } elseif ($this->Guest->save($this->request->data, true, array('username', 'password', 'role', 'creator_id', 'email', 'quota'))) { 69 69 $guestId = $this->Guest->getLastInsertID(); 70 70 $guest = $this->Guest->findById($guestId); 71 71 $user = $this->getUser(); 72 72 Logger::info("User '{$user['User']['username']}' ({$user['User']['id']}) created a guest account '{$guest['Guest']['username']}' ({$guest['Guest']['id']})"); 73 $this->Session->setFlash( sprintf(__("Guest account '%s' was successfully created", true), $this->data['Guest']['username']));73 $this->Session->setFlash(__("Guest account '%s' was successfully created", $this->request->data['Guest']['username'])); 74 74 $this->redirect("edit/$guestId"); 75 75 } else { 76 $this->Session->setFlash(__("Sorry. Guest account could not created" , true));76 $this->Session->setFlash(__("Sorry. Guest account could not created")); 77 77 } 78 78 } … … 84 84 85 85 if (!$this->Guest->hasAny(array('id' => $guestId, 'creator_id' => $userId))) { 86 $this->Session->setFlash(__("Sorry. Could not find requested guest" , true));86 $this->Session->setFlash(__("Sorry. Could not find requested guest")); 87 87 Logger::debug("Sorry. Could not find requested guest '$guestId' of user '$userId'"); 88 88 $this->redirect("index"); 89 89 } 90 90 91 if (!empty($this-> data)) {91 if (!empty($this->request->data)) { 92 92 $this->Guest->id = $guestId; 93 $this->Guest->set($this-> data);93 $this->Guest->set($this->request->data); 94 94 if ($this->Guest->save(null, true, array('username', 'password', 'email', 'expires', 'quota'))) { 95 $this->Session->setFlash(__("Guest data were saved" , true));96 $auth = max(0, min(3, $this-> data['Comment']['auth']));95 $this->Session->setFlash(__("Guest data were saved")); 96 $auth = max(0, min(3, $this->request->data['Comment']['auth'])); 97 97 $this->Option->setValue('comment.auth', $auth, $guestId); 98 98 } else { 99 99 Logger::err("Could not save guest"); 100 100 Logger::trace($this->Guest->validationErrors); 101 $this->Session->setFlash(__("Updates could not be saved!" , true));102 } 103 } 104 $this-> data = $this->Guest->findById($guestId);105 unset($this-> data['Guest']['password']);106 $this-> data['Comment']['auth'] = $this->Option->getValue($this->data, 'comment.auth', COMMENT_AUTH_NONE);101 $this->Session->setFlash(__("Updates could not be saved!")); 102 } 103 } 104 $this->request->data = $this->Guest->findById($guestId); 105 unset($this->request->data['Guest']['password']); 106 $this->request->data['Comment']['auth'] = $this->Option->getValue($this->request->data, 'comment.auth', COMMENT_AUTH_NONE); 107 107 $this->set('userId', $userId); 108 $this->subMenu[] = array('url' => array('action' => $this->action, $guestId), 'title' => __("Edit" , true), 'active' => true,109 array('url' => array('action' => 'links', $guestId), 'title' => __("RSS" , true)),108 $this->subMenu[] = array('url' => array('action' => $this->action, $guestId), 'title' => __("Edit"), 'active' => true, 109 array('url' => array('action' => 'links', $guestId), 'title' => __("RSS")), 110 110 ); 111 111 } … … 115 115 function delete($guestId) { 116 116 $userId = $this->getUserId(); 117 $guest = $this->Guest->find( array('Guest.id' => $guestId, 'Creator.id' => $userId));117 $guest = $this->Guest->find('first', array('conditions' => array('Guest.id' => $guestId, 'Creator.id' => $userId))); 118 118 if (!$guest) { 119 $this->Session->setFlash(__("Could not find requested guest" , true));119 $this->Session->setFlash(__("Could not find requested guest")); 120 120 } else { 121 121 $user = $this->getUser(); 122 122 Logger::info("User '{$user['User']['username']}' ({$user['User']['id']}) deleted guest account '{$guest['Guest']['username']}' ({$guest['Guest']['id']})"); 123 $this->Session->setFlash( sprintf(__("Guest account '%s' deleted!", true), $guest['Guest']['username']));123 $this->Session->setFlash(__("Guest account '%s' deleted!", $guest['Guest']['username'])); 124 124 $this->Guest->delete($guestId); 125 125 } … … 128 128 129 129 function addGroup($groupId) { 130 if (!empty($this-> data)) {130 if (!empty($this->request->data)) { 131 131 $userId = $this->getUserId(); 132 $group = $this->Group->find( array('Group.name' => $this->data['Group']['name'], 'Group.user_id' => $userId));133 $guest = $this->Guest->find( array('Guest.id' => $groupId, 'Creator.id' => $userId));132 $group = $this->Group->find('first', array('conditions' => array('Group.name' => $this->request->data['Group']['name'], 'Group.user_id' => $userId))); 133 $guest = $this->Guest->find('first', array('conditions' => array('Guest.id' => $groupId, 'Creator.id' => $userId))); 134 134 135 135 if (!$guest) { … … 137 137 $this->redirect("index"); 138 138 } elseif (!$group) { 139 $this->Session->setFlash("The group '{$this-> data['Group']['name']}' does not exists!");139 $this->Session->setFlash("The group '{$this->request->data['Group']['name']}' does not exists!"); 140 140 } else { 141 141 $list = Set::extract($guest, "Member.{n}.id"); … … 146 146 if ($this->Guest->save()) { 147 147 Logger::info("Added group '{$group['Group']['name']}' ({$group['Group']['id']}) to guest '{$guest['Guest']['username']}' ({$guest['Guest']['id']})"); 148 $this->Session->setFlash("The group '{$this-> data['Group']['name']}' was added to your guest '{$guest['Guest']['username']}'");148 $this->Session->setFlash("The group '{$this->request->data['Group']['name']}' was added to your guest '{$guest['Guest']['username']}'"); 149 149 } else { 150 $this->Session->setFlash("The group '{$this-> data['Group']['name']}' could not be added to your guest '{$guest['Guest']['username']}'");150 $this->Session->setFlash("The group '{$this->request->data['Group']['name']}' could not be added to your guest '{$guest['Guest']['username']}'"); 151 151 } 152 152 } … … 160 160 $userId = $this->getUserId(); 161 161 162 $guest = $this->Guest->find( array('Guest.id' => $guestId, 'Creator.id' => $userId));162 $guest = $this->Guest->find('first', array('conditions' => array('Guest.id' => $guestId, 'Creator.id' => $userId))); 163 163 if (!$guest) { 164 164 $this->Session->setFlash("Could not find guest!"); … … 193 193 194 194 $userId = $this->getUserId(); 195 $guest = $this->Guest->find( array('Guest.id' => $guestId, 'Creator.id' => $userId));195 $guest = $this->Guest->find('first', array('conditions' => array('Guest.id' => $guestId, 'Creator.id' => $userId))); 196 196 if (!$guest) { 197 197 $this->Session->setFlash("Could not find guest!"); … … 211 211 } 212 212 } 213 $this-> data = $this->Guest->findById($guestId);214 $this->subMenu[] = array('url' => array('action' => 'edit', $guestId), 'title' => __("Edit" , true), 'active' => true,215 array('url' => array('action' => 'links', $guestId), 'title' => __("RSS" , true), 'active' => true),213 $this->request->data = $this->Guest->findById($guestId); 214 $this->subMenu[] = array('url' => array('action' => 'edit', $guestId), 'title' => __("Edit"), 'active' => true, 215 array('url' => array('action' => 'links', $guestId), 'title' => __("RSS"), 'active' => true), 216 216 ); 217 217 } -
Controller/HomeController.php
r3605ef4 ree4c2b7f 46 46 $this->uses = array('Media', 'Tag', 'Category', 'Comment'); 47 47 $this->constructClasses(); 48 $this->pageTitle = __("Home" , true);48 $this->pageTitle = __("Home"); 49 49 50 50 parent::beforeFilter(); -
Controller/ImagesController.php
r1a41cea ree4c2b7f 27 27 var $components = array('RequestHandler', 'Search', 'FastFileResponder'); 28 28 var $uses = array('Media', 'Group', 'Tag', 'Category', 'Location'); 29 var $helpers = array('Form', 'Html', ' Ajax', 'ImageData', 'Time', 'Search', 'ExplorerMenu', 'Rss', 'Map', 'Navigator', 'Flowplayer', 'Tab', 'Number', 'Option');29 var $helpers = array('Form', 'Html', 'ImageData', 'Time', 'Search', 'ExplorerMenu', 'Rss', 'Map', 'Navigator', 'Flowplayer', 'Tab', 'Number', 'Option', 'Autocomplete'); 30 30 var $crumbs = array(); 31 31 … … 37 37 $groupSelect = Set::combine($groups, '{n}.Group.id', '{n}.Group.name'); 38 38 asort($groupSelect); 39 $groupSelect[0] = __('[Keep]' , true);40 $groupSelect[-1] = __('[No Group]' , true);39 $groupSelect[0] = __('[Keep]'); 40 $groupSelect[-1] = __('[No Group]'); 41 41 $this->set('groups', $groupSelect); 42 42 } else { … … 65 65 * in the session to avoid multiple rating per session. */ 66 66 function _updateRating() { 67 if (!$this-> data || !isset($this->data['Media']['id'])) {67 if (!$this->request->data || !isset($this->request->data['Media']['id'])) { 68 68 Logger::warn("Precondition failed"); 69 69 return; … … 79 79 80 80 // Check for media rating 81 $id = $this-> data['Media']['id'];81 $id = $this->request->data['Media']['id']; 82 82 $ranked = array(); 83 83 if ($this->Session->check('Media.ranked')) { … … 89 89 } 90 90 91 $this->Media->updateRanking($this-> data);91 $this->Media->updateRanking($this->request->data); 92 92 93 93 // update rated media ids … … 97 97 98 98 function view($id) { 99 $this-> data = $this->Search->paginateMediaByCrumb($id, $this->crumbs);100 if (!$this-> data) {99 $this->request->data = $this->Search->paginateMediaByCrumb($id, $this->crumbs); 100 if (!$this->request->data) { 101 101 $this->render('notfound'); 102 102 } else { … … 118 118 $comment = $this->Session->read('Comment.data'); 119 119 $this->Comment->validationErrors = $this->Session->read('Comment.validationErrors'); 120 $this-> data['Comment'] = am($comment['Comment'], $this->data['Comment']);121 //$this-> data = am($this->Session->read('Comment.data'), $this->data);120 $this->request->data['Comment'] = am($comment['Comment'], $this->request->data['Comment']); 121 //$this->request->data = am($this->Session->read('Comment.data'), $this->request->data); 122 122 $this->Session->delete('Comment.data'); 123 123 } 124 $this->FastFileResponder->add($this-> data, 'preview');124 $this->FastFileResponder->add($this->request->data, 'preview'); 125 125 } 126 126 } 127 127 128 128 function update($id) { 129 if (!empty($this-> data)) {129 if (!empty($this->request->data)) { 130 130 $user = $this->getUser(); 131 131 $media = $this->Media->findById($id); … … 138 138 } else { 139 139 //$this->_checkAndSetGroupId(); 140 $tmp = $this->Media->editSingle(&$media, &$this-> data);140 $tmp = $this->Media->editSingle(&$media, &$this->request->data); 141 141 if (!$this->Media->save($tmp)) { 142 142 Logger::warn("Could not save media"); … … 159 159 160 160 function updateAcl($id) { 161 if (!empty($this-> data)) {161 if (!empty($this->request->data)) { 162 162 $user = $this->getUser(); 163 163 $media = $this->Media->findById($id); … … 169 169 Logger::warn("User '{$username}' ({$user['User']['id']}) has no previleges to change tags of image ".$id); 170 170 } else { 171 $this->Media->prepareGroupData(&$this-> data, &$user);171 $this->Media->prepareGroupData(&$this->request->data, &$user); 172 172 $tmp = array('Media' => array('id' => $id)); 173 $this->Media->updateAcl(&$tmp, &$media, &$this-> data);173 $this->Media->updateAcl(&$tmp, &$media, &$this->request->data); 174 174 $this->Media->save($tmp, true); 175 175 Logger::info("Changed acl of media $id"); -
Controller/OptionsController.php
r1a41cea ree4c2b7f 30 30 function beforeFilter() { 31 31 $this->subMenu = array( 32 'acl' => __("Default Rights" , true),33 'profile' => __("Profile" , true),34 'rss' => __("RSS Feeds" , true),32 'acl' => __("Default Rights"), 33 'profile' => __("Profile"), 34 'rss' => __("RSS Feeds"), 35 35 ); 36 36 parent::beforeFilter(); … … 57 57 58 58 $userId = $this->getUserId(); 59 if ( isset($this->data)) {59 if (!empty($this->request->data)) { 60 60 // TODO check valid acl 61 $this->_set($userId, 'acl.group', $this-> data);61 $this->_set($userId, 'acl.group', $this->request->data); 62 62 63 63 // check values 64 if ($this->data['acl']['write']['meta'] > $this->data['acl']['write']['tag']) 65 $this->data['acl']['write']['meta'] = $this->data['acl']['write']['tag']; 66 if ($this->data['acl']['read']['original'] > $this->data['acl']['read']['preview']) 67 $this->data['acl']['read']['original'] = $this->data['acl']['read']['preview']; 64 if ($this->request->data['acl']['write']['meta'] > $this->request->data['acl']['write']['tag']) { 65 $this->request->data['acl']['write']['meta'] = $this->request->data['acl']['write']['tag']; 66 } 67 if ($this->request->data['acl']['read']['original'] > $this->request->data['acl']['read']['preview']) { 68 $this->request->data['acl']['read']['original'] = $this->request->data['acl']['read']['preview']; 69 } 68 70 69 $this->_set($userId, 'acl.write.tag', $this-> data);70 $this->_set($userId, 'acl.write.meta', $this-> data);71 $this->_set($userId, 'acl.write.tag', $this->request->data); 72 $this->_set($userId, 'acl.write.meta', $this->request->data); 71 73 72 $this->_set($userId, 'acl.read.original', $this-> data);73 $this->_set($userId, 'acl.read.preview', $this-> data);74 $this->_set($userId, 'acl.read.original', $this->request->data); 75 $this->_set($userId, 'acl.read.preview', $this->request->data); 74 76 75 $this->Session->setFlash(__("Settings saved" , true));77 $this->Session->setFlash(__("Settings saved")); 76 78 } 77 79 $tree = $this->Option->getTree($userId); 78 80 $this->Option->addDefaultAclTree(&$tree); 79 $this-> data = $tree;81 $this->request->data = $tree; 80 82 81 83 $this->set('userId', $userId); … … 86 88 $groups = array(); 87 89 } 88 $groups[-1] = __('[No Group]' , true);90 $groups[-1] = __('[No Group]'); 89 91 $this->set('groups', $groups); 90 92 } … … 94 96 95 97 $userId = $this->getUserId(); 96 if (!empty($this-> data)) {98 if (!empty($this->request->data)) { 97 99 $this->User->id = $userId; 98 if (!$this->User->save($this-> data['User'], true, array('username', 'firstname', 'lastname', 'password', 'email', 'visible_level', 'notify_interval'))) {100 if (!$this->User->save($this->request->data['User'], true, array('username', 'firstname', 'lastname', 'password', 'email', 'visible_level', 'notify_interval'))) { 99 101 Logger::err("Could not update user profile"); 100 $this->Session->setFlash(__("Could not save profile!" , true));102 $this->Session->setFlash(__("Could not save profile!")); 101 103 } else { 102 104 Logger::info("User $userId profile updated"); 103 $this->Session->setFlash(__("Profile saved" , true));105 $this->Session->setFlash(__("Profile saved")); 104 106 } 105 $browser = Set::extract("/Option/user/browser/full", $this-> data);107 $browser = Set::extract("/Option/user/browser/full", $this->request->data); 106 108 $this->Option->setValue('user.browser.full', $browser[0], $userId); 107 109 } 108 $this-> data = $this->User->findById($userId);109 $this-> data['Option'] = $this->Option->getTree($userId);110 unset($this-> data['User']['password']);110 $this->request->data = $this->User->findById($userId); 111 $this->request->data['Option'] = $this->Option->getTree($userId); 112 unset($this->request->data['User']['password']); 111 113 } 112 114 … … 124 126 } 125 127 } 126 $this-> data = $this->User->findById($userId);128 $this->request->data = $this->User->findById($userId); 127 129 } 128 130 -
Controller/SetupController.php
rbbc826a ree4c2b7f 317 317 $newContent = preg_replace("/$oldSalt/", $salt, $content); 318 318 if (!$file->write($newContent)) { 319 $this->Session->setFlash( sprintf(__("Could not write configuration to '%s'", true), $this->core));319 $this->Session->setFlash(__("Could not write configuration to '%s'", $this->core)); 320 320 Logger::err("Could not write configuration to '$this->core'"); 321 321 } else { … … 324 324 $this->Session->renew(); 325 325 326 $this->Session->setFlash(__("Update core settings" , true));326 $this->Session->setFlash(__("Update core settings")); 327 327 Logger::info("Set new security salt to '$this->core'"); 328 328 $this->redirect('index'); … … 395 395 $this->Session->delete('configError'); 396 396 397 if (!empty($this-> data)) {397 if (!empty($this->request->data)) { 398 398 $output = "<?php 399 399 /** … … 407 407 'datasource' => 'Database/Mysql', 408 408 'persistent' => true, 409 'host' => '{$this-> data['db']['host']}',410 'login' => '{$this-> data['db']['login']}',411 'password' => '{$this-> data['db']['password']}',412 'database' => '{$this-> data['db']['database']}',413 'prefix' => '{$this-> data['db']['prefix']}',409 'host' => '{$this->request->data['db']['host']}', 410 'login' => '{$this->request->data['db']['login']}', 411 'password' => '{$this->request->data['db']['password']}', 412 'database' => '{$this->request->data['db']['database']}', 413 'prefix' => '{$this->request->data['db']['prefix']}', 414 414 'encoding' => 'utf8' 415 415 ); … … 423 423 } else { 424 424 Logger::err("Could not write database configuration file '{$this->dbConfig}'"); 425 $this->Session->setFlash(__("Could not write database configuration file" , true));425 $this->Session->setFlash(__("Could not write database configuration file")); 426 426 } 427 427 $file->close(); 428 unset($this-> data['db']['password']);429 $this->Session->write('configData', $this-> data);428 unset($this->request->data['db']['password']); 429 $this->Session->write('configData', $this->request->data); 430 430 } else { 431 431 if ($this->Session->check('configData')) { … … 460 460 461 461 if (!$this->__hasConnection()) { 462 $this->Session->setFlash(__('Could not connect to database. Please check your database configuration!' , true));462 $this->Session->setFlash(__('Could not connect to database. Please check your database configuration!')); 463 463 $this->Session->write('configError', true); 464 464 $this->redirect('config'); … … 484 484 } 485 485 Logger::info("Successful database migration to verion " . $this->Migration->getVersion('app')); 486 $this->Session->setFlash(__("All required tables are created" , true));486 $this->Session->setFlash(__("All required tables are created")); 487 487 $this->redirect('user'); 488 488 } catch (MigrationVersionException $errors) { 489 489 Logger::trace($errors->getMessage()); 490 $this->Session->setFlash(__("Could not create tables correctly. Please see logfile for details" , true));490 $this->Session->setFlash(__("Could not create tables correctly. Please see logfile for details")); 491 491 } 492 492 } … … 516 516 $this->Session->write('User.username', $this->request->data['User']['username']); 517 517 Logger::info("Admin account '{$this->request->data['User']['username']}' was created"); 518 $this->Session->setFlash(__("Admin account was successfully created" , true));518 $this->Session->setFlash(__("Admin account was successfully created")); 519 519 $this->redirect('system'); 520 520 } else { 521 521 Logger::err("Admin account '{$this->request->data['User']['username']}' could not be created"); 522 $this->Session->setFlash(__("Could not create admin account. Please retry" , true));522 $this->Session->setFlash(__("Could not create admin account. Please retry")); 523 523 } 524 524 } elseif (!isset($this->request->data['User']['username'])) { … … 689 689 if (!$this->_initMigration()) { 690 690 Logger::err("Cannot init migration data"); 691 $this->Session->setFlash(__("Cannot initialize database migration data" , true));691 $this->Session->setFlash(__("Cannot initialize database migration data")); 692 692 return false; 693 693 } -
Controller/SystemController.php
r1a41cea ree4c2b7f 25 25 var $name = 'System'; 26 26 var $helpers = array('Form'); 27 var $uses = array(' Option');27 var $uses = array('Media', 'Option'); 28 28 var $subMenu = array(); 29 29 … … 33 33 34 34 $this->subMenu = array( 35 'index' => __("General" , true),36 'external' => __("External Programs" , true),37 'map' => __("Map Settings" , true),38 'upgrade' => __("Database Upgrade" , true),39 'deleteUnusedMetaData' => __("Delete Unused Metadata" , true)35 'index' => __("General"), 36 'external' => __("External Programs"), 37 'map' => __("Map Settings"), 38 'upgrade' => __("Database Upgrade"), 39 'deleteUnusedMetaData' => __("Delete Unused Metadata") 40 40 ); 41 41 } … … 52 52 53 53 function index() { 54 if (isset($this-> data)) {55 $this->_set(0, 'general.title', $this-> data);56 $this->_set(0, 'general.subtitle', $this-> data);54 if (isset($this->request->data)) { 55 $this->_set(0, 'general.title', $this->request->data); 56 $this->_set(0, 'general.subtitle', $this->request->data); 57 57 } 58 $this-> data = $this->Option->getTree(0);58 $this->request->data = $this->Option->getTree(0); 59 59 } 60 60 61 61 function external() { 62 if (!empty($this-> data)) {62 if (!empty($this->request->data)) { 63 63 // TODO check valid acl 64 $this->_set(0, 'bin.exiftool', $this-> data);65 $this->_set(0, 'bin.convert', $this-> data);66 $this->_set(0, 'bin.ffmpeg', $this-> data);67 $this->_set(0, 'bin.flvtool2', $this-> data);64 $this->_set(0, 'bin.exiftool', $this->request->data); 65 $this->_set(0, 'bin.convert', $this->request->data); 66 $this->_set(0, 'bin.ffmpeg', $this->request->data); 67 $this->_set(0, 'bin.flvtool2', $this->request->data); 68 68 // debug 69 $this->set('commit', $this-> data);69 $this->set('commit', $this->request->data); 70 70 $this->Session->setFlash("Settings saved"); 71 71 } 72 72 $tree = $this->Option->getTree(0); 73 $this-> data = $tree;73 $this->request->data = $tree; 74 74 } 75 75 76 76 function map() { 77 if (!empty($this-> data)) {78 $this->_set(0, 'google.map.key', $this-> data);77 if (!empty($this->request->data)) { 78 $this->_set(0, 'google.map.key', $this->request->data); 79 79 // debug 80 $this->set('commit', $this-> data);80 $this->set('commit', $this->request->data); 81 81 $this->Session->setFlash("Settings saved"); 82 82 } 83 83 $tree = $this->Option->getTree(0); 84 $this-> data = $tree;84 $this->request->data = $tree; 85 85 } 86 86 87 87 /** Database upgrade via the Migraions plugin */ 88 88 function upgrade($action = '') { 89 CakePlugin::load('Migrations'); 89 90 App::import('Lib', 'Migrations.MigrationVersion'); 90 91 $Migration = new MigrationVersion(array('connection' => 'default')); … … 101 102 if ($action == 'run' && $currentVersion < $migrationVersion) { 102 103 if (!$Migration->run(array('type' => 'app', 'direction' => 'up'))) { 103 $this->Session->setFlash(__("Database migration failed. Please see the log files for errors." , true));104 $this->Session->setFlash(__("Database migration failed. Please see the log files for errors.")); 104 105 Logger::error("Could not run migration"); 105 106 } else { 106 107 Logger::info("Upgraded database from version $currentVersion to " . max(array_keys($Migration->getMapping('app')))); 107 $this->Session->setFlash(__("The database migration was successful." , true));108 $this->Session->setFlash(__("The database migration was successful.")); 108 109 } 109 110 } … … 122 123 123 124 function deleteUnusedMetaData($delete = '') { 124 App::import('Model', array('Tag', 'Category', 'Location')); 125 $this->Media->Tag->bindModel(array('hasAndBelongsToMany' => array('Media')), false); 126 $this->Media->Tag->Behaviors->attach('DeleteUnused', array('relatedHabtm' => 'Media')); 125 127 126 $this->Tag =& new Tag(); 127 $this->Tag->bindModel(array('hasAndBelongsToMany' => array('Media')), false); 128 $this->Tag->Behaviors->attach('DeleteUnused', array('relatedHabtm' => 'Media')); 129 $unusedTagCount = count($this->Tag->findAllUnused()); 128 $this->Media->Category->bindModel(array('hasAndBelongsToMany' => array('Media')), false); 129 $this->Media->Category->Behaviors->attach('DeleteUnused', array('relatedHabtm' => 'Media')); 130 130 131 $this->Category =& new Category(); 132 $this->Category->bindModel(array('hasAndBelongsToMany' => array('Media')), false); 133 $this->Category->Behaviors->attach('DeleteUnused', array('relatedHabtm' => 'Media')); 134 $unusedCategoryCount = count($this->Category->findAllUnused()); 135 136 $this->Location =& new Location(); 137 $this->Location->bindModel(array('hasAndBelongsToMany' => array('Media')), false); 138 $this->Location->Behaviors->attach('DeleteUnused', array('relatedHabtm' => 'Media')); 139 $unusedLocationCount = count($this->Location->findAllUnused()); 131 $this->Media->Location->bindModel(array('hasAndBelongsToMany' => array('Media')), false); 132 $this->Media->Location->Behaviors->attach('DeleteUnused', array('relatedHabtm' => 'Media')); 140 133 141 134 if ($delete == 'delete') { 142 $this-> Tag->deleteAllUnused();143 $this-> Location->deleteAllUnused();144 $this-> Category->deleteAllUnused();145 $this->Session->setFlash(__("All unused meta data are deleted" , true));135 $this->Media->Tag->deleteAllUnused(); 136 $this->Media->Location->deleteAllUnused(); 137 $this->Media->Category->deleteAllUnused(); 138 $this->Session->setFlash(__("All unused meta data are deleted")); 146 139 } 147 $this->data = compact('unusedTagCount', 'unusedCategoryCount', 'unusedLocationCount'); 140 141 $unusedTagCount = count($this->Media->Tag->findAllUnused()); 142 $unusedCategoryCount = count($this->Media->Category->findAllUnused()); 143 $unusedLocationCount = count($this->Media->Location->findAllUnused()); 144 145 $this->request->data = compact('unusedTagCount', 'unusedCategoryCount', 'unusedLocationCount'); 148 146 } 149 147 } -
Controller/UsersController.php
re449ecc0 ree4c2b7f 33 33 parent::beforeFilter(); 34 34 $this->subMenu = array( 35 'index' => __("List User" , true),35 'index' => __("List User"), 36 36 ); 37 37 if ($this->hasRole(ROLE_SYSOP)) { 38 38 $this->subMenu = am($this->subMenu, array( 39 array('action' => 'add', 'title' => __("Add User" , true), 'admin' => true),40 array('action' => 'register', 'title' => __("Registration" , true), 'admin' => true),39 array('action' => 'add', 'title' => __("Add User"), 'admin' => true), 40 array('action' => 'register', 'title' => __("Registration"), 'admin' => true), 41 41 )); 42 42 } … … 90 90 function index() { 91 91 $this->set('isAdmin', $this->hasRole(ROLE_SYSOP)); 92 $this-> data = $this->User->findVisibleUsers($this->getUser());92 $this->request->data = $this->User->findVisibleUsers($this->getUser()); 93 93 } 94 94 95 95 function view($name) { 96 $this-> data = $this->User->findVisibleUsers($this->getUser(), $name);97 if (!$this-> data) {96 $this->request->data = $this->User->findVisibleUsers($this->getUser(), $name); 97 if (!$this->request->data) { 98 98 $this->redirect('index'); 99 99 } 100 $userId = $this-> data['User']['id'];101 $this-> data['Media']['count'] = $this->Media->find('count', array('conditions' => array('Media.user_id' => $userId), 'recursive' => -1));102 $this-> data['File']['count'] = $this->MyFile->find('count', array('conditions' => array('File.user_id' => $userId), 'recursive' => -1));100 $userId = $this->request->data['User']['id']; 101 $this->request->data['Media']['count'] = $this->Media->find('count', array('conditions' => array('Media.user_id' => $userId), 'recursive' => -1)); 102 $this->request->data['File']['count'] = $this->MyFile->find('count', array('conditions' => array('File.user_id' => $userId), 'recursive' => -1)); 103 103 $bytes = $this->MyFile->find('all', array('conditions' => array("File.user_id" => $userId), 'recursive' => -1, 'fields' => 'SUM(File.size) AS Bytes')); 104 $this-> data['File']['bytes'] = $bytes[0][0]['Bytes'];104 $this->request->data['File']['bytes'] = $bytes[0][0]['Bytes']; 105 105 106 106 $groupUserIds = Set::extract('/Group/user_id'); 107 107 $this->set('users', $this->User->find('all', array('condition' => array('User.id' => $groupUserIds), 'recursive' => -1))); 108 108 109 $this->Search->setUser($this-> data['User']['username']);109 $this->Search->setUser($this->request->data['User']['username']); 110 110 $this->Search->setShow(6); 111 111 $this->set('media', $this->Search->paginate()); … … 115 115 * set the user is forwarded to this given address on successful login. */ 116 116 function login() { 117 $failedText = __("Sorry. Wrong password or unknown username!" , true);118 if (!empty($this-> data) && !$this->RequestHandler->isPost()) {117 $failedText = __("Sorry. Wrong password or unknown username!"); 118 if (!empty($this->request->data) && !$this->RequestHandler->isPost()) { 119 119 Logger::warn("Authentication failed: Request was not HTTP POST"); 120 120 $this->Session->setFlash($failedText); 121 $this-> data = null;122 } 123 if (empty($this-> data['User']['username']) xor empty($this->data['User']['password'])) {121 $this->request->data = null; 122 } 123 if (empty($this->request->data['User']['username']) xor empty($this->request->data['User']['password'])) { 124 124 Logger::warn("Authentication failed: Username or password are not set"); 125 $this->Session->setFlash(__("Please enter username and password!" , true));126 $this-> data = null;127 } 128 129 if (!empty($this-> data)) {130 $user = $this->User->findByUsername($this-> data['User']['username']);125 $this->Session->setFlash(__("Please enter username and password!")); 126 $this->request->data = null; 127 } 128 129 if (!empty($this->request->data)) { 130 $user = $this->User->findByUsername($this->request->data['User']['username']); 131 131 132 132 if (!$user) { 133 Logger::warn("Authentication failed: Unknown username '{$this-> data['User']['username']}'!");133 Logger::warn("Authentication failed: Unknown username '{$this->request->data['User']['username']}'!"); 134 134 $this->Session->setFlash($failedText); 135 135 } elseif ($this->User->isExpired($user)) { 136 136 Logger::warn("User account of '{$user['User']['username']}' (id {$user['User']['id']}) is expired!"); 137 $this->Session->setFlash(__("Sorry. Your account is expired!" , true));137 $this->Session->setFlash(__("Sorry. Your account is expired!")); 138 138 } else { 139 139 $user = $this->User->decrypt(&$user); 140 if ($user['User']['password'] == $this-> data['User']['password']) {140 if ($user['User']['password'] == $this->request->data['User']['password']) { 141 141 $this->Session->renew(); 142 $this->Session->activate();143 142 if (!$this->Session->check('User.id') || $this->Session->read('User.id') != $user['User']['id']) { 144 143 Logger::info("Start new session for '{$user['User']['username']}' (id {$user['User']['id']})"); … … 158 157 } else { 159 158 Logger::err("Could not write session information of user '{$user['User']['username']}' ({$user['User']['id']})"); 160 $this->Session->setFlash(__("Sorry. Internal login procedure failed!" , true));159 $this->Session->setFlash(__("Sorry. Internal login procedure failed!")); 161 160 } 162 161 } else { 163 Logger::warn("Authentication failed: Incorrect password of username '{$this-> data['User']['username']}'!");162 Logger::warn("Authentication failed: Incorrect password of username '{$this->request->data['User']['username']}'!"); 164 163 $this->Session->setFlash($failedText); 165 164 } 166 165 } 167 unset($this-> data['User']['password']);166 unset($this->request->data['User']['password']); 168 167 } 169 168 $this->set('register', $this->Option->getValue($this->getUser(), 'user.register.enable', 0)); … … 186 185 $this->requireRole(ROLE_SYSOP, array('loginRedirect' => '/admin/users')); 187 186 188 $this-> data = $this->paginate('User', array('User.role>='.ROLE_USER));187 $this->request->data = $this->paginate('User', array('User.role>='.ROLE_USER)); 189 188 } 190 189 … … 195 194 $userId = $this->getUserId(); 196 195 $userRole = $this->getUserRole(); 197 if ($userId == $id && $userRole == ROLE_ADMIN && $this-> data['User']['role'] < ROLE_ADMIN) {196 if ($userId == $id && $userRole == ROLE_ADMIN && $this->request->data['User']['role'] < ROLE_ADMIN) { 198 197 $count = $this->User->find('count', array('conditions' => array('User.role >= '.ROLE_ADMIN))); 199 198 if ($count == 1) { 200 199 Logger::warn('Can not degrade last admin'); 201 $this->Session->setFlash(__('Can not degrade last admin' , true));200 $this->Session->setFlash(__('Can not degrade last admin')); 202 201 return false; 203 202 } … … 209 208 function _addAdminEditMenu($userId) { 210 209 $subActions = array( 211 'password' => __("Password" , true),212 'path' => __("Local Paths" , true));213 $subItems = array('url' => array('admin' => true, 'action' => 'edit', $userId), 'title' => __('Edit' , true), 'active' => true);210 'password' => __("Password"), 211 'path' => __("Local Paths")); 212 $subItems = array('url' => array('admin' => true, 'action' => 'edit', $userId), 'title' => __('Edit'), 'active' => true); 214 213 foreach ($subActions as $action => $title) { 215 214 $subItems[] = array('url' => array('admin' => true, 'action' => $action, $userId), 'title' => $title, 'active' => ('admin_'.$action == $this->action)); … … 223 222 224 223 $id = intval($id); 225 if (!empty($this-> data) && $this->_lastAdminCheck($id)) {226 $this-> data['User']['id'] = $id;227 228 if ($this->User->save($this-> data, true, array('email', 'expires', 'quota', 'firstname', 'lastname', 'role'))) {229 Logger::debug("Data of user {$this-> data['User']['id']} was updated");230 $this->Session->setFlash(__('User data was updated' , true));224 if (!empty($this->request->data) && $this->_lastAdminCheck($id)) { 225 $this->request->data['User']['id'] = $id; 226 227 if ($this->User->save($this->request->data, true, array('email', 'expires', 'quota', 'firstname', 'lastname', 'role'))) { 228 Logger::debug("Data of user {$this->request->data['User']['id']} was updated"); 229 $this->Session->setFlash(__('User data was updated')); 231 230 } else { 232 231 Logger::err("Could not save user data"); 233 232 Logger::debug($this->User->validationErrors); 234 $this->Session->setFlash(__('Could not be updated' , true));235 } 236 } 237 238 $this-> data = $this->User->findById($id);233 $this->Session->setFlash(__('Could not be updated')); 234 } 235 } 236 237 $this->request->data = $this->User->findById($id); 239 238 $this->set('allowAdminRole', ($this->getUserRole() == ROLE_ADMIN) ? true : false); 240 239 … … 246 245 247 246 $id = intval($id); 248 if (!empty($this-> data)) {249 $this-> data['User']['id'] = $id;250 251 if ($this->User->save($this-> data, true, array('password'))) {252 Logger::debug("Data of user {$this-> data['User']['id']} was updated");253 $this->Session->setFlash(__('User data was updated' , true));247 if (!empty($this->request->data)) { 248 $this->request->data['User']['id'] = $id; 249 250 if ($this->User->save($this->request->data, true, array('password'))) { 251 Logger::debug("Data of user {$this->request->data['User']['id']} was updated"); 252 $this->Session->setFlash(__('User data was updated')); 254 253 } else { 255 254 Logger::err("Could not save user data"); 256 255 Logger::debug($this->User->validationErrors); 257 $this->Session->setFlash(__('Could not be updated' , true));258 } 259 } 260 261 $this-> data = $this->User->findById($id);262 unset($this-> data['User']['password']);256 $this->Session->setFlash(__('Could not be updated')); 257 } 258 } 259 260 $this->request->data = $this->User->findById($id); 261 unset($this->request->data['User']['password']); 263 262 264 263 $this->_addAdminEditMenu($id); … … 269 268 270 269 $id = intval($id); 271 if (!empty($this-> data)) {272 $this-> data['User']['id'] = $id;273 274 $this->User->set($this-> data);275 276 if (!empty($this-> data['Option']['path']['fspath'])) {277 $fsroot = $this-> data['Option']['path']['fspath'];270 if (!empty($this->request->data)) { 271 $this->request->data['User']['id'] = $id; 272 273 $this->User->set($this->request->data); 274 275 if (!empty($this->request->data['Option']['path']['fspath'])) { 276 $fsroot = $this->request->data['Option']['path']['fspath']; 278 277 $fsroot = Folder::slashTerm($fsroot); 279 278 280 279 if (is_dir($fsroot) && is_readable($fsroot)) { 281 280 $this->Option->addValue('path.fsroot[]', $fsroot, $id); 282 $this->Session->setFlash( sprintf(__("Directory '%s' was added", true), $fsroot));281 $this->Session->setFlash(__("Directory '%s' was added", $fsroot)); 283 282 Logger::info("Add external directory '$fsroot' to user $id"); 284 283 } else { 285 $this->Session->setFlash( sprintf(__("Directory '%s' could not be read", true), $fsroot));284 $this->Session->setFlash(__("Directory '%s' could not be read", $fsroot)); 286 285 Logger::err("Directory '$fsroot' could not be read"); 287 286 } … … 289 288 } 290 289 291 $this-> data = $this->User->findById($id);292 unset($this-> data['User']['password']);293 294 $this->set('fsroots', $this->Option->buildTree($this-> data, 'path.fsroot'));290 $this->request->data = $this->User->findById($id); 291 unset($this->request->data['User']['password']); 292 293 $this->set('fsroots', $this->Option->buildTree($this->request->data, 'path.fsroot')); 295 294 $this->_addAdminEditMenu($id); 296 295 } … … 299 298 $this->requireRole(ROLE_SYSOP, array('loginRedirect' => '/admin/users')); 300 299 301 if (!empty($this-> data)) {302 if ($this->User->hasAny(array('User.username' => $this-> data['User']['username']))) {303 $this->Session->setFlash(__('Username already exists, please choose a different name!' , true));300 if (!empty($this->request->data)) { 301 if ($this->User->hasAny(array('User.username' => $this->request->data['User']['username']))) { 302 $this->Session->setFlash(__('Username already exists, please choose a different name!')); 304 303 } else { 305 $this-> data['User']['role'] = ROLE_USER;306 if ($this->User->save($this-> data, true, array('username', 'password', 'role', 'email'))) {307 Logger::info("New user {$this-> data['User']['username']} was created");308 $this->Session->setFlash(__('User was created' , true));304 $this->request->data['User']['role'] = ROLE_USER; 305 if ($this->User->save($this->request->data, true, array('username', 'password', 'role', 'email'))) { 306 Logger::info("New user {$this->request->data['User']['username']} was created"); 307 $this->Session->setFlash(__('User was created')); 309 308 $this->redirect('/admin/users/edit/'.$this->User->id); 310 309 } else { 311 Logger::warn("Creation of user {$this-> data['User']['username']} failed");312 $this->Session->setFlash(__('Could not create user!' , true));310 Logger::warn("Creation of user {$this->request->data['User']['username']} failed"); 311 $this->Session->setFlash(__('Could not create user!')); 313 312 } 314 313 } … … 322 321 $user = $this->User->findById($id); 323 322 if (!$user) { 324 $this->Session->setFlash(__("Could not delete user: user not found!" , true));323 $this->Session->setFlash(__("Could not delete user: user not found!")); 325 324 $this->redirect('index'); 326 325 } else { 327 326 $this->User->delete($id); 328 327 Logger::notice("All data of user '{$user['User']['username']}' ($id) deleted"); 329 $this->Session->setFlash( sprintf(__("User %s was deleted", true), $user['User']['username']));328 $this->Session->setFlash(__("User %s was deleted", $user['User']['username'])); 330 329 $this->redirect('index'); 331 330 } … … 346 345 $this->Option->delValue('path.fsroot[]', $fsroot, $id); 347 346 Logger::info("Deleted external directory '$fsroot' from user $id"); 348 $this->Session->setFlash( sprintf(__("Deleted external directory '%s'", true), $fsroot));347 $this->Session->setFlash(__("Deleted external directory '%s'", $fsroot)); 349 348 $this->redirect("path/$id"); 350 349 } … … 353 352 $this->requireRole(ROLE_SYSOP, array('loginRedirect' => '/admin/users')); 354 353 355 if (!empty($this-> data)) {356 if ($this-> data['user']['register']['enable']) {354 if (!empty($this->request->data)) { 355 if ($this->request->data['user']['register']['enable']) { 357 356 $this->Option->setValue('user.register.enable', 1, 0); 358 357 } else { 359 358 $this->Option->setValue('user.register.enable', 0, 0); 360 359 } 361 $quota = $this->__fromReadableSize($this-> data['user']['register']['quota']);360 $quota = $this->__fromReadableSize($this->request->data['user']['register']['quota']); 362 361 $this->Option->setValue('user.register.quota', $quota, 0); 363 $this->Session->setFlash(__("Options saved!" , true));364 } 365 $this-> data = $this->Option->getTree($this->getUserId());362 $this->Session->setFlash(__("Options saved!")); 363 } 364 $this->request->data = $this->Option->getTree($this->getUserId()); 366 365 367 366 // add default values 368 if (!isset($this-> data['user']['register']['enable'])) {369 $this-> data['user']['register']['enable'] = 0;370 } 371 if (!isset($this-> data['user']['register']['quota'])) {372 $this-> data['user']['register']['quota'] = (float)100*1024*1024;367 if (!isset($this->request->data['user']['register']['enable'])) { 368 $this->request->data['user']['register']['enable'] = 0; 369 } 370 if (!isset($this->request->data['user']['register']['quota'])) { 371 $this->request->data['user']['register']['quota'] = (float)100*1024*1024; 373 372 } 374 373 … … 377 376 /** Password recovery */ 378 377 function password() { 379 if (!empty($this-> data)) {380 $user = $this->User->find( array(381 'username' => $this-> data['User']['username'],382 'email' => $this-> data['User']['email']));378 if (!empty($this->request->data)) { 379 $user = $this->User->find('first', array('conditions' => array( 380 'username' => $this->request->data['User']['username'], 381 'email' => $this->request->data['User']['email']))); 383 382 if (empty($user)) { 384 $this->Session->setFlash(__('No user with this email was found' , true));383 $this->Session->setFlash(__('No user with this email was found')); 385 384 Logger::warn(sprintf("No user '%s' with email %s was found", 386 $this-> data['User']['username'], $this->data['User']['email']));385 $this->request->data['User']['username'], $this->request->data['User']['email'])); 387 386 } else { 388 387 $this->Email->to = sprintf("%s %s <%s>", … … 402 401 $user['User']['id'], 403 402 $user['User']['email'])); 404 $this->Session->setFlash(__('Mail was sent!' , true));403 $this->Session->setFlash(__('Mail was sent!')); 405 404 } else { 406 405 Logger::err(sprintf("Could not send password mail to user '%s' (id %d) with address '%s'", … … 408 407 $user['User']['id'], 409 408 $user['User']['email'])); 410 $this->Session->setFlash(__('Mail could not be sent: unknown error!' , true));409 $this->Session->setFlash(__('Mail could not be sent: unknown error!')); 411 410 } 412 411 } … … 423 422 } 424 423 425 if (!empty($this-> data)) {426 if ($this-> data['Captcha']['verification'] != $this->Session->read('user.register.captcha')) {427 $this->Session->setFlash(__('Captcha verification failed' , true));424 if (!empty($this->request->data)) { 425 if ($this->request->data['Captcha']['verification'] != $this->Session->read('user.register.captcha')) { 426 $this->Session->setFlash(__('Captcha verification failed')); 428 427 Logger::verbose("Captcha verification failed"); 429 } elseif ($this->User->hasAny(array('User.username' => $this-> data['User']['username']))) {430 $this->Session->setFlash(__('Username already exists, please choose different name!' , true));431 Logger::info("Username already exists: {$this-> data['User']['username']}");428 } elseif ($this->User->hasAny(array('User.username' => $this->request->data['User']['username']))) { 429 $this->Session->setFlash(__('Username already exists, please choose different name!')); 430 Logger::info("Username already exists: {$this->request->data['User']['username']}"); 432 431 } else { 433 $user = $this->User->create($this-> data);432 $user = $this->User->create($this->request->data); 434 433 if ($this->User->save($user['User'], true, array('id', 'username', 'password', 'email'))) { 435 Logger::info("New user {$this-> data['User']['username']} was created");434 Logger::info("New user {$this->request->data['User']['username']} was created"); 436 435 $this->_initRegisteredUser($this->User->getLastInsertID()); 437 436 } else { 438 Logger::err("Creation of user {$this-> data['User']['username']} failed");439 $this->Session->setFlash(__('Could not create user' , true));437 Logger::err("Creation of user {$this->request->data['User']['username']} failed"); 438 $this->Session->setFlash(__('Could not create user')); 440 439 } 441 440 } 442 441 } 443 unset($this-> data['User']['password']);444 unset($this-> data['User']['confirm']);445 unset($this-> data['Captcha']['verification']);442 unset($this->request->data['User']['password']); 443 unset($this->request->data['User']['confirm']); 444 unset($this->request->data['Captcha']['verification']); 446 445 $this->layout = 'default'; 447 446 } … … 474 473 // send confimation email 475 474 if (!$this->_sendConfirmationEmail($user, $key)) { 476 $this->Session->setFlash(__("Could not send the confirmation email. Please contact the admin." , true));477 return false; 478 } 479 $this->Session->setFlash(__("A confirmation email was sent to your email address" , true));475 $this->Session->setFlash(__("Could not send the confirmation email. Please contact the admin.")); 476 return false; 477 } 478 $this->Session->setFlash(__("A confirmation email was sent to your email address")); 480 479 $this->redirect("/users/confirm"); 481 480 } … … 489 488 } 490 489 491 if (!$key && !empty($this-> data)) {490 if (!$key && !empty($this->request->data)) { 492 491 // check user input 493 if (empty($this-> data['User']['key'])) {494 $this->Session->setFlash(__("Please enter the confirmation key" , true));492 if (empty($this->request->data['User']['key'])) { 493 $this->Session->setFlash(__("Please enter the confirmation key")); 495 494 } else { 496 $key = $this-> data['User']['key'];495 $key = $this->request->data['User']['key']; 497 496 } 498 497 } … … 507 506 function _checkConfirmation($key) { 508 507 // check key. Option [belongsTo] User: The user is bound to option 509 $user = $this->Option->find( array("Option.value" => $key));508 $user = $this->Option->find('first', array('conditions' => array("Option.value" => $key))); 510 509 if (!$user) { 511 510 Logger::trace("Could not find confirmation key"); 512 $this->Session->setFlash(__("Could not find confirmation key" , true));511 $this->Session->setFlash(__("Could not find confirmation key")); 513 512 return false; 514 513 } … … 516 515 if (!isset($user['User']['id'])) { 517 516 Logger::err("Could not find the user for register confirmation"); 518 $this->Session->setFlash(__("Internal error occured" , true));517 $this->Session->setFlash(__("Internal error occured")); 519 518 return false; 520 519 } … … 525 524 $expires = strtotime($user['User']['expires']); 526 525 if ($now - $expires > (14 * 24 * 3600 + 3600)) { 527 $this->Session->setFlash(__("Could not find confirmation key" , true));526 $this->Session->setFlash(__("Could not find confirmation key")); 528 527 Logger::err("Registration confirmation is expired."); 529 528 $this->User->delete($user['User']['id']); -
Model/AppModel.php
rbbc826a ree4c2b7f 232 232 if ($this->data) { 233 233 $data = $this->stripAlias(); 234 $ name = Inflector::underscore($name);235 if (isset($data[$ name])) {236 return $data[$ name];234 $unserscore = Inflector::underscore($name); 235 if (isset($data[$unserscore])) { 236 return $data[$unserscore]; 237 237 } 238 238 } -
Model/MyFile.php
re449ecc0 ree4c2b7f 126 126 $path = Folder::slashTerm(dirname($filename)); 127 127 128 return $this->find( array("path" => $path, "file" => $file));128 return $this->find('first', array('conditions' => array("path" => $path, "file" => $file))); 129 129 } 130 130 -
View/Browser/folder.ctp
r0fb8d7c ree4c2b7f 3 3 <?php echo $this->Session->flash(); ?> 4 4 5 <p><?php echo __("Location %s", $ fileList->location($path)); ?></p>5 <p><?php echo __("Location %s", $this->FileList->location($path)); ?></p> 6 6 7 7 <?php echo $this->Form->create(false, array('action' => 'folder/'.$path)); ?> -
View/Browser/sync.ctp
r0fb8d7c ree4c2b7f 7 7 <p><?php echo __("Note: In case you are using phTagr with external paths it is recommended to synchronize your images to store this important information within the media file. After the synchronization these mata data could be read by other image programs or desktop search engines."); ?> 8 8 9 <?php if ($this-> data['action'] != 'run' && $this->data['unsynced'] > 0): ?>10 <p><?php echo __("You have %d unsynchronized media. Click %s to start the synchronization (this might take some time)", $this-> data['unsynced'], $this->Html->link(__("sync"), 'sync/run')); ?></p>9 <?php if ($this->request->data['action'] != 'run' && $this->request->data['unsynced'] > 0): ?> 10 <p><?php echo __("You have %d unsynchronized media. Click %s to start the synchronization (this might take some time)", $this->request->data['unsynced'], $this->Html->link(__("sync"), 'sync/run')); ?></p> 11 11 <?php endif; ?> 12 12 13 <?php if ($this-> data['unsynced'] == 0): ?>13 <?php if ($this->request->data['unsynced'] == 0): ?> 14 14 <div class="info"><?php echo __("All media are synchronized"); ?></div> 15 15 <?php endif; ?> 16 16 17 <?php if (count($this-> data['errors'])): ?>17 <?php if (count($this->request->data['errors'])): ?> 18 18 <div class="error"><?php echo __("Some files could not be updated with new metadata. Mainly this happens if the files are write protected. Please have a look to the log files for details."); ?></div> 19 19 <?php endif; ?> 20 20 21 <?php if ($this-> data['action'] == 'run'): ?>21 <?php if ($this->request->data['action'] == 'run'): ?> 22 22 <p><?php 23 echo __("Synchronized %d media.", count($this-> data['synced']));24 if ($this-> data['unsynced']) {25 echo __(" %d media remains unsynced. Click %s to synchronize again", $this-> data['unsynced'], $this->Html->link(__('sync', 'sync/run')));23 echo __("Synchronized %d media.", count($this->request->data['synced'])); 24 if ($this->request->data['unsynced']) { 25 echo __(" %d media remains unsynced. Click %s to synchronize again", $this->request->data['unsynced'], $this->Html->link(__('sync', 'sync/run'))); 26 26 } 27 27 ?></p> -
View/Browser/upload.ctp
r0fb8d7c ree4c2b7f 4 4 5 5 <?php if ($free > 0): ?> 6 <p><?php echo __("You upload files to folder %s", $ fileList->location($path)); ?></p>6 <p><?php echo __("You upload files to folder %s", $this->FileList->location($path)); ?></p> 7 7 <p><?php echo __("You can upload maximal %s and %s at once", $this->Number->toReadableSize($free), $this->Number->toReadableSize($max)); ?></p> 8 8 -
View/Comments/index.ctp
r0fb8d7c ree4c2b7f 4 4 <?php if ($comments): ?> 5 5 <div class="paginator"><div class="subpaginator"> 6 <?php echo $ paginator->prev().' '.$paginator->numbers().' '.$paginator->next(); ?>6 <?php echo $this->Paginator->prev().' '.$this->Paginator->numbers().' '.$this->Paginator->next(); ?> 7 7 </div></div> 8 8 … … 13 13 <div class="meta"> 14 14 <span class="from"><?php echo $comment['Comment']['name'] ?></span> said 15 <span class="date"><?php echo $t ime->relativeTime($comment['Comment']['date']); ?></span>15 <span class="date"><?php echo $this->Time->timeAgoInWords($comment['Comment']['date']); ?></span> 16 16 </div><!-- comment meta --> 17 17 … … 21 21 $link = '/images/view/'.$comment['Media']['id']; 22 22 echo '<div class="image">'.$this->Html->link($img, $link, array('escape' => false)).'</div>';?> 23 <?php echo preg_replace('/\n/', '<br />', $t ext->truncate($comment['Comment']['text'], 220, array('ending' => '...', 'exact' => false, 'html' => false))); ?>23 <?php echo preg_replace('/\n/', '<br />', $this->Text->truncate($comment['Comment']['text'], 220, array('ending' => '...', 'exact' => false, 'html' => false))); ?> 24 24 </div> 25 25 </div><!-- comment --> … … 28 28 29 29 <div class="paginator"><div class="subpaginator"> 30 <?php echo $ paginator->prev().' '.$paginator->numbers().' '.$paginator->next(); ?>30 <?php echo $this->Paginator->prev().' '.$this->Paginator->numbers().' '.$this->Paginator->next(); ?> 31 31 </div></div> 32 32 -
View/Comments/rss.ctp
r1a41cea ree4c2b7f 10 10 } 11 11 12 echo $rss->items($this-> data, 'getItem');12 echo $rss->items($this->request->data, 'getItem'); 13 13 ?> -
View/Elements/Explorer/description.ctp
r0fb8d7c ree4c2b7f 1 1 <?php 2 2 $this->Search->initialize(); 3 echo $this->element(' explorer/date', array('media' => $media));3 echo $this->element('Explorer/date', array('media' => $media)); 4 4 if (count($media['Tag'])) { 5 5 echo $this->Html->tag('p', -
View/Elements/Explorer/media.ctp
r0fb8d7c ree4c2b7f 62 62 </div> 63 63 <div class="p-explorer-media-description" id="<?php echo 'description-'.$media['Media']['id']; ?>"> 64 <?php echo $this->element(' explorer/description', array('media' => $media)); ?>64 <?php echo $this->element('Explorer/description', array('media' => $media)); ?> 65 65 </div> -
View/Elements/Explorer/menu.ctp
r0fb8d7c ree4c2b7f 1 1 <?php 2 2 $canWriteTag = $canWriteMeta = $canWriteCaption = $canWriteAcl = 0; 3 if (count($this-> data)) {4 $canWriteTag = max(Set::extract('/Media/canWriteTag', $this-> data));5 $canWriteMeta = max(Set::extract('/Media/canWriteMeta', $this-> data));6 $canWriteCaption = max(Set::extract('/Media/canWriteCaption', $this-> data));7 $canWriteAcl = max(Set::extract('/Media/canWriteAcl', $this-> data));3 if (count($this->request->data)) { 4 $canWriteTag = max(Set::extract('/Media/canWriteTag', $this->request->data)); 5 $canWriteMeta = max(Set::extract('/Media/canWriteMeta', $this->request->data)); 6 $canWriteCaption = max(Set::extract('/Media/canWriteCaption', $this->request->data)); 7 $canWriteAcl = max(Set::extract('/Media/canWriteAcl', $this->request->data)); 8 8 } 9 9 ?> … … 34 34 <?php 35 35 $user = $this->Search->getUser(); 36 $tagUrls = $this->ImageData->getAllExtendSearchUrls($crumbs, $user, 'tag', array_unique(Set::extract('/Tag/name', $this-> data)));36 $tagUrls = $this->ImageData->getAllExtendSearchUrls($crumbs, $user, 'tag', array_unique(Set::extract('/Tag/name', $this->request->data))); 37 37 ksort($tagUrls); 38 $categoryUrls = $this->ImageData->getAllExtendSearchUrls($crumbs, $user, 'category', array_unique(Set::extract('/Category/name', $this-> data)));38 $categoryUrls = $this->ImageData->getAllExtendSearchUrls($crumbs, $user, 'category', array_unique(Set::extract('/Category/name', $this->request->data))); 39 39 ksort($categoryUrls); 40 $locationUrls = $this->ImageData->getAllExtendSearchUrls($crumbs, $user, 'location', array_unique(Set::extract('/Location/name', $this-> data)));40 $locationUrls = $this->ImageData->getAllExtendSearchUrls($crumbs, $user, 'location', array_unique(Set::extract('/Location/name', $this->request->data))); 41 41 ksort($locationUrls); 42 42 … … 65 65 <p><?php echo __('Users') . " "; ?> 66 66 <?php 67 $userUrls = $this->ImageData->getAllExtendSearchUrls($crumbs, false, 'user', array_unique(Set::extract('/User/username', $this-> data)));67 $userUrls = $this->ImageData->getAllExtendSearchUrls($crumbs, false, 'user', array_unique(Set::extract('/User/username', $this->request->data))); 68 68 foreach ($userUrls as $name => $urls) { 69 69 echo $this->ImageData->getExtendSearchLinks($urls, $name, ($name == $user)) . ' '; … … 99 99 if ($canWriteTag) { 100 100 echo $this->Form->input('Tag.names', array('label' => __('Tags'), 'after' => $this->Html->tag('div', __('E.g. newtag, -oldtag'), array('class' => 'description')))); 101 echo $ autocomplete->autoComplete('Tag.names', 'autocomplete/tag', array('split' => true));101 echo $this->Autocomplete->autoComplete('Tag.names', 'autocomplete/tag', array('split' => true)); 102 102 } 103 103 if ($canWriteMeta) { 104 104 echo $this->Form->input('Category.names', array('label' => __('Categories'))); 105 echo $ autocomplete->autoComplete('Category.names', 'autocomplete/category', array('split' => true));105 echo $this->Autocomplete->autoComplete('Category.names', 'autocomplete/category', array('split' => true)); 106 106 echo $this->Form->input('Location.city', array('label' => __('City'))); 107 echo $ autocomplete->autoComplete('Location.city', 'autocomplete/city');107 echo $this->Autocomplete->autoComplete('Location.city', 'autocomplete/city'); 108 108 echo $this->Form->input('Location.sublocation', array('label' => __('Sublocation'))); 109 echo $ autocomplete->autoComplete('Location.sublocation', 'autocomplete/sublocation');109 echo $this->Autocomplete->autoComplete('Location.sublocation', 'autocomplete/sublocation'); 110 110 echo $this->Form->input('Location.state', array('label' => __('State'))); 111 echo $ autocomplete->autoComplete('Location.state', 'autocomplete/state');111 echo $this->Autocomplete->autoComplete('Location.state', 'autocomplete/state'); 112 112 echo $this->Form->input('Location.country', array('label' => __('Country'))); 113 echo $ autocomplete->autoComplete('Location.country', 'autocomplete/country');113 echo $this->Autocomplete->autoComplete('Location.country', 'autocomplete/country'); 114 114 echo $this->Form->input('Media.geo', array('label' => __('Geo data'), 'maxlength' => 32, 'after' => $this->Html->tag('div', __('latitude, longitude'), array('class' => 'description')))); 115 115 } -
View/Elements/comment.ctp
r0fb8d7c ree4c2b7f 4 4 ?> 5 5 <div id="comments"> 6 <?php if (count($this-> data['Comment'])): ?>6 <?php if (count($this->request->data['Comment'])): ?> 7 7 <h3><?php echo __('Comments'); ?></h3> 8 8 <?php $count = 0; ?> 9 <?php foreach ($this-> data['Comment'] as $key => $comment): ?>9 <?php foreach ($this->request->data['Comment'] as $key => $comment): ?> 10 10 <?php if (!is_numeric($key)) continue; ?> 11 11 <div class="comment <?php echo ($count++%2)?'even':'odd'; ?>"> … … 16 16 $name = $this->Html->link($comment['name'], $comment['url']); 17 17 } 18 $t ime = $this->Html->tag('span', $this->Time->relativeTime($comment['date']), array('class' => 'date'));19 __("%s said %s", $name, $t ime);18 $this->Time = $this->Html->tag('span', $this->Time->timeAgoInWords($comment['date']), array('class' => 'date')); 19 __("%s said %s", $name, $this->Time); 20 20 ?> 21 21 <?php 22 if ($this-> data['Media']['isOwner'] || $comment['user_id'] == $userId) {22 if ($this->request->data['Media']['isOwner'] || $comment['user_id'] == $userId) { 23 23 echo $this->Html->link(__('(delete)'), '/comments/delete/'.$comment['id'].'/'.$this->SearchParams); 24 24 } … … 37 37 <fieldset> 38 38 <?php 39 echo $this->Form->hidden('Media.id', array('value' => $this-> data['Media']['id']));39 echo $this->Form->hidden('Media.id', array('value' => $this->request->data['Media']['id'])); 40 40 ?> 41 41 <?php -
View/Elements/footer.ctp
r0fb8d7c ree4c2b7f 1 1 <?php 2 2 global $TIME_START; 3 $t ime = microtime(true) - $TIME_START;4 __("%s Social Web Gallery %s in %.3fs. Layout based on %s, Icons by %s", '© 2006-2010', $this->Html->link('phtagr.org', 'http://www.phtagr.org'), $t ime, $this->Html->link('YAML', 'http://www.yaml.de'), $this->Html->link('FamFamFam', 'http://www.famfamfam.com'));3 $this->Time = microtime(true) - $TIME_START; 4 __("%s Social Web Gallery %s in %.3fs. Layout based on %s, Icons by %s", '© 2006-2010', $this->Html->link('phtagr.org', 'http://www.phtagr.org'), $this->Time, $this->Html->link('YAML', 'http://www.yaml.de'), $this->Html->link('FamFamFam', 'http://www.famfamfam.com')); 5 5 ?> -
View/Elements/single_acl_form.ctp
r0fb8d7c ree4c2b7f 1 1 <?php 2 echo $this->ImageData->acl2select('Media.readPreview', $this-> data, ACL_READ_PREVIEW, ACL_READ_MASK, array('label' => __("Who can view image?")));3 echo $this->ImageData->acl2select('Media.readOriginal', $this-> data, ACL_READ_ORIGINAL, ACL_READ_MASK, array('label' => __("Who can download the image?")));4 echo $this->ImageData->acl2select('Media.writeTag', $this-> data, ACL_WRITE_TAG, ACL_WRITE_MASK, array('label' => __("Who can edit the tags?")));5 echo $this->ImageData->acl2select('Media.writeMeta', $this-> data, ACL_WRITE_META, ACL_WRITE_MASK, array('label' => __("Who can edit all meta data?")));6 echo $this->Form->input('Group.id', array('type' => 'select', 'options' => $groups, 'selected' => $this-> data['Media']['group_id'], 'label' => __('Group')));2 echo $this->ImageData->acl2select('Media.readPreview', $this->request->data, ACL_READ_PREVIEW, ACL_READ_MASK, array('label' => __("Who can view image?"))); 3 echo $this->ImageData->acl2select('Media.readOriginal', $this->request->data, ACL_READ_ORIGINAL, ACL_READ_MASK, array('label' => __("Who can download the image?"))); 4 echo $this->ImageData->acl2select('Media.writeTag', $this->request->data, ACL_WRITE_TAG, ACL_WRITE_MASK, array('label' => __("Who can edit the tags?"))); 5 echo $this->ImageData->acl2select('Media.writeMeta', $this->request->data, ACL_WRITE_META, ACL_WRITE_MASK, array('label' => __("Who can edit all meta data?"))); 6 echo $this->Form->input('Group.id', array('type' => 'select', 'options' => $groups, 'selected' => $this->request->data['Media']['group_id'], 'label' => __('Group'))); 7 7 ?> -
View/Elements/single_meta_form.ctp
r0fb8d7c ree4c2b7f 1 1 <?php 2 if ($this-> data['Media']['canWriteTag']) {3 echo $this->Form->input('Tag.names', array('label' => __('Tags'), 'value' => join(', ', Set::extract('/Tag/name', $this-> data))));4 echo $ autocomplete->autoComplete('Tag.names', '/explorer/autocomplete/tag', array('split' => true));2 if ($this->request->data['Media']['canWriteTag']) { 3 echo $this->Form->input('Tag.names', array('label' => __('Tags'), 'value' => join(', ', Set::extract('/Tag/name', $this->request->data)))); 4 echo $this->Autocomplete->autoComplete('Tag.names', '/explorer/autocomplete/tag', array('split' => true)); 5 5 } 6 if ($this-> data['Media']['canWriteMeta']) {7 echo $this->Form->input('Category.names', array('label' => __('Categories'), 'value' => join(', ', Set::extract('/Category/name', $this-> data))));8 echo $ autocomplete->autoComplete('Category.names', '/explorer/autocomplete/category', array('split' => true));9 echo $this->Form->input('Location.city', array('label' => __('City'), 'value' => join('', Set::extract('/Location[type='.LOCATION_CITY.']/name', $this-> data))));10 echo $ autocomplete->autoComplete('Locations.city', '/explorer/autocomplete/city');11 echo $this->Form->input('Location.sublocation', array('label' => __('Sublocation'), 'value' => join('', Set::extract('/Location[type='.LOCATION_SUBLOCATION.']/name', $this-> data))));12 echo $ autocomplete->autoComplete('Location.sublocation', '/explorer/autocomplete/sublocation');13 echo $this->Form->input('Location.state', array('label' => __('State'), 'value' => join('', Set::extract('/Location[type='.LOCATION_STATE.']/name', $this-> data))));14 echo $ autocomplete->autoComplete('Location.state', '/explorer/autocomplete/state');15 echo $this->Form->input('Location.country', array('label' => __('Country'), 'value' => join('', Set::extract('/Location[type='.LOCATION_COUNTRY.']/name', $this-> data))));16 echo $ autocomplete->autoComplete('Location.country', '/explorer/autocomplete/country');6 if ($this->request->data['Media']['canWriteMeta']) { 7 echo $this->Form->input('Category.names', array('label' => __('Categories'), 'value' => join(', ', Set::extract('/Category/name', $this->request->data)))); 8 echo $this->Autocomplete->autoComplete('Category.names', '/explorer/autocomplete/category', array('split' => true)); 9 echo $this->Form->input('Location.city', array('label' => __('City'), 'value' => join('', Set::extract('/Location[type='.LOCATION_CITY.']/name', $this->request->data)))); 10 echo $this->Autocomplete->autoComplete('Locations.city', '/explorer/autocomplete/city'); 11 echo $this->Form->input('Location.sublocation', array('label' => __('Sublocation'), 'value' => join('', Set::extract('/Location[type='.LOCATION_SUBLOCATION.']/name', $this->request->data)))); 12 echo $this->Autocomplete->autoComplete('Location.sublocation', '/explorer/autocomplete/sublocation'); 13 echo $this->Form->input('Location.state', array('label' => __('State'), 'value' => join('', Set::extract('/Location[type='.LOCATION_STATE.']/name', $this->request->data)))); 14 echo $this->Autocomplete->autoComplete('Location.state', '/explorer/autocomplete/state'); 15 echo $this->Form->input('Location.country', array('label' => __('Country'), 'value' => join('', Set::extract('/Location[type='.LOCATION_COUNTRY.']/name', $this->request->data)))); 16 echo $this->Autocomplete->autoComplete('Location.country', '/explorer/autocomplete/country'); 17 17 $geo = ""; 18 if (isset($this-> data['Media']['latitude']) && isset($this->data['Media']['longitude'])) {19 $geo = $this-> data['Media']['latitude'] . ', ' . $this->data['Media']['longitude'];18 if (isset($this->request->data['Media']['latitude']) && isset($this->request->data['Media']['longitude'])) { 19 $geo = $this->request->data['Media']['latitude'] . ', ' . $this->request->data['Media']['longitude']; 20 20 } 21 21 echo $this->Form->input('Media.geo', array('label' => __('Geo data'), 'value' => $geo, 'maxlength' => 32)); 22 22 } 23 if ($this-> data['Media']['canWriteCaption']) {23 if ($this->request->data['Media']['canWriteCaption']) { 24 24 echo $this->Form->input('Media.date', array('type' => 'text', 'after' => $this->Html->tag('div', __('E.g. 2008-08-07 15:30'), array('class' => 'description')))); 25 25 echo $this->Form->input('Media.name', array('type' => 'text')); -
View/Explorer/autocomplete.ctp
r1a41cea ree4c2b7f 1 1 <ul> 2 <?php foreach($this-> data as $name): ?>2 <?php foreach($this->request->data as $name): ?> 3 3 <li><?php echo h($name); ?></li> 4 4 <?php endforeach; ?> -
View/Explorer/editacl.ctp
r0fb8d7c ree4c2b7f 1 1 <?php 2 $mediaId = $this-> data['Media']['id'];2 $mediaId = $this->request->data['Media']['id']; 3 3 $crumbUrl = '/'.$this->Breadcrumb->params($crumbs); 4 4 echo $this->Form->create(null, array('url' => 'saveacl/'.$mediaId.$crumbUrl, 'id' => 'form-acl-'.$mediaId)); -
View/Explorer/editmeta.ctp
r0fb8d7c ree4c2b7f 1 1 <?php 2 $mediaId = $this-> data['Media']['id'];2 $mediaId = $this->request->data['Media']['id']; 3 3 $crumbUrl = '/'.$this->Breadcrumb->params($crumbs); 4 4 echo $this->Form->create(null, array('url' => 'savemeta/'.$mediaId.$crumbUrl, 'id' => 'form-meta-'.$mediaId)); -
View/Explorer/index.ctp
r0fb8d7c ree4c2b7f 32 32 buttons: { 33 33 ':SAVE': function() { 34 var $ this->Form = $('#form-meta-' + id);35 $.post($ this->Form.attr('action'), $this->Form.serialize(), function(data) {34 var $form = $('#form-meta-' + id); 35 $.post($form.attr('action'), $form.serialize(), function(data) { 36 36 $('#media-' + id).html(data); 37 37 $('#media-' + id).mediaAction(); … … 59 59 buttons: { 60 60 ':SAVE': function() { 61 var $ this->Form = $('#form-acl-' + id);62 $.post($ this->Form.attr('action'), $this->Form.serialize(), function(data) {61 var $form = $('#form-acl-' + id); 62 $.post($form.attr('action'), $form.serialize(), function(data) { 63 63 $('#media-' + id).html(data); 64 64 $('#media-' + id).mediaAction(); … … 178 178 <div class="p-explorer-media-list"> 179 179 <?php 180 $canWriteTag = count($this-> data) ? max(Set::extract('/Media/canWriteTag', $this->data)) : 0;180 $canWriteTag = count($this->request->data) ? max(Set::extract('/Media/canWriteTag', $this->request->data)) : 0; 181 181 $index = 0; 182 182 $pos = ($this->Search->getPage(1)-1) * $this->Search->getShow(12) + 1; 183 183 184 184 echo '<div class="row">'; 185 foreach ($this-> data as $media) {185 foreach ($this->request->data as $media) { 186 186 $editable = $media['Media']['canWriteTag'] ? 'editable' : ''; 187 187 $cell = "cell" . ($index %4); -
View/Explorer/media.ctp
r0fb8d7c ree4c2b7f 21 21 ?> 22 22 <atom:link rel="self" href="<?php echo Router::url($this->Search->getUri(), true); ?>" /> 23 <?php if ($ navigator->hasPrev()): ?>23 <?php if ($this->Navigator->hasPrev()): ?> 24 24 <atom:link rel="previous" href="<?php echo Router::url($this->Search->getUri(false, array('page' => $this->Search->getPage(1) - 1)), true); ?>" /> 25 25 <?php endif; ?> 26 <?php if ($ navigator->hasNext()): ?>26 <?php if ($this->Navigator->hasNext()): ?> 27 27 <atom:link rel="next" href="<?php echo Router::url($this->Search->getUri(false, array('page' => $this->Search->getPage(1) + 1)), true); ?>" /> 28 28 <?php endif; ?> 29 29 <?php 30 30 $offset = $this->Search->getShow() * ($this->Search->getPage(1) - 1) + 1; 31 foreach ($this-> data as $media): ?>31 foreach ($this->request->data as $media): ?> 32 32 <item> 33 33 <title><?php echo $media['Media']['name']." by ".$media['User']['username']; ?></title> -
View/Explorer/points.ctp
r1a41cea ree4c2b7f 1 1 <markers> 2 <?php foreach ($this-> data as $media): ?>2 <?php foreach ($this->request->data as $media): ?> 3 3 <marker id="<?php echo $media['Media']['id']; ?>" lat="<?php echo $media['Media']['latitude']; ?>" lng="<?php echo $media['Media']['longitude']; ?>" > 4 4 <name><?php echo h($media['Media']['name']); ?></name> -
View/Explorer/quicksearch.ctp
r0fb8d7c ree4c2b7f 7 7 $cell=0; 8 8 9 if (!count($this-> data)): ?>9 if (!count($this->request->data)): ?> 10 10 <div class="info"> 11 11 <?php echo __("Sorry, nothing was found for %s", h($quicksearch)); ?> … … 20 20 21 21 <?php 22 foreach($this-> data as $media) {22 foreach($this->request->data as $media) { 23 23 echo $this->ImageData->mediaLink($media, 'mini').' '; 24 24 } … … 27 27 28 28 <?php 29 $tags = Set::extract('/Tag/name', $this-> data);29 $tags = Set::extract('/Tag/name', $this->request->data); 30 30 if (count($tags)) { 31 31 echo '<p>' . __('See more results of tag') . ': '; … … 38 38 } 39 39 40 $categories = Set::extract('/Category/name', $this-> data);40 $categories = Set::extract('/Category/name', $this->request->data); 41 41 if (count($categories)) { 42 42 echo '<p>' . __('See more results of category') . ': '; … … 49 49 } 50 50 51 $locations = Set::extract('/Location/name', $this-> data);51 $locations = Set::extract('/Location/name', $this->request->data); 52 52 if (count($locations)) { 53 53 echo '<p>' . __('See more results of location') . ': '; -
View/Explorer/rss.ctp
r1a41cea ree4c2b7f 10 10 } 11 11 12 echo $rss->items($this-> data, 'getItem');12 echo $rss->items($this->request->data, 'getItem'); 13 13 ?> -
View/Explorer/updatemeta.ctp
r0fb8d7c ree4c2b7f 3 3 $pos = $this->Search->getPos(); 4 4 $index = 0; 5 echo $this->element('explorer/media', array('media' => $this-> data, 'index' => $index, 'pos' => $pos));5 echo $this->element('explorer/media', array('media' => $this->request->data, 'index' => $index, 'pos' => $pos)); 6 6 ?> -
View/Groups/autocomplete.ctp
r1a41cea ree4c2b7f 1 <?php debug($this-> data); ?>1 <?php debug($this->request->data); ?> 2 2 <ul> 3 <?php foreach($this-> data as $user): ?>3 <?php foreach($this->request->data as $user): ?> 4 4 <li><?php echo $user['User']['username']; ?></li> 5 5 <?php endforeach; ?> -
View/Groups/create.ctp
r0fb8d7c ree4c2b7f 8 8 <?php 9 9 echo $this->Form->input('Group.name', array('label' => __('Name'))); 10 echo $this->Form->input('Group.description', array('label' => __('Description'), 'type' => ' blob'));10 echo $this->Form->input('Group.description', array('label' => __('Description'), 'type' => 'text')); 11 11 echo $this->Form->input('Group.is_hidden', array('label' => __('This group is hidden'), 'type' => 'checkbox')); 12 12 echo $this->Form->input('Group.is_moderated', array('label' => __('New group members are moderated'), 'type' => 'checkbox')); -
View/Groups/dashboard_create.ctp
r0fb8d7c ree4c2b7f 16 16 17 17 <?php 18 debug($this-> data);18 debug($this->request->data); 19 19 20 20 ?> … … 36 36 37 37 <?php 38 debug($this-> data);38 debug($this->request->data); 39 39 40 40 ?> … … 56 56 57 57 <?php 58 debug($this-> data);58 debug($this->request->data); 59 59 60 60 ?> … … 76 76 77 77 <?php 78 debug($this-> data);78 debug($this->request->data); 79 79 80 80 ?> … … 96 96 97 97 <?php 98 debug($this-> data);98 debug($this->request->data); 99 99 100 100 ?> … … 116 116 117 117 <?php 118 debug($this-> data);118 debug($this->request->data); 119 119 120 120 ?> -
View/Groups/dashboard_index.ctp
r0fb8d7c ree4c2b7f 4 4 5 5 <?php 6 debug($this-> data);6 debug($this->request->data); 7 7 8 8 ?> … … 12 12 13 13 <?php 14 debug($this-> data);14 debug($this->request->data); 15 15 16 16 ?> … … 20 20 21 21 <?php 22 debug($this-> data);22 debug($this->request->data); 23 23 24 24 ?> … … 28 28 29 29 <?php 30 debug($this-> data);30 debug($this->request->data); 31 31 32 32 ?> … … 36 36 37 37 <?php 38 debug($this-> data);38 debug($this->request->data); 39 39 40 40 ?> … … 44 44 45 45 <?php 46 debug($this-> data);46 debug($this->request->data); 47 47 48 48 ?> -
View/Groups/dashboard_manage.ctp
r0fb8d7c ree4c2b7f 13 13 14 14 <?php 15 $allgroup_names = Set::extract('/Member/name', $this-> data);15 $allgroup_names = Set::extract('/Member/name', $this->request->data); 16 16 sort($allgroup_names); 17 17 $cells = array(); … … 28 28 29 29 <?php 30 debug($this-> data);30 debug($this->request->data); 31 31 32 32 ?> … … 45 45 46 46 <?php 47 $allgroup_names = Set::extract('/Member/name', $this-> data);47 $allgroup_names = Set::extract('/Member/name', $this->request->data); 48 48 sort($allgroup_names); 49 49 $cells = array(); … … 60 60 61 61 <?php 62 debug($this-> data);62 debug($this->request->data); 63 63 64 64 ?> … … 77 77 78 78 <?php 79 $allgroup_names = Set::extract('/Member/name', $this-> data);79 $allgroup_names = Set::extract('/Member/name', $this->request->data); 80 80 sort($allgroup_names); 81 81 $cells = array(); … … 92 92 93 93 <?php 94 debug($this-> data);94 debug($this->request->data); 95 95 96 96 ?> … … 109 109 110 110 <?php 111 $allgroup_names = Set::extract('/Member/name', $this-> data);111 $allgroup_names = Set::extract('/Member/name', $this->request->data); 112 112 sort($allgroup_names); 113 113 $cells = array(); … … 124 124 125 125 <?php 126 debug($this-> data);126 debug($this->request->data); 127 127 128 128 ?> … … 141 141 142 142 <?php 143 $allgroup_names = Set::extract('/Member/name', $this-> data);143 $allgroup_names = Set::extract('/Member/name', $this->request->data); 144 144 sort($allgroup_names); 145 145 $cells = array(); … … 156 156 157 157 <?php 158 debug($this-> data);158 debug($this->request->data); 159 159 160 160 ?> … … 173 173 174 174 <?php 175 $allgroup_names = Set::extract('/Member/name', $this-> data);175 $allgroup_names = Set::extract('/Member/name', $this->request->data); 176 176 sort($allgroup_names); 177 177 $cells = array(); … … 188 188 189 189 <?php 190 debug($this-> data);190 debug($this->request->data); 191 191 192 192 ?> -
View/Groups/dashboard_search.ctp
r0fb8d7c ree4c2b7f 24 24 </ul> 25 25 <?php 26 debug($this-> data);26 debug($this->request->data); 27 27 28 28 ?> … … 52 52 </ul> 53 53 <?php 54 debug($this-> data);54 debug($this->request->data); 55 55 56 56 ?> … … 80 80 </ul> 81 81 <?php 82 debug($this-> data);82 debug($this->request->data); 83 83 84 84 ?> … … 108 108 </ul> 109 109 <?php 110 debug($this-> data);110 debug($this->request->data); 111 111 112 112 ?> … … 136 136 </ul> 137 137 <?php 138 debug($this-> data);138 debug($this->request->data); 139 139 140 140 ?> … … 164 164 </ul> 165 165 <?php 166 debug($this-> data);166 debug($this->request->data); 167 167 168 168 ?> -
View/Groups/edit.ctp
r0fb8d7c ree4c2b7f 1 <h1><?php echo __('Group: %s', $this-> data['Group']['name']); ?></h1>1 <h1><?php echo __('Group: %s', $this->request->data['Group']['name']); ?></h1> 2 2 3 3 <?php echo $this->Session->flash() ?> 4 4 5 <?php echo $this->Form->create(null, array('action' => "edit/{$this-> data['Group']['name']}")); ?>5 <?php echo $this->Form->create(null, array('action' => "edit/{$this->request->data['Group']['name']}")); ?> 6 6 7 7 <fieldset><legend><?php echo __('Edit Group'); ?></legend> -
View/Groups/index.ctp
r0fb8d7c ree4c2b7f 3 3 <?php echo $this->Session->flash(); ?> 4 4 5 <?php if (!empty($this-> data)): ?>5 <?php if (!empty($this->request->data)): ?> 6 6 <table class="default"> 7 7 <thead> … … 24 24 $isAdmin = $currentUser['User']['role'] >= ROLE_ADMIN; 25 25 26 foreach($this-> data as $group) {26 foreach($this->request->data as $group) { 27 27 $actions = array(); 28 28 if ($currentUser['User']['id'] != $group['Group']['user_id']) { … … 50 50 $this->Html->link($group['Group']['name'], "view/{$group['Group']['name']}", array('title' => $group['Group']['description'])), 51 51 $this->Html->link($group['User']['username'], "/users/view/{$group['User']['username']}"), 52 $t ext->truncate($group['Group']['description'], 30, array('ending' => '...', 'exact' => false, 'html' => false)),52 $this->Text->truncate($group['Group']['description'], 30, array('ending' => '...', 'exact' => false, 'html' => false)), 53 53 count($group['Member']), 54 54 $this->Html->tag('div', implode(' ', $actions), array('class' => 'actionlist')) -
View/Groups/listmembers.ctp
r0fb8d7c ree4c2b7f 1 <h1><?php echo __('Group %s', $this-> data['Group']['name']); ?></h1>1 <h1><?php echo __('Group %s', $this->request->data['Group']['name']); ?></h1> 2 2 3 3 <?php echo $this->Session->flash() ?> … … 10 10 __('Member'), 11 11 ); 12 if ($this-> data['Group']['is_admin']) {12 if ($this->request->data['Group']['is_admin']) { 13 13 $headers[] = __('Action'); 14 14 } … … 20 20 <?php 21 21 $cells = array(); 22 foreach ($this-> data['Member'] as $member) {22 foreach ($this->request->data['Member'] as $member) { 23 23 $actions = array(); 24 if ($this-> data['Group']['is_admin']) {24 if ($this->request->data['Group']['is_admin']) { 25 25 $actions[] = $this->Html->link( 26 26 $this->Html->image('icons/delete.png', … … 29 29 'title' => __("Unsubscribe '%s'", $member['username']) 30 30 ) 31 ), "deleteMember/{$this-> data['Group']['name']}/{$member['username']}", array('escape' => false));31 ), "deleteMember/{$this->request->data['Group']['name']}/{$member['username']}", array('escape' => false)); 32 32 } 33 33 $row = array( -
View/Groups/view.ctp
r0fb8d7c ree4c2b7f 1 <h1><?php echo __('Group %s', $this-> data['Group']['name']); ?></h1>1 <h1><?php echo __('Group %s', $this->request->data['Group']['name']); ?></h1> 2 2 3 3 <?php echo $this->Session->flash() ?> … … 8 8 9 9 <p><?php 10 if (empty($this-> data['Group']['description'])) {10 if (empty($this->request->data['Group']['description'])) { 11 11 __("This group has no description"); 12 12 } else { 13 echo h($this-> data['Group']['description']);13 echo h($this->request->data['Group']['description']); 14 14 } ?></p> 15 15 <p><?php 16 __("The group is owned by user %s and has %d media in total.", $this->Html->link($this-> data['User']['username'], "/users/view/{$this->data['User']['username']}"), $mediaCount);17 if ($this-> data['Group']['is_admin']) {18 echo ' ' . $this->Html->link(__('Edit'), "edit/{$this-> data['Group']['name']}");16 __("The group is owned by user %s and has %d media in total.", $this->Html->link($this->request->data['User']['username'], "/users/view/{$this->request->data['User']['username']}"), $mediaCount); 17 if ($this->request->data['Group']['is_admin']) { 18 echo ' ' . $this->Html->link(__('Edit'), "edit/{$this->request->data['Group']['name']}"); 19 19 } 20 20 ?></p> … … 24 24 $iconYes = $this->Html->image('icons/accept.png', array('alt' => '+', 'title' => '+')) . ' '; 25 25 $iconNo = $this->Html->image('icons/delete.png', array('alt' => '-', 'title' => '-')) . ' '; 26 if ($this-> data['Group']['is_hidden']) {26 if ($this->request->data['Group']['is_hidden']) { 27 27 echo $this->Html->tag('li', $iconNo . __("The group is hidden")); 28 28 } else { 29 29 echo $this->Html->tag('li', $iconYes . __("The group is shown with the media")); 30 30 } 31 if ($this-> data['Group']['is_moderated']) {31 if ($this->request->data['Group']['is_moderated']) { 32 32 echo $this->Html->tag('li', $iconNo . __("The group subscription requires a confirmation")); 33 33 } else { 34 34 echo $this->Html->tag('li', $iconYes . __("The group subscription is free and does not need a confirmation")); 35 35 } 36 if ($this-> data['Group']['is_shared']) {36 if ($this->request->data['Group']['is_shared']) { 37 37 echo $this->Html->tag('li', $iconYes . __("This group is shared and can be used by other members")); 38 38 } else { … … 49 49 __('Member'), 50 50 ); 51 if ($this-> data['Group']['is_admin']) {51 if ($this->request->data['Group']['is_admin']) { 52 52 $headers[] = __('Action'); 53 53 } … … 59 59 <?php 60 60 $cells = array(); 61 foreach ($this-> data['Member'] as $member) {61 foreach ($this->request->data['Member'] as $member) { 62 62 $actions = array(); 63 if ($this-> data['Group']['is_admin']) {63 if ($this->request->data['Group']['is_admin']) { 64 64 $actions[] = $this->Html->link( 65 65 $this->Html->image('icons/delete.png', … … 68 68 'title' => __("Unsubscribe '%s'", $member['username']) 69 69 ) 70 ), "deleteMember/{$this-> data['Group']['name']}/{$member['username']}", array('escape' => false));70 ), "deleteMember/{$this->request->data['Group']['name']}/{$member['username']}", array('escape' => false)); 71 71 } 72 72 $row = array( … … 84 84 85 85 <?php 86 if ($this-> data['Group']['is_admin']) {86 if ($this->request->data['Group']['is_admin']) { 87 87 echo $this->Form->create('Group', array('action' => 'addMember')); 88 88 echo "<fieldset><legend>" . __("Add user") . "</legend>"; … … 95 95 } else { 96 96 $userId = $this->Session->read('User.id'); 97 $memberIds = Set::extract('/Member/id', $this-> data);97 $memberIds = Set::extract('/Member/id', $this->request->data); 98 98 if (in_array($userId, $memberIds)) { 99 echo $this->Html->link(__('Unsubscribe'), "unsubscribe/{$this-> data['Group']['name']}");99 echo $this->Html->link(__('Unsubscribe'), "unsubscribe/{$this->request->data['Group']['name']}"); 100 100 } else { 101 echo $this->Html->link(__('Subscribe'), "subscribe/{$this-> data['Group']['name']}");101 echo $this->Html->link(__('Subscribe'), "subscribe/{$this->request->data['Group']['name']}"); 102 102 } 103 103 } … … 111 111 } 112 112 ?></p> 113 <p><?php echo __('See all media of the group %s', $this->Html->link($this-> data['Group']['name'], "/explorer/group/{$this->data['Group']['name']}")); ?></p>113 <p><?php echo __('See all media of the group %s', $this->Html->link($this->request->data['Group']['name'], "/explorer/group/{$this->request->data['Group']['name']}")); ?></p> 114 114 <?php endif; ?> -
View/Guests/autocomplete.ctp
r1a41cea ree4c2b7f 1 1 <ul> 2 <?php foreach($this-> data as $group): ?>2 <?php foreach($this->request->data as $group): ?> 3 3 <li><?php echo $group['Group']['name']; ?></li> 4 4 <?php endforeach; ?> -
View/Guests/edit.ctp
r0fb8d7c ree4c2b7f 1 <h1><?php echo __('Guest: %s', $this-> data['Guest']['username']); ?></h1>1 <h1><?php echo __('Guest: %s', $this->request->data['Guest']['username']); ?></h1> 2 2 3 3 <?php echo $this->Session->flash(); ?> 4 4 5 <?php echo $this->Form->create(null, array('action' => 'edit/'.$this-> data['Guest']['id']));?>5 <?php echo $this->Form->create(null, array('action' => 'edit/'.$this->request->data['Guest']['id']));?> 6 6 <fieldset><legend><?php echo __('Guest'); ?></legend> 7 7 <?php 8 8 echo $this->Form->input('Guest.email', array('label' => __('Email'))); 9 9 echo $this->Form->input('Guest.expires', array('type' => 'text', 'label' => __('Expires'))); 10 echo $this->Form->input('Guest.webdav', array('type' => 'checkbox', 'checked' => ($this-> data['Guest']['quota'] > 0 ? 'checked' : ''), 'label' => __('Enable WebDAV access')));10 echo $this->Form->input('Guest.webdav', array('type' => 'checkbox', 'checked' => ($this->request->data['Guest']['quota'] > 0 ? 'checked' : ''), 'label' => __('Enable WebDAV access'))); 11 11 ?> 12 12 </fieldset> … … 24 24 3 => __('Name and captcha') 25 25 ); 26 $select = $this-> data['Comment']['auth'];26 $select = $this->request->data['Comment']['auth']; 27 27 echo '<div class="input select">'; 28 28 echo $this->Form->label(null, __('Authentication')); 29 echo $this->Form->select('Comment.auth', $options, $select, array('empty' => false));29 echo $this->Form->select('Comment.auth', $options, array('empty' => false, 'value' => $select)); 30 30 echo '</div>'; 31 31 ?> … … 34 34 </form> 35 35 36 <?php if(count($this-> data['Member'])): ?>36 <?php if(count($this->request->data['Member'])): ?> 37 37 <h2><?php echo __('Group List'); ?></h2> 38 38 <table class="default"> … … 50 50 <?php 51 51 $cells = array(); 52 foreach($this-> data['Member'] as $group) {53 $delConfirm = __("Do you really want to delete the group '%s' from this guest '%s'?", $group['name'], $this-> data['Guest']['username']);52 foreach($this->request->data['Member'] as $group) { 53 $delConfirm = __("Do you really want to delete the group '%s' from this guest '%s'?", $group['name'], $this->request->data['Guest']['username']); 54 54 $cells[] = array( 55 55 $this->Html->link($group['name'], '/groups/view/'.$group['name']), 56 56 $this->Html->link( 57 57 $this->Html->image('icons/delete.png', array('alt' => 'Delete', 'title' => 'Delete')), 58 '/guests/deleteGroup/'.$this-> data['Guest']['id'].'/'.$group['id'], array('escape' => false), $delConfirm)58 '/guests/deleteGroup/'.$this->request->data['Guest']['id'].'/'.$group['id'], array('escape' => false), $delConfirm) 59 59 ); 60 60 } … … 67 67 <?php endif; ?> 68 68 69 <?php echo $this->Form->create(null, array('action' => 'addGroup/'.$this-> data['Guest']['id']));?>69 <?php echo $this->Form->create(null, array('action' => 'addGroup/'.$this->request->data['Guest']['id']));?> 70 70 <fieldset><legend><?php echo __('Group Assignements'); ?></legend> 71 <div class="input"><label><?php echo __('Group'); ?></label>72 <?php echo $ajax->autocomplete('Group.name', '/guests/autocomplete'); ?></div>71 <?php echo $this->Form->input('Group.name'); ?> 72 <?php echo $this->Autocomplete->autoComplete('Group.name', '/guests/autocomplete'); ?> 73 73 </fieldset> 74 74 <?php echo $this->Form->submit(__('Add Group')); ?> -
View/Guests/index.ctp
r0fb8d7c ree4c2b7f 3 3 <?php echo $this->Session->flash(); ?> 4 4 5 <?php if (!empty($this-> data)): ?>5 <?php if (!empty($this->request->data)): ?> 6 6 <table class="default"> 7 7 <thead> … … 14 14 15 15 <tbody> 16 <?php $row=0; foreach($this-> data as $guest): ?>16 <?php $row=0; foreach($this->request->data as $guest): ?> 17 17 <tr class="<?php echo ($row++%2)?"even":"odd";?>"> 18 18 <td><?php echo $this->Html->link($guest['Guest']['username'], 'edit/'.$guest['Guest']['id']); ?></td> … … 38 38 39 39 <?php 40 //debug($this-> data);40 //debug($this->request->data); 41 41 ?> -
View/Guests/links.ctp
r0fb8d7c ree4c2b7f 12 12 13 13 <?php 14 $myMedia = Router::url('/explorer/user/'.$this-> data['Guest']['username'].'/key:'.$this->data['Guest']['key'], true);14 $myMedia = Router::url('/explorer/user/'.$this->request->data['Guest']['username'].'/key:'.$this->request->data['Guest']['key'], true); 15 15 ?> 16 16 <ul> 17 <li><?php echo __('My Media of Guest %s (Link %s)', $this->Html->link($this-> data['Guest']['username'], $myMedia, '<code>'. $myMedia . '</code>'); ?></li>17 <li><?php echo __('My Media of Guest %s (Link %s)', $this->Html->link($this->request->data['Guest']['username'], $myMedia), '<code>'. $myMedia . '</code>'); ?></li> 18 18 </ul> 19 19 … … 23 23 <p><?php echo __('Following links provide a authenticated RSS and Media RSS links.'); ?></p> 24 24 <?php 25 $recentMedia = Router::url('/explorer/rss/key:'.$this-> data['Guest']['key'], true);26 $recentComments = Router::url('/comments/rss/key:'.$this-> data['Guest']['key'], true);27 $mediaRss = Router::url('/explorer/media/key:'.$this-> data['Guest']['key'].'/media.rss', true);28 $myMediaMediaRss = Router::url('/explorer/media/user:'.$this-> data['Guest']['username'].'/key:'.$this->data['Guest']['key'].'/media.rss', true);25 $recentMedia = Router::url('/explorer/rss/key:'.$this->request->data['Guest']['key'], true); 26 $recentComments = Router::url('/comments/rss/key:'.$this->request->data['Guest']['key'], true); 27 $mediaRss = Router::url('/explorer/media/key:'.$this->request->data['Guest']['key'].'/media.rss', true); 28 $myMediaMediaRss = Router::url('/explorer/media/user:'.$this->request->data['Guest']['username'].'/key:'.$this->request->data['Guest']['key'].'/media.rss', true); 29 29 ?> 30 30 <ul> … … 35 35 </ul> 36 36 37 <p><?php echo __('Click %s to renew the authentication key. All previous links become invalid.', $this->Html->link(__('renew key'), 'links/'.$this-> data['Guest']['id'].'/renew')); ?></p>37 <p><?php echo __('Click %s to renew the authentication key. All previous links become invalid.', $this->Html->link(__('renew key'), 'links/'.$this->request->data['Guest']['id'].'/renew')); ?></p> -
View/Helper/ExplorerMenuHelper.php
r0fb8d7c ree4c2b7f 33 33 function _countAssociation($association) { 34 34 $result = array(); 35 if (isset($this-> data['Media'])) {36 $data = array($this-> data);35 if (isset($this->request->data['Media'])) { 36 $data = array($this->request->data); 37 37 } else { 38 $data =& $this-> data;38 $data =& $this->request->data; 39 39 } 40 40 if (!$data) { … … 199 199 function getMainMenu() { 200 200 $out = ''; 201 $data = $this-> data;201 $data = $this->request->data; 202 202 $this->Search->initialize(); 203 203 $items = array(); -
View/Helper/FlowplayerHelper.php
r1a41cea ree4c2b7f 35 35 /** Creates the link container for the flowplayer */ 36 36 function link($media) { 37 list($width, $height) = $this->ImageData->getimagesize($this-> data, OUTPUT_SIZE_VIDEO);37 list($width, $height) = $this->ImageData->getimagesize($this->request->data, OUTPUT_SIZE_VIDEO); 38 38 $height += 24; 39 39 $id = $media['Media']['id']; -
View/Helper/ImageDataHelper.php
r0fb8d7c ree4c2b7f 26 26 class ImageDataHelper extends AppHelper { 27 27 28 var $helpers = array('Session', ' Ajax', 'Html', 'Form', 'Search', 'Option', 'Breadcrumb');28 var $helpers = array('Session', 'Html', 'Form', 'Search', 'Option', 'Breadcrumb'); 29 29 30 30 var $Sanitize = null; … … 538 538 } 539 539 540 /* 540 541 if ($data['Media']['canWriteTag']) { 541 542 $output .= ' '.$this->Ajax->link( … … 552 553 } 553 554 } 555 */ 554 556 return $cells; 555 557 } -
View/Helper/SearchHelper.php
r3605ef4 ree4c2b7f 152 152 $this->_addParams(&$data, $add); 153 153 $this->_delParams(&$data, $del); 154 if (!$data) { 155 return ''; 156 } 154 157 ksort($data); 155 158 -
View/Images/view.ctp
r0fb8d7c ree4c2b7f 5 5 <span></span> 6 6 <?php 7 if (($this-> data['Media']['type'] & MEDIA_TYPE_VIDEO) > 0) {8 echo $flowplayer->video($this-> data);7 if (($this->request->data['Media']['type'] & MEDIA_TYPE_VIDEO) > 0) { 8 echo $flowplayer->video($this->request->data); 9 9 } else { 10 //$size = $this->ImageData->getimagesize($this-> data, OUTPUT_SIZE_PREVIEW);11 $size = $this->ImageData->getimagesize($this-> data, 960);12 $src = Router::url("/media/preview/".$this-> data['Media']['id']);13 $img = $this->Html->tag('img', null, array('src' => $src, 'width' => $size[0], 'height' => $size[1], 'alt' => $this-> data['Media']['name']));14 if ($ navigator->hasNextMedia()) {15 echo $this->Html->link($img, $ navigator->getNextMediaUrl(), array('escape' => false));10 //$size = $this->ImageData->getimagesize($this->request->data, OUTPUT_SIZE_PREVIEW); 11 $size = $this->ImageData->getimagesize($this->request->data, 960); 12 $src = Router::url("/media/preview/".$this->request->data['Media']['id']); 13 $img = $this->Html->tag('img', null, array('src' => $src, 'width' => $size[0], 'height' => $size[1], 'alt' => $this->request->data['Media']['name'])); 14 if ($this->Navigator->hasNextMedia()) { 15 echo $this->Html->link($img, $this->Navigator->getNextMediaUrl(), array('escape' => false)); 16 16 } else { 17 17 echo $img; … … 21 21 </div> 22 22 <div class="navigator"> 23 <div class="up"><div class="sub"><?php echo $ navigator->up(); ?></div></div>24 <?php if ($ navigator->hasPrevMedia()): ?>25 <div class="prev"><div class="sub"><?php echo $ navigator->prevMedia(); ?></div></div>23 <div class="up"><div class="sub"><?php echo $this->Navigator->up(); ?></div></div> 24 <?php if ($this->Navigator->hasPrevMedia()): ?> 25 <div class="prev"><div class="sub"><?php echo $this->Navigator->prevMedia(); ?></div></div> 26 26 <?php endif; ?> 27 <?php if ($ navigator->hasNextMedia()): ?>28 <div class="next"><div class="sub"><?php echo $ navigator->nextMedia(); ?></div></div>27 <?php if ($this->Navigator->hasNextMedia()): ?> 28 <div class="next"><div class="sub"><?php echo $this->Navigator->nextMedia(); ?></div></div> 29 29 <?php endif; ?> 30 30 </div> … … 34 34 <?php 35 35 $items = array(__("General"), __("Media Details")); 36 if ($ map->hasApi() && $map->hasMediaGeo($this->data)) {36 if ($this->Map->hasApi() && $this->Map->hasMediaGeo($this->request->data)) { 37 37 $items['map'] = __("Map"); 38 38 } 39 if ($this-> data['Media']['canWriteTag']) {39 if ($this->request->data['Media']['canWriteTag']) { 40 40 $items['edit'] = __("Edit"); 41 41 } 42 if ($this-> data['Media']['canWriteAcl']) {42 if ($this->request->data['Media']['canWriteAcl']) { 43 43 $items['acl'] = __("Access Right"); 44 44 } 45 echo $t ab->menu($items);45 echo $this->Tab->menu($items); 46 46 ?> 47 <?php echo $t ab->open(0); ?>47 <?php echo $this->Tab->open(0); ?> 48 48 <div class="meta"> 49 <div id="meta-<?php echo $this-> data['Media']['id']; ?>">49 <div id="meta-<?php echo $this->request->data['Media']['id']; ?>"> 50 50 <table class="bare"> 51 <?php echo $this->Html->tableCells($this->ImageData->metaTable(&$this-> data)); ?>51 <?php echo $this->Html->tableCells($this->ImageData->metaTable(&$this->request->data)); ?> 52 52 </table> 53 53 </div> 54 54 </div><!-- meta --> 55 <?php echo $t ab->close(); ?>55 <?php echo $this->Tab->close(); ?> 56 56 57 <?php echo $t ab->open(1); ?>57 <?php echo $this->Tab->open(1); ?> 58 58 <div class="meta"> 59 59 <table class="bare"> 60 60 <?php 61 61 $cells = array(); 62 $cells[] = array(__("User"), $this->Html->link($this-> data['User']['username'], '/explorer/user/'.$this->data['User']['username']));63 if ($this-> data['Media']['isOwner']) {62 $cells[] = array(__("User"), $this->Html->link($this->request->data['User']['username'], '/explorer/user/'.$this->request->data['User']['username'])); 63 if ($this->request->data['Media']['isOwner']) { 64 64 $files = array(); 65 foreach ($this-> data['File'] as $file) {65 foreach ($this->request->data['File'] as $file) { 66 66 $link = $this->ImageData->getPathLink($file); 67 67 $files[] = $this->Html->link($file['file'], $link).' ('.$this->Number->toReadableSize($file['size']).')'; … … 69 69 $cells[] = array(__("File(s)"), implode(', ', $files)); 70 70 } 71 $folders = $this->ImageData->getFolderLinks($this-> data);71 $folders = $this->ImageData->getFolderLinks($this->request->data); 72 72 if ($folders) { 73 73 $cells[] = array(__("Folder"), implode(' / ', $folders)); 74 74 } 75 $cells[] = array(__("View Count"), $this-> data['Media']['clicks']);76 $cells[] = array(__("Created"), $t ime->relativeTime($this->data['Media']['created']));77 $cells[] = array(__("Last modified"), $t ime->relativeTime($this->data['Media']['modified']));78 $cells[] = array(__("Size"), $this-> data['Media']['width'].'px * '.$this->data['Media']['height'].'px');75 $cells[] = array(__("View Count"), $this->request->data['Media']['clicks']); 76 $cells[] = array(__("Created"), $this->Time->timeAgoInWords($this->request->data['Media']['created'])); 77 $cells[] = array(__("Last modified"), $this->Time->timeAgoInWords($this->request->data['Media']['modified'])); 78 $cells[] = array(__("Size"), $this->request->data['Media']['width'].'px * '.$this->request->data['Media']['height'].'px'); 79 79 80 if ($this-> data['Media']['model']) {81 $cells[] = array(__("Model"), $this-> data['Media']['model']);80 if ($this->request->data['Media']['model']) { 81 $cells[] = array(__("Model"), $this->request->data['Media']['model']); 82 82 } 83 if ($this-> data['Media']['duration'] > 0) {84 $cells[] = array(__("Duration"), $this-> data['Media']['duration'].'s');83 if ($this->request->data['Media']['duration'] > 0) { 84 $cells[] = array(__("Duration"), $this->request->data['Media']['duration'].'s'); 85 85 } else { 86 if ($this-> data['Media']['aperture'] > 0) {87 $cells[] = array(__("Aperture"), $this-> data['Media']['aperture']);86 if ($this->request->data['Media']['aperture'] > 0) { 87 $cells[] = array(__("Aperture"), $this->request->data['Media']['aperture']); 88 88 } 89 if ($this-> data['Media']['shutter'] > 0) {90 $cells[] = array(__("Shutter"), $this->ImageData->niceShutter($this-> data['Media']['shutter']));89 if ($this->request->data['Media']['shutter'] > 0) { 90 $cells[] = array(__("Shutter"), $this->ImageData->niceShutter($this->request->data['Media']['shutter'])); 91 91 } 92 if ($this-> data['Media']['iso'] > 0) {93 $cells[] = array(__("ISO"), $this-> data['Media']['iso']);92 if ($this->request->data['Media']['iso'] > 0) { 93 $cells[] = array(__("ISO"), $this->request->data['Media']['iso']); 94 94 } 95 95 } … … 98 98 </table> 99 99 </div> 100 <?php echo $t ab->close(); ?>100 <?php echo $this->Tab->close(); ?> 101 101 <?php 102 if ($ map->hasApi() && $map->hasMediaGeo($this->data)) {103 echo $t ab->open('map');104 echo $ map->container();105 echo $ map->script();106 echo $t ab->close();102 if ($this->Map->hasApi() && $this->Map->hasMediaGeo($this->request->data)) { 103 echo $this->Tab->open('map'); 104 echo $this->Map->container(); 105 echo $this->Map->script(); 106 echo $this->Tab->close(); 107 107 } 108 if ($this-> data['Media']['canWriteTag']) {109 echo $t ab->open('edit');110 echo $this->Form->create(null, array('url' => 'update/'.$this-> data['Media']['id'].'/'.join('/', $crumbs), 'id' => 'edit'));108 if ($this->request->data['Media']['canWriteTag']) { 109 echo $this->Tab->open('edit'); 110 echo $this->Form->create(null, array('url' => 'update/'.$this->request->data['Media']['id'].'/'.join('/', $crumbs), 'id' => 'edit')); 111 111 echo "<fieldset>"; 112 112 echo View::element('single_meta_form'); 113 113 echo "</fieldset>"; 114 114 echo $this->Form->end(__('Save')); 115 echo $t ab->close();115 echo $this->Tab->close(); 116 116 } 117 if ($this-> data['Media']['canWriteAcl']) {118 echo $t ab->open('acl');119 echo $this->Form->create(null, array('url' => 'updateAcl/'.$this-> data['Media']['id'].'/'.join('/', $crumbs), 'id' => 'acl'));117 if ($this->request->data['Media']['canWriteAcl']) { 118 echo $this->Tab->open('acl'); 119 echo $this->Form->create(null, array('url' => 'updateAcl/'.$this->request->data['Media']['id'].'/'.join('/', $crumbs), 'id' => 'acl')); 120 120 echo "<fieldset>"; 121 121 echo View::element('single_acl_form'); 122 122 echo "</fieldset>"; 123 123 echo $this->Form->end(__('Save')); 124 echo $t ab->close();124 echo $this->Tab->close(); 125 125 } 126 126 ?> … … 182 182 JS; 183 183 $vars = array( 184 'ID' => $this-> data['Media']['id'],185 'LATITUDE' => ($this-> data['Media']['latitude'] ? $this->data['Media']['latitude'] : 0),186 'LONGITUDE' => ($this-> data['Media']['longitude'] ? $this->data['Media']['longitude'] : 0));184 'ID' => $this->request->data['Media']['id'], 185 'LATITUDE' => ($this->request->data['Media']['latitude'] ? $this->request->data['Media']['latitude'] : 0), 186 'LONGITUDE' => ($this->request->data['Media']['longitude'] ? $this->request->data['Media']['longitude'] : 0)); 187 187 foreach ($vars as $name => $value) { 188 188 $script = preg_replace("/:$name/", $value, $script); -
View/Options/rss.ctp
r0fb8d7c ree4c2b7f 8 8 9 9 <?php 10 $recentMedia = Router::url('/explorer/rss/key:'.$this-> data['User']['key'], true);11 $recentComments = Router::url('/comments/rss/key:'.$this-> data['User']['key'], true);12 $mediaRss = Router::url('/explorer/media/key:'.$this-> data['User']['key'].'/media.rss', true);13 $myMediaMediaRss = Router::url('/explorer/media/user:'.$this-> data['User']['username'].'/key:'.$this->data['User']['key'].'/media.rss', true);10 $recentMedia = Router::url('/explorer/rss/key:'.$this->request->data['User']['key'], true); 11 $recentComments = Router::url('/comments/rss/key:'.$this->request->data['User']['key'], true); 12 $mediaRss = Router::url('/explorer/media/key:'.$this->request->data['User']['key'].'/media.rss', true); 13 $myMediaMediaRss = Router::url('/explorer/media/user:'.$this->request->data['User']['username'].'/key:'.$this->request->data['User']['key'].'/media.rss', true); 14 14 ?> 15 15 <ul> -
View/System/delete_unused_meta_data.ctp
r0fb8d7c ree4c2b7f 1 1 <h1><?php echo __("Delete Unused Metadata"); ?></h1> 2 2 <?php echo $this->Session->flash(); ?> 3 <p><?php echo __("Delete all unused meta data from database: %d tags, %d categories, %d locations.", $this-> data['unusedTagCount'], $this->data['unusedCategoryCount'], $this->data['unusedLocationCount']); ?>3 <p><?php echo __("Delete all unused meta data from database: %d tags, %d categories, %d locations.", $this->request->data['unusedTagCount'], $this->request->data['unusedCategoryCount'], $this->request->data['unusedLocationCount']); ?> 4 4 </p><?php echo $this->Html->link(__('Delete'), 'deleteUnusedMetaData/delete', array('class' => 'button')); ?></p> -
View/Users/admin_edit.ctp
r0fb8d7c ree4c2b7f 1 <h1><?php echo __(" User: %s", $this-> data['User']['username']); ?></h1>1 <h1><?php echo __(" User: %s", $this->request->data['User']['username']); ?></h1> 2 2 3 3 <?php echo $this->Session->flash(); ?> 4 4 5 <?php echo $this->Form->create(null, array('action' => 'edit/'.$this-> data['User']['id'])); ?>5 <?php echo $this->Form->create(null, array('action' => 'edit/'.$this->request->data['User']['id'])); ?> 6 6 <fieldset><legend><?php echo __('General'); ?></legend> 7 7 <?php … … 13 13 $roles[ROLE_ADMIN] = __('Admin'); 14 14 } 15 echo $this->Form->input('User.role', array('type' => 'select', 'options' => $roles, 'selected' => $this-> data['User']['role']));15 echo $this->Form->input('User.role', array('type' => 'select', 'options' => $roles, 'selected' => $this->request->data['User']['role'])); 16 16 ?> 17 17 </fieldset> … … 20 20 <?php 21 21 echo $this->Form->input('User.expires', array('label' => __('Expire date'), 'type' => 'text')); 22 echo $this->Form->input('User.quota', array('type' => 'text', 'label' => __('Upload Quota'), 'value' => $this->Number->toReadableSize($this-> data['User']['quota'])));22 echo $this->Form->input('User.quota', array('type' => 'text', 'label' => __('Upload Quota'), 'value' => $this->Number->toReadableSize($this->request->data['User']['quota']))); 23 23 ?> 24 24 </fieldset> -
View/Users/admin_index.ctp
r0fb8d7c ree4c2b7f 2 2 <?php echo $this->Session->flash(); ?> 3 3 4 <?php $ paginator->options(array('update' => 'main_content', 'indicator' => 'spinner'));?>4 <?php $this->Paginator->options(array('update' => 'main_content', 'indicator' => 'spinner'));?> 5 5 6 <?php echo $ paginator->prev(__('Prev'), null, null, array('class' => 'disabled')); ?>7 <?php echo " | "; echo $ paginator->numbers(); ?>8 <?php echo $ paginator->next(__('Next'), null, null, array('class' => 'disabled')); ?>6 <?php echo $this->Paginator->prev(__('Prev'), null, null, array('class' => 'disabled')); ?> 7 <?php echo " | "; echo $this->Paginator->numbers(); ?> 8 <?php echo $this->Paginator->next(__('Next'), null, null, array('class' => 'disabled')); ?> 9 9 10 Page <?php echo $ paginator->counter() ?>10 Page <?php echo $this->Paginator->counter() ?> 11 11 12 12 <table class="default"> 13 13 <thead> 14 14 <tr> 15 <td><?php echo $ paginator->sort(__('Username'), 'username'); ?></td>16 <td><?php echo $ paginator->sort(__('Firstname'), 'firstname'); ?></td>17 <td><?php echo $ paginator->sort(__('Lastname'), 'lastname'); ?></td>15 <td><?php echo $this->Paginator->sort(__('Username'), 'username'); ?></td> 16 <td><?php echo $this->Paginator->sort(__('Firstname'), 'firstname'); ?></td> 17 <td><?php echo $this->Paginator->sort(__('Lastname'), 'lastname'); ?></td> 18 18 <td><?php echo __('Guests'); ?></td> 19 <td><?php echo $ paginator->sort(__('User role'), 'role'); ?></td>19 <td><?php echo $this->Paginator->sort(__('User role'), 'role'); ?></td> 20 20 <td><?php echo __('Actions'); ?></td> 21 21 </tr> … … 23 23 24 24 <tbody> 25 <?php $row=0; foreach($this-> data as $user): ?>25 <?php $row=0; foreach($this->request->data as $user): ?> 26 26 <tr class="<?php echo ($row++%2)?"even":"odd";?>"> 27 27 <td><?php echo $this->Html->link($user['User']['username'], '/admin/users/edit/'.$user['User']['id']);?></td> -
View/Users/admin_password.ctp
r0fb8d7c ree4c2b7f 1 <h1><?php echo __(" User: %s", $this-> data['User']['username']); ?></h1>1 <h1><?php echo __(" User: %s", $this->request->data['User']['username']); ?></h1> 2 2 3 3 <?php echo $this->Session->flash(); ?> 4 4 5 <?php echo $this->Form->create(null, array('action' => 'password/'.$this-> data['User']['id'])); ?>5 <?php echo $this->Form->create(null, array('action' => 'password/'.$this->request->data['User']['id'])); ?> 6 6 <fieldset><legend>Password</legend> 7 7 <?php -
View/Users/admin_path.ctp
r0fb8d7c ree4c2b7f 1 <h1><?php echo __(" User: %s", $this-> data['User']['username']); ?></h1>1 <h1><?php echo __(" User: %s", $this->request->data['User']['username']); ?></h1> 2 2 3 3 <?php echo $this->Session->flash(); ?> … … 19 19 <td><?php echo "$root"; ?></td> 20 20 <td><?php 21 $delConfirm = __("Do you really want to detete the path '%s' of '%s'?", $root, $this-> data['User']['username']);21 $delConfirm = __("Do you really want to detete the path '%s' of '%s'?", $root, $this->request->data['User']['username']); 22 22 echo $this->Html->link($this->Html->image('icons/delete.png', array('alt' => __('Delete'), 'title' => __("Delete path '%s'", $root))), 23 '/admin/users/delpath/'.$this-> data['User']['id'].'/'.$root, array('escape' => false), $delConfirm);?></td>23 '/admin/users/delpath/'.$this->request->data['User']['id'].'/'.$root, array('escape' => false), $delConfirm);?></td> 24 24 </tr> 25 25 <?php endforeach; ?> … … 35 35 <?php endif; ?> 36 36 37 <?php echo $this->Form->create(null, array('action' => 'path/'.$this-> data['User']['id'])); ?>37 <?php echo $this->Form->create(null, array('action' => 'path/'.$this->request->data['User']['id'])); ?> 38 38 <fieldset><legend><?php echo __('Add Directory'); ?></legend> 39 39 <?php echo $this->Form->input('Option.path.fspath', array('label' => __('Directory'))); ?> -
View/Users/admin_register.ctp
r0fb8d7c ree4c2b7f 5 5 <fieldset><legend><?php echo __('Registration'); ?></legend> 6 6 <?php echo $this->Form->input('user.register.enable', array('label' => __('Allow anonymous registration'), 'type' => 'checkbox')); ?> 7 <?php echo $this->Form->input('user.register.quota', array('label' => __('Initial quota limit'), 'type' => 'text', 'value' => $this->Number->toReadableSize($this-> data['user']['register']['quota']))); ?>7 <?php echo $this->Form->input('user.register.quota', array('label' => __('Initial quota limit'), 'type' => 'text', 'value' => $this->Number->toReadableSize($this->request->data['user']['register']['quota']))); ?> 8 8 </fieldset> 9 9 <?php echo $this->Form->end(__('Save')); ?> -
View/Users/index.ctp
r0fb8d7c ree4c2b7f 8 8 <?php echo $this->Session->flash(); ?> 9 9 10 <?php if (!empty($this-> data)): ?>10 <?php if (!empty($this->request->data)): ?> 11 11 <table class="default"> 12 12 <thead> … … 24 24 $cells = array(); 25 25 26 foreach($this-> data as $user) {26 foreach($this->request->data as $user) { 27 27 $row = array( 28 28 $this->Html->link($user['User']['username'], "view/{$user['User']['username']}"), 29 $t ime->relativeTime($user['User']['created']),29 $this->Time->timeAgoInWords($user['User']['created']), 30 30 ); 31 31 $cells[] = $row; -
View/Users/view.ctp
r0fb8d7c ree4c2b7f 1 1 <h1><?php 2 __('User %s', $this-> data['User']['username']);2 __('User %s', $this->request->data['User']['username']); 3 3 if ($currentUser['User']['role'] >= ROLE_SYSOP) { 4 echo " " . $this->Html->link(__("Edit"), array('action' => 'edit', 'admin' => true, $this-> data['User']['id']));4 echo " " . $this->Html->link(__("Edit"), array('action' => 'edit', 'admin' => true, $this->request->data['User']['id'])); 5 5 } 6 6 ?></h1> … … 24 24 <?php 25 25 $cells = array(); 26 $cells[] = array(__("Member since"), $this->Time-> relativeTime($this->data['User']['created']));27 $cells[] = array(__("Count of media"), $this-> data['Media']['count']);28 $cells[] = array(__("Count of files"), $this-> data['File']['count']);29 $cells[] = array(__("Size of files"), $this->Number->toReadableSize($this-> data['File']['bytes']));26 $cells[] = array(__("Member since"), $this->Time->timeAgoInWords($this->request->data['User']['created'])); 27 $cells[] = array(__("Count of media"), $this->request->data['Media']['count']); 28 $cells[] = array(__("Count of files"), $this->request->data['File']['count']); 29 $cells[] = array(__("Size of files"), $this->Number->toReadableSize($this->request->data['File']['bytes'])); 30 30 echo $this->Html->tableCells($cells, array('class' => 'odd'), array('class' => 'even')); 31 31 ?> … … 50 50 <?php 51 51 $cells = array(); 52 $groupIds = Set::extract('/Group/id', $this-> data);53 foreach ($this-> data['Group'] as $group) {52 $groupIds = Set::extract('/Group/id', $this->request->data); 53 foreach ($this->request->data['Group'] as $group) { 54 54 $username = implode('', Set::extract("/User[id={$group['user_id']}]/username", $users)); 55 55 $cells[] = array( 56 56 $this->Html->link($group['name'], "/groups/view/{$group['name']}"), 57 57 $this->Html->link($username, "/user/view/$username"), 58 $t ext->truncate($group['description'], 30, array('ending' => '...', 'exact' => false, 'html' => false)),58 $this->Text->truncate($group['description'], 30, array('ending' => '...', 'exact' => false, 'html' => false)), 59 59 $this->Html->link("View media", "/explorer/group/{$group['name']}") 60 60 ); 61 61 } 62 foreach ($this-> data['Member'] as $group) {62 foreach ($this->request->data['Member'] as $group) { 63 63 if (in_array($group['id'], $groupIds)) { 64 64 continue; … … 68 68 $this->Html->link($group['name'], "/groups/view/{$group['name']}"), 69 69 $this->Html->link($username, "/users/view/$username"), 70 $t ext->truncate($group['description'], 30, array('ending' => '...', 'exact' => false, 'html' => false)),70 $this->Text->truncate($group['description'], 30, array('ending' => '...', 'exact' => false, 'html' => false)), 71 71 $this->Html->link("View media", "/explorer/group/{$group['name']}") 72 72 ); … … 95 95 } 96 96 ?></p> 97 <p><?php echo __('See all media of user %s', $this->Html->link($this-> data['User']['username'], "/explorer/user/{$this->data['User']['username']}")); ?></p>97 <p><?php echo __('See all media of user %s', $this->Html->link($this->request->data['User']['username'], "/explorer/user/{$this->request->data['User']['username']}")); ?></p> 98 98 <?php endif; ?> -
View/home/index.ctp
r0fb8d7c ree4c2b7f 49 49 <div class="meta"> 50 50 <span class="from"><?php echo $comment['Comment']['name'] ?></span> said 51 <span class="date"><?php echo $t ime->relativeTime($comment['Comment']['date']); ?>:</span>51 <span class="date"><?php echo $this->Time->timeAgoInWords($comment['Comment']['date']); ?>:</span> 52 52 </div><!-- comment meta --> 53 53 54 54 <div class="text"> 55 <?php echo preg_replace('/\n/', '<br />', $t ext->truncate($comment['Comment']['text'], 220, array('ending' => '...', 'exact' => false, 'html' => false))); ?>55 <?php echo preg_replace('/\n/', '<br />', $this->Text->truncate($comment['Comment']['text'], 220, array('ending' => '...', 'exact' => false, 'html' => false))); ?> 56 56 </div> 57 57 </div><!-- comment -->
