本文整理汇总了PHP中module_entries函数的典型用法代码示例。如果您正苦于以下问题:PHP module_entries函数的具体用法?PHP module_entries怎么用?PHP module_entries使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了module_entries函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
foreach ($_GPC['module'] as $row) {
if (isset($modules[$row])) {
$module[] = $row;
}
}
}
$params = $insert = array(':position' => '3');
$sql = 'DELETE FROM ' . tablename('site_nav') . " WHERE `multiid` = :multiid AND `position` = :position AND `module` <> :module";
$params[':multiid'] = $id;
$params[':module'] = '';
$insert['uniacid'] = $_W['uniacid'];
$insert['multiid'] = $id;
$insert['status'] = '1';
if (pdo_query($sql, $params)) {
foreach ($module as $value) {
$entry = module_entries($value, array('home'));
$insert['module'] = $value;
$insert['name'] = $entry['home'][0]['title'];
$insert['url'] = $entry['home'][0]['url'];
pdo_insert('site_nav', $insert);
}
}
$quickmenu = array('template' => $_GPC['template'], 'enablemodule' => $module);
pdo_update('site_multi', array('quickmenu' => iserializer($quickmenu)), array('uniacid' => $_W['uniacid'], 'id' => $id));
message('快捷菜单模板设置成功!', url('site/multi/quickmenu', array('mtid' => $id, 'f' => $_GPC['f'])), 'success');
}
$path = IA_ROOT . '/app/themes/quick';
if (is_dir($path)) {
if ($handle = opendir($path)) {
while (false !== ($templatepath = readdir($handle))) {
$ext = pathinfo($templatepath);
示例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;
}
示例3: reply_search
if ($status != -1) {
$condition .= " AND status = '{$status}'";
}
if (isset($_GPC['keyword'])) {
$condition .= ' AND `name` LIKE :keyword';
$params[':keyword'] = "%{$_GPC['keyword']}%";
}
$replies = reply_search($condition, $params, $pindex, $psize, $total);
$pager = pagination($total, $pindex, $psize);
if (!empty($replies)) {
foreach ($replies as &$item) {
$condition = '`rid`=:rid';
$params = array();
$params[':rid'] = $item['id'];
$item['keywords'] = reply_keywords_search($condition, $params);
$entries = module_entries($m, array('rule'), $item['id']);
if (!empty($entries)) {
$item['options'] = $entries['rule'];
}
}
}
template('platform/reply');
}
if ($do == 'post') {
if ($_W['isajax'] && $_W['ispost']) {
$sql = 'SELECT `rid` FROM ' . tablename('rule_keyword') . " WHERE `uniacid` = :uniacid AND `content` = :content";
$result = pdo_fetchall($sql, array(':uniacid' => $_W['uniacid'], ':content' => $_GPC['keyword']));
if (!empty($result)) {
$keywords = array();
foreach ($result as $reply) {
$keywords[] = $reply['rid'];
示例4: load
$m = $_GPC['m'];
if (!empty($m)) {
load()->model('module');
$error = module_solution_check($m);
if (is_error($error)) {
message($error['message']);
}
$solution = module_fetch($m);
$title = ' 行业解决方案 - ' . $solution['title'];
$site = WeUtility::createModuleSite($m);
if (!is_error($site)) {
$method = 'doWebWelcome';
$welcome = @$site->{$method}();
}
if (empty($welcome)) {
$entries = module_entries($m, array('menu', 'home', 'profile', 'shortcut', 'cover'));
if ($_W['role'] == 'operator') {
foreach ($entries as $index1 => &$entry1) {
if ($index1 == 'cover') {
continue;
}
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' => $m, ':do' => $data['do'], 'state' => $data['state']));
if (empty($ixes)) {
unset($entry1[$index2]);
}
示例5: exit
}
if (pdo_insert('site_nav', $nav)) {
exit('success');
}
}
}
exit;
}
$bindings = array();
if (!empty($module)) {
$modulenames = array($m);
} else {
$modulenames = array_keys($modules);
}
foreach ($modulenames as $modulename) {
$entries = module_entries($modulename, array($type['name']));
if (!empty($entries[$type['name']])) {
$bindings[$modulename] = $entries[$type['name']];
}
}
$entries = array();
if (!empty($bindings)) {
foreach ($bindings as $modulename => $group) {
foreach ($group as $bind) {
$entries[] = array('module' => $modulename, 'from' => $bind['from'], 'title' => $bind['title'], 'url' => $bind['url']);
}
}
}
$multiid = intval($_GPC['multiid']);
$multis = pdo_fetchall('SELECT * FROM ' . tablename('site_multi') . ' WHERE uniacid = :uniacid', array(':uniacid' => $_W['uniacid']), 'id');
$site = $multis[$multiid];
示例6: 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;
}
示例7: 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);
//.........这里部分代码省略.........
示例8: defined
<?php
defined('IN_IA') or exit('Access Denied');
$callback = $_GPC['callback'];
load()->model('module');
$modulemenus = array();
$modules = uni_modules();
foreach ($modules as &$module) {
if ($module['type'] == 'system') {
continue;
}
$entries = module_entries($module['name'], array('home', 'profile', 'shortcut', 'function'));
if (empty($entries)) {
continue;
}
$module['home'] = $entries['menu'];
$module['profile'] = $entries['profile'];
$module['shortcut'] = $entries['shortcut'];
$module['function'] = $entries['function'];
if ($module['type'] == '') {
$module['type'] = 'other';
}
$modulemenus[$module['type']][$module['name']] = $module;
}
$modtypes = module_types();
$sysmenus = array(array('title' => '微站首页', 'url' => murl('home')), array('title' => '个人中心', 'url' => murl('mc')));
$multis = pdo_fetchall('SELECT id,title FROM ' . tablename('site_multi') . ' WHERE uniacid = :uniacid AND status != 0', array(':uniacid' => $_W['uniacid']));
if (!empty($multis)) {
foreach ($multis as $multi) {
$multimenus[] = array('title' => $multi['title'], 'url' => murl('home', array('t' => $multi['id'])));
}
示例9: empty
}
$icon = empty($_GPC['add_icon'][$k]) ? 'fa fa-puzzle-piece' : trim($_GPC['add_icon'][$k]);
if ($title && $url && $m) {
$data = array();
$data['do'] = '';
$data['module'] = $m;
$data['entry'] = 'mine';
$data['title'] = $title;
$data['url'] = $url;
$data['icon'] = $icon;
$data['displayorder'] = intval($_GPC['add_displayorder'][$k]);
pdo_insert('modules_bindings', $data);
} else {
continue;
}
}
}
message('更新模块菜单成功', 'refresh', 'success');
}
$modules = pdo_fetchall('SELECT mid, name, title FROM ' . tablename('modules') . ' WHERE issystem = 0');
foreach ($modules as &$li) {
$li['entry'] = module_entries($li['name'], array('mine', 'menu'));
}
template('extension/module-permission');
}
if ($do == 'del_bind') {
$eid = intval($_GPC['eid']);
$permission = intval($_GPC['permission']);
pdo_delete('modules_bindings', array('eid' => $eid, 'entry' => 'mine'));
exit;
}
示例10: module_solution_check
<?php
$modulename = $_GPC['m'];
$check = module_solution_check($modulename);
if (is_error($check)) {
message($check['message'], '', 'error');
}
$module_types = module_types();
$module = module_fetch($modulename);
define('ACTIVE_FRAME_URL', url('home/welcome/ext', array('m' => $modulename)));
$username = pdo_fetchcolumn('SELECT username FROM' . tablename('users') . ' WHERE uid = :uid', array(':uid' => intval($_GPC['uid'])));
$entries = module_entries($modulename, array('menu', 'rule', 'function'));
if (!empty($entries)) {
foreach ($entries as $index1 => &$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));
$entry2['eid'] = $eid;
if ($entry2['from'] == 'call') {
$entry2['eid'] = 0;
}
$entry2['do'] = $data['do'];
$entry2['state'] = $data['state'];
$entry2['dostate'] = $data['do'] . $data['state'];
$shuju[$index1][$i] = $entry2;
$i++;
}
}
示例11: array
if ($mod['url'] == 'all') {
$all = 1;
break;
} else {
$mineurl[] = $mod['url'];
}
}
}
$data = array();
if ($module['settings']) {
$data[] = array('title' => '参数设置', 'permission' => $m . '_settings');
}
if ($module['isrulefields']) {
$data[] = array('title' => '回复规则列表', 'permission' => $m . '_rule');
}
$entries = module_entries($m);
if (!empty($entries['home'])) {
$data[] = array('title' => '微站首页导航', 'permission' => $m . '_home');
}
if (!empty($entries['profile'])) {
$data[] = array('title' => '个人中心导航', 'permission' => $m . '_profile');
}
if (!empty($entries['shortcut'])) {
$data[] = array('title' => '快捷菜单', 'permission' => $m . '_shortcut');
}
if (!empty($entries['cover'])) {
foreach ($entries['cover'] as $cover) {
$data[] = array('title' => $cover['title'], 'permission' => $m . '_cover_' . $cover['do']);
}
}
if (!empty($entries['menu'])) {