當前位置: 首頁>>代碼示例>>PHP>>正文


PHP AdminConfigBuilder::keySelect方法代碼示例

本文整理匯總了PHP中Admin\Builder\AdminConfigBuilder::keySelect方法的典型用法代碼示例。如果您正苦於以下問題:PHP AdminConfigBuilder::keySelect方法的具體用法?PHP AdminConfigBuilder::keySelect怎麽用?PHP AdminConfigBuilder::keySelect使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Admin\Builder\AdminConfigBuilder的用法示例。


在下文中一共展示了AdminConfigBuilder::keySelect方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: 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();
         }
     }
 }
開發者ID:naliduo,項目名稱:Lightweight-social-platform,代碼行數:101,代碼來源:AdvController.class.php

示例2: 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();
 }
開發者ID:ccccy,項目名稱:wuanlife,代碼行數:38,代碼來源:ConfigController.class.php

示例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();
 }
開發者ID:terrydeng,項目名稱:beimeibang1205,代碼行數:45,代碼來源:ConfigController.class.php


注:本文中的Admin\Builder\AdminConfigBuilder::keySelect方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。