Exemplo n.º 1
0
 /**
  * 生成面包屑
  * @return type
  */
 public static function createBreadcrumbs()
 {
     $topMenu = LsYii::getApp()->controller->topMenu;
     $sideMenu = LsYii::getApp()->controller->sideMenu;
     $lastBreadcrumb = LsYii::getApp()->controller->lastBreadcrumb;
     if ($topMenu) {
         $tModel = Menu::getMenu($topMenu);
     }
     //后台一级菜单
     if ($sideMenu) {
         $sModel = Menu::getMenu($sideMenu);
     }
     //后台三级菜单
     //获取其中的二级菜单
     if (isset($sModel) && !empty($sModel)) {
         $mModel = Menu::getMenu($sModel->pid);
     }
     //获取二级菜单
     if (isset($tModel) && !empty($sModel)) {
         $tBreadcrumbs = ['label' => $tModel->name, 'url' => [$tModel->url]];
     }
     if (isset($mModel) && !empty($mModel)) {
         $mBreadcrumbs = ['label' => $mModel->name, 'url' => [$mModel->url]];
     }
     if (isset($sModel) && !empty($sModel)) {
         $sBreadcrumbs = ['label' => $sModel->name, 'url' => [$sModel->url]];
     }
     $lBreadcrumbs = ['label' => $lastBreadcrumb];
     $arr[] = isset($tBreadcrumbs) ? $tBreadcrumbs : "";
     $arr[] = isset($mBreadcrumbs) ? $mBreadcrumbs : "";
     $arr[] = isset($sBreadcrumbs) ? $sBreadcrumbs : "";
     $arr[] = isset($lastBreadcrumb) ? ['label' => LsYii::gT($lastBreadcrumb)] : "";
     $arr = array_filter($arr);
     return $arr;
 }
Exemplo n.º 2
0
 /**
  * 生成保存与关闭的按钮
  * @param type $submitText
  * @param type $closeLink
  */
 public static function SubmitButtons($submitText, $closeLink = null)
 {
     echo Html::beginTag('div', ['class' => 'form-group center']);
     echo Html::submitButton(LsYii::gT($submitText), ['class' => 'btn btn-primary', 'name' => 'save']);
     if ($closeLink !== null) {
         echo Html::a(LsYii::gT("Return"), $closeLink, ['name' => 'close', 'class' => 'btn btn-default', 'style' => 'margin-left:10px;']);
     }
     echo Html::endTag('div');
 }
Exemplo n.º 3
0
 /**
  * Validates the password.
  * This method serves as the inline validation for password.
  *
  * @param string $attribute the attribute currently being validated
  * @param array $params the additional name-value pairs given in the rule
  */
 public function validatePassword($attribute, $params)
 {
     if (!$this->hasErrors()) {
         $user = $this->getUser();
         if (!$user || !$user->validatePassword($this->password, $user->password_hash)) {
             $this->addError($attribute, \source\LsYii::gT('用户名或者密码错误'));
         }
     }
 }
 public function actionBaidu()
 {
     $this->setMenus(51, "百度第三方登录");
     $model = new BaiduConfig();
     if ($model->load(LsYii::getRequest()->post())) {
         $model->save($model->attributes);
         LsYii::setSuccessMessage(LsYii::gT('save success'));
     } else {
         $model = $model->initValue();
     }
     return $this->render('baidu', ['model' => $model]);
 }
Exemplo n.º 5
0
    #main-content {
        margin-left: 0px;
    }
    .container {
        width: 100%;
    }
    .due-time {
        color: red;
    }
</style>
<div class="site-error">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <div class="alert alert-danger">
        <?php 
echo nl2br(Html::encode($message));
?>
    </div>
    
    <p>
        页面将在<span class="due-time">3</span>秒后自动跳转,如未跳转<?php 
echo Html::a(\source\LsYii::gT('这里'), LsYii::getRequest()->getReferrer(), ["node-type" => "run-link"]);
?>
    </p>
</div>
<?php 
$this->registerJs("\$(function() {\n        var dt = setInterval(function() {\n            var due = \$('.due-time').html();\n            if(parseInt(due) <= 1) {\n                clearInterval(dt);\n                var url = \$('a[node-type=run-link]').attr('href');\n                window.location.href = url;\n            }\n            \$('.due-time').html(parseInt(due) - 1);\n        } , 1000);\n     })", yii\web\View::POS_END);
Exemplo n.º 6
0
use yii\grid\GridView;
use source\LsYii;
use source\modules\dict\models\DictCategory;
/* @var $this yii\web\View */
/* @var $searchModel source\models\search\DictCategorySearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = '字典分类';
echo \source\libs\Message::getMessage();
?>
<div class="page-header">
    <h3>
        <strong><?php 
echo Html::encode($this->title);
?>
</strong>
        <div class="pull-right">
            <?php 
echo Html::a('<span class="glyphicon glyphicon-plus"></span> ' . LsYii::gT('添加字典分类'), ['/dict/dictcategory/create'], ['class' => 'btn btn-primary']);
?>
        </div>
    </h3>
</div>
<div class="dict-category-index">
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'layout' => '{items} {summary} {pager}', 'tableOptions' => ['class' => 'table table-hover'], 'columns' => ['id', 'name', 'description', ['class' => 'source\\core\\grid\\ActionColumn', 'template' => '{view} {update} {delete}', 'buttons' => ['view' => function ($url, $model) {
    return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', source\helpers\Url::to(['/dict/dict/index', 'category_id' => $model->id]), []);
}]]]]);
?>

</div>
Exemplo n.º 7
0
 /**
  * @inheritdoc
  */
 public function attributeLabels()
 {
     return ['id' => LsYii::gT('ID', 'field'), 'parent_id' => LsYii::gT('Parent', 'field'), 'category_id' => LsYii::gT('Category', 'field'), 'name' => LsYii::gT('Name', 'field'), 'value' => LsYii::gT('Value', 'field'), 'description' => LsYii::gT('Description', 'field'), 'thumb' => LsYii::gT('Thumb', 'field'), 'status' => LsYii::gT('Status', 'field'), 'sort' => LsYii::gT('Sort', 'field')];
 }
Exemplo n.º 8
0
                        <ul class="dropdown-menu">
                            <li>
                                <?php 
echo Html::a('<span class="glyphicon glyphicon-user"></span> ' . LsYii::gT("个人资料"), Url::to(['site/profile']), []);
?>
                            </li>
                            <li>
                                <?php 
echo Html::a('<span class="glyphicon glyphicon-pencil"></span> ' . LsYii::gT("修改密码"), Url::to(['site/modifyPwd']), []);
?>
                            </li>
                        </ul>
                    </li>
                    <li>
                        <?php 
echo Html::a(LsYii::gT('退出登录'), Url::to(['site/logout']), ['data-method' => 'post']);
?>
                    </li>
                </ul>
            </div>
        </div>

        <div class="container bs-docs-container">
            <div class="row">
                <div class="col-md-2">
                    <div class="bs-sidebar hidden-print affix-top">
                        <?php 
$topMenu = LsYii::getApp()->controller->topMenu;
$menus = Menu::getMenuArray($topMenu, 3);
$html = '';
if ($menus) {
Exemplo n.º 9
0
<?php

use source\LsYii;
use source\helpers\Html;
use source\core\widgets\ActiveForm;
use source\helpers\Url;
use source\libs\Constants;
use source\libs\Message;
/* @var $this yii\web\View */
/* @var $model backend\models\config\BasicConfig */
/* @var $form ActiveForm */
$this->title = LsYii::gT('Register And Visit');
echo Message::getMessage();
?>
<div class="page-header">
    <h3>
        <strong><?php 
echo Html::encode($this->title);
?>
</strong>
    </h3>
</div>
<div class="config-basic">
    <?php 
$form = ActiveForm::begin(['id' => 'access-config-form', 'options' => ['class' => 'form-horizontal']]);
?>

        <?php 
echo $form->field($model, 'allow_register')->checkbox([], false);
?>
Exemplo n.º 10
0
$attribute = 'verifyCode';
$name = $model->getAttributeLabel($attribute);
$input = Html::activeTextInput($model, $attribute, ['enter' => 'totab', 'placeholder' => $name, 'autocomplete' => 'off']);
echo Html::label("<span></span>" . $input, Html::getInputId($model, $attribute), ['class' => 'clear']);
echo Html::beginTag('div');
echo yii\captcha\Captcha::widget(['name' => 'captchaimage', 'imageOptions' => ['id' => 'captchaImg', 'title' => '换一个', 'alt' => '换一个', 'style' => 'cursor:pointer;'], 'template' => '{image}']);
echo Html::endTag('div');
?>
                    </li>
                    <li class="error-message" <?php 
echo empty($message) ? '' : 'style="display: block;"';
?>
>
                        <?php 
echo $message;
?>
                    </li>
                    <li class="admin-submit">
                        <?php 
echo Html::submitInput(LsYii::gT('Login'), ['class' => 'btn btn-default']);
?>
                 
                    </li>
                </ul>
            <?php 
ActiveForm::end();
?>
       
        </div>
    </div>
</div>
Exemplo n.º 11
0
<?php

use source\LsYii;
use source\core\widgets\ActiveForm;
use source\helpers\Url;
use source\libs\Constants;
use source\helpers\Html;
use source\modules\system\models\config\ThemeConfig;
use source\libs\Message;
use source\modules\system\models\config\DatetimeConfig;
/* @var $this yii\web\View */
/* @var $model backend\models\config\BasicConfig */
/* @var $form ActiveForm */
$this->title = LsYii::gT("Datetime Setting");
echo Message::getMessage();
?>
<div class="page-header">
    <h3>
        <strong><?php 
echo Html::encode($this->title);
?>
</strong>
    </h3>
</div>
<div class="config-basic">

    <?php 
$form = ActiveForm::begin(['id' => 'theme-config-form', 'options' => ['class' => 'form-horizontal']]);
?>
        <?php 
echo $form->field($model, 'datetime_timezone')->dropDownList(DatetimeConfig::getTimezoneItems());
Exemplo n.º 12
0
 /**
  * @inheritdoc
  */
 public function attributeLabels()
 {
     return ['allow_register' => LsYii::gT('Allow Register', 'field')];
 }
Exemplo n.º 13
0
<?php

use source\LsYii;
use source\core\widgets\ActiveForm;
use source\helpers\Url;
use source\libs\Constants;
use source\helpers\Html;
use source\modules\system\models\config\ThemeConfig;
use source\libs\Message;
/* @var $this yii\web\View */
/* @var $model backend\models\config\BasicConfig */
/* @var $form ActiveForm */
$this->title = LsYii::gT("Theme Setting");
echo Message::getMessage();
?>
<div class="page-header">
    <h3>
        <strong><?php 
echo Html::encode($this->title);
?>
</strong>
    </h3>
</div>
<div class="config-basic">

    <?php 
$form = ActiveForm::begin(['id' => 'theme-config-form', 'options' => ['class' => 'form-horizontal']]);
?>
        <?php 
echo $form->field($model, 'admin_theme')->radioList(ThemeConfig::getAdminItems());
?>
Exemplo n.º 14
0
 /**
  * 输出日志消息
  * @param type $message 要输出的日志消息
  * @param type $callback 是否要返回检测用户输入
  */
 private static function _appendLog($message, $callback = false)
 {
     if ($callback) {
         $message .= '<br/> <a href="' . Url::to(['site/db']) . '" class="red">' . LsYii::gT('返回检测') . '</a>';
     }
     $message = json_encode($message);
     echo '<script type="text/javascript"> var message=' . $message . ';$("#progress").append(message + "<br/>");</script>';
     ob_flush();
     flush();
 }
Exemplo n.º 15
0
 /**
  * 得到格式化的数组
  * @param type $model
  * @param type $pid
  * @param type $expanded
  * @param type $hasChildren
  * @param type $htmlOptions
  * @return array
  */
 public static function getTreeDataInternal($models, $pid, $expanded = false, $hasChildren = false, $htmlOptions = array())
 {
     $data = array();
     if (!$models) {
         return $data;
     }
     foreach ($models as $model) {
         if ($model->pid == $pid) {
             $template = Html::beginTag('div', array('class' => 'tree-hover'));
             if (isset($htmlOptions['updateUrl'])) {
                 $updateUrl = Url::to([$htmlOptions['updateUrl'], 'id' => $model->id]);
                 $template .= Html::a($model->name, $updateUrl);
                 $template .= '<span class="pull-right">';
                 $template .= Html::a('<span class="glyphicon glyphicon-edit"></span>', $updateUrl, ['title' => LsYii::gT('编辑')]);
             } else {
                 $template .= $model->name;
                 $template .= '<span class="pull-right">';
             }
             if (isset($htmlOptions['addChildrenUrl'])) {
                 $addChilderUrl = Url::to([$htmlOptions['addChildrenUrl'], 'id' => $model->id]);
                 $template .= Html::a('<span class="glyphicon glyphicon-plus"></span>', $addChilderUrl, array('title' => LsYii::gT('添加子类')));
             }
             if (isset($htmlOptions['deleteUrl'])) {
                 $deleteUrl = Url::to([$htmlOptions['deleteUrl'], 'id' => $model->id]);
                 $template .= Html::a('<span class="glyphicon glyphicon-remove"></span>', $deleteUrl, array('title' => LsYii::gT('删除'), 'data-method' => 'POST'));
             }
             $template .= Html::endTag('div');
             $arr['text'] = $template;
             $arr['expanded'] = $expanded;
             $arr['id'] = $model->id;
             $arr['children'] = self::getTreeDataInternal($models, $model->id, $expanded, $hasChildren, $htmlOptions);
             $data[] = $arr;
         }
     }
     return $data;
 }
Exemplo n.º 16
0
use source\LsYii;
use common\widgets\TreeView;
use source\modules\menu\models\Menu;
/* @var $this yii\web\View */
/* @var $searchModel source\models\search\MenuSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = '菜单管理';
$this->registerJs("\$(function(){\n    \$('.nav-tabs .active').mouseover(function(){\n        \$(this).find('.attribute-remove').show();\n    }).mouseout(function(){\n        \$(this).find('.attribute-remove').hide();\n    });\n    \$('.nav-tabs .active .attribute-remove').click(function(){\n        window.open('" . \source\helpers\Url::to(['/menu/site/delete', 'id' => $model->id]) . "' , '_self');\n        return false;\n    });\n})", \source\core\back\BackView::POS_END);
echo source\libs\Message::getMessage();
?>
<div class="page-header">
    <h3>
        <strong><?php 
echo Html::encode($this->title);
?>
</strong>
        <div class="pull-right">
            <?php 
echo Html::a('<span class="glyphicon glyphicon-plus"></span> ' . LsYii::gT('添加新菜单'), ['/menu/site/create'], ['class' => 'btn btn-primary']);
?>
        </div>
    </h3>
</div>
<div class="menu-index">
    <?php 
echo yii\bootstrap\Tabs::widget(['items' => Menu::getItems($model->id, '/menu/site/index')]);
echo TreeView::widget(['data' => Menu::getTreeData($model->root, $model->id, true, false, ['updateUrl' => '/menu/site/update', 'addChildrenUrl' => '/menu/site/create', 'deleteUrl' => '/menu/site/delete'])]);
?>

</div>
Exemplo n.º 17
0
 /**
  * @inheritdoc
  */
 public function attributeLabels()
 {
     return ['id' => LsYii::gT('ID'), 'username' => LsYii::gT('Username'), 'password' => LsYii::gT('Password'), 'auth_key' => LsYii::gT('Auth Key'), 'password_hash' => LsYii::gT('Password Hash'), 'password_reset_token' => LsYii::gT('Password Reset Token'), 'email' => 'Email', 'status' => '状态', 'statusText' => '状态', 'created_at' => '创建时间', 'updated_at' => '更新时间', 'role' => '角色'];
 }
Exemplo n.º 18
0
 /**
  * @inheritdoc
  */
 public function attributeLabels()
 {
     return ['seo_title' => LsYii::gT('Seo Title', 'field'), 'seo_keywords' => LsYii::gT('Seo Keywords', 'field'), 'seo_description' => LsYii::gT('Seo Description', 'field'), 'seo_head' => LsYii::gT('Seo Head', 'field')];
 }
Exemplo n.º 19
0
 /**
  * Deletes an existing Role model.
  * If deletion is successful, the browser will be redirected to the 'index' page.
  * @param string $id
  * @return mixed
  */
 public function actionDelete($id)
 {
     $category = LsYii::getGetValue('category');
     Role::setMenus($category);
     $model = $this->findModel($id);
     if ($model->is_system) {
         return $this->redirect(['index', 'category' => $category, 'message' => LsYii::gT('该分类还有子项,不能被删除'), 'type' => 2]);
     } else {
         $model->delete();
         return $this->redirect(['index', 'category' => $category, 'message' => LsYii::gT('删除成功')]);
     }
 }
Exemplo n.º 20
0
?>
</strong>
        <small><?php 
echo Html::encode(DictCategory::getDictCategoryName($category_id));
?>
</small>
        <div class="pull-right">
            <?php 
echo Html::a('<span class="glyphicon glyphicon-plus"></span> ' . LsYii::gT('添加字典'), ['/dict/dict/create', 'category_id' => $category_id], ['class' => 'btn btn-primary']);
?>
            <?php 
echo Html::a('<span class="glyphicon glyphicon-share-alt"></span> ' . LsYii::gT('Return'), ['/dict/dictcategory/index'], ['class' => 'btn btn-primary']);
?>
        </div>
    </h3>
</div>
<div class="dict-index">
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'layout' => '{items} {summary} {pager}', 'tableOptions' => ['class' => 'table table-hover'], 'columns' => [['attribute' => 'name'], ['attribute' => 'value'], ['attribute' => 'status', 'filter' => \source\libs\Constants::getDictStatus(), 'content' => function ($model, $key, $index, $gridView) {
    return \source\libs\Constants::getDictStatus($model->status);
}], ['attribute' => 'sort', 'filter' => Html::activeInput('text', $searchModel, 'sort', ['class' => 'form-control'])], ['class' => 'source\\core\\grid\\ActionColumn', 'template' => '{update} {delete}', 'buttons' => ['view' => function ($url, $model) {
    return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', ['/dict/dict/view', 'id' => $model->id, 'category_id' => LsYii::getGetValue('category_id')], []);
}, 'update' => function ($url, $model) {
    return Html::a('<span class="glyphicon glyphicon-edit"></span>', ['/dict/dict/update', 'id' => $model->id, 'category_id' => LsYii::getGetValue('category_id')], []);
}, 'delete' => function ($url, $model) {
    return Html::a('<span class="glyphicon glyphicon-trash"></span>', ['/dict/dict/delete', 'id' => $model->id, 'category_id' => LsYii::getGetValue('category_id')], ['data-method' => 'post', 'data-confirm' => LsYii::gT('Are you sure you want to delete this item?')]);
}]]]]);
?>

</div>
Exemplo n.º 21
0
<?php

use source\LsYii;
use source\helpers\Html;
use source\core\widgets\ActiveForm;
use source\helpers\Url;
use source\libs\Constants;
use source\libs\Message;
use source\helpers\ArrayHelper;
/* @var $this yii\web\View */
/* @var $model backend\models\config\BasicConfig */
/* @var $form ActiveForm */
$this->title = LsYii::gT('QQ第三方登录设置');
echo Message::getMessage();
?>
<div class="page-header">
    <h3>
        <strong><?php 
echo Html::encode($this->title);
?>
</strong>
    </h3>
</div>
<div class="config-basic">
    <?php 
$form = ActiveForm::begin(['id' => 'baidu-config-form', 'options' => ['class' => 'form-horizontal']]);
?>
        <?php 
echo $form->field($model, 'baidu_appid');
?>
        <?php 
Exemplo n.º 22
0
<?php

use source\helpers\Html;
use source\core\grid\GridView;
use source\LsYii;
use source\libs\Message;
/* @var $this yii\web\View */
/* @var $searchModel source\modules\modularity\models\search\ModularitySearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = source\LsYii::gT('Modularity Setting');
echo Message::getMessage();
?>
<div class="page-header">
    <h3>
        <strong><?php 
echo Html::encode($this->title);
?>
</strong>
        <div class="pull-right">
            <?php 
echo Html::a(\Yii::t('yii', '<span class="glyphicon glyphicon-plus"></span> Create {attribute}', ['attribute' => LsYii::gT('Modularity')]), ['/gii/default/view', 'id' => 'lsmodule'], ['class' => 'btn btn-primary', 'target' => '_blank']);
?>
        </div>
    </h3>
</div>
<div class="modularity-index">
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'layout' => '{items} {summary} {pager}', 'tableOptions' => ['class' => 'table table-hover'], 'columns' => [['label' => '标识', 'value' => 'id'], ['label' => '名称', 'value' => 'instance.name'], ['label' => '描述', 'value' => 'instance.description'], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{system} {install} {admin} {home}', 'buttons' => ['system' => function ($url, $data) {
    return $data["instance"]->is_system ? "系统内置" : "";
}, 'install' => function ($url, $data) {
    if (!$data["instance"]->is_system) {
Exemplo n.º 23
0
 /**
  * @inheritdoc
  */
 public function attributeLabels()
 {
     return ['site_name' => LsYii::gT('Site Name', 'field'), 'site_description' => LsYii::gT('Site Description', 'field'), 'site_domain' => LsYii::gT('Site Domain', 'field'), 'site_email' => LsYii::gT('Site Email', 'field'), 'site_language' => LsYii::gT('Site Language', 'field'), 'sys_icp' => LsYii::gT('Site Icp', 'field'), 'site_about' => LsYii::gT('Site About', 'field'), 'site_status' => LsYii::gT('Site Status', 'field')];
 }
Exemplo n.º 24
0
<?php

use source\LsYii;
use source\core\widgets\ActiveForm;
use source\helpers\Url;
use source\libs\Constants;
use source\helpers\Html;
use source\libs\Message;
/* @var $this yii\web\View */
/* @var $model backend\models\config\BasicConfig */
/* @var $form ActiveForm */
$this->title = LsYii::gT("Basic Setting");
echo Message::getMessage();
?>
<div class="page-header">
    <h3>
        <strong><?php 
echo Html::encode($this->title);
?>
</strong>
    </h3>
</div>
<div class="config-basic">

    <?php 
$form = ActiveForm::begin(['id' => 'basic-config-form', 'options' => ['class' => 'form-horizontal']]);
?>

        <?php 
echo $form->field($model, 'site_name');
?>
Exemplo n.º 25
0
 /**
  * Deletes an existing Permission model.
  * If deletion is successful, the browser will be redirected to the 'index' page.
  * @param string $id
  * @return mixed
  */
 public function actionDelete($id, $category)
 {
     $this->findModel($id)->delete();
     return $this->redirect(['index', 'category' => $category, 'message' => LsYii::gT('删除成功')]);
 }
Exemplo n.º 26
0
 /**
  * 卸载
  * 'canInstall' => true
  * 'canUninstall' => true
  * 'hasAdmin' => true
  * 'hasHome' => true
  * 'canActiveAdmin' => false
  * 'canActiveHome' => false
  * @param type $id
  * @return type
  */
 public function actionUninstall($id)
 {
     $lastBreadcrumb = "Uninstall Modularity";
     $this->setMenus(12, $lastBreadcrumb);
     Modularity::deleteAll(['id' => $id]);
     $modules = $this->modularityService->getAllModules();
     if (isset($modules[$id]) && $modules[$id]['instance'] !== null) {
         $modules[$id]['instance']->uninstall();
     }
     return $this->redirect(['index', 'message' => \Yii::t('yii', '{attribute} Success', ['attribute' => LsYii::gT($lastBreadcrumb)])]);
 }
Exemplo n.º 27
0
use source\models\User;
use source\libs\Constants;
use source\modules\rbac\models\Role;
/* @var $this yii\web\View */
/* @var $searchModel source\models\search\UserSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = '注册会员';
echo source\libs\Message::getMessage();
?>
<div class="page-header">
    <h3>
        <strong><?php 
echo Html::encode($this->title);
?>
</strong>
        <div class="pull-right">
            <?php 
echo Html::a('<span class="glyphicon glyphicon-plus"></span> ' . LsYii::gT('添加' . $this->title), ['/user/member/create'], ['class' => 'btn btn-primary']);
?>
        </div>
    </h3>
</div>
<div class="user-index">
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['attribute' => 'username', 'value' => 'username'], ['attribute' => 'email', 'value' => 'email'], ['attribute' => 'status', 'filter' => Constants::getStatusItems(), 'content' => function ($model, $key, $index, $gridView) {
    return Constants::getStatusItems($model->status);
}], ['attribute' => 'role', 'value' => 'role', 'filter' => Role::getMemberItems()], ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>
Exemplo n.º 28
0
 /**
  * Deletes an existing Category model.
  * If deletion is successful, the browser will be redirected to the 'index' page.
  * @param string $id
  * @return mixed
  */
 public function actionDelete($id)
 {
     $this->setMenus(30, "删除分类");
     $model = $this->findModel($id);
     //判断是否有子项
     if (Category::findAll(['pid' => $id])) {
         return $this->redirect(['index', 'message' => LsYii::gT('该分类还有子项,不能被删除'), 'type' => 2]);
     }
     if ($model->if_delete == \source\libs\Constants::If_Delete_Prohibit) {
         return $this->redirect(['index', 'message' => LsYii::gT('该分类不允许被删除'), 'type' => 2]);
     }
     $rgt = $model->rgt;
     if ($model->delete()) {
         Category::updateAllCounters(['rgt' => -2], "`lft`<{$rgt} AND `rgt`>={$rgt}");
         Category::updateAllCounters(['rgt' => -2, 'lft' => -2], "`lft`>{$rgt}");
         $message = LsYii::gT('删除成功');
         $type = 1;
     } else {
         $message = LsYii::gT('删除失败');
         $type = 2;
     }
     return $this->redirect(['index', 'message' => $message, 'type' => $type]);
 }
Exemplo n.º 29
0
?>
</label>
                        <div class="col-sm-4">
                            <span class="col-color col-color-now"><?php 
// echo $adminuserCount;
?>
</span>
                            <?php 
// echo CHtml::link("查看",array("/admin/adminuser/admin"),array('class'=>'see'))
?>
                     
                        </div>
                    </div>
                    <div class="form-group bs-form-group-index">
                        <label for="inputEmail3" class="col-sm-2 control-label"><?php 
echo LsYii::gT("广告数量");
?>
</label>
                        <div class="col-sm-4">
                            <span class="col-color col-color-now"><?php 
// echo $advertisement;
?>
</span>
                            <?php 
// echo CHtml::link("查看",array("/admin/advertisement/admin"),array('class'=>'see'))
?>
                 
                        </div>
                    </div>
                </div>
            </div>
Exemplo n.º 30
0
<?php

use source\LsYii;
use source\core\widgets\ActiveForm;
use source\helpers\Url;
use source\libs\Constants;
use source\helpers\Html;
use source\libs\Message;
/* @var $this yii\web\View */
/* @var $model backend\models\config\BasicConfig */
/* @var $form ActiveForm */
$this->title = LsYii::gT("SEO Setting");
echo Message::getMessage();
?>
<div class="page-header">
    <h3>
        <strong><?php 
echo Html::encode($this->title);
?>
</strong>
    </h3>
</div>
<div class="config-basic">

    <?php 
$form = ActiveForm::begin(['id' => 'seo-config-form', 'options' => ['class' => 'form-horizontal']]);
?>

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