• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP module_types函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中module_types函数的典型用法代码示例。如果您正苦于以下问题:PHP module_types函数的具体用法?PHP module_types怎么用?PHP module_types使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了module_types函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: buildframes

function buildframes($types = array('platform'), $modulename = '')
{
    global $_W;
    $ms = (include IA_ROOT . '/web/common/frames.inc.php');
    $ms = array_elements($types, $ms);
    if (in_array('ext', $types)) {
        load()->model('module');
        $frames = array();
        $modules = uni_modules();
        if (!empty($modules)) {
            foreach ($modules as $m) {
                if (in_array($m['name'], array('basic', 'news', 'music', 'userapi'))) {
                    continue;
                }
                $frames[$m['type']][] = $m;
            }
        }
        $types = module_types();
        if (!empty($frames)) {
            foreach ($frames as $type => $fs) {
                $items = array();
                if (!empty($fs)) {
                    foreach ($fs as $m) {
                        $items[] = array('title' => $m['title'], 'url' => url('home/welcome/ext', array('m' => $m['name'])));
                    }
                }
                $ms['ext'][] = array('title' => $types[$type]['title'], 'items' => $items);
            }
        }
    }
    if (in_array('solution', $types)) {
        load()->model('module');
        $module = module_fetch($modulename);
        $entries = module_entries($modulename, array('menu'));
        if ($_W['role'] == 'operator') {
            foreach ($entries as &$entry1) {
                foreach ($entry1 as $index2 => &$entry2) {
                    $url_arr = parse_url($entry2['url']);
                    $url_query = $url_arr['query'];
                    parse_str($url_query, $query_arr);
                    $eid = intval($query_arr['eid']);
                    $data = pdo_fetch('SELECT * FROM ' . tablename('modules_bindings') . ' WHERE eid = :eid', array(':eid' => $eid));
                    $ixes = pdo_fetchcolumn('SELECT id FROM ' . tablename('solution_acl') . ' WHERE uid = :uid AND module = :module AND do = :do AND state = :state', array('uid' => $_W['uid'], ':module' => $modulename, ':do' => $data['do'], 'state' => $data['state']));
                    if (empty($ixes)) {
                        unset($entry1[$index2]);
                    }
                }
            }
        }
        if ($entries['menu']) {
            $menus = array('title' => $module['title']);
            foreach ($entries['menu'] as $menu) {
                $menus['items'][] = array('title' => $menu['title'], 'url' => $menu['url']);
            }
            $ms['solution'][] = $menus;
        }
    }
    return $ms;
}
开发者ID:ruige123456,项目名称:dataMining,代码行数:59,代码来源:common.func.php


示例2: buildframes

function buildframes($types = array('platform'), $modulename = '')
{
    global $_W;
    $ms = (include IA_ROOT . '/web/common/frames.inc.php');
    load()->model('module');
    $frames = array();
    $modules = uni_modules();
    //print_r($module);die();
    if (!empty($modules)) {
        $sysmods = system_modules();
        foreach ($modules as $m) {
            if (in_array($m['name'], $sysmods)) {
                continue;
            }
            $frames[$m['type']][] = $m;
        }
    }
    $types = module_types();
    if (!empty($frames)) {
        foreach ($frames as $type => $fs) {
            $items = array();
            if (!empty($fs)) {
                foreach ($fs as $m) {
                    $items[] = array('title' => $m['title'], 'url' => url('home/welcome/ext', array('m' => $m['name'])));
                }
            }
            $ms['ext'][] = array('title' => $types[$type]['title'], 'items' => $items);
        }
    }
    if (in_array('solution', $types)) {
        load()->model('module');
        $error = module_solution_check($modulename);
        if (is_error($error)) {
        } else {
            $module = module_fetch($modulename);
            $entries = module_entries($modulename, array('menu'));
            if ($_W['role'] == 'operator') {
                foreach ($entries as &$entry1) {
                    foreach ($entry1 as $index2 => &$entry2) {
                        $url_arr = parse_url($entry2['url']);
                        $url_query = $url_arr['query'];
                        parse_str($url_query, $query_arr);
                        $eid = intval($query_arr['eid']);
                        $data = pdo_fetch('SELECT * FROM ' . tablename('modules_bindings') . ' WHERE eid = :eid', array(':eid' => $eid));
                        $ixes = pdo_fetchcolumn('SELECT id FROM ' . tablename('solution_acl') . ' WHERE uid = :uid AND module = :module AND do = :do AND state = :state', array('uid' => $_W['uid'], ':module' => $modulename, ':do' => $data['do'], 'state' => $data['state']));
                        if (empty($ixes)) {
                            unset($entry1[$index2]);
                        }
                    }
                }
            }
            if ($entries['menu']) {
                $menus = array('title' => '业务功能菜单');
                foreach ($entries['menu'] as $menu) {
                    $menus['items'][] = array('title' => $menu['title'], 'url' => $menu['url']);
                }
                $ms['solution'][] = $menus;
            }
        }
    }
    if (empty($_W['isfounder'])) {
        $urls = array();
        $permurls = pdo_fetchall("SELECT url FROM " . tablename('users_permission') . " WHERE uid = :uid AND uniacid = :uniacid", array(':uid' => $_W['uid'], ':uniacid' => $_W['uniacid']));
        if (!empty($permurls)) {
            foreach ($permurls as $row) {
                $urls[] = $row['url'];
            }
        }
        if (!empty($urls)) {
            foreach ($ms as $name => $section) {
                $hassection = false;
                foreach ($section as $i => $menus) {
                    $hasitems = false;
                    foreach ($menus['items'] as $j => $menu) {
                        $_W['setting']['permurls']['menus'][] = ltrim($menu['url'], './index.php?');
                        if (!in_array(rtrim(ltrim($menu['url'], './index.php?'), '&'), $urls)) {
                            unset($ms[$name][$i]['items'][$j]);
                        } else {
                            $hasitems = true;
                            $hassection = true;
                        }
                    }
                    if (!$hasitems) {
                        unset($ms[$name][$i]);
                    }
                }
                if (!$hassection) {
                    unset($ms[$name]);
                } else {
                    $_W['setting']['permurls']['sections'][] = $name;
                }
            }
        }
    }
    $_W['setting']['permurls']['urls'] = $urls;
    return $ms;
}
开发者ID:6662680,项目名称:qday_wx,代码行数:97,代码来源:common.func.php


示例3: message

        message('模块更新成功! <br> 由于数据库更新, 可能会产生多余的字段. 你可以按照需要删除.<div><a class="btn btn-primary" href="' . url('system/database/trim') . '">现在去删除</a>&nbsp;&nbsp;&nbsp;<a class="btn btn-default" href="' . url('extension/module/') . '">返回模块列表</a></div>', '', 'success');
    } else {
        message('模块更新成功!', referer(), 'success');
    }
}
if ($do == 'designer') {
    if (empty($_W['isfounder'])) {
        message('您没有设计新模块的权限', '', 'error');
    }
    $_W['page']['title'] = '设计新模块 - 模块 - 扩展';
    load()->model('module');
    $available = array();
    $available['download'] = class_exists('ZipArchive');
    $available['create'] = @is_writable(IA_ROOT . '/addons');
    $mtypes = m_msg_types();
    $modtypes = module_types();
    $versions = array();
    $versions[] = '0.6';
    $m = array();
    $m['platform'] = array();
    $m['platform']['subscribes'] = array();
    $m['platform']['handles'] = array();
    $m['site'] = array();
    $m['versions'] = array();
    if (checksubmit() && $available[$_GPC['method']]) {
        $m['application']['name'] = trim($_GPC['application']['name']);
        if (empty($m['application']['name']) || preg_match('/\\*\\/|\\/\\*|eval|\\$\\_/i', $m['application']['name'])) {
            message('请输入有效的模块名称. ');
        }
        $m['application']['identifie'] = trim($_GPC['application']['identifie']);
        if (empty($m['application']['identifie']) || !preg_match('/^[a-z][a-z\\d_]+$/i', $m['application']['identifie'])) {
开发者ID:nsoff,项目名称:wdlcms,代码行数:31,代码来源:module.ctrl.php


示例4: buildframes

function buildframes($frame = array('platform'))
{
    global $_W, $_GPC;
    if ($_W['role'] == 'clerk') {
        return false;
    }
    $GLOBALS['top_nav'] = pdo_fetchall('SELECT name, title, append_title FROM ' . tablename('core_menu') . ' WHERE pid = 0 AND is_display = 1 ORDER BY displayorder DESC');
    $ms = cache_load('system_frame');
    if (empty($ms)) {
        cache_build_frame_menu();
        $ms = cache_load('system_frame');
    }
    load()->model('module');
    $frames = array();
    $modules = uni_modules(false);
    $modules_temp = array_keys($modules);
    $status = uni_user_permission_exist();
    if (is_error($status)) {
        $modules_temp = pdo_fetchall('SELECT type FROM ' . tablename('users_permission') . ' WHERE uniacid = :uniacid AND uid = :uid AND type != :type', array(':uniacid' => $_W['uniacid'], ':uid' => $_W['uid'], ':type' => 'system'), 'type');
        if (!empty($modules_temp)) {
            $modules_temp = array_keys($modules_temp);
        } else {
            $modules = array();
        }
    }
    if (!empty($modules)) {
        $sysmods = system_modules();
        foreach ($modules as $m) {
            if (in_array($m['name'], $sysmods)) {
                $_W['setting']['permurls']['modules'][] = $m['name'];
                continue;
            }
            if (in_array($m['name'], $modules_temp)) {
                if ($m['enabled']) {
                    $frames[$m['type']][] = $m;
                }
                $_W['setting']['permurls']['modules'][] = $m['name'];
            }
        }
    }
    if (is_error($status)) {
        $system = array();
        $system = uni_user_permission('system');
        if (!empty($system) || !empty($modules_temp)) {
            foreach ($ms as $name => $section) {
                $hassection = false;
                foreach ($section as $i => $menus) {
                    $hasitems = false;
                    if (empty($menus['items'])) {
                        continue;
                    }
                    foreach ($menus['items'] as $j => $menu) {
                        if (!in_array($menu['permission_name'], $system)) {
                            unset($ms[$name][$i]['items'][$j]);
                        } else {
                            $hasitems = true;
                            $hassection = true;
                        }
                    }
                    if (!$hasitems) {
                        unset($ms[$name][$i]);
                    }
                }
                if (!$hassection) {
                    unset($ms[$name]);
                } else {
                    $_W['setting']['permurls']['sections'][] = $name;
                }
            }
        }
    }
    $types = module_types();
    if (!empty($frames)) {
        foreach ($frames as $type => $fs) {
            $items = array();
            if (!empty($fs)) {
                foreach ($fs as $m) {
                    $items[] = array('title' => $m['title'], 'url' => url('home/welcome/ext', array('m' => $m['name'])));
                }
            }
            $ms['ext'][] = array('title' => $types[$type]['title'], 'items' => $items);
        }
        if (is_error($status)) {
            $_W['setting']['permurls']['sections'][] = 'ext';
        }
    }
    $GLOBALS['ext_type'] = 0;
    $m = trim($_GPC['m']);
    $eid = intval($_GPC['eid']);
    if (FRAME == 'ext' && (!empty($m) || !empty($eid)) && $GLOBALS['ext_type'] != 2) {
        if (empty($_COOKIE['ext_type'])) {
            setcookie('ext_type', 1, TIMESTAMP + 8640000, "/");
            $_COOKIE['ext_type'] = 1;
        }
        $GLOBALS['ext_type'] = $_COOKIE['ext_type'];
        if (empty($m)) {
            $m = pdo_fetchcolumn('SELECT module FROM ' . tablename('modules_bindings') . ' WHERE eid = :eid', array(':eid' => $eid));
        }
        $module = module_fetch($m);
        $entries = module_entries($m);
//.........这里部分代码省略.........
开发者ID:weikit,项目名称:wechat-addon,代码行数:101,代码来源:common.func.php



注:本文中的module_types函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP module_url函数代码示例发布时间:2022-05-15
下一篇:
PHP module_templates函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap