Example #1
4
 public function run()
 {
     echo '
     <div class="input-group input-medium show-password">';
     if ($this->hasModel()) {
         echo Html::activePasswordInput($this->model, $this->attribute, $this->options);
     } else {
         echo Html::passwordInput($this->name, $this->value, $this->options);
     }
     echo '
         <span class="input-group-btn">
             <button class="btn btn-default" style="margin-bottom: 5px; height: 34px;" type="button">
                 <i class="glyphicon glyphicon-eye-open"></i>
             </button>
         </span>
     </div>';
     $this->registerClientScript();
 }
Example #2
0
 /**
  * @return string
  * @throws InvalidConfigException
  */
 private function renderWidget($input = '')
 {
     $imgSrc = "data:image/jpeg;base64,";
     if ($this->QrParams['type'] === Enum::QR_FORMAT_PNG) {
         $imgSrc = "data:image/png;base64,";
     }
     echo '<div><img src=' . $imgSrc . base64_encode($this->generateQr($this->otp->getProvisioningUri())) . ' /></div>';
     if ($this->link || is_string($this->link)) {
         echo Html::a($this->link, $this->otp->getProvisioningUri());
     }
     echo $this->hasModel() ? Html::activeHiddenInput($this->model, $this->attribute, $this->options) : Html::passwordInput($this->name, $this->value, $this->options);
 }
Example #3
0
 /**
  * @inheritdoc
  */
 public function run()
 {
     Asset::register($this->view);
     $config = empty($this->config) ? json_encode(['locale' => \Yii::$app->language]) : json_encode($this->config);
     $this->view->registerJs(sprintf('$("#%s").passField(%s)', $this->options['id'], $config));
     if ($this->hasModel()) {
         if ($this->form == null) {
             throw new InvalidConfigException(__CLASS__ . '.form property must be specified');
         }
         return $this->form->field($this->model, $this->attribute)->passwordInput($this->options);
     } else {
         return Html::passwordInput($this->name, $this->value, $this->options);
     }
 }
Example #4
0
 private function value($value, $type = null, $options = [])
 {
     $uniqid = uniqid();
     $options = array_merge(['role' => 'statusInfoValue', 'id' => 'status-info-span' . $uniqid, 'class' => 'col-md-7 col-lg-7'], $options);
     switch ($type) {
         case 'link':
             $value = Html::a($value, $value);
             break;
         case 'input':
             $value = Html::textInput('status-info-input' . $uniqid, $value, ['id' => 'status-info-input' . $uniqid, 'class' => 'form-control']);
             break;
         case 'password':
             $value = Html::passwordInput('status-info-input' . $uniqid, $value, ['id' => 'status-info-input' . $uniqid, 'class' => 'form-control']);
             break;
         case 'raw':
         case 'text':
             break;
         default:
             $options['class'] = ' badge';
             break;
     }
     return Html::tag('span', $value, $options);
 }
Example #5
0
 /**
  * @inheritdoc
  */
 public function passwordInput($options = [])
 {
     $options = $this->mergeInputOptions(['class' => 'k-textbox'], $options);
     $this->parts['{input}'] = Html::passwordInput($this->attribute, null, $options);
     return $this;
 }
 /**
  * Passwword input field
  *
  * @param array $options Optional data for the text input array.
  * @return \luya\admin\ngrest\aw\ActiveField
  */
 public function passwordInput(array $options = [])
 {
     $this->parts['{input}'] = Html::passwordInput($this->attribute, $this->value, ['class' => 'input__field', 'id' => $this->form->getFieldId($this->attribute), 'ng-model' => 'params.' . $this->attribute]);
     $this->parts['{class}'] = 'input input--text input--vertical';
     return $this;
 }
Example #7
0
 public static function passwordForm($model, $value = null, $isBackForm = true, $appendOptions = [])
 {
     $value = self::getValue($model, $value, $isBackForm);
     $options = self::getOptions($model, $isBackForm, $appendOptions);
     return Html::passwordInput(self::getInputName($model, $options), $value, $options);
 }
Example #8
0
																</div>
															</div>
															<div class="form-group">
																<label class="control-label col-md-3">Password:</label>
																<div class="col-md-9">
																	<?php 
echo Html::passwordInput('password', '', ['id' => 'password', 'class' => 'form-control', 'placeholder' => 'กรุณากรอกรหัสผ่านใหม่']);
?>
																	</div>
															</div>
															
															<div class="form-group">
																<label class="control-label col-md-3">Verify Password:</label>
																<div class="col-md-9">
																	<?php 
echo Html::passwordInput('confirmPassword', '', ['id' => 'confirmPassword', 'class' => 'form-control', 'placeholder' => 'กรุณากรอกรหัสผ่านใหม่อีกครั้ง']);
?>
 
																	</div>
															</div>
															<div class="form-group">
																<label class="control-label col-md-3"></label>
																<div class="col-md-9">
																<p class="ect"></p>
																	</div>
															</div>
															
														</div>
								</div>
			
							</div>
Example #9
0
?>
                                </div>
                                <div class="form-group">
                                    <?php 
echo Html::label('Пользователь');
?>
                                    <?php 
echo Html::TextInput('db_user', $settings['db_user'], array('class' => 'form-control'));
?>
                                </div>
                                <div class="form-group">
                                    <?php 
echo Html::label('Пароль');
?>
                                    <?php 
echo Html::passwordInput('db_password', $settings['db_password'], array('class' => 'form-control'));
?>
                                </div>
                                <div class="form-group text-right">
                                    <?php 
echo Html::button('Проверка', ['class' => 'btn btn-warning pull-left check', 'name' => 'db-check']);
?>
                                    <?php 
echo Html::submitButton('Сохранить', ['class' => 'btn btn-primary', 'name' => 'db-button']);
?>
                                </div>
                                <div id="result" class="form-group"></div>
                                <?php 
ActiveForm::end();
?>
                            </div>
Example #10
0
?>

<div class="post-protected">
    <?php 
$form = ActiveForm::begin();
?>

    <p><?php 
echo Yii::t('writesdown', 'The media is protected, therefore, please type the right password to view the media.');
?>
</p>

    <div class="form-group field-posttype-post_type_name required">
        <?php 
echo Html::label(Yii::t('writesdown', 'Password'), 'post-post_password', ['class' => 'control-label']);
?>
        <?php 
echo Html::passwordInput('password', null, ['class' => 'form-control', 'id' => 'post-post_password']);
?>
    </div>

    <div class="form-group">
        <?php 
echo Html::submitButton(Yii::t('writesdown', 'Submit The Password'), ['class' => 'btn btn-flat btn-primary']);
?>
    </div>

    <?php 
ActiveForm::end();
?>
</div>
Example #11
0
 protected function getApixPasswordHtml($form, $config, $field)
 {
     $model = $config['model'];
     $fieldHtml = Html::passwordInput($model . "[{$field->name}]", null, $field->options);
     if ($config['label']) {
         $fieldHtml = "<div class='frm-field'><label>{$field->label}</label>{$fieldHtml}<span class='error' cmt-error='{$field->name}'></span></div>";
     } else {
         $fieldHtml = "<div class='frm-field'>{$fieldHtml}<span class='error' cmt-error='{$field->name}'></span></div>";
     }
     return $fieldHtml;
 }
Example #12
0
<?php 
$form = ActiveForm::begin(['id' => 'user-form', 'layout' => 'horizontal']);
echo $form->errorSummary($model);
echo $form->field($model, 'email')->input('email');
echo $form->field($model, 'password')->input('password');
?>


<div class="form-group field-user-password_confirm">
    <label class="control-label col-sm-3" for="password_confirm"><?php 
echo Yii::t('ica_auth', 'Confirm password');
?>
</label>
    <div class="col-sm-6">
    <?php 
echo Html::passwordInput('password_confirm', null, ['class' => 'form-control']);
?>
    </div>
</div>

<?php 
echo $form->field($model, 'is_active')->checkbox();
?>

<div class="form-group field-auth_items">
<label class="control-label col-sm-3"><?php 
echo Yii::t('ica_auth', 'Roles');
?>
</label>
<?php 
$allAuthItems = [];
Example #13
0
    ActiveForm::begin();
    ?>
    <div class="form-group">
        <?php 
    echo Html::label('Username', 'username');
    ?>
        <?php 
    echo Html::textInput('username', '', ['class' => 'form-control']);
    ?>
    </div>
    <div class="form-group">
        <?php 
    echo Html::label('Password', 'password');
    ?>
        <?php 
    echo Html::passwordInput('password', '', ['class' => 'form-control']);
    ?>
    </div>
    <?php 
    echo Html::submitButton('Login', ['class' => 'btn btn-primary']);
    ?>
    <?php 
    ActiveForm::end();
    ?>
    <?php 
} else {
    ?>
    <h2>You are authenticated!</h2>
    <br /><br />
    <?php 
    echo Html::a('Logout', ['my-authentication/logout'], ['class' => 'btn btn-warning']);
Example #14
0
?>
" width="754" height="537"></a></div>
                </div>
            </div>
        </div>
        <!-- 滚动图片 -->
    </div>
    <div class="urlog">
        <h3>用户登录</h3>
        <form  class="frla"  action="/site/login" method="post">
                <?php 
echo Html::textInput("LoginForm[username]", $model->username, array('id' => 'username', 'placeholder' => '用户名', 'class' => 'txt'));
?>
           
                <?php 
echo Html::passwordInput('LoginForm[password]', $model->password, array('id' => 'password', 'placeholder' => '密码', 'class' => 'pass'));
?>
           
                <?php 
echo Html::textInput('LoginForm[verifycode]', '', array('id' => 'verifycode', 'placeholder' => '请输入右侧验证码', 'class' => 'tchec'));
?>
                <div class="checo verify-code" style="top:156px">
                <?php 
$url = '/site/captcha';
echo "<a href='javascript:' onclick='javascript:return refreshcode();' >" . Html::img($url, array('id' => 'img_code', 'style' => 'height:35px;')) . "</a>";
?>
                </div> 
                <div class="error">
                    <?php 
$errors = $model->getFirstErrors();
if (count($errors) > 0) {
Example #15
0
    }
    ?>
                </div>
            <?php 
}
?>
        </div>
        <div class="form-group field-loginform-password required
            <?php 
echo $model->getErrors('password') ? ' has-error' : '';
?>
">
            <div class="input-group">
                <span class="input-group-addon"><i class="fa fa-key"></i></span>
                <?php 
echo Html::passwordInput('LoginForm[password]', $model->password, ['class' => 'form-control', 'placeholder' => $model->getAttributeLabel('password')]);
?>
            </div>
            <?php 
if ($model->getErrors('password')) {
    ?>
                <div class="help-block">
                    <?php 
    foreach ($model->getErrors('password') as $error) {
        ?>
                        <p>
                            <?php 
        echo $error;
        ?>
                        </p>
                    <?php 
Example #16
0
use yii\helpers\ArrayHelper;
use shiyang\setting\models\Setting;
use shiyang\setting\Module;
$this->title = Module::t('setting', 'Setting');
$this->params['breadcrumbs'][] = $this->title;
$items = [];
foreach ($settingParent as $parent) {
    $item['label'] = Module::t('setting', $parent->code);
    $str = '';
    $children = Setting::find()->where(['parent_id' => $parent->id])->orderBy(['sort_order' => SORT_ASC, 'id' => SORT_ASC])->all();
    foreach ($children as $child) {
        $str .= '<div class="form-group field-blogcatalog-parent_id"><label class="col-lg-2 control-label" for="blogcatalog-parent_id">' . Module::t('setting', $child->code) . '</label><div class="col-lg-3">';
        if ($child->type == 'text') {
            $str .= Html::textInput("Setting[{$child->code}]", $child->value, ["class" => "form-control"]);
        } elseif ($child->type == 'password') {
            $str .= Html::passwordInput("Setting[{$child->code}]", $child->value, ["class" => "form-control"]);
        } elseif ($child->type == 'select') {
            $options = [];
            $arrayOptions = explode(',', $child->store_range);
            foreach ($arrayOptions as $option) {
                $options[$option] = Module::t('setting', $option);
            }
            $str .= Html::dropDownList("Setting[{$child->code}]", $child->value, $options, ["class" => "form-control"]);
        }
        $str .= '</div></div>';
    }
    $item['content'] = $str;
    array_push($items, $item);
}
?>
Example #17
0
	
													</div>
												</div>
												<div class="form-group">
													<label class="control-label col-md-3"><span class="required"> * </span>ชื่อที่ใช้เข้าสู่ระบบ:</label>
													<div class="col-md-9">
														<?php 
echo Html::activeInput('text', $model, 'username', ['id' => 'username', 'class' => 'form-control', 'required' => 'required', 'placeholder' => 'Username...']);
?>
													</div>
												</div>
												<div class="form-group">
													<label class="control-label col-md-3"><span class="required"> * </span>รหัสผ่าน:</label>
													<div class="col-md-9">
														<?php 
echo Html::passwordInput('password', '', ['class' => 'form-control', 'required' => 'required', 'placeholder' => 'กรุณากรอกรหัสผ่านใหม่']);
?>
														</div>
												</div>
												
												</div>
												
											</div>
									
											<div class="row rowbb">
												<div class="col-md-12">
													<div class="form-actions fluid">
														<div class="text-center">
														<?php 
echo Button::widget(['label' => 'บันทึก', 'options' => ['class' => 'btn green', 'type' => 'submit']]);
?>
Example #18
0
    $size = 6;
} else {
    $size = 12;
}
$fieldExtra = '';
if (!empty($instance->setupErrors[$id])) {
    $fieldExtra = 'has-feedback has-error';
}
echo Html::beginTag('div', ['class' => 'form-group col-md-' . $size . ' ' . $fieldExtra]);
echo Html::label($field['label'], $fieldId);
if (isset($field['default']) && $value === null) {
    $value = $field['default'];
}
switch ($field['type']) {
    case 'password':
        echo Html::passwordInput($fieldName, $value, ['class' => 'form-control', 'id' => $fieldId]);
        break;
    case 'select':
        $options = ['class' => 'form-control', 'id' => $fieldId];
        if (isset($field['prompt'])) {
            $options['prompt'] = $field['prompt'];
        }
        echo Html::dropDownList($fieldName, $value, $field['options'], $options);
        break;
    default:
        echo Html::textInput($fieldName, $value, ['class' => 'form-control', 'id' => $fieldId]);
        break;
}
if (!empty($instance->setupErrors[$id])) {
    echo Html::tag('div', $instance->setupErrors[$id], ['class' => 'help-inline text-danger']);
} else {
Example #19
0
$form = ActiveForm::begin();
?>

            <p>
                <?php 
echo Yii::t('writesdown', '{title} is protected, please submit the right password to view the Media.', ['title' => Html::encode($media->title)]);
?>

            </p>
            <div class="form-group field-media-password required">
                <?php 
echo Html::label(Yii::t('writesdown', 'Password'), 'media-password', ['class' => 'control-label']);
?>

                <?php 
echo Html::passwordInput('password', null, ['class' => 'form-control', 'id' => 'media-password']);
?>

            </div>
            <div class="form-group">
                <?php 
echo Html::submitButton(Yii::t('writesdown', 'Submit Password'), ['class' => 'btn btn-flat btn-primary']);
?>

            </div>
            <?php 
ActiveForm::end();
?>

        </div>
    </article>
?>
</div>
<div class="form-group">
    <?php 
echo Html::label("Usuario: ", "lblusuario");
?>
    <?php 
echo Html::textInput("usuario", null, ["class" => "form-control"]);
?>
</div>
<div class="form-group">
    <?php 
echo Html::label("Contraseña: ", "lblcontraseña");
?>
    <?php 
echo Html::passwordInput("contraseña", null, ["class" => "form-control"]);
?>
</div>



<div class="col-md-1"><?php 
echo Html::submitInput("Guardar", ["class" => "btn btn-primary"]);
?>
</div>
<div class="col-md-1"><?php 
echo Html::submitInput("Cancelar", ["class" => "btn btn-primary"]);
?>
</div>
<div class="col-md-1"><?php 
echo Html::submitInput("Modificar", ["class" => "btn btn-primary"]);
Example #21
0
 public function testPasswordInput()
 {
     $this->assertEquals('<input type="password" name="test">', Html::passwordInput('test'));
     $this->assertEquals('<input type="password" class="t" name="test" value="value">', Html::passwordInput('test', 'value', ['class' => 't']));
 }
Example #22
0
?>

<div id="pincode-modal" class="modal fade">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title"><?php 
echo Yii::t('hipanel:client', 'Enter pincode');
?>
</h4>
            </div>
            <div class="modal-body">
                <div class="form-group">
                    <?php 
echo Html::passwordInput('pincode', null, ['class' => 'form-control', 'id' => 'pincode', 'placeholder' => '****']);
?>
                    <p class="help-block"></p>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><?php 
echo Yii::t('hipanel', 'Close');
?>
</button>
                <?php 
echo Html::button(Yii::t('hipanel', 'Send'), ['id' => 'get-authcode-button', 'class' => 'btn btn-primary', 'autocomplete' => 'off', 'data-toggle' => 'button', 'data-loading-text' => $loadingText]);
?>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->