diff options
author | Dries Buytaert <dries@buytaert.net> | 2004-06-18 15:04:37 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2004-06-18 15:04:37 +0000 |
commit | 54b77d64354949428bc8bf48d47b587312a535f2 (patch) | |
tree | 8e29ff15063129388e14009f0de6fda996beb897 /modules/page.module | |
parent | 5ad73c8eb63c8c8db451e5586860f52be8dd8874 (diff) | |
download | brdo-54b77d64354949428bc8bf48d47b587312a535f2.tar.gz brdo-54b77d64354949428bc8bf48d47b587312a535f2.tar.bz2 |
Tabs patch!
CHANGES
-------
+ Introduced tabs. First, we extended the menu system to support tabs. Next, a tab was added for every link that was (1) an administrative action other than the implicit 'view' (2) relevant to that particular page only. This is illustrated by the fact that all tabs are verbs and that clicking a page's tab leads you to a subpage of that page.
+ Flattened the administration menu. The tabs helped simplify the navigation menu as I could separate 'actions' from 'navigation'. In addition, I removed the 'administer > configuration'-menu, renamed 'blocks' to 'sidebars' which I hope is a bit more descriptive, and made a couple more changes. Earlier, we already renamed 'taxonomy' to 'categorization' and we move 'statistics' under 'logs'.
+ Grouped settings. All settings have been grouped under 'administer > settings'.
TODO
----
+ Update core themes: only Xtemplate default supports tabs and even those look ugly. Need help.
+ Update contributed modules. The menu() hook changed drastically. Updating your code adhere the new menu() function should be 90% of the work. Moreover, ensure that your modue's admin links are still valid and that URLs to node get updated to the new scheme ('node/view/x' -> 'node/x').
Diffstat (limited to 'modules/page.module')
-rw-r--r-- | modules/page.module | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/modules/page.module b/modules/page.module index 09cb73cc8..930ef20ab 100644 --- a/modules/page.module +++ b/modules/page.module @@ -14,7 +14,7 @@ function page_help($section) { <p><strong>create pages:</strong> Allows a role to create pages. They cannot edit or delete pages, even if they are the authors. You must enable this permission to in order for a role to create a page.</p> <p><strong>maintain personal pages:</strong> Allows a role to add/edit pages if they own the page. Use this permission if you want users to be able to edit and maintain their own pages.</p> "); - case 'admin/system/modules#description': + case 'admin/modules#description': return t('Enables the creation of pages that can be added to the navigation system.'); case 'node/add#page': return t('If you just want to add a page with a link in the menu to your site, this is the best choice. Unlike a story, a static page bypasses the submission queue.'); @@ -87,24 +87,13 @@ function page_load($node) { } /** - * Implementation of hook_link(). + * Implementation of hook_menu(). */ -function page_link($type, $node = 0, $main) { - - $links = array(); - - if ($type == 'system') { - menu('node/add/page', t('page'), page_access('create', $node) ? MENU_FALLTHROUGH : MENU_DENIED, 0); - } - - if ($type == 'node' && $node->type == 'page') { - /* Don't display a redundant edit link if they are node administrators */ - if (page_access('update', $node) && !user_access('administer nodes')) { - $links[] = l(t('edit this page'), "node/edit/$node->nid"); - } - } - - return $links; +function page_menu() { + $items = array(); + $items[] = array('path' => 'node/add/page', 'title' => t('page'), + 'access' => page_access('create', NULL)); + return $items; } /** @@ -112,7 +101,7 @@ function page_link($type, $node = 0, $main) { * * If body is dynamic (using PHP code), the body will be generated. */ -function page_content($node, $main = 0) { +function page_content($node, $teaser = FALSE) { if ($node->format == 1) { // PHP type ob_start(); @@ -122,7 +111,7 @@ function page_content($node, $main = 0) { } else { // Assume HTML type by default - $node = node_prepare($node, $main); + $node = node_prepare($node, $teaser); } return $node; } @@ -130,11 +119,11 @@ function page_content($node, $main = 0) { /** * Implementation of hook_view(). */ -function page_view($node, $main = 0, $page = 0) { +function page_view($node, $teaser = FALSE, $page = FALSE) { // prepare the node content - $node = page_content($node, $main); + $node = page_content($node, $teaser); // print the node - return theme('node', $node, $main, $page); + return theme('node', $node, $teaser, $page); } /** |