/* Check if an hooks file exist */
if (file_exists(BABEL_BASE . '/config/hooks.php')) {
include_once BABEL_BASE . '/config/hooks.php';
-
+
$func = '_babel_hook_' . $fname;
-
+
if (function_exists($func)) {
$res = call_user_func($func, $info);
} else {
Translate_Display::warning(_("Hook file doesn't exist"));
}
}
-
+
function displayLanguage() {
global $lang, $app;
-
+
if (!isset(Horde_Nls::$config['languages'][$lang])) {
return;
}
-
+
$res = sprintf(_("Language: %s (%s)"), Horde_Nls::$config['languages'][$lang], $lang);
if ($app) {
$res .= ' | ' . sprintf(_("Module: %s"), $app);
}
-
+
return $res;
}
-
+
function ModuleSelection() {
$html = '';
$html .= '<span style="float:right">';
$html .= '<form action="' . Horde::selfUrl() . '" method="post" name="moduleSelector">';
$html .= '<select name="module" onchange="moduleSubmit()">';
-
+
$apps = array('ALL' => _("All Applications")) + Babel::listApps();
-
+
foreach($apps as $app => $desc) {
if (!Babel::hasPermission("module:$app")) {
continue;
}
-
+
if (Horde_Util::getFormData('module') == $app) {
$html .= '<option class="control" value="' . $app . '" selected>' . '+ ' . $desc;
} else {
$html .= '<option value="' . $app . '">' . '– ' . $desc;
}
}
-
+
$html .= '</select>';
$html .= '</form>';
$html .= '</span>';
-
+
$html .= '<script language="JavaScript" type="text/javascript">' . "\n";
$html .= '<!--' . "\n";
$html .= 'var loading;' . "\n";
$html .= '</script>' . "\n";
return $html;
}
-
+
function LanguageSelection() {
global $app;
-
+
$html = '';
$html .= '<span style="float:right">';
$html .= '<form action="' . Horde::selfUrl() . '" method="post" name="languageSelector">';
$html .= ' ';
$html .= '<input type="hidden" name="module" value="' . $app . '">';
$html .= '<select name="display_language" onchange="languageSubmit()">';
-
+
$tests = Horde_Nls::$config['languages'];
-
+
// Unset English
unset($tests['en_US']);
-
+
foreach($tests as $dir => $desc) {
if (!Babel::hasPermission("language:$dir")) {
continue;
}
-
+
if (isset($_SESSION['babel']['language']) && $dir == $_SESSION['babel']['language']) {
$html .= '<option class="control" value="' . $dir . '" selected>' . '+ ' . $desc;
} else {
$html .= '<option value="' . $dir . '">' . '– ' . $desc;
}
}
-
+
$html .= '</select>';
$html .= ' ';
$html .= '</form>';
$html .= '</span>';
-
+
$html .= '<script language="JavaScript" type="text/javascript">' . "\n";
$html .= '<!--' . "\n";
$html .= 'var loading;' . "\n";
$html .= '</script>' . "\n";
return $html;
}
-
+
function listApps($all = false) {
global $registry;
$res = array();
-
+
if ($all) {
$res['ALL'] = _("All Applications");
}
-
+
foreach ($registry->applications as $app => $params) {
if ($params['status'] == 'heading' || $params['status'] == 'block') {
continue;
}
-
+
if (isset($params['fileroot']) && !is_dir($params['fileroot'])) {
continue;
}
-
+
if (preg_match('/_reports$/', $app) || preg_match('/_tools$/', $app)) {
continue;
}
-
+
if (Babel::hasPermission("module:$app")) {
$res[$app] = sprintf("%s (%s)", $params['name'], $app);
}
}
return $res;
}
-
+
/**
* Returns the value of the specified permission for $userId.
*
function hasPermission($permission, $filter = null, $perm = null)
{
global $perms;
-
+
$userId = Horde_Auth::getAuth();
$admin = ($userId == 'admin') ? true : false;
-
+
if ($admin || !$perms->exists('babel:' . $permission)) {
return true;
}
-
+
$allowed = $perms->getPermissions('babel:' . $permission);
-
+
switch ($filter) {
case 'tabs':
if ($perm) {
global $registry;
$menu = new Horde_Menu();
-
+
$menu->addArray(array('url' => Horde::applicationUrl('index.php'),
'text' => _("_General"),
'icon' => 'list.png'));
'text' => _("_View"),
'icon' => 'view.png'));
}
-
+
if (Babel::hasPermission('stats')) {
$menu->addArray(array('url' => Horde::applicationUrl('stats.php'),
'text' => _("_Stats"),
'icon' => 'extract.png'));
}
-
+
if (Babel::hasPermission('extract')) {
$menu->addArray(array('url' => Horde::applicationUrl('extract.php'),
'text' => _("_Extract"),
'icon' => 'extract.png'));
}
-
+
if (Babel::hasPermission('make')) {
$menu->addArray(array('url' => Horde::applicationUrl('make.php'),
'text' => _("_Make"),
**/
function sendEmail($email, $type = 'html', $attachments = array()) {
global $client, $scopserv;
-
+
include_once("Mail.php");
include_once("Mail/mime.php");
$headers["From"] = $email['from'];
$headers["Subject"] = $email['subject'];
-
+
$mime = new Mail_Mime();
if ($type == 'html') {
$mime->setHtmlBody($email['content']);
} else {
$mime->setTxtBody($email['content']);
}
-
+
if (!empty($attachments)) {
foreach ($attachments as $info) {
$mime->addAttachment($info['file'],
$info['name'], false);
}
}
-
+
$body = $mime->get();
$hdrs = $mime->headers($headers);
-
+
$mail_object = &Mail::factory("mail");
return $mail_object->send($email['to'], $hdrs, $body);
}
function RB_init() {
- Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('effects.js', 'horde', true);
Horde::addScriptFile('redbox.js', 'horde', true);
}
-
+
function RB_start($secs = 30) {
-
+
$msg = '';
$msg .= '<table width=100% id="RB_confirm"><tr><td>';
$msg .= '<b>' . _("Please be patient ...") . '</b>';
$msg .= addslashes(sprintf(_("Can take up to %d minutes !"), $min));
}
}
-
+
$msg .= '</td><td><img src="themes/graphics/redbox_spinner.gif">';
-
+
$msg .= '</td></tr></table>';
echo '<script>';
echo 'RedBox.loading();';
echo 'RedBox.close();';
echo '</script>';
}
-
+
}
Chora::url('co', $where, array('r' => $rev)), _("View"),
Chora::url('co', $where, array('r' => $rev, 'p' => 1)), _("Download"));
-Horde::addScriptFile('prototype.js', 'chora', true);
Horde::addScriptFile('annotate.js', 'chora', true);
$js_vars = array(
$printAllCols = count($fileList);
$sortdirclass = $acts['sbt'] ? 'sortdown' : 'sortup';
-Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('tables.js', 'horde', true);
require CHORA_TEMPLATES . '/common-header.inc';
require CHORA_TEMPLATES . '/menu.inc';
}
}
-Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('tables.js', 'horde', true);
Horde::addScriptFile('QuickFinder.js', 'horde', true);
Horde::addScriptFile('revlog.js', 'chora', true);
$log_print = Chora::formatLogMessage($log->queryLog());
$author = Chora::showAuthorName($log->queryAuthor(), true);
- Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('stripe.js', 'horde', true);
require CHORA_TEMPLATES . '/common-header.inc';
require CHORA_TEMPLATES . '/menu.inc';
/* Get list of diff types. */
$diff_types = array_flip($VC->availableDiffTypes());
-Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('stripe.js', 'horde', true);
require CHORA_TEMPLATES . '/common-header.inc';
require CHORA_TEMPLATES . '/menu.inc';
$extraLink = Chora::getFileViews($where, 'patchsets');
-Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('tables.js', 'horde', true);
// JS search not needed if showing a single patchset
arsort($stats);
$title = sprintf(_("Statistics for %s"), Horde_Text_Filter::filter($where, 'space2html', array('charset' => Horde_Nls::getCharset(), 'encode' => true, 'encode_all' => true)));
-Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('tables.js', 'horde', true);
require CHORA_TEMPLATES . '/common-header.inc';
require CHORA_TEMPLATES . '/menu.inc';
$title = _("Edit yout profile page");
-Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('effects.js', 'horde', true);
Horde::addScriptFile('redbox.js', 'horde', true);
require HORDE_TEMPLATES . '/common-header.inc';
}
Horde::addScriptFile('stripe.js', 'horde', true);
-Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('effects.js', 'horde', true);
Horde::addScriptFile('redbox.js', 'horde', true);
Horde::addScriptFile('search.js', 'folks', true);
$dir = Horde_Util::getFormData('dir');
$title = _("Clipboard");
-Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('tables.js', 'horde', true);
require GOLLEM_TEMPLATES . '/common-header.inc';
Gollem::menu();
'var warn_recursive = ' . intval($GLOBALS['prefs']->getValue('recursive_deletes') == 'warn'),
);
-Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('manager.js', 'gollem', true);
Horde::addScriptFile('popup.js', 'gollem', true);
Horde::addScriptFile('tables.js', 'horde', true);
$t->set('width', round(100 / (count($rightsval) + 1)) . '%');
$t->set('prefsurl', $prefs_url);
-Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('acl.js', 'imp', true);
echo $t->fetch(IMP_TEMPLATES . '/acl/acl.html');
if (!$chunk) {
$template_output = $t->fetch(IMP_TEMPLATES . '/compose/compose.html');
}
-Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('compose.js', 'imp', true);
require IMP_TEMPLATES . '/common-header.inc';
Horde::addInlineScript($js_code);
/* Display the form. */
$title = _("Address Book");
-Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('contacts.js', 'imp', true);
require IMP_TEMPLATES . '/common-header.inc';
Horde::addInlineScript(array(
}
Prefs_UI::generateHeader(null, $chunk);
-Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('fetchmailprefs.js', 'imp', true);
$charset = Horde_Nls::getCharset();
}
require_once dirname(__FILE__) . '/lib/base.php';
-Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('folders.js', 'imp', true);
/* Redirect back to the mailbox if folder use is not allowed. */
*/
public function attach()
{
- Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('effects.js', 'horde', true);
Horde::addScriptFile('autocomplete.js', 'horde', true);
if ($prefs->getValue('nav_popup')) {
// Always include these scripts so they'll be there if
// there's new mail in later dynamic updates.
- Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('effects.js', 'horde', true);
Horde::addScriptFile('redbox.js', 'horde', true);
}
{
// Need to include script files before we start output
$core_scripts = array(
- array('prototype.js', 'horde', true),
array('effects.js', 'horde', true),
array('horde.js', 'horde', true),
array('DimpCore.js', 'imp', true),
if (($view != 'mimp') &&
$GLOBALS['prefs']->getValue('compose_popup') &&
$GLOBALS['browser']->hasFeature('javascript')) {
- Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('imp.js', 'imp', true);
if (isset($args['to'])) {
$args['to'] = addcslashes($args['to'], '\\"');
if (($_SESSION['imp']['protocol'] != 'pop') &&
$prefs->getValue('fetchmail_menu')) {
- Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('effects.js', 'horde', true);
Horde::addScriptFile('redbox.js', 'horde', true);
Horde::addScriptFile('dialog.js', 'imp', true);
}
$t_html = str_replace("\n", ' ', $t->fetch(IMP_TEMPLATES . '/newmsg/alert.html'));
- Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('effects.js', 'horde', true);
Horde::addScriptFile('redbox.js', 'horde', true);
return 'RedBox.overlay = false; RedBox.showHtml(\'' . addcslashes($t_html, "'/") . '\');';
static public function passphraseDialogJS($type, $action = null,
$params = array())
{
- Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('effects.js', 'horde', true);
Horde::addScriptFile('redbox.js', 'horde', true);
Horde::addScriptFile('dialog.js', 'imp', true);
$addr_check = ($GLOBALS['prefs']->getValue('html_image_addrbook') && $this->_inAddressBook());
if (!$view_img && !$addr_check) {
- $data .= Horde_Util::bufferOutput(array('Horde', 'addScriptFile'), 'prototype.js', 'horde', true) .
- Horde_Util::bufferOutput(array('Horde', 'addScriptFile'), 'imp.js', 'imp', true);
+ $data .= Horde_Util::bufferOutput(array('Horde', 'addScriptFile'), 'imp.js', 'imp', true);
// Unblock javascript code in js/src/imp.js
$cleanhtml['status'][] = array(
} else {
/* We need to insert JavaScript code now if S/MIME support is
* active. */
- Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('imp.js', 'imp', true);
}
$addr_count = count($addr_array);
$ret = '<span class="nowrap">' . implode(',</span> <span class="nowrap">', $addr_array) . '</span>';
if ($link && $addr_count > 15) {
- Horde::addScriptFile('prototype.js', 'horde', true);
-
$ret = '<span>' .
'<span onclick="[ this, this.next(), this.next(1) ].invoke(\'toggle\')" class="widget largeaddrlist">' . sprintf(_("[Show Addresses - %d recipients]"), $addr_count) . '</span>' .
'<span onclick="[ this, this.previous(), this.next() ].invoke(\'toggle\')" class="widget largeaddrlist" style="display:none">' . _("[Hide Addresses]") . '</span>' .
* HEAD. */
switch ($group) {
case 'flags':
- Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('colorpicker.js', 'horde', true);
Horde::addScriptFile('flagmanagement.js', 'imp', true);
$pagetitle = $title = htmlspecialchars($title);
}
-Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('effects.js', 'horde', true);
Horde::addScriptFile('redbox.js', 'horde', true);
Horde::addScriptFile('mailbox.js', 'imp', true);
$m_template->set('msgtext', $msgtext);
/* Output message page now. */
-Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('effects.js', 'horde', true);
Horde::addScriptFile('imp.js', 'imp', true);
Horde::addScriptFile('message.js', 'imp', true);
$t = new Horde_Template();
$t->setOption('gettext', true);
if ($prefs->getValue('use_pgp')) {
- Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('imp.js', 'imp', true);
$t->set('pgpactive', true);
$t->set('overview-help', Horde_Help::link('imp', 'pgp-overview'));
}
$title = _("Message Search");
-Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('stripe.js', 'horde', true);
Horde::addScriptFile('search.js', 'imp', true);
require IMP_TEMPLATES . '/common-header.inc';
/* Get the list of rules now. */
$filter_list = $filters->getFilterList();
-Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('tooltips.js', 'horde', true);
Horde::addScriptFile('stripe.js', 'horde', true);
$title = _("Filter Rules");
*/
public function attach()
{
- Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('effects.js', 'horde', true);
Horde::addScriptFile('autocomplete.js', 'horde', true);
*/
public function attach()
{
- Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('effects.js', 'horde', true);
Horde::addScriptFile('autocomplete.js', 'horde', true);
public static function header($title, $scripts = array())
{
// Need to include script files before we start output
- Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('effects.js', 'horde', true);
Horde::addScriptFile('horde.js', 'horde', true);
Horde::addScriptFile('dragdrop2.js', 'horde', true);
<?php
-Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('effects.js', 'horde', true);
Horde::addScriptFile('views.js', 'kronolith', true);
Horde::addScriptFile('stripe.js', 'horde', true);
if (!$print_view) {
Horde::addScriptFile('popup.js', 'horde', true);
Horde::addScriptFile('tooltips.js', 'horde', true);
- Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('effects.js', 'horde', true);
Horde::addScriptFile('QuickFinder.js', 'horde', true);
$print_link = Horde::applicationUrl(Horde_Util::addParameter('list.php', array('print' => 1)));
Horde::addScriptFile('popup.js', 'horde', true);
Horde::addScriptFile('tooltips.js', 'horde', true);
-Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('effects.js', 'horde', true);
Horde::addScriptFile('QuickFinder.js', 'horde', true);
}
$html .= '</select></form>';
- Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('effects.js', 'horde', true);
Horde::addScriptFile('redbox.js', 'horde', true);
Horde::addScriptFile('feed.js', 'news', true);
return $html;
}
-}
\ No newline at end of file
+}
$title = _("Export Classes");
-Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('effects.js', 'horde', true);
Horde::addScriptFile('redbox.js', 'horde', true);
require SKOLI_TEMPLATES . '/common-header.inc';
Horde::addScriptFile('popup.js', 'horde', true);
Horde::addScriptFile('tooltips.js', 'horde', true);
-Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('effects.js', 'horde', true);
Horde::addScriptFile('QuickFinder.js', 'horde', true);
$title = _("Search");
$notification->push('document.skoli_searchform.stext.focus();', 'javascript');
-Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('QuickFinder.js', 'horde', true);
Horde::addScriptFile('effects.js', 'horde', true);
Horde::addScriptFile('redbox.js', 'horde', true);
switch ($entry['type']) {
case 'mark':
- $details = $entry['subject'] . ': ' . $entry['mark'] .
- ($classes[$entry['classid']]->get('marks') == 'percent' ? '%' : '') .
+ $details = $entry['subject'] . ': ' . $entry['mark'] .
+ ($classes[$entry['classid']]->get('marks') == 'percent' ? '%' : '') .
' (' . $entry['weight'] . '), ' . $entry['title'];
break;
break;
case 'outcome':
- $details = $entry['outcome'] . ': ' .
- (isset($entry['completed']) && $entry['completed'] != '' ? _("Completed") : _("Open")) .
+ $details = $entry['outcome'] . ': ' .
+ (isset($entry['completed']) && $entry['completed'] != '' ? _("Completed") : _("Open")) .
(isset($entry['comment']) && $entry['comment'] != '' ? ', ' . $entry['comment'] : '');
break;
<?php
-Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('QuickFinder.js', 'horde', true);
$current_user = Horde_Auth::getAuth();
}
$title = $view->getTitle();
-Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('contact_tabs.js', 'turba', true);
require TURBA_TEMPLATES . '/common-header.inc';
if ($print_view) {
$templates[] = '/browse/header.inc';
}
- Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('QuickFinder.js', 'horde', true);
Horde::addScriptFile('effects.js', 'horde', true);
Horde::addScriptFile('redbox.js', 'horde', true);
$notification->push('document.directory_search.name.focus();', 'javascript');
}
-Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('QuickFinder.js', 'horde', true);
Horde::addScriptFile('effects.js', 'horde', true);
Horde::addScriptFile('redbox.js', 'horde', true);
<?php if (!$prefs->isLocked('columns')):
-Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('effects.js', 'horde', true);
Horde::addScriptFile('dragdrop.js', 'horde', true);