From 82badb19c79a2789008a8c3eca3bf15a13e44fd9 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 30 Sep 2011 14:24:27 -0400 Subject: [PATCH] Move docs menu to site primary menu --- actions/doc.php | 68 +++++++++++++++++++++++++++++++++ doc-src/help | 21 ---------- doc-src/tags | 4 -- plugins/OpenID/OpenIDPlugin.php | 15 +++----- 4 files changed, 74 insertions(+), 34 deletions(-) diff --git a/actions/doc.php b/actions/doc.php index 95f76fb9dd..c26b290902 100644 --- a/actions/doc.php +++ b/actions/doc.php @@ -162,4 +162,72 @@ class DocAction extends Action Event::handle('EndLoadDoc', array($this->title, &$this->output)); } } + + function showLocalNav() + { + $menu = new DocNav($this); + $menu->show(); + } +} + +class DocNav extends Menu +{ + function show() + { + $stub = new HomeStubNav($this->action); + $this->submenu(_m('MENU','Home'), $stub); + + $docs = new DocListNav($this->action); + $this->submenu(_m('MENU','Docs'), $docs); + } +} + +class DocListNav extends Menu +{ + function getItems() + { + $items = array(); + + if (Event::handle('StartDocsMenu', array(&$items))) { + + $items = array(array('doc', + array('title' => 'help'), + _m('MENU', 'Help'), + _('Getting started'), + 'nav_doc_help'), + array('doc', + array('title' => 'about'), + _m('MENU', 'About'), + _('About this site'), + 'nav_doc_about'), + array('doc', + array('title' => 'faq'), + _m('MENU', 'FAQ'), + _('Frequently asked questions'), + 'nav_doc_faq'), + array('doc', + array('title' => 'contact'), + _m('MENU', 'Contact'), + _('Contact info'), + 'nav_doc_contact'), + array('doc', + array('title' => 'tags'), + _m('MENU', 'Tags'), + _('Using tags'), + 'nav_doc_tags'), + array('doc', + array('title' => 'groups'), + _m('MENU', 'Groups'), + _('Using groups'), + 'nav_doc_groups'), + array('doc', + array('title' => 'api'), + _m('MENU', 'API'), + _('RESTful API'), + 'nav_doc_api')); + + Event::handle('EndDocsMenu', array(&$items)); + } + return $items; + } } diff --git a/doc-src/help b/doc-src/help index 0e39082ad0..d85a328900 100644 --- a/doc-src/help +++ b/doc-src/help @@ -16,24 +16,3 @@ To subscribe to other people's notifications, go to their profile page and click the "subscribe" button. They'll get a notice that you're now subscribed to their notifications, and, who knows?, they might subscribe back. - -More help ---------- - -Here are some documents that you might find helpful in understanding -%%site.name%% and how to use it. - -* [About](%%doc.about%%) - an overview of the service -* [FAQ](%%doc.faq%%) - frequently-asked questions about %%site.name%% -* [Contact](%%doc.contact%%) - who to contact with questions about the service -* [IM](%%doc.im%%) - using the instant-message (IM) features of %%site.name%% -* [SMS](%%doc.sms%%) - tying your cellphone to %%site.name%% -* [Tags](%%doc.tags%%) - different ways to use tagging -* [Groups](%%doc.groups%%) - joining together in groups -* [Lists](%%doc.lists%%) - organize your contacts -* [OpenMicroBlogging](%%doc.openmublog%%) - subscribing to remote users -* [Privacy](%%doc.privacy%%) - %%site.name%%'s privacy policy -* [Source](%%doc.source%%) - How to get the StatusNet source code -* [Badge](%%doc.badge%%) - How to put a StatusNet badge on your blog or homepage -* [Bookmarklet](%%doc.bookmarklet%%) - Bookmarklet for posting Web pages -* [API](%%doc.api%%) - API for use by external clients diff --git a/doc-src/tags b/doc-src/tags index 3e9065a100..82885a9c8d 100644 --- a/doc-src/tags +++ b/doc-src/tags @@ -52,10 +52,6 @@ private prepend a '.' to the tag in the tags editing box. To set an existing public tag as private or vice-versa, go to the tag's edit page. -The most used public tags are displayed in the -[public people tag cloud](%%action.publicpeopletagcloud%%). Their -size shows their frequency of use. - Remote people tags ------------------ diff --git a/plugins/OpenID/OpenIDPlugin.php b/plugins/OpenID/OpenIDPlugin.php index 023ff8e86d..ed6d6534c0 100644 --- a/plugins/OpenID/OpenIDPlugin.php +++ b/plugins/OpenID/OpenIDPlugin.php @@ -536,15 +536,12 @@ class OpenIDPlugin extends Plugin * * @return boolean hook value */ - function onEndLoadDoc($title, &$output) - { - if ($title == 'help') { - // TRANS: Item on help page. This message contains Markdown links in the form [description](link). - $menuitem = _m('* [OpenID](%%doc.openid%%) - What OpenID is and how to use it with this service.'); - - $output .= common_markup_to_html($menuitem); - } - + function onEndDocsMenu(&$items) { + $items[] = array('doc', + array('title' => 'openid'), + _m('MENU', 'OpenID'), + _('Logging in with OpenID'), + 'nav_doc_openid'); return true; }