summaryrefslogtreecommitdiff
path: root/modules/story.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2004-06-18 15:04:37 +0000
committerDries Buytaert <dries@buytaert.net>2004-06-18 15:04:37 +0000
commit54b77d64354949428bc8bf48d47b587312a535f2 (patch)
tree8e29ff15063129388e14009f0de6fda996beb897 /modules/story.module
parent5ad73c8eb63c8c8db451e5586860f52be8dd8874 (diff)
downloadbrdo-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/story.module')
-rw-r--r--modules/story.module24
1 files changed, 15 insertions, 9 deletions
diff --git a/modules/story.module b/modules/story.module
index 857ff2beb..104220551 100644
--- a/modules/story.module
+++ b/modules/story.module
@@ -6,9 +6,9 @@
*/
function story_help($section) {
switch ($section) {
- case 'admin/system/modules#description':
+ case 'admin/modules#description':
return t('Enables users to submit stories, articles or similar content.');
- case 'admin/system/modules/story':
+ case 'admin/settings/story':
return t("Stories are like newspaper articles. They tend to follow a publishing flow of <strong>submit -&gt; moderate -&gt; post to the main page -&gt; comments</strong>. Below you may fix a minimum word count for stories and also write some submission or content guidelines for users wanting to post a story.");
case 'admin/help#story':
return t("
@@ -17,7 +17,7 @@ function story_help($section) {
<h3>User access permissions for stories</h3>
<p><strong>create stories:</strong> Allows a role to create stories. They cannot edit or delete stories, even if they are the authors. You must enable this permission to in order for a role to create a story.</p>
<p><strong>maintain personal stories:</strong> Allows a role to add/edit stories if they own the story. Use this permission if you want users to be able to edit and maintain their own stories.</p>
- ", array('%story-config' => url('admin/system/modules/story')));
+ ", array('%story-config' => url('admin/settings/story')));
case 'node/add/story':
return variable_get('story_help', '');
case 'node/add#story':
@@ -78,14 +78,10 @@ function story_access($op, $node) {
function story_link($type, $node = 0, $main) {
$links = array();
- if ($type == 'system') {
- menu('node/add/story', t('story'), story_access('create', $node) ? MENU_FALLTHROUGH : MENU_DENIED, 0);
- }
-
if ($type == 'node' && $node->type == 'story') {
- /* Don't display a redundant edit link if they are node administrators */
+ // Don't display a redundant edit link if they are node administrators.
if (story_access('update', $node) && !user_access('administer nodes')) {
- $links[] = l(t('edit this story'), "node/edit/$node->nid");
+ $links[] = l(t('edit this story'), "node/$node->nid/edit");
}
}
@@ -93,6 +89,16 @@ function story_link($type, $node = 0, $main) {
}
/**
+ * Implementation of hook_menu().
+ */
+function story_menu() {
+ $items = array();
+ $items[] = array('path' => 'node/add/story', 'title' => t('story'),
+ 'access' => story_access('create', NULL));
+ return $items;
+}
+
+/**
* Implementation of hook_validate().
*
* Ensures the story is of adequate length.