Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
UserProfileWidget.php
1 <div class="user-profile-widget">
2  <h2><?php echo UserModule::t('Your profile'); ?></h2>
3 
4  <?php if (Yii::app()->user->hasFlash('profileMessage')) { ?>
5  <div class="success">
6  <?php echo Yii::app()->user->getFlash('profileMessage'); ?>
7  </div>
8  <?php } ?>
9  <table class="dataGrid">
10  <tr>
11  <th class="label"><?php echo CHtml::encode($model->getAttributeLabel('username')); ?></th>
12  <td>
13  <?php echo CHtml::encode($model->username); ?>
14  </td>
15  </tr>
16  <tr>
17  <th class="label"><?php echo CHtml::encode($model->getAttributeLabel('email')); ?>
18  </th>
19  <td><?php echo CHtml::encode($model->email); ?>
20  </td>
21  </tr>
22  <tr>
23  <th class="label"><?php echo CHtml::encode($model->getAttributeLabel('createtime')); ?>
24  </th>
25  <td><?php echo $model->createtime; ?>
26  </td>
27  </tr>
28  <tr>
29  <th class="label"><?php echo CHtml::encode($model->getAttributeLabel('lastvisit')); ?>
30  </th>
31  <td><?php echo $model->lastvisit; ?>
32  </td>
33  </tr>
34  <tr>
35  <th class="label"><?php echo CHtml::encode($model->getAttributeLabel('status')); ?>
36  </th>
37  <td><?php echo CHtml::encode(User::itemAlias("UserStatus", $model->status));
38  ?>
39  </td>
40  </tr>
41  <?php
42  $profileFields = ProfileField::model()->forOwner()->sort()->findAll();
43  if ($profileFields) {
44  foreach ($profileFields as $field) {
45  //echo "<pre>"; print_r($profile); die();
46  ?>
47  <tr>
48  <th class="label"><?php echo CHtml::encode(UserModule::t($field->title)); ?></th>
49  <td>
50  <?php echo (($field->widgetView($profile)) ? $field->widgetView($profile) : CHtml::encode((($field->range) ? Profile::range($field->range, $profile->getAttribute($field->varname)) : $profile->getAttribute($field->varname)))); ?>
51  </td>
52  </tr>
53  <?php
54  }
55  //$profile->getAttribute($field->varname)
56  }
57  ?>
58 
59  </table>
60 </div>