/** * Returns a list of all design class in a folder * * @param string $folder folder where to start the search. */ function getDCFileList($folder) { global $c, $lang; $ret = array(); $ret[] = array($lang->get('no_design', 'No design selected'), ''); $dirhandle = opendir($c["basepath"] . $folder . '/'); while (false !== ($fname = readdir($dirhandle))) { $pgn_fname = $fname . "/dc_" . $fname . ".php"; if (is_dir($c["basepath"] . $folder . '/' . $fname) && file_exists($c["basepath"] . $folder . '/' . $pgn_fname)) { $ref = createDCRef($c["basepath"] . $folder . '/' . $pgn_fname); $ret[] = array($ref->getName(), $pgn_fname); unset($ref); } } closedir($dirhandle); return $ret; }
<? /********************************************************************** * @module Application **********************************************************************/ require_once "../../config.inc.php"; $auth = new auth("Administrator"); $page = new page("Designs"); require_once "menudef.inc.php"; $form = new SettingsForm($lang->get("designs", "Website Designs")); $ar = createNameValueArray('sitemap', 'NAME', 'MENU_ID'); $designclasses = getDCFileList('designs'); $form->addRadioSetting($lang->get('sel_design', 'Select Design'), 'CDS/MENU', $designclasses); $mclass = reg_load('CDS/MENU'); if ((value("set0", "", "") != $mclass) && (value("set0", "", "") != "")) $mclass = value("set0"); if ($mclass != "") { $form->addHeadline($lang->get('adjust/desugb', 'Adjust Design')); $ref = createDCRef($c["basepath"]."designs/".$mclass); $ref->editConfiguration(&$form); $form->add(new Spacer(2)); } $page->add($form); $page->draw(); $db->close(); ?>
/** * Draws the menu footer, use this instead of drawMenu for some special menus. * */ function drawMenuFooter() { global $c; if (!is_object($this->menuRef)) { $menuType = reg_load('CDS/MENU'); if ($menuType != "") $this->menuRef = createDCRef($c["basepath"]."designs/".$menuType); } if (is_object($this->menuRef)) echo $this->menuRef->getFooter(); }