From c7b52a892872eaacaadc2f42639e56f340a9ac2b Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 20 Mar 2012 16:02:00 +0000 Subject: [PATCH] remove not necessary mime_(type|size|name) --- felamimail/inc/class.felamimail_hooks.inc.php | 3 --- felamimail/inc/class.uifelamimail.inc.php | 8 ++++---- phpgwapi/inc/class.egw_link.inc.php | 14 +------------- 3 files changed, 5 insertions(+), 20 deletions(-) diff --git a/felamimail/inc/class.felamimail_hooks.inc.php b/felamimail/inc/class.felamimail_hooks.inc.php index 35928b1470..d6957d5c75 100644 --- a/felamimail/inc/class.felamimail_hooks.inc.php +++ b/felamimail/inc/class.felamimail_hooks.inc.php @@ -85,9 +85,6 @@ class felamimail_hooks 'menuaction' => 'felamimail.uifelamimail.importMessageFromVFS2DraftAndDisplay', 'mime_popup' => '850xegw_getWindowOuterHeight()', 'mime_url' => 'formData[file]', - 'mime_name' => 'formData[name]', // why are these required? - 'mime_type' => 'formData[type]', - 'mime_size' => 'formData[size]', ), ), ); diff --git a/felamimail/inc/class.uifelamimail.inc.php b/felamimail/inc/class.uifelamimail.inc.php index 28962a9586..fb63de7929 100644 --- a/felamimail/inc/class.uifelamimail.inc.php +++ b/felamimail/inc/class.uifelamimail.inc.php @@ -617,7 +617,7 @@ class uifelamimail /** * importMessageFromVFS2DraftAndDisplay * - * @param array $_formData Array with information of name, type, file and size; file is required, + * @param array $formData Array with information of name, type, file and size; file is required, * name, type and size may be set here to meet the requirements * Example: $formData['name'] = 'a_email.eml'; * $formData['type'] = 'message/rfc822'; @@ -634,14 +634,14 @@ class uifelamimail // name should be set to meet the requirements of checkFileBasics if (parse_url($formData['file'],PHP_URL_SCHEME) == 'vfs' && (!isset($formData['name']) || empty($formData['name']))) { - $buff = explode('/',$_formData['file']); + $buff = explode('/',$formData['file']); $suffix = ''; if (is_array($buff)) $formData['name'] = array_pop($buff); // take the last part as name } // type should be set to meet the requirements of checkFileBasics if (parse_url($formData['file'],PHP_URL_SCHEME) == 'vfs' && (!isset($formData['type']) || empty($formData['type']))) { - $buff = explode('.',$_formData['file']); + $buff = explode('.',$formData['file']); $suffix = ''; if (is_array($buff)) $suffix = array_pop($buff); // take the last extension to check with ext2mime if (!empty($suffix)) $formData['type'] = mime_magic::ext2mime($suffix); @@ -659,7 +659,7 @@ class uifelamimail 'menuaction' => 'felamimail.uidisplay.display', 'uid' => $messageUid, 'mailbox' => base64_encode($draftFolder), - 'deleteDraftOnClose' => 1, + 'deleteDraftOnClose' => 1, ); } catch (egw_exception_wrong_userinput $e) diff --git a/phpgwapi/inc/class.egw_link.inc.php b/phpgwapi/inc/class.egw_link.inc.php index e36dc08df2..91b5539f2b 100644 --- a/phpgwapi/inc/class.egw_link.inc.php +++ b/phpgwapi/inc/class.egw_link.inc.php @@ -227,6 +227,7 @@ class egw_link extends solink 'edit','edit_id','edit_popup', 'list','list_popup', 'name','icon','query', + 'mime', ))); } return json_encode($to_json); @@ -951,19 +952,6 @@ class egw_link extends solink { throw egw_exception_assertion_failed("Missing 'mime_id' or 'mime_url' for mime-type '$type'!"); } - // some optional values fmail needs ... - foreach(array( - 'mime_type' => $type, - 'mime_size' => null, // filesize(egw_vfs::PREFIX.$path), - 'mime_name' => basename($path), - ) as $name => $value) - { - if (isset($data[$name])) - { - $data[$data[$name]] = $name == 'mime_size' ? filesize(egw_vfs::PREFIX.$path) : $value; - unset($data[$name]); - } - } $popup = $data['mime_popup']; unset($data['mime_popup']); }