summaryrefslogtreecommitdiff
path: root/modules/archive
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/archive
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/archive')
-rw-r--r--modules/archive/archive.module38
1 files changed, 25 insertions, 13 deletions
diff --git a/modules/archive/archive.module b/modules/archive/archive.module
index 15825ec25..4ad26b527 100644
--- a/modules/archive/archive.module
+++ b/modules/archive/archive.module
@@ -6,15 +6,15 @@
*/
function archive_help($section) {
switch ($section) {
- case 'admin/system/modules#description':
+ case 'admin/modules#description':
return t('Displays a calendar to navigate old content.');
- case 'admin/system/modules/archive':
+ case 'admin/settings/archive':
return t('Choose the starting "day of the week" for the displayed calendar block.');
}
}
/**
- * Generates a monthly claendar, for display in the archive block.
+ * Generates a monthly calendar, for display in the archive block.
*/
function archive_calendar($original = 0) {
global $user;
@@ -199,15 +199,26 @@ function archive_link($type) {
if ($type == 'page' && user_access('access content')) {
$links[] = l(t('archives'), 'archive', array('title' => t('Read the older content in our archive.')));
}
-
- if ($type == 'system') {
- menu('archive', t('archives'), user_access('access content') ? 'archive_page' : MENU_DENIED, 0, MENU_HIDE);
- }
-
return $links;
}
/**
+ * Implementation of hook_menu().
+ */
+function archive_menu() {
+ $items = array();
+ $items[] = array('path' => 'archive', 'title' => t('archives'),
+ 'access' => user_access('access content'),
+ 'callback' => 'archive_page',
+ 'type' => MENU_SUGGESTED_ITEM);
+ $items[] = array('path' => 'archive/configure', 'title' => t('configure'),
+ 'access' => user_access('administer site configuration'),
+ 'callback' => 'archive_configure',
+ 'type' => MENU_LOCAL_TASK);
+ return $items;
+}
+
+/**
* Menu callback; lists all nodes posted on a given date.
*/
function archive_page($year = 0, $month = 0, $day = 0) {
@@ -247,13 +258,14 @@ function archive_page($year = 0, $month = 0, $day = 0) {
print theme('page', $output);
}
-/**
- * Implementation of hook_settings().
- */
-function archive_settings() {
+function archive_configure() {
+ if ($_POST) {
+ system_settings_save();
+ }
+
$output = form_select(t('First day of week'), 'default_firstday', variable_get('default_firstday', 0), array(0 => t('Sunday'), 1 => t('Monday'), 2 => t('Tuesday'), 3 => t('Wednesday'), 4 => t('Thursday'), 5 => t('Friday'), 6 => t('Saturday')), t('The first day of the week. By changing this value you choose how the calendar block is rendered.'));
- return $output;
+ print theme('page', system_settings_form($output));
}
?>