'object', 'subtype' => $type, 'limit' => 1, )); if ($object) { $content .= elgg_view('output/longtext', array('value' => $object[0]->description)); } else { $content .= elgg_echo("expages:notset"); } $content = elgg_view('expages/wrapper', array('content' => $content)); if (elgg_is_admin_logged_in()) { elgg_register_menu_item('title', array( 'name' => 'edit', 'text' => elgg_echo('edit'), 'href' => "admin/appearance/expages?type=$type", 'link_class' => 'elgg-button elgg-button-action', )); } if (elgg_is_logged_in() || !elgg_get_config('walled_garden')) { $body = elgg_view_layout('one_column', array('title' => $title, 'content' => $content)); echo elgg_view_page($title, $body); } else { elgg_load_css('elgg.walled_garden'); $body = elgg_view_layout('walled_garden', array('content' => $header . $content)); echo elgg_view_page($title, $body, 'walled_garden'); } return true; } /** * Adds menu items to the expages edit form * * @param string $hook 'register' * @param string $type 'menu:expages' * @param array $return current menu items * @param array $params parameters * * @return array */ function expages_menu_register_hook($hook, $type, $return, $params) { $type = elgg_extract('type', $params); $pages = array('about', 'terms', 'privacy'); foreach ($pages as $page) { $return[] = ElggMenuItem::factory(array( 'name' => $page, 'text' => elgg_echo("expages:$page"), 'href' => "admin/appearance/expages?type=$page", 'selected' => $page === $type, )); } return $return; } /** * Forward to the new style of URLs * * @param string $page */ function expages_url_forwarder($page) { global $CONFIG; $url = "{$CONFIG->wwwroot}{$page}"; forward($url); }