本文整理汇总了PHP中s::rollArray方法的典型用法代码示例。如果您正苦于以下问题:PHP s::rollArray方法的具体用法?PHP s::rollArray怎么用?PHP s::rollArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类s
的用法示例。
在下文中一共展示了s::rollArray方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: view
function view()
{
$tmp = $modules = array();
$file = SYS_ROOT . 'conf/global/modules.ini';
$tmp = ini::parse($file);
foreach ($tmp as $k => $v) {
$arr = explode('.', $k);
$modules[$arr[0]][] = array('module_name' => $arr[1], 'module_title' => $v['title'], 'module_version' => $v['ver']);
}
$tmp = $apps = array();
$file = SYS_ROOT . 'conf/global/apps.ini';
$tmp = ini::parse($file);
foreach ($tmp as $k => $v) {
$v['app'] = $k;
if ($v['in'] == '1') {
s::roll('appsin', $v);
if (isset($modules[$k])) {
s::rollArray('appsin' . $k, $modules[$k]);
}
} else {
s::roll('apps', $v);
if (isset($modules[$k])) {
s::rollArray('apps' . $k, $modules[$k]);
}
}
}
}
示例2: adapter
function adapter()
{
$adapter_file = APPS . self::$map['app'] . '/adapter.ini';
$array = ini::parse($adapter_file);
$action = self::$map['module'] . '.' . self::$map['action'];
if (self::$apps_excl) {
if (self::$map['app'] != 'system' || $action != 'profile.view') {
if (!isset(self::$apps_excl[self::$map['app']][$action])) {
return self::loadErrorPage();
}
}
}
if (!$array) {
return self::loadErrorPage();
}
if (!isset($array[$action])) {
return self::loadErrorPage();
}
$mtabs = $tabs = false;
foreach ($array as $k => $v) {
if (isset($v['rule'])) {
$rule = explode(',', $v['rule']);
$continue = true;
foreach ($rule as $u) {
$u = trim($u);
if ($u == RULE || $u == 'all') {
$continue = false;
}
}
if ($continue) {
continue;
}
}
if (arrays::testKey($v, 'ico')) {
$ico = 'tab_ico tab_ico_' . $v['ico'];
} else {
$ico = '';
}
if (arrays::testKey($v, 'mtab')) {
$active = false;
if ($action == $k) {
$active = true;
}
if ($v['mtab'] == 1) {
$name = $v['title'];
} else {
$name = $v['mtab'];
}
$list = explode('.', $k);
$link = SYS_DIR . self::$map['app'] . '/' . $list[0] . '/' . $list[1] . '/';
if (isset($v['right'])) {
if ($active) {
$addtabs[$list[0]][] = array('tab' => '<span class="' . $ico . '">' . $name . '</span>');
} else {
$addtabs[$list[0]][] = array('tab' => '<a href="' . $link . '" class="' . $ico . '">' . $name . '</a>');
}
} else {
if ($active) {
$mtabs[$list[0]][] = array('tab' => '<span class="' . $ico . '">' . $name . '</span>');
} else {
$mtabs[$list[0]][] = array('tab' => '<a href="' . $link . '" class="' . $ico . '">' . $name . '</a>');
}
}
} else {
if (arrays::testKey($v, 'tab')) {
$active = false;
if ($action == $k) {
$active = true;
}
if ($v['tab'] == 1) {
$name = $v['title'];
} else {
$name = $v['tab'];
}
$list = explode('.', $k);
$link = SYS_DIR . self::$map['app'] . '/' . $list[0] . '/' . $list[1] . '/';
if (isset($v['right'])) {
if ($active) {
$addtabs[] = array('tab' => '<span class="' . $ico . '">' . $name . '</span>');
} else {
$addtabs[] = array('tab' => '<a href="' . $link . '" class="' . $ico . '">' . $name . '</a>');
}
} else {
if ($active) {
$tabs[] = array('tab' => '<span class="' . $ico . '">' . $name . '</span>');
} else {
$tabs[] = array('tab' => '<a href="' . $link . '" class="' . $ico . '">' . $name . '</a>');
}
}
}
}
}
if (isset($mtabs[self::$map['module']]) && $mtabs[self::$map['module']]) {
s::rollArray('admin_tabs', $mtabs[self::$map['module']]);
s::set('admin_tabs', files::get(ROOT . STYLE_PATH . 'tmpls/tabs.html'));
if (isset($addtabs[self::$map['module']])) {
s::rollArray('admin_right_tabs', $addtabs[self::$map['module']]);
}
} else {
if ($tabs) {
//.........这里部分代码省略.........
示例3: getParentPages
function getParentPages($site_id = 1, $levels = false)
{
db::table('pages');
db::where('site_id', $site_id);
db::where('page_pub', '1');
db::where('page_child', '1');
$res = db::select('page_child', 'page_id', 'page_title', 'page_parent', 'page_pub');
$array = array();
if (!$levels) {
while ($row = mysql_fetch_assoc($res)) {
s::roll('parent_pages', $row);
}
} else {
$i = 0;
while ($row = mysql_fetch_assoc($res)) {
$i++;
if ($row['page_parent'] != '0') {
$page = self::getPage($row['page_parent']);
$row['page_title'] = $page['page_title'] . ' → ' . $row['page_title'];
}
$array[$row['page_title'] . $i] = $row;
}
}
ksort($array);
s::rollArray('parent_pages', $array);
}