Archived
1
0
Fork 0

minor view changes

This commit is contained in:
Fredric N 2010-10-03 01:38:49 +02:00
parent 4c2c435f19
commit 868d26f585
4 changed files with 63 additions and 2 deletions

View file

@ -6,13 +6,15 @@
<?php
$postCount = count($this->posts);
for ($i = 0; $i < $postCount; $i++):
$post = $this->posts[$i];
$post = $this->posts[$i];
?>
<div class="blogpost">
<h3><a href="<?=$this->url(array('action' => 'read','id' => $post->getId()),'blog-default') ?>"><?=$post->getTitle() ?></a></h3>
<div class="publish"><?=$post->getPubDate()->toString('yyyy-MM-dd').' at '.$post->getPubDate()->toString('HH:mm').' '.$post->getAuthor()->getFirstName() ?></div>
<div class="content"><?=$post->getContent() ?></div>
<div class="tags"><?=join(', ',$post->getTags()) ?></div>
</div>
<?php if ($i+1 != $postCount): ?>

View file

@ -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']);

View file

@ -44,3 +44,12 @@ function get_gravatar( $email, $s = 80, $d = '404', $r = 'g', $img = false, $att
<td>bbb</td>
</tr>
</table>
<?php
$user = new User(array('firstName' => 'Kalle', 'lastName' => 'Andersson'));
$user->save();
?>

View file

@ -250,3 +250,21 @@ div#agrement {
#footer, #footer a { color: #999 }
#footer a:hover { color: #333 }
ul.custom {
list-style-image: url(../img/ulli.png);
padding-left: 20px;
}
ul.custom li.item { margin-bottom: 20px }
ul.custom li.item h3 {
padding: 0 0 0 0;
margin: 0 0 0 0;
}
ul.custom li.item p {
padding: 0;
margin: 0 0 0 10px;
}