diff options
author | Thomas Tanghus <thomas@tanghus.net> | 2012-07-19 23:48:17 +0200 |
---|---|---|
committer | Thomas Tanghus <thomas@tanghus.net> | 2012-07-20 00:18:23 +0200 |
commit | 1cbddcf211d81065bf91bacee5b318c48b6b27aa (patch) | |
tree | 750491cb581baa03884160e0bdf4e709489ce861 /apps/contacts/ajax/savecrop.php | |
parent | 616f2f336e1e03aaf22aeed7196182b1890669b5 (diff) | |
download | nextcloud-server-1cbddcf211d81065bf91bacee5b318c48b6b27aa.tar.gz nextcloud-server-1cbddcf211d81065bf91bacee5b318c48b6b27aa.zip |
Code style
Diffstat (limited to 'apps/contacts/ajax/savecrop.php')
-rw-r--r-- | apps/contacts/ajax/savecrop.php | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/apps/contacts/ajax/savecrop.php b/apps/contacts/ajax/savecrop.php index adce6be3b39..3958af5c07c 100644 --- a/apps/contacts/ajax/savecrop.php +++ b/apps/contacts/ajax/savecrop.php @@ -27,7 +27,7 @@ OCP\JSON::callCheck(); // Firefox and Konqueror tries to download application/json for me. --Arthur OCP\JSON::setContentTypeHeader('text/plain'); -require_once('loghandler.php'); +require_once 'loghandler.php'; $image = null; @@ -48,7 +48,7 @@ if($id == '') { bailOut('Missing contact id.'); } -OCP\Util::writeLog('contacts','savecrop.php: key: '.$tmpkey, OCP\Util::DEBUG); +OCP\Util::writeLog('contacts', 'savecrop.php: key: '.$tmpkey, OCP\Util::DEBUG); $data = OC_Cache::get($tmpkey); if($data) { @@ -56,7 +56,9 @@ if($data) { if($image->loadFromdata($data)) { $w = ($w != -1 ? $w : $image->width()); $h = ($h != -1 ? $h : $image->height()); - OCP\Util::writeLog('contacts','savecrop.php, x: '.$x1.' y: '.$y1.' w: '.$w.' h: '.$h, OCP\Util::DEBUG); + OCP\Util::writeLog('contacts', + 'savecrop.php, x: '.$x1.' y: '.$y1.' w: '.$w.' h: '.$h, + OCP\Util::DEBUG); if($image->crop($x1, $y1, $w, $h)) { if(($image->width() <= 200 && $image->height() <= 200) || $image->resize(200)) { $card = OC_Contacts_App::getContactVCard($id); @@ -65,7 +67,9 @@ if($data) { bailOut(OC_Contacts_App::$l10n->t('Error getting contact object.')); } if($card->__isset('PHOTO')) { - OCP\Util::writeLog('contacts','savecrop.php: PHOTO property exists.', OCP\Util::DEBUG); + OCP\Util::writeLog('contacts', + 'savecrop.php: PHOTO property exists.', + OCP\Util::DEBUG); $property = $card->__get('PHOTO'); if(!$property) { OC_Cache::remove($tmpkey); @@ -76,8 +80,12 @@ if($data) { $property->parameters[] = new Sabre_VObject_Parameter('TYPE', $image->mimeType()); $card->__set('PHOTO', $property); } else { - OCP\Util::writeLog('contacts','savecrop.php: files: Adding PHOTO property.', OCP\Util::DEBUG); - $card->addProperty('PHOTO', $image->__toString(), array('ENCODING' => 'b', 'TYPE' => $image->mimeType())); + OCP\Util::writeLog('contacts', + 'savecrop.php: files: Adding PHOTO property.', + OCP\Util::DEBUG); + $card->addProperty('PHOTO', + $image->__toString(), array('ENCODING' => 'b', + 'TYPE' => $image->mimeType())); } $now = new DateTime; $card->setString('REV', $now->format(DateTime::W3C)); |