Yum::requiredFieldNote(); ?> </p> <?php $form = $this->beginWidget('CActiveForm', array('id' => 'privacysetting-form', 'enableAjaxValidation' => true)); echo $form->errorSummary($model); ?> <div class="profile_field_selection"> <?php echo '<h3>' . Yum::t('Profile field public options') . '</h3>'; echo '<p>' . Yum::t('Select the fields that should be public') . ':</p>'; $i = 1; $counter = 0; foreach (YumProfileField::model()->findAll() as $field) { $counter++; if ($counter == 1) { echo '<div class="float-left" style="width: 175px;">'; } printf('<div>%s<label class="profilefieldlabel" for="privacy_for_field_%d">%s</label></div>', CHtml::checkBox("privacy_for_field_{$i}", $model->public_profile_fields & $i), $i, Yum::t($field->title)); $i *= 2; if ($counter % 4 == 0) { echo '</div><div class="float-left" style="width: 175px;">'; } } if ($counter % 4 != 0) { echo '</div>'; } echo '<div class="clear"></div>'; ?>
/** * Load profile fields. * Overwrite this method to get another set of fields * @since 0.6 * @return array of YumProfileFields or empty array */ public function loadProfileFields() { if (self::$fields === null) { self::$fields = YumProfileField::model()->cache(3600)->findAll(); if (self::$fields == null) { self::$fields = array(); } } return self::$fields; }
) ); $this->widget('zii.widgets.CDetailView', array( 'data'=>$model, 'attributes'=>$attributes, )); } else { // For all users $attributes = array( 'username', ); if($profiles) { $profileFields = YumProfileField::model()->forAll()->findAll(); if ($profileFields) { foreach($profileFields as $field) { array_push($attributes,array( 'label' => Yii::t('UserModule.user', $field->title), 'name' => $field->varname, 'value' => $model->profile->getAttribute($field->varname), )); } } } array_push($attributes, array( 'name' => 'createtime', 'value' => date(UserModule::$dateFormat,$model->createtime),
<?php if (!Yum::module()->loginType & UserModule::LOGIN_BY_EMAIL) { ?> <tr> <th class="label"><?php echo CHtml::encode($model->getAttributeLabel('username')); ?> </th> <td><?php echo CHtml::encode($model->username); ?> </td> </tr> <?php } $profileFields = YumProfileField::model()->forOwner()->sort()->with('group')->together()->findAll(); if ($profileFields && Yum::hasModule('profile')) { foreach ($profileFields as $field) { if ($field->field_type == 'DROPDOWNLIST') { ?> <tr> <th class="label"><?php echo CHtml::encode(Yum::t($field->title)); ?> </th> <td><?php if (is_object($model->profile->{ucfirst($field->varname)})) { echo CHtml::encode($model->profile->{ucfirst($field->varname)}->{$field->related_field_name}); } ?> </td>
} ?> <table class="dataGrid"> <tr> <th class="label"><?php echo CHtml::encode($model->getAttributeLabel('username')); ?> </th> <td><?php echo CHtml::encode($model->username); ?> </td> </tr> <?php $profileFields = YumProfileField::model()->forOwner()->sort()->findAll(); if ($profileFields) { foreach ($profileFields as $field) { ?> <tr> <th class="label"><?php echo CHtml::encode(Yii::t('UserModule.user', $field->title)); ?> </th> <td><?php echo CHtml::encode($profile->getAttribute($field->varname)); ?> </td> </tr> <?php }