summaryrefslogtreecommitdiff
path: root/modules/page.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2002-12-10 20:35:20 +0000
committerDries Buytaert <dries@buytaert.net>2002-12-10 20:35:20 +0000
commit7ce686c152416dc3a240861840f9c18791e38762 (patch)
treef771ce209303d39fed6915d1f90d5fc0030e3f23 /modules/page.module
parenteceead1819b8e480725db17816d1b2af4f3fd768 (diff)
downloadbrdo-7ce686c152416dc3a240861840f9c18791e38762.tar.gz
brdo-7ce686c152416dc3a240861840f9c18791e38762.tar.bz2
o Permission improvements:
+ Removed the "post content" permission and replaced it by more fine-grained permissions such as "maintain static pages", "maintain personal blog", "maintain stories", etc. o Usability improvements to teasers: + Teaser forms are no more. Teasers are extracted automatically but can also be instructed using a delimiter "---". Furthermore, when a post it too short for a teaser, the user won't be bother with teaser stuff anymore. + Added an option to set the teaser length, or to disable teasers all together. + When previewing a post, both the short (if any) and the full version of a post are shown. This addresses a common complaint; for example, when writing a book page there was no way you could preview the short version of your post. + Forum posts can be teasered now. This is particularly helpful in the context of drupal.org where we promote forum topics. o Bugfix: replaced all PHP short tags (<?) with long tags (<?php). o Bugfix: removed hard-coded dependence on comment module. o Bugfix: when the queue module was disabled, it was not possible to approve updated book pages. o Bugfix: applied modified version of Marco's node_teaser() fix.
Diffstat (limited to 'modules/page.module')
-rw-r--r--modules/page.module37
1 files changed, 24 insertions, 13 deletions
diff --git a/modules/page.module b/modules/page.module
index ef68a5632..f4b43fc3b 100644
--- a/modules/page.module
+++ b/modules/page.module
@@ -2,19 +2,23 @@
// $Id$
function page_help() {
- $output .= "<p>The page module is used to create a <i>site page</i>. Unlike a story, a site page is a persistent web page on your site which usually shortcuts the typical lifecycle of user generated content (i.e. submit -&gt; moderate -&gt; post -&gt; comment). A site page is usually linked from the main navigation bar, using whatever text the author wishes. To create a site page without this navigation link, simply skip the form field which requests link text. Administrators are the exclusive authors of site pages (i.e. requires the <i>administer nodes</i> in ". la("permission", array("mod" => "user", "op" => "permission")) .").</p>";
+ $output .= "<p>The page module is used to create a <i>static page</i>. Unlike a story, a static page is a persistent web page on your site which usually shortcuts the typical lifecycle of user generated content (i.e. submit -&gt; moderate -&gt; post -&gt; comment). A static page is usually linked from the main navigation bar, using whatever text the author wishes. To create a static page without this navigation link, simply skip the form field which requests link text. Administrators are the exclusive authors of static pages (i.e. requires the <i>administer nodes</i> in ". la("permission", array("mod" => "user", "op" => "permission")) .").</p>";
$output .= "<p>Site pages, unlike many other forms of Drupal content, may be made of PHP code in addition to HTML and text. All Drupal objects and functions are available to the Site Page author.</p>";
return $output;
}
-function page_system($field){
+function page_system($field) {
$system["description"] = t("Enables the creation of a static pages that can be added to the navigation system.");
return $system[$field];
}
+function page_perm() {
+ return array("maintain static pages");
+}
+
function page_node($field) {
- $info["name"] = t("site page");
- $info["description"] = t("If you just want to add a page with a link in the menu to your site, this would be the best choice. Unlike a story, a site page by-passes the submission queue.");
+ $info["name"] = t("static page");
+ $info["description"] = t("If you just want to add a page with a link in the menu to your site, this would be the best choice. Unlike a story, a static page by-passes the submission queue.");
return $info[$field];
}
@@ -23,6 +27,18 @@ function page_access($op, $node) {
if ($op == "view") {
return $node->status;
}
+
+ if ($op == "create") {
+ return user_access("maintain static pages");
+ }
+
+ if ($op == "update") {
+ return user_access("maintain static pages");
+ }
+
+ if ($op == "delete") {
+ return user_access("maintain static pages");
+ }
}
function page_save($op, $node) {
@@ -32,7 +48,7 @@ function page_save($op, $node) {
}
if ($op == "create") {
- return array("body" => filter($node->body), "teaser" => filter($node->teaser), "format", "link", "description");
+ return array("teaser" => $node->body, "format", "link", "description");
}
if ($op == "decline") {
@@ -40,7 +56,7 @@ function page_save($op, $node) {
}
if ($op == "update") {
- return array("body" => filter($node->body), "teaser" => filter($node->teaser), "format", "link", "description");
+ return array("teaser" => $node->body, "format", "link", "description");
}
}
@@ -70,8 +86,8 @@ function page_link($type) {
}
}
- if ($type == "menu.create" && user_access("administer nodes")) {
- $links[] = lm(t("create site page"), array("mod" => "node", "op" => "add", "type" => "page"), "", array("title" => t("Add a new site page.")));
+ if ($type == "menu.create" && user_access("maintain static pages")) {
+ $links[] = lm(t("create static page"), array("mod" => "node", "op" => "add", "type" => "page"), "", array("title" => t("Add a new static page.")));
}
return $links ? $links : array();
@@ -139,11 +155,6 @@ function page_form(&$node, &$help, &$error) {
$node->body = addslashes($node->body);
}
}
- else {
- if ($node->teaser) {
- $output .= form_textarea(t("Teaser"), "teaser", $node->teaser, 60, 5, $error["teaser"]);
- }
- }
if (function_exists("taxonomy_node_form")) {
$output .= implode("", taxonomy_node_form("page", $node));