exit(1);
}
-require_once INSTALLDIR.'/lib/accountsettingsaction.php';
+
define('MAX_ORIGINAL', 480);
/**
* Prepare to run
*/
-
function prepare($args)
{
parent::prepare($args);
}
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;
}
$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));
$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,
}
$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');
$this->elementEnd('fieldset');
$this->elementEnd('form');
-
}
function showCropForm()
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'],
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,
$this->elementEnd('ul');
$this->elementEnd('fieldset');
$this->elementEnd('form');
-
}
/**
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;
*
* @return void
*/
-
function showStylesheets()
{
parent::showStylesheets();
*
* @return void
*/
-
function showScripts()
{
parent::showScripts();