本文整理汇总了PHP中Admin\Builder\AdminConfigBuilder::keyTextArea方法的典型用法代码示例。如果您正苦于以下问题:PHP AdminConfigBuilder::keyTextArea方法的具体用法?PHP AdminConfigBuilder::keyTextArea怎么用?PHP AdminConfigBuilder::keyTextArea使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Admin\Builder\AdminConfigBuilder
的用法示例。
在下文中一共展示了AdminConfigBuilder::keyTextArea方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: config
public function config()
{
$builder = new AdminConfigBuilder();
$data = $builder->handleConfig();
$builder->title('基本配置');
$builder->keyText('WEBSITE_NAME', '网站名称显示')->keyEditor('COPY_RIGHT', '网站版权信息')->group('通用设置', 'WEBSITE_NAME,COPY_RIGHT');
$builder->keyTextArea('SUMMARY', '登陆页导语', '不要过长,一句话即可')->group('登陆页设置', 'SUMMARY');
$builder->keyTextArea('STATISTICALCODE', '统计代码', '用于统计网站访问量的第三方代码,推荐CNZZ统计 ')->group('统计代码设置', 'STATISTICALCODE');
$builder->buttonSubmit();
$builder->data($data);
$builder->display();
}
示例2: config
public function config()
{
$builder = new AdminConfigBuilder();
$data = $builder->handleConfig();
$default_position = <<<str
1:系统首页
2:推荐阅读
4:本类推荐
str;
$builder->title('资讯基础设置')->data($data);
$builder->keyTextArea('NEWS_SHOW_POSITION', '展示位配置')->keyDefault('NEWS_SHOW_POSITION', $default_position)->keyText('NEWS_SHOW_TITLE', '标题名称', '在首页展示块的标题')->keyDefault('NEWS_SHOW_TITLE', '热门资讯')->keyText('NEWS_SHOW_COUNT', '显示资讯的个数', '只有在网站首页模块中启用了资讯块之后才会显示')->keyDefault('NEWS_SHOW_COUNT', 4)->keyRadio('NEWS_SHOW_TYPE', '资讯的筛选范围', '', array('1' => '后台推荐', '0' => '全部'))->keyDefault('NEWS_SHOW_TYPE', 0)->keyRadio('NEWS_SHOW_ORDER_FIELD', '排序值', '展示模块的数据排序方式', array('view' => '阅读数', 'create_time' => '发表时间', 'update_time' => '更新时间'))->keyDefault('NEWS_SHOW_ORDER_FIELD', 'view')->keyRadio('NEWS_SHOW_ORDER_TYPE', '排序方式', '展示模块的数据排序方式', array('desc' => '倒序,从大到小', 'asc' => '正序,从小到大'))->keyDefault('NEWS_SHOW_ORDER_TYPE', 'desc')->keyText('NEWS_SHOW_CACHE_TIME', '缓存时间', '默认600秒,以秒为单位')->keyDefault('NEWS_SHOW_CACHE_TIME', '600')->group('基本配置', 'NEWS_SHOW_POSITION')->group('首页展示配置', 'NEWS_SHOW_COUNT,NEWS_SHOW_TITLE,NEWS_SHOW_TYPE,NEWS_SHOW_ORDER_TYPE,NEWS_SHOW_ORDER_FIELD,NEWS_SHOW_CACHE_TIME')->groupLocalComment('本地评论配置', 'index')->buttonSubmit()->buttonBack()->display();
}
示例3: editAdv
//.........这里部分代码省略.........
switch ($pos['type']) {
case 1:
//todo 单图
$data['pic'] = I('pic', 0, 'intval');
$data['target'] = I('target', 0, 'text');
break;
case 3:
$data['text'] = I('text', '', 'text');
$data['text_color'] = I('text_color', '', 'text');
$data['text_font_size'] = I('text_font_size', '', 'text');
$data['target'] = I('target', 0, 'text');
//todo 文字
break;
case 4:
//todo 代码
$data['code'] = I('code', '', '');
break;
}
$adv['data'] = json_encode($data);
if ($aId == 0) {
$result = $advModel->add($adv);
} else {
$adv['id'] = $aId;
$result = $advModel->save($adv);
}
if ($result === false) {
$this->error('保存失败。');
} else {
$this->success('保存成功。');
}
}
} else {
//快速添加广告位逻辑
//todo 快速添加
$builder = new AdminConfigBuilder();
$adv['pos'] = $pos['title'] . '——' . $pos['name'] . '——' . $pos['path'];
$adv['pos_id'] = $aPosId;
$builder->keyReadOnly('pos', '所属广告位');
$builder->keyReadOnly('pos_id', '广告位ID');
$builder->keyId()->keyTitle('title', '广告说明');
$builder->title($pos['title'] . '设置——' . $advPosModel->switchType($pos['type']));
$builder->keyTime('start_time', '开始生效时间', '不设置则立即生效')->keyTime('end_time', '失效时间', '不设置则一直有效')->keyText('sort', '排序')->keyCreateTime()->keyStatus();
$builder->buttonSubmit();
$data = json_decode($adv['data'], true);
if (!empty($data)) {
$adv = array_merge($adv, $data);
}
if ($aId) {
$builder->data($adv);
} else {
$builder->data(array('pos' => $adv['pos'], 'pos_id' => $aPosId));
}
switch ($pos['type']) {
case 1:
//todo 单图
$builder->keySingleImage('pic', '图片', '选图上传,建议尺寸' . $pos['width'] . '*' . $pos['height']);
$builder->keyText('url', '链接地址');
$builder->keySelect('target', '打开方式', null, array('_blank' => '新窗口:_blank', '_self' => '当前层:_self', '_parent' => '父框架:_parent', '_top' => '整个框架:_top'));
break;
case 2:
//todo 多图
break;
case 3:
$builder->keyText('text', '文字内容', '广告展示文字');
$builder->keyText('url', '链接地址');
$builder->keyColor('text_color', '文字颜色', '文字颜色')->keyDefault('data[text_color]', '#000000');
$builder->keyText('text_font_size', '文字大小,需带单位,例如:14px')->keyDefault('data[text_font_size]', '12px');
$builder->keySelect('target', '打开方式', null, array('_blank' => '新窗口:_blank', '_self' => '当前层:_self', '_parent' => '父框架:_parent', '_top' => '整个框架:_top'));
//todo 文字
break;
case 4:
//todo 代码
$builder->keyTextArea('code', '代码内容', '不对此字段进行过滤,可填写js、html');
break;
}
$builder->keyDefault('status', 1)->keyDefault('sort', 1);
$builder->keyDefault('title', $pos['title'] . '的广告 ' . date('m月d日', time()) . ' 添加')->keyDefault('end_time', time() + 60 * 60 * 24 * 7);
if ($pos['type'] == 2) {
$this->_meta_title = $pos['title'] . '设置——' . $advPosModel->switchType($pos['type']);
$adv['start_time'] = isset($adv['start_time']) ? $adv['start_time'] : time();
$adv['end_time'] = isset($adv['end_time']) ? $adv['end_time'] : time() + 60 * 60 * 24 * 7;
$adv['create_time'] = isset($adv['create_time']) ? $adv['create_time'] : time();
$adv['sort'] = isset($adv['sort']) ? $adv['sort'] : 1;
$adv['status'] = isset($adv['status']) ? $adv['status'] : 1;
$advs = D('Adv')->where(array('pos_id' => $aPosId))->select();
foreach ($advs as &$v) {
$data = json_decode($v['data'], true);
if (!empty($data)) {
$v = array_merge($v, $data);
}
}
unset($v);
$this->assign('list', $advs);
$this->assign('pos', $pos);
$this->display('editslider');
} else {
$builder->display();
}
}
}