Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenDocCN
yii2_fecshop
提交
29fc0642
Y
yii2_fecshop
项目概览
OpenDocCN
/
yii2_fecshop
通知
17
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Y
yii2_fecshop
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
29fc0642
编写于
8月 08, 2019
作者:
T
Terry
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
admin config appfront account
上级
f2e0ab0c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
372 addition
and
0 deletion
+372
-0
app/appadmin/modules/Config/block/appfrontaccount/Manager.php
...appadmin/modules/Config/block/appfrontaccount/Manager.php
+257
-0
app/appadmin/modules/Config/controllers/AppfrontaccountController.php
.../modules/Config/controllers/AppfrontaccountController.php
+37
-0
app/appadmin/theme/base/default/config/appfrontaccount/manager.php
...min/theme/base/default/config/appfrontaccount/manager.php
+78
-0
未找到文件。
app/appadmin/modules/Config/block/appfrontaccount/Manager.php
0 → 100644
浏览文件 @
29fc0642
<?php
/**
* FecShop file.
*
* @link http://www.fecshop.com/
* @copyright Copyright (c) 2016 FecShop Software LLC
* @license http://www.fecshop.com/license/
*/
namespace
fecshop\app\appadmin\modules\Config\block\appfrontaccount
;
use
fec\helpers\CUrl
;
use
fec\helpers\CRequest
;
use
fecshop\app\appadmin\interfaces\base\AppadminbaseBlockEditInterface
;
use
fecshop\app\appadmin\modules\AppadminbaseBlockEdit
;
use
Yii
;
/**
* block cms\staticblock.
* @author Terry Zhao <2358269014@qq.com>
* @since 1.0
*/
class
Manager
extends
AppadminbaseBlockEdit
implements
AppadminbaseBlockEditInterface
{
public
$_saveUrl
;
// 需要配置
public
$_key
=
'appfront_account'
;
public
$_type
;
protected
$_attrArr
=
[
'registerSuccessAutoLogin'
,
'registerSuccessRedirectUrlKey'
,
'registerPageCaptcha'
,
'loginPageCaptcha'
,
'forgotPasswordCaptcha'
,
'contactsCaptcha'
,
'min_name_length'
,
'max_name_length'
,
'min_pass_length'
,
'max_pass_length'
,
];
public
function
init
()
{
// 需要配置
$this
->
_saveUrl
=
CUrl
::
getUrl
(
'config/appfrontaccount/managersave'
);
$this
->
_editFormData
=
'editFormData'
;
$this
->
setService
();
$this
->
_param
=
CRequest
::
param
();
$this
->
_one
=
$this
->
_service
->
getByKey
([
'key'
=>
$this
->
_key
,
]);
if
(
$this
->
_one
[
'value'
])
{
$this
->
_one
[
'value'
]
=
unserialize
(
$this
->
_one
[
'value'
]);
}
}
// 传递给前端的数据 显示编辑form
public
function
getLastData
()
{
$id
=
''
;
if
(
isset
(
$this
->
_one
[
'id'
]))
{
$id
=
$this
->
_one
[
'id'
];
}
return
[
'id'
=>
$id
,
'editBar'
=>
$this
->
getEditBar
(),
'textareas'
=>
$this
->
_textareas
,
'lang_attr'
=>
$this
->
_lang_attr
,
'saveUrl'
=>
$this
->
_saveUrl
,
];
}
public
function
setService
()
{
$this
->
_service
=
Yii
::
$service
->
storeBaseConfig
;
}
public
function
getEditArr
()
{
$deleteStatus
=
Yii
::
$service
->
customer
->
getStatusDeleted
();
$activeStatus
=
Yii
::
$service
->
customer
->
getStatusActive
();
return
[
// 需要配置
[
'label'
=>
Yii
::
$service
->
page
->
translate
->
__
(
'Register Page Captcha'
),
'name'
=>
'registerPageCaptcha'
,
'display'
=>
[
'type'
=>
'select'
,
'data'
=>
[
Yii
::
$app
->
store
->
enable
=>
'Yes'
,
Yii
::
$app
->
store
->
disable
=>
'No'
,
],
],
'remark'
=>
'注册页面的验证码是否开启'
],
[
'label'
=>
Yii
::
$service
->
page
->
translate
->
__
(
'Register Success AutoLogin'
),
'name'
=>
'registerSuccessAutoLogin'
,
'display'
=>
[
'type'
=>
'select'
,
'data'
=>
[
Yii
::
$app
->
store
->
enable
=>
'Yes'
,
Yii
::
$app
->
store
->
disable
=>
'No'
,
],
],
'remark'
=>
'账号注册成功后,是否自动登录'
],
[
'label'
=>
Yii
::
$service
->
page
->
translate
->
__
(
'Register Success RedirectUrlKey'
),
'name'
=>
'registerSuccessRedirectUrlKey'
,
'display'
=>
[
'type'
=>
'inputString'
,
],
'remark'
=>
'注册登录成功后,跳转的url'
,
],
[
'label'
=>
Yii
::
$service
->
page
->
translate
->
__
(
'Login Page Captcha'
),
'name'
=>
'loginPageCaptcha'
,
'display'
=>
[
'type'
=>
'select'
,
'data'
=>
[
Yii
::
$app
->
store
->
enable
=>
'Yes'
,
Yii
::
$app
->
store
->
disable
=>
'No'
,
],
],
'remark'
=>
'登录页面的验证码是否开启'
],
[
'label'
=>
Yii
::
$service
->
page
->
translate
->
__
(
'Forgot Password Captcha'
),
'name'
=>
'forgotPasswordCaptcha'
,
'display'
=>
[
'type'
=>
'select'
,
'data'
=>
[
Yii
::
$app
->
store
->
enable
=>
'Yes'
,
Yii
::
$app
->
store
->
disable
=>
'No'
,
],
],
'remark'
=>
'忘记密码页面的验证码是否开启'
],
[
'label'
=>
Yii
::
$service
->
page
->
translate
->
__
(
'Contacts Captcha'
),
'name'
=>
'contactsCaptcha'
,
'display'
=>
[
'type'
=>
'select'
,
'data'
=>
[
Yii
::
$app
->
store
->
enable
=>
'Yes'
,
Yii
::
$app
->
store
->
disable
=>
'No'
,
],
],
'remark'
=>
'联系我们页面的验证码是否开启'
],
[
'label'
=>
Yii
::
$service
->
page
->
translate
->
__
(
'Min Name Length'
),
'name'
=>
'min_name_length'
,
'display'
=>
[
'type'
=>
'inputString'
,
],
'remark'
=>
'注册账号的firstname的最小长度'
,
],
[
'label'
=>
Yii
::
$service
->
page
->
translate
->
__
(
'Max Name Length'
),
'name'
=>
'max_name_length'
,
'display'
=>
[
'type'
=>
'inputString'
,
],
'remark'
=>
'注册账号的firstname, lastname的最大长度'
,
],
[
'label'
=>
Yii
::
$service
->
page
->
translate
->
__
(
'Min Password Length'
),
'name'
=>
'min_pass_length'
,
'display'
=>
[
'type'
=>
'inputString'
,
],
'remark'
=>
'注册账号的密码的最小长度'
,
],
[
'label'
=>
Yii
::
$service
->
page
->
translate
->
__
(
'Max Password Length'
),
'name'
=>
'max_pass_length'
,
'display'
=>
[
'type'
=>
'inputString'
,
],
'remark'
=>
'注册账号的密码的最大长度'
,
],
];
}
public
function
getArrParam
(){
$request_param
=
CRequest
::
param
();
$this
->
_param
=
$request_param
[
$this
->
_editFormData
];
$param
=
[];
$attrVals
=
[];
foreach
(
$this
->
_param
as
$attr
=>
$val
)
{
if
(
in_array
(
$attr
,
$this
->
_attrArr
))
{
$attrVals
[
$attr
]
=
$val
;
}
else
{
$param
[
$attr
]
=
$val
;
}
}
$param
[
'value'
]
=
$attrVals
;
$param
[
'key'
]
=
$this
->
_key
;
return
$param
;
}
/**
* save article data, get rewrite url and save to article url key.
*/
public
function
save
()
{
/*
* if attribute is date or date time , db storage format is int ,by frontend pass param is int ,
* you must convert string datetime to time , use strtotime function.
*/
// 设置 bdmin_user_id 为 当前的user_id
$this
->
_service
->
saveConfig
(
$this
->
getArrParam
());
$errors
=
Yii
::
$service
->
helper
->
errors
->
get
();
if
(
!
$errors
)
{
echo
json_encode
([
'statusCode'
=>
'200'
,
'message'
=>
Yii
::
$service
->
page
->
translate
->
__
(
'Save Success'
),
]);
exit
;
}
else
{
echo
json_encode
([
'statusCode'
=>
'300'
,
'message'
=>
$errors
,
]);
exit
;
}
}
public
function
getVal
(
$name
,
$column
){
if
(
is_object
(
$this
->
_one
)
&&
property_exists
(
$this
->
_one
,
$name
)
&&
$this
->
_one
[
$name
])
{
return
$this
->
_one
[
$name
];
}
$content
=
$this
->
_one
[
'value'
];
if
(
is_array
(
$content
)
&&
!
empty
(
$content
)
&&
isset
(
$content
[
$name
]))
{
return
$content
[
$name
];
}
return
''
;
}
}
\ No newline at end of file
app/appadmin/modules/Config/controllers/AppfrontaccountController.php
0 → 100644
浏览文件 @
29fc0642
<?php
/**
* FecShop file.
*
* @link http://www.fecshop.com/
* @copyright Copyright (c) 2016 FecShop Software LLC
* @license http://www.fecshop.com/license/
*/
namespace
fecshop\app\appadmin\modules\Config\controllers
;
use
fecshop\app\appadmin\modules\Config\ConfigController
;
use
Yii
;
/**
* @author Terry Zhao <2358269014@qq.com>
* @since 1.0
*/
class
AppfrontaccountController
extends
ConfigController
{
public
$enableCsrfValidation
=
true
;
public
function
actionManager
()
{
$data
=
$this
->
getBlock
()
->
getLastData
();
return
$this
->
render
(
$this
->
action
->
id
,
$data
);
}
public
function
actionManagersave
()
{
$primaryKey
=
Yii
::
$service
->
customer
->
getPrimaryKey
();
$data
=
$this
->
getBlock
(
'manager'
)
->
save
();
}
}
app/appadmin/theme/base/default/config/appfrontaccount/manager.php
0 → 100644
浏览文件 @
29fc0642
<?php
/**
* FecMall file.
*
* @link http://www.fecmall.com/
* @copyright Copyright (c) 2016 FecMall Software LLC
* @license http://www.fecmall.com/license
*/
use
yii\helpers\Html
;
use
fec\helpers\CRequest
;
use
fecadmin\models\AdminRole
;
/**
* @author Terry Zhao <2358269014@qq.com>
* @since 1.0
*/
?>
<style>
.checker
{
float
:
left
;}
.dialog
.pageContent
{
background
:
none
;}
.dialog
.pageContent
.pageFormContent
{
background
:
none
;}
</style>
<div
class=
"pageContent systemConfig"
>
<form
method=
"post"
action=
"
<?=
$saveUrl
?>
"
class=
"pageForm required-validate"
onsubmit=
"return validateCallback(this, navTabAjaxDone);"
>
<?php
echo
CRequest
::
getCsrfInputHtml
();
?>
<div
layouth=
"56"
class=
"pageFormContent"
style=
"height: 240px; overflow: auto;"
>
<input
type=
"hidden"
value=
"
<?=
$_id
;
?>
"
size=
"30"
name=
"editFormData[_id]"
class=
"textInput "
>
<fieldset
id=
"fieldset_table_qbe"
>
<legend
style=
"color:#cc0000"
>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'Appfront Account Config'
)
?>
</legend>
<div>
<?=
$editBar
;
?>
</div>
</fieldset>
<?=
$lang_attr
?>
<?=
$textareas
?>
</div>
<div
class=
"formBar"
>
<ul>
<!--<li><a class="buttonActive" href="javascript:;"><span>保存</span></a></li>-->
<li>
<div
class=
"buttonActive"
><div
class=
"buttonContent"
><button
onclick=
"func('accept')"
value=
"accept"
name=
"accept"
type=
"submit"
>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'Save'
)
?>
</button></div></div>
</li>
<li>
<div
class=
"button"
><div
class=
"buttonContent"
><button
type=
"button"
class=
"close"
>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'Cancel'
)
?>
</button></div></div>
</li>
</ul>
</div>
</form>
</div>
<style>
.pageForm
.pageFormContent
.edit_p
{
width
:
100%
;
line-height
:
35px
;
}
.pageForm
.pageFormContent
.edit_p
.remark-text
{
font-size
:
11px
;
color
:
#777
;
margin-left
:
20px
;
}
.pageForm
.pageFormContent
p
.edit_p
label
{
width
:
240px
;
line-height
:
30px
;
font-size
:
13px
;
font-weight
:
500
;
}
.pageContent
.combox
{
margin-left
:
5px
;
}
</style>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录