本文整理匯總了PHP中Admin\Builder\AdminConfigBuilder::keySingleImage方法的典型用法代碼示例。如果您正苦於以下問題:PHP AdminConfigBuilder::keySingleImage方法的具體用法?PHP AdminConfigBuilder::keySingleImage怎麽用?PHP AdminConfigBuilder::keySingleImage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Admin\Builder\AdminConfigBuilder
的用法示例。
在下文中一共展示了AdminConfigBuilder::keySingleImage方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: config
public function config()
{
$builder = new AdminConfigBuilder();
$data = $builder->handleConfig();
$data['OPEN_LOGIN_PANEL'] = $data['OPEN_LOGIN_PANEL'] ? $data['OPEN_LOGIN_PANEL'] : 1;
$builder->title('首頁設置');
$modules = D('Common/Module')->getAll();
foreach ($modules as $m) {
if ($m['is_setup'] == 1 && $m['entry'] != '') {
if (file_exists(APP_PATH . $m['name'] . '/Widget/HomeBlockWidget.class.php')) {
$module[] = array('data-id' => $m['name'], 'title' => $m['alias']);
}
}
}
$module[] = array('data-id' => 'slider', 'title' => '輪播');
$default = array(array('data-id' => 'disable', 'title' => '禁用', 'items' => $module), array('data-id' => 'enable', 'title' => '啟用', 'items' => array()));
$builder->keyKanban('BLOCK', '展示模塊', '拖拽到右側以展示這些模塊,新的模塊安裝後會多出一些可操作的項目');
$data['BLOCK'] = $builder->parseKanbanArray($data['BLOCK'], $module, $default);
$builder->group('展示模塊', 'BLOCK');
$builder->keySingleImage('PIC1', '圖片');
$builder->keyText('URL1', '鏈接');
$builder->keyText('TITLE1', '標題');
$builder->keyRadio('TARGET1', '新窗口打開', '', array('_blank' => '新窗口', '_self' => '本窗口'));
$builder->group('幻燈片1', 'PIC1,URL1,TITLE1,TARGET1');
$builder->keySingleImage('PIC2', '圖片');
$builder->keyText('URL2', '鏈接');
$builder->keyText('TITLE2', '標題');
$builder->keyRadio('TARGET2', '新窗口打開', '', array('_blank' => '新窗口', '_self' => '本窗口'));
$builder->group('幻燈片2', 'PIC2,URL2,TITLE2,TARGET2');
$builder->keySingleImage('PIC3', '圖片');
$builder->keyText('URL3', '鏈接');
$builder->keyText('TITLE3', '標題');
$builder->keyRadio('TARGET3', '新窗口打開', '', array('_blank' => '新窗口', '_self' => '本窗口'));
$builder->group('幻燈片3', 'PIC3,URL3,TITLE3,TARGET3');
$show_blocks = get_kanban_config('BLOCK_SORT', 'enable', array(), 'Home');
$builder->buttonSubmit();
$builder->data($data);
$builder->display();
}
示例2: config
public function config()
{
$builder = new AdminConfigBuilder();
$data = $builder->handleConfig();
$data['OPEN_LOGIN_PANEL'] = $data['OPEN_LOGIN_PANEL'] ? $data['OPEN_LOGIN_PANEL'] : 1;
$builder->title(L('_HOME_SETTING_'));
$modules = D('Common/Module')->getAll();
foreach ($modules as $m) {
if ($m['is_setup'] == 1 && $m['entry'] != '') {
if (file_exists(APP_PATH . $m['name'] . '/Widget/HomeBlockWidget.class.php')) {
$module[] = array('data-id' => $m['name'], 'title' => $m['alias']);
}
}
}
$module[] = array('data-id' => 'slider', 'title' => L('_CAROUSEL_'));
$default = array(array('data-id' => 'disable', 'title' => L('_DISABLED_'), 'items' => $module), array('data-id' => 'enable', 'title' => L('_ENABLED_'), 'items' => array()));
$builder->keyKanban('BLOCK', L('_DISPLAY_BLOCK_'), L('_TIP_DISPLAY_BLOCK_'));
$data['BLOCK'] = $builder->parseKanbanArray($data['BLOCK'], $module, $default);
$builder->group(L('_DISPLAY_BLOCK_'), 'BLOCK');
$builder->keySingleImage('PIC1', L('_PICTURE_'));
$builder->keyText('URL1', L('_LINK_'));
$builder->keyText('TITLE1', L('_TITLE_'));
$builder->keyRadio('TARGET1', L('_NEW_WINDOW_OPEN_'), '', array('_blank' => L('_NEW_WINDOW_'), '_self' => L('_SELF_WINDOW_')));
$builder->group(L('_SLIDE1_'), 'PIC1,URL1,TITLE1,TARGET1');
$builder->keySingleImage('PIC2', L('_PICTURE_'));
$builder->keyText('URL2', L('_LINK_'));
$builder->keyText('TITLE2', L('_TITLE_'));
$builder->keyRadio('TARGET2', L('_NEW_WINDOW_OPEN_'), '', array('_blank' => L('_NEW_WINDOW_'), '_self' => L('_SELF_WINDOW_')));
$builder->group(L('_SLIDE2_'), 'PIC2,URL2,TITLE2,TARGET2');
$builder->keySingleImage('PIC3', L('_PICTURE_'));
$builder->keyText('URL3', L('_LINK_'));
$builder->keyText('TITLE3', L('_TITLE_'));
$builder->keyRadio('TARGET3', L('_NEW_WINDOW_OPEN_'), '', array('_blank' => L('_NEW_WINDOW_'), '_self' => L('_SELF_WINDOW_')));
$builder->group(L('_SLIDE3_'), 'PIC3,URL3,TITLE3,TARGET3');
$show_blocks = get_kanban_config('BLOCK_SORT', 'enable', array(), 'Home');
$builder->buttonSubmit();
$builder->data($data);
$builder->display();
}
示例3: website
public function website()
{
$builder = new AdminConfigBuilder();
$data = $builder->handleConfig();
$builder->title('網站信息')->suggest('此處配置網站的一般信息。');
$builder->keyText('WEB_SITE_NAME', '網站名', '用於郵件,短信,站內信顯示');
$builder->keyText('ICP', '網站備案號', '設置在網站底部顯示的備案號,如“滬ICP備12007941號-2');
$builder->keySingleImage('LOGO', '網站Logo', '網站的logo設置,建議尺寸156*50');
$builder->keySingleImage('QRCODE', '微信二維碼', '懸浮微信二維碼');
$builder->keySingleImage('JUMP_BACKGROUND', '跳轉頁背景圖片', '跳轉頁背景圖片');
$builder->keyText('SUCCESS_WAIT_TIME', '成功等待時間', '設置成功時頁麵等待頁麵');
$builder->keyText('ERROR_WAIT_TIME', '失敗等待時間', '設置失敗時頁麵等待頁麵');
$builder->keyEditor('ABOUT_US', '關於我們內容', '頁腳關於我們介紹');
$builder->keyEditor('SUBSCRIB_US', '關注我們', '頁腳關注我們內容');
$builder->keyEditor('COPY_RIGHT', '版權信息', '頁腳版權信息');
$builder->group('基本信息', array('WEB_SITE_NAME', 'ICP', 'LOGO', 'QRCODE'));
$builder->group('頁腳信息', array('ABOUT_US', 'SUBSCRIB_US', 'COPY_RIGHT'));
$builder->group('跳轉頁麵', array('JUMP_BACKGROUND', 'SUCCESS_WAIT_TIME', 'ERROR_WAIT_TIME'));
$builder->data($data);
$builder->keyDefault('SUCCESS_WAIT_TIME', 2);
$builder->keyDefault('ERROR_WAIT_TIME', 5);
$builder->buttonSubmit();
$builder->display();
}
示例4: website
public function website()
{
$builder = new AdminConfigBuilder();
$data = $builder->handleConfig();
$builder->title('網站信息')->suggest('此處配置網站的一般信息。');
$builder->keyText('WEB_SITE_NAME', '網站名', '用於郵件,短信,站內信顯示');
$builder->keyText('ICP', '網站備案號', '設置在網站底部顯示的備案號,如“滬ICP備12007941號-2');
$builder->keySingleImage('LOGO', '網站Logo', '網站的logo設置,建議尺寸156*50');
$builder->keySingleImage('QRCODE', '微信二維碼', '懸浮微信二維碼');
$builder->keySingleImage('JUMP_BACKGROUND', '跳轉頁背景圖片', '跳轉頁背景圖片');
$builder->keyText('SUCCESS_WAIT_TIME', '成功等待時間', '設置成功時頁麵等待頁麵');
$builder->keyText('ERROR_WAIT_TIME', '失敗等待時間', '設置失敗時頁麵等待頁麵');
$builder->keyEditor('ABOUT_US', '關於我們內容', '頁腳關於我們介紹');
$builder->keyEditor('SUBSCRIB_US', '關注我們', '頁腳關注我們內容');
$builder->keyEditor('COPY_RIGHT', '版權信息', '頁腳版權信息');
$addons = \Think\Hook::get('uploadDriver');
$opt = array('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', '圖片上傳驅動', '圖片上傳驅動', $opt);
$builder->keySelect('DOWNLOAD_UPLOAD_DRIVER', '附件上傳驅動', '附件上傳驅動', $opt);
$builder->group('基本信息', array('WEB_SITE_NAME', 'ICP', 'LOGO', 'QRCODE'));
$builder->group('頁腳信息', array('ABOUT_US', 'SUBSCRIB_US', 'COPY_RIGHT'));
$builder->group('跳轉頁麵', array('JUMP_BACKGROUND', 'SUCCESS_WAIT_TIME', 'ERROR_WAIT_TIME'));
$builder->group('上傳配置', array('PICTURE_UPLOAD_DRIVER', 'DOWNLOAD_UPLOAD_DRIVER'));
$builder->data($data);
$builder->keyDefault('SUCCESS_WAIT_TIME', 2);
$builder->keyDefault('ERROR_WAIT_TIME', 5);
$builder->buttonSubmit();
$builder->display();
}
示例5: 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();
}
}
}
示例6: 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();
}