本文整理汇总了PHP中Admin\Builder\AdminConfigBuilder::keyBool方法的典型用法代码示例。如果您正苦于以下问题:PHP AdminConfigBuilder::keyBool方法的具体用法?PHP AdminConfigBuilder::keyBool怎么用?PHP AdminConfigBuilder::keyBool使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Admin\Builder\AdminConfigBuilder
的用法示例。
在下文中一共展示了AdminConfigBuilder::keyBool方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: install
public function install()
{
$aName = I('get.name', '', 'text');
$aNav = I('add_nav', 0, 'intval');
$module = $this->moduleModel->getModule($aName);
if (IS_POST) {
//执行guide中的内容
$res = $this->moduleModel->install($module['id']);
if ($res === true) {
if ($aNav) {
$channel['title'] = $module['alias'];
$channel['url'] = $module['entry'];
$channel['sort'] = 100;
$channel['status'] = 1;
$channel['icon'] = $module['icon'];
M('Channel')->add($channel);
S('common_nav', null);
}
$this->success(L('_INSTALLATION_MODULE_SUCCESS_'), U('lists'));
} else {
$this->error(L('_SETUP_MODULE_FAILED_') . $this->moduleModel->getError());
}
} else {
$builder = new AdminConfigBuilder();
$builder->title($module['alias'] . L('_DASH_') . L('_GUIDE_MODULE_INSTALL_'));
$builder->keyId()->keyReadOnly('name', L('_MODULE_NAME_'))->keyText('alias', L('_MODULE_CHINESE_NAME_'))->keyReadOnly('version', L('_VERSION_'))->keyText('icon', L('_ICON_'))->keyTextArea('summary', L('_MODULE_INTRODUCTION_'))->keyReadOnly('developer', L('_DEVELOPER_'))->keyText('entry', L('_FRONT_ENTRANCE_'))->keyText('admin_entry', L('_BACKGROUND_ENTRY_'));
//, 'repair' => L('_FIX_MODE_')修复模式不会导入模块专用数据表,只导入菜单、权限、行为、行为限制
$builder->keyRadio('mode', L('_INSTALLATION_MODE_'), '', array('install' => L('_COVER_INSTALLATION_MODE_')));
if ($module['entry']) {
$builder->keyBool('add_nav', L('_ADD_NAVIGATION_'), L('_INSTALL_AUTO_ADD_MENU_', array('link' => U('channel/index'))));
}
/* $builder->keyRadio('add_nav',L('_ADD_NAVIGATION_MENU_'),L('_DEFAULT_WILL_NOT_ADD_NAVIGATION_'),array(1=>L('_DO_NOT_ADD_'),2=>L('_ADD_')));*/
$builder->group(L('_INSTALL_OPTION_'), 'mode,add_nav');
/* $builder->group(L('_MODULE_INFORMATION_'), 'id,name,alias,version,icon,summary,developer,entry,admin_entry');*/
$module['mode'] = 'install';
$module['add_nav'] = '1';
$builder->data($module);
$builder->buttonSubmit();
$builder->buttonBack();
$builder->display();
}
/* */
}
示例2: install
public function install()
{
$aName = I('get.name', '', 'text');
$aNav = I('add_nav', 0, 'intval');
$module = $this->moduleModel->getModule($aName);
if (IS_POST) {
//执行guide中的内容
$res = $this->moduleModel->install($module['id']);
if ($res === true) {
if ($aNav) {
$channel['title'] = $module['alias'];
$channel['url'] = $module['entry'];
$channel['sort'] = 100;
$channel['status'] = 1;
$channel['icon'] = $module['icon'];
M('Channel')->add($channel);
S('common_nav', null);
}
$this->success('安装模块成功。', U('lists'));
} else {
$this->error('安装模块失败。' . $this->moduleModel->getError());
}
} else {
$builder = new AdminConfigBuilder();
$builder->title($module['alias'] . '——模块安装向导');
$builder->keyId()->keyReadOnly('name', '模块名')->keyText('alias', '模块中文名')->keyReadOnly('version', '版本')->keyText('icon', '图标')->keyTextArea('summary', '模块介绍')->keyReadOnly('developer', '开发者')->keyText('entry', '前台入口')->keyText('admin_entry', '后台入口');
//, 'repair' => '修复模式'修复模式不会导入模块专用数据表,只导入菜单、权限、行为、行为限制
$builder->keyRadio('mode', '安装模式', '', array('install' => '覆盖安装模式'));
if ($module['entry']) {
$builder->keyBool('add_nav', '添加导航', '安装后自动在导航栏中加入菜单,或者<a target="_blank" href="' . U('channel/index') . '">手动设置</a>');
}
/* $builder->keyRadio('add_nav','添加导航菜单','默认不会添加导航',array(1=>'不添加',2=>'添加'));*/
$builder->group('安装选项', 'mode,add_nav');
/* $builder->group('模块信息', 'id,name,alias,version,icon,summary,developer,entry,admin_entry');*/
$module['mode'] = 'install';
$module['add_nav'] = '1';
$builder->data($module);
$builder->buttonSubmit();
$builder->buttonBack();
$builder->display();
}
/* */
}
示例3: website
public function website()
{
$builder = new AdminConfigBuilder();
$data = $builder->handleConfig();
$builder->title(L('_SITE_INFO_'))->suggest(L('_SITE_INFO_VICE_'));
/* $builder->keySelect('LANG', L('_WEBSITE_LANGUAGE_'), L('_SELECT_THE_DEFAULT_LANGUAGE_'), array('zh-cn' => L('_SIMPLIFIED_CHINESE_'), 'en-us' => L('_ENGLISH_')));*/
$builder->keyText('WEB_SITE_NAME', L('_SITE_NAME_'), L('_SITE_NAME_VICE_'));
$builder->keyText('ICP', L('_LICENSE_NO_'), L('_LICENSE_NO_VICE_'));
$builder->keySingleImage('LOGO', L('_SITE_LOGO_'), L('_SITE_LOGO_VICE_'));
$builder->keySingleImage('QRCODE', L('_QR_WEIXIN_'), L('_QR_WEIXIN_VICE_'));
$builder->keySingleImage('JUMP_BACKGROUND', L('_IMG_BG_REDIRECTED_'), L('_IMG_BG_REDIRECTED_'));
$builder->keyText('SUCCESS_WAIT_TIME', L(''), L(''));
$builder->keyText('ERROR_WAIT_TIME', L(''), L(''));
$builder->keyEditor('ABOUT_US', L(''), L(''));
$builder->keyEditor('SUBSCRIB_US', L(''), L(''));
$builder->keyEditor('COPY_RIGHT', L(''), L(''));
$addons = \Think\Hook::get('uploadDriver');
$opt = array('local' => L('_LOCAL_'));
foreach ($addons as $name) {
if (class_exists($name)) {
$class = new $name();
$config = $class->getConfig();
if ($config['switch']) {
$opt[$class->info['name']] = $class->info['title'];
}
}
}
$builder->keySelect('PICTURE_UPLOAD_DRIVER', L('_PICTURE_UPLOAD_DRIVER_'), L('_PICTURE_UPLOAD_DRIVER_'), $opt);
$builder->keySelect('DOWNLOAD_UPLOAD_DRIVER', L('_ATTACHMENT_UPLOAD_DRIVER_'), L('_ATTACHMENT_UPLOAD_DRIVER_'), $opt);
$builder->group(L('_BASIC_INFORMATION_'), array('WEB_SITE_NAME', 'ICP', 'LOGO', 'QRCODE', 'LANG'));
$builder->group(L('_THE_FOOTER_INFORMATION_'), array('ABOUT_US', 'SUBSCRIB_US', 'COPY_RIGHT'));
$builder->group(L('_JUMP_PAGE_'), array('JUMP_BACKGROUND', 'SUCCESS_WAIT_TIME', 'ERROR_WAIT_TIME'));
$builder->keyBool('GET_INFORMATION', L('_OPEN_INSTANT_ACCESS_TO_THE_MESSAGE_'), L('_OPEN_INSTANT_ACCESS_TO_THE_MESSAGE_VICE_'));
$builder->keyText('GET_INFORMATION_INTERNAL', L('_MESSAGE_POLLING_INTERVAL_'), L('_MESSAGE_POLLING_INTERVAL_VICE_'));
$builder->group(L('_PERFORMANCE_SETTINGS_'), array('GET_INFORMATION', 'GET_INFORMATION_INTERNAL'));
$builder->group(L('_UPLOAD_CONFIGURATION_'), array('PICTURE_UPLOAD_DRIVER', 'DOWNLOAD_UPLOAD_DRIVER'));
$builder->data($data);
$builder->keyDefault('SUCCESS_WAIT_TIME', 2);
$builder->keyDefault('ERROR_WAIT_TIME', 5);
$builder->keyDefault('LANG', 'zh-cn');
$builder->keyDefault('GET_INFORMATION', 1);
$builder->keyDefault('GET_INFORMATION_INTERNAL', 10);
$builder->buttonSubmit();
$builder->display();
}
示例4: editSection
public function editSection()
{
$aSectionId = I('id', 0, 'intval');
$oldSection = $this->bookSectionModel->getData($aSectionId);
$title = $oldSection['type'] ? '编辑文章: ' . $oldSection['title'] : '编辑章节: ' . $oldSection['title'];
if (!$oldSection) {
$this->error(L('_THIS_CHAPTER_DOES_NOT_EXIST_AND_CANNOT_BE_EDITED_WITH_EXCLAMATION_'));
}
if (IS_POST) {
$data['id'] = $aSectionId;
$data['uid'] = I('post.uid', get_uid(), 'intval');
$data['title'] = I('post.title', '', 'text');
$data['pid'] = I('post.pid', 0, 'intval');
$data['keywords'] = I('post.keywords', '', 'text');
$data['summary'] = I('post.summary', '', 'text');
$data['is_show'] = I('post.is_show', 1, 'intval');
$data['sort'] = I('post.sort', 0, 'intval');
$data['create_time'] = I('post.create_time', time(), 'intval');
$data['status'] = I('post.status', 1, 'intval');
$data['book_id'] = $oldSection['book_id'];
$data['color'] = I('post.color', '', 'text');
if (!$oldSection['type']) {
$data['open_child'] = I('post.open_child', 1, 'intval');
}
if (mb_strlen($data['title'], 'utf-8') <= 0) {
$this->error(L('_TITLE_CAN_NOT_BE_EMPTY_WITH_EXCLAMATION_'));
}
$res_section = $this->bookSectionModel->editData($data);
if ($oldSection['type']) {
$detail['section_id'] = $aSectionId;
$detailModel = D('BookDetail');
$exist = $detailModel->where($detail)->find();
$detail['content'] = $_POST['content'];
if ($exist) {
$detail['id'] = $exist['id'];
$res_detail = $detailModel->save($detail);
} else {
$res_detail = $detailModel->add($detail);
}
}
if ($res_section || $res_detail) {
$this->success(L('_OPERATION_SUCCESS_WITH_EXCLAMATION_'));
} else {
if ($oldSection['type']) {
$this->error('编辑失败!操作章节表时报 ' . $this->bookSectionModel->getError() . L('_WRONG;_THE_OPERATION_OF_THE_ARTICLE_FOR_DETAILS_OF_THE_TIMES_') . $detailModel->getError() . L('_WRONG_WITH_PERIOD_'));
} else {
$this->error(L('_EDIT_FAILED_WITH_EXCLAMATION_') . $this->bookSectionModel->getError());
}
}
} else {
$options = $this->bookSectionModel->getSectionOptions($oldSection['book_id'], $aSectionId);
$builder = new AdminConfigBuilder();
$builder->title($title);
$builder->data($oldSection)->keyId()->keyUid('uid', L('_AUTHOR_UID_'))->keyTitle('title', L('_TITLE_'))->keySelect('pid', L('_FATHER_CLASS_'), '', $options)->keyText('keywords', L('_KEY_WORDS_'))->keyTextArea('summary', L('_INTRODUCTION_'));
if ($oldSection['type']) {
$builder->keyEditor('content', L('_CONTENT_'), '', 'all', array('width' => '850px', 'height' => '400px'));
} else {
$builder->keyBool('open_child', L('_START_SUB_CHAPTER_'));
}
$builder->keyRadio('is_show', L('_RELEASE_STATUS_'), '', array('0' => L('_DRAFT_'), '1' => L('_NORMAL_')))->keyInteger('sort', L('_SORT_'))->keyColor('color', L('_TEXT_COLOR_'))->keyCreateTime()->keyStatus()->buttonSubmit()->buttonBack()->display();
}
}