summaryrefslogtreecommitdiff
path: root/actions/avatarsettings.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-01-22 12:35:25 +0100
committerEvan Prodromou <evan@controlyourself.ca>2009-01-22 12:35:25 +0100
commita2a2dd88b5a580715a1b8256a5d8b7743675711c (patch)
treed9daa558200526d52aec315ccd196bef7dd46d5a /actions/avatarsettings.php
parent6a3204d08e035812cf111e20f72bf0c7ffb4c601 (diff)
parentf89f6a8eb0d16fc7c4114ba9279466189b857ea6 (diff)
Merge branch 'master' of evan@dev.controlyourself.ca:/var/www/trunk
Diffstat (limited to 'actions/avatarsettings.php')
-rw-r--r--actions/avatarsettings.php47
1 files changed, 28 insertions, 19 deletions
diff --git a/actions/avatarsettings.php b/actions/avatarsettings.php
index b303fd2fd..2c7af9b7a 100644
--- a/actions/avatarsettings.php
+++ b/actions/avatarsettings.php
@@ -37,12 +37,13 @@ require_once INSTALLDIR.'/lib/accountsettingsaction.php';
/**
* Upload an avatar
*
- * We use jQuery to crop the image after upload.
+ * We use jCrop plugin for jQuery to crop the image after upload.
*
* @category Settings
* @package Laconica
* @author Evan Prodromou <evan@controlyourself.ca>
* @author Zach Copley <zach@controlyourself.ca>
+ * @author Sarven Capadisli <csarven@controlyourself.ca>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://laconi.ca/
*/
@@ -94,42 +95,43 @@ class AvatarsettingsAction extends AccountSettingsAction
$original = $profile->getOriginalAvatar();
$this->elementStart('form', array('enctype' => 'multipart/form-data',
- 'method' => 'POST',
- 'id' => 'avatar',
+ 'method' => 'post',
+ 'id' => 'form_settings_avatar',
+ 'class' => 'form_settings',
'action' =>
common_local_url('avatarsettings')));
+ $this->elementStart('fieldset');
+ $this->element('legend', null, _('Avatar settings'));
$this->hidden('token', common_session_token());
+ $this->elementStart('ul', 'form_data');
if ($original) {
- $this->elementStart('div',
+ $this->elementStart('li',
array('id' => 'avatar_original',
'class' => 'avatar_view'));
- $this->element('h3', null, _("Original:"));
+ $this->element('h2', null, _("Original"));
$this->elementStart('div', array('id'=>'avatar_original_view'));
$this->element('img', array('src' => $original->url,
- 'class' => 'avatar original',
'width' => $original->width,
'height' => $original->height,
'alt' => $user->nickname));
$this->elementEnd('div');
- $this->elementEnd('div');
+ $this->elementEnd('li');
}
$avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
if ($avatar) {
- $this->elementStart('div',
+ $this->elementStart('li',
array('id' => 'avatar_preview',
'class' => 'avatar_view'));
- $this->element('h3', null, _("Preview:"));
+ $this->element('h2', null, _("Preview"));
$this->elementStart('div', array('id'=>'avatar_preview_view'));
$this->element('img', array('src' => $original->url,//$avatar->url,
- 'class' => 'avatar profile',
'width' => AVATAR_PROFILE_SIZE,
'height' => AVATAR_PROFILE_SIZE,
'alt' => $user->nickname));
$this->elementEnd('div');
- $this->elementEnd('div');
foreach (array('avatar_crop_x', 'avatar_crop_y',
'avatar_crop_w', 'avatar_crop_h') as $crop_info) {
@@ -138,21 +140,28 @@ class AvatarsettingsAction extends AccountSettingsAction
'id' => $crop_info));
}
$this->submit('crop', _('Crop'));
+
+ $this->elementEnd('li');
}
+ $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' => MAX_AVATAR_SIZE));
+ $this->elementEnd('li');
+ $this->elementEnd('ul');
- $this->elementStart('p');
-
- $this->element('input', array('name' => 'avatarfile',
- 'type' => 'file',
- 'id' => 'avatarfile'));
- $this->elementEnd('p');
-
+ $this->elementStart('ul', 'form_actions');
+ $this->elementStart('li');
$this->submit('upload', _('Upload'));
+ $this->elementEnd('li');
+ $this->elementEnd('ul');
+
+ $this->elementEnd('fieldset');
$this->elementEnd('form');
}
@@ -250,7 +259,7 @@ class AvatarsettingsAction extends AccountSettingsAction
{
parent::showStylesheets();
$jcropStyle =
- common_path('js/jcrop/jquery.Jcrop.css?version='.LACONICA_VERSION);
+ common_path('theme/base/css/jquery.Jcrop.css?version='.LACONICA_VERSION);
$this->element('link', array('rel' => 'stylesheet',
'type' => 'text/css',