Exemple #1
0
function user_pic($user, $size = 'small', $htmlOptions = array())
{
    //profile object needed to get internal url
    if (!$user['Profile']) {
        $user['Profile'] = LsDoctrineQuery::create()->from('sfGuardUserProfile p')->where('p.user_id = ?', $user['id'])->setHydrationMode(Doctrine::HYDRATE_ARRAY)->fetchOne();
    }
    if ($fn = $user['Profile']['filename']) {
        $str = $size . DIRECTORY_SEPARATOR . $fn;
    } else {
        $str = 'system' . DIRECTORY_SEPARATOR . 'user.png';
    }
    $htmlOptions = array_merge(array('alt' => $user['Profile']['public_name'], 'style' => 'border: 0;'), $htmlOptions);
    $link = link_to(image_tag($str, $htmlOptions), sfGuardUserTable::getInternalUrl($user));
    return $link;
}
Exemple #2
0
<?php

include_partial('global/section', array('title' => 'Research Groups', 'action' => array('text' => 'details', 'url' => sfGuardUserTable::getInternalUrl($user, 'groups'))));
?>

<div class="padded">
<?php 
foreach ($groups as $group) {
    ?>
  <?php 
    echo group_link($group);
    ?>
  <br />
<?php 
}
?>
</div>
 public function getInternalUrl($action = null, $params = null)
 {
     return sfGuardUserTable::getInternalUrl($this, $action, $params);
 }