/** * Echos the html for the specified menu array. * @param $DrawMenu array[menu_item] In the format of @a $Menu. */ function RenderMenu($DrawMenu) { echo '<ul>'; foreach ($DrawMenu as $child) { echo '<li>'; echo '<a href="' . xml_escape($child['link']) . '">' . xml_escape($child['name']) . ' (' . $child['quantity'] . ')</a>'; if (isset($child['children']) && !empty($child['children'])) { echo RenderMenu($child['children']); } echo '</li>'; } echo '</ul>'; }
<?php if (iCMSa != 1 || !admit('CFG')) { exit; } #Update links if (isset($_SESSION['renew'])) { try { require './lib/mcache.php'; require './lib/categories.php'; RenderMenu(); Latest(); RSS(); if (function_exists('glob') && ($glob = glob('cache/cat*.php'))) { foreach ($glob as $x) { unlink($x); } } unset($_SESSION['renew'], $glob, $x); include './admin/config.php'; return 1; } catch (Exception $e) { $view->info($lang['saved']); } } #Save if ($_POST) { $opt = array('url' => $_POST['url'], 'path' => $_POST['path'], 'nice' => (int) $_POST['nice']); require './lib/config.php'; $f = new Config('db'); try {
function commit(&$data) { $cfg = array(); Installer::$urlMode = $this->urls; #Content options - category IDs foreach ($this->catid as $lang => $id) { $cfg['start'][$lang] = $id; } require './cfg/content.php'; $o = new Config('content'); $o->save($cfg); $cfg = array(); require './cfg/main.php'; #Get Sblam! key if (function_exists('fsockopen')) { $key = @file_get_contents('http://sblam.com/keygen.html'); $cfg['captcha'] = 1; $cfg['sbKey'] = $key ? $key : NULL; } else { $cfg['captcha'] = 0; $cfg['sbKey'] = NULL; } #Main options - page title and URL format $cfg['title'] = $this->title; $cfg['RSS'] = $this->rss; $o = new Config('main'); $o->add('cfg', $cfg); $o->save(); #Database access - db.php $this->buildConfig($data); #Rebuild polls if (file_exists('./mod/polls')) { include './mod/polls/poll.php'; RebuildPoll(null, $this->db); } #Sort categories include './lib/categories.php'; RebuildTree($this->db); RSS(null, $this->db); #Create menu cache include './lib/mcache.php'; RenderMenu($this->db); #Finish :) $this->db->commit(); }