if (preg_match('/charset=(.*)/i', $headers, $m)) {
return $m[1];
}
- return NLS::getCharset();
+ return Horde_Nls::getCharset();
}
function convert_string($msg) {
$f = array('/</', '/>/');
$t = array('<', '>');
$msg = preg_replace($f, $t, $msg);
- return Horde_String::convertCharset(html_entity_decode($msg), NLS::getCharset(), Translate_Display::parseCharset($po->meta['Content-Type']));
+ return Horde_String::convertCharset(html_entity_decode($msg), Horde_Nls::getCharset(), Translate_Display::parseCharset($po->meta['Content-Type']));
}
function display_string($msg) {
$f = array('/</', '/>/');
$t = array('<', '>');
$msg = preg_replace($f, $t, $msg);
- return Horde_String::convertCharset($msg, Translate_Display::parseCharset($po->meta['Content-Type']), NLS::getCharset());
+ return Horde_String::convertCharset($msg, Translate_Display::parseCharset($po->meta['Content-Type']), Horde_Nls::getCharset());
}
function get_percent($used, $total) {
<?php
if (isset($language)) {
- header('Content-type: text/html; charset=' . NLS::getCharset());
+ header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
header('Vary: Accept-Language');
}
?>
Chora::fatal($e);
}
-$title = sprintf(_("Source Annotation of %s (revision %s)"), Horde_Text_Filter::filter($where, 'space2html', array('charset' => NLS::getCharset(), 'encode' => true, 'encode_all' => true)), $rev);
+$title = sprintf(_("Source Annotation of %s (revision %s)"), Horde_Text_Filter::filter($where, 'space2html', array('charset' => Horde_Nls::getCharset(), 'encode' => true, 'encode_all' => true)), $rev);
$extraLink = sprintf('<a href="%s">%s</a> | <a href="%s">%s</a>',
Chora::url('co', $where, array('r' => $rev)), _("View"),
Chora::url('co', $where, array('r' => $rev, 'p' => 1)), _("Download"));
}
$prev = $fl->queryPreviousRevision($rev);
- $line = Horde_Text_Filter::filter($line['line'], 'space2html', array('charset' => NLS::getCharset(), 'encode' => true, 'encode_all' => true));
+ $line = Horde_Text_Filter::filter($line['line'], 'space2html', array('charset' => Horde_Nls::getCharset(), 'encode' => true, 'encode_all' => true));
include CHORA_TEMPLATES . '/annotate/line.inc';
}
continue;
}
$url = Chora::url('browsedir', $where . '/' . $currentDir . '/', array('onb' => $onb));
- $currDir = Horde_Text_Filter::filter($currentDir, 'space2html', array('charset' => NLS::getCharset(), 'encode' => true, 'encode_all' => true));
+ $currDir = Horde_Text_Filter::filter($currentDir, 'space2html', array('charset' => Horde_Nls::getCharset(), 'encode' => true, 'encode_all' => true));
require CHORA_TEMPLATES . '/directory/dir.inc';
}
echo '</tbody>';
$log = $lg->queryLog();
$attic = $currFile->isDeleted();
$fileName = $where . ($attic ? '/' . 'Attic' : '') . '/' . $realname;
- $name = Horde_Text_Filter::filter($realname, 'space2html', array('charset' => NLS::getCharset(), 'encode' => true, 'encode_all' => true));
+ $name = Horde_Text_Filter::filter($realname, 'space2html', array('charset' => Horde_Nls::getCharset(), 'encode' => true, 'encode_all' => true));
$url = Chora::url('browsefile', $fileName, array('onb' => $onb));
$readableDate = Chora::readableTime($date);
if ($log) {
passthru($conf['paths']['cvsgraph'] . ' ' . $argstr . ' ' . $file);
} else {
// Display the wrapper page for the image.
- $title = sprintf(_("Graph for %s"), Horde_Text_Filter::filter($where, 'space2html', array('charset' => NLS::getCharset(), 'encode' => true, 'encode_all' => true)));
+ $title = sprintf(_("Graph for %s"), Horde_Text_Filter::filter($where, 'space2html', array('charset' => Horde_Nls::getCharset(), 'encode' => true, 'encode_all' => true)));
$extraLink = Chora::getFileViews($where, 'cvsgraph');
require CHORA_TEMPLATES . '/common-header.inc';
$abbrev_r1 = $VC->abbrev($r1);
$abbrev_r2 = $VC->abbrev($r2);
$title = sprintf(_("Diff for %s between version %s and %s"),
- Horde_Text_Filter::filter($where, 'space2html', array('charset' => NLS::getCharset(), 'encode' => true, 'encode_all' => true)), $abbrev_r1, $abbrev_r2);
+ Horde_Text_Filter::filter($where, 'space2html', array('charset' => Horde_Nls::getCharset(), 'encode' => true, 'encode_all' => true)), $abbrev_r1, $abbrev_r2);
/* Format log entries. */
$log_messages = array();
$maxCol = max($val, $maxCol);
}
-$title = sprintf(_("Source Branching View for %s"), Horde_Text_Filter::filter($where, 'space2html', array('charset' => NLS::getCharset(), 'encode' => true, 'encode_all' => true)));
+$title = sprintf(_("Source Branching View for %s"), Horde_Text_Filter::filter($where, 'space2html', array('charset' => Horde_Nls::getCharset(), 'encode' => true, 'encode_all' => true)));
$extraLink = Chora::getFileViews($where, 'history');
require CHORA_TEMPLATES . '/common-header.inc';
if (!empty($onb)) {
$url = Horde_Util::addParameter($url, array('onb' => $onb));
}
- $bar .= '/ <a href="' . $url . '">'. Horde_Text_Filter::filter($dir, 'space2html', array('charset' => NLS::getCharset(), 'encode' => true, 'encode_all' => true)) . '</a> ';
+ $bar .= '/ <a href="' . $url . '">'. Horde_Text_Filter::filter($dir, 'space2html', array('charset' => Horde_Nls::getCharset(), 'encode' => true, 'encode_all' => true)) . '</a> ';
}
}
*/
static public function formatLogMessage($log)
{
- $log = Horde_Text_Filter::filter($log, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO, 'charset' => NLS::getCharset(), 'class' => ''));
+ $log = Horde_Text_Filter::filter($log, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO, 'charset' => Horde_Nls::getCharset(), 'class' => ''));
return (empty($GLOBALS['conf']['tickets']['regexp']) || empty($GLOBALS['conf']['tickets']['replacement']))
? $log
}
arsort($stats);
-$title = sprintf(_("Statistics for %s"), Horde_Text_Filter::filter($where, 'space2html', array('charset' => NLS::getCharset(), 'encode' => true, 'encode_all' => true)));
+$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';
<?php
if (isset($language)) {
- header('Content-type: text/html; charset=' . NLS::getCharset());
+ header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
header('Vary: Accept-Language');
}
echo !empty($language) ? '<html lang="' . strtr($language, '_', '-') . '">' : '<html><head>';
if (Horde_Util::nonInputVar('js_vars')) {
echo '<script type="text/javascript">//<![CDATA[' . "\n" .
- 'var Chora = ' . Horde_Serialize::serialize($js_vars, Horde_Serialize::JSON, NLS::getCharset()) . ";\n//]]></script>\n";
+ 'var Chora = ' . Horde_Serialize::serialize($js_vars, Horde_Serialize::JSON, Horde_Nls::getCharset()) . ";\n//]]></script>\n";
}
Horde::includeScriptFiles();
<?php
if (isset($language)) {
- header('Content-type: text/html; charset=' . NLS::getCharset());
+ header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
header('Vary: Accept-Language');
}
?>
}
}
-echo Horde_Serialize::serialize($block_data, Horde_Serialize::JSON, NLS::getCharset());
+echo Horde_Serialize::serialize($block_data, Horde_Serialize::JSON, Horde_Nls::getCharset());
}
}
- $content = Horde_Serialize::serialize($content, Horde_Serialize::JSON, NLS::getCharset());
- $title = Horde_Serialize::serialize($title, Horde_Serialize::JSON, NLS::getCharset());
- $params = Horde_Serialize::serialize($params, Horde_Serialize::JSON, NLS::getCharset());
+ $content = Horde_Serialize::serialize($content, Horde_Serialize::JSON, Horde_Nls::getCharset());
+ $title = Horde_Serialize::serialize($title, Horde_Serialize::JSON, Horde_Nls::getCharset());
+ $params = Horde_Serialize::serialize($params, Horde_Serialize::JSON, Horde_Nls::getCharset());
$js_init .= 'portal.add(new Xilinus.Widget().'
. 'setTitle(title_' . $js_id .').'
break;
case 'eo':
case 'desc':
- $row[$key] = Horde_String::convertCharset($value, NLS::getCharset(), $params['charset']);
+ $row[$key] = Horde_String::convertCharset($value, Horde_Nls::getCharset(), $params['charset']);
break;
default:
break;
$charsets[$charset] = $charset;
}
}
- $my_charset = NLS::getCharset(true);
+ $my_charset = Horde_Nls::getCharset(true);
}
foreach ($templates[$next_step] as $template) {
$this->_ledger,
sprintf('%\'04d', $number),
$type,
- Horde_String::convertCharset($name, NLS::getCharset(), $this->_params['charset']),
+ Horde_String::convertCharset($name, Horde_Nls::getCharset(), $this->_params['charset']),
(int)(bool)$eo,
- Horde_String::convertCharset($desc, NLS::getCharset(), $this->_params['charset']),
+ Horde_String::convertCharset($desc, Horde_Nls::getCharset(), $this->_params['charset']),
(int)(bool)$closed);
/* Log the query at a DEBUG log level. */
$this->_params['table_accounts']);
$values = array(sprintf('%\'04d', $number),
$type,
- Horde_String::convertCharset($name, NLS::getCharset(), $this->_params['charset']),
+ Horde_String::convertCharset($name, Horde_Nls::getCharset(), $this->_params['charset']),
(int)(bool)$eo,
- Horde_String::convertCharset($desc, NLS::getCharset(), $this->_params['charset']),
+ Horde_String::convertCharset($desc, Horde_Nls::getCharset(), $this->_params['charset']),
(int)(bool)$closed,
$this->_ledger,
$accountId);
$account,
(int)(bool)$eo,
(float)$amount,
- Horde_String::convertCharset($desc, NLS::getCharset(), $this->_params['charset']));
+ Horde_String::convertCharset($desc, Horde_Nls::getCharset(), $this->_params['charset']));
/* Log the query at a DEBUG log level. */
Horde::logMessage(sprintf('Fima_Driver_sql::_addPosting(): %s', $query),
$account,
(int)(bool)$eo,
(float)$amount,
- Horde_String::convertCharset($desc, NLS::getCharset(), $this->_params['charset']),
+ Horde_String::convertCharset($desc, Horde_Nls::getCharset(), $this->_params['charset']),
$this->_ledger,
$postingId);
Horde::compressOutput();
// Set the timezone variable.
-NLS::setTimeZone();
+Horde_Nls::setTimeZone();
// Create a share instance.
require_once 'Horde/Share.php';
<?php
if (isset($language)) {
- header('Content-type: text/html; charset=' . NLS::getCharset());
+ header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
header('Vary: Accept-Language');
}
?>
$value = hash('md5', $value);
}
$fields[] = 'user_' . Horde_String::lower($field);
- $values[] = Horde_String::convertCharset($value, NLS::getCharset(), $conf['sql']['charset']);
+ $values[] = Horde_String::convertCharset($value, Horde_Nls::getCharset(), $conf['sql']['charset']);
}
$values[] = $userID;
{
$result = Horde::loadConfiguration('countries.php', 'countries', 'folks');
if ($result instanceof PEAR_Error) {
- return NLS::getCountryISO();
+ return Horde_Nls::getCountryISO();
}
return $result;
*/
static public function sendMail($to, $subject, $body, $attaches = array())
{
- $mail = new Horde_Mime_Mail($subject, $body, $to, $GLOBALS['conf']['support'], NLS::getCharset());
+ $mail = new Horde_Mime_Mail($subject, $body, $to, $GLOBALS['conf']['support'], Horde_Nls::getCharset());
require_once FOLKS_BASE . '/lib/version.php';
$mail->addHeader('User-Agent', 'Folks ' . FOLKS_VERSION);
foreach ($attaches as $file) {
if (file_exists($file)) {
- $mail->addAttachment($file, null, null, NLS::getCharset());
+ $mail->addAttachment($file, null, null, Horde_Nls::getCharset());
}
}
$mail = new Horde_Mime_Mail($subject, $body, null,
$this->_params['from_addr'],
- NLS::getCharset());
+ Horde_Nls::getCharset());
$mail->addHeader('User-Agent', 'Folks ' . FOLKS_VERSION);
$mail->addHeader('X-Originating-IP', $_SERVER['REMOTE_ADDR']);
foreach ($attachments as $file) {
if (file_exists($file)) {
- $mail->addAttachment($file, null, null, NLS::getCharset());
+ $mail->addAttachment($file, null, null, Horde_Nls::getCharset());
}
}
if (empty($to)) {
continue;
}
- $mail->addHeader('To', $to, NLS::getCharset(), true);
+ $mail->addHeader('To', $to, Horde_Nls::getCharset(), true);
$mail->send($mail_driver, $mail_params);
}
// Set charset to UTF-8 for most flexible conversion between email charset and
// backend charset.
-NLS::setCharsetEnvironment('UTF-8');
+Horde_Nls::setCharsetEnvironment('UTF-8');
// Read and parse the message.
$messages = array();
$body2 = sprintf($body, $row[0], $registry->get('name', 'horde'), Folks::getUrlFor('user', $row[0], true, -1));
// Send mail
- $mail = new MIME_Mail($subject, $body2, $row[1], $conf['support'], NLS::getCharset());
+ $mail = new MIME_Mail($subject, $body2, $row[1], $conf['support'], Horde_Nls::getCharset());
$mail->addHeader('User-Agent', 'Folks' . FOLKS_VERSION);
$sent = $mail->send($conf['mailer']['type'], $conf['mailer']['params']);
if ($sent instanceof PEAR_Error) {
<?php
if (isset($language)) {
- header('Content-type: text/html; charset=' . NLS::getCharset());
+ header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
header('Vary: Accept-Language');
}
?>
-<?php echo '<?xml version="1.0" encoding="' . NLS::getCharset() . '"?>' ?>
+<?php echo '<?xml version="1.0" encoding="' . Horde_Nls::getCharset() . '"?>' ?>
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/">
<channel>
-<?php echo '<?xml version="1.0" encoding="' . NLS::getCharset() . '"?>' ?>
+<?php echo '<?xml version="1.0" encoding="' . Horde_Nls::getCharset() . '"?>' ?>
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/">
<channel>
}
/* Get current locale information. */
- $linfo = NLS::getLocaleInfo();
+ $linfo = Horde_Nls::getLocaleInfo();
/* Build the pattern. */
$pattern = '(-)?';
function getInfo($vars, $var, &$info)
{
$value = $vars->get($var->getVarName());
- $linfo = NLS::getLocaleInfo();
+ $linfo = Horde_Nls::getLocaleInfo();
$value = str_replace($linfo['mon_thousands_sep'], '', $value);
$info = str_replace($linfo['mon_decimal_point'], '.', $value);
}
}
}
}
- require_once 'Horde/NLS.php';
echo '<input type="hidden" name="_formvars" value="'
- . htmlspecialchars(serialize($vars), ENT_QUOTES, NLS::getCharset())
+ . htmlspecialchars(serialize($vars), ENT_QUOTES, Horde_Nls::getCharset())
. '" />';
}
public function getInfo($vars, $var, &$info)
{
$value = $vars->get($var->name);
- $linfo = NLS::getLocaleInfo();
+ $linfo = Horde_Nls::getLocaleInfo();
$value = str_replace($linfo['mon_thousands_sep'], '', $value);
$info = str_replace($linfo['mon_decimal_point'], '.', $value);
}
}
/* Get current locale information. */
- $linfo = NLS::getLocaleInfo();
+ $linfo = Horde_Nls::getLocaleInfo();
/* Build the pattern. */
$pattern = '(-)?';
if ($var->type->fraction) {
$value = sprintf('%01.' . $var->type->fraction . 'f', $value);
}
- $linfo = NLS::getLocaleInfo();
+ $linfo = Horde_Nls::getLocaleInfo();
/* Only if there is a mon_decimal_point do the
* substitution. */
if (!empty($linfo['mon_decimal_point'])) {
. 'id="%2$s" value="%3$s"%4$s%5$s%6$s />',
($var->isDisabled() ? ' form-input-disabled" ' : ''),
$var->getVarName(),
- htmlspecialchars($var->getValue($vars), ENT_QUOTES, NLS::getCharset()),
+ htmlspecialchars($var->getValue($vars), ENT_QUOTES, Horde_Nls::getCharset()),
($var->isDisabled() ? ' disabled="disabled" ' : ''),
($var->type->maxlength ? ' maxlength="' . $var->type->maxlength . '"' : ''),
$this->_getActionScripts($form, $var)
return sprintf(
'<input type="text" class="form-input-phone" name="%1$s" id="%1$s" value="%2$s" %3$s%4$s />',
$var->getVarName(),
- htmlspecialchars($var->getValue($vars), ENT_QUOTES, NLS::getCharset()),
+ htmlspecialchars($var->getValue($vars), ENT_QUOTES, Horde_Nls::getCharset()),
($var->isDisabled() ? ' disabled="disabled" ' : ''),
$this->_getActionScripts($form, $var)
);
{
return sprintf(' <input type="text" class="form-input-ipaddress" name="%1$s" id="%1$s" value="%2$s" %3$s%4$s />',
$var->getVarName(),
- htmlspecialchars($var->getValue($vars), ENT_QUOTES, NLS::getCharset()),
+ htmlspecialchars($var->getValue($vars), ENT_QUOTES, Horde_Nls::getCharset()),
$var->isDisabled() ? ' disabled="disabled" ' : '',
$this->_getActionScripts($form, $var)
);
/* Hidden tag to store the preview image filename. */
$html = sprintf(' <input type="hidden" name="%1$s" id="%1$s" value="%2$s" />',
$varname . '[img]',
- htmlspecialchars($image['img'], ENT_QUOTES, NLS::getCharset()));
+ htmlspecialchars($image['img'], ENT_QUOTES, Horde_Nls::getCharset()));
/* Unserialize the img information to get the full array. */
$image['img'] = @unserialize($image['img']);
$prompt = $var->type->prompt;
$htmlchars = $var->getOption('htmlchars');
if ($prompt) {
- $prompt = '<option value="">' . ($htmlchars ? htmlspecialchars($prompt, ENT_QUOTES, NLS::getCharset()) : $prompt) . '</option>';
+ $prompt = '<option value="">' . ($htmlchars ? htmlspecialchars($prompt, ENT_QUOTES, Horde_Nls::getCharset()) : $prompt) . '</option>';
}
return sprintf(' <select name="%1$s" id="%1$s"%2$s>%3$s%4$s </select>',
$var->getVarName(),
/* Hidden tag to store the current first level. */
$html = sprintf(' <input type="hidden" name="%1$s[old]" id="%1$s[old]" value="%2$s" />',
$varname,
- htmlspecialchars($selected['1'], ENT_QUOTES, NLS::getCharset()));
+ htmlspecialchars($selected['1'], ENT_QUOTES, Horde_Nls::getCharset()));
/* First level. */
$values_1 = Horde_Array::valuesToKeys(array_keys($values));
'if (this.value) { document.' . $form->getName() . '.formname.value=\'\';' . 'document.' . $form->getName() . '.submit() }',
($var->hasAction() ? ' ' . $this->_genActionScript($form, $var->_action, $varname) : ''));
if (!empty($prompts)) {
- $html .= '<option value="">' . htmlspecialchars($prompts[0], ENT_QUOTES, NLS::getCharset()) . '</option>';
+ $html .= '<option value="">' . htmlspecialchars($prompts[0], ENT_QUOTES, Horde_Nls::getCharset()) . '</option>';
}
$html .= $this->_selectOptions($values_1, $selected['1']);
$html .= ' </select>';
$varname,
($var->hasAction() ? ' ' . $this->_genActionScript($form, $var->_action, $varname) : ''));
if (!empty($prompts)) {
- $html .= '<option value="">' . htmlspecialchars($prompts[1], ENT_QUOTES, NLS::getCharset()) . '</option>';
+ $html .= '<option value="">' . htmlspecialchars($prompts[1], ENT_QUOTES, Horde_Nls::getCharset()) . '</option>';
}
$values_2 = array();
if (!empty($selected['1'])) {
function _renderVarDisplayDefault($form, $var, $vars)
{
return nl2br(htmlspecialchars($var->getValue($vars), ENT_QUOTES,
- NLS::getCharset()));
+ Horde_Nls::getCharset()));
}
function _renderVarDisplay_html($form, $var, $vars)
return Horde::link($mail_link, $email_val)
. htmlspecialchars($display_email) . '</a>';
} else {
- return nl2br(htmlspecialchars($display_email, ENT_QUOTES, NLS::getCharset()));
+ return nl2br(htmlspecialchars($display_email, ENT_QUOTES, Horde_Nls::getCharset()));
}
}
if (count($values) == 0) {
return _("No values");
} elseif (isset($values[$value]) && $value != '') {
- return htmlspecialchars($values[$value], ENT_QUOTES, NLS::getCharset());
+ return htmlspecialchars($values[$value], ENT_QUOTES, Horde_Nls::getCharset());
}
}
if (count($values) == 0) {
return _("No values");
} elseif (isset($values[$var->getValue($vars)])) {
- return htmlspecialchars($values[$var->getValue($vars)], ENT_QUOTES, NLS::getCharset());
+ return htmlspecialchars($values[$var->getValue($vars)], ENT_QUOTES, Horde_Nls::getCharset());
}
}
$display[] = $name;
}
}
- return htmlspecialchars(implode(', ', $display), ENT_QUOTES, NLS::getCharset());
+ return htmlspecialchars(implode(', ', $display), ENT_QUOTES, Horde_Nls::getCharset());
}
}
$display[] = $name;
}
}
- return htmlspecialchars(implode(', ', $display), ENT_QUOTES, NLS::getCharset());
+ return htmlspecialchars(implode(', ', $display), ENT_QUOTES, Horde_Nls::getCharset());
}
}
}
}
- $html = nl2br(htmlspecialchars($var->getValue($vars), ENT_QUOTES, NLS::getCharset()));
+ $html = nl2br(htmlspecialchars($var->getValue($vars), ENT_QUOTES, Horde_Nls::getCharset()));
if (!empty($mapurl)) {
$html .= ' ' . Horde::link(Horde::externalUrl($mapurl), $desc, null, '_blank') . Horde::img($icon, $desc, '', $registry->getImageDir('horde')) . '</a>';
}
function _renderVarDisplay_invalid($form, $var, $vars)
{
return '<p class="form-error form-inline">'
- . htmlspecialchars($var->type->message, ENT_QUOTES, NLS::getCharset())
+ . htmlspecialchars($var->type->message, ENT_QUOTES, Horde_Nls::getCharset())
. '</p>';
}
$selected = '';
}
$result .= ' <option value="';
- $result .= ($htmlchars) ? htmlspecialchars($value, ENT_QUOTES, NLS::getCharset()) : $value;
+ $result .= ($htmlchars) ? htmlspecialchars($value, ENT_QUOTES, Horde_Nls::getCharset()) : $value;
$result .= '"' . $selected . '>';
$result .= ($htmlchars) ? htmlspecialchars($display) : $display;
$result .= "</option>\n";
$selected = '';
}
$result .= " <option value=\""
- . htmlspecialchars($value, ENT_QUOTES, NLS::getCharset())
+ . htmlspecialchars($value, ENT_QUOTES, Horde_Nls::getCharset())
. "\"$selected>" . htmlspecialchars($display) . "</option>\n";
}
$imp_folder = IMP_Folder::singleton();
- $new = Horde_String::convertCharset($mbox, NLS::getCharset(), 'UTF7-IMAP');
+ $new = Horde_String::convertCharset($mbox, Horde_Nls::getCharset(), 'UTF7-IMAP');
try {
$new = $imptree->createMailboxName(Horde_Util::getPost('parent'), $new);
$result = $imp_folder->create($new, $prefs->getValue('subscribe'));
try {
$new = $imptree->createMailboxName($new_parent, $new);
- $new = Horde_String::convertCharset($new, NLS::getCharset(), 'UTF7-IMAP');
+ $new = Horde_String::convertCharset($new, Horde_Nls::getCharset(), 'UTF7-IMAP');
if ($old != $new) {
$result = $imp_folder->rename($old, $new);
if ($result) {
/* Ignore missing addresses, which are returned as <>. */
if (strlen($mail_address) > 2) {
$mail_address_full = $mail_identity->getDefaultFromAddress(true);
- NLS::setTimeZone();
- NLS::setLanguageEnvironment();
+ Horde_Nls::setTimeZone();
+ Horde_Nls::setLanguageEnvironment();
/* Set up the mail headers and read the log file. */
$msg_headers = new Horde_Mime_Headers();
$msg = new Horde_Mime_Part();
$msg->setType('text/plain');
- $msg->setCharset(NLS::getCharset());
+ $msg->setCharset(Horde_Nls::getCharset());
$msg->setContents(Horde_String::wrap(sprintf(_("Your linked attachment has been downloaded by at least one user.\n\nAttachment name: %s\nAttachment date: %s\n\nClick on the following link to permanently delete the attachment:\n%s"), $file_name, date('r', $time_stamp), Horde_Util::addParameter(Horde::selfUrl(true, false, true), 'd', $id))));
$msg->send($mail_address, $msg_headers);
}
/* Set the current time zone. */
-NLS::setTimeZone();
+Horde_Nls::setTimeZone();
/* Initialize the IMP_Compose:: object. */
$imp_compose = IMP_Compose::singleton(Horde_Util::getFormData('composeCache'));
}
/* Set the default charset. */
- $charset = NLS::getEmailCharset();
+ $charset = Horde_Nls::getEmailCharset();
if (!$prefs->isLocked('sending_charset')) {
$charset = Horde_Util::getFormData('charset', $charset);
}
try {
$old_index = $imp_compose->getMetadata('draft_index');
- $res = $imp_compose->saveDraft($header, Horde_Util::getFormData('message', ''), NLS::getCharset(), Horde_Util::getFormData('html'));
+ $res = $imp_compose->saveDraft($header, Horde_Util::getFormData('message', ''), Horde_Nls::getCharset(), Horde_Util::getFormData('html'));
$result->success = 1;
/* Delete existing draft. */
Horde::callHook('_imp_hook_disable_compose', array(), 'imp');
/* Set the current time zone. */
-NLS::setTimeZone();
+Horde_Nls::setTimeZone();
/* Initialize the IMP_Compose:: object. */
$imp_compose = IMP_Compose::singleton(Horde_Util::getFormData('composeCache'));
$f_to = $imp_ui->getAddressList(Horde_Util::getFormData('to'));
try {
- $imp_ui->redirectMessage($f_to, $imp_compose, $imp_contents, NLS::getEmailCharset());
+ $imp_ui->redirectMessage($f_to, $imp_compose, $imp_contents, Horde_Nls::getEmailCharset());
if ($prefs->getValue('compose_confirm')) {
$notification->push(_("Message redirected successfully."), 'horde.success');
}
);
try {
- if ($imp_compose->buildAndSendMessage($message, $header, NLS::getEmailCharset(), false, $options)) {
+ if ($imp_compose->buildAndSendMessage($message, $header, Horde_Nls::getEmailCharset(), false, $options)) {
$imp_compose->destroy();
if (Horde_Util::getFormData('resume_draft') &&
}
/* Set the current time zone. */
-NLS::setTimeZone();
+Horde_Nls::setTimeZone();
/* Determine if compose mode is disabled. */
$compose_disable = !empty($conf['hooks']['disable_compose']) &&
* $charset - charset to use when sending messages
* $encoding - best guessed charset offered to the user as the default value
* in the charset dropdown list. */
-$charset = $prefs->isLocked('sending_charset') ? NLS::getEmailCharset() : Horde_Util::getFormData('charset');
-$encoding = empty($charset) ? NLS::getEmailCharset() : $charset;
+$charset = $prefs->isLocked('sending_charset') ? Horde_Nls::getEmailCharset() : Horde_Util::getFormData('charset');
+$encoding = empty($charset) ? Horde_Nls::getEmailCharset() : $charset;
/* Is this a popup window? */
$has_js = $browser->hasFeature('javascript');
/* Save the draft. */
try {
- $result = $imp_compose->saveDraft($header, $message, NLS::getCharset(), $rtemode);
+ $result = $imp_compose->saveDraft($header, $message, Horde_Nls::getCharset(), $rtemode);
$imp_compose->destroy();
/* Closing draft if requested by preferences. */
Horde_Mime_Address::addrArray2String($identity->getBccAddresses($ident))
);
}
- $js_code[] = 'ImpCompose.identities = ' . Horde_Serialize::serialize($js_ident, Horde_Serialize::JSON, NLS::getCharset());
+ $js_code[] = 'ImpCompose.identities = ' . Horde_Serialize::serialize($js_ident, Horde_Serialize::JSON, Horde_Nls::getCharset());
}
$t->set('attach_vcard', Horde_Util::getFormData('vcard'));
}
if ($_SESSION['imp']['file_upload']) {
- $localeinfo = NLS::getLocaleInfo();
+ $localeinfo = Horde_Nls::getLocaleInfo();
if ($GLOBALS['registry']->hasMethod('files/selectlistLink')) {
$res = $GLOBALS['registry']->call('files/selectlistLink', array(_("Attach Files"), 'widget', 'compose', true));
$t->set('selectlistlink', (is_a($res, 'PEAR_Error')) ? null : $res);
$selected_addresses = array();
foreach (explode('|', Horde_Util::getFormData('sa')) as $addr) {
if (strlen(trim($addr))) {
- $selected_addresses[] = @htmlspecialchars($addr, ENT_QUOTES, NLS::getCharset());
+ $selected_addresses[] = @htmlspecialchars($addr, ENT_QUOTES, Horde_Nls::getCharset());
}
}
foreach ($addresses as $addr) {
if (!empty($addr['email'])) {
if (strpos($addr['email'], ',') !== false) {
- $a_list[] = @htmlspecialchars(Horde_Mime_Address::encode($addr['name'], 'personal') . ': ' . $addr['email'] . ';', ENT_QUOTES, NLS::getCharset());
+ $a_list[] = @htmlspecialchars(Horde_Mime_Address::encode($addr['name'], 'personal') . ': ' . $addr['email'] . ';', ENT_QUOTES, Horde_Nls::getCharset());
} else {
$mbox_host = explode('@', $addr['email']);
if (isset($mbox_host[1])) {
- $a_list[] = @htmlspecialchars(Horde_Mime_Address::writeAddress($mbox_host[0], $mbox_host[1], $addr['name']), ENT_QUOTES, NLS::getCharset());
+ $a_list[] = @htmlspecialchars(Horde_Mime_Address::writeAddress($mbox_host[0], $mbox_host[1], $addr['name']), ENT_QUOTES, Horde_Nls::getCharset());
}
}
}
Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('fetchmailprefs.js', 'imp', true);
-$charset = NLS::getCharset();
+$charset = Horde_Nls::getCharset();
IMP::addInlineScript(array(
'ImpFetchmailprefs.fetchurl = ' . Horde_Serialize($fetch_url, Horde_Serialize::JSON, $charset),
'ImpFetchmailprefs.prefsurl = ' . Horde_Serialize($prefs_url, Horde_Serialize::JSON, $charset)
$subscribe = $prefs->getValue('subscribe');
$showAll = (!$subscribe || $_SESSION['imp']['showunsub']);
-$charset = NLS::getCharset();
+$charset = Horde_Nls::getCharset();
/* Get the base URL for this page. */
$folders_url = Horde::selfUrl();
} else {
require_once 'Horde/Identity.php';
- $charset = NLS::getCharset();
+ $charset = Horde_Nls::getCharset();
$imp_ui = new IMP_UI_Mailbox('INBOX');
$shown = empty($this->_params['msgs_shown']) ? 3 : $this->_params['msgs_shown'];
$mdn->addMDNRequestHeaders($headers, $barefrom);
}
- $browser_charset = NLS::getCharset();
+ $browser_charset = Horde_Nls::getCharset();
$headers->addHeader('From', Horde_String::convertCharset($header['from'], $browser_charset, $charset));
$headers_result = Horde::loadConfiguration('header.php', '_header');
if (!is_a($headers_result, 'PEAR_Error')) {
foreach ($headers_result as $key => $val) {
- $headers->addHeader(trim($key), Horde_String::convertCharset(trim($val), NLS::getCharset(), $charset));
+ $headers->addHeader(trim($key), Horde_String::convertCharset(trim($val), Horde_Nls::getCharset(), $charset));
}
}
}
try {
- $GLOBALS['imp_imap']->ob->append(Horde_String::convertCharset($opts['sent_folder'], NLS::getCharset(), 'UTF-8'), array(array('data' => $fcc, 'flags' => $flags)));
+ $GLOBALS['imp_imap']->ob->append(Horde_String::convertCharset($opts['sent_folder'], Horde_Nls::getCharset(), 'UTF-8'), array(array('data' => $fcc, 'flags' => $flags)));
} catch (Horde_Imap_Client_Exception $e) {
$notification->push(sprintf(_("Message sent successfully, but not saved to %s"), IMP::displayFolder($opts['sent_folder'])));
$sent_saved = false;
$recipients += isset($address['grounpname']) ? count($address['addresses']) : 1;
}
if ($recipients > $timelimit) {
- $error = @htmlspecialchars(sprintf(_("You are not allowed to send messages to more than %d recipients within %d hours."), $timelimit, $conf['sentmail']['params']['limit_period']), ENT_COMPAT, NLS::getCharset());
+ $error = @htmlspecialchars(sprintf(_("You are not allowed to send messages to more than %d recipients within %d hours."), $timelimit, $conf['sentmail']['params']['limit_period']), ENT_COMPAT, Horde_Nls::getCharset());
if (!empty($conf['hooks']['permsdenied'])) {
$error = Horde::callHook('_perms_hook_denied', array('imp:max_timelimit'), 'horde', $error);
}
$num_recipients += count(explode(',', $recipient));
}
if ($num_recipients > $max_recipients) {
- $message = @htmlspecialchars(sprintf(_("You are not allowed to send messages to more than %d recipients."), $max_recipients), ENT_COMPAT, NLS::getCharset());
+ $message = @htmlspecialchars(sprintf(_("You are not allowed to send messages to more than %d recipients."), $max_recipients), ENT_COMPAT, Horde_Nls::getCharset());
if (!empty($conf['hooks']['permsdenied'])) {
$message = Horde::callHook('_perms_hook_denied', array('imp:max_recipients'), 'horde', $message);
}
// Convert IDN hosts to ASCII.
if (Horde_Util::extensionExists('idn')) {
$old_error = error_reporting(0);
- $host = idn_to_ascii(Horde_String::convertCharset($host, NLS::getCharset(), 'UTF-8'));
+ $host = idn_to_ascii(Horde_String::convertCharset($host, Horde_Nls::getCharset(), 'UTF-8'));
error_reporting($old_error);
} elseif (Horde_Mime::is8bit($ob['mailbox'])) {
throw new IMP_Compose_Exception(sprintf(_("Invalid character in e-mail address: %s."), $email));
protected function _createMimeMessage($to, $body, $charset,
$options = array())
{
- $nls_charset = NLS::getCharset();
+ $nls_charset = Horde_Nls::getCharset();
$body = Horde_String::convertCharset($body, $nls_charset, $charset);
if (!empty($options['html'])) {
return array(
'body' => $msg,
- 'encoding' => isset($msg_text) ? $msg_text['encoding'] : NLS::getCharset(),
+ 'encoding' => isset($msg_text) ? $msg_text['encoding'] : Horde_Nls::getCharset(),
'format' => $format,
'headers' => $header,
'identity' => $this->_getMatchingIdentity($h)
$headerob = $contents->getHeaderOb();
$part = new Horde_Mime_Part();
- $part->setCharset(NLS::getCharset());
+ $part->setCharset(Horde_Nls::getCharset());
$part->setType('message/rfc822');
$part->setName(_("Forwarded Message"));
$part->setContents($contents->fullMessageText(array('stream' => true)));
}
$part = new Horde_Mime_Part();
$part->setType($type);
- $part->setCharset(NLS::getCharset());
+ $part->setCharset(Horde_Nls::getCharset());
$part->setName($filename);
$part->setBytes($_FILES[$name]['size']);
$part->setDisposition('attachment');
'/%r/' => $h->getValue('date'),
/* Date as ddd, dd mmm yyyy. */
- '/%d/' => Horde_String::convertCharset(strftime("%a, %d %b %Y", $udate), NLS::getExternalCharset()),
+ '/%d/' => Horde_String::convertCharset(strftime("%a, %d %b %Y", $udate), Horde_Nls::getExternalCharset()),
/* Date in locale's default. */
- '/%x/' => Horde_String::convertCharset(strftime("%x", $udate), NLS::getExternalCharset()),
+ '/%x/' => Horde_String::convertCharset(strftime("%x", $udate), Horde_Nls::getExternalCharset()),
/* Date and time in locale's default. */
- '/%c/' => Horde_String::convertCharset(strftime("%c", $udate), NLS::getExternalCharset()),
+ '/%c/' => Horde_String::convertCharset(strftime("%c", $udate), Horde_Nls::getExternalCharset()),
/* Message-ID. */
'/%m/' => $message_id,
$fullpath = sprintf('%s/%s/%d', self::VFS_LINK_ATTACH_PATH, $auth, $ts);
$charset = $part->getCharset();
- $trailer = Horde_String::convertCharset(_("Attachments"), NLS::getCharset(), $charset);
+ $trailer = Horde_String::convertCharset(_("Attachments"), Horde_Nls::getCharset(), $charset);
if ($prefs->getValue('delete_attachments_monthly')) {
/* Determine the first day of the month in which the current
* attachments will be ripe for deletion, then subtract 1 second
* to obtain the last day of the previous month. */
$del_time = mktime(0, 0, 0, date('n') + $prefs->getValue('delete_attachments_monthly_keep') + 1, 1, date('Y')) - 1;
- $trailer .= Horde_String::convertCharset(' (' . sprintf(_("Links will expire on %s"), strftime('%x', $del_time)) . ')', NLS::getCharset(), $charset);
+ $trailer .= Horde_String::convertCharset(' (' . sprintf(_("Links will expire on %s"), strftime('%x', $del_time)) . ')', Horde_Nls::getCharset(), $charset);
}
foreach ($this->getAttachments() as $att) {
$part = $contents->getMIMEPart($body_id);
$type = $part->getType();
$part_charset = $part->getCharset();
- $charset = NLS::getCharset();
+ $charset = Horde_Nls::getCharset();
$msg = Horde_String::convertCharset($part->getContents(), $part_charset);
/* Enforce reply limits. */
}
/* Determine default encoding. */
- $encoding = NLS::getEmailCharset();
+ $encoding = Horde_Nls::getEmailCharset();
if (($charset == 'UTF-8') &&
(strcasecmp($part_charset, 'US-ASCII') !== 0) &&
(strcasecmp($part_charset, $encoding) !== 0)) {
$part = new Horde_Mime_Part();
$part->setType('text/x-vcard');
- $part->setCharset(NLS::getCharset());
+ $part->setCharset(Horde_Nls::getCharset());
$part->setContents($vcard);
$part->setName((strlen($name) ? $name : 'vcard') . '.vcf');
$this->_attachVCard = $part;
)
)
),
- 'type' => 'text/html; charset=' . NLS::getCharset()
+ 'type' => 'text/html; charset=' . Horde_Nls::getCharset()
)
);
}
* give the user a link to open the part in a new window with the
* correct character set. */
if (($mode != 'full') && ($mime_part->getPrimaryType() == 'text')) {
- $default_charset = Horde_String::upper(NLS::getCharset());
+ $default_charset = Horde_String::upper(Horde_Nls::getCharset());
if ($default_charset !== 'UTF-8') {
$charset_upper = Horde_String::upper($mime_part->getCharset());
if (($charset_upper != 'US-ASCII') &&
$ptext = $pmime->getContents();
$ptext = Horde_String::convertCharset($ptext, $pmime->getCharset());
if ($pmime->getType() == 'text/html') {
- $ptext = Horde_Text_Filter::filter($ptext, 'html2text', array('charset' => NLS::getCharset()));
+ $ptext = Horde_Text_Filter::filter($ptext, 'html2text', array('charset' => Horde_Nls::getCharset()));
}
$this->_build = $oldbuild;
if (empty($params['title'])) {
$old_error = error_reporting(0);
- $tooltip = nl2br(htmlspecialchars($tooltip, ENT_QUOTES, NLS::getCharset()));
+ $tooltip = nl2br(htmlspecialchars($tooltip, ENT_QUOTES, Horde_Nls::getCharset()));
$title = $ak = '';
} else {
$title = $params['title'];
}
if (isset($GLOBALS['language'])) {
- header('Content-type: text/html; charset=' . NLS::getCharset());
+ header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
header('Vary: Accept-Language');
}
/* Check permissions. */
if (!IMP::hasPermission('create_folders')) {
$old_error = error_reporting(0);
- $message = htmlspecialchars(_("You are not allowed to create folders."), ENT_COMPAT, NLS::getCharset());
+ $message = htmlspecialchars(_("You are not allowed to create folders."), ENT_COMPAT, Horde_Nls::getCharset());
error_reporting($old_error);
if (!empty($conf['hooks']['permsdenied'])) {
$message = Horde::callHook('_perms_hook_denied', array('imp:create_folders'), 'horde', $message);
return false;
} elseif (!IMP::hasPermission('max_folders')) {
$old_error = error_reporting(0);
- $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d folders."), IMP::hasPermission('max_folders', true)), ENT_COMPAT, NLS::getCharset());
+ $message = htmlspecialchars(sprintf(_("You are not allowed to create more than %d folders."), IMP::hasPermission('max_folders', true)), ENT_COMPAT, Horde_Nls::getCharset());
error_reporting($old_error);
if (!empty($conf['hooks']['permsdenied'])) {
$message = Horde::callHook('_perms_hook_denied', array('imp:max_folders'), 'horde', $message);
$contact_link = $registry->link('contacts/show', array('uid' => $result, 'source' => $prefs->getValue('add_source')));
$old_error = error_reporting(0);
- $escapeName = htmlspecialchars($newName, ENT_COMPAT, NLS::getCharset());
+ $escapeName = htmlspecialchars($newName, ENT_COMPAT, Horde_Nls::getCharset());
error_reporting($old_error);
return (!empty($contact_link) && !is_a($contact_link, 'PEAR_Error'))
$val = isset($filter[$mbox['val']]) ? '' : htmlspecialchars($mbox['val']);
$sel = ($mbox['val'] && !empty($options['selected']) && ($mbox['val'] === $options['selected'])) ? ' selected="selected"' : '';
$label = empty($options['abbrev']) ? $mbox['label'] : $mbox['abbrev'];
- $text .= sprintf('<option value="%s"%s>%s</option>%s', $val, $sel, Horde_Text_Filter::filter($label, 'space2html', array('charset' => NLS::getCharset(), 'encode' => true)), "\n");
+ $text .= sprintf('<option value="%s"%s>%s</option>%s', $val, $sel, Horde_Text_Filter::filter($label, 'space2html', array('charset' => Horde_Nls::getCharset(), 'encode' => true)), "\n");
}
/* Add the list of virtual folders to the list. */
$vfolder_sel = $GLOBALS['imp_search']->searchMboxID();
$text .= '<option value="" disabled="disabled">- - - - - - - - -</option>' . "\n";
foreach ($vfolders as $id => $val) {
- $text .= sprintf('<option value="%s"%s>%s</option>%s', $GLOBALS['imp_search']->createSearchID($id), ($vfolder_sel == $id) ? ' selected="selected"' : '', Horde_Text_Filter::filter($val, 'space2html', array('charset' => NLS::getCharset(), 'encode' => true)), "\n");
+ $text .= sprintf('<option value="%s"%s>%s</option>%s', $GLOBALS['imp_search']->createSearchID($id), ($vfolder_sel == $id) ? ' selected="selected"' : '', Horde_Text_Filter::filter($val, 'space2html', array('charset' => Horde_Nls::getCharset(), 'encode' => true)), "\n");
}
}
}
foreach ($tasklists as $id => $tasklist) {
$text .= sprintf('<option value="%s">%s</option>%s',
'_tasklist_' . $id,
- Horde_Text_Filter::filter($tasklist->get('name'), 'space2html', array('charset' => NLS::getCharset(), 'encode' => true)),
+ Horde_Text_Filter::filter($tasklist->get('name'), 'space2html', array('charset' => Horde_Nls::getCharset(), 'encode' => true)),
"\n");
}
}
foreach ($notepads as $id => $notepad) {
$text .= sprintf('<option value="%s">%s</option>%s',
'_notepad_' . $id,
- Horde_Text_Filter::filter($notepad->get('name'), 'space2html', array('charset' => NLS::getCharset(), 'encode' => true)),
+ Horde_Text_Filter::filter($notepad->get('name'), 'space2html', array('charset' => Horde_Nls::getCharset(), 'encode' => true)),
"\n");
}
}
if (stripos($out, $key) === 0) {
$len = strlen($key);
if ((strlen($out) == $len) || ($out[$len + 1] == $delimiter)) {
- $out = substr_replace($out, Horde_String::convertCharset($val, NLS::getCharset(), 'UTF7-IMAP'), 0, $len);
+ $out = substr_replace($out, Horde_String::convertCharset($val, Horde_Nls::getCharset(), 'UTF7-IMAP'), 0, $len);
break;
}
}
*/
static public function escapeJSON($json)
{
- return '/*-secure-' . rawurlencode(Horde_Serialize::serialize($json, Horde_Serialize::JSON, NLS::getCharset())) . '*/';
+ return '/*-secure-' . rawurlencode(Horde_Serialize::serialize($json, Horde_Serialize::JSON, Horde_Nls::getCharset())) . '*/';
}
/**
if (!isset($addrlist)) {
$addrlist = IMP_Compose::getAddressList();
}
- IMP::addInlineScript('if (!IMP) { var IMP = {}; } IMP.ac_list = '. Horde_Serialize::serialize(array_map('htmlspecialchars', $addrlist), Horde_Serialize::JSON, NLS::getCharset()));
+ IMP::addInlineScript('if (!IMP) { var IMP = {}; } IMP.ac_list = '. Horde_Serialize::serialize(array_map('htmlspecialchars', $addrlist), Horde_Serialize::JSON, Horde_Nls::getCharset()));
self::$_listOutput = true;
}
$func = 'Autocompleter.Local';
if (empty($params['states'])) {
$params['states'] = '""';
} else {
- $params['states'] = Horde_Serialize::serialize($params['states'], Horde_Serialize::JSON, NLS::getCharset());
+ $params['states'] = Horde_Serialize::serialize($params['states'], Horde_Serialize::JSON, Horde_Nls::getCharset());
}
if (empty($params['locales'])) {
$params['locales'] = array();
}
}
asort($params['locales'], SORT_LOCALE_STRING);
- $params['locales'] = Horde_Serialize::serialize($params['locales'], Horde_Serialize::JSON, NLS::getCharset());
+ $params['locales'] = Horde_Serialize::serialize($params['locales'], Horde_Serialize::JSON, Horde_Nls::getCharset());
parent::__construct($params);
}
foreach (array_keys($old_folders) as $k) {
foreach ($sent_mail_folders as $folder) {
if (preg_match('/^' . str_replace('/', '\/', $folder) . '-([^-]+)-([0-9]{4})$/i', $k, $regs)) {
- $folder_array[$k] = Horde_String::convertCharset((is_numeric($regs[1])) ? mktime(0, 0, 0,$regs[1], 1, $regs[2]) : strtotime("$regs[1] 1, $regs[2]"), NLS::getCharset(), 'UTF7-IMAP');
+ $folder_array[$k] = Horde_String::convertCharset((is_numeric($regs[1])) ? mktime(0, 0, 0,$regs[1], 1, $regs[2]) : strtotime("$regs[1] 1, $regs[2]"), Horde_Nls::getCharset(), 'UTF7-IMAP');
}
}
}
$text = (substr($GLOBALS['language'], 0, 2) == 'en') ? strtolower(strftime('-%b-%Y', $last_maintenance)) : strftime('-%m-%Y', $last_maintenance);
- return $folder . Horde_String::convertCharset($text, NLS::getExternalCharset(), 'UTF7-IMAP');
+ return $folder . Horde_String::convertCharset($text, Horde_Nls::getExternalCharset(), 'UTF7-IMAP');
}
}
/* TODO: When Horde_iCalendar supports setting of charsets
* we need to set it there instead of relying on the fact
* that both Nag and IMP use the same charset. */
- $body = Horde_String::convertCharset($body, $body_part->getCharset(), NLS::getCharset());
+ $body = Horde_String::convertCharset($body, $body_part->getCharset(), Horde_Nls::getCharset());
/* Create a new iCalendar. */
$vCal = new Horde_iCalendar();
$newPart->setDisposition('attachment');
/* We need to make sure all text is in the correct charset. */
- $newPart->setCharset(NLS::getCharset());
+ $newPart->setCharset(Horde_Nls::getCharset());
$newPart->setContents(sprintf(_("[Attachment stripped: Original attachment type: %s, name: %s]"), $oldPart->getType(), $oldPart->getName(true)));
$message->alterPart($partid, $newPart);
}
'type' => 'info'
)
),
- 'type' => 'text/html; charset=' . NLS::getCharset()
+ 'type' => 'text/html; charset=' . Horde_Nls::getCharset()
);
return $ret;
}
? array(
'data' => '',
'status' => array($status),
- 'type' => 'text/html; charset=' . NLS::getCharset()
+ 'type' => 'text/html; charset=' . Horde_Nls::getCharset()
)
: null;
}
$this->_mimepart->getMimeId() => array(
'data' => $render['html'],
'status' => $render['status'],
- 'type' => 'text/html; charset=' . NLS::getCharset()
+ 'type' => 'text/html; charset=' . Horde_Nls::getCharset()
)
);
}
protected function _IMPrender($inline)
{
$data = $this->_mimepart->getContents();
- $charset = NLS::getCharset();
+ $charset = Horde_Nls::getCharset();
$msg_charset = $this->_mimepart->getCharset();
if ($inline) {
*/
protected function _mailtoCallback($m)
{
- return 'href="' . $GLOBALS['registry']->call('mail/compose', array(Horde_String::convertCharset(html_entity_decode($m[2]), 'ISO-8859-1', NLS::getCharset()))) . '"';
+ return 'href="' . $GLOBALS['registry']->call('mail/compose', array(Horde_String::convertCharset(html_entity_decode($m[2]), 'ISO-8859-1', Horde_Nls::getCharset()))) . '"';
}
/**
$this->_mimepart->getMimeId() => array(
'data' => $this->_outputImgTag('data', $this->_mimepart->getName(true)),
'status' => array(),
- 'type' => 'text/html; charset=' . NLS::getCharset()
+ 'type' => 'text/html; charset=' . Horde_Nls::getCharset()
)
);
} else {
'text' => $status
)
),
- 'type' => 'text/html; charset=' . NLS::getCharset()
+ 'type' => 'text/html; charset=' . Horde_Nls::getCharset()
)
);
}
'text' => $status
)
),
- 'type' => 'text/html; charset=' . NLS::getCharset()
+ 'type' => 'text/html; charset=' . Horde_Nls::getCharset()
)
);
}
$this->_mimepart->getMimeId() => array(
'data' => $str,
'status' => array(),
- 'type' => 'text/html; charset=' . NLS::getCharset()
+ 'type' => 'text/html; charset=' . Horde_Nls::getCharset()
)
);
}
*/
protected function _outputImgTag($type, $alt)
{
- return '<img src="' . $this->_params['contents']->urlView($this->_mimepart, 'view_attach', array('params' => array('imp_img_view' => $type))) . '" alt="' . htmlspecialchars($alt, ENT_COMPAT, NLS::getCharset()) . '" />';
+ return '<img src="' . $this->_params['contents']->urlView($this->_mimepart, 'view_attach', array('params' => array('imp_img_view' => $type))) . '" alt="' . htmlspecialchars($alt, ENT_COMPAT, Horde_Nls::getCharset()) . '" />';
}
}
{
global $registry;
- $charset = NLS::getCharset();
+ $charset = Horde_Nls::getCharset();
$data = $this->_mimepart->getContents();
$mime_id = $this->_mimepart->getMimeId();
$ret[$mdn_id] = array(
'data' => $data,
'status' => $status,
- 'type' => 'text/html; charset=' . NLS::getCharset()
+ 'type' => 'text/html; charset=' . Horde_Nls::getCharset()
);
return $ret;
if (count($indices) != $total) {
$mime_part = new Horde_Mime_Part();
$mime_part->setType('text/plain');
- $mime_part->setCharset(NLS::getCharset());
+ $mime_part->setCharset(Horde_Nls::getCharset());
$mime_part->setContents(sprintf(_("[Cannot display message - found only %s of %s parts of this message in the current mailbox.]"), count($indices), $total));
return array($this->_mimepart->getMimeId() => $mime_part);
}
'text' => $status
)
),
- 'type' => 'text/html; charset=' . NLS::getCharset()
+ 'type' => 'text/html; charset=' . Horde_Nls::getCharset()
)
);
}
*/
protected function _outputImgTag()
{
- return '<img src="' . $this->_params['contents']->urlView($this->_mimepart, 'view_attach', array('params' => array('pdf_view_thumbnail' => 1))) . '" alt="' . htmlspecialchars(_("View PDF File"), ENT_COMPAT, NLS::getCharset()) . '" />';
+ return '<img src="' . $this->_params['contents']->urlView($this->_mimepart, 'view_attach', array('params' => array('pdf_view_thumbnail' => 1))) . '" alt="' . htmlspecialchars(_("View PDF File"), ENT_COMPAT, Horde_Nls::getCharset()) . '" />';
}
}
'text' => $resymmetric ? self::$_inlinecache[$base_id][$base_id]['status'][0]['text'] : array()
)
),
- 'type' => 'text/html; charset=' . NLS::getCharset()
+ 'type' => 'text/html; charset=' . Horde_Nls::getCharset()
),
$version_id => null,
$data_id => null
$mime_id => array(
'data' => $data,
'status' => array($status),
- 'type' => 'text/html; charset=' . NLS::getCharset()
+ 'type' => 'text/html; charset=' . Horde_Nls::getCharset()
)
);
}
'text' => array()
)
),
- 'type' => 'text/html; charset=' . NLS::getCharset()
+ 'type' => 'text/html; charset=' . Horde_Nls::getCharset()
),
$sig_id => null
);
global $conf, $prefs;
$mime_id = $this->_mimepart->getMimeId();
- $type = 'text/html; charset=' . NLS::getCharset();
+ $type = 'text/html; charset=' . Horde_Nls::getCharset();
// Trim extra whitespace in the text.
$text = trim($this->_mimepart->getContents());
$filters = array(
'text2html' => array(
'parselevel' => Horde_Text_Filter_Text2html::MICRO,
- 'charset' => NLS::getCharset()
+ 'charset' => Horde_Nls::getCharset()
),
'tabs2spaces' => array(),
);
$text_part = new Horde_Mime_Part();
$text_part->setType('text/plain');
- $text_part->setCharset(NLS::getCharset());
+ $text_part->setCharset(Horde_Nls::getCharset());
$text_part->setContents(preg_replace("/begin [0-7]{3} .+\r?\n.+\r?\nend/Us", "\n", $text));
$new_part->addPart($text_part);
'text' => array(_("This message has been encrypted via S/MIME."))
)
),
- 'type' => 'text/html; charset=' . NLS::getCharset()
+ 'type' => 'text/html; charset=' . Horde_Nls::getCharset()
)
);
$status = &self::$_inlinecache[$base_id][$base_id]['status'][0]['text'];
$this->_mimepart->getMimeId() => array(
'data' => $this->_impsmime->certToHTML($sig_result->cert),
'status' => array(),
- 'type' => 'text/html; charset=' . NLS::getCharset()
+ 'type' => 'text/html; charset=' . Horde_Nls::getCharset()
)
);
}
'text' => array(_("This message has been digitally signed via S/MIME."))
)
),
- 'type' => 'text/html; charset=' . NLS::getCharset()
+ 'type' => 'text/html; charset=' . Horde_Nls::getCharset()
),
$sig_id => null
);
if (!empty($subject) &&
$GLOBALS['registry']->hasMethod('contacts/addField') &&
$GLOBALS['prefs']->getValue('add_source')) {
- $status[] = sprintf(_("The S/MIME certificate of %s: "), @htmlspecialchars($subject, ENT_COMPAT, NLS::getCharset())) . $this->_params['contents']->linkViewJS($this->_mimepart, 'view_attach', _("View"), array('params' => array('mode' => IMP_Contents::RENDER_INLINE, 'view_smime_key' => 1))) . '/' . Horde::link('#', '', null, null, $this->_impsmime->savePublicKeyURL($sig_result->cert, $this->_params['contents']->getIndex(), $sig_id) . ' return false;') . _("Save in your Address Book") . '</a>';
+ $status[] = sprintf(_("The S/MIME certificate of %s: "), @htmlspecialchars($subject, ENT_COMPAT, Horde_Nls::getCharset())) . $this->_params['contents']->linkViewJS($this->_mimepart, 'view_attach', _("View"), array('params' => array('mode' => IMP_Contents::RENDER_INLINE, 'view_smime_key' => 1))) . '/' . Horde::link('#', '', null, null, $this->_impsmime->savePublicKeyURL($sig_result->cert, $this->_params['contents']->getIndex(), $sig_id) . ' return false;') . _("Save in your Address Book") . '</a>';
}
}
$ret[$this->_mimepart->getMimeId()] = array(
'data' => $data,
'status' => $status,
- 'type' => 'text/html; charset=' . NLS::getCharset()
+ 'type' => 'text/html; charset=' . Horde_Nls::getCharset()
);
return $ret;
$this->_mimepart->getMimeId() => array(
'data' => $text,
'status' => array($status),
- 'type' => 'text/html; charset=' . NLS::getCharset()
+ 'type' => 'text/html; charset=' . Horde_Nls::getCharset()
)
);
}
/* Send the message. */
try {
- $imp_compose->sendMessage($to, $spam_headers, $mime, NLS::getCharset());
+ $imp_compose->sendMessage($to, $spam_headers, $mime, Horde_Nls::getCharset());
$report_flag = true;
} catch (IMP_Compose_Exception $e) {
Horde::logMessage($e, __FILE__, __LINE__, PEAR_LOG_ERR);
}
if (!isset($this->_cache['localeinfo'])) {
- $this->_cache['localeinfo'] = NLS::getLocaleInfo();
+ $this->_cache['localeinfo'] = Horde_Nls::getLocaleInfo();
}
$size = $size / 1024;
$new_subject = $subject = IMP::filterText(preg_replace("/\s+/", ' ', $subject));
if ($htmlspaces) {
- $new_subject = Horde_Text_Filter::filter($subject, 'space2html', array('charset' => NLS::getCharset(), 'encode' => true));
+ $new_subject = Horde_Text_Filter::filter($subject, 'space2html', array('charset' => Horde_Nls::getCharset(), 'encode' => true));
if (empty($new_subject)) {
$new_subject = htmlspecialchars($subject);
}
$label = IMP::getLabel($mbox);
/* Set the current time zone. */
- NLS::setTimeZone();
+ Horde_Nls::setTimeZone();
/* Run filters now. */
if (!empty($_SESSION['imp']['filteravail']) &&
/* Get mailbox information. */
$overview = $imp_mailbox->getMailboxArray($msglist, array('headers' => array('list-post', 'x-priority'), 'structure' => $GLOBALS['prefs']->getValue('atc_flag')));
- $charset = NLS::getCharset();
+ $charset = Horde_Nls::getCharset();
$imp_ui = new IMP_UI_Mailbox($folder);
/* Display message information. */
);
/* Set the current time zone. */
- NLS::setTimeZone();
+ Horde_Nls::setTimeZone();
/* Get envelope/header information. We don't use flags in this
* view. */
switch ($task) {
case 'add':
- return $imap->addMailbox(Horde_String::convertCharset($params[0], NLS::getCharset(), 'utf7-imap'));
+ return $imap->addMailbox(Horde_String::convertCharset($params[0], Horde_Nls::getCharset(), 'utf7-imap'));
case 'remove':
- return $imap->removeMailbox(Horde_String::convertCharset($params[0], NLS::getCharset(), 'utf7-imap'));
+ return $imap->removeMailbox(Horde_String::convertCharset($params[0], Horde_Nls::getCharset(), 'utf7-imap'));
case 'list':
return $imap->listMailboxes();
if ($conf['user']['allow_folders'] &&
!$prefs->isLocked('sent_mail_folder')) {
$sent_mail_folder = Horde_Util::getFormData('sent_mail_folder');
- $sent_mail_new = Horde_String::convertCharset(Horde_Util::getFormData('sent_mail_new'), NLS::getCharset(), 'UTF7-IMAP');
+ $sent_mail_new = Horde_String::convertCharset(Horde_Util::getFormData('sent_mail_new'), Horde_Nls::getCharset(), 'UTF7-IMAP');
$sent_mail_default = $prefs->getValue('sent_mail_folder');
if (empty($sent_mail_folder) && !empty($sent_mail_new)) {
$sent_mail_folder = IMP::appendNamespace($sent_mail_new);
if ($conf['user']['allow_folders']) {
$folder = Horde_Util::getFormData($folder);
if (isset($folder) && !$prefs->isLocked($pref)) {
- $new = Horde_String::convertCharset(Horde_Util::getFormData($new), NLS::getCharset(), 'UTF7-IMAP');
+ $new = Horde_String::convertCharset(Horde_Util::getFormData($new), Horde_Nls::getCharset(), 'UTF7-IMAP');
if ($folder == IMP_PREF_NO_FOLDER) {
$prefs->setValue($pref, '');
} else {
Horde::addScriptFile('flagmanagement.js', 'imp', true);
IMP::addInlineScript(array(
- 'ImpFlagmanagement.new_prompt = ' . Horde_Serialize::serialize(_("Please enter the label for the new flag:"), Horde_Serialize::JSON, NLS::getCharset())
+ 'ImpFlagmanagement.new_prompt = ' . Horde_Serialize::serialize(_("Please enter the label for the new flag:"), Horde_Serialize::JSON, Horde_Nls::getCharset())
));
break;
}
Horde::logMessage($_SERVER['REMOTE_ADDR'] . ' ' . Horde_Auth::getLogoutReasonString(), __FILE__, __LINE__, PEAR_LOG_NOTICE);
}
- $language = (isset($prefs)) ? $prefs->getValue('language') : NLS::select();
+ $language = (isset($prefs)) ? $prefs->getValue('language') : Horde_Nls::select();
unset($_SESSION['imp']);
@session_start();
}
- NLS::setLang($language);
+ Horde_Nls::setLang($language);
/* Hook to preselect the correct language in the widget. */
$_GET['new_lang'] = $language;
$lang_url = null;
$choose_language = ($imp_auth && !$prefs->isLocked('language'));
if ($choose_language) {
- $_SESSION['horde_language'] = NLS::select();
+ $_SESSION['horde_language'] = Horde_Nls::select();
$langs = array();
foreach ($nls['languages'] as $key => $val) {
$langs[] = array(
Horde::addScriptFile('login.js', 'imp', true);
require IMP_TEMPLATES . '/common-header.inc';
-$charset = NLS::getCharset();
+$charset = Horde_Nls::getCharset();
$login_params = $autologin
? array('autologin' => $autologin, 'server_key' => '')
: array('server_key' => '');
$readonly = $imp_imap->isReadOnly($imp_mbox['mailbox']);
/* Set the current time zone. */
-NLS::setTimeZone();
+Horde_Nls::setTimeZone();
/* Run through the action handlers */
$actionID = Horde_Util::getFormData('a');
}
/* Set the current time zone. */
-NLS::setTimeZone();
+Horde_Nls::setTimeZone();
$do_filter = false;
$open_compose_window = null;
}
/* Format the From: Header. */
- $getfrom = $imp_ui->getFrom($ob['envelope'], array('fullfrom' => true, 'specialchars' => NLS::getCharset()));
+ $getfrom = $imp_ui->getFrom($ob['envelope'], array('fullfrom' => true, 'specialchars' => Horde_Nls::getCharset()));
$msg['from'] = $getfrom['from'];
$msg['fullfrom'] = $getfrom['fullfrom'];
switch ($fromlinkstyle) {
$readonly = $imp_imap->isReadOnly($imp_mbox['mailbox']);
/* Set the current time zone. */
-NLS::setTimeZone();
+Horde_Nls::setTimeZone();
/* Run through action handlers */
$actionID = Horde_Util::getFormData('a');
$imp_message = IMP_Message::singleton();
/* Set the current time zone. */
-NLS::setTimeZone();
+Horde_Nls::setTimeZone();
/* Initialize the user's identities. */
require_once 'Horde/Identity.php';
$origin_host = array($origin_host);
}
foreach ($origin_host as $host) {
- $from_img .= NLS::generateFlagImageByHost($host) . ' ';
+ $from_img .= Horde_Nls::generateFlagImageByHost($host) . ' ';
}
trim($from_img);
}
if (empty($from_img) && !empty($envelope['from'])) {
$from_ob = reset($envelope['from']);
- $from_img = NLS::generateFlagImageByHost($from_ob['host']);
+ $from_img = Horde_Nls::generateFlagImageByHost($from_ob['host']);
}
if (!empty($from_img)) {
function _textWindowOutput($filename, $msg)
{
- $GLOBALS['browser']->downloadHeaders($filename, 'text/plain; charset=' . NLS::getCharset(), true, strlen($msg));
+ $GLOBALS['browser']->downloadHeaders($filename, 'text/plain; charset=' . Horde_Nls::getCharset(), true, strlen($msg));
echo $msg;
}
: sprintf(_("%u of %u messages in %s unread."), $unseen_num, $total_num, IMP::getLabel($mailbox));
$t = new IMP_Template();
-$t->set('charset', NLS::getCharset());
+$t->set('charset', Horde_Nls::getCharset());
$t->set('xsl', $registry->get('themesuri') . '/feed-rss.xsl');
$t->set('pubDate', htmlspecialchars(date('r')));
$t->set('desc', htmlspecialchars($description));
$imp_search_fields = $imp_search->searchFields();
-$charset = NLS::getCharset();
+$charset = Horde_Nls::getCharset();
/* Get URL parameter data. */
$search = array();
function _textWindowOutput($filename, $msg, $html = false)
{
- $type = ($html ? 'text/html' : 'text/plain') . '; charset=' . NLS::getCharset();
+ $type = ($html ? 'text/html' : 'text/plain') . '; charset=' . Horde_Nls::getCharset();
$GLOBALS['browser']->downloadHeaders($filename, $type, true, strlen($msg));
echo $msg;
}
}
if ($updated) {
- $prefs->setValue('stationery', serialize(Horde_String::convertCharset($stationery_list, NLS::getCharset(), $prefs->getCharset())), false);
+ $prefs->setValue('stationery', serialize(Horde_String::convertCharset($stationery_list, Horde_Nls::getCharset(), $prefs->getCharset())), false);
$notification->push($updated, 'horde.success');
}
$t->set('content_label', Horde::label('content', _("Stationery:")));
$t->set('content', $stationery['c']);
$t->set('button_href', Horde_Util::addParameter($compose_url, 'group', 'compose'));
-$t->set('button_val', htmlspecialchars(_("Return to Message Composition"), ENT_COMPAT, NLS::getCharset()));
+$t->set('button_val', htmlspecialchars(_("Return to Message Composition"), ENT_COMPAT, Horde_Nls::getCharset()));
echo $t->fetch(IMP_TEMPLATES . '/stationery/stationery.html');
if (!$chunk) {
<?php
if (isset($GLOBALS['language'])) {
- header('Content-type: text/html; charset=' . NLS::getCharset());
+ header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
header('Vary: Accept-Language');
}
?>
)
);
-echo IMP::wrapInlineScript(array('var IMP = ' . Horde_Serialize::serialize($code, Horde_Serialize::JSON, NLS::getCharset()) . ';'));
+echo IMP::wrapInlineScript(array('var IMP = ' . Horde_Serialize::serialize($code, Horde_Serialize::JSON, Horde_Nls::getCharset()) . ';'));
);
}
-echo IMP::wrapInlineScript(array('var DIMP = ' . Horde_Serialize::serialize($code, Horde_Serialize::JSON, NLS::getCharset())));
+echo IMP::wrapInlineScript(array('var DIMP = ' . Horde_Serialize::serialize($code, Horde_Serialize::JSON, Horde_Nls::getCharset())));
}
/* Set the current time zone. */
-NLS::setTimeZone();
+Horde_Nls::setTimeZone();
/* Run through action handlers. */
$actionID = Horde_Util::getFormData('actionID');
$loop_array = IMP::parseIndicesList($msglist);
}
-$charset = NLS::getCharset();
+$charset = Horde_Nls::getCharset();
$imp_ui = new IMP_UI_Message();
foreach ($loop_array as $mbox => $idxlist) {
function _sanitizeName($name)
{
- $name = Horde_String::convertCharset($name, NLS::getCharset(), 'UTF-8');
+ $name = Horde_String::convertCharset($name, Horde_Nls::getCharset(), 'UTF-8');
return Horde_String::convertCharset(trim(preg_replace('/[^\pL\pN-+_. ]/u', '_', $name), ' _'), 'UTF-8');
}
case 'rule_copy':
if (!Ingo::hasPermission('allow_rules')) {
- $message = @htmlspecialchars(_("You are not allowed to create or edit custom rules."), ENT_COMPAT, NLS::getCharset());
+ $message = @htmlspecialchars(_("You are not allowed to create or edit custom rules."), ENT_COMPAT, Horde_Nls::getCharset());
if (!empty($conf['hooks']['permsdenied'])) {
$message = Horde::callHook('_perms_hook_denied', array('ingo:allow_rules'), 'horde', $message);
}
break 2;
} elseif (Ingo::hasPermission('max_rules') !== true &&
Ingo::hasPermission('max_rules') <= count($filters->getFilterList())) {
- $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d rules."), Ingo::hasPermission('max_rules')), ENT_COMPAT, NLS::getCharset());
+ $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d rules."), Ingo::hasPermission('max_rules')), ENT_COMPAT, Horde_Nls::getCharset());
if (!empty($conf['hooks']['permsdenied'])) {
$message = Horde::callHook('_perms_hook_denied', array('ingo:max_rules'), 'horde', $message);
}
/* Create description. */
if (!$edit_allowed) {
- $entry['descriplink'] = @htmlspecialchars($name, ENT_COMPAT, NLS::getCharset());
+ $entry['descriplink'] = @htmlspecialchars($name, ENT_COMPAT, Horde_Nls::getCharset());
} elseif (!empty($filter['conditions'])) {
$descrip = '';
$condition_size = count($filter['conditions']) - 1;
$descrip .= "\n[stop]";
}
- $entry['descriplink'] = Horde::linkTooltip($editurl, sprintf(_("Edit %s"), $name), null, null, null, $descrip) . @htmlspecialchars($name, ENT_COMPAT, NLS::getCharset()) . '</a>';
+ $entry['descriplink'] = Horde::linkTooltip($editurl, sprintf(_("Edit %s"), $name), null, null, null, $descrip) . @htmlspecialchars($name, ENT_COMPAT, Horde_Nls::getCharset()) . '</a>';
} else {
- $entry['descriplink'] = Horde::link($editurl, sprintf(_("Edit %s"), $name)) . @htmlspecialchars($name, ENT_COMPAT, NLS::getCharset()) . '</a>';
+ $entry['descriplink'] = Horde::link($editurl, sprintf(_("Edit %s"), $name)) . @htmlspecialchars($name, ENT_COMPAT, Horde_Nls::getCharset()) . '</a>';
}
/* Create edit link. */
$label = $mbox['abbrev'];
$text .= sprintf('<option%s value="%s"%s>%s</option>%s',
$disabled, $val, $sel,
- Horde_Text_Filter::filter($label, 'space2html', array('charset' => NLS::getCharset(), 'encode' => true)), "\n");
+ Horde_Text_Filter::filter($label, 'space2html', array('charset' => Horde_Nls::getCharset(), 'encode' => true)), "\n");
}
$text .= '</select>';
static public function createFolder($folder)
{
return $GLOBALS['registry']->hasMethod('mail/createFolder')
- ? $GLOBALS['registry']->call('mail/createFolder', array('folder' => Horde_String::convertCharset($folder, NLS::getCharset(), 'UTF7-IMAP')))
+ ? $GLOBALS['registry']->call('mail/createFolder', array('folder' => Horde_String::convertCharset($folder, Horde_Nls::getCharset(), 'UTF7-IMAP')))
: false;
}
foreach ($overview as $msg) {
$GLOBALS['notification']->push(
sprintf(_("Filter activity: The message \"%s\" from \"%s\" has been moved to the folder \"%s\"."),
- !empty($msg['envelope']['subject']) ? Horde_Mime::decode($msg['envelope']['subject'], NLS::getCharset()) : _("[No Subject]"),
- !empty($msg['envelope']['from']) ? Horde_Mime::decode(Horde_Mime_Address::addrArray2String($msg['envelope']['from']), NLS::getCharset()) : _("[No Sender]"),
- Horde_String::convertCharset($rule['action-value'], 'UTF7-IMAP', NLS::getCharset())),
+ !empty($msg['envelope']['subject']) ? Horde_Mime::decode($msg['envelope']['subject'], Horde_Nls::getCharset()) : _("[No Subject]"),
+ !empty($msg['envelope']['from']) ? Horde_Mime::decode(Horde_Mime_Address::addrArray2String($msg['envelope']['from']), Horde_Nls::getCharset()) : _("[No Sender]"),
+ Horde_String::convertCharset($rule['action-value'], 'UTF7-IMAP', Horde_Nls::getCharset())),
'horde.message');
}
} else {
$GLOBALS['notification']->push(sprintf(_("Filter activity: %s message(s) have been moved to the folder \"%s\"."),
count($indices),
- Horde_String::convertCharset($rule['action-value'], 'UTF7-IMAP', NLS::getCharset())), 'horde.message');
+ Horde_String::convertCharset($rule['action-value'], 'UTF7-IMAP', Horde_Nls::getCharset())), 'horde.message');
}
} elseif ($rule['action'] == Ingo_Storage::ACTION_DISCARD) {
/* We need to grab the overview first. */
foreach ($overview as $msg) {
$GLOBALS['notification']->push(
sprintf(_("Filter activity: The message \"%s\" from \"%s\" has been deleted."),
- !empty($msg['envelope']['subject']) ? Horde_Mime::decode($msg['envelope']['subject'], NLS::getCharset()) : _("[No Subject]"),
- !empty($msg['envelope']['from']) ? Horde_Mime::decode($msg['envelope']['from'], NLS::getCharset()) : _("[No Sender]")),
+ !empty($msg['envelope']['subject']) ? Horde_Mime::decode($msg['envelope']['subject'], Horde_Nls::getCharset()) : _("[No Subject]"),
+ !empty($msg['envelope']['from']) ? Horde_Mime::decode($msg['envelope']['from'], Horde_Nls::getCharset()) : _("[No Sender]")),
'horde.message');
}
} else {
foreach ($overview as $msg) {
$GLOBALS['notification']->push(
sprintf(_("Filter activity: The message \"%s\" from \"%s\" has been copied to the folder \"%s\"."),
- !empty($msg['envelope']['subject']) ? Horde_Mime::decode($msg['envelope']['subject'], NLS::getCharset()) : _("[No Subject]"),
- !empty($msg['envelope']['from']) ? Horde_Mime::decode($msg['envelope']['from'], NLS::getCharset()) : _("[No Sender]"),
- Horde_String::convertCharset($rule['action-value'], 'UTF7-IMAP', NLS::getCharset())),
+ !empty($msg['envelope']['subject']) ? Horde_Mime::decode($msg['envelope']['subject'], Horde_Nls::getCharset()) : _("[No Subject]"),
+ !empty($msg['envelope']['from']) ? Horde_Mime::decode($msg['envelope']['from'], Horde_Nls::getCharset()) : _("[No Sender]"),
+ Horde_String::convertCharset($rule['action-value'], 'UTF7-IMAP', Horde_Nls::getCharset())),
'horde.message');
}
} else {
- $GLOBALS['notification']->push(sprintf(_("Filter activity: %s message(s) have been copied to the folder \"%s\"."), count($indices), Horde_String::convertCharset($rule['action-value'], 'UTF7-IMAP', NLS::getCharset())), 'horde.message');
+ $GLOBALS['notification']->push(sprintf(_("Filter activity: %s message(s) have been copied to the folder \"%s\"."), count($indices), Horde_String::convertCharset($rule['action-value'], 'UTF7-IMAP', Horde_Nls::getCharset())), 'horde.message');
}
}
}
}
// Writing vacation.msg file
- $reason = Horde_Mime::encode($params['action-value']['reason'], NLS::getCharset());
+ $reason = Horde_Mime::encode($params['action-value']['reason'], Horde_Nls::getCharset());
$driver = Ingo::getDriver();
$driver->_connect();
$result = $driver->_vfs->writeData($driver->_params['vfs_path'], 'vacation.msg', $reason, true);
$this->_action[] = ' ($current_time <= ' . $end . ')) ';
$this->_action[] = ' {';
}
- $this->_action[] = " cc \"| mailbot -D " . $params['action-value']['days'] . " -c '" . NLS::getCharset() . "' -t \$HOME/vacation.msg -d \$HOME/vacation -A 'From: $from' -s '" . Horde_Mime::encode($params['action-value']['subject'], NLS::getCharset()) . "' /usr/sbin/sendmail -t \"";
+ $this->_action[] = " cc \"| mailbot -D " . $params['action-value']['days'] . " -c '" . Horde_Nls::getCharset() . "' -t \$HOME/vacation.msg -d \$HOME/vacation -A 'From: $from' -s '" . Horde_Mime::encode($params['action-value']['subject'], Horde_Nls::getCharset()) . "' /usr/sbin/sendmail -t \"";
if (($start != 0) && ($end !== 0)) {
$this->_action[] = ' }';
$this->_action[] = ' }';
$this->_action[] = ' -a"From: <' . $address . '>" \\';
$this->_action[] = ' -A"X-Loop: ' . $address . '" \\';
if (Horde_Mime::is8bit($params['action-value']['reason'])) {
- $this->_action[] = ' -i"Subject: ' . Horde_Mime::encode($params['action-value']['subject'] . ' (Re: $SUBJECT)', NLS::getCharset()) . '" \\';
+ $this->_action[] = ' -i"Subject: ' . Horde_Mime::encode($params['action-value']['subject'] . ' (Re: $SUBJECT)', Horde_Nls::getCharset()) . '" \\';
$this->_action[] = ' -i"Content-Transfer-Encoding: quoted-printable" \\';
- $this->_action[] = ' -i"Content-Type: text/plain; charset=' . NLS::getCharset() . '" ; \\';
+ $this->_action[] = ' -i"Content-Type: text/plain; charset=' . Horde_Nls::getCharset() . '" ; \\';
$reason = Horde_Mime::quotedPrintableEncode($params['action-value']['reason'], "\n");
} else {
- $this->_action[] = ' -i"Subject: ' . Horde_Mime::encode($params['action-value']['subject'] . ' (Re: $SUBJECT)', NLS::getCharset()) . '" ; \\';
+ $this->_action[] = ' -i"Subject: ' . Horde_Mime::encode($params['action-value']['subject'] . ' (Re: $SUBJECT)', Horde_Nls::getCharset()) . '" ; \\';
$reason = $params['action-value']['reason'];
}
$reason = addcslashes($reason, "\\\n\r\t\"`");
. _("Generated by Ingo (http://www.horde.org/ingo/)") . ' ('
. trim(strftime($date_format . ', ' . $time_format))
. ")\n\n";
- $code = Horde_String::convertCharset($code, NLS::getCharset(), 'UTF-8');
+ $code = Horde_String::convertCharset($code, Horde_Nls::getCharset(), 'UTF-8');
$requires = $this->requires();
if (count($requires) > 1) {
}
$vals = array(
- 'subject' => Horde_String::convertCharset($vacation->getVacationSubject(), NLS::getCharset(), 'UTF-8'),
+ 'subject' => Horde_String::convertCharset($vacation->getVacationSubject(), Horde_Nls::getCharset(), 'UTF-8'),
'days' => $vacation->getVacationDays(),
'addresses' => $vacation_addr,
'start' => $vacation->getVacationStart(),
'end_year' => $vacation->getVacationEndYear(),
'end_month' => $vacation->getVacationEndMonth(),
'end_day' => $vacation->getVacationEndDay(),
- 'reason' => Horde_String::convertCharset($vacation->getVacationReason(), NLS::getCharset(), 'UTF-8'),
+ 'reason' => Horde_String::convertCharset($vacation->getVacationReason(), Horde_Nls::getCharset(), 'UTF-8'),
);
$action = $tests = array();
$code .= (empty($code) ? '' : "\n") . '# ' . $line;
}
}
- return Horde_String::convertCharset($code, NLS::getCharset(), 'UTF-8');
+ return Horde_String::convertCharset($code, Horde_Nls::getCharset(), 'UTF-8');
}
/**
/* Convert rules from the old format. */
$data = @unserialize($prefs->getValue('rules'));
} else {
- $data = Horde_String::convertCharset($data, $prefs->getCharset(), NLS::getCharset());
+ $data = Horde_String::convertCharset($data, $prefs->getCharset(), Horde_Nls::getCharset());
}
if ($data) {
$ob->setFilterlist($data);
/* Convert vacation from the old format. */
$data = unserialize($prefs->getValue('vacation'));
} elseif (is_array($data)) {
- $data = $prefs->convertFromDriver($data, NLS::getCharset());
+ $data = $prefs->convertFromDriver($data, Horde_Nls::getCharset());
}
if ($data) {
$ob->setVacationAddresses($data['addresses'], false);
return $prefs->setValue('blacklist', serialize($data));
case self::ACTION_FILTERS:
- return $prefs->setValue('rules', serialize(Horde_String::convertCharset($ob->getFilterList(), NLS::getCharset(), $prefs->getCharset())), false);
+ return $prefs->setValue('rules', serialize(Horde_String::convertCharset($ob->getFilterList(), Horde_Nls::getCharset(), $prefs->getCharset())), false);
case self::ACTION_FORWARD:
$data = array(
'start' => $ob->getVacationStart(),
'end' => $ob->getVacationEnd(),
);
- return $prefs->setValue('vacation', serialize($prefs->convertToDriver($data, NLS::getCharset())), false);
+ return $prefs->setValue('vacation', serialize($prefs->convertToDriver($data, Horde_Nls::getCharset())), false);
case self::ACTION_WHITELIST:
return $prefs->setValue('whitelist', serialize($ob->getWhitelist()));
$values = array(
implode("\n", $ob->getVacationAddresses()),
Horde_String::convertCharset($ob->getVacationSubject(),
- NLS::getCharset(),
+ Horde_Nls::getCharset(),
$this->_params['charset']),
Horde_String::convertCharset($ob->getVacationReason(),
- NLS::getCharset(),
+ Horde_Nls::getCharset(),
$this->_params['charset']),
(int)$ob->getVacationDays(),
(int)$ob->getVacationStart(),
*/
protected function _ruleToBackend($rule)
{
- return array(Horde_String::convertCharset($rule['name'], NLS::getCharset(), $this->_params['charset']),
+ return array(Horde_String::convertCharset($rule['name'], Horde_Nls::getCharset(), $this->_params['charset']),
(int)$rule['action'],
- isset($rule['action-value']) ? Horde_String::convertCharset($rule['action-value'], NLS::getCharset(), $this->_params['charset']) : null,
+ isset($rule['action-value']) ? Horde_String::convertCharset($rule['action-value'], Horde_Nls::getCharset(), $this->_params['charset']) : null,
isset($rule['flags']) ? (int)$rule['flags'] : null,
- isset($rule['conditions']) ? serialize(Horde_String::convertCharset($rule['conditions'], NLS::getCharset(), $this->_params['charset'])) : null,
+ isset($rule['conditions']) ? serialize(Horde_String::convertCharset($rule['conditions'], Horde_Nls::getCharset(), $this->_params['charset'])) : null,
isset($rule['combine']) ? (int)$rule['combine'] : null,
isset($rule['stop']) ? (int)$rule['stop'] : null,
isset($rule['disable']) ? (int)(!$rule['disable']) : 1);
/* Check rule permissions. */
if (!Ingo::hasPermission('allow_rules')) {
- $message = @htmlspecialchars(_("You are not allowed to create or edit custom rules."), ENT_COMPAT, NLS::getCharset());
+ $message = @htmlspecialchars(_("You are not allowed to create or edit custom rules."), ENT_COMPAT, Horde_Nls::getCharset());
if (!empty($conf['hooks']['permsdenied'])) {
$message = Horde::callHook('_perms_hook_denied', array('ingo:allow_rules'), 'horde', $message);
}
if (is_null($edit_number)) {
if (Ingo::hasPermission('max_rules') !== true &&
Ingo::hasPermission('max_rules') <= count($filters->getFilterList())) {
- $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d rules."), Ingo::hasPermission('max_rules')), ENT_COMPAT, NLS::getCharset());
+ $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d rules."), Ingo::hasPermission('max_rules')), ENT_COMPAT, Horde_Nls::getCharset());
if (!empty($conf['hooks']['permsdenied'])) {
$message = Horde::callHook('_perms_hook_denied', array('ingo:max_rules'), 'horde', $message);
}
<?php
if (isset($language)) {
- header('Content-type: text/html; charset=' . NLS::getCharset());
+ header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
header('Vary: Accept-Language');
}
$page_title = $GLOBALS['registry']->get('name');
<table width="100%" cellspacing="0">
<tr class="control">
<td>
- <?php echo Horde::label('name', _("Rule Name:")) ?> <input class="input" id="name" name="name" size="50" value="<?php echo (isset($rule['name'])) ? @htmlspecialchars($rule['name'], ENT_COMPAT, NLS::getCharset()) : '' ?>" />
+ <?php echo Horde::label('name', _("Rule Name:")) ?> <input class="input" id="name" name="name" size="50" value="<?php echo (isset($rule['name'])) ? @htmlspecialchars($rule['name'], ENT_COMPAT, Horde_Nls::getCharset()) : '' ?>" />
</td>
<td width="40" class="rightAlign">
<?php echo Horde_Help::link('ingo', 'rule-name') ?>
<?php
if (isset($language)) {
- header('Content-type: text/html; charset=' . NLS::getCharset());
+ header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
header('Vary: Accept-Language');
}
?>
<?php
if (isset($language)) {
- header('Content-type: text/html; charset=' . NLS::getCharset());
+ header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
header('Vary: Accept-Language');
}
?>
global $registry, $notification, $browser;
/* Horde core classes that aren't autoloaded. */
- include_once 'Horde/NLS.php';
include_once 'Horde/Perms.php';
$registry = Horde_Registry::singleton();
<?php
if (isset($language)) {
- header('Content-type: text/html; charset=' . NLS::getCharset());
+ header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
header('Vary: Accept-Language');
}
?>
);
if (Kronolith::hasPermission('max_events') !== true &&
Kronolith::hasPermission('max_events') <= Kronolith::countEvents()) {
- $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), Kronolith::hasPermission('max_events')), ENT_COMPAT, NLS::getCharset());
+ $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), Kronolith::hasPermission('max_events')), ENT_COMPAT, Horde_Nls::getCharset());
if (!empty($conf['hooks']['permsdenied'])) {
$message = Horde::callHook('_perms_hook_denied', array('kronolith:max_events'), 'horde', $message);
}
}
}
- $iCal->setAttribute('X-WR-CALNAME', Horde_String::convertCharset(implode(', ', $calNames), NLS::getCharset(), 'utf-8'));
+ $iCal->setAttribute('X-WR-CALNAME', Horde_String::convertCharset(implode(', ', $calNames), Horde_Nls::getCharset(), 'utf-8'));
$data = $iCal->exportvCalendar();
$browser->downloadHeaders(_("events.ics"), 'text/calendar', false, strlen($data));
echo $data;
foreach ($next_step as $row) {
if ($max_events !== true && $num_events >= $max_events) {
- $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), Kronolith::hasPermission('max_events')), ENT_COMPAT, NLS::getCharset());
+ $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), Kronolith::hasPermission('max_events')), ENT_COMPAT, Horde_Nls::getCharset());
if (!empty($conf['hooks']['permsdenied'])) {
$message = Horde::callHook('_perms_hook_denied', array('kronolith:max_events'), 'horde', $message);
}
{
if (Kronolith::hasPermission('max_events') !== true &&
Kronolith::hasPermission('max_events') <= Kronolith::countEvents()) {
- $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), Kronolith::hasPermission('max_events')), ENT_COMPAT, NLS::getCharset());
+ $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), Kronolith::hasPermission('max_events')), ENT_COMPAT, Horde_Nls::getCharset());
if (!empty($GLOBALS['conf']['hooks']['permsdenied'])) {
$message = Horde::callHook('_perms_hook_denied', array('kronolith:max_events'), 'horde', $message);
}
require_once dirname(__FILE__) . '/lib/base.php';
// We want to always generate UTF-8 iCalendar data.
-NLS::setCharset('UTF-8');
+Horde_Nls::setCharset('UTF-8');
// Determine the username to show free/busy time for.
$cal = Horde_Util::getFormData('c');
if ($user) {
$prefs = &Prefs::singleton($conf['prefs']['driver'], 'kronolith', $user, '', null, false);
$prefs->retrieve();
- NLS::setTimeZone();
+ Horde_Nls::setTimeZone();
$cal = @unserialize($prefs->getValue('fb_cals'));
if (is_array($cal)) {
$cal = implode('|', $cal);
}
$browser->downloadHeaders(($user ? $user : $cal) . '.vfb',
- 'text/calendar; charset=' . NLS::getCharset(),
+ 'text/calendar; charset=' . Horde_Nls::getCharset(),
true,
strlen($fb));
echo $fb;
$now = new Horde_Date(time());
$template = new Horde_Template();
-$template->set('charset', NLS::getCharset());
+$template->set('charset', Horde_Nls::getCharset());
$template->set('updated', $now->format(DATE_ATOM));
$template->set('kronolith_name', 'Kronolith');
$template->set('kronolith_version', KRONOLITH_VERSION);
$template->set('kronolith_uri', 'http://www.horde.org/kronolith/');
$template->set('kronolith_icon', Horde::url($registry->getImageDir() . '/kronolith.png', true, -1));
$template->set('xsl', $registry->get('themesuri') . '/feed-rss.xsl');
-$template->set('calendar_name', @htmlspecialchars($share->get('name'), ENT_COMPAT, NLS::getCharset()));
-$template->set('calendar_desc', @htmlspecialchars($share->get('desc'), ENT_COMPAT, NLS::getCharset()), true);
-$template->set('calendar_owner', @htmlspecialchars($identity->getValue('fullname'), ENT_COMPAT, NLS::getCharset()));
-$template->set('calendar_email', @htmlspecialchars($identity->getValue('from_addr'), ENT_COMPAT, NLS::getCharset()), true);
+$template->set('calendar_name', @htmlspecialchars($share->get('name'), ENT_COMPAT, Horde_Nls::getCharset()));
+$template->set('calendar_desc', @htmlspecialchars($share->get('desc'), ENT_COMPAT, Horde_Nls::getCharset()), true);
+$template->set('calendar_owner', @htmlspecialchars($identity->getValue('fullname'), ENT_COMPAT, Horde_Nls::getCharset()));
+$template->set('calendar_email', @htmlspecialchars($identity->getValue('from_addr'), ENT_COMPAT, Horde_Nls::getCharset()), true);
$template->set('self_url', $self_url);
$twentyFour = $prefs->getValue('twentyFor');
}
$modified = new Horde_Date($modified);
/* Description. */
- $desc = @htmlspecialchars($event->getDescription(), ENT_COMPAT, NLS::getCharset());
+ $desc = @htmlspecialchars($event->getDescription(), ENT_COMPAT, Horde_Nls::getCharset());
if (strlen($desc)) {
$desc .= '<br /><br />';
}
$attendees[] = empty($status['name']) ? $attendee : Horde_Mime_Address::trimAddress($status['name'] . (strpos($attendee, '@') === false ? '' : ' <' . $attendee . '>'));
}
if (count($attendees)) {
- $desc .= '<br />' . _("Who:") . ' ' . @htmlspecialchars(implode(', ', $attendees), ENT_COMPAT, NLS::getCharset());
+ $desc .= '<br />' . _("Who:") . ' ' . @htmlspecialchars(implode(', ', $attendees), ENT_COMPAT, Horde_Nls::getCharset());
}
if (strlen($event->getLocation())) {
- $desc .= '<br />' . _("Where:") . ' ' . @htmlspecialchars($event->getLocation(), ENT_COMPAT, NLS::getCharset());
+ $desc .= '<br />' . _("Where:") . ' ' . @htmlspecialchars($event->getLocation(), ENT_COMPAT, Horde_Nls::getCharset());
}
$desc .= '<br />' . _("Event Status:") . ' ' . Kronolith::statusToString($event->getStatus());
- $entries[$id]['title'] = @htmlspecialchars($event->getTitle(), ENT_COMPAT, NLS::getCharset());
- $entries[$id]['desc'] = @htmlspecialchars($desc, ENT_COMPAT, NLS::getCharset());
+ $entries[$id]['title'] = @htmlspecialchars($event->getTitle(), ENT_COMPAT, Horde_Nls::getCharset());
+ $entries[$id]['desc'] = @htmlspecialchars($desc, ENT_COMPAT, Horde_Nls::getCharset());
$entries[$id]['url'] = htmlspecialchars(Horde::url($event->getViewUrl(), true, -1));
$entries[$id]['modified'] = $modified->format(DATE_ATOM);
}
switch ($ct) {
case 'json':
header('Content-Type: application/json');
- echo Horde_Serialize::serialize($result, Horde_Serialize::JSON, NLS::getCharset());
+ echo Horde_Serialize::serialize($result, Horde_Serialize::JSON, Horde_Nls::getCharset());
break;
case 'plain':
*/
public function convertToDriver($value)
{
- return Horde_String::convertCharset($value, NLS::getCharset(), $this->_params['charset']);
+ return Horde_String::convertCharset($value, Horde_Nls::getCharset(), $this->_params['charset']);
}
/**
$vEvent->setAttribute('LAST-MODIFIED', $modified);
}
- $vEvent->setAttribute('SUMMARY', $v1 ? $this->getTitle() : Horde_String::convertCharset($this->getTitle(), NLS::getCharset(), 'utf-8'));
+ $vEvent->setAttribute('SUMMARY', $v1 ? $this->getTitle() : Horde_String::convertCharset($this->getTitle(), Horde_Nls::getCharset(), 'utf-8'));
$name = Kronolith::getUserName($this->getCreatorId());
if (!$v1) {
- $name = Horde_String::convertCharset($name, NLS::getCharset(), 'utf-8');
+ $name = Horde_String::convertCharset($name, Horde_Nls::getCharset(), 'utf-8');
}
$vEvent->setAttribute('ORGANIZER',
'mailto:' . Kronolith::getUserEmail($this->getCreatorId()),
array('CN' => $name));
if (!$this->isPrivate() || $this->getCreatorId() == Horde_Auth::getAuth()) {
if (!empty($this->description)) {
- $vEvent->setAttribute('DESCRIPTION', $v1 ? $this->description : Horde_String::convertCharset($this->description, NLS::getCharset(), 'utf-8'));
+ $vEvent->setAttribute('DESCRIPTION', $v1 ? $this->description : Horde_String::convertCharset($this->description, Horde_Nls::getCharset(), 'utf-8'));
}
// Tags
$tags = implode(', ', $tags);
}
if (!empty($tags)) {
- $vEvent->setAttribute('CATEGORIES', $v1 ? $tags : Horde_String::convertCharset($tags, NLS::getCharset(), 'utf-8'));
+ $vEvent->setAttribute('CATEGORIES', $v1 ? $tags : Horde_String::convertCharset($tags, Horde_Nls::getCharset(), 'utf-8'));
}
// Location
if (!empty($this->location)) {
- $vEvent->setAttribute('LOCATION', $v1 ? $this->location : Horde_String::convertCharset($this->location, NLS::getCharset(), 'utf-8'));
+ $vEvent->setAttribute('LOCATION', $v1 ? $this->location : Horde_String::convertCharset($this->location, Horde_Nls::getCharset(), 'utf-8'));
}
}
$vEvent->setAttribute('CLASS', $this->isPrivate() ? 'PRIVATE' : 'PUBLIC');
}
} else {
if (!empty($status['name'])) {
- $params['CN'] = Horde_String::convertCharset($status['name'], NLS::getCharset(), 'utf-8');
+ $params['CN'] = Horde_String::convertCharset($status['name'], Horde_Nls::getCharset(), 'utf-8');
}
if (!empty($email)) {
$email = 'mailto:' . $email;
// strptime() is locale dependent, i.e. %p is not always matching
// AM/PM. Set the locale to C to workaround this, but grab the
// locale's D_FMT before that.
- $date_format = NLS::getLangInfo(D_FMT);
+ $date_format = Horde_Nls::getLangInfo(D_FMT);
$old_locale = setlocale(LC_TIME, 0);
setlocale(LC_TIME, 'C');
array('style' => $this->getCSSColors(false)));
}
- $link .= @htmlspecialchars($event_title, ENT_QUOTES, NLS::getCharset());
+ $link .= @htmlspecialchars($event_title, ENT_QUOTES, Horde_Nls::getCharset());
if ($this->hasPermission(PERMS_READ) &&
(isset($this->eventID) ||
$js_vars['existing'] = $this->_params['existing'];
}
- $script = array('new PrettyAutocompleter(' . Horde_Serialize::serialize($js_vars, Horde_Serialize::JSON, NLS::getCharset()) . ')');
+ $script = array('new PrettyAutocompleter(' . Horde_Serialize::serialize($js_vars, Horde_Serialize::JSON, Horde_Nls::getCharset()) . ')');
} else {
$script = array('new Ajax.Autocompleter(' . implode(',', $params) . ')');
}
header('X-UA-Compatible: IE=7');
if (isset($GLOBALS['language'])) {
- header('Content-type: text/html; charset=' . NLS::getCharset());
+ header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
header('Vary: Accept-Language');
}
'week_start' => (int)$prefs->getValue('week_start_monday'),
'date_format' => str_replace(array('%e', '%d', '%a', '%A', '%m', '%h', '%b', '%B', '%y', '%Y'),
array('d', 'dd', 'ddd', 'dddd', 'MM', 'MMM', 'MMM', 'MMMM', 'yy', 'yyyy'),
- NLS::getLangInfo(D_FMT)),
+ Horde_Nls::getLangInfo(D_FMT)),
'time_format' => $prefs->getValue('twentyFour') ? 'HH:mm' : 'hh:mm tt',
'status' => array('tentative' => self::STATUS_TENTATIVE,
'confirmed' => self::STATUS_CONFIRMED,
'allday' => _("All day"),
);
for ($i = 1; $i <= 12; ++$i) {
- $code['text']['month'][$i - 1] = NLS::getLangInfo(constant('MON_' . $i));
+ $code['text']['month'][$i - 1] = Horde_Nls::getLangInfo(constant('MON_' . $i));
}
for ($i = 1; $i <= 7; ++$i) {
- $code['text']['weekday'][$i] = NLS::getLangInfo(constant('DAY_' . $i));
+ $code['text']['weekday'][$i] = Horde_Nls::getLangInfo(constant('DAY_' . $i));
}
foreach (array(Horde_Date_Recurrence::RECUR_DAILY,
Horde_Date_Recurrence::RECUR_WEEKLY,
$code['text']['recur'][$recurType] = self::recurToString($recurType);
}
- return array('var Kronolith = ' . Horde_Serialize::serialize($code, Horde_Serialize::JSON, NLS::getCharset()) . ';');
+ return array('var Kronolith = ' . Horde_Serialize::serialize($code, Horde_Serialize::JSON, Horde_Nls::getCharset()) . ';');
}
/**
/* Build the iCalendar data */
$iCal = new Horde_iCalendar();
$iCal->setAttribute('METHOD', $method);
- $iCal->setAttribute('X-WR-CALNAME', Horde_String::convertCharset($share->get('name'), NLS::getCharset(), 'utf-8'));
+ $iCal->setAttribute('X-WR-CALNAME', Horde_String::convertCharset($share->get('name'), Horde_Nls::getCharset(), 'utf-8'));
$vevent = $event->toiCalendar($iCal);
if ($action == self::ITIP_CANCEL && !empty($instance)) {
$vevent->setAttribute('RECURRENCE-ID', $instance, array('VALUE' => 'DATE'));
$ics->setContents($iCal->exportvCalendar());
$ics->setName($filename);
$ics->setContentTypeParameter('METHOD', $method);
- $ics->setCharset(NLS::getCharset());
+ $ics->setCharset(Horde_Nls::getCharset());
$recipient = empty($status['name']) ? $email : Horde_Mime_Address::trimAddress($status['name'] . ' <' . $email . '>');
- $mail = new Horde_Mime_Mail($subject, $message, $recipient, $from, NLS::getCharset());
+ $mail = new Horde_Mime_Mail($subject, $message, $recipient, $from, Horde_Nls::getCharset());
require_once KRONOLITH_BASE . '/lib/version.php';
try {
$mail->addHeader('User-Agent', 'Kronolith ' . KRONOLITH_VERSION);
}
foreach ($addresses as $lang => $twentyFour) {
- NLS::setLang($lang);
+ Horde_Nls::setLang($lang);
switch ($action) {
case 'add':
null,
implode(',', $df_recipients),
$from,
- NLS::getCharset());
- $mime_mail->setBody($message, NLS::getCharset(), true);
+ Horde_Nls::getCharset());
+ $mime_mail->setBody($message, Horde_Nls::getCharset(), true);
Horde::logMessage(sprintf('Sending event notifications for %s to %s', $event->title, implode(', ', $df_recipients)), __FILE__, __LINE__, PEAR_LOG_DEBUG);
try {
$mime_mail->send($mail_driver, $mail_params, false, false);
if (!is_a($share, 'PEAR_Error')) {
$iCal->setAttribute('X-WR-CALNAME',
Horde_String::convertCharset($share->get('name'),
- NLS::getCharset(),
+ Horde_Nls::getCharset(),
'utf-8'));
}
}
$GLOBALS['browser']->downloadHeaders(
$event->getTitle() . '.ics',
- 'text/calendar; charset=' . NLS::getCharset(),
+ 'text/calendar; charset=' . Horde_Nls::getCharset(),
true, strlen($content));
echo $content;
exit;
$share = &$kronolith_shares->getShare($event->getCalendar());
$iCal = new Horde_iCalendar($version);
- $iCal->setAttribute('X-WR-CALNAME', Horde_String::convertCharset($share->get('name'), NLS::getCharset(), 'utf-8'));
+ $iCal->setAttribute('X-WR-CALNAME', Horde_String::convertCharset($share->get('name'), Horde_Nls::getCharset(), 'utf-8'));
// Create a new vEvent.
$vEvent = &$event->toiCalendar($iCal);
$share = &$kronolith_shares->getShare($calendar);
$iCal = new Horde_iCalendar($version);
- $iCal->setAttribute('X-WR-CALNAME', Horde_String::convertCharset($share->get('name'), NLS::getCharset(), 'utf-8'));
+ $iCal->setAttribute('X-WR-CALNAME', Horde_String::convertCharset($share->get('name'), Horde_Nls::getCharset(), 'utf-8'));
foreach ($events as $dayevents) {
foreach ($dayevents as $event) {
if (($reminder == 'owner' && $alarm_user == $owner) ||
($reminder == 'show' && in_array($calendar, $shown_calendars)) ||
$reminder == 'read') {
- NLS::setLanguageEnvironment($prefs->getValue('language'));
+ Horde_Nls::setLanguageEnvironment($prefs->getValue('language'));
$alarm = $event->toAlarm($time, $alarm_user, $prefs);
if ($alarm) {
$alarm_list[] = $alarm;
Horde::compressOutput();
/* Set the timezone variable, if available. */
-NLS::setTimeZone();
+Horde_Nls::setTimeZone();
/* Create a share instance. */
$GLOBALS['kronolith_shares'] = &Horde_Share::singleton($registry->getApp());
/* Check permissions. */
if (Kronolith::hasPermission('max_events') !== true &&
Kronolith::hasPermission('max_events') <= Kronolith::countEvents()) {
- $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), Kronolith::hasPermission('max_events')), ENT_COMPAT, NLS::getCharset());
+ $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), Kronolith::hasPermission('max_events')), ENT_COMPAT, Horde_Nls::getCharset());
if (!empty($conf['hooks']['permsdenied'])) {
$message = Horde::callHook('_perms_hook_denied', array('kronolith:max_events'), 'horde', $message);
}
$lang = $prefs->getValue('language');
$twentyFour = $prefs->getValue('twentyFour');
$dateFormat = $prefs->getValue('date_format');
- NLS::setLanguageEnvironment($lang);
+ Horde_Nls::setLanguageEnvironment($lang);
$mime_mail = new Horde_Mime_Mail(sprintf(_("Your daily agenda for %s"), strftime($dateFormat, $runtime)),
null,
$email,
$GLOBALS['conf']['reminder']['from_addr'],
- NLS::getCharset());
+ Horde_Nls::getCharset());
$mail_driver = $GLOBALS['conf']['mailer']['type'];
$mail_params = $GLOBALS['conf']['mailer']['params'];
$message .= $event->title . "\n";
}
- $mime_mail->setBody($message, NLS::getCharset(), true);
+ $mime_mail->setBody($message, Horde_Nls::getCharset(), true);
try {
$mime_mail->addRecipients($email);
} catch (Horde_Mime_Exception $e) {}
Horde::addScriptFile('stripe.js', 'horde', true);
if (isset($language)) {
- header('Content-type: text/html; charset=' . NLS::getCharset());
+ header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
header('Vary: Accept-Language');
}
?>
<tr>
<th class="kronolithMinicalEmpty"> </th>
<?php for ($i = $prefs->getValue('week_start_monday'), $c = $i + 7; $i < $c; $i++): ?>
- <th title="<?php echo NLS::getLangInfo(constant('DAY_' . ($i % 7 + 1))) ?>"><?php echo substr(NLS::getLangInfo(constant('DAY_' . ($i % 7 + 1))), 0, 1) ?></th>
+ <th title="<?php echo Horde_Nls::getLangInfo(constant('DAY_' . ($i % 7 + 1))) ?>"><?php echo substr(Horde_Nls::getLangInfo(constant('DAY_' . ($i % 7 + 1))), 0, 1) ?></th>
<?php endfor; ?>
</tr>
</thead>
<tr>
<td class="kronolithFirstCol"><div id="kronolithLoadingmonth" class="kronolithLoading"></div></td>
<?php for ($w = $prefs->getValue('week_start_monday'), $i = $w, $c = $i + 7; $i < $c; $i++): ?>
- <td class="kronolithCol"><span><?php echo NLS::getLangInfo(constant('DAY_' . ($i % 7 + 1))) ?></span></td>
+ <td class="kronolithCol"><span><?php echo Horde_Nls::getLangInfo(constant('DAY_' . ($i % 7 + 1))) ?></span></td>
<?php endfor; ?>
</tr>
</table>
<thead><tr>
<th class="kronolithMinicalEmpty"> </th>
<?php for ($i = $prefs->getValue('week_start_monday'), $c = $i + 7; $i < $c; $i++): ?>
- <th title="<?php echo NLS::getLangInfo(constant('DAY_' . ($i % 7 + 1))) ?>"><?php echo substr(NLS::getLangInfo(constant('DAY_' . ($i % 7 + 1))), 0, 1) ?></th>
+ <th title="<?php echo Horde_Nls::getLangInfo(constant('DAY_' . ($i % 7 + 1))) ?>"><?php echo substr(Horde_Nls::getLangInfo(constant('DAY_' . ($i % 7 + 1))), 0, 1) ?></th>
<?php endfor; ?>
</tr></thead>
<tbody>
*/
require_once 'Horde/Serialize.php';
-$charset = NLS::getCharset();
+$charset = Horde_Nls::getCharset();
/* Variables used in core javascript files. */
$var = array(
<!-- owner -->
<tr>
<td class="rightAlign"><strong><?php echo _("Owner") ?> </strong></td>
- <td><?php echo @htmlspecialchars($owner, ENT_COMPAT, NLS::getCharset()) ?> </td>
+ <td><?php echo @htmlspecialchars($owner, ENT_COMPAT, Horde_Nls::getCharset()) ?> </td>
</tr>
<?php endif; ?>
<?php if (isset($created)): ?>
<tr>
<td class="nowrap rightAlign"><strong><?php echo _("Created") ?></strong> </td>
- <td class="nowrap"><?php echo $created->strftime($dateFormat) . ' ' . $created->format($timeFormat) . ' ' . @htmlspecialchars($createdby, ENT_COMPAT, NLS::getCharset()) ?></td>
+ <td class="nowrap"><?php echo $created->strftime($dateFormat) . ' ' . $created->format($timeFormat) . ' ' . @htmlspecialchars($createdby, ENT_COMPAT, Horde_Nls::getCharset()) ?></td>
</tr>
<?php endif; ?>
<?php if (isset($modified)): ?>
<tr>
<td class="nowrap rightAlign"><strong><?php echo _("Last Modified") ?></strong> </td>
- <td class="nowrap"><?php echo $modified->strftime($dateFormat) . ' ' . $modified->format($timeFormat) . ' ' . @htmlspecialchars($modifiedby, ENT_COMPAT, NLS::getCharset()) ?></td>
+ <td class="nowrap"><?php echo $modified->strftime($dateFormat) . ' ' . $modified->format($timeFormat) . ' ' . @htmlspecialchars($modifiedby, ENT_COMPAT, Horde_Nls::getCharset()) ?></td>
</tr>
<?php endif; ?>
'ORDER BY n.publish DESC ' .
'LIMIT 0, ' . $this->_params['limit'];
- $params = array(News::CONFIRMED, $this->_params['category'], $this->_params['category'], NLS::select());
+ $params = array(News::CONFIRMED, $this->_params['category'], $this->_params['category'], Horde_Nls::select());
$rows = $GLOBALS['news']->db->getAll($query, $params, DB_FETCHMODE_ASSOC);
if ($rows instanceof PEAR_Error) {
return $rows->getDebugInfo();
{
require_once dirname(__FILE__) . '/../base.php';
- $params = array(News::CONFIRMED, NLS::select());
+ $params = array(News::CONFIRMED, Horde_Nls::select());
$query = 'SELECT n.id, n.publish, n.comments, n.picture, n.category1, nl.title, nl.abbreviation ' .
'FROM ' . $GLOBALS['news']->prefix . ' AS n, ' . $GLOBALS['news']->prefix . '_body AS nl WHERE ' .
'n.status = ? AND n.publish <= NOW() ' .
'ORDER BY n.publish DESC ' .
'LIMIT 0, ' . $this->_params['limit'];
- $params = array(News::CONFIRMED, 0, NLS::select());
+ $params = array(News::CONFIRMED, 0, Horde_Nls::select());
$rows = $GLOBALS['news']->db->getAll($query, $params, DB_FETCHMODE_ASSOC);
if ($rows instanceof PEAR_Error) {
return $rows->getDebugInfo();
'LIMIT 0, ' . $this->_params['limit'];
$younger = $_SERVER['REQUEST_TIME'] - $this->_params['days'] * 86400;
- $params = array(News::CONFIRMED, date('Y-m-d', $younger), NLS::select());
+ $params = array(News::CONFIRMED, date('Y-m-d', $younger), Horde_Nls::select());
$rows = $GLOBALS['news']->db->getAll($query, $params, DB_FETCHMODE_ASSOC);
if ($rows instanceof PEAR_Error) {
return $rows->getDebugInfo();
'LIMIT 0, ' . $this->_params['limit'];
$younger = $_SERVER['REQUEST_TIME'] - $this->_params['days'] * 86400;
- $params = array(News::CONFIRMED, date('Y-m-d', $younger), NLS::select());
+ $params = array(News::CONFIRMED, date('Y-m-d', $younger), Horde_Nls::select());
$rows = $GLOBALS['news']->db->getAll($query, $params, DB_FETCHMODE_ASSOC);
if ($rows instanceof PEAR_Error) {
return $rows->getDebugInfo();
$sql = 'FROM ' . $GLOBALS['news']->prefix . ' AS n, ' . $GLOBALS['news']->prefix . '_body AS l '
. ' WHERE n.id = l.id AND l.lang = ?';
- $params = array('_lang' => NLS::select());
+ $params = array('_lang' => Horde_Nls::select());
if ($perms == PERMS_READ) {
$sql .= ' AND n.publish <= ? ';
. $this->prefix . ' AS n WHERE l.lang = ? AND n.id = l.id AND n.status = ? ORDER BY n.publish DESC LIMIT 0, '
. ($minimize ? '100' : '500');
- $result = $this->db->query($sql, array(NLS::select(), News::CONFIRMED));
+ $result = $this->db->query($sql, array(Horde_Nls::select(), News::CONFIRMED));
if ($result instanceof PEAR_Error) {
return $result;
}
static $lang;
if ($lang === null) {
- $lang = NLS::Select();
+ $lang = Horde_Nls::Select();
if (!empty($conf['attributes']['languages']) &&
!in_array($lang, $conf['attributes']['languages'])) {
$lang = $conf['attributes']['languages'][0];
{
/* Set parents defualt data */
parent::__construct(array('templatePath' => NEWS_TEMPLATES,
- 'encoding' => NLS::select()));
+ 'encoding' => Horde_Nls::select()));
}
/**
$row['publish'],
News::getUrlFor('news', $id, true, -1));
-$mail = new Horde_Mime_Mail($row['title'], $body, $to, $from, NLS::getCharset());
+$mail = new Horde_Mime_Mail($row['title'], $body, $to, $from, Horde_Nls::getCharset());
$result = $mail->send($conf['mailer']['type'], $conf['mailer']['params']);
if ($result instanceof PEAR_Error) {
$notification->push($result);
$pdf->write(12, _("On") . ': ' . News::dateFormat($row['publish']) . "\n");
$pdf->write(12, _("Link") . ': ' . News::getUrlFor('news', $id, true) . "\n\n", News::getUrlFor('news', $id, true));
-$pdf->multiCell(0, 12, Horde_String::convertCharset(strip_tags($row['content']), NLS::getCharset(), 'UTF-8'));
+$pdf->multiCell(0, 12, Horde_String::convertCharset(strip_tags($row['content']), Horde_Nls::getCharset(), 'UTF-8'));
$browser->downloadHeaders($id . '.pdf', 'application/pdf');
echo $pdf->getOutput();
$list = News::getLastComments(50);
$title = _("Last comments");
- $rss = '<?xml version="1.0" encoding="' . NLS::getCharset() . '" ?>
+ $rss = '<?xml version="1.0" encoding="' . Horde_Nls::getCharset() . '" ?>
<rss version="2.0">
<channel>
<title>' . htmlspecialchars($title) . '</title>
- <language>' . str_replace('_', '-', strtolower(NLS::select())) . '</language>
+ <language>' . str_replace('_', '-', strtolower(Horde_Nls::select())) . '</language>
<lastBuildDate>' . date('r') . '</lastBuildDate>
<description>' . htmlspecialchars($title) . '</description>
<link>' . Horde::applicationUrl('index.php', true, -1) . '</link>
$cache->set($cache_key, $rss);
}
-header('Content-type: text/xml; charset=' . NLS::getCharset());
+header('Content-type: text/xml; charset=' . Horde_Nls::getCharset());
echo $rss;
$title = $registry->get('name', 'horde');
$read_url = Horde::applicationUrl('read.php', true, -1);
- $rss = '<?xml version="1.0" encoding="' . NLS::getCharset() . '" ?>
+ $rss = '<?xml version="1.0" encoding="' . Horde_Nls::getCharset() . '" ?>
<rss version="2.0">
<channel>
<title>' . htmlspecialchars($title) . '</title>
- <language>' . str_replace('_', '-', strtolower(NLS::select())) . '</language>
+ <language>' . str_replace('_', '-', strtolower(Horde_Nls::select())) . '</language>
<lastBuildDate>' . date('r') . '</lastBuildDate>
<description>' . htmlspecialchars($title) . '</description>
<link>' . Horde::applicationUrl('index.php', true, -1) . '</link>
'nl.title, nl.abbreviation ' .
'FROM ' . $news->prefix . ' AS n, ' . $news->prefix . '_body AS nl ' .
'WHERE n.status="' . News::CONFIRMED . '" AND n.publish<=NOW() ' .
- 'AND nl.lang="' . NLS::select() . '" AND n.id=nl.id ORDER BY publish DESC';
+ 'AND nl.lang="' . Horde_Nls::select() . '" AND n.id=nl.id ORDER BY publish DESC';
$rssbody = '';
$query = $news->db->modifyLimitQuery($query, 0, 10);
$list = $news->db->getAssoc($query, true, array(), DB_FETCHMODE_ASSOC);
}
// Wee need the last published news time
- $rssheader = '<?xml version="1.0" encoding="' . NLS::getCharset() . '" ?>
+ $rssheader = '<?xml version="1.0" encoding="' . Horde_Nls::getCharset() . '" ?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/" >
<channel>
<title>' . htmlspecialchars($title) . '</title>
- <language>' . str_replace('_', '-', strtolower(NLS::select())) . '</language>
+ <language>' . str_replace('_', '-', strtolower(Horde_Nls::select())) . '</language>
<lastBuildDate>' . date('r', $lastnewstime) . '</lastBuildDate>
<description>' . htmlspecialchars($title) . '</description>
<link>' . Horde::applicationUrl('index.php', true, -1) . '</link>
<?php
if (isset($language)) {
- header('Content-type: text/html; charset=' . NLS::getCharset());
+ header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
header('Vary: Accept-Language');
}
?>
<?php
if (isset($language)) {
- header('Content-type: text/html; charset=' . NLS::getCharset());
+ header('Content-type: text/html; charset=' . Horde_Nls::getCharset());
header('Vary: Accept-Language');
}
?>