Skip to content

Commit

Permalink
Deleting two json-encode-only views, fixing a new-line bug in app_con…
Browse files Browse the repository at this point in the history
…troller.php, variables name changes in config.php
  • Loading branch information
vad committed Apr 7, 2009
1 parent b0fbb73 commit 49a2ef2
Show file tree
Hide file tree
Showing 15 changed files with 28 additions and 99 deletions.
2 changes: 0 additions & 2 deletions app_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
* along with Taolin. If not, see <http://www.gnu.org/licenses/>.
*
*/
?>

<?php
class AppController extends Controller
{
function checkSession()
Expand Down
8 changes: 4 additions & 4 deletions config/config.sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
'App.contactus' => 'admin@example.com', //email address used in photos controller
'App.addtomail' => '@example.com',
'App.defaultgroupname' => 'Group',
'App.imagefolder' => 'YOUR_PATH/user_images', //folder must be img/user_images, update only the absolute path
'App.webcamfolder' => 'ONE_PATH/webcam/',
'App.imagefoldererror' => 'ANOTHER_PATH/images_upload_error/', //folder must be img/user_images, update only the absolute path, for FBK is /www/desktop/html/images_desktop/
'App.imagefoldername' => 'user_images/',
'App.imagefolder.fs_path' => 'YOUR_PATH/user_images', //folder must be img/user_images, update only the absolute path
'App.imagefolder.error_fs_path' => 'ANOTHER_PATH/images_upload_error/', //folder must be img/user_images, update only the absolute path, for FBK is /www/desktop/html/images_desktop/
'App.imagefolder.web_path' => 'user_images/',
'App.imagefolder.webcam_fs_path' => 'ONE_PATH/webcam/',
'App.publications' => '1', //1 for TRUE, 0 for FALSE; used only when you have a server to show publications
'App.auth' => 'Dummy', //Choose between Dummy or Ldap
'App.jsdebug' => '1', //used in views/portal/index.ctp
Expand Down
8 changes: 4 additions & 4 deletions controllers/photos_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function getphotos(){

$photo_ar = $this->Photo->find('all', $query);

$imagefoldername = Configure::read('App.imagefoldername');
$imagefoldername = Configure::read('App.imagefolder.web_path');

foreach($photo_ar as $photo){
$photo['Photo']['size'] = $photo[0]['size'];
Expand Down Expand Up @@ -112,7 +112,7 @@ function setdefaultphoto($p_id){
$params = $this->Photo->findById($p_id, array('field' =>'Photo.name','Photo.filename','Photo.width','Photo.height','Photo.caption',));

// Add event to the timeline
$imagefoldername = Configure::read('App.imagefoldername');
$imagefoldername = Configure::read('App.imagefolder.web_path');

$sanitized_desc = $this->san->html(str_replace('\'', '\\\'', $params['Photo']['caption']));
$this->addtotimeline(array("url" => (Router::url('/')).'img/'.$imagefoldername.$params['Photo']['filename'], "width" => $params['Photo']['width'], "height" => $params['Photo']['height'], "filename" => $params['Photo']['filename'], "caption" => $sanitized_desc, "name" => $params['Photo']['name']));
Expand All @@ -133,7 +133,7 @@ function uploadphoto(){
$response['success'] = false;

/* Directory into which file would be uploaded */
$dest_dir = Configure::read('App.imagefolder');
$dest_dir = Configure::read('App.imagefolder.fs_path');

$user_id = $this->Session->read('id');

Expand All @@ -143,7 +143,7 @@ function uploadphoto(){
$maxFileSizeInKb = round($maxFileSize/1024);

// Directory where not correctly uploaded photos are stored
$error_dir = Configure::read('App.imagefoldererror');
$error_dir = Configure::read('App.imagefolder.error_fs_path');

$params = $this->params['form'];
$file_params = $this->params['form']['file'];
Expand Down
2 changes: 1 addition & 1 deletion controllers/timelines_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function gettimeline(){

foreach($events as $event){
$event['user_photo'] = $hash_photos[$event['user_id']];
$event['img_path'] = Configure::read('App.imagefoldername');
$event['img_path'] = Configure::read('App.imagefolder.web_path');
$event['event'] = $this->prepareevent($event);
unset($event['param'], $event['temp']);
$result[] = $event;
Expand Down
2 changes: 1 addition & 1 deletion controllers/users_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function getinfo($id=-1) {
$defaultgroupname = Configure::read('App.defaultgroupname');
$json['user']['defaultgroupname'] = $defaultgroupname;

$imagefoldername = Configure::read('App.imagefoldername');
$imagefoldername = Configure::read('App.imagefolder.web_path');

if (!empty($photo['Photo'])){
$json['user']['photo'] = Router::url('/').'img/'.$imagefoldername.'t640x480/'.$photo['Photo']['filename'];
Expand Down
2 changes: 1 addition & 1 deletion controllers/users_widgets_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function getinitialconfig(){

$response['config']['addtomail'] = Configure::read('App.addtomail');
$response['config']['contactus'] = Configure::read('App.contactus');
$response['config']['imgpath'] = Configure::read('App.imagefoldername');
$response['config']['imgpath'] = Configure::read('App.imagefolder.web_path');
$response['config']['jabber_server'] = Configure::read('App.jabber.server');
$response['config']['jabber_domain'] = Configure::read('App.jabber.domain');

Expand Down
9 changes: 5 additions & 4 deletions controllers/webcams_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
* along with Taolin. If not, see <http://www.gnu.org/licenses/>.
*
*/
?>
<?php

uses('sanitize');

Expand Down Expand Up @@ -85,9 +83,12 @@ function gettime(){


function getsnapshot() {
$webcamfolder = Configure::read('App.webcamfolder');
define('SNAPSHOT', $webcamfolder.'noise_cantinery.jpg');
Configure::write('debug', '0');
$this->layout = 'ajax';
header('Content-Type: image/jpeg');

$webcamfolder = Configure::read('App.imagefolder.webcam_fs_path');
define('SNAPSHOT', $webcamfolder.'noise_cantinery.jpg');
readfile(SNAPSHOT);
}

Expand Down
4 changes: 2 additions & 2 deletions controllers/widgets_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function listwidgets(){
$results['widgets'] = $widgets;
$results['totalCount'] = $count;

$this->set('result', $results);
$this->set('json', $results);
}


Expand All @@ -83,7 +83,7 @@ function donothing($id, $action){

$response = array();
$response['success'] = true;
$this->set('response', $response);
$this->set('json', $response);
}


Expand Down
2 changes: 1 addition & 1 deletion controllers/wrappers_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function getrss() {
$out['items'][] = $tmp;
}

$this->set('out', $out);
$this->set('json', $out);
}


Expand Down
5 changes: 1 addition & 4 deletions index.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

<?php
/* SVN FILE: $Id: index.php 6305 2008-01-02 02:33:56Z phpnut $ */
/**
Expand All @@ -24,6 +23,4 @@
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
require 'webroot' . DIRECTORY_SEPARATOR . 'index.php';
?>


?>
7 changes: 4 additions & 3 deletions views/webcams/getsnapshot.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* along with Taolin. If not, see <http://www.gnu.org/licenses/>.
*
*/
?>
//This view is empty because the corresponding controller does everything (returns an image)
//This is not clean but it works

//This view is empty because the corresponding controller does everything (returns an image)
//This is not clean but it works
?>
23 changes: 0 additions & 23 deletions views/widgets/donothing.ctp

This file was deleted.

23 changes: 0 additions & 23 deletions views/widgets/listwidgets.ctp

This file was deleted.

7 changes: 4 additions & 3 deletions views/workplaces/getmap.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* along with Taolin. If not, see <http://www.gnu.org/licenses/>.
*
*/
?>
//This view is empty because the corresponding controller does everything (returns an image)
//This is not clean but it works

//This view is empty because the corresponding controller does everything (returns an image)
//This is not clean but it works
?>
23 changes: 0 additions & 23 deletions views/wrappers/getrss.ctp

This file was deleted.

0 comments on commit 49a2ef2

Please sign in to comment.