还原配置

pull/8/head
pppscn 2018-11-07 22:22:57 +08:00
parent 569c43161d
commit 765c021978
200 changed files with 14406 additions and 3 deletions

BIN
application/.DS_Store vendored 100644

Binary file not shown.

BIN
application/admin/.DS_Store vendored 100644

Binary file not shown.

View File

@ -0,0 +1,256 @@
<?php
namespace app\admin\controller;
use app\admin\model\Admin;
use app\admin\model\CalendarEvent;
use app\common\controller\Backend;
use think\exception\PDOException;
/**
* 日历管理
*
* @icon calendar
*/
class Calendar extends Backend
{
/**
* Calendar模型对象
*/
protected $model = null;
protected $childrenAdminIds = [];
public function _initialize()
{
parent::_initialize();
$this->model = model('Calendar');
$this->childrenAdminIds = $this->auth->getChildrenAdminIds(true);
}
/**
* 查看
*/
public function index()
{
$adminList = Admin::where('id', 'in', $this->childrenAdminIds)->field('id,username as name')->select();
$this->assignconfig('admins', $adminList);
//设置过滤方法
$this->request->filter(['strip_tags']);
if ($this->request->isAjax())
{
//如果发送的来源是Selectpage则转发到Selectpage
if ($this->request->request('keyField'))
{
return $this->selectpage();
}
$start = $this->request->get('start');
$end = $this->request->get('end');
$type = $this->request->get('type');
$admin_id = $this->request->get('admin_id');
if (!$admin_id)
{
$admin_id = $type == 'my' ? $this->auth->id : 0;
}
$adminIds = $admin_id ? [$admin_id] : $this->childrenAdminIds;
$list = $this->model
->where('admin_id', 'in', $adminIds)
->where('starttime', 'between', [strtotime($start), strtotime($end)])
->order('id desc')
->select();
$result = [];
$time = time();
foreach ($list as $k => $v)
{
$result[] = $v['render'];
}
return json($result);
}
$eventList = CalendarEvent::where('admin_id', $this->auth->id)->order('id desc')->select();
$this->view->assign("eventList", $eventList);
return $this->view->fetch();
}
/**
* 添加事件
*/
public function addevent()
{
$params = $this->request->post("row/a");
if ($params)
{
$params['admin_id'] = $this->auth->id;
$calendarEvent = new CalendarEvent();
$result = $calendarEvent->allowField(true)->save($params);
if ($result)
{
$this->success('', null, ['id' => $calendarEvent->id, 'title' => $calendarEvent->title, 'background' => $calendarEvent->background]);
}
else
{
$this->error();
}
}
$this->error(__('Parameter %s can not be empty', ''));
}
/**
* 删除事件
*/
public function delevent($ids = NULL)
{
if ($ids)
{
$count = model('CalendarEvent')->destroy($ids);
if ($count)
{
$this->success();
}
}
$this->error(__('Parameter %s can not be empty', 'ids'));
}
/**
* 添加日历
*/
public function add($ids = NULL)
{
if ($this->request->isPost())
{
if ($ids)
{
$params = CalendarEvent::get($ids);
if ($params)
{
$params = $params->toArray();
unset($params['id']);
$params = array_merge($params, $this->request->post("row/a"));
}
}
else
{
$params = $this->request->post("row/a");
}
if ($params)
{
foreach ($params as $k => &$v)
{
$v = is_array($v) ? implode(',', $v) : $v;
}
$params['status'] = 'normal';
try
{
$params['admin_id'] = $this->auth->id;
$row = model('Calendar');
$row->allowField(true)->save($params);
$data = $row->render;
$this->success('', null, $data);
}
catch (PDOException $e)
{
$this->error($e->getMessage());
}
}
$this->error(__('Parameter %s can not be empty', ''));
}
return $this->view->fetch();
}
/**
* 编辑日历
*/
public function edit($ids = NULL)
{
$row = $this->model->get($ids);
if (!$row)
$this->error(__('No Results were found'));
if ($this->request->isPost())
{
if (!in_array($row->admin_id, $this->childrenAdminIds))
{
$this->error(__('You have no permission'));
}
$params = $this->request->post("row/a");
if ($params)
{
foreach ($params as $k => &$v)
{
$v = is_array($v) ? implode(',', $v) : $v;
}
try
{
//是否采用模型验证
if ($this->modelValidate)
{
$name = basename(str_replace('\\', '/', get_class($this->model)));
$validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : true) : $this->modelValidate;
$row->validate($validate);
}
$result = $row->save($params);
if ($result !== false)
{
$data = $row->render;
$this->success('', null, $data);
}
else
{
$this->error($row->getError());
}
}
catch (PDOException $e)
{
$this->error($e->getMessage());
}
}
$this->error(__('Parameter %s can not be empty', ''));
}
$this->view->assign("row", $row);
return $this->view->fetch();
}
/**
* 删除日历
*/
public function del($ids = "")
{
if ($ids)
{
$count = $this->model->where('admin_id', 'in', $this->childrenAdminIds)->where('id', 'in', $ids)->delete();
if ($count)
{
$this->success();
}
}
$this->error(__('Parameter %s can not be empty', 'ids'));
}
/**
* 批量操作
*/
public function multi($ids = "")
{
$ids = $ids ? $ids : $this->request->param("ids");
if ($ids)
{
if ($this->request->has('params'))
{
parse_str($this->request->post("params"), $values);
$values = array_intersect_key($values, array_flip(is_array($this->multiFields) ? $this->multiFields : explode(',', $this->multiFields)));
if ($values)
{
$count = $this->model->where($this->model->getPk(), 'in', $ids)->where('admin_id', 'in', $this->childrenAdminIds)->update($values);
$this->success();
}
else
{
$this->error(__('You have no permission'));
}
}
}
$this->error(__('Parameter %s can not be empty', 'ids'));
}
}

View File

@ -0,0 +1,219 @@
<?php
namespace app\admin\controller;
use app\common\controller\Backend;
use think\Config;
use think\console\Input;
use think\Db;
use think\Exception;
/**
* 在线命令管理
*
* @icon fa fa-circle-o
*/
class Command extends Backend
{
/**
* Command模型对象
*/
protected $model = null;
protected $noNeedRight = ['get_controller_list', 'get_field_list'];
public function _initialize()
{
parent::_initialize();
$this->model = model('Command');
$this->view->assign("statusList", $this->model->getStatusList());
}
/**
* 添加
*/
public function add()
{
$tableList = [];
$list = \think\Db::query("SHOW TABLES");
foreach ($list as $key => $row) {
$tableList[reset($row)] = reset($row);
}
$this->view->assign("tableList", $tableList);
return $this->view->fetch();
}
/**
* 获取字段列表
* @internal
*/
public function get_field_list()
{
$dbname = Config::get('database.database');
$prefix = Config::get('database.prefix');
$table = $this->request->request('table');
//从数据库中获取表字段信息
$sql = "SELECT * FROM `information_schema`.`columns` "
. "WHERE TABLE_SCHEMA = ? AND table_name = ? "
. "ORDER BY ORDINAL_POSITION";
//加载主表的列
$columnList = Db::query($sql, [$dbname, $table]);
$fieldlist = [];
foreach ($columnList as $index => $item) {
$fieldlist[] = $item['COLUMN_NAME'];
}
$this->success("", null, ['fieldlist' => $fieldlist]);
}
/**
* 获取控制器列表
* @internal
*/
public function get_controller_list()
{
$adminPath = dirname(__DIR__) . DS;
$controllerDir = $adminPath . 'controller' . DS;
$files = new \RecursiveIteratorIterator(
new \RecursiveDirectoryIterator($controllerDir), \RecursiveIteratorIterator::LEAVES_ONLY
);
$list = [];
foreach ($files as $name => $file) {
if (!$file->isDir()) {
$filePath = $file->getRealPath();
$name = str_replace($controllerDir, '', $filePath);
$name = str_replace(DS, "/", $name);
$list[] = ['id' => $name, 'name' => $name];
}
}
$pageNumber = $this->request->request("pageNumber");
$pageSize = $this->request->request("pageSize");
return json(['list' => array_slice($list, ($pageNumber - 1) * $pageSize, $pageSize), 'total' => count($list)]);
}
/**
* 详情
*/
public function detail($ids)
{
$row = $this->model->get($ids);
if (!$row)
$this->error(__('No Results were found'));
$this->view->assign("row", $row);
return $this->view->fetch();
}
/**
* 执行
*/
public function execute($ids)
{
$row = $this->model->get($ids);
if (!$row)
$this->error(__('No Results were found'));
$result = $this->doexecute($row['type'], json_decode($row['params'], true));
$this->success("", null, ['result' => $result]);
}
/**
* 执行命令
*/
public function command($action = '')
{
$commandtype = $this->request->request("commandtype");
$params = $this->request->request();
$allowfields = [
'crud' => 'table,controller,model,fields,force,local,delete,menu',
'menu' => 'controller,delete',
'min' => 'module,resource,optimize',
'api' => 'url,module,output,template,force,title,author,class,language',
];
$argv = [];
$allowfields = isset($allowfields[$commandtype]) ? explode(',', $allowfields[$commandtype]) : [];
$allowfields = array_filter(array_intersect_key($params, array_flip($allowfields)));
if (isset($params['local']) && !$params['local']) {
$allowfields['local'] = $params['local'];
} else {
unset($allowfields['local']);
}
foreach ($allowfields as $key => $param) {
$argv[] = "--{$key}=" . (is_array($param) ? implode(',', $param) : $param);
}
if ($commandtype == 'crud') {
$extend = 'setcheckboxsuffix,enumradiosuffix,imagefield,filefield,intdatesuffix,switchsuffix,citysuffix,selectpagesuffix,selectpagessuffix,ignorefields,sortfield,editorsuffix,headingfilterfield';
$extendArr = explode(',', $extend);
foreach ($params as $index => $item) {
if (in_array($index, $extendArr)) {
foreach (explode(',', $item) as $key => $value) {
if ($value) {
$argv[] = "--{$index}={$value}";
}
}
}
}
$isrelation = (int)$this->request->request('isrelation');
if ($isrelation && isset($params['relation'])) {
foreach ($params['relation'] as $index => $relation) {
foreach ($relation as $key => $value) {
$argv[] = "--{$key}=" . (is_array($value) ? implode(',', $value) : $value);
}
}
}
} else if ($commandtype == 'menu') {
if (isset($params['allcontroller']) && $params['allcontroller']) {
$argv[] = "--controller=all-controller";
} else {
foreach (explode(',', $params['controllerfile']) as $index => $param) {
if ($param) {
$argv[] = "--controller=" . substr($param, 0, -4);
}
}
}
} else if ($commandtype == 'min') {
} else if ($commandtype == 'api') {
} else {
}
if ($action == 'execute') {
$result = $this->doexecute($commandtype, $argv);
$this->success("", null, ['result' => $result]);
} else {
$this->success("", null, ['command' => "php think {$commandtype} " . implode(' ', $argv)]);
}
return;
}
protected function doexecute($commandtype, $argv)
{
$commandName = "\\app\\admin\\command\\" . ucfirst($commandtype);
$input = new Input($argv);
$output = new \addons\command\library\Output();
$command = new $commandName($commandtype);
$data = [
'type' => $commandtype,
'params' => json_encode($argv),
'command' => "php think {$commandtype} " . implode(' ', $argv),
'executetime' => time(),
];
$this->model->save($data);
try {
$command->run($input, $output);
$result = implode("\n", $output->getMessage());
$this->model->status = 'successed';
} catch (Exception $e) {
$result = implode("\n", $output->getMessage()) . "\n";
$result .= $e->getMessage();
$this->model->status = 'failured';
}
$result = trim($result);
$this->model->content = $result;
$this->model->save();
return $result;
}
}

View File

@ -0,0 +1,214 @@
<?php
namespace app\admin\controller;
use addons\docs\library\Service;
use app\common\controller\Backend;
use fast\Http;
use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;
use think\Exception;
use think\Validate;
use ZipArchive;
/**
*
* 文档管理
* @icon fa fa-circle-o
*/
class Docs extends Backend
{
protected $docs = [];
public function _initialize()
{
parent::_initialize();
$this->docsdata = Service::getDocsData();
}
/**
* 查看
*/
public function index()
{
//设置过滤方法
$this->request->filter(['strip_tags']);
if ($this->request->isAjax())
{
$search = $this->request->request("search");
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$list = [];
foreach ($this->docsdata as $type => $pages)
{
foreach ($pages as $index => $page)
{
if (!$search || stripos($page['relative'], $search) !== false || stripos($page['title'], $search) !== false)
{
$page['relativeurl'] = addon_url("docs/index/index") . "?md={$page['relative']}";
$list[] = $page;
}
}
}
$total = count($list);
$result = array("total" => $total, "rows" => array_slice($list, $offset, $limit));
return json($result);
}
return $this->view->fetch();
}
/**
* 添加
*/
public function add()
{
if ($this->request->isPost())
{
$params = $this->request->post("row/a");
if ($params)
{
try
{
if (!$params['md'])
{
throw new Exception("MD文件不能为空");
}
$config = get_addon_config('docs');
//未设置后缀
if (stripos($params['md'], ".{$config['suffix']}") === false)
{
$params['md'] .= ".{$config['suffix']}";
}
if (mb_substr_count($params['md'], "/") > 1)
{
throw new Exception("MD文件中只能包含一个/字符");
}
if (!Validate::is($params['md'], "/^[A-Za-z0-9\-\_\.]+$/"))
{
throw new Exception("MD文件只能是字母数字下划线");
}
$row = Service::getMarkdownData($params['md']);
if ($row)
{
throw new Exception("对应的MD文件已经存在");
}
Service::setMarkdownData($params['md'], $params);
$this->success();
}
catch (Exception $e)
{
$this->error($e->getMessage());
}
}
$this->error(__('Parameter %s can not be empty', ''));
}
return $this->view->fetch();
}
/**
* 编辑
*/
public function edit($ids = NULL)
{
$row = Service::getMarkdownData($ids, true, false);
if (!$row)
$this->error(__('No Results were found'));
if ($this->request->isPost())
{
$params = $this->request->post("row/a");
if ($params)
{
try
{
Service::setMarkdownData($ids, $params);
$this->success();
}
catch (Exception $e)
{
$this->error($e->getMessage());
}
}
$this->error(__('Parameter %s can not be empty', ''));
}
$this->view->assign("row", $row);
return $this->view->fetch();
}
/**
* 删除
*/
public function del($ids = "")
{
if ($ids)
{
$row = Service::getMarkdownData($ids, false, false);
if (!$row)
$this->error(__('No Results were found'));
try
{
unlink(Service::getDocsSourceDir() . $row['relative']);
Service::refreshDocsData();
$this->success();
}
catch (Exception $e)
{
$this->error($e->getMessage());
}
}
$this->error(__('Parameter %s can not be empty', 'ids'));
}
/**
* 刷新
*/
public function refresh()
{
Service::refreshDocsData();
$this->success();
}
/**
* 导出
*/
public function export()
{
//重新生成一次文档
Service::build();
$distDir = Service::getDocsDistDir();
$zipFile = RUNTIME_PATH . 'addons' . DS . 'export-docs-' . date('YmdHis') . '.zip';
$rootPath = realpath($distDir);
$zip = new ZipArchive();
$zip->open($zipFile, ZipArchive::CREATE | ZipArchive::OVERWRITE);
$files = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($rootPath), RecursiveIteratorIterator::LEAVES_ONLY
);
foreach ($files as $name => $file)
{
if (!$file->isDir())
{
$filePath = $file->getRealPath();
$relativePath = substr($filePath, strlen($rootPath) + 1);
$zip->addFile($filePath, $relativePath);
}
}
$zip->close();
Http::sendToBrowser($zipFile);
}
/**
* 批量更新
* @internal
*/
public function multi($ids = "")
{
return;
}
}

View File

@ -0,0 +1,50 @@
<?php
namespace app\admin\controller;
use app\common\controller\Backend;
/**
* 测试管理
*
* @icon fa fa-circle-o
*/
class Test extends Backend
{
/**
* Test模型对象
* @var \app\admin\model\Test
*/
protected $model = null;
public function _initialize()
{
parent::_initialize();
$this->model = new \app\admin\model\Test;
$this->view->assign("weekList", $this->model->getWeekList());
$this->view->assign("flagList", $this->model->getFlagList());
$this->view->assign("genderdataList", $this->model->getGenderdataList());
$this->view->assign("hobbydataList", $this->model->getHobbydataList());
$this->view->assign("statusList", $this->model->getStatusList());
$this->view->assign("stateList", $this->model->getStateList());
}
/**
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
*/
/**
* 导入
*/
/*
public function import()
{
return parent::import();
}
*/
}

View File

@ -0,0 +1,59 @@
<?php
namespace app\admin\controller\cms;
use app\admin\model\Channel;
use app\common\controller\Backend;
use fast\Tree;
use think\db\Query;
/**
* Ajax
*
* @icon fa fa-circle-o
* @internal
*/
class Ajax extends Backend
{
/**
* 模型对象
*/
protected $model = null;
protected $noNeedRight = ['*'];
public function _initialize()
{
parent::_initialize();
}
/**
* 获取模板列表
* @internal
*/
public function get_template_list()
{
$files = [];
$keyValue = $this->request->request("keyValue");
if (!$keyValue) {
$name = $this->request->request("name");
if ($name) {
$files[] = ['name' => $name . '.html'];
}
//设置过滤方法
$this->request->filter(['strip_tags']);
$config = get_addon_config('cms');
$themeDir = ADDON_PATH . 'cms' . DS . 'view' . DS . $config['theme'] . DS;
$dh = opendir($themeDir);
while (false !== ($filename = readdir($dh))) {
if ($filename == '.' || $filename == '..')
continue;
$files[] = ['name' => $filename];
}
} else {
$files[] = ['name' => $keyValue];
}
return $result = ['total' => count($files), 'list' => $files];
}
}

View File

@ -0,0 +1,363 @@
<?php
namespace app\admin\controller\cms;
use app\admin\model\Channel;
use app\common\controller\Backend;
use fast\Tree;
use think\Db;
use think\db\Query;
/**
* 内容表
*
* @icon fa fa-circle-o
*/
class Archives extends Backend
{
/**
* Archives模型对象
*/
protected $model = null;
protected $noNeedRight = ['get_channel_fields', 'check_element_available'];
public function _initialize()
{
parent::_initialize();
$this->model = model('Archives');
$channelList = [];
$disabledIds = [];
$all = collection(Channel::order("weigh desc,id desc")->select())->toArray();
foreach ($all as $k => $v) {
$state = ['opened' => true];
if ($v['type'] != 'list') {
$disabledIds[] = $v['id'];
}
if ($v['type'] == 'link') {
$state['checkbox_disabled'] = true;
}
$channelList[] = [
'id' => $v['id'],
'parent' => $v['parent_id'] ? $v['parent_id'] : '#',
'text' => __($v['name']),
'type' => $v['type'],
'state' => $state
];
}
$tree = Tree::instance()->init($all, 'parent_id');
$channelOptions = $tree->getTree(0, "<option value=@id @selected @disabled>@spacer@name</option>", '', $disabledIds);
$this->view->assign('channelOptions', $channelOptions);
$this->assignconfig('channelList', $channelList);
$this->view->assign("flagList", $this->model->getFlagList());
$this->view->assign("statusList", $this->model->getStatusList());
}
/**
* 查看
*/
public function index()
{
//设置过滤方法
$this->request->filter(['strip_tags']);
if ($this->request->isAjax()) {
$this->relationSearch = TRUE;
//如果发送的来源是Selectpage则转发到Selectpage
if ($this->request->request('keyField')) {
return $this->selectpage();
}
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$total = $this->model
->with('Channel')
->where($where)
->order($sort, $order)
->count();
$list = $this->model
->with('Channel')
->where($where)
->order($sort, $order)
->limit($offset, $limit)
->select();
$result = array("total" => $total, "rows" => $list);
return json($result);
}
$modelList = \app\admin\model\Modelx::all();
$this->view->assign('modelList', $modelList);
return $this->view->fetch();
}
/**
* 副表内容
*/
public function content($model_id = null)
{
$model = \app\admin\model\Modelx::get($model_id);
if (!$model) {
$this->error('未找到对应模型');
}
$fieldsList = \app\admin\model\Fields::where('model_id', $model['id'])->where('type', '<>', 'text')->select();
//设置过滤方法
$this->request->filter(['strip_tags']);
if ($this->request->isAjax()) {
//如果发送的来源是Selectpage则转发到Selectpage
if ($this->request->request('keyField')) {
return $this->selectpage();
}
$fields = [];
foreach ($fieldsList as $index => $item) {
$fields[] = "addon." . $item['name'];
}
$table = $this->model->getTable();
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$sort = 'main.id';
$total = Db::table($table)
->alias('main')
->join('cms_channel channel', 'channel.id=main.channel_id', 'LEFT')
->join($model['table'] . ' addon', 'addon.id=main.id', 'LEFT')
->field('main.id,main.channel_id,main.title,channel.name as channel_name,addon.id as aid' . ($fields ? ',' . implode(',', $fields) : ''))
->where($where)
->order($sort, $order)
->count();
$list = Db::table($table)
->alias('main')
->join('cms_channel channel', 'channel.id=main.channel_id', 'LEFT')
->join($model['table'] . ' addon', 'addon.id=main.id', 'LEFT')
->field('main.id,main.channel_id,main.title,channel.name as channel_name,addon.id as aid' . ($fields ? ',' . implode(',', $fields) : ''))
->where($where)
->order($sort, $order)
->limit($offset, $limit)
->select();
$result = array("total" => $total, "rows" => $list);
return json($result);
}
$fields = [];
foreach ($fieldsList as $index => $item) {
$fields[] = ['field' => $item['name'], 'title' => $item['title'], 'type' => $item['type'], 'content' => $item['content_list']];
}
$this->assignconfig('fields', $fields);
$this->view->assign('fieldsList', $fieldsList);
$this->view->assign('model', $model);
$this->assignconfig('model_id', $model_id);
$modelList = \app\admin\model\Modelx::all();
$this->view->assign('modelList', $modelList);
return $this->view->fetch();
}
/**
* 编辑
*
* @param mixed $ids
*/
public function edit($ids = NULL)
{
$row = $this->model->get($ids);
if (!$row)
$this->error(__('No Results were found'));
$adminIds = $this->getDataLimitAdminIds();
if (is_array($adminIds)) {
if (!in_array($row[$this->dataLimitField], $adminIds)) {
$this->error(__('You have no permission'));
}
}
if ($this->request->isPost()) {
return parent::edit($ids);
}
$channel = Channel::get($row['channel_id']);
if (!$channel) {
$this->error(__('No specified channel found'));
}
$model = \app\admin\model\Modelx::get($channel['model_id']);
if (!$model) {
$this->error(__('No specified model found'));
}
$addon = db($model['table'])->where('id', $row['id'])->find();
if ($addon) {
$row = array_merge($row->toArray(), $addon);
}
$all = collection(Channel::order("weigh desc,id desc")->select())->toArray();
foreach ($all as $k => $v) {
if ($v['type'] != 'list' || $v['model_id'] != $channel['model_id']) {
$disabledIds[] = $v['id'];
}
}
$tree = Tree::instance()->init($all, 'parent_id');
$channelOptions = $tree->getTree(0, "<option value=@id @selected @disabled>@spacer@name</option>", $row['channel_id'], $disabledIds);
$this->view->assign('channelOptions', $channelOptions);
$this->view->assign("row", $row);
return $this->view->fetch();
}
/**
* 删除
* @param mixed $ids
*/
public function del($ids = "")
{
\app\admin\model\Archives::event('after_delete', function ($row) {
Channel::where('id', $row['channel_id'])->where('items', '>', 0)->setDec('items');
});
return parent::del($ids);
}
/**
* 还原
* @param mixed $ids
*/
public function restore($ids = "")
{
$pk = $this->model->getPk();
$adminIds = $this->getDataLimitAdminIds();
if (is_array($adminIds)) {
$this->model->where($this->dataLimitField, 'in', $adminIds);
}
if ($ids) {
$this->model->where($pk, 'in', $ids);
}
$archivesChannelIds = $this->model->onlyTrashed()->column('id,channel_id');
$archivesChannelIds = array_filter($archivesChannelIds);
$this->model->where('id', 'in', array_keys($archivesChannelIds));
$count = $this->model->restore('1=1');
if ($count) {
$channelNums = array_count_values($archivesChannelIds);
foreach ($channelNums as $k => $v) {
Channel::where('id', $k)->setInc('items', $v);
}
$this->success();
}
$this->error(__('No rows were updated'));
}
/**
* 移动
*/
public function move($ids = "")
{
if ($ids) {
$channel_id = $this->request->post('channel_id');
$pk = $this->model->getPk();
$adminIds = $this->getDataLimitAdminIds();
if (is_array($adminIds)) {
$this->model->where($this->dataLimitField, 'in', $adminIds);
}
$this->model->where($pk, 'in', $ids);
$channel = Channel::get($channel_id);
if ($channel && $channel['type'] === 'list') {
$channelNums = \app\admin\model\Archives::
with('channel')
->where('archives.' . $pk, 'in', $ids)
->where('channel_id', '<>', $channel['id'])
->field('channel_id,COUNT(*) AS nums')
->group('channel_id')
->select();
$result = $this->model
->where('model_id', '=', $channel['model_id'])
->where('channel_id', '<>', $channel['id'])
->update(['channel_id' => $channel_id]);
if ($result) {
$count = 0;
foreach ($channelNums as $k => $v) {
if ($v['channel']) {
Channel::where('id', $v['channel_id'])->where('items', '>', 0)->setDec('items', min($v['channel']['items'], $v['nums']));
}
$count += $v['nums'];
}
Channel::where('id', $channel_id)->setInc('items', $count);
$this->success();
} else {
$this->error(__('No rows were updated'));
}
} else {
$this->error(__('No rows were updated'));
}
$this->error(__('Parameter %s can not be empty', 'ids'));
}
}
/**
* 获取栏目列表
* @internal
*/
public function get_channel_fields()
{
$this->view->engine->layout(false);
$channel_id = $this->request->post('channel_id');
$archives_id = $this->request->post('archives_id');
$channel = Channel::get($channel_id, 'model');
if ($channel && $channel['type'] === 'list') {
$values = [];
if ($archives_id) {
$values = db($channel['model']['table'])->where('id', $archives_id)->find();
}
$fields = \app\admin\model\Fields::where('model_id', $channel['model_id'])
->order('weigh desc,id desc')
->select();
foreach ($fields as $k => $v) {
//优先取编辑的值,再次取默认值
$v->value = isset($values[$v['name']]) ? $values[$v['name']] : (is_null($v['defaultvalue']) ? '' : $v['defaultvalue']);
$v->rule = str_replace(',', '; ', $v->rule);
if (in_array($v->type, ['checkbox', 'lists', 'images'])) {
$checked = '';
if ($v['minimum'] && $v['maximum'])
$checked = "{$v['minimum']}~{$v['maximum']}";
else if ($v['minimum'])
$checked = "{$v['minimum']}~";
else if ($v['maximum'])
$checked = "~{$v['maximum']}";
if ($checked)
$v->rule .= (';checked(' . $checked . ')');
}
if (in_array($v->type, ['checkbox', 'radio']) && stripos($v->rule, 'required') !== false) {
$v->rule = str_replace('required', 'checked', $v->rule);
}
if (in_array($v->type, ['selects'])) {
$v->extend .= (' ' . 'data-max-options="' . $v['maximum'] . '"');
}
}
$this->view->assign('fields', $fields);
$this->view->assign('values', $values);
$this->success('', null, ['html' => $this->view->fetch('fields')]);
} else {
$this->error(__('Please select channel'));
}
$this->error(__('Parameter %s can not be empty', 'ids'));
}
/**
* 检测元素是否可用
* @internal
*/
public function check_element_available()
{
$id = $this->request->request('id');
$name = $this->request->request('name');
$value = $this->request->request('value');
$name = substr($name, 4, -1);
if (!$name) {
$this->error(__('Parameter %s can not be empty', 'name'));
}
if ($id) {
$this->model->where('id', '<>', $id);
}
$exist = $this->model->where($name, $value)->find();
if ($exist) {
$this->error(__('The data already exist'));
} else {
$this->success();
}
}
}

View File

@ -0,0 +1,55 @@
<?php
namespace app\admin\controller\cms;
use app\common\controller\Backend;
/**
* 区块表
*
* @icon fa fa-circle-o
*/
class Block extends Backend
{
/**
* Block模型对象
*/
protected $model = null;
public function _initialize()
{
parent::_initialize();
$this->model = model('Block');
$this->view->assign("statusList", $this->model->getStatusList());
}
public function selectpage_type()
{
$list = [];
$word = (array)$this->request->request("q_word/a");
$field = $this->request->request('showField');
$keyValue = $this->request->request('keyValue');
if (!$keyValue) {
if (array_filter($word)) {
foreach ($word as $k => $v) {
$list[] = ['id' => $v, $field => $v];
}
}
$typeArr = \app\admin\model\Block::column('type');
$typeArr = array_unique($typeArr);
foreach ($typeArr as $index => $item) {
$list[] = ['id' => $item, $field => $item];
}
} else {
$list[] = ['id' => $keyValue, $field => $keyValue];
}
return json(['total' => count($list), 'list' => $list]);
}
public function import()
{
return parent::import();
}
}

View File

@ -0,0 +1,181 @@
<?php
namespace app\admin\controller\cms;
use app\common\controller\Backend;
use app\admin\model\Channel as ChannelModel;
use fast\Tree;
/**
* 栏目表
*
* @icon fa fa-circle-o
*/
class Channel extends Backend
{
protected $channelList = [];
protected $modelList = [];
protected $multiFields = ['weigh', 'status'];
/**
* Channel模型对象
*/
protected $model = null;
protected $noNeedRight = ['check_element_available'];
public function _initialize()
{
parent::_initialize();
$this->request->filter(['strip_tags']);
$this->model = model('Channel');
$tree = Tree::instance();
$tree->init(collection($this->model->order('weigh desc,id desc')->select())->toArray(), 'parent_id');
$this->channelList = $tree->getTreeList($tree->getTreeArray(0), 'name');
$this->modelList = \app\admin\model\Modelx::order('id asc')->select();
$this->view->assign("modelList", $this->modelList);
$this->view->assign("channelList", $this->channelList);
$this->view->assign("typeList", ChannelModel::getTypeList());
$this->view->assign("statusList", ChannelModel::getStatusList());
}
/**
* 查看
*/
public function index()
{
if ($this->request->isAjax()) {
$search = $this->request->request("search");
$model_id = $this->request->request("model_id");
//构造父类select列表选项数据
$list = [];
if ($search) {
foreach ($this->channelList as $k => $v) {
if (stripos($v['name'], $search) !== false || stripos($v['nickname'], $search) !== false) {
$list[] = $v;
}
}
} else {
$list = $this->channelList;
}
foreach ($list as $index => $item) {
if ($model_id && $model_id != $item['model_id']) {
unset($list[$index]);
}
}
$list = array_values($list);
$modelNameArr = [];
foreach ($this->modelList as $k => $v) {
$modelNameArr[$v['id']] = $v['name'];
}
foreach ($list as $k => &$v) {
$v['model_name'] = $v['model_id'] && isset($modelNameArr[$v['model_id']]) ? $modelNameArr[$v['model_id']] : __('None');
}
$total = count($list);
$result = array("total" => $total, "rows" => $list);
return json($result);
}
return $this->view->fetch();
}
/**
* 添加
*/
public function add()
{
if ($this->request->isPost()) {
$params = $this->request->post("row/a");
if ($params) {
if ($this->dataLimit && $this->dataLimitFieldAutoFill) {
$params[$this->dataLimitField] = $this->auth->id;
}
try {
//是否采用模型验证
if ($this->modelValidate) {
$name = basename(str_replace('\\', '/', get_class($this->model)));
$validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : true) : $this->modelValidate;
$this->model->validate($validate);
}
$nameArr = array_filter(explode("\n", str_replace("\r\n", "\n", $params['name'])));
if (count($nameArr) > 1) {
foreach ($nameArr as $index => $item) {
$itemArr = array_filter(explode('|', $item));
$params['name'] = $itemArr[0];
$params['diyname'] = isset($itemArr[1]) ? $itemArr[1] : '';
$result = $this->model->allowField(true)->isUpdate(false)->data($params)->save();
}
} else {
$result = $this->model->allowField(true)->save($params);
}
if ($result !== false) {
$this->success();
} else {
$this->error($this->model->getError());
}
} catch (\think\exception\PDOException $e) {
$this->error($e->getMessage());
}
}
$this->error(__('Parameter %s can not be empty', ''));
}
return $this->view->fetch();
}
/**
* Selectpage搜索
*
* @internal
*/
public function selectpage()
{
return parent::selectpage();
}
/**
* 检测元素是否可用
* @internal
*/
public function check_element_available()
{
$id = $this->request->request('id');
$name = $this->request->request('name');
$value = $this->request->request('value');
$name = substr($name, 4, -1);
if (!$name) {
$this->error(__('Parameter %s can not be empty', 'name'));
}
if ($name == 'diyname') {
if ($id) {
$this->model->where('id', '<>', $id);
}
$exist = $this->model->where($name, $value)->find();
if ($exist) {
$this->error(__('The data already exist'));
} else {
$this->success();
}
} else if ($name == 'name') {
$nameArr = array_filter(explode("\n", str_replace("\r\n", "\n", $value)));
if (count($nameArr) > 1) {
foreach ($nameArr as $index => $item) {
$itemArr = array_filter(explode('|', $item));
if (!isset($itemArr[1])) {
$this->error('格式:分类名称|自定义名称');
}
$exist = \app\admin\model\Channel::getByDiyname($itemArr[1]);
if ($exist) {
$this->error('自定义名称[' . $itemArr[1] . ']已经存在');
}
}
$this->success();
} else {
$this->success();
}
}
}
}

View File

@ -0,0 +1,64 @@
<?php
namespace app\admin\controller\cms;
use app\common\controller\Backend;
/**
* 评论管理
*
* @icon fa fa-comment
*/
class Comment extends Backend
{
/**
* Comment模型对象
*/
protected $model = null;
public function _initialize()
{
parent::_initialize();
$this->model = model('Comment');
$this->view->assign("typeList", $this->model->getTypeList());
$this->view->assign("statusList", $this->model->getStatusList());
}
/**
* 查看
*/
public function index()
{
$this->relationSearch = true;
//设置过滤方法
$this->request->filter(['strip_tags']);
if ($this->request->isAjax())
{
//如果发送的来源是Selectpage则转发到Selectpage
if ($this->request->request('keyField'))
{
return $this->selectpage();
}
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$total = $this->model
->with('archives')
->where($where)
->order($sort, $order)
->count();
$list = $this->model
->with('archives')
->where($where)
->order($sort, $order)
->limit($offset, $limit)
->select();
$list = collection($list)->toArray();
$result = array("total" => $total, "rows" => $list);
return json($result);
}
return $this->view->fetch();
}
}

View File

@ -0,0 +1,178 @@
<?php
namespace app\admin\controller\cms;
use app\common\controller\Backend;
/**
* 自定义表单数据表
*
* @icon fa fa-circle-o
*/
class Diydata extends Backend
{
/**
* 自定义表单模型对象
*/
protected $diyform = null;
/**
* 定义表单数据表模型
* @var null
*/
protected $model = null;
public function _initialize()
{
parent::_initialize();
$diyform_id = $this->request->param('diyform_id');
$this->diyform = \app\admin\model\Diyform::get($diyform_id);
if (!$this->diyform) {
$this->error('未找到对应自定义表单');
}
$this->model = \think\Db::name($this->diyform['table']);
$this->assignconfig('diyform_id', $diyform_id);
}
/**
* 查看
*/
public function index()
{
$fieldsList = \app\admin\model\Fields::where('diyform_id', $this->diyform['id'])->where('type', '<>', 'text')->select();
$fields = [];
foreach ($fieldsList as $index => $item) {
$fields[] = ['field' => $item['name'], 'title' => $item['title'], 'type' => $item['type'], 'content' => $item['content_list']];
}
$this->assignconfig('fields', $fields);
$diyformList = \app\admin\model\Diyform::all();
$this->view->assign('diyform', $this->diyform);
$this->view->assign('diyformList', $diyformList);
return parent::index();
}
/**
* 添加
*/
public function add()
{
$this->assignFields();
if ($this->request->isPost()) {
$params = $this->request->post("row/a");
if ($params) {
if ($this->dataLimit && $this->dataLimitFieldAutoFill) {
$params[$this->dataLimitField] = $this->auth->id;
}
try {
$result = $this->model->insert($params);
if ($result !== false) {
$this->success();
} else {
$this->error($this->model->getError());
}
} catch (\think\exception\PDOException $e) {
$this->error($e->getMessage());
} catch (\think\Exception $e) {
$this->error($e->getMessage());
}
}
$this->error(__('Parameter %s can not be empty', ''));
}
return $this->view->fetch();
}
/**
* 编辑
*/
public function edit($ids = NULL)
{
$row = $this->model->where('id', $ids)->find();
if (!$row)
$this->error(__('No Results were found'));
$adminIds = $this->getDataLimitAdminIds();
if (is_array($adminIds)) {
if (!in_array($row[$this->dataLimitField], $adminIds)) {
$this->error(__('You have no permission'));
}
}
if ($this->request->isPost()) {
$params = $this->request->post("row/a");
if ($params) {
try {
$result = $this->model->where('id', $ids)->update($params);
if ($result !== false) {
$this->success();
} else {
$this->error($row->getError());
}
} catch (\think\exception\PDOException $e) {
$this->error($e->getMessage());
} catch (\think\Exception $e) {
$this->error($e->getMessage());
}
}
$this->error(__('Parameter %s can not be empty', ''));
}
$this->assignFields($ids);
$this->view->assign("row", $row);
return $this->view->fetch();
}
/**
* 删除
*/
public function del($ids = "")
{
if ($ids) {
$pk = $this->model->getPk();
$adminIds = $this->getDataLimitAdminIds();
if (is_array($adminIds)) {
$count = $this->model->where($this->dataLimitField, 'in', $adminIds);
}
$count = $this->model->where($pk, 'in', $ids)->delete();
if ($count) {
$this->success();
} else {
$this->error(__('No rows were deleted'));
}
}
$this->error(__('Parameter %s can not be empty', 'ids'));
}
private function assignFields($diydata_id = 0)
{
$values = [];
if ($diydata_id) {
$values = db($this->diyform['table'])->where('id', $diydata_id)->find();
}
$fields = \app\admin\model\Fields::where('diyform_id', $this->diyform['id'])
->order('weigh desc,id desc')
->select();
foreach ($fields as $k => $v) {
$v->value = isset($values[$v['name']]) ? $values[$v['name']] : '';
$v->rule = str_replace(',', '; ', $v->rule);
if (in_array($v->type, ['checkbox', 'lists', 'images'])) {
$checked = '';
if ($v['minimum'] && $v['maximum'])
$checked = "{$v['minimum']}~{$v['maximum']}";
else if ($v['minimum'])
$checked = "{$v['minimum']}~";
else if ($v['maximum'])
$checked = "~{$v['maximum']}";
if ($checked)
$v->rule .= (';checked(' . $checked . ')');
}
if (in_array($v->type, ['checkbox', 'radio']) && stripos($v->rule, 'required') !== false) {
$v->rule = str_replace('required', 'checked', $v->rule);
}
if (in_array($v->type, ['selects'])) {
$v->extend .= (' ' . 'data-max-options="' . $v['maximum'] . '"');
}
}
$this->view->assign('fields', $fields);
$this->view->assign('values', $values);
}
}

View File

@ -0,0 +1,27 @@
<?php
namespace app\admin\controller\cms;
use app\common\controller\Backend;
/**
* 自定义表单表
*
* @icon fa fa-circle-o
*/
class Diyform extends Backend
{
/**
* Model模型对象
*/
protected $model = null;
public function _initialize()
{
parent::_initialize();
$this->model = model('Diyform');
$this->view->assign("statusList", $this->model->getStatusList());
}
}

View File

@ -0,0 +1,114 @@
<?php
namespace app\admin\controller\cms;
use app\common\controller\Backend;
use app\common\model\Config;
/**
* 模型字段表
*
* @icon fa fa-circle-o
*/
class Fields extends Backend
{
/**
* Fields模型对象
*/
protected $model = null;
protected $modelValidate = true;
protected $modelSceneValidate = true;
protected $noNeedRight = ['rulelist'];
public function _initialize()
{
parent::_initialize();
$this->model = model('Fields');
$this->view->assign("statusList", $this->model->getStatusList());
$this->view->assign('typeList', Config::getTypeList());
$this->view->assign('regexList', Config::getRegexList());
}
/**
* 查看
*/
public function index()
{
$model_id = $this->request->param('model_id', 0);
$diyform_id = $this->request->param('diyform_id', 0);
$condition = $model_id ? ['model_id' => $model_id] : ['diyform_id' => $diyform_id];
//设置过滤方法
$this->request->filter(['strip_tags']);
if ($this->request->isAjax()) {
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$total = $this->model
->where($condition)
->where($where)
->order($sort, $order)
->count();
$list = $this->model
->where($condition)
->where($where)
->order($sort, $order)
->limit($offset, $limit)
->select();
$result = array("total" => $total, "rows" => $list);
return json($result);
}
$this->assignconfig('model_id', $model_id);
$this->assignconfig('diyform_id', $diyform_id);
$this->view->assign('model_id', $model_id);
$this->view->assign('diyform_id', $diyform_id);
$model = $model_id ? \app\admin\model\Modelx::get($model_id) : \app\admin\model\Diyform::get($diyform_id);
$this->view->assign('model', $model);
$modelList = $model_id ? \app\admin\model\Modelx::all() : \app\admin\model\Diyform::all();
$this->view->assign('modelList', $modelList);
return $this->view->fetch();
}
/**
* 添加
*/
public function add()
{
$model_id = $this->request->param('model_id', 0);
$diyform_id = $this->request->param('diyform_id', 0);
$this->view->assign('model_id', $model_id);
$this->view->assign('diyform_id', $diyform_id);
return parent::add();
}
/**
* 规则列表
* @internal
*/
public function rulelist()
{
//主键
$primarykey = $this->request->request("keyField");
//主键值
$keyValue = $this->request->request("keyValue", "");
$keyValueArr = array_filter(explode(',', $keyValue));
$regexList = Config::getRegexList();
$list = [];
foreach ($regexList as $k => $v) {
if ($keyValueArr) {
if (in_array($k, $keyValueArr)) {
$list[] = ['id' => $k, 'name' => $v];
}
} else {
$list[] = ['id' => $k, 'name' => $v];
}
}
return json(['list' => $list]);
}
}

View File

@ -0,0 +1,26 @@
<?php
namespace app\admin\controller\cms;
use app\common\controller\Backend;
/**
* 内容模型表
*
* @icon fa fa-circle-o
*/
class Modelx extends Backend
{
/**
* Model模型对象
*/
protected $model = null;
public function _initialize()
{
parent::_initialize();
$this->model = model('Modelx');
}
}

View File

@ -0,0 +1,63 @@
<?php
namespace app\admin\controller\cms;
use app\common\controller\Backend;
/**
* 单页表
*
* @icon fa fa-circle-o
*/
class Page extends Backend
{
/**
* Page模型对象
*/
protected $model = null;
protected $noNeedRight = ['selectpage_type'];
public function _initialize()
{
parent::_initialize();
$this->model = model('Page');
$this->view->assign("flagList", $this->model->getFlagList());
$this->view->assign("statusList", $this->model->getStatusList());
}
public function index()
{
$typeArr = \app\admin\model\Page::column('type');
$this->view->assign('typeList', $typeArr);
return parent::index();
}
/**
* 动态下拉选择类型
* @internal
*/
public function selectpage_type()
{
$list = [];
$word = (array)$this->request->request("q_word/a");
$field = $this->request->request('showField');
$keyValue = $this->request->request('keyValue');
if (!$keyValue) {
if (array_filter($word)) {
foreach ($word as $k => $v) {
$list[] = ['id' => $v, $field => $v];
}
}
$typeArr = \app\admin\model\Page::column('type');
$typeArr = array_unique($typeArr);
foreach ($typeArr as $index => $item) {
$list[] = ['id' => $item, $field => $item];
}
} else {
$list[] = ['id' => $keyValue, $field => $keyValue];
}
return json(['total' => count($list), 'list' => $list]);
}
}

View File

@ -0,0 +1,46 @@
<?php
namespace app\admin\controller\cms;
use app\common\controller\Backend;
/**
* 标签表
*
* @icon tags
*/
class Tags extends Backend
{
/**
* Tags模型对象
*/
protected $model = null;
public function _initialize()
{
parent::_initialize();
$this->model = model('Tags');
}
/**
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个方法
* 因此在当前控制器中可不用编写增删改查的代码,如果需要自己控制这部分逻辑
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
*/
public function selectpage()
{
$response = parent::selectpage();
$word = (array)$this->request->request("q_word/a");
if (array_filter($word)) {
$result = $response->getData();
foreach ($word as $k => $v) {
array_unshift($result['list'], ['id' => $v, 'name' => $v]);
$result['total']++;
}
$response->data($result);
}
return $response;
}
}

View File

@ -0,0 +1,41 @@
<?php
namespace app\admin\controller\example;
use app\common\controller\Backend;
/**
* 百度地图
*
* @icon fa fa-map
* @remark 可以搜索百度位置调用百度地图的相关API
*/
class Baidumap extends Backend
{
protected $model = null;
public function _initialize()
{
parent::_initialize();
$this->model = model('AdminLog');
}
/**
* 查找地图
*/
public function map()
{
return $this->view->fetch();
}
/**
* 搜索列表
*/
public function selectpage()
{
$this->model = model('Area');
return parent::selectpage();
}
}

View File

@ -0,0 +1,121 @@
<?php
namespace app\admin\controller\example;
use app\common\controller\Backend;
/**
* 表格完整示例
*
* @icon fa fa-table
* @remark 在使用Bootstrap-table中的常用方式,更多使用方式可查看:http://bootstrap-table.wenzhixin.net.cn/zh-cn/
*/
class Bootstraptable extends Backend
{
protected $model = null;
protected $noNeedRight = ['start', 'pause', 'change', 'detail', 'cxselect', 'searchlist'];
public function _initialize()
{
parent::_initialize();
$this->model = model('AdminLog');
}
/**
* 查看
*/
public function index()
{
if ($this->request->isAjax()) {
list($where, $sort, $order, $offset, $limit) = $this->buildparams(NULL);
$total = $this->model
->where($where)
->order($sort, $order)
->count();
$list = $this->model
->where($where)
->order($sort, $order)
->limit($offset, $limit)
->select();
$result = array("total" => $total, "rows" => $list, "extend" => ['money' => mt_rand(100000,999999), 'price' => 200]);
return json($result);
}
return $this->view->fetch();
}
/**
* 详情
*/
public function detail($ids)
{
$row = $this->model->get(['id' => $ids]);
if (!$row)
$this->error(__('No Results were found'));
if ($this->request->isAjax()) {
$this->success("Ajax请求成功", null, ['id' => $ids]);
}
$this->view->assign("row", $row->toArray());
return $this->view->fetch();
}
/**
* 启用
*/
public function start($ids = '')
{
$this->success("模拟启动成功");
}
/**
* 暂停
*/
public function pause($ids = '')
{
$this->success("模拟暂停成功");
}
/**
* 切换
*/
public function change($ids = '')
{
$this->success("模拟切换成功");
}
/**
* 联动搜索
*/
public function cxselect()
{
$type = $this->request->get('type');
$group_id = $this->request->get('group_id');
$list = null;
if ($group_id !== '') {
if ($type == 'group') {
$groupIds = $this->auth->getChildrenGroupIds(true);
$list = \app\admin\model\AuthGroup::where('id', 'in', $groupIds)->field('id as value, name')->select();
} else {
$adminIds = \app\admin\model\AuthGroupAccess::where('group_id', 'in', $group_id)->column('uid');
$list = \app\admin\model\Admin::where('id', 'in', $adminIds)->field('id as value, username AS name')->select();
}
}
$this->success('', null, $list);
}
/**
* 搜索下拉列表
*/
public function searchlist()
{
$result = $this->model->limit(10)->select();
$searchlist = [];
foreach ($result as $key => $value) {
$searchlist[] = ['id' => $value['url'], 'name' => $value['url']];
}
$data = ['searchlist' => $searchlist];
$this->success('', null, $data);
}
}

View File

@ -0,0 +1,24 @@
<?php
namespace app\admin\controller\example;
use app\common\controller\Backend;
/**
* 彩色角标
*
* @icon fa fa-table
* @remark 在JS端控制角标的显示与隐藏,请注意左侧菜单栏角标的数值变化
*/
class Colorbadge extends Backend
{
protected $model = null;
public function _initialize()
{
parent::_initialize();
$this->model = model('AdminLog');
}
}

View File

@ -0,0 +1,24 @@
<?php
namespace app\admin\controller\example;
use app\common\controller\Backend;
/**
* 控制器间跳转
*
* @icon fa fa-table
* @remark FastAdmin支持在控制器间跳转,点击后将切换到另外一个TAB中,无需刷新当前页面
*/
class Controllerjump extends Backend
{
protected $model = null;
public function _initialize()
{
parent::_initialize();
$this->model = model('AdminLog');
}
}

View File

@ -0,0 +1,26 @@
<?php
namespace app\admin\controller\example;
use app\common\controller\Backend;
/**
* 自定义搜索
*
* @icon fa fa-search
* @remark 自定义列表的搜索
*/
class Customsearch extends Backend
{
protected $model = null;
public function _initialize()
{
parent::_initialize();
$this->model = model('AdminLog');
$ipList = $this->model->whereTime('createtime', '-37 days')->group("ip")->column("ip,ip as aa");
$this->view->assign("ipList", $ipList);
}
}

View File

@ -0,0 +1,23 @@
<?php
namespace app\admin\controller\example;
use app\common\controller\Backend;
/**
* 多级联动
*
* @icon fa fa-table
* @remark FastAdmin使用了jQuery-cxselect实现多级联动,更多文档请参考https://github.com/karsonzhang/cxSelect
*/
class Cxselect extends Backend
{
protected $model = null;
public function _initialize()
{
parent::_initialize();
}
}

View File

@ -0,0 +1,95 @@
<?php
namespace app\admin\controller\example;
use app\common\controller\Backend;
/**
* 多表格示例
*
* @icon fa fa-table
* @remark 当一个页面上存在多个Bootstrap-table时该如何控制按钮和表格
*/
class Multitable extends Backend
{
protected $model = null;
public function _initialize()
{
parent::_initialize();
}
/**
* 查看
*/
public function index()
{
$this->loadlang('general/attachment');
$this->loadlang('general/crontab');
return $this->view->fetch();
}
public function table1()
{
$this->model = model('Attachment');
//设置过滤方法
$this->request->filter(['strip_tags']);
if ($this->request->isAjax())
{
//如果发送的来源是Selectpage则转发到Selectpage
if ($this->request->request('keyField'))
{
return $this->selectpage();
}
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$total = $this->model
->where($where)
->order($sort, $order)
->count();
$list = $this->model
->where($where)
->order($sort, $order)
->limit($offset, $limit)
->select();
$result = array("total" => $total, "rows" => $list);
return json($result);
}
return $this->view->fetch('index');
}
public function table2()
{
$this->model = model('AdminLog');
//设置过滤方法
$this->request->filter(['strip_tags']);
if ($this->request->isAjax())
{
//如果发送的来源是Selectpage则转发到Selectpage
if ($this->request->request('keyField'))
{
return $this->selectpage();
}
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$total = $this->model
->where($where)
->order($sort, $order)
->count();
$list = $this->model
->where($where)
->order($sort, $order)
->limit($offset, $limit)
->select();
$result = array("total" => $total, "rows" => $list);
return json($result);
}
return $this->view->fetch('index');
}
}

View File

@ -0,0 +1,52 @@
<?php
namespace app\admin\controller\example;
use app\common\controller\Backend;
/**
* 关联模型
*
* @icon fa fa-table
* @remark 当使用到关联模型时需要重载index方法
*/
class Relationmodel extends Backend
{
protected $model = null;
public function _initialize()
{
parent::_initialize();
$this->model = model('AdminLog');
}
/**
* 查看
*/
public function index()
{
$this->relationSearch = true;
$this->searchFields = "admin.username,id";
if ($this->request->isAjax())
{
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$total = $this->model
->with("admin")
->where($where)
->order($sort, $order)
->count();
$list = $this->model
->with("admin")
->where($where)
->order($sort, $order)
->limit($offset, $limit)
->select();
$result = array("total" => $total, "rows" => $list);
return json($result);
}
return $this->view->fetch();
}
}

View File

@ -0,0 +1,60 @@
<?php
namespace app\admin\controller\example;
use app\common\controller\Backend;
/**
* 表格模板示例
*
* @icon fa fa-table
* @remark 可以通过使用表格模板将表格中的行渲染成一样的展现方式,基于此功能可以任意定制自己想要的展示列表
*/
class Tabletemplate extends Backend
{
protected $model = null;
public function _initialize()
{
parent::_initialize();
$this->model = model('AdminLog');
}
/**
* 查看
*/
public function index()
{
if ($this->request->isAjax())
{
list($where, $sort, $order, $offset, $limit) = $this->buildparams(NULL);
$total = $this->model
->where($where)
->order($sort, $order)
->count();
$list = $this->model
->where($where)
->order($sort, $order)
->limit($offset, $limit)
->select();
$result = array("total" => $total, "rows" => $list);
return json($result);
}
return $this->view->fetch();
}
/**
* 详情
*/
public function detail($ids)
{
$row = $this->model->get(['id' => $ids]);
if (!$row)
$this->error(__('No Results were found'));
$this->view->assign("row", $row->toArray());
return $this->view->fetch();
}
}

View File

@ -0,0 +1,100 @@
<?php
namespace app\admin\controller\general;
use app\common\controller\Backend;
use Cron\CronExpression;
/**
* 定时任务
*
* @icon fa fa-tasks
* @remark 类似于Linux的Crontab定时任务,可以按照设定的时间进行任务的执行,目前仅支持三种任务:请求URL、执行SQL、执行Shell
*/
class Crontab extends Backend
{
protected $model = null;
protected $noNeedRight = ['check_schedule', 'get_schedule_future'];
public function _initialize()
{
parent::_initialize();
$this->model = model('Crontab');
$this->view->assign('typedata', \app\common\model\Crontab::getTypeList());
}
/**
* 查看
*/
public function index()
{
if ($this->request->isAjax())
{
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$total = $this->model
->where($where)
->order($sort, $order)
->count();
$list = $this->model
->where($where)
->order($sort, $order)
->limit($offset, $limit)
->select();
foreach ($list as $k => &$v)
{
$cron = CronExpression::factory($v['schedule']);
$v['nexttime'] = $cron->getNextRunDate()->getTimestamp();
}
$result = array("total" => $total, "rows" => $list);
return json($result);
}
return $this->view->fetch();
}
/**
* 判断Crontab格式是否正确
* @internal
*/
public function check_schedule()
{
$row = $this->request->post("row/a");
$schedule = isset($row['schedule']) ? $row['schedule'] : '';
if (CronExpression::isValidExpression($schedule))
{
$this->success();
}
else
{
$this->error(__('Crontab format invalid'));
}
}
/**
* 根据Crontab表达式读取未来七次的时间
* @internal
*/
public function get_schedule_future()
{
$time = [];
$schedule = $this->request->post('schedule');
$days = (int) $this->request->post('days');
try
{
$cron = CronExpression::factory($schedule);
for ($i = 0; $i < $days; $i++)
{
$time[] = $cron->getNextRunDate(null, $i)->format('Y-m-d H:i:s');
}
}
catch (\Exception $e)
{
}
return json(['futuretime' => $time]);
}
}

View File

@ -0,0 +1,290 @@
<?php
namespace app\admin\controller\general;
use addons\database\library\Backup;
use app\common\controller\Backend;
use think\Db;
use think\Debug;
use think\Exception;
use think\exception\PDOException;
use ZipArchive;
/**
* 数据库管理
*
* @icon fa fa-database
* @remark 可在线进行一些简单的数据库表优化或修复,查看表结构和数据。也可以进行SQL语句的操作
*/
class Database extends Backend
{
protected $noNeedRight = ['backuplist'];
/**
* 查看
*/
function index()
{
$tables_data_length = $tables_index_length = $tables_free_length = $tables_data_count = 0;
$tables = $list = [];
$list = Db::query("SHOW TABLES");
foreach ($list as $key => $row) {
$tables[] = ['name' => reset($row), 'rows' => 0];
}
$data['tables'] = $tables;
$data['saved_sql'] = [];
$this->view->assign($data);
return $this->view->fetch();
}
/**
* SQL查询
*/
public function query()
{
$do_action = $this->request->post('do_action');
echo '<style type="text/css">
xmp,body{margin:0;padding:0;line-height:18px;font-size:12px;font-family:"Helvetica Neue", Helvetica, Microsoft Yahei, Hiragino Sans GB, WenQuanYi Micro Hei, sans-serif;}
hr{height:1px;margin:5px 1px;background:#e3e3e3;border:none;}
</style>';
if ($do_action == '')
exit(__('Invalid parameters'));
$tablename = $this->request->post("tablename/a");
if (in_array($do_action, array('doquery', 'optimizeall', 'repairall'))) {
$this->$do_action();
} else if (count($tablename) == 0) {
exit(__('Invalid parameters'));
} else {
foreach ($tablename as $table) {
$this->$do_action($table);
echo "<br />";
}
}
}
/**
* 备份列表
* @internal
*/
public function backuplist()
{
$config = get_addon_config('database');
$backupDir = ROOT_PATH . 'public' . DS . $config['backupDir'];
$backuplist = [];
foreach (glob($backupDir . "*.zip") as $filename) {
$time = filemtime($filename);
$backuplist[$time] =
[
'file' => str_replace($backupDir, '', $filename),
'date' => date("Y-m-d H:i:s", $time),
'size' => format_bytes(filesize($filename))
];
}
krsort($backuplist);
$this->success("", null, ['backuplist' => array_values($backuplist)]);
}
/**
* 还原
*/
public function restore($ids = '')
{
$config = get_addon_config('database');
$backupDir = ROOT_PATH . 'public' . DS . $config['backupDir'];
if ($this->request->isPost()) {
$action = $this->request->request('action');
$file = $this->request->request('file');
$file = $backupDir . $file;
if ($action == 'restore') {
try {
$dir = RUNTIME_PATH . 'database' . DS;
if (!is_dir($dir)) {
mkdir($dir, 0755);
}
if (class_exists('ZipArchive')) {
$zip = new ZipArchive;
if ($zip->open($file) !== TRUE) {
throw new Exception(__('Can not open zip file'));
}
if (!$zip->extractTo($dir)) {
$zip->close();
throw new Exception(__('Can not unzip file'));
}
$zip->close();
$filename = basename($file);
$sqlFile = $dir . str_replace('.zip', '.sql', $filename);
if (!is_file($sqlFile)) {
throw new Exception(__('Sql file not found'));
}
$filesize = filesize($sqlFile);
$list = Db::query('SELECT @@global.max_allowed_packet');
if (isset($list[0]['@@global.max_allowed_packet']) && $filesize >= $list[0]['@@global.max_allowed_packet']) {
Db::execute('SET @@global.max_allowed_packet = ' . ($filesize + 1024));
//throw new Exception('备份文件超过配置max_allowed_packet大小请修改Mysql服务器配置');
}
$sql = file_get_contents($sqlFile);
Db::clear();
//必须重连一次
Db::connect([], true)->query("select 1");
Db::getPdo()->exec($sql);
}
} catch (Exception $e) {
$this->error($e->getMessage());
} catch (PDOException $e) {
$this->error($e->getMessage());
}
$this->success(__('Restore successful'));
} else if ($action == 'delete') {
unlink($file);
$this->success(__('Delete successful'));
}
}
}
/**
* 备份
*/
public function backup()
{
$config = get_addon_config('database');
$backupDir = ROOT_PATH . 'public' . DS . $config['backupDir'];
if ($this->request->isPost()) {
$database = config('database');
try {
$backup = new Backup($database['hostname'], $database['username'], $database['database'], $database['password'], $database['hostport']);
$backup->setIgnoreTable($config['backupIgnoreTables'])->backup($backupDir);
} catch (Exception $e) {
$this->error($e->getMessage());
}
$this->success(__('Backup successful'));
}
return;
}
private function viewinfo($name)
{
$row = Db::query("SHOW CREATE TABLE `{$name}`");
$row = array_values($row[0]);
$info = $row[1];
echo "<xmp>{$info};</xmp>";
}
private function viewdata($name = '')
{
$sqlquery = "SELECT * FROM `{$name}`";
$this->doquery($sqlquery);
}
private function optimize($name = '')
{
if (Db::execute("OPTIMIZE TABLE `{$name}`")) {
echo __('Optimize table %s done', $name);
} else {
echo __('Optimize table %s fail', $name);
}
}
private function optimizeall($name = '')
{
$list = Db::query("SHOW TABLES");
foreach ($list as $key => $row) {
$name = reset($row);
if (Db::execute("OPTIMIZE TABLE {$name}")) {
echo __('Optimize table %s done', $name);
} else {
echo __('Optimize table %s fail', $name);
}
echo "<br />";
}
}
private function repair($name = '')
{
if (Db::execute("REPAIR TABLE `{$name}`")) {
echo __('Repair table %s done', $name);
} else {
echo __('Repair table %s fail', $name);
}
}
private function repairall($name = '')
{
$list = Db::query("SHOW TABLES");
foreach ($list as $key => $row) {
$name = reset($row);
if (Db::execute("REPAIR TABLE {$name}")) {
echo __('Repair table %s done', $name);
} else {
echo __('Repair table %s fail', $name);
}
echo "<br />";
}
}
private function doquery($sql = null)
{
$sqlquery = $sql ? $sql : $this->request->post('sqlquery');
if ($sqlquery == '')
exit(__('SQL can not be empty'));
$sqlquery = str_replace("\r", "", $sqlquery);
$sqls = preg_split("/;[ \t]{0,}\n/i", $sqlquery);
$maxreturn = 100;
$r = '';
foreach ($sqls as $key => $val) {
if (trim($val) == '')
continue;
$val = rtrim($val, ';');
$r .= "SQL<span style='color:green;'>{$val}</span> ";
if (preg_match("/^(select|explain)(.*)/i ", $val)) {
Debug::remark("begin");
$limit = stripos(strtolower($val), "limit") !== false ? true : false;
$count = Db::execute($val);
if ($count > 0) {
$resultlist = Db::query($val . (!$limit && $count > $maxreturn ? ' LIMIT ' . $maxreturn : ''));
} else {
$resultlist = [];
}
Debug::remark("end");
$time = Debug::getRangeTime('begin', 'end', 4);
$usedseconds = __('Query took %s seconds', $time) . "<br />";
if ($count <= 0) {
$r .= __('Query returned an empty result');
} else {
$r .= (__('Total:%s', $count) . (!$limit && $count > $maxreturn ? ',' . __('Max output:%s', $maxreturn) : ""));
}
$r = $r . ',' . $usedseconds;
$j = 0;
foreach ($resultlist as $m => $n) {
$j++;
if (!$limit && $j > $maxreturn)
break;
$r .= "<hr/>";
$r .= "<font color='red'>" . __('Row:%s', $j) . "</font><br />";
foreach ($n as $k => $v) {
$r .= "<font color='blue'>{$k}</font>{$v}<br/>\r\n";
}
}
} else {
Debug::remark("begin");
$count = Db::execute($val);
Debug::remark("end");
$time = Debug::getRangeTime('begin', 'end', 4);
$r .= __('Query affected %s rows and took %s seconds', $count, $time) . "<br />";
}
}
echo $r;
}
}

View File

@ -0,0 +1,67 @@
<?php
namespace app\admin\controller\wechat;
use app\common\controller\Backend;
use app\common\model\WechatResponse;
/**
* 微信自动回复管理
*
* @icon fa fa-circle-o
*/
class Autoreply extends Backend
{
protected $model = null;
protected $noNeedRight = ['check_text_unique'];
public function _initialize()
{
parent::_initialize();
$this->model = model('WechatAutoreply');
}
/**
* 编辑
*/
public function edit($ids = NULL)
{
$row = $this->model->get(['id' => $ids]);
if (!$row)
$this->error(__('No Results were found'));
if ($this->request->isPost()) {
$params = $this->request->post("row/a");
if ($params) {
$row->save($params);
$this->success();
}
$this->error();
}
$response = WechatResponse::get(['eventkey' => $row['eventkey']]);
$this->view->assign("response", $response);
$this->view->assign("row", $row);
return $this->view->fetch();
}
/**
* 判断文本是否唯一
* @internal
*/
public function check_text_unique()
{
$row = $this->request->post("row/a");
$except = $this->request->post("except");
$text = isset($row['text']) ? $row['text'] : '';
if ($this->model->where('text', $text)->where(function ($query) use ($except) {
if ($except) {
$query->where('text', '<>', $except);
}
})->count() == 0) {
$this->success();
} else {
$this->error(__('Text already exists'));
}
}
}

View File

@ -0,0 +1,126 @@
<?php
namespace app\admin\controller\wechat;
use app\common\controller\Backend;
use think\Controller;
use think\Request;
/**
* 微信配置管理
*
* @icon fa fa-circle-o
*/
class Config extends Backend
{
protected $model = null;
public function _initialize()
{
parent::_initialize();
$this->model = model('WechatConfig');
}
/**
* 添加
*/
public function add()
{
if ($this->request->isPost()) {
$params = $this->request->post("row/a");
if ($params) {
foreach ($params as $k => &$v) {
$v = is_array($v) ? implode(',', $v) : $v;
}
if ($params['mode'] == 'json') {
//JSON字段
$fieldarr = $valuearr = [];
$field = $this->request->post('field/a');
$value = $this->request->post('value/a');
foreach ($field as $k => $v) {
if ($v != '') {
$fieldarr[] = $field[$k];
$valuearr[] = $value[$k];
}
}
$params['value'] = json_encode(array_combine($fieldarr, $valuearr), JSON_UNESCAPED_UNICODE);
}
unset($params['mode']);
try {
//是否采用模型验证
if ($this->modelValidate) {
$name = basename(str_replace('\\', '/', get_class($this->model)));
$validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : true) : $this->modelValidate;
$this->model->validate($validate);
}
$result = $this->model->save($params);
if ($result !== false) {
$this->success();
} else {
$this->error($this->model->getError());
}
} catch (\think\exception\PDOException $e) {
$this->error($e->getMessage());
}
}
$this->error(__('Parameter %s can not be empty', ''));
}
return $this->view->fetch();
}
/**
* 编辑
*/
public function edit($ids = NULL)
{
$row = $this->model->get($ids);
if (!$row)
$this->error(__('No Results were found'));
if ($this->request->isPost()) {
$params = $this->request->post("row/a");
if ($params) {
foreach ($params as $k => &$v) {
$v = is_array($v) ? implode(',', $v) : $v;
}
if ($params['mode'] == 'json') {
//JSON字段
$fieldarr = $valuearr = [];
$field = $this->request->post('field/a');
$value = $this->request->post('value/a');
foreach ($field as $k => $v) {
if ($v != '') {
$fieldarr[] = $field[$k];
$valuearr[] = $value[$k];
}
}
$params['value'] = json_encode(array_combine($fieldarr, $valuearr), JSON_UNESCAPED_UNICODE);
}
unset($params['mode']);
try {
//是否采用模型验证
if ($this->modelValidate) {
$name = basename(str_replace('\\', '/', get_class($this->model)));
$validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : true) : $this->modelValidate;
$row->validate($validate);
}
$result = $row->save($params);
if ($result !== false) {
$this->success();
} else {
$this->error($row->getError());
}
} catch (\think\exception\PDOException $e) {
$this->error($e->getMessage());
}
}
$this->error(__('Parameter %s can not be empty', ''));
}
$this->view->assign("row", $row);
$this->view->assign("value", (array)json_decode($row->value, true));
return $this->view->fetch();
}
}

View File

@ -0,0 +1,90 @@
<?php
namespace app\admin\controller\wechat;
use app\common\controller\Backend;
use app\common\model\WechatResponse;
use EasyWeChat\Foundation\Application;
use think\Exception;
/**
* 菜单管理
*
* @icon fa fa-list-alt
*/
class Menu extends Backend
{
protected $wechatcfg = NULL;
public function _initialize()
{
parent::_initialize();
$this->wechatcfg = \app\common\model\WechatConfig::get(['name' => 'menu']);
}
/**
* 查看
*/
public function index()
{
$responselist = array();
$all = WechatResponse::all();
foreach ($all as $k => $v) {
$responselist[$v['eventkey']] = $v['title'];
}
$this->view->assign('responselist', $responselist);
$this->view->assign('menu', (array)json_decode($this->wechatcfg->value, TRUE));
return $this->view->fetch();
}
/**
* 修改
*/
public function edit($ids = NULL)
{
$menu = $this->request->post("menu");
$menu = (array)json_decode($menu, TRUE);
$this->wechatcfg->value = json_encode($menu, JSON_UNESCAPED_UNICODE);
$this->wechatcfg->save();
$this->success();
}
/**
* 同步
*/
public function sync($ids = NULL)
{
$app = new Application(get_addon_config('wechat'));
try {
$hasError = false;
$menu = json_decode($this->wechatcfg->value, TRUE);
foreach ($menu as $k => $v) {
if (isset($v['sub_button'])) {
foreach ($v['sub_button'] as $m => $n) {
if (isset($n['key']) && !$n['key']) {
$hasError = true;
break 2;
}
}
} else if (isset($v['key']) && !$v['key']) {
$hasError = true;
break;
}
}
if (!$hasError) {
$ret = $app->menu->add($menu);
if ($ret->errcode == 0) {
$this->success();
} else {
$this->error($ret->errmsg);
}
} else {
$this->error(__('Invalid parameters'));
}
} catch (Exception $e) {
$this->error($e->getMessage());
}
}
}

View File

@ -0,0 +1,79 @@
<?php
namespace app\admin\controller\wechat;
use app\common\controller\Backend;
use addons\wechat\library\Wechat;
/**
* 资源管理
*
* @icon fa fa-list-alt
*/
class Response extends Backend
{
protected $model = null;
protected $searchFields = 'id,title';
public function _initialize()
{
parent::_initialize();
$this->model = model('WechatResponse');
}
/**
* 选择素材
*/
public function select()
{
return $this->view->fetch();
}
/**
* 添加
*/
public function add()
{
if ($this->request->isPost()) {
$params = $this->request->post("row/a");
$params['eventkey'] = isset($params['eventkey']) && $params['eventkey'] ? $params['eventkey'] : uniqid();
$params['content'] = json_encode($params['content']);
$params['createtime'] = time();
if ($params) {
$this->model->save($params);
$this->success();
$this->content = $params;
}
$this->error();
}
$appConfig = Wechat::appConfig();
$this->view->applist = $appConfig;
return $this->view->fetch();
}
/**
* 编辑
*/
public function edit($ids = NULL)
{
$row = $this->model->get($ids);
if (!$row)
$this->error(__('No Results were found'));
if ($this->request->isPost()) {
$params = $this->request->post("row/a");
$params['eventkey'] = isset($params['eventkey']) && $params['eventkey'] ? $params['eventkey'] : uniqid();
$params['content'] = json_encode($params['content']);
if ($params) {
$row->save($params);
$this->success();
}
$this->error();
}
$this->view->assign("row", $row);
$appConfig = Wechat::appConfig();
$this->view->applist = $appConfig;
return $this->view->fetch();
}
}

View File

@ -0,0 +1,22 @@
<?php
return [
'Title' => '任务标题',
'Url' => '链接',
'All' => '全部',
'My' => '个人',
'Please select a user' => '请选择管理员',
'New Dialog' => '弹窗',
'New Addtabs' => '新选项卡',
'Add to event' => '添加到备选事件',
'Add to calendar' => '添加到日历',
'Exist event' => '备选事件',
'Add event' => '添加事件',
'Remove after drop' => '添加后移除事件',
'Title tips' => '事件标题,不能为空',
'Link tips' => '链接地址,可以为空',
'Drag here to delete' => '挺拽到这里删除',
'Begintime' => '开始时间',
'Endtime' => '结束时间',
'Status' => '状态'
];

View File

@ -0,0 +1,48 @@
<?php
return [
'Channel' => '栏目',
'Channel_id' => '栏目ID',
'Channel_name' => '栏目名称',
'Channel list' => '栏目列表',
'Addon list' => '副表列表',
'Model' => '模型',
'Model_id' => '模型ID',
'User_id' => '发布会员',
'Title' => '文章标题',
'Flag' => '标志',
'Image' => '缩略图',
'Keywords' => '关键字',
'Description' => '描述',
'Tags' => 'TAG',
'Weigh' => '权重',
'Views' => '浏览',
'Comments' => '评论',
'Likes' => '点赞',
'Dislikes' => '点踩',
'Diyname' => '自定义URL',
'Createtime' => '创建时间',
'Updatetime' => '更新时间',
'Deletetime' => '删除时间',
'Recycle bin' => '回收站',
'Restore' => '还原',
'Restore all' => '还原全部',
'Destroy' => '销毁',
'Destroy all' => '清空回收站',
'Nothing need restore' => '没有需要还原的数据',
'Move tips' => '只能将数据移动到相同模型的栏目下,不同模型的数据移动将被忽略',
'Are you sure you want to truncate?' => '确认清空回收站?',
'Can not be digital' => '不能为数字',
'Please select channel' => '请选择分类',
'The data already exist' => '已经存在',
'Status' => '状态',
'Status normal' => '正常',
'Status hidden' => '隐藏',
'Status rejected' => '已拒绝',
'Status pulloff' => '已下线',
'Set to rejected' => '设为拒绝',
'Set to pulloff' => '设为下线',
'Array key' => '键',
'Array value' => '值',
'Publish' => '发布'
];

View File

@ -0,0 +1,13 @@
<?php
return [
'Type' => '类型',
'Name' => '名称',
'Title' => '标题',
'Image' => '图片',
'Url' => '链接',
'Content' => '内容',
'Createtime' => '添加时间',
'Updatetime' => '更新时间',
'Status' => '状态'
];

View File

@ -0,0 +1,30 @@
<?php
return [
'Type' => '类型',
'Model_id' => '模型ID',
'Model_name' => '模型名称',
'Parent_id' => '父ID',
'Parent_ids' => '父ID集合',
'Child_ids' => '子ID集合',
'Name' => '名称',
'Image' => '图片',
'Keywords' => '关键字',
'Description' => '描述',
'Diyname' => '自定义名称',
'Outlink' => '外部链接',
'Items' => '文章数量',
'Weigh' => '权重',
'Channeltpl' => '栏目页模板',
'Listtpl' => '列表页模板',
'Showtpl' => '详情页模板',
'Pagesize' => '分页大小',
'Createtime' => '创建时间',
'Updatetime' => '更新时间',
'The data already exist' => '已经存在',
'Iscontribute' => '是否允许投稿',
'Status' => '状态',
'Channel' => '栏目',
'List' => '列表',
'Link' => '外部链接'
];

View File

@ -0,0 +1,19 @@
<?php
return [
'Id' => 'ID',
'Type' => '类型',
'Archives' => '文档',
'Page' => '单页',
'Aid' => '关联ID',
'Pid' => '父ID',
'User_id' => '会员ID',
'Content' => '内容',
'Comments' => '评论数',
'Ip' => 'IP',
'Useragent' => 'User Agent',
'Subscribe' => '订阅',
'Createtime' => '创建时间',
'Updatetime' => '更新时间',
'Status' => '状态'
];

View File

@ -0,0 +1,8 @@
<?php
return [
'User_id' => '会员ID',
'Createtime' => '添加时间',
'Updatetime' => '更新时间',
'Status' => '状态'
];

View File

@ -0,0 +1,16 @@
<?php
return [
'Type' => '类型',
'Name' => '名称',
'Table' => '表名',
'Keywords' => '关键字',
'Description' => '描述',
'Successtips' => '成功提交提示文字',
'Diyname' => '自定义名称',
'Needlogin' => '是否需要登录',
'Formtpl' => '表单模板',
'Createtime' => '添加时间',
'Updatetime' => '更新时间',
'Status' => '状态'
];

View File

@ -0,0 +1,45 @@
<?php
return [
'Model_id' => '模型ID',
'Name' => '名称',
'Type' => '类型',
'Title' => '标题',
'Content' => '条目列表',
'Rule' => '验证规则',
'Validate Msg' => '错误消息',
'Validate Ok' => '成功消息',
'Validate Tip' => '提示消息',
'Extend' => '扩展信息',
'Weigh' => '排序',
'Setting' => '字段设置',
'Length' => '字段长度',
'Decimals' => '小数点长度',
'Minimum' => '最少选择',
'Maximum' => '最大选择',
'Defaultvalue' => '默认值',
'Iscontribute' => '是否可投稿',
'Isfilter' => '是否列表筛选',
'String' => '字符',
'Text' => '文本',
'Editor' => '编辑器',
'Number' => '数字',
'Date' => '日期',
'Time' => '时间',
'Datetime' => '日期时间',
'Image' => '图片',
'Images' => '图片(多)',
'File' => '文件',
'Files' => '文件(多)',
'Select' => '列表',
'Selects' => '列表(多选)',
'Switch' => '开关',
'Checkbox' => '复选',
'Radio' => '单选',
'Array' => '数组',
'Array key' => '键名',
'Array value' => '键值',
'Createtime' => '添加时间',
'Updatetime' => '更新时间',
'Status' => '状态'
];

View File

@ -0,0 +1,15 @@
<?php
return [
'Name' => '模型名称',
'Table' => '表名',
'Fields' => '字段列表',
'Channeltpl' => '栏目页模板',
'Listtpl' => '列表页模板',
'Showtpl' => '详情页模板',
'Main list' => '主表列表',
'Addon list' => '副表列表',
'Createtime' => '创建时间',
'Updatetime' => '更新时间',
'Setting' => '配置'
];

View File

@ -0,0 +1,22 @@
<?php
return [
'Id' => 'ID',
'Category_id' => '分类ID',
'Type' => '类型',
'Title' => '标题',
'Keywords' => '关键字',
'Description' => '描述',
'Flag' => '标志',
'Image' => '图片',
'Content' => '内容',
'Icon' => '图标',
'Views' => '点击',
'Comments' => '评论',
'Diyname' => '自定义',
'Showtpl' => '视图模板',
'Createtime' => '创建时间',
'Updatetime' => '更新时间',
'Weigh' => '权重',
'Status' => '状态'
];

View File

@ -0,0 +1,7 @@
<?php
return [
'Name' => '标签名称',
'Archives' => '文档ID集合',
'Nums' => '文档数量'
];

View File

@ -0,0 +1,16 @@
<?php
return [
'Id' => 'ID',
'Type' => '类型',
'Params' => '参数',
'Command' => '命令',
'Content' => '返回结果',
'Executetime' => '执行时间',
'Createtime' => '创建时间',
'Updatetime' => '更新时间',
'Execute again' => '再次执行',
'Successed' => '成功',
'Failured' => '失败',
'Status' => '状态'
];

View File

@ -0,0 +1,42 @@
<?php
return [
'Id' => 'ID',
'Name' => '租客名称',
'Contacts_ids' => '联系人',
'Certificate_number' => '证件号码',
'Industry_id' => '行业分类',
'Tel' => '电话',
'Email' => '邮箱',
'Invoice_bank' => '开户银行',
'Invoice_account' => '银行帐号',
'Invoice_tel' => '开票电话',
'Invoice_address' => '开票地址',
'Invoice_tax_number' => '
纳税人识别号',
'Unified_social_credit_code' => '统一社会信用代码',
'Tax_payer_id_number' => '纳税人识别号码',
'Registration_number' => '注册号',
'Organization_code' => '组织机构代码',
'Legal_person' => '法定代表人',
'Birth_country' => '国籍',
'Registered_capital' => '注册资本',
'Operating_state' => '经营状态',
'Founding_time' => '成立日期',
'Company_type' => '公司类型',
'Staff_size' => '人员规模',
'Business_term' => '营业期限',
'Registration_authority' => '登记机关',
'Approval_time' => '核准日期',
'English_name' => '英文名',
'District' => '所属地区',
'Industry' => '所属行业',
'Registered_address' => '
注册地址',
'Business_scope' => '经营范围',
'Tags' => '客户标签',
'Admin_id' => '创建者',
'Createtime' => '创建时间',
'Updatetime' => '更新时间',
'Weigh' => '排序'
];

View File

@ -0,0 +1,8 @@
<?php
return [
'Id' => 'ID',
'Name' => '标签名称',
'Tenant_ids' => '租客集合',
'Nums' => '租客数量'
];

View File

@ -0,0 +1,17 @@
<?php
return [
'name' => '名称',
'title' => '标题',
'type' => '分类',
'sort' => '排序',
'relative' => '文件位置',
'contributeurl' => '贡献URL',
'source' => 'MD源内容',
'preview' => '预览',
'order' => '排序',
'isnew' => '新标识',
'markdown file' => 'MD文件名称',
'refresh docs' => '刷新缓存',
'export html' => '导出HTML',
];

View File

@ -0,0 +1,17 @@
<?php
return [
'Title' => '任务标题',
'Maximums' => '最多执行',
'Sleep' => '延迟秒数',
'Schedule' => '执行周期',
'Executes' => '执行次数',
'No limit' => '无限制',
'Execute time' => '最后执行时间',
'Request Url' => '请求URL',
'Execute Sql Script' => '执行SQL',
'Execute Shell' => '执行Shell',
'Crontab format invalid' => 'Crontab格式错误',
'Next execute time' => '下次预计时间',
'The next %s times the execution time' => '接下来 %s 次的执行时间',
];

View File

@ -0,0 +1,43 @@
<?php
return [
'SQL Result' => '查询结果',
'Basic query' => '基础查询',
'View structure' => '查看表结构',
'View data' => '查看表数据',
'Backup and Restore' => '备份与还原',
'Backup now' => '立即备份',
'File' => '文件',
'Size' => '大小',
'Date' => '备份日期',
'Restore' => '还原',
'Delete' => '删除',
'Optimize' => '优化表',
'Repair' => '修复表',
'Optimize all' => '优化全部表',
'Repair all' => '修复全部表',
'Backup successful' => '备份成功',
'Restore successful' => '还原成功',
'Delete successful' => '删除成功',
'Can not open zip file' => '无法打开备份文件',
'Can not unzip file' => '无法解压备份文件',
'Sql file not found' => '未找到SQL文件',
'Table:%s' => '总计:%s个表',
'Record:%s' => '记录:%s条',
'Data:%s' => '占用:%s',
'Index:%s' => '索引:%s',
'SQL Result:' => '查询结果:',
'SQL can not be empty' => 'SQL语句不能为空',
'Max output:%s' => '最大返回%s条',
'Total:%s' => '共有%s条记录! ',
'Row:%s' => '记录:%s',
'Executes one or multiple queries which are concatenated by a semicolon' => '请输入SQL语句支持批量查询多条SQL以分号(;)分格',
'Query affected %s rows and took %s seconds' => '共影响%s条记录! 耗时:%s秒!',
'Query returned an empty result' => '返回结果为空!',
'Query took %s seconds' => '耗时%s秒!',
'Optimize table %s done' => '优化表[%s]成功',
'Repair table %s done' => '修复表[%s]成功',
'Optimize table %s fail' => '优化表[%s]失败',
'Repair table %s fail' => '修复表[%s]失败'
];

View File

@ -0,0 +1,47 @@
<?php
return [
'Id' => 'ID',
'Admin_id' => '管理员ID',
'Category_id' => '分类ID(单选)',
'Category_ids' => '分类ID(多选)',
'Week' => '星期(单选)',
'Week monday' => '星期一',
'Week tuesday' => '星期二',
'Week wednesday' => '星期三',
'Flag' => '标志(多选)',
'Flag hot' => '热门',
'Flag index' => '首页',
'Flag recommend' => '推荐',
'Genderdata' => '性别(单选)',
'Genderdata male' => '男',
'Genderdata female' => '女',
'Hobbydata' => '爱好(多选)',
'Hobbydata music' => '音乐',
'Hobbydata reading' => '读书',
'Hobbydata swimming' => '游泳',
'Title' => '标题',
'Content' => '内容',
'Image' => '图片',
'Images' => '图片组',
'Attachfile' => '附件',
'Keywords' => '关键字',
'Description' => '描述',
'City' => '省市',
'Price' => '价格',
'Views' => '点击',
'Startdate' => '开始日期',
'Activitytime' => '活动时间(datetime)',
'Year' => '年',
'Times' => '时间',
'Refreshtime' => '刷新时间(int)',
'Createtime' => '创建时间',
'Updatetime' => '更新时间',
'Weigh' => '权重',
'Switch' => '开关',
'Status' => '状态',
'State' => '状态值',
'State 0' => '禁用',
'State 1' => '正常',
'State 2' => '推荐',
];

View File

@ -0,0 +1,8 @@
<?php
return [
'Text' => '文本',
'Event key' => '响应标识',
'Remark' => '备注',
'Text already exists' => '文本已经存在',
];

View File

@ -0,0 +1,10 @@
<?php
return [
'name' => '配置名称',
'value' => '配置值',
'Json key' => '键',
'Json value' => '值',
'createtime' => '创建时间',
'updatetime' => '更新时间'
];

View File

@ -0,0 +1,8 @@
<?php
return [
'Resource title' => '资源标题',
'Event key' => '事件标识',
'Text' => '文本',
'App' => '应用',
];

View File

@ -0,0 +1,138 @@
<?php
namespace app\admin\model;
use app\admin\model\Channel;
use app\admin\model\Tags;
use app\common\model\Config;
use think\Model;
use traits\model\SoftDelete;
class Archives extends Model
{
use SoftDelete;
// 表名
protected $name = 'cms_archives';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'int';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
protected $deleteTime = 'deletetime';
// 追加属性
protected $append = [
'flag_text',
'status_text',
'publishtime_text',
'url',
];
public function getUrlAttr($value, $data)
{
$diyname = $data['diyname'] ? $data['diyname'] : $data['id'];
return addon_url('cms/archives/index', [':id' => $data['id'], ':diyname' => $diyname, ':channel' => $data['channel_id']]);
}
protected static function init()
{
self::afterInsert(function ($row) {
$pk = $row->getPk();
$channel = Channel::get($row['channel_id']);
$row->getQuery()->where($pk, $row[$pk])->update(['model_id' => $channel ? $channel['model_id'] : 0, 'weigh' => $row[$pk]]);
Channel::where('id', $row['channel_id'])->setInc('items');
});
self::beforeWrite(function ($row) {
//在更新之前对数组进行处理
foreach ($row->getData() as $k => $value) {
if (is_array($value) && isset($value['field'])) {
$value = json_encode(Config::getArrayData($value), JSON_UNESCAPED_UNICODE);
} else {
$value = is_array($value) ? implode(',', $value) : $value;
}
$row->$k = $value;
}
});
self::afterWrite(function ($row) {
if (isset($row['channel_id'])) {
//在更新成功后刷新副表、TAGS表数据、栏目表
$channel = Channel::get($row->channel_id);
if ($channel) {
$model = Modelx::get($channel['model_id']);
if ($model && isset($row['content'])) {
$values = array_intersect_key($row->getData(), array_flip($model->fields));
$values['id'] = $row['id'];
$values['content'] = $row['content'];
db($model['table'])->insert($values, TRUE);
}
}
}
if (isset($row['tags'])) {
$tags = array_filter(explode(',', $row['tags']));
if ($tags) {
$tagslist = Tags::where('name', 'in', $tags)->select();
foreach ($tagslist as $k => $v) {
$archives = explode(',', $v['archives']);
if (!in_array($row['id'], $archives)) {
$archives[] = $row['id'];
$v->archives = implode(',', $archives);
$v->nums++;
$v->save();
}
$tags = array_diff($tags, [$v['name']]);
}
$list = [];
foreach ($tags as $k => $v) {
$list[] = ['name' => $v, 'archives' => $row['id'], 'nums' => 1];
}
if ($list) {
(new Tags())->saveAll($list);
}
}
}
});
}
public function getFlagList()
{
return ['hot' => __('Hot'), 'new' => __('New'), 'recommend' => __('Recommend')];
}
public function getStatusList()
{
return ['normal' => __('Normal'), 'hidden' => __('Hidden'), 'rejected' => __('Status rejected'), 'pulloff' => __('Status pulloff')];
}
public function getFlagTextAttr($value, $data)
{
$value = $value ? $value : $data['flag'];
$valueArr = $value ? explode(',', $value) : [];
$list = $this->getFlagList();
return implode(',', array_intersect_key($list, array_flip($valueArr)));
}
public function getStatusTextAttr($value, $data)
{
$value = $value ? $value : $data['status'];
$list = $this->getStatusList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getPublishtimeTextAttr($value, $data)
{
$value = $value ? $value : $data['publishtime'];
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
protected function setPublishtimeAttr($value)
{
return $value && !is_numeric($value) ? strtotime($value) : $value;
}
public function channel()
{
return $this->belongsTo('Channel', 'channel_id', '', [], 'LEFT')->setEagerlyType(0);
}
}

View File

@ -0,0 +1,16 @@
<?php
namespace app\admin\model;
use think\Model;
class Area extends Model
{
// 开启自动写入时间戳字段
protected $autoWriteTimestamp = false;
// 定义时间戳字段名
protected $createTime = false;
protected $updateTime = false;
}

View File

@ -0,0 +1,34 @@
<?php
namespace app\admin\model;
use think\Model;
class Block extends Model
{
// 表名
protected $name = 'cms_block';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'int';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
// 追加属性
protected $append = [
'status_text'
];
public function getStatusList()
{
return ['normal' => __('Normal'), 'hidden' => __('Hidden')];
}
public function getStatusTextAttr($value, $data)
{
$value = $value ? $value : $data['status'];
$list = $this->getStatusList();
return isset($list[$value]) ? $list[$value] : '';
}
}

View File

@ -0,0 +1,74 @@
<?php
namespace app\admin\model;
use think\Model;
class Calendar extends Model
{
// 表名
protected $name = 'calendar';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'int';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
// 追加属性
protected $append = [
'starttime_text',
'endtime_text',
'status_text'
];
public function getStatuslist()
{
return ['normal' => __('Normal'), 'hidden' => __('Hidden'), 'expired' => __('Expired'), 'completed' => __('Completed')];
}
public function getStarttimeTextAttr($value, $data)
{
$value = $value ? $value : $data['starttime'];
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getEndtimeTextAttr($value, $data)
{
$value = $value ? $value : $data['endtime'];
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getStatusTextAttr($value, $data)
{
$value = $value ? $value : $data['status'];
$list = $this->getStatusList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getRenderAttr($value, $data)
{
$allDay = ($data['starttime'] === $data['endtime'] && date("H:i:s", $data['starttime']) == '00:00:00');
return [
'id' => $data['id'],
'title' => $data['title'],
'start' => date("c", $data['starttime']),
'end' => date("c", $data['endtime']),
'backgroundColor' => "{$data['background']}",
'borderColor' => "{$data['background']}",
'allDay' => $allDay,
'url' => $data['url'],
'className' => "{$data['classname']} fc-{$data['status']}" . (($allDay ? $data['endtime'] + 86400 : $data['endtime']) < time() ? ' fc-expired' : '')
];
}
protected function setStarttimeAttr($value)
{
return $value && !is_numeric($value) ? strtotime($value) : $value;
}
protected function setEndtimeAttr($value)
{
return $value && !is_numeric($value) ? strtotime($value) : $value;
}
}

View File

@ -0,0 +1,21 @@
<?php
namespace app\admin\model;
use think\Model;
class CalendarEvent extends Model
{
// 表名
protected $name = 'calendar_event';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'int';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
// 追加属性
protected $append = [
];
}

View File

@ -0,0 +1,97 @@
<?php
namespace app\admin\model;
use think\Model;
class Channel extends Model
{
// 表名
protected $name = 'cms_channel';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'int';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
// 追加属性
protected $append = [
'type_text',
'status_text',
'url'
];
public function getUrlAttr($value, $data)
{
$diyname = $data['diyname'] ? $data['diyname'] : $data['id'];
return isset($data['type']) && isset($data['outlink']) && $data['type'] == 'link' ? $data['outlink'] : addon_url('cms/channel/index', [':id' => $data['id'], ':diyname' => $diyname]);
}
protected static function init()
{
self::afterInsert(function ($row) {
//创建时自动添加权重值
$pk = $row->getPk();
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
});
self::afterDelete(function ($row) {
//删除时,删除子节点,同时将所有相关文档移入回收站
static $tree;
if (!$tree) {
$tree = \fast\Tree::instance();
$tree->init(collection(Channel::order('weigh desc,id desc')->field('id,parent_id,name,type,diyname,status')->select())->toArray(), 'parent_id');
}
$childIds = $tree->getChildrenIds($row['id']);
if ($childIds) {
Channel::destroy(function ($query) use ($childIds) {
$query->where('id', 'in', $childIds);
});
}
$childIds[] = $row['id'];
db('cms_archives')->where('channel_id', 'in', $childIds)->update(['deletetime' => time()]);
});
self::afterWrite(function ($row) {
$changed = $row->getChangedData();
//隐藏时判断是否有子节点,有则隐藏
if (isset($changed['status']) && $changed['status'] == 'hidden') {
static $tree;
if (!$tree) {
$tree = \fast\Tree::instance();
$tree->init(collection(Channel::order('weigh desc,id desc')->field('id,parent_id,name,type,diyname,status')->select())->toArray(), 'parent_id');
}
$childIds = $tree->getChildrenIds($row['id']);
db('cms_channel')->where('id', 'in', $childIds)->update(['status' => 'hidden']);
}
});
}
public static function getTypeList()
{
return ['channel' => __('Channel'), 'list' => __('List'), 'link' => __('Link')];
}
public static function getStatusList()
{
return ['normal' => __('Normal'), 'hidden' => __('Hidden')];
}
public function getTypeTextAttr($value, $data)
{
$value = $value ? $value : $data['type'];
$list = $this->getTypeList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getStatusTextAttr($value, $data)
{
$value = $value ? $value : $data['status'];
$list = $this->getStatusList();
return isset($list[$value]) ? $list[$value] : '';
}
public function model()
{
return $this->belongsTo('Modelx', 'model_id')->setEagerlyType(0);
}
}

View File

@ -0,0 +1,59 @@
<?php
namespace app\admin\model;
use think\Model;
class Command extends Model
{
// 表名
protected $name = 'command';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'int';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
// 追加属性
protected $append = [
'executetime_text',
'type_text',
'status_text'
];
public function getStatusList()
{
return ['successed' => __('Successed'), 'failured' => __('Failured')];
}
public function getExecutetimeTextAttr($value, $data)
{
$value = $value ? $value : $data['executetime'];
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getTypeTextAttr($value, $data)
{
$value = $value ? $value : $data['type'];
$list = ['crud' => '一键生成CRUD', 'menu' => '一键生成菜单', 'min' => '一键压缩打包', 'api' => '一键生成文档'];
return isset($list[$value]) ? $list[$value] : '';
}
public function getStatusTextAttr($value, $data)
{
$value = $value ? $value : $data['status'];
$list = $this->getStatusList();
return isset($list[$value]) ? $list[$value] : '';
}
protected function setExecutetimeAttr($value)
{
return $value && !is_numeric($value) ? strtotime($value) : $value;
}
}

View File

@ -0,0 +1,58 @@
<?php
namespace app\admin\model;
use think\Model;
class Comment extends Model
{
// 表名
protected $name = 'cms_comment';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'int';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
// 追加属性
protected $append = [
'type_text',
'status_text'
];
public function getTypeList()
{
return ['archives' => __('Archives'), 'page' => __('Page')];
}
public function getStatusList()
{
return ['normal' => __('Normal'), 'hidden' => __('Hidden')];
}
public function getTypeTextAttr($value, $data)
{
$value = $value ? $value : $data['type'];
$list = $this->getTypeList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getStatusTextAttr($value, $data)
{
$value = $value ? $value : $data['status'];
$list = $this->getStatusList();
return isset($list[$value]) ? $list[$value] : '';
}
public function archives()
{
return $this->belongsTo('Archives', 'aid', '', [], 'LEFT')->setEagerlyType(0);
}
}

View File

@ -0,0 +1,59 @@
<?php
namespace app\admin\model;
use think\Config;
use think\Model;
class Diyform extends Model
{
// 表名
protected $name = 'cms_diyform';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'int';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
// 追加属性
protected $append = [
'url'
];
public static function init()
{
self::afterInsert(function ($row) {
$prefix = Config::get('database.prefix');
$sql = "CREATE TABLE `{$prefix}{$row['table']}` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` int(10) DEFAULT NULL COMMENT '会员ID',
`createtime` int(10) DEFAULT NULL COMMENT '添加时间',
`updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='{$row['name']}'";
db()->query($sql);
});
}
public function getUrlAttr($value, $data)
{
$diyname = $data['diyname'] ? $data['diyname'] : $data['id'];
return addon_url('cms/diyform/index', [':id' => $data['id'], ':diyname' => $diyname]);
}
public function getFieldsAttr($value, $data)
{
return is_array($value) ? $value : ($value ? explode(',', $value) : []);
}
public function getStatusList()
{
return ['normal' => __('Normal'), 'hidden' => __('Hidden')];
}
public function getStatusTextAttr($value, $data)
{
$value = $value ? $value : $data['status'];
$list = $this->getStatusList();
return isset($list[$value]) ? $list[$value] : '';
}
}

View File

@ -0,0 +1,143 @@
<?php
namespace app\admin\model;
use addons\cms\library\Alter;
use app\admin\model\Modelx;
use app\admin\model\Diyform;
use app\common\model\Config;
use think\Exception;
use think\exception\PDOException;
use think\Model;
class Fields extends Model
{
// 表名
protected $name = 'cms_fields';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'int';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
// 追加属性
protected $append = [
'status_text',
'content_list',
];
protected static $listField = ['select', 'selects', 'checkbox', 'radio', 'array'];
public function setError($error)
{
$this->error = $error;
}
protected static function init()
{
$beforeUpdateCallback = function ($row) {
};
$afterInsertCallback = function ($row) {
//为了避免引起更新的事件回调这里采用直接执行SQL的写法
$row->query($row->fetchSql(true)->update(['id' => $row['id'], 'weigh' => $row['id']]));
$field = $row['model_id'] ? 'model_id' : 'diyform_id';
$model = $row['model_id'] ? Modelx::get($row[$field]) : Diyform::get($row[$field]);
if ($model) {
$sql = Alter::instance()
->setTable($model['table'])
->setName($row['name'])
->setLength($row['length'])
->setContent($row['content'])
->setDecimals($row['decimals'])
->setDefaultvalue($row['defaultvalue'])
->setComment($row['title'])
->setType($row['type'])
->getAddSql();
try {
db()->query($sql);
$fields = Fields::where($field, $model['id'])->field('name')->column('name');
$model->fields = implode(',', $fields);
$model->save();
} catch (PDOException $e) {
$row->getQuery()->where('id', $row->id)->delete();
throw new Exception($e->getMessage());
}
}
};
$afterUpdateCallback = function ($row) {
$field = $row['model_id'] ? 'model_id' : 'diyform_id';
$model = $row['model_id'] ? Modelx::get($row[$field]) : Diyform::get($row[$field]);
if ($model) {
$alter = Alter::instance();
if (isset($row['oldname']) && $row['oldname'] != $row['name']) {
$alter->setOldname($row['oldname']);
}
$sql = $alter
->setTable($model['table'])
->setName($row['name'])
->setLength($row['length'])
->setContent($row['content'])
->setDecimals($row['decimals'])
->setDefaultvalue($row['defaultvalue'])
->setComment($row['title'])
->setType($row['type'])
->getModifySql();
db()->query($sql);
$fields = Fields::where($field, $model['id'])->field('name')->column('name');
$model->fields = implode(',', $fields);
$model->save();
}
};
self::beforeInsert($beforeUpdateCallback);
self::beforeUpdate($beforeUpdateCallback);
self::afterInsert($afterInsertCallback);
self::afterUpdate($afterUpdateCallback);
self::afterDelete(function ($row) {
$field = $row['model_id'] ? 'model_id' : 'diyform_id';
$model = $row['model_id'] ? Modelx::get($row[$field]) : Diyform::get($row[$field]);
if ($model) {
$sql = Alter::instance()
->setTable($model['table'])
->setName($row['name'])
->getDropSql();
try {
db()->query($sql);
} catch (PDOException $e) {
}
}
});
}
public function getContentListAttr($value, $data)
{
return in_array($data['type'], self::$listField) ? Config::decode($data['content']) : $data['content'];
}
public function getStatusList()
{
return ['normal' => __('Normal'), 'hidden' => __('Hidden')];
}
public function getStatusTextAttr($value, $data)
{
$value = $value ? $value : $data['status'];
$list = $this->getStatusList();
return isset($list[$value]) ? $list[$value] : '';
}
public function model()
{
return $this->belongsTo('Modelx', 'model_id')->setEagerlyType(0);
}
public function diyform()
{
return $this->belongsTo('Diyform', 'diyform_id')->setEagerlyType(0);
}
}

View File

@ -0,0 +1,36 @@
<?php
namespace app\admin\model;
use think\Config;
use think\Model;
class Modelx extends Model
{
// 表名
protected $name = 'cms_model';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'int';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
// 追加属性
protected $append = [
];
public static function init()
{
self::afterInsert(function ($row) {
$prefix = Config::get('database.prefix');
$sql = "CREATE TABLE `{$prefix}{$row['table']}` (`id` int(10) NOT NULL,`content` longtext NOT NULL,PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='{$row['name']}'";
db()->query($sql);
});
}
public function getFieldsAttr($value, $data)
{
return is_array($value) ? $value : ($value ? explode(',', $value) : []);
}
}

View File

@ -0,0 +1,61 @@
<?php
namespace app\admin\model;
use think\Model;
class Page extends Model
{
// 表名
protected $name = 'cms_page';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'int';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
// 追加属性
protected $append = [
'flag_text',
'status_text',
'url'
];
protected static function init()
{
self::afterInsert(function ($row) {
$row->save(['weigh' => $row['id']]);
});
}
public function getUrlAttr($value, $data)
{
return addon_url('cms/page/index', [':diyname' => $data['diyname']]);
}
public function getStatusList()
{
return ['normal' => __('Normal'), 'hidden' => __('Hidden')];
}
public function getStatusTextAttr($value, $data)
{
$value = $value ? $value : $data['status'];
$list = $this->getStatusList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getFlagList()
{
return ['hot' => __('Hot'), 'index' => __('Index'), 'recommend' => __('Recommend')];
}
public function getFlagTextAttr($value, $data)
{
$value = $value ? $value : $data['flag'];
$valueArr = explode(',', $value);
$list = $this->getFlagList();
return implode(',', array_intersect_key($list, array_flip($valueArr)));
}
}

View File

@ -0,0 +1,27 @@
<?php
namespace app\admin\model;
use think\Model;
class Tags extends Model
{
// 表名
protected $name = 'cms_tags';
// 自动写入时间戳字段
protected $autoWriteTimestamp = false;
// 定义时间戳字段名
protected $createTime = false;
protected $updateTime = false;
// 追加属性
protected $append = [
'url'
];
public function getUrlAttr($value, $data)
{
return addon_url('cms/tags/index', [':name' => $data['name']]);
}
}

View File

@ -0,0 +1,143 @@
<?php
namespace app\admin\model;
use think\Model;
class Test extends Model
{
// 表名
protected $name = 'test';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'int';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
// 追加属性
protected $append = [
'week_text',
'flag_text',
'genderdata_text',
'hobbydata_text',
'refreshtime_text',
'status_text',
'state_text'
];
protected static function init()
{
self::afterInsert(function ($row) {
$pk = $row->getPk();
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
});
}
public function getWeekList()
{
return ['monday' => __('Week monday'), 'tuesday' => __('Week tuesday'), 'wednesday' => __('Week wednesday')];
}
public function getFlagList()
{
return ['hot' => __('Flag hot'), 'index' => __('Flag index'), 'recommend' => __('Flag recommend')];
}
public function getGenderdataList()
{
return ['male' => __('Genderdata male'), 'female' => __('Genderdata female')];
}
public function getHobbydataList()
{
return ['music' => __('Hobbydata music'), 'reading' => __('Hobbydata reading'), 'swimming' => __('Hobbydata swimming')];
}
public function getStatusList()
{
return ['normal' => __('Normal'), 'hidden' => __('Hidden')];
}
public function getStateList()
{
return ['0' => __('State 0'), '1' => __('State 1'), '2' => __('State 2')];
}
public function getWeekTextAttr($value, $data)
{
$value = $value ? $value : $data['week'];
$list = $this->getWeekList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getFlagTextAttr($value, $data)
{
$value = $value ? $value : $data['flag'];
$valueArr = explode(',', $value);
$list = $this->getFlagList();
return implode(',', array_intersect_key($list, array_flip($valueArr)));
}
public function getGenderdataTextAttr($value, $data)
{
$value = $value ? $value : $data['genderdata'];
$list = $this->getGenderdataList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getHobbydataTextAttr($value, $data)
{
$value = $value ? $value : $data['hobbydata'];
$valueArr = explode(',', $value);
$list = $this->getHobbydataList();
return implode(',', array_intersect_key($list, array_flip($valueArr)));
}
public function getRefreshtimeTextAttr($value, $data)
{
$value = $value ? $value : $data['refreshtime'];
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getStatusTextAttr($value, $data)
{
$value = $value ? $value : $data['status'];
$list = $this->getStatusList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getStateTextAttr($value, $data)
{
$value = $value ? $value : $data['state'];
$list = $this->getStateList();
return isset($list[$value]) ? $list[$value] : '';
}
protected function setFlagAttr($value)
{
return is_array($value) ? implode(',', $value) : $value;
}
protected function setHobbydataAttr($value)
{
return is_array($value) ? implode(',', $value) : $value;
}
protected function setRefreshtimeAttr($value)
{
return $value && !is_numeric($value) ? strtotime($value) : $value;
}
}

View File

@ -0,0 +1,27 @@
<?php
namespace app\admin\validate;
use think\Validate;
class Archives extends Validate
{
/**
* 验证规则
*/
protected $rule = [
];
/**
* 提示消息
*/
protected $message = [
];
/**
* 验证场景
*/
protected $scene = [
'add' => [],
'edit' => [],
];
}

View File

@ -0,0 +1,27 @@
<?php
namespace app\admin\validate;
use think\Validate;
class Block extends Validate
{
/**
* 验证规则
*/
protected $rule = [
];
/**
* 提示消息
*/
protected $message = [
];
/**
* 验证场景
*/
protected $scene = [
'add' => [],
'edit' => [],
];
}

View File

@ -0,0 +1,27 @@
<?php
namespace app\admin\validate;
use think\Validate;
class Channel extends Validate
{
/**
* 验证规则
*/
protected $rule = [
];
/**
* 提示消息
*/
protected $message = [
];
/**
* 验证场景
*/
protected $scene = [
'add' => [],
'edit' => [],
];
}

View File

@ -0,0 +1,27 @@
<?php
namespace app\admin\validate;
use think\Validate;
class Command extends Validate
{
/**
* 验证规则
*/
protected $rule = [
];
/**
* 提示消息
*/
protected $message = [
];
/**
* 验证场景
*/
protected $scene = [
'add' => [],
'edit' => [],
];
}

View File

@ -0,0 +1,27 @@
<?php
namespace app\admin\validate;
use think\Validate;
class Comment extends Validate
{
/**
* 验证规则
*/
protected $rule = [
];
/**
* 提示消息
*/
protected $message = [
];
/**
* 验证场景
*/
protected $scene = [
'add' => [],
'edit' => [],
];
}

View File

@ -0,0 +1,27 @@
<?php
namespace app\admin\validate;
use think\Validate;
class CrmTenant extends Validate
{
/**
* 验证规则
*/
protected $rule = [
];
/**
* 提示消息
*/
protected $message = [
];
/**
* 验证场景
*/
protected $scene = [
'add' => [],
'edit' => [],
];
}

View File

@ -0,0 +1,27 @@
<?php
namespace app\admin\validate;
use think\Validate;
class CrmTenantTags extends Validate
{
/**
* 验证规则
*/
protected $rule = [
];
/**
* 提示消息
*/
protected $message = [
];
/**
* 验证场景
*/
protected $scene = [
'add' => [],
'edit' => [],
];
}

View File

@ -0,0 +1,49 @@
<?php
namespace app\admin\validate;
use think\Validate;
class Fields extends Validate
{
/**
* 验证规则
*/
protected $rule = [
'name|名称' => 'require|unique:fields,model_id^name',
'title|管理员' => 'require',
'model_id|模型ID' => 'require|integer',
'status|状态' => 'require|in:normal,hidden',
];
/**
* 提示消息
*/
protected $message = [
];
/**
* 验证场景
*/
protected $scene = [
'add' => [
'name', 'title', 'model_id', 'status'
],
'edit' => [
'name', 'title', 'model_id', 'status'
],
];
public function __construct(array $rules = array(), $message = array(), $field = array())
{
//如果是编辑模式,则排除下主键
$ids = request()->param("ids");
if ($ids)
{
$this->rule['name|名称'] .= ",{$ids}";
}
parent::__construct($rules, $message, $field);
}
}

View File

@ -0,0 +1,27 @@
<?php
namespace app\admin\validate;
use think\Validate;
class Modelx extends Validate
{
/**
* 验证规则
*/
protected $rule = [
];
/**
* 提示消息
*/
protected $message = [
];
/**
* 验证场景
*/
protected $scene = [
'add' => [],
'edit' => [],
];
}

View File

@ -0,0 +1,27 @@
<?php
namespace app\admin\validate;
use think\Validate;
class Page extends Validate
{
/**
* 验证规则
*/
protected $rule = [
];
/**
* 提示消息
*/
protected $message = [
];
/**
* 验证场景
*/
protected $scene = [
'add' => [],
'edit' => [],
];
}

View File

@ -0,0 +1,27 @@
<?php
namespace app\admin\validate;
use think\Validate;
class Tags extends Validate
{
/**
* 验证规则
*/
protected $rule = [
];
/**
* 提示消息
*/
protected $message = [
];
/**
* 验证场景
*/
protected $scene = [
'add' => [],
'edit' => [],
];
}

View File

@ -0,0 +1,27 @@
<?php
namespace app\admin\validate;
use think\Validate;
class Test extends Validate
{
/**
* 验证规则
*/
protected $rule = [
];
/**
* 提示消息
*/
protected $message = [
];
/**
* 验证场景
*/
protected $scene = [
'add' => [],
'edit' => [],
];
}

View File

@ -0,0 +1,122 @@
<link rel="stylesheet" href="__CDN__/assets/libs/fullcalendar/dist/fullcalendar.css">
<style>
.fc-day.selected {
background:#e0f2be!important;
}
.fc-event.fc-completed {
text-decoration:line-through;
}
.fc-event.fc-expired {
background:#999!important;
border-color:#999!important;
}
.calendar-trash {
position:absolute;top:0;left:0;
display: inline-block;
width:100%;
height:52px;
text-align:center;
line-height:52px;
color: #e74c3c;
background-color: #f2dede;
display:none;
}
.fc .fc-toolbar .calendar-trash .fa{font-size: 20px;display:inline-block;vertical-align:middle;}
.fc .fc-toolbar .calendar-trash > * {float:none}
</style>
<section class="">
<div class="row">
<div class="col-md-3">
<div class="box box-solid">
<div class="box-header with-border">
<h4 class="box-title">{:__('Exist event')}</h4>
</div>
<div class="box-body">
<!-- the events -->
<div id="external-events">
{foreach $eventList as $k=>$v}
<div class="external-event" data-id="{$v.id}" data-title="{$v.title}" data-background="{$v.background}" style="background-color:{$v.background};color:#fff;">{$v.title}</div>
{/foreach}
<div class="checkbox">
<label for="drop-remove">
<input type="checkbox" id="drop-remove">
{:__('Remove after drop')}
</label>
</div>
</div>
</div>
<!-- /.box-body -->
</div>
<!-- /. box -->
<div class="box box-solid">
<div class="box-header with-border">
<h3 class="box-title">{:__('Add event')}</h3>
</div>
<div class="box-body">
<form id="add-form" action="calendar/addevent" role="form" method="post">
<div class="btn-group" style="width: 100%; margin-bottom: 10px;">
<input type="hidden" name="row[background]" value="#18bc9c" />
<ul class="fc-color-picker" id="color-chooser">
<li><a class="text-green" href="#"><i class="fa fa-square"></i></a></li>
<li><a class="text-aqua" href="#"><i class="fa fa-square"></i></a></li>
<li><a class="text-blue" href="#"><i class="fa fa-square"></i></a></li>
<li><a class="text-light-blue" href="#"><i class="fa fa-square"></i></a></li>
<li><a class="text-teal" href="#"><i class="fa fa-square"></i></a></li>
<li><a class="text-yellow" href="#"><i class="fa fa-square"></i></a></li>
<li><a class="text-orange" href="#"><i class="fa fa-square"></i></a></li>
<li><a class="text-red" href="#"><i class="fa fa-square"></i></a></li>
<li><a class="text-purple" href="#"><i class="fa fa-square"></i></a></li>
<li><a class="text-fuchsia" href="#"><i class="fa fa-square"></i></a></li>
<li><a class="text-muted" href="#"><i class="fa fa-square"></i></a></li>
<li><a class="text-navy" href="#"><i class="fa fa-square"></i></a></li>
</ul>
</div>
<div class="input-group" style="margin-bottom:10px;">
<span class="input-group-addon"><i class="fa fa-list-ol fa-fw"></i></span>
<input id="event-title" name="row[title]" data-rule="required" type="text" class="form-control" placeholder="{:__('Title tips')}">
</div>
<div class="input-group" style="margin-bottom:10px;">
<span class="input-group-addon"><i class="fa fa-link fa-fw"></i></span>
<input id="event-url" name="row[url]" class="form-control" type="text" placeholder="{:__('Link tips')}">
</div>
<div class="input-group" style="margin-bottom:10px;">
<span class="input-group-addon"><i class="fa fa-tags fa-fw"></i></span>
<select name="row[classname]" class="form-control" id="">
<option value="">{:__('None')}</option>
<option value="btn-dialog">{:__('New Dialog')}</option>
<option value="btn-addtabs">{:__('New Addtabs')}</option>
</select>
</div>
<div class="input-group" style="margin-bottom:10px;">
<label for="c-type-event"> <input id="c-type-event" name="type" value="event" type="radio" checked=""> {:__('Add to event')}</label> &nbsp;
<label for="c-type-calendar"> <input id="c-type-calendar" name="type" value="calendar" type="radio"> {:__('Add to calendar')}</label>
</div>
<div class="input-group" id="daterange" style="margin-bottom:10px;display:none;">
<span class="input-group-addon"><i class="fa fa-calendar fa-fw"></i></span>
<input id="c-starttime" style="margin-bottom:-1px;" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[starttime]" type="text" value="{:date('Y-m-d 00:00:00')}">
<input id="c-endtime" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD 00:00:00" data-use-current="true" name="row[endtime]" type="text" value="{:date('Y-m-d 00:00:00')}">
</div>
<div class="">
<button type="submit" class="btn btn-primary">{:__('Add')}</button>
<button type="reset" class="btn btn-default">{:__('Reset')}</button>
</div>
</form>
</div>
</div>
</div>
<!-- /.col -->
<div class="col-md-9">
<div class="box box-solid">
<div class="box-body no-padding">
<div id="calendar"></div>
</div>
<!-- /.box-body -->
</div>
<!-- /. box -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</section>

View File

@ -0,0 +1,198 @@
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<div class="row">
<div class="col-md-9 col-sm-12">
<div class="panel panel-default panel-intro">
<div class="panel-heading">
<ul class="nav nav-tabs">
<li class="active"><a href="#basic" data-toggle="tab">基础信息</a></li>
</ul>
</div>
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="basic">
<div class="form-group">
<label for="c-channel_id" class="control-label col-xs-12 col-sm-2">{:__('Channel_id')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-channel_id" data-rule="required" class="form-control selectpicker" data-live-search="true" name="row[channel_id]">
{$channelOptions}
</select>
</div>
</div>
<div class="form-group">
<label for="c-channel_id" class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input type="text" class="form-control selectpage" data-source="user/user/index" placeholder="发布会员,可为空" data-field="nickname" name="row[user_id]" />
</div>
</div>
<div class="form-group">
<label for="c-title" class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text" value="">
</div>
</div>
<div class="form-group">
<label for="c-image" class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<input id="c-image" class="form-control" size="50" name="row[image]" type="text" value="">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="plupload-image" class="btn btn-danger plupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
</div>
<span class="msg-box n-right" for="c-image"></span>
</div>
<ul class="row list-inline plupload-preview" id="p-image"></ul>
</div>
</div>
<div class="form-group">
<label for="c-tags" class="control-label col-xs-12 col-sm-2">{:__('Tags')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-tags" data-rule="" class="form-control selectpage" placeholder="请手动输入或选择标签" data-source="cms/tags/selectpage" data-primary-key="name" data-multiple="true" name="row[tags]" type="text" value="">
</div>
</div>
<div class="form-group">
<label for="c-diyname" class="control-label col-xs-12 col-sm-2">{:__('Diyname')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<div class="input-group-btn">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">{:addon_url('cms/archives/index', [':diyname'=>''])}</button>
</div>
<input type="text" id="c-diyname" data-rule="diyname" name="row[diyname]" class="form-control" placeholder="请输入自定义的名称,为空将使用主键ID" />
</div>
</div>
</div>
<div class="form-group">
<label for="c-content" class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
<div class="col-xs-12 col-sm-8">
<textarea id="c-content" data-rule="required" class="form-control editor" name="row[content]" rows="15" ></textarea>
</div>
</div>
<div class="form-group">
<label for="c-keywords" class="control-label col-xs-12 col-sm-2">{:__('Keywords')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-keywords" data-rule="" class="form-control" name="row[keywords]" type="text" value="">
</div>
</div>
<div class="form-group">
<label for="c-description" class="control-label col-xs-12 col-sm-2">{:__('Description')}:</label>
<div class="col-xs-12 col-sm-8">
<textarea id="c-description" cols="60" rows="5" data-rule="" class="form-control" name="row[description]"></textarea>
</div>
</div>
<div id="extend"></div>
</div>
</div>
<div class="form-group normal-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-3 col-sm-12">
<div class="panel panel-default panel-intro">
<div class="panel-heading">
<div class="panel-lead"><em>相关信息</em></div>
</div>
<div class="panel-body">
<div class="tab-content">
<div class="tab-pane fade active in">
<div class="form-group">
<label for="c-views" class="control-label col-xs-12 col-sm-3">{:__('Views')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group margin-bottom-sm">
<input id="c-views" data-rule="required" class="form-control" name="row[views]" placeholder="{:__('Views')}" type="number" value="0">
<span class="input-group-addon"><i class="fa fa-eye text-success"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label for="c-comments" class="control-label col-xs-12 col-sm-3">{:__('Comments')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group margin-bottom-sm">
<input id="c-comments" data-rule="required" class="form-control" name="row[comments]" placeholder="{:__('Comments')}" type="number" value="0">
<span class="input-group-addon"><i class="fa fa-comment text-info"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label for="c-likes" class="control-label col-xs-12 col-sm-3">{:__('Likes')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group margin-bottom-sm">
<input id="c-likes" data-rule="required" class="form-control" name="row[likes]" placeholder="{:__('Likes')}" type="number" value="0">
<span class="input-group-addon"><i class="fa fa-thumbs-up text-danger"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label for="c-dislikes" class="control-label col-xs-12 col-sm-3">{:__('Dislikes')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group margin-bottom-sm">
<input id="c-dislikes" data-rule="required" class="form-control" name="row[dislikes]" placeholder="{:__('Dislikes')}" type="number" value="0">
<span class="input-group-addon"><i class="fa fa-thumbs-down text-gray"></i></span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default panel-intro">
<div class="panel-heading">
<div class="panel-lead"><em>状态</em></div>
</div>
<div class="panel-body">
<div class="tab-content">
<div class="tab-pane fade active in">
<div class="form-group">
<label for="c-flag" class="control-label col-xs-12 col-sm-3">{:__('Flag')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-flag" class="form-control selectpicker" multiple="" name="row[flag][]">
{foreach name="flagList" item="vo"}
<option value="{$key}" {in name="key" value=""}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-3">{:__('Status')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-status" class="form-control selectpicker" name="row[status]">
{foreach name="statusList" item="vo"}
<option value="{$key}" {in name="key" value=""}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-3">{:__('Publish')}:</label>
<div class="col-xs-12 col-sm-8">
<div class='input-group date'>
<input type='text' name="row[publishtime]" data-date-format="YYYY-MM-DD 00:00:00" value="{:date('Y-m-d H:i:s')}" class="form-control datetimepicker" />
<span class="input-group-addon">
<span class="fa fa-calendar"></span>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</form>

View File

@ -0,0 +1,29 @@
<div class="panel panel-default panel-intro">
<div class="panel-heading">
{:build_heading(null,FALSE)}
<ul class="nav nav-tabs" data-field="main.model_id">
{foreach name="modelList" item="vo"}
<li class="{:$model['id']==$vo['id']?'active':''}"><a href="cms/archives/content/model_id/{$vo.id}" data-value="{$vo.id}">{$vo.name}</a></li>
{/foreach}
</ul>
</div>
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div id="toolbar" class="toolbar">
{:build_toolbar('refresh,edit,del')}
</div>
<table id="table" class="table table-striped table-bordered table-hover"
data-operate-edit="{:$auth->check('cms/model/edit')}"
data-operate-del="{:$auth->check('cms/model/del')}"
width="100%">
</table>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,207 @@
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<input type="hidden" value="{$row.id}" id="archive-id" />
<div class="row">
<div class="col-md-9 col-sm-12">
<div class="panel panel-default panel-intro">
<div class="panel-heading">
<ul class="nav nav-tabs">
<li class="active"><a href="#basic" data-toggle="tab">基础信息</a></li>
</ul>
</div>
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="basic">
<div class="form-group">
<label for="c-channel_id" class="control-label col-xs-12 col-sm-2">{:__('Channel_id')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-channel_id" data-rule="required" class="form-control selectpicker" data-live-search="true" name="row[channel_id]">
{$channelOptions}
</select>
</div>
</div>
<div class="form-group">
<label for="c-channel_id" class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input type="text" class="form-control selectpage" data-source="user/user/index" placeholder="发布会员,可为空" data-field="nickname" name="row[user_id]" value="{$row.user_id}" />
</div>
</div>
<div class="form-group">
<label for="c-title" class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text" value="{$row.title}">
</div>
</div>
<div class="form-group">
<label for="c-image" class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<input id="c-image" class="form-control" size="50" name="row[image]" type="text" value="{$row.image}">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="plupload-image" class="btn btn-danger plupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
</div>
<span class="msg-box n-right" for="c-image"></span>
</div>
<ul class="row list-inline plupload-preview" id="p-image"></ul>
</div>
</div>
<div class="form-group">
<label for="c-tags" class="control-label col-xs-12 col-sm-2">{:__('Tags')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-tags" data-rule="" class="form-control selectpage" placeholder="请手动输入或选择标签" data-source="cms/tags/selectpage" data-primary-key="name" data-multiple="true" name="row[tags]" type="text" value="{$row.tags}">
</div>
</div>
<div class="form-group">
<label for="c-diyname" class="control-label col-xs-12 col-sm-2">{:__('Diyname')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<div class="input-group-btn">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">{:addon_url('cms/archives/index', [':diyname'=>''])}</button>
</div>
<input type="text" id="c-diyname" data-rule="diyname" name="row[diyname]" class="form-control" placeholder="请输入自定义的名称,为空将使用主键ID" value="{$row.diyname}" />
</div>
</div>
</div>
<div class="form-group">
<label for="c-content" class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
<div class="col-xs-12 col-sm-8">
<textarea id="c-content" data-rule="required" class="form-control editor" name="row[content]" rows="15" >{$row.content}</textarea>
</div>
</div>
<div class="form-group">
<label for="c-keywords" class="control-label col-xs-12 col-sm-2">{:__('Keywords')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-keywords" data-rule="" class="form-control" name="row[keywords]" type="text" value="{$row.keywords}">
</div>
</div>
<div class="form-group">
<label for="c-description" class="control-label col-xs-12 col-sm-2">{:__('Description')}:</label>
<div class="col-xs-12 col-sm-8">
<textarea id="c-description" cols="60" rows="5" data-rule="" class="form-control" name="row[description]">{$row.description}</textarea>
</div>
</div>
<div id="extend"></div>
</div>
</div>
<div class="form-group normal-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-3 col-sm-12">
<div class="panel panel-default panel-intro">
<div class="panel-heading">
<div class="panel-lead"><em>相关信息</em></div>
</div>
<div class="panel-body">
<div class="tab-content">
<div class="tab-pane fade active in">
<div class="form-group">
<label for="c-views" class="control-label col-xs-12 col-sm-3">{:__('Views')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group margin-bottom-sm">
<input id="c-views" data-rule="required" class="form-control" name="row[views]" placeholder="{:__('Views')}" type="number" value="{$row.views}">
<span class="input-group-addon"><i class="fa fa-eye text-success"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label for="c-comments" class="control-label col-xs-12 col-sm-3">{:__('Comments')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group margin-bottom-sm">
<input id="c-comments" data-rule="required" class="form-control" name="row[comments]" placeholder="{:__('Comments')}" type="number" value="{$row.comments}">
<span class="input-group-addon"><i class="fa fa-comment text-info"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label for="c-likes" class="control-label col-xs-12 col-sm-3">{:__('Likes')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group margin-bottom-sm">
<input id="c-likes" data-rule="required" class="form-control" name="row[likes]" placeholder="{:__('Likes')}" type="number" value="{$row.likes}">
<span class="input-group-addon"><i class="fa fa-thumbs-up text-danger"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label for="c-dislikes" class="control-label col-xs-12 col-sm-3">{:__('Dislikes')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group margin-bottom-sm">
<input id="c-dislikes" data-rule="required" class="form-control" name="row[dislikes]" placeholder="{:__('Dislikes')}" type="number" value="{$row.dislikes}">
<span class="input-group-addon"><i class="fa fa-thumbs-down text-gray"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label for="c-weigh" class="control-label col-xs-12 col-sm-3">{:__('Weigh')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group margin-bottom-sm">
<input id="c-weigh" data-rule="required" class="form-control" name="row[weigh]" placeholder="{:__('Weigh')}" type="number" value="{$row.weigh}">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default panel-intro">
<div class="panel-heading">
<div class="panel-lead"><em>状态</em></div>
</div>
<div class="panel-body">
<div class="tab-content">
<div class="tab-pane fade active in">
<div class="form-group">
<label for="c-flag" class="control-label col-xs-12 col-sm-3">{:__('Flag')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-flag" class="form-control selectpicker" multiple="" name="row[flag][]">
{foreach name="flagList" item="vo"}
<option value="{$key}" {in name="key" value="$row.flag"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-3">{:__('Status')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-status" class="form-control selectpicker" name="row[status]">
{foreach name="statusList" item="vo"}
<option value="{$key}" {in name="key" value="$row.status"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-3">{:__('Publish')}:</label>
<div class="col-xs-12 col-sm-8">
<div class='input-group date datetimepicker'>
<input type='text' name="row[publishtime]" data-date-format="YYYY-MM-DD 00:00:00" value="{$row.publishtime_text}" class="form-control datetimepicker" />
<span class="input-group-addon">
<span class="fa fa-calendar"></span>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</form>

View File

@ -0,0 +1,102 @@
{foreach $fields as $item}
<div class="form-group">
<div class="control-label col-xs-12 col-sm-2">{$item.title}</div>
<div class="col-xs-12 col-sm-8">
{switch $item.type}
{case string}
<input type="text" name="row[{$item.name}]" id="c-{$item.name}" value="{$item.value}" class="form-control" data-rule="{$item.rule}" data-tip="{$item.tip}" {$item.extend} />
{/case}
{case value="text" break="0"}{/case}
{case editor}
<textarea name="row[{$item.name}]" id="c-{$item.name}" class="form-control {eq name='$item.type' value='editor'}editor{/eq}" data-rule="{$item.rule}" rows="5" data-tip="{$item.tip}" {$item.extend}>{$item.value}</textarea>
{/case}
{case array}
{php}$arrList=isset($values[$item['name']])?(array)json_decode($item['value'],true):$item['content_list'];{/php}
<dl class="fieldlist" rel="{$arrList|count}" data-name="row[{$item.name}]">
<dd>
<ins>{:__('Array key')}</ins>
<ins>{:__('Array value')}</ins>
</dd>
{foreach $arrList as $key => $vo}
<dd class="form-inline">
<input type="text" name="row[{$item.name}][field][{$key}]" class="form-control" value="{$key}" size="10" />
<input type="text" name="row[{$item.name}][value][{$key}]" class="form-control" value="{$vo}" size="40" />
<span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
<span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
</dd>
{/foreach}
<dd><a href="javascript:;" class="append btn btn-sm btn-success"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
</dl>
{/case}
{case date}
<input type="text" name="row[{$item.name}]" id="c-{$item.name}" value="{$item.value}" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-tip="{$item.tip}" data-rule="{$item.rule}" {$item.extend} />
{/case}
{case time}
<input type="text" name="row[{$item.name}]" id="c-{$item.name}" value="{$item.value}" class="form-control datetimepicker" data-date-format="HH:mm:ss" data-tip="{$item.tip}" data-rule="{$item.rule}" {$item.extend} />
{/case}
{case datetime}
<input type="text" name="row[{$item.name}]" id="c-{$item.name}" value="{$item.value}" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-tip="{$item.tip}" data-rule="{$item.rule}" {$item.extend} />
{/case}
{case number}
<input type="number" name="row[{$item.name}]" id="c-{$item.name}" value="{$item.value}" class="form-control" data-tip="{$item.tip}" data-rule="{$item.rule}" {$item.extend} />
{/case}
{case checkbox}
{foreach name="item.content_list" item="vo"}
<label for="row[{$item.name}][]-{$key}"><input id="row[{$item.name}][]-{$key}" name="row[{$item.name}][]" type="checkbox" value="{$key}" data-rule="{$item.rule}" data-tip="{$item.tip}" {in name="key" value="$item.value"}checked{/in} /> {$vo}</label>
{/foreach}
{/case}
{case radio}
{foreach name="item.content_list" item="vo"}
<label for="row[{$item.name}]-{$key}"><input id="row[{$item.name}]-{$key}" name="row[{$item.name}]" type="radio" value="{$key}" data-rule="{$item.rule}" data-tip="{$item.tip}" {in name="key" value="$item.value"}checked{/in} /> {$vo}</label>
{/foreach}
{/case}
{case value="select" break="0"}{/case}
{case value="selects"}
<select name="row[{$item.name}]{$item.type=='selects'?'[]':''}" class="form-control selectpicker" data-rule="{$item.rule}" data-tip="{$item.tip}" {$item.extend} {$item.type=='selects'?'multiple':''}>
{foreach name="item.content_list" item="vo"}
<option value="{$key}" {in name="key" value="$item.value"}selected{/in}>{$vo}</option>
{/foreach}
</select>
{/case}
{case value="image" break="0"}{/case}
{case value="images"}
<div class="input-group">
<input id="c-{$item.name}" class="form-control" name="row[{$item.name}]" type="text" value="{$item.value}" data-rule="{$item.rule}" data-tip="{$item.tip}">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="plupload-{$item.name}" class="btn btn-danger plupload" data-input-id="c-{$item.name}" data-preview-id="p-{$item.name}" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="{$item.type=='file'?'false':'true'}" {if $item.maximum}data-maxcount="{$item.maximum}"{/if}><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-{$item.name}" class="btn btn-primary fachoose" data-input-id="c-{$item.name}" data-preview-id="p-{$item.name}" data-mimetype="image/*" data-multiple="{$item.type=='file'?'false':'true'}" {if $item.maximum}data-maxcount="{$item.maximum}"{/if}><i class="fa fa-list"></i> {:__('Choose')}</button></span>
</div>
<span class="msg-box n-right" for="c-{$item.name}"></span>
</div>
<ul class="row list-inline plupload-preview" id="p-{$item.name}"></ul>
{/case}
{case value="file" break="0"}{/case}
{case value="files"}
<div class="input-group">
<input id="c-{$item.name}" class="form-control" name="row[{$item.name}]" type="text" value="{$item.value}" data-rule="{$item.rule}" data-tip="{$item.tip}">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="plupload-{$item.name}" class="btn btn-danger plupload" data-input-id="c-{$item.name}" data-multiple="{$item.type=='file'?'false':'true'}" {if $item.maximum}data-maxcount="{$item.maximum}"{/if}><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-{$item.name}" class="btn btn-primary fachoose" data-input-id="c-{$item.name}" data-multiple="{$item.type=='file'?'false':'true'}" {if $item.maximum}data-maxcount="{$item.maximum}"{/if}><i class="fa fa-list"></i> {:__('Choose')}</button></span>
</div>
<span class="msg-box n-right" for="c-{$item.name}"></span>
</div>
{/case}
{case switch}
<input id="c-{$item.name}" name="row[{$item.name}]" type="hidden" value="{:$item.value?1:0}">
<a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-{$item.name}" data-yes="1" data-no="0" >
<i class="fa fa-toggle-on text-success {if !$item.value}fa-flip-horizontal text-gray{/if} fa-2x"></i>
</a>
{/case}
{case bool}
<label for="row[{$item.name}]-yes"><input id="row[{$item.name}]-yes" name="row[{$item.name}]" type="radio" value="1" {$item.value?'checked':''} data-tip="{$item.tip}" /> {:__('Yes')}</label>
<label for="row[{$item.name}]-no"><input id="row[{$item.name}]-no" name="row[{$item.name}]" type="radio" value="0" {$item.value?'':'checked'} data-tip="{$item.tip}" /> {:__('No')}</label>
{/case}
{case custom}
{$item.content}
{/case}
{/switch}
</div>
</div>
{/foreach}

View File

@ -0,0 +1,93 @@
<style>
.form-commonsearch .form-group{
margin-left:0;margin-right:0;padding:0;
}
form.form-commonsearch .control-label {
padding-right:0;
}
.tdtitle {
margin-bottom:5px;
font-weight: 600;
}
</style>
<div class="row">
<div class="col-md-3 hidden-xs hidden-sm" id="channelbar" style="padding-right:0;">
<div class="panel panel-default panel-intro">
<div class="panel-heading">
<div class="panel-lead">
<em>{:__('Channel list')}</em>
</div>
</div>
<div class="panel-body">
<span class="text-muted"><input type="checkbox" name="" id="checkall" /> <label for="checkall"><small>{:__('Check all')}</small></label></span>
<span class="text-muted"><input type="checkbox" name="" id="expandall" checked="" /> <label for="expandall"><small>{:__('Expand all')}</small></label></span>
<div id="channeltree">
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-md-9" id="archivespanel">
<div class="panel panel-default panel-intro" style="background: #f1f4f6;padding-top: 0;padding-bottom: 0;box-shadow: none;">
{:build_heading()}
<div id="myTabContent" class="tab-content" style="background:#fff;padding:15px;">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div id="toolbar" class="toolbar">
{:build_toolbar('refresh,add,del',['add'=>[url('cms.archives/add'), 'btn btn-success btn-addtabs', 'fa fa-plus', __('Add'), __('Add')]])}
<a class="btn btn-info btn-move dropdown-toggle btn-disabled disabled"><i class="fa fa-arrow-right"></i> {:__('Move')}</a>
<div class="dropdown btn-group {:$auth->check('cms/archives/multi')?'':'hide'}">
<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
<ul class="dropdown-menu text-left" role="menu">
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=rejected"><i class="fa fa-exclamation-circle"></i> {:__('Set to rejected')}</a></li>
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=pulloff"><i class="fa fa-arrow-circle-down"></i> {:__('Set to pulloff')}</a></li>
</ul>
</div>
<a class="btn btn-success btn-recyclebin btn-dialog" href="cms/archives/recyclebin" title="{:__('Recycle bin')}"><i class="fa fa-recycle"></i> {:__('Recycle bin')}</a>
<div class="dropdown btn-group {:$auth->check('cms/archives/content')?'':'hide'}">
<a href="javascript:;" class="btn btn-info dropdown-toggle" title="{:__('Addon list')}" data-toggle="dropdown"><i class="fa fa-file"></i> {:__('Addon list')}</a>
<ul class="dropdown-menu text-left" role="menu">
{volist name="modelList" id="item"}
<li><a class="btn btn-link btn-addtabs" href="{:url('cms.archives/content')}/model_id/{$item.id}" title="{$item.name}"><i class="fa fa-file"></i> {$item.name}</a></li>
{/volist}
</ul>
</div>
<a href="javascript:;" class="btn btn-default btn-channel hidden-xs hidden-sm"><i class="fa fa-bars"></i></a>
</div>
<table id="table" class="table table-striped table-bordered table-hover"
data-operate-edit="{:$auth->check('cms/archives/edit')}"
data-operate-del="{:$auth->check('cms/archives/del')}"
width="100%">
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<script id="channeltpl" type="text/html">
<div class="box box-solid bg-red-gradient">
<div class="box-header ui-sortable-handle" style="cursor: move;">
{:__('Warning')}
</div>
<!-- /.box-header -->
<div class="box-body">
{:__('Move tips')}
</div>
<!-- /.box-body -->
<div class="box-footer text-black">
<div class="row">
<div class="col-sm-12">
<select name="channel" class="form-control" id="">
<option value="0">{:__('Please select channel')}</option>
{$channelOptions}
</select>
</div>
</div>
<!-- /.row -->
</div>
</div>
</script>

View File

@ -0,0 +1,23 @@
<div class="panel panel-default panel-intro">
{:build_heading()}
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div id="toolbar" class="toolbar">
{:build_toolbar('refresh')}
<a class="btn btn-info btn-multi btn-disabled disabled" href="javascript:;" data-url="{:url('cms.archives/restore')}" data-action="restore"><i class="fa fa-rotate-left"></i> {:__('Restore')}</a>
<a class="btn btn-danger btn-multi btn-disabled disabled" href="javascript:;" data-url="{:url('cms.archives/destroy')}" data-action="destroy"><i class="fa fa-times"></i> {:__('Destroy')}</a>
<a class="btn btn-success btn-restoreall" href="{:url('cms.archives/restore')}" title="{:__('Restore all')}"><i class="fa fa-rotate-left"></i> {:__('Restore all')}</a>
<a class="btn btn-danger btn-destroyall" href="{:url('cms.archives/destroy')}" title="{:__('Destroy all')}"><i class="fa fa-times"></i> {:__('Destroy all')}</a>
</div>
<table id="table" class="table table-striped table-bordered table-hover"
width="100%">
</table>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,66 @@
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<div class="form-group">
<label for="c-type" class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-type" data-rule="required" class="form-control selectpage" data-source="cms/block/selectpage_type" placeholder="请手动输入或选择类型" data-primary-key="type" data-field="type" name="row[type]" type="text" value="">
</div>
</div>
<div class="form-group">
<label for="c-name" class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text">
</div>
</div>
<div class="form-group">
<label for="c-title" class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text">
</div>
</div>
<div class="form-group">
<label for="c-image" class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<input id="c-image" data-rule="" class="form-control" size="50" name="row[image]" type="text" value="">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="plupload-image" class="btn btn-danger plupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
</div>
<span class="msg-box n-right" for="c-image"></span>
</div>
<ul class="row list-inline plupload-preview" id="p-image"></ul>
</div>
</div>
<div class="form-group">
<label for="c-url" class="control-label col-xs-12 col-sm-2">{:__('Url')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-url" data-rule="" class="form-control" name="row[url]" type="text" value="">
</div>
</div>
<div class="form-group">
<label for="c-content" class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
<div class="col-xs-12 col-sm-8">
<textarea id="c-content" data-rule="" class="form-control editor" rows="15" name="row[content]" cols="50"></textarea>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
{foreach name="statusList" item="vo"}
<label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="normal"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>

View File

@ -0,0 +1,66 @@
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<div class="form-group">
<label for="c-type" class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-type" data-rule="required" class="form-control selectpage" data-source="cms/block/selectpage_type" placeholder="请手动输入或选择类型" data-primary-key="type" data-field="type" name="row[type]" type="text" value="{$row.type}">
</div>
</div>
<div class="form-group">
<label for="c-name" class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name}">
</div>
</div>
<div class="form-group">
<label for="c-title" class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text" value="{$row.title}">
</div>
</div>
<div class="form-group">
<label for="c-image" class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<input id="c-image" data-rule="" class="form-control" size="50" name="row[image]" type="text" value="{$row.image}">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="plupload-image" class="btn btn-danger plupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
</div>
<span class="msg-box n-right" for="c-image"></span>
</div>
<ul class="row list-inline plupload-preview" id="p-image"></ul>
</div>
</div>
<div class="form-group">
<label for="c-url" class="control-label col-xs-12 col-sm-2">{:__('Url')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-url" data-rule="" class="form-control" name="row[url]" type="text" value="{$row.url}">
</div>
</div>
<div class="form-group">
<label for="c-content" class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
<div class="col-xs-12 col-sm-8">
<textarea id="c-content" data-rule="" class="form-control editor" rows="15" name="row[content]" cols="50">{$row.content}</textarea>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
{foreach name="statusList" item="vo"}
<label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>

View File

@ -0,0 +1,28 @@
<div class="panel panel-default panel-intro">
{:build_heading()}
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div id="toolbar" class="toolbar">
{:build_toolbar('refresh,add,edit,del')}
<div class="dropdown btn-group {:$auth->check('cms/block/multi')?'':'hide'}">
<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
<ul class="dropdown-menu text-left" role="menu">
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
</ul>
</div>
</div>
<table id="table" class="table table-striped table-bordered table-hover"
data-operate-edit="{:$auth->check('cms/block/edit')}"
data-operate-del="{:$auth->check('cms/block/del')}"
width="100%">
</table>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,130 @@
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<div class="form-group">
<label for="c-type" class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
{foreach name="typeList" item="vo"}
<label for="row[type]-{$key}"><input id="row[type]-{$key}" name="row[type]" type="radio" value="{$key}" {in name="key" value="channel"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
<div class="margin" style="margin-left:0;">
<div class="alert alert-dismissable bg-info">
<button type="button" class="close" data-dismiss="alert">×</button>
<strong>栏目</strong>: 栏目类型下不可以发布文章,但可以添加子栏目、列表、链接<br>
<strong>列表</strong>: 列表类型下可以发布文章,但不能添加子栏目<br>
<strong>链接</strong>: 链接类型下不可以发布文章和子级栏目<br>
</div>
</div>
</div>
</div>
<div class="form-group tf tf-list tf-channel">
<label for="c-model_id" class="control-label col-xs-12 col-sm-2">{:__('Model_id')}:</label>
<div class="col-xs-12 col-sm-8">
<select name="row[model_id]" id="c-model_id" class="form-control">
{foreach name="modelList" item="vo"}
<option value="{$vo.id}" data-channeltpl="{$vo.channeltpl}" data-listtpl="{$vo.listtpl}" data-showtpl="{$vo.showtpl}">{$vo.name}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label for="parent_id" class="control-label col-xs-12 col-sm-2">{:__('上级栏目')}:</label>
<div class="col-xs-12 col-sm-8">
<select name="row[parent_id]" data-rule="required" id="parent_id" class="form-control">
<option value="0">{:__('None')}</option>
{foreach name="channelList" item="vo"}
<option value="{$vo.id}" {if $vo.type=='link'}disabled{else /}data-model="{$vo.model_id}"{/if}>{$vo.name}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label for="c-name" class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
<div class="col-xs-12 col-sm-8">
<textarea id="c-name" data-rule="required; channelname" class="form-control" name="row[name]" data-toggle="tooltip" title="如果需要多个一次录入多个分类时请换行输入,录入多个时将忽略自定义名称,批量录入格式:分类名称|自定义名称"></textarea>
</div>
</div>
<div class="form-group">
<label for="c-image" class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<input id="c-image" data-rule="" class="form-control" size="50" name="row[image]" type="text">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="plupload-image" class="btn btn-danger plupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
</div>
<span class="msg-box n-right" for="c-image"></span>
</div>
<ul class="row list-inline plupload-preview" id="p-image"></ul>
</div>
</div>
<div class="form-group tf tf-channel tf tf-list">
<label for="c-keywords" class="control-label col-xs-12 col-sm-2">{:__('Keywords')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-keywords" data-rule="" class="form-control" name="row[keywords]" type="text">
</div>
</div>
<div class="form-group tf tf-channel tf tf-list">
<label for="c-description" class="control-label col-xs-12 col-sm-2">{:__('Description')}:</label>
<div class="col-xs-12 col-sm-8">
<textarea id="c-description" data-rule="" class="form-control" name="row[description]"></textarea>
</div>
</div>
<div class="form-group">
<label for="c-diyname" class="control-label col-xs-12 col-sm-2">{:__('Diyname')}:</label>
<div class="col-xs-12 col-sm-4">
<input id="c-diyname" data-rule="required(single); diyname" class="form-control" name="row[diyname]" type="text">
</div>
</div>
<div class="form-group tf tf-link">
<label for="c-outlink" class="control-label col-xs-12 col-sm-2">{:__('Outlink')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-outlink" data-rule="required" class="form-control" name="row[outlink]" type="text">
</div>
</div>
<div class="form-group tf tf-channel">
<label for="c-channeltpl" class="control-label col-xs-12 col-sm-2">{:__('Channeltpl')}:</label>
<div class="col-xs-12 col-sm-4">
<input id="c-channeltpl" data-rule="required" class="form-control selectpage" name="row[channeltpl]" data-source="cms/ajax/get_template_list" data-primary-key="name" data-field="name" type="text">
</div>
</div>
<div class="form-group tf tf-list">
<label for="c-listtpl" class="control-label col-xs-12 col-sm-2">{:__('Listtpl')}:</label>
<div class="col-xs-12 col-sm-4">
<input id="c-listtpl" data-rule="required" class="form-control selectpage" name="row[listtpl]" data-source="cms/ajax/get_template_list" data-primary-key="name" data-field="name" type="text">
</div>
</div>
<div class="form-group tf tf-list">
<label for="c-showtpl" class="control-label col-xs-12 col-sm-2">{:__('Showtpl')}:</label>
<div class="col-xs-12 col-sm-4">
<input id="c-showtpl" data-rule="required" class="form-control selectpage" name="row[showtpl]" data-source="cms/ajax/get_template_list" data-primary-key="name" data-field="name" type="text">
</div>
</div>
<div class="form-group tf tf-list">
<label for="c-pagesize" class="control-label col-xs-12 col-sm-2">{:__('Pagesize')}:</label>
<div class="col-xs-12 col-sm-4">
<input id="c-pagesize" data-rule="required" class="form-control" name="row[pagesize]" type="number" value="10">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
{foreach name="statusList" item="vo"}
<label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="normal"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>

View File

@ -0,0 +1,136 @@
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<input type="hidden" value="{$row.id}" id="channel-id" />
<div class="form-group">
<label for="c-type" class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
{foreach name="typeList" item="vo"}
<label for="row[type]-{$key}"><input id="row[type]-{$key}" name="row[type]" disabled type="radio" value="{$key}" {in name="key" value="$row.type"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
<div class="margin" style="margin-left:0;">
<div class="alert alert-dismissable bg-info">
<button type="button" class="close" data-dismiss="alert">×</button>
<strong>栏目</strong>: 栏目类型下不可以发布文章,但可以添加子栏目、列表、链接<br>
<strong>列表</strong>: 列表类型下可以发布文章,但不能添加子栏目<br>
<strong>链接</strong>: 链接类型下不可以发布文章和子级栏目<br>
</div>
</div>
</div>
</div>
<div class="form-group tf tf-list tf-channel">
<label for="c-model_id" class="control-label col-xs-12 col-sm-2">{:__('Model_id')}:</label>
<div class="col-xs-12 col-sm-8">
<select name="row[model_id]" id="c-model_id" class="form-control " disabled>
{foreach name="modelList" item="vo"}
<option {in name="vo.id" value="$row.model_id"}selected="selected"{/in} value="{$vo.id}" data-channeltpl="{$vo.channeltpl}" data-listtpl="{$vo.listtpl}" data-showtpl="{$vo.showtpl}">{$vo.name}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label for="parent_id" class="control-label col-xs-12 col-sm-2">{:__('上级栏目')}:</label>
<div class="col-xs-12 col-sm-8">
<select name="row[parent_id]" data-rule="required" id="parent_id" class="form-control">
<option value="0">{:__('None')}</option>
{foreach name="channelList" item="vo"}
<option value="{$vo.id}" {if $vo.type!=='link'}data-model="{$vo.model_id}"{/if} {if $vo.type=='link' || $vo.id==$row.id || $vo.model_id!=$row.model_id}disabled{/if} {if $vo.id==$row.parent_id}selected{/if}>{$vo.name}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label for="c-name" class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
<div class="col-xs-12 col-sm-4">
<input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name}" />
</div>
</div>
<div class="form-group">
<label for="c-image" class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<input id="c-image" data-rule="" class="form-control" size="50" name="row[image]" type="text" value="{$row.image}">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="plupload-image" class="btn btn-danger plupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
</div>
<span class="msg-box n-right" for="c-image"></span>
</div>
<ul class="row list-inline plupload-preview" id="p-image"></ul>
</div>
</div>
<div class="form-group tf tf-channel tf tf-list">
<label for="c-keywords" class="control-label col-xs-12 col-sm-2">{:__('Keywords')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-keywords" data-rule="" class="form-control" name="row[keywords]" type="text" value="{$row.keywords}">
</div>
</div>
<div class="form-group tf tf-channel tf tf-list">
<label for="c-description" class="control-label col-xs-12 col-sm-2">{:__('Description')}:</label>
<div class="col-xs-12 col-sm-8">
<textarea id="c-description" data-rule="" class="form-control" name="row[description]">{$row.description}</textarea>
</div>
</div>
<div class="form-group">
<label for="c-diyname" class="control-label col-xs-12 col-sm-2">{:__('Diyname')}:</label>
<div class="col-xs-12 col-sm-4">
<input id="c-diyname" data-rule="required; diyname" class="form-control" name="row[diyname]" type="text" value="{$row.diyname}">
</div>
</div>
<div class="form-group tf tf-link">
<label for="c-outlink" class="control-label col-xs-12 col-sm-2">{:__('Outlink')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-outlink" data-rule="required" class="form-control" name="row[outlink]" type="text" value="{$row.outlink}">
</div>
</div>
<div class="form-group tf tf-channel">
<label for="c-channeltpl" class="control-label col-xs-12 col-sm-2">{:__('Channeltpl')}:</label>
<div class="col-xs-12 col-sm-4">
<input id="c-channeltpl" data-rule="required" class="form-control selectpage" name="row[channeltpl]" data-source="cms/ajax/get_template_list" data-primary-key="name" data-field="name" type="text" value="{$row.channeltpl}">
</div>
</div>
<div class="form-group tf tf-list">
<label for="c-listtpl" class="control-label col-xs-12 col-sm-2">{:__('Listtpl')}:</label>
<div class="col-xs-12 col-sm-4">
<input id="c-listtpl" data-rule="required" class="form-control selectpage" name="row[listtpl]" data-source="cms/ajax/get_template_list" data-primary-key="name" data-field="name" type="text" value="{$row.listtpl}">
</div>
</div>
<div class="form-group tf tf-list">
<label for="c-showtpl" class="control-label col-xs-12 col-sm-2">{:__('Showtpl')}:</label>
<div class="col-xs-12 col-sm-4">
<input id="c-showtpl" data-rule="required" class="form-control selectpage" name="row[showtpl]" data-source="cms/ajax/get_template_list" data-primary-key="name" data-field="name" type="text" value="{$row.showtpl}">
</div>
</div>
<div class="form-group tf tf-list">
<label for="c-pagesize" class="control-label col-xs-12 col-sm-2">{:__('Pagesize')}:</label>
<div class="col-xs-12 col-sm-4">
<input id="c-pagesize" data-rule="required" class="form-control" name="row[pagesize]" type="number" value="{$row.pagesize}">
</div>
</div>
<div class="form-group">
<label for="c-weigh" class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
<div class="col-xs-12 col-sm-4">
<input id="c-weigh" data-rule="required" class="form-control" name="row[weigh]" type="number" value="{$row.weigh}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
{foreach name="statusList" item="vo"}
<label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>

View File

@ -0,0 +1,37 @@
<div class="panel panel-default panel-intro">
<div class="panel-heading">
{:build_heading(null,FALSE)}
<ul class="nav nav-tabs" data-field="model_id">
<li class="active"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
{foreach name="modelList" item="vo"}
<li><a href="#t-{$vo.id}" data-value="{$vo.id}" data-toggle="tab">{$vo.name}</a></li>
{/foreach}
</ul>
</div>
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div id="toolbar" class="toolbar">
{:build_toolbar('refresh,add,edit,del')}
<div class="dropdown btn-group {:$auth->check('cms/channel/multi')?'':'hide'}">
<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
<ul class="dropdown-menu text-left" role="menu">
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
</ul>
</div>
</div>
<table id="table" class="table table-striped table-bordered table-hover"
data-operate-edit="{:$auth->check('cms/channel/edit')}"
data-operate-del="{:$auth->check('cms/channel/del')}"
width="100%">
</table>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,82 @@
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<div class="form-group">
<label for="c-type" class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-type" data-rule="required" class="form-control selectpicker" name="row[type]">
{foreach name="typeList" item="vo"}
<option value="{$key}" {in name="key" value="archives"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label for="c-aid" class="control-label col-xs-12 col-sm-2">{:__('Aid')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-aid" data-rule="required" class="form-control" name="row[aid]" type="number" value="0">
</div>
</div>
<div class="form-group">
<label for="c-pid" class="control-label col-xs-12 col-sm-2">{:__('Pid')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-pid" data-rule="required" class="form-control" name="row[pid]" type="number" value="0">
</div>
</div>
<div class="form-group">
<label for="c-user_id" class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-user_id" data-rule="required" class="form-control" name="row[user_id]" type="text" value="0">
</div>
</div>
<div class="form-group">
<label for="c-content" class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
<div class="col-xs-12 col-sm-8">
<textarea id="c-content" data-rule="required" class="form-control editor" rows="5" name="row[content]" cols="50"></textarea>
</div>
</div>
<div class="form-group">
<label for="c-comments" class="control-label col-xs-12 col-sm-2">{:__('Comments')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-comments" data-rule="required" class="form-control" name="row[comments]" type="number" value="0">
</div>
</div>
<div class="form-group">
<label for="c-ip" class="control-label col-xs-12 col-sm-2">{:__('Ip')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-ip" data-rule="" class="form-control" name="row[ip]" type="text" value="">
</div>
</div>
<div class="form-group">
<label for="c-useragent" class="control-label col-xs-12 col-sm-2">{:__('Useragent')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-useragent" data-rule="" class="form-control" name="row[useragent]" type="text" value="">
</div>
</div>
<div class="form-group">
<label for="c-subscribe" class="control-label col-xs-12 col-sm-2">{:__('Subscribe')}:</label>
<div class="col-xs-12 col-sm-8">
{:build_radios('row[subscribe]', [1=>'是', 0=>'否'])}
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
{foreach name="statusList" item="vo"}
<label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="normal"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>

View File

@ -0,0 +1,82 @@
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<div class="form-group">
<label for="c-type" class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-type" data-rule="required" class="form-control selectpicker" name="row[type]">
{foreach name="typeList" item="vo"}
<option value="{$key}" {in name="key" value="$row.type"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label for="c-aid" class="control-label col-xs-12 col-sm-2">{:__('Aid')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-aid" data-rule="required" class="form-control" name="row[aid]" type="number" value="{$row.aid}">
</div>
</div>
<div class="form-group">
<label for="c-pid" class="control-label col-xs-12 col-sm-2">{:__('Pid')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-pid" data-rule="required" class="form-control" name="row[pid]" type="number" value="{$row.pid}">
</div>
</div>
<div class="form-group">
<label for="c-user_id" class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-user_id" data-rule="required" class="form-control" name="row[user_id]" type="text" value="{$row.user_id}">
</div>
</div>
<div class="form-group">
<label for="c-content" class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
<div class="col-xs-12 col-sm-8">
<textarea id="c-content" data-rule="required" class="form-control editor" rows="5" name="row[content]" cols="50">{$row.content}</textarea>
</div>
</div>
<div class="form-group">
<label for="c-comments" class="control-label col-xs-12 col-sm-2">{:__('Comments')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-comments" data-rule="required" class="form-control" name="row[comments]" type="number" value="{$row.comments}">
</div>
</div>
<div class="form-group">
<label for="c-ip" class="control-label col-xs-12 col-sm-2">{:__('Ip')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-ip" data-rule="required" class="form-control" name="row[ip]" type="text" value="{$row.ip}">
</div>
</div>
<div class="form-group">
<label for="c-useragent" class="control-label col-xs-12 col-sm-2">{:__('Useragent')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-useragent" data-rule="required" class="form-control" name="row[useragent]" type="text" value="{$row.useragent}">
</div>
</div>
<div class="form-group">
<label for="c-subscribe" class="control-label col-xs-12 col-sm-2">{:__('Subscribe')}:</label>
<div class="col-xs-12 col-sm-8">
{:build_radios('row[subscribe]', [1=>'是', 0=>'否'], $row['subscribe'])}
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
{foreach name="statusList" item="vo"}
<label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>

View File

@ -0,0 +1,32 @@
<div class="panel panel-default panel-intro">
{:build_heading()}
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div id="toolbar" class="toolbar">
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('cms/comment/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('cms/comment/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('cms/comment/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
<div class="dropdown btn-group {:$auth->check('cms/comment/multi')?'':'hide'}">
<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
<ul class="dropdown-menu text-left" role="menu">
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
</ul>
</div>
</div>
<table id="table" class="table table-striped table-bordered table-hover"
data-operate-edit="{:$auth->check('cms/comment/edit')}"
data-operate-del="{:$auth->check('cms/comment/del')}"
width="100%">
</table>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,17 @@
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-user_id" data-source="user/user/index" data-field='nickname' class="form-control selectpage" name="row[user_id]" type="text" value="">
</div>
</div>
{include file="cms/diydata/fields"}
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>

View File

@ -0,0 +1,17 @@
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-user_id" data-source="user/user/index" data-field='nickname' class="form-control selectpage" name="row[user_id]" type="text" value="{$row.user_id}">
</div>
</div>
{include file="cms/diydata/fields"}
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>

View File

@ -0,0 +1,102 @@
{foreach $fields as $item}
<div class="form-group">
<div class="control-label col-xs-12 col-sm-2">{$item.title}</div>
<div class="col-xs-12 col-sm-8">
{switch $item.type}
{case string}
<input type="text" name="row[{$item.name}]" id="c-{$item.name}" value="{$item.value}" class="form-control" data-rule="{$item.rule}" data-tip="{$item.tip}" {$item.extend} />
{/case}
{case value="text" break="0"}{/case}
{case editor}
<textarea name="row[{$item.name}]" id="c-{$item.name}" class="form-control {eq name='$item.type' value='editor'}editor{/eq}" data-rule="{$item.rule}" rows="5" data-tip="{$item.tip}" {$item.extend}>{$item.value}</textarea>
{/case}
{case array}
{php}$arrList=isset($values[$item['name']])?(array)json_decode($item['value'],true):$item['content_list'];{/php}
<dl class="fieldlist" rel="{$arrList|count}" data-name="row[{$item.name}]">
<dd>
<ins>{:__('Array key')}</ins>
<ins>{:__('Array value')}</ins>
</dd>
{foreach $arrList as $key => $vo}
<dd class="form-inline">
<input type="text" name="row[{$item.name}][field][{$key}]" class="form-control" value="{$key}" size="10" />
<input type="text" name="row[{$item.name}][value][{$key}]" class="form-control" value="{$vo}" size="40" />
<span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
<span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
</dd>
{/foreach}
<dd><a href="javascript:;" class="append btn btn-sm btn-success"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
</dl>
{/case}
{case date}
<input type="text" name="row[{$item.name}]" id="c-{$item.name}" value="{$item.value}" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-tip="{$item.tip}" data-rule="{$item.rule}" {$item.extend} />
{/case}
{case time}
<input type="text" name="row[{$item.name}]" id="c-{$item.name}" value="{$item.value}" class="form-control datetimepicker" data-date-format="HH:mm:ss" data-tip="{$item.tip}" data-rule="{$item.rule}" {$item.extend} />
{/case}
{case datetime}
<input type="text" name="row[{$item.name}]" id="c-{$item.name}" value="{$item.value}" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-tip="{$item.tip}" data-rule="{$item.rule}" {$item.extend} />
{/case}
{case number}
<input type="number" name="row[{$item.name}]" id="c-{$item.name}" value="{$item.value}" class="form-control" data-tip="{$item.tip}" data-rule="{$item.rule}" {$item.extend} />
{/case}
{case checkbox}
{foreach name="item.content_list" item="vo"}
<label for="row[{$item.name}][]-{$key}"><input id="row[{$item.name}][]-{$key}" name="row[{$item.name}][]" type="checkbox" value="{$key}" data-rule="{$item.rule}" data-tip="{$item.tip}" {in name="key" value="$item.value"}checked{/in} /> {$vo}</label>
{/foreach}
{/case}
{case radio}
{foreach name="item.content_list" item="vo"}
<label for="row[{$item.name}]-{$key}"><input id="row[{$item.name}]-{$key}" name="row[{$item.name}]" type="radio" value="{$key}" data-rule="{$item.rule}" data-tip="{$item.tip}" {in name="key" value="$item.value"}checked{/in} /> {$vo}</label>
{/foreach}
{/case}
{case value="select" break="0"}{/case}
{case value="selects"}
<select name="row[{$item.name}]{$item.type=='selects'?'[]':''}" class="form-control selectpicker" data-rule="{$item.rule}" data-tip="{$item.tip}" {$item.extend} {$item.type=='selects'?'multiple':''}>
{foreach name="item.content_list" item="vo"}
<option value="{$key}" {in name="key" value="$item.value"}selected{/in}>{$vo}</option>
{/foreach}
</select>
{/case}
{case value="image" break="0"}{/case}
{case value="images"}
<div class="input-group">
<input id="c-{$item.name}" class="form-control" name="row[{$item.name}]" type="text" value="{$item.value}" data-rule="{$item.rule}" data-tip="{$item.tip}">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="plupload-{$item.name}" class="btn btn-danger plupload" data-input-id="c-{$item.name}" data-preview-id="p-{$item.name}" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="{$item.type=='file'?'false':'true'}" {if $item.maximum}data-maxcount="{$item.maximum}"{/if}><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-{$item.name}" class="btn btn-primary fachoose" data-input-id="c-{$item.name}" data-preview-id="p-{$item.name}" data-mimetype="image/*" data-multiple="{$item.type=='file'?'false':'true'}" {if $item.maximum}data-maxcount="{$item.maximum}"{/if}><i class="fa fa-list"></i> {:__('Choose')}</button></span>
</div>
<span class="msg-box n-right" for="c-{$item.name}"></span>
</div>
<ul class="row list-inline plupload-preview" id="p-{$item.name}"></ul>
{/case}
{case value="file" break="0"}{/case}
{case value="files"}
<div class="input-group">
<input id="c-{$item.name}" class="form-control" name="row[{$item.name}]" type="text" value="{$item.value}" data-rule="{$item.rule}" data-tip="{$item.tip}">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="plupload-{$item.name}" class="btn btn-danger plupload" data-input-id="c-{$item.name}" data-multiple="{$item.type=='file'?'false':'true'}" {if $item.maximum}data-maxcount="{$item.maximum}"{/if}><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-{$item.name}" class="btn btn-primary fachoose" data-input-id="c-{$item.name}" data-multiple="{$item.type=='file'?'false':'true'}" {if $item.maximum}data-maxcount="{$item.maximum}"{/if}><i class="fa fa-list"></i> {:__('Choose')}</button></span>
</div>
<span class="msg-box n-right" for="c-{$item.name}"></span>
</div>
{/case}
{case switch}
<input id="c-{$item.name}" name="row[{$item.name}]" type="hidden" value="{:$item.value?1:0}">
<a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-{$item.name}" data-yes="1" data-no="0" >
<i class="fa fa-toggle-on text-success {if !$item.value}fa-flip-horizontal text-gray{/if} fa-2x"></i>
</a>
{/case}
{case bool}
<label for="row[{$item.name}]-yes"><input id="row[{$item.name}]-yes" name="row[{$item.name}]" type="radio" value="1" {$item.value?'checked':''} data-tip="{$item.tip}" /> {:__('Yes')}</label>
<label for="row[{$item.name}]-no"><input id="row[{$item.name}]-no" name="row[{$item.name}]" type="radio" value="0" {$item.value?'':'checked'} data-tip="{$item.tip}" /> {:__('No')}</label>
{/case}
{case custom}
{$item.content}
{/case}
{/switch}
</div>
</div>
{/foreach}

View File

@ -0,0 +1,29 @@
<div class="panel panel-default panel-intro">
<div class="panel-heading">
{:build_heading(null,FALSE)}
<ul class="nav nav-tabs" data-field="diyform_id">
{foreach name="diyformList" item="vo"}
<li class="{:$diyform['id']==$vo['id']?'active':''}"><a href="{:url('cms.diydata/index')}/diyform_id/{$vo.id}" data-value="{$vo.id}">{$vo.name}</a></li>
{/foreach}
</ul>
</div>
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div id="toolbar" class="toolbar">
{:build_toolbar('refresh,add,edit,del')}
</div>
<table id="table" class="table table-striped table-bordered table-hover"
data-operate-edit="{:$auth->check('cms/block/edit')}"
data-operate-del="{:$auth->check('cms/block/del')}"
width="100%">
</table>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,79 @@
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<div class="form-group">
<label for="c-name" class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text">
</div>
</div>
<div class="form-group">
<label for="c-title" class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text">
</div>
</div>
<div class="form-group">
<label for="c-table" class="control-label col-xs-12 col-sm-2">{:__('Table')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-table" data-rule="required" class="form-control" name="row[table]" type="text">
</div>
</div>
<div class="form-group">
<label for="c-diyname" class="control-label col-xs-12 col-sm-2">{:__('Diyname')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-diyname" data-rule="" class="form-control" name="row[diyname]" type="text" value="">
</div>
</div>
<div class="form-group">
<label for="c-keywords" class="control-label col-xs-12 col-sm-2">{:__('Keywords')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-keywords" data-rule="" class="form-control" name="row[keywords]" type="text" value="">
</div>
</div>
<div class="form-group">
<label for="c-description" class="control-label col-xs-12 col-sm-2">{:__('Description')}:</label>
<div class="col-xs-12 col-sm-8">
<textarea id="c-description" cols="60" rows="5" data-rule="" class="form-control" name="row[description]"></textarea>
</div>
</div>
<div class="form-group">
<label for="c-successtips" class="control-label col-xs-12 col-sm-2">{:__('Successtips')}:</label>
<div class="col-xs-12 col-sm-8">
<textarea id="c-successtips" cols="60" rows="5" data-rule="" class="form-control" name="row[successtips]"></textarea>
</div>
</div>
<div class="form-group">
<label for="c-formtpl" class="control-label col-xs-12 col-sm-2">{:__('Formtpl')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-formtpl" data-rule="required" class="form-control selectpage" name="row[formtpl]" data-source="cms/ajax/get_template_list" data-primary-key="name" data-field="name" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Needlogin')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-needlogin" name="row[needlogin]" type="hidden" value="0">
<a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-needlogin" data-yes="1" data-no="0" >
<i class="fa fa-toggle-on text-success fa-flip-horizontal text-gray fa-2x"></i>
</a>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
{foreach name="statusList" item="vo"}
<label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="normal" }checked{/in} /> {$vo}</label>
{/foreach}
</div>
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>

Some files were not shown because too many files have changed in this diff Show More