Skip to content

Commit

Permalink
Merge pull request #171 from BeeR13/master
Browse files Browse the repository at this point in the history
A few corrections
  • Loading branch information
thyseus committed Jan 15, 2014
2 parents 2fb72a9 + cd9a974 commit bf42796
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 31 deletions.
6 changes: 3 additions & 3 deletions profile/views/profile/_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
foreach(YumProfile::getProfileFields() as $field) {
echo CHtml::openTag('div',array());

echo CHtml::activeLabelEx($profile, $field);
echo CHtml::activeTextField($profile,
echo $form->LabelEx($profile, $field);
echo $form->TextField($profile,
$field);
echo CHtml::error($profile,$field);
echo $form->error($profile,$field);

echo CHtml::closeTag('div');
}
Expand Down
16 changes: 9 additions & 7 deletions profile/views/profile/update.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,25 @@

<div class="form">

<?php echo CHtml::beginForm(); ?>
<?php $form=$this->beginWidget('zii.widgets.CActiveForm', array(
'id'=>'profile-form',
)); ?>

<?php echo Yum::requiredFieldNote(); ?>

<?php echo CHtml::errorSummary(array($user, $profile)); ?>
<?php echo $form->errorSummary(array($user, $profile)); ?>

<?php if(Yum::module()->loginType & UserModule::LOGIN_BY_USERNAME) { ?>

<?php echo CHtml::activeLabelEx($user,'username'); ?>
<?php echo CHtml::activeTextField($user,'username',array(
<?php echo $form->LabelEx($user,'username'); ?>
<?php echo $form->activeTextField($user,'username',array(
'size'=>20,'maxlength'=>20)); ?>
<?php echo CHtml::error($user,'username'); ?>
<?php echo $form->error($user,'username'); ?>

<?php } ?>

<?php if(isset($profile) && is_object($profile))
$this->renderPartial('/profile/_form', array('profile' => $profile)); ?>
$this->renderPartial('/profile/_form', array('profile' => $profile, 'form'=>$form)); ?>

<?php

Expand All @@ -41,6 +43,6 @@
: Yum::t('Save profile changes'), array('class'=>'btn')); ?>


<?php echo CHtml::endForm(); ?>
<?php $this->endWidget(); ?>

</div><!-- form -->
7 changes: 1 addition & 6 deletions user/models/YumUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,7 @@ public function rules() {

$rules[] = array('username', 'unique',
'message' => Yum::t('This username already exists'));

$rules[] = array(
'username',
'match',
'pattern' => $usernameRequirements['match'],
'message' => Yum::t($usernameRequirements['dontMatchMessage']));

$rules[] = array('status', 'in', 'range' => array(0, 1, 2, 3, -1, -2));
$rules[] = array('superuser', 'in', 'range' => array(0, 1));
$rules[] = array('username, createtime, lastvisit, lastpasswordchange, superuser, status', 'required');
Expand Down
4 changes: 2 additions & 2 deletions usergroup/views/groups/_form.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="form">
<p class="note">
<?php echo Yii::t('app','Fields with');?> <span class="required">*</span> <?php echo Yii::t('app','are required');?>.
<?php echo Yum::t('Fields with <span class="required">*</span> are required.');?>
</p>

<?php $form=$this->beginWidget('CActiveForm', array(
Expand All @@ -25,6 +25,6 @@
<?php
echo CHtml::Button(Yum::t('Cancel'), array(
'submit' => array('groups/index')));
echo CHtml::submitButton(Yum::t('Save'));
echo CHtml::submitButton($model->isNewRecord ? Yum::t('Create') : Yum::t('Save'));
$this->endWidget(); ?>
</div> <!-- form -->
3 changes: 1 addition & 2 deletions usergroup/views/groups/create.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
<?php $this->title = Yum::t('Create Usergroup'); ?>
<?php
$this->renderPartial('_form', array(
'model' => $model,
'buttons' => 'create'));
'model' => $model));

?>

8 changes: 6 additions & 2 deletions usergroup/views/groups/success.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<p> The Usergroup <?php echo $model; ?> has been successfully created </p>
<?php
echo Yum::t('The Usergroup {groupname} has been successfully created', array('groupname' => $model))
?>

<?php echo CHtml::Button(Yii::t('app', 'Back'), array('id' => $relation.'_done')); ?><?php echo CHtml::Button(Yii::t('app', 'Add another Usergroup'), array('id' => $relation.'_create'));
<?php
echo CHtml::Button(Yum::t('Back'), array('id' => $relation.'_done'));
echo CHtml::Button(Yum::t('Add another Usergroup'), array('id' => $relation.'_create'));
17 changes: 8 additions & 9 deletions usergroup/views/groups/update.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
<?php
$this->breadcrumbs=array(
'Usergroups'=>array('index'),
$model->title=>array('view','id'=>$model->id),
Yii::t('app', 'Update'),
Yum::t('Usergroups')=>array('index'),
$model->title=>array('view','id'=>$model->id),
Yum::t('Update')
);

$this->menu=array(
array('label'=>Yii::t('app', 'List') . ' Usergroup', 'url'=>array('index')),
array('label'=>Yii::t('app', 'Create') . ' Usergroup', 'url'=>array('create')),
array('label'=>Yii::t('app', 'View') . ' Usergroup', 'url'=>array('view', 'id'=>$model->id)),
array('label'=>Yii::t('app', 'Manage') . ' Usergroup', 'url'=>array('admin')),
array('label'=>Yum::t('List Usergroup'), 'url'=>array('index')),
array('label'=>Yum::t('Create Usergroup'), 'url'=>array('create')),
array('label'=>Yum::t('View Usergroup'), 'url'=>array('view', 'id'=>$model->id)),
array('label'=>Yum::t('Manage Usergroup'), 'url'=>array('admin')),
);
?>

<h1> <?php echo Yii::t('app', 'Update');?> Usergroup #<?php echo $model->id; ?> </h1>
<h1> <?php echo Yum::t('Update Usergroup'); ?> #<?php echo $model->id; ?> </h1>
<?php
$this->renderPartial('_form', array(
'model'=>$model));
?>

0 comments on commit bf42796

Please sign in to comment.