本文整理汇总了PHP中get_type_bycate函数的典型用法代码示例。如果您正苦于以下问题:PHP get_type_bycate函数的具体用法?PHP get_type_bycate怎么用?PHP get_type_bycate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_type_bycate函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
public function edit()
{
$id = I('get.id', '');
if (empty($id)) {
$this->error('参数不能为空!');
}
$model_id = 6;
// 获取详细数据
$Model = D('Record');
$data = $Model->detail($id);
// 获取当前的模型信息
$model = get_top_model($data['model_id']);
$model = $model[$model_id];
$this->assign('data', $data);
$this->assign('model_id', $data['model_id']);
$this->assign('model', $model);
//获取表单字段排序
$fields = get_model_attribute($model['id']);
$this->assign('fields', $fields);
//获取当前分类的文档类型
$this->assign('type_list', get_type_bycate($data['category_id']));
$this->meta_title = '编辑文档';
$this->display();
}
示例2: edit
/**
* 文档编辑页面初始化
* @author huajie <banhuajie@163.com>
*/
public function edit()
{
//获取左边菜单
$this->getMenu();
$id = I('get.id', '');
if (empty($id)) {
$this->error('参数不能为空!');
}
// 获取详细数据
$Document = M('Doc0s1');
//$Document = M('Doc0s1A1');
$data = $Document->detail($id);
if (!$data) {
$this->error($Document->getError());
}
if ($data['pid']) {
// 获取上级文档
$article = $Document->field('id,title,type')->find($data['pid']);
$this->assign('article', $article);
}
// 获取当前的模型信息
$model = get_document_model($data['model_id']);
$this->assign('data', $data);
$this->assign('model_id', $data['model_id']);
$this->assign('model', $model);
//获取表单字段排序
$fields = get_model_attribute($model['id']);
$this->assign('fields', $fields);
//获取当前分类的文档类型
$this->assign('type_list', get_type_bycate($data['category_id']));
$this->meta_title = '编辑文档';
$this->display();
}
示例3: batchOperate
/**
* 批量操作
* @author Rocks
*/
public function batchOperate()
{
//获取左边菜单
$this->getMenu();
$pid = I('pid', 0);
$cate_id = I('cate_id');
empty($cate_id) && $this->error('参数不能为空!');
//检查该分类是否允许发布
$allow_publish = D('Document')->checkCategory($cate_id);
!$allow_publish && $this->error('该分类不允许发布内容!');
//批量导入目录
if (IS_POST) {
$model_id = I('model_id');
$type = 1;
//TODO:目前只支持目录,要动态获取
$content = I('content');
$_POST['content'] = '';
//重置内容
preg_match_all('/[^\\r]+/', $content, $matchs);
//获取每一个目录的数据
$list = $matchs[0];
foreach ($list as $value) {
if (!empty($value) && strpos($value, '|') !== false) {
//过滤换行回车并分割
$data = explode('|', str_replace(array("\r", "\r\n", "\n"), '', $value));
//构造新增的数据
$data = array('name' => $data[0], 'title' => $data[1], 'game_id' => $cate_id, 'model_id' => $model_id);
$data['description'] = '';
$data['pid'] = $pid;
$data['type'] = $type;
//构造post数据用于自动验证
$_POST = $data;
$res = D('Document')->update($data);
}
}
if ($res) {
$this->success('批量导入成功!', U('index?pid=' . $pid . '&cate_id=' . $cate_id));
} else {
if (isset($res)) {
$this->error(D('Document')->getError());
} else {
$this->error('批量导入失败,请检查内容格式!');
}
}
}
$this->assign('pid', $pid);
$this->assign('cate_id', $cate_id);
$this->assign('type_list', get_type_bycate($cate_id));
$this->meta_title = '批量导入';
$this->display('batchoperate');
}
示例4: edit
/**
* 文档编辑页面初始化
* @author huajie <banhuajie@163.com>
*/
public function edit()
{
//获取左边菜单
$id = I('get.id', '');
if (empty($id)) {
$this->error('参数不能为空!');
}
/*获取一条记录的详细数据*/
$ShopProduct = D('ShopProduct');
$data = $ShopProduct->detail($id);
if (!$data) {
$this->error($ShopProduct->getError());
}
$this->assign('data', $data);
$this->assign('model_id', 4);
/* 获取要编辑的扩展模型模板 */
$model = $this->getModel(4);
$this->assign('model', $model);
//获取表单字段排序
$fields = get_model_attribute(4);
$this->assign('fields', $fields);
//获取当前分类的文档类型
$this->assign('type_list', get_type_bycate($data['cid']));
Cookie('__forward__', $_SERVER['REQUEST_URI']);
$this->display();
}