@@ -52,8 +52,8 @@ public function rules() {
// will receive user inputs.
return array(
array('varname, title, field_type', 'required'),
array('varname', 'match', 'pattern' => '/^[A-Za-z_0-9]+$/u', 'message' => UserModule::t("Variable name may consist of A-z, 0-9, underscores, begin with a letter.")),
array('varname', 'unique', 'message' => UserModule::t("This field already exists.")),
array('varname', 'match', 'pattern' => '/^[A-Za-z_0-9]+$/u', 'message' => Yii::t('app', "Variable name may only consist of A-z, 0-9, underscores, begin with a letter.")),
array('varname', 'unique', 'message' => Yii::t('app', "This field already exists.")),
array('varname, field_type', 'length', 'max' => 50),
array('field_size, field_size_min, required, position, visible', 'numerical', 'integerOnly' => true),
array('title, match, error_message, other_validator, default, widget', 'length', 'max' => 255),
@@ -76,22 +76,22 @@ public function relations() {
*/
public function attributeLabels() {
return array(
'id' => UserModule::t('Id'),
'varname' => UserModule::t('Variable name'),
'title' => UserModule::t('Title'),
'field_type' => UserModule::t('Field Type'),
'field_size' => UserModule::t('Field Size'),
'field_size_min' => UserModule::t('Field Size min'),
'required' => UserModule::t('Required'),
'match' => UserModule::t('Match'),
'range' => UserModule::t('Range'),
'error_message' => UserModule::t('Error Message'),
'other_validator' => UserModule::t('Other Validator'),
'default' => UserModule::t('Default'),
'widget' => UserModule::t('Widget'),
'widgetparams' => UserModule::t('Widget parameters'),
'position' => UserModule::t('Position'),
'visible' => UserModule::t('Visible'),
'id' => Yii::t('app', 'Id'),
'varname' => Yii::t('app', 'Variable name'),
'title' => Yii::t('app', 'Title'),
'field_type' => Yii::t('app', 'Field Type'),
'field_size' => Yii::t('app', 'Field Size'),
'field_size_min' => Yii::t('app', 'Minimum Field Size'),
'required' => Yii::t('app', 'Required'),
'match' => Yii::t('app', 'Match'),
'range' => Yii::t('app', 'Range'),
'error_message' => Yii::t('app', 'Error Message'),
'other_validator' => Yii::t('app', 'Other Validator'),
'default' => Yii::t('app', 'Default'),
'widget' => Yii::t('app', 'Widget'),
'widgetparams' => Yii::t('app', 'Widget parameters'),
'position' => Yii::t('app', 'Position'),
'visible' => Yii::t('app', 'Visible'),
);
}

@@ -170,26 +170,26 @@ public function widgetEdit($model, $params = array()) {
public static function itemAlias($type, $code = NULL) {
$_items = array(
'field_type' => array(
'INTEGER' => UserModule::t('INTEGER'),
'VARCHAR' => UserModule::t('VARCHAR'),
'TEXT' => UserModule::t('TEXT'),
'DATE' => UserModule::t('DATE'),
'FLOAT' => UserModule::t('FLOAT'),
'BOOL' => UserModule::t('BOOL'),
'BLOB' => UserModule::t('BLOB'),
'BINARY' => UserModule::t('BINARY'),
'INTEGER' => Yii::t('app', 'INTEGER'),
'VARCHAR' => Yii::t('app', 'VARCHAR'),
'TEXT' => Yii::t('app', 'TEXT'),
'DATE' => Yii::t('app', 'DATE'),
'FLOAT' => Yii::t('app', 'FLOAT'),
'BOOL' => Yii::t('app', 'BOOL'),
'BLOB' => Yii::t('app', 'BLOB'),
'BINARY' => Yii::t('app', 'BINARY'),
),
'required' => array(
self::REQUIRED_NO => UserModule::t('No'),
self::REQUIRED_NO => Yii::t('app', 'No'),
self::REQUIRED_NO_SHOW_REG => UserModule::t('No, but show on registration form'),
self::REQUIRED_YES_SHOW_REG => UserModule::t('Yes and show on registration form'),
self::REQUIRED_YES_NOT_SHOW_REG => UserModule::t('Yes'),
self::REQUIRED_YES_NOT_SHOW_REG => Yii::t('app', 'Yes'),
),
'visible' => array(
self::VISIBLE_ALL => UserModule::t('For all'),
self::VISIBLE_REGISTER_USER => UserModule::t('Registered users'),
self::VISIBLE_ONLY_OWNER => UserModule::t('Only owner'),
self::VISIBLE_NO => UserModule::t('Hidden'),
self::VISIBLE_ALL => Yii::t('app', 'For all'),
self::VISIBLE_REGISTER_USER => Yii::t('app', 'Registered users'),
self::VISIBLE_ONLY_OWNER => Yii::t('app', 'Owner Only'),
self::VISIBLE_NO => Yii::t('app', 'Hidden'),
),
);
if (isset($code))
@@ -11,13 +11,13 @@ class RegistrationForm extends User {
public function rules() {
$rules = array(
array('username, password, verifyPassword, email', 'required'),
array('username', 'length', 'max'=>20, 'min' => 3,'message' => UserModule::t("Incorrect username (length between 3 and 20 characters).")),
array('password', 'length', 'max'=>128, 'min' => 4,'message' => UserModule::t("Incorrect password (minimal length 4 symbols).")),
array('username', 'length', 'max'=>20, 'min' => 3,'message' => Yii::t('app', "Incorrect username (length between 3 and 20 characters).")),
array('password', 'length', 'max'=>128, 'min' => 4,'message' => Yii::t('app', "Minimal password length is 4 characters")),
array('email', 'email'),
array('username', 'unique', 'message' => UserModule::t("This user's name already exists.")),
array('email', 'unique', 'message' => UserModule::t("This user's email address already exists.")),
array('verifyPassword', 'compare', 'compareAttribute'=>'password', 'message' => UserModule::t("Retype Password is incorrect.")),
array('username', 'match', 'pattern' => '/^[A-Za-z0-9_]+$/u','message' => UserModule::t("Incorrect symbols (A-z0-9).")),
array('username', 'unique', 'message' => Yii::t('app', "This username already exists.")),
array('email', 'unique', 'message' => Yii::t('app', "This email address already exists.")),
array('verifyPassword', 'compare', 'compareAttribute'=>'password', 'message' => Yii::t('app', "Passwords don't match!")),
array('username', 'match', 'pattern' => '/^[A-Za-z0-9_]+$/u','message' => Yii::t('app', "Username can't have symbols")),
);
if (isset($_POST['ajax']) && $_POST['ajax']==='registration-form')
return $rules;
@@ -1,7 +1,7 @@
<?php $this->pageTitle=Yii::app()->name . ' - '.UserModule::t("Profile");
$this->breadcrumbs=array(
UserModule::t("Profile")=>array('profile'),
UserModule::t("Edit"),
Yii::t('app', 'Profile')=>array('profile'),
Yii::t('app', 'Edit'),
);
?><h2><?php echo UserModule::t('Edit profile'); ?></h2>
<?php echo $this->renderPartial('menu'); ?>
@@ -18,7 +18,7 @@
'htmlOptions' => array('enctype'=>'multipart/form-data'),
)); ?>

<p class="note"><?php echo UserModule::t('Fields with <span class="required">*</span> are required.'); ?></p>
<p class="note"><?php echo Yii::t('app', 'Fields with <span class="required">*</span> are required.'); ?></p>

<?php echo $form->errorSummary(array($model,$profile)); ?>

@@ -58,7 +58,7 @@
</div>

<div class="row buttons">
<?php echo CHtml::submitButton($model->isNewRecord ? UserModule::t('Create') : UserModule::t('Save')); ?>
<?php echo CHtml::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Save')); ?>
</div>

<?php $this->endWidget(); ?>
@@ -6,7 +6,7 @@
<?php
}
?>
<li><?php echo CHtml::link(UserModule::t('Edit'), array('/profile/edit')); ?></li>
<li><?php echo CHtml::link(UserModule::t('Change password'), array('/profile/changepassword')); ?></li>
<li><?php echo CHtml::link(UserModule::t('Logout'), array('/logout')); ?></li>
<li><?php echo CHtml::link(Yii::t('app', 'Edit'), array('/profile/edit')); ?></li>
<li><?php echo CHtml::link(Yii::t('app', 'Change password'), array('/profile/changepassword')); ?></li>
<li><?php echo CHtml::link(Yii::t('app', 'Logout'), array('/logout')); ?></li>
</ul>
@@ -1,9 +1,9 @@
<?php
$this->pageTitle = Yii::app()->name . ' - ' . UserModule::t("Profile");
$this->pageTitle = Yii::app()->name . ' - ' . Yii::t('app', 'Profile');
$this->breadcrumbs = array(
UserModule::t("Profile"),
Yii::t('app', 'Profile'),
);
?><h2><?php echo UserModule::t('Your profile'); ?></h2>
?><h2><?php echo Yii::t('app', 'Your profile'); ?></h2>
<?php echo $this->renderPartial('/profile/menu'); ?>

<?php if (Yii::app()->user->hasFlash('profileMessage')): ?>
@@ -1,7 +1,7 @@
<?php
$this->breadcrumbs = array(
UserModule::t("Login") => array('/user/login'),
UserModule::t("Restore"),
Yii::t('app', "Login") => array('/user/login'),
Yii::t('app', "Restore"),
);
?>

@@ -19,11 +19,11 @@
<div class="row">
<?php echo CHtml::activeLabel($form, 'login_or_email'); ?>
<?php echo CHtml::activeTextField($form, 'login_or_email') ?>
<p class="hint"><?php echo UserModule::t("Please enter your login or email address!"); ?></p>
<p class="hint"><?php echo Yii::t('app', "Please enter your login or email address!"); ?></p>
</div>

<div class="row submit">
<?php echo CHtml::submitButton(UserModule::t("Restore")); ?>
<?php echo CHtml::submitButton(Yii::t('app', "Restore")); ?>
</div>

<?php echo CHtml::endForm(); ?>
@@ -1,7 +1,7 @@
<?php
$this->pageTitle = Yii::app()->name . ' - ' . UserModule::t("Login");
$this->pageTitle = Yii::app()->name . ' - ' . Yii::t('app', 'Login');
$this->breadcrumbs = array(
UserModule::t("Login"),
Yii::t('app', "Login"),
);
?>

@@ -34,12 +34,12 @@
</div>

<div class="row submit">
<?php echo CHtml::submitButton(UserModule::t("Login")); ?>
<?php echo CHtml::submitButton(Yii::t('app', 'Login')); ?>
</div>

<div class="row">
<p class="hint">
<?php echo CHtml::link(UserModule::t("Register"), Yii::app()->getModule('user')->registrationUrl); ?> | <?php echo CHtml::link(UserModule::t("Lost Password?"), Yii::app()->getModule('user')->recoveryUrl); ?>
<?php echo CHtml::link(Yii::t('app', 'Register'), Yii::app()->getModule('user')->registrationUrl); ?> | <?php echo CHtml::link(Yii::t('app', 'Lost Password?'), Yii::app()->getModule('user')->recoveryUrl); ?>
</p>
</div>

@@ -1,10 +1,10 @@
<?php $this->pageTitle=Yii::app()->name . ' - '.UserModule::t("Registration");
<?php $this->pageTitle=Yii::app()->name . ' - '.Yii::t('app', "Registration");
$this->breadcrumbs=array(
UserModule::t("Registration"),
Yii::t('app', "Registration"),
);
?>

<h1><?php echo UserModule::t("Registration"); ?></h1>
<h1><?php echo Yii::t('app', "Registration"); ?></h1>

<?php if(Yii::app()->user->hasFlash('registration')): ?>
<div class="success">
@@ -20,7 +20,7 @@
'htmlOptions' => array('enctype'=>'multipart/form-data'),
)); ?>

<p class="note"><?php echo UserModule::t('Fields with <span class="required">*</span> are required.'); ?></p>
<p class="note"><?php echo Yii::t('app', 'Fields with <span class="required">*</span> are required.'); ?></p>

<?php echo $form->errorSummary(array($model,$profile)); ?>

@@ -35,7 +35,7 @@
<?php echo $form->passwordField($model,'password'); ?>
<?php echo $form->error($model,'password'); ?>
<p class="hint">
<?php echo UserModule::t("Minimal password length 4 symbols."); ?>
<?php echo Yii::t('app', "Minimum password length is 4."); ?>
</p>
</div>

@@ -83,13 +83,13 @@
<?php echo $form->textField($model,'verifyCode'); ?>
<?php echo $form->error($model,'verifyCode'); ?>

<p class="hint"><?php echo UserModule::t("Please enter the letters as they are shown in the image above."); ?>
<br/><?php echo UserModule::t("Letters are not case-sensitive."); ?></p>
<p class="hint"><?php echo Yii::t('app', "Please enter the letters as they are shown in the image above."); ?>
<br/><?php echo Yii::t('app', "Letters are not case-sensitive."); ?></p>
</div>
<?php endif; ?>

<div class="row submit">
<?php echo CHtml::submitButton(UserModule::t("Register")); ?>
<?php echo CHtml::submitButton(Yii::t('app', "Register")); ?>
</div>

<?php $this->endWidget(); ?>
@@ -8,7 +8,7 @@

<div class="right">
<?php echo UserModule::t('Hello, {username}!',array('{username}'=>CHtml::link($user->username,$module->profileUrl)))?><br>
<?php echo CHtml::link(UserModule::t('Logout'),$module->logoutUrl)?>
<?php echo CHtml::link(Yii::t('app', 'Logout'),$module->logoutUrl)?>
</div>


@@ -24,7 +24,7 @@

<div class="row">
<p class="hint">
<?php echo CHtml::link(UserModule::t("Register"),Yii::app()->getModule('user')->registrationUrl); ?> | <?php echo CHtml::link(UserModule::t("Lost Password?"),Yii::app()->getModule('user')->recoveryUrl); ?>
<?php echo CHtml::link(Yii::t('app', 'Register'),Yii::app()->getModule('user')->registrationUrl); ?> | <?php echo CHtml::link(Yii::t('app', 'Lost Password?'),Yii::app()->getModule('user')->recoveryUrl); ?>
</p>
</div>

@@ -34,7 +34,7 @@
</div>

<div class="row submit">
<?php echo CHtml::submitButton(UserModule::t("Login")); ?>
<?php echo CHtml::submitButton(Yii::t('app', 'Login')); ?>
</div>

<?php echo CHtml::endForm(); ?>