Various file path fixes.

This commit is contained in:
Thomas Tanghus 2012-04-30 01:48:01 +02:00
parent a8b6fdd396
commit 9c520c70a8
7 changed files with 12 additions and 9 deletions

View File

@ -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

View File

@ -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);

View File

@ -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);

View File

@ -23,7 +23,7 @@ $id = isset($_['id']) ? $_['id'] : '';
<div id="contact_photo" class="contactsection">
<form class="float" id="file_upload_form" action="ajax/uploadphoto.php" method="post" enctype="multipart/form-data" target="file_upload_target">
<form class="float" id="file_upload_form" action="<?php echo OC_Helper::linkTo('contacts', 'ajax/uploadphoto.php'); ?>" method="post" enctype="multipart/form-data" target="file_upload_target">
<div class="tip propertycontainer" id="contacts_details_photo_wrapper" title="<?php echo $l->t('Click or drop to upload picture'); ?> (max <?php echo $_['uploadMaxHumanFilesize']; ?>)" data-element="PHOTO">
<!-- img style="padding: 1em;" id="contacts_details_photo" alt="Profile picture" src="photo.php?id=<?php echo $_['id']; ?>" / -->
<progress id="contacts_details_photo_progress" style="display:none;" value="0" max="100">0 %</progress>

View File

@ -22,7 +22,7 @@
</td>
</tr>
</table>
<form id="import_upload_form" action="ajax/uploadimport.php" method="post" enctype="multipart/form-data" target="import_upload_target">
<form id="import_upload_form" action="<?php echo OC_Helper::linkTo('contacts', 'ajax/uploadimport.php'); ?>" method="post" enctype="multipart/form-data" target="import_upload_target">
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $_['uploadMaxFilesize'] ?>" id="max_upload">
<input id="import_upload_start" type="file" accept="text/*" name="importfile" />
<input id="close_button" style="float: left;" type="button" onclick="Contacts.UI.Addressbooks.cancel(this);" value="<?php echo $l->t("Cancel"); ?>">

View File

@ -5,7 +5,7 @@ $RUNTIME_APPTYPES=array('filesystem');
// Init owncloud
require_once('../../lib/template.php');
require_once('lib/template.php');
OC_JSON::checkLoggedIn();

View File

@ -240,6 +240,6 @@ OCdialogs = {
var newval = parseInt($(dcid + ' #dirtree option:last').val())+1;
$(dcid + ' #dirtree').append('<option selected="selected" value="'+newval+'">'+name+'</option>');
$(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)});
}
};