/** * Standard modular run function for snippet hooks. Generates XHTML to insert into a page using AJAX. * * @return tempcode The snippet */ function run() { if (has_zone_access(get_member(), 'adminzone')) { require_code('menus'); return build_stored_menu('popup', '_management'); } return new ocp_tempcode(); }
/** * Standard modular run function for snippet hooks. Generates XHTML to insert into a page using AJAX. * * @return tempcode The snippet */ function run() { if (!is_guest()) { require_code('menus'); $built = build_stored_menu('popup', '_bookmarks'); if (is_null($built)) { return new ocp_tempcode(); } return $built; } return new ocp_tempcode(); }
/** * Standard modular run function. * * @param array A map of parameters. * @return tempcode The result of execution. */ function run($map) { if (!array_key_exists('param', $map)) { return do_lang_tempcode('NO_PARAMETER_SENT', 'param'); } // can't function like that require_css('side_blocks'); $type = array_key_exists('type', $map) ? $map['type'] : 'tree'; $silent_failure = array_key_exists('silent_failure', $map) ? $map['silent_failure'] : '0'; $tray_status = array_key_exists('tray_status', $map) ? $map['tray_status'] : ''; if ($type != 'tree') { $exists = file_exists(get_file_base() . '/themes/default/templates/MENU_BRANCH_' . $type . '.tpl'); if (!$exists) { $exists = file_exists(get_custom_file_base() . '/themes/default/templates_custom/MENU_BRANCH_' . $type . '.tpl'); } $theme = $GLOBALS['FORUM_DRIVER']->get_theme(); if (!$exists && $theme != 'default') { $exists = file_exists(get_custom_file_base() . '/themes/' . $theme . '/templates/MENU_BRANCH_' . $type . '.tpl'); if (!$exists) { $exists = file_exists(get_custom_file_base() . '/themes/' . $theme . '/templates_custom/MENU_BRANCH_' . $type . '.tpl'); } } if (!$exists) { $type = 'tree'; } } require_code('menus'); $menu = build_stored_menu($type, $map['param'], $silent_failure == '1'); $menu->handle_symbol_preprocessing(); // Optimisation: we are likely to have lots of page-links in here, so we want to spawn them to be detected for mass moniker loading if ($menu->is_empty()) { return new ocp_tempcode(); } if (array_key_exists('caption', $map) && $map['caption'] != '') { $menu = do_template('BLOCK_SIDE_STORED_MENU', array('_GUID' => 'ae46aa37a9c5a526f43b26a391164436', 'CONTENT' => $menu, 'PARAM' => $map['param'], 'TRAY_STATUS' => $tray_status, 'CAPTION' => $map['caption'])); } return $menu; }