X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fgrouplogo.php;h=a6694cd837c929327da53689ea267058a8ccca92;hb=c97048d01bea468e0cf8865b60c3c250b4515c39;hp=7b7c01b23b9fc7425d63585971669e713e86207d;hpb=6fa0bea76db45454071a08b12664d9f25fea5ca5;p=quix0rs-gnu-social.git diff --git a/actions/grouplogo.php b/actions/grouplogo.php index 7b7c01b23b..a6694cd837 100644 --- a/actions/grouplogo.php +++ b/actions/grouplogo.php @@ -32,7 +32,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } -require_once INSTALLDIR.'/lib/accountsettingsaction.php'; + define('MAX_ORIGINAL', 480); @@ -60,7 +60,6 @@ class GrouplogoAction extends GroupDesignAction /** * Prepare to run */ - function prepare($args) { parent::prepare($args); @@ -83,7 +82,7 @@ class GrouplogoAction extends GroupDesignAction } if (!$nickname) { - // TRANS: Client error displayed when trying to change group logo settings without having a nickname. + // TRANS: Client error displayed when trying to change group logo settings without providing a nickname. $this->clientError(_('No nickname.'), 404); return false; } @@ -181,8 +180,8 @@ class GrouplogoAction extends GroupDesignAction if (!$profile) { common_log_db_error($user, 'SELECT', __FILE__); - // TRANS: Server error displayed coming across a request from a user without a profile. - $this->serverError(_('User without matching profile.')); + // TRANS: Error message displayed when referring to a user without a profile. + $this->serverError(_('User has no profile.')); return; } @@ -205,7 +204,7 @@ class GrouplogoAction extends GroupDesignAction $this->elementStart('li', array('id' => 'avatar_original', 'class' => 'avatar_view')); // TRANS: Uploaded original file in group logo form. - $this->element('h2', null, _("Original")); + $this->element('h2', null, _('Original')); $this->elementStart('div', array('id'=>'avatar_original_view')); $this->element('img', array('src' => $this->group->original_logo, 'alt' => $this->group->nickname)); @@ -217,7 +216,7 @@ class GrouplogoAction extends GroupDesignAction $this->elementStart('li', array('id' => 'avatar_preview', 'class' => 'avatar_view')); // TRANS: Header for preview of to be displayed group logo. - $this->element('h2', null, _("Preview")); + $this->element('h2', null, _('Preview')); $this->elementStart('div', array('id'=>'avatar_preview_view')); $this->element('img', array('src' => $this->group->homepage_logo, 'width' => AVATAR_PROFILE_SIZE, @@ -228,13 +227,13 @@ class GrouplogoAction extends GroupDesignAction } $this->elementStart('li', array ('id' => 'settings_attach')); - $this->element('input', array('name' => 'avatarfile', - 'type' => 'file', - 'id' => 'avatarfile')); $this->element('input', array('name' => 'MAX_FILE_SIZE', 'type' => 'hidden', 'id' => 'MAX_FILE_SIZE', 'value' => ImageFile::maxFileSizeInt())); + $this->element('input', array('name' => 'avatarfile', + 'type' => 'file', + 'id' => 'avatarfile')); $this->elementEnd('li'); $this->elementEnd('ul'); @@ -247,7 +246,6 @@ class GrouplogoAction extends GroupDesignAction $this->elementEnd('fieldset'); $this->elementEnd('form'); - } function showCropForm() @@ -269,7 +267,7 @@ class GrouplogoAction extends GroupDesignAction array('id' => 'avatar_original', 'class' => 'avatar_view')); // TRANS: Header for originally uploaded file before a crop on the group logo page. - $this->element('h2', null, _("Original")); + $this->element('h2', null, _('Original')); $this->elementStart('div', array('id'=>'avatar_original_view')); $this->element('img', array('src' => Avatar::url($this->filedata['filename']), 'width' => $this->filedata['width'], @@ -282,7 +280,7 @@ class GrouplogoAction extends GroupDesignAction array('id' => 'avatar_preview', 'class' => 'avatar_view')); // TRANS: Header for the cropped group logo on the group logo page. - $this->element('h2', null, _("Preview")); + $this->element('h2', null, _('Preview')); $this->elementStart('div', array('id'=>'avatar_preview_view')); $this->element('img', array('src' => Avatar::url($this->filedata['filename']), 'width' => AVATAR_PROFILE_SIZE, @@ -304,7 +302,6 @@ class GrouplogoAction extends GroupDesignAction $this->elementEnd('ul'); $this->elementEnd('fieldset'); $this->elementEnd('form'); - } /** @@ -353,20 +350,21 @@ class GrouplogoAction extends GroupDesignAction return; } + $type = $imagefile->preferredType(); $filename = Avatar::filename($this->group->id, - image_type_to_extension($imagefile->type), + image_type_to_extension($type), null, 'group-temp-'.common_timestamp()); $filepath = Avatar::path($filename); - move_uploaded_file($imagefile->filepath, $filepath); + $imagefile->copyTo($filepath); $filedata = array('filename' => $filename, 'filepath' => $filepath, 'width' => $imagefile->width, 'height' => $imagefile->height, - 'type' => $imagefile->type); + 'type' => $type); $_SESSION['FILEDATA'] = $filedata; @@ -437,7 +435,6 @@ class GrouplogoAction extends GroupDesignAction * * @return void */ - function showStylesheets() { parent::showStylesheets(); @@ -449,7 +446,6 @@ class GrouplogoAction extends GroupDesignAction * * @return void */ - function showScripts() { parent::showScripts(); @@ -462,7 +458,7 @@ class GrouplogoAction extends GroupDesignAction $this->autofocus('avatarfile'); } - function showLocalNav() + function showObjectNav() { $nav = new GroupNav($this, $this->group); $nav->show();