本文整理汇总了PHP中COM_endBlock函数的典型用法代码示例。如果您正苦于以下问题:PHP COM_endBlock函数的具体用法?PHP COM_endBlock怎么用?PHP COM_endBlock使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了COM_endBlock函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: MAPS_getGroupOverlayForm
/**
* This function creates a Group of Overlay Form
*
* Creates a Form for a group of overlay using the supplied defaults (if specified).
*
* @param array $group array of values describing a group of overlay
* @return string HTML string of overlay form
*/
function MAPS_getGroupOverlayForm($group = array())
{
global $_CONF, $_TABLES, $_MAPS_CONF, $LANG_MAPS_1, $LANG_configselects, $LANG_ACCESS, $_USER, $_GROUPS, $_SCRIPTS;
$display = COM_startBlock('<h1>' . $LANG_MAPS_1['group_edit'] . ' ' . $group['o_group_name'] . '</h1>');
$template = COM_newTemplate($_CONF['path'] . 'plugins/maps/templates');
$template->set_file(array('map' => 'group_overlay_form.thtml'));
$template->set_var('yes', $LANG_MAPS_1['yes']);
$template->set_var('no', $LANG_MAPS_1['no']);
//informations
$template->set_var('group_overlay_presentation', $LANG_MAPS_1['group_overlay_presentation']);
$template->set_var('informations', $LANG_MAPS_1['informations']);
$template->set_var('name_label', $LANG_MAPS_1['group_overlay_name_label']);
$template->set_var('name', stripslashes($group['o_group_name']));
$template->set_var('required_field', $LANG_MAPS_1['required_field']);
//Form validation
$template->set_var('save_button', $LANG_MAPS_1['save_button']);
if ($group['o_group_id'] > 0) {
$template->set_var('delete_button', '<option value="delete">' . $LANG_MAPS_1['delete_button'] . '</option>');
} else {
$template->set_var('delete_button', '');
}
$template->set_var('ok_button', $LANG_MAPS_1['ok_button']);
if (isset($group['o_group_id'])) {
$template->set_var('o_group_id', '<input type="hidden" name="o_group_id" value="' . $group['o_group_id'] . '" />');
} else {
$template->set_var('o_group_id', '');
}
$display .= $template->parse('output', 'map');
$display .= COM_endBlock();
return $display;
}
示例2: polllist
/**
* Shows all polls in system
*
* List all the polls on the system if no $pid is provided
*
* @return string HTML for poll listing
*
*/
function polllist()
{
global $_CONF, $_TABLES, $_USER, $_PO_CONF, $LANG25, $LANG_LOGIN, $LANG_POLLS;
$retval = '';
if (empty($_USER['username']) && ($_CONF['loginrequired'] == 1 || $_PO_CONF['pollsloginrequired'] == 1)) {
$retval = COM_startBlock($LANG_LOGIN[1], '', COM_getBlockTemplate('_msg_block', 'header'));
$login = new Template($_CONF['path_layout'] . 'submit');
$login->set_file(array('login' => 'submitloginrequired.thtml'));
$login->set_var('xhtml', XHTML);
$login->set_var('login_message', $LANG_LOGIN[2]);
$login->set_var('site_url', $_CONF['site_url']);
$login->set_var('lang_login', $LANG_LOGIN[3]);
$login->set_var('lang_newuser', $LANG_LOGIN[4]);
$login->parse('output', 'login');
$retval .= $login->finish($login->get_var('output'));
$retval .= COM_endBlock(COM_getBlockTemplate('_msg_block', 'footer'));
} else {
require_once $_CONF['path_system'] . 'lib-admin.php';
$header_arr = array(array('text' => $LANG25[9], 'field' => 'topic', 'sort' => true), array('text' => $LANG25[20], 'field' => 'voters', 'sort' => true), array('text' => $LANG25[3], 'field' => 'unixdate', 'sort' => true), array('text' => $LANG_POLLS['open_poll'], 'field' => 'is_open', 'sort' => true));
$defsort_arr = array('field' => 'unixdate', 'direction' => 'desc');
$text_arr = array('has_menu' => false, 'title' => $LANG_POLLS['pollstitle'], 'instructions' => "", 'icon' => '', 'form_url' => '');
$query_arr = array('table' => 'polltopics', 'sql' => $sql = "SELECT *,UNIX_TIMESTAMP(date) AS unixdate, display " . "FROM {$_TABLES['polltopics']} WHERE 1=1", 'query_fields' => array('topic'), 'default_filter' => COM_getPermSQL(), 'query' => '', 'query_limit' => 0);
$retval .= ADMIN_list('polls', 'plugin_getListField_polls', $header_arr, $text_arr, $query_arr, $defsort_arr);
}
return $retval;
}
示例3: MG_access_denied
function MG_access_denied()
{
global $LANG_MG00, $LANG_ACCESS;
$display = COM_startBlock($LANG_ACCESS['accessdenied'], '', COM_getBlockTemplate('_msg_block', 'header')) . '<br' . XHTML . '>' . $LANG_MG00['access_denied_msg'] . COM_endBlock(COM_getBlockTemplate('_msg_block', 'footer'));
$display = MG_createHTMLDocument($display);
COM_output($display);
exit;
}
示例4: MG_invalidRequest
function MG_invalidRequest()
{
global $LANG_MG02, $_CONF, $_MG_CONF;
$retval = '';
$retval .= COM_startBlock($LANG_MG02['error_header'], '', COM_getBlockTemplate('_admin_block', 'header'));
$T = new Template($_MG_CONF['template_path']);
$T->set_file('admin', 'error.thtml');
$T->set_var('errormessage', $LANG_MG02['generic_error']);
$T->parse('output', 'admin');
$retval .= $T->finish($T->get_var('output'));
$retval .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
return $retval;
}
示例5: CLASSIFIEDS_admin_menu
/**
* Returns admin menu display
*
* Generates the admin menu from the template and returns the result as a string of HTML
*
* @return string HTML of admin menu
*/
function CLASSIFIEDS_admin_menu()
{
global $_CONF, $LANG_CLASSIFIEDS_1, $_TABLES;
$retval = COM_startBlock();
// generate the menu from the template
$menu = new Template($_CONF['path'] . 'plugins/classifieds/templates/menus');
$menu->set_file(array('menu' => 'admin_menu.thtml'));
$menu->set_var('site_url', $_CONF['site_url']);
$menu->set_var('classifieds', $LANG_CLASSIFIEDS_1['plugin_name']);
$menu->set_var('classifieds_list', $LANG_CLASSIFIEDS_1['classifieds_list']);
$menu->set_var('categories_list', $LANG_CLASSIFIEDS_1['categories_list']);
$retval .= $menu->parse('output', 'menu');
$retval .= COM_endBlock();
// retval results
return $retval;
}
示例6: EXP_adminList
/**
* Build the admin list of pages
* @return string HTML content
*/
function EXP_adminList()
{
global $_CONF, $_TABLES, $LANG_ADMIN, $LANG_ACCESS, $_CONF_EXP, $LANG_EX00;
USES_lib_admin();
$retval = '';
$header_arr = array(array('text' => $LANG_ADMIN['edit'], 'field' => 'edit', 'sort' => false), array('text' => 'Page ID', 'field' => 'exid', 'sort' => true), array('text' => 'Title', 'field' => 'title', 'sort' => true), array('text' => 'URL', 'field' => 'url', 'sort' => true), array('text' => 'Hits', 'field' => 'hits', 'sort' => true));
$menu_arr = array(array('url' => $_CONF['site_admin_url'] . '/plugins/' . $_CONF_EXP['pi_name'] . '/edit.php?exid=0', 'text' => 'Add New'), array('url' => $_CONF['site_admin_url'], 'text' => $LANG_ADMIN['admin_home']));
$defsort_arr = array('field' => 'exid', 'direction' => 'asc');
$header_str = $LANG_EX00['header'] . ' ' . $LANG_EX00['version'] . ' ' . $_CONF_EXP['pi_version'];
$retval .= COM_startBlock($header_str, '', COM_getBlockTemplate('_admin_block', 'header'));
$retval .= ADMIN_createMenu($menu_arr, 'Administer External Pages', plugin_geticon_external());
$text_arr = array('has_extras' => true, 'form_url' => "{$_CONF['site_admin_url']}/plugins/{$_CONF_EXP['pi_name']}/index.php");
$query_arr = array('table' => 'external', 'sql' => "SELECT * FROM {$_TABLES['external']} ", 'query_fields' => array('title', 'url'), 'default_filter' => COM_getPermSql());
$retval .= ADMIN_list('external', 'EXP_getAdminListField', $header_arr, $text_arr, $query_arr, $defsort_arr, '', '', '', $form_arr);
$retval .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
return $retval;
}
示例7: CUSTOM_handle404
function CUSTOM_handle404($alternate_url = '')
{
global $_CONF, $_USER, $LANG_404;
// send 404 in any case
header('HTTP/1.1 404 Not Found');
header('Status: 404 Not Found');
$display .= COM_startBlock($LANG_404[1]);
if (isset($_SERVER['SCRIPT_URI'])) {
$url = strip_tags($_SERVER['SCRIPT_URI']);
} else {
$request = $_SERVER['REQUEST_URI'];
$url = 'http://' . $_SERVER['HTTP_HOST'] . strip_tags($request);
}
// Add log stuff
if (isset($_USER['uid'])) {
$byuser = $_USER['uid'] . '@' . $_SERVER['REMOTE_ADDR'];
} else {
$byuser = 'anon@' . $_SERVER['REMOTE_ADDR'];
}
$refurl = $_SERVER['HTTP_REFERER'];
$remoteaddress = $_SERVER['REMOTE_ADDR'];
$timestamp = @strftime('%c');
$logentry = "404 Error generated by {$byuser} for url: {$url} - Referring url: {$refurl}";
$logfile = $_CONF['path_log'] . '404.log';
if (!($file = fopen($logfile, 'a'))) {
} else {
fputs($file, "{$timestamp} - {$logentry} \n");
}
$display .= CUSTOM_getStaticpage('404');
$display .= sprintf($LANG_404[2], $url);
if ($alternate_url != '') {
$display .= sprintf($LANG_404[4], $alternate_url);
} else {
$display .= $LANG_404[3];
}
$display .= COM_endBlock();
// $display = COM_createHTMLDocument($display, array('pagetitle' => $LANG_404[1]));
$display = COM_createHTMLDocument($display, array('what' => 'none', 'pagetitle' => $LANG_404[1], 'rightblock' => false));
COM_output($display);
exit;
// Do not want to go any further
}
示例8: _logoEdit
function _logoEdit()
{
global $_CONF, $_LOGO, $_TABLES, $LANG_ADMIN, $LANG_LOGO, $_IMAGE_TYPE;
$retval = '';
$menu_arr = array(array('url' => $_CONF['site_admin_url'], 'text' => $LANG_ADMIN['admin_home']));
$retval .= COM_startBlock($LANG_LOGO['logo_options'], '', COM_getBlockTemplate('_admin_block', 'header'));
$retval .= ADMIN_createMenu($menu_arr, $LANG_LOGO['instructions'], $_CONF['layout_url'] . '/images/icons/logo.' . $_IMAGE_TYPE);
$retval .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
if (file_exists($_CONF['path_html'] . '/images/' . $_LOGO['logo_name'])) {
$current_logo = '<img src="' . $_CONF['site_url'] . '/images/' . $_LOGO['logo_name'] . '" alt="" border="0"/>';
} else {
$current_logo = $LANG_LOGO['no_logo_graphic'];
}
$T = new Template($_CONF['path_layout'] . 'admin/logo/');
$T->set_file('admin', 'logo.thtml');
$T->set_var(array('s_form_action' => $_CONF['site_admin_url'] . '/logo.php', 'graphic_logo_selected' => $_LOGO['use_graphic_logo'] == 1 ? ' checked="checked"' : '', 'text_logo_selected' => $_LOGO['use_graphic_logo'] == 0 ? ' checked="checked"' : '', 'no_logo_selected' => $_LOGO['use_graphic_logo'] == -1 ? ' checked="checked"' : '', 'slogan_selected' => $_LOGO['display_site_slogan'] == 1 ? ' checked="checked"' : '', 'current_logo_graphic' => $current_logo));
$T->parse('output', 'admin');
$retval .= $T->finish($T->get_var('output'));
return $retval;
}
示例9: EVLIST_adminHeader
/**
* Create the common header for all admin functions
*
* @param string $page Current page. Used for selecting menus
* @return string HTML for admin header portion.
*/
function EVLIST_adminHeader($page)
{
global $_CONF, $LANG_ADMIN, $LANG_EVLIST, $_EV_CONF;
$retval = '';
USES_lib_admin();
$menu_arr = array();
if ($page == 'events') {
$menu_arr[] = array('url' => EVLIST_URL . '/event.php?edit=event', 'text' => $LANG_EVLIST['new_event']);
} else {
$menu_arr[] = array('url' => EVLIST_ADMIN_URL . '/index.php', 'text' => $LANG_EVLIST['events']);
}
if ($page == 'calendars') {
$menu_arr[] = array('url' => EVLIST_ADMIN_URL . '/index.php?editcal=x', 'text' => $LANG_EVLIST['new_calendar']);
} else {
$menu_arr[] = array('url' => EVLIST_ADMIN_URL . '/index.php?view=calendars', 'text' => $LANG_EVLIST['calendars']);
}
if ($page == 'categories') {
$menu_arr[] = array('url' => EVLIST_ADMIN_URL . '/index.php?editcat=x', 'text' => $LANG_EVLIST['new_category']);
} else {
$menu_arr[] = array('url' => EVLIST_ADMIN_URL . '/index.php?categories=x', 'text' => $LANG_EVLIST['categories']);
}
if ($_EV_CONF['enable_rsvp']) {
if ($page == 'tickettypes') {
$menu_arr[] = array('url' => EVLIST_ADMIN_URL . '/index.php?editticket=0', 'text' => $LANG_EVLIST['new_ticket_type']);
} else {
$menu_arr[] = array('url' => EVLIST_ADMIN_URL . '/index.php?tickettypes', 'text' => $LANG_EVLIST['ticket_types']);
}
}
$menu_arr[] = array('url' => EVLIST_ADMIN_URL . '/index.php?importcalendar=x', 'text' => $LANG_EVLIST['import_calendar']);
$menu_arr[] = array('url' => EVLIST_ADMIN_URL . '/index.php?import=x', 'text' => $LANG_EVLIST['import_from_csv']);
$menu_arr[] = array('url' => $_CONF['site_admin_url'], 'text' => $LANG_ADMIN['admin_home']);
$retval .= COM_startBlock('evList ' . $_EV_CONF['pi_version'], '', COM_getBlockTemplate('_admin_block', 'header'));
$retval .= ADMIN_createMenu($menu_arr, $LANG_EVLIST['admin_instr'][$page], plugin_geticon_evlist());
$retval .= COM_endBlock();
return $retval;
}
示例10: COM_applyFilter
if (isset($_GET['mode'])) {
$mode = COM_applyFilter($_GET['mode']);
}
}
$T = new Template($_MG_CONF['template_path']);
$T->set_file('admin', 'administration.thtml');
$T->set_var(array('site_admin_url' => $_CONF['site_admin_url'], 'site_url' => $_MG_CONF['site_url'], 'lang_admin' => $LANG_MG00['admin'], 'xhtml' => XHTML));
if ($mode == $LANG_MG01['save'] && !empty($LANG_MG01['save'])) {
MG_createUsers();
exit;
} elseif ($mode == $LANG_MG01['cancel']) {
echo COM_refresh($_MG_CONF['admin_url'] . 'index.php');
exit;
} else {
if (isset($_REQUEST['page'])) {
$page = COM_applyFilter($_REQUEST['page'], true) - 1;
if ($page < 0) {
$page = 0;
}
} else {
$page = 0;
}
$T->set_var(array('admin_body' => MG_selectUsers($page), 'title' => $LANG_MG01['batch_create_members'], 'lang_help' => '<img src="' . MG_getImageFile('button_help.png') . '" style="border:none;" alt="?"' . XHTML . '>', 'help_url' => $_MG_CONF['site_url'] . '/docs/usage.html#Batch_Create_Member_Albums'));
}
$T->parse('output', 'admin');
$display = COM_startBlock($LANG_MG00['admin'], '', COM_getBlockTemplate('_admin_block', 'header'));
$display .= MG_showAdminMenu('member_albums');
$display .= $T->finish($T->get_var('output'));
$display .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
$display = COM_createHTMLDocument($display);
COM_output($display);
示例11: LIB_import
function LIB_import($pi_name)
{
global $_CONF;
$lang_box_admin = "LANG_" . strtoupper($pi_name) . "_ADMIN";
global ${$lang_box_admin};
$lang_box_admin = ${$lang_box_admin};
$tmpl = new Template($_CONF['path'] . "plugins/" . THIS_PLUGIN . "/templates/admin/");
$tmpl->set_file(array('import' => 'import.thtml'));
$tmpl->set_var('site_admin_url', $_CONF['site_admin_url']);
$tmpl->set_var('gltoken_name', CSRF_TOKEN);
$tmpl->set_var('gltoken', SEC_createToken());
$tmpl->set_var('xhtml', XHTML);
$tmpl->set_var('script', THIS_SCRIPT);
$tmpl->set_var('importmsg', $lang_box_admin['importmsg']);
$tmpl->set_var('importfile', $lang_box_admin['importfile']);
$tmpl->set_var('submit', $lang_box_admin['submit']);
$tmpl->parse('output', 'import');
$import = $tmpl->finish($tmpl->get_var('output'));
$retval = "";
$retval .= COM_startBlock($lang_box_admin['import'], '', COM_getBlockTemplate('_admin_block', 'header'));
$retval .= $import;
$retval .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
return $retval;
}
示例12: list
$p->set_var('LANG_deleteafter', $LANG_GF01['DELETEAFTER']);
$p->set_var('LANG_all', $LANG_GF01['ALL']);
$p->set_var('LANG_topic', $LANG_GF01['TOPIC']);
$p->set_var('LANG_title', $LANG_GF01['TITLE']);
$p->set_var('LANG_date', $LANG_GF01['DATE']);
$p->set_var('LANG_comments', $LANG_GF01['COMMENTS']);
if ($numrows > 0) {
$base_url = $_CONF['site_admin_url'] . '/plugins/forum/migrate.php?seltopic=' . $curtopic;
for ($i = 0; $i < $numrows; $i++) {
list($topic, $sid, $story, $date, $comments) = DB_fetchArray($result);
$p->set_var('sid', $sid);
$p->set_var('topic', $topic);
if (isset($_POST['seltopic']) && $_POST['seltopic'] == "submissions") {
$p->set_var('story_link', $_CONF['site_admin_url'] . '/story.php?moderate=x&sid=' . $sid);
} else {
$p->set_var('story_link', $_CONF['site_url'] . '/article.php?story=' . $sid);
}
$p->set_var('story_title', $story);
$p->set_var('date', $date);
$p->set_var('num_comments', $comments);
$p->set_var('cssid', $i % 2 + 1);
$p->parse('story_record', 'records', true);
}
$p->set_var('page_navigation', COM_printPageNavigation($base_url, $page, $numpages));
}
$p->parse('output', 'page');
$display .= $p->finish($p->get_var('output'));
$display .= COM_endBlock();
$display .= FF_adminfooter();
$display .= FF_siteFooter();
echo $display;
示例13: showForm
//.........这里部分代码省略.........
$searchform->set_var('lang_all_words', $LANG09[44]);
$searchform->set_var('lang_any_word', $LANG09[45]);
$searchform->set_var('lang_titles', $LANG09[69]);
$escquery = htmlspecialchars($this->_query);
$escquery = str_replace(array('{', '}'), array('{', '}'), $escquery);
$searchform->set_var('query', $escquery);
$searchform->set_var('datestart', $this->_dateStart);
$searchform->set_var('dateend', $this->_dateEnd);
if ($this->_titlesOnly) {
$searchform->set_var('title_checked', ' checked="checked"');
} else {
$searchform->set_var('title_checked', '');
}
$phrase_selected = '';
$all_selected = '';
$any_selected = '';
if ($this->_keyType == 'phrase') {
$phrase_selected = 'selected="selected"';
} else {
if ($this->_keyType == 'all') {
$all_selected = 'selected="selected"';
} else {
if ($this->_keyType == 'any') {
$any_selected = 'selected="selected"';
}
}
}
$searchform->set_var('key_phrase_selected', $phrase_selected);
$searchform->set_var('key_all_selected', $all_selected);
$searchform->set_var('key_any_selected', $any_selected);
$options = '';
$plugintypes = array('all' => $LANG09[4], 'stories' => $LANG09[6], 'comments' => $LANG09[7]);
$plugintypes = array_merge($plugintypes, PLG_getSearchTypes());
// Generally I don't like to hardcode HTML but this seems easiest
foreach ($plugintypes as $key => $val) {
$options .= "<option value=\"{$key}\"";
if ($this->_type == $key) {
$options .= ' selected="selected"';
}
$options .= ">{$val}</option>" . LB;
}
$searchform->set_var('plugin_types', $options);
if ($_CONF['contributedbyline'] == 1) {
$searchform->set_var('lang_authors', $LANG09[8]);
$searchusers = array();
$result = DB_query("SELECT DISTINCT uid FROM {$_TABLES['comments']}");
while ($A = DB_fetchArray($result)) {
$searchusers[$A['uid']] = $A['uid'];
}
$result = DB_query("SELECT DISTINCT uid FROM {$_TABLES['stories']} WHERE (date <= NOW()) AND (draft_flag = 0)");
while ($A = DB_fetchArray($result)) {
$searchusers[$A['uid']] = $A['uid'];
}
$inlist = implode(',', $searchusers);
if (!empty($inlist)) {
$sql = "SELECT uid,username,fullname FROM {$_TABLES['users']} WHERE uid IN ({$inlist})";
if (isset($_CONF['show_fullname']) && $_CONF['show_fullname'] == 1) {
/* Caveat: This will group all users with an emtpy fullname
* together, so it's not exactly sorted by their
* full name ...
*/
$sql .= ' ORDER BY fullname,username';
} else {
$sql .= ' ORDER BY username';
}
$result = DB_query($sql);
$options = '';
while ($A = DB_fetchArray($result)) {
$options .= '<option value="' . $A['uid'] . '"';
if ($A['uid'] == $this->_author) {
$options .= ' selected="selected"';
}
$options .= '>' . htmlspecialchars(COM_getDisplayName('', $A['username'], $A['fullname'])) . '</option>';
}
$searchform->set_var('author_option_list', $options);
$searchform->parse('author_form_element', 'authors', true);
} else {
$searchform->set_var('author_form_element', '<input type="hidden" name="author" value="0"' . XHTML . '>');
}
} else {
$searchform->set_var('author_form_element', '<input type="hidden" name="author" value="0"' . XHTML . '>');
}
// Results per page
$options = '';
$limits = explode(',', $_CONF['search_limits']);
foreach ($limits as $limit) {
$options .= "<option value=\"{$limit}\"";
if ($_CONF['num_search_results'] == $limit) {
$options .= ' selected="selected"';
}
$options .= ">{$limit}</option>" . LB;
}
$searchform->set_var('search_limits', $options);
$searchform->set_var('lang_search', $LANG09[10]);
PLG_templateSetVars('search', $searchform);
$searchform->parse('output', 'searchform');
$retval .= $searchform->finish($searchform->get_var('output'));
$retval .= COM_endBlock();
return $retval;
}
示例14: _at_Header
function _at_Header()
{
global $_CONF, $LANG_ADMIN, $LANG32;
$retval = '';
$retval .= COM_startBlock($LANG32[87], '', COM_getBlockTemplate('_admin_block', 'header'));
$retval .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
return $retval;
}
示例15: MB_editMenu
function MB_editMenu($mid)
{
global $_CONF, $_TABLES, $_ST_CONF, $stMenu, $LANG_MB00, $LANG_MB01, $LANG_MB_ADMIN, $LANG_MB_TYPES, $LANG_MB_GLTYPES, $LANG_MB_GLFUNCTION, $LANG_MB_MENU_TYPES;
$retval = '';
$menu_id = $mid;
$menu = menu::getInstance($menu_id);
$menu_arr = array(array('url' => $_CONF['site_admin_url'] . '/menu.php?mode=menu&menu=' . $menu_id, 'text' => $LANG_MB01['return_to'] . $menu->name), array('url' => $_CONF['site_admin_url'] . '/menu.php', 'text' => $LANG_MB01['menu_list']));
$retval .= COM_startBlock($LANG_MB01['menu_builder'] . ' :: ' . $LANG_MB01['edit_element'] . ' for ' . $menu->name, '', COM_getBlockTemplate('_admin_block', 'header'));
$retval .= ADMIN_createMenu($menu_arr, $LANG_MB_ADMIN[5], $_CONF['layout_url'] . '/images/icons/menubuilder.png');
// build menu type select
$menuTypeSelect = '<select id="menutype" name="menutype">' . LB;
while ($types = current($LANG_MB_MENU_TYPES)) {
$menuTypeSelect .= '<option value="' . key($LANG_MB_MENU_TYPES) . '"';
if (key($LANG_MB_MENU_TYPES) == $menu->type) {
$menuTypeSelect .= ' selected="selected"';
}
$menuTypeSelect .= '>' . $types . '</option>' . LB;
next($LANG_MB_MENU_TYPES);
}
$menuTypeSelect .= '</select>' . LB;
// build group select
$rootUser = DB_getItem($_TABLES['group_assignments'], 'ug_uid', 'ug_main_grp_id=1');
$usergroups = SEC_getUserGroups($rootUser);
$usergroups[$LANG_MB01['non-logged-in']] = 998;
uksort($usergroups, "strnatcasecmp");
$group_select = '<select id="group" name="group">' . LB;
for ($i = 0; $i < count($usergroups); $i++) {
$group_select .= '<option value="' . $usergroups[key($usergroups)] . '"';
if ($usergroups[key($usergroups)] == $menu->group_id) {
$group_select .= ' selected="selected"';
}
$group_select .= '>' . ucfirst(key($usergroups)) . '</option>' . LB;
next($usergroups);
}
$group_select .= '</select>' . LB;
$T = new Template($_CONF['path_layout'] . 'admin/menu');
$T->set_file(array('admin' => 'editmenu.thtml'));
if ($mid == 1 || $mid == 2 || $mid == 3) {
$disabled = ' readonly ';
} else {
$disabled = '';
}
$menu_active_check = $menu->active == 1 ? ' checked="checked"' : '';
$T->set_var(array('group_select' => $group_select, 'menutype' => $menu->type, 'menutype_select' => $menuTypeSelect, 'menuactive' => $menu->active == 1 ? ' checked="checked"' : ' ', 'form_action' => $_CONF['site_admin_url'] . '/menu.php', 'menu_id' => $mid, 'menuname' => $menu->name, 'enabled' => $menu_active_check, 'disabled' => $disabled));
$T->parse('output', 'admin');
$retval .= $T->finish($T->get_var('output'));
$retval .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
return $retval;
}