diff --git a/application/modules/blog/views/scripts/index/latest.phtml b/application/modules/blog/views/scripts/index/latest.phtml
index 908109f..f3b926a 100644
--- a/application/modules/blog/views/scripts/index/latest.phtml
+++ b/application/modules/blog/views/scripts/index/latest.phtml
@@ -6,13 +6,15 @@
posts);
for ($i = 0; $i < $postCount; $i++):
-$post = $this->posts[$i];
+
+ $post = $this->posts[$i];
?>
=$post->getPubDate()->toString('yyyy-MM-dd').' at '.$post->getPubDate()->toString('HH:mm').' '.$post->getAuthor()->getFirstName() ?>
=$post->getContent() ?>
+
=join(', ',$post->getTags()) ?>
diff --git a/application/modules/default/controllers/ProfileController.php b/application/modules/default/controllers/ProfileController.php
index a71eaec..4514bb6 100644
--- a/application/modules/default/controllers/ProfileController.php
+++ b/application/modules/default/controllers/ProfileController.php
@@ -2,6 +2,11 @@
class ProfileController extends Fiktiv_Controller_Action
{
+ public function preDispatch() {
+ if (!Zend_Auth::getInstance()->hasIdentity())
+ $this->_redirect('/');
+ }
+
public function indexAction()
{
@@ -22,6 +27,21 @@ class ProfileController extends Fiktiv_Controller_Action
'validators' => array(new Zend_Validate_Alpha())
));
+ $options = array(
+ User::AVATAR_NONE => 'Ingen avatar',
+ User::AVATAR_FIKTIV => 'Egen avatar',
+ User::AVATAR_GRVTAR => 'Gravatar'
+ );
+ $form->addElement('select', 'avatar', array(
+ 'label' => 'u:avatar type',
+ 'validators' => array(new Zend_Validate_InArray($options)),
+ 'multiOptions' => $options
+ ));
+
+ $form->addElement('file', 'avatarImage', array(
+ 'label' => 'Upload avatar'
+ ));
+
$form->addElement('password', 'password', array(
'label' => 'u:password',
'validators' => array(new Zend_Validate_Alnum())
@@ -48,12 +68,23 @@ class ProfileController extends Fiktiv_Controller_Action
)
);
+ $form->addDisplayGroup(
+ array(
+ 'avatar',
+ 'avatarImage',
+ ),
+ 'partTwo',
+ array(
+ 'legend' => 'u:avatar'
+ )
+ );
+
$form->addDisplayGroup(
array(
'password',
'passwordConfirm'
),
- 'partTwo',
+ 'partThree',
array(
'legend' => 'u:change password'
)
@@ -87,6 +118,7 @@ class ProfileController extends Fiktiv_Controller_Action
unset($data['password']);
}
+
unset($data['passwordConfirm']);
unset($data['save']);
diff --git a/application/modules/default/views/scripts/index/index.phtml b/application/modules/default/views/scripts/index/index.phtml
index 68d738c..70dcbd8 100644
--- a/application/modules/default/views/scripts/index/index.phtml
+++ b/application/modules/default/views/scripts/index/index.phtml
@@ -44,3 +44,12 @@ function get_gravatar( $email, $s = 80, $d = '404', $r = 'g', $img = false, $att