/** * Add link to menu at top of content pane * * @return void * */ function demo_page_header_template_do() { global $oTemplate, $nbsp; sq_change_text_domain('demo'); $output = makeInternalLink('plugins/demo/demo.php', _("Demo"), '') . $nbsp . $nbsp; sq_change_text_domain('squirrelmail'); return array('menuline' => $output); }
/** * Adds second layer of calendar links to upper menu * @return void */ function calendar_header() { global $color, $year, $day, $month; // FIXME: Don't echo HTML from core. This whole function should probably be moved into a template file echo html_tag('table', '', '', $color[0], 'border="0" width="100%" cellspacing="0" cellpadding="2"') . html_tag('tr') . html_tag('td', '', 'left', '', 'width="100%"'); echo makeInternalLink("plugins/calendar/calendar.php?year={$year}&month={$month}", _("Month View"), "right"); echo " \n"; echo makeInternalLink("plugins/calendar/day.php?year={$year}&month={$month}&day={$day}", _("Day View"), "right"); echo " \n"; // echo makeInternalLink("plugins/calendar/event_create.php?year=$year&month=$month&day=$day",_("Add Event"),"right"); // echo " \n"; echo '</td></tr>'; }
/** * Create compose link * * Returns a link to the compose-page, taking in consideration * the compose_in_new and javascript settings. * @param string url the URL to the compose page * @param string text the link text, default "Compose" * @return string a link to the compose page */ function makeComposeLink($url, $text = null, $target = '') { global $compose_new_win, $javascript_on; if (!$text) { $text = _("Compose"); } // if not using "compose in new window", make // regular link and be done with it if ($compose_new_win != '1') { return makeInternalLink($url, $text, $target); } // build the compose in new window link... // if javascript is on, use onClick event to handle it if ($javascript_on) { sqgetGlobalVar('base_uri', $base_uri, SQ_SESSION); return '<a href="javascript:void(0)" onclick="comp_in_new(\'' . $base_uri . $url . '\')">' . $text . '</a>'; } // otherwise, just open new window using regular HTML return makeInternalLink($url, $text, '_blank'); }
/** * Same as makeInternalLink, but echoes it too */ function displayInternalLink($path, $text, $target = '') { echo makeInternalLink($path, $text, $target); }
for ($i = 0; $i < $mailfetch['server_number']; $i++) { if ($mailfetch[$i]['pass'] == '') { echo html_tag('tr', html_tag('td', _("Password for") . ' <b>' . sm_encode_html_special_chars($mailfetch[$i]['alias']) . '</b>: ', 'right') . html_tag('td', '<input type="password" name="pass_' . $i . '" />', 'left')); } } echo html_tag('tr', html_tag('td', ' ') . html_tag('td', '<input type="submit" name="submit_mailfetch" value="' . _("Fetch Mail") . '" />', 'left')) . '</table></form>'; } $mailfetch = Mail_Fetch_Servers(); displayPageHeader($color); echo '<br />'; echo html_tag('table', html_tag('tr', html_tag('td', '<b>' . _("Remote POP server Fetching Mail") . '</b>', 'center', $color[0])), 'center', '', 'width="95%" cols="1"'); /* 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>'; echo makeInternalLink('plugins/mail_fetch/options.php', _("Click here to go to the options page.")); $oTemplate->display('footer.tpl'); exit; } // get $server_to_fetch from globals, if not set display a choice to the user if (!sqgetGlobalVar('server_to_fetch', $server_to_fetch, SQ_POST)) { Mail_Fetch_Select_Server($mailfetch); $oTemplate->display('footer.tpl'); exit; } if ($server_to_fetch == 'all') { $i_start = 0; $i_stop = $mailfetch['server_number']; } else { $i_start = $server_to_fetch; $i_stop = $i_start + 1;
/** * Show the button in the main bar * * @access private * */ function bug_report_button_do() { global $username, $data_dir; $bug_report_visible = getPref($data_dir, $username, 'bug_report_visible', FALSE); if (!$bug_report_visible || !bug_report_check_user()) { return; } global $oTemplate, $nbsp; $output = makeInternalLink('plugins/bug_report/bug_report.php', _("Bug"), '') . $nbsp . $nbsp; return array('menuline' => $output); }
/** * Add link to menu at top of content pane * * @return void * */ function mail_fetch_link_do() { global $oTemplate, $nbsp; $output = makeInternalLink('plugins/mail_fetch/fetch.php', _("Fetch"), '') . $nbsp . $nbsp; return array('menuline' => $output); }
/** * Create compose link * * Returns a link to the compose-page, taking in consideration * the compose_in_new and javascript settings. * * @param string $url The URL to the compose page * @param string $text The link text, default "Compose" * @param string $target URL target, if any (since 1.4.3) * @param string $accesskey The access key to be used, if any * * @return string a link to the compose page * * @since 1.4.2 */ function makeComposeLink($url, $text = null, $target = '', $accesskey = 'NONE') { global $compose_new_win, $compose_width, $compose_height, $oTemplate; if (!$text) { $text = _("Compose"); } // if not using "compose in new window", make // regular link and be done with it if ($compose_new_win != '1') { return makeInternalLink($url, $text, $target, $accesskey); } // build the compose in new window link... // if javascript is on, use onclick event to handle it if (checkForJavascript()) { sqgetGlobalVar('base_uri', $base_uri, SQ_SESSION); $compuri = SM_BASE_URI . $url; return create_hyperlink('javascript:void(0)', $text, '', "comp_in_new('{$compuri}','{$compose_width}','{$compose_height}')", '', '', '', $accesskey == 'NONE' ? array() : array('accesskey' => $accesskey)); } // otherwise, just open new window using regular HTML return makeInternalLink($url, $text, '_blank', $accesskey); }
/** * Add link to menu at top of content pane * * @return void * */ function test_menuline_do() { global $oTemplate, $nbsp; $output = makeInternalLink('plugins/test/test.php', 'Test', 'right') . $nbsp . $nbsp; return array('menuline' => $output); }