EOS;
- $oTemplate->assign('header_tags', $header_tags);
+ $oTemplate->assign('header_tags', $header_tags, FALSE);
$oTemplate->display('protocol_header.tpl');
/* this is used to check elsewhere whether we should call this function */
return create_hyperlink($base_uri . $path, $text, $target);
}
-/**
- * Same as makeInternalLink, but echoes it too
- */
-function displayInternalLink($path, $text, $target='') {
-// FIXME: should let the template echo all these kinds of things
- echo makeInternalLink($path, $text, $target);
-}
-
/**
* Outputs a complete SquirrelMail page header, starting with <!doctype> and
* including the default menu bar. Uses displayHtmlHeader and takes
* this explains the imap_mailbox.php dependency. We should instead store
* the selected mailbox in the session and fallback to the session var.
*/
+//FIXME: $shortBoxName will be sanitized when assigned to template, so remove htmlspecialchars on the following line?
$shortBoxName = htmlspecialchars(imap_utf7_decode_local(
readShortMailboxName($mailbox, $delimiter)));
if ( $shortBoxName == 'INBOX' ) {
$oTemplate->assign('body_tag_js', $sBodyTagJs);
$oTemplate->assign('shortBoxName', $shortBoxName);
- $oTemplate->assign('provider_link', $provider_link);
+ $oTemplate->assign('provider_link', $provider_link, FALSE);
$oTemplate->assign('frame_top', $frame_top);
$oTemplate->assign('urlMailbox', $urlMailbox);
$oTemplate->assign('startMessage', $startMessage);
function squirrelmail_plugin_init_bug_report() {
global $squirrelmail_plugin_hooks;
- $squirrelmail_plugin_hooks['menuline']['bug_report'] = 'bug_report_button';
+ $squirrelmail_plugin_hooks['template_construct_page_header.tpl']['bug_report'] = 'bug_report_button';
$squirrelmail_plugin_hooks['loading_prefs']['bug_report'] = 'bug_report_load';
$squirrelmail_plugin_hooks['optpage_loadhook_display']['bug_report'] = 'bug_report_block';
}
return;
}
- displayInternalLink('plugins/bug_report/bug_report.php', _("Bug"), '');
- echo " \n";
+ global $oTemplate;
+ $nbsp = $oTemplate->fetch('non_breaking_space.tpl');
+ $output = makeInternalLink('plugins/bug_report/bug_report.php', _("Bug"), '')
+ . $nbsp . $nbsp;
+ return array('menuline' => $output);
}
/**
* @subpackage calendar
*/
+/**
+ * Add link to menu at top of content pane
+ *
+ * @return void
+ *
+ */
+function calendar_do() {
+
+ global $oTemplate;
+ $nbsp = $oTemplate->fetch('non_breaking_space.tpl');
+ $output = makeInternalLink('plugins/calendar/calendar.php',_("Calendar"),'right')
+ . $nbsp . $nbsp;
+ return array('menuline' => $output);
+
+}
+
/**
* Adds second layer of calendar links to upper menu
* @return void
*/
/**
- * Initialize the plugin
- * @return void
- */
+ * Register this plugin with SquirrelMail
+ *
+ * @return void
+ *
+ */
function squirrelmail_plugin_init_calendar() {
+
global $squirrelmail_plugin_hooks;
- $squirrelmail_plugin_hooks['menuline']['calendar'] = 'calendar';
+
+ $squirrelmail_plugin_hooks['template_construct_page_header.tpl']['calendar']
+ = 'calendar';
+
}
+
/**
- * Adds Calendar link to upper menu
- * @return void
- */
+ * Add link to menu at top of content pane
+ *
+ * @return void
+ *
+ */
function calendar() {
- displayInternalLink('plugins/calendar/calendar.php',_("Calendar"),'right');
- echo " \n";
+
+ include_once(SM_PATH . 'plugins/calendar/functions.php');
+ return calendar_do();
+
}
+
+
/* there are no servers defined yet... */
if($mailfetch['server_number'] == 0) {
+//FIXME: do not echo directly to browser -- use templates only
echo '<p>' . _("No POP3 servers configured yet.") . '</p>';
- displayInternalLink('plugins/mail_fetch/options.php',
+ echo makeInternalLink('plugins/mail_fetch/options.php',
_("Click here to go to the options page.") );
$oTemplate->display('footer.tpl');
exit();
/** declare plugin globals */
global $mail_fetch_allow_unsubscribed;
+/**
+ * Add link to menu at top of content pane
+ *
+ * @return void
+ *
+ */
+function mail_fetch_link_do() {
+
+ global $oTemplate;
+ $nbsp = $oTemplate->fetch('non_breaking_space.tpl');
+ $output = makeInternalLink('plugins/mail_fetch/fetch.php', _("Fetch"), '')
+ . $nbsp . $nbsp;
+ return array('menuline' => $output);
+
+}
+
/**
* Controls use of unsubscribed folders in plugin
* @global boolean $mail_fetch_allow_unsubscribed
function squirrelmail_plugin_init_mail_fetch() {
global $squirrelmail_plugin_hooks;
- $squirrelmail_plugin_hooks['menuline']['mail_fetch'] = 'mail_fetch_link';
+ $squirrelmail_plugin_hooks['template_construct_page_header.tpl']['mail_fetch'] = 'mail_fetch_link';
$squirrelmail_plugin_hooks['login_verified']['mail_fetch'] = 'mail_fetch_setnew';
$squirrelmail_plugin_hooks['left_main_before']['mail_fetch'] = 'mail_fetch_login';
$squirrelmail_plugin_hooks['optpage_register_block']['mail_fetch'] = 'mailfetch_optpage_register_block';
* @private
*/
function mail_fetch_link() {
- displayInternalLink('plugins/mail_fetch/fetch.php', _("Fetch"), '');
- echo ' ';
+ include_once (SM_PATH . 'plugins/mail_fetch/functions.php');
+ return mail_fetch_link_do();
}
/**
<?php echo $options_link; ?>
<?php echo $search_link; ?>
<?php echo $help_link; ?>
- <?php /* FIXME: no hooks in templates!! */ global $null; do_hook('menuline', $null); ?>
+ <?php if (!empty($plugin_output['menuline'])) echo $plugin_output['menuline']; ?>
</td>
<td class="sqm_providerInfo">
<?php
<?php echo $options_link; ?>
<?php echo $search_link; ?>
<?php echo $help_link; ?>
- <?php /* FIXME: no hooks in templates!! */ global $null; do_hook('menuline', $null); ?>
+ <?php if (!empty($plugin_output['menuline'])) echo $plugin_output['menuline']; ?>
</td>
<td class="sqm_providerInfo">
<?php