From 9c520c70a8df5057ab20db8282e8fb63520bde88 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Mon, 30 Apr 2012 01:48:01 +0200 Subject: [PATCH] Various file path fixes. --- apps/contacts/ajax/currentphoto.php | 2 +- apps/contacts/ajax/oc_photo.php | 8 ++++---- apps/contacts/js/contacts.js | 3 +++ apps/contacts/templates/part.contact.php | 2 +- apps/contacts/templates/part.importaddressbook.php | 2 +- apps/files/ajax/rawlist.php | 2 +- core/js/oc-dialogs.js | 2 +- 7 files changed, 12 insertions(+), 9 deletions(-) diff --git a/apps/contacts/ajax/currentphoto.php b/apps/contacts/ajax/currentphoto.php index 15cb6c7a08..171f5c3478 100644 --- a/apps/contacts/ajax/currentphoto.php +++ b/apps/contacts/ajax/currentphoto.php @@ -20,7 +20,7 @@ * */ // Init owncloud -require_once('../../../lib/base.php'); +//require_once('../../../lib/base.php'); // Check if we are a user // Firefox and Konqueror tries to download application/json for me. --Arthur diff --git a/apps/contacts/ajax/oc_photo.php b/apps/contacts/ajax/oc_photo.php index 14d77ea50b..e46441c482 100644 --- a/apps/contacts/ajax/oc_photo.php +++ b/apps/contacts/ajax/oc_photo.php @@ -20,7 +20,7 @@ * */ // Init owncloud -require_once('../../../lib/base.php'); +require_once('lib/base.php'); // Check if we are a user // Firefox and Konqueror tries to download application/json for me. --Arthur @@ -36,11 +36,11 @@ function debug($msg) { OC_Log::write('contacts','ajax/oc_photo.php: '.$msg, OC_Log::DEBUG); } -if (!isset($_GET['id'])) { +if(!isset($_GET['id'])) { bailOut(OC_Contacts_App::$l10n->t('No contact ID was submitted.')); } -if (!isset($_GET['path'])) { +if(!isset($_GET['path'])) { bailOut(OC_Contacts_App::$l10n->t('No photo path was submitted.')); } @@ -66,7 +66,7 @@ if(!$image->fixOrientation()) { // No fatal error so we don't bail out. debug('Couldn\'t save correct image orientation: '.$tmpfname); } if($image->save($tmpfname)) { - OC_JSON::success(array('data' => array('mime'=>$_SERVER['CONTENT_TYPE'], 'name'=>$fn, 'id'=>$id, 'tmp'=>$tmpfname))); + OC_JSON::success(array('data' => array('id'=>$_GET['id'], 'tmp'=>$tmpfname))); exit(); } else { bailOut('Couldn\'t save temporary image: '.$tmpfname); diff --git a/apps/contacts/js/contacts.js b/apps/contacts/js/contacts.js index 7333b0e8d4..ba8e08fd87 100644 --- a/apps/contacts/js/contacts.js +++ b/apps/contacts/js/contacts.js @@ -1066,6 +1066,9 @@ Contacts={ }, loadPhotoHandlers:function(){ $('#phototools li a').tipsy(); + $('#phototools li a').click(function() { + $(this).tipsy('hide'); + }); $('#contacts_details_photo_wrapper').hover( function () { $('#phototools').slideDown(200); diff --git a/apps/contacts/templates/part.contact.php b/apps/contacts/templates/part.contact.php index a35d38e886..bbe2014332 100644 --- a/apps/contacts/templates/part.contact.php +++ b/apps/contacts/templates/part.contact.php @@ -23,7 +23,7 @@ $id = isset($_['id']) ? $_['id'] : '';
-
+
diff --git a/apps/contacts/templates/part.importaddressbook.php b/apps/contacts/templates/part.importaddressbook.php index 3efb90cd22..2db2336886 100644 --- a/apps/contacts/templates/part.importaddressbook.php +++ b/apps/contacts/templates/part.importaddressbook.php @@ -22,7 +22,7 @@ - + "> diff --git a/apps/files/ajax/rawlist.php b/apps/files/ajax/rawlist.php index 8f1990d1b8..0b37b93674 100644 --- a/apps/files/ajax/rawlist.php +++ b/apps/files/ajax/rawlist.php @@ -5,7 +5,7 @@ $RUNTIME_APPTYPES=array('filesystem'); // Init owncloud -require_once('../../lib/template.php'); +require_once('lib/template.php'); OC_JSON::checkLoggedIn(); diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js index 6a3dac02ea..7e41c1a7a5 100644 --- a/core/js/oc-dialogs.js +++ b/core/js/oc-dialogs.js @@ -240,6 +240,6 @@ OCdialogs = { var newval = parseInt($(dcid + ' #dirtree option:last').val())+1; $(dcid + ' #dirtree').append(''); $(dcid + ' .filepicker_loader').css('visibility', 'visible'); - $.getJSON(OC.webroot+'/files/ajax/rawlist.php', {dir: p, mimetype: $(dcid).data('mimetype')}, function(r){OC.dialogs.fillFilePicker(r, dcid)}); + $.getJSON(OC.filePath('files', 'ajax', 'rawlist.php'), {dir: p, mimetype: $(dcid).data('mimetype')}, function(r){OC.dialogs.fillFilePicker(r, dcid)}); } };