HCE Project DC service web UI  0.2
Hierarchical Cluster Engine DC service web UI
 All Classes Namespaces Files Functions Variables Pages
edit.php
Go to the documentation of this file.
1 <?php $this->pageTitle = Yii::app()->name.' - '.UserModule::t("Profile");
2 $this->breadcrumbs = array(
3  UserModule::t("Profile") => array('profile'),
4  UserModule::t("Edit"),
5 );
6 $this->menu = array(
7  array('label' => UserModule::t('Profile'), 'url' => array('/user/profile')),
8  array('label' => UserModule::t('Change password'), 'url' => array('changepassword')),
9  array('label' => UserModule::t('Logout'), 'url' => array('/user/logout')),
10 );
11 ?><h1><?php echo UserModule::t('Edit profile'); ?></h1>
12 
13 <?php if (Yii::app()->user->hasFlash('profileMessage')): ?>
14 <div class="success">
15 <?php echo Yii::app()->user->getFlash('profileMessage'); ?>
16 </div>
17 <?php endif; ?>
18 <div class="form">
19 <?php $form = $this->beginWidget('CActiveForm', array(
20  'id' => 'profile-form',
21  'enableAjaxValidation' => true,
22  'htmlOptions' => array('enctype' => 'multipart/form-data'),
23 )); ?>
24 
25  <p class="note"><?php echo UserModule::t('Fields with <span class="required">*</span> are required.'); ?></p>
26 
27  <?php echo $form->errorSummary(array($model, $profile)); ?>
28 
29 <?php
30  $profileFields = $profile->getFields();
32  foreach ($profileFields as $field) {
33  ?>
34  <div class="row">
35  <?php echo $form->labelEx($profile, $field->varname);
36 
37  if ($widgetEdit = $field->widgetEdit($profile)) {
38  echo $widgetEdit;
39  } elseif ($field->range) {
40  echo $form->dropDownList($profile, $field->varname, Profile::range($field->range));
41  } elseif ($field->field_type == "TEXT") {
42  echo $form->textArea($profile, $field->varname, array('rows' => 6, 'cols' => 50));
43  } else {
44  echo $form->textField($profile, $field->varname, array('size' => 60, 'maxlength' => (($field->field_size) ? $field->field_size : 255)));
45  }
46  echo $form->error($profile, $field->varname);
47  ?>
48  </div>
49  <?php
50 
51  }
52  }
53 ?>
54  <div class="row">
55  <?php echo $form->labelEx($model, 'username'); ?>
56  <?php echo $form->textField($model, 'username', array('size' => 20, 'maxlength' => 20)); ?>
57  <?php echo $form->error($model, 'username'); ?>
58  </div>
59 
60  <div class="row">
61  <?php echo $form->labelEx($model, 'email'); ?>
62  <?php echo $form->textField($model, 'email', array('size' => 60, 'maxlength' => 128)); ?>
63  <?php echo $form->error($model, 'email'); ?>
64  </div>
65 
66  <div class="row buttons">
67  <?php echo CHtml::submitButton($model->isNewRecord ? UserModule::t('Create') : UserModule::t('Save')); ?>
68  </div>
69 
70 <?php $this->endWidget(); ?>
71 
72 </div><!-- form -->