--- onthisday.module 8 Oct 2008 19:51:28 -0000 1.1.2.2.2.4
+++ onthisday.module 13 Dec 2008 00:32:25 -0000
@@ -7,6 +7,19 @@
}
}
+function onthisday_theme() {
+ return array(
+ 'onthisday_page' => array(
+ 'template' => 'onthisday_page',
+ 'arguments' => array('offset' => NULL, 'month' => NULL, 'day' => NULL),
+ ),
+ 'onthisday_block' => array(
+ 'template' => 'onthisday_block',
+ 'arguments' => array('offset' => NULL),
+ )
+ );
+}
+
function onthisday_menu () {
$items['onthisday/feed'] = array(
'title' => t("On This Day"),
@@ -46,7 +59,7 @@
return $items;
}
-function _onthisday_block($offset, $month = NULL, $day = NULL) {
+function theme_onthisday_block($offset, $month = NULL, $day = NULL) {
if ($offset == -1) {
$offset = _onthisday_maxyears();
}
@@ -107,7 +120,7 @@
switch ($delta) {
case 0:
$block['subject'] = t("On This Day");
- $block['content'] = _onthisday_block($offset);
+ $block['content'] = theme('onthisday_block', $offset);
$block['content'] .= variable_get('onthisday_more_link', 0) == 1 ? '
' . l(t('more'), 'onthisday' . date('/m/d')) . '
' : '';
return $block;
break;
@@ -119,7 +132,7 @@
$month = date('n', $node->created);
$day = date('j', $node->created);
$block['subject'] = t("Also Posted This Day in History");
- $block['content'] = _onthisday_block($offset, $month, $day);
+ $block['content'] = theme('onthisday_block', $offset, $month, $day);
$block['content'] .= variable_get('onthisday_more_link', 0) == 1 ? '' . l(t('more'), 'onthisday') . '
' : '';
return $block;
}
@@ -128,7 +141,7 @@
}
}
-function _onthisday_page($offset) {
+function theme_onthisday_page($offset) {
if ($offset == -1) {
$offset = _onthisday_maxyears();
}
@@ -152,16 +165,16 @@
'href' => url('onthisday/feed')));
$output .= theme('xml_icon', url('onthisday/feed'));
}
- print theme('page', $output);
+ return $output;
}
function onthisday_page() {
- return _onthisday_page(variable_get('onthisday_years', 1), 'page');
+ print theme('onthisday_page', variable_get('onthisday_years', 1));
}
function onthisday_feed() {
global $base_url;
- $output = _onthisday_block(variable_get('onthisday_years', 1));
+ $output = theme('onthisday_block', variable_get('onthisday_years', 1));
drupal_set_header('Content-Type: text/xml; charset=utf-8');
print '<';
print '?xml version="1.0"?>';