本文整理汇总了PHP中Doo::loadClassAt方法的典型用法代码示例。如果您正苦于以下问题:PHP Doo::loadClassAt方法的具体用法?PHP Doo::loadClassAt怎么用?PHP Doo::loadClassAt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Doo
的用法示例。
在下文中一共展示了Doo::loadClassAt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($db = '')
{
$this->db = $db;
Doo::loadClassAt('KVCache', 'default');
$KVCache = new KVCache();
$this->_redis = $KVCache->cfile();
}
示例2: mod
public function mod()
{
$configKey = 'settingConfig';
// $cachePath = Doo::conf()->CACHE_PATH;
// Doo::conf()->CACHE_PATH = Doo::conf()->SITE_PATH.'protect/confCache/';
array_push($this->_includeJsFileList, 'js/ueditor/ueditor.config.js');
array_push($this->_includeJsFileList, 'js/ueditor/ueditor.all.min.js');
array_push($this->_includeJsFileList, 'js/ueditor/lang/zh-cn/zh-cn.js');
array_push($this->_includeJsFileList, 'js/ueditor/ueditor.use.js');
$shopNameList = DBproxy::getProcedure('Manage')->setDimension(2)->getShopName();
$shopNameOpt = '<select class="m-wrap" name="shopname" id="city-element">';
foreach ($shopNameList as $key => $value) {
$selected = $this->getUrlVar('shopname') == $value['cityid'] . ',' . $value['shopname'] ? 'selected=selected' : '';
$shopNameOpt .= '<option ' . $selected . ' value="' . $value['cityid'] . ',' . $value['shopname'] . '">' . $value['cityNshopname'] . '</option>';
}
$shopNameOpt .= '</select>';
if ($this->isAjax() && $_POST) {
$v = Doo::loadHelper('DooValidator', true);
$success = true;
$errors = array();
DOO::cache('php')->set($configKey, json_encode($_POST), 3600 * 24 * 365 * 100);
// 处理返回路径
if ($success) {
$errors = ConfigController::$dataTableUrl;
}
$this->ajaxFormResult($success, $errors);
} else {
$infoCache = DOO::cache('php')->get($configKey);
$info = json_decode($infoCache, true);
// echo Doo::conf()->CACHE_PATH = $cachePath;
Doo::loadClassAt('html/DooFormExt', 'default');
$form = new DooFormExt(array('method' => 'post', 'renderFormat' => 'html', 'action' => '', 'attributes' => array('id' => 'js-form', 'class' => 'form-horizontal'), 'elements' => array('errors' => array('display', array('div' => false, 'label' => false, 'content' => '<div id="js-form-errors" class=""></div><div style="clear:both"></div>')), 'peiSwitch' => array('select', array('label' => L('菜品调剂发送开关:'), 'attributes' => array('class' => "m-wrap"), 'multioptions' => array(0 => '关', 1 => '开'), 'value' => isset($info['peiSwitch']) ? $info['peiSwitch'] : '0')), 'waimaiSum' => array('text', array('label' => '外卖起送份数', 'attributes' => array('class' => "m-wrap"), 'value' => isset($info['waimaiSum']) ? $info['waimaiSum'] : '1')), 'aboutTxt' => array('display', array('label' => '关于我们', 'attributes' => array('class' => "m-wrap"), 'content' => '<script id="about" type="text/plain" style="width:1024px;height:500px;">' . $info['editorValue'] . '</script>')), 'saveAndSee' => array('button', array('div' => false, 'left' => ' ', 'label' => '保存&查看<i class="icon-arrow-right"></i>', 'attributes' => array('class' => "btn blue"), 'value' => 1)), 'cancelAndReturn' => array('display', array('div' => false, 'left' => ' ', 'right' => '</div>', 'content' => '<a class="btn" href="' . ConfigController::$dataTableUrl . '"><i class="icon-arrow-left"></i>取消&返回</a>')))));
$this->contentlayoutRender($form->render());
}
}
示例3: getProcedure
public static function getProcedure($dbName)
{
$dbName = ucfirst($dbName);
if (!isset(self::$_procedureList[$dbName])) {
Doo::loadClassAt('procedures/' . $dbName, 'default');
self::$_procedureList[$dbName] = new $dbName();
}
return self::$_procedureList[$dbName];
}
示例4: dataTable
public function dataTable()
{
Doo::loadClassAt('html/DataTable', 'default');
Doo::loadClassAt('html/DooFormExt', 'default');
$dt = new DataTable();
$param['starttime'] = $this->getUrlVar('starttime', NULL);
$param['endtime'] = $this->getUrlVar('endtime', NULL);
//$param['bookid'] = $this->getUrlVar('bookid',NULL);
$param['order'] = $this->getUrlVar('order', NULL);
$param['bookname'] = $this->getUrlVar('bookname', NULL);
//$param['booktypeid'] = $this->getUrlVar('booktypeid',0);
$param['waimai'] = $this->getUrlVar('waimai', '2');
$param['shopname'] = $this->getUrlVar('shopname', '');
$export = $this->getUrlVar('export');
// 表头
$header = array('bookid' => array('name' => '菜品ID'), 'title' => array('name' => '菜品名称'), 'sum' => array('name' => '销量'), 'price' => array('name' => '微信单价'), 'totle' => array('name' => '总价'));
//所有店列表
$shopNameList = DBproxy::getProcedure('Manage')->setDimension(2)->getShopName();
$shopNameOpt = '<select class="m-wrap" name="shopname" id="city-element"><option>全部门店</option>';
foreach ($shopNameList as $key => $value) {
$selected = $this->getUrlVar('shopname') == $value['cityid'] . ',' . $value['shopname'] ? 'selected=selected' : '';
$shopNameOpt .= '<option ' . $selected . ' value="' . $value['cityid'] . ',' . $value['shopname'] . '">' . $value['cityNshopname'] . '</option>';
}
$shopNameOpt .= '</select>';
$res = DBproxy::getProcedure('Manage')->setDimension(2)->queryOrderHit($param);
$sum = 0;
foreach ($res['data'] as $key => $value) {
$sum += $value['sum'];
$res['data'][$key]['totle'] = $value['sum'] * $value['price'];
}
// 生产表格
$content = $dt->setTitle('')->setAttr(array('class' => 'table table-hover ', 'id' => 'js-queryTable '))->setHeader($header)->setData($res['data'])->setTopContent('')->setBottomContent('')->setDefaultValue('unkown')->render(false);
//查询表单
$form = new DooFormExt(array('method' => 'get', 'renderFormat' => 'html', 'action' => '', 'attributes' => array('id' => 'js-get-form', 'class' => 'form-horizontal'), 'elements' => array('starttime' => array('text', array('left' => ' ', 'hide-label' => true, 'div' => false, 'placeholder' => '开始日期', 'attributes' => array('class' => "m-wrap", "onClick" => "WdatePicker()"), 'value' => $this->getUrlVar('starttime'))), 'endtime' => array('text', array('left' => ' ', 'hide-label' => true, 'div' => false, 'placeholder' => '结束日期', 'attributes' => array('class' => "m-wrap", "onClick" => "WdatePicker({maxDate:'%y-%M-%d'})"), 'value' => $this->getUrlVar('endtime'))), 'shopname' => array('display', array('left' => '', 'hide-label' => true, 'div' => false, 'attributes' => array('class' => 'small m-wrap'), 'content' => $shopNameOpt)), 'bookname' => array('text', array('left' => ' ', 'hide-label' => true, 'div' => false, 'placeholder' => '菜品名称', 'attributes' => array('class' => "m-wrap"), 'value' => $this->getUrlVar('bookname'))), 'waimai' => array('select', array('left' => ' 是否外卖', 'hide-label' => true, 'div' => false, 'attributes' => array('class' => 'small m-wrap'), 'multioptions' => array('2' => '全部', '1' => '是', '0' => '否'), 'value' => $this->getUrlVar('waimai'))), 'order' => array('select', array('left' => ' 点击量排序', 'hide-label' => true, 'div' => false, 'attributes' => array('class' => 'small m-wrap'), 'multioptions' => array('desc' => '多', 'asc' => '少'), 'value' => $this->getUrlVar('order'))), 'search' => array('button', array('div' => false, 'label' => '<i class="icon-search"></i>查询', 'attributes' => array('class' => "btn blue"), 'value' => 1)), 'export' => array('button', array('div' => false, 'label' => ' <i class="icon-export"></i> 导出', 'attributes' => array('class' => "btn black"), 'value' => 1)))));
$sumDiv = '销售总数量:' . $sum;
$content .= $sumDiv;
//export
if (trim($export) == 1) {
exportExcel($content);
exit;
}
// 显示模版
$this->contentlayoutRender($form->render() . $content);
}
示例5: in
/**
* 登录
*/
public function in()
{
if ($this->_user->isLogin()) {
$result = $this->_user->logout();
}
// 自动登录
// if($this->_user->autoLogin()) {
// $this->alert('自动登录成功','success');
// return;
// }
if ($this->isAjax() && $_POST) {
$result = $this->_user->login($_POST['username'], $_POST['password'], $_POST['safecode'], $_POST['lang'], isset($_POST['remember']) ? 1 : 0);
$this->ajaxFormResult($result['success'], $result['success'] ? adminAppUrl('home') : $result['errors']);
} else {
Doo::loadClassAt('html/DooFormExt', 'default');
$form = new DooFormExt(array('method' => 'post', 'renderFormat' => 'array', 'action' => '', 'attributes' => array('id' => 'js-form', 'class' => 'form-vertical login-form'), 'elements' => array('username' => array('text', array('hide-label' => FALSE, 'placeholder' => '用户名', 'attributes' => array('class' => "m-wrap placeholder-no-fix"))), 'lang' => array('select', array('multioptions' => Doo::conf()->langList, 'hide-label' => FALSE, 'attributes' => array('class' => "m-wrap small"))), 'password' => array('password', array('hide-label' => FALSE, 'placeholder' => '密码', 'attributes' => array('class' => "m-wrap placeholder-no-fix"))), 'remember' => array('checkbox', array('hide-label' => FALSE, 'div' => FALSE, 'attributes' => array('class' => ""))), 'safecode' => array('text', array('div' => FALSE, 'hide-label' => FALSE, 'placeholder' => '验证码', 'attributes' => array('class' => "m-wrap small"))))));
$this->renderc($this->_templateDefault . '/login/in', $form->render());
}
}
示例6: checkAuthority
/**
* 检查页面权限
* @param unknown $authority
* @param unknown $checkvalue
* @return boolean
*/
public function checkAuthority($authority, $checkvalue)
{
if (empty($authority)) {
return false;
}
//超管直接返回成功
if ($authority == '-1') {
return true;
}
Doo::loadClassAt('Menu', 'default');
$menu = new menu(DBproxy::getManage());
$menuList = $menu->getMenuArray();
foreach ($menuList as $key => $var) {
if (empty($var['url'])) {
continue;
}
if (strpos($var['url'], '/') !== 0) {
continue;
}
$menuid = -2;
if (strpos($var['url'], '/') === 0) {
$first = '';
} else {
$first = '/';
}
// var_dump($_SERVER['REDIRECT_URL'] , trim('/'.Doo::conf()->adminRoute.$first.$var['url']),'<br>');
//寻找后台菜单URL和当前URL 是否匹配。
if ($_SERVER['REDIRECT_URL'] == trim('/' . Doo::conf()->adminRoute . $first . $var['url'])) {
$menuid = $var['id'];
// echo '<pre>';var_dump($_SESSION['authory'],isset($authority[$menuid]),$var);
// var_dump($authority,$menuid,$checkvalue);die;
}
if (isset($authority[$menuid]) && ($authority[$menuid] & $checkvalue) == $checkvalue) {
return true;
}
}
return false;
}
示例7: _getFormConfig
/**
* 取得表单配置
* @param boolean $isInsert 1 是插入表单配置,0 是修改表单
* @param array $data 修改表单时传入数组
* @return array
*/
protected function _getFormConfig($isInsert = true, $data = array())
{
Doo::loadClassAt('DataExt', 'default');
$dataExt = new DataExt();
$insertForm = array('method' => 'post', 'renderFormat' => 'html', 'action' => '', 'attributes' => array('id' => 'js-form', 'class' => 'form-horizontal'), 'elements' => array('errors' => array('display', array('div' => false, 'label-hide' => true, 'content' => '<div id="js-form-errors" class=""></div><div style="clear:both"></div>')), 'name' => array('text', array('label' => '门店名称:', 'attributes' => array('class' => "m-wrap"), 'value' => '')), 'longitude' => array('text', array('label' => '经度:', 'attributes' => array('class' => "m-wrap"), 'value' => '')), 'latitude' => array('text', array('label' => '纬度', 'attributes' => array('class' => "m-wrap"), 'value' => '')), 'city' => array('select', array('label' => L('城市:'), 'attributes' => array('class' => "m-wrap"), 'multioptions' => MapController::$city, 'value' => '')), 'status' => array('select', array('label' => L('可用状态:'), 'attributes' => array('class' => "m-wrap"), 'multioptions' => MapController::$status, 'value' => 0)), 'saveAndReutrn' => array('button', array('div' => false, 'left' => '<div class="form-actions js-submitButton">', 'label' => '<i class="icon-arrow-left"></i>保存&返回', 'attributes' => array('class' => "btn blue"), 'value' => 1)), 'saveAndAdd' => array('button', array('div' => false, 'left' => ' ', 'label' => '<i class="icon-plus"></i>保存&新增', 'attributes' => array('class' => "btn blue"), 'value' => 1)), 'cancel' => array('display', array('div' => false, 'left' => ' ', 'content' => '<a class="btn" href="' . $_SERVER['REQUEST_URI'] . '"><i class="icon-undo"></i>取消</a>')), 'cancelAndReturn' => array('display', array('div' => false, 'left' => ' ', 'right' => '</div>', 'content' => '<a class="btn" href="' . MapController::$dataTableUrl . '"><i class="icon-arrow-left"></i>取消&返回</a>'))));
if ($isInsert) {
return $insertForm;
} else {
// 将数据写入表单
foreach ($data as $key => $val) {
if (isset($insertForm['elements'][$key])) {
$insertForm['elements'][$key][1]['value'] = $val;
}
}
return $insertForm;
}
}
示例8: _getFormConfig
/**
* 取得表单配置
* @param boolean $isInsert 1 是插入表单配置,0 是修改表单
* @param array $data 修改表单时传入数组
* @return array
*/
protected function _getFormConfig($isInsert = true, $data = array(), $info = array())
{
Doo::loadClassAt('DataExt', 'default');
$dataExt = new DataExt();
$insertForm = array('method' => 'post', 'renderFormat' => 'html', 'action' => '', 'attributes' => array('id' => 'js-form', 'class' => 'form-horizontal'), 'elements' => array('errors' => array('display', array('div' => false, 'label-hide' => true, 'content' => '<div id="js-form-errors" class=""></div><div style="clear:both"></div>')), 'cityid' => array('display', array('label' => L('所属城市:'), 'attributes' => array('class' => "m-wrap"), 'content' => PeiSongController::$city)), 'shopname' => array('text', array('label' => L('店名:'), 'attributes' => array('class' => "m-wrap"), 'value' => '')), 'shopNamePhone' => array('text', array('label' => L('店长电话:'), 'attributes' => array('class' => "m-wrap"), 'value' => '')), 'peisongPhone' => array('text', array('label' => L('配送间电话:'), 'attributes' => array('class' => "m-wrap"), 'value' => '')), 'saveAndReutrn' => array('button', array('div' => false, 'left' => '<div class="form-actions js-submitButton">', 'label' => '<i class="icon-arrow-left"></i>' . L('保存&返回'), 'attributes' => array('class' => "btn blue"), 'value' => 1)), 'saveAndAdd' => array('button', array('div' => false, 'left' => ' ', 'label' => '<i class="icon-plus"></i>' . L('保存&新增'), 'attributes' => array('class' => "btn blue"), 'value' => 1)), 'cancel' => array('display', array('div' => false, 'left' => ' ', 'content' => '<a class="btn" href="' . $_SERVER['REQUEST_URI'] . '"><i class="icon-undo"></i>' . L('取消') . '</a>')), 'cancelAndReturn' => array('display', array('div' => false, 'left' => ' ', 'right' => '</div>', 'content' => '<a class="btn" href="' . PeiSongController::$dataTableUrl . '"><i class="icon-arrow-left"></i>' . L('取消&返回') . '</a>'))));
if ($isInsert) {
return $insertForm;
} else {
// 将数据写入表单
foreach ($data as $key => $val) {
if (isset($insertForm['elements'][$key])) {
if ($key == 'name') {
$val = $data['cname'];
}
$insertForm['elements'][$key][1]['value'] = $val;
}
}
$insertForm['elements']['cityid'][1]['content'] = '<select class="m-wrap" name="city" id="city-element"><option value="0">' . L('顶级城市') . '</option>' . City::cateToOption($data['cityid'], false) . '</select>';
return $insertForm;
}
}
示例9: cacheKV
public function cacheKV()
{
Doo::loadClassAt('KVCache', 'default');
$KVCache = new KVCache();
return $this->_redis = $KVCache->redis();
}
示例10: session_start
session_start();
include '../protected/config/common.conf.php';
include '../protected/config/routes.default.conf.php';
include '../protected/config/db.default.conf.php';
include '../protected/config/timezone.conf.php';
include '../protected/config/area.conf.php';
include '../protected/module/default/class/func.php';
// 旧方法库
#Just include this for production mode
//include $config['BASE_PATH'].'deployment/deploy.php';
include $config['BASE_PATH'] . 'Doo.php';
include $config['BASE_PATH'] . 'app/DooConfig.php';
# Uncomment for auto loading the framework classes.
//spl_autoload_register('Doo::autoload');
Doo::conf()->set($config);
# remove this if you wish to see the normal PHP error view.
include $config['BASE_PATH'] . 'diagnostic/debug.php';
# database usage
//Doo::useDbReplicate(); #for db replication master-slave usage
//Doo::db()->setMap($dbmap);
Doo::conf()->add('dbconfig', $dbconfig);
Doo::loadClassAt('DBproxy', 'default');
// Doo::db()->setDb($dbconfig, $config['APP_MODE']);
// Doo::db()->sql_tracking = true; #for debugging/profiling purpose
Doo::app()->route = $route;
# Uncomment for DB profiling
//Doo::logger()->beginDbProfile('doowebsite');
Doo::app()->run();
//Doo::logger()->endDbProfile('doowebsite');
Doo::logger()->rotateFile(102400);
Doo::logger()->writeLogs('framework/' . date('Ym') . '/' . date('d') . '.log', false);
示例11: _getPasswordFormConfig
/**
* 取得修改密码表单配置
* @param boolean $isInsert 1 是插入表单配置,0 是修改表单
* @param array $data 修改表单时传入数组
* @return array
*/
protected function _getPasswordFormConfig($isInsert = true, $data = array())
{
Doo::loadClassAt('DataExt', 'default');
$dataExt = new DataExt();
$insertForm = array('method' => 'post', 'renderFormat' => 'html', 'action' => '', 'attributes' => array('id' => 'js-form', 'class' => 'form-horizontal'), 'elements' => array('errors' => array('display', array('div' => false, 'label-hide' => true, 'content' => '<div id="js-form-errors" class=""></div><div style="clear:both"></div>')), 'name' => array('text', array('label' => '操作员姓名', 'attributes' => array('class' => "m-wrap small"), 'value' => '')), 'uname' => array('text', array('label' => '登陆账号', 'attributes' => array('class' => "m-wrap small"), 'value' => '')), 'password' => array('password', array('label' => '原登陆密码', 'attributes' => array('class' => "m-wrap small"), 'value' => '')), 'password1' => array('password', array('label' => '新登陆密码', 'attributes' => array('class' => "m-wrap small"), 'value' => '')), 'password2' => array('password', array('label' => '再次输入密码', 'attributes' => array('class' => "m-wrap small"), 'value' => '')), 'saveAndReutrn' => array('button', array('div' => false, 'left' => '<div class="form-actions js-submitButton">', 'label' => '<i class="icon-arrow-left"></i>保存', 'attributes' => array('class' => "btn blue"), 'value' => 1)), 'cancel' => array('display', array('div' => false, 'left' => ' ', 'content' => '<a class="btn" href="' . $_SERVER['REQUEST_URI'] . '"><i class="icon-undo"></i>取消</a>'))));
if ($isInsert) {
return $insertForm;
} else {
//编辑时登录账户不需要修改
$insertForm['elements']['name'][0] = 'display';
$insertForm['elements']['name'][1]['content'] = '<label class="m-wrap text">' . $data['name'] . '<input type="hidden" name="name" id="name-element" value="' . $data['name'] . '"> </label>';
//编辑时登录账户不需要修改
$insertForm['elements']['uname'][0] = 'display';
$insertForm['elements']['uname'][1]['content'] = '<label class="m-wrap text">' . $data['uname'] . '<input type="hidden" name="uname" id="uname-element" value="' . $data['uname'] . '"> </label>';
// 将数据写入表单
foreach ($data as $key => $val) {
if (isset($insertForm['elements'][$key])) {
$insertForm['elements'][$key][1]['value'] = $val;
}
}
return $insertForm;
}
}
示例12: _getFormConfig
/**
* 取得表单配置
* @param boolean $isInsert 1 是插入表单配置,0 是修改表单
* @param array $data 修改表单时传入数组
* @return array
*/
protected function _getFormConfig($isInsert = true, $data = array())
{
Doo::loadClassAt('DataExt', 'default');
$dataExt = new DataExt();
$id = isset($data['categoryid']) ? $data['categoryid'] : '';
$insertForm = array('method' => 'post', 'renderFormat' => 'html', 'action' => '', 'attributes' => array('id' => 'js-form', 'class' => 'form-horizontal'), 'elements' => array('errors' => array('display', array('div' => false, 'label-hide' => true, 'content' => '<div id="js-form-errors" class=""></div><div style="clear:both"></div>')), 'categoryid' => array('display', array('label' => L('父分类:'), 'attributes' => array('class' => "m-wrap"), 'content' => '<select id="categoryid-element" name="categoryid" class="m-wrap">' . Category::cateToOption($id) . '</select>')), 'name' => array('text', array('label' => L('名称:'), 'attributes' => array('class' => "m-wrap"), 'value' => '')), 'price' => array('text', array('label' => L('价格'), 'attributes' => array('class' => "m-wrap"), 'value' => 0)), 'wxprice' => array('text', array('label' => L('微信预定价格'), 'attributes' => array('class' => "m-wrap"), 'value' => 0)), 'peiSongSum' => array('text', array('label' => L('配送调度数'), 'attributes' => array('class' => "m-wrap"), 'value' => 10)), 'la' => array('text', array('label' => L('辣程序(越高越辣)'), 'attributes' => array('class' => "m-wrap"), 'value' => 0)), 'sort' => array('text', array('label' => L('排序:'), 'attributes' => array('class' => "m-wrap"), 'value' => '', 'help' => '数字越大排越前')), 'status' => array('select', array('label' => L('可用状态:'), 'attributes' => array('class' => "m-wrap"), 'multioptions' => BookController::$status, 'value' => 0)), 'descript' => array('text', array('label' => L('描述'), 'attributes' => array('class' => "m-wrap"), 'value' => '')), 'img' => array('file', array('label' => L('菜品图片:'), 'attributes' => array('class' => "m-wrap"), 'help' => '图片规格:(宽*高)640*480px,大小200-300k左右')), 'saveAndReutrn' => array('button', array('div' => false, 'left' => '<div class="form-actions js-submitButton">', 'label' => '<i class="icon-arrow-left"></i>保存&返回', 'attributes' => array('class' => "btn blue"), 'value' => 1)), 'saveAndAdd' => array('button', array('div' => false, 'left' => ' ', 'label' => '<i class="icon-plus"></i>保存&新增', 'attributes' => array('class' => "btn blue"), 'value' => 1)), 'cancel' => array('display', array('div' => false, 'left' => ' ', 'content' => '<a class="btn" href="' . $_SERVER['REQUEST_URI'] . '"><i class="icon-undo"></i>取消</a>')), 'cancelAndReturn' => array('display', array('div' => false, 'left' => ' ', 'right' => '</div>', 'content' => '<a class="btn" href="' . BookController::$dataTableUrl . '"><i class="icon-arrow-left"></i>取消&返回</a>'))));
if ($isInsert) {
return $insertForm;
} else {
#$insertForm['elements']['img'][1]['help'].= '<label class="m-wrap text"><img style="height:100px" src="' . Doo::conf()->APP_URL.$data['img'] . '"> <input type="hidden" name="img" id="img-element" value="' . $data['img'] . '"> </label>';
#$insertForm['elements']['img'][0] = 'display';
#$insertForm['elements']['img'][1]['content'] = '<label class="m-wrap text"><img style="height:100px" src="' . Doo::conf()->APP_URL.$data['img'] . '"> <input type="hidden" name="img" id="img-element" value="' . $data['img'] . '"> </label>';
// 将数据写入表单
foreach ($data as $key => $val) {
if (isset($insertForm['elements'][$key])) {
$insertForm['elements'][$key][1]['value'] = $val;
}
}
$insertForm['elements']['img'][1]['help'] .= '<label class="m-wrap text"><img style="height:100px" src="' . Doo::conf()->APP_URL . $data['img'] . '"> <input type="hidden" name="img" id="img-element" value="' . $data['img'] . '"> </label>';
$insertForm['elements']['img'][1]['value'] = '';
return $insertForm;
}
}
示例13: sendMessage
private function sendMessage($msgInfo)
{
Doo::loadClassAt('HttpClient', 'default');
$client = new HttpClient(FEYIN_HOST, FEYIN_PORT);
if (!$client->post('/api/sendMsg', $msgInfo)) {
//提交失败
return 'faild';
} else {
return $client->getContent();
}
}
示例14: beforeRun
public function beforeRun($resource, $action)
{
header("Content-type:text/html;charset=utf-8");
parent::beforeRun($resource, $action);
Doo::loadClassAt('User', 'default');
$this->_user = new User(DBproxy::getManage());
$this->_pageAuth = new PageAuth();
$this->_action = $action;
if ($this->_checkIsLogin) {
if (!$this->_user->isLogin()) {
$this->notLoginPage();
exit;
}
} else {
$this->_checkPageAuth = TRUE;
// 关闭登录验证时,自动关闭页面权限验证
}
if ($this->_checkPageAuth) {
$this->_currentPageAuth = isset($this->_checkActionAuthList[$action]) ? $this->_checkActionAuthList[$action] : $this->_checkActionAuthList['notauth'];
if (!$this->_pageAuth->auth($this->_currentPageAuth)) {
$this->notAuthPage();
exit;
}
}
$this->_pageTitle = Doo::conf()->siteName;
$this->_opname = $this->_user->getUsername();
$this->init();
}
示例15: getRoleAuthority
/**
* 获取角色菜单权限
* @param int $roleid 角色ID
* @return array 权限列表(menu_id,perm_id)
*/
public function getRoleAuthority($roleid)
{
Doo::loadClassAt('Role', 'default');
$role = new role();
$result = $role->get_role_perm($roleid);
foreach ($result as $key => $value) {
$res[] = array('menu_id' => $key, 'perm_id' => $value);
}
return $res;
}