require_once BABEL_BASE . '/lib/Gettext/PO.php';
require_once 'Horde/Form.php';
-require_once 'Horde/Variables.php';
require_once 'Horde/Form/Renderer.php';
require_once 'Horde/Form/Action.php';
require_once 'Horde/UI/Tabs.php';
-$app = Util::getFormData('module');
+$app = Horde_Util::getFormData('module');
$show = 'edit';
-$vars = &Variables::getDefaultVariables();
+$vars = &Horde_Variables::getDefaultVariables();
if ($app) {
$napp = ($app == 'horde') ? '' : $app;
/* Set up the template fields. */
$template->set('menu', Babel::getMenu('string'));
-$template->set('notify', Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
+$template->set('notify', Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
/* Create upload form */
$form = &new Horde_Form($vars, _("Edit Translation"), $show);
/* Validate form if submitted */
-if ($app && Util::getFormData('submitbutton') == _("Save")) {
+if ($app && Horde_Util::getFormData('submitbutton') == _("Save")) {
if ($form->validate($vars, false)) {
$form->getInfo($vars, $form_values);
foreach($meta_params as $k => $v) {
- if ($val = Util::getFormData($k)) {
+ if ($val = Horde_Util::getFormData($k)) {
$po->meta[$k] = $val;
}
}
$po->save($pofile);
- if (Util::getFormData('url') == 'view') {
+ if (Horde_Util::getFormData('url') == 'view') {
$url = Horde::applicationUrl('view.php');
- $url = Util::addParameter($url, array('module' => $app));
+ $url = Horde_Util::addParameter($url, array('module' => $app));
header('Location: ' . $url);
exit;
}
$vars->set('module', $app);
$form->addHidden('', 'url', 'text', false);
- $vars->set('url', Util::getFormData('url'));
+ $vars->set('url', Horde_Util::getFormData('url'));
foreach($meta_params as $k => $v) {
$form->addVariable($k, $k, 'text', false, false);
echo $template->fetch(BABEL_TEMPLATES . '/layout.html');
-$vars = &Variables::getDefaultVariables();
+$vars = &Horde_Variables::getDefaultVariables();
/* Create upload form */
$form = &new Horde_Form($vars, _("Extract Translation"), 'extract');
continue;
}
- if (Util::getFormData('module') == $app) {
+ if (Horde_Util::getFormData('module') == $app) {
$html .= '<option class="control" value="' . $app . '" selected>' . '+ ' . $desc;
} else {
$html .= '<option value="' . $app . '">' . '– ' . $desc;
$f = array('/</', '/>/');
$t = array('<', '>');
$msg = preg_replace($f, $t, $msg);
- return String::convertCharset(html_entity_decode($msg), NLS::getCharset(), Translate_Display::parseCharset($po->meta['Content-Type']));
+ return Horde_String::convertCharset(html_entity_decode($msg), NLS::getCharset(), Translate_Display::parseCharset($po->meta['Content-Type']));
}
function display_string($msg) {
$f = array('/</', '/>/');
$t = array('<', '>');
$msg = preg_replace($f, $t, $msg);
- return String::convertCharset($msg, Translate_Display::parseCharset($po->meta['Content-Type']), NLS::getCharset());
+ return Horde_String::convertCharset($msg, Translate_Display::parseCharset($po->meta['Content-Type']), NLS::getCharset());
}
function get_percent($used, $total) {
}
if (!empty($module) && $module != $apps[$i]) { continue; }
$package = ucfirst($apps[$i]);
- $package_u = String::upper($apps[$i]);
+ $package_u = Horde_String::upper($apps[$i]);
@include $dirs[$i] . '/lib/version.php';
$version = eval('return(defined("' . $package_u . '_VERSION") ? ' . $package_u . '_VERSION : "???");');
Translate_Display::header(sprintf(_("Initializing module %s..."), $apps[$i]));
/* Form and Variables */
require_once 'Horde/Form.php';
-require_once 'Horde/Variables.php';
require_once 'Horde/Form/Renderer.php';
require_once 'Horde/Form/Action.php';
$template = &new Horde_Template();
/* Module selection */
-$app = Util::getFormData('module');
+$app = Horde_Util::getFormData('module');
/* Language selection */
-if (($lang = Util::getFormData('display_language')) !== null) {
+if (($lang = Horde_Util::getFormData('display_language')) !== null) {
$_SESSION['babel']['language'] = $lang;
} elseif (isset($_SESSION['babel']['language'])) {
$lang = $_SESSION['babel']['language'];
/* Set up the template fields. */
$template->set('menu', Babel::getMenu('string'));
-$template->set('notify', Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
+$template->set('notify', Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
$template->set('lang', Babel::displayLanguage());
$fmenu = Babel::LanguageSelection();
echo $template->fetch(BABEL_TEMPLATES . '/layout.html');
-$vars = &Variables::getDefaultVariables();
+$vars = &Horde_Variables::getDefaultVariables();
/* Create upload form */
$form = &new Horde_Form($vars, _("Make Translation"), 'make');
}
echo $template->fetch(BABEL_TEMPLATES . '/layout.html');
-$vars = &Variables::getDefaultVariables();
+$vars = &Horde_Variables::getDefaultVariables();
/* Create upload form */
$form = &new Horde_Form($vars, _("View Statistics"), 'stats');
echo "\n<tr class=\"item" . ($i++ % 2) . "\">";
}
echo "\n\t<td>" . $nls['languages'][$key] . "</td>";
- echo "\n\t<td>" . Horde::link(Util::addParameter(Horde::applicationUrl('view.php'), array('display_language' => $key, 'module' => $_app))) . $key . '</a>' . "</td>";
+ echo "\n\t<td>" . Horde::link(Horde_Util::addParameter(Horde::applicationUrl('view.php'), array('display_language' => $key, 'module' => $_app))) . $key . '</a>' . "</td>";
echo "\n\t<td>" . Translate_Display::create_bargraph($value[2], $value[0]) . "</td>";
echo "\n\t<td>" . $value[2] . "</td>";
echo "\n\t<td>" . $value [3] . "</td>";
<?php echo Horde::stylesheetLink('babel') ?>
</head>
-<body<?php if (Util::nonInputVar('bodyClass')) echo ' class="' . $bodyClass . '"' ?>>
+<body<?php if (Horde_Util::nonInputVar('bodyClass')) echo ' class="' . $bodyClass . '"' ?>>
@define('BABEL_BASE', dirname(__FILE__)) ;
require_once BABEL_BASE . '/lib/base.php';
-$vars = &Variables::getDefaultVariables();
+$vars = &Horde_Variables::getDefaultVariables();
/* Create upload form */
$form = &new Horde_Form($vars, _("Upload new Translation"), 'upload');
$form->addVariable('', '', 'spacer', true);
/* Validate form if submitted */
-if (Util::getFormData('submitbutton') == _("Upload")) {
+if (Horde_Util::getFormData('submitbutton') == _("Upload")) {
if ($form->validate($vars, false)) {
$form->getInfo($vars, $form_values);
"Content-Transfer-Encoding" => "8bit",
"Plural-Forms" => "nplurals=2; plural=(n > 1);");
-$app = Util::getFormData('module');
-$editmode = Util::getFormData('editmode', 0);
-$cstring = Util::getFormData('cstring');
-$page = Util::getFormData('page', 0);
-$filter = Util::getFormData('filter');
-$search = Util::getFormData('search');
+$app = Horde_Util::getFormData('module');
+$editmode = Horde_Util::getFormData('editmode', 0);
+$cstring = Horde_Util::getFormData('cstring');
+$page = Horde_Util::getFormData('page', 0);
+$filter = Horde_Util::getFormData('filter');
+$search = Horde_Util::getFormData('search');
if ($app) {
/* Render the page. */
echo $template->fetch(BABEL_TEMPLATES . '/layout.html');
-$app = Util::getFormData('module');
+$app = Horde_Util::getFormData('module');
$show = 'edit';
-$vars = &Variables::getDefaultVariables();
+$vars = &Horde_Variables::getDefaultVariables();
if ($app) {
//
-$f_cancel = Util::getFormData('cancel');
-$f_save = Util::getFormData('submit');
+$f_cancel = Horde_Util::getFormData('cancel');
+$f_save = Horde_Util::getFormData('submit');
if (($f_save || $f_cancel) && $cstring) {
if ($curlock = $locks->getLocks(md5($cstring), $lockscope)) {
if ($f_save && $cstring) {
$decstr = $po->encstr[$cstring];
- $msgstr = Util::getFormData('msgstr');
+ $msgstr = Horde_Util::getFormData('msgstr');
$comments = trim($po->comments[$decstr]);
- $phpformat = Util::getFormData('phpformat');
- $fuzzy = Util::getFormData('fuzzy');
+ $phpformat = Horde_Util::getFormData('phpformat');
+ $fuzzy = Horde_Util::getFormData('fuzzy');
$status = $po->status[$decstr];
foreach($status as $k => $v) {
/* Set up the template fields. */
$template->set('menu', Babel::getMenu('string'));
-$template->set('notify', Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
+$template->set('notify', Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
/* Create upload form */
$form = &new Horde_Form($vars, _("View Translation"), $show);
if (Babel::hasPermission('view', 'tabs', PERMS_EDIT)) {
$hmenu_desc = _("Edit Header");
$url = Horde::applicationUrl('edit.php');
- $url = Util::addParameter($url, array('module' => $app,
+ $url = Horde_Util::addParameter($url, array('module' => $app,
'url' => 'view'));
$hmenu = Horde::link($url, $hmenu_desc, 'menuitem', null);
$hmenu_desc = _("All");
}
$url = Horde::applicationUrl('view.php');
- $url = Util::addParameter($url, array('module' => $app));
+ $url = Horde_Util::addParameter($url, array('module' => $app));
$filter_html .= Horde::link($url, _("Edit Mode"), 'menuitem', null). ' ' . $hmenu_desc . '</a> ';
$filter_html .= '| ';
$hmenu_desc = _("Translated");
}
$url = Horde::applicationUrl('view.php');
- $url = Util::addParameter($url, array('module' => $app, 'filter' => 'translated'));
+ $url = Horde_Util::addParameter($url, array('module' => $app, 'filter' => 'translated'));
$filter_html .= Horde::link($url, $hmenu_desc, 'menuitem', null). ' ' . $hmenu_desc . '</a> ';
$filter_html .= '| ';
$hmenu_desc = _("Fuzzy");
}
$url = Horde::applicationUrl('view.php');
- $url = Util::addParameter($url, array('module' => $app, 'filter' => 'fuzzy'));
+ $url = Horde_Util::addParameter($url, array('module' => $app, 'filter' => 'fuzzy'));
$filter_html .= Horde::link($url, $hmenu_desc, 'menuitem', null). ' ' . $hmenu_desc . '</a> ';
$filter_html .= '| ';
$hmenu_desc = _("Untranslated");
}
$url = Horde::applicationUrl('view.php');
- $url = Util::addParameter($url, array('module' => $app, 'filter' => 'untranslated'));
+ $url = Horde_Util::addParameter($url, array('module' => $app, 'filter' => 'untranslated'));
$filter_html .= Horde::link($url, $hmenu_desc, 'menuitem', null). ' ' . $hmenu_desc . '</a> ';
$filter_html .= '] ';
if (Babel::hasPermission('viewsource', 'tabs', PERMS_EDIT)) {
$surl = Horde::applicationUrl('viewsource.php');
- $surl = Util::addParameter($surl, array('module' => $app,
+ $surl = Horde_Util::addParameter($surl, array('module' => $app,
'file' => $sfile,
'line' => $sline));
if (Babel::hasPermission('view', 'tabs', PERMS_EDIT)) {
if (!$editmode || $cstring != $encstr) {
$surl = Horde::applicationUrl('view.php');
- $surl = Util::addParameter($surl, array('module' => $app, 'cstring' => $encstr, 'editmode' => 1, 'page' => $page, 'filter' => $filter, 'search' => $search));
+ $surl = Horde_Util::addParameter($surl, array('module' => $app, 'cstring' => $encstr, 'editmode' => 1, 'page' => $page, 'filter' => $filter, 'search' => $search));
$surl .= "#" . md5($encstr);
echo Horde::link($surl, _("Edit Translation")) . Horde::img('babel.png') . ' ' ._("Edit Translation") . "</a>";
<tr><td>
<?php
$viewurl = Horde::applicationUrl('view.php');
-$viewurl = Util::addParameter($viewurl, array('editmode' => $editmode,
+$viewurl = Horde_Util::addParameter($viewurl, array('editmode' => $editmode,
'module' => $app,
'filter' => $filter,
'search' => $search));
require_once dirname(__FILE__) . '/lib/base.php';
-$app = Util::getFormData('module');
-$sfile = Util::getFormData('file');
-$sline = Util::getFormData('line');
+$app = Horde_Util::getFormData('module');
+$sfile = Horde_Util::getFormData('file');
+$sline = Horde_Util::getFormData('line');
if ($app == 'horde') {
$srcfile = realpath(sprintf("%s/%s", HORDE_BASE, $sfile));
}
/* Retrieve the desired revision from the GET variable. */
-$rev = Util::getFormData('rev');
+$rev = Horde_Util::getFormData('rev');
if (!$rev || !$VC->isValidRevision($rev)) {
Chora::fatal(sprintf(_("Revision %s not found"), $rev ? $rev : _("NONE")), '404 Not Found');
}
-switch (Util::getFormData('actionID')) {
+switch (Horde_Util::getFormData('actionID')) {
case 'log':
$log = $fl->queryLogs($rev);
if (!is_null($log)) {
Horde::addScriptFile('annotate.js', 'chora', true);
$js_vars = array(
- 'ANNOTATE_URL' => Util::addParameter(Horde::applicationUrl('annotate.php'), array('actionID' => 'log', 'f' => $where, 'rev' => ''), null, false),
+ 'ANNOTATE_URL' => Horde_Util::addParameter(Horde::applicationUrl('annotate.php'), array('actionID' => 'log', 'f' => $where, 'rev' => ''), null, false),
'loading_text' => _("Loading...")
);
}
$rev = $VC->hasFeature('snapshots')
- ? Util::getFormData('rev')
+ ? Horde_Util::getFormData('rev')
: null;
try {
Chora::fatal(sprintf(_("$fullname: no such file or directory"), $where), '404 Not Found');
}
-$onb = Util::getFormData('onb');
+$onb = Horde_Util::getFormData('onb');
try {
$fl = $VC->getFileObject($where, array('branch' => $onb));
} catch (Horde_Vcs_Exception $e) {
require CHORA_TEMPLATES . '/log/rev.inc';
- if (($i++ > 100) && !Util::getFormData('all')) {
+ if (($i++ > 100) && !Horde_Util::getFormData('all')) {
break;
}
}
}
/* Should we pretty-print this output or not? */
-$plain = Util::getFormData('p', 0);
+$plain = Horde_Util::getFormData('p', 0);
/* Create the VC_File object and populate it. */
try {
}
/* Get the revision number. */
-$r = Util::getFormData('r');
+$r = Horde_Util::getFormData('r');
/* If no revision is specified, default to HEAD. If a revision is
* specified, it's safe to cache for a long time. */
$root = escapeShellCmd($VC->sourceroot());
$file = escapeShellCmd($where . ',v');
-if (Util::getFormData('show_image')) {
+if (Horde_Util::getFormData('show_image')) {
// Pipe out the actual image.
$args = array('c' => $conf['paths']['cvsgraph_conf'],
'r' => $root);
}
/* Initialise the form variables correctly. */
-$r1 = Util::getFormData('r1');
-$r2 = Util::getFormData('r2');
+$r1 = Horde_Util::getFormData('r1');
+$r2 = Horde_Util::getFormData('r2');
/* Ensure that we have valid revision numbers. */
if (!$VC->isValidRevision($r1) || !$VC->isValidRevision($r2)) {
}
/* If no type has been specified, then default to human readable. */
-$type = Util::getFormData('t', 'colored');
-if (Util::getFormData('ty') == 'u') {
+$type = Horde_Util::getFormData('t', 'colored');
+if (Horde_Util::getFormData('ty') == 'u') {
$type = 'unified';
}
/* Unless otherwise specified, show whitespace differences and 3 lines
* of context. */
-$ws = Util::getFormData('ws', 1);
-$num = (int)Util::getFormData('num', 3);
+$ws = Horde_Util::getFormData('ws', 1);
+$num = (int)Horde_Util::getFormData('num', 3);
/* Cache the output of the diff for a week - it can be longer, since
* it should never change. */
/* See if any have been passed as GET variables, and if so, assign
* them into the acts array. */
foreach ($defaultActs as $key => $default) {
- $acts[$key] = Util::getFormData($key, $default);
+ $acts[$key] = Horde_Util::getFormData($key, $default);
}
if (!isset($sourceroots[$acts['rt']])) {
$GLOBALS['conf']['paths']['temp'] = Horde::getTempDir();
try {
- $GLOBALS['VC'] = Horde_Vcs::factory(String::ucfirst($sourcerootopts['type']),
+ $GLOBALS['VC'] = Horde_Vcs::factory(Horde_String::ucfirst($sourcerootopts['type']),
array('cache' => $cache,
'sourceroot' => $sourcerootopts['location'],
'paths' => $GLOBALS['conf']['paths'],
$GLOBALS['conf']['options']['introTitle'] = isset($sourcerootopts['title']) ? $sourcerootopts['title'] : '';
$GLOBALS['conf']['options']['sourceRootName'] = $sourcerootopts['name'];
- $where = Util::getFormData('f', '/');
+ $where = Horde_Util::getFormData('f', '/');
/* Location relative to the sourceroot. */
$where = preg_replace(array('|^/|', '|\.\.|'), '', $where);
$arglist['f'] = $uri;
}
- $url = Util::addParameter(Horde::applicationUrl($script), $arglist);
+ $url = Horde_Util::addParameter(Horde::applicationUrl($script), $arglist);
return empty($anchor) ? $url : ($url . '#' . $anchor);
}
{
$arglist = self::_getArgList($GLOBALS['acts'], $GLOBALS['defaultActs'], array());
- $fields = Util::formInput();
+ $fields = Horde_Util::formInput();
foreach ($arglist as $key => $val) {
$fields .= '<input type="hidden" name="' . htmlspecialchars($key) . '" value="' . htmlspecialchars($val) . '" />';
}
}
$ps_opts = array();
-if ($ps_id = Util::getFormData('ps')) {
+if ($ps_id = Horde_Util::getFormData('ps')) {
$ps_opts['range'] = array($ps_id);
}
$data = reset($data);
echo '<div class="fixed">' . Text_Filter::filter($data['data'], 'text2html', array('parselevel' => TEXT_HTML_MICRO)) . '</div>';
} elseif (strpos($mime_type, 'image/') !== false) {
- echo Horde::img(Util::addParameter(Horde::selfUrl(true), 'p', 1), '', '', '');
+ echo Horde::img(Horde_Util::addParameter(Horde::selfUrl(true), 'p', 1), '', '', '');
} elseif ($pretty->canRender('inline')) {
$data = $pretty->render('inline');
$data = reset($data);
echo $data['data'];
} else {
- echo Horde::link(Util::addParameter(Horde::selfUrl(true), 'p', 1)) . Horde::img('download.png', '', '', $registry->getImageDir('horde')) . ' ' . sprintf(_("Download revision %s"), $r) . '</a>';
+ echo Horde::link(Horde_Util::addParameter(Horde::selfUrl(true), 'p', 1)) . Horde::img('download.png', '', '', $registry->getImageDir('horde')) . ' ' . sprintf(_("Download revision %s"), $r) . '</a>';
}
?>
</div>
echo "<meta http-equiv=\"refresh\" content=\"$refresh_time;url=$refresh_url\">\n";
}
-if (Util::nonInputVar('js_vars')) {
+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";
}
<?php echo Horde::stylesheetLink('chora') ?>
</head>
-<body<?php if ($bc = Util::nonInputVar('bodyClass')) echo ' class="' . $bc . '"' ?><?php if ($bi = Util::nonInputVar('bodyId')) echo ' id="' . $bi . '"'; ?>>
+<body<?php if ($bc = Horde_Util::nonInputVar('bodyClass')) echo ' class="' . $bc . '"' ?><?php if ($bi = Horde_Util::nonInputVar('bodyId')) echo ' id="' . $bi . '"'; ?>>
<td>
<form method="get" action="diff.php">
<?php echo Chora::formInputs() ?>
- <input type="hidden" name="f" value="<?php echo htmlspecialchars(Util::getFormData('f')) ?>" />
- <input type="hidden" name="r1" value="<?php echo htmlspecialchars(Util::getFormData('r1')) ?>" />
- <input type="hidden" name="r2" value="<?php echo htmlspecialchars(Util::getFormData('r2')) ?>" />
+ <input type="hidden" name="f" value="<?php echo htmlspecialchars(Horde_Util::getFormData('f')) ?>" />
+ <input type="hidden" name="r1" value="<?php echo htmlspecialchars(Horde_Util::getFormData('r1')) ?>" />
+ <input type="hidden" name="r2" value="<?php echo htmlspecialchars(Horde_Util::getFormData('r2')) ?>" />
<?php echo _("Download diff as: ") ?>
<select name="t" onchange="this.form.submit()">
<?php if (isset($diff_types['unified'])): ?>
<form method="get" action="browsedir.php">
<?php echo _("View Branch:") ?>
<?php echo Chora::formInputs() ?>
- <input type="hidden" name="f" value="<?php echo htmlspecialchars(Util::getFormData('f')) ?>" />
+ <input type="hidden" name="f" value="<?php echo htmlspecialchars(Horde_Util::getFormData('f')) ?>" />
<select name="rev" onchange="this.form.submit()">
<?php foreach (array_map('htmlspecialchars', $branches) as $val): ?>
<option value="<?php echo $val ?>"<?php echo ($val == $rev) ? ' selected="selected"' : '' ?>><?php echo $val ?></option>
</tbody>
</table>
-<?php if ($fl->revisionCount() > 100 && !Util::getFormData('all')): ?>
+<?php if ($fl->revisionCount() > 100 && !Horde_Util::getFormData('all')): ?>
<table class="options" cellspacing="0">
<tr>
<td>
<?php printf(_("Only showing the 100 latest revisions. %sShow all revisions?</a> (may take a while)."),
- Horde::link(Util::addParameter(Horde::selfUrl(true), 'all', 1))) ?>
+ Horde::link(Horde_Util::addParameter(Horde::selfUrl(true), 'all', 1))) ?>
</td>
</tr>
</table>
<td>
<form method="get" action="diff.php">
<?php echo Chora::formInputs() ?>
- <input type="hidden" name="f" value="<?php echo htmlspecialchars(Util::getFormData('f')) ?>" />
+ <input type="hidden" name="f" value="<?php echo htmlspecialchars(Horde_Util::getFormData('f')) ?>" />
<?php printf(_("Show diffs between %s and %s"),
'<input type="text" size="6" name="r1" value="' . $diffValueLeft . '" />',
'<input type="text" size="6" name="r2" value="' . $diffValueRight . '" />') ?>
<td>
<form method="get" action="browsefile.php">
<?php echo Chora::formInputs() ?>
- <input type="hidden" name="f" value="<?php echo htmlspecialchars(Util::getFormData('f')) ?>" />
+ <input type="hidden" name="f" value="<?php echo htmlspecialchars(Horde_Util::getFormData('f')) ?>" />
<?php echo _("Show Branch:") ?>
<select name="onb" onchange="this.form.submit()">
<option value="0"<?php if (!isset($onb) || !$onb) echo ' selected="selected"' ?>><?php echo _("All Branches") ?></option>
require_once dirname(__FILE__) . '/lib/base.load.php';
include_once HORDE_BASE . '/lib/core.php';
-/* We should have loaded the String class, from the Horde_Util
- package, in core.php. If String:: isn't defined, then we're not
+/* We should have loaded the Horde_String class, from the Horde_Util
+ package, in core.php. If Horde_String:: isn't defined, then we're not
finding some critical libraries. */
-if (!class_exists('String')) {
+if (!class_exists('Horde_String')) {
echo '<br /><h2 style="color:red">The Horde_Util package was not found. If PHP\'s error_reporting setting is high enough and display_errors is on, there should be error messages printed above that may help you in debugging the problem. If you are simply missing these files, then you need to get the <a href="http://cvs.horde.org/cvs.php/framework">framework</a> module from <a href="http://www.horde.org/source/">Horde CVS</a>, and install the packages in it with the install-packages.php script.</h2>';
exit;
}
@define('CRUMB_BASE', dirname(__FILE__));
require_once CRUMB_BASE . '/lib/base.php';
-require_once 'Horde/Variables.php';
require_once 'Horde/Form.php';
require_once 'Horde/Form/Renderer.php';
require_once CRUMB_BASE . '/lib/Forms/AddClient.php';
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$formname = $vars->get('formname');
$addform = new Horde_Form_AddClient($vars);
require_once 'Horde/Form.php';
require_once 'Horde/Form/Renderer.php';
require_once CRUMB_BASE . '/lib/Forms/ContactSearch.php';
-require_once 'Horde/Variables.php';
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$searchform = new Horde_Form_ContactSearch($vars);
<?php echo Horde::stylesheetLink('skeleton') ?>
</head>
-<body<?php if ($bc = Util::nonInputVar('bodyClass')) echo ' class="' . $bc . '"' ?><?php if ($bi = Util::nonInputVar('bodyId')) echo ' id="' . $bi . '"'; ?>>
+<body<?php if ($bc = Horde_Util::nonInputVar('bodyClass')) echo ' class="' . $bc . '"' ?><?php if ($bi = Horde_Util::nonInputVar('bodyId')) echo ' id="' . $bi . '"'; ?>>
require_once 'Horde/Loader.php';
// Block to load
-$block_id = Util::getFormData('block');
+$block_id = Horde_Util::getFormData('block');
list($app, $name) = explode(':', $block_id);
$block_data = array();
-$block = Horde_Block_Collection::getBlock($app, $name, Util::getFormData('defaults'));
+$block = Horde_Block_Collection::getBlock($app, $name, Horde_Util::getFormData('defaults'));
if ($block instanceof PEAR_Error) {
$block_data['title'] = $block->getMessage();
$block_data['content'] = $block->getDebugInfo();
require_once 'Horde/Loader.php';
// Block to load
-$block_id = Util::getFormData('block');
+$block_id = Horde_Util::getFormData('block');
list($app, $name) = explode(':', $block_id);
// Load collection
$params = $blocks->getParams($app, $name);
if (empty($params) ||
!$blocks->isEditable($app, $name)) {
- echo '<script type="text/javascript">noParams("' . Util::getFormData('widget') . '", "' . _("This block has no special parameters.") . '");</script>';
+ echo '<script type="text/javascript">noParams("' . Horde_Util::getFormData('widget') . '", "' . _("This block has no special parameters.") . '");</script>';
} else {
$block = &$blocks->getBlock($app, $name);
- $defaults = Util::getFormData('defaults');
+ $defaults = Horde_Util::getFormData('defaults');
if (empty($defaults)) {
foreach ($params as $key => $val) {
$defaults[$key] = $val;
}
$layout = array();
-$params = Util::getPost('params');
+$params = Horde_Util::getPost('params');
foreach ($_POST as $column => $rows) {
if (substr($column, 0, 11) != 'widget_col_') {
continue;
<h1 class="header"><?php echo htmlspecialchars($blocks->getName($app, $name)) ?></h1>
<form action="<?php echo Horde::selfUrl() ?>#block" method="post" id="blockform" name="blockform">
-<?php Util::pformInput() ?>
+<?php Horde_Util::pformInput() ?>
<input type="hidden" name="action" value="save" />
-<input type="hidden" name="block" value="<?php echo Util::getFormData('block') ?>" />
-<input type="hidden" name="widget" value="<?php echo Util::getFormData('widget') ?>" />
+<input type="hidden" name="block" value="<?php echo Horde_Util::getFormData('block') ?>" />
+<input type="hidden" name="widget" value="<?php echo Horde_Util::getFormData('widget') ?>" />
<table style="width: 100%; border-collapse: collapse;">
<?php if ($block->updateable): ?>
<tr>
@define('FIMA_BASE', dirname(__FILE__));
require_once FIMA_BASE . '/lib/base.php';
require_once FIMA_BASE . '/lib/Forms/account.php';
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
/* Redirect to the account list if no action has been requested. */
$actionID = $vars->get('actionID');
if (!isset($account) || !isset($account['account_id'])) {
$notification->push(_("Account not found."), 'horde.error');
} else {
- $vars = new Variables($account);
+ $vars = new Horde_Variables($account);
$vars->set('actionID', 'save_account');
$vars->set('number_new', $vars->get('number'));
$form = new Fima_AccountForm($vars, sprintf(_("Edit: %s"), trim($account['number'] . ' ' . $account['name'])), $share->hasPermission(Auth::getAuth(), PERMS_DELETE));
if ($vars->get('submitbutton') == _("Delete this account")) {
/* Redirect to the delete form. */
$account_id = $vars->get('account_id');
- header('Location: ' . Util::addParameter(Horde::applicationUrl('account.php', true), array('account' => $account_id, 'actionID' => 'delete_account'), null, false));
+ header('Location: ' . Horde_Util::addParameter(Horde::applicationUrl('account.php', true), array('account' => $account_id, 'actionID' => 'delete_account'), null, false));
exit;
}
$notification->push(sprintf(_("Saved %s."), trim($info['number_new'] . ' ' . $info['name'])), 'horde.success');
/* Return to the accounts. */
if ($vars->get('submitbutton') == _("Save and New")) {
- header('Location: ' . Util::addParameter(Horde::applicationUrl('account.php', true), array('account' => $vars->get('parent_id'), 'actionID' => 'add_account'), null, false));
+ header('Location: ' . Horde_Util::addParameter(Horde::applicationUrl('account.php', true), array('account' => $vars->get('parent_id'), 'actionID' => 'add_account'), null, false));
} else {
header('Location: ' . Horde::applicationUrl('accounts.php', true));
}
if (!isset($account) || !isset($account['account_id'])) {
$notification->push(_("Account not found."), 'horde.error');
} else {
- $vars = new Variables($account);
+ $vars = new Horde_Variables($account);
$vars->set('actionID', 'purge_account');
$vars->set('dssubaccounts', array('type' => 'none', 'account' => $account_id));
$vars->set('dspostings', array('type' => 'delete', 'account' => $account_id));
if ($vars->get('submitbutton') == _("Edit this account")) {
/* Redirect to the edit form. */
$account_id = $vars->get('account_id');
- header('Location: ' . Util::addParameter(Horde::applicationUrl('account.php', true), array('account' => $account_id, 'actionID' => 'modify_account'), null, false));
+ header('Location: ' . Horde_Util::addParameter(Horde::applicationUrl('account.php', true), array('account' => $account_id, 'actionID' => 'modify_account'), null, false));
exit;
}
}
/* Run through the action handlers. */
-$actionID = Util::getFormData('actionID');
+$actionID = Horde_Util::getFormData('actionID');
switch ($actionID) {
case 'delete_all':
if (!$share->hasPermission(Auth::getAuth(), PERMS_DELETE)) {
/* Prepare account folder structure */
$account_url = Horde::applicationUrl('account.php');;
-$view_url = Util::addParameter(Horde::applicationUrl('postings.php'), 'actionID', 'search_postings');
+$view_url = Horde_Util::addParameter(Horde::applicationUrl('postings.php'), 'actionID', 'search_postings');
$accounts = array();
$accounts['root'] = array('account_id' => 'root', 'owner' => $ledger, 'number' => '', 'type' => 'root', 'name' => $share->get('name'), 'desc' => '', 'icon' => 'accounts.png', 'closed' => false, 'expanded' => true, 'parent_id' => null);
$types = Fima::getAccountTypes();
foreach ($types as $typeId => $typeLabel) {
- $accounts[$typeId] = array('account_id' => $typeId, 'owner' => $ledger, 'number' => '', 'type' => $typeId, 'name' => $typeLabel, 'desc' => '', 'icon' => $typeId . '.png', 'closed' => false, 'expanded' => true, 'parent_id' => 'root', 'view_link' => Util::addParameter($view_url, 'search_type', $typeId), 'add_link' => Util::addParameter($account_url, array('account' => $typeId, 'actionID' => 'add_account')));
+ $accounts[$typeId] = array('account_id' => $typeId, 'owner' => $ledger, 'number' => '', 'type' => $typeId, 'name' => $typeLabel, 'desc' => '', 'icon' => $typeId . '.png', 'closed' => false, 'expanded' => true, 'parent_id' => 'root', 'view_link' => Horde_Util::addParameter($view_url, 'search_type', $typeId), 'add_link' => Horde_Util::addParameter($account_url, array('account' => $typeId, 'actionID' => 'add_account')));
}
/* Get accounts. */
foreach ($accountlist as $accountId => $account) {
$accounts[$accountId] = $account;
- $accounts[$accountId]['view_link'] = Util::addParameter($view_url, $account['type'] == FIMA_ACCOUNTTYPE_ASSET ? 'search_asset' : 'search_account', $account['account_id']);
- $account_url_account = Util::addParameter($account_url, 'account', $account['account_id']);
- $accounts[$accountId]['add_link'] = Util::addParameter($account_url_account, 'actionID', 'add_account');
- $accounts[$accountId]['edit_link'] = Util::addParameter($account_url_account, 'actionID', 'modify_account');
- $accounts[$accountId]['delete_link'] = Util::addParameter($account_url_account, 'actionID', 'delete_account');
+ $accounts[$accountId]['view_link'] = Horde_Util::addParameter($view_url, $account['type'] == FIMA_ACCOUNTTYPE_ASSET ? 'search_asset' : 'search_account', $account['account_id']);
+ $account_url_account = Horde_Util::addParameter($account_url, 'account', $account['account_id']);
+ $accounts[$accountId]['add_link'] = Horde_Util::addParameter($account_url_account, 'actionID', 'add_account');
+ $accounts[$accountId]['edit_link'] = Horde_Util::addParameter($account_url_account, 'actionID', 'modify_account');
+ $accounts[$accountId]['delete_link'] = Horde_Util::addParameter($account_url_account, 'actionID', 'delete_account');
if ($account['parent_id'] !== null && isset($accounts[$account['parent_id']])) {
unset($accounts[$accountId]['add_link']);
}
/* Print. */
-$print_view = (bool)Util::getFormData('print');
+$print_view = (bool)Horde_Util::getFormData('print');
if (!$print_view) {
Horde::addScriptFile('popup.js', 'horde', true);
- $print_link = Horde::applicationUrl(Util::addParameter('accounts.php', array('print' => 1)));
+ $print_link = Horde::applicationUrl(Horde_Util::addParameter('accounts.php', array('print' => 1)));
}
Horde::addScriptFile('tables.js', 'horde', true);
/* Initial values. */
$param = array('time_fields' => $time_fields,
'file_types' => $file_types);
-$import_format = Util::getFormData('import_format', '');
-$import_step = Util::getFormData('import_step', 0) + 1;
+$import_format = Horde_Util::getFormData('import_format', '');
+$import_step = Horde_Util::getFormData('import_step', 0) + 1;
$next_step = IMPORT_FILE;
-$actionID = Util::getFormData('actionID');
+$actionID = Horde_Util::getFormData('actionID');
$error = false;
/* Loop through the action handlers. */
$row[$key] = Fima::convertValueToAmount($value);
break;
case 'eo':
- case 'desc':
- $row[$key] = String::convertCharset($value, NLS::getCharset(), $params['charset']);
+ case 'desc':
+ $row[$key] = Horde_String::convertCharset($value, NLS::getCharset(), $params['charset']);
break;
default:
break;
break;
}
- switch (Util::getFormData('exportID')) {
+ switch (Horde_Util::getFormData('exportID')) {
case EXPORT_CSV:
$csv = &Horde_Data::singleton('csv');
$csv->exportFile(_("postings.csv"), $data, true);
}
$_SESSION['import_data']['target'] = $ledger;
- $_SESSION['import_data']['purge'] = Util::getFormData('purge');
+ $_SESSION['import_data']['purge'] = Horde_Util::getFormData('purge');
break;
}
exit;
}
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$form = new Fima_CreateLedgerForm($vars);
// Execute if the form is valid.
exit;
}
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$ledger_id = $vars->get('l');
if ($ledger_id == Auth::getAuth()) {
$notification->push(_("This ledger cannot be deleted."), 'horde.warning');
$form = new Fima_DeleteLedgerForm($vars, $ledger);
// Execute if the form is valid (must pass with POST variables only).
-if ($form->validate(new Variables($_POST))) {
+if ($form->validate(new Horde_Variables($_POST))) {
$result = $form->execute();
if (is_a($result, 'PEAR_Error')) {
$notification->push($result, 'horde.error');
exit;
}
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$ledger = $fima_shares->getShare($vars->get('l'));
if (is_a($ledger, 'PEAR_Error')) {
$notification->push($ledger, 'horde.error');
global $registry;
$menus = array(
- array('add', _("Add Postings"), 'add.png', Util::addParameter(Horde::applicationUrl('postings.php'), 'actionID', 'add_postings')),
+ array('add', _("Add Postings"), 'add.png', Horde_Util::addParameter(Horde::applicationUrl('postings.php'), 'actionID', 'add_postings')),
array('search', _("Search"), 'search.png', Horde::applicationUrl('search.php'), $registry->getImageDir('horde')),
array('accounts', _("Accounts"), 'accounts.png', Horde::applicationUrl('accounts.php')),
array('reports', _("Reports"), 'report.png', Horde::applicationUrl('report.php')),
'owner' => $row['account_owner'],
'number' => sprintf('%\'04d', $row['account_number']),
'type' => $row['account_type'],
- 'name' => String::convertCharset($row['account_name'], $this->_params['charset']),
+ 'name' => Horde_String::convertCharset($row['account_name'], $this->_params['charset']),
'eo' => $row['account_eo'],
- 'desc' => String::convertCharset($row['account_desc'], $this->_params['charset']),
+ 'desc' => Horde_String::convertCharset($row['account_desc'], $this->_params['charset']),
'closed' => $row['account_closed'],
'label' => trim($row['account_number'] . ' ' .
(($parent === null) ? '' : $parent['name'] . ' - ') .
- String::convertCharset($row['account_name'], $this->_params['charset'])),
+ Horde_String::convertCharset($row['account_name'], $this->_params['charset'])),
'parent_id' => ($parent === null) ? null : $parent['account_id'],
'parent_number' => ($parent === null) ? '' : $parent['number'],
'parent_name' => ($parent === null) ? '' : $parent['name']);
$this->_ledger,
sprintf('%\'04d', $number),
$type,
- String::convertCharset($name, NLS::getCharset(), $this->_params['charset']),
+ Horde_String::convertCharset($name, NLS::getCharset(), $this->_params['charset']),
(int)(bool)$eo,
- String::convertCharset($desc, NLS::getCharset(), $this->_params['charset']),
+ Horde_String::convertCharset($desc, 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,
- String::convertCharset($name, NLS::getCharset(), $this->_params['charset']),
+ Horde_String::convertCharset($name, NLS::getCharset(), $this->_params['charset']),
(int)(bool)$eo,
- String::convertCharset($desc, NLS::getCharset(), $this->_params['charset']),
+ Horde_String::convertCharset($desc, NLS::getCharset(), $this->_params['charset']),
(int)(bool)$closed,
$this->_ledger,
$accountId);
'date' => $row['posting_date'],
'asset' => $row['posting_asset'],
'account' => $row['posting_account'],
- 'desc' => String::convertCharset($row['posting_desc'], $this->_params['charset']),
+ 'desc' => Horde_String::convertCharset($row['posting_desc'], $this->_params['charset']),
'amount' => $row['posting_amount'],
'eo' => (int)(bool)$row['posting_eo']);
}
$account,
(int)(bool)$eo,
(float)$amount,
- String::convertCharset($desc, NLS::getCharset(), $this->_params['charset']));
+ Horde_String::convertCharset($desc, 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,
- String::convertCharset($desc, NLS::getCharset(), $this->_params['charset']),
+ Horde_String::convertCharset($desc, NLS::getCharset(), $this->_params['charset']),
$this->_ledger,
$postingId);
if (!$GLOBALS['display_ledgers']) {
$GLOBALS['display_ledgers'] = array();
}
- if (($ledgerId = Util::getFormData('display_ledger')) !== null) {
+ if (($ledgerId = Horde_Util::getFormData('display_ledger')) !== null) {
if (is_array($ledgerId)) {
$GLOBALS['display_ledgers'] = $ledgerId;
} else {
$GLOBALS['prefs']->setValue('display_ledgers', serialize($GLOBALS['display_ledgers']));
/* Update active ledger. */
- if (($changeledger = Util::getFormData('changeledger')) !== null) {
+ if (($changeledger = Horde_Util::getFormData('changeledger')) !== null) {
$GLOBALS['prefs']->setValue('active_ledger', $changeledger);
}
}
{
global $conf, $registry, $browser, $print_link;
- $actionID = Util::getFormData('actionID');
+ $actionID = Horde_Util::getFormData('actionID');
require_once 'Horde/Menu.php';
$menu = new Menu(HORDE_MENU_MASK_ALL);
$menu->add(Horde::applicationUrl('postings.php'), _("_List Postings"), 'list.png', null, null, null, (basename($_SERVER['PHP_SELF']) == 'index.php' && basename(dirname($_SERVER['PHP_SELF'])) != 'ledgers') ? 'current' : ($actionID === null ? null : '__noselection'));
- $menu->add(Util::addParameter(Horde::applicationUrl('postings.php'), 'actionID', 'add_postings'), _("Add _Postings"), 'add.png', null, null, null, $actionID == 'add_postings' ? 'current' : '__noselection');
+ $menu->add(Horde_Util::addParameter(Horde::applicationUrl('postings.php'), 'actionID', 'add_postings'), _("Add _Postings"), 'add.png', null, null, null, $actionID == 'add_postings' ? 'current' : '__noselection');
$menu->add(Horde::applicationUrl('search.php'), _("Search"), 'search.png', $registry->getImageDir('horde'));
$menu->add(Horde::applicationUrl('accounts.php'), _("_Accounts"), 'accounts.png');
* @package Fima
*/
-/** Variables */
-require_once 'Horde/Variables.php';
-
/** Horde_Form */
require_once 'Horde/Form.php';
* @package Fima
*/
-/** Variables */
-require_once 'Horde/Variables.php';
-
/** Horde_Form */
require_once 'Horde/Form.php';
* @package Fima
*/
-/** Variables */
-require_once 'Horde/Variables.php';
-
/** Horde_Form */
require_once 'Horde/Form.php';
* @package Fima
*/
-/** Variables */
-require_once 'Horde/Variables.php';
-
/** Horde_Form */
require_once 'Horde/Form.php';
require_once HORDE_BASE . '/lib/core.php';
// Registry.
-$session_control = Util::nonInputVar('session_control');
+$session_control = Horde_Util::nonInputVar('session_control');
if ($session_control == 'none') {
$registry = &Registry::singleton(HORDE_SESSION_NONE);
} elseif ($session_control == 'readonly') {
{
global $prefs;
- $active_ledger = Util::getFormData('active_ledger');
+ $active_ledger = Horde_Util::getFormData('active_ledger');
if (!is_null($active_ledger)) {
$ledgers = Fima::listLedgers();
if (is_array($ledgers) && array_key_exists($active_ledger, $ledgers)) {
{
global $prefs;
- $period = Util::getFormData('closedperiod');
+ $period = Horde_Util::getFormData('closedperiod');
if ((int)$period['year'] > 0 && (int)$period['month'] > 0) {
$period = mktime(0, 0, 0, $period['month'] + 1, 0, $period['year']);
} else {
$updated = true;
return $updated;
-}
\ No newline at end of file
+}
@define('FIMA_BASE', dirname(__FILE__));
require_once FIMA_BASE . '/lib/base.php';
-require_once 'Horde/Variables.php';
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
/* Get the current action ID. */
-$actionID = Util::getFormData('actionID');
+$actionID = Horde_Util::getFormData('actionID');
/* Change posting type. */
-if (($postingtype = Util::getFormData('postingtype')) !== null) {
+if (($postingtype = Horde_Util::getFormData('postingtype')) !== null) {
$postingtypeold = $prefs->getValue('active_postingtype');
$prefs->setValue('active_postingtype', $postingtype);
}
/* Create page array. */
$pageOb = array();
$pageOb['url'] = Horde::applicationUrl('postings.php');
-if (($pageOb['page'] = Util::getFormData('page')) === null) {
+if (($pageOb['page'] = Horde_Util::getFormData('page')) === null) {
$pageOb['page'] = $prefs->getValue('startpage');
}
$pageOb['mode'] = 'list';
switch ($actionID) {
case 'change_sort':
/* Sort out the sorting values. */
- if (($sortby = Util::getFormData('sortby')) !== null) {
+ if (($sortby = Horde_Util::getFormData('sortby')) !== null) {
$prefs->setValue('sortby', $sortby);
}
- if (($sortdir = Util::getFormData('sortdir')) !== null) {
+ if (($sortdir = Horde_Util::getFormData('sortdir')) !== null) {
$prefs->setValue('sortdir', $sortdir);
}
break;
case 'search_postings':
/* If we're searching, only list those postings that match the search result. */
- $_SESSION['fima_search'] = array('type' => Util::getFormData('search_type'),
- 'date_start' => Util::getFormData('search_date_start'),
- 'date_end' => Util::getFormData('search_date_end'),
- 'asset' => Util::getFormData('search_asset'),
- 'account' => Util::getFormData('search_account'),
- 'desc' => Util::getFormData('search_desc'),
- 'amount_start' => Util::getFormData('search_amount_start'),
- 'amount_end' => Util::getFormData('search_amount_end'),
- 'eo' => Util::getFormData('search_eo'));
+ $_SESSION['fima_search'] = array('type' => Horde_Util::getFormData('search_type'),
+ 'date_start' => Horde_Util::getFormData('search_date_start'),
+ 'date_end' => Horde_Util::getFormData('search_date_end'),
+ 'asset' => Horde_Util::getFormData('search_asset'),
+ 'account' => Horde_Util::getFormData('search_account'),
+ 'desc' => Horde_Util::getFormData('search_desc'),
+ 'amount_start' => Horde_Util::getFormData('search_amount_start'),
+ 'amount_end' => Horde_Util::getFormData('search_amount_end'),
+ 'eo' => Horde_Util::getFormData('search_eo'));
/* Build filters. */
if ($_SESSION['fima_search']['type'] !== null) {
case 'add_postings':
$pageOb['mode'] = 'edit';
- $pageOb['url'] = Util::addParameter($pageOb['url'], 'actionID', 'add_postings');
+ $pageOb['url'] = Horde_Util::addParameter($pageOb['url'], 'actionID', 'add_postings');
$actionID = 'save_postings';
$postings = array();
$title = _("Add Postings");
break;
case 'edit_postings':
- $postingset = Util::getFormData('indices');
+ $postingset = Horde_Util::getFormData('indices');
if ($postingset !== null) {
$pageOb['mode'] = 'edit';
- $pageOb['url'] = Util::addParameter($pageOb['url'], 'actionID', 'add_postings');
+ $pageOb['url'] = Horde_Util::addParameter($pageOb['url'], 'actionID', 'add_postings');
$actionID = 'save_postings';
$filters[] = array('id', $postingset);
$title = _("Edit Postings");
break;
case 'shift_postings':
- $postingset = Util::getFormData('indices');
+ $postingset = Horde_Util::getFormData('indices');
if ($postingset !== null) {
$pageOb['mode'] = 'shift';
$actionID = 'update_postings';
case 'save_postings':
/* Get the form values. */
- $postingset = Util::getFormData('posting_id');
+ $postingset = Horde_Util::getFormData('posting_id');
$share = &$GLOBALS['fima_shares']->getShare($ledger);
if (!$share->hasPermission(Auth::getAuth(), PERMS_EDIT)) {
$posting_owner = $ledger;
$posting_type = $prefs->getValue('active_postingtype');
- $posting_dates = Util::getFormData('date');
- $posting_assets = Util::getFormData('asset');
- $posting_accounts = Util::getFormData('account');
- $posting_eos = Util::getFormData('eo');
- $posting_amounts = Util::getFormData('amount');
- $posting_descs = Util::getFormData('desc');
+ $posting_dates = Horde_Util::getFormData('date');
+ $posting_assets = Horde_Util::getFormData('asset');
+ $posting_accounts = Horde_Util::getFormData('account');
+ $posting_eos = Horde_Util::getFormData('eo');
+ $posting_amounts = Horde_Util::getFormData('amount');
+ $posting_descs = Horde_Util::getFormData('desc');
$postings = array();
$savecount = 0;
case 'delete_postings':
/* Delete postings if we're provided with valid account IDs. */
- $postingset = Util::getFormData('indices');
+ $postingset = Horde_Util::getFormData('indices');
$share = &$GLOBALS['fima_shares']->getShare($ledger);
if (!$share->hasPermission(Auth::getAuth(), PERMS_DELETE)) {
case 'update_postings':
/* Get the form values. */
- $postingset = Util::getFormData('posting_id');
+ $postingset = Horde_Util::getFormData('posting_id');
$share = &$GLOBALS['fima_shares']->getShare($ledger);
if (!$share->hasPermission(Auth::getAuth(), PERMS_EDIT)) {
header('Location: ' . Horde::applicationUrl('postings.php', true));
exit;
} elseif ($postingset !== null) {
- $posting_type = Util::getFormData('type');
- $posting_asset = Util::getFormData('asset');
- $posting_account = Util::getFormData('account');
+ $posting_type = Horde_Util::getFormData('type');
+ $posting_asset = Horde_Util::getFormData('asset');
+ $posting_account = Horde_Util::getFormData('account');
if ($posting_type || $posting_asset || $posting_account) {
$storage = &Fima_Driver::singleton($ledger);
$notification->push(sprintf(_("Access denied transfering postings in %s."), $share->get('name')), 'horde.error');
header('Location: ' . Horde::applicationUrl('postings.php', true));
exit;
- } elseif (!$share->hasPermission(Auth::getAuth(), PERMS_DELETE) && (!Util::getFormData('keep') || Util::getFormData('delete'))) {
+ } elseif (!$share->hasPermission(Auth::getAuth(), PERMS_DELETE) && (!Horde_Util::getFormData('keep') || Horde_Util::getFormData('delete'))) {
$notification->push(sprintf(_("Access denied transfering postings in %s."), $share->get('name')), 'horde.error');
header('Location: ' . Horde::applicationUrl('postings.php', true));
exit;
} else {
- $type_from = Util::getFormData('type_from');
- $period_from = Util::getFormData('period_from');
- $keep = Util::getFormData('keep');
- $summarize = Util::getFormData('summarize');
- $summarize_account = Util::getFormData('summarize_post_account');
- $type_to = Util::getFormData('type_to');
- $period_to = Util::getFormData('period_to');
- $delete = Util::getFormData('delete');
+ $type_from = Horde_Util::getFormData('type_from');
+ $period_from = Horde_Util::getFormData('period_from');
+ $keep = Horde_Util::getFormData('keep');
+ $summarize = Horde_Util::getFormData('summarize');
+ $summarize_account = Horde_Util::getFormData('summarize_post_account');
+ $type_to = Horde_Util::getFormData('type_to');
+ $period_to = Horde_Util::getFormData('period_to');
+ $delete = Horde_Util::getFormData('delete');
$period_from_start = mktime(0, 0, 0, ($period_from['month'] === '') ? 1 : $period_from['month'], 1, (int)$period_from['year']);
$period_from_end = mktime(0, 0, 0, ($period_from['month'] === '') ? 12 : $period_from['month'] + 1, ($period_from['month'] === '') ? 31 : 0, (int)$period_from['year']);
}
/* Print. */
-$print_view = (bool)Util::getFormData('print');
+$print_view = (bool)Horde_Util::getFormData('print');
if (!$print_view && $pageOb['mode'] == 'list') {
Horde::addScriptFile('popup.js', 'horde', true);
- $print_link = Util::addParameter(Horde::applicationUrl('postings.php'), array('print' => 1));
+ $print_link = Horde_Util::addParameter(Horde::applicationUrl('postings.php'), array('print' => 1));
}
/* Filters. */
if ($pageOb['mode'] == 'list' || $pageOb['mode'] == 'edit') {
$sortby = $prefs->getValue('sortby');
$sortdir = $prefs->getValue('sortdir');
- $sorturl = Util::addParameter($pageOb['url'], 'sortdir', ($sortdir) ? 0 : 1);
+ $sorturl = Horde_Util::addParameter($pageOb['url'], 'sortdir', ($sortdir) ? 0 : 1);
}
/* Generate page links. */
$pageOb['pages_first'] = Horde::img('nav/first-grey.png', null, null, $graphicsdir);
$pageOb['pages_prev'] = Horde::img('nav/left-grey.png', null, null, $graphicsdir);
} else {
- $first_url = Util::addParameter($pageOb['url'], 'page', 1);
+ $first_url = Horde_Util::addParameter($pageOb['url'], 'page', 1);
$pageOb['pages_first'] = Horde::link($first_url, _("First Page")) . Horde::img('nav/first.png', '<<', null, $graphicsdir) . '</a>';
- $prev_url = Util::addParameter($pageOb['url'], 'page', $pageOb['page'] - 1);
+ $prev_url = Horde_Util::addParameter($pageOb['url'], 'page', $pageOb['page'] - 1);
$pageOb['pages_prev'] = Horde::link($prev_url, _("Previous Page"), '', '', '', '', '', array('id' => 'prev')) . Horde::img('nav/left.png', '<', null, $graphicsdir) . '</a>';
}
if ($pageOb['page'] == $pageOb['page_count']) {
$pageOb['pages_last'] = Horde::img('nav/last-grey.png', null, null, $graphicsdir);
$pageOb['pages_next'] = Horde::img('nav/right-grey.png', null, null, $graphicsdir);
} else {
- $next_url = Util::addParameter($pageOb['url'], 'page', $pageOb['page'] + 1);
+ $next_url = Horde_Util::addParameter($pageOb['url'], 'page', $pageOb['page'] + 1);
$pageOb['pages_next'] = Horde::link($next_url, _("Next Page"), '', '', '', '', '', array('id' => 'next')) . Horde::img('nav/right.png', '>', null, $graphicsdir) . '</a>';
- $last_url = Util::addParameter($pageOb['url'], 'page', $pageOb['page_count']);
+ $last_url = Horde_Util::addParameter($pageOb['url'], 'page', $pageOb['page_count']);
$pageOb['pages_last'] = Horde::link($last_url, _("Last Page")) . Horde::img('nav/last.png', '>>', null, $graphicsdir) . '</a>';
}
}
require_once FIMA_BASE . '/config/report.php';
require_once FIMA_BASE . '/lib/Report.php';
-$actionID = Util::getFormData('actionID');
+$actionID = Horde_Util::getFormData('actionID');
switch ($actionID) {
case 'open_report':
- $_SESSION['fima_report'] = array('report_id' => Util::getFormData('report_id'),
- 'display' => Util::getFormData('display'),
- 'posting_account' => Util::getFormData('posting_account'),
- 'period_start' => Util::getFormData('period_start'),
- 'period_end' => Util::getFormData('period_end'),
- 'reference_start' => Util::getFormData('reference_start'),
- 'reference_end' => Util::getFormData('reference_end'),
- 'cumulate' => Util::getFormData('cumulate'),
- 'nullrows' => Util::getFormData('nullrows'),
- 'subaccounts' => Util::getFormData('subaccounts'),
- 'yearly' => Util::getFormData('yearly'),
- 'graph' => Util::getFormData('graph'));
+ $_SESSION['fima_report'] = array('report_id' => Horde_Util::getFormData('report_id'),
+ 'display' => Horde_Util::getFormData('display'),
+ 'posting_account' => Horde_Util::getFormData('posting_account'),
+ 'period_start' => Horde_Util::getFormData('period_start'),
+ 'period_end' => Horde_Util::getFormData('period_end'),
+ 'reference_start' => Horde_Util::getFormData('reference_start'),
+ 'reference_end' => Horde_Util::getFormData('reference_end'),
+ 'cumulate' => Horde_Util::getFormData('cumulate'),
+ 'nullrows' => Horde_Util::getFormData('nullrows'),
+ 'subaccounts' => Horde_Util::getFormData('subaccounts'),
+ 'yearly' => Horde_Util::getFormData('yearly'),
+ 'graph' => Horde_Util::getFormData('graph'));
break;
case 'clear_report':
unset($_SESSION['fima_report']);
$params['graph'] = 0;
}
-$params['out'] = Util::getFormData('out');
-$params['sortby'] = Util::getFormData('sortby');
-$params['sortdir'] = Util::getFormData('sortdir');
+$params['out'] = Horde_Util::getFormData('out');
+$params['sortby'] = Horde_Util::getFormData('sortby');
+$params['sortdir'] = Horde_Util::getFormData('sortdir');
/* Get posting types and output displays. */
$types = Fima::getPostingTypes();
$params['title'] = $_reports[$params['report_id']];
/* Build report url. */
- $params['url'] = Util::addParameter(Horde::applicationUrl('report.php'), 'actionID', 'display_report');
+ $params['url'] = Horde_Util::addParameter(Horde::applicationUrl('report.php'), 'actionID', 'display_report');
/* Add params from options. */
$params['graphsize'] = $prefs->getValue('report_graphsize');
require_once FIMA_BASE . '/lib/base.php';
/* Get the current action ID. */
-$actionID = Util::getFormData('actionID');
+$actionID = Horde_Util::getFormData('actionID');
switch ($actionID) {
case 'clear_search':
<h1 class="header"><?php echo htmlspecialchars($share->get('name')) ?></h1>
<form method="post" name="accounts" action="accounts.php">
-<?php Util::pformInput() ?>
+<?php Horde_Util::pformInput() ?>
<input type="hidden" name="actionID" value="" />
<div id="accountList">
<?php echo Horde::stylesheetLink('fima', empty($print_view) ? '' : 'print') ?>
</head>
-<body<?php if ($bc = Util::nonInputVar('bodyClass')) echo ' class="' . $bc . '"' ?><?php if ($bi = Util::nonInputVar('bodyId')) echo ' id="' . $bi . '"'; ?>>
+<body<?php if ($bc = Horde_Util::nonInputVar('bodyClass')) echo ' class="' . $bc . '"' ?><?php if ($bi = Horde_Util::nonInputVar('bodyId')) echo ' id="' . $bi . '"'; ?>>
<form method="post" name="export" action="<?php echo Horde::downloadUrl(_("postings.csv"), null, Horde::applicationUrl('data.php')) ?>">
-<?php echo Util::formInput() ?>
+<?php echo Horde_Util::formInput() ?>
<input type="hidden" name="actionID" value="export" />
<h1 class="header">
<form method="post" name="import_form" enctype="multipart/form-data" action="data.php">
-<?php Util::pformInput() ?>
+<?php Horde_Util::pformInput() ?>
<input type="hidden" name="actionID" value="<?php echo htmlspecialchars($next_step) ?>" />
<input type="hidden" name="import_step" value="<?php echo (int)$import_step ?>" />
<div id="ledger-list-buttons">
<form method="get" action="create.php">
-<?php echo Util::formInput() ?>
+<?php echo Horde_Util::formInput() ?>
<input type="submit" class="button" value="<?php echo _("Create a new Ledger") ?>" />
</form>
</div>
<tr>
<td><?php echo $browse_img ?></td>
<td><?php echo htmlspecialchars($ledger->get('name')) ?></td>
- <td><a href="<?php echo Util::addParameter($edit_url_base, 'l', $ledger->getName()) ?>" title="<?php echo _("Edit") ?>"><?php echo $edit_img ?></a></td>
+ <td><a href="<?php echo Horde_Util::addParameter($edit_url_base, 'l', $ledger->getName()) ?>" title="<?php echo _("Edit") ?>"><?php echo $edit_img ?></a></td>
<?php if (empty($conf['share']['no_sharing'])): ?>
- <td><a onclick="return !popup(this.href);" href="<?php echo Util::addParameter($perms_url_base, 'share', $ledger->getName()) ?>" target="_blank" title="<?php echo _("Change Permissions") ?>"><?php echo $perms_img ?></a></td>
+ <td><a onclick="return !popup(this.href);" href="<?php echo Horde_Util::addParameter($perms_url_base, 'share', $ledger->getName()) ?>" target="_blank" title="<?php echo _("Change Permissions") ?>"><?php echo $perms_img ?></a></td>
<?php endif; ?>
- <td><a href="<?php echo Util::addParameter($delete_url_base, 'l', $ledger->getName()) ?>" title="<?php echo _("Delete") ?>"><?php echo $delete_img ?></a></td>
+ <td><a href="<?php echo Horde_Util::addParameter($delete_url_base, 'l', $ledger->getName()) ?>" title="<?php echo _("Delete") ?>"><?php echo $delete_img ?></a></td>
</tr>
<?php endforeach; ?>
</tbody>
<?php if ($pageOb['mode'] == 'list'): ?>
<?php echo Horde::link($pageOb['url'], _("Refresh List")) . Horde::img('reload.png', _("Refresh List"), '', $registry->getImageDir('horde')) ?> </a>
<?php if (!isset($_SESSION['fima_search'])): ?>
- <?php echo Horde::link(Util::addParameter(Horde::applicationUrl('search.php'), 'search_type', $prefs->getValue('active_postingtype')), _("Search Postings")) . Horde::img('search.png', _("Search"), '', $registry->getImageDir('horde')) ?></a>
+ <?php echo Horde::link(Horde_Util::addParameter(Horde::applicationUrl('search.php'), 'search_type', $prefs->getValue('active_postingtype')), _("Search Postings")) . Horde::img('search.png', _("Search"), '', $registry->getImageDir('horde')) ?></a>
<?php else: ?>
<?php echo Horde::link(Horde::applicationUrl('search.php'), _("Edit Search Query")) . Horde::img('edit.png', _("Edit Search Query"), '', $registry->getImageDir('horde')) ?></a>
- <?php echo Horde::link(Util::addParameter($pageOb['url'], 'actionID', 'clear_search'), _("Clear Search Query")) . Horde::img('delete.png', _("Clear Search Query"), '', $registry->getImageDir('horde')) ?></a>
+ <?php echo Horde::link(Horde_Util::addParameter($pageOb['url'], 'actionID', 'clear_search'), _("Clear Search Query")) . Horde::img('delete.png', _("Clear Search Query"), '', $registry->getImageDir('horde')) ?></a>
<?php endif; ?>
<?php endif; ?>
</div>
<?php if ($pageOb['mode'] != 'list'): ?>
<form method="post" name="postings" action="<?php echo $pageOb['url'] ?>">
-<?php Util::pformInput() ?>
+<?php Horde_Util::pformInput() ?>
<?php endif; ?>
<div class="rightFloat">
<?php if ($pageOb['page_count'] > 1): ?>
<form method="get" name="pagenav" action="<?php echo Horde::applicationUrl('postings.php') ?>">
- <?php Util::pformInput() ?>
+ <?php Horde_Util::pformInput() ?>
<?php echo $pageOb['pages_first'] . ' ' . $pageOb['pages_prev'] ?>
- <input type="text" name="page" value="<?php echo htmlspecialchars($pageOb['page']) ?>" size="<?php echo String::length($pageOb['page_count']) ?>" />
+ <input type="text" name="page" value="<?php echo htmlspecialchars($pageOb['page']) ?>" size="<?php echo Horde_String::length($pageOb['page_count']) ?>" />
<?php echo $pageOb['pages_next'] . ' ' . $pageOb['pages_last'] ?>
</form>
<?php endif; ?>
?>
<?php if ($pageOb['mode'] == 'list'): ?>
<form method="post" name="postings" action="<?php echo $pageOb['url'] ?>">
-<?php Util::pformInput() ?>
+<?php Horde_Util::pformInput() ?>
<?php endif; ?>
<table class="postingList" width="100%" cellspacing="0">
<tr class="item">
<?php foreach ($headers as $key => $val): ?>
<?php if ($pageOb['mode'] == 'list'): ?>
- <th class="<?php echo ($sortby == $key) ? 'selected' : 'item' ?>" width="<?php echo $val['width'] ?>" onclick="document.location.href='<?php echo addslashes(Util::addParameter(($sortby == $key) ? $sorturl : $pageOb['url'], array('sortby' => $key, 'actionID' => 'change_sort'))) ?>';">
+ <th class="<?php echo ($sortby == $key) ? 'selected' : 'item' ?>" width="<?php echo $val['width'] ?>" onclick="document.location.href='<?php echo addslashes(Horde_Util::addParameter(($sortby == $key) ? $sorturl : $pageOb['url'], array('sortby' => $key, 'actionID' => 'change_sort'))) ?>';">
<?php if ($sortby == $key): ?>
- <?php echo Horde::link(Util::addParameter($sorturl, array('sortby' => $key, 'actionID' => 'change_sort')), $val['stext'], null, null, null, $val['stext']) . Horde::img($sortImg, $sortText, '', $registry->getImageDir('horde')) ?></a>
+ <?php echo Horde::link(Horde_Util::addParameter($sorturl, array('sortby' => $key, 'actionID' => 'change_sort')), $val['stext'], null, null, null, $val['stext']) . Horde::img($sortImg, $sortText, '', $registry->getImageDir('horde')) ?></a>
<?php endif; ?>
- <?php echo Horde::widget(Util::addParameter(($sortby == $key) ? $sorturl : $pageOb['url'], array('sortby' => $key, 'actionID' => 'change_sort')), $val['stext'], 'widget', null, null, $val['text']) ?>
+ <?php echo Horde::widget(Horde_Util::addParameter(($sortby == $key) ? $sorturl : $pageOb['url'], array('sortby' => $key, 'actionID' => 'change_sort')), $val['stext'], 'widget', null, null, $val['text']) ?>
<?php else: ?>
<th class="item" width="<?php echo $val['width'] ?>">
<?php echo str_replace('_', '', $val['text']) ?>
<br />
-<p><img class="reportImage" src="<?php echo Util::addParameter($report->getParam('url'), 'out', '1') ?>" alt="<?php echo _("Report") ?>" title="<?php echo htmlspecialchars($title) ?>" /></p>
-<?php /*<--<p><iframe src="<?php echo Util::addParameter($report->getParam('url'), 'out', '1') ?>" /></iframe></p>-->*/ ?>
+<p><img class="reportImage" src="<?php echo Horde_Util::addParameter($report->getParam('url'), 'out', '1') ?>" alt="<?php echo _("Report") ?>" title="<?php echo htmlspecialchars($title) ?>" /></p>
+<?php /*<--<p><iframe src="<?php echo Horde_Util::addParameter($report->getParam('url'), 'out', '1') ?>" /></iframe></p>-->*/ ?>
<form method="post" name="report" action="report.php">
-<?php Util::pformInput() ?>
+<?php Horde_Util::pformInput() ?>
<input type="hidden" name="actionID" value="open_report" />
<input type="hidden" name="sortby" value="<?php echo $params['sortby'] ?>" />
<input type="hidden" name="sortdir" value="<?php echo $params['sortdir'] ?>" />
$reporturl = $report->getParam('url');
$sortby = $report->getParam('sortby');
$sortdir = $report->getParam('sortdir');
-$sorturl = Util::addParameter($reporturl, 'sortdir', ($sortdir) ? 0 : 1);
+$sorturl = Horde_Util::addParameter($reporturl, 'sortdir', ($sortdir) ? 0 : 1);
$sortImg = ($sortdir) ? 'za.png' : 'az.png';
$sortImgText = ($sortdir) ? '\/' : '/\\';
foreach ($row as $colId => $value) {
if ($rowId === '__headersort__') {
$sortText = sprintf(_("Sort by %s"), $value);
- echo '<th class="' . (($sortby == $colId) ? 'selected' : 'item') . ' sortable" onclick="document.location.href=' . addslashes(Util::addParameter(($sortby == $colId) ? $sorturl : $reporturl, 'sortby', $colId)) . '">';
+ echo '<th class="' . (($sortby == $colId) ? 'selected' : 'item') . ' sortable" onclick="document.location.href=' . addslashes(Horde_Util::addParameter(($sortby == $colId) ? $sorturl : $reporturl, 'sortby', $colId)) . '">';
if ($sortby == $colId) {
- echo Horde::link(Util::addParameter($sorturl, 'sortby', $colId), $sortText, null, null, null, $sortText) . Horde::img($sortImg, $sortImgText, '', $registry->getImageDir('horde')) . '</a>';
+ echo Horde::link(Horde_Util::addParameter($sorturl, 'sortby', $colId), $sortText, null, null, null, $sortText) . Horde::img($sortImg, $sortImgText, '', $registry->getImageDir('horde')) . '</a>';
}
- echo Horde::widget(Util::addParameter(($sortby == $colId) ? $sorturl : $reporturl, 'sortby', $colId), $sortText, 'widget', null, null, $value);
+ echo Horde::widget(Horde_Util::addParameter(($sortby == $colId) ? $sorturl : $reporturl, 'sortby', $colId), $sortText, 'widget', null, null, $value);
echo '</th>';
} elseif ($rowId === '__header__') {
echo '<th class="item">' . htmlspecialchars($value) . '</th>';
<form method="post" name="search" action="postings.php">
-<?php Util::pformInput() ?>
+<?php Horde_Util::pformInput() ?>
<input type="hidden" name="actionID" value="search_postings" />
<div class="header">
<?php echo htmlspecialchars($title) ?>
<?php if (isset($_SESSION['fima_search'])): ?>
-<?php echo Horde::link(Util::addParameter(Horde::applicationUrl('search.php'), 'actionID', 'clear_search'), _("Clear Search Query")) . Horde::img('delete.png', _("Clear Search Query"), '', $registry->getImageDir('horde')) ?></a>
+<?php echo Horde::link(Horde_Util::addParameter(Horde::applicationUrl('search.php'), 'actionID', 'clear_search'), _("Clear Search Query")) . Horde::img('delete.png', _("Clear Search Query"), '', $registry->getImageDir('horde')) ?></a>
<?php endif; ?>
</div>
$title = _("Confirm email");
// Get supplied code
-$code = Util::getGet('code');
+$code = Horde_Util::getGet('code');
if (empty($code)) {
$notification->push(_("You must supply a confirmation code."));
header('Location: ' . Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
}
// Get supplied username
-$user = Util::getGet('user');
+$user = Horde_Util::getGet('user');
if (empty($code)) {
$notification->push(_("You must supply a username."));
header('Location: ' . Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
}
header('Location: ' . Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
-exit;
\ No newline at end of file
+exit;
$title = _("Renew account");
// Get supplied code
-$code = Util::getGet('code');
+$code = Horde_Util::getGet('code');
if (empty($code)) {
$notification->push(_("You must supply a confirmation code."));
header('Location: ' . Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
}
// Get supplied username
-$user = Util::getGet('user');
+$user = Horde_Util::getGet('user');
if (empty($code)) {
$notification->push(_("You must supply a username."));
header('Location: ' . Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
}
header('Location: ' . Auth::getLoginScreen('folks', Horde::applicationUrl('edit/edit.php')));
-exit;
\ No newline at end of file
+exit;
$auth = Auth::singleton($conf['auth']['driver']);
if (!$auth->hasCapability('resetpassword')) {
$notification->push(_("Cannot reset password automatically, contact your administrator."), 'horde.error');
- header('Location: ' . Auth::getLoginScreen('', Util::getFormData('url')));
+ header('Location: ' . Auth::getLoginScreen('', Horde_Util::getFormData('url')));
exit;
}
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$title = _("Reset Your Password");
$form = new Horde_Form($vars, $title);
$form->setButtons(_("Continue"));
// Get user security pass
-$user = Util::getFormData('username');
+$user = Horde_Util::getFormData('username');
if ($user) {
$u_prefs = Prefs::singleton($conf['prefs']['driver'], 'horde', Auth::addHook($user), '', null, false);
$u_prefs->retrieve();
}
/* Check the given values with the prefs stored ones. */
- if ((!empty($answer) && String::lower($answer) == String::lower($info['security_answer'])) ||
+ if ((!empty($answer) && Horde_String::lower($answer) == Horde_String::lower($info['security_answer'])) ||
empty($answer)) {
/* Info matches, so reset the password. */
require FOLKS_TEMPLATES . '/login/signup.php';
-require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
+require $registry->get('templates', 'horde') . '/common-footer.inc';
exit;
}
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$form = new HordeSignupForm($vars);
if ($form->validate()) {
$form->getInfo(null, $info);
require FOLKS_TEMPLATES . '/login/signup.php';
-require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
+require $registry->get('templates', 'horde') . '/common-footer.inc';
define('AUTH_HANDLER', true);
define('FOLKS_BASE', dirname(__FILE__) . '/..');
require_once FOLKS_BASE . '/lib/base.php';
-require_once 'Horde/Variables.php';
$auth = Auth::singleton($conf['auth']['driver']);
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$tabs = new Horde_UI_Tabs('what', $vars);
$tabs->addTab(_("Login"), Horde::applicationUrl('login.php'), 'login');
require_once dirname(__FILE__) . '/tabs.php';
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$title = _("Forgot your username?");
$form = new Horde_Form($vars, $title);
require FOLKS_TEMPLATES . '/login/signup.php';
-require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
+require $registry->get('templates', 'horde') . '/common-footer.inc';
*/
require_once dirname(__FILE__) . '/lib/base.php';
-require_once 'Horde/Variables.php';
$title = _("Activity");
$count = 0;
}
-$page = Util::getGet('page', 0);
+$page = Horde_Util::getGet('page', 0);
$perpage = $prefs->getValue('per_page');
$criteria = array('sort_by' => 'activity', 'sort_dir' => 0);
$users = $folks_driver->getUsers($criteria, $page * $perpage, $perpage);
$users = array();
}
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$pager = new Horde_UI_Pager('page',
$vars, array('num' => $count,
'url' => 'activity.php',
require FOLKS_TEMPLATES . '/menu.inc';
require FOLKS_TEMPLATES . '/list/list.php';
-require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
+require $registry->get('templates', 'horde') . '/common-footer.inc';
*/
require_once dirname(__FILE__) . '/lib/base.php';
-require_once 'Horde/Variables.php';
$title = _("Birthday");
$count = 0;
}
-if (($sort_by = Util::getFormData('sort_by')) !== null) {
+if (($sort_by = Horde_Util::getFormData('sort_by')) !== null) {
$prefs->setValue('sort_by', $sort_by);
} else {
$sort_by = $prefs->getValue('sort_by');
}
-if (($sort_dir = Util::getFormData('sort_dir')) !== null) {
+if (($sort_dir = Horde_Util::getFormData('sort_dir')) !== null) {
$prefs->setValue('sort_dir', $sort_dir);
} else {
$sort_dir = $prefs->getValue('sort_dir');
}
-$page = Util::getGet('page', 0);
+$page = Horde_Util::getGet('page', 0);
$perpage = $prefs->getValue('per_page');
$criteria = array('birthday' => date('-m-d'), 'sort_by' => $sort_by, 'sort_dir' => $sort_dir);
$users = $folks_driver->getUsers($criteria, $page * $perpage, $perpage);
$users = array();
}
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$pager = new Horde_UI_Pager('page',
$vars, array('num' => $count,
'url' => 'birthday.php',
require FOLKS_TEMPLATES . '/list/list.php';
-require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
+require $registry->get('templates', 'horde') . '/common-footer.inc';
function _horde_hook_signup_preprocess($info)
{
if (isset($info['extra']['username'])) {
- $info['extra']['username'] = String::lower($info['extra']['username']);
+ $info['extra']['username'] = Horde_String::lower($info['extra']['username']);
$username = $info['extra']['username'];
} else {
- $info['user_name'] = String::lower($info['user_name']);
+ $info['user_name'] = Horde_String::lower($info['user_name']);
$username = $info['user_name'];
}
if ($field == 'password') {
$value = hash('md5', $value);
}
- $fields[] = 'user_' . String::lower($field);
- $values[] = String::convertCharset($value, NLS::getCharset(), $conf['sql']['charset']);
+ $fields[] = 'user_' . Horde_String::lower($field);
+ $values[] = Horde_String::convertCharset($value, NLS::getCharset(), $conf['sql']['charset']);
}
$values[] = $userID;
require_once $GLOBALS['registry']->get('fileroot', 'folks') . '/lib/Folks.php';
$code = Folks::encodeString($userID, 'activate' . hash('md5', $extra['password']));
- $link = Util::addParameter(Horde::applicationUrl('account/approve.php', true, -1),
+ $link = Horde_Util::addParameter(Horde::applicationUrl('account/approve.php', true, -1),
array('user' => $userID, 'code' => $code),
null, false);
$title = _("Activity");
-$activity_scope = Util::getGet('activity_scope');
-$activity_date = Util::getGet('activity_date');
+$activity_scope = Horde_Util::getGet('activity_scope');
+$activity_date = Horde_Util::getGet('activity_date');
if ($activity_scope && $activity_date) {
$result = $folks_driver->deleteActivity($activity_scope, $activity_date);
if ($result instanceof PEAR_Error) {
echo $tabs->render('activity');
require FOLKS_TEMPLATES . '/edit/activity.php';
-require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
+require $registry->get('templates', 'horde') . '/common-footer.inc';
} elseif ($form->validate()) {
- if (Util::getFormData('submitbutton') == _("Delete all current comments")) {
+ if (Horde_Util::getFormData('submitbutton') == _("Delete all current comments")) {
$result = $registry->call('forums/deleteForum', array('folks', Auth::getAuth()));
if ($result instanceof PEAR_Error) {
}
}
-require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
+require $registry->get('templates', 'horde') . '/common-footer.inc';
$form->setButtons(array(_("Save"), _("Delete picture")));
if ($form->validate()) {
- switch (Util::getFormData('submitbutton')) {
+ switch (Horde_Util::getFormData('submitbutton')) {
case _("Save"):
$form->getInfo(null, $info);
echo $tabs->render('edit');
$form->renderActive(null, null, null, 'post');
-require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
+require $registry->get('templates', 'horde') . '/common-footer.inc';
$friends = Folks_Friends::singleton();
// Perform action
-$user = Util::getFormData('user');
+$user = Horde_Util::getFormData('user');
if ($user) {
if ($friends->isFriend($user)) {
$result = $friends->removeFriend($user);
$body = sprintf(_("User %s added you to his firends list on %s. \nTo approve, go to: %s \nTo reject, go to: %s \nTo see to his profile, go to: %s \n"),
Auth::getAuth(),
$registry->get('name', 'horde'),
- Util::addParameter(Horde::applicationUrl('edit/friends/approve.php', true, -1), 'user', Auth::getAuth()),
- Util::addParameter(Horde::applicationUrl('edit/friends/reject.php', true, -1), 'user', Auth::getAuth()),
+ Horde_Util::addParameter(Horde::applicationUrl('edit/friends/approve.php', true, -1), 'user', Auth::getAuth()),
+ Horde_Util::addParameter(Horde::applicationUrl('edit/friends/reject.php', true, -1), 'user', Auth::getAuth()),
Folks::getUrlFor('user', Auth::getAuth(), true, -1));
$result = $friends->sendNotification($user, $title, $body);
if ($result instanceof PEAR_Error) {
require FOLKS_TEMPLATES . '/edit/add.php';
require FOLKS_TEMPLATES . '/edit/footer.php';
-require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
+require $registry->get('templates', 'horde') . '/common-footer.inc';
Horde::authenticationFailureRedirect();
}
-$user = Util::getGet('user');
+$user = Horde_Util::getGet('user');
if (empty($user)) {
$notification->push(_("You must supply a username."));
header('Location: ' . Horde::applicationUrl('edit/friends/index.php'));
$folks_driver->logActivity(sprintf(_("Added user %s as a friend."), $link));
header('Location: ' . Horde::applicationUrl('edit/friends/index.php'));
-exit;
\ No newline at end of file
+exit;
$friends = Folks_Friends::singleton();
// Perform action
-$user = Util::getGet('user');
+$user = Horde_Util::getGet('user');
if ($user) {
if ($friends->isBlacklisted($user)) {
$result = $friends->removeBlacklisted($user);
$friend_form->renderActive();
require FOLKS_TEMPLATES . '/edit/footer.php';
-require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
+require $registry->get('templates', 'horde') . '/common-footer.inc';
}
// Handle action
-$action = Util::getFormData('action');
+$action = Horde_Util::getFormData('action');
switch ($action) {
case 'delete':
- $g = Util::getFormdata('g');
+ $g = Horde_Util::getFormdata('g');
$result = $friends->removeGroup($g);
if ($result instanceof PEAR_Error) {
$notification->push($result);
case 'edit':
- $g = Util::getFormdata('g');
+ $g = Horde_Util::getFormdata('g');
$form = new Horde_Form($vars, _("Rename group"), 'editgroup');
$form->addHidden('action', 'action', 'text', 'edit');
$form->addHidden('g', 'g', 'text', 'edit');
$v = $form->addVariable(_("New name"), 'new_name', 'text', true);
$v->setDefault($groups[$g]);
- if (Util::getFormData('submitbutton') == _("Cancel")) {
+ if (Horde_Util::getFormData('submitbutton') == _("Cancel")) {
$notification->push(sprintf(_("Group \"%s\" has not been renamed."), $groups[$g]), 'horde.warning');
header('Location: ' . Horde::applicationUrl('edit/groups.php'));
exit;
- } elseif (Util::getFormData('submitbutton') == _("Rename")) {
- $new_name = Util::getFormData('new_name');
+ } elseif (Horde_Util::getFormData('submitbutton') == _("Rename")) {
+ $new_name = Horde_Util::getFormData('new_name');
$result = $friends->renameGroup($g, $new_name);
if ($result instanceof PEAR_Error) {
$notification->push($result);
break;
}
-$remove_url = Util::addParameter(Horde::applicationUrl('edit/friends/groups.php'), 'action', 'delete');
+$remove_url = Horde_Util::addParameter(Horde::applicationUrl('edit/friends/groups.php'), 'action', 'delete');
$remove_img = Horde::img('delete.png', '', '', $registry->getImageDir('horde'));
-$edit_url = Util::addParameter(Horde::applicationUrl('edit/friends/groups.php'), 'action', 'edit');
+$edit_url = Horde_Util::addParameter(Horde::applicationUrl('edit/friends/groups.php'), 'action', 'edit');
$edit_img = Horde::img('edit.png', '', '', $registry->getImageDir('horde'));
$perms_url = Horde::applicationUrl('perms.php');
$perms_img = Horde::img('perms.png', '', '', $registry->getImageDir('horde'));
echo $tabs->render('groups');
require FOLKS_TEMPLATES . '/edit/groups.php';
-require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
+require $registry->get('templates', 'horde') . '/common-footer.inc';
Horde::authenticationFailureRedirect();
}
-$user = Util::getGet('user');
+$user = Horde_Util::getGet('user');
if (empty($user)) {
$notification->push(_("You must supply a username."));
header('Location: ' . Horde::applicationUrl('edit/friends/index.php'));
$friends->sendNotification($user, $title, $body);
header('Location: ' . Horde::applicationUrl('edit/friends/index.php'));
-exit;
\ No newline at end of file
+exit;
$auth = Auth::singleton($conf['auth']['driver']);
if (!$auth->hasCapability('resetpassword')) {
$notification->push(_("Cannot update password, contact your administrator."), 'horde.error');
- header('Location: ' . Auth::getLoginScreen('', Util::getFormData('url')));
+ header('Location: ' . Auth::getLoginScreen('', Horde_Util::getFormData('url')));
exit;
}
$title = _("Change Your Password");
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$form = new Horde_Form($vars, $title, 'password');
$form->setButtons(_("Continue"));
$form->addVariable(_("Current password"), 'old', 'password', true);
} while (false);
// update password reminder prefs
-if (Util::getPost('formname') == 'security') {
- if ($prefs->getValue('security_question') != Util::getPost('security_question')) {
- $prefs->setValue('security_question', Util::getPost('security_question'));
+if (Horde_Util::getPost('formname') == 'security') {
+ if ($prefs->getValue('security_question') != Horde_Util::getPost('security_question')) {
+ $prefs->setValue('security_question', Horde_Util::getPost('security_question'));
}
- if ($prefs->getValue('security_answer') != Util::getPost('security_answer')) {
- $prefs->setValue('security_answer', Util::getPost('security_answer'));
+ if ($prefs->getValue('security_answer') != Horde_Util::getPost('security_answer')) {
+ $prefs->setValue('security_answer', Horde_Util::getPost('security_answer'));
}
$notification->push(_("Your securiy questions was updated."), 'horde.success');
$form->renderActive(null, null, null, 'post');
echo '<br />';
$form_security->renderActive(null, null, null, 'post');
-require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
+require $registry->get('templates', 'horde') . '/common-footer.inc';
Horde::authenticationFailureRedirect();
}
-require_once 'Horde/Variables.php';
-
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$tabs = new Horde_UI_Tabs('what', $vars);
$tabs->addTab(_("Edit my profile"), Horde::applicationUrl('edit/edit.php'), 'edit');
$tabs->addTab(_("Privacy"), Horde::applicationUrl('edit/privacy.php'), 'privacy');
}
-Horde::addScriptFile('tables.js', 'horde', true);
\ No newline at end of file
+Horde::addScriptFile('tables.js', 'horde', true);
$title = _("Friends");
-require_once 'Horde/Variables.php';
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$form = new Folks_Activity_Form($vars, _("What are you doing right now?"), 'short');
if ($form->validate()) {
$result = $form->execute();
require FOLKS_TEMPLATES . '/friends/friends.php';
-require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
+require $registry->get('templates', 'horde') . '/common-footer.inc';
$login = Horde::url($webroot . '/login.php', true);
if (!empty($url)) {
- $login = Util::addParameter($login, 'url', $url);
+ $login = Horde_Util::addParameter($login, 'url', $url);
}
return $login;
}
}
}
*/
-}
\ No newline at end of file
+}
}
$profile = $GLOBALS['cache']->get('folksProfile' . $user, $GLOBALS['conf']['cache']['default_lifetime']);
- if ($profile || (Auth::isAdmin() && Util::getGet('debug'))) {
+ if ($profile || (Auth::isAdmin() && Horde_Util::getGet('debug'))) {
$profile = unserialize($profile);
static public function getImageUrl($user, $view = 'small', $full = false)
{
if (empty($GLOBALS['conf']['images']['direct'])) {
- return Util::addParameter(Horde::applicationUrl('view.php', $full),
+ return Horde_Util::addParameter(Horde::applicationUrl('view.php', $full),
array('view' => $view,
'id' => $user),
null, false);
case 'user':
if (empty($GLOBALS['conf']['urls']['pretty'])) {
- return Util::addParameter(Horde::applicationUrl('user.php', $full, $append_session), 'user', $data);
+ return Horde_Util::addParameter(Horde::applicationUrl('user.php', $full, $append_session), 'user', $data);
} else {
return Horde::applicationUrl('user/' . $data, $full, $append_session);
}
{
parent::__construct($vars, $title, $name);
- $this->addHidden('', 'url', 'text', Util::getFormData('url', '/'));
+ $this->addHidden('', 'url', 'text', Horde_Util::getFormData('url', '/'));
$this->setButtons(_("Login"));
$this->addVariable(_("Username"), 'username', 'text', true, false,
$GLOBALS['folks_driver']->updateOnlineStatus();
// Start output compression.
-if (!Util::nonInputVar('no_compress')) {
+if (!Horde_Util::nonInputVar('no_compress')) {
Horde::compressOutput();
-}
\ No newline at end of file
+}
*/
require_once dirname(__FILE__) . '/lib/base.php';
-require_once 'Horde/Variables.php';
$title = _("List");
$count = 0;
}
-if (($sort_by = Util::getFormData('sort_by')) !== null) {
+if (($sort_by = Horde_Util::getFormData('sort_by')) !== null) {
$prefs->setValue('sort_by', $sort_by);
} else {
$sort_by = $prefs->getValue('sort_by');
}
-if (($sort_dir = Util::getFormData('sort_dir')) !== null) {
+if (($sort_dir = Horde_Util::getFormData('sort_dir')) !== null) {
$prefs->setValue('sort_dir', $sort_dir);
} else {
$sort_dir = $prefs->getValue('sort_dir');
}
-$page = Util::getGet('page', 0);
+$page = Horde_Util::getGet('page', 0);
$perpage = $prefs->getValue('per_page');
$criteria = array('sort_by' => $sort_by, 'sort_dir' => $sort_dir);
$users = $folks_driver->getUsers($criteria, $page * $perpage, $perpage);
$users = array();
}
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$pager = new Horde_UI_Pager('page',
$vars, array('num' => $count,
'url' => 'list.php',
require FOLKS_TEMPLATES . '/menu.inc';
require FOLKS_TEMPLATES . '/list/list.php';
-require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
+require $registry->get('templates', 'horde') . '/common-footer.inc';
*/
if ($conf['login']['prelogin'] &&
Auth::getAuth() &&
- ($app = Util::getGet('app'))) {
+ ($app = Horde_Util::getGet('app'))) {
Horde::callHook('_folks_hook_prelogin', array($app), 'folks');
}
/*
* Login parameters
*/
-$url_param = Util::getFormData('url');
+$url_param = Horde_Util::getFormData('url');
$login_url = Auth::getLoginScreen('folks', $url_param);
/*
* Form
*/
$title = sprintf(_("Login to %s"), $registry->get('name', 'horde'));
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$form = new Folks_Login_Form($vars, $title, 'folks_login');
/*
* Check time between one login and anther
*/
-$username = strtolower(trim(Util::getPost('username')));
+$username = strtolower(trim(Horde_Util::getPost('username')));
if ($username && $conf['login']['diff']) {
$last_try = $cache->get('login_last_try_' . $username, $conf['cache']['default_lifetime']);
if ($last_try && $_SERVER['REQUEST_TIME'] - $last_try <= $conf['login']['diff']) {
*/
require_once dirname(__FILE__) . '/lib/base.php';
-require_once 'Horde/Variables.php';
$title = _("New");
$count = 0;
}
-$page = Util::getGet('page', 0);
+$page = Horde_Util::getGet('page', 0);
$perpage = $prefs->getValue('per_page');
$criteria = array('sort_by' => 'signup_at', 'sort_dir' => 0);
$users = $folks_driver->getUsers($criteria, $page * $perpage, $perpage);
$users = array();
}
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$pager = new Horde_UI_Pager('page',
$vars, array('num' => $count,
'url' => 'new.php',
require FOLKS_TEMPLATES . '/menu.inc';
require FOLKS_TEMPLATES . '/list/list.php';
-require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
+require $registry->get('templates', 'horde') . '/common-footer.inc';
*/
require_once dirname(__FILE__) . '/lib/base.php';
-require_once 'Horde/Variables.php';
$title = _("Online");
$count = 0;
}
-if (($sort_by = Util::getFormData('sort_by')) !== null) {
+if (($sort_by = Horde_Util::getFormData('sort_by')) !== null) {
$prefs->setValue('sort_by', $sort_by);
} else {
$sort_by = $prefs->getValue('sort_by');
}
-if (($sort_dir = Util::getFormData('sort_dir')) !== null) {
+if (($sort_dir = Horde_Util::getFormData('sort_dir')) !== null) {
$prefs->setValue('sort_dir', $sort_dir);
} else {
$sort_dir = $prefs->getValue('sort_dir');
}
-$page = Util::getGet('page', 0);
+$page = Horde_Util::getGet('page', 0);
$perpage = $prefs->getValue('per_page');
$criteria = array('online' => true, 'sort_by' => $sort_by, 'sort_dir' => $sort_dir);
$users = $folks_driver->getUsers($criteria, $page * $perpage, $perpage);
$users = array();
}
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$pager = new Horde_UI_Pager('page',
$vars, array('num' => $count,
'url' => 'online.php',
require FOLKS_TEMPLATES . '/list/list.php';
-require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
+require $registry->get('templates', 'horde') . '/common-footer.inc';
$auth = &Auth::singleton($conf['auth']['driver']);
$reload = false;
-$actionID = Util::getFormData('actionID', 'edit');
+$actionID = Horde_Util::getFormData('actionID', 'edit');
switch ($actionID) {
case 'edit':
- $share = &$shares->getShareById(Util::getFormData('cid'));
+ $share = &$shares->getShareById(Horde_Util::getFormData('cid'));
if (!is_a($share, 'PEAR_Error')) {
$perm = &$share->getPermission();
- } elseif (($category = Util::getFormData('share')) !== null) {
+ } elseif (($category = Horde_Util::getFormData('share')) !== null) {
$share = &$shares->getShare($category);
if (!is_a($share, 'PEAR_Error')) {
$perm = &$share->getPermission();
break;
case 'editform':
- $share = &$shares->getShareById(Util::getFormData('cid'));
+ $share = &$shares->getShareById(Horde_Util::getFormData('cid'));
if (is_a($share, 'PEAR_Error')) {
$notification->push(_("Attempt to edit a non-existent share."), 'horde.error');
} else {
// Process owner and owner permissions.
$old_owner = $share->get('owner');
- $new_owner = Auth::addHook(Util::getFormData('owner', $old_owner));
+ $new_owner = Auth::addHook(Horde_Util::getFormData('owner', $old_owner));
if ($old_owner !== $new_owner && !empty($new_owner)) {
if ($old_owner != Auth::getAuth() && !Auth::isAdmin()) {
$notification->push(_("Only the owner or system administrator may change ownership or owner permissions for a share"), 'horde.error');
}
// Process default permissions.
- if (Util::getFormData('default_show')) {
+ if (Horde_Util::getFormData('default_show')) {
$perm->addDefaultPermission(PERMS_SHOW, false);
} else {
$perm->removeDefaultPermission(PERMS_SHOW, false);
}
- if (Util::getFormData('default_read')) {
+ if (Horde_Util::getFormData('default_read')) {
$perm->addDefaultPermission(PERMS_READ, false);
} else {
$perm->removeDefaultPermission(PERMS_READ, false);
}
- if (Util::getFormData('default_edit')) {
+ if (Horde_Util::getFormData('default_edit')) {
$perm->addDefaultPermission(PERMS_EDIT, false);
} else {
$perm->removeDefaultPermission(PERMS_EDIT, false);
}
- if (Util::getFormData('default_delete')) {
+ if (Horde_Util::getFormData('default_delete')) {
$perm->addDefaultPermission(PERMS_DELETE, false);
} else {
$perm->removeDefaultPermission(PERMS_DELETE, false);
}
// Process guest permissions.
- if (Util::getFormData('guest_show')) {
+ if (Horde_Util::getFormData('guest_show')) {
$perm->addGuestPermission(PERMS_SHOW, false);
} else {
$perm->removeGuestPermission(PERMS_SHOW, false);
}
- if (Util::getFormData('guest_read')) {
+ if (Horde_Util::getFormData('guest_read')) {
$perm->addGuestPermission(PERMS_READ, false);
} else {
$perm->removeGuestPermission(PERMS_READ, false);
}
- if (Util::getFormData('guest_edit')) {
+ if (Horde_Util::getFormData('guest_edit')) {
$perm->addGuestPermission(PERMS_EDIT, false);
} else {
$perm->removeGuestPermission(PERMS_EDIT, false);
}
- if (Util::getFormData('guest_delete')) {
+ if (Horde_Util::getFormData('guest_delete')) {
$perm->addGuestPermission(PERMS_DELETE, false);
} else {
$perm->removeGuestPermission(PERMS_DELETE, false);
}
// Process creator permissions.
- if (Util::getFormData('creator_show')) {
+ if (Horde_Util::getFormData('creator_show')) {
$perm->addCreatorPermission(PERMS_SHOW, false);
} else {
$perm->removeCreatorPermission(PERMS_SHOW, false);
}
- if (Util::getFormData('creator_read')) {
+ if (Horde_Util::getFormData('creator_read')) {
$perm->addCreatorPermission(PERMS_READ, false);
} else {
$perm->removeCreatorPermission(PERMS_READ, false);
}
- if (Util::getFormData('creator_edit')) {
+ if (Horde_Util::getFormData('creator_edit')) {
$perm->addCreatorPermission(PERMS_EDIT, false);
} else {
$perm->removeCreatorPermission(PERMS_EDIT, false);
}
- if (Util::getFormData('creator_delete')) {
+ if (Horde_Util::getFormData('creator_delete')) {
$perm->addCreatorPermission(PERMS_DELETE, false);
} else {
$perm->removeCreatorPermission(PERMS_DELETE, false);
}
// Process user permissions.
- $u_names = Util::getFormData('u_names');
- $u_show = Util::getFormData('u_show');
- $u_read = Util::getFormData('u_read');
- $u_edit = Util::getFormData('u_edit');
- $u_delete = Util::getFormData('u_delete');
+ $u_names = Horde_Util::getFormData('u_names');
+ $u_show = Horde_Util::getFormData('u_show');
+ $u_read = Horde_Util::getFormData('u_read');
+ $u_edit = Horde_Util::getFormData('u_edit');
+ $u_delete = Horde_Util::getFormData('u_delete');
foreach ($u_names as $key => $user) {
// Apply backend hooks
}
// Process group permissions.
- $g_names = Util::getFormData('g_names');
- $g_show = Util::getFormData('g_show');
- $g_read = Util::getFormData('g_read');
- $g_edit = Util::getFormData('g_edit');
- $g_delete = Util::getFormData('g_delete');
+ $g_names = Horde_Util::getFormData('g_names');
+ $g_show = Horde_Util::getFormData('g_show');
+ $g_read = Horde_Util::getFormData('g_read');
+ $g_edit = Horde_Util::getFormData('g_edit');
+ $g_delete = Horde_Util::getFormData('g_delete');
foreach ($g_names as $key => $group) {
if (empty($group)) {
if (is_a($result, 'PEAR_Error')) {
$notification->push($result, 'horde.error');
} else {
- if (Util::getFormData('save_and_finish')) {
- Util::closeWindowJS();
+ if (Horde_Util::getFormData('save_and_finish')) {
+ Horde_Util::closeWindowJS();
exit;
}
$notification->push(sprintf(_("Updated \"%s\"."), $share->get('name')), 'horde.success');
*/
require_once dirname(__FILE__) . '/lib/base.php';
-require_once 'Horde/Variables.php';
$title = _("Popularity");
$count = 0;
}
-$page = Util::getGet('page', 0);
+$page = Horde_Util::getGet('page', 0);
$perpage = $prefs->getValue('per_page');
$criteria = array('sort_by' => 'popularity', 'sort_dir' => 0);
$users = $folks_driver->getUsers($criteria, $page * $perpage, $perpage);
$users = array();
}
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$pager = new Horde_UI_Pager('page',
$vars, array('num' => $count,
'url' => 'popularity.php',
require FOLKS_TEMPLATES . '/common-header.inc';
require FOLKS_TEMPLATES . '/menu.inc';
require FOLKS_TEMPLATES . '/list/list.php';
-require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
+require $registry->get('templates', 'horde') . '/common-footer.inc';
*/
require_once dirname(__FILE__) . '/lib/base.php';
-require_once 'Horde/Variables.php';
if (!Auth::isAuthenticated()) {
Horde::authenticationFailureRedirect();
}
-$user = Util::getFormData('user');
+$user = Horde_Util::getFormData('user');
if (empty($user)) {
$notification->push(_("User is not selected"), 'horde.warning');
header('Location: ' . Folks::getUrlFor('list', 'list'));
$title = _("Do you really want to report this user?");
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$form = new Horde_Form($vars, $title);
$form->setButtons(array(_("Report"), _("Cancel")));
$form->addVariable(_("Report type"), 'type', 'radio', true, false, null, array($enum));
$form->addVariable(_("Report reason"), 'reason', 'longtext', true);
-$user_id = Util::getFormData('id');
+$user_id = Horde_Util::getFormData('id');
if ($form->validate()) {
- if (Util::getFormData('submitbutton') == _("Report")) {
+ if (Horde_Util::getFormData('submitbutton') == _("Report")) {
$body = _("User") . ': ' . $user . "\n"
. _("Report type") . ': ' . $enum[$vars->get('type')] . "\n"
require FOLKS_TEMPLATES . '/common-header.inc';
require FOLKS_TEMPLATES . '/menu.inc';
$form->renderActive(null, null, null, 'post');
-require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
+require $registry->get('templates', 'horde') . '/common-footer.inc';
define('FOLKS_BASE', dirname(__FILE__));
require_once FOLKS_BASE . '/lib/base.php';
-require_once 'Horde/Variables.php';
-if (Util::getFormData('submitbutton') == _("Close")) {
+if (Horde_Util::getFormData('submitbutton') == _("Close")) {
echo '<script type="text/javascript">RedBox.close();</script>';
-} elseif (Util::getFormData('formname') == 'savesearch') {
+} elseif (Horde_Util::getFormData('formname') == 'savesearch') {
- $result = $folks_driver->saveSearch(Util::getFormData('search_criteria'), Util::getFormData('search_name'));
+ $result = $folks_driver->saveSearch(Horde_Util::getFormData('search_criteria'), Horde_Util::getFormData('search_name'));
if ($result instanceof PEAR_Error) {
$notification->push($result);
} else {
exit;
}
-} elseif ((Util::getGet('delete') == 1) && Util::getGet('query')) {
+} elseif ((Horde_Util::getGet('delete') == 1) && Horde_Util::getGet('query')) {
- $result = $folks_driver->deleteSavedSearch(Util::getGet('query'));
+ $result = $folks_driver->deleteSavedSearch(Horde_Util::getGet('query'));
if ($result instanceof PEAR_Error) {
$notification->push($result);
} else {
}
// Render
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$vars->set('search_criteria', $_SESSION['folks']['last_search']);
$form = new Horde_Form($vars, '', 'savesearch');
$form->addVariable(_("Name"), 'search_name', 'text', true);
$form->addHidden('', 'search_criteria', 'text', true);
$form->setButtons(array(_("Save"), _("Close")));
$notification->notify(array('listeners' => 'status'));
-$form->renderActive(null, null, Horde::selfUrl(), 'post');
\ No newline at end of file
+$form->renderActive(null, null, Horde::selfUrl(), 'post');
require_once dirname(__FILE__) . '/lib/base.php';
require_once FOLKS_BASE . '/lib/Forms/Search.php';
-require_once 'Horde/Variables.php';
$title = _("Search");
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$form = new Folks_Search_Form($vars, $title, 'search');
if (isset($_SESSION['folks']['last_search']) && !$form->isSubmitted()) {
$criteria = unserialize($_SESSION['folks']['last_search']);
}
-if (Util::getGet('query') && !$form->isSubmitted()) {
- $criteria = $folks_driver->getSearchCriteria(Util::getGet('query'));
+if (Horde_Util::getGet('query') && !$form->isSubmitted()) {
+ $criteria = $folks_driver->getSearchCriteria(Horde_Util::getGet('query'));
if ($criteria instanceof PEAR_Error) {
$notification->push($criteria);
$criteria = array();
$count = 0;
}
- if (($sort_by = Util::getFormData('sort_by')) !== null) {
+ if (($sort_by = Horde_Util::getFormData('sort_by')) !== null) {
$criteria['sort_by'] = $sort_by;
} else {
$criteria['sort_by'] = $prefs->getValue('sort_by');
}
- if (($sort_dir = Util::getFormData('sort_dir')) !== null) {
+ if (($sort_dir = Horde_Util::getFormData('sort_dir')) !== null) {
$criteria['sort_dir'] = $sort_dir;
} else {
$criteria['sort_dir'] = $prefs->getValue('sort_dir');
}
- $page = Util::getGet('page', 0);
+ $page = Horde_Util::getGet('page', 0);
$perpage = $prefs->getValue('per_page');
$users = $folks_driver->getUsers($criteria, $page * $perpage, $perpage);
if ($users instanceof PEAR_Error) {
$users = array();
}
- $vars = Variables::getDefaultVariables();
+ $vars = Horde_Variables::getDefaultVariables();
$pager = new Horde_UI_Pager('page',
$vars, array('num' => $count,
'url' => 'search.php',
require FOLKS_TEMPLATES . '/list/search.php';
}
-require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
+require $registry->get('templates', 'horde') . '/common-footer.inc';
<strong><?php echo $user ?></strong></a><br />
<span class="small">
<?php foreach ($actions as $action): ?>
-<a href="<?php echo Util::addParameter($action['url'], $action['id'], $user) ?>"><?php echo $action['name'] ?> </a>
+<a href="<?php echo Horde_Util::addParameter($action['url'], $action['id'], $user) ?>"><?php echo $action['name'] ?> </a>
<?php endforeach; ?>
<br />
<?php
<?php echo Horde::stylesheetLink('folks') ?>
</head>
-<body<?php if ($bc = Util::nonInputVar('bodyClass')) echo ' class="' . $bc . '"' ?><?php if ($bi = Util::nonInputVar('bodyId')) echo ' id="' . $bi . '"'; ?>>
+<body<?php if ($bc = Horde_Util::nonInputVar('bodyClass')) echo ' class="' . $bc . '"' ?><?php if ($bi = Horde_Util::nonInputVar('bodyId')) echo ' id="' . $bi . '"'; ?>>
</td>
<td><?php echo Folks::format_datetime($activity['activity_date']) ?></td>
<td><?php echo $activity['activity_message']; unset($activity['activity_message']); ?></td>
- <td><a href="<?php echo Util::addParameter($delete_url, $activity) ?>" title="<?php echo _("Delete") ?>"/><?php echo $delete_img ?></a></td>
+ <td><a href="<?php echo Horde_Util::addParameter($delete_url, $activity) ?>" title="<?php echo _("Delete") ?>"/><?php echo $delete_img ?></a></td>
</tr>
<?php } ?>
</tbody>
<?php
foreach ($actions as $action) {
echo '<td>';
- echo '<a href="' . Util::addParameter($action['url'], $action['id'], $user) . '">'
+ echo '<a href="' . Horde_Util::addParameter($action['url'], $action['id'], $user) . '">'
. $action['img'] . ' ' . $action['name'] . '</a>';
echo '</td>';
}
echo '<tr><td>' . $group_name . '</td>';
$owner = $friends->getGroupOwner($group_id);
echo '<td style="text-align: center"><a href="' . Folks::getUrlFor('user', $owner) .'"><img src="' . Folks::getImageUrl($owner) . '" class="userMiniIcon" /><br />' . $owner . '</a></td>';
- echo '<td><a href="' . Util::addParameter($members_url, 'g', $group_id) . '">' . $members_img . ' ' . _("Members") . '</a></td>';
+ echo '<td><a href="' . Horde_Util::addParameter($members_url, 'g', $group_id) . '">' . $members_img . ' ' . _("Members") . '</a></td>';
if ($friends->hasCapability('groups_add')) {
- echo '<td><a href="' . Util::addParameter($edit_url, 'g', $group_id) . '">' . $edit_img . ' ' . _("Rename") . '</a></td>';
- echo '<td><a href="#" onclick="if (confirm(\'' . _("Do you really want to delete this group?") . '\')) {window.location=\'' . Util::addParameter($remove_url, 'g', $group_id) . '\'}">' . $remove_img . ' ' . _("Delete") . '</a></td>';
- echo '<td><a href="#" onclick="popup(\'' . Util::addParameter($perms_url, 'cid', $group_id) . '\')">' . $perms_img . ' ' . _("Permissions") . '</a></td>';
+ echo '<td><a href="' . Horde_Util::addParameter($edit_url, 'g', $group_id) . '">' . $edit_img . ' ' . _("Rename") . '</a></td>';
+ echo '<td><a href="#" onclick="if (confirm(\'' . _("Do you really want to delete this group?") . '\')) {window.location=\'' . Horde_Util::addParameter($remove_url, 'g', $group_id) . '\'}">' . $remove_img . ' ' . _("Delete") . '</a></td>';
+ echo '<td><a href="#" onclick="popup(\'' . Horde_Util::addParameter($perms_url, 'cid', $group_id) . '\')">' . $perms_img . ' ' . _("Permissions") . '</a></td>';
}
echo '</tr>';
}
echo '<tr><td><a href="' . Horde::applicationUrl('edit/friends/index.php') . '">' . _("All") . '</a>';
foreach ($groups as $group_id => $group_name) {
- echo '<tr><td><a href="' . Util::addParameter(Horde::applicationUrl('edit/friends/friends.php'), $group_id) . '">' . $group_name . '</a>';
+ echo '<tr><td><a href="' . Horde_Util::addParameter(Horde::applicationUrl('edit/friends/friends.php'), $group_id) . '">' . $group_name . '</a>';
}
echo '<tr><td><a href="' . Horde::applicationUrl('edit/friends/know.php') . '">' . _("Might know") . '</a>';
</table>
</td>
-<td>
\ No newline at end of file
+<td>
foreach ($headers as $key => $val) {
echo '<th class="widget leftAlign nowrap">' . "\n";
if ($criteria['sort_by'] == $key) {
- echo Horde::link(Util::addParameter($list_url, 'sort_dir', ($criteria['sort_dir'] == 'DESC') ? 'ASC' : 'DESC'), $val['text'], null, null, null, $val['text']);
+ echo Horde::link(Horde_Util::addParameter($list_url, 'sort_dir', ($criteria['sort_dir'] == 'DESC') ? 'ASC' : 'DESC'), $val['text'], null, null, null, $val['text']);
echo Horde::img($sortImg, $sortText, null, $registry->getImageDir('horde')) . '</a> ';
}
- echo Horde::widget(Util::addParameter(($criteria['sort_by'] == $key) ? $list_url : $list_url, 'sort_by', $key), $val['text'], 'widget');
+ echo Horde::widget(Horde_Util::addParameter(($criteria['sort_by'] == $key) ? $list_url : $list_url, 'sort_by', $key), $val['text'], 'widget');
echo '</th>';
}
?>
<?php endforeach; ?>
</table>
<?php echo $pager->render() ?>
-<?php endif; ?>
\ No newline at end of file
+<?php endif; ?>
<?php
foreach ($queries as $query) {
$delete_img = Horde::img('delete.png', _("Delete"), '', $registry->getImageDir('horde'));
- echo '<tr><td>' . Horde::link(Util::addParameter(Horde::applicationUrl('search.php'), 'query', $query), '', 'bottom') . $query . '</a></td>';
- echo '<td>' . Horde::link(Util::addParameter(Horde::applicationUrl('save_search.php'), array('query' => $query, 'delete' => 1))) . $delete_img . '</a></td></tr>';
+ echo '<tr><td>' . Horde::link(Horde_Util::addParameter(Horde::applicationUrl('search.php'), 'query', $query), '', 'bottom') . $query . '</a></td>';
+ echo '<td>' . Horde::link(Horde_Util::addParameter(Horde::applicationUrl('save_search.php'), array('query' => $query, 'delete' => 1))) . $delete_img . '</a></td></tr>';
}
?>
</table>
<a href="javascript: document.getElementById('message_body').focus()" title="<?php echo _("Add a comment") ?>">
<img src="<?php echo $registry->getImageDir('agora') ?>/agora.png"> <?php echo _("Add a comment") ?></a>
-<a href="<?php echo Util::addParameter(Horde::applicationUrl('edit/friends/add.php'), 'user', $user); ?>" title="<?php echo sprintf(_("Add %s as a friend?"), $user) ?>" onclick="return confirm('<?php echo sprintf(_("Add %s as a friend?"), $user) ?>')">
+<a href="<?php echo Horde_Util::addParameter(Horde::applicationUrl('edit/friends/add.php'), 'user', $user); ?>" title="<?php echo sprintf(_("Add %s as a friend?"), $user) ?>" onclick="return confirm('<?php echo sprintf(_("Add %s as a friend?"), $user) ?>')">
<img src="<?php echo $registry->getImageDir('horde') ?>/user.png"> <?php echo _("Friend") ?></a>
-<a href="<?php echo Util::addParameter(Horde::applicationUrl('edit/friends/blacklist.php'), 'user', $user); ?>" title="<?php echo sprintf(_("Add %s to you blacklist?"), $user) ?>" onclick="return confirm('<?php echo sprintf(_("Add %s to you blacklist?"), $user) ?>')">
+<a href="<?php echo Horde_Util::addParameter(Horde::applicationUrl('edit/friends/blacklist.php'), 'user', $user); ?>" title="<?php echo sprintf(_("Add %s to you blacklist?"), $user) ?>" onclick="return confirm('<?php echo sprintf(_("Add %s to you blacklist?"), $user) ?>')">
<img src="<?php echo $registry->getImageDir('horde') ?>/locked.png"> <?php echo _("Blacklist") ?></a>
-<a href="<?php echo Util::addParameter(Horde::applicationUrl('report.php'), 'user', $user); ?>" title="<?php echo _("Report user") ?>">
+<a href="<?php echo Horde_Util::addParameter(Horde::applicationUrl('report.php'), 'user', $user); ?>" title="<?php echo _("Report user") ?>">
<img src="<?php echo $registry->getImageDir('horde') ?>/problem.png"> <?php echo _("Report") ?></a>
<a href="<?php echo Folks::getUrlFor('list', 'list') ?>" title="<?php echo _("User list") ?>">
</div>
-<br />
\ No newline at end of file
+<br />
<?php
echo '<li><img src="' . $registry->getImageDir('horde') . '/alerts/success.png">'
. _("Click here to login.")
- . ' <a href="' . Auth::getLoginScreen('letter', Util::addParameter(Horde::applicationUrl('user.php'), 'user', $user)) . '">' . _("Click here to login.") . '</a>'
+ . ' <a href="' . Auth::getLoginScreen('letter', Horde_Util::addParameter(Horde::applicationUrl('user.php'), 'user', $user)) . '">' . _("Click here to login.") . '</a>'
. '</li>';
?>
</ul>
<td class="header" colspan="2">
<span style="float: right">
<a href="<?php echo Horde::applicationUrl('edit/friends/index.php') ?>" title="<?php echo _("Edit my firends") ?>"><img src="<?php echo $registry->getImageDir('horde') ?>/plus.png" /></a>
-<a href="<?php echo Util::addParameter(Horde::applicationUrl('edit/friends/index.php'), 'user', $user) ?>" title="<?php echo sprintf(_("Add %s as a friend?"), $user) ?>"><img src="<?php echo $registry->getImageDir('horde') ?>/nav/right.png" /></a>
+<a href="<?php echo Horde_Util::addParameter(Horde::applicationUrl('edit/friends/index.php'), 'user', $user) ?>" title="<?php echo sprintf(_("Add %s as a friend?"), $user) ?>"><img src="<?php echo $registry->getImageDir('horde') ?>/nav/right.png" /></a>
</span>
<?php echo _("Friends") ?> (<?php echo count($friends) ?>)
</td>
}
} else {
echo $comments_reason;
-}
\ No newline at end of file
+}
require_once dirname(__FILE__) . '/lib/base.php';
// Load profile
-$user = Util::getFormData('user', Auth::getAuth());
+$user = Horde_Util::getFormData('user', Auth::getAuth());
$profile = $folks_driver->getProfile($user);
if ($profile instanceof PEAR_Error) {
$notification->push($profile);
// Prepare an process activity form
if ($user == Auth::getAuth()) {
require_once FOLKS_BASE . '/lib/Forms/Activity.php';
- require_once 'Horde/Variables.php';
- $vars = Variables::getDefaultVariables();
+ $vars = Horde_Variables::getDefaultVariables();
$form = new Folks_Activity_Form($vars, _("What are you doing right now?"), 'short');
if ($form->validate()) {
$result = $form->execute();
break;
}
-require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
+require $registry->get('templates', 'horde') . '/common-footer.inc';
<?php
-require_once 'Horde/Util.php';
/**
* This class defines the Horde_Image:: API, and also provides some
* utility functions, such as generating highlights of a color.
*
* @package Horde_Image
*
- * @TODO: - Can we depend on the Util:: class or some other solution needed?
+ * @TODO: - Can we depend on the Horde_Util:: class or some other solution needed?
* - Exceptions
*/
class Horde_Image
*/
public function toFile($data = false)
{
- $tmp = Util::getTempFile('img', false, $this->_tmpdir);
+ $tmp = Horde_Util::getTempFile('img', false, $this->_tmpdir);
$fp = @fopen($tmp, 'wb');
fwrite($fp, $data ? $data : $this->raw());
fclose($fp);
return $point;
}
-}
\ No newline at end of file
+}
return '';
}
- return Util::bufferOutput('image' . $this->_type, $this->_im);
+ return Horde_Util::bufferOutput('image' . $this->_type, $this->_im);
}
/**
// Perform convert command if needed
if (count($this->_operations) || count($this->_postSrcOperations) || $convert) {
- $tmpout = Util::getTempFile('img', false, $this->_tmpdir);
+ $tmpout = Horde_Util::getTempFile('img', false, $this->_tmpdir);
$command = $this->_convert . ' ' . implode(' ', $this->_operations)
. ' "' . $tmpin . '"\'[0]\' '
. implode(' ', $this->_postSrcOperations)
}
// Now an output file
- $tmpout = Util::getTempFile('img', false, $this->_tmpdir);
+ $tmpout = Horde_Util::getTempFile('img', false, $this->_tmpdir);
// Substitue them in the cmd string
$cmd = str_replace(array('__FILEIN__', '__FILEOUT__', '__CONVERT__'),
return $this->_convert;
}
-}
\ No newline at end of file
+}
public function __construct($params, $context = array())
{
parent::__construct($params, $context);
- if (Util::loadExtension('imagick')) {
+ if (Horde_Util::loadExtension('imagick')) {
ini_set('imagick.locale_fix', 1);
$this->_imagick = new Imagick();
if (!empty($params['filename'])) {
$border->destroy();
}
- }
\ No newline at end of file
+ }
// Putting these here so they don't interfere with timing/memory data when
// profiling.
-$driver = Util::getFormData('driver', 'Im');
-$test = Util::getFormData('test');
+$driver = Horde_Util::getFormData('driver', 'Im');
+$test = Horde_Util::getFormData('test');
$convert = trim(`which convert`);
$handler = new Horde_Log_Handler_Stream(fopen('/tmp/imagetest.log','a+'));
$logger = new Horde_Log_Logger($handler);
global $driver, $logger;
$logger->debug("$driver, $effect, $time, $memory");
-}
\ No newline at end of file
+}
<?php
/**
- * @package Horde_Form
- */
-
-/** String */
-include_once 'Horde/String.php';
-
-/**
* Horde_Form Master Class.
*
* The Horde_Form:: package provides form rendering, validation, and
* other functionality for the Horde Application Framework.
*
- * $Horde: incubator/Horde_Form/Horde/Form.php,v 1.19 2008/08/26 15:32:55 selsky Exp $
- *
* Copyright 2001-2007 Robert E. Coyle <robertecoyle@hotmail.com>
* Copyright 2001-2009 The Horde Project (http://www.horde.org/)
*
*
* @author Robert E. Coyle <robertecoyle@hotmail.com>
* @author Chuck Hagenbuch <chuck@horde.org>
- * @since Horde 3.0
* @package Horde_Form
*/
class Horde_Form {
public function __construct($vars, $title = '', $name = null)
{
if (is_null($name)) {
- $name = String::lower(get_class($this));
+ $name = Horde_String::lower(get_class($this));
}
$this->_vars = $vars;
{
$valid = true;
- if (!empty($this->_maxlength) && String::length($value) > $this->_maxlength) {
+ if (!empty($this->_maxlength) && Horde_String::length($value) > $this->_maxlength) {
$valid = false;
$message = sprintf(_("Value is over the maximum length of %s."), $this->_maxlength);
} elseif ($var->isRequired() && empty($this->_regex)) {
{
$valid = true;
- $length = String::length(trim($value));
+ $length = Horde_String::length(trim($value));
if ($var->isRequired() && $length <= 0) {
$valid = false;
$message = _("This field is required.");
} elseif ($length > $this->_chars) {
$valid = false;
- $message = sprintf(_("There are too many characters in this field. You have entered %s characters; you must enter less than %s."), String::length(trim($value)), $this->_chars);
+ $message = sprintf(_("There are too many characters in this field. You have entered %s characters; you must enter less than %s."), Horde_String::length(trim($value)), $this->_chars);
}
return $valid;
function getInfo($vars, $var, &$info)
{
- $info = String::lower($vars->get($var->getVarName())) == 'on';
+ $info = Horde_String::lower($vars->get($var->getVarName())) == 'on';
}
/**
$col = $db->getCol($sql);
if (!is_a($col, 'PEAR_Error')) {
- $values = Horde_Array::combine($col, $col);
+ $values = array_combine($col, $col);
}
}
parent::init($values, $prompt);
return false;
}
- if (String::lower($value) != String::lower($this->_text)) {
+ if (Horde_String::lower($value) != Horde_String::lower($this->_text)) {
$message = _("The text you entered did not match the text on the screen.");
return false;
}
. (empty($this->_name) ? '' : ' id="' . $this->_name. '"')
. (is_null($this->_enctype) ? '' : ' enctype="' . $this->_enctype . '"')
. ">\n";
- echo Util::formInput();
+ echo Horde_Util::formInput();
$this->listFormVars($form);
public function getInfo($vars, $var, &$info)
{
- $info = String::lower($vars->get($var->name)) == 'on';
+ $info = Horde_String::lower($vars->get($var->name)) == 'on';
}
}
{
$valid = true;
- if (!empty($this->_maxlength) && String::length($value) > $this->_maxlength) {
+ if (!empty($this->_maxlength) && Horde_String::length($value) > $this->_maxlength) {
$valid = false;
$message = sprintf(_("Value is over the maximum length of %s."), $this->_maxlength);
} elseif ($var->required && empty($this->_regex)) {
$img = Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/images/view.php');
if (isset($image['img']['vfs_id'])) {
/* Calling an image from VFS. */
- $img = Util::addParameter($img, array('f' => $image['img']['vfs_id'],
+ $img = Horde_Util::addParameter($img, array('f' => $image['img']['vfs_id'],
's' => 'vfs',
'p' => $image['img']['vfs_path']));
} else {
/* Calling an image from a tmp directory (uploads). */
- $img = Util::addParameter($img, 'f', $image['img']['file']);
+ $img = Horde_Util::addParameter($img, 'f', $image['img']['file']);
}
// TODO: possible to change to unobtrusive JS?
/* Rotate 270. */
- $html .= Horde::link('#', '', '', '', 'showImage(\'' . Util::addParameter($img, array('a' => 'rotate', 'v' => '270')) . '\', \'_p_' . $varname . '\', true);') . Horde::img('rotate-270.png', _("Rotate Left"), '', $img_dir) . '</a>';
+ $html .= Horde::link('#', '', '', '', 'showImage(\'' . Horde_Util::addParameter($img, array('a' => 'rotate', 'v' => '270')) . '\', \'_p_' . $varname . '\', true);') . Horde::img('rotate-270.png', _("Rotate Left"), '', $img_dir) . '</a>';
/* Rotate 180. */
- $html .= Horde::link('#', '', '', '', 'showImage(\'' . Util::addParameter($img, array('a' => 'rotate', 'v' => '180')) . '\', \'_p_' . $varname . '\', true);') . Horde::img('rotate-180.png', _("Rotate 180"), '', $img_dir) . '</a>';
+ $html .= Horde::link('#', '', '', '', 'showImage(\'' . Horde_Util::addParameter($img, array('a' => 'rotate', 'v' => '180')) . '\', \'_p_' . $varname . '\', true);') . Horde::img('rotate-180.png', _("Rotate 180"), '', $img_dir) . '</a>';
/* Rotate 90. */
- $html .= Horde::link('#', '', '', '', 'showImage(\'' . Util::addParameter($img, array('a' => 'rotate', 'v' => '90')) . '\', \'_p_' . $varname . '\', true);') . Horde::img('rotate-90.png', _("Rotate Right"), '', $img_dir) . '</a>';
+ $html .= Horde::link('#', '', '', '', 'showImage(\'' . Horde_Util::addParameter($img, array('a' => 'rotate', 'v' => '90')) . '\', \'_p_' . $varname . '\', true);') . Horde::img('rotate-90.png', _("Rotate Right"), '', $img_dir) . '</a>';
/* Flip image. */
- $html .= Horde::link('#', '', '', '', 'showImage(\'' . Util::addParameter($img, 'a', 'flip') . '\', \'_p_' . $varname . '\', true);') . Horde::img('flip.png', _("Flip"), '', $img_dir) . '</a>';
+ $html .= Horde::link('#', '', '', '', 'showImage(\'' . Horde_Util::addParameter($img, 'a', 'flip') . '\', \'_p_' . $varname . '\', true);') . Horde::img('flip.png', _("Flip"), '', $img_dir) . '</a>';
/* Mirror image. */
- $html .= Horde::link('#', '', '', '', 'showImage(\'' . Util::addParameter($img, 'a', 'mirror') . '\', \'_p_' . $varname . '\', true);') . Horde::img('mirror.png', _("Mirror"), '', $img_dir) . '</a>';
+ $html .= Horde::link('#', '', '', '', 'showImage(\'' . Horde_Util::addParameter($img, 'a', 'mirror') . '\', \'_p_' . $varname . '\', true);') . Horde::img('mirror.png', _("Mirror"), '', $img_dir) . '</a>';
/* Apply grayscale. */
- $html .= Horde::link('#', '', '', '', 'showImage(\'' . Util::addParameter($img, 'a', 'grayscale') . '\', \'_p_' . $varname . '\', true);') . Horde::img('grayscale.png', _("Grayscale"), '', $img_dir) . '</a>';
+ $html .= Horde::link('#', '', '', '', 'showImage(\'' . Horde_Util::addParameter($img, 'a', 'grayscale') . '\', \'_p_' . $varname . '\', true);') . Horde::img('grayscale.png', _("Grayscale"), '', $img_dir) . '</a>';
/* Resize width. */
$html .= sprintf('%s <input type="text" class="form-input-resize" onchange="src=getResizeSrc(\'%s\', \'%s\');showImage(src, \'_p_%s\', true);" %s />',
_("w:"),
- Util::addParameter($img, 'a', 'resize'),
+ Horde_Util::addParameter($img, 'a', 'resize'),
$varname,
$varname,
'_w_'. $varname);
/* Resize height. */
$html .= sprintf('%s <input type="text" class="form-input-resize" onchange="src=getResizeSrc(\'%s\', \'%s\');showImage(src, \'_p_%s\', true);" %s />',
_("h:"),
- Util::addParameter($img, 'a', 'resize'),
+ Horde_Util::addParameter($img, 'a', 'resize'),
$varname,
$varname,
'_h_'. $varname);
/* Apply fixed ratio resize. */
- $html .= Horde::link('#', '', '', '', 'src=getResizeSrc(\'' . Util::addParameter($img, 'a', 'resize') . '\', \'' . $varname . '\', \'1\');showImage(src, \'_p_' . $varname . '\', true);') . Horde::img('ratio.png', _("Fix ratio"), '', $img_dir) . '</a>';
+ $html .= Horde::link('#', '', '', '', 'src=getResizeSrc(\'' . Horde_Util::addParameter($img, 'a', 'resize') . '\', \'' . $varname . '\', \'1\');showImage(src, \'_p_' . $varname . '\', true);') . Horde::img('ratio.png', _("Fix ratio"), '', $img_dir) . '</a>';
/* Keep also original if it has been requested. */
if ($var->type->show_keeporig) {
{
$img_params = $var->getValue($vars);
$img_url = Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/images/view.php');
- $img_url = Util::addParameter($img_url, $img_params);
+ $img_url = Horde_Util::addParameter($img_url, $img_params);
return Horde::img($img_url, isset($img_params['f']) ? $img_params['f'] : '', '', '');
}
} elseif (preg_match('/(.*?)\r?\n([A-Z]{1,3})-(\d{5})\s+(.*)/i', $address, $addressParts)) {
/* European address style. */
include 'Horde/NLS/carsigns.php';
- $country = array_search(String::upper($addressParts[2]), $carsigns);
+ $country = array_search(Horde_String::upper($addressParts[2]), $carsigns);
/* Map24 generated map. */
if (in_array($country, array('al', 'ad', 'am', 'az', 'be', 'ba',
}
/* Mapquest generated map. */
- $mapurl2 = 'http://www.mapquest.com/maps/map.adp?country=' . String::upper($country);
+ $mapurl2 = 'http://www.mapquest.com/maps/map.adp?country=' . Horde_String::upper($country);
$desc2 = _("MapQuest map");
$icon2 = 'map_eu.png';
if (!empty($addressParts[1])) {
if ($GLOBALS['registry']->hasMethod('files/getViewLink')) {
$filename = basename($filename);
$url = $GLOBALS['registry']->call('files/getViewLink', array($dir, $filename));
- $filename = Horde::link($url, _("Preview"), null, 'form_file_view') . htmlspecialchars(Util::realPath($dir . '/' . $filename), ENT_QUOTES, $this->_charset) . '</a>';
+ $filename = Horde::link($url, _("Preview"), null, 'form_file_view') . htmlspecialchars(Horde_Util::realPath($dir . '/' . $filename), ENT_QUOTES, $this->_charset) . '</a>';
} else {
if (!empty($dir) && ($dir != '.')) {
$filename = $dir . '/' . $filename;
@define('INCUBATOR_BASE', dirname(__FILE__));
require_once HORDE_BASE . '/lib/core.php';
-require_once 'Horde/Variables.php';
require_once 'Horde/Autoloader.php';
Horde_Autoloader::addClassPath(dirname(__FILE__));
$registry = Registry::singleton();
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$vars->set('example_bar', 'text with a beginning and an end');
$form = new Horde_Form($vars, 'Horde_Form Test');
if ($this->_params['update'] || $this->_params['delete']) {
$content .= '<td class="nowrap">' . "\n";
if ($this->_params['update']) {
- $content .= '<a class="update" href="' . Util::addParameter($url, 'action', 'update') . '&' . $keys . '">' .
+ $content .= '<a class="update" href="' . Horde_Util::addParameter($url, 'action', 'update') . '&' . $keys . '">' .
'<img src="<tag:img_dir />/edit.png" alt="<gettext>Edit</gettext>" title="<gettext>Edit</gettext>" /></a> ' . "\n";
}
if ($this->_params['delete']) {
- $content .= '<a class="delete" href="' . Util::addParameter($url, 'action', 'delete') . '&' . $keys . '">' .
+ $content .= '<a class="delete" href="' . Horde_Util::addParameter($url, 'action', 'delete') . '&' . $keys . '">' .
'<img src="<tag:img_dir />/delete.png" alt="<gettext>Delete</gettext>" title="<gettext>Delete</gettext>" /></a> ' . "\n";
}
$content .= '</td>' . "\n";
die('Permission denied');
}
-require_once 'Horde/Variables.php';
require_once 'Horde/Autoloader.php';
require_once dirname(__FILE__) . '/Form.php';
require_once dirname(__FILE__) . '/Table.php';
-$what2process = Util::getFormData('what2process', 'Rdo');
-$table = Util::getFormData('table', 'horde_user');
-$self_url = Util::addParameter(Horde::selfUrl(false), array('table' => $table, 'what2process' => $what2process), null, false);
+$what2process = Horde_Util::getFormData('what2process', 'Rdo');
+$table = Horde_Util::getFormData('table', 'horde_user');
+$self_url = Horde_Util::addParameter(Horde::selfUrl(false), array('table' => $table, 'what2process' => $what2process), null, false);
if ($what2process == 'Rdo') {
$mapper = $table;
}
-$action = Util::getFormData('action');
+$action = Horde_Util::getFormData('action');
-$filter = Util::getFormData('filter', array());
+$filter = Horde_Util::getFormData('filter', array());
$title = sprintf('%s: %s', $action, $table);
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$form = Horde_Form_Helper::factory($what2process, $vars, $title, null, $mapper);
switch ($action) {
case 'search':
case 'search_active':
$form->getInfo($vars, $filter);
- $self_url = Util::addParameter($self_url, 'action', 'search');
+ $self_url = Horde_Util::addParameter($self_url, 'action', 'search');
break;
}
require_once 'Horde/Form.php';
require_once 'Horde/Form/Renderer.php';
-require_once 'Horde/Variables.php';
require_once 'Horde/Array.php';
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$dbh = DB::connect($conf['sql']);
$tables = $dbh->getListOf('tables');
}
// We should have a url now, and possibly other options.
- $url = Util::addParameter($this->_oembed_endpoint, $options, null, false);
+ $url = Horde_Util::addParameter($this->_oembed_endpoint, $options, null, false);
try {
$response = $this->_http_client->request('GET', $url);
{
$this->assertValidRevision($rev);
- $tmpfile = Util::getTempFile('vc', true, $this->_paths['temp']);
+ $tmpfile = Horde_Util::getTempFile('vc', true, $this->_paths['temp']);
$where = $fileob->queryModulePath();
$pipe = popen(escapeshellcmd($this->getPath('cvs')) . ' -n server > ' . escapeshellarg($tmpfile), VC_WINDOWS ? 'wb' : 'w');
$svnPath = $this->getPath('svn');
$tempDir = isset($this->_paths['svn_home'])
? $this->_paths['svn_home']
- : Util::getTempDir();
+ : Horde_Util::getTempDir();
$command = $svnPath . ' --non-interactive --config-dir ' . $tempDir;
if ($this->_username) {
exit;
}
-$acls = Util::getFormData('acl');
-$folder = Util::getFormData('folder');
-$new_user = Util::getFormData('new_user');
+$acls = Horde_Util::getFormData('acl');
+$folder = Horde_Util::getFormData('folder');
+$new_user = Horde_Util::getFormData('new_user');
if ($new_user) {
- $new_acl = Util::getFormData('new_acl');
+ $new_acl = Horde_Util::getFormData('new_acl');
/* check to see if $new_user already has an acl on the folder */
if (isset($acls[$new_user])) {
$acls[$new_user] = $new_acl;
/* Run through the action handlers. */
$ok_form = true;
-switch (Util::getFormData('actionID')) {
+switch (Horde_Util::getFormData('actionID')) {
case 'imp_acl_set':
if (!$folder) {
$notification->push(_("No folder selected."), 'horde.error');
extract($result);
$app = 'imp';
-$chunk = Util::nonInputVar('chunk');
+$chunk = Horde_Util::nonInputVar('chunk');
Prefs_UI::generateHeader(null, $chunk);
/* Set up template. */
$t = new IMP_Template();
$t->setOption('gettext', true);
$t->set('aclurl', Horde::applicationUrl('acl.php'));
-$t->set('forminput', Util::formInput());
-$t->set('aclnavcell', Util::bufferOutput(array('Prefs_UI', 'generateNavigationCell'), 'acl'));
+$t->set('forminput', Horde_Util::formInput());
+$t->set('aclnavcell', Horde_Util::bufferOutput(array('Prefs_UI', 'generateNavigationCell'), 'acl'));
$t->set('changefolder', Horde::link('#', _("Change Folder"), 'smallheader', '', '', '', '', array('id' => 'changefolder')));
$t->set('sharedimg', Horde::img('shared.png', _("Change Folder")));
$t->set('options', IMP::flistSelect(array('selected' => $folder)));
function _getListMessages($mbox, $change)
{
$args = array(
- 'cached' => Util::getPost('cached'),
- 'cacheid' => Util::getPost('cacheid'),
+ 'cached' => Horde_Util::getPost('cached'),
+ 'cacheid' => Horde_Util::getPost('cacheid'),
'mbox' => $mbox,
- 'rangeslice' => Util::getPost('rangeslice'),
- 'qsearch' => Util::getPost('qsearch'),
- 'qsearchmbox' => Util::getPost('qsearchmbox'),
+ 'rangeslice' => Horde_Util::getPost('rangeslice'),
+ 'qsearch' => Horde_Util::getPost('qsearch'),
+ 'qsearchmbox' => Horde_Util::getPost('qsearchmbox'),
);
- $search = Util::getPost('search');
+ $search = Horde_Util::getPost('search');
if (empty($search)) {
- list($slice_start, $slice_end) = explode(':', Util::getPost('slice'), 2);
+ list($slice_start, $slice_end) = explode(':', Horde_Util::getPost('slice'), 2);
$args += array(
'slice_start' => intval($slice_start),
'slice_end' => intval($slice_end)
$args += array(
'search_uid' => $search->imapuid,
'search_view' => $search->view,
- 'search_before' => intval(Util::getPost('search_before')),
- 'search_after' => intval(Util::getPost('search_after'))
+ 'search_before' => intval(Horde_Util::getPost('search_before')),
+ 'search_after' => intval(Horde_Util::getPost('search_after'))
);
}
// TODO: This can potentially be optimized for arrival time sort - if the
// cache ID changes, we know the changes must occur at end of mailbox.
- if (empty($res->reset) && (Util::getPost('purge') || $change)) {
+ if (empty($res->reset) && (Horde_Util::getPost('purge') || $change)) {
$res->update = 1;
}
- $req_id = Util::getPost('request_id');
+ $req_id = Horde_Util::getPost('request_id');
if (!is_null($req_id)) {
$res->request_id = intval($req_id);
}
return null;
}
-// Need to load Util:: to give us access to Util::getPathInfo().
+// Need to load Horde_Util:: to give us access to Horde_Util::getPathInfo().
require_once dirname(__FILE__) . '/lib/base.load.php';
require_once HORDE_BASE . '/lib/core.php';
-$action = basename(Util::getPathInfo());
+$action = basename(Horde_Util::getPathInfo());
if (empty($action)) {
// This is the only case where we really don't return anything, since
// the frontend can be presumed not to make this request on purpose.
require_once IMP_BASE . '/lib/base.php';
// Process common request variables.
-$mbox = Util::getPost('view');
-$indices = $imp_imap->ob->utils->fromSequenceString(Util::getPost('uid'));
-$cacheid = Util::getPost('cacheid');
+$mbox = Horde_Util::getPost('view');
+$indices = $imp_imap->ob->utils->fromSequenceString(Horde_Util::getPost('uid'));
+$cacheid = Horde_Util::getPost('cacheid');
// Open an output buffer to ensure that we catch errors that might break JSON
// encoding.
$imp_folder = IMP_Folder::singleton();
- $new = String::convertCharset($mbox, NLS::getCharset(), 'UTF7-IMAP');
+ $new = Horde_String::convertCharset($mbox, NLS::getCharset(), 'UTF7-IMAP');
try {
- $new = $imptree->createMailboxName(Util::getPost('parent'), $new);
+ $new = $imptree->createMailboxName(Horde_Util::getPost('parent'), $new);
$result = $imp_folder->create($new, $prefs->getValue('subscribe'));
if ($result) {
$result = DIMP::getFolderResponse($imptree);
break;
case 'RenameFolder':
- $old = Util::getPost('old_name');
- $new_parent = Util::getPost('new_parent');
- $new = Util::getPost('new_name');
+ $old = Horde_Util::getPost('old_name');
+ $new_parent = Horde_Util::getPost('new_parent');
+ $new = Horde_Util::getPost('new_name');
if (!$old || !$new) {
break;
}
try {
$new = $imptree->createMailboxName($new_parent, $new);
- $new = String::convertCharset($new, NLS::getCharset(), 'UTF7-IMAP');
+ $new = Horde_String::convertCharset($new, NLS::getCharset(), 'UTF7-IMAP');
if ($old != $new) {
$result = $imp_folder->rename($old, $new);
if ($result) {
break;
case 'FlagAll':
- $flags = Horde_Serialize::unserialize(Util::getPost('flags'), Horde_Serialize::JSON);
+ $flags = Horde_Serialize::unserialize(Horde_Util::getPost('flags'), Horde_Serialize::JSON);
if (empty($mbox) || empty($flags)) {
break;
}
- $set = Util::getPost('set');
+ $set = Horde_Util::getPost('set');
$imp_message = &IMP_Message::singleton();
$result = $imp_message->flagAllInMailbox($flags, array($mbox), $set);
}
/* Change sort preferences if necessary. */
- $sortby = Util::getPost('sortby');
- $sortdir = Util::getPost('sortdir');
+ $sortby = Horde_Util::getPost('sortby');
+ $sortdir = Horde_Util::getPost('sortdir');
if (!is_null($sortby) || !is_null($sortdir)) {
IMP::setSort($sortby, $sortdir, $mbox);
}
$result = new stdClass;
$changed = _changed($mbox, $cacheid, false);
- if (Util::getPost('rangeslice') ||
- !Util::getPost('checkcache') ||
+ if (Horde_Util::getPost('rangeslice') ||
+ !Horde_Util::getPost('checkcache') ||
$changed) {
$result->ViewPort = _getListMessages($mbox, $changed);
}
case 'MoveMessage':
case 'CopyMessage':
- $to = Util::getPost('tofld');
+ $to = Horde_Util::getPost('tofld');
if (!$to || empty($indices)) {
break;
}
break;
case 'FlagMessage':
- $flags = Util::getPost('flags');
+ $flags = Horde_Util::getPost('flags');
if (!$flags || empty($indices)) {
break;
}
break;
case 'AddContact':
- $email = Util::getPost('email');
- $name = Util::getPost('name');
+ $email = Horde_Util::getPost('email');
+ $name = Horde_Util::getPost('name');
// Allow $name to be empty.
if (empty($email)) {
break;
case 'ReportSpam':
$change = _changed($mbox, $cacheid, false);
- $spam_result = IMP_Spam::reportSpam($indices, Util::getPost('spam') ? 'spam' : 'notspam');
+ $spam_result = IMP_Spam::reportSpam($indices, Horde_Util::getPost('spam') ? 'spam' : 'notspam');
if ($spam_result) {
$result = _generateDeleteResult($mbox, $indices, $change);
// If $spam_result is non-zero, then we know the message has been
}
$imp_filter = new IMP_Filter();
- if (Util::getPost('blacklist')) {
+ if (Horde_Util::getPost('blacklist')) {
$change = _changed($mbox, $cacheid, false);
if ($imp_filter->blacklistMessage($indices, false)) {
$result = _generateDeleteResult($mbox, $indices, $change);
$result = new stdClass;
// Need to replace line endings or else IE won't display line endings
// properly.
- $result->text = str_replace("\n", "\r\n", Text_Filter::filter(Util::getPost('text'), 'html2text'));
+ $result->text = str_replace("\n", "\r\n", Text_Filter::filter(Horde_Util::getPost('text'), 'html2text'));
break;
case 'Text2Html':
require_once 'Horde/Text/Filter.php';
$result = new stdClass;
- $result->text = Text_Filter::filter(Util::getPost('text'), 'text2html', array('parselevel' => TEXT_HTML_MICRO_LINKURL, 'class' => null, 'callback' => null));
+ $result->text = Text_Filter::filter(Horde_Util::getPost('text'), 'text2html', array('parselevel' => TEXT_HTML_MICRO_LINKURL, 'class' => null, 'callback' => null));
break;
case 'GetForwardData':
$msg = $header = null;
$idx_string = _getIdxString($indices);
- $imp_compose = IMP_Compose::singleton(Util::getPost('imp_compose'));
+ $imp_compose = IMP_Compose::singleton(Horde_Util::getPost('imp_compose'));
$imp_contents = IMP_Contents::singleton($idx_string);
$imp_ui = new IMP_UI_Compose();
$fwd_msg = $imp_ui->getForwardData($imp_compose, $imp_contents, $idx_string);
break;
case 'GetReplyData':
- $imp_compose = IMP_Compose::singleton(Util::getPost('imp_compose'));
+ $imp_compose = IMP_Compose::singleton(Horde_Util::getPost('imp_compose'));
$imp_contents = IMP_Contents::singleton(_getIdxString($indices));
- $reply_msg = $imp_compose->replyMessage(Util::getPost('type'), $imp_contents);
+ $reply_msg = $imp_compose->replyMessage(Horde_Util::getPost('type'), $imp_contents);
$header = $reply_msg['headers'];
$header['replytype'] = 'reply';
break;
case 'DeleteDraft':
- $index = Util::getPost('index');
+ $index = Horde_Util::getPost('index');
if (empty($indices)) {
break;
}
break;
case 'DeleteAttach':
- $atc = Util::getPost('atc_indices');
+ $atc = Horde_Util::getPost('atc_indices');
if (!is_null($atc)) {
- $imp_compose = IMP_Compose::singleton(Util::getPost('imp_compose'));
+ $imp_compose = IMP_Compose::singleton(Horde_Util::getPost('imp_compose'));
foreach ($imp_compose->deleteAttachment($atc) as $val) {
$notification->push(sprintf(_("Deleted the attachment \"%s\"."), Horde_Mime::decode($val)), 'horde.success');
}
break;
case 'chunkContent':
- $chunk = basename(Util::getPost('chunk'));
+ $chunk = basename(Horde_Util::getPost('chunk'));
if (!empty($chunk)) {
$result = new stdClass;
- $result->chunk = Util::bufferOutput('include', IMP_TEMPLATES . '/chunks/' . $chunk . '.php');
+ $result->chunk = Horde_Util::bufferOutput('include', IMP_TEMPLATES . '/chunks/' . $chunk . '.php');
}
break;
break;
}
- $add = Util::getPost('add');
+ $add = Horde_Util::getPost('add');
$display_folder = IMP::displayFolder($mbox);
$imptree = IMP_Imap_Tree::singleton();
break;
case 'SendMDN':
- $index = Util::getPost('index');
+ $index = Horde_Util::getPost('index');
if (empty($mbox) || empty($index)) {
break;
}
$result = new stdClass;
$result->success = false;
- $passphrase = Util::getFormData('dialog_input');
+ $passphrase = Horde_Util::getFormData('dialog_input');
if ($action == 'SMIMEPersonal') {
$imp_smime = Horde_Crypt::singleton(array('IMP', 'Smime'));
try {
Horde::requireSecureConnection();
if ($passphrase) {
- if ($imp_pgp->storePassphrase(($action == 'PGPSymmetric') ? 'symmetric' : 'personal', $passphrase, Util::getFormData('symmetricid'))) {
+ if ($imp_pgp->storePassphrase(($action == 'PGPSymmetric') ? 'symmetric' : 'personal', $passphrase, Horde_Util::getFormData('symmetricid'))) {
$result->success = 1;
} else {
$result->error = _("Invalid passphrase entered.");
break;
case 'Fetchmail':
- $fetch_list = Util::getFormData('accounts');
+ $fetch_list = Horde_Util::getFormData('accounts');
if (empty($fetch_list)) {
$result->error = _("No accounts selected.");
} else {
}
// Gather required form variables.
-$mail_user = Util::getFormData('u', null);
-$time_stamp = Util::getFormData('t', null);
-$file_name = Util::getFormData('f', null);
+$mail_user = Horde_Util::getFormData('u', null);
+$time_stamp = Horde_Util::getFormData('t', null);
+$file_name = Horde_Util::getFormData('f', null);
if (is_null($mail_user) || is_null($time_stamp) || is_null($file_name)) {
Horde::fatal(_("The attachment was not found."), $self_url, __LINE__);
}
// Check to see if we need to send a verification message.
if ($conf['compose']['link_attachments_notify']) {
if ($vfsroot->exists($full_path, $file_name . '.notify')) {
- $delete_id = Util::getFormData('d');
+ $delete_id = Horde_Util::getFormData('d');
$read_id = $vfsroot->read($full_path, $file_name . '.notify');
if (is_a($read_id, 'PEAR_Error')) {
Horde::logMessage($read_id, __FILE__, __LINE__, PEAR_LOG_ERR);
$msg = new Horde_Mime_Part();
$msg->setType('text/plain');
$msg->setCharset(NLS::getCharset());
- $msg->setContents(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), Util::addParameter(Horde::selfUrl(true, false, true), 'd', $id))));
+ $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);
}
// Prevent 'jar:' attacks on Firefox. See Ticket #5892.
if ($browser->isBrowser('mozilla')) {
- if (in_array(String::lower($mime_type), array('application/java-archive', 'application/x-jar'))) {
+ if (in_array(Horde_String::lower($mime_type), array('application/java-archive', 'application/x-jar'))) {
$mime_type = 'application/octet-stream';
}
}
* DEFAULT: 525600 = 1 year */
$expire_time = 525600;
-// Need to load Util:: to give us access to Util::getPathInfo().
+// Need to load Horde_Util:: to give us access to Horde_Util::getPathInfo().
require_once dirname(__FILE__) . '/lib/base.load.php';
require_once HORDE_BASE . '/lib/core.php';
-$path_info = trim(Util::getPathInfo(), '/');
+$path_info = trim(Horde_Util::getPathInfo(), '/');
if (empty($path_info)) {
exit;
}
/* The headers of the message. */
$header = array();
foreach (array('to', 'cc', 'bcc', 'subject', 'in_reply_to', 'references') as $v) {
- $header[$v] = rawurldecode(Util::getFormData($v, ''));
+ $header[$v] = rawurldecode(Horde_Util::getFormData($v, ''));
}
-$action = Util::getFormData('action');
+$action = Horde_Util::getFormData('action');
$get_sig = true;
$msg = '';
require_once 'Horde/Identity.php';
$identity = &Identity::singleton(array('imp', 'imp'));
if (!$prefs->isLocked('default_identity')) {
- $identity_id = Util::getFormData('identity');
+ $identity_id = Horde_Util::getFormData('identity');
if (!is_null($identity_id)) {
$identity->setDefault($identity_id);
}
NLS::setTimeZone();
/* Initialize the IMP_Compose:: object. */
-$imp_compose = &IMP_Compose::singleton(Util::getFormData('composeCache'));
+$imp_compose = &IMP_Compose::singleton(Horde_Util::getFormData('composeCache'));
/* Init IMP_UI_Compose:: object. */
$imp_ui = new IMP_UI_Compose();
/* Set the default charset. */
$charset = NLS::getEmailCharset();
if (!$prefs->isLocked('sending_charset')) {
- $charset = Util::getFormData('charset', $charset);
+ $charset = Horde_Util::getFormData('charset', $charset);
}
switch ($action) {
case 'save_draft':
/* Set up the From address based on the identity. */
try {
- $from = $identity->getFromLine(null, Util::getFormData('from'));
+ $from = $identity->getFromLine(null, Horde_Util::getFormData('from'));
} catch (Horde_Exception $e) {
$notification->push($e);
break;
/* Save the draft. */
try {
- $res = $imp_compose->saveDraft($header, Util::getFormData('message', ''), NLS::getCharset(), Util::getFormData('html'));
+ $res = $imp_compose->saveDraft($header, Horde_Util::getFormData('message', ''), NLS::getCharset(), Horde_Util::getFormData('html'));
$result->success = 1;
/* Delete existing draft. */
- _removeAutoSaveDraft(Util::getFormData('draft_index'));
+ _removeAutoSaveDraft(Horde_Util::getFormData('draft_index'));
if ($action == 'auto_save_draft') {
/* Just update the last draft index so subsequent
}
try {
- $from = $identity->getFromLine(null, Util::getFormData('from'));
+ $from = $identity->getFromLine(null, Horde_Util::getFormData('from'));
} catch (Horde_Exception $e) {
$notification->push($e);
break;
$header['from'] = $from;
$header['replyto'] = $identity->getValue('replyto_addr');
- $header['to'] = $imp_ui->getAddressList(Util::getFormData('to'), Util::getFormData('to_list'), Util::getFormData('to_field'), Util::getFormData('to_new'));
+ $header['to'] = $imp_ui->getAddressList(Horde_Util::getFormData('to'), Horde_Util::getFormData('to_list'), Horde_Util::getFormData('to_field'), Horde_Util::getFormData('to_new'));
if ($prefs->getValue('compose_cc')) {
- $header['cc'] = $imp_ui->getAddressList(Util::getFormData('cc'), Util::getFormData('cc_list'), Util::getFormData('cc_field'), Util::getFormData('cc_new'));
+ $header['cc'] = $imp_ui->getAddressList(Horde_Util::getFormData('cc'), Horde_Util::getFormData('cc_list'), Horde_Util::getFormData('cc_field'), Horde_Util::getFormData('cc_new'));
}
if ($prefs->getValue('compose_bcc')) {
- $header['bcc'] = $imp_ui->getAddressList(Util::getFormData('bcc'), Util::getFormData('bcc_list'), Util::getFormData('bcc_field'), Util::getFormData('bcc_new'));
+ $header['bcc'] = $imp_ui->getAddressList(Horde_Util::getFormData('bcc'), Horde_Util::getFormData('bcc_list'), Horde_Util::getFormData('bcc_field'), Horde_Util::getFormData('bcc_new'));
}
- $message = Util::getFormData('message');
- $html = Util::getFormData('html');
+ $message = Horde_Util::getFormData('message');
+ $html = Horde_Util::getFormData('html');
- $result->index = intval(Util::getFormData('index'));
+ $result->index = intval(Horde_Util::getFormData('index'));
- $reply_folder = Util::getFormData('folder');
- if ($reply_type = Util::getFormData('reply_type')) {
- $result->reply_folder = Util::getFormData('folder');
+ $reply_folder = Horde_Util::getFormData('folder');
+ if ($reply_type = Horde_Util::getFormData('reply_type')) {
+ $result->reply_folder = Horde_Util::getFormData('folder');
$result->reply_type = $reply_type;
}
$imptree->eltDiffStart();
$options = array(
- 'readreceipt' => Util::getFormData('request_read_receipt'),
+ 'readreceipt' => Horde_Util::getFormData('request_read_receipt'),
'reply_index' => $result->index . IMP::IDX_SEP . $reply_folder,
'reply_type' => $reply_type,
- 'save_attachments' => Util::getFormData('save_attachments_select'),
+ 'save_attachments' => Horde_Util::getFormData('save_attachments_select'),
'save_sent' => (($prefs->isLocked('save_sent_mail'))
? $identity->getValue('save_sent_mail')
- : (bool)Util::getFormData('save_sent_mail')),
+ : (bool)Horde_Util::getFormData('save_sent_mail')),
'sent_folder' => $identity->getValue('sent_mail_folder'),
);
/* Remove any auto-saved drafts. */
if ($prefs->getValue('auto_save_drafts') ||
$prefs->getValue('auto_delete_drafts')) {
- _removeAutoSaveDraft(Util::getFormData('draft_index'));
+ _removeAutoSaveDraft(Horde_Util::getFormData('draft_index'));
$result->draft_delete = 1;
}
}
}
- Horde::sendHTTPResponse(Horde::prepareResponse($result, !$result->success || !Util::getFormData('nonotify') ? $GLOBALS['imp_notify'] : null, false), 'json');
+ Horde::sendHTTPResponse(Horde::prepareResponse($result, !$result->success || !Horde_Util::getFormData('nonotify') ? $GLOBALS['imp_notify'] : null, false), 'json');
exit;
}
$imp_ui->attachAutoCompleter(array('to', 'cc', 'bcc'));
$imp_ui->attachSpellChecker('dimp');
-$type = Util::getFormData('type');
-$index = Util::getFormData('uid');
-$folder = Util::getFormData('folder');
+$type = Horde_Util::getFormData('type');
+$index = Horde_Util::getFormData('uid');
+$folder = Horde_Util::getFormData('folder');
$show_editor = false;
$title = _("New Message");
case 'reply':
case 'reply_all':
case 'reply_list':
- $reply_msg = $imp_compose->replyMessage($type, $imp_contents, Util::getFormData('to'));
+ $reply_msg = $imp_compose->replyMessage($type, $imp_contents, Horde_Util::getFormData('to'));
$msg = $reply_msg['body'];
$header = $reply_msg['headers'];
$header['replytype'] = 'reply';
if ($show_editor) {
$compose_result['js'][] = 'DIMP.conf_compose.show_editor = 1';
}
-if (Util::getFormData('popup')) {
+if (Horde_Util::getFormData('popup')) {
$compose_result['js'][] = 'DIMP.conf_compose.popup = 1';
}
IMP::addInlineScript($compose_result['js']);
/* The message text and headers. */
$msg = '';
$header = array(
- 'in_reply_to' => Util::getFormData('in_reply_to'),
- 'references' => Util::getFormData('references')
+ 'in_reply_to' => Horde_Util::getFormData('in_reply_to'),
+ 'references' => Horde_Util::getFormData('references')
);
/* Set the current identity. */
$identity = &Identity::singleton(array('imp', 'imp'));
if (!$prefs->isLocked('default_identity')) {
- $identity_id = Util::getFormData('identity');
+ $identity_id = Horde_Util::getFormData('identity');
if (!is_null($identity_id)) {
$identity->setDefault($identity_id);
}
$save_sent_mail = $prefs->getValue('save_sent_mail');
$sent_mail_folder = $identity->getValue('sent_mail_folder');
-$index = Util::getFormData('index');
-$thismailbox = Util::getFormData('thismailbox');
+$index = Horde_Util::getFormData('index');
+$thismailbox = Horde_Util::getFormData('thismailbox');
$resume_draft = false;
/* Determine if mailboxes are readonly. */
NLS::setTimeZone();
/* Initialize the IMP_Compose:: object. */
-$imp_compose = &IMP_Compose::singleton(Util::getFormData('composeCache'));
+$imp_compose = &IMP_Compose::singleton(Horde_Util::getFormData('composeCache'));
/* Run through the action handlers. */
-$actionID = Util::getFormData('a');
+$actionID = Horde_Util::getFormData('a');
switch ($actionID) {
// 'd' = draft
case 'd':
break;
case _("Expand Names"):
- $action = Util::getFormData('action');
+ $action = Horde_Util::getFormData('action');
$imp_ui = new IMP_UI_Compose();
- $header['to'] = $imp_ui->expandAddresses(Util::getFormData('to'), $imp_compose);
+ $header['to'] = $imp_ui->expandAddresses(Horde_Util::getFormData('to'), $imp_compose);
if ($action !== 'rc') {
if ($prefs->getValue('compose_cc')) {
- $header['cc'] = $imp_ui->expandAddresses(Util::getFormData('cc'), $imp_compose);
+ $header['cc'] = $imp_ui->expandAddresses(Horde_Util::getFormData('cc'), $imp_compose);
}
if ($prefs->getValue('compose_bcc')) {
- $header['bcc'] = $imp_ui->expandAddresses(Util::getFormData('bcc'), $imp_compose);
+ $header['bcc'] = $imp_ui->expandAddresses(Horde_Util::getFormData('bcc'), $imp_compose);
}
}
if (!is_null($action)) {
break;
}
$actions = array('r' => 'reply', 'ra' => 'reply_all', 'rl' => 'reply_list');
- $reply_msg = $imp_compose->replyMessage($actions[$actionID], $imp_contents, Util::getFormData('to'));
+ $reply_msg = $imp_compose->replyMessage($actions[$actionID], $imp_contents, Horde_Util::getFormData('to'));
$header = $reply_msg['headers'];
break;
$imp_ui = new IMP_UI_Compose();
- $f_to = $imp_ui->getAddressList(Util::getFormData('to'));
+ $f_to = $imp_ui->getAddressList(Horde_Util::getFormData('to'));
try {
$imp_ui->redirectMessage($f_to, $imp_compose, $imp_contents, NLS::getEmailCharset());
if ($compose_disable) {
break;
}
- $message = Util::getFormData('message', '');
- $f_to = Util::getFormData('to');
+ $message = Horde_Util::getFormData('message', '');
+ $f_to = Horde_Util::getFormData('to');
$f_cc = $f_bcc = null;
$header = array();
- if ($ctype = Util::getFormData('ctype')) {
+ if ($ctype = Horde_Util::getFormData('ctype')) {
if (!($imp_contents = &_getIMPContents($index, $thismailbox))) {
break;
}
}
try {
- $header['from'] = $identity->getFromLine(null, Util::getFormData('from'));
+ $header['from'] = $identity->getFromLine(null, Horde_Util::getFormData('from'));
} catch (Horde_Exception $e) {
$header['from'] = '';
}
$header['replyto'] = $identity->getValue('replyto_addr');
- $header['subject'] = Util::getFormData('subject');
+ $header['subject'] = Horde_Util::getFormData('subject');
$imp_ui = new IMP_UI_Compose();
- $header['to'] = $imp_ui->getAddressList(Util::getFormData('to'));
+ $header['to'] = $imp_ui->getAddressList(Horde_Util::getFormData('to'));
if ($prefs->getValue('compose_cc')) {
- $header['cc'] = $imp_ui->getAddressList(Util::getFormData('cc'));
+ $header['cc'] = $imp_ui->getAddressList(Horde_Util::getFormData('cc'));
}
if ($prefs->getValue('compose_bcc')) {
- $header['bcc'] = $imp_ui->getAddressList(Util::getFormData('bcc'));
+ $header['bcc'] = $imp_ui->getAddressList(Horde_Util::getFormData('bcc'));
}
$options = array(
'sent_folder' => $sent_mail_folder,
'reply_type' => $ctype,
'reply_index' => empty($index) ? null : $index . IMP::IDX_SEP . $thismailbox,
- 'readreceipt' => Util::getFormData('request_read_receipt')
+ 'readreceipt' => Horde_Util::getFormData('request_read_receipt')
);
try {
if ($imp_compose->buildAndSendMessage($message, $header, NLS::getEmailCharset(), false, $options)) {
- if (Util::getFormData('resume_draft') &&
+ if (Horde_Util::getFormData('resume_draft') &&
$prefs->getValue('auto_delete_drafts')) {
$imp_message = &IMP_Message::singleton();
$idx_array = array($index . IMP::IDX_SEP . $thismailbox);
/* Grab any data that we were supplied with. */
if (empty($msg)) {
- $msg = Util::getFormData('message', '');
+ $msg = Horde_Util::getFormData('message', '');
}
foreach (array('to', 'cc', 'bcc', 'subject') as $val) {
if (empty($header[$val])) {
- $header[$val] = Util::getFormData($val);
+ $header[$val] = Horde_Util::getFormData($val);
}
}
}
foreach (array('start', 'page', 'mailbox', 'thismailbox') as $key) {
- if (($param = Util::getFormData($key))) {
- $url = Util::addParameter($url, $key, $param, $encode);
+ if (($param = Horde_Util::getFormData($key))) {
+ $url = Horde_Util::addParameter($url, $key, $param, $encode);
}
}
/* The headers of the message. */
$header = array(
- 'in_reply_to' => Util::getFormData('in_reply_to'),
- 'references' => Util::getFormData('references')
+ 'in_reply_to' => Horde_Util::getFormData('in_reply_to'),
+ 'references' => Horde_Util::getFormData('references')
);
$get_sig = true;
/* Set the current identity. */
$identity = &Identity::singleton(array('imp', 'imp'));
if (!$prefs->isLocked('default_identity')) {
- $identity_id = Util::getFormData('identity');
+ $identity_id = Horde_Util::getFormData('identity');
if (!is_null($identity_id)) {
$identity->setDefault($identity_id);
}
}
/* Catch submits if javascript is not present. */
-if (!($actionID = Util::getFormData('actionID'))) {
+if (!($actionID = Horde_Util::getFormData('actionID'))) {
foreach (array('send_message', 'save_draft', 'cancel_compose', 'add_attachment', 'compose_expand_addr') as $val) {
- if (Util::getFormData('btn_' . $val)) {
+ if (Horde_Util::getFormData('btn_' . $val)) {
$actionID = $val;
break;
}
default:
try {
- IMP::checkRequestToken('imp.compose', Util::getFormData('compose_requestToken'));
+ IMP::checkRequestToken('imp.compose', Horde_Util::getFormData('compose_requestToken'));
} catch (Horde_Exception $e) {
$notification->push($e);
$actionID = null;
}
}
-$save_sent_mail = Util::getFormData('save_sent_mail');
+$save_sent_mail = Horde_Util::getFormData('save_sent_mail');
$sent_mail_folder = $identity->getValue('sent_mail_folder');
-$index = Util::getFormData('index');
-$reply_index = Util::getFormData('reply_index');
-$thismailbox = Util::getFormData('thismailbox');
+$index = Horde_Util::getFormData('index');
+$reply_index = Horde_Util::getFormData('reply_index');
+$thismailbox = Horde_Util::getFormData('thismailbox');
/* Check for duplicate submits. */
-if ($token = Util::getFormData('compose_formToken')) {
+if ($token = Horde_Util::getFormData('compose_formToken')) {
$tokenSource = isset($conf['token'])
? Horde_Token::factory($conf['token']['driver'], Horde::getDriverConfig('token', $conf['token']['driver']))
: Horde_Token::factory('file');
}
/* Initialize the IMP_Compose:: object. */
-$imp_compose = &IMP_Compose::singleton(Util::getFormData('composeCache'));
-$imp_compose->pgpAttachPubkey((bool) Util::getFormData('pgp_attach_pubkey'));
-$imp_compose->userLinkAttachments((bool) Util::getFormData('link_attachments'));
+$imp_compose = &IMP_Compose::singleton(Horde_Util::getFormData('composeCache'));
+$imp_compose->pgpAttachPubkey((bool) Horde_Util::getFormData('pgp_attach_pubkey'));
+$imp_compose->userLinkAttachments((bool) Horde_Util::getFormData('link_attachments'));
try {
- $imp_compose->attachVCard((bool) Util::getFormData('vcard'), $identity->getValue('fullname'));
+ $imp_compose->attachVCard((bool) Horde_Util::getFormData('vcard'), $identity->getValue('fullname'));
} catch (IMP_Compose_Exception $e) {
$notification->push($e);
}
* $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() : Util::getFormData('charset');
+$charset = $prefs->isLocked('sending_charset') ? NLS::getEmailCharset() : Horde_Util::getFormData('charset');
$encoding = empty($charset) ? NLS::getEmailCharset() : $charset;
/* Is this a popup window? */
$has_js = $browser->hasFeature('javascript');
-$isPopup = (($prefs->getValue('compose_popup') || Util::getFormData('popup')) && $has_js);
+$isPopup = (($prefs->getValue('compose_popup') || Horde_Util::getFormData('popup')) && $has_js);
/* Determine the composition type - text or HTML.
$rtemode is null if browser does not support it. */
if ($prefs->isLocked('compose_html')) {
$rtemode = $prefs->getValue('compose_html');
} else {
- $rtemode = Util::getFormData('rtemode');
+ $rtemode = Horde_Util::getFormData('rtemode');
if (is_null($rtemode)) {
$rtemode = $prefs->getValue('compose_html');
} else {
- $oldrtemode = Util::getFormData('oldrtemode');
+ $oldrtemode = Horde_Util::getFormData('oldrtemode');
$get_sig = false;
}
}
$stationery = null;
$all_stationery = @unserialize($prefs->getValue('stationery', false));
if (is_array($all_stationery)) {
- $all_stationery = String::convertCharset($all_stationery, $prefs->getCharset());
+ $all_stationery = Horde_String::convertCharset($all_stationery, $prefs->getCharset());
foreach ($all_stationery as $id => $choice) {
if (($choice['t'] == 'plain') ||
(($choice['t'] == 'html') && $rtemode)) {
/* Only notify if we are reloading the compose screen. */
$notify = ($actionID != 'send_message') && ($actionID != 'save_draft');
- $deleteList = Util::getPost('delattachments', array());
+ $deleteList = Horde_Util::getPost('delattachments', array());
/* Update the attachment information. */
foreach (array_keys($imp_compose->getAttachments()) as $i) {
if (!in_array($i, $deleteList)) {
- $description = Util::getFormData('file_description_' . $i);
+ $description = Horde_Util::getFormData('file_description_' . $i);
$imp_compose->updateAttachment($i, array('description' => $description));
}
}
}
$imp_headers = $imp_contents->getHeaderOb();
$header['to'] = '';
- if (Util::getFormData('mailto')) {
+ if (Horde_Util::getFormData('mailto')) {
$header['to'] = $imp_headers->getValue('to');
}
if (empty($header['to'])) {
case 'compose_expand_addr':
case 'redirect_expand_addr':
- $header['to'] = $imp_ui->expandAddresses(Util::getFormData('to'), $imp_compose);
+ $header['to'] = $imp_ui->expandAddresses(Horde_Util::getFormData('to'), $imp_compose);
if ($actionID == 'compose_expand_addr') {
- $header['cc'] = $imp_ui->expandAddresses(Util::getFormData('cc'), $imp_compose);
- $header['bcc'] = $imp_ui->expandAddresses(Util::getFormData('bcc'), $imp_compose);
+ $header['cc'] = $imp_ui->expandAddresses(Horde_Util::getFormData('cc'), $imp_compose);
+ $header['bcc'] = $imp_ui->expandAddresses(Horde_Util::getFormData('bcc'), $imp_compose);
}
$get_sig = false;
break;
break;
}
- $reply_msg = $imp_compose->replyMessage($actionID, $imp_contents, Util::getFormData('to'));
+ $reply_msg = $imp_compose->replyMessage($actionID, $imp_contents, Horde_Util::getFormData('to'));
$msg = $reply_msg['body'];
$header = $reply_msg['headers'];
$format = $reply_msg['format'];
break;
}
- $f_to = Util::getFormData('to', $imp_ui->getAddressList(Util::getFormData('to'), Util::getFormData('to_list'), Util::getFormData('to_field'), Util::getFormData('to_new')));
+ $f_to = Horde_Util::getFormData('to', $imp_ui->getAddressList(Horde_Util::getFormData('to'), Horde_Util::getFormData('to_list'), Horde_Util::getFormData('to_field'), Horde_Util::getFormData('to_new')));
try {
$imp_ui->redirectMessage($f_to, $imp_compose, $imp_contents, $encoding);
$notification->push(_("Message redirected successfully."), 'horde.success');
_popupSuccess();
} else {
- Util::closeWindowJS();
+ Horde_Util::closeWindowJS();
}
} else {
if ($prefs->getValue('compose_confirm')) {
}
try {
- $header['from'] = $identity->getFromLine(null, Util::getFormData('from'));
+ $header['from'] = $identity->getFromLine(null, Horde_Util::getFormData('from'));
} catch (Horde_Exception $e) {
$header['from'] = '';
$get_sig = false;
}
$header['replyto'] = $identity->getValue('replyto_addr');
- $header['to'] = $imp_ui->getAddressList(Util::getFormData('to'), Util::getFormData('to_list'), Util::getFormData('to_field'), Util::getFormData('to_new'));
+ $header['to'] = $imp_ui->getAddressList(Horde_Util::getFormData('to'), Horde_Util::getFormData('to_list'), Horde_Util::getFormData('to_field'), Horde_Util::getFormData('to_new'));
if ($prefs->getValue('compose_cc')) {
- $header['cc'] = $imp_ui->getAddressList(Util::getFormData('cc'), Util::getFormData('cc_list'), Util::getFormData('cc_field'), Util::getFormData('cc_new'));
+ $header['cc'] = $imp_ui->getAddressList(Horde_Util::getFormData('cc'), Horde_Util::getFormData('cc_list'), Horde_Util::getFormData('cc_field'), Horde_Util::getFormData('cc_new'));
}
if ($prefs->getValue('compose_bcc')) {
- $header['bcc'] = $imp_ui->getAddressList(Util::getFormData('bcc'), Util::getFormData('bcc_list'), Util::getFormData('bcc_field'), Util::getFormData('bcc_new'));
+ $header['bcc'] = $imp_ui->getAddressList(Horde_Util::getFormData('bcc'), Horde_Util::getFormData('bcc_list'), Horde_Util::getFormData('bcc_field'), Horde_Util::getFormData('bcc_new'));
}
- $message = Util::getFormData('message');
- $header['subject'] = Util::getFormData('subject', '');
- if ($smf = Util::getFormData('sent_mail_folder')) {
+ $message = Horde_Util::getFormData('message');
+ $header['subject'] = Horde_Util::getFormData('subject', '');
+ if ($smf = Horde_Util::getFormData('sent_mail_folder')) {
$sent_mail_folder = $smf;
}
$options = array(
'save_sent' => $save_sent_mail,
'sent_folder' => $sent_mail_folder,
- 'save_attachments' => Util::getFormData('save_attachments_select'),
- 'reply_type' => Util::getFormData('reply_type'),
+ 'save_attachments' => Horde_Util::getFormData('save_attachments_select'),
+ 'reply_type' => Horde_Util::getFormData('reply_type'),
'reply_index' => (empty($reply_index) ? null : $reply_index . IMP::IDX_SEP . $thismailbox),
- 'encrypt' => Util::getFormData('encrypt_options'),
- 'priority' => Util::getFormData('x_priority'),
- 'readreceipt' => Util::getFormData('request_read_receipt')
+ 'encrypt' => Horde_Util::getFormData('encrypt_options'),
+ 'priority' => Horde_Util::getFormData('x_priority'),
+ 'readreceipt' => Horde_Util::getFormData('request_read_receipt')
);
try {
break;
}
- if (Util::getFormData('resume_draft') &&
+ if (Horde_Util::getFormData('resume_draft') &&
$prefs->getValue('auto_delete_drafts') &&
($thismailbox == IMP::folderPref($prefs->getValue('drafts_folder'), true))) {
$imp_message = &IMP_Message::singleton();
}
_popupSuccess();
} else {
- Util::closeWindowJS();
+ Horde_Util::closeWindowJS();
}
} else {
if ($prefs->getValue('compose_confirm') && $sent) {
/* Set up the From address based on the identity. */
try {
- $header['from'] = $identity->getFromLine(null, Util::getFormData('from'));
+ $header['from'] = $identity->getFromLine(null, Horde_Util::getFormData('from'));
} catch (Horde_Exception $e) {
$header['from'] = '';
$get_sig = false;
break;
}
foreach (array('to', 'cc', 'bcc', 'subject') as $val) {
- $header[$val] = Util::getFormData($val);
+ $header[$val] = Horde_Util::getFormData($val);
}
- $message = Util::getFormData('message', '');
+ $message = Horde_Util::getFormData('message', '');
/* Save the draft. */
try {
/* Closing draft if requested by preferences. */
if ($isPopup) {
if ($prefs->getValue('close_draft')) {
- Util::closeWindowJS();
+ Horde_Util::closeWindowJS();
exit;
} else {
$notification->push($result, 'horde.success');
break;
case 'fwd_digest':
- $indices = Util::getFormData('fwddigest');
+ $indices = Horde_Util::getFormData('fwddigest');
if (!empty($indices)) {
$msglist = unserialize(urldecode($indices));
$subject_header = $imp_compose->attachIMAPMessage($msglist);
case 'cancel_compose':
$imp_compose->deleteAllAttachments();
if ($isPopup) {
- Util::closeWindowJS();
+ Horde_Util::closeWindowJS();
} else {
header('Location: ' . _mailboxReturnURL(false));
}
exit;
case 'selectlist_process':
- $select_id = Util::getFormData('selectlist_selectid');
+ $select_id = Horde_Util::getFormData('selectlist_selectid');
if (!empty($select_id) &&
$registry->hasMethod('files/selectlistResults') &&
$registry->hasMethod('files/returnFromSelectlist')) {
if (empty($stationery_list)) {
break;
}
- $stationery = Util::getFormData('stationery');
+ $stationery = Horde_Util::getFormData('stationery');
if (strlen($stationery)) {
$stationery = (int)$stationery;
$stationery_content = $stationery_list[$stationery]['c'];
- $msg = Util::getFormData('message', '');
+ $msg = Horde_Util::getFormData('message', '');
if (strpos($stationery_content, '%s') !== false) {
$sig = $identity->getSignature();
if ($rtemode) {
/* If the attachments cache is not empty, we must reload this page
* and delete the attachments. */
if ($imp_compose->numberOfAttachments()) {
- $cancel_url = Util::addParameter(Horde::selfUrl(), array('actionID' => 'cancel_compose', 'composeCache' => $composeCacheID, 'popup' => 1), null, false);
+ $cancel_url = Horde_Util::addParameter(Horde::selfUrl(), array('actionID' => 'cancel_compose', 'composeCache' => $composeCacheID, 'popup' => 1), null, false);
}
} else {
/* If the attachments cache is not empty, we must reload this page and
delete the attachments. */
if ($imp_compose->numberOfAttachments()) {
- $cancel_url = Util::addParameter(_mailboxReturnURL(true, Horde::selfUrl()), array('actionID' => 'cancel_compose', 'composeCache' => $composeCacheID), null, false);
+ $cancel_url = Horde_Util::addParameter(_mailboxReturnURL(true, Horde::selfUrl()), array('actionID' => 'cancel_compose', 'composeCache' => $composeCacheID), null, false);
} else {
$cancel_url = _mailboxReturnURL(true);
}
/* Grab any data that we were supplied with. */
if (empty($msg)) {
- $msg = Util::getFormData('message', Util::getFormData('body', ''));
+ $msg = Horde_Util::getFormData('message', Horde_Util::getFormData('body', ''));
if ($browser->hasQuirk('double_linebreak_textarea')) {
$msg = preg_replace('/(\r?\n){3}/', '$1', $msg);
}
foreach (array('to', 'cc', 'bcc', 'subject') as $val) {
if (!isset($header[$val])) {
- $header[$val] = Util::getFormData($val, $imp_ui->getAddressList(Util::getFormData($val), Util::getFormData($val . '_list'), Util::getFormData($val . '_field'), Util::getFormData($val . '_new')));
+ $header[$val] = Horde_Util::getFormData($val, $imp_ui->getAddressList(Horde_Util::getFormData($val), Horde_Util::getFormData($val . '_list'), Horde_Util::getFormData($val . '_field'), Horde_Util::getFormData($val . '_new')));
}
}
$siglocation = 0;
$msg = "\n" . $sig . $msg;
} else {
- $siglocation = String::length($msg);
+ $siglocation = Horde_String::length($msg);
/* We always add a line break at the beginning, so if length is 1,
ignore that line break (i.e. the message is empty). */
if ($siglocation == 1) {
/* If PGP encryption is set by default, and we have a recipient list on first
* load, make sure we have public keys for all recipients. */
-$encrypt_options = Util::getFormData('encrypt_options');
+$encrypt_options = Horde_Util::getFormData('encrypt_options');
if ($prefs->getValue('use_pgp')) {
$default_encrypt = $prefs->getValue('default_encrypt');
if (!$token &&
break;
case 'bottom':
- $cursor_pos = String::length($msg);
+ $cursor_pos = Horde_String::length($msg);
break;
case 'sig':
$cursor_pos = $siglocation;
} elseif (!empty($sig)) {
$next_pos = $pos = 0;
- $sig_length = String::length($sig);
+ $sig_length = Horde_String::length($sig);
do {
$cursor_pos = $pos;
$pos = strpos($msg, $sig, $next_pos);
/* Set up the base template now. */
$t = new IMP_Template();
$t->setOption('gettext', true);
-$t->set('post_action', Util::addParameter(Horde::applicationUrl('compose.php'), 'uniq', uniqid(mt_rand())));
+$t->set('post_action', Horde_Util::addParameter(Horde::applicationUrl('compose.php'), 'uniq', uniqid(mt_rand())));
$t->set('allow_compose', !$compose_disable);
if ($redirect) {
/* Prepare the redirect template. */
$t->set('mailbox', htmlspecialchars($thismailbox));
$t->set('index', htmlspecialchars($index));
- $t->set('status', Util::bufferOutput(array('IMP', 'status')));
+ $t->set('status', Horde_Util::bufferOutput(array('IMP', 'status')));
$t->set('title', htmlspecialchars($title));
$t->set('token', IMP::getRequestToken('imp.compose'));
if ($registry->hasMethod('contacts/search')) {
$t->set('has_search', true);
- $t->set('abook', Horde::link('#', _("Address Book"), 'widget', null, 'window.open(\'' . Util::addParameter(Horde::applicationUrl('contacts.php'), array('formname' => 'redirect', 'to_only' => 1)) . '\', \'contacts\', \'toolbar=no,location=no,status=no,scrollbars=yes,resizable=yes,width=550,height=300,left=100,top=100\'); return false;') . Horde::img('addressbook_browse.png') . '<br />' . _("Address Book") . '</a>');
+ $t->set('abook', Horde::link('#', _("Address Book"), 'widget', null, 'window.open(\'' . Horde_Util::addParameter(Horde::applicationUrl('contacts.php'), array('formname' => 'redirect', 'to_only' => 1)) . '\', \'contacts\', \'toolbar=no,location=no,status=no,scrollbars=yes,resizable=yes,width=550,height=300,left=100,top=100\'); return false;') . Horde::img('addressbook_browse.png') . '<br />' . _("Address Book") . '</a>');
if (!$has_js) {
$t->set('expand', Horde::link('#', _("Expand Names"), 'widget', null, "$('actionID').value='redirect_expand_addr';uniqSubmit();return false;") . Horde::img('expand.png') . '<br />' . _("Expand Names") . '</a>', true);
}
$template_output = $t->fetch(IMP_TEMPLATES . '/compose/redirect.html');
} else {
- if (!($reply_type = Util::getFormData('reply_type'))) {
+ if (!($reply_type = Horde_Util::getFormData('reply_type'))) {
switch ($actionID) {
case 'reply':
case 'reply_all':
$tabindex = 0;
$t->set('file_upload', $_SESSION['imp']['file_upload']);
- $t->set('forminput', Util::formInput());
+ $t->set('forminput', Horde_Util::formInput());
$hidden = array(
'actionID' => '',
$hidden['MAX_FILE_SIZE'] = $_SESSION['imp']['file_upload'];
}
foreach (array('page', 'start', 'popup') as $val) {
- $hidden[$val] = htmlspecialchars(Util::getFormData($val));
+ $hidden[$val] = htmlspecialchars(Horde_Util::getFormData($val));
}
if ($reply_type) {
$hidden['reply_type'] = $reply_type;
$t->set('hidden', $hidden_val);
$t->set('title', htmlspecialchars($title));
- $t->set('status', Util::bufferOutput(array('IMP', 'status')));
+ $t->set('status', Horde_Util::bufferOutput(array('IMP', 'status')));
$t->set('send_msg_ak', Horde::getAccessKeyAndTitle(_("_Send Message")));
if ($conf['user']['allow_folders'] && !$readonly_drafts) {
$t->set('save_draft_ak', Horde::getAccessKeyAndTitle(_("Save _Draft")));
$t->set('help_compose-from', Help::link('imp', 'compose-from'));
$t->set('fromaddr_locked', $prefs->isLocked('from_addr'));
try {
- $t->set('from', htmlspecialchars($identity->getFromLine(null, Util::getFormData('from'))));
+ $t->set('from', htmlspecialchars($identity->getFromLine(null, Horde_Util::getFormData('from'))));
} catch (Horde_Exception $e) {
$t->set('from', '');
}
$t->set('priority_label', Horde::label('priority', _("_Priority")));
$t->set('priority_tabindex', ++$tabindex);
- $priority = Util::getFormData('x_priority', 3);
+ $priority = Horde_Util::getFormData('x_priority', 3);
$priorities = array(
1 => '1 (' . _("Highest") . ')',
2 => '2 (' . _("High") . ')',
}
$t->set('ssm_selected', $token ? ($save_sent_mail == 'on') : $identity->saveSentmail());
$t->set('ssm_label', Horde::label('ssm', _("Sa_ve a copy in ")));
- if ($smf = Util::getFormData('sent_mail_folder')) {
+ if ($smf = Horde_Util::getFormData('sent_mail_folder')) {
$sent_mail_folder = $smf;
}
if (!empty($conf['user']['select_sentmail_folder']) &&
$d_read = $prefs->getValue('disposition_request_read');
$t->set('rrr', $conf['compose']['allow_receipts'] && ($d_read != 'never'));
if ($t->get('rrr')) {
- $t->set('rrr_selected', ($d_read != 'ask') || (Util::getFormData('request_read_receipt') == 'on'));
+ $t->set('rrr_selected', ($d_read != 'ask') || (Horde_Util::getFormData('request_read_receipt') == 'on'));
$t->set('rrr_label', Horde::label('rrr', _("Request a _Read Receipt")));
}
$t->set('help-encrypt', Help::link('imp', 'compose-options-encrypt'));
$t->set('pgp_options', ($prefs->getValue('use_pgp') && $prefs->getValue('pgp_public_key')));
if ($t->get('pgp_options')) {
- $t->set('pgp_attach_pubkey', Util::getFormData('pgp_attach_pubkey', $prefs->getValue('pgp_attach_pubkey')));
+ $t->set('pgp_attach_pubkey', Horde_Util::getFormData('pgp_attach_pubkey', $prefs->getValue('pgp_attach_pubkey')));
$t->set('pap', Horde::label('pap', _("Attach a copy of your PGP public key to the message?")));
$t->set('help-pubkey', Help::link('imp', 'pgp-compose-attach-pubkey'));
}
}
if ($registry->hasMethod('contacts/ownVCard')) {
$t->set('vcard', Horde::label('vcard', _("Attach your contact information to the message?")));
- $t->set('attach_vcard', Util::getFormData('vcard'));
+ $t->set('attach_vcard', Horde_Util::getFormData('vcard'));
}
if ($_SESSION['imp']['file_upload']) {
$localeinfo = NLS::getLocaleInfo();
if ($t->get('show_link_save_attach')) {
$attach_options = array();
if ($show_save_attach) {
- $save_attach_val = Util::getFormData('save_attachments_select', ($save_attach == 'prompt_yes'));
+ $save_attach_val = Horde_Util::getFormData('save_attachments_select', ($save_attach == 'prompt_yes'));
$attach_options[] = array('label' => _("Save Attachments with message in sent-mail folder?"), 'name' => 'save_attachments_select', 'select_yes' => ($save_attach_val == 1), 'select_no' => ($save_attach_val == 0), 'help' => Help::link('imp', 'compose-save-attachments'));
}
if ($show_link_attach) {
- $link_attach_val = Util::getFormData('link_attachments');
+ $link_attach_val = Horde_Util::getFormData('link_attachments');
$attach_options[] = array('label' => _("Link Attachments?"), 'name' => 'link_attachments', 'select_yes' => ($link_attach_val == 1), 'select_no' => ($link_attach_val == 0), 'help' => Help::link('imp', 'compose-link-attachments'));
}
$t->set('attach_options', $attach_options);
);
if ($type != 'application/octet-stream') {
- $preview_url = Util::addParameter(Horde::applicationUrl('view.php'), array('actionID' => 'compose_attach_preview', 'id' => $atc_num, 'composeCache' => $composeCacheID));
+ $preview_url = Horde_Util::addParameter(Horde::applicationUrl('view.php'), array('actionID' => 'compose_attach_preview', 'id' => $atc_num, 'composeCache' => $composeCacheID));
$entry['name'] = Horde::link($preview_url, _("Preview") . ' ' . $entry['name'], 'link', 'compose_preview_window') . $entry['name'] . '</a>';
}
// if (!function_exists('_imp_hook_trailer')) {
// function _imp_hook_trailer($trailer)
// {
-// $vdomain = String::lower(preg_replace('|^.*?\.|i', '', getenv('HTTP_HOST')));
+// $vdomain = Horde_String::lower(preg_replace('|^.*?\.|i', '', getenv('HTTP_HOST')));
// $ldapServer = 'localhost';
// $ldapPort = '389';
// $searchBase = 'ispmanDomain=' . $vdomain . ",o=ispman";
// if (!function_exists('_imp_hook_vinfo')) {
// function _imp_hook_vinfo($type = 'username', $data = null)
// {
-// $vdomain = String::lower(preg_replace('|^mail\.|i', '', getenv('HTTP_HOST')));
+// $vdomain = Horde_String::lower(preg_replace('|^mail\.|i', '', getenv('HTTP_HOST')));
//
// switch ($type) {
// case 'username':
);
}
-if (Util::extensionExists('openssl') && isset($GLOBALS['conf']['utils']['openssl_binary'])) {
+if (Horde_Util::extensionExists('openssl') && isset($GLOBALS['conf']['utils']['openssl_binary'])) {
$prefGroups['smime'] = array(
'column' => _("Other Options"),
'label' => _("S/MIME Options"),
'xurl' => 'javascript:if(typeof navigator.registerProtocolHandler==\'undefined\')alert(\''
. addslashes(_("Your browser does not support this feature."))
. '\');else navigator.registerProtocolHandler(\'mailto\',\''
- . Util::addParameter(Horde::applicationUrl('compose.php', true),
+ . Horde_Util::addParameter(Horde::applicationUrl('compose.php', true),
array('actionID' => 'mailto_link', 'to' => ''), false)
. '%s\',\'' . $GLOBALS['registry']->get('name') . '\');',
'desc' => sprintf(_("Click here to open all mailto: links in %s."), $GLOBALS['registry']->get('name')));
/* If we self-submitted, use that source. Otherwise, choose a good
* source. */
-$source = Util::getFormData('source');
+$source = Horde_Util::getFormData('source');
if (empty($source) || !isset($source_list[$source])) {
/* We don't just pass the second argument to getFormData() because
* we want to trap for invalid sources, not just no source. */
}
/* Get the search as submitted (defaults to '' which should list everyone). */
-$search = Util::getFormData('search');
+$search = Horde_Util::getFormData('search');
/* Get the name of the calling form (Defaults to 'compose'). */
-$formname = Util::getFormData('formname', 'compose');
+$formname = Horde_Util::getFormData('formname', 'compose');
/* Are we limiting to only the 'To:' field? */
-$to_only = Util::getFormData('to_only');
+$to_only = Horde_Util::getFormData('to_only');
$search_params = IMP_Compose::getAddressSearchParams();
$apiargs = array(
);
$addresses = array();
-if (Util::getFormData('searched') || $prefs->getValue('display_contact')) {
+if (Horde_Util::getFormData('searched') || $prefs->getValue('display_contact')) {
$results = $registry->call('contacts/search', $apiargs);
foreach ($results as $r) {
/* The results list returns an array for each source searched. Make
/* If self-submitted, preserve the currently selected users encoded by
* javascript to pass as value|text. */
$selected_addresses = array();
-foreach (explode('|', Util::getFormData('sa')) as $addr) {
+foreach (explode('|', Horde_Util::getFormData('sa')) as $addr) {
if (strlen(trim($addr))) {
$selected_addresses[] = @htmlspecialchars($addr, ENT_QUOTES, NLS::getCharset());
}
$template = new IMP_Template();
$template->setOption('gettext', true);
-$template->set('action', Horde::url(Util::addParameter(Horde::applicationUrl('contacts.php'), array('uniq' => uniqid(mt_rand())))));
+$template->set('action', Horde::url(Horde_Util::addParameter(Horde::applicationUrl('contacts.php'), array('uniq' => uniqid(mt_rand())))));
$template->set('formname', $formname);
-$template->set('formInput', Util::formInput());
+$template->set('formInput', Horde_Util::formInput());
$template->set('search', htmlspecialchars($search));
if (count($source_list) > 1) {
$template->set('multiple_source', true);
/* Initialize Fetchmail libraries. */
$fm_account = new IMP_Fetchmail_Account();
-$driver = Util::getFormData('fm_driver');
+$driver = Horde_Util::getFormData('fm_driver');
$fetch_url = Horde::applicationUrl('fetchmailprefs.php');
-$prefs_url = Util::addParameter(IMP::prefsURL(true), 'group', 'fetchmail', false);
+$prefs_url = Horde_Util::addParameter(IMP::prefsURL(true), 'group', 'fetchmail', false);
$to_edit = null;
/* Handle clients without javascript. */
-$actionID = Util::getFormData('actionID');
+$actionID = Horde_Util::getFormData('actionID');
if ($actionID === null) {
- if (Util::getPost('edit')) {
+ if (Horde_Util::getPost('edit')) {
$actionID = 'fetchmail_prefs_edit';
- } elseif (Util::getPost('save')) {
+ } elseif (Horde_Util::getPost('save')) {
$actionID = 'fetchmail_prefs_save';
- } elseif (Util::getPost('delete')) {
+ } elseif (Horde_Util::getPost('delete')) {
$actionID = 'fetchmail_prefs_delete';
- } elseif (Util::getPost('back')) {
+ } elseif (Horde_Util::getPost('back')) {
header('Location: ' . $prefs_url);
exit;
- } elseif (Util::getPost('select')) {
+ } elseif (Horde_Util::getPost('select')) {
header('Location: ' . $fetch_url);
exit;
}
break;
case 'fetchmail_prefs_edit':
- $to_edit = Util::getFormData('account');
+ $to_edit = Horde_Util::getFormData('account');
$driver = $fm_account->getValue('driver', $to_edit);
$fetchmail = IMP_Fetchmail::factory($driver, array());
break;
case 'fetchmail_prefs_save':
- $to_edit = Util::getFormData('edit_account');
+ $to_edit = Horde_Util::getFormData('edit_account');
if ($to_edit == '') {
$to_edit = $fm_account->add();
}
$fetchmail = IMP_Fetchmail::factory($driver, array());
- $id = Util::getFormData('fm_id');
+ $id = Horde_Util::getFormData('fm_id');
if (empty($id)) {
$id = _("Unnamed");
}
foreach ($fetchmail->getParameterList() as $val) {
- $fm_account->setValue($val, ($val == 'id') ? $id : Util::getFormData('fm_' . $val), $to_edit);
+ $fm_account->setValue($val, ($val == 'id') ? $id : Horde_Util::getFormData('fm_' . $val), $to_edit);
}
$prefs->setValue('fetchmail_login', (bool)array_sum($fm_account->getAll('loginfetch')));
break;
case 'fetchmail_prefs_delete':
- $to_delete = Util::getFormData('edit_account');
+ $to_delete = Horde_Util::getFormData('edit_account');
if ($to_delete !== null) {
$deleted_account = $fm_account->delete($to_delete);
$notification->push(sprintf(_("The account \"%s\" has been deleted."), $deleted_account['id']), 'horde.success');
extract($result);
$app = 'imp';
-$chunk = Util::nonInputVar('chunk');
+$chunk = Horde_Util::nonInputVar('chunk');
/* Prepare template. */
$t = new IMP_Template();
$t->setOption('gettext', true);
-$t->set('navcell', Util::bufferOutput(array('Prefs_UI', 'generateNavigationCell'), 'fetchmail'));
+$t->set('navcell', Horde_Util::bufferOutput(array('Prefs_UI', 'generateNavigationCell'), 'fetchmail'));
$t->set('fetchurl', $fetch_url);
$t->set('prefsurl', $prefs_url);
-$t->set('forminput', Util::formInput());
+$t->set('forminput', Horde_Util::formInput());
if (empty($actionID)) {
/* If actionID is still empty, we haven't selected an account yet. */
$menuitem_locked = $prefs->isLocked('filter_menuitem');
/* Run through the action handlers. */
-$actionID = Util::getFormData('actionID');
+$actionID = Horde_Util::getFormData('actionID');
switch ($actionID) {
case 'update_prefs':
if (!$login_locked) {
- $prefs->setValue('filter_on_login', Util::getFormData('filter_login') ? 1 : 0);
+ $prefs->setValue('filter_on_login', Horde_Util::getFormData('filter_login') ? 1 : 0);
}
if (!$display_locked) {
- $prefs->setValue('filter_on_display', Util::getFormData('filter_display') ? 1 : 0);
+ $prefs->setValue('filter_on_display', Horde_Util::getFormData('filter_display') ? 1 : 0);
}
if (!$sidebar_locked) {
- $prefs->setValue('filter_on_sidebar', Util::getFormData('filter_sidebar') ? 1 : 0);
+ $prefs->setValue('filter_on_sidebar', Horde_Util::getFormData('filter_sidebar') ? 1 : 0);
}
if (!$anymailbox_locked) {
- $prefs->setValue('filter_any_mailbox', Util::getFormData('filter_any_mailbox') ? 1 : 0);
+ $prefs->setValue('filter_any_mailbox', Horde_Util::getFormData('filter_any_mailbox') ? 1 : 0);
}
if (!$menuitem_locked) {
- $prefs->setValue('filter_menuitem', Util::getFormData('filter_menuitem') ? 1 : 0);
+ $prefs->setValue('filter_menuitem', Horde_Util::getFormData('filter_menuitem') ? 1 : 0);
}
$notification->push(_("Preferences successfully updated."), 'horde.success');
break;
}
$app = 'imp';
-$chunk = Util::nonInputVar('chunk');
+$chunk = Horde_Util::nonInputVar('chunk');
$group = 'filters';
Prefs_UI::generateHeader(null, $chunk);
$t = new IMP_Template();
$t->setOption('gettext', true);
-$t->set('navcell', Util::bufferOutput(array('Prefs_UI', 'generateNavigationCell'), 'filters'));
+$t->set('navcell', Horde_Util::bufferOutput(array('Prefs_UI', 'generateNavigationCell'), 'filters'));
$t->set('prefsurl', IMP::prefsURL(true));
$t->set('return_text', _("Return to Options"));
$t->set('notactive', true);
} else {
$t->set('selfurl', Horde::applicationUrl('filterprefs.php'));
- $t->set('forminput', Util::formInput());
+ $t->set('forminput', Horde_Util::formInput());
$t->set('group', $group);
$t->set('app', $app);
$mask = IMP_Imap_Tree::NEXT_SHOWCLOSED;
/* Toggle subscribed view, if necessary. */
-if ($subscribe && Util::getFormData('ts')) {
+if ($subscribe && Horde_Util::getFormData('ts')) {
$showAll = !$showAll;
$_SESSION['imp']['showunsub'] = $showAll;
$imptree->showUnsubscribed($showAll);
$selfurl = Horde::applicationUrl('folders-mimp.php');
if ($subscribe) {
$sub_text = $showAll ? _("Show Subscribed Folders") : _("Show All Folders");
- $sub_link = Util::addParameter($selfurl, 'ts', 1);
+ $sub_link = Horde_Util::addParameter($selfurl, 'ts', 1);
}
$title = _("Folders");
$imaptree = &IMP_Imap_Tree::singleton();
/* $folder_list is already encoded in UTF7-IMAP. */
-$folder_list = Util::getFormData('folder_list', array());
+$folder_list = Horde_Util::getFormData('folder_list', array());
/* Set the URL to refresh the page to in the META tag */
$refresh_url = Horde::applicationUrl('folders.php', true);
$open_compose_window = null;
/* Run through the action handlers. */
-$actionID = Util::getFormData('actionID');
+$actionID = Horde_Util::getFormData('actionID');
if ($actionID) {
try {
- IMP::checkRequestToken('imp.folders', Util::getFormData('folders_token'));
+ IMP::checkRequestToken('imp.folders', Horde_Util::getFormData('folders_token'));
} catch (Horde_Exception $e) {
$notification->push($e);
$actionID = null;
switch ($actionID) {
case 'collapse_folder':
case 'expand_folder':
- $folder = Util::getFormData('folder');
+ $folder = Horde_Util::getFormData('folder');
if (!empty($folder)) {
($actionID == 'expand_folder') ? $imaptree->expand($folder) : $imaptree->collapse($folder);
}
break;
case 'delete_search_query':
- $queryid = Util::getFormData('queryid');
+ $queryid = Horde_Util::getFormData('queryid');
if (!empty($queryid)) {
$imp_search->deleteSearchQuery($queryid);
}
break;
case 'import_mbox':
- $import_folder = Util::getFormData('import_folder');
+ $import_folder = Horde_Util::getFormData('import_folder');
if (!empty($import_folder)) {
$res = $browser->wasFileUploaded('mbox_upload', _("mailbox file"));
if (!is_a($res, 'PEAR_Error')) {
- $res = $imp_folder->importMbox(String::convertCharset($import_folder, $charset, 'UTF7-IMAP'), $_FILES['mbox_upload']['tmp_name']);
- $mbox_name = basename(Util::dispelMagicQuotes($_FILES['mbox_upload']['name']));
+ $res = $imp_folder->importMbox(Horde_String::convertCharset($import_folder, $charset, 'UTF7-IMAP'), $_FILES['mbox_upload']['tmp_name']);
+ $mbox_name = basename(Horde_Util::dispelMagicQuotes($_FILES['mbox_upload']['name']));
if ($res === false) {
$notification->push(sprintf(_("There was an error importing %s."), $mbox_name), 'horde.error');
} else {
break;
case 'create_folder':
- $new_mailbox = Util::getFormData('new_mailbox');
+ $new_mailbox = Horde_Util::getFormData('new_mailbox');
if (!empty($new_mailbox)) {
try {
- $new_mailbox = $imaptree->createMailboxName(array_shift($folder_list), String::convertCharset($new_mailbox, $charset, 'UTF7-IMAP'));
+ $new_mailbox = $imaptree->createMailboxName(array_shift($folder_list), Horde_String::convertCharset($new_mailbox, $charset, 'UTF7-IMAP'));
$imp_folder->create($new_mailbox, $subscribe);
} catch (Horde_Exception $e) {
$notification->push($e);
case 'rename_folder':
// $old_names already in UTF7-IMAP
- $old_names = explode("\n", Util::getFormData('old_names'));
- $new_names = explode("\n", Util::getFormData('new_names'));
+ $old_names = explode("\n", Horde_Util::getFormData('old_names'));
+ $new_names = explode("\n", Horde_Util::getFormData('new_names'));
$iMax = count($new_names);
if (!empty($new_names) &&
!empty($old_names) &&
($iMax == count($old_names))) {
for ($i = 0; $i < $iMax; ++$i) {
- $imp_folder->rename(trim($old_names[$i], "\r\n"), String::convertCharset(IMP::appendNamespace(trim($new_names[$i], "\r\n")), $charset, 'UTF7-IMAP'));
+ $imp_folder->rename(trim($old_names[$i], "\r\n"), Horde_String::convertCharset(IMP::appendNamespace(trim($new_names[$i], "\r\n")), $charset, 'UTF7-IMAP'));
}
}
break;
/* Token to use in requests */
$folders_token = IMP::getRequestToken('imp.folders');
-$folders_url = Util::addParameter($folders_url, 'folders_token', $folders_token);
+$folders_url = Horde_Util::addParameter($folders_url, 'folders_token', $folders_token);
if ($_SESSION['imp']['file_upload'] && ($actionID == 'import_mbox')) {
$title = _("Folder Navigator");
$i_template->setOption('gettext', true);
$i_template->set('folders_url', $folders_url);
$i_template->set('import_folder', $folder_list[0]);
- $i_template->set('folder_name', htmlspecialchars(String::convertCharset($folder_list[0], 'UTF7-IMAP'), ENT_COMPAT, $charset));
+ $i_template->set('folder_name', htmlspecialchars(Horde_String::convertCharset($folder_list[0], 'UTF7-IMAP'), ENT_COMPAT, $charset));
$i_template->set('folders_token', $folders_token);
echo $i_template->fetch(IMP_TEMPLATES . '/folders/import.html');
require $registry->get('templates', 'horde') . '/common-footer.inc';
if ($prefs->getValue('subscribe')) {
$a_template->set('subscribe', true);
$subToggleText = ($showAll) ? _("Hide Unsubscribed") : _("Show Unsubscribed");
- $a_template->set('toggle_subscribe', Horde::widget(Util::addParameter($folders_url, array('actionID' => 'toggle_subscribed_view', 'folders_token' => $folders_token)), $subToggleText, 'widget', '', '', $subToggleText, true));
+ $a_template->set('toggle_subscribe', Horde::widget(Horde_Util::addParameter($folders_url, array('actionID' => 'toggle_subscribed_view', 'folders_token' => $folders_token)), $subToggleText, 'widget', '', '', $subToggleText, true));
}
$a_template->set('nav_poll', !$prefs->isLocked('nav_poll') && !$prefs->getValue('nav_poll_all'));
$a_template->set('notrash', !$prefs->getValue('use_trash'));
$a_template->set('file_upload', $_SESSION['imp']['file_upload']);
$a_template->set('help', Help::link('imp', 'folder-options'));
-$a_template->set('expand_all', Horde::widget(Util::addParameter($folders_url, array('actionID' => 'expand_all_folders', 'folders_token' => $folders_token)), _("Expand All Folders"), 'widget', '', '', _("Expand All"), true));
-$a_template->set('collapse_all', Horde::widget(Util::addParameter($folders_url, array('actionID' => 'collapse_all_folders', 'folders_token' => $folders_token)), _("Collapse All Folders"), 'widget', '', '', _("Collapse All"), true));
+$a_template->set('expand_all', Horde::widget(Horde_Util::addParameter($folders_url, array('actionID' => 'expand_all_folders', 'folders_token' => $folders_token)), _("Expand All Folders"), 'widget', '', '', _("Expand All"), true));
+$a_template->set('collapse_all', Horde::widget(Horde_Util::addParameter($folders_url, array('actionID' => 'collapse_all_folders', 'folders_token' => $folders_token)), _("Collapse All Folders"), 'widget', '', '', _("Collapse All"), true));
/* Check to see if user wants new mail notification */
if (!empty($newmsgs)) {
}
/* Add some further information to the $raw_rows array. */
-$name_url = Util::addParameter(Horde::applicationUrl('mailbox.php'), 'no_newmail_popup', 1);
+$name_url = Horde_Util::addParameter(Horde::applicationUrl('mailbox.php'), 'no_newmail_popup', 1);
$rowct = 0;
$morembox = $rows = array();
foreach ($raw_rows as $val) {
if (!empty($val['unseen'])) {
$val['name'] = '<strong>' . $val['name'] . '</strong>';
}
- $val['name'] = Horde::link(Util::addParameter($name_url, 'mailbox', $val['value']), sprintf(_("View messages in %s"), ($val['vfolder']) ? $val['base_elt']['l'] : $val['display'])) . $val['name'] . '</a>';
+ $val['name'] = Horde::link(Horde_Util::addParameter($name_url, 'mailbox', $val['value']), sprintf(_("View messages in %s"), ($val['vfolder']) ? $val['base_elt']['l'] : $val['display'])) . $val['name'] . '</a>';
}
$dir2 = _image($val, null, 'folder');
if ($val['children']) {
- $dir = Util::addParameter($folders_url, 'folder', $val['value']);
+ $dir = Horde_Util::addParameter($folders_url, 'folder', $val['value']);
if ($imaptree->isOpen($val['base_elt'])) {
- $dir = Util::addParameter($dir, 'actionID', 'collapse_folder');
+ $dir = Horde_Util::addParameter($dir, 'actionID', 'collapse_folder');
if ($val['value'] == 'INBOX') {
$minus_img = 'minustop.png';
} else {
}
$dir = Horde::link($dir, _("Collapse Folder")) . _image($minus_img, _("Collapse"), 'tree') . "</a>$dir2";
} else {
- $dir = Util::addParameter($dir, 'actionID', 'expand_folder');
+ $dir = Horde_Util::addParameter($dir, 'actionID', 'expand_folder');
if ($val['value'] == 'INBOX') {
$plus_img = 'plustop.png';
} else {
$viewmode = $_SESSION['imp']['view'];
-if (!($path = Util::getFormData('imple'))) {
+if (!($path = Horde_Util::getFormData('imple'))) {
if ($viewmode == 'dimp') {
Horde::sendHTTPResponse(new stdClass(), 'json');
}
$folders = $imaptree->getPollList(true, true);
/* Quota info, if available. */
- $quota_msg = Util::bufferOutput(array('IMP', 'quota'));
+ $quota_msg = Horde_Util::bufferOutput(array('IMP', 'quota'));
if (!empty($quota_msg)) {
$html .= '<tr><td colspan="3">' . $quota_msg . '</td></tr>';
}
if (!empty($info['recent'])) {
$newmsgs[$folder] = $info['recent'];
}
- $url = Util::addParameter(Horde::applicationUrl('mailbox.php', true), array('no_newmail_popup' => 1, 'mailbox' => $folder));
+ $url = Horde_Util::addParameter(Horde::applicationUrl('mailbox.php', true), array('no_newmail_popup' => 1, 'mailbox' => $folder));
$html .= '<tr style="cursor:pointer" class="text" onclick="self.location=\'' . $url . '\'"><td>';
if (!empty($info['unseen'])) {
$html .= '<strong>';
if ($prefs->getValue('nav_popup')) {
$alert = IMP::getNewMessagePopup($newmsgs);
- if (!Util::getFormData('httpclient')) {
+ if (!Horde_Util::getFormData('httpclient')) {
$alert = 'document.observe("dom:loaded", function() { ' . $alert . ' });';
}
$notification->push($alert, 'javascript');
- $html .= Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'javascript'));
+ $html .= Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'javascript'));
}
if (($sound = $prefs->getValue('nav_audio'))) {
$notification->push($registry->getImageDir() .
'/audio/' . $sound, 'audio');
- $html .= Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'audio'));
+ $html .= Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'audio'));
}
} elseif (!empty($this->_params['show_unread'])) {
if (count($folders) == 0) {
return;
}
- $name_url = Util::addParameter(Horde::applicationUrl('mailbox.php'), 'no_newmail_popup', 1);
+ $name_url = Horde_Util::addParameter(Horde::applicationUrl('mailbox.php'), 'no_newmail_popup', 1);
/* Initialize the IMP_Tree object. */
$imaptree = &IMP_Imap_Tree::singleton();
'icon' => $val['icon'],
'icondir' => $val['icondir'],
'iconopen' => $val['iconopen'],
- 'url' => ($val['container']) ? null : Util::addParameter($name_url, 'mailbox', $val['value']),
+ 'url' => ($val['container']) ? null : Horde_Util::addParameter($name_url, 'mailbox', $val['value']),
);
$tree->addNode($parent . $val['value'],
($val['level']) ? $parent . $val['parent'] : $parent,
$browser_charset = NLS::getCharset();
- $headers->addHeader('From', String::convertCharset($header['from'], $browser_charset, $charset));
+ $headers->addHeader('From', Horde_String::convertCharset($header['from'], $browser_charset, $charset));
if (!empty($header['replyto']) &&
($header['replyto'] != $barefrom)) {
- $headers->addHeader('Reply-to', String::convertCharset($header['replyto'], $browser_charset, $charset));
+ $headers->addHeader('Reply-to', Horde_String::convertCharset($header['replyto'], $browser_charset, $charset));
}
if (!empty($header['to'])) {
- $headers->addHeader('To', String::convertCharset($header['to'], $browser_charset, $charset));
+ $headers->addHeader('To', Horde_String::convertCharset($header['to'], $browser_charset, $charset));
} elseif (empty($header['to']) && empty($header['cc'])) {
$headers->addHeader('To', 'undisclosed-recipients:;');
}
if (!empty($header['cc'])) {
- $headers->addHeader('Cc', String::convertCharset($header['cc'], $browser_charset, $charset));
+ $headers->addHeader('Cc', Horde_String::convertCharset($header['cc'], $browser_charset, $charset));
}
- $headers->addHeader('Subject', String::convertCharset($header['subject'], $browser_charset, $charset));
+ $headers->addHeader('Subject', Horde_String::convertCharset($header['subject'], $browser_charset, $charset));
/* Add necessary headers for replies. */
if (!empty($opts['reply_type']) && ($opts['reply_type'] == 'reply')) {
$headers_result = Horde::loadConfiguration('header.php', '_header');
if (!is_a($headers_result, 'PEAR_Error')) {
foreach ($headers_result as $key => $val) {
- $headers->addHeader(trim($key), String::convertCharset(trim($val), NLS::getCharset(), $charset));
+ $headers->addHeader(trim($key), Horde_String::convertCharset(trim($val), NLS::getCharset(), $charset));
}
}
}
try {
- $GLOBALS['imp_imap']->ob->append(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'], 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;
}
// Convert IDN hosts to ASCII.
- if (Util::extensionExists('idn')) {
+ if (Horde_Util::extensionExists('idn')) {
$old_error = error_reporting(0);
- $host = idn_to_ascii(String::convertCharset($host, NLS::getCharset(), 'UTF-8'));
+ $host = idn_to_ascii(Horde_String::convertCharset($host, 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));
$options = array())
{
$nls_charset = NLS::getCharset();
- $body = String::convertCharset($body, $nls_charset, $charset);
+ $body = Horde_String::convertCharset($body, $nls_charset, $charset);
if (!empty($options['html'])) {
$body_html = $body;
$htmlBody->setType('text/html');
$htmlBody->setCharset($charset);
$htmlBody->setDisposition('inline');
- $htmlBody->setDescription(String::convertCharset(_("HTML Version of Message"), $nls_charset, $charset));
+ $htmlBody->setDescription(Horde_String::convertCharset(_("HTML Version of Message"), $nls_charset, $charset));
/* Run tidy on the HTML, if available. */
if ($tidy_config = IMP::getTidyConfig(strlen($body_html))) {
- $tidy = tidy_parse_string(String::convertCharset($body_html, $charset, 'UTF-8'), $tidy_config, 'utf8');
+ $tidy = tidy_parse_string(Horde_String::convertCharset($body_html, $charset, 'UTF-8'), $tidy_config, 'utf8');
$tidy->cleanRepair();
- $htmlBody->setContents(String::convertCharset(tidy_get_output($tidy), 'UTF-8', $charset));
+ $htmlBody->setContents(Horde_String::convertCharset(tidy_get_output($tidy), 'UTF-8', $charset));
} else {
$htmlBody->setContents($body_html);
}
- $textBody->setDescription(String::convertCharset(_("Plaintext Version of Message"), $nls_charset, $charset));
+ $textBody->setDescription(Horde_String::convertCharset(_("Plaintext Version of Message"), $nls_charset, $charset));
$textpart = new Horde_Mime_Part();
$textpart->setType('multipart/alternative');
if ($attached == 1) {
if (!($name = $headerob->getValue('subject'))) {
$name = _("[No Subject]");
- } elseif (String::length($name) > 80) {
- $name = String::substr($name, 0, 80) . '...';
+ } elseif (Horde_String::length($name) > 80) {
+ $name = Horde_String::substr($name, 0, 80) . '...';
}
return 'Fwd: ' . $GLOBALS['imp_imap']->ob->utils->getBaseSubject($name, array('keepblob' => true));
} else {
$tmp[_("Cc")] = $ob;
}
- $max = max(array_map(array('String', 'length'), array_keys($tmp))) + 2;
+ $max = max(array_map(array('Horde_String', 'length'), array_keys($tmp))) + 2;
$text = '';
foreach ($tmp as $key => $val) {
- $text .= String::pad($key . ': ', $max, ' ', STR_PAD_LEFT) . $val . "\n";
+ $text .= Horde_String::pad($key . ': ', $max, ' ', STR_PAD_LEFT) . $val . "\n";
}
return $text;
throw new IMP_Compose_Exception($res);
}
- $filename = Util::dispelMagicQuotes($_FILES[$name]['name']);
+ $filename = Horde_Util::dispelMagicQuotes($_FILES[$name]['name']);
$tempfile = $_FILES[$name]['tmp_name'];
/* Check for filesize limitations. */
'/%r/' => $h->getValue('date'),
/* Date as ddd, dd mmm yyyy. */
- '/%d/' => String::convertCharset(strftime("%a, %d %b %Y", $udate), NLS::getExternalCharset()),
+ '/%d/' => Horde_String::convertCharset(strftime("%a, %d %b %Y", $udate), NLS::getExternalCharset()),
/* Date in locale's default. */
- '/%x/' => String::convertCharset(strftime("%x", $udate), NLS::getExternalCharset()),
+ '/%x/' => Horde_String::convertCharset(strftime("%x", $udate), NLS::getExternalCharset()),
/* Date and time in locale's default. */
- '/%c/' => String::convertCharset(strftime("%c", $udate), NLS::getExternalCharset()),
+ '/%c/' => Horde_String::convertCharset(strftime("%c", $udate), NLS::getExternalCharset()),
/* Message-ID. */
'/%m/' => $message_id,
$fullpath = sprintf('%s/%s/%d', self::VFS_LINK_ATTACH_PATH, $auth, $ts);
$charset = $part->getCharset();
- $trailer = String::convertCharset(_("Attachments"), NLS::getCharset(), $charset);
+ $trailer = Horde_String::convertCharset(_("Attachments"), 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 .= 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)) . ')', NLS::getCharset(), $charset);
}
foreach ($this->getAttachments() as $att) {
- $trailer .= "\n" . Util::addParameter($baseurl, array('u' => $auth, 't' => $ts, 'f' => $att->getName()), null, false);
+ $trailer .= "\n" . Horde_Util::addParameter($baseurl, array('u' => $auth, 't' => $ts, 'f' => $att->getName()), null, false);
if ($conf['compose']['use_vfs']) {
$res = $vfs->rename(self::VFS_ATTACH_PATH, $att->getInformation('temp_filename'), $fullpath, escapeshellcmd($att->getName()));
} else {
$type = $part->getType();
$part_charset = $part->getCharset();
$charset = NLS::getCharset();
- $msg = String::convertCharset($part->getContents(), $part_charset);
+ $msg = Horde_String::convertCharset($part->getContents(), $part_charset);
/* Enforce reply limits. */
if (!empty($options['replylimit']) &&
!empty($GLOBALS['conf']['compose']['reply_limit'])) {
$limit = $GLOBALS['conf']['compose']['reply_limit'];
- if (String::length($msg) > $limit) {
- $msg = String::substr($msg, 0, $limit) . "\n" . _("[Truncated Text]");
+ if (Horde_String::length($msg) > $limit) {
+ $msg = Horde_String::substr($msg, 0, $limit) . "\n" . _("[Truncated Text]");
}
}
if (($mode == 'html)' &&
($tidy_config = IMP::getTidyConfig($part->getBytes())))) {
$tidy_config['show-body-only'] = true;
- $tidy = tidy_parse_string(String::convertCharset($msg, $charset, 'UTF-8'), $tidy_config, 'UTF8');
+ $tidy = tidy_parse_string(Horde_String::convertCharset($msg, $charset, 'UTF-8'), $tidy_config, 'UTF8');
$tidy->cleanRepair();
- $msg = String::convertCharset(tidy_get_output($tidy), 'UTF-8', $charset);
+ $msg = Horde_String::convertCharset(tidy_get_output($tidy), 'UTF-8', $charset);
}
if ($mode == 'html') {
if ($part->getContentTypeParameter('format') == 'flowed') {
$flowed = new Horde_Text_Flowed($msg);
- if (String::lower($part->getContentTypeParameter('delsp')) == 'yes') {
+ if (Horde_String::lower($part->getContentTypeParameter('delsp')) == 'yes') {
$flowed->setDelSp(true);
}
$flowed->setMaxLength(0);
for ($i = 1, $fcount = count($_FILES); $i <= $fcount; ++$i) {
$key = $field . $i;
if (isset($_FILES[$key]) && ($_FILES[$key]['error'] != 4)) {
- $filename = Util::dispelMagicQuotes($_FILES[$key]['name']);
+ $filename = Horde_Util::dispelMagicQuotes($_FILES[$key]['name']);
if (!empty($_FILES[$key]['error'])) {
switch ($_FILES[$key]['error']) {
case UPLOAD_ERR_INI_SIZE:
$headers = array();
foreach (array('to', 'cc', 'bcc', 'subject') as $val) {
- $headers[$val] = $imp_ui->getAddressList(Util::getFormData($val), Util::getFormData($val . '_list'), Util::getFormData($val . '_field'), Util::getFormData($val . '_new'));
+ $headers[$val] = $imp_ui->getAddressList(Horde_Util::getFormData($val), Horde_Util::getFormData($val . '_list'), Horde_Util::getFormData($val . '_field'), Horde_Util::getFormData($val . '_new'));
}
try {
- $body = $this->_saveDraftMsg($headers, Util::getFormData('message', ''), Util::getFormData('charset'), Util::getFormData('rtemode'), false);
+ $body = $this->_saveDraftMsg($headers, Horde_Util::getFormData('message', ''), Horde_Util::getFormData('charset'), Horde_Util::getFormData('rtemode'), false);
} catch (IMP_Compose_Exception $e) {
return;
}
$vfs = VFS::singleton($GLOBALS['conf']['vfs']['type'], Horde::getDriverConfig('vfs', $GLOBALS['conf']['vfs']['type']));
// TODO: Garbage collection?
- $result = $vfs->writeData(self::VFS_DRAFTS_PATH, hash('md5', Util::getFormData('user')), $body, true);
+ $result = $vfs->writeData(self::VFS_DRAFTS_PATH, hash('md5', Horde_Util::getFormData('user')), $body, true);
if (is_a($result, 'PEAR_Error')) {
return;
}
!$part->getContents()) {
$contents = $this->getBodyPart($id, array('length' => empty($options['length']) ? null : $options['length']));
if (($part->getPrimaryType() == 'text') &&
- (String::upper($part->getCharset()) == 'US-ASCII') &&
+ (Horde_String::upper($part->getCharset()) == 'US-ASCII') &&
Horde_Mime::is8bit($contents)) {
- $contents = String::convertCharset($contents, 'US-ASCII');
+ $contents = Horde_String::convertCharset($contents, 'US-ASCII');
}
$part->setContents($contents);
* 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 = String::upper(NLS::getCharset());
+ $default_charset = Horde_String::upper(NLS::getCharset());
if ($default_charset !== 'UTF-8') {
- $charset_upper = String::upper($mime_part->getCharset());
+ $charset_upper = Horde_String::upper($mime_part->getCharset());
if (($charset_upper != 'US-ASCII') &&
($charset_upper != $default_charset)) {
$ret['status'][] = array(
// account for any content-encoding & HTML tags.
$pmime = $this->getMIMEPart($mimeid, array('length' => $maxlen * 3));
$ptext = $pmime->getContents();
- $ptext = String::convertCharset($ptext, $pmime->getCharset());
+ $ptext = Horde_String::convertCharset($ptext, $pmime->getCharset());
if ($pmime->getType() == 'text/html') {
require_once 'Horde/Text/Filter.php';
$ptext = Text_Filter::filter($ptext, 'html2text',
$this->_build = $oldbuild;
- if (String::length($ptext) > $maxlen) {
- return array('cut' => true, 'text' => String::substr($ptext, 0, $maxlen) . ' ...');
+ if (Horde_String::length($ptext) > $maxlen) {
+ return array('cut' => true, 'text' => Horde_String::substr($ptext, 0, $maxlen) . ' ...');
}
return array('cut' => false, 'text' => $ptext);
*/
public function getSummary($id, $mask = 0)
{
- $download_zip = (($mask & self::SUMMARY_DOWNLOAD_ZIP) && Util::extensionExists('zlib'));
+ $download_zip = (($mask & self::SUMMARY_DOWNLOAD_ZIP) && Horde_Util::extensionExists('zlib'));
$param_array = array();
$this->_buildMessage();
($id != 0) &&
(intval($id) != 1) &&
(strpos($id, '.') === false)) {
- $url = Util::removeParameter(Horde::selfUrl(true), array('actionID', 'imapid', 'index'));
- $url = Util::addParameter($url, array('actionID' => 'strip_attachment', 'imapid' => $id, 'index' => $this->_index, 'message_token' => IMP::getRequestToken('imp.impcontents')));
+ $url = Horde_Util::removeParameter(Horde::selfUrl(true), array('actionID', 'imapid', 'index'));
+ $url = Horde_Util::addParameter($url, array('actionID' => 'strip_attachment', 'imapid' => $id, 'index' => $this->_index, 'message_token' => IMP::getRequestToken('imp.impcontents')));
$part['strip'] = Horde::link($url, _("Strip Attachment"), 'stripAtc', null, "return window.confirm('" . addslashes(_("Are you sure you wish to PERMANENTLY delete this attachment?")) . "');") . '</a>';
}
$params = $this->_urlViewParams($mime_part, $actionID, isset($options['params']) ? $options['params'] : array());
return empty($options['dload'])
- ? Util::addParameter(Horde::applicationUrl('view.php'), $params)
+ ? Horde_Util::addParameter(Horde::applicationUrl('view.php'), $params)
: Horde::downloadUrl($mime_part->getName(true), $params);
}
{
$list = $this->getAll($key);
foreach ($list as $val2) {
- if (strpos(String::lower($val), String::lower($val2)) !== false) {
+ if (strpos(Horde_String::lower($val), Horde_String::lower($val2)) !== false) {
return true;
}
}
$abbrev = $label = str_repeat(' ', 4 * $ob['c']) . $ob['l'];
if (strlen($abbrev) > 26) {
- $abbrev = String::substr($abbrev, 0, 10) . '...' . String::substr($abbrev, -13, 13);
+ $abbrev = Horde_String::substr($abbrev, 0, 10) . '...' . Horde_String::substr($abbrev, -13, 13);
}
$list[$ob['v']] = array('val' => $imaptree->isContainer($ob) ? '' : $ob['v'], 'label' => $label, 'abbrev' => $abbrev);
}
return false;
}
- if (Util::getFormData('popup')) {
- Util::closeWindowJS();
+ if (Horde_Util::getFormData('popup')) {
+ Horde_Util::closeWindowJS();
} else {
- $url = Util::addParameter(self::getLogoutUrl(null, true), 'url', Horde::selfUrl(true));
+ $url = Horde_Util::addParameter(self::getLogoutUrl(null, true), 'url', Horde::selfUrl(true));
header('Location: ' . $url);
}
exit;
$fields = array('to', 'cc', 'bcc', 'message', 'body', 'subject');
foreach ($fields as $val) {
- if (($$val = Util::getFormData($val))) {
+ if (($$val = Horde_Util::getFormData($val))) {
$args[$val] = $$val;
}
}
}
$options += self::getComposeArgs();
- $url = Util::addParameter(Horde::applicationUrl('compose.php', true), $options, null, false);
+ $url = Horde_Util::addParameter(Horde::applicationUrl('compose.php', true), $options, null, false);
header('Location: ' . $url);
return true;
}
foreach ($args as $k => $v) {
$encode_args[$k] = rawurlencode($v);
}
- return 'javascript:void(window.open(\'' . Util::addParameter(Horde::applicationUrl('compose-dimp.php'), $encode_args, null, false) . '\', \'\', \'width=820,height=610,status=1,scrollbars=yes,resizable=yes\'));';
+ return 'javascript:void(window.open(\'' . Horde_Util::addParameter(Horde::applicationUrl('compose-dimp.php'), $encode_args, null, false) . '\', \'\', \'width=820,height=610,status=1,scrollbars=yes,resizable=yes\'));';
}
if (($view != 'mimp') &&
return "javascript:" . self::popupIMPString('compose.php', $args);
}
- return Util::addParameter(Horde::applicationUrl(($view == 'mimp') ? 'compose-mimp.php' : 'compose.php'), $args);
+ return Horde_Util::addParameter(Horde::applicationUrl(($view == 'mimp') ? 'compose-mimp.php' : 'compose.php'), $args);
}
/**
if (stripos($out, $key) === 0) {
$len = strlen($key);
if ((strlen($out) == $len) || ($out[$len + 1] == $delimiter)) {
- $out = substr_replace($out, String::convertCharset($val, NLS::getCharset(), 'UTF7-IMAP'), 0, $len);
+ $out = substr_replace($out, Horde_String::convertCharset($val, NLS::getCharset(), 'UTF7-IMAP'), 0, $len);
break;
}
}
}
- $cache[$folder] = String::convertCharset($out, 'UTF7-IMAP');
+ $cache[$folder] = Horde_String::convertCharset($out, 'UTF7-IMAP');
return $cache[$folder];
}
}
if (!empty($mailbox) && !$GLOBALS['imp_imap']->isReadOnly($mailbox)) {
- $menu_trash_url = Util::addParameter(self::generateIMPUrl($menu_mailbox_url, $mailbox), array('actionID' => 'empty_mailbox', 'mailbox_token' => self::getRequestToken('imp.mailbox')));
+ $menu_trash_url = Horde_Util::addParameter(self::generateIMPUrl($menu_mailbox_url, $mailbox), array('actionID' => 'empty_mailbox', 'mailbox_token' => self::getRequestToken('imp.mailbox')));
$menu->add($menu_trash_url, _("Empty _Trash"), 'empty_trash.png', null, null, "return window.confirm('" . addslashes(_("Are you sure you wish to empty your trash folder?")) . "');", '__noselection');
}
}
if (!empty($spam_folder) &&
$prefs->getValue('empty_spam_menu')) {
- $menu_spam_url = Util::addParameter(self::generateIMPUrl($menu_mailbox_url, $spam_folder), array('actionID' => 'empty_mailbox', 'mailbox_token' => self::getRequestToken('imp.mailbox')));
+ $menu_spam_url = Horde_Util::addParameter(self::generateIMPUrl($menu_mailbox_url, $spam_folder), array('actionID' => 'empty_mailbox', 'mailbox_token' => self::getRequestToken('imp.mailbox')));
$menu->add($menu_spam_url, _("Empty _Spam"), 'empty_spam.png', null, null, "return window.confirm('" . addslashes(_("Are you sure you wish to empty your spam folder?")) . "');", '__noselection');
}
}
}
if ($conf['user']['allow_folders']) {
- $menu->add(Util::nocacheUrl(Horde::applicationUrl('folders.php')), _("_Folders"), 'folders/folder.png');
+ $menu->add(Horde_Util::nocacheUrl(Horde::applicationUrl('folders.php')), _("_Folders"), 'folders/folder.png');
}
if ($_SESSION['imp']['protocol'] != 'pop') {
static public function menu()
{
$t = new IMP_Template();
- $t->set('forminput', Util::formInput());
+ $t->set('forminput', Horde_Util::formInput());
$t->set('use_folders', ($_SESSION['imp']['protocol'] != 'pop') && $GLOBALS['conf']['user']['allow_folders'], true);
if ($t->get('use_folders')) {
Horde::addScriptFile('imp.js', 'imp', true);
$folders = array();
foreach ($var as $mb => $nm) {
$folders[] = array(
- 'url' => Util::addParameter(self::generateIMPUrl('mailbox.php', $mb), 'no_newmail_popup', 1),
+ 'url' => Horde_Util::addParameter(self::generateIMPUrl('mailbox.php', $mb), 'no_newmail_popup', 1),
'name' => htmlspecialchars(self::displayFolder($mb)),
'new' => (int)$nm,
);
if (($_SESSION['imp']['protocol'] != 'pop') &&
$GLOBALS['prefs']->getValue('use_vinbox') &&
($vinbox_id = $GLOBALS['prefs']->getValue('vinbox_id'))) {
- $t->set('vinbox', Horde::link(Util::addParameter(self::generateIMPUrl('mailbox.php', $GLOBALS['imp_search']->createSearchID($vinbox_id)), 'no_newmail_popup', 1)));
+ $t->set('vinbox', Horde::link(Horde_Util::addParameter(self::generateIMPUrl('mailbox.php', $GLOBALS['imp_search']->createSearchID($vinbox_id)), 'no_newmail_popup', 1)));
}
} else {
$t->set('msg', ($var == 1) ? _("You have 1 new message.") : sprintf(_("You have %s new messages."), $var));
*/
static public function prefsURL($full = false)
{
- return Util::addParameter(Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/prefs.php', $full), array('app' => 'imp'));
+ return Horde_Util::addParameter(Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/prefs.php', $full), array('app' => 'imp'));
}
/**
static public function generateIMPUrl($page, $mailbox, $uid = null,
$tmailbox = null, $encode = true)
{
- return Util::addParameter(Horde::applicationUrl($page), self::getIMPMboxParameters($mailbox, $uid, $tmailbox), null, $encode);
+ return Horde_Util::addParameter(Horde::applicationUrl($page), self::getIMPMboxParameters($mailbox, $uid, $tmailbox), null, $encode);
}
/**
*/
static public function getCurrentMailboxInfo()
{
- $mbox = Util::getFormData('mailbox');
+ $mbox = Horde_Util::getFormData('mailbox');
return array(
'mailbox' => empty($mbox) ? 'INBOX' : $mbox,
- 'thismailbox' => Util::getFormData('thismailbox', $mbox),
- 'index' => Util::getFormData('index')
+ 'thismailbox' => Horde_Util::getFormData('thismailbox', $mbox),
+ 'index' => Horde_Util::getFormData('index')
);
}
$params = array_filter(array(
'server_key' => isset($_SESSION['imp']['server_key']) ?
$_SESSION['imp']['server_key'] :
- Util::getFormData('server_key'),
- 'language' => Util::getFormData('language')
+ Horde_Util::getFormData('server_key'),
+ 'language' => Horde_Util::getFormData('language')
));
if ($force ||
: Auth::addLogoutParameters($url, $reason);
if (!empty($params)) {
- $url = Util::addParameter($url, $params, null, false);
+ $url = Horde_Util::addParameter($url, $params, null, false);
}
return $url;
static public function popupIMPString($url, $params = array(),
$width = 700, $height = 650)
{
- return "IMP.popup('" . Horde::applicationUrl($url) . "'," . $width . "," . $height . ",'" . $GLOBALS['browser']->escapeJSCode(str_replace('+', '%20', substr(Util::addParameter('', $params, null, false), 1))) . "');";
+ return "IMP.popup('" . Horde::applicationUrl($url) . "'," . $width . "," . $height . ",'" . $GLOBALS['browser']->escapeJSCode(str_replace('+', '%20', substr(Horde_Util::addParameter('', $params, null, false), 1))) . "');";
}
/**
*/
static public function getTidyConfig($size)
{
- if (!Util::extensionExists('tidy') ||
+ if (!Horde_Util::extensionExists('tidy') ||
function_exists('tidy_load_config') &&
($size > 250000)) {
return false;
/* Prepare email validator */
require_once 'Horde/Form.php';
- require_once 'Horde/Variables.php';
$email = new Horde_Form_Type_email();
- $vars = new Variables();
+ $vars = new Horde_Variables();
$var = new Horde_Form_Variable('', 'replyto_addr', $email, false);
/* Verify From address. */
{
static $list;
- $address = String::lower($address);
+ $address = Horde_String::lower($address);
if (!isset($list)) {
$list = $this->getAllFromAddresses(true);
}
foreach ($this->_identitiesWithDefaultLast() as $key => $identity) {
/* Get From Addresses. */
- $list[String::lower($this->getFromAddress($key))] = $key;
+ $list[Horde_String::lower($this->getFromAddress($key))] = $key;
/* Get Aliases. */
if ($alias) {
$addrs = $this->getAliasAddress($key);
if (!empty($addrs)) {
foreach (array_filter($addrs) as $val) {
- $list[String::lower($val)] = $key;
+ $list[Horde_String::lower($val)] = $key;
}
}
}
if (!empty($address['host'])) {
$find_address .= '@' . $address['host'];
}
- $find_address = String::lower($find_address);
+ $find_address = Horde_String::lower($find_address);
/* Search 'tieto' addresses first. */
/* Check for this address explicitly. */
}
$elt = $this->_makeElt($val, self::ELT_VFOLDER | self::ELT_IS_SUBSCRIBED);
- $elt['l'] = $elt['v'] = String::substr($val, String::length($this->VFOLDER_KEY) + String::length($this->_delimiter));
+ $elt['l'] = $elt['v'] = Horde_String::substr($val, Horde_String::length($this->VFOLDER_KEY) + Horde_String::length($this->_delimiter));
$this->_insertElt($elt);
} else {
/* Break apart the name via the delimiter and go step by
{
// Avoid errors if 'input' isn't set and short-circuit empty searches.
if (empty($args['input']) ||
- !($input = Util::getPost($args['input']))) {
+ !($input = Horde_Util::getPost($args['input']))) {
return array();
}
}
try {
- return $speller->spellCheck(Util::getPost($args['input']));
+ return $speller->spellCheck(Horde_Util::getPost($args['input']));
} catch (Exception $e) {
Horde::logMessage($e, __FILE__, __LINE__, PEAR_LOG_ERR);
return array('bad' => array(), 'suggestions' => array());
(empty($GLOBALS['conf']['hooks']['disable_compose']) ||
Horde::callHook('_imp_hook_disable_compose', array(true), 'imp'))) {
- $items[Util::addParameter(Horde::applicationUrl('compose-mimp.php'), 'u', uniqid(mt_rand()))] = _("New Message");
+ $items[Horde_Util::addParameter(Horde::applicationUrl('compose-mimp.php'), 'u', uniqid(mt_rand()))] = _("New Message");
}
if ($page != 'folders') {
// @TODO - Options for mobile browsers
// if ($options_link = Horde::getServiceLink('options', 'mimp')) {
- // $items[Util::addParameter($options_link, 'mobile', 1, false)] = _("Options");
+ // $items[Horde_Util::addParameter($options_link, 'mobile', 1, false)] = _("Options");
// }
$logout_link = IMP::getLogoutUrl(AUTH_REASON_LOGOUT);
if (!empty($logout_link)) {
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] = 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]"), NLS::getCharset(), 'UTF7-IMAP');
}
}
}
$text = (substr($GLOBALS['language'], 0, 2) == 'en') ? strtolower(strftime('-%b-%Y', $last_maintenance)) : strftime('-%m-%Y', $last_maintenance);
- return $folder . String::convertCharset($text, NLS::getExternalCharset(), 'UTF7-IMAP');
+ return $folder . Horde_String::convertCharset($text, NLS::getExternalCharset(), 'UTF7-IMAP');
}
}
*/
function doMaintenance()
{
- $result = Util::getFormData('not_agree');
+ $result = Horde_Util::getFormData('not_agree');
if (isset($result)) {
header('Location: ' . IMP::getLogoutUrl(array(AUTH_REASON_MESSAGE => _("You did not agree to the Terms of Service agreement, so you were not allowed to login.")), true));
exit;
/* 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 = String::convertCharset($body, $body_part->getCharset(), NLS::getCharset());
+ $body = Horde_String::convertCharset($body, $body_part->getCharset(), NLS::getCharset());
/* Create a new iCalendar. */
$vCal = new Horde_iCalendar();
$msg_charset = $this->_mimepart->getCharset();
if ($inline) {
- $data = String::convertCharset($data, $msg_charset);
+ $data = Horde_String::convertCharset($data, $msg_charset);
$msg_charset = $charset;
}
/* Run tidy on the HTML. */
if ($this->getConfigParam('tidy') &&
- ($tidy_config = IMP::getTidyConfig(String::length($data)))) {
+ ($tidy_config = IMP::getTidyConfig(Horde_String::length($data)))) {
if ($msg_charset == 'us-ascii') {
$tidy = tidy_parse_string($data, $tidy_config, 'ascii');
$tidy->cleanRepair();
$data = tidy_get_output($tidy);
} else {
- $tidy = tidy_parse_string(String::convertCharset($data, $msg_charset, 'UTF-8'), $tidy_config, 'utf8');
+ $tidy = tidy_parse_string(Horde_String::convertCharset($data, $msg_charset, 'UTF-8'), $tidy_config, 'utf8');
$tidy->cleanRepair();
- $data = String::convertCharset(tidy_get_output($tidy), 'UTF-8', $msg_charset);
+ $data = Horde_String::convertCharset(tidy_get_output($tidy), 'UTF-8', $msg_charset);
}
}
preg_match($this->_img_regex, $data)) {
/* Make sure the URL parameters are correct for the current
* message. */
- $url = Util::removeParameter(IMP::selfUrl(), array('actionID', 'index'));
- $url = Util::addParameter($url, 'index', $this->_params['contents']->getIndex());
+ $url = Horde_Util::removeParameter(IMP::selfUrl(), array('actionID', 'index'));
+ $url = Horde_Util::addParameter($url, 'index', $this->_params['contents']->getIndex());
- $view_img = Util::getFormData('view_html_images');
+ $view_img = Horde_Util::getFormData('view_html_images');
$addr_check = ($GLOBALS['prefs']->getValue('html_image_addrbook') && $this->_inAddressBook());
if (!$view_img && !$addr_check) {
- $data .= Util::bufferOutput(array('Horde', 'addScriptFile'), 'prototype.js', 'horde', true) .
- Util::bufferOutput(array('Horde', 'addScriptFile'), 'imp.js', 'imp', true);
+ $data .= Horde_Util::bufferOutput(array('Horde', 'addScriptFile'), 'prototype.js', 'horde', true) .
+ Horde_Util::bufferOutput(array('Horde', 'addScriptFile'), 'imp.js', 'imp', true);
// Unblock javascript code in js/src/imp.js
$cleanhtml['status'][] = array(
'icon' => Horde::img('mime/image.png'),
'text' => array(
- String::convertCharset(_("Images have been blocked to protect your privacy."), $charset, $msg_charset),
- Horde::link(Util::addParameter($url, 'view_html_images', 1), '', 'unblockImageLink') . String::convertCharset(_("Show Images?"), $charset, $msg_charset) . '</a>'
+ Horde_String::convertCharset(_("Images have been blocked to protect your privacy."), $charset, $msg_charset),
+ Horde::link(Horde_Util::addParameter($url, 'view_html_images', 1), '', 'unblockImageLink') . Horde_String::convertCharset(_("Show Images?"), $charset, $msg_charset) . '</a>'
)
);
*/
protected function _mailtoCallback($m)
{
- return 'href="' . $GLOBALS['registry']->call('mail/compose', array(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', NLS::getCharset()))) . '"';
}
/**
*/
protected function _render()
{
- switch (Util::getFormData('imp_img_view')) {
+ switch (Horde_Util::getFormData('imp_img_view')) {
case 'data':
/* If calling page is asking us to output data, do that without
* any further delay and exit. */
*/
protected function _popupImageWindow()
{
- $self_url = Util::addParameter(IMP::selfUrl(), array('imp_img_view' => ((Util::getFormData('imp_img_view') == 'load_convert') ? 'view_convert' : 'data')));
+ $self_url = Horde_Util::addParameter(IMP::selfUrl(), array('imp_img_view' => ((Horde_Util::getFormData('imp_img_view') == 'load_convert') ? 'view_convert' : 'data')));
$title = $this->_mimepart->getName(true);
$str = <<<EOD
if (!empty($GLOBALS['conf']['image']['convert'])) {
$context['convert'] = $GLOBALS['conf']['image']['convert'];
$img = Horde_Image::factory('Im', array('context' => $context));
- } elseif (Util::extensionExists('gd')) {
+ } elseif (Horde_Util::extensionExists('gd')) {
$img = Horde_Image::factory('Gd', array('context' => $context));
}
$ret = $this->_renderInline();
if (!empty($ret)) {
reset($ret);
- $ret[key($ret)]['data'] = Util::bufferOutput('include', $GLOBALS['registry']->get('templates', 'horde') . '/common-header.inc') .
+ $ret[key($ret)]['data'] = Horde_Util::bufferOutput('include', $GLOBALS['registry']->get('templates', 'horde') . '/common-header.inc') .
$ret[key($ret)]['data'] .
- Util::bufferOutput('include', $GLOBALS['registry']->get('templates', 'horde') . '/common-footer.inc');
+ Horde_Util::bufferOutput('include', $GLOBALS['registry']->get('templates', 'horde') . '/common-footer.inc');
}
return $ret;
}
$msgs = array();
// Handle the action requests.
- $actions = Util::getFormData('itip_action', array());
+ $actions = Horde_Util::getFormData('itip_action', array());
foreach ($actions as $key => $action) {
switch ($action) {
case 'delete':
$body = new Horde_Mime_Part();
$body->setType('text/plain');
$body->setCharset($charset);
- $body->setContents(String::wrap($message, 76, "\n"));
+ $body->setContents(Horde_String::wrap($message, 76, "\n"));
$ics = new Horde_Mime_Part();
$ics->setType('text/calendar');
$msg_headers->addHeader('From', $email);
$msg_headers->addHeader('To', $organizerEmail);
- $identity->setDefault(Util::getFormData('identity'));
+ $identity->setDefault(Horde_Util::getFormData('identity'));
$replyto = $identity->getValue('replyto_addr');
if (!empty($replyto) && ($replyto != $email)) {
$msg_headers->addHeader('Reply-to', $replyto);
$message = _("Attached is a reply to a calendar request you sent.");
$body = new Horde_Mime_Part('text/plain',
- String::wrap($message, 76, "\n"),
+ Horde_String::wrap($message, 76, "\n"),
$charset);
$ics = new Horde_Mime_Part('text/calendar', $vCal->exportvCalendar());
$msg_headers->addHeader('From', $email);
$msg_headers->addHeader('To', $organizerEmail);
- $identity->setDefault(Util::getFormData('identity'));
+ $identity->setDefault(Horde_Util::getFormData('identity'));
$replyto = $identity->getValue('replyto_addr');
if (!empty($replyto) && ($replyto != $email)) {
$msg_headers->addHeader('Reply-to', $replyto);
protected function _render()
{
/* Create the thumbnail and display. */
- if (!Util::getFormData('pdf_view_thumbnail')) {
+ if (!Horde_Util::getFormData('pdf_view_thumbnail')) {
return parent::_render();
}
$this->_imppgp = Horde_Crypt::singleton(array('IMP', 'Pgp'));
}
- if (Util::getFormData('rawpgpkey')) {
+ if (Horde_Util::getFormData('rawpgpkey')) {
return array(
$this->_mimepart->getMimeId() => array(
'data' => $this->_mimepart->getContents(),
$status[] = _("The message below has been digitally signed via PGP.");
if ($GLOBALS['prefs']->getValue('pgp_verify') ||
- Util::getFormData('pgp_verify_msg')) {
+ Horde_Util::getFormData('pgp_verify_msg')) {
$graphicsdir = $GLOBALS['registry']->getImageDir('horde');
$sig_part = $this->_params['contents']->getMIMEPart($sig_id);
} else {
switch ($_SESSION['imp']['view']) {
case 'imp':
- $status[] = Horde::link(Util::addParameter(IMP::selfUrl(), array('pgp_verify_msg' => 1))) . _("Click HERE to verify the message.") . '</a>';
+ $status[] = Horde::link(Horde_Util::addParameter(IMP::selfUrl(), array('pgp_verify_msg' => 1))) . _("Click HERE to verify the message.") . '</a>';
break;
case 'dimp':
}
// Convert to the local charset.
- $text = String::convertCharset($text, $this->_mimepart->getCharset());
+ $text = Horde_String::convertCharset($text, $this->_mimepart->getCharset());
// Check for 'flowed' text data.
if ($this->_mimepart->getContentTypeParameter('format') == 'flowed') {
$part2 = new Horde_Mime_Part();
$part2->setType('application/x-imp-pgp-signature');
- $part2->setContents(String::convertCharset(implode("\n", $val['data']) . "\n" . implode("\n", $sig['data']), $charset));
+ $part2->setContents(Horde_String::convertCharset(implode("\n", $val['data']) . "\n" . implode("\n", $sig['data']), $charset));
$part->addPart($part1);
$part->addPart($part2);
*/
protected function _parseUUencode()
{
- $text = String::convertCharset($this->_mimepart->getContents(), $this->_mimepart->getCharset());
+ $text = Horde_String::convertCharset($this->_mimepart->getContents(), $this->_mimepart->getCharset());
/* Don't want to use convert_uudecode() here as there may be multiple
* files residing in the text. */
/* Check to see if S/MIME support is available. */
$this->_initSMIME();
- if (Util::getFormData('view_smime_key')) {
+ if (Horde_Util::getFormData('view_smime_key')) {
return $this->_outputSMIMEKey();
}
$sig_result = null;
if ($GLOBALS['prefs']->getValue('smime_verify') ||
- Util::getFormData('smime_verify_msg')) {
+ Horde_Util::getFormData('smime_verify_msg')) {
try {
$sig_result = $this->_impsmime->verifySignature($raw_text);
} catch (Horde_Exception $e) {
} else {
switch ($_SESSION['imp']['view']) {
case 'imp':
- $status[] = Horde::link(Util::addParameter(IMP::selfUrl(), 'smime_verify_msg', 1)) . _("Click HERE to verify the message.") . '</a>';
+ $status[] = Horde::link(Horde_Util::addParameter(IMP::selfUrl(), 'smime_verify_msg', 1)) . _("Click HERE to verify the message.") . '</a>';
break;
case 'dimp':
*/
protected function _render()
{
- if (!Util::getFormData('tnef_attachment')) {
+ if (!Horde_Util::getFormData('tnef_attachment')) {
$ret = $this->_renderInfo();
reset($ret);
$ret[key($ret)]['data'] = '<html><body>' . $ret[key($ret)]['data'] . '</body></html>';
/* Display the requested file. Its position in the $tnefData
* array can be found in 'tnef_attachment'. */
- $tnefKey = Util::getFormData('tnef_attachment') - 1;
+ $tnefKey = Horde_Util::getFormData('tnef_attachment') - 1;
/* Verify that the requested file exists. */
if (isset($tnefData[$tnefKey])) {
*/
protected function _render()
{
- if (!Util::getFormData('zip_attachment')) {
+ if (!Horde_Util::getFormData('zip_attachment')) {
$this->_callback = array(&$this, '_IMPcallback');
return parent::_render();
}
* in 'zip_attachment'. */
$data = $this->_mimepart->getContents();
$zip = &Horde_Compress::singleton('zip');
- $fileKey = Util::getFormData('zip_attachment') - 1;
+ $fileKey = Horde_Util::getFormData('zip_attachment') - 1;
$zipInfo = $zip->decompress($data, array('action' => HORDE_COMPRESS_ZIP_LIST));
/* Verify that the requested file exists. */
$name = preg_replace('/( )+$/', '', $val['name']);
if (!empty($val['size']) && (strstr($val['attr'], 'D') === false) &&
- ((($val['method'] == 0x8) && Util::extensionExists('zlib')) ||
+ ((($val['method'] == 0x8) && Horde_Util::extensionExists('zlib')) ||
($val['method'] == 0x0))) {
$mime_part = $this->_mimepart;
$mime_part->setName(basename($name));
public function editURL($id = null)
{
$id = $this->_strip($id);
- return Util::addParameter(Horde::applicationUrl('search.php'), array('edit_query' => $id));
+ return Horde_Util::addParameter(Horde::applicationUrl('search.php'), array('edit_query' => $id));
}
/**
public function deleteURL($id = null)
{
$id = $this->_strip($id);
- return Util::addParameter(Horde::applicationUrl('folders.php'),
+ return Horde_Util::addParameter(Horde::applicationUrl('folders.php'),
array('actionID' => 'delete_search_query',
'folders_token' => IMP::getRequestToken('imp.folders'),
'queryid' => $id,
{
/* TODO: For now, redirect MIMP to mailbox page. */
if ($_SESSION['imp']['view'] == 'mimp') {
- $url = Util::addParameter(Horde::applicationUrl('mailbox-mimp.php', true), array('mailbox' => 'INBOX'));
+ $url = Horde_Util::addParameter(Horde::applicationUrl('mailbox-mimp.php', true), array('mailbox' => 'INBOX'));
if (!empty($actionID)) {
- $url = Util::addParameter($url, array('actionID' => $actionID), null, false);
+ $url = Horde_Util::addParameter($url, array('actionID' => $actionID), null, false);
}
return $url;
}
}
if ($init_url == 'folders.php') {
- $url = Util::addParameter(Horde::applicationUrl($init_url, !$encode), array_merge(array('folders_token' => IMP::getRequestToken('imp.folders')), IMP::getComposeArgs()), null, $encode);
+ $url = Horde_Util::addParameter(Horde::applicationUrl($init_url, !$encode), array_merge(array('folders_token' => IMP::getRequestToken('imp.folders')), IMP::getComposeArgs()), null, $encode);
} else {
- $url = Util::addParameter(Horde::applicationUrl('mailbox.php', !$encode), array_merge(array('mailbox' => $init_url, 'mailbox_token' => IMP::getRequestToken('imp.mailbox')), IMP::getComposeArgs()), null, $encode);
+ $url = Horde_Util::addParameter(Horde::applicationUrl('mailbox.php', !$encode), array_merge(array('mailbox' => $init_url, 'mailbox_token' => IMP::getRequestToken('imp.mailbox')), IMP::getComposeArgs()), null, $encode);
}
if (!empty($actionID)) {
- $url = Util::addParameter($url, 'actionID', $actionID, $encode);
+ $url = Horde_Util::addParameter($url, 'actionID', $actionID, $encode);
}
return $url;
$clean_to = '';
foreach (Horde_Mime_Address::explode($to, ',;') as $val) {
$val = trim($val);
- $clean_to .= $val . (($val[String::length($val) - 1] == ';') ? ' ' : ', ');
+ $clean_to .= $val . (($val[Horde_String::length($val) - 1] == ';') ? ' ' : ', ');
}
if ($expand) {
return $clean_to;
$add_link = $registry->link('contacts/add', array('source' => $prefs->getValue('add_source')));
if (is_a($add_link, 'PEAR_Error')) {
$add_link = $registry->hasMethod('contacts/import')
- ? Util::addParameter($addURL, 'actionID', 'add_address')
+ ? Horde_Util::addParameter($addURL, 'actionID', 'add_address')
: null;
}
}
/* Append the add address icon to every address if contact
* manager is available. */
if ($add_link) {
- $curr_link = Util::addParameter($add_link, array('name' => $ad['personal'], 'address' => $ad['inner']));
+ $curr_link = Horde_Util::addParameter($add_link, array('name' => $ad['personal'], 'address' => $ad['inner']));
$ret .= Horde::link($curr_link, sprintf(_("Add %s to my Address Book"), $ad['inner'])) .
Horde::img('addressbook_add.png', sprintf(_("Add %s to my Address Book"), $ad['inner'])) . '</a>';
}
/* Append the add address icon to every address if contact
* manager is available. */
if ($add_link) {
- $curr_link = Util::addParameter($add_link, array('name' => $ob['personal'], 'address' => $ob['inner']));
+ $curr_link = Horde_Util::addParameter($add_link, array('name' => $ob['personal'], 'address' => $ob['inner']));
$ret .= Horde::link($curr_link, sprintf(_("Add %s to my Address Book"), $ob['inner'])) .
Horde::img('addressbook_add.png', sprintf(_("Add %s to my Address Book"), $ob['inner'])) . '</a>';
}
$result[$head] = $result['reply-to'];
unset($result['reply-to']);
}
- $headers[] = array('id' => String::ucfirst($head), 'name' => $str, 'value' => '');
+ $headers[] = array('id' => Horde_String::ucfirst($head), 'name' => $str, 'value' => '');
} elseif ($val = $mime_headers->getValue($head)) {
if ($head == 'date') {
/* Add local time to date header. */
$val = htmlspecialchars($val);
}
if (!$preview) {
- $headers[] = array('id' => String::ucfirst($head), 'name' => $str, 'value' => $val);
+ $headers[] = array('id' => Horde_String::ucfirst($head), 'name' => $str, 'value' => $val);
}
}
}
switch ($task) {
case 'add':
- return $imap->addMailbox(String::convertCharset($params[0], NLS::getCharset(), 'utf7-imap'));
+ return $imap->addMailbox(Horde_String::convertCharset($params[0], NLS::getCharset(), 'utf7-imap'));
case 'remove':
- return $imap->removeMailbox(String::convertCharset($params[0], NLS::getCharset(), 'utf7-imap'));
+ return $imap->removeMailbox(Horde_String::convertCharset($params[0], NLS::getCharset(), 'utf7-imap'));
case 'list':
return $imap->listMailboxes();
// Registry.
$s_ctrl = 0;
-switch (Util::nonInputVar('session_control')) {
+switch (Horde_Util::nonInputVar('session_control')) {
case 'netscape':
if ($browser->isBrowser('mozilla')) {
session_cache_limiter('private, must-revalidate');
// We explicitly do not check application permissions for the compose
// and login pages, since those are handled below and need to fall through
// to IMP-specific code.
-$compose_page = Util::nonInputVar('compose_page');
+$compose_page = Horde_Util::nonInputVar('compose_page');
if (is_a(($pushed = $registry->pushApp('imp', !(defined('AUTH_HANDLER') || $compose_page))), 'PEAR_Error')) {
if ($pushed->getCode() == 'permission_denied') {
Horde::authenticationFailureRedirect();
}
// Start compression.
-if (!Util::nonInputVar('no_compress')) {
+if (!Horde_Util::nonInputVar('no_compress')) {
Horde::compressOutput();
}
? $_SESSION['imp']['view']
: 'imp';
-$authentication = Util::nonInputVar('authentication', 0);
+$authentication = Horde_Util::nonInputVar('authentication', 0);
if ($authentication !== 'none') {
// If we've gotten to this point and have valid login credentials
// but don't actually have an IMP session, then we need to go
} elseif ($viewmode == 'dimp') {
// Handle session timeouts
if (!IMP::checkAuthentication(true)) {
- switch (Util::nonInputVar('session_timeout')) {
+ switch (Horde_Util::nonInputVar('session_timeout')) {
case 'json':
$GLOBALS['notification']->push(null, 'dimp.timeout');
Horde::sendHTTPResponse(Horde::prepareResponse(), 'json');
exit;
default:
- Horde::redirect(Util::addParameter(Horde::url($GLOBALS['registry']->get('webroot', 'imp') . '/redirect.php'), 'url', Horde::selfUrl(true)));
+ Horde::redirect(Horde_Util::addParameter(Horde::url($GLOBALS['registry']->get('webroot', 'imp') . '/redirect.php'), 'url', Horde::selfUrl(true)));
}
}
} else {
}
// Handle logout requests
-if (($viewmode == 'dimp') && Util::nonInputVar('dimp_logout')) {
+if (($viewmode == 'dimp') && Horde_Util::nonInputVar('dimp_logout')) {
Horde::redirect(str_replace('&', '&', IMP::getLogoutUrl()));
}
// Notification system.
$notification = &Notification::singleton();
if (($viewmode == 'mimp') ||
- (Util::nonInputVar('login_page') && $GLOBALS['browser']->isMobile())) {
+ (Horde_Util::nonInputVar('login_page') && $GLOBALS['browser']->isMobile())) {
require_once 'Horde/Notification/Listener/mobile.php';
$GLOBALS['imp_notify'] = &$notification->attach('status', null, 'Notification_Listener_mobile');
} elseif ($viewmode == 'dimp') {
if ($viewmode == 'mimp') {
// Mobile markup renderer.
- $debug = Util::nonInputVar('mimp_debug');
+ $debug = Horde_Util::nonInputVar('mimp_debug');
$GLOBALS['mimp_render'] = new Horde_Mobile(null, $debug);
$GLOBALS['mimp_render']->set('debug', !empty($debug));
}
if ($conf['user']['allow_folders'] &&
!$prefs->isLocked('sent_mail_folder')) {
- $sent_mail_folder = Util::getFormData('sent_mail_folder');
- $sent_mail_new = String::convertCharset(Util::getFormData('sent_mail_new'), NLS::getCharset(), 'UTF7-IMAP');
+ $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_default = $prefs->getValue('sent_mail_folder');
if (empty($sent_mail_folder) && !empty($sent_mail_new)) {
$sent_mail_folder = IMP::appendNamespace($sent_mail_new);
global $conf, $prefs;
if ($conf['user']['allow_folders']) {
- $folder = Util::getFormData($folder);
+ $folder = Horde_Util::getFormData($folder);
if (isset($folder) && !$prefs->isLocked($pref)) {
- $new = String::convertCharset(Util::getFormData($new), NLS::getCharset(), 'UTF7-IMAP');
+ $new = Horde_String::convertCharset(Horde_Util::getFormData($new), NLS::getCharset(), 'UTF7-IMAP');
if ($folder == IMP_PREF_NO_FOLDER) {
$prefs->setValue($pref, '');
} else {
global $prefs;
$ret = true;
- if (Util::getFormData('trash') == IMP_PREF_VTRASH) {
+ if (Horde_Util::getFormData('trash') == IMP_PREF_VTRASH) {
if ($prefs->isLocked('use_vtrash')) {
$ret = false;
} else {
{
global $prefs;
- $search_sources = Util::getFormData('search_sources');
+ $search_sources = Horde_Util::getFormData('search_sources');
if (!is_null($search_sources)) {
$prefs->setValue('search_sources', $search_sources);
unset($_SESSION['imp']['cache']['ac_ajax']);
$updated = true;
}
- $search_fields_string = Util::getFormData('search_fields_string');
+ $search_fields_string = Horde_Util::getFormData('search_fields_string');
if (!is_null($search_fields_string)) {
$prefs->setValue('search_fields', $search_fields_string);
$updated = true;
}
- $add_source = Util::getFormData('add_source');
+ $add_source = Horde_Util::getFormData('add_source');
if (!is_null($add_source)) {
$prefs->setValue('add_source', $add_source);
$updated = true;
function handle_initialpageselect($updated)
{
- $initial_page = Util::getFormData('initial_page');
+ $initial_page = Horde_Util::getFormData('initial_page');
$GLOBALS['prefs']->setValue('initial_page', $initial_page);
return true;
}
function handle_encryptselect($updated)
{
- $default_encrypt = Util::getFormData('default_encrypt');
+ $default_encrypt = Horde_Util::getFormData('default_encrypt');
$GLOBALS['prefs']->setValue('default_encrypt', $default_encrypt);
return true;
}
function handle_defaultsearchselect($updated)
{
- $default_search = Util::getFormData('default_search');
+ $default_search = Horde_Util::getFormData('default_search');
$GLOBALS['prefs']->setValue('default_search', $default_search);
return true;
}
function handle_soundselect($updated)
{
- return $GLOBALS['prefs']->setValue('nav_audio', Util::getFormData('nav_audio'));
+ return $GLOBALS['prefs']->setValue('nav_audio', Horde_Util::getFormData('nav_audio'));
}
function handle_flagmanagement($updated)
{
$imp_flags = &IMP_Imap_Flags::singleton();
- $flag_action = Util::getFormData('flag_action');
- $flag_data = Util::getFormData('flag_data');
+ $flag_action = Horde_Util::getFormData('flag_action');
+ $flag_data = Horde_Util::getFormData('flag_data');
if ($flag_action == 'add') {
$imp_flags->addFlag($flag_data);
default:
/* Change labels for user-defined flags. */
if ($val['t'] == 'imapp') {
- $label = Util::getFormData('label_' . $md5);
+ $label = Horde_Util::getFormData('label_' . $md5);
if (strlen($label) && ($label != $val['l'])) {
$imp_flags->updateFlag($key, array('l' => $label));
}
}
/* Change background for all flags. */
- $bg = strtolower(Util::getFormData('bg_' . $md5));
+ $bg = strtolower(Horde_Util::getFormData('bg_' . $md5));
if ((isset($val['b']) && ($bg != $val['b'])) ||
(!isset($val['b']) && ($bg != $def_color))) {
$imp_flags->updateFlag($key, array('b' => $bg));
/* Make sure we have an active IMAP stream. */
if (!$GLOBALS['registry']->call('mail/server')) {
- header('Location: ' . Util::addParameter(Horde::applicationUrl('redirect.php'), 'url', Horde::selfUrl(true)));
+ header('Location: ' . Horde_Util::addParameter(Horde::applicationUrl('redirect.php'), 'url', Horde::selfUrl(true)));
exit;
}
require_once dirname(__FILE__) . '/lib/base.php';
/* Set the 'preferred' server. */
-$pref_server = Util::getFormData('server');
+$pref_server = Horde_Util::getFormData('server');
if (!empty($pref_server)) {
IMP_Session::$prefServer = $pref_server;
}
$auth = &Auth::singleton($conf['auth']['driver']);
$logout_reason = $auth->getLogoutReason();
-$actionID = (Util::getFormData('action') == 'compose') ? 'login_compose' : Util::getFormData('actionID');
-$url_param = Util::getFormData('url');
+$actionID = (Horde_Util::getFormData('action') == 'compose') ? 'login_compose' : Horde_Util::getFormData('actionID');
+$url_param = Horde_Util::getFormData('url');
/* Handle cases where we already have a session. */
if (!empty($_SESSION['imp']) && is_array($_SESSION['imp'])) {
$url = Auth::addLogoutParameters($conf['user']['redirect_on_logout'], AUTH_REASON_LOGOUT);
}
if (!isset($_COOKIE[session_name()])) {
- $url = Util::addParameter($url, session_name(), session_id());
+ $url = Horde_Util::addParameter($url, session_name(), session_id());
}
header('Location: ' . $url);
exit;
if (!empty($conf['auth']['alternate_login'])) {
$url = Auth::addLogoutParameters($conf['auth']['alternate_login']);
if (!isset($_COOKIE[session_name()])) {
- $url = Util::addParameter($url, session_name(), session_id(), false);
+ $url = Horde_Util::addParameter($url, session_name(), session_id(), false);
}
if ($url_param) {
- $url = Util::addParameter($url, 'url', $url_param, false);
+ $url = Horde_Util::addParameter($url, 'url', $url_param, false);
}
header('Location: ' . $url);
exit;
} elseif ($conf['user']['alternate_login']) {
$url = Auth::addLogoutParameters($conf['user']['alternate_login']);
if (!isset($_COOKIE[session_name()])) {
- $url = Util::addParameter($url, session_name(), session_id(), false);
+ $url = Horde_Util::addParameter($url, session_name(), session_id(), false);
}
header('Location: ' . $url);
exit;
* make sure that the Horde auth key gets set instead. */
Horde_Secret::setKey($imp_auth ? 'auth' : 'imp');
-$autologin = Util::getFormData('autologin', false);
-$server_key = Util::getFormData('server_key', IMP_Session::getAutoLoginServer());
+$autologin = Horde_Util::getFormData('autologin', false);
+$server_key = Horde_Util::getFormData('server_key', IMP_Session::getAutoLoginServer());
if (($servers = $GLOBALS['imp_imap']->loadServerConfig()) === false) {
$servers = array();
}
if (count($used_servers) == 1) {
$params['server_key'] = key($used_servers);
}
- $url = Util::addParameter($url, $params, null, false);
+ $url = Horde_Util::addParameter($url, $params, null, false);
header('Location: ' . $url);
exit;
}
$t->set('action', Horde::url('redirect.php', false, -1, true));
$t->set('imp_auth', intval($imp_auth));
-$t->set('formInput', Util::formInput());
+$t->set('formInput', Horde_Util::formInput());
$t->set('actionID', htmlspecialchars($actionID));
$t->set('url', htmlspecialchars($url_param));
$t->set('autologin', intval($autologin));
-$t->set('anchor_string', htmlspecialchars(Util::getFormData('anchor_string')));
+$t->set('anchor_string', htmlspecialchars(Horde_Util::getFormData('anchor_string')));
$t->set('server_key', (!$display_list) ? htmlspecialchars($server_key) : null);
/* Do we need to do IE version detection? */
}
$t->set('username_tabindex', ++$tabindex);
-$t->set('username', htmlspecialchars(Util::getFormData('imapuser')));
+$t->set('username', htmlspecialchars(Horde_Util::getFormData('imapuser')));
$t->set('user_vinfo', null);
if (!empty($conf['hooks']['vinfo'])) {
$t->set('user_vinfo', Horde::callHook('_imp_hook_vinfo', array('vdomain'), 'imp'));
$t->set('signup_link', false);
if ($conf['signup']['allow'] && isset($auth) && $auth->hasCapability('add')) {
$t->set('signup_text', _("Don't have an account? Sign up."));
- $t->set('signup_link', Horde::link(Util::addParameter(Horde::url($registry->get('webroot', 'horde') . '/signup.php'), 'url', $url_param), $t->get('signup_text'), 'light'));
+ $t->set('signup_link', Horde::link(Horde_Util::addParameter(Horde::url($registry->get('webroot', 'horde') . '/signup.php'), 'url', $url_param), $t->get('signup_text'), 'light'));
}
$login_page = true;
: array('server_key' => '');
IMP::addInlineScript(array(
- 'ImpLogin.autologin_url = ' . Horde_Serialize::serialize(Util::addParameter(Horde::selfUrl(), $login_params, null, false), Horde_Serialize::JSON, $charset),
+ 'ImpLogin.autologin_url = ' . Horde_Serialize::serialize(Horde_Util::addParameter(Horde::selfUrl(), $login_params, null, false), Horde_Serialize::JSON, $charset),
'ImpLogin.ie_clientcaps = ' . intval($t->get('ie_clientcaps')),
'ImpLogin.imp_auth = ' . intval($imp_auth),
'ImpLogin.lang_url = ' . Horde_Serialize::serialize($lang_url, Horde_Serialize::JSON, $charset),
NLS::setTimeZone();
/* Run through the action handlers */
-$actionID = Util::getFormData('a');
+$actionID = Horde_Util::getFormData('a');
switch ($actionID) {
// 'm' = message missing
case 'm':
// 'c' = change sort
case 'c':
- IMP::setSort(Util::getFormData('sb'), Util::getFormData('sd'));
+ IMP::setSort(Horde_Util::getFormData('sb'), Horde_Util::getFormData('sd'));
break;
}
/* Build the list of messages in the mailbox. */
$imp_mailbox = &IMP_Mailbox::singleton($imp_mbox['mailbox']);
-$pageOb = $imp_mailbox->buildMailboxPage(Util::getFormData('p'), Util::getFormData('s'));
+$pageOb = $imp_mailbox->buildMailboxPage(Horde_Util::getFormData('p'), Horde_Util::getFormData('s'));
/* Generate page links. */
$pages_first = $pages_prev = $pages_last = $pages_next = null;
if ($pageOb['page'] != 1) {
- $pages_first = new Horde_Mobile_link(_("First Page"), Util::addParameter($mailbox_url, 'p', 1));
- $pages_prev = new Horde_Mobile_link(_("Previous Page"), Util::addParameter($mailbox_url, 'p', $pageOb['page'] - 1));
+ $pages_first = new Horde_Mobile_link(_("First Page"), Horde_Util::addParameter($mailbox_url, 'p', 1));
+ $pages_prev = new Horde_Mobile_link(_("Previous Page"), Horde_Util::addParameter($mailbox_url, 'p', $pageOb['page'] - 1));
}
if ($pageOb['page'] != $pageOb['pagecount']) {
- $pages_next = new Horde_Mobile_link(_("Next Page"), Util::addParameter($mailbox_url, 'p', $pageOb['page'] + 1));
- $pages_last = new Horde_Mobile_link(_("Last Page"), Util::addParameter($mailbox_url, 'p', $pageOb['pagecount']));
+ $pages_next = new Horde_Mobile_link(_("Next Page"), Horde_Util::addParameter($mailbox_url, 'p', $pageOb['page'] + 1));
+ $pages_last = new Horde_Mobile_link(_("Last Page"), Horde_Util::addParameter($mailbox_url, 'p', $pageOb['pagecount']));
}
/* Generate mailbox summary string. */
/* Format the from header. */
$getfrom = $imp_ui->getFrom($ob['envelope']);
$msg['from'] = $getfrom['from'];
- if (String::length($msg['from']) > $conf['mimp']['mailbox']['max_from_chars']) {
- $msg['from'] = String::substr($msg['from'], 0, $conf['mimp']['mailbox']['max_from_chars']) . '...';
+ if (Horde_String::length($msg['from']) > $conf['mimp']['mailbox']['max_from_chars']) {
+ $msg['from'] = Horde_String::substr($msg['from'], 0, $conf['mimp']['mailbox']['max_from_chars']) . '...';
}
/* Get flag information. */
$msg['status'] .= $val['abbrev'];
} elseif ($val['type'] == 'imapp') {
$msg['subject'] = '*' .
- ((String::length($val['label']) > 8)
- ? String::substr($val['label'], 0, 5) . '...'
+ ((Horde_String::length($val['label']) > 8)
+ ? Horde_String::substr($val['label'], 0, 5) . '...'
: $val['label']
) .
'* ' . $msg['subject'];
$msg['subject'] = '>> ' . ltrim($msg['subject']);
}
- if (String::length($msg['subject']) > $conf['mimp']['mailbox']['max_subj_chars']) {
- $msg['subject'] = String::substr($msg['subject'], 0, $conf['mimp']['mailbox']['max_subj_chars']) . '...';
+ if (Horde_String::length($msg['subject']) > $conf['mimp']['mailbox']['max_subj_chars']) {
+ $msg['subject'] = Horde_String::substr($msg['subject'], 0, $conf['mimp']['mailbox']['max_subj_chars']) . '...';
}
/* Generate the target link. */
$msgs[] = $msg;
}
-$mailbox = Util::addParameter($mailbox_url, 'p', $pageOb['page']);
+$mailbox = Horde_Util::addParameter($mailbox_url, 'p', $pageOb['page']);
$items = array($mailbox => _("Refresh"));
/* Determine if we are going to show the Purge Deleted link. */
if (!$readonly &&
!$prefs->getValue('use_trash') &&
!$imp_search->isVINBOXFolder()) {
- $items[Util::addParameter($mailbox, array('a' => 'e'))] = _("Purge Deleted");
+ $items[Horde_Util::addParameter($mailbox, array('a' => 'e'))] = _("Purge Deleted");
}
/* Create sorting links. */
if (($key == Horde_Imap_Client::SORT_SUBJECT) &&
IMP::threadSortAvailable($mailbox)) {
if (is_null($threadob)) {
- $items[Util::addParameter($mailbox, array('a' => 'c', 'sb' => Horde_Imap_Client::SORT_THREAD, 'sd' => $sortdir))] = _("Sort by Thread");
+ $items[Horde_Util::addParameter($mailbox, array('a' => 'c', 'sb' => Horde_Imap_Client::SORT_THREAD, 'sd' => $sortdir))] = _("Sort by Thread");
} else {
$sortkey = Horde_Imap_Client::SORT_THREAD;
- $items[Util::addParameter($mailbox, array('a' => 'c', 'sb' => Horde_Imap_Client::SORT_SUBJECT, 'sd' => $sortdir))] = _("Do Not Sort by Thread");
+ $items[Horde_Util::addParameter($mailbox, array('a' => 'c', 'sb' => Horde_Imap_Client::SORT_SUBJECT, 'sd' => $sortdir))] = _("Do Not Sort by Thread");
}
}
if ($sortpref['by'] == $key) {
$val = '*' . $val;
$sortdir = !$sortdir;
}
- $sort[$key] = new Horde_Mobile_link($val, Util::addParameter($mailbox, array('a' => 'c', 'sb' => $sortkey, 'sd' => $sortdir)));
+ $sort[$key] = new Horde_Mobile_link($val, Horde_Util::addParameter($mailbox, array('a' => 'c', 'sb' => $sortkey, 'sd' => $sortdir)));
}
}
$nav = array('pages_first', 'pages_prev', 'pages_next', 'pages_last');
foreach ($nav as $n) {
- if (Util::nonInputVar($n)) {
+ if (Horde_Util::nonInputVar($n)) {
$mset->add($$n);
}
}
* set: $actionID, $start. */
$mailbox_url = Horde::applicationUrl('mailbox.php');
$mailbox_imp_url = IMP::generateIMPUrl('mailbox.php', $imp_mbox['mailbox']);
-if (!Util::nonInputVar('from_message_page')) {
- $actionID = Util::getFormData('actionID');
- $start = Util::getFormData('start');
+if (!Horde_Util::nonInputVar('from_message_page')) {
+ $actionID = Horde_Util::getFormData('actionID');
+ $start = Horde_Util::getFormData('start');
}
/* Get form data and make sure it's the type that we're expecting. */
-$targetMbox = Util::getFormData('targetMbox');
-$newMbox = Util::getFormData('newMbox');
-if (!is_array(($indices = Util::getFormData('indices')))) {
+$targetMbox = Horde_Util::getFormData('targetMbox');
+$newMbox = Horde_Util::getFormData('newMbox');
+if (!is_array(($indices = Horde_Util::getFormData('indices')))) {
$indices = array($indices);
}
/* Run through the action handlers */
if ($actionID && ($actionID != 'message_missing')) {
try {
- IMP::checkRequestToken('imp.mailbox', Util::getFormData('mailbox_token'));
+ IMP::checkRequestToken('imp.mailbox', Horde_Util::getFormData('mailbox_token'));
} catch (Horde_Exception $e) {
$notification->push($e);
$actionID = null;
switch ($actionID) {
case 'change_sort':
- IMP::setSort(Util::getFormData('sortby'), Util::getFormData('sortdir'));
+ IMP::setSort(Horde_Util::getFormData('sortby'), Horde_Util::getFormData('sortdir'));
break;
case 'blacklist':
break;
case 'flag_messages':
- $flag = Util::getPost('flag');
+ $flag = Horde_Util::getPost('flag');
if ($flag && !empty($indices)) {
$set = true;
if ($flag[0] == '0') {
break;
case 'view_messages':
- $redirect = Util::addParameter(IMP::generateIMPUrl('thread.php', $imp_mbox['mailbox'], null, null, false), array('mode' => 'msgview', 'msglist' => $GLOBALS['imp_imap']->ob->utils->toSequenceString(IMP::parseIndicesList($indices), array('mailbox' => true))), null, false);
+ $redirect = Horde_Util::addParameter(IMP::generateIMPUrl('thread.php', $imp_mbox['mailbox'], null, null, false), array('mode' => 'msgview', 'msglist' => $GLOBALS['imp_imap']->ob->utils->toSequenceString(IMP::parseIndicesList($indices), array('mailbox' => true))), null, false);
header('Location: ' . $redirect);
exit;
$do_filter = true;
} elseif (($imp_mbox['mailbox'] == 'INBOX') ||
($prefs->getValue('filter_any_mailbox') && !$search_mbox)) {
- $filter_url = Util::addParameter($mailbox_imp_url, array('actionID' => 'filter', 'mailbox_token' => $mailbox_token));
+ $filter_url = Horde_Util::addParameter($mailbox_imp_url, array('actionID' => 'filter', 'mailbox_token' => $mailbox_token));
}
}
/* Build the list of messages in the mailbox. */
$imp_mailbox = IMP_Mailbox::singleton($imp_mbox['mailbox']);
-$pageOb = $imp_mailbox->buildMailboxPage(Util::getFormData('page'), $start);
+$pageOb = $imp_mailbox->buildMailboxPage(Horde_Util::getFormData('page'), $start);
$show_preview = ($conf['mailbox']['show_preview'] && $prefs->getValue('preview_enabled'));
$overview_headers = array('x-priority');
* not a virtual folder. */
if ($search_mbox && !$pageOb['msgcount'] && !$vfolder) {
$notification->push(_("No messages matched your search."), 'horde.warning');
- header('Location: ' . Util::addParameter(Horde::applicationUrl('search.php', true), array('no_match' => 1, 'mailbox' => $imp_mbox['mailbox']), null, false));
+ header('Location: ' . Horde_Util::addParameter(Horde::applicationUrl('search.php', true), array('no_match' => 1, 'mailbox' => $imp_mbox['mailbox']), null, false));
exit;
}
$pages_first = Horde::img($rtl ? 'nav/last-grey.png' : 'nav/first-grey.png', null, null, $graphicsdir);
$pages_prev = Horde::img($rtl ? 'nav/right-grey.png' : 'nav/left-grey.png', null, null, $graphicsdir);
} else {
- $first_url = Util::addParameter($mailbox_imp_url, 'page', 1);
+ $first_url = Horde_Util::addParameter($mailbox_imp_url, 'page', 1);
$pages_first = Horde::link($first_url, _("First Page")) . Horde::img($rtl ? 'nav/last.png' : 'nav/first.png', $rtl ? '>>' : '<<', null, $graphicsdir) . '</a>';
- $prev_url = Util::addParameter($mailbox_imp_url, 'page', $pageOb['page'] - 1);
+ $prev_url = Horde_Util::addParameter($mailbox_imp_url, 'page', $pageOb['page'] - 1);
$pages_prev = Horde::link($prev_url, _("Previous Page")) . Horde::img($rtl ? 'nav/right.png' : 'nav/left.png', $rtl ? '>' : '<', null, $graphicsdir) . '</a>';
}
$pages_last = Horde::img($rtl ? 'nav/first-grey.png' : 'nav/last-grey.png', null, null, $graphicsdir);
$pages_next = Horde::img($rtl ? 'nav/left-grey.png' : 'nav/right-grey.png', null, null, $graphicsdir);
} else {
- $next_url = Util::addParameter($mailbox_imp_url, 'page', $pageOb['page'] + 1);
+ $next_url = Horde_Util::addParameter($mailbox_imp_url, 'page', $pageOb['page'] + 1);
$pages_next = Horde::link($next_url, _("Next Page")) . Horde::img($rtl ? 'nav/left.png' : 'nav/right.png', $rtl ? '<' : '>', null, $graphicsdir) . '</a>';
- $last_url = Util::addParameter($mailbox_imp_url, 'page', $pageOb['pagecount']);
+ $last_url = Horde_Util::addParameter($mailbox_imp_url, 'page', $pageOb['pagecount']);
$pages_last = Horde::link($last_url, _("Last Page")) . Horde::img($rtl ? 'nav/first.png' : 'nav/last.png', $rtl ? '<<' : '>>', null, $graphicsdir) . '</a>';
}
}
/* If user wants the mailbox to be refreshed, set time here. */
$refresh_time = $prefs->getValue('refresh_time');
-$refresh_url = Util::addParameter($mailbox_imp_url, 'page', $pageOb['page']);
+$refresh_url = Horde_Util::addParameter($mailbox_imp_url, 'page', $pageOb['page']);
if (isset($filter_url)) {
- $filter_url = Util::addParameter($filter_url, 'page', $pageOb['page']);
+ $filter_url = Horde_Util::addParameter($filter_url, 'page', $pageOb['page']);
}
/* Set the folder for the sort links. */
-$sort_url = Util::addParameter($mailbox_imp_url, 'sortdir', ($sortpref['dir']) ? 0 : 1);
+$sort_url = Horde_Util::addParameter($mailbox_imp_url, 'sortdir', ($sortpref['dir']) ? 0 : 1);
/* Determine if we are showing previews. */
$preview_tooltip = ($show_preview) ? $prefs->getValue('preview_show_tooltip') : false;
* the current mailbox. */
$imp_imap->ob->openMailbox($imp_mbox['mailbox'], Horde_Imap_Client::OPEN_READWRITE);
- if (!Util::getFormData('no_newmail_popup')) {
+ if (!Horde_Util::getFormData('no_newmail_popup')) {
/* Newmail audio. */
if (($sound = $prefs->getValue('nav_audio'))) {
$notification->push($registry->getImageDir() . '/audio/' . $sound, 'audio');
$hdr_template->set('search', false);
if ($_SESSION['imp']['protocol'] != 'pop') {
if (!$search_mbox) {
- $hdr_template->set('search', Horde::link(Util::addParameter(Horde::applicationUrl('search.php'), 'search_mailbox', $imp_mbox['mailbox']), sprintf(_("Search %s"), $rawtitle)) . Horde::img('search.png', _("Search")) . '</a>');
+ $hdr_template->set('search', Horde::link(Horde_Util::addParameter(Horde::applicationUrl('search.php'), 'search_mailbox', $imp_mbox['mailbox']), sprintf(_("Search %s"), $rawtitle)) . Horde::img('search.png', _("Search")) . '</a>');
if (!$readonly) {
- $hdr_template->set('empty', Horde::link(Util::addParameter($mailbox_imp_url, array('actionID' => 'empty_mailbox', 'mailbox' => $imp_mbox['mailbox'], 'mailbox_token' => $mailbox_token)), _("Empty folder"), '', '', "ImpMailbox.confirmDialog(this.href, '" . addslashes(_("Are you sure you wish to delete all mail in this folder?")) . "'); return false;") . Horde::img('empty_spam.png', _("Empty folder")) . '</a>');
+ $hdr_template->set('empty', Horde::link(Horde_Util::addParameter($mailbox_imp_url, array('actionID' => 'empty_mailbox', 'mailbox' => $imp_mbox['mailbox'], 'mailbox_token' => $mailbox_token)), _("Empty folder"), '', '', "ImpMailbox.confirmDialog(this.href, '" . addslashes(_("Are you sure you wish to delete all mail in this folder?")) . "'); return false;") . Horde::img('empty_spam.png', _("Empty folder")) . '</a>');
}
} else {
if ($imp_search->isEditableVFolder()) {
/* Show 'Show Deleted' prompt if mailbox has no viewable message but
has hidden, deleted messages. */
$del_template = new IMP_Template();
- $del_template->set('hide', Horde::widget(Util::addParameter($refresh_url, array('actionID' => 'hide_deleted', 'mailbox_token' => $mailbox_token)), $deleted_prompt, 'widget hideAction', '', '', $deleted_prompt));
+ $del_template->set('hide', Horde::widget(Horde_Util::addParameter($refresh_url, array('actionID' => 'hide_deleted', 'mailbox_token' => $mailbox_token)), $deleted_prompt, 'widget hideAction', '', '', $deleted_prompt));
if (!$readonly) {
- $del_template->set('purge', Horde::widget(Util::addParameter($refresh_url, array('actionID' => 'expunge_mailbox', 'mailbox_token' => $mailbox_token)), _("Purge Deleted"), 'widget purgeAction', '', '', _("Pur_ge Deleted")));
+ $del_template->set('purge', Horde::widget(Horde_Util::addParameter($refresh_url, array('actionID' => 'expunge_mailbox', 'mailbox_token' => $mailbox_token)), _("Purge Deleted"), 'widget purgeAction', '', '', _("Pur_ge Deleted")));
}
echo $del_template->fetch(IMP_TEMPLATES . '/mailbox/actions_deleted.html');
}
$n_template = new IMP_Template();
$n_template->setOption('gettext', true);
$n_template->set('id', 1);
- $n_template->set('sessiontag', Util::formInput());
+ $n_template->set('sessiontag', Horde_Util::formInput());
$n_template->set('use_folders', $conf['user']['allow_folders']);
$n_template->set('readonly', $readonly);
$n_template->set('use_pop', $_SESSION['imp']['protocol'] == 'pop');
$n_template->set('pages_next', $pages_next);
$n_template->set('pages_last', $pages_last);
$n_template->set('page_val', htmlspecialchars($pageOb['page']));
- $n_template->set('page_size', String::length($pageOb['pagecount']));
+ $n_template->set('page_size', Horde_String::length($pageOb['pagecount']));
}
echo $n_template->fetch(IMP_TEMPLATES . '/mailbox/navbar.html');
}
if ($showdelete['purge']) {
- $mailbox_link = Util::addParameter($mailbox_imp_url, 'page', $pageOb['page']);
+ $mailbox_link = Horde_Util::addParameter($mailbox_imp_url, 'page', $pageOb['page']);
if (isset($deleted_prompt)) {
- $a_template->set('hide_deleted', Horde::widget(Util::addParameter($mailbox_link, array('actionID' => 'hide_deleted', 'mailbox_token' => $mailbox_token)), $deleted_prompt, 'widget hideAction', '', '', $deleted_prompt));
+ $a_template->set('hide_deleted', Horde::widget(Horde_Util::addParameter($mailbox_link, array('actionID' => 'hide_deleted', 'mailbox_token' => $mailbox_token)), $deleted_prompt, 'widget hideAction', '', '', $deleted_prompt));
}
- $a_template->set('purge_deleted', Horde::widget(Util::addParameter($mailbox_link, array('actionID' => 'expunge_mailbox', 'mailbox_token' => $mailbox_token)), _("Purge Deleted"), 'widget purgeAction', '', '', _("Pur_ge Deleted")));
+ $a_template->set('purge_deleted', Horde::widget(Horde_Util::addParameter($mailbox_link, array('actionID' => 'expunge_mailbox', 'mailbox_token' => $mailbox_token)), _("Purge Deleted"), 'widget purgeAction', '', '', _("Pur_ge Deleted")));
}
if ($registry->hasMethod('mail/blacklistFrom')) {
$extra = Horde_Imap_Client::SORT_SUBJECT;
$standard = Horde_Imap_Client::SORT_THREAD;
}
- $headers[$standard]['extra'] = ' <span style="font-size:95%">[' . Horde::widget(Util::addParameter($mailbox_imp_url, array('sortby' => $extra, 'actionID' => 'change_sort', 'mailbox_token' => $mailbox_token)), $headers[$extra]['stext'], 'widget" style="font-size:95%; font-weight:normal;', null, 'if (window.event) window.event.cancelBubble = true; else if (event) event.stopPropagation();', $headers[$extra]['text']) . ']</span>';
+ $headers[$standard]['extra'] = ' <span style="font-size:95%">[' . Horde::widget(Horde_Util::addParameter($mailbox_imp_url, array('sortby' => $extra, 'actionID' => 'change_sort', 'mailbox_token' => $mailbox_token)), $headers[$extra]['stext'], 'widget" style="font-size:95%; font-weight:normal;', null, 'if (window.event) window.event.cancelBubble = true; else if (event) event.stopPropagation();', $headers[$extra]['text']) . ']</span>';
unset($headers[$extra]);
}
$ptr = &$headers[$key];
$ptr['class'] = ($sortpref['by'] == $key) ? 'selected' : 'item';
if ($sortpref['by'] == $key) {
- $ptr['change_sort_link'] = Horde::link(Util::addParameter($sort_url, array('sortby' => $key, 'actionID' => 'change_sort', 'mailbox_token' => $mailbox_token)), $val['stext'], null, null, null, $val['stext']) . Horde::img($sortImg, $sortText, '', $graphicsdir) . '</a>';
+ $ptr['change_sort_link'] = Horde::link(Horde_Util::addParameter($sort_url, array('sortby' => $key, 'actionID' => 'change_sort', 'mailbox_token' => $mailbox_token)), $val['stext'], null, null, null, $val['stext']) . Horde::img($sortImg, $sortText, '', $graphicsdir) . '</a>';
} else {
$ptr['change_sort_link'] = null;
}
if ($sortpref['limit']) {
$ptr['sortlimit_text'] = Horde::stripAccessKey($val['text']);
} else {
- $ptr['change_sort'] = addslashes(Util::addParameter(($sortpref['by'] == $key) ? $sort_url : $mailbox_imp_url, array('sortby' => $key, 'actionID' => 'change_sort', 'mailbox_token' => $mailbox_token)));
- $ptr['change_sort_widget'] = Horde::widget(Util::addParameter(($sortpref['by'] == $key) ? $sort_url : $mailbox_imp_url, array('sortby' => $key, 'actionID' => 'change_sort', 'mailbox_token' => $mailbox_token)), $val['stext'], 'widget', null, null, $val['text']);
+ $ptr['change_sort'] = addslashes(Horde_Util::addParameter(($sortpref['by'] == $key) ? $sort_url : $mailbox_imp_url, array('sortby' => $key, 'actionID' => 'change_sort', 'mailbox_token' => $mailbox_token)));
+ $ptr['change_sort_widget'] = Horde::widget(Horde_Util::addParameter(($sortpref['by'] == $key) ? $sort_url : $mailbox_imp_url, array('sortby' => $key, 'actionID' => 'change_sort', 'mailbox_token' => $mailbox_token)), $val['stext'], 'widget', null, null, $val['text']);
if (!isset($val['extra'])) {
$ptr['extra'] = null;
}
$mh_template->set('mailbox_url', $mailbox_url);
$mh_template->set('mailbox', htmlspecialchars($imp_mbox['mailbox']));
$mh_template->set('mailbox_token', $mailbox_token);
- $mh_template->set('sessiontag', Util::formInput());
+ $mh_template->set('sessiontag', Horde_Util::formInput());
$mh_template->set('sortlimit', $sortpref['limit']);
$mh_template->set('headers', $headers);
_outputSummaries($msgs, $lastMbox);
$msgs = array();
}
- $folder_link = Horde::url(Util::addParameter('mailbox.php', 'mailbox', $ob['mailbox']));
+ $folder_link = Horde::url(Horde_Util::addParameter('mailbox.php', 'mailbox', $ob['mailbox']));
$folder_link = Horde::link($folder_link, sprintf(_("View messages in %s"), IMP::displayFolder($ob['mailbox'])), 'smallheader') . IMP::displayFolder($ob['mailbox']) . '</a>';
if (is_null($search_template)) {
$search_template = new IMP_Template();
}
$maxlen = $prefs->getValue('preview_maxlen');
- if (String::length($ptext) > $maxlen) {
- $ptext = String::substr($ptext, 0, $maxlen) . ' ...';
+ if (Horde_String::length($ptext) > $maxlen) {
+ $ptext = Horde_String::substr($ptext, 0, $maxlen) . ' ...';
} elseif (empty($ob['previewcut'])) {
$ptext .= '[[' . _("END") . ']]';
}
/* Add subject flags. */
foreach ($subject_flags as $val) {
$flag_label = $val['label'];
- if (String::length($val['label']) > 12) {
- $flag_label = String::substr($val['label'], 0, 10) . '...';
+ if (Horde_String::length($val['label']) > 12) {
+ $flag_label = Horde_String::substr($val['label'], 0, 10) . '...';
}
$msg['subject'] = '<span class="' . $val['classname'] . '" style="background:' . htmlspecialchars($val['bg']) . '" title="' . htmlspecialchars($val['label']) . '">' . htmlspecialchars($flag_label) . '</span>' . $msg['subject'];
require_once dirname(__FILE__) . '/lib/base.php';
-$folder = Util::getFormData('folder');
-$index = Util::getFormData('uid');
+$folder = Horde_Util::getFormData('folder');
+$index = Horde_Util::getFormData('uid');
if (!$index || !$folder) {
exit;
}
/* Make sure we have a valid index. */
$imp_mailbox = &IMP_Mailbox::singleton($imp_mbox['mailbox'], $imp_mbox['index']);
if (!$imp_mailbox->isValidIndex()) {
- header('Location: ' . Util::addParameter(IMP::generateIMPUrl('mailbox-mimp.php', $imp_mbox['mailbox']), array('a' => 'm'), null, false));
+ header('Location: ' . Horde_Util::addParameter(IMP::generateIMPUrl('mailbox-mimp.php', $imp_mbox['mailbox']), array('a' => 'm'), null, false));
exit;
}
NLS::setTimeZone();
/* Run through action handlers */
-$actionID = Util::getFormData('a');
+$actionID = Horde_Util::getFormData('a');
switch ($actionID) {
// 'd' = delete message
// 'u' = undelete message
$imp_message->undelete($indices_array);
} else {
try {
- IMP::checkRequestToken('imp.message-mimp', Util::getFormData('mt'));
+ IMP::checkRequestToken('imp.message-mimp', Horde_Util::getFormData('mt'));
$imp_message->delete($indices_array);
if ($prefs->getValue('mailbox_return')) {
- header('Location: ' . Util::addParameter(IMP::generateIMPUrl('mailbox-mimp.php', $imp_mbox['mailbox']), array('s' => $imp_mailbox->getMessageIndex()), null, false));
+ header('Location: ' . Horde_Util::addParameter(IMP::generateIMPUrl('mailbox-mimp.php', $imp_mbox['mailbox']), array('s' => $imp_mailbox->getMessageIndex()), null, false));
exit;
}
if (($_SESSION['imp']['protocol'] != 'pop') &&
* message array, so we will return to mailbox.php if that is the
* case. */
if (!$imp_mailbox->isValidIndex()) {
- header('Location: ' . Util::addParameter(IMP::generateIMPUrl('mailbox-mimp.php', $imp_mbox['mailbox']), array('s' => $imp_mailbox->getMessageIndex()), null, false));
+ header('Location: ' . Horde_Util::addParameter(IMP::generateIMPUrl('mailbox-mimp.php', $imp_mbox['mailbox']), array('s' => $imp_mailbox->getMessageIndex()), null, false));
exit;
}
Horde_Imap_Client::FETCH_HEADERTEXT => array(array('parse' => true, 'peek' => $readonly))
), array('ids' => array($index)));
} catch (Horde_Imap_Client_Exception $e) {
- header('Location: ' . Util::addParameter(IMP::generateIMPUrl('mailbox-mimp.php', $mailbox_name), array('a' => 'm'), null, false));
+ header('Location: ' . Horde_Util::addParameter(IMP::generateIMPUrl('mailbox-mimp.php', $mailbox_name), array('a' => 'm'), null, false));
exit;
}
try {
$imp_contents = &IMP_Contents::singleton($index . IMP::IDX_SEP . $mailbox_name);
} catch (Horde_Exception $e) {
- header('Location: ' . Util::addParameter(IMP::generateIMPUrl('mailbox-mimp.php', $mailbox_name), array('a' => 'm'), null, false));
+ header('Location: ' . Horde_Util::addParameter(IMP::generateIMPUrl('mailbox-mimp.php', $mailbox_name), array('a' => 'm'), null, false));
exit;
}
$msgcount = $imp_mailbox->getMessageCount();
/* Generate the mailbox link. */
-$mailbox_link = Util::addParameter(IMP::generateIMPUrl('mailbox-mimp.php', $imp_mbox['mailbox']), array('s' => $msgindex));
+$mailbox_link = Horde_Util::addParameter(IMP::generateIMPUrl('mailbox-mimp.php', $imp_mbox['mailbox']), array('s' => $msgindex));
$self_link = IMP::generateIMPUrl('message-mimp.php', $imp_mbox['mailbox'], $index, $mailbox_name);
/* Output download confirmation screen. */
-$atc_id = Util::getFormData('atc');
+$atc_id = Horde_Util::getFormData('atc');
if (($actionID == 'c') && !is_null($atc_id)) {
$summary = $imp_contents->getSummary($atc_id, IMP_Contents::SUMMARY_SIZE | IMP_Contents::SUMMARY_DESCRIP_NOLINK_NOHTMLSPECCHARS | IMP_Contents::SUMMARY_DOWNLOAD_NOJS);
$subject = IMP::filterText($subject);
/* Generate the shortened subject text. */
- if (String::length($subject) > $conf['mimp']['mailbox']['max_subj_chars']) {
- $subject = String::substr($subject, 0, $conf['mimp']['mailbox']['max_subj_chars']) . '...';
+ if (Horde_String::length($subject) > $conf['mimp']['mailbox']['max_subj_chars']) {
+ $subject = Horde_String::substr($subject, 0, $conf['mimp']['mailbox']['max_subj_chars']) . '...';
}
} else {
$subject = _("[No Subject]");
if (isset($val['abbrev'])) {
$status .= $val['abbrev'];
} elseif ($val['type'] == 'imapp') {
- if (String::length($val['label']) > 8) {
- $status .= ' *' . String::substr($val['label'], 0, 5) . '...*';
+ if (Horde_String::length($val['label']) > 8) {
+ $status .= ' *' . Horde_String::substr($val['label'], 0, 5) . '...*';
} else {
$status .= ' *' . $val['label'] . '*';
}
}
/* Display the first 250 characters, or display the entire message? */
-if ($prefs->getValue('mimp_preview_msg') && !Util::getFormData('fullmsg')) {
- $msg_text = String::substr($msg_text, 0, 250) . " [...]\n";
- $fullmsg_link = new Horde_Mobile_link(_("View Full Message"), Util::addParameter($self_link, array('fullmsg' => 1)));
+if ($prefs->getValue('mimp_preview_msg') && !Horde_Util::getFormData('fullmsg')) {
+ $msg_text = Horde_String::substr($msg_text, 0, 250) . " [...]\n";
+ $fullmsg_link = new Horde_Mobile_link(_("View Full Message"), Horde_Util::addParameter($self_link, array('fullmsg' => 1)));
} else {
$fullmsg_link = null;
}
if (!$readonly) {
if (in_array('\\deleted', $flags)) {
- $mset->add(new Horde_Mobile_link(_("Undelete"), Util::addParameter($self_link, array('a' => 'u'))));
+ $mset->add(new Horde_Mobile_link(_("Undelete"), Horde_Util::addParameter($self_link, array('a' => 'u'))));
} else {
- $mset->add(new Horde_Mobile_link(_("Delete"), Util::addParameter($self_link, array('a' => 'd', 'mt' => IMP::getRequestToken('imp.message-mimp')))));
+ $mset->add(new Horde_Mobile_link(_("Delete"), Horde_Util::addParameter($self_link, array('a' => 'd', 'mt' => IMP::getRequestToken('imp.message-mimp')))));
}
}
$null = null;
$hb = &$c->add(new Horde_Mobile_block($null));
-$allto_param = Util::getFormData('allto');
+$allto_param = Horde_Util::getFormData('allto');
foreach ($display_headers as $head => $val) {
$all_to = false;
$hb->add(new Horde_Mobile_text($basic_headers[$head] . ': ', array('b')));
- if ((String::lower($head) == 'to') &&
+ if ((Horde_String::lower($head) == 'to') &&
!$allto_param &&
(($pos = strpos($val, ',')) !== false)) {
- $val = String::substr($val, 0, strpos($val, ','));
+ $val = Horded_String::substr($val, 0, strpos($val, ','));
$all_to = true;
}
$t = &$hb->add(new Horde_Mobile_text($val . (($all_to) ? ' ' : "\n")));
if ($all_to) {
- $hb->add(new Horde_Mobile_link('[' . _("Show All") . ']', Util::addParameter($self_link, array('allto' => 1))));
+ $hb->add(new Horde_Mobile_link('[' . _("Show All") . ']', Horde_Util::addParameter($self_link, array('allto' => 1))));
$t = &$hb->add(new Horde_Mobile_text("\n"));
}
$t->set('linebreaks', true);
if (empty($summary['download'])) {
$hb->add(new Horde_Mobile_text($summary['description']));
} else {
- $hb->add(new Horde_Mobile_link($summary['description'], Util::addParameter($self_link, array('a' => 'c', 'atc' => $key))));
+ $hb->add(new Horde_Mobile_link($summary['description'], Horde_Util::addParameter($self_link, array('a' => 'c', 'atc' => $key))));
}
$t = &$hb->add(new Horde_Mobile_text(sprintf(' [%s] %s', $summary['type'], $summary['size']) . "\n"));
$t->set('linebreaks', true);
$user_identity = &Identity::singleton(array('imp', 'imp'));
/* Run through action handlers. */
-$actionID = Util::getFormData('actionID');
+$actionID = Horde_Util::getFormData('actionID');
if ($actionID && ($actionID != 'print_message')) {
try {
- IMP::checkRequestToken('imp.message', Util::getFormData('message_token'));
+ IMP::checkRequestToken('imp.message', Horde_Util::getFormData('message_token'));
} catch (Horde_Exception $e) {
$notification->push($e);
$actionID = null;
case 'move_message':
case 'copy_message':
- if (($targetMbox = Util::getFormData('targetMbox')) !== null) {
- if (Util::getFormData('newMbox', 0) == 1) {
+ if (($targetMbox = Horde_Util::getFormData('targetMbox')) !== null) {
+ if (Horde_Util::getFormData('newMbox', 0) == 1) {
$targetMbox = IMP::folderPref($targetMbox, true);
$newMbox = true;
} else {
break;
case 'flag_message':
- $flag = Util::getFormData('flag');
+ $flag = Horde_Util::getFormData('flag');
if ($flag && !empty($indices_array)) {
$peek = $set = true;
if ($flag[0] == '0') {
case 'add_address':
try {
- $contact_link = IMP::addAddress(Util::getFormData('address'), Util::getFormData('name'));
+ $contact_link = IMP::addAddress(Horde_Util::getFormData('address'), Horde_Util::getFormData('name'));
$notification->push(sprintf(_("Entry \"%s\" was successfully added to the address book"), $contact_link), 'horde.success', array('content.raw'));
} catch (Horde_Exception $e) {
$notification->push($e, 'horde.error');
case 'strip_all':
case 'strip_attachment':
try {
- $imp_message->stripPart($indices_array, ($actionID == 'strip_all') ? null : Util::getFormData('imapid'));
+ $imp_message->stripPart($indices_array, ($actionID == 'strip_all') ? null : Horde_Util::getFormData('imapid'));
} catch (Horde_Exception $e) {
$notification->push($e, 'horde.error');
}
/* Generate the link to ourselves. */
$msgindex = $imp_mailbox->getMessageIndex();
$message_url = Horde::applicationUrl('message.php');
-$self_link = Util::addParameter(IMP::generateIMPUrl('message.php', $imp_mbox['mailbox'], $index, $mailbox_name), array('start' => $msgindex, 'message_token' => $message_token));
+$self_link = Horde_Util::addParameter(IMP::generateIMPUrl('message.php', $imp_mbox['mailbox'], $index, $mailbox_name), array('start' => $msgindex, 'message_token' => $message_token));
/* Create the IMP_UI_Message:: object. */
$imp_ui = new IMP_UI_Message();
}
/* Determine if all/list/user-requested headers needed. */
-$all_headers = Util::getFormData('show_all_headers');
-$list_headers = Util::getFormData('show_list_headers');
+$all_headers = Horde_Util::getFormData('show_all_headers');
+$list_headers = Horde_Util::getFormData('show_list_headers');
$user_hdrs = $imp_ui->getUserHeaders();
/* Check for the presence of mailing list information. */
/* For the self URL link, we can't trust the index in the query string as it
* may have changed if we deleted/copied/moved messages. We may need other
* stuff in the query string, so we need to do an add/remove of 'index'. */
-$selfURL = Util::removeParameter(Horde::selfUrl(true), array('index', 'actionID', 'mailbox', 'thismailbox'));
+$selfURL = Horde_Util::removeParameter(Horde::selfUrl(true), array('index', 'actionID', 'mailbox', 'thismailbox'));
$selfURL = IMP::generateIMPUrl($selfURL, $imp_mbox['mailbox'], $index, $mailbox_name);
-IMP::$newUrl = $selfURL = html_entity_decode(Util::addParameter($selfURL, 'message_token', $message_token));
-$headersURL = htmlspecialchars(Util::removeParameter($selfURL, array('show_all_headers', 'show_list_headers')));
+IMP::$newUrl = $selfURL = html_entity_decode(Horde_Util::addParameter($selfURL, 'message_token', $message_token));
+$headersURL = htmlspecialchars(Horde_Util::removeParameter($selfURL, array('show_all_headers', 'show_list_headers')));
/* Generate previous/next links. */
$prev_msg = $imp_mailbox->getIMAPIndex(-1);
}
/* Generate the mailbox link. */
-$mailbox_url = Util::addParameter(IMP::generateIMPUrl('mailbox.php', $imp_mbox['mailbox']), 'start', $msgindex);
+$mailbox_url = Horde_Util::addParameter(IMP::generateIMPUrl('mailbox.php', $imp_mbox['mailbox']), 'start', $msgindex);
/* Generate the view link. */
$view_link = IMP::generateIMPUrl('view.php', $imp_mbox['mailbox'], $index, $mailbox_name);
$h_page_label = htmlspecialchars($page_label);
$header_label = $h_page_label;
if ($imp_search->isSearchMbox($imp_mbox['mailbox'])) {
- $header_label .= ' [' . Horde::link(Util::addParameter(Horde::applicationUrl('mailbox.php'), 'mailbox', $mailbox_name)) . IMP::displayFolder($mailbox_name) . '</a>]';
+ $header_label .= ' [' . Horde::link(Horde_Util::addParameter(Horde::applicationUrl('mailbox.php'), 'mailbox', $mailbox_name)) . IMP::displayFolder($mailbox_name) . '</a>]';
}
/* Prepare the navbar top template. */
$t_template = new IMP_Template();
$t_template->set('message_url', $message_url);
- $t_template->set('form_input', Util::formInput());
+ $t_template->set('form_input', Horde_Util::formInput());
$t_template->set('mailbox', htmlspecialchars($imp_mbox['mailbox']));
$t_template->set('thismailbox', htmlspecialchars($mailbox_name));
$t_template->set('start', htmlspecialchars($msgindex));
$n_template->set('back_to', Horde::widget($mailbox_url, sprintf(_("Back to %s"), $h_page_label), 'widget', '', '', sprintf(_("Bac_k to %s"), $h_page_label), true));
$rtl = !empty($nls['rtl'][$language]);
- if (Util::nonInputVar('prev_url')) {
+ if (Horde_Util::nonInputVar('prev_url')) {
$n_template->set('prev', Horde::link($prev_url, _("Previous Message")));
$n_template->set('prev_img', Horde::img($rtl ? 'nav/right.png' : 'nav/left.png', $rtl ? '>' : '<', '', $registry->getImageDir('horde')));
} else {
$n_template->set('prev_img', Horde::img($rtl ? 'nav/right-grey.png' : 'nav/left-grey.png', '', '', $registry->getImageDir('horde')));
}
- if (Util::nonInputVar('next_url')) {
+ if (Horde_Util::nonInputVar('next_url')) {
$n_template->set('next', Horde::link($next_url, _("Next Message")));
$n_template->set('next_img', Horde::img($rtl ? 'nav/left.png' : 'nav/right.png', $rtl ? '<' : '>', '', $registry->getImageDir('horde')));
} else {
if (!$readonly) {
if (in_array('\\deleted', $flags)) {
- $a_template->set('delete', Horde::widget(Util::addParameter($self_link, 'actionID', 'undelete_message'), _("Undelete"), 'widget', '', '', _("Undelete"), true));
+ $a_template->set('delete', Horde::widget(Horde_Util::addParameter($self_link, 'actionID', 'undelete_message'), _("Undelete"), 'widget', '', '', _("Undelete"), true));
} else {
- $a_template->set('delete', Horde::widget(Util::addParameter($self_link, 'actionID', 'delete_message'), _("Delete"), 'widget', '', ($use_pop) ? "return window.confirm('" . addslashes(_("Are you sure you wish to PERMANENTLY delete these messages?")) . "');" : '', _("_Delete"), true));
+ $a_template->set('delete', Horde::widget(Horde_Util::addParameter($self_link, 'actionID', 'delete_message'), _("Delete"), 'widget', '', ($use_pop) ? "return window.confirm('" . addslashes(_("Are you sure you wish to PERMANENTLY delete these messages?")) . "');" : '', _("_Delete"), true));
}
}
}
if (IMP::threadSortAvailable($imp_mbox['mailbox'])) {
- $a_template->set('show_thread', Horde::widget(Util::addParameter(IMP::generateIMPUrl('thread.php', $imp_mbox['mailbox'], $index, $mailbox_name), array('start' => $msgindex)), _("View Thread"), 'widget', '', '', _("_View Thread"), true));
+ $a_template->set('show_thread', Horde::widget(Horde_Util::addParameter(IMP::generateIMPUrl('thread.php', $imp_mbox['mailbox'], $index, $mailbox_name), array('start' => $msgindex)), _("View Thread"), 'widget', '', '', _("_View Thread"), true));
}
if ($registry->hasMethod('mail/blacklistFrom')) {
- $a_template->set('blacklist', Horde::widget(Util::addParameter($self_link, 'actionID', 'blacklist'), _("Blacklist"), 'widget', '', '', _("_Blacklist"), true));
+ $a_template->set('blacklist', Horde::widget(Horde_Util::addParameter($self_link, 'actionID', 'blacklist'), _("Blacklist"), 'widget', '', '', _("_Blacklist"), true));
}
if ($registry->hasMethod('mail/whitelistFrom')) {
- $a_template->set('whitelist', Horde::widget(Util::addParameter($self_link, 'actionID', 'whitelist'), _("Whitelist"), 'widget', '', '', _("_Whitelist"), true));
+ $a_template->set('whitelist', Horde::widget(Horde_Util::addParameter($self_link, 'actionID', 'whitelist'), _("Whitelist"), 'widget', '', '', _("_Whitelist"), true));
}
if (!empty($conf['user']['allow_view_source'])) {
$a_template->set('save_as', Horde::widget(Horde::downloadUrl($subject, array_merge(array('actionID' => 'save_message'), $imp_params)), _("Save as"), 'widget', '', '', _("Sa_ve as"), 2));
$print_params = array_merge(array('actionID' => 'print_message'), $imp_params);
- $a_template->set('print', Horde::widget(Util::addParameter(IMP::generateIMPUrl('message.php', $imp_mbox['mailbox']), $print_params), _("Print"), 'widget', '_blank', IMP::popupIMPString('message.php', $print_params) . 'return false;', _("_Print"), true));
+ $a_template->set('print', Horde::widget(Horde_Util::addParameter(IMP::generateIMPUrl('message.php', $imp_mbox['mailbox']), $print_params), _("Print"), 'widget', '_blank', IMP::popupIMPString('message.php', $print_params) . 'return false;', _("_Print"), true));
if ($conf['spam']['reporting'] &&
($conf['spam']['spamfolder'] ||
$a_template->set('common_headers', Horde::widget($headersURL, _("Show Common Headers"), 'widget', '', '', _("Show Common Headers"), true));
}
if (!$all_headers) {
- $a_template->set('all_headers', Horde::widget(Util::addParameter($headersURL, 'show_all_headers', 1), _("Show All Headers"), 'widget', '', '', _("Show All Headers"), true));
+ $a_template->set('all_headers', Horde::widget(Horde_Util::addParameter($headersURL, 'show_all_headers', 1), _("Show All Headers"), 'widget', '', '', _("Show All Headers"), true));
}
if ($list_info['exists'] && !$list_headers) {
- $a_template->set('list_headers', Horde::widget(Util::addParameter($headersURL, 'show_list_headers', 1), _("Show Mailing List Information"), 'widget', '', '', _("Show Mailing List Information"), true));
+ $a_template->set('list_headers', Horde::widget(Horde_Util::addParameter($headersURL, 'show_list_headers', 1), _("Show Mailing List Information"), 'widget', '', '', _("Show Mailing List Information"), true));
}
}
/* Do MDN processing now. */
if (!IMP::$printMode &&
- $imp_ui->MDNCheck($imp_mbox['mailbox'], $index, $mime_headers, Util::getFormData('mdn_confirm'))) {
- $msgtext .= $imp_ui->formatStatusMsg(array('text' => array(_("The sender of this message is requesting a Message Disposition Notification from you when you have read this message."), sprintf(_("Click %s to send the notification message."), Horde::link(htmlspecialchars(Util::addParameter($selfURL, 'mdn_confirm', 1))) . _("HERE") . '</a>'))));
+ $imp_ui->MDNCheck($imp_mbox['mailbox'], $index, $mime_headers, Horde_Util::getFormData('mdn_confirm'))) {
+ $msgtext .= $imp_ui->formatStatusMsg(array('text' => array(_("The sender of this message is requesting a Message Disposition Notification from you when you have read this message."), sprintf(_("Click %s to send the notification message."), Horde::link(htmlspecialchars(Horde_Util::addParameter($selfURL, 'mdn_confirm', 1))) . _("HERE") . '</a>'))));
}
-$show_parts = Util::getFormData('show_parts', $prefs->getValue('parts_display'));
+$show_parts = Horde_Util::getFormData('show_parts', $prefs->getValue('parts_display'));
if ($show_parts == 'all') {
$atc_parts = array_keys($parts_list);
}
if (!IMP::$printMode) {
$a_template->set('atc', Horde::widget('#', _("Attachments"), 'widget hasmenu', '', '', _("Attachments"), true));
if ($show_parts != 'all') {
- $a_template->set('show_parts_all', Horde::widget(Util::addParameter($headersURL, array('show_parts' => 'all')), _("Show All Message Parts"), 'widget', '', '', _("Show All Message Parts"), true));
+ $a_template->set('show_parts_all', Horde::widget(Horde_Util::addParameter($headersURL, array('show_parts' => 'all')), _("Show All Message Parts"), 'widget', '', '', _("Show All Message Parts"), true));
}
if ($show_parts != 'atc') {
- $a_template->set('show_parts_atc', Horde::widget(Util::addParameter($headersURL, array('show_parts' => 'atc')), _("Show Attachments Only"), 'widget', '', '', _("Show Attachments Only"), true));
+ $a_template->set('show_parts_atc', Horde::widget(Horde_Util::addParameter($headersURL, array('show_parts' => 'atc')), _("Show Attachments Only"), 'widget', '', '', _("Show Attachments Only"), true));
}
if (count($display_ids) > 2) {
$a_template->set('download_all', Horde::widget($imp_contents->urlView($imp_contents->getMIMEMessage(), 'download_all'), _("Download All Attachments (in .zip file)"), 'widget', '', '', _("Download All Attachments (in .zip file)"), true));
if ($strip_atc) {
- $a_template->set('strip_all', Horde::widget(htmlspecialchars(html_entity_decode(Util::addParameter(Util::removeParameter(Horde::selfUrl(true), array('actionID')), array('actionID' => 'strip_all', 'message_token' => $message_token)))), _("Strip All Attachments"), 'widget', '', "return window.confirm('" . addslashes(_("Are you sure you wish to PERMANENTLY delete all attachments?")) . "');", _("Strip All Attachments"), true));
+ $a_template->set('strip_all', Horde::widget(htmlspecialchars(html_entity_decode(Horde_Util::addParameter(Horde_Util::removeParameter(Horde::selfUrl(true), array('actionID')), array('actionID' => 'strip_all', 'message_token' => $message_token)))), _("Strip All Attachments"), 'widget', '', "return window.confirm('" . addslashes(_("Are you sure you wish to PERMANENTLY delete all attachments?")) . "');", _("Strip All Attachments"), true));
}
}
}
$t->setOption('gettext', true);
$t->set('selfurl', Horde::applicationUrl('pgp.php'));
$t->set('broken_mp_form', $GLOBALS['browser']->hasQuirk('broken_multipart_form'));
- $t->set('reload', htmlspecialchars(Util::getFormData('reload')));
+ $t->set('reload', htmlspecialchars(Horde_Util::getFormData('reload')));
$t->set('target', $target);
- $t->set('forminput', Util::formInput());
+ $t->set('forminput', Horde_Util::formInput());
$t->set('import_public_key', $target == 'process_import_public_key');
$t->set('import_personal_public_key', $target == 'process_import_personal_public_key');
$t->set('import_personal_private_key', $target == 'process_import_personal_private_key');
function _getImportKey()
{
- $key = Util::getFormData('import_key');
+ $key = Horde_Util::getFormData('import_key');
if (!empty($key)) {
return $key;
}
function _reloadWindow()
{
$cacheSess = &Horde_SessionObjects::singleton();
- $reload = Util::getFormData('reload');
+ $reload = Horde_Util::getFormData('reload');
$cacheSess->setPruneFlag($reload, true);
- Util::closeWindowJS('opener.focus();opener.location.href="' . $cacheSess->query($reload) . '";');
+ Horde_Util::closeWindowJS('opener.focus();opener.location.href="' . $cacheSess->query($reload) . '";');
}
require_once dirname(__FILE__) . '/lib/base.php';
$secure_check = Horde::isConnectionSecure();
/* Run through the action handlers */
-$actionID = Util::getFormData('actionID');
+$actionID = Horde_Util::getFormData('actionID');
switch ($actionID) {
case 'generate_key':
/* Check that fields are filled out (except for Comment) and that the
passphrases match. */
- $realname = Util::getFormData('generate_realname');
- $email = Util::getFormData('generate_email');
- $comment = Util::getFormData('generate_comment');
- $keylength = Util::getFormData('generate_keylength');
- $passphrase1 = Util::getFormData('generate_passphrase1');
- $passphrase2 = Util::getFormData('generate_passphrase2');
+ $realname = Horde_Util::getFormData('generate_realname');
+ $email = Horde_Util::getFormData('generate_email');
+ $comment = Horde_Util::getFormData('generate_comment');
+ $keylength = Horde_Util::getFormData('generate_keylength');
+ $passphrase1 = Horde_Util::getFormData('generate_passphrase1');
+ $passphrase2 = Horde_Util::getFormData('generate_passphrase2');
if (empty($realname) || empty($email)) {
$notification->push(_("Name and/or email cannot be empty"), 'horde.error');
case 'view_public_key':
case 'info_public_key':
try {
- $key = $imp_pgp->getPublicKey(Util::getFormData('email'), array('noserver' => true));
+ $key = $imp_pgp->getPublicKey(Horde_Util::getFormData('email'), array('noserver' => true));
} catch (Horde_Exception $e) {
$key = $e->getMessage();
}
case 'delete_public_key':
try {
- $imp_pgp->deletePublicKey(Util::getFormData('email'));
- $notification->push(sprintf(_("PGP Public Key for \"%s\" was successfully deleted."), Util::getFormData('email')), 'horde.success');
+ $imp_pgp->deletePublicKey(Horde_Util::getFormData('email'));
+ $notification->push(sprintf(_("PGP Public Key for \"%s\" was successfully deleted."), Horde_Util::getFormData('email')), 'horde.success');
} catch (Horde_Exception $e) {
$notification->push($e);
}
break;
case 'save_options':
- $prefs->setValue('use_pgp', Util::getFormData('use_pgp') ? 1 : 0);
- $prefs->setValue('pgp_attach_pubkey', Util::getFormData('pgp_attach_pubkey') ? 1 : 0);
- $prefs->setValue('pgp_scan_body', Util::getFormData('pgp_scan_body') ? 1 : 0);
- $prefs->setValue('pgp_verify', Util::getFormData('pgp_verify') ? 1 : 0);
+ $prefs->setValue('use_pgp', Horde_Util::getFormData('use_pgp') ? 1 : 0);
+ $prefs->setValue('pgp_attach_pubkey', Horde_Util::getFormData('pgp_attach_pubkey') ? 1 : 0);
+ $prefs->setValue('pgp_scan_body', Horde_Util::getFormData('pgp_scan_body') ? 1 : 0);
+ $prefs->setValue('pgp_verify', Horde_Util::getFormData('pgp_verify') ? 1 : 0);
$notification->push(_("Preferences successfully updated."), 'horde.success');
break;
case 'save_attachment_public_key':
/* Retrieve the key from the message. */
try {
- $contents = &IMP_Contents::singleton(Util::getFormData('uid') . IMP::IDX_SEP . Util::getFormData('mailbox'));
+ $contents = &IMP_Contents::singleton(Horde_Util::getFormData('uid') . IMP::IDX_SEP . Horde_Util::getFormData('mailbox'));
} catch (Horde_Exception $e) {
Horde::fatal($e, __FILE__, __LINE__);
}
- $mime_part = $contents->getMIMEPart(Util::getFormData('mime_id'));
+ $mime_part = $contents->getMIMEPart(Horde_Util::getFormData('mime_id'));
if (empty($mime_part)) {
Horde::fatal('Cannot retrieve public key from message.', __FILE__, __LINE__);
}
/* Add the public key to the storage system. */
try {
$imp_pgp->addPublicKey($mime_part->getContents());
- Util::closeWindowJS();
+ Horde_Util::closeWindowJS();
} catch (Horde_Exception $e) {
$notification->push($e, $key_info->getCode());
}
require_once 'Horde/Help.php';
require_once 'Horde/Prefs/UI.php';
$app = 'imp';
-$chunk = Util::nonInputVar('chunk');
+$chunk = Horde_Util::nonInputVar('chunk');
Prefs_UI::generateHeader('pgp', $chunk);
/* If PGP preference not active, do NOT show PGP Admin screen. */
if (!$t->get('empty_pubkey_list')) {
$plist = array();
foreach ($pubkey_list as $val) {
- $linkurl = Util::addParameter($selfURL, 'email', $val['email']);
+ $linkurl = Horde_Util::addParameter($selfURL, 'email', $val['email']);
$plist[] = array(
'name' => $val['name'],
'email' => $val['email'],
- 'view' => Horde::link(Util::addParameter($linkurl, 'actionID', 'view_public_key'), sprintf(_("View %s Public Key"), $val['name']), null, 'view_key'),
- 'info' => Horde::link(Util::addParameter($linkurl, 'actionID', 'info_public_key'), sprintf(_("Information on %s Public Key"), $val['name']), null, 'info_key'),
- 'delete' => Horde::link(Util::addParameter($linkurl, 'actionID', 'delete_public_key'), sprintf(_("Delete %s Public Key"), $val['name']), null, null, "if (confirm('" . addslashes(_("Are you sure you want to delete this public key?")) . "')) { return true; } else { return false; }")
+ 'view' => Horde::link(Horde_Util::addParameter($linkurl, 'actionID', 'view_public_key'), sprintf(_("View %s Public Key"), $val['name']), null, 'view_key'),
+ 'info' => Horde::link(Horde_Util::addParameter($linkurl, 'actionID', 'info_public_key'), sprintf(_("Information on %s Public Key"), $val['name']), null, 'info_key'),
+ 'delete' => Horde::link(Horde_Util::addParameter($linkurl, 'actionID', 'delete_public_key'), sprintf(_("Delete %s Public Key"), $val['name']), null, null, "if (confirm('" . addslashes(_("Are you sure you want to delete this public key?")) . "')) { return true; } else { return false; }")
);
}
$t->set('pubkey_list', $plist);
$t->set('no_source', !$GLOBALS['prefs']->getValue('add_source'));
if (!$t->get('no_source')) {
$cacheSess = &Horde_SessionObjects::singleton();
- $t->set('public_import_url', Util::addParameter(Util::addParameter($selfURL, 'actionID', 'import_public_key'), 'reload', $cacheSess->storeOid($selfURL, false)));
+ $t->set('public_import_url', Horde_Util::addParameter(Horde_Util::addParameter($selfURL, 'actionID', 'import_public_key'), 'reload', $cacheSess->storeOid($selfURL, false)));
$t->set('import_pubkey-help', Help::link('imp', 'pgp-import-pubkey'));
}
}
if ($secure_check) {
$t->set('has_key', $prefs->getValue('pgp_public_key') && $prefs->getValue('pgp_private_key'));
if ($t->get('has_key')) {
- $t->set('viewpublic', Horde::link(Util::addParameter($selfURL, 'actionID', 'view_personal_public_key'), _("View Personal Public Key"), null, 'view_key'));
- $t->set('infopublic', Horde::link(Util::addParameter($selfURL, 'actionID', 'info_personal_public_key'), _("Information on Personal Public Key"), null, 'info_key'));
- $t->set('sendkey', Horde::link(Util::addParameter($selfURL, 'actionID', 'send_public_key'), _("Send Key to Public Keyserver")));
+ $t->set('viewpublic', Horde::link(Horde_Util::addParameter($selfURL, 'actionID', 'view_personal_public_key'), _("View Personal Public Key"), null, 'view_key'));
+ $t->set('infopublic', Horde::link(Horde_Util::addParameter($selfURL, 'actionID', 'info_personal_public_key'), _("Information on Personal Public Key"), null, 'info_key'));
+ $t->set('sendkey', Horde::link(Horde_Util::addParameter($selfURL, 'actionID', 'send_public_key'), _("Send Key to Public Keyserver")));
$t->set('personalkey-public-help', Help::link('imp', 'pgp-personalkey-public'));
$passphrase = $imp_pgp->getPassphrase('personal');
- $t->set('passphrase', (empty($passphrase)) ? Horde::link('#', _("Enter Passphrase"), null, null, IMP::passphraseDialogJS('PGPPersonal') . ';return false;') . _("Enter Passphrase") : Horde::link(Util::addParameter($selfURL, 'actionID', 'unset_passphrase'), _("Unload Passphrase")) . _("Unload Passphrase"));
- $t->set('viewprivate', Horde::link(Util::addParameter($selfURL, 'actionID', 'view_personal_private_key'), _("View Personal Private Key"), null, 'view_key'));
- $t->set('infoprivate', Horde::link(Util::addParameter($selfURL, 'actionID', 'info_personal_private_key'), _("Information on Personal Private Key"), null, 'info_key'));
+ $t->set('passphrase', (empty($passphrase)) ? Horde::link('#', _("Enter Passphrase"), null, null, IMP::passphraseDialogJS('PGPPersonal') . ';return false;') . _("Enter Passphrase") : Horde::link(Horde_Util::addParameter($selfURL, 'actionID', 'unset_passphrase'), _("Unload Passphrase")) . _("Unload Passphrase"));
+ $t->set('viewprivate', Horde::link(Horde_Util::addParameter($selfURL, 'actionID', 'view_personal_private_key'), _("View Personal Private Key"), null, 'view_key'));
+ $t->set('infoprivate', Horde::link(Horde_Util::addParameter($selfURL, 'actionID', 'info_personal_private_key'), _("Information on Personal Private Key"), null, 'info_key'));
$t->set('personalkey-private-help', Help::link('imp', 'pgp-personalkey-private'));
$t->set('deletekeypair', addslashes(_("Are you sure you want to delete your keypair? (This is NOT recommended!)")));
$t->set('personalkey-delete-help', Help::link('imp', 'pgp-personalkey-delete'));
$t->set('personalkey-create-keylength-help', Help::link('imp', 'pgp-personalkey-create-keylength'));
$t->set('personalkey-create-passphrase-help', Help::link('imp', 'pgp-personalkey-create-passphrase'));
$t->set('keygen', addslashes(_("Key generation may take a long time to complete. Continue with key generation?")));
- $t->set('personal_import_url', Util::addParameter($selfURL, 'actionID', 'import_personal_public_key'));
+ $t->set('personal_import_url', Horde_Util::addParameter($selfURL, 'actionID', 'import_personal_public_key'));
$t->set('personalkey-create-actions-help', Help::link('imp', 'pgp-personalkey-create-actions'));
}
}
function _framesetUrl($url)
{
- if (!$GLOBALS['noframeset'] && Util::getFormData('load_frameset')) {
+ if (!$GLOBALS['noframeset'] && Horde_Util::getFormData('load_frameset')) {
$full_url = Horde::applicationUrl($GLOBALS['registry']->get('webroot', 'horde') . '/index.php', true);
- $url = Util::addParameter($full_url, 'url', _addAnchor($url, 'param'), false);
+ $url = Horde_Util::addParameter($full_url, 'url', _addAnchor($url, 'param'), false);
}
return $url;
}
$addActionID = true;
if ($GLOBALS['url_in']) {
- $url = Horde::url(Util::removeParameter($GLOBALS['url_in'], session_name()), true);
+ $url = Horde::url(Horde_Util::removeParameter($GLOBALS['url_in'], session_name()), true);
} elseif (Auth::getProvider() == 'imp') {
$url = Horde::applicationUrl($GLOBALS['registry']->get('webroot', 'horde') . '/', true);
/* Force the initial page to IMP if we're logging in to compose a
* message. */
if ($actionID == 'login_compose') {
- $url = Util::addParameter($url, 'url', _addAnchor(IMP_Session::getInitialUrl('login_compose', false), 'param'));
+ $url = Horde_Util::addParameter($url, 'url', _addAnchor(IMP_Session::getInitialUrl('login_compose', false), 'param'));
$addActionID = false;
}
} else {
$url = IMP_Session::getInitialUrl($actionID, false);
if ($isLogin) {
/* Don't show popup window in initial page. */
- $url = Util::addParameter($url, 'no_newmail_popup', 1, false);
+ $url = Horde_Util::addParameter($url, 'no_newmail_popup', 1, false);
}
}
if ($addActionID && $actionID) {
/* Preserve the actionID. */
- $url = Util::addParameter($url, 'actionID', $actionID, false);
+ $url = Horde_Util::addParameter($url, 'actionID', $actionID, false);
}
return $url;
break;
case 'url':
- $anchor = Util::getFormData('anchor_string');
+ $anchor = Horde_Util::getFormData('anchor_string');
if (!empty($anchor)) {
$url .= '#' . $anchor;
} else {
require_once dirname(__FILE__) . '/lib/base.php';
require_once 'Horde/Maintenance.php';
-$actionID = (Util::getFormData('action') == 'compose') ? 'login_compose' : Util::getFormData('actionID');
-$autologin = Util::getFormData('autologin');
-$imapuser = Util::getPost('imapuser');
-$pass = Util::getPost('pass');
+$actionID = (Horde_Util::getFormData('action') == 'compose') ? 'login_compose' : Horde_Util::getFormData('actionID');
+$autologin = Horde_Util::getFormData('autologin');
+$imapuser = Horde_Util::getPost('imapuser');
+$pass = Horde_Util::getPost('pass');
if (!empty($autologin)) {
$imapuser = IMP_Session::canAutoLogin();
$pass = Auth::getCredential('password');
/* Get URL/Anchor strings now. */
$url_anchor = null;
-$url_in = $url_form = Util::getFormData('url');
+$url_in = $url_form = Horde_Util::getFormData('url');
if (($pos = strrpos($url_in, '#')) !== false) {
$url_anchor = substr($url_in, $pos + 1);
$url_in = substr($url_in, 0, $pos);
}
/* If we are returning from Maintenance processing. */
-if (Util::getFormData(MAINTENANCE_DONE_PARAM)) {
+if (Horde_Util::getFormData(MAINTENANCE_DONE_PARAM)) {
/* Finish up any login tasks we haven't completed yet. */
IMP_Session::loginTasks();
if (empty($url_in)) {
$url = IMP_Session::getInitialUrl($actionID, false);
} elseif (!empty($actionID)) {
- $url = Util::addParameter($url_in, 'actionID', $actionID, false);
+ $url = Horde_Util::addParameter($url_in, 'actionID', $actionID, false);
}
/* Don't show popup window in initial page. */
if ($isLogin) {
- $url = Util::addParameter($url, 'no_newmail_popup', 1, false);
+ $url = Horde_Util::addParameter($url, 'no_newmail_popup', 1, false);
}
_redirect(_framesetUrl($url));
Horde::getCleanSession();
}
- if (IMP_Session::createSession($imapuser, $pass, Util::getFormData('server_key', IMP_Session::getAutoLoginServer()))) {
- $ie_version = Util::getFormData('ie_version');
+ if (IMP_Session::createSession($imapuser, $pass, Horde_Util::getFormData('server_key', IMP_Session::getAutoLoginServer()))) {
+ $ie_version = Horde_Util::getFormData('ie_version');
if ($ie_version) {
$browser->setIEVersion($ie_version);
}
- if (($horde_language = Util::getFormData('new_lang'))) {
+ if (($horde_language = Horde_Util::getFormData('new_lang'))) {
$_SESSION['horde_language'] = $horde_language;
}
$view = empty($conf['user']['select_view'])
? (empty($conf['user']['force_view']) ? 'imp' : $conf['user']['force_view'])
- : Util::getFormData('select_view', 'imp');
+ : Horde_Util::getFormData('select_view', 'imp');
setcookie('default_imp_view', $view, time() + 30 * 86400,
$conf['cookie']['path'],
/* Determine the mailbox that was requested and if only new mail should be
* displayed. Default to new mail in INBOX. */
-$request = Util::getPathInfo();
+$request = Horde_Util::getPathInfo();
if (!empty($request)) {
$request_parts = explode('/-/', $request);
if (!empty($request_parts[0])) {
require_once dirname(__FILE__) . '/lib/base.php';
-$id = Util::getFormData('id');
-$index = Util::getFormData('index');
+$id = Horde_Util::getFormData('id');
+$index = Horde_Util::getFormData('index');
/* Run through the action handlers. */
-$actionID = Util::getFormData('actionID');
+$actionID = Horde_Util::getFormData('actionID');
switch ($actionID) {
case 'save_image':
$contents = &IMP_Contents::singleton($index);
'data' => $mime_part->getContents(),
'type' => $mime_part->getType()
);
- $res = $registry->call('images/saveImage', array(null, Util::getFormData('gallery'), $image_data));
+ $res = $registry->call('images/saveImage', array(null, Horde_Util::getFormData('gallery'), $image_data));
if (is_a($res, 'PEAR_Error')) {
$notification->push($res, 'horde.error');
break;
}
- Util::closeWindowJS();
+ Horde_Util::closeWindowJS();
exit;
}
exit;
}
-$actionID = Util::getFormData('actionID');
-$edit_query = Util::getFormData('edit_query');
-$edit_query_vfolder = Util::getFormData('edit_query_vfolder');
-$search_mailbox = Util::getFormData('search_mailbox');
+$actionID = Horde_Util::getFormData('actionID');
+$edit_query = Horde_Util::getFormData('edit_query');
+$edit_query_vfolder = Horde_Util::getFormData('edit_query_vfolder');
+$search_mailbox = Horde_Util::getFormData('search_mailbox');
$imp_search_fields = $imp_search->searchFields();
/* Get URL parameter data. */
$search = array();
-if (Util::getFormData('no_match')) {
+if (Horde_Util::getFormData('no_match')) {
$search = $imp_search->retrieveUIQuery();
$retrieve_search = true;
} elseif (($edit_query !== null) && $imp_search->isSearchMbox($edit_query)) {
$retrieve_search = false;
}
if (empty($search)) {
- $search['field'] = Util::getFormData('field', array('from', 'to', 'subject', 'body'));
+ $search['field'] = Horde_Util::getFormData('field', array('from', 'to', 'subject', 'body'));
if (!empty($search['field']) && !end($search['field'])) {
array_pop($search['field']);
}
$search['field_end'] = count($search['field']);
- $search['match'] = Util::getFormData('search_match');
- $search['text'] = Util::getFormData('search_text');
- $search['text_not'] = Util::getFormData('search_text_not');
- $search['date'] = Util::getFormData('search_date');
- $search['folders'] = Util::getFormData('search_folders', array());
- $search['save_vfolder'] = Util::getFormData('save_vfolder');
- $search['vfolder_label'] = Util::getFormData('vfolder_label');
- $search['mbox'] = Util::getFormData('mbox', $search_mailbox);
+ $search['match'] = Horde_Util::getFormData('search_match');
+ $search['text'] = Horde_Util::getFormData('search_text');
+ $search['text_not'] = Horde_Util::getFormData('search_text_not');
+ $search['date'] = Horde_Util::getFormData('search_date');
+ $search['folders'] = Horde_Util::getFormData('search_folders', array());
+ $search['save_vfolder'] = Horde_Util::getFormData('save_vfolder');
+ $search['vfolder_label'] = Horde_Util::getFormData('vfolder_label');
+ $search['mbox'] = Horde_Util::getFormData('mbox', $search_mailbox);
}
/* Run through the action handlers. */
}
/* Redirect to the Mailbox Screen. */
- header('Location: ' . Util::addParameter(Horde::applicationUrl('mailbox.php', true), 'mailbox', $GLOBALS['imp_search']->createSearchID($id), false));
+ header('Location: ' . Horde_Util::addParameter(Horde::applicationUrl('mailbox.php', true), 'mailbox', $GLOBALS['imp_search']->createSearchID($id), false));
exit;
case 'reset_search':
break;
case 'delete_field':
- $key = Util::getFormData('delete_field_id');
+ $key = Horde_Util::getFormData('delete_field_id');
/* Unset all entries in array input and readjust ids. */
$vars = array('field', 'text', 'text_not', 'date');
$search['folders'][] = 'INBOX';
$subscribe = false;
} elseif ($subscribe = $prefs->getValue('subscribe')) {
- $shown = Util::getFormData('show_subscribed_only', $subscribe);
+ $shown = Horde_Util::getFormData('show_subscribed_only', $subscribe);
}
/* Prepare the search template. */
sprintf(
_("Search %s"),
Horde::link(
- Horde::url(Util::addParameter('mailbox.php',
+ Horde::url(Horde_Util::addParameter('mailbox.php',
'mailbox',
$search['mbox'])))
. htmlspecialchars(IMP::displayFolder($search['mbox']))
if (!empty($saved_searches)) {
$ss = array();
foreach ($saved_searches as $key => $val) {
- if (String::length($val) > 100) {
- $val = String::substr($val, 0, 100) . ' ...';
+ if (Horde_String::length($val) > 100) {
+ $val = Horde_String::substr($val, 0, 100) . ' ...';
}
$ss[] = array('val' => htmlspecialchars($key), 'text' => htmlspecialchars($val));
}
$t->setOption('gettext', true);
$t->set('selfurl', Horde::applicationUrl('smime.php'));
$t->set('broken_mp_form', $GLOBALS['browser']->hasQuirk('broken_multipart_form'));
- $t->set('reload', htmlspecialchars(Util::getFormData('reload')));
+ $t->set('reload', htmlspecialchars(Horde_Util::getFormData('reload')));
$t->set('target', $target);
- $t->set('forminput', Util::formInput());
+ $t->set('forminput', Horde_Util::formInput());
$t->set('import_public_key', $target == 'process_import_public_key');
$t->set('import_personal_certs', $target == 'process_import_personal_certs');
echo $t->fetch(IMP_TEMPLATES . '/smime/import_key.html');
function _getImportKey()
{
- $key = Util::getFormData('import_key');
+ $key = Horde_Util::getFormData('import_key');
if (!empty($key)) {
return $key;
}
function _actionWindow()
{
- $oid = Util::getFormData('passphrase_action');
+ $oid = Horde_Util::getFormData('passphrase_action');
$cacheSess = &Horde_SessionObjects::singleton();
$cacheSess->setPruneFlag($oid, true);
- Util::closeWindowJS($cacheSess->query($oid));
+ Horde_Util::closeWindowJS($cacheSess->query($oid));
}
function _reloadWindow()
{
$cacheSess = &Horde_SessionObjects::singleton();
- $reload = Util::getFormData('reload');
+ $reload = Horde_Util::getFormData('reload');
$cacheSess->setPruneFlag($reload, true);
- Util::closeWindowJS('opener.focus();opener.location.href="' . $cacheSess->query($reload) . '";');
+ Horde_Util::closeWindowJS('opener.focus();opener.location.href="' . $cacheSess->query($reload) . '";');
}
function _textWindowOutput($filename, $msg, $html = false)
$secure_check = Horde::isConnectionSecure();
/* Run through the action handlers */
-$actionID = Util::getFormData('actionID');
+$actionID = Horde_Util::getFormData('actionID');
switch ($actionID) {
case 'delete_key':
$imp_smime->deletePersonalKeys();
case 'delete_public_key':
try {
- $imp_smime->deletePublicKey(Util::getFormData('email'));
- $notification->push(sprintf(_("S/MIME Public Key for \"%s\" was successfully deleted."), Util::getFormData('email')), 'horde.success');
+ $imp_smime->deletePublicKey(Horde_Util::getFormData('email'));
+ $notification->push(sprintf(_("S/MIME Public Key for \"%s\" was successfully deleted."), Horde_Util::getFormData('email')), 'horde.success');
} catch (Horde_Exception $e) {
$notification->push($e);
}
case 'view_public_key':
case 'info_public_key':
try {
- $key = $imp_smime->getPublicKey(Util::getFormData('email'));
+ $key = $imp_smime->getPublicKey(Horde_Util::getFormData('email'));
} catch (Horde_Exception $e) {
$key = $e->getMessage();
}
_importKeyDialog('process_import_personal_certs');
} else {
try {
- $imp_smime->addFromPKCS12($pkcs12, Util::getFormData('upload_key_pass'), Util::getFormData('upload_key_pk_pass'));
+ $imp_smime->addFromPKCS12($pkcs12, Horde_Util::getFormData('upload_key_pass'), Horde_Util::getFormData('upload_key_pk_pass'));
$notification->push(_("S/MIME Public/Private Keypair successfully added."), 'horde.success');
_reloadWindow();
} catch (Horde_Exception $e) {
case 'save_attachment_public_key':
/* Retrieve the key from the message. */
try {
- $contents = &IMP_Contents::singleton(Util::getFormData('uid') . IMP::IDX_SEP . Util::getFormData('mailbox'));
+ $contents = &IMP_Contents::singleton(Horde_Util::getFormData('uid') . IMP::IDX_SEP . Horde_Util::getFormData('mailbox'));
} catch (Horde_Exception $e) {
Horde::fatal($e, __FILE__, __LINE__);
}
- $mime_part = $contents->getMIMEPart(Util::getFormData('mime_id'));
+ $mime_part = $contents->getMIMEPart(Horde_Util::getFormData('mime_id'));
if (empty($mime_part)) {
Horde::fatal('Cannot retrieve public key from message.', __FILE__, __LINE__);
}
/* Add the public key to the storage system. */
try {
$imp_smime->addPublicKey($mime_part);
- Util::closeWindowJS();
+ Horde_Util::closeWindowJS();
} catch (Horde_Exception $e) {
$notification->push(_("No Certificate found"), 'horde.error');
}
break;
case 'save_options':
- $prefs->setValue('use_smime', Util::getFormData('use_smime') ? 1 : 0);
- $prefs->setValue('smime_verify', Util::getFormData('smime_verify') ? 1 : 0);
+ $prefs->setValue('use_smime', Horde_Util::getFormData('use_smime') ? 1 : 0);
+ $prefs->setValue('smime_verify', Horde_Util::getFormData('smime_verify') ? 1 : 0);
$notification->push(_("Preferences successfully updated."), 'horde.success');
break;
}
require_once 'Horde/Help.php';
require_once 'Horde/Prefs/UI.php';
$app = 'imp';
-$chunk = Util::nonInputVar('chunk');
+$chunk = Horde_Util::nonInputVar('chunk');
Prefs_UI::generateHeader('smime', $chunk);
$selfURL = Horde::applicationUrl('smime.php');
if (!$t->get('empty_pubkey_list')) {
$plist = array();
foreach ($pubkey_list as $val) {
- $linkurl = Util::addParameter($selfURL, 'email', $val['email']);
+ $linkurl = Horde_Util::addParameter($selfURL, 'email', $val['email']);
$plist[] = array(
'name' => $val['name'],
'email' => $val['email'],
- 'view' => Horde::link(Util::addParameter($linkurl, 'actionID', 'view_public_key'), sprintf(_("View %s Public Key"), $val['name']), null, 'view_key'),
- 'info' => Horde::link(Util::addParameter($linkurl, 'actionID', 'info_public_key'), sprintf(_("Information on %s Public Key"), $val['name']), null, 'info_key'),
- 'delete' => Horde::link(Util::addParameter($linkurl, 'actionID', 'delete_public_key'), sprintf(_("Delete %s Public Key"), $val['name']), null, null, "if (confirm('" . addslashes(_("Are you sure you want to delete this public key?")) . "')) { return true; } else { return false; }")
+ 'view' => Horde::link(Horde_Util::addParameter($linkurl, 'actionID', 'view_public_key'), sprintf(_("View %s Public Key"), $val['name']), null, 'view_key'),
+ 'info' => Horde::link(Horde_Util::addParameter($linkurl, 'actionID', 'info_public_key'), sprintf(_("Information on %s Public Key"), $val['name']), null, 'info_key'),
+ 'delete' => Horde::link(Horde_Util::addParameter($linkurl, 'actionID', 'delete_public_key'), sprintf(_("Delete %s Public Key"), $val['name']), null, null, "if (confirm('" . addslashes(_("Are you sure you want to delete this public key?")) . "')) { return true; } else { return false; }")
);
}
$t->set('pubkey_list', $plist);
$t->set('no_source', !$GLOBALS['prefs']->getValue('add_source'));
if (!$t->get('no_source')) {
$cacheSess = &Horde_SessionObjects::singleton();
- $t->set('public_import_url', Util::addParameter(Util::addParameter($selfURL, 'actionID', 'import_public_key'), 'reload', $cacheSess->storeOid($selfURL, false)));
+ $t->set('public_import_url', Horde_Util::addParameter(Horde_Util::addParameter($selfURL, 'actionID', 'import_public_key'), 'reload', $cacheSess->storeOid($selfURL, false)));
$t->set('import_pubkey-help', Help::link('imp', 'smime-import-pubkey'));
}
}
if (!$t->get('secure_check')) {
$t->set('has_key', $prefs->getValue('smime_public_key') && $prefs->getValue('smime_private_key'));
if ($t->get('has_key')) {
- $t->set('viewpublic', Horde::link(Util::addParameter($selfURL, 'actionID', 'view_personal_public_key'), _("View Personal Public Key"), null, 'view_key'));
- $t->set('infopublic', Horde::link(Util::addParameter($selfURL, 'actionID', 'info_personal_public_key'), _("Information on Personal Public Key"), null, 'info_key'));
+ $t->set('viewpublic', Horde::link(Horde_Util::addParameter($selfURL, 'actionID', 'view_personal_public_key'), _("View Personal Public Key"), null, 'view_key'));
+ $t->set('infopublic', Horde::link(Horde_Util::addParameter($selfURL, 'actionID', 'info_personal_public_key'), _("Information on Personal Public Key"), null, 'info_key'));
$passphrase = $imp_smime->getPassphrase();
- $t->set('passphrase', empty($passphrase) ? Horde::link('#', _("Enter Passphrase"), null, null, IMP::passphraseDialogJS('SMIMEPersonal') . ';return false;') . _("Enter Passphrase") : Horde::link(Util::addParameter($selfURL, 'actionID', 'unset_passphrase'), _("Unload Passphrase")) . _("Unload Passphrase"));
- $t->set('viewprivate', Horde::link(Util::addParameter($selfURL, 'actionID', 'view_personal_private_key'), _("View Personal Private Key"), null, 'view_key'));
+ $t->set('passphrase', empty($passphrase) ? Horde::link('#', _("Enter Passphrase"), null, null, IMP::passphraseDialogJS('SMIMEPersonal') . ';return false;') . _("Enter Passphrase") : Horde::link(Horde_Util::addParameter($selfURL, 'actionID', 'unset_passphrase'), _("Unload Passphrase")) . _("Unload Passphrase"));
+ $t->set('viewprivate', Horde::link(Horde_Util::addParameter($selfURL, 'actionID', 'view_personal_private_key'), _("View Personal Private Key"), null, 'view_key'));
$t->set('deletekeypair', addslashes(_("Are you sure you want to delete your keypair? (This is NOT recommended!)")));
$t->set('personalkey-delete-help', Help::link('imp', 'smime-delete-personal-certs'));
} else {
- $t->set('personal_import_url', Util::addParameter($selfURL, 'actionID', 'import_personal_certs'));
+ $t->set('personal_import_url', Horde_Util::addParameter($selfURL, 'actionID', 'import_personal_certs'));
$t->set('import-cert-help', Help::link('imp', 'smime-import-personal-certs'));
}
}
require_once dirname(__FILE__) . '/lib/base.php';
require_once 'Horde/Prefs/UI.php';
-$compose_url = Util::addParameter(Horde::url($registry->get('webroot', 'horde') . '/services/prefs.php', true), 'app', 'imp', false);
+$compose_url = Horde_Util::addParameter(Horde::url($registry->get('webroot', 'horde') . '/services/prefs.php', true), 'app', 'imp', false);
/* Is the preference locked? */
if ($prefs->isLocked('stationery')) {
/* Retrieve stationery. */
$stationery_list = @unserialize($prefs->getValue('stationery', false));
$stationery_list = is_array($stationery_list)
- ? String::convertCharset($stationery_list, $prefs->getCharset())
+ ? Horde_String::convertCharset($stationery_list, $prefs->getCharset())
: array();
/* Get form data. */
-$selected = Util::getFormData('stationery');
+$selected = Horde_Util::getFormData('stationery');
if (strlen($selected)) {
$selected = (int)$selected;
}
/* Always check for stationery type switches. */
-$content = Util::getFormData('content', '');
-$last_type = Util::getFormData('last_type');
-$name = Util::getFormData('name', '');
-$type = Util::getFormData('type', 'plain');
+$content = Horde_Util::getFormData('content', '');
+$last_type = Horde_Util::getFormData('last_type');
+$name = Horde_Util::getFormData('name', '');
+$type = Horde_Util::getFormData('type', 'plain');
if (!empty($last_type) && $last_type != $type) {
if ($type == 'plain') {
require_once 'Horde/Text/Filter.php';
$stationery = array('n' => $name, 't' => $type, 'c' => $content);
/* Run through the action handlers. */
-$actionID = Util::getFormData('actionID');
+$actionID = Horde_Util::getFormData('actionID');
$updated = false;
switch ($actionID) {
case 'update':
- if (Util::getFormData('edit')) {
+ if (Horde_Util::getFormData('edit')) {
/* Stationery has been switched. */
if (strlen($selected)) {
/* Edit existing. */
} else {
$stationery = array('n' => '', 't' => 'plain', 'c' => '');
}
- } elseif (Util::getFormData('delete')) {
+ } elseif (Horde_Util::getFormData('delete')) {
/* Delete stationery. */
if (isset($stationery_list[$selected])) {
$updated = sprintf(_("The stationery \"%s\" has been deleted."), $stationery_list[$selected]['n']);
$selected = null;
}
$stationery = array('n' => '', 't' => 'plain', 'c' => '');
- } elseif (Util::getFormData('save')) {
+ } elseif (Horde_Util::getFormData('save')) {
/* Saving stationery. */
if (!strlen($selected)) {
$selected = count($stationery_list);
}
if ($updated) {
- $prefs->setValue('stationery', serialize(String::convertCharset($stationery_list, NLS::getCharset(), $prefs->getCharset())), false);
+ $prefs->setValue('stationery', serialize(Horde_String::convertCharset($stationery_list, NLS::getCharset(), $prefs->getCharset())), false);
$notification->push($updated, 'horde.success');
}
extract($result);
$app = 'imp';
-$chunk = Util::nonInputVar('chunk');
+$chunk = Horde_Util::nonInputVar('chunk');
Prefs_UI::generateHeader(null, $chunk);
$t = new IMP_Template();
$t->setOption('gettext', true);
$t->set('action', Horde::selfUrl());
-$t->set('forminput', Util::formInput());
-$t->set('navcell', Util::bufferOutput(array('Prefs_UI', 'generateNavigationCell'), 'compose'));
+$t->set('forminput', Horde_Util::formInput());
+$t->set('navcell', Horde_Util::bufferOutput(array('Prefs_UI', 'generateNavigationCell'), 'compose'));
$slist = array();
foreach ($stationery_list as $key => $choice) {
$t->set('html', $stationery['t'] == 'html');
$t->set('content_label', Horde::label('content', _("Stationery:")));
$t->set('content', $stationery['c']);
-$t->set('button_href', Util::addParameter($compose_url, 'group', 'compose'));
+$t->set('button_href', Horde_Util::addParameter($compose_url, 'group', 'compose'));
$t->set('button_val', htmlspecialchars(_("Return to Message Composition"), ENT_COMPAT, NLS::getCharset()));
echo $t->fetch(IMP_TEMPLATES . '/stationery/stationery.html');
?>
<div id="composeloading"></div>
<form id="compose" name="compose" enctype="multipart/form-data" action="compose-dimp.php" method="post" target="submit_frame">
-<?php echo Util::formInput() ?>
+<?php echo Horde_Util::formInput() ?>
<input type="hidden" id="action" name="action" />
<input type="hidden" id="last_identity" name="last_identity" value="<?php echo (int)$selected_identity ?>" />
<input type="hidden" id="html" name="html" value="<?php echo intval($rte && $compose_html) ?>" />
if (!empty($refresh_time) && !empty($refresh_url)) {
echo "<meta http-equiv=\"refresh\" content=\"$refresh_time;url=$refresh_url\" />\n";
}
-echo Util::bufferOutput('require', IMP_TEMPLATES . '/javascript_defs.php');
+echo Horde_Util::bufferOutput('require', IMP_TEMPLATES . '/javascript_defs.php');
IMP::includeScriptFiles();
IMP::includeStylesheetFiles(!empty($printer_friendly));
?>
<title><?php echo htmlspecialchars($page_title) ?></title>
<link href="<?php echo $GLOBALS['registry']->getImageDir() ?>/favicon.ico" rel="SHORTCUT ICON" />
-<?php if ($mailbox_url = Util::nonInputVar('mailbox_url')): ?>
+<?php if ($mailbox_url = Horde_Util::nonInputVar('mailbox_url')): ?>
<link href="<?php echo $mailbox_url ?>" rel="Up" />
-<?php elseif (!Util::nonInputVar('login_page')): ?>
-<link href="<?php echo Util::addParameter(Horde::applicationUrl('mailbox.php'), 'mailbox', 'INBOX') ?>" rel="Top" />
+<?php elseif (!Horde_Util::nonInputVar('login_page')): ?>
+<link href="<?php echo Horde_Util::addParameter(Horde::applicationUrl('mailbox.php'), 'mailbox', 'INBOX') ?>" rel="Top" />
<?php endif; ?>
-<?php if ($first_url = Util::nonInputVar('first_url')): ?>
+<?php if ($first_url = Horde_Util::nonInputVar('first_url')): ?>
<link href="<?php echo $first_url ?>" rel="First" />
<?php endif; ?>
-<?php if ($prev_url = Util::nonInputVar('prev_url')): ?>
+<?php if ($prev_url = Horde_Util::nonInputVar('prev_url')): ?>
<link href="<?php echo $prev_url ?>" rel="Previous" id="prev" />
<?php endif; ?>
-<?php if ($next_url = Util::nonInputVar('next_url')): ?>
+<?php if ($next_url = Horde_Util::nonInputVar('next_url')): ?>
<link href="<?php echo $next_url ?>" rel="Next" id="next" />
<?php endif; ?>
-<?php if ($last_url = Util::nonInputVar('last_url')): ?>
+<?php if ($last_url = Horde_Util::nonInputVar('last_url')): ?>
<link href="<?php echo $last_url ?>" rel="Last" />
<?php endif; ?>
-<?php if ($rss_url = Util::nonInputVar('rss_url')): ?>
+<?php if ($rss_url = Horde_Util::nonInputVar('rss_url')): ?>
<link rel="alternate" type="application/rss+xml" href="<?php echo $rss_url ?>" />
<?php endif; ?>
-<?php if (!Util::nonInputVar('login_page')): ?>
+<?php if (!Horde_Util::nonInputVar('login_page')): ?>
<link href="<?php echo Horde::applicationUrl('search.php') ?>" rel="search" />
<?php endif ?>
<?php if (!empty($ie_clientcaps)): ?><style>IE\:clientcaps {behavior:url(#default#clientcaps)}</style><?php endif; ?>
<?php IMP::outputInlineScript(); ?>
</head>
-<body<?php if ($bc = Util::nonInputVar('bodyClass')) echo ' class="' . $bc . '"' ?><?php if ($bi = Util::nonInputVar('bodyId')) echo ' id="' . $bi . '"'; ?>>
+<body<?php if ($bc = Horde_Util::nonInputVar('bodyClass')) echo ' class="' . $bc . '"' ?><?php if ($bi = Horde_Util::nonInputVar('bodyId')) echo ' id="' . $bi . '"'; ?>>
<?php if (!empty($ie_clientcaps)): ?><IE:clientcaps ID="objCCaps" /><?php endif; ?>
// Hidden Variables.
$f->add(new Horde_Mobile_hidden('composeCache', $cacheID));
-$f->add(new Horde_Mobile_hidden('thismailbox', Util::getFormData('thismailbox')));
-$f->add(new Horde_Mobile_hidden('index', Util::getFormData('index')));
-$f->add(new Horde_Mobile_hidden('resume_draft', Util::getFormData('resume_draft', $resume_draft)));
+$f->add(new Horde_Mobile_hidden('thismailbox', Horde_Util::getFormData('thismailbox')));
+$f->add(new Horde_Mobile_hidden('index', Horde_Util::getFormData('index')));
+$f->add(new Horde_Mobile_hidden('resume_draft', Horde_Util::getFormData('resume_draft', $resume_draft)));
-if (Util::getFormData('ctype')) {
- $f->add(new Horde_Mobile_hidden('ctype', Util::getFormData('ctype')));
+if (Horde_Util::getFormData('ctype')) {
+ $f->add(new Horde_Mobile_hidden('ctype', Horde_Util::getFormData('ctype')));
} else {
switch ($actionID) {
case 'r':
}
}
-if ((Util::getFormData('is_reply') == 1) ||
+if ((Horde_Util::getFormData('is_reply') == 1) ||
(strpos($actionID, 'reply') === 0)) {
$f->add(new Horde_Mobile_hidden('is_reply', 1));
$f->add(new Horde_Mobile_hidden('in_reply_to', $header['in_reply_to']));
if (!$prefs->isLocked('default_identity')) {
$ib = &$f->add(new Horde_Mobile_block(new Horde_Mobile_text(_("Identity"))));
$ident_sel = &$ib->add(new Horde_Mobile_select('identity'));
- $default = Util::getFormData('identity', $identity->getDefault());
+ $default = Horde_Util::getFormData('identity', $identity->getDefault());
foreach ($select_list as $key => $select) {
$ident_sel->add($select, $key, ($key == $default));
}
$f->add(new Horde_Mobile_hidden('thismailbox', $thismailbox));
$f->add(new Horde_Mobile_hidden('index', $index));
$f->add(new Horde_Mobile_hidden('action', 'rc'));
-$f->add(new Horde_Mobile_hidden('array_index', Util::getFormData('array_index')));
+$f->add(new Horde_Mobile_hidden('array_index', Horde_Util::getFormData('array_index')));
$f->add(new Horde_Mobile_input('to', $header['to'], _("To: ")));
$c->add(new Horde_Mobile_text(sprintf(_("Welcome to %s"), ($imp_auth) ? $registry->get('name',' horde') : $registry->get('name'))));
$f = &$c->add(new Horde_Mobile_form(Horde::applicationUrl('redirect.php', false, -1)));
-$f->add(new Horde_Mobile_input('imapuser', htmlspecialchars(Util::getFormData('imapuser')), _("Username: ")));
+$f->add(new Horde_Mobile_input('imapuser', htmlspecialchars(Horde_Util::getFormData('imapuser')), _("Username: ")));
// Add a password input, and set the type accordingly.
$p = &$f->add(new Horde_Mobile_input('pass', '', _("Password: ")));
require_once dirname(__FILE__) . '/lib/base.load.php';
include_once HORDE_BASE . '/lib/core.php';
-/* We should have loaded the String class, from the Horde_Util
- * package, in core.php. If String:: isn't defined, then we're not
+/* We should have loaded the Horde_String class, from the Horde_Util
+ * package, in core.php. If Horde_String:: isn't defined, then we're not
* finding some critical libraries. */
-if (!class_exists('String')) {
+if (!class_exists('Horde_String')) {
echo '<br /><h2 style="color:red">The Horde_Util package was not found. If PHP\'s error_reporting setting is high enough and display_errors is on, there should be error messages printed above that may help you in debugging the problem. If you are simply missing these files, then you need to get the <a href="http://cvs.horde.org/cvs.php/framework">framework</a> module from <a href="http://www.horde.org/source/">Horde CVS</a>, and install the packages in it with the install-packages.php script.</h2>';
exit;
}
* DEFAULT/'thread' - Thread mode
* 'msgview' - Multiple message view
*/
-$mode = Util::getFormData('mode', 'thread');
+$mode = Horde_Util::getFormData('mode', 'thread');
$imp_mailbox = &IMP_Mailbox::singleton($imp_mbox['mailbox'], $imp_mbox['index']);
}
} else {
/* MSGVIEW MODE: Make sure we have a valid list of messages. */
- $msglist = $GLOBALS['imp_imap']->ob->utils->fromSequenceString(Util::getFormData('msglist'));
+ $msglist = $GLOBALS['imp_imap']->ob->utils->fromSequenceString(Horde_Util::getFormData('msglist'));
if (empty($msglist)) {
$error = true;
}
NLS::setTimeZone();
/* Run through action handlers. */
-$actionID = Util::getFormData('actionID');
+$actionID = Horde_Util::getFormData('actionID');
switch ($actionID) {
case 'add_address':
try {
- $contact_link = IMP::addAddress(Util::getFormData('address'), Util::getFormData('name'));
+ $contact_link = IMP::addAddress(Horde_Util::getFormData('address'), Horde_Util::getFormData('name'));
$notification->push(sprintf(_("Entry \"%s\" was successfully added to the address book"), $contact_link), 'horde.success', array('content.raw'));
} catch (Horde_Exception $e) {
$notification->push($e);
$curr_msg['link'] = Horde::widget('#display', _("Back to Multiple Message View Index"), 'widget', '', '', _("Back to Multiple Message View Index"), true);
}
$curr_msg['link'] .= ' | ' . Horde::widget(IMP::generateIMPUrl('message.php', $imp_mbox['mailbox'], $idx, $mbox), _("Go to Message"), 'widget', '', '', _("Go to Message"), true);
- $curr_msg['link'] .= ' | ' . Horde::widget(Util::addParameter(IMP::generateIMPUrl('mailbox.php', $mbox), array('start' => $imp_mailbox->getArrayIndex($idx))), sprintf(_("Back to %s"), $page_label), 'widget', '', '', sprintf(_("Bac_k to %s"), $page_label));
+ $curr_msg['link'] .= ' | ' . Horde::widget(Horde_Util::addParameter(IMP::generateIMPUrl('mailbox.php', $mbox), array('start' => $imp_mailbox->getArrayIndex($idx))), sprintf(_("Back to %s"), $page_label), 'widget', '', '', sprintf(_("Bac_k to %s"), $page_label));
$curr_tree['class'] = (++$rowct % 2) ? 'text' : 'item0';
$curr_tree['subject'] = (($mode == 'thread') ? $threadtree[$idx] : null) . ' ' . Horde::link('#i' . $idx) . $subject_header . '</a> (' . $addr . ')';
'subject',
$mode == 'thread' ? $subject : sprintf(_("%d Messages"), count($msgs)));
if ($mode == 'thread') {
- $delete_link = Util::addParameter(
+ $delete_link = Horde_Util::addParameter(
IMP::generateIMPUrl('mailbox.php', $mbox),
array('start' => $imp_mailbox->getArrayIndex($idx),
'actionID' => 'delete_messages',
'mailbox_token' => IMP::getRequestToken('imp.mailbox')));
foreach ($thread as $val) {
- $delete_link = Util::addParameter(
+ $delete_link = Horde_Util::addParameter(
$delete_link,
array('indices[]' => $val . IMP::IDX_SEP . $imp_mbox['mailbox']));
}
function _sanitizeName($name)
{
- $name = String::convertCharset($name, NLS::getCharset(), 'UTF-8');
- return String::convertCharset(trim(preg_replace('/[^\pL\pN-+_. ]/u', '_', $name), ' _'), 'UTF-8');
+ $name = Horde_String::convertCharset($name, NLS::getCharset(), 'UTF-8');
+ return Horde_String::convertCharset(trim(preg_replace('/[^\pL\pN-+_. ]/u', '_', $name), ' _'), 'UTF-8');
}
/* Don't compress if we are already sending in compressed format. */
$session_control = 'readonly';
require_once dirname(__FILE__) . '/lib/base.php';
-$actionID = Util::getFormData('actionID');
-$ctype = Util::getFormData('ctype');
-$id = Util::getFormData('id');
+$actionID = Horde_Util::getFormData('actionID');
+$ctype = Horde_Util::getFormData('ctype');
+$id = Horde_Util::getFormData('id');
/* 'compose_attach_preview' doesn't use IMP_Contents since there is no
* IMAP message data - rather, we must use the IMP_Compose object to
* get the necessary Horde_Mime_Part. */
if ($actionID == 'compose_attach_preview') {
/* Initialize the IMP_Compose:: object. */
- $imp_compose = &IMP_Compose::singleton(Util::getFormData('composeCache'));
+ $imp_compose = &IMP_Compose::singleton(Horde_Util::getFormData('composeCache'));
$mime = $imp_compose->buildAttachment($id);
/* Create a dummy IMP_Contents() object so we can use the view code below.
$actionID = 'view_attach';
$id = $mime->getMimeId();
} else {
- $uid = Util::getFormData('uid');
+ $uid = Horde_Util::getFormData('uid');
if (!$uid) {
// TODO: Remove usage of 'index'
- $uid = Util::getFormData('index');
+ $uid = Horde_Util::getFormData('index');
}
- $mailbox = Util::getFormData('mailbox');
+ $mailbox = Horde_Util::getFormData('mailbox');
if (!$uid || !$mailbox) {
exit;
}
break;
case 'download_render':
- $render = $contents->renderMIMEPart($id, Util::getFormData('mode', IMP_Contents::RENDER_FULL), array('type' => $ctype));
+ $render = $contents->renderMIMEPart($id, Horde_Util::getFormData('mode', IMP_Contents::RENDER_FULL), array('type' => $ctype));
reset($render);
$key = key($render);
$body = $render[$key]['data'];
}
/* Compress output? */
- if (($actionID == 'download_attach') && Util::getFormData('zip')) {
+ if (($actionID == 'download_attach') && Horde_Util::getFormData('zip')) {
$horde_compress = &Horde_Compress::singleton('zip');
$body = $horde_compress->compress(array(array('data' => $body, 'name' => $name)));
$name .= '.zip';
exit;
case 'view_attach':
- $render = $contents->renderMIMEPart($id, Util::getFormData('mode', IMP_Contents::RENDER_FULL), array('type' => $ctype));
+ $render = $contents->renderMIMEPart($id, Horde_Util::getFormData('mode', IMP_Contents::RENDER_FULL), array('type' => $ctype));
if (!empty($render)) {
reset($render);
$key = key($render);
$folder = $blacklist_folder = null;
/* Perform requested actions. */
-$actionID = Util::getFormData('actionID');
+$actionID = Horde_Util::getFormData('actionID');
switch ($actionID) {
case 'create_folder':
- $blacklist_folder = Ingo::createFolder(Util::getFormData('new_folder_name'));
+ $blacklist_folder = Ingo::createFolder(Horde_Util::getFormData('new_folder_name'));
break;
case 'rule_update':
- switch (Util::getFormData('action')) {
+ switch (Horde_Util::getFormData('action')) {
case 'delete':
$folder = '';
break;
break;
case 'folder':
- $folder = Util::getFormData('actionvalue');
+ $folder = Horde_Util::getFormData('actionvalue');
break;
}
if (($folder == Ingo::BLACKLIST_MARKER) && !$have_mark) {
$notification->push("Not supported by this script generator.", 'horde.error');
} else {
- $ret = $blacklist->setBlacklist(Util::getFormData('blacklist'));
+ $ret = $blacklist->setBlacklist(Horde_Util::getFormData('blacklist'));
if (is_a($ret, 'PEAR_Error')) {
$notification->push($ret, $ret->getCode());
} else {
$on_demand = $ingo_script->performAvailable();
/* Get web parameter data. */
-$actionID = Util::getFormData('actionID');
-$id = Util::getFormData('rulenumber');
+$actionID = Horde_Util::getFormData('actionID');
+$id = Horde_Util::getFormData('rulenumber');
/* Get permissions. */
$edit_allowed = Ingo::hasPermission('shares', PERMS_EDIT);
break;
case 'rule_up':
- $steps = Util::getFormData('steps', 1);
+ $steps = Horde_Util::getFormData('steps', 1);
$filters->ruleUp($id, $steps);
break;
case 'rule_down':
- $steps = Util::getFormData('steps', 1);
+ $steps = Horde_Util::getFormData('steps', 1);
$filters->ruleDown($id, $steps);
break;
header('Location: ' . Horde::applicationUrl('filters.php', true));
exit;
}
- $prefs->setValue('show_filter_msg', Util::getFormData('show_filter_msg'));
- $prefs->setValue('filter_seen', Util::getFormData('filter_seen'));
+ $prefs->setValue('show_filter_msg', Horde_Util::getFormData('show_filter_msg'));
+ $prefs->setValue('filter_seen', Horde_Util::getFormData('filter_seen'));
$notification->push(_("Settings successfully updated."), 'horde.success');
break;
$entry = array();
$entry['number'] = ++$i;
- $url = Util::addParameter($filters_url, 'rulenumber', $rule_number);
+ $url = Horde_Util::addParameter($filters_url, 'rulenumber', $rule_number);
$copyurl = $delurl = $editurl = $name = null;
switch ($filter['action']) {
break;
default:
- $editurl = Util::addParameter($rule_url, array('edit' => $rule_number, 'actionID' => 'rule_edit'));
- $delurl = Util::addParameter($url, 'actionID', 'rule_delete');
- $copyurl = Util::addParameter($url, 'actionID', 'rule_copy');
+ $editurl = Horde_Util::addParameter($rule_url, array('edit' => $rule_number, 'actionID' => 'rule_edit'));
+ $delurl = Horde_Util::addParameter($url, 'actionID', 'rule_delete');
+ $copyurl = Horde_Util::addParameter($url, 'actionID', 'rule_copy');
$entry['filterimg'] = false;
$name = $filter['name'];
break;
}
/* Create up/down arrow links. */
- $entry['upurl'] = Util::addParameter($url, 'actionID', 'rule_up');
- $entry['downurl'] = Util::addParameter($url, 'actionID', 'rule_down');
+ $entry['upurl'] = Horde_Util::addParameter($url, 'actionID', 'rule_up');
+ $entry['downurl'] = Horde_Util::addParameter($url, 'actionID', 'rule_down');
$entry['uplink'] = ($i > 1) ? Horde::link($entry['upurl'], _("Move Rule Up")) : false;
$entry['downlink'] = ($i < $rule_count) ? Horde::link($entry['downurl'], _("Move Rule Down")) : false;
if (empty($filter['disable'])) {
if ($edit_allowed) {
- $entry['disablelink'] = Horde::link(Util::addParameter($url, 'actionID', 'rule_disable'), sprintf(_("Disable %s"), $name));
+ $entry['disablelink'] = Horde::link(Horde_Util::addParameter($url, 'actionID', 'rule_disable'), sprintf(_("Disable %s"), $name));
$entry['disableimg'] = Horde::img('enable.png', sprintf(_("Disable %s"), $name));
} else {
$entry['disableimg'] = Horde::img('enable.png');
$entry['enableimg'] = false;
} else {
if ($edit_allowed) {
- $entry['enablelink'] = Horde::link(Util::addParameter($url, 'actionID', 'rule_enable'), sprintf(_("Enable %s"), $name));
+ $entry['enablelink'] = Horde::link(Horde_Util::addParameter($url, 'actionID', 'rule_enable'), sprintf(_("Enable %s"), $name));
$entry['enableimg'] = Horde::img('disable.png', sprintf(_("Enable %s"), $name));
} else {
$entry['enableimg'] = Horde::img('disable.png');
require_once dirname(__FILE__) . '/lib/base.php';
require_once 'Horde/Help.php';
-require_once 'Horde/Variables.php';
/* Redirect if forward is not available. */
if (!in_array(Ingo_Storage::ACTION_FORWARD, $_SESSION['ingo']['script_categories'])) {
$fwd_rule = $filters->getRule($fwd_id);
/* Load libraries. */
-$vars = &Variables::getDefaultVariables();
+$vars = &Horde_Variables::getDefaultVariables();
if ($vars->get('submitbutton') == _("Return to Rules List")) {
header('Location: ' . Horde::applicationUrl('filters.php', true));
exit;
*/
public function __construct($params = array())
{
- if (!Util::extensionExists('ldap')) {
+ if (!Horde_Util::extensionExists('ldap')) {
Horde::fatal(PEAR::raiseError(_("LDAP support is required but the LDAP module is not available or not loaded.")), __FILE__, __LINE__);
}
$values[] = $script;
}
- $replace = array(String::lower($this->_params['script_attribute']) => $values);
+ $replace = array(Horde_String::lower($this->_params['script_attribute']) => $values);
if (empty($values)) {
$r = @ldap_mod_del($ldapcn, $userDN, $replace);
} else {
static public function createFolder($folder)
{
return $GLOBALS['registry']->hasMethod('mail/createFolder')
- ? $GLOBALS['registry']->call('mail/createFolder', array('folder' => String::convertCharset($folder, NLS::getCharset(), 'UTF7-IMAP')))
+ ? $GLOBALS['registry']->call('mail/createFolder', array('folder' => Horde_String::convertCharset($folder, NLS::getCharset(), 'UTF7-IMAP')))
: false;
}
$menu->add(Horde::applicationUrl('script.php'), _("_Script"), 'script.png');
}
if (!empty($GLOBALS['ingo_shares']) && empty($GLOBALS['conf']['share']['no_sharing'])) {
- $menu->add('#', _("_Permissions"), 'perms.png', $GLOBALS['registry']->getImageDir('horde'), '', 'popup(\'' . Util::addParameter(Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/shares/edit.php', true), array('app' => 'ingo', 'share' => htmlspecialchars($_SESSION['ingo']['backend']['id'] . ':' . Auth::getAuth())), null, false) . '\');return false;');
+ $menu->add('#', _("_Permissions"), 'perms.png', $GLOBALS['registry']->getImageDir('horde'), '', 'popup(\'' . Horde_Util::addParameter(Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/shares/edit.php', true), array('app' => 'ingo', 'share' => htmlspecialchars($_SESSION['ingo']['backend']['id'] . ':' . Auth::getAuth())), null, false) . '\');return false;');
}
if ($returnType == 'object') {
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]"),
- String::convertCharset($rule['action-value'], 'UTF7-IMAP', NLS::getCharset())),
+ Horde_String::convertCharset($rule['action-value'], 'UTF7-IMAP', NLS::getCharset())),
'horde.message');
}
} else {
$GLOBALS['notification']->push(sprintf(_("Filter activity: %s message(s) have been moved to the folder \"%s\"."),
count($indices),
- String::convertCharset($rule['action-value'], 'UTF7-IMAP', NLS::getCharset())), 'horde.message');
+ Horde_String::convertCharset($rule['action-value'], 'UTF7-IMAP', NLS::getCharset())), 'horde.message');
}
} elseif ($rule['action'] == Ingo_Storage::ACTION_DISCARD) {
/* We need to grab the overview first. */
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]"),
- String::convertCharset($rule['action-value'], 'UTF7-IMAP', NLS::getCharset())),
+ Horde_String::convertCharset($rule['action-value'], 'UTF7-IMAP', NLS::getCharset())),
'horde.message');
}
} else {
- $GLOBALS['notification']->push(sprintf(_("Filter activity: %s message(s) have been copied to the folder \"%s\"."), count($indices), 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', NLS::getCharset())), 'horde.message');
}
}
}
. _("Generated by Ingo (http://www.horde.org/ingo/)") . ' ('
. trim(strftime($date_format . ', ' . $time_format))
. ")\n\n";
- $code = String::convertCharset($code, NLS::getCharset(), 'UTF-8');
+ $code = Horde_String::convertCharset($code, NLS::getCharset(), 'UTF-8');
$requires = $this->requires();
if (count($requires) > 1) {
}
$vals = array(
- 'subject' => String::convertCharset($vacation->getVacationSubject(), NLS::getCharset(), 'UTF-8'),
+ 'subject' => Horde_String::convertCharset($vacation->getVacationSubject(), 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' => String::convertCharset($vacation->getVacationReason(), NLS::getCharset(), 'UTF-8'),
+ 'reason' => Horde_String::convertCharset($vacation->getVacationReason(), NLS::getCharset(), 'UTF-8'),
);
$action = $tests = array();
$code .= (empty($code) ? '' : "\n") . '# ' . $line;
}
}
- return String::convertCharset($code, NLS::getCharset(), 'UTF-8');
+ return Horde_String::convertCharset($code, NLS::getCharset(), 'UTF-8');
}
/**
/* Convert rules from the old format. */
$data = @unserialize($prefs->getValue('rules'));
} else {
- $data = String::convertCharset($data, $prefs->getCharset(), NLS::getCharset());
+ $data = Horde_String::convertCharset($data, $prefs->getCharset(), NLS::getCharset());
}
if ($data) {
$ob->setFilterlist($data);
return $prefs->setValue('blacklist', serialize($data));
case self::ACTION_FILTERS:
- return $prefs->setValue('rules', serialize(String::convertCharset($ob->getFilterList(), NLS::getCharset(), $prefs->getCharset())), false);
+ return $prefs->setValue('rules', serialize(Horde_String::convertCharset($ob->getFilterList(), NLS::getCharset(), $prefs->getCharset())), false);
case self::ACTION_FORWARD:
$data = array(
$ob->setVacationEnd((int)$data['vacation_end']);
$ob->setVacationExcludes(explode("\n", $data['vacation_excludes']), false);
$ob->setVacationIgnorelist((bool)$data['vacation_ignorelists']);
- $ob->setVacationReason(String::convertCharset($data['vacation_reason'], $this->_params['charset']));
- $ob->setVacationSubject(String::convertCharset($data['vacation_subject'], $this->_params['charset']));
+ $ob->setVacationReason(Horde_String::convertCharset($data['vacation_reason'], $this->_params['charset']));
+ $ob->setVacationSubject(Horde_String::convertCharset($data['vacation_subject'], $this->_params['charset']));
$ob->setSaved(true);
} elseif ($data = @unserialize($GLOBALS['prefs']->getDefault('vacation'))) {
$ob->setVacationAddresses($data['addresses'], false);
$query = sprintf($query, $this->_params['table_vacations']);
$values = array(
implode("\n", $ob->getVacationAddresses()),
- String::convertCharset($ob->getVacationSubject(),
+ Horde_String::convertCharset($ob->getVacationSubject(),
NLS::getCharset(),
$this->_params['charset']),
- String::convertCharset($ob->getVacationReason(),
+ Horde_String::convertCharset($ob->getVacationReason(),
NLS::getCharset(),
$this->_params['charset']),
(int)$ob->getVacationDays(),
while ($row = $result->fetchRow(DB_FETCHMODE_ASSOC)) {
$data[$row['rule_order']] = array(
'id' => (int)$row['rule_id'],
- 'name' => String::convertCharset($row['rule_name'], $this->_params['charset']),
+ 'name' => Horde_String::convertCharset($row['rule_name'], $this->_params['charset']),
'action' => (int)$row['rule_action'],
- 'action-value' => String::convertCharset($row['rule_value'], $this->_params['charset']),
+ 'action-value' => Horde_String::convertCharset($row['rule_value'], $this->_params['charset']),
'flags' => (int)$row['rule_flags'],
- 'conditions' => empty($row['rule_conditions']) ? null : String::convertCharset(unserialize($row['rule_conditions']), $this->_params['charset']),
+ 'conditions' => empty($row['rule_conditions']) ? null : Horde_String::convertCharset(unserialize($row['rule_conditions']), $this->_params['charset']),
'combine' => (int)$row['rule_combine'],
'stop' => (bool)$row['rule_stop'],
'disable' => !(bool)$row['rule_active']);
*/
protected function _ruleToBackend($rule)
{
- return array(String::convertCharset($rule['name'], NLS::getCharset(), $this->_params['charset']),
+ return array(Horde_String::convertCharset($rule['name'], NLS::getCharset(), $this->_params['charset']),
(int)$rule['action'],
- isset($rule['action-value']) ? String::convertCharset($rule['action-value'], NLS::getCharset(), $this->_params['charset']) : null,
+ isset($rule['action-value']) ? Horde_String::convertCharset($rule['action-value'], NLS::getCharset(), $this->_params['charset']) : null,
isset($rule['flags']) ? (int)$rule['flags'] : null,
- isset($rule['conditions']) ? serialize(String::convertCharset($rule['conditions'], NLS::getCharset(), $this->_params['charset'])) : null,
+ isset($rule['conditions']) ? serialize(Horde_String::convertCharset($rule['conditions'], 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);
}
/* Select current share. */
- $_SESSION['ingo']['current_share'] = Util::getFormData('ruleset', @$_SESSION['ingo']['current_share']);
+ $_SESSION['ingo']['current_share'] = Horde_Util::getFormData('ruleset', @$_SESSION['ingo']['current_share']);
if (empty($_SESSION['ingo']['current_share']) ||
empty($GLOBALS['all_rulesets'][$_SESSION['ingo']['current_share']]) ||
!$GLOBALS['all_rulesets'][$_SESSION['ingo']['current_share']]->hasPermission(Auth::getAuth(), PERMS_READ)) {
$filters = &$ingo_storage->retrieve(Ingo_Storage::ACTION_FILTERS);
/* Run through action handlers. */
-$actionID = Util::getFormData('actionID');
-$edit_number = Util::getFormData('edit');
+$actionID = Horde_Util::getFormData('actionID');
+$edit_number = Horde_Util::getFormData('edit');
switch ($actionID) {
case 'create_folder':
case 'rule_save':
}
$rule = array(
- 'id' => Util::getFormData('id'),
- 'name' => Util::getFormData('name'),
- 'combine' => Util::getFormData('combine'),
+ 'id' => Horde_Util::getFormData('id'),
+ 'name' => Horde_Util::getFormData('name'),
+ 'combine' => Horde_Util::getFormData('combine'),
'conditions' => array()
);
- $field = Util::getFormData('field');
- $match = Util::getFormData('match');
- $userheader = Util::getFormData('userheader');
- $value = Util::getFormData('value');
+ $field = Horde_Util::getFormData('field');
+ $match = Horde_Util::getFormData('match');
+ $userheader = Horde_Util::getFormData('userheader');
+ $value = Horde_Util::getFormData('value');
if ($ingo_script->caseSensitive()) {
- $casesensitive = Util::getFormData('case');
+ $casesensitive = Horde_Util::getFormData('case');
}
$valid = true;
}
if ($actionID == 'create_folder') {
- $rule['action-value'] = Ingo::createFolder(Util::getFormData('new_folder_name'));
+ $rule['action-value'] = Ingo::createFolder(Horde_Util::getFormData('new_folder_name'));
} else {
- $rule['action-value'] = Util::getFormData('actionvalue');
+ $rule['action-value'] = Horde_Util::getFormData('actionvalue');
}
- $rule['action'] = Util::getFormData('action');
- $rule['stop'] = Util::getFormData('stop');
+ $rule['action'] = Horde_Util::getFormData('action');
+ $rule['stop'] = Horde_Util::getFormData('stop');
$rule['flags'] = 0;
- $flags = Util::getFormData('flags', array());
+ $flags = Horde_Util::getFormData('flags', array());
if (!empty($flags)) {
foreach ($flags as $val) {
$rule['flags'] |= $val;
header('Location: ' . Horde::applicationUrl('filters.php', true));
exit;
}
- $cond_num = Util::getFormData('conditionnumber');
+ $cond_num = Horde_Util::getFormData('conditionnumber');
if (!is_null($cond_num)) {
unset($rule['conditions'][$cond_num]);
$rule['conditions'] = array_values($rule['conditions']);
'<option value="' . Ingo::USER_HEADER . '"' . ((!$option_selected) ? ' selected="selected"' : '') . '>' . _("Self-Defined Header") . (($lastfield) ? '' : ':') . "</option>\n";
if (!$option_selected) {
$header_entry = true;
- $userheader = Util::getFormData('userheader');
+ $userheader = Horde_Util::getFormData('userheader');
if (empty($userheader)) {
$userheader = isset($condition['field']) ? $condition['field'] : '';
} else {
/* Activate/deactivate script if requested.
activateScript() does its own $notification->push() on error. */
-$actionID = Util::getFormData('actionID');
+$actionID = Horde_Util::getFormData('actionID');
switch ($actionID) {
case 'action_activate':
if (!empty($script)) {
exit;
}
-/* Load libraries. */
-require_once 'Horde/Variables.php';
-
/* Get the spam object and rule. */
$spam = &$ingo_storage->retrieve(Ingo_Storage::ACTION_SPAM);
$filters = &$ingo_storage->retrieve(Ingo_Storage::ACTION_FILTERS);
$spam_id = $filters->findRuleId(Ingo_Storage::ACTION_SPAM);
$spam_rule = $filters->getRule($spam_id);
-$vars = &Variables::getDefaultVariables();
+$vars = &Horde_Variables::getDefaultVariables();
if ($vars->get('submitbutton') == _("Return to Rules List")) {
header('Location: ' . Horde::applicationUrl('filters.php', true));
exit;
<form method="post" name="filters" action="<?php echo Horde::applicationUrl('blacklist.php') ?>">
-<?php Util::pformInput() ?>
+<?php Horde_Util::pformInput() ?>
<input type="hidden" name="actionID" value="rule_update" />
<input type="hidden" name="new_folder_name" value="" />
<?php echo Horde::stylesheetLink('ingo') ?>
</head>
-<body<?php if ($bc = Util::nonInputVar('bodyClass')) echo ' class="' . $bc . '"' ?><?php if ($bi = Util::nonInputVar('bodyId')) echo ' id="' . $bi . '"'; ?>>
+<body<?php if ($bc = Horde_Util::nonInputVar('bodyClass')) echo ' class="' . $bc . '"' ?><?php if ($bi = Horde_Util::nonInputVar('bodyId')) echo ' id="' . $bi . '"'; ?>>
}
</script>
<form method="post" name="filters" action="<?php echo Horde::applicationUrl('filters.php') ?>">
-<?php Util::pformInput() ?>
+<?php Horde_Util::pformInput() ?>
<input type="hidden" name="actionID" value="" />
<div class="header">
<?php echo _("Existing Rules") . ' ' . Help::link('ingo', 'filters_rules') ?>
<?php $flags_val = $prefs->getValue('filter_seen') ?>
<form method="post" name="filtersettings" action="filters.php">
-<?php Util::pformInput() ?>
+<?php Horde_Util::pformInput() ?>
<input type="hidden" name="actionID" value="settings_save" />
<h1 class="header">
<?php echo _("Additional Settings") ?>
<form action="filters.php" method="post" name="rulesetsmenu">
-<?php echo Util::formInput() ?>
+<?php echo Horde_Util::formInput() ?>
<div id="menu">
<?php if (!empty($ingo_shares) && count($all_rulesets) > 1): ?>
<div style="float:right">
</script>
<form method="post" name="rule" action="<?php echo Horde::applicationUrl('rule.php') ?>">
-<?php Util::pformInput() ?>
+<?php Horde_Util::pformInput() ?>
<input type="hidden" name="actionID" value="rule_update" />
<input type="hidden" name="conditionnumber" value="-1" />
<input type="hidden" name="new_folder_name" value="" />
<?php if ($actionID != 'show_active'): ?>
<td>
<form method="post" name="activate_script" action="<?php echo Horde::applicationUrl('script.php') ?>">
- <?php Util::pformInput() ?>
+ <?php Horde_Util::pformInput() ?>
<input type="hidden" name="actionID" value="action_activate" />
<input class="button" type="submit" name="submit" value="<?php echo _("Activate Script") ?>" />
</form>
</td>
<td>
<form method="post" name="deactivate_script" action="<?php echo Horde::applicationUrl('script.php') ?>">
- <?php Util::pformInput() ?>
+ <?php Horde_Util::pformInput() ?>
<input type="hidden" name="actionID" value="action_deactivate" />
<input class="button" type="submit" name="submit" value="<?php echo _("Deactivate Script") ?>" />
</form>
</td>
<td>
<form method="post" name="show_active_script" action="<?php echo Horde::applicationUrl('script.php') ?>">
- <?php Util::pformInput() ?>
+ <?php Horde_Util::pformInput() ?>
<input type="hidden" name="actionID" value="show_active" />
<input class="button" type="submit" name="submit" value="<?php echo _("Show Active Script") ?>" />
</form>
<?php else: ?>
<td>
<form method="post" name="show_current_script" action="<?php echo Horde::applicationUrl('script.php') ?>">
- <?php Util::pformInput() ?>
+ <?php Horde_Util::pformInput() ?>
<input class="button" type="submit" name="submit" value="<?php echo _("Show Current Script") ?>" />
</form>
</td>
<form method="post" name="filters" action="<?php echo Horde::applicationUrl('whitelist.php') ?>">
-<?php Util::pformInput() ?>
+<?php Horde_Util::pformInput() ?>
<input type="hidden" name="actionID" value="rule_update" />
<h1 class="header">
<?php echo _("Whitelist") ?>
require_once dirname(__FILE__) . '/lib/base.load.php';
include_once HORDE_BASE . '/lib/core.php';
-/* We should have loaded the String class, from the Horde_Util
- * package, in core.php. If String:: isn't defined, then we're not
+/* We should have loaded the Horde_String class, from the Horde_Util
+ * package, in core.php. If Horde_String:: isn't defined, then we're not
* finding some critical libraries. */
-if (!class_exists('String')) {
+if (!class_exists('Horde_String')) {
echo '<br /><h2 style="color:red">The Horde_Util package was not found. If PHP\'s error_reporting setting is high enough and display_errors is on, there should be error messages printed above that may help you in debugging the problem. If you are simply missing these files, then you need to get the <a href="http://cvs.horde.org/cvs.php/framework">framework</a> module from <a href="http://www.horde.org/source/">Horde CVS</a>, and install the packages in it with the install-packages.php script.</h2>';
exit;
}
require_once dirname(__FILE__) . '/lib/base.php';
require_once 'Horde/Help.php';
-require_once 'Horde/Variables.php';
/* Redirect if vacation is not available. */
if (!in_array(Ingo_Storage::ACTION_VACATION, $_SESSION['ingo']['script_categories'])) {
$vac_rule = $filters->getRule($vac_id);
/* Load libraries. */
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
if ($vars->get('submitbutton') == _("Return to Rules List")) {
header('Location: ' . Horde::applicationUrl('filters.php', true));
exit;
$whitelist = &$ingo_storage->retrieve(Ingo_Storage::ACTION_WHITELIST);
/* Perform requested actions. */
-$actionID = Util::getFormData('actionID');
+$actionID = Horde_Util::getFormData('actionID');
switch ($actionID) {
case 'rule_update':
- $ret = $whitelist->setWhitelist(Util::getFormData('whitelist'));
+ $ret = $whitelist->setWhitelist(Horde_Util::getFormData('whitelist'));
if (is_a($ret, 'PEAR_Error')) {
$notification->push($ret, $ret->getCode());
} else {
/* Include Horde's core.php file. */
include_once '../lib/core.php';
-/* We should have loaded the String class, from the Horde_Util
- package, in core.php. If String:: isn't defined, then we're not
+/* We should have loaded the Horde_String class, from the Horde_Util
+ package, in core.php. If Horde_String:: isn't defined, then we're not
finding some critical libraries. */
-if (!class_exists('String')) {
+if (!class_exists('Horde_String')) {
echo '<br /><h2 style="color:red">The Horde_Util package was not found. If PHP\'s error_reporting setting is high enough and display_errors is on, there should be error messages printed above that may help you in debugging the problem. If you are simply missing these files, then you need to get the <a href="http://cvs.horde.org/cvs.php/framework">framework</a> module from <a href="http://www.horde.org/source/">Horde CVS</a>, and install the packages in it with the install-packages.php script.</h2>';
exit;
}
global $registry, $notification, $browser;
/* Horde core classes that aren't autoloaded. */
- include_once 'Horde/Util.php';
- include_once 'Horde/String.php';
include_once 'Horde/NLS.php';
include_once 'Horde/Auth.php';
include_once 'Horde/Perms.php';
return self::$instance;
}
-}
\ No newline at end of file
+}
/**
* FIXME: Allow retrieving the form fields without specifying $vars.
*/
- require_once 'Horde/Variables.php';
$object = null;
- $form = new Koward_Form_Object(Variables::getDefaultVariables(), $object);
+ $form = new Koward_Form_Object(Horde_Variables::getDefaultVariables(), $object);
$fields = array_keys($form->getTypeFields($type));
return $allParams;
}
-}
\ No newline at end of file
+}
/* Destroy any existing session on login and make sure to use a
* new session ID, to avoid session fixation issues. */
Horde::getCleanSession();
- if ($this->koward->auth->authenticate(Util::getPost('horde_user'),
- array('password' => Util::getPost('horde_pass')))) {
+ if ($this->koward->auth->authenticate(Horde_Util::getPost('horde_user'),
+ array('password' => Horde_Util::getPost('horde_pass')))) {
$entry = sprintf('Login success for %s [%s] to Horde',
Auth::getAuth(), $_SERVER['REMOTE_ADDR']);
Horde::logMessage($entry, __FILE__, __LINE__, PEAR_LOG_NOTICE);
exit;
} else {
$entry = sprintf('FAILED LOGIN for %s [%s] to Horde',
- Util::getFormData('horde_user'), $_SERVER['REMOTE_ADDR']);
+ Horde_Util::getFormData('horde_user'), $_SERVER['REMOTE_ADDR']);
Horde::logMessage($entry, __FILE__, __LINE__, PEAR_LOG_ERR);
}
}
header('Location: ' . $this->urlFor(array('controller' => 'index', 'action' => 'login')));
exit;
}
-}
\ No newline at end of file
+}
public function listall()
{
require_once 'Horde/UI/Tabs.php';
- require_once 'Horde/Variables.php';
$this->object_type = $this->params->get('id', $this->types[0]);
}
}
- $this->tabs = new Horde_UI_Tabs(null, Variables::getDefaultVariables());
+ $this->tabs = new Horde_UI_Tabs(null, Horde_Variables::getDefaultVariables());
foreach ($this->koward->objects as $key => $configuration) {
if (!$this->koward->hasAccess($this->getPermissionId() . '/' . $key)) {
continue;
$this->koward->notification->push(_("The object that should be viewed has not been specified."),
'horde.error');
} else {
- require_once 'Horde/Variables.php';
-
$this->object = $this->koward->getObject($this->params->id);
$this->object_type = $this->koward->getType($this->object);
}
}
- $this->vars = Variables::getDefaultVariables();
+ $this->vars = Horde_Variables::getDefaultVariables();
$this->form = new Koward_Form_Object($this->vars, $this->object,
array('title' => _("View object")));
$this->edit = Horde::link(
{
$this->object = null;
- require_once 'Horde/Util.php';
- $type = Util::getFormData('type');
+ $type = Horde_Util::getFormData('type');
if (!empty($type)) {
$this->checkAccess($this->getPermissionId() . '/' . $type,
private function _edit()
{
try {
- require_once 'Horde/Variables.php';
- $this->vars = Variables::getDefaultVariables();
+ $this->vars = Horde_Variables::getDefaultVariables();
foreach ($this->params as $key => $value) {
if (!$this->vars->exists($key)) {
if (is_array($value) && count($value) == 1) {
public function search()
{
try {
- require_once 'Horde/Variables.php';
- $this->vars = Variables::getDefaultVariables();
+ $this->vars = Horde_Variables::getDefaultVariables();
$this->form = new Koward_Form_Search($this->vars, $this->object);
$this->allowEdit = $this->koward->hasAccess('object/edit',
$this->render();
}
-}
\ No newline at end of file
+}
{
$this->koward = &Koward::singleton();
- parent::Horde_Form(Variables::getDefaultVariables());
+ parent::Horde_Form(Horde_Variables::getDefaultVariables());
$this->setTitle(_("Object actions"));
function &execute()
{
- require_once 'Horde/Util.php';
-
- $submit = Util::getFormData('submitbutton');
+ $submit = Horde_Util::getFormData('submitbutton');
if (!empty($submit)) {
$type = $this->koward->getType($this->object);
foreach ($this->koward->objects[$type]['actions'] as $action => $label) {
<tr>
<td class="light rightAlign"><strong><?php echo Horde::label('horde_user', _("Username")) ?></strong> </td>
- <td class="leftAlign"><input type="text" id="horde_user" name="horde_user" value="<?php echo htmlspecialchars(Util::getFormData('horde_user')) ?>" style="direction:ltr" /></td>
+ <td class="leftAlign"><input type="text" id="horde_user" name="horde_user" value="<?php echo htmlspecialchars(Horde_Util::getFormData('horde_user')) ?>" style="direction:ltr" /></td>
</tr>
<tr>
<?= $this->renderPartial('menu'); ?>
<form action="<?= $this->submit_url ?>" method="post" name="delete">
-<?php echo Util::formInput() ?>
+<?php echo Horde_Util::formInput() ?>
<div class="headerbox">
'type' => 'link',
'xurl' => sprintf('javascript:if (window.sidebar && window.sidebar.addPanel) window.sidebar.addPanel(\'%s\', \'%s\', \'%s\'); else alert(\'%s\');',
$GLOBALS['registry']->get('name', 'horde'),
- Util::addParameter(Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/portal/sidebar.php', true, -1), 'mozbar', '1'),
+ Horde_Util::addParameter(Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/portal/sidebar.php', true, -1), 'mozbar', '1'),
Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/prefs.php', true, -1),
addslashes(_("Couldn't find the Mozilla Sidebar. Make sure the sidebar is open."))),
'desc' => sprintf(_("Add the %s Menu as a Mozilla Sidebar"), $GLOBALS['registry']->get('name', 'horde'))
require_once dirname(__FILE__) . '/lib/base.php';
-if (!Util::getFormData('cancel')) {
- $targetcalendar = Util::getFormData('targetcalendar');
+if (!Horde_Util::getFormData('cancel')) {
+ $targetcalendar = Horde_Util::getFormData('targetcalendar');
if (strpos($targetcalendar, ':')) {
list($calendar_id, $user) = explode(':', $targetcalendar, 2);
} else {
$notification->push(sprintf(_("There was an error adding the event: %s"), $message), 'horde.error');
} else {
- if (Util::getFormData('sendupdates', false)) {
+ if (Horde_Util::getFormData('sendupdates', false)) {
$event = Kronolith::getDriver()->getEvent($result);
if (is_a($event, 'PEAR_Error')) {
$notification->push($event, 'horde.error');
}
}
-if ($url = Util::getFormData('url')) {
+if ($url = Horde_Util::getFormData('url')) {
header('Location: ' . $url);
} else {
- $url = Util::addParameter($prefs->getValue('defaultview') . '.php',
- array('month' => Util::getFormData('month'),
- 'year' => Util::getFormData('year')));
+ $url = Horde_Util::addParameter($prefs->getValue('defaultview') . '.php',
+ array('month' => Horde_Util::getFormData('month'),
+ 'year' => Horde_Util::getFormData('year')));
header('Location: ' . Horde::applicationUrl($url, true));
}
$GLOBALS['notification']->push($result, 'horde.error');
return true;
}
- $start = new Horde_Date(Util::getFormData('view_start'));
- $end = new Horde_Date(Util::getFormData('view_end'));
+ $start = new Horde_Date(Horde_Util::getFormData('view_start'));
+ $end = new Horde_Date(Horde_Util::getFormData('view_end'));
$end->hour = 23;
$end->min = $end->sec = 59;
Kronolith::addEvents($events, $event, $start, $end, true, true);
$result = new stdClass;
- $result->cal = Util::getFormData('cal');
- $result->view = Util::getFormData('view');
+ $result->cal = Horde_Util::getFormData('cal');
+ $result->view = Horde_Util::getFormData('view');
$result->sig = $start->dateString() . $end->dateString();
if (count($events)) {
$result->events = $events;
return $result;
}
-// Need to load Util:: to give us access to Util::getPathInfo().
+// Need to load Horde_Util:: to give us access to Horde_Util::getPathInfo().
require_once dirname(__FILE__) . '/base.load.php';
require_once HORDE_BASE . '/lib/core.php';
-$action = basename(Util::getPathInfo());
+$action = basename(Horde_Util::getPathInfo());
if (empty($action)) {
// This is the only case where we really don't return anything, since
// the frontend can be presumed not to make this request on purpose.
require_once KRONOLITH_BASE . '/lib/base.php';
// Process common request variables.
-$cacheid = Util::getPost('cacheid');
+$cacheid = Horde_Util::getPost('cacheid');
// Open an output buffer to ensure that we catch errors that might break JSON
// encoding.
switch ($action) {
case 'ListEvents':
- $start = new Horde_Date(Util::getFormData('start'));
- $end = new Horde_Date(Util::getFormData('end'));
- $cal = Util::getFormData('cal');
+ $start = new Horde_Date(Horde_Util::getFormData('start'));
+ $end = new Horde_Date(Horde_Util::getFormData('end'));
+ $cal = Horde_Util::getFormData('cal');
$result = new stdClass;
$result->cal = $cal;
- $result->view = Util::getFormData('view');
+ $result->view = Horde_Util::getFormData('view');
$result->sig = $start->dateString() . $end->dateString();
if (!($kronolith_driver = getDriver($cal))) {
break;
break;
case 'GetEvent':
- if (!($kronolith_driver = getDriver(Util::getFormData('cal')))) {
+ if (!($kronolith_driver = getDriver(Horde_Util::getFormData('cal')))) {
$result = true;
break;
}
- if (is_null($id = Util::getFormData('id'))) {
+ if (is_null($id = Horde_Util::getFormData('id'))) {
$result = true;
break;
}
break;
case 'SaveEvent':
- if (!($kronolith_driver = getDriver(Util::getFormData('cal')))) {
+ if (!($kronolith_driver = getDriver(Horde_Util::getFormData('cal')))) {
$result = true;
break;
}
- $event = $kronolith_driver->getEvent(Util::getFormData('id'));
+ $event = $kronolith_driver->getEvent(Horde_Util::getFormData('id'));
if (is_a($event, 'PEAR_Error')) {
$notification->push($event, 'horde.error');
$result = true;
break;
case 'UpdateEvent':
- if (!($kronolith_driver = getDriver(Util::getFormData('cal')))) {
+ if (!($kronolith_driver = getDriver(Horde_Util::getFormData('cal')))) {
break;
}
- if (is_null($id = Util::getFormData('id'))) {
+ if (is_null($id = Horde_Util::getFormData('id'))) {
$result = true;
break;
}
$result = true;
break;
}
- $attributes = Horde_Serialize::unserialize(Util::getFormData('att'), Horde_Serialize::JSON);
+ $attributes = Horde_Serialize::unserialize(Horde_Util::getFormData('att'), Horde_Serialize::JSON);
foreach ($attributes as $attribute => $value) {
switch ($attribute) {
case 'start_date':
break;
case 'DeleteEvent':
- if (!($kronolith_driver = getDriver(Util::getFormData('cal')))) {
+ if (!($kronolith_driver = getDriver(Horde_Util::getFormData('cal')))) {
$result = true;
break;
}
- if (is_null($id = Util::getFormData('id'))) {
+ if (is_null($id = Horde_Util::getFormData('id'))) {
$result = true;
break;
}
break;
case 'SearchEvents':
- $query = Horde_Serialize::unserialize(Util::getFormData('query'), Horde_Serialize::JSON);
+ $query = Horde_Serialize::unserialize(Horde_Util::getFormData('query'), Horde_Serialize::JSON);
if (!isset($query->start)) {
$query->start = new Horde_Date($_SERVER['REQUEST_TIME']);
}
if (!isset($query->end)) {
$query->end = null;
}
- $cals = Horde_Serialize::unserialize(Util::getFormData('cals'), Horde_Serialize::JSON);
+ $cals = Horde_Serialize::unserialize(Horde_Util::getFormData('cals'), Horde_Serialize::JSON);
$events = array();
foreach ($cals as $cal) {
if (!($kronolith_driver = getDriver($cal))) {
}
$result = new stdClass;
$result->view = 'search';
- $result->query = Util::getFormData('query');
+ $result->query = Horde_Util::getFormData('query');
if ($events) {
$result->events = $events;
}
case 'SearchCalendars':
$result = new stdClass;
- $result->events = 'Searched for calendars: ' . Util::getFormData('title');
+ $result->events = 'Searched for calendars: ' . Horde_Util::getFormData('title');
break;
case 'SaveCalPref':
break;
case 'ChunkContent':
- $chunk = basename(Util::getPost('chunk'));
+ $chunk = basename(Horde_Util::getPost('chunk'));
if (!empty($chunk)) {
$result = new stdClass;
- $result->chunk = Util::bufferOutput('include', KRONOLITH_TEMPLATES . '/chunks/' . $chunk . '.php');
+ $result->chunk = Horde_Util::bufferOutput('include', KRONOLITH_TEMPLATES . '/chunks/' . $chunk . '.php');
}
break;
@define('AUTH_HANDLER', true);
require_once dirname(__FILE__) . '/lib/base.php';
-$cal = Util::getFormData('c');
-$id = Util::getFormData('e');
-$uid = Util::getFormData('i');
-$user = Util::getFormData('u');
+$cal = Horde_Util::getFormData('c');
+$id = Horde_Util::getFormData('e');
+$uid = Horde_Util::getFormData('i');
+$user = Horde_Util::getFormData('u');
-switch (Util::getFormData('a')) {
+switch (Horde_Util::getFormData('a')) {
case 'accept':
$action = Kronolith::RESPONSE_ACCEPTED;
$msg = _("You have successfully accepted attendence to this event.");
require_once dirname(__FILE__) . '/lib/base.php';
require_once 'Horde/Identity.php';
-require_once 'Horde/Variables.php';
// Get the current attendees array from the session cache.
$attendees = (isset($_SESSION['kronolith']['attendees']) &&
$editAttendee = null;
// Get the action ID and value. This specifies what action the user initiated.
-$actionID = Util::getFormData('actionID');
-if (Util::getFormData('clearAll')) {
+$actionID = Horde_Util::getFormData('actionID');
+if (Horde_Util::getFormData('clearAll')) {
$actionID = 'clear';
}
-$actionValue = Util::getFormData('actionValue');
+$actionValue = Horde_Util::getFormData('actionValue');
// Perform the specified action, if there is one.
switch ($actionID) {
$parser = new Mail_RFC822;
// Add new attendees. Multiple attendees can be seperated on a single line
// by whitespace and/or commas.
- $newAttendees = trim(Util::getFormData('newAttendees'));
+ $newAttendees = trim(Horde_Util::getFormData('newAttendees'));
if (empty($newAttendees)) {
- if (Util::getFormData('addNewClose')) {
- Util::closeWindowJS();
+ if (Horde_Util::getFormData('addNewClose')) {
+ Horde_Util::closeWindowJS();
exit;
}
break;
$_SESSION['kronolith']['attendees'] = $attendees;
- if (Util::getFormData('addNewClose')) {
- Util::closeWindowJS();
+ if (Horde_Util::getFormData('addNewClose')) {
+ Horde_Util::closeWindowJS();
exit;
}
break;
case 'dismiss':
// Close the attendee window.
if ($browser->hasFeature('javascript')) {
- Util::closeWindowJS();
+ Horde_Util::closeWindowJS();
exit;
}
- $url = Util::getFormData('url');
+ $url = Horde_Util::getFormData('url');
if (!empty($url)) {
$location = Horde::applicationUrl($url, true);
} else {
- $url = Util::addParameter($prefs->getValue('defaultview') . '.php',
- 'month', Util::getFormData('month'));
- $url = Util::addParameter($url, 'year', Util::getFormData('year'));
+ $url = Horde_Util::addParameter($prefs->getValue('defaultview') . '.php',
+ 'month', Horde_Util::getFormData('month'));
+ $url = Horde_Util::addParameter($url, 'year', Horde_Util::getFormData('year'));
$location = Horde::applicationUrl($url, true);
}
// Make sure URL is unique.
- $location = Util::addParameter($location, 'unique', hash('md5', microtime()));
+ $location = Horde_Util::addParameter($location, 'unique', hash('md5', microtime()));
header('Location: ' . $location);
exit;
}
// Get the current Free/Busy view; default to the 'day' view if none specified.
-$view = Util::getFormData('view', 'Day');
+$view = Horde_Util::getFormData('view', 'Day');
// Pre-format our delete image/link.
$delimg = Horde::img('delete.png', _("Remove Attendee"), null,
$ident = &Identity::singleton();
$identities = $ident->getAll('id');
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$tabs = new Horde_UI_Tabs(null, $vars);
$tabs->addTab(_("Day"), 'javascript:switchView(\'Day\')', 'Day');
$tabs->addTab(_("Work Week"), 'javascript:switchView(\'Workweek\')', 'Workweek');
}
}
-$date = Util::getFormData('date', date('Ymd')) . '000000';
+$date = Horde_Util::getFormData('date', date('Ymd')) . '000000';
$date = new Horde_Date($date);
$vfb_html = $attendee_view->render($date);
exit;
}
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$form = new Kronolith_CreateCalendarForm($vars);
// Execute if the form is valid.
exit;
}
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$calendar_id = $vars->get('c');
if ($calendar_id == Auth::getAuth()) {
$notification->push(_("This calendar cannot be deleted."), 'horde.warning');
$form = new Kronolith_DeleteCalendarForm($vars, $calendar);
// Execute if the form is valid (must pass with POST variables only).
-if ($form->validate(new Variables($_POST))) {
+if ($form->validate(new Horde_Variables($_POST))) {
$result = $form->execute();
if (is_a($result, 'PEAR_Error')) {
$notification->push($result, 'horde.error');
exit;
}
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$calendar = $kronolith_shares->getShare($vars->get('c'));
if (is_a($calendar, 'PEAR_Error')) {
$notification->push($calendar, 'horde.error');
Horde::url($registry->get('webroot', 'horde')
. ($rewrite ? '/rpc/kronolith/' : '/rpc.php/kronolith/'),
true, -1) :
- Util::addParameter(Horde::applicationUrl('ics.php', true, -1), 'c', '');
+ Horde_Util::addParameter(Horde::applicationUrl('ics.php', true, -1), 'c', '');
$calendars = array();
$sorted_calendars = array();
}
$calendar = null;
-$calendarId = Util::getFormData('c');
+$calendarId = Horde_Util::getFormData('c');
if (strncmp($calendarId, 'remote_', 7) === 0) {
$calendarId = substr($calendarId, 7);
$remote_calendars = unserialize($prefs->getValue('remote_cals'));
. ($rewrite ? '/rpc/kronolith/' : '/rpc.php/kronolith/'),
true, -1)
. $calendar->get('owner') . '/' . $calendar->getName() . '.ics'
- : Util::addParameter(Horde::applicationUrl('ics.php', true, -1), 'c',
+ : Horde_Util::addParameter(Horde::applicationUrl('ics.php', true, -1), 'c',
$calendar->getName());
}
exit;
}
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$url = $vars->get('url');
$remote_calendar = null;
exit;
}
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$form = new Kronolith_SubscribeRemoteCalendarForm($vars);
// Execute if the form is valid.
exit;
}
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$url = $vars->get('url');
$remote_calendar = null;
$form = new Kronolith_UnsubscribeRemoteCalendarForm($vars, $remote_calendar);
// Execute if the form is valid (must pass with POST variables only).
-if ($form->validate(new Variables($_POST))) {
+if ($form->validate(new Horde_Variables($_POST))) {
$result = $form->execute();
if (is_a($result, 'PEAR_Error')) {
$notification->push($result, 'horde.error');
require_once dirname(__FILE__) . '/lib/base.php';
if (!Auth::getAuth()) {
- Util::closeWindowJS();
+ Horde_Util::closeWindowJS();
exit;
}
/* If we self-submitted, use that source. Otherwise, choose a good
* source. */
-$source = Util::getFormData('source');
+$source = Horde_Util::getFormData('source');
if (empty($source) || !isset($source_list[$source])) {
/* We don't just pass the second argument to getFormData() because
* we want to trap for invalid sources, not just no source. */
}
/* Get the search as submitted (defaults to '' which should list everyone). */
-$search = Util::getFormData('search');
+$search = Horde_Util::getFormData('search');
$apiargs = array();
$apiargs['addresses'] = array($search);
$apiargs['addressbooks'] = array($source);
/* If self-submitted, preserve the currently selected users encoded by
javascript to pass as value|text. */
$selected_addresses = array();
-$sa = explode('|', Util::getFormData('sa'));
+$sa = explode('|', Horde_Util::getFormData('sa'));
for ($i = 0; $i < count($sa) - 1; $i += 2) {
$selected_addresses[$sa[$i]] = $sa[$i + 1];
}
/* Set the default list display (name or email). */
-$display = Util::getFormData('display', 'name');
+$display = Horde_Util::getFormData('display', 'name');
/* Display the form. */
$title = _("Address Book");
}
/* Initial values. */
-$import_step = Util::getFormData('import_step', 0) + 1;
-$actionID = Util::getFormData('actionID');
+$import_step = Horde_Util::getFormData('import_step', 0) + 1;
+$actionID = Horde_Util::getFormData('actionID');
$next_step = Horde_Data::IMPORT_FILE;
$app_fields = array('title' => _("Title"),
'start_date' => _("Start Date"),
'recur_end_date' => 'date');
$param = array('time_fields' => $time_fields,
'file_types' => $file_types);
-$import_format = Util::getFormData('import_format', '');
+$import_format = Horde_Util::getFormData('import_format', '');
$error = false;
$kronolith_driver = Kronolith::getDriver();
/* Loop through the action handlers. */
switch ($actionID) {
case 'export':
- if (Util::getFormData('all_events')) {
+ if (Horde_Util::getFormData('all_events')) {
$start = null;
$end = null;
} else {
- $start->mday = Util::getFormData('start_day');
- $start->month = Util::getFormData('start_month');
- $start->year = Util::getFormData('start_year');
- $end->mday = Util::getFormData('end_day');
- $end->month = Util::getFormData('end_month');
- $end->year = Util::getFormData('end_year');
+ $start->mday = Horde_Util::getFormData('start_day');
+ $start->month = Horde_Util::getFormData('start_month');
+ $start->year = Horde_Util::getFormData('start_year');
+ $end->mday = Horde_Util::getFormData('end_day');
+ $end->month = Horde_Util::getFormData('end_month');
+ $end->year = Horde_Util::getFormData('end_year');
}
$events = array();
- $calendars = Util::getFormData('exportCal', $display_calendars);
+ $calendars = Horde_Util::getFormData('exportCal', $display_calendars);
if (!is_array($calendars)) {
$calendars = array($calendars);
}
break;
}
- $exportID = Util::getFormData('exportID');
+ $exportID = Horde_Util::getFormData('exportID');
switch ($exportID) {
case Horde_Data::EXPORT_CSV:
$data = array();
}
}
- $iCal->setAttribute('X-WR-CALNAME', String::convertCharset(implode(', ', $calNames), NLS::getCharset(), 'utf-8'));
+ $iCal->setAttribute('X-WR-CALNAME', Horde_String::convertCharset(implode(', ', $calNames), NLS::getCharset(), 'utf-8'));
$data = $iCal->exportvCalendar();
$browser->downloadHeaders(_("events.ics"), 'text/calendar', false, strlen($data));
echo $data;
break;
case Horde_Data::IMPORT_FILE:
- $_SESSION['import_data']['import_cal'] = Util::getFormData('importCal');
- $_SESSION['import_data']['purge'] = Util::getFormData('purge');
+ $_SESSION['import_data']['import_cal'] = Horde_Util::getFormData('importCal');
+ $_SESSION['import_data']['purge'] = Horde_Util::getFormData('purge');
break;
}
$view = Kronolith::getView('Day');
$title = $view->getTime($prefs->getValue('date_format'));
-$print_view = (bool)Util::getFormData('print');
+$print_view = (bool)Horde_Util::getFormData('print');
Horde::addScriptFile('tooltip.js', 'horde', true);
if (!$print_view) {
require_once dirname(__FILE__) . '/lib/base.php';
-$kronolith_driver = Kronolith::getDriver(null, Util::getFormData('calendar'));
-if ($eventID = Util::getFormData('eventID')) {
+$kronolith_driver = Kronolith::getDriver(null, Horde_Util::getFormData('calendar'));
+if ($eventID = Horde_Util::getFormData('eventID')) {
$event = $kronolith_driver->getEvent($eventID);
if (is_a($event, 'PEAR_Error')) {
- if (($url = Util::getFormData('url')) === null) {
+ if (($url = Horde_Util::getFormData('url')) === null) {
$url = Horde::applicationUrl($prefs->getValue('defaultview') . '.php', true);
}
header('Location: ' . $url);
} else {
$notification_type = Kronolith::ITIP_CANCEL;
$instance = null;
- if (Util::getFormData('future')) {
+ if (Horde_Util::getFormData('future')) {
$recurEnd = new Horde_Date(array('hour' => 0, 'min' => 0, 'sec' => 0,
- 'month' => Util::getFormData('month', date('n')),
- 'mday' => Util::getFormData('mday', date('j')) - 1,
- 'year' => Util::getFormData('year', date('Y'))));
+ 'month' => Horde_Util::getFormData('month', date('n')),
+ 'mday' => Horde_Util::getFormData('mday', date('j')) - 1,
+ 'year' => Horde_Util::getFormData('year', date('Y'))));
if ($event->end->compareDate($recurEnd) > 0) {
$result = $kronolith_driver->deleteEvent($event->getId());
if (is_a($result, 'PEAR_Error')) {
$event->save();
}
$notification_type = Kronolith::ITIP_REQUEST;
- } elseif (Util::getFormData('current')) {
- $event->recurrence->addException(Util::getFormData('year'),
- Util::getFormData('month'),
- Util::getFormData('mday'));
+ } elseif (Horde_Util::getFormData('current')) {
+ $event->recurrence->addException(Horde_Util::getFormData('year'),
+ Horde_Util::getFormData('month'),
+ Horde_Util::getFormData('mday'));
$event->save();
- $instance = new Horde_Date(array('year' => Util::getFormData('year'),
- 'month' => Util::getFormData('month'),
- 'mday' => Util::getFormData('mday')));
+ $instance = new Horde_Date(array('year' => Horde_Util::getFormData('year'),
+ 'month' => Horde_Util::getFormData('month'),
+ 'mday' => Horde_Util::getFormData('mday')));
}
if (!$event->recurs() ||
- Util::getFormData('all') ||
+ Horde_Util::getFormData('all') ||
!$event->recurrence->hasActiveRecurrence()) {
$result = $kronolith_driver->deleteEvent($event->getId());
if (is_a($result, 'PEAR_Error')) {
}
}
- if (Util::getFormData('sendupdates', false)) {
+ if (Horde_Util::getFormData('sendupdates', false)) {
Kronolith::sendITipNotifications($event, $notification, $notification_type, $instance);
}
}
}
-if ($url = Util::getFormData('url')) {
+if ($url = Horde_Util::getFormData('url')) {
$location = $url;
} else {
- $url = Util::addParameter($prefs->getValue('defaultview') . '.php',
- 'date', Util::getFormData('date', date('Ymd')));
+ $url = Horde_Util::addParameter($prefs->getValue('defaultview') . '.php',
+ 'date', Horde_Util::getFormData('date', date('Ymd')));
$location = Horde::applicationUrl($url, true);
}
{
$res = $event->save();
$tagger = Kronolith::getTagger();
- $tagger->replaceTags($event->getUID(), Util::getFormData('tags'));
+ $tagger->replaceTags($event->getUID(), Horde_Util::getFormData('tags'));
if (is_a($res, 'PEAR_Error')) {
$GLOBALS['notification']->push(sprintf(_("There was an error editing the event: %s"), $res->getMessage()), 'horde.error');
- } elseif (Util::getFormData('sendupdates', false)) {
+ } elseif (Horde_Util::getFormData('sendupdates', false)) {
Kronolith::sendITipNotifications($event, $GLOBALS['notification'], Kronolith::ITIP_REQUEST);
}
}
require_once dirname(__FILE__) . '/lib/base.php';
-$url = Util::getFormData('url');
+$url = Horde_Util::getFormData('url');
$kronolith_driver = Kronolith::getDriver();
-if ($exception = Util::getFormData('del_exception')) {
- $calendar = Util::getFormData('calendar');
+if ($exception = Horde_Util::getFormData('del_exception')) {
+ $calendar = Horde_Util::getFormData('calendar');
$share = &$kronolith_shares->getShare($calendar);
if (is_a($share, 'PEAR_Error')) {
$notification->push(sprintf(_("There was an error accessing the calendar: %s"), $share->getMessage()), 'horde.error');
} else {
$kronolith_driver->open($calendar);
- $event = &$kronolith_driver->getEvent(Util::getFormData('eventID'));
+ $event = &$kronolith_driver->getEvent(Horde_Util::getFormData('eventID'));
$result = sscanf($exception, '%04d%02d%02d', $year, $month, $day);
if ($result == 3 && !is_a($event, 'PEAR_Error') && $event->recurs()) {
$event->recurrence->deleteException($year, $month, $day);
_save($event);
}
}
-} elseif (!Util::getFormData('cancel')) {
- $source = Util::getFormData('existingcalendar');
- $targetcalendar = Util::getFormData('targetcalendar');
+} elseif (!Horde_Util::getFormData('cancel')) {
+ $source = Horde_Util::getFormData('existingcalendar');
+ $targetcalendar = Horde_Util::getFormData('targetcalendar');
if (strpos($targetcalendar, ':')) {
list($target, $user) = explode(':', $targetcalendar, 2);
} else {
} else {
$event = false;
- if (($edit_recur = Util::getFormData('edit_recur')) &&
+ if (($edit_recur = Horde_Util::getFormData('edit_recur')) &&
$edit_recur != 'all' && $edit_recur != 'copy' &&
_check_max()) {
/* Get event details. */
$kronolith_driver->open($source);
- $event = &$kronolith_driver->getEvent(Util::getFormData('eventID'));
- $recur_ex = Util::getFormData('recur_ex');
+ $event = &$kronolith_driver->getEvent(Horde_Util::getFormData('eventID'));
+ $recur_ex = Horde_Util::getFormData('recur_ex');
$exception = new Horde_Date($recur_ex);
switch ($edit_recur) {
$event->setUID(null);
_save($event);
$event = null;
- } elseif (Util::getFormData('saveAsNew') ||
+ } elseif (Horde_Util::getFormData('saveAsNew') ||
$edit_recur == 'copy') {
if (_check_max()) {
$kronolith_driver->open($target);
($user != Auth::getAuth() &&
$share->hasPermission(Auth::getAuth(), PERMS_DELEGATE)))) {
$kronolith_driver->open($source);
- $res = $kronolith_driver->move(Util::getFormData('eventID'), $target);
+ $res = $kronolith_driver->move(Horde_Util::getFormData('eventID'), $target);
if (is_a($res, 'PEAR_Error')) {
$notification->push(sprintf(_("There was an error moving the event: %s"), $res->getMessage()), 'horde.error');
} else {
}
$kronolith_driver->open($event_load_from);
- $event = &$kronolith_driver->getEvent(Util::getFormData('eventID'));
+ $event = &$kronolith_driver->getEvent(Horde_Util::getFormData('eventID'));
}
if ($event && !is_a($event, 'PEAR_Error')) {
if (!empty($url)) {
$location = $url;
} else {
- $url = Util::addParameter($prefs->getValue('defaultview') . '.php',
- array('month' => Util::getFormData('month'),
- 'year' => Util::getFormData('year')));
+ $url = Horde_Util::addParameter($prefs->getValue('defaultview') . '.php',
+ array('month' => Horde_Util::getFormData('month'),
+ 'year' => Horde_Util::getFormData('year')));
$location = Horde::applicationUrl($url, true);
}
// Make sure URL is unique.
-$location = Util::addParameter($location, 'unique', hash('md5', microtime()), false);
+$location = Horde_Util::addParameter($location, 'unique', hash('md5', microtime()), false);
header('Location: ' . $location);
require_once dirname(__FILE__) . '/lib/base.php';
-$viewName = Util::getFormData('view', 'Event');
+$viewName = Horde_Util::getFormData('view', 'Event');
$view = Kronolith::getView($viewName);
if (is_a($view->event, 'PEAR_Error')) {
$notification->push($view->event, 'horde.error');
/* Shortcut when we're deleting events and don't want confirmation. */
if (!$view->event->recurs() &&
!($prefs->getValue('confirm_delete') ||
- Util::getFormData('confirm'))) {
+ Horde_Util::getFormData('confirm'))) {
header('Location: ' . Horde::applicationUrl('delete.php?' . $_SERVER['QUERY_STRING'], true));
exit;
}
case 'EditEvent':
if ($view->event->isPrivate() &&
$view->event->getCreatorId() != Auth::getAuth()) {
- $url = Util::getFormData('url');
+ $url = Horde_Util::getFormData('url');
if (empty($url)) {
$url = Horde::applicationUrl($prefs->getValue('defaultview') . '.php', true);
}
- header('Location: ' . Util::addParameter($url, 'unique', hash('md5', microtime()), false));
+ header('Location: ' . Horde_Util::addParameter($url, 'unique', hash('md5', microtime()), false));
exit;
}
break;
}
$title = $view->getTitle();
-$print_view = (bool)Util::getFormData('print');
+$print_view = (bool)Horde_Util::getFormData('print');
if (!$print_view) {
Horde::addScriptFile('popup.js', 'horde', true);
}
NLS::setCharset('UTF-8');
// Determine the username to show free/busy time for.
-$cal = Util::getFormData('c');
-$user = Util::getFormData('u');
+$cal = Horde_Util::getFormData('c');
+$user = Horde_Util::getFormData('u');
if (!empty($cal)) {
if (is_array($cal)) {
$cal = implode('|', $cal);
}
-} elseif ($pathInfo = Util::getPathInfo()) {
+} elseif ($pathInfo = Horde_Util::getPathInfo()) {
$user = basename($pathInfo);
}
require_once 'Horde/Identity.php';
require_once 'Horde/Template.php';
-$calendar = Util::getFormData('c');
+$calendar = Horde_Util::getFormData('c');
$share = $kronolith_shares->getShare($calendar);
if (is_a($share, 'PEAR_Error')) {
_no_access(404, 'Not Found',
}
}
-$feed_type = basename(Util::getFormData('type'));
+$feed_type = basename(Horde_Util::getFormData('type'));
if (empty($feed_type)) {
// If not specified, default to Atom.
$feed_type = 'atom';
if (isset($conf['urls']['pretty']) && $conf['urls']['pretty'] == 'rewrite') {
$self_url = 'feed/' . $calendar;
} else {
- $self_url = Util::addParameter('feed/index.php', 'c', $calendar);
+ $self_url = Horde_Util::addParameter('feed/index.php', 'c', $calendar);
}
$self_url = Horde::applicationUrl($self_url, true, -1);
require_once dirname(__FILE__) . '/lib/base.php';
-$path = Util::getFormData('imple');
+$path = Horde_Util::getFormData('imple');
if (!$path) {
exit;
}
}
$date = new Horde_Date(time());
- return $title . ', ' . Horde::link(Horde::url(Util::addParameter($registry->getInitialPage(), $url_params), true)) . $date->strftime('%B, %Y') . '</a>';
+ return $title . ', ' . Horde::link(Horde::url(Horde_Util::addParameter($registry->getInitialPage(), $url_params), true)) . $date->strftime('%B, %Y') . '</a>';
}
/**
$url_params['display_cal'] = $this->_params['calendar'];
}
/* Set up the link to the day view. */
- $url = Util::addParameter(Horde::applicationUrl('day.php', true),
+ $url = Horde_Util::addParameter(Horde::applicationUrl('day.php', true),
$url_params);
$date_stamp = $date_ob->dateString();
} else {
$url_params = array();
}
- return Horde::link(Horde::url(Util::addParameter($registry->getInitialPage(), $url_params), true)) . _("Upcoming Events") . '</a>';
+ return Horde::link(Horde::url(Horde_Util::addParameter($registry->getInitialPage(), $url_params), true)) . _("Upcoming Events") . '</a>';
}
/**
} else {
$url_params = array();
}
- return Horde::link(Horde::url(Util::addParameter($GLOBALS['registry']->getInitialPage(), $url_params), true)) . _("Prior Events") . '</a>';
+ return Horde::link(Horde::url(Horde_Util::addParameter($GLOBALS['registry']->getInitialPage(), $url_params), true)) . _("Prior Events") . '</a>';
}
/**
} else {
$url_params = array();
}
- return Horde::link(Horde::url(Util::addParameter($registry->getInitialPage(), $url_params), true)) . htmlspecialchars($registry->get('name')) . '</a>';
+ return Horde::link(Horde::url(Horde_Util::addParameter($registry->getInitialPage(), $url_params), true)) . htmlspecialchars($registry->get('name')) . '</a>';
}
/**
$url_params['display_cal'] = $this->_params['calendar'];
}
$daylink = Horde::applicationUrl('day.php', true);
- $daylink = Util::addParameter($daylink, $url_params);
+ $daylink = Horde_Util::addParameter($daylink, $url_params);
$html .= Horde::link($daylink, sprintf(_("Goto %s"),
$dayname));
$html .= $dayname . '</a></strong></td></tr>';
*/
public function convertFromDriver($value)
{
- return String::convertCharset($value, $this->_params['charset']);
+ return Horde_String::convertCharset($value, $this->_params['charset']);
}
/**
*/
public function convertToDriver($value)
{
- return String::convertCharset($value, NLS::getCharset(), $this->_params['charset']);
+ return Horde_String::convertCharset($value, NLS::getCharset(), $this->_params['charset']);
}
/**
$vEvent->setAttribute('LAST-MODIFIED', $modified);
}
- $vEvent->setAttribute('SUMMARY', $v1 ? $this->getTitle() : String::convertCharset($this->getTitle(), NLS::getCharset(), 'utf-8'));
+ $vEvent->setAttribute('SUMMARY', $v1 ? $this->getTitle() : Horde_String::convertCharset($this->getTitle(), NLS::getCharset(), 'utf-8'));
$name = Kronolith::getUserName($this->getCreatorId());
if (!$v1) {
- $name = String::convertCharset($name, NLS::getCharset(), 'utf-8');
+ $name = Horde_String::convertCharset($name, NLS::getCharset(), 'utf-8');
}
$vEvent->setAttribute('ORGANIZER',
'mailto:' . Kronolith::getUserEmail($this->getCreatorId()),
array('CN' => $name));
if (!$this->isPrivate() || $this->getCreatorId() == Auth::getAuth()) {
if (!empty($this->description)) {
- $vEvent->setAttribute('DESCRIPTION', $v1 ? $this->description : String::convertCharset($this->description, NLS::getCharset(), 'utf-8'));
+ $vEvent->setAttribute('DESCRIPTION', $v1 ? $this->description : Horde_String::convertCharset($this->description, NLS::getCharset(), 'utf-8'));
}
// Tags
$tags = implode(', ', $tags);
}
if (!empty($tags)) {
- $vEvent->setAttribute('CATEGORIES', $v1 ? $tags : String::convertCharset($tags, NLS::getCharset(), 'utf-8'));
+ $vEvent->setAttribute('CATEGORIES', $v1 ? $tags : Horde_String::convertCharset($tags, NLS::getCharset(), 'utf-8'));
}
// Location
if (!empty($this->location)) {
- $vEvent->setAttribute('LOCATION', $v1 ? $this->location : String::convertCharset($this->location, NLS::getCharset(), 'utf-8'));
+ $vEvent->setAttribute('LOCATION', $v1 ? $this->location : Horde_String::convertCharset($this->location, NLS::getCharset(), 'utf-8'));
}
}
$vEvent->setAttribute('CLASS', $this->isPrivate() ? 'PRIVATE' : 'PUBLIC');
}
} else {
if (!empty($status['name'])) {
- $params['CN'] = String::convertCharset($status['name'], NLS::getCharset(), 'utf-8');
+ $params['CN'] = Horde_String::convertCharset($status['name'], NLS::getCharset(), 'utf-8');
}
if (!empty($email)) {
$email = 'mailto:' . $email;
// Class
$class = $vEvent->getAttribute('CLASS');
if (!is_array($class) && !is_a($class, 'PEAR_Error')) {
- $class = String::upper($class);
+ $class = Horde_String::upper($class);
if ($class == 'PRIVATE' || $class == 'CONFIDENTIAL') {
$this->setPrivate(true);
} else {
// Status.
$status = $vEvent->getAttribute('STATUS');
if (!is_array($status) && !is_a($status, 'PEAR_Error')) {
- $status = String::upper($status);
+ $status = Horde_String::upper($status);
if ($status == 'DECLINED') {
$status = 'CANCELLED';
}
'mday' => $match[3]));
$formatted = $horde_date->strftime($GLOBALS['prefs']->getValue('date_format'));
return $formatted
- . Horde::link(Util::addParameter(Horde::applicationUrl('edit.php'), array('calendar' => $this->getCalendar(), 'eventID' => $this->eventID, 'del_exception' => $date, 'url' => Util::getFormData('url'))), sprintf(_("Delete exception on %s"), $formatted))
+ . Horde::link(Horde_Util::addParameter(Horde::applicationUrl('edit.php'), array('calendar' => $this->getCalendar(), 'eventID' => $this->eventID, 'del_exception' => $date, 'url' => Horde_Util::getFormData('url'))), sprintf(_("Delete exception on %s"), $formatted))
. Horde::img('delete-small.png', _("Delete"), '', $GLOBALS['registry']->getImageDir('horde'))
. '</a>';
}
*/
public function hasAttendee($email)
{
- $email = String::lower($email);
+ $email = Horde_String::lower($email);
return isset($this->attendees[$email]);
}
*/
public function addAttendee($email, $attendance, $response, $name = null)
{
- $email = String::lower($email);
+ $email = Horde_String::lower($email);
if ($attendance == Kronolith::PART_IGNORE) {
if (isset($this->attendees[$email])) {
$attendance = $this->attendees[$email]['attendance'];
*/
public function removeAttendee($email)
{
- $email = String::lower($email);
+ $email = Horde_String::lower($email);
if (isset($this->attendees[$email])) {
unset($this->attendees[$email]);
}
global $prefs, $cManager;
// Event owner.
- $targetcalendar = Util::getFormData('targetcalendar');
+ $targetcalendar = Horde_Util::getFormData('targetcalendar');
if (strpos($targetcalendar, ':')) {
list(, $creator) = explode(':', $targetcalendar, 2);
} else {
$this->setCreatorId($creator);
// Basic fields.
- $this->setTitle(Util::getFormData('title', $this->title));
- $this->setDescription(Util::getFormData('description', $this->description));
- $this->setLocation(Util::getFormData('location', $this->location));
- $this->setPrivate(Util::getFormData('private'));
+ $this->setTitle(Horde_Util::getFormData('title', $this->title));
+ $this->setDescription(Horde_Util::getFormData('description', $this->description));
+ $this->setLocation(Horde_Util::getFormData('location', $this->location));
+ $this->setPrivate(Horde_Util::getFormData('private'));
// Status.
- $this->setStatus(Util::getFormData('status', $this->status));
+ $this->setStatus(Horde_Util::getFormData('status', $this->status));
// Attendees.
if (isset($_SESSION['kronolith']['attendees']) && is_array($_SESSION['kronolith']['attendees'])) {
setlocale(LC_TIME, 'C');
// Event start.
- if ($start_date = Util::getFormData('start_date')) {
- $start_time = Util::getFormData('start_time');
+ if ($start_date = Horde_Util::getFormData('start_date')) {
+ $start_time = Horde_Util::getFormData('start_time');
$start = $start_date . ' ' . $start_time;
$format = $date_format . ' '
. ($prefs->getValue('twentyFour') ? '%H:%M' : '%I:%M %p');
$this->start = new Horde_Date($start);
}
} else {
- $start = Util::getFormData('start');
+ $start = Horde_Util::getFormData('start');
$start_year = $start['year'];
$start_month = $start['month'];
$start_day = $start['day'];
- $start_hour = Util::getFormData('start_hour');
- $start_min = Util::getFormData('start_min');
- $am_pm = Util::getFormData('am_pm');
+ $start_hour = Horde_Util::getFormData('start_hour');
+ $start_min = Horde_Util::getFormData('start_min');
+ $am_pm = Horde_Util::getFormData('am_pm');
if (!$prefs->getValue('twentyFour')) {
if ($am_pm == 'PM') {
}
}
- if (Util::getFormData('end_or_dur') == 1) {
- if (Util::getFormData('whole_day') == 1) {
+ if (Horde_Util::getFormData('end_or_dur') == 1) {
+ if (Horde_Util::getFormData('whole_day') == 1) {
$start_hour = 0;
$start_min = 0;
$dur_day = 0;
$dur_hour = 24;
$dur_min = 0;
} else {
- $dur_day = (int)Util::getFormData('dur_day');
- $dur_hour = (int)Util::getFormData('dur_hour');
- $dur_min = (int)Util::getFormData('dur_min');
+ $dur_day = (int)Horde_Util::getFormData('dur_day');
+ $dur_hour = (int)Horde_Util::getFormData('dur_hour');
+ $dur_min = (int)Horde_Util::getFormData('dur_min');
}
}
'year' => $start_year));
}
- if ($end_date = Util::getFormData('end_date')) {
+ if ($end_date = Horde_Util::getFormData('end_date')) {
// Event end.
- $end_time = Util::getFormData('end_time');
+ $end_time = Horde_Util::getFormData('end_time');
$end = $end_date . ' ' . $end_time;
$format = $date_format . ' '
. ($prefs->getValue('twentyFour') ? '%H:%M' : '%I:%M %p');
} else {
$this->end = new Horde_Date($end);
}
- } elseif (Util::getFormData('end_or_dur') == 1) {
+ } elseif (Horde_Util::getFormData('end_or_dur') == 1) {
// Event duration.
$this->end = new Horde_Date(array('hour' => $start_hour + $dur_hour,
'min' => $start_min + $dur_min,
'year' => $start_year));
} else {
// Event end.
- $end = Util::getFormData('end');
+ $end = Horde_Util::getFormData('end');
$end_year = $end['year'];
$end_month = $end['month'];
$end_day = $end['day'];
- $end_hour = Util::getFormData('end_hour');
- $end_min = Util::getFormData('end_min');
- $end_am_pm = Util::getFormData('end_am_pm');
+ $end_hour = Horde_Util::getFormData('end_hour');
+ $end_min = Horde_Util::getFormData('end_min');
+ $end_am_pm = Horde_Util::getFormData('end_am_pm');
if (!$prefs->getValue('twentyFour')) {
if ($end_am_pm == 'PM') {
setlocale(LC_TIME, $old_locale);
// Alarm.
- if (!is_null($alarm = Util::getFormData('alarm'))) {
+ if (!is_null($alarm = Horde_Util::getFormData('alarm'))) {
if ($alarm) {
- $this->setAlarm(Util::getFormData('alarm_value') * Util::getFormData('alarm_unit'));
+ $this->setAlarm(Horde_Util::getFormData('alarm_value') * Horde_Util::getFormData('alarm_unit'));
// Notification.
- if (Util::getFormData('alarm_change_method')) {
- $types = Util::getFormData('event_alarms');
+ if (Horde_Util::getFormData('alarm_change_method')) {
+ $types = Horde_Util::getFormData('event_alarms');
if (!empty($types)) {
$methods = array();
foreach ($types as $type) {
$methods[$type] = array();
switch ($type){
case 'notify':
- $methods[$type]['sound'] = Util::getFormData('event_alarms_sound');
+ $methods[$type]['sound'] = Horde_Util::getFormData('event_alarms_sound');
break;
case 'mail':
- $methods[$type]['email'] = Util::getFormData('event_alarms_email');
+ $methods[$type]['email'] = Horde_Util::getFormData('event_alarms_email');
break;
case 'popup':
break;
}
// Recurrence.
- $recur = Util::getFormData('recur');
+ $recur = Horde_Util::getFormData('recur');
if ($recur !== null && $recur !== '') {
if (!isset($this->recurrence)) {
$this->recurrence = new Horde_Date_Recurrence($this->start);
}
- if (Util::getFormData('recur_enddate_type') == 'date') {
- $recur_enddate = Util::getFormData('recur_enddate');
+ if (Horde_Util::getFormData('recur_enddate_type') == 'date') {
+ $recur_enddate = Horde_Util::getFormData('recur_enddate');
if ($this->recurrence->hasRecurEnd()) {
$recurEnd = $this->recurrence->recurEnd;
$recurEnd->month = $recur_enddate['month'];
'year' => $recur_enddate['year']));
}
$this->recurrence->setRecurEnd($recurEnd);
- } elseif (Util::getFormData('recur_enddate_type') == 'count') {
- $this->recurrence->setRecurCount(Util::getFormData('recur_count'));
- } elseif (Util::getFormData('recur_enddate_type') == 'none') {
+ } elseif (Horde_Util::getFormData('recur_enddate_type') == 'count') {
+ $this->recurrence->setRecurCount(Horde_Util::getFormData('recur_count'));
+ } elseif (Horde_Util::getFormData('recur_enddate_type') == 'none') {
$this->recurrence->setRecurCount(0);
$this->recurrence->setRecurEnd(null);
}
$this->recurrence->setRecurType($recur);
switch ($recur) {
case Horde_Date_Recurrence::RECUR_DAILY:
- $this->recurrence->setRecurInterval(Util::getFormData('recur_daily_interval', 1));
+ $this->recurrence->setRecurInterval(Horde_Util::getFormData('recur_daily_interval', 1));
break;
case Horde_Date_Recurrence::RECUR_WEEKLY:
- $weekly = Util::getFormData('weekly');
+ $weekly = Horde_Util::getFormData('weekly');
$weekdays = 0;
if (is_array($weekly)) {
foreach ($weekly as $day) {
}
}
- $this->recurrence->setRecurInterval(Util::getFormData('recur_weekly_interval', 1));
+ $this->recurrence->setRecurInterval(Horde_Util::getFormData('recur_weekly_interval', 1));
$this->recurrence->setRecurOnDay($weekdays);
break;
case Horde_Date_Recurrence::RECUR_MONTHLY_DATE:
- $this->recurrence->setRecurInterval(Util::getFormData('recur_day_of_month_interval', 1));
+ $this->recurrence->setRecurInterval(Horde_Util::getFormData('recur_day_of_month_interval', 1));
break;
case Horde_Date_Recurrence::RECUR_MONTHLY_WEEKDAY:
- $this->recurrence->setRecurInterval(Util::getFormData('recur_week_of_month_interval', 1));
+ $this->recurrence->setRecurInterval(Horde_Util::getFormData('recur_week_of_month_interval', 1));
break;
case Horde_Date_Recurrence::RECUR_YEARLY_DATE:
- $this->recurrence->setRecurInterval(Util::getFormData('recur_yearly_interval', 1));
+ $this->recurrence->setRecurInterval(Horde_Util::getFormData('recur_yearly_interval', 1));
break;
case Horde_Date_Recurrence::RECUR_YEARLY_DAY:
- $this->recurrence->setRecurInterval(Util::getFormData('recur_yearly_day_interval', 1));
+ $this->recurrence->setRecurInterval(Horde_Util::getFormData('recur_yearly_day_interval', 1));
break;
case Horde_Date_Recurrence::RECUR_YEARLY_WEEKDAY:
- $this->recurrence->setRecurInterval(Util::getFormData('recur_yearly_weekday_interval', 1));
+ $this->recurrence->setRecurInterval(Horde_Util::getFormData('recur_yearly_weekday_interval', 1));
break;
}
- if ($exceptions = Util::getFormData('exceptions')) {
+ if ($exceptions = Horde_Util::getFormData('exceptions')) {
foreach ($exceptions as $exception) {
$this->recurrence->addException((int)substr($exception, 0, 4),
(int)substr($exception, 4, 2),
}
// Tags.
- $this->tags = Util::getFormData('tags', $this->tags);
+ $this->tags = Horde_Util::getFormData('tags', $this->tags);
$this->initialized = true;
}
$params['calendar'] = $this->getCalendar();
}
- return Horde::applicationUrl(Util::addParameter('event.php', $params), $full);
+ return Horde::applicationUrl(Horde_Util::addParameter('event.php', $params), $full);
}
/**
$params['calendar'] = $this->getCalendar();
}
- return Horde::applicationUrl(Util::addParameter('event.php', $params));
+ return Horde::applicationUrl(Horde_Util::addParameter('event.php', $params));
}
/**
$params['view'] = 'DeleteEvent';
$params['eventID'] = $this->eventID;
$params['calendar'] = $this->getCalendar();
- return Horde::applicationUrl(Util::addParameter('event.php', $params));
+ return Horde::applicationUrl(Horde_Util::addParameter('event.php', $params));
}
/**
$params['calendar'] = $this->getCalendar();
}
- return Horde::applicationUrl(Util::addParameter('event.php', $params));
+ return Horde::applicationUrl(Horde_Util::addParameter('event.php', $params));
}
public function getLink($datetime = null, $icons = true, $from_url = null, $full = false)
$event_title = $this->getTitle();
if (isset($this->external) && !empty($this->external_link)) {
$link = $this->external_link;
- $link = Horde::linkTooltip(Horde::url($link), '', 'event-tentative', '', '', String::wrap($this->description));
+ $link = Horde::linkTooltip(Horde::url($link), '', 'event-tentative', '', '', Horde_String::wrap($this->description));
} elseif (isset($this->eventID) && $this->hasPermission(PERMS_READ)) {
$link = Horde::linkTooltip($this->getViewUrl(array('datetime' => $datetime->strftime('%Y%m%d%H%M%S'), 'url' => $from_url), $full),
$event_title,
}
if ($this->description) {
- $tooltip .= "\n\n" . String::wrap($this->description);
+ $tooltip .= "\n\n" . Horde_String::wrap($this->description);
}
}
{
$this->stored = true;
$this->initialized = true;
- $this->setTitle(String::convertCharset($dhEvent->getTitle(), 'UTF-8'));
+ $this->setTitle(Horde_String::convertCharset($dhEvent->getTitle(), 'UTF-8'));
$this->start = new Horde_Date($dhEvent->_date->getTime());
$this->end = new Horde_Date($this->start);
$this->end->mday++;
* @package Kronolith
*/
-/** Variables */
-require_once 'Horde/Variables.php';
-
/** Horde_Form */
require_once 'Horde/Form.php';
* @package Kronolith
*/
-/** Variables */
-require_once 'Horde/Variables.php';
-
/** Horde_Form */
require_once 'Horde/Form.php';
* @package Kronolith
*/
-/** Variables */
-require_once 'Horde/Variables.php';
-
/** Horde_Form */
require_once 'Horde/Form.php';
* @package Kronolith
*/
-/** Variables */
-require_once 'Horde/Variables.php';
-
/** Horde_Form */
require_once 'Horde/Form.php';
* @package Kronolith
*/
-/** Variables */
-require_once 'Horde/Variables.php';
-
/** Horde_Form */
require_once 'Horde/Form.php';
* @package Kronolith
*/
-/** Variables */
-require_once 'Horde/Variables.php';
-
/** Horde_Form */
require_once 'Horde/Form.php';
$optimal->merge($optional);
$base_url = Horde::selfUrl();
- $base_url = Util::removeParameter($base_url, 'date');
- $base_url = Util::removeParameter($base_url, 'fbview');
- $base_url = Util::addParameter($base_url, 'fbview', $this->view);
+ $base_url = Horde_Util::removeParameter($base_url, 'date');
+ $base_url = Horde_Util::removeParameter($base_url, 'fbview');
+ $base_url = Horde_Util::addParameter($base_url, 'fbview', $this->view);
$template = new Horde_Template();
$template->set('title', $this->_title());
{
// Avoid errors if 'input' isn't set and short-circuit empty searches.
if (empty($args['input']) ||
- !($input = Util::getFormData($args['input']))) {
+ !($input = Horde_Util::getFormData($args['input']))) {
return array();
}
{
// Avoid errors if 'input' isn't set and short-circuit empty searches.
if (empty($args['input']) ||
- !($input = Util::getFormData($args['input']))) {
+ !($input = Horde_Util::getFormData($args['input']))) {
return array();
}
return array_map('htmlspecialchars', $this->getTagList($input));
'URI_AJAX' => Horde::url($kronolith_webroot . '/ajax.php', true, -1),
'URI_PREFS' => Horde::url($horde_webroot . '/services/prefs/', true, -1),
'URI_IMG' => $registry->getImageDir() . '/',
- //'URI_VIEW' => Util::addParameter(Horde::url($imp_webroot . '/view.php', true, -1), array('actionID' => 'view_source', 'id' => 0), null, false),
+ //'URI_VIEW' => Horde_Util::addParameter(Horde::url($imp_webroot . '/view.php', true, -1), array('actionID' => 'view_source', 'id' => 0), null, false),
'SESSION_ID' => defined('SID') ? SID : '',
'prefs_url' => str_replace('&', '&', Horde::getServiceLink('options', 'kronolith')),
'name' => $registry->get('name'),
$calendars = array($driver[0] => array($driver[1]));
} else {
$calendars = array(
- String::ucfirst($GLOBALS['conf']['calendar']['driver']) => $GLOBALS['display_calendars'],
+ Horde_String::ucfirst($GLOBALS['conf']['calendar']['driver']) => $GLOBALS['display_calendars'],
'Horde' => $GLOBALS['display_external_calendars'],
'Ical' => $GLOBALS['display_remote_calendars']);
if (!empty($GLOBALS['conf']['holidays']['enable'])) {
/* Update preferences for which calendars to display. If the
* user doesn't have any selected calendars to view then fall
* back to an available calendar. */
- if (($calendarId = Util::getFormData('display_cal')) !== null) {
+ if (($calendarId = Horde_Util::getFormData('display_cal')) !== null) {
if (is_array($calendarId)) {
$calendars = $calendarId;
$GLOBALS['display_calendars'] = array();
}
/* Check for single "toggle" calendars. */
- if (($calendarId = Util::getFormData('toggle_calendar')) !== null) {
+ if (($calendarId = Horde_Util::getFormData('toggle_calendar')) !== null) {
if (strncmp($calendarId, 'remote_', 7) === 0) {
$calendarId = substr($calendarId, 7);
if (in_array($calendarId, $GLOBALS['display_remote_calendars'])) {
*/
public static function responseFromICal($response)
{
- switch (String::upper($response)) {
+ switch (Horde_String::upper($response)) {
case 'ACCEPTED':
return self::RESPONSE_ACCEPTED;
$GLOBALS['conf']['urls']['pretty'] == 'rewrite') {
$feed_url = 'feed/' . $calendar;
} else {
- $feed_url = Util::addParameter('feed/index.php', 'c', $calendar);
+ $feed_url = Horde_Util::addParameter('feed/index.php', 'c', $calendar);
}
return Horde::applicationUrl($feed_url, true, -1);
}
$myemail = $ident->getValue('from_addr');
if (!$myemail) {
- $notification->push(sprintf(_("You do not have an email address configured in your Personal Information Options. You must set one %shere%s before event notifications can be sent."), Horde::link(Util::addParameter(Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/prefs.php'), array('app' => 'horde', 'group' => 'identities'))), '</a>'), 'horde.error', array('content.raw'));
+ $notification->push(sprintf(_("You do not have an email address configured in your Personal Information Options. You must set one %shere%s before event notifications can be sent."), Horde::link(Horde_Util::addParameter(Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/prefs.php'), array('app' => 'horde', 'group' => 'identities'))), '</a>'), 'horde.error', array('content.raw'));
return;
}
$message .= _("Attached is an iCalendar file with more information about the event. If your mail client supports iTip requests you can use this file to easily update your local copy of the event.");
if ($action == self::ITIP_REQUEST) {
- $attend_link = Util::addParameter(Horde::applicationUrl('attend.php', true, -1), array('c' => $event->getCalendar(), 'e' => $event->getId(), 'u' => $email), null, false);
- $message .= "\n\n" . sprintf(_("If your email client doesn't support iTip requests you can use one of the following links to accept or decline the event.\n\nTo accept the event:\n%s\n\nTo accept the event tentatively:\n%s\n\nTo decline the event:\n%s\n"), Util::addParameter($attend_link, 'a', 'accept', false), Util::addParameter($attend_link, 'a', 'tentative', false), Util::addParameter($attend_link, 'a', 'decline', false));
+ $attend_link = Horde_Util::addParameter(Horde::applicationUrl('attend.php', true, -1), array('c' => $event->getCalendar(), 'e' => $event->getId(), 'u' => $email), null, false);
+ $message .= "\n\n" . sprintf(_("If your email client doesn't support iTip requests you can use one of the following links to accept or decline the event.\n\nTo accept the event:\n%s\n\nTo accept the event tentatively:\n%s\n\nTo decline the event:\n%s\n"), Horde_Util::addParameter($attend_link, 'a', 'accept', false), Horde_Util::addParameter($attend_link, 'a', 'tentative', false), Horde_Util::addParameter($attend_link, 'a', 'decline', false));
}
/* Build the iCalendar data */
$iCal = new Horde_iCalendar();
$iCal->setAttribute('METHOD', $method);
- $iCal->setAttribute('X-WR-CALNAME', String::convertCharset($share->get('name'), NLS::getCharset(), 'utf-8'));
+ $iCal->setAttribute('X-WR-CALNAME', Horde_String::convertCharset($share->get('name'), NLS::getCharset(), 'utf-8'));
$vevent = $event->toiCalendar($iCal);
if ($action == self::ITIP_CANCEL && !empty($instance)) {
$vevent->setAttribute('RECURRENCE-ID', $instance, array('VALUE' => 'DATE'));
*/
public static function currentDate()
{
- if ($date = Util::getFormData('date')) {
+ if ($date = Horde_Util::getFormData('date')) {
return new Horde_Date($date . '000000');
}
- if ($date = Util::getFormData('datetime')) {
+ if ($date = Horde_Util::getFormData('datetime')) {
return new Horde_Date($date);
}
$date = self::currentDate();
$date_stamp = $date->dateString();
- require_once 'Horde/Variables.php';
- $tabs = new Horde_UI_Tabs('view', Variables::getDefaultVariables());
+ $tabs = new Horde_UI_Tabs('view', Horde_Variables::getDefaultVariables());
$tabs->preserve('date', $date_stamp);
$tabs->addTab(_("Day"), Horde::applicationUrl('day.php'),
return;
}
- require_once 'Horde/Variables.php';
- $tabs = new Horde_UI_Tabs('event', Variables::getDefaultVariables());
+ $tabs = new Horde_UI_Tabs('event', Horde_Variables::getDefaultVariables());
$date = self::currentDate();
$tabs->preserve('datetime', $date->dateString());
public static function getDriver($driver = null, $calendar = null)
{
if (empty($driver)) {
- $driver = String::ucfirst($GLOBALS['conf']['calendar']['driver']);
+ $driver = Horde_String::ucfirst($GLOBALS['conf']['calendar']['driver']);
}
if (!isset(self::$_instances[$driver])) {
case 'Event':
require_once KRONOLITH_BASE . '/lib/Views/Event.php';
- if (Util::getFormData('calendar') == '**remote') {
- $event = self::getDriver('Ical', Util::getFormData('remoteCal'))
- ->getEvent(Util::getFormData('eventID'));
- } elseif ($uid = Util::getFormData('uid')) {
+ if (Horde_Util::getFormData('calendar') == '**remote') {
+ $event = self::getDriver('Ical', Horde_Util::getFormData('remoteCal'))
+ ->getEvent(Horde_Util::getFormData('eventID'));
+ } elseif ($uid = Horde_Util::getFormData('uid')) {
$event = self::getDriver()->getByUID($uid);
} else {
- $event = self::getDriver(null, Util::getFormData('calendar'))
- ->getEvent(Util::getFormData('eventID'));
+ $event = self::getDriver(null, Horde_Util::getFormData('calendar'))
+ ->getEvent(Horde_Util::getFormData('eventID'));
}
if (!is_a($event, 'PEAR_Error') &&
!$event->hasPermission(PERMS_READ)) {
case 'EditEvent':
require_once KRONOLITH_BASE . '/lib/Views/EditEvent.php';
- if (Util::getFormData('calendar') == '**remote') {
- $event = self::getDriver('Ical', Util::getFormData('remoteCal'))
- ->getEvent(Util::getFormData('eventID'));
+ if (Horde_Util::getFormData('calendar') == '**remote') {
+ $event = self::getDriver('Ical', Horde_Util::getFormData('remoteCal'))
+ ->getEvent(Horde_Util::getFormData('eventID'));
} else {
- $event = self::getDriver(null, Util::getFormData('calendar'))
- ->getEvent(Util::getFormData('eventID'));
+ $event = self::getDriver(null, Horde_Util::getFormData('calendar'))
+ ->getEvent(Horde_Util::getFormData('eventID'));
}
if (!is_a($event, 'PEAR_Error') &&
!$event->hasPermission(PERMS_EDIT)) {
case 'DeleteEvent':
require_once KRONOLITH_BASE . '/lib/Views/DeleteEvent.php';
- $event = self::getDriver(null, Util::getFormData('calendar'))
- ->getEvent(Util::getFormData('eventID'));
+ $event = self::getDriver(null, Horde_Util::getFormData('calendar'))
+ ->getEvent(Horde_Util::getFormData('eventID'));
if (!is_a($event, 'PEAR_Error') &&
!$event->hasPermission(PERMS_DELETE)) {
$event = PEAR::raiseError(_("Permission Denied"));
case 'ExportEvent':
require_once KRONOLITH_BASE . '/lib/Views/ExportEvent.php';
- if (Util::getFormData('calendar') == '**remote') {
- $event = self::getDriver('Ical', Util::getFormData('remoteCal'))
- ->getEvent(Util::getFormData('eventID'));
- } elseif ($uid = Util::getFormData('uid')) {
+ if (Horde_Util::getFormData('calendar') == '**remote') {
+ $event = self::getDriver('Ical', Horde_Util::getFormData('remoteCal'))
+ ->getEvent(Horde_Util::getFormData('eventID'));
+ } elseif ($uid = Horde_Util::getFormData('uid')) {
$event = self::getDriver()->getByUID($uid);
} else {
- $event = self::getDriver(null, Util::getFormData('calendar'))
- ->getEvent(Util::getFormData('eventID'));
+ $event = self::getDriver(null, Horde_Util::getFormData('calendar'))
+ ->getEvent(Horde_Util::getFormData('eventID'));
}
if (!is_a($event, 'PEAR_Error') &&
!$event->hasPermission(PERMS_READ)) {
(!empty($conf['hooks']['permsdenied']) ||
self::hasPermission('max_events') === true ||
self::hasPermission('max_events') > self::countEvents())) {
- $menu->add(Util::addParameter(Horde::applicationUrl('new.php'), 'url', Horde::selfUrl(true, false, true)), _("_New Event"), 'new.png');
+ $menu->add(Horde_Util::addParameter(Horde::applicationUrl('new.php'), 'url', Horde::selfUrl(true, false, true)), _("_New Event"), 'new.png');
}
if ($browser->hasFeature('dom')) {
Horde::addScriptFile('goto.js', 'kronolith');
}
/* Print. */
- if ($conf['menu']['print'] && ($view = Util::nonInputVar('view'))) {
- $menu->add(Util::addParameter($view->link(), 'print', 1), _("_Print"), 'print.png', $registry->getImageDir('horde'), '_blank', 'popup(kronolithPrintLink ? kronolithPrintLink : this.href); return false;', '__noselection');
+ if ($conf['menu']['print'] && ($view = Horde_Util::nonInputVar('view'))) {
+ $menu->add(Horde_Util::addParameter($view->link(), 'print', 1), _("_Print"), 'print.png', $registry->getImageDir('horde'), '_blank', 'popup(kronolithPrintLink ? kronolithPrintLink : this.href); return false;', '__noselection');
}
if ($returnType == 'object') {
}
break;
} elseif ($val['confirmed'] ||
- Util::getFormData($key . '_confirm')) {
+ Horde_Util::getFormData($key . '_confirm')) {
/* Perform maintenance if confirmed. */
$mod = &$this->_loadModule($key);
$mod->doMaintenance();
foreach ($existing_tags as $tag_id => $existing_tag) {
$found = false;
foreach ($tags as $tag_text) {
- //if ($existing_tag == String::lower($tag_text, true)) {
+ //if ($existing_tag == Horde_String::lower($tag_text, true)) {
if ($existing_tag == $tag_text) {
$found = true;
break;
echo '<tbody>';
if ($addLinks) {
- $newEventUrl = Util::addParameter(
+ $newEventUrl = Horde_Util::addParameter(
'new.php',
array('datetime' => sprintf($this->dateString() . '%02d%02d00',
$this->slots[0]['hour'], $this->slots[0]['min']),
}
if ($addLinks) {
- $newEventUrl = Util::addParameter(
+ $newEventUrl = Horde_Util::addParameter(
'new.php',
array('datetime' => sprintf($this->dateString() . '%02d%02d00',
$this->slots[$i]['hour'], $this->slots[$i]['min']),
function link($offset = 0, $full = false)
{
return Horde::applicationUrl(
- Util::addParameter('day.php', 'date', $this->getTime('%Y%m%d', $offset)),
+ Horde_Util::addParameter('day.php', 'date', $this->getTime('%Y%m%d', $offset)),
$full);
}
return;
}
- if ($datetime = Util::getFormData('datetime')) {
+ if ($datetime = Horde_Util::getFormData('datetime')) {
$datetime = new Horde_Date($datetime);
$month = $datetime->month;
$year = $datetime->year;
$day = $datetime->mday;
} else {
- $month = Util::getFormData('month', date('n'));
- $day = Util::getFormData('mday', date('j'));
- $year = Util::getFormData('year', date('Y'));
+ $month = Horde_Util::getFormData('month', date('n'));
+ $day = Horde_Util::getFormData('mday', date('j'));
+ $year = Horde_Util::getFormData('year', date('Y'));
}
- $url = Util::getFormData('url');
+ $url = Horde_Util::getFormData('url');
echo '<div id="DeleteEvent"' . ($active ? '' : ' style="display:none"') . '>';
if (!$this->event->recurs()) {
}
$_SESSION['kronolith']['attendees'] = $this->event->getAttendees();
- if ($datetime = Util::getFormData('datetime')) {
+ if ($datetime = Horde_Util::getFormData('datetime')) {
$datetime = new Horde_Date($datetime);
$month = $datetime->month;
$year = $datetime->year;
} else {
- $month = Util::getFormData('month', date('n'));
- $year = Util::getFormData('year', date('Y'));
+ $month = Horde_Util::getFormData('month', date('n'));
+ $year = Horde_Util::getFormData('year', date('Y'));
}
- $url = Util::getFormData('url');
+ $url = Horde_Util::getFormData('url');
$perms = PERMS_EDIT;
if ($this->event->getCreatorId() == Auth::getAuth()) {
$perms |= PERMS_DELEGATE;
if (isset($url)) {
$cancelurl = $url;
} else {
- $cancelurl = Util::addParameter('month.php', array('month' => $month,
+ $cancelurl = Horde_Util::addParameter('month.php', array('month' => $month,
'year', $year));
$cancelurl = Horde::applicationUrl($cancelurl, true);
}
$status = Kronolith::statusToString($this->event->getStatus());
$attendees = $this->event->getAttendees();
- if ($datetime = Util::getFormData('datetime')) {
+ if ($datetime = Horde_Util::getFormData('datetime')) {
$datetime = new Horde_Date($datetime);
$month = $datetime->month;
$year = $datetime->year;
} else {
- $month = (int)Util::getFormData('month', date('n'));
- $year = (int)Util::getFormData('year', date('Y'));
+ $month = (int)Horde_Util::getFormData('month', date('n'));
+ $year = (int)Horde_Util::getFormData('year', date('Y'));
}
$dateFormat = $prefs->getValue('date_format');
$share = &$GLOBALS['kronolith_shares']->getShare($event->getCalendar());
if (!is_a($share, 'PEAR_Error')) {
$iCal->setAttribute('X-WR-CALNAME',
- String::convertCharset($share->get('name'),
+ Horde_String::convertCharset($share->get('name'),
NLS::getCharset(),
'utf-8'));
}
$html .= '<td class="' . $style . '" height="70" width="14%" valign="top"><div>';
- $url = Util::addParameter(Horde::applicationUrl('day.php'),
+ $url = Horde_Util::addParameter(Horde::applicationUrl('day.php'),
'date', $date->dateString());
$html .= '<a class="day" href="' . $url . '">' . $date->mday . '</a>';
if ($addLinks) {
- $url = Util::addParameter(Horde::applicationUrl('new.php'),
+ $url = Horde_Util::addParameter(Horde::applicationUrl('new.php'),
array('date' => $date->dateString(),
'url' => $this->link(0, true)));
if ($sidebyside) {
- $url = Util::addParameter($url, 'calendar', $id);
+ $url = Horde_Util::addParameter($url, 'calendar', $id);
}
$html .= Horde::link($url, _("Create a New Event"), 'newEvent') .
Horde::img('new_small.png', '+') . '</a>';
}
if ($date->dayOfWeek() == Horde_Date::DATE_MONDAY) {
- $url = Util::addParameter('week.php', 'date', $date->dateString());
+ $url = Horde_Util::addParameter('week.php', 'date', $date->dateString());
$html .= Horde::link(Horde::applicationUrl($url), '', 'week') . sprintf(_("Week %d"), $week) . '</a>';
}
function link($offset = 0, $full = false)
{
$month = $this->getMonth($offset);
- return Horde::applicationUrl(Util::addParameter('month.php', 'date', $month->dateString()), $full);
+ return Horde::applicationUrl(Horde_Util::addParameter('month.php', 'date', $month->dateString()), $full);
}
function getName()
function link($offset = 0, $full = false)
{
$week = $this->getWeek($offset);
- return Horde::applicationUrl(Util::addParameter($this->_controller,
+ return Horde::applicationUrl(Horde_Util::addParameter($this->_controller,
'date',
$week->dateString()),
$full);
// Heading for each month.
$date = new Horde_Date(sprintf('%04d%02d01010101', $this->year, $month));
$mtitle = $date->strftime('%B');
- $url = Util::addParameter(Horde::applicationUrl('month.php'), array('date' => $date->dateString()));
+ $url = Horde_Util::addParameter(Horde::applicationUrl('month.php'), array('date' => $date->dateString()));
$html .= '<h2 class="smallheader"><a class="smallheader" href="' . $url . '">' . $mtitle . '</a></h2>' .
'<table class="nopadding monthgrid" cellspacing="0" width="100%"><thead><tr class="item">';
if (!$prefs->getValue('week_start_monday')) {
/* Set up the link to the day view. */
$url = Horde::applicationUrl('day.php', true);
- $url = Util::addParameter($url, 'date', $date->dateString());
+ $url = Horde_Util::addParameter($url, 'date', $date->dateString());
if ($date->month != $month) {
$cellday = ' ';
function link($offset = 0, $full = false)
{
- return Horde::applicationUrl(Util::addParameter('year.php', 'date', $this->year + $offset) . '0101', $full);
+ return Horde::applicationUrl(Horde_Util::addParameter('year.php', 'date', $this->year + $offset) . '0101', $full);
}
function getName()
$share = &$kronolith_shares->getShare($event->getCalendar());
$iCal = new Horde_iCalendar($version);
- $iCal->setAttribute('X-WR-CALNAME', String::convertCharset($share->get('name'), NLS::getCharset(), 'utf-8'));
+ $iCal->setAttribute('X-WR-CALNAME', Horde_String::convertCharset($share->get('name'), 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', String::convertCharset($share->get('name'), NLS::getCharset(), 'utf-8'));
+ $iCal->setAttribute('X-WR-CALNAME', Horde_String::convertCharset($share->get('name'), NLS::getCharset(), 'utf-8'));
foreach ($events as $dayevents) {
foreach ($dayevents as $event) {
$found = false;
$error = _("No attendees have been updated because none of the provided email addresses have been found in the event's attendees list.");
- $sender_lcase = String::lower($sender);
+ $sender_lcase = Horde_String::lower($sender);
foreach ($atnames as $index => $attendee) {
- $attendee = str_replace('mailto:', '', String::lower($attendee));
+ $attendee = str_replace('mailto:', '', Horde_String::lower($attendee));
$name = isset($atparms[$index]['CN']) ? $atparms[$index]['CN'] : null;
if ($event->hasAttendee($attendee)) {
if (is_null($sender) || $sender_lcase == $attendee) {
Horde_Autoloader::addClassPattern('/^Kronolith_/', $kronolith_dir);
/* Registry. */
-$session_control = Util::nonInputVar('session_control');
+$session_control = Horde_Util::nonInputVar('session_control');
if ($session_control == 'none') {
$registry = &Registry::singleton(Registry::SESSION_NONE);
} elseif ($session_control == 'readonly') {
$maint->runMaintenance();
}
Kronolith::loginTasksFlag(0);
-} elseif (Util::getFormData(MAINTENANCE_DONE_PARAM) &&
+} elseif (Horde_Util::getFormData(MAINTENANCE_DONE_PARAM) &&
Kronolith::loginTasksFlag()) {
$maint = Maintenance::factory('kronolith', array('last_maintenance' => $GLOBALS['prefs']->getValue('last_kronolith_maintenance')));
if (!$maint) {
{
global $prefs;
- $calName = Util::getFormData('remote_name');
- $calUrl = trim(Util::getFormData('remote_url'));
- $calUser = trim(Util::getFormData('remote_user'));
- $calPasswd = trim(Util::getFormData('remote_password'));
+ $calName = Horde_Util::getFormData('remote_name');
+ $calUrl = trim(Horde_Util::getFormData('remote_url'));
+ $calUser = trim(Horde_Util::getFormData('remote_user'));
+ $calPasswd = trim(Horde_Util::getFormData('remote_password'));
$key = Auth::getCredential('password');
if ($key) {
$calPasswd = base64_encode(Secret::write($key, $calPasswd));
}
- $calActionID = Util::getFormData('remote_action', 'add');
+ $calActionID = Horde_Util::getFormData('remote_action', 'add');
if ($calActionID == 'add') {
if (!empty($calName) && !empty($calUrl)) {
function handle_shareselect($updated)
{
- $default_share = Util::getFormData('default_share');
+ $default_share = Horde_Util::getFormData('default_share');
if (!is_null($default_share)) {
$sharelist = Kronolith::listCalendars();
if ((is_array($sharelist)) > 0 && isset($sharelist[$default_share])) {
function handle_holiday_drivers($updated)
{
- $holiday_driversSelected = Util::getFormData('holiday_drivers');
+ $holiday_driversSelected = Horde_Util::getFormData('holiday_drivers');
$holiday_driversFiltered = array();
if (is_array($holiday_driversSelected)) {
{
global $prefs;
- $search_sources = Util::getFormData('search_sources');
+ $search_sources = Horde_Util::getFormData('search_sources');
if ($search_sources !== null) {
$prefs->setValue('search_sources', $search_sources);
$updated = true;
}
- $search_fields_string = Util::getFormData('search_fields_string');
+ $search_fields_string = Horde_Util::getFormData('search_fields_string');
if ($search_fields_string !== null) {
$prefs->setValue('search_fields', $search_fields_string);
$updated = true;
function handle_fb_cals_select($updated)
{
- $fb_calsSelected = Util::getFormData('fb_cals');
+ $fb_calsSelected = Horde_Util::getFormData('fb_cals');
$fb_cals = Kronolith::listCalendars();
$fb_calsFiltered = array();
function handle_default_alarm_management($updated)
{
$GLOBALS['prefs']->setValue('default_alarm',
- (int)Util::getFormData('alarm_value') * (int)Util::getFormData('alarm_unit'));
+ (int)Horde_Util::getFormData('alarm_value') * (int)Horde_Util::getFormData('alarm_unit'));
return true;
}
require 'Date/Calc.php';
require 'Horde/Date.php';
-require 'Horde/Util.php';
require 'Horde/iCalendar.php';
$iCal = new Horde_iCalendar();
require 'Date/Calc.php';
require 'Horde/Date.php';
require 'Horde/Date/Recurrence.php';
-require 'Horde/Util.php';
require 'Horde/iCalendar.php';
$iCal = new Horde_iCalendar();
$view = Kronolith::getView('Month');
$title = $view->date->strftime('%B %Y');
-$print_view = (bool)Util::getFormData('print');
+$print_view = (bool)Horde_Util::getFormData('print');
Horde::addScriptFile('tooltip.js', 'horde', true);
if (!$print_view) {
$message = Horde::callHook('_perms_hook_denied', array('kronolith:max_events'), 'horde', $message);
}
$notification->push($message, 'horde.error', array('content.raw'));
- $url = Util::addParameter($prefs->getValue('defaultview') . '.php', array('month' => Util::getFormData('month'),
- 'year' => Util::getFormData('year')));
+ $url = Horde_Util::addParameter($prefs->getValue('defaultview') . '.php', array('month' => Horde_Util::getFormData('month'),
+ 'year' => Horde_Util::getFormData('year')));
header('Location: ' . Horde::applicationUrl($url, true));
exit;
}
-$calendar_id = Util::getFormData('calendar', Kronolith::getDefaultCalendar(PERMS_EDIT));
+$calendar_id = Horde_Util::getFormData('calendar', Kronolith::getDefaultCalendar(PERMS_EDIT));
if (!$calendar_id) {
- $url = Util::addParameter($prefs->getValue('defaultview') . '.php', array('month' => Util::getFormData('month'),
- 'year' => Util::getFormData('year')));
+ $url = Horde_Util::addParameter($prefs->getValue('defaultview') . '.php', array('month' => Horde_Util::getFormData('month'),
+ 'year' => Horde_Util::getFormData('year')));
header('Location: ' . Horde::applicationUrl($url, true));
}
$event = Kronolith::getDriver()->getEvent();
$_SESSION['kronolith']['attendees'] = $event->getAttendees();
-$date = Util::getFormData('datetime');
+$date = Horde_Util::getFormData('datetime');
if (!$date) {
- $date = Util::getFormData('date', date('Ymd')) . '000600';
+ $date = Horde_Util::getFormData('date', date('Ymd')) . '000600';
if ($prefs->getValue('twentyFour')) {
$event->start->hour = 12;
}
}
$event->start = new Horde_Date($date);
$event->end = new Horde_Date($event->start);
-if (Util::getFormData('allday')) {
+if (Horde_Util::getFormData('allday')) {
$event->end->mday++;
} else {
// Default to a 1 hour duration.
$year = $event->start->year;
$buttons = array('<input type="submit" class="button" name="save" value="' . _("Save Event") . '" />');
-$url = Util::getFormData('url');
+$url = Horde_Util::getFormData('url');
if (isset($url)) {
$cancelurl = $url;
} else {
- $cancelurl = Util::addParameter('month.php', array('month' => $month,
+ $cancelurl = Horde_Util::addParameter('month.php', array('month' => $month,
'year' => $year));
$cancelurl = Horde::applicationUrl($cancelurl, true);
}
$auth = &Auth::singleton($conf['auth']['driver']);
$reload = false;
-$actionID = Util::getFormData('actionID', 'edit');
+$actionID = Horde_Util::getFormData('actionID', 'edit');
switch ($actionID) {
case 'edit':
- $share = &$shares->getShareById(Util::getFormData('cid'));
+ $share = &$shares->getShareById(Horde_Util::getFormData('cid'));
if (!is_a($share, 'PEAR_Error')) {
$perm = &$share->getPermission();
- } elseif (($category = Util::getFormData('share')) !== null) {
+ } elseif (($category = Horde_Util::getFormData('share')) !== null) {
$share = &$shares->getShare($category);
if (!is_a($share, 'PEAR_Error')) {
$perm = &$share->getPermission();
break;
case 'editform':
- $share = &$shares->getShareById(Util::getFormData('cid'));
+ $share = &$shares->getShareById(Horde_Util::getFormData('cid'));
if (is_a($share, 'PEAR_Error')) {
$notification->push(_("Attempt to edit a non-existent share."), 'horde.error');
} else {
// Process owner and owner permissions.
$old_owner = $share->get('owner');
- $new_owner = Auth::addHook(Util::getFormData('owner', $old_owner));
+ $new_owner = Auth::addHook(Horde_Util::getFormData('owner', $old_owner));
if ($old_owner !== $new_owner && !empty($new_owner)) {
if ($old_owner != Auth::getAuth() && !Auth::isAdmin()) {
$notification->push(_("Only the owner or system administrator may change ownership or owner permissions for a share"), 'horde.error');
}
// Process default permissions.
- if (Util::getFormData('default_show')) {
+ if (Horde_Util::getFormData('default_show')) {
$perm->addDefaultPermission(PERMS_SHOW, false);
} else {
$perm->removeDefaultPermission(PERMS_SHOW, false);
}
- if (Util::getFormData('default_read')) {
+ if (Horde_Util::getFormData('default_read')) {
$perm->addDefaultPermission(PERMS_READ, false);
} else {
$perm->removeDefaultPermission(PERMS_READ, false);
}
- if (Util::getFormData('default_edit')) {
+ if (Horde_Util::getFormData('default_edit')) {
$perm->addDefaultPermission(PERMS_EDIT, false);
} else {
$perm->removeDefaultPermission(PERMS_EDIT, false);
}
- if (Util::getFormData('default_delete')) {
+ if (Horde_Util::getFormData('default_delete')) {
$perm->addDefaultPermission(PERMS_DELETE, false);
} else {
$perm->removeDefaultPermission(PERMS_DELETE, false);
}
- if (Util::getFormData('default_delegate')) {
+ if (Horde_Util::getFormData('default_delegate')) {
$perm->addDefaultPermission(PERMS_DELEGATE, false);
} else {
$perm->removeDefaultPermission(PERMS_DELEGATE, false);
}
// Process guest permissions.
- if (Util::getFormData('guest_show')) {
+ if (Horde_Util::getFormData('guest_show')) {
$perm->addGuestPermission(PERMS_SHOW, false);
} else {
$perm->removeGuestPermission(PERMS_SHOW, false);
}
- if (Util::getFormData('guest_read')) {
+ if (Horde_Util::getFormData('guest_read')) {
$perm->addGuestPermission(PERMS_READ, false);
} else {
$perm->removeGuestPermission(PERMS_READ, false);
}
- if (Util::getFormData('guest_edit')) {
+ if (Horde_Util::getFormData('guest_edit')) {
$perm->addGuestPermission(PERMS_EDIT, false);
} else {
$perm->removeGuestPermission(PERMS_EDIT, false);
}
- if (Util::getFormData('guest_delete')) {
+ if (Horde_Util::getFormData('guest_delete')) {
$perm->addGuestPermission(PERMS_DELETE, false);
} else {
$perm->removeGuestPermission(PERMS_DELETE, false);
}
- if (Util::getFormData('guest_delegate')) {
+ if (Horde_Util::getFormData('guest_delegate')) {
$perm->addGuestPermission(PERMS_DELEGATE, false);
} else {
$perm->removeGuestPermission(PERMS_DELEGATE, false);
}
// Process creator permissions.
- if (Util::getFormData('creator_show')) {
+ if (Horde_Util::getFormData('creator_show')) {
$perm->addCreatorPermission(PERMS_SHOW, false);
} else {
$perm->removeCreatorPermission(PERMS_SHOW, false);
}
- if (Util::getFormData('creator_read')) {
+ if (Horde_Util::getFormData('creator_read')) {
$perm->addCreatorPermission(PERMS_READ, false);
} else {
$perm->removeCreatorPermission(PERMS_READ, false);
}
- if (Util::getFormData('creator_edit')) {
+ if (Horde_Util::getFormData('creator_edit')) {
$perm->addCreatorPermission(PERMS_EDIT, false);
} else {
$perm->removeCreatorPermission(PERMS_EDIT, false);
}
- if (Util::getFormData('creator_delete')) {
+ if (Horde_Util::getFormData('creator_delete')) {
$perm->addCreatorPermission(PERMS_DELETE, false);
} else {
$perm->removeCreatorPermission(PERMS_DELETE, false);
}
- if (Util::getFormData('creator_delegate')) {
+ if (Horde_Util::getFormData('creator_delegate')) {
$perm->addCreatorPermission(PERMS_DELEGATE, false);
} else {
$perm->removeCreatorPermission(PERMS_DELEGATE, false);
}
// Process user permissions.
- $u_names = Util::getFormData('u_names');
- $u_show = Util::getFormData('u_show');
- $u_read = Util::getFormData('u_read');
- $u_edit = Util::getFormData('u_edit');
- $u_delete = Util::getFormData('u_delete');
- $u_delegate = Util::getFormData('u_delegate');
+ $u_names = Horde_Util::getFormData('u_names');
+ $u_show = Horde_Util::getFormData('u_show');
+ $u_read = Horde_Util::getFormData('u_read');
+ $u_edit = Horde_Util::getFormData('u_edit');
+ $u_delete = Horde_Util::getFormData('u_delete');
+ $u_delegate = Horde_Util::getFormData('u_delegate');
foreach ($u_names as $key => $user) {
// Apply backend hooks
}
// Process group permissions.
- $g_names = Util::getFormData('g_names');
- $g_show = Util::getFormData('g_show');
- $g_read = Util::getFormData('g_read');
- $g_edit = Util::getFormData('g_edit');
- $g_delete = Util::getFormData('g_delete');
- $g_delegate = Util::getFormData('g_delegate');
+ $g_names = Horde_Util::getFormData('g_names');
+ $g_show = Horde_Util::getFormData('g_show');
+ $g_read = Horde_Util::getFormData('g_read');
+ $g_edit = Horde_Util::getFormData('g_edit');
+ $g_delete = Horde_Util::getFormData('g_delete');
+ $g_delegate = Horde_Util::getFormData('g_delegate');
foreach ($g_names as $key => $group) {
if (empty($group)) {
if (is_a($result, 'PEAR_Error')) {
$notification->push($result, 'horde.error');
} else {
- if (Util::getFormData('save_and_finish')) {
- Util::closeWindowJS();
+ if (Horde_Util::getFormData('save_and_finish')) {
+ Horde_Util::closeWindowJS();
exit;
}
$notification->push(sprintf(_("Updated \"%s\"."), $share->get('name')), 'horde.success');
$registry = &Registry::singleton();
/* Which application. */
-$app = Util::getFormData('app');
+$app = Horde_Util::getFormData('app');
if (!$app) {
echo '<ul id="app">';
foreach ($registry->listApps() as $app) {
require_once $appbase . '/lib/base.php';
/* Which preference. */
-$pref = Util::getFormData('pref');
+$pref = Horde_Util::getFormData('pref');
if (!$pref) {
$_prefs = array();
if (is_callable(array('Horde', 'loadConfiguration'))) {
}
/* Which action. */
-if (Util::getPost('pref') == $pref) {
+if (Horde_Util::getPost('pref') == $pref) {
/* POST for saving a pref. */
- $prefs->setValue($pref, Util::getPost('value'));
+ $prefs->setValue($pref, Horde_Util::getPost('value'));
}
/* GET returns the current value, POST returns the new value. */
__FILE__, __LINE__, PEAR_LOG_ERR);
return;
}
- $pad = max(String::length(_("All day")) + 2, $twentyFour ? 6 : 8);
+ $pad = max(Horde_String::length(_("All day")) + 2, $twentyFour ? 6 : 8);
$message = sprintf(_("Your daily agenda for %s"),
strftime($dateFormat, $runtime))
require_once dirname(__FILE__) . '/lib/base.php';
/* Get search parameters. */
-$search_mode = Util::getFormData('search_mode', 'basic');
-$search_calendar = explode('|', Util::getFormData('calendar', '|__any'), 2);
+$search_mode = Horde_Util::getFormData('search_mode', 'basic');
+$search_calendar = explode('|', Horde_Util::getFormData('calendar', '|__any'), 2);
$events = null;
if ($search_mode == 'basic') {
- $desc = Util::getFormData('pattern_desc');
- $title = Util::getFormData('pattern_title');
+ $desc = Horde_Util::getFormData('pattern_desc');
+ $title = Horde_Util::getFormData('pattern_title');
if (strlen($desc) || strlen($title)) {
$event = Kronolith::getDriver()->getEvent();
$event->setDescription($desc);
$event->status = null;
$time1 = $_SERVER['REQUEST_TIME'];
- $range = Util::getFormData('range');
+ $range = Horde_Util::getFormData('range');
if ($range == '+') {
$event->start = new Horde_Date($time1);
$event->end = null;
* a default end date. */
$event->initialized = true;
- $q_title = Util::getFormData('title');
+ $q_title = Horde_Util::getFormData('title');
if (strlen($q_title)) {
$event->readForm();
- if (Util::getFormData('status') == Kronolith::STATUS_NONE) {
+ if (Horde_Util::getFormData('status') == Kronolith::STATUS_NONE) {
$event->status = null;
}
</script>
<form method="post" action="attendees.php" name="attendeesForm">
-<?php Util::pformInput() ?>
+<?php Horde_Util::pformInput() ?>
<input type="hidden" name="actionID" value="add" />
<input type="hidden" name="actionValue" value="" />
<input type="hidden" name="view" value="<?php echo htmlspecialchars($view) ?>" />
<div id="calendar-list-buttons">
<?php if (!$prefs->isLocked('default_share')): ?>
<form method="get" action="create.php">
- <?php echo Util::formInput() ?>
+ <?php echo Horde_Util::formInput() ?>
<input type="submit" class="button" value="<?php echo _("Create a new Local Calendar") ?>" />
</form>
<?php endif; ?>
<form method="get" action="remote_subscribe.php">
- <?php echo Util::formInput() ?>
+ <?php echo Horde_Util::formInput() ?>
<input type="submit" class="button" value="<?php echo _("Subscribe to a Remote Calendar") ?>" />
</form>
</div>
<?php $calendar = $calendars[$calendar_id]; if (is_array($calendar)): ?>
<td><?php echo htmlspecialchars($calendar['name']) ?></td>
<td><?php echo _("Remote") ?></td>
- <td><?php $url = Util::addParameter($display_url_base, 'display_cal', 'remote_' . $calendar['url'], false) ?><a href="<?php echo htmlspecialchars($url) ?>" title="<?php echo _("Click or copy this URL to display this calendar") ?>" target="_blank"><?php echo htmlspecialchars(shorten_url($url)) ?></a></td>
+ <td><?php $url = Horde_Util::addParameter($display_url_base, 'display_cal', 'remote_' . $calendar['url'], false) ?><a href="<?php echo htmlspecialchars($url) ?>" title="<?php echo _("Click or copy this URL to display this calendar") ?>" target="_blank"><?php echo htmlspecialchars(shorten_url($url)) ?></a></td>
<td><a href="<?php echo htmlspecialchars($calendar['url']) ?>" title="<?php echo _("Click or copy this URL to display this calendar") ?>" target="_blank"><?php echo htmlspecialchars(shorten_url($calendar['url'])) ?></a></td>
- <td><a href="<?php echo Util::addParameter($remote_edit_url_base, 'url', $calendar['url']) ?>" title="<?php echo _("Edit") ?>"><?php echo $edit_img ?></a></td>
+ <td><a href="<?php echo Horde_Util::addParameter($remote_edit_url_base, 'url', $calendar['url']) ?>" title="<?php echo _("Edit") ?>"><?php echo $edit_img ?></a></td>
<?php if (empty($conf['share']['no_sharing'])): ?>
<td> </td>
<?php endif; ?>
- <td><a href="<?php echo Util::addParameter($remote_unsubscribe_url_base, 'url', $calendar['url']) ?>" title="<?php echo _("Unsubscribe") ?>"><?php echo $delete_img ?></a></td>
+ <td><a href="<?php echo Horde_Util::addParameter($remote_unsubscribe_url_base, 'url', $calendar['url']) ?>" title="<?php echo _("Unsubscribe") ?>"><?php echo $delete_img ?></a></td>
<?php else: ?>
<td><?php echo htmlspecialchars($calendar->get('name')) ?></td>
<td><?php echo _("Local") ?></td>
- <td><?php $url = Util::addParameter($display_url_base, 'display_cal', $calendar->getName(), false) ?><a href="<?php echo htmlspecialchars($url) ?>" title="<?php echo _("Click or copy this URL to display this calendar") ?>" target="_blank"><?php echo htmlspecialchars(shorten_url($url)) ?></a></td>
- <td><?php $url = $webdav ? $subscribe_url_base . $calendar->get('owner') . '/' . $calendar->getName() . '.ics' : Util::addParameter($subscribe_url_base, 'c', $calendar->getName(), false) ?><a href="<?php echo htmlspecialchars($url) ?>" title="<?php echo _("Click or copy this URL to display this calendar") ?>" target="_blank"><?php echo htmlspecialchars(shorten_url($url)) ?></a></td>
- <td><a href="<?php echo Util::addParameter($edit_url_base, 'c', $calendar->getName()) ?>" title="<?php echo _("Edit") ?>"><?php echo $edit_img ?></a></td>
+ <td><?php $url = Horde_Util::addParameter($display_url_base, 'display_cal', $calendar->getName(), false) ?><a href="<?php echo htmlspecialchars($url) ?>" title="<?php echo _("Click or copy this URL to display this calendar") ?>" target="_blank"><?php echo htmlspecialchars(shorten_url($url)) ?></a></td>
+ <td><?php $url = $webdav ? $subscribe_url_base . $calendar->get('owner') . '/' . $calendar->getName() . '.ics' : Horde_Util::addParameter($subscribe_url_base, 'c', $calendar->getName(), false) ?><a href="<?php echo htmlspecialchars($url) ?>" title="<?php echo _("Click or copy this URL to display this calendar") ?>" target="_blank"><?php echo htmlspecialchars(shorten_url($url)) ?></a></td>
+ <td><a href="<?php echo Horde_Util::addParameter($edit_url_base, 'c', $calendar->getName()) ?>" title="<?php echo _("Edit") ?>"><?php echo $edit_img ?></a></td>
<?php if (empty($conf['share']['no_sharing'])): ?>
- <td><a onclick="return !popup(this.href);" href="<?php echo Util::addParameter($perms_url_base, 'share', $calendar->getName()) ?>" target="_blank" title="<?php echo _("Change Permissions") ?>"><?php echo $perms_img ?></a></td>
+ <td><a onclick="return !popup(this.href);" href="<?php echo Horde_Util::addParameter($perms_url_base, 'share', $calendar->getName()) ?>" target="_blank" title="<?php echo _("Change Permissions") ?>"><?php echo $perms_img ?></a></td>
<?php endif; ?>
- <td><a href="<?php echo Util::addParameter($delete_url_base, 'c', $calendar->getName()) ?>" title="<?php echo _("Delete") ?>"><?php echo $delete_img ?></a></td>
+ <td><a href="<?php echo Horde_Util::addParameter($delete_url_base, 'c', $calendar->getName()) ?>" title="<?php echo _("Delete") ?>"><?php echo $delete_img ?></a></td>
<?php endif; ?>
</tr>
<?php endforeach; ?>
Horde::includeScriptFiles();
require KRONOLITH_TEMPLATES . '/javascript_defs.php';
-$bc = Util::nonInputVar('bodyClass');
+$bc = Horde_Util::nonInputVar('bodyClass');
if (isset($view) && is_object($view) && $prefs->getValue('show_panel')) {
if ($bc) {
$bc .= ' ';
<?php Kronolith::outputInlineScript(); ?>
</head>
-<body<?php if ($bc) echo ' class="' . $bc . '"'; if ($bi = Util::nonInputVar('bodyId')) echo ' id="' . $bi . '"'; ?>>
+<body<?php if ($bc) echo ' class="' . $bc . '"'; if ($bi = Horde_Util::nonInputVar('bodyId')) echo ' id="' . $bi . '"'; ?>>
</script>
<form method="post" name="contacts" onsubmit="passAddresses();" action="contacts.php?nocache=<?php echo hash('md5', mt_rand()) ?>">
<input type="hidden" name="sa" />
-<?php Util::pformInput() ?>
+<?php Horde_Util::pformInput() ?>
<div class="header"><?php echo _("Address Book") ?></div>
<form method="post" name="export" action="<?php echo Horde::downloadUrl(_("events.csv"), null, 'data.php') ?>">
-<?php Util::pformInput() ?>
+<?php Horde_Util::pformInput() ?>
<input type="hidden" name="actionID" value="export" />
<br class="spacer" />
<form method="post" name="import_form" enctype="multipart/form-data" action="data.php">
-<?php Util::pformInput() ?>
+<?php Horde_Util::pformInput() ?>
<input type="hidden" name="actionID" value="<?php echo htmlspecialchars($next_step) ?>" />
<input type="hidden" name="import_step" value="<?php echo (int)$import_step ?>" />
<?php
if (empty($url)) {
- $url = Util::addParameter('month.php', array('month' => $month,
+ $url = Horde_Util::addParameter('month.php', array('month' => $month,
'year' => $year));
$url = Horde::applicationUrl($url, true);
}
?>
<form action="delete.php" method="post" id="deleteform" name="delete">
-<?php echo Util::formInput() ?>
+<?php echo Horde_Util::formInput() ?>
<input type="hidden" name="year" value="<?php if (isset($year)) echo htmlspecialchars($year) ?>" />
<input type="hidden" name="month" value="<?php if (isset($month)) echo htmlspecialchars($month) ?>" />
<input type="hidden" name="mday" value="<?php if (isset($day)) echo htmlspecialchars($day) ?>" />
<?php
if (empty($url)) {
- $url = Util::addParameter('month.php', array('month' => $month,
+ $url = Horde_Util::addParameter('month.php', array('month' => $month,
'year' => $year));
$url = Horde::applicationUrl($url, true);
}
?>
<form action="delete.php" method="post" name="delete">
-<?php echo Util::formInput() ?>
+<?php echo Horde_Util::formInput() ?>
<input type="hidden" name="year" value="<?php if (isset($year)) echo htmlspecialchars($year) ?>" />
<input type="hidden" name="month" value="<?php if (isset($month)) echo htmlspecialchars($month) ?>" />
<input type="hidden" name="mday" value="<?php if (isset($day)) echo htmlspecialchars($day) ?>" />
<input type="hidden" name="url" value="<?php echo htmlspecialchars($url) ?>" />
<input type="hidden" name="eventID" value="<?php echo htmlspecialchars($this->event->getId()) ?>" />
-<input type="hidden" name="calendar" value="<?php echo htmlspecialchars(Util::getFormData('calendar')) ?>" />
+<input type="hidden" name="calendar" value="<?php echo htmlspecialchars(Horde_Util::getFormData('calendar')) ?>" />
<div class="headerbox">
<?php if (!empty($this->event->attendees)): ?>
<?php $showCalSelect = (!$GLOBALS['prefs']->isLocked('default_share') && count($calendars) > 1); ?>
<form action="<?php echo ($event->isInitialized() && !$event->isRemote() ? 'edit.php' : 'add.php') ?>" method="post" name="eventform" id="eventform">
-<?php Util::pformInput() ?>
+<?php Horde_Util::pformInput() ?>
<input type="hidden" name="year" value="<?php if (isset($year)) echo htmlspecialchars($year) ?>" />
<input type="hidden" name="month" value="<?php if (isset($month)) echo htmlspecialchars($month) ?>" />
<input type="hidden" name="mday" value="<?php if (isset($day)) echo htmlspecialchars($day) ?>" />
<input type="radio" name="edit_recur" value="future" id="edit_future" onclick="KronolithEventForm.setStartDate($F('recur_ex'))" /> <?php echo Horde::label('edit_future', _("Future")) ?>
<input type="radio" name="edit_recur" value="all" id="edit_all" checked="checked" /> <?php echo Horde::label('edit_all', _("All")) ?>
<input type="radio" name="edit_recur" value="copy" id="edit_copy" /> <?php echo Horde::label('edit_copy', _("Save As New")) ?>
- <input type="hidden" name="recur_ex" id="recur_ex" value="<?php echo Util::getFormData('datetime') ?>" />
+ <input type="hidden" name="recur_ex" id="recur_ex" value="<?php echo Horde_Util::getFormData('datetime') ?>" />
</td>
</tr>
<?php endif; ?>
</form>
<script type="text/javascript">
document.eventform.title.focus();
-</script>
\ No newline at end of file
+</script>
<script type="text/javascript">
KronolithEventForm = new Object();
-<?php if (!Util::nonInputVar('issearch')): ?>
+<?php if (!Horde_Util::nonInputVar('issearch')): ?>
KronolithEventForm.setInterval = function(field)
{
elt = document.eventform[field];
day = $('end_day').value;
month = $('end_month').value - 1;
year = $('end_year').value;
-<?php if (!Util::nonInputVar('issearch')): ?>
+<?php if (!Horde_Util::nonInputVar('issearch')): ?>
} else if (span == 'recur_end_wday') {
spanObj = $('recur_end_wday');
day = $('recur_enddate_day').value;
$('su').checked = false;
}
-<?php if (Util::getFormData('allday') == 1): ?>
+<?php if (Horde_Util::getFormData('allday') == 1): ?>
Event.observe(window, 'load', function() {
$('allday').click;
});
<div id="pageControlsInner">
<form action="<?php echo Horde::selfUrl() ?>" method="post">
-<?php echo Util::formInput() ?>
+<?php echo Horde_Util::formInput() ?>
<h4><?php echo _("Search for Calendars:") ?></h4>
<p>
<input id="calendarSearch" type="text" for="mycalendars,sharedcalendars,remotecalendars,externalcalendars" />
<form name="edit" method="post" action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']) ?>">
-<?php Util::pformInput() ?>
+<?php Horde_Util::pformInput() ?>
<input type="hidden" name="actionID" value="editform" />
<input type="hidden" name="cid" value="<?php echo htmlspecialchars($share->getId()) ?>" />
<table width="100%" cellspacing="0">
<?php echo _("Copy this URL for use wherever you need your Free/Busy URL:") ?>
</div>
<p class="text">
- <?php echo Util::addParameter(Horde::applicationUrl('fb.php', true, -1), 'u', Auth::getAuth()) ?>
+ <?php echo Horde_Util::addParameter(Horde::applicationUrl('fb.php', true, -1), 'u', Auth::getAuth()) ?>
</p>
</div>
<form method="post" name="eventform" action="search.php">
-<?php Util::pformInput() ?>
+<?php Horde_Util::pformInput() ?>
<input type="hidden" name="actionID" value="search_calendar" />
<input type="hidden" name="search_mode" value="basic" />
<br /><br />
<h1 class="header">
<span class="smallheader rightFloat">
- <?php echo Horde::widget(Util::addParameter(Horde::applicationUrl('search.php'), 'search_mode', 'advanced'), _("Advanced Search"), 'smallheader', '', '', _("Ad_vanced Search")) ?>
+ <?php echo Horde::widget(Horde_Util::addParameter(Horde::applicationUrl('search.php'), 'search_mode', 'advanced'), _("Advanced Search"), 'smallheader', '', '', _("Ad_vanced Search")) ?>
</span>
<?php echo _("Basic Search") ?>
</h1>
<strong><?php echo Horde::label('pattern_title', _("Title")) ?></strong>
</td>
<td>
- <input name="pattern_title" id="pattern_title" type="text" value="<?php echo htmlspecialchars(Util::getFormData('pattern_title')) ?>" size="50" maxlength="100" />
+ <input name="pattern_title" id="pattern_title" type="text" value="<?php echo htmlspecialchars(Horde_Util::getFormData('pattern_title')) ?>" size="50" maxlength="100" />
</td>
</tr>
<tr>
<strong><?php echo Horde::label('pattern_desc', _("Descri_ption")) ?></strong>
</td>
<td>
- <input name="pattern_desc" id="pattern_desc" type="text" value="<?php echo htmlspecialchars(Util::getFormData('pattern_desc')) ?>" size="50" maxlength="100" />
+ <input name="pattern_desc" id="pattern_desc" type="text" value="<?php echo htmlspecialchars(Horde_Util::getFormData('pattern_desc')) ?>" size="50" maxlength="100" />
</td>
</tr>
<!-- range -->
function range_option_string($thisrange, $descr)
{
echo '<option ';
- if (Util::getFormData('range') == $thisrange) {
+ if (Horde_Util::getFormData('range') == $thisrange) {
echo "value=\"$thisrange\" selected=\"selected\"";
} else {
echo "value=\"$thisrange\"";
require KRONOLITH_TEMPLATES . '/edit/javascript.inc';
?>
<form method="post" name="eventform" action="search.php">
-<?php Util::pformInput() ?>
+<?php Horde_Util::pformInput() ?>
<input type="hidden" name="actionID" value="search_calendar" />
<input type="hidden" name="search_mode" value="advanced" />
<br /><br />
<h1 class="header">
<span class="smallheader rightFloat">
- <?php echo Horde::widget(Util::addParameter(Horde::applicationUrl('search.php'), 'search_mode', 'basic'), _("Basic Search"), 'smallheader', '', '', _("_Basic Search")) ?>
+ <?php echo Horde::widget(Horde_Util::addParameter(Horde::applicationUrl('search.php'), 'search_mode', 'basic'), _("Basic Search"), 'smallheader', '', '', _("_Basic Search")) ?>
</span>
<?php echo _("Advanced Search") ?>
</h1>
(!empty($conf['hooks']['permsdenied']) ||
Kronolith::hasPermission('max_events') === true ||
Kronolith::hasPermission('max_events') > Kronolith::countEvents())) {
- $addurl = Util::addParameter('new.php',
+ $addurl = Horde_Util::addParameter('new.php',
array('date' => $day->dateString(),
'url' => $this->link(0, true)));
echo Horde::link(Horde::applicationUrl($addurl), _("Create a New Event"), 'iconAdd')
require_once dirname(__FILE__) . '/lib/base.load.php';
include_once HORDE_BASE . '/lib/core.php';
-/* We should have loaded the String class, from the Horde_Util package, in
- * core.php. If String:: isn't defined, then we're not finding some critical
+/* We should have loaded the Horde_String class, from the Horde_Util package, in
+ * core.php. If Horde_String:: isn't defined, then we're not finding some critical
* libraries. */
-if (!class_exists('String')) {
+if (!class_exists('Horde_String')) {
echo '<br /><h2 style="color:red">The Horde_Util package was not found. If PHP\'s error_reporting setting is high enough and display_errors is on, there should be error messages printed above that may help you in debugging the problem. If you are simply missing these files, then you need to get the <a href="http://cvs.horde.org/cvs.php/framework">framework</a> module from <a href="http://www.horde.org/source/">Horde CVS</a>, and install the packages in it with the install-packages.php script.</h2>';
exit;
}
require_once dirname(__FILE__) . '/lib/base.php';
-$view = Kronolith::getView(Util::getFormData('view'));
+$view = Kronolith::getView(Horde_Util::getFormData('view'));
if ($view) {
$print_view = false;
- Kronolith::tabs(strtolower(str_replace('kronolith_view_', '', String::lower(get_class($view)))));
+ Kronolith::tabs(strtolower(str_replace('kronolith_view_', '', Horde_String::lower(get_class($view)))));
$view->html();
- echo '<div style="display:none" id="view_vars" view="' . htmlspecialchars(Util::getFormData('view')) . '" date="' . Kronolith::currentDate()->format(DATE_RFC2822) . '" print="' . Util::addParameter($view->link(), 'print', 1) . '">';
+ echo '<div style="display:none" id="view_vars" view="' . htmlspecialchars(Horde_Util::getFormData('view')) . '" date="' . Kronolith::currentDate()->format(DATE_RFC2822) . '" print="' . Horde_Util::addParameter($view->link(), 'print', 1) . '">';
}
$view = Kronolith::getView('Week');
$title = sprintf(_("Week %d"), $view->week);
-$print_view = (bool)Util::getFormData('print');
+$print_view = (bool)Horde_Util::getFormData('print');
Horde::addScriptFile('tooltip.js', 'horde', true);
if (!$print_view) {
$view = Kronolith::getView('WorkWeek');
$title = sprintf(_("Week %d"), $view->week);
-$print_view = (bool)Util::getFormData('print');
+$print_view = (bool)Horde_Util::getFormData('print');
Horde::addScriptFile('tooltip.js', 'horde', true);
if (!$print_view) {
$view = Kronolith::getView('Year');
$title = $view->year;
-$print_view = (bool)Util::getFormData('print');
+$print_view = (bool)Horde_Util::getFormData('print');
Horde::addScriptFile('tooltip.js', 'horde', true);
if (!$print_view) {
*/
require_once dirname(__FILE__) . '/lib/base.php';
-require_once 'Horde/Variables.php';
/**
* This routine removes all attributes from a given tag except
// Default vars
$title = _("Add news");
$default_lang = News::getLang();
-$id = Util::getFormData('id', false);
-$return = Util::getFormData('return', false);
+$id = Horde_Util::getFormData('id', false);
+$return = Horde_Util::getFormData('return', false);
// We just delete default image?
-if ($id && Util::getFormData('submitbutton') == _("Delete existing picture")) {
+if ($id && Horde_Util::getFormData('submitbutton') == _("Delete existing picture")) {
$result = $news->write_db->query('UPDATE ' . $news->prefix . ' SET picture = ? WHERE id = ?', array(0, $id));
if ($sources instanceof PEAR_Error) {
$notification->push($sources);
}
// Prepare form
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$form = new Horde_Form($vars, '', 'addnews');
$form->addHidden('', 'return', 'text', false, true);
// Do we have a gallery?
if (empty($info['gallery'])) {
- $abbr = String::substr(strip_tags($info['body'][$default_lang]['content']), 0, $conf['preview']['list_content']);
+ $abbr = Horde_String::substr(strip_tags($info['body'][$default_lang]['content']), 0, $conf['preview']['list_content']);
$result = $registry->call('images/createGallery',
array(null,
array('name' => $info['body'][$default_lang]['title'],
. '(id, lang, title, abbreviation, content, picture_comment, tags) VALUES (?, ?, ?, ?, ?, ?, ?)');
foreach ($info['body'] as $lang => $values) {
- $abbr = String::substr(strip_tags($values['content']), 0, $conf['preview']['list_content']);
+ $abbr = Horde_String::substr(strip_tags($values['content']), 0, $conf['preview']['list_content']);
$news->write_db->execute($query_body, array($id, $lang, $values['title'], $abbr, $values['content'], $values['caption'], $values['tags']));
}
$url = $return;
} elseif (in_array($info['category1'], $allowed_cats) ||
in_array($info['category2'], $allowed_cats)) {
- $url = Util::addParameter(Horde::applicationUrl('edit.php'), 'id', $id);
+ $url = Horde_Util::addParameter(Horde::applicationUrl('edit.php'), 'id', $id);
} else {
$url = Horde::applicationUrl('browse.php');
}
require_once NEWS_TEMPLATES . '/menu.inc';
require_once NEWS_TEMPLATES . '/add/before.inc';
-$form->renderActive(null, null, Util::addParameter(Horde::applicationUrl('add.php'), 'id', $id, false), 'post');
+$form->renderActive(null, null, Horde_Util::addParameter(Horde::applicationUrl('add.php'), 'id', $id, false), 'post');
require_once $registry->get('templates', 'horde') . '/common-footer.inc';
require_once NEWS_BASE . '/lib/base.php';
require NEWS_BASE . '/admin/tabs.php';
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$form = new Horde_Form($vars, _("Do you really wont to delete this category?"), 'delete');
$form->setButtons(array(_("Remove"), _("Cancel")));
-$category_id = Util::getFormData('category_id');
+$category_id = Horde_Util::getFormData('category_id');
$form->addHidden('', 'category_id', 'int', $category_id);
if ($form->validate()) {
- if (Util::getFormData('submitbutton') == _("Remove")) {
+ if (Horde_Util::getFormData('submitbutton') == _("Remove")) {
$news_cat->deleteCategory($category_id);
if ($result instanceof PEAR_Error) {
$notification->push(_("Category was not deleted.") . ' ' . $result->getMessage(), 'horde.error');
require_once NEWS_BASE . '/lib/base.php';
require NEWS_BASE . '/admin/tabs.php';
-$category_id = Util::getFormData('category_id');
+$category_id = Horde_Util::getFormData('category_id');
$title = !empty($category_id) ? _("Edit category") : _("Add category");
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$form = new Horde_Form($vars, $title, 'editcategory');
if ($category_id && !$form->isSubmitted()) {
$delete_img = Horde::img('delete.png', _("Delete"), '', $registry->getImageDir('horde'));
foreach ($categories as $category_id => $category) {
- $categories[$category_id]['actions'][] = Horde::link(Util::addParameter($delete_url, 'category_id', $category_id), _("Delete")) .
+ $categories[$category_id]['actions'][] = Horde::link(Horde_Util::addParameter($delete_url, 'category_id', $category_id), _("Delete")) .
$delete_img . '</a>';
- $categories[$category_id]['actions'][] = Horde::link(Util::addParameter($edit_url, 'category_id', $category_id), _("Edit")) .
+ $categories[$category_id]['actions'][] = Horde::link(Horde_Util::addParameter($edit_url, 'category_id', $category_id), _("Edit")) .
$edit_img . '</a>';
}
require_once NEWS_BASE . '/lib/base.php';
require '../tabs.php';
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$form = new Horde_Form($vars, _("Do you really wont to delete this source?"), 'delete');
$form->setButtons(array(_("Remove"), _("Cancel")));
-$source_id = Util::getFormData('source_id');
+$source_id = Horde_Util::getFormData('source_id');
$form->addHidden('', 'source_id', 'int', $source_id);
if ($form->validate()) {
- if (Util::getFormData('submitbutton') == _("Remove")) {
+ if (Horde_Util::getFormData('submitbutton') == _("Remove")) {
$news->deleteSource($source_id);
if ($result instanceof PEAR_Error) {
$notification->push(_("Source was not deleted.") . ' ' . $result->getMessage(), 'horde.error');
require_once NEWS_BASE . '/lib/base.php';
require '../tabs.php';
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$source_id = $vars->get('source_id');
$title = !empty($source_id) ? _("Edit Source") : _("Add Source");
$view_img = Horde::img('category.png', _("View items"), '', $registry->getImageDir('horde'));
foreach ($sources as $source_id => $source) {
- $sources[$source_id]['actions'][] = Horde::link(Util::addParameter($view_url, 'source_id', $source_id), _("View articles")) .
+ $sources[$source_id]['actions'][] = Horde::link(Horde_Util::addParameter($view_url, 'source_id', $source_id), _("View articles")) .
$view_img . '</a>';
- $sources[$source_id]['actions'][] = Horde::link(Util::addParameter($delete_url, 'source_id', $source_id), _("Delete")) .
+ $sources[$source_id]['actions'][] = Horde::link(Horde_Util::addParameter($delete_url, 'source_id', $source_id), _("Delete")) .
$delete_img . '</a>';
- $sources[$source_id]['actions'][] = Horde::link(Util::addParameter($edit_url, 'source_id', $source_id), _("Edit")) .
+ $sources[$source_id]['actions'][] = Horde::link(Horde_Util::addParameter($edit_url, 'source_id', $source_id), _("Edit")) .
$edit_img . '</a>';
}
Horde::authenticationFailureRedirect();
}
-require_once 'Horde/Variables.php';
-
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$tabs = new Horde_UI_Tabs('admin', $vars);
$tabs->addTab(_("Sources"), Horde::applicationUrl('admin/sources/index.php'), 'sources');
// Default vars
$title = _("Browse");
-$page = Util::getGet('news_page', 0);
+$page = Horde_Util::getGet('news_page', 0);
$per_page = $prefs->getValue('per_page');
$browse_url = Horde::applicationUrl('browse.php');
-$cid = Util::getGet('cid');
+$cid = Horde_Util::getGet('cid');
// Define creteria
if (!empty($_GET)) {
$criteria = $_GET;
- $browse_url = Util::addParameter($browse_url, $_GET);
+ $browse_url = Horde_Util::addParameter($browse_url, $_GET);
} else {
$criteria = array();
}
$layout = &Horde_Block_Layout_Manager::singleton('news_layout', $blocks, unserialize($prefs->getValue('news_layout')));
// Handle requested actions.
-$layout->handle(Util::getFormData('action'),
- (int)Util::getFormData('row'),
- (int)Util::getFormData('col'));
+$layout->handle(Horde_Util::getFormData('action'),
+ (int)Horde_Util::getFormData('row'),
+ (int)Horde_Util::getFormData('col'));
if ($layout->updated()) {
$prefs->setValue('news_layout', $layout->serialize());
}
*/
require_once dirname(__FILE__) . '/lib/base.php';
-require_once 'Horde/Variables.php';
if (!Auth::isAdmin('news:admin')) {
$notification->push(_("Only admin can delete a news."));
exit;
}
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$form = new Horde_Form($vars, _("Are you sure you want to delete this news?"), 'delete');
$form->setButtons(array(_("Remove"), _("Cancel")));
-$id = (int)Util::getFormData('id');
+$id = (int)Horde_Util::getFormData('id');
$form->addHidden('', 'id', 'int', $id);
$row = $news->get($id);
if ($form->validate()) {
- if (Util::getFormData('submitbutton') == _("Remove")) {
+ if (Horde_Util::getFormData('submitbutton') == _("Remove")) {
// Delete attachment
$sql = 'SELECT file_id FROM ' . $news->prefix . '_files WHERE news_id = ?';
*/
require_once dirname(__FILE__) . '/lib/base.php';
-require_once 'Horde/Variables.php';
if (!Auth::isAdmin('news:admin')) {
$notification->push(_("Only admin can delete a news."));
exit;
}
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$form = new Horde_Form($vars, _("Are you sure you want to delete file?"), 'delete');
$form->setButtons(array(_("Remove"), _("Cancel")));
-$news_id = (int)Util::getFormData('news_id');
+$news_id = (int)Horde_Util::getFormData('news_id');
$form->addHidden('', 'news_id', 'int', true);
-$news_lang = Util::getFormData('lang', News::getLang());
+$news_lang = Horde_Util::getFormData('lang', News::getLang());
$form->addHidden('', 'news_lang', 'text', false);
-$file_id = Util::getFormData('file_id');
+$file_id = Horde_Util::getFormData('file_id');
$form->addHidden('', 'file_id', 'text', true);
$article = $news->get($news_id);
if ($form->validate()) {
- if (Util::getFormData('submitbutton') == _("Remove")) {
+ if (Horde_Util::getFormData('submitbutton') == _("Remove")) {
$result = News::deleteFile($file_id);
if ($result instanceof PEAR_Error) {
$form->renderActive(null, null, null, 'post');
-require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
+require $registry->get('templates', 'horde') . '/common-footer.inc';
require_once dirname(__FILE__) . '/lib/base.php';
$title = _("Diff");
-$id = Util::getFormData('id', 0);
-$version = Util::getFormData('version', 0);
+$id = Horde_Util::getFormData('id', 0);
+$version = Horde_Util::getFormData('version', 0);
/* Set up the diff renderer. */
-$render_type = Util::getFormData('render', 'inline');
+$render_type = Horde_Util::getFormData('render', 'inline');
$class = 'Text_Diff_Renderer_' . $render_type;
$renderer = &new $class();
exit;
}
-$id = (int)Util::getFormData('id', 0);
-$page = (int)Util::getFormData('page', 0);
-$browse_url = Util::addParameter(Horde::applicationUrl('edit.php'), array('page' => $page, 'id' => $id), null, false);
+$id = (int)Horde_Util::getFormData('id', 0);
+$page = (int)Horde_Util::getFormData('page', 0);
+$browse_url = Horde_Util::addParameter(Horde::applicationUrl('edit.php'), array('page' => $page, 'id' => $id), null, false);
$edit_url = Horde::applicationUrl('add.php');
$read_url = Horde::applicationUrl('reads.php');
$has_comments = $registry->hasMethod('forums/doComments');
-$actionID = Util::getFormData('actionID');
+$actionID = Horde_Util::getFormData('actionID');
// save as future version
if (!empty($actionID) && $id > 0) {
break;
case 'renew';
- $version = Util::getFormData('version');
+ $version = Horde_Util::getFormData('version');
$version_data = $news->db->getRow('SELECT content FROM ' . $news->prefix . '_versions WHERE id = ? AND version = ?',
array($id, $version), DB_FETCHMODE_ASSOC);
}
$title = _("Edit");
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$form = new News_Search($vars);
$form->getInfo(null, $info);
}
// Select rows
-$page = Util::getGet('news_page', 0);
+$page = Horde_Util::getGet('news_page', 0);
$per_page = $prefs->getValue('per_page');
$sql = $news->db->modifyLimitQuery($sql, $page*$per_page, $per_page);
$rows = $news->db->getAll($sql, $binds[1], DB_FETCHMODE_ASSOC);
}
}
-$feed_id = Util::getPost('feed_id');
+$feed_id = Horde_Util::getPost('feed_id');
$stories = _getStories($feed_id);
$df = $GLOBALS['prefs']->getValue('date_format');
foreach ($stories as $story) {
$no_compress = true;
require_once dirname(__FILE__) . '/lib/base.php';
-$news_id = Util::getFormData('news_id', false);
-$actionID = Util::getFormData('actionID');
-$file_id = Util::getFormData('file_id');
-$file_name = Util::getFormData('file_name');
-$news_lang = Util::getFormData('news_lang', News::getLang());
-$file_type = Util::getFormData('file_type');
-$file_size = Util::getFormData('file_size');
+$news_id = Horde_Util::getFormData('news_id', false);
+$actionID = Horde_Util::getFormData('actionID');
+$file_id = Horde_Util::getFormData('file_id');
+$file_name = Horde_Util::getFormData('file_name');
+$news_lang = Horde_Util::getFormData('news_lang', News::getLang());
+$file_type = Horde_Util::getFormData('file_type');
+$file_size = Horde_Util::getFormData('file_size');
/* Run through action handlers. */
switch ($actionID) {
{
require_once dirname(__FILE__) . '/../base.php';
- $url = Util::addParameter(Horde::applicationUrl('browse.php'), 'category', $this->_params['category']);
+ $url = Horde_Util::addParameter(Horde::applicationUrl('browse.php'), 'category', $this->_params['category']);
$name = $GLOBALS['news_cat']->getName($this->_params['category']);
$html = Horde::link($url, sprintf(_("Last news in %s"), $name), 'header');
$html .= sprintf(_("Last news in %s"), $name) . '</a>';
$view = new News_View();
$view->news = $rows;
- $view->moreurl = Util::addParameter(Horde::applicationUrl('browse.php'), 'category', $this->_params['category']);
+ $view->moreurl = Horde_Util::addParameter(Horde::applicationUrl('browse.php'), 'category', $this->_params['category']);
return $view->render('/block/news.php');
}
-}
\ No newline at end of file
+}
$url = Horde::applicationUrl('browse.php');
foreach ($sources as $source_id => $source_name) {
$html .= '- '
- . Horde::link(Util::addparameter($url, 'source_id', $source_id), '', '', '_blank')
+ . Horde::link(Horde_Util::addparameter($url, 'source_id', $source_id), '', '', '_blank')
. $source_name . '</a><br />';
}
return $html;
}
-}
\ No newline at end of file
+}
foreach ($cats as $cid => $category) {
if ($click_url !== null) {
- $name = Horde::link(Util::addParameter($click_url, 'cid', $cid), _("Select Category")) . $category['category_name'] . '</a>';
+ $name = Horde::link(Horde_Util::addParameter($click_url, 'cid', $cid), _("Select Category")) . $category['category_name'] . '</a>';
} else {
$name = $category['category_name'];
}
$links = array();
if ($have_add_item) {
- $links[] = Horde::link(Util::addParameter($add_item, 'cid', $cid), _("Add New Item")) . $add_img . '</a>';
+ $links[] = Horde::link(Horde_Util::addParameter($add_item, 'cid', $cid), _("Add New Item")) . $add_img . '</a>';
}
$parent_id = $category['category_parentid'] ? $category['category_parentid'] : null;
's' => 'vfs',
'p' => self::VFS_PATH . '/images/categories/',
'c' => 'news');
- return Util::addParameter(Horde::url('/services/images/view.php'), $img_params);
+ return Horde_Util::addParameter(Horde::url('/services/images/view.php'), $img_params);
}
}
$tag_link = Horde::applicationUrl('search.php');
foreach ($tags_elemets as $tag => $time) {
sort($time);
- $tags->addElement($tag, Util::addParameter($tag_link, array('word' => $tag)),
+ $tags->addElement($tag, Horde_Util::addParameter($tag_link, array('word' => $tag)),
count($tags_elemets[$tag]), $time[0]);
}
<?php
-
-require_once 'Horde/Variables.php';
-
/**
* News search form
*
public function getPager($info, $count, $url)
{
$pager = new Horde_UI_Pager('news_page',
- Variables::getDefaultVariables(),
+ Horde_Variables::getDefaultVariables(),
array('num' => $count,
'url' => $url,
'page_count' => 10,
/**
* Fetch the field values of the submitted form.
*
- * @param Variables $vars A Variables instance, optional since Horde 3.2.
+ * @param Horde_Variables $vars A Horde_Variables instance, optional since Horde 3.2.
* @param array $info Array to be filled with the submitted field
* values.
*/
*
* @param array $variables An array of Horde_Form_Variable objects to
* fetch from.
- * @param object $vars The Variables object.
+ * @param object $vars The Horde_Variables object.
* @param array $info The array to be filled with the submitted
* field values.
*/
case 'news':
if (empty($GLOBALS['conf']['urls']['pretty'])) {
- return Util::addParameter(Horde::applicationUrl('news.php', $full, $append_session), 'id', $data);
+ return Horde_Util::addParameter(Horde::applicationUrl('news.php', $full, $append_session), 'id', $data);
} else {
return Horde::applicationUrl('article/' . $data, $full, $append_session);
}
case 'category':
if (empty($GLOBALS['conf']['urls']['pretty'])) {
- return Util::addParameter(Horde::applicationUrl('browse.php', $full, $append_session), 'category', $data);
+ return Horde_Util::addParameter(Horde::applicationUrl('browse.php', $full, $append_session), 'category', $data);
} else {
return Horde::applicationUrl('category/' . $data, $full, $append_session);
}
case 'source':
if (empty($GLOBALS['conf']['urls']['pretty'])) {
- return Util::addParameter(Horde::applicationUrl('browse.php', $full, $append_session), 'source', $data);
+ return Horde_Util::addParameter(Horde::applicationUrl('browse.php', $full, $append_session), 'source', $data);
} else {
return Horde::applicationUrl('source/' . $data, $full, $append_session);
}
$view_url = Horde::applicationUrl('files.php');
$html = '<table><tr valign="top"><td>';
- $html .= Horde::link(Util::addParameter($view_url, array('actionID' => 'download_zip_all', 'news_id' => $id)), _("Compress and dowload all files at once")) . $dowload_zip . '</a> ' . "\n";
+ $html .= Horde::link(Horde_Util::addParameter($view_url, array('actionID' => 'download_zip_all', 'news_id' => $id)), _("Compress and dowload all files at once")) . $dowload_zip . '</a> ' . "\n";
$html .= _("Attached files: ") . '</td><td>' . "\n";
foreach ($files as $file) {
- $view_url = Util::addParameter($view_url, $file);
+ $view_url = Horde_Util::addParameter($view_url, $file);
$html .= ' - ' . "\n";
- $html .= Horde::link(Util::addParameter($view_url, 'actionID', 'download_zip'), sprintf(_("Compress and dowload %s"), $file['file_name'])) . $dowload_zip . '</a> ' . "\n";
- $html .= Horde::link(Util::addParameter($view_url, 'actionID', 'download_file'), sprintf(_("Dowload %s"), $file['file_name'])) . $dowload_img . '</a> ' . "\n";
- $html .= Horde::link(Util::addParameter($view_url, 'actionID', 'view_file'), sprintf(_("Preview %s"), $file['file_name']), '', '_file_view');
+ $html .= Horde::link(Horde_Util::addParameter($view_url, 'actionID', 'download_zip'), sprintf(_("Compress and dowload %s"), $file['file_name'])) . $dowload_zip . '</a> ' . "\n";
+ $html .= Horde::link(Horde_Util::addParameter($view_url, 'actionID', 'download_file'), sprintf(_("Dowload %s"), $file['file_name'])) . $dowload_img . '</a> ' . "\n";
+ $html .= Horde::link(Horde_Util::addParameter($view_url, 'actionID', 'view_file'), sprintf(_("Preview %s"), $file['file_name']), '', '_file_view');
$html .= Horde::img(Horde_Mime_Viewer::getIcon($file['file_type']), $file['file_name'], 'width="16" height="16"', '') . ' ';
if (Auth::isAdmin('news:admin')) {
- $html .= Horde::link(Util::addParameter($delete_url, $file), sprintf(_("Delete %s"), $file['file_name'])) . $delete_img . '</a> ' . "\n";
+ $html .= Horde::link(Horde_Util::addParameter($delete_url, $file), sprintf(_("Delete %s"), $file['file_name'])) . $delete_img . '</a> ' . "\n";
}
$html .= $file['file_name'] . '</a> ' . "\n";
$html .= ' (' . self::format_filesize($file['file_size']) . ')';
static public function getImageUrl($id, $view = 'small', $type = 'news')
{
if (empty($GLOBALS['conf']['images']['direct'])) {
- return Util::addParameter(Horde::applicationUrl('view.php'),
+ return Horde_Util::addParameter(Horde::applicationUrl('view.php'),
array('type' => $type,
'view' => $view,
'id' => $id),
<?php
-
-require_once 'Horde/Variables.php';
-
/**
* News search form
*
static public function getPager($info, $count, $url)
{
$pager = new Horde_UI_Pager('news_page',
- Variables::getDefaultVariables(),
+ Horde_Variables::getDefaultVariables(),
array('num' => $count,
'url' => $url,
'page_count' => 10,
/**
* Fetch the field values of the submitted form.
*
- * @param Variables $vars A Variables instance, optional since Horde 3.2.
+ * @param Horde_Variables $vars A Horde_Variables instance, optional since Horde 3.2.
* @param array $info Array to be filled with the submitted field
* values.
*/
*
* @param array $variables An array of Horde_Form_Variable objects to
* fetch from.
- * @param object $vars The Variables object.
+ * @param object $vars The Horde_Variables object.
* @param array $info The array to be filled with the submitted
* field values.
*/
$search = Horde::applicationUrl('search.php');
foreach (explode(' ', $tags) as $tag) {
$html .= '<a href="'
- . Util::addParameter($search, array('word' => $tag))
+ . Horde_Util::addParameter($search, array('word' => $tag))
. '">' . $tag . '</a> ';
}
return $html;
}
-}
\ No newline at end of file
+}
$GLOBALS['news_cat'] = new News_Categories();
// Start compression.
-if (!Util::nonInputVar('no_compress')) {
+if (!Horde_Util::nonInputVar('no_compress')) {
Horde::compressOutput();
}
require_once dirname(__FILE__) . '/lib/base.php';
-$id = Util::getFormData('id');
+$id = Horde_Util::getFormData('id');
$row = $news->get($id);
if ($row instanceof PEAR_Error) {
$notification->push($row);
_error(_("Only authenticated users can send mails."));
}
-$to = Util::getFormData('email');
+$to = Horde_Util::getFormData('email');
if (empty($to)) {
_error(_("No mail entered."));
exit;
}
header('Location: ' . News::getUrlFor('news', $id));
-exit;
\ No newline at end of file
+exit;
require_once dirname(__FILE__) . '/lib/base.php';
-$id = Util::getFormData('id');
+$id = Horde_Util::getFormData('id');
$row = $news->get($id);
// check if the news exists
}
// check if the news exists
-if (($version = Util::getFormData('version')) !== null) {
+if (($version = Horde_Util::getFormData('version')) !== null) {
$sql = 'SELECT created, user_uid, content FROM ' . $news->prefix . '_versions WHERE id = ? AND version = ?';
$version_data = $news->db->getRow($sql, array($id, $version), DB_FETCHMODE_ASSOC);
if (empty($version_data)) {
require $template_path . 'news.php';
-require_once $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
+require_once $registry->get('templates', 'horde') . '/common-footer.inc';
require_once dirname(__FILE__) . '/lib/base.php';
-$id = Util::getFormData('id');
+$id = Horde_Util::getFormData('id');
$row = $news->get($id);
if ($row instanceof PEAR_Error) {
$notification->push($row);
$notification->push(_("News sucessfuly added to you notes."), 'horde.success');
header('Location: ' . $registry->getInitialPage('mnemo'));
exit;
-}
\ No newline at end of file
+}
$no_compress = true;
require_once dirname(__FILE__) . '/lib/base.php';
-$id = Util::getFormData('id');
+$id = Horde_Util::getFormData('id');
$row = $news->get($id);
// Check if the news exists
$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, String::convertCharset(strip_tags($row['content']), NLS::getCharset(), 'UTF-8'));
+$pdf->multiCell(0, 12, Horde_String::convertCharset(strip_tags($row['content']), NLS::getCharset(), 'UTF-8'));
$browser->downloadHeaders($id . '.pdf', 'application/pdf');
echo $pdf->getOutput();
require_once dirname(__FILE__) . '/lib/base.php';
-$id = Util::getFormData('id');
-$version = Util::getFormData('version', false);
+$id = Horde_Util::getFormData('id');
+$version = Horde_Util::getFormData('version', false);
$row = $news->get($id);
$template_path = News::getTemplatePath($row['category1'], 'news');
Horde::authenticationFailureRedirect();
}
-$id = Util::getFormData('id', 0);
-$actionID = Util::getFormData('actionID', false);
+$id = Horde_Util::getFormData('id', 0);
+$actionID = Horde_Util::getFormData('actionID', false);
$url = Horde::applicationUrl('reads.php');
$sql = 'SELECT id, user, ip, readdate FROM ' . $news->prefix . '_user_reads WHERE ';
// Default vars
$title = _("Browse");
-$page = Util::getGet('news_page', 0);
+$page = Horde_Util::getGet('news_page', 0);
$per_page = $prefs->getValue('per_page');
$browse_url = Horde::applicationUrl('browse.php');
-$cid = Util::getGet('cid');
+$cid = Horde_Util::getGet('cid');
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$form = new News_Search($vars);
$form->getInfo(null, $criteria);
}
require_once $browse_template_path . '/footer.inc';
-require_once $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
+require_once $registry->get('templates', 'horde') . '/common-footer.inc';
$result = $news->db->query('UPDATE news_body SET tags = ""');
$result = $news->db->query('SELECT id, title FROM news_body WHERE tags = "" ORDER BY id ASC');
while ($row = $result->fetchRow(DB_FETCHMODE_ASSOC)) {
- $row['title'] = String::lower($row['title'], true);
+ $row['title'] = Horde_String::lower($row['title'], true);
$row['title'] = str_replace($remove, '', $row['title']);
$tags = explode(' ', $row['title']);
foreach ($tags as $i => $tag) {
$news->db->query('UPDATE news_body SET tags = ? WHERE id = ?', $params);
}
-echo 'done';
\ No newline at end of file
+echo 'done';
<?php echo Horde::stylesheetLink('news') ?>
</head>
-<body<?php if ($bc = Util::nonInputVar('bodyClass')) echo ' class="' . $bc . '"' ?><?php if ($bi = Util::nonInputVar('bodyId')) echo ' id="' . $bi . '"'; ?>>
+<body<?php if ($bc = Horde_Util::nonInputVar('bodyClass')) echo ' class="' . $bc . '"' ?><?php if ($bi = Horde_Util::nonInputVar('bodyId')) echo ' id="' . $bi . '"'; ?>>
<a href="<?php echo News::getImageUrl($id, 'big'); ?>" target="_blank" title="<?php echo _("Click for full picture") ?>">
<img src="<?php echo News::getImageUrl($id, 'small'); ?>" style="height: 50px; width: 50px;" />
</a><br />
-<a href="<?php echo Util::addParameter($browse_url, array('id' => $id, 'actionID' => 'deletepicture')) ?>" onclick="confirm('<?php echo _("Do you really want to delete this picture?") ?>');"><?php echo _("Delete picture") ?></a>
+<a href="<?php echo Horde_Util::addParameter($browse_url, array('id' => $id, 'actionID' => 'deletepicture')) ?>" onclick="confirm('<?php echo _("Do you really want to delete this picture?") ?>');"><?php echo _("Delete picture") ?></a>
<?php endif; ?>
</td>
<td>
}
echo _(" by ") . $version['user_uid'] . _(" at ") . $version['created'] . "\n(";
- $url = Util::addParameter(Horde::applicationUrl('news.php'), array('id' => $id, 'version' => $version['version']));
+ $url = Horde_Util::addParameter(Horde::applicationUrl('news.php'), array('id' => $id, 'version' => $version['version']));
echo Horde::link($url, _("View"), '', '_blank', '', _("View")) . _("View") . '</a> | ';
- $url = Util::addParameter(Horde::applicationUrl('edit.php'), array('id' => $id, 'actionID' => 'renew'));
- echo Horde::link(Util::addParameter($url,'version', $version['version']),_("Renew")) . _("Renew") . '</a> | ';
+ $url = Horde_Util::addParameter(Horde::applicationUrl('edit.php'), array('id' => $id, 'actionID' => 'renew'));
+ echo Horde::link(Horde_Util::addParameter($url,'version', $version['version']),_("Renew")) . _("Renew") . '</a> | ';
- $url = Util::addParameter(Horde::applicationUrl('diff.php'), array('id' => $id, 'version' => $version['version']));
+ $url = Horde_Util::addParameter(Horde::applicationUrl('diff.php'), array('id' => $id, 'version' => $version['version']));
echo Horde::link('#', _("Diff"), '', '', "popup('$url')") . _("Diff") . '</a> ';
echo ')<br />' . "\n";
<td nowrap="nowrap">
<?php
-$url = Util::addParameter($edit_url, array('page' => $page, 'id' => $row['id']));
+$url = Horde_Util::addParameter($edit_url, array('page' => $page, 'id' => $row['id']));
echo Horde::link($url,_("Edit")) .
Horde::img('edit.png', _("Edit"), '', $img_dir) . '</a> ';
-echo Horde::link(Util::addParameter($browse_url, 'id', $row['id']), _("Info")) .
+echo Horde::link(Horde_Util::addParameter($browse_url, 'id', $row['id']), _("Info")) .
Horde::img('devel.png', _("Info"), '', $img_dir). '</a> ';
/* admins options */
if (Auth::isAdmin() || isset($allowed_cats[$row['category1']]) || isset($allowed_cats[$row['category2']])) {
if ($row['status'] == News::CONFIRMED) {
- $url = Util::addParameter($browse_url, array('page' => $page, 'actionID' => 'deactivate', 'id' => $row['id']));
+ $url = Horde_Util::addParameter($browse_url, array('page' => $page, 'actionID' => 'deactivate', 'id' => $row['id']));
echo Horde::link($url,_("Deactivate")) . Horde::img('cross.png', _("Deactivate"), '', $img_dir) . '</a> ';
} else {
- $url = Util::addParameter($browse_url, array('page' => $page, 'actionID' => 'activate', 'id' => $row['id']));
+ $url = Horde_Util::addParameter($browse_url, array('page' => $page, 'actionID' => 'activate', 'id' => $row['id']));
echo Horde::link($url,_("Activate")) . Horde::img('tick.png', _("Activate"), '', $img_dir) . '</a> ';
- $url = Util::addParameter(Horde::applicationUrl('delete.php'), 'id', $row['id']);
+ $url = Horde_Util::addParameter(Horde::applicationUrl('delete.php'), 'id', $row['id']);
echo Horde::link($url,_("Delete"), '', '', '', _("Delete")) . Horde::img('delete.png', _("Delete"), '', $img_dir) . '</a> ';
if ($row['status'] == News::LOCKED) {
- $url = Util::addParameter($browse_url, array('page' => $page, 'actionID' => 'unlock', 'id' => $row['id']));
+ $url = Horde_Util::addParameter($browse_url, array('page' => $page, 'actionID' => 'unlock', 'id' => $row['id']));
echo Horde::link($url,_("Unlock")) . Horde::img('map.png', '', '', $img_dir) . '</a> ';
} else {
- $url = Util::addParameter($browse_url, array('page' => $page, 'actionID' => 'lock', 'id' => $row['id']));
+ $url = Horde_Util::addParameter($browse_url, array('page' => $page, 'actionID' => 'lock', 'id' => $row['id']));
echo Horde::link($url,_("Lock")) . Horde::img('locked.png', '', '', $img_dir) . '</a> ';
}
}
<td><?php echo $row['user'] ?></td>
<td>
<?php
-$url = Util::addParameter($read_url, 'id', $row['id']);
+$url = Horde_Util::addParameter($read_url, 'id', $row['id']);
echo Horde::link('javascript:void(0)', $row['view_count'], '', '', "popup('$url')", $row['view_count']) . number_format($row['view_count']) . '</a>';
?>
</td>
echo '<td>' . $row['comments'] . '</td>';
}
?>
-</tr>
\ No newline at end of file
+</tr>
echo '</ul><br />';
}
-$trackback_url = Util::addParameter(Horde::applicationUrl('trackback.php', true), 'id', $id);
+$trackback_url = Horde_Util::addParameter(Horde::applicationUrl('trackback.php', true), 'id', $id);
echo _("Use the following link to trackback from your own site: ") .
'<br> <input value="' . $trackback_url . '" /><br />';
<?php
echo '<div class="header">' . _("News data") . '</div>';
-echo _("By") . ': ' . Horde::link(Util::addParameter($browse_url, 'user', $row['user'])) . $row['user'] . '</a><br />';
-echo _("On") . ': ' . Horde::link(Util::addParameter($browse_url, 'publish', $row['publish'])) . News::dateFormat($row['publish']) . '</a><br />';
-echo _("Category") . ': ' . Horde::link(Util::addParameter($browse_url, 'cid', $row['category1'])) . $GLOBALS['news_cat']->getName($row['category1']) . '</a><br />';
+echo _("By") . ': ' . Horde::link(Horde_Util::addParameter($browse_url, 'user', $row['user'])) . $row['user'] . '</a><br />';
+echo _("On") . ': ' . Horde::link(Horde_Util::addParameter($browse_url, 'publish', $row['publish'])) . News::dateFormat($row['publish']) . '</a><br />';
+echo _("Category") . ': ' . Horde::link(Horde_Util::addParameter($browse_url, 'cid', $row['category1'])) . $GLOBALS['news_cat']->getName($row['category1']) . '</a><br />';
$plain = preg_replace('/\s\s+/', ' ', trim(strip_tags($row['content'])));
echo _("Chars") . ': ' . number_format(strlen($plain)) . '<br />';
$sources = $news->getSources(true);
echo _("Source media") . ': ' . Horde::externalUrl($sources[$row['source']]['source_url'], true) .
$sources[$row['source']]['source_name'] . '</a><br />';
-}
\ No newline at end of file
+}
echo '<br /><div class="header">' . _("On this day") . '</div>';
$img = Horde::img('news.png', '', '', $registry->getImageDir('news'));
-echo $img . ' ' . Horde::link(Util::addParameter($browse_url, 'date', $row['publish'])) . _("News of this day.") . '</a><br />';
+echo $img . ' ' . Horde::link(Horde_Util::addParameter($browse_url, 'date', $row['publish'])) . _("News of this day.") . '</a><br />';
if ($registry->hasInterface('schedul')) {
$img = Horde::img('schedul.png', '', '', $registry->getImageDir('schedul'));
$url = $registry->get('webroot', 'schedul') . '/browse.php';
- $url = Util::addParameter($url, array('actionID' => 'date', 'date' => $row['publish']));
+ $url = Horde_Util::addParameter($url, array('actionID' => 'date', 'date' => $row['publish']));
echo $img . ' ' . Horde::link($url) . _("Events on this day.") . '</a><br />';
}
echo $img . ' ' . Horde::link('javascript:window.print()') . _("Printer firendly") . '</a><br />';
$img = Horde::img('mime/pdf.png', '', '', $registry->getImageDir('horde'));
-echo $img . ' ' . Horde::link(Util::addParameter(Horde::applicationUrl('pdf.php'), 'id', $id)) . _("PDF") . '</a><br />';
+echo $img . ' ' . Horde::link(Horde_Util::addParameter(Horde::applicationUrl('pdf.php'), 'id', $id)) . _("PDF") . '</a><br />';
/* Bookmark link */
if ($registry->hasMethod('bookmarks/getAddUrl')) {
if ($registry->hasInterface('notes')) {
$img = Horde::img('mnemo.png', '', '', $registry->getImageDir('mnemo'));
- $url = Util::addParameter(Horde::applicationUrl('note.php', true), 'id', $id);
+ $url = Horde_Util::addParameter(Horde::applicationUrl('note.php', true), 'id', $id);
echo $img . ' ' . Horde::link($url) . _("Add to notes.") . '</a><br />';
-}
\ No newline at end of file
+}
<tr>
-<td><?php echo Horde::link(Util::addParameter($url, 'id', $row['id']), $row['title']) . $row['id'] . '</a>'; ?></td>
-<td><?php echo Horde::link(Util::addParameter($url, 'actionID', $row['user']), $row['user']) . $row['user'] . '</a>'; ?></td>
+<td><?php echo Horde::link(Horde_Util::addParameter($url, 'id', $row['id']), $row['title']) . $row['id'] . '</a>'; ?></td>
+<td><?php echo Horde::link(Horde_Util::addParameter($url, 'actionID', $row['user']), $row['user']) . $row['user'] . '</a>'; ?></td>
<td><?php echo $row['ip'] ?></td>
<td><?php echo $row['readdate'] ?></td>
</tr>
/* Try to create object */
$trackback_data = array(
- 'id' => Util::getFormData('id'),
+ 'id' => Horde_Util::getFormData('id'),
'host' => $_SERVER['REMOTE_ADDR'],
- 'title' => Util::getFormData('title'),
- 'excerpt' => Util::getFormData('excerpt'),
- 'url' => Util::getFormData('url'),
- 'blog_name' => Util::getFormData('blog_name')
+ 'title' => Horde_Util::getFormData('title'),
+ 'excerpt' => Horde_Util::getFormData('excerpt'),
+ 'url' => Horde_Util::getFormData('url'),
+ 'blog_name' => Horde_Util::getFormData('blog_name')
);
$trackback = News::loadTrackback($trackback_data);
exit;
}
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$form = new Skoli_EntryForm($vars);
// Execute if the form is valid.
$notification->push(sprintf(_("The new entry for \"%s\" has been added."), $result), 'horde.success');
}
- header('Location: ' . Horde::applicationUrl(Util::addParameter('add.php', 'class', $vars->get('class_id')), true));
+ header('Location: ' . Horde::applicationUrl(Horde_Util::addParameter('add.php', 'class', $vars->get('class_id')), true));
exit;
}
exit;
}
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$form = new Skoli_CreateClassForm($vars);
// Execute if the form is valid.
exit;
}
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$class_id = $vars->get('c');
$class = $skoli_shares->getShare($class_id);
$form = new Skoli_DeleteClassForm($vars, $class);
// Execute if the form is valid (must pass with POST variables only).
-if ($form->validate(new Variables($_POST))) {
+if ($form->validate(new Horde_Variables($_POST))) {
$result = $form->execute();
if (is_a($result, 'PEAR_Error')) {
$notification->push($result, 'horde.error');
exit;
}
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$class = $skoli_shares->getShare($vars->get('c'));
if (is_a($class, 'PEAR_Error')) {
$notification->push($class, 'horde.error');
$class_options = array();
foreach ($classes as $key=>$class) {
- $class_options[] = '<option value="' . htmlspecialchars($key) . '"' . (Util::getFormData('class') == $key ? ' selected="selected"' : '') . '>' .
+ $class_options[] = '<option value="' . htmlspecialchars($key) . '"' . (Horde_Util::getFormData('class') == $key ? ' selected="selected"' : '') . '>' .
htmlspecialchars($class->get('name')) . "</option>\n";
}
htmlspecialchars(_("Whole class")) . "</option>\n";
$student_options = array();
$student_options[] = $wholeclass_option;
-if (Util::getFormData('class') != '') {
- $class = Util::getFormData('class');
+if (Horde_Util::getFormData('class') != '') {
+ $class = Horde_Util::getFormData('class');
} else {
reset($classes);
$class = key($classes);
htmlspecialchars($address[$conf['addresses']['name_field']]) . "</option>\n";
}
-$actionID = Util::getFormData('actionID');
+$actionID = Horde_Util::getFormData('actionID');
/* Loop through the action handlers. */
switch ($actionID) {
case 'export':
$data = array();
$driver = &Skoli_Driver::singleton($class);
- if (Util::getFormData('student') == 'all') {
+ if (Horde_Util::getFormData('student') == 'all') {
/* Export whole class. */
$subjects = $driver->getSubjects('mark');
foreach ($export_class['_students'] as $student) {
$subjects = $driver->getSubjects('mark');
foreach ($subjects as $subject) {
$params = array(array('name' => 'subject', 'value' => $subject, 'strict' => 1));
- $marks = Skoli::listEntries($class, Util::getFormData('student'), 'mark', $params, SKOLI_SORT_DATE, SKOLI_SORT_DESCEND);
+ $marks = Skoli::listEntries($class, Horde_Util::getFormData('student'), 'mark', $params, SKOLI_SORT_DATE, SKOLI_SORT_DESCEND);
foreach ($marks as $mark) {
$data[] = array($subject, $mark['date'], $mark['title'], Skoli::convertNumber($mark['mark']), Skoli::convertNumber($mark['weight']));
}
$subjects = $driver->getSubjects('objective');
foreach ($subjects as $subject) {
$params = array(array('name' => 'subject', 'value' => $subject, 'strict' => 1));
- $objectives = Skoli::listEntries($class, Util::getFormData('student'), 'objective', $params, SKOLI_SORT_DATE, SKOLI_SORT_DESCEND);
+ $objectives = Skoli::listEntries($class, Horde_Util::getFormData('student'), 'objective', $params, SKOLI_SORT_DATE, SKOLI_SORT_DESCEND);
foreach ($objectives as $objective) {
$data[] = array($subject, $objective['date'], $objective['category'], $objective['objective']);
}
}
$data[] = array(_("Outcomes"));
- $outcomes = Skoli::listEntries($class, Util::getFormData('student'), 'outcome', null, SKOLI_SORT_DATE, SKOLI_SORT_DESCEND);
+ $outcomes = Skoli::listEntries($class, Horde_Util::getFormData('student'), 'outcome', null, SKOLI_SORT_DATE, SKOLI_SORT_DESCEND);
foreach ($outcomes as $outcome) {
$completed = isset($outcome['completed']) && $outcome['completed'] != '' ? _("Completed") : _("Open");
$comment = isset($outcome['comment']) ? $outcome['comment'] : '';
}
$data[] = array(_("Absences"));
- $absences = Skoli::listEntries($class, Util::getFormData('student'), 'absence', null, SKOLI_SORT_DATE, SKOLI_SORT_DESCEND);
+ $absences = Skoli::listEntries($class, Horde_Util::getFormData('student'), 'absence', null, SKOLI_SORT_DATE, SKOLI_SORT_DESCEND);
foreach ($absences as $absence) {
$excused = isset($absence['excused']) && $absence['excused'] != '' ? _("Excused") : _("Not excused");
$comment = isset($absence['comment']) ? $absence['comment'] : '';
break;
}
- switch (Util::getFormData('exportID')) {
+ switch (Horde_Util::getFormData('exportID')) {
case EXPORT_CSV:
$csv = &Horde_Data::singleton('csv');
- $csv->exportFile(_("class.csv"), $data, (Util::getFormData('student') == 'all'));
+ $csv->exportFile(_("class.csv"), $data, (Horde_Util::getFormData('student') == 'all'));
exit;
case EXPORT_TSV:
$tsv = &Horde_Data::singleton('tsv');
- $tsv->exportFile(_("class.tsv"), $data, (Util::getFormData('student') == 'all'));
+ $tsv->exportFile(_("class.tsv"), $data, (Horde_Util::getFormData('student') == 'all'));
exit;
}
@define('SKOLI_BASE', dirname(__FILE__));
require_once SKOLI_BASE . '/lib/base.php';
-require_once 'Horde/Variables.php';
require_once 'Horde/UI/Tabs.php';
// Exit if this isn't an authenticated user.
exit;
}
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
$driver = &Skoli_Driver::singleton();
$entry = $driver->getEntry($vars->get('entry'));
if (is_a($entry, 'PEAR_Error') || !count($entry)) {
// Check permissions
if (!$share->hasPermission(Auth::getAuth(), PERMS_READ)) {
$notification->push(_("You are not allowed to view this entry."), 'horde.error');
- header('Location: ' . Util::addParameter(Horde::applicationUrl('search.php', true), 'actionID', 'search'));
+ header('Location: ' . Horde_Util::addParameter(Horde::applicationUrl('search.php', true), 'actionID', 'search'));
exit;
}
$studentdetails = Skoli::getStudent($share->get('address_book'), $entry['student_id']);
// Get view.
-$viewName = Util::getFormData('view', 'Entry');
+$viewName = Horde_Util::getFormData('view', 'Entry');
if ($viewName != 'DeleteEntry') {
require_once SKOLI_BASE . '/lib/Forms/Entry.php';
$notification->push(sprintf(_("Couldn't update this entry: %s"), $result->getMessage()), 'horde.error');
} else {
$notification->push(sprintf(_("The entry for \"%s\" has been saved."), $studentdetails[$conf['addresses']['name_field']]), 'horde.success');
- header('Location: ' . Util::addParameter(Horde::applicationUrl('search.php', true), 'actionID', 'search'));
+ header('Location: ' . Horde_Util::addParameter(Horde::applicationUrl('search.php', true), 'actionID', 'search'));
exit;
}
}
}
// Entry actions.
-$actionID = Util::getFormData('actionID');
+$actionID = Horde_Util::getFormData('actionID');
if ($actionID == 'delete') {
if (is_a($deleted = $driver->deleteEntry($entry['object_id']), 'PEAR_Error')) {
$notification->push(sprintf(_("There was an error deleting this entry: %s"), $deleted->getMessage()), 'horde.error');
} else {
$notification->push(sprintf(_("The entry for \"%s\" has been deleted."), $studentdetails[$conf['addresses']['name_field']]), 'horde.success');
- header('Location: ' . Util::addParameter(Horde::applicationUrl('search.php', true), 'actionID', 'search'));
+ header('Location: ' . Horde_Util::addParameter(Horde::applicationUrl('search.php', true), 'actionID', 'search'));
exit;
}
}
// Get tabs.
-$url = Util::addParameter(Horde::applicationUrl('entry.php'), 'entry', $entry['object_id']);
+$url = Horde_Util::addParameter(Horde::applicationUrl('entry.php'), 'entry', $entry['object_id']);
$tabs = new Horde_UI_Tabs('view', $vars);
$tabs->addTab(_("View"), $url, array('tabname' => 'Entry', 'id' => 'tabEntry'));
if ($share->hasPermission(Auth::getAuth(), PERMS_EDIT)) {
false,
array('icon' => 'add.png',
'icondir' => $icondir,
- 'url' => Util::addParameter($add, array('class' => $name))));
+ 'url' => Horde_Util::addParameter($add, array('class' => $name))));
}
$tree->addNode($parent . '__search',
$parent,
* @package Skoli
*/
-/** Variables */
-require_once 'Horde/Variables.php';
-
/** Horde_Form */
require_once 'Horde/Form.php';
* @package Skoli
*/
-/** Variables */
-require_once 'Horde/Variables.php';
-
/** Horde_Form */
require_once 'Horde/Form.php';
* @package Skoli
*/
-/** Variables */
-require_once 'Horde/Variables.php';
-
/** Horde_Form */
require_once 'Horde/Form.php';
* @package Skoli
*/
-/** Variables */
-require_once 'Horde/Variables.php';
-
/** Horde_Form */
require_once 'Horde/Form.php';
if (!$GLOBALS['display_classes']) {
$GLOBALS['display_classes'] = array();
}
- if (($classId = Util::getFormData('display_class')) !== null) {
+ if (($classId = Horde_Util::getFormData('display_class')) !== null) {
if (is_array($classId)) {
$GLOBALS['display_classes'] = $classId;
} else {
$GLOBALS['display_classes'][] = $classId;
}
}
- $GLOBALS['prefs']->setValue('show_students', Util::getFormData('show_students') ? 1 : 0);
+ $GLOBALS['prefs']->setValue('show_students', Horde_Util::getFormData('show_students') ? 1 : 0);
}
$GLOBALS['prefs']->setValue('display_classes', serialize($GLOBALS['display_classes']));
$menu = new Menu(HORDE_MENU_MASK_ALL);
$menu->add(Horde::applicationUrl('list.php'), _("List Classes"), 'skoli.png', null, null, null, basename($_SERVER['PHP_SELF']) == 'index.php' ? 'current' : null);
if (count(Skoli::listClasses(false, PERMS_EDIT))) {
- $menu->add(Horde::applicationUrl('add.php'), _("_New Entry"), 'add.png', null, null, null, Util::getFormData('entry') ? '__noselection' : null);
+ $menu->add(Horde::applicationUrl('add.php'), _("_New Entry"), 'add.png', null, null, null, Horde_Util::getFormData('entry') ? '__noselection' : null);
}
/* Search. */
* Show this item only if an application provides 'calendar/show' and we have permissions to view it.
$app = $registry->hasMethod('calendar/show');
if ($app !== false && $registry->get('status', $app) != 'inactive' && $registry->hasPermission($app, PERMS_EDIT)) {
- $menu->add(Horde::applicationUrl(Util::addParameter('timetable.php', 'actionID', 'new_timetable')), _("_New Timetable"), 'timetable.png');
+ $menu->add(Horde::applicationUrl(Horde_Util::addParameter('timetable.php', 'actionID', 'new_timetable')), _("_New Timetable"), 'timetable.png');
}
*/
$title = _("My Classes");
/* Get and set Variables */
-require_once 'Horde/Variables.php';
-$vars = Variables::getDefaultVariables();
+$vars = Horde_Variables::getDefaultVariables();
/* Get the current action ID. */
-$actionID = Util::getFormData('actionID');
+$actionID = Horde_Util::getFormData('actionID');
/* Sort out the sorting values */
-if (($sortby_class = Util::getFormData('sortby_class')) !== null) {
+if (($sortby_class = Horde_Util::getFormData('sortby_class')) !== null) {
if ($sortby_class == $prefs->getValue('sortby_class')) {
$prefs->setValue('sortdir_class', !$prefs->getValue('sortdir_class'));
} else {
$prefs->setValue('sortby_student', $sortby_class);
}
}
-if (($sortby_student = Util::getFormData('sortby_student')) !== null) {
+if (($sortby_student = Horde_Util::getFormData('sortby_student')) !== null) {
$prefs->setValue('sortby_student', $sortby_student);
if ($sortby_student == $prefs->getValue('sortby_student')) {
$prefs->setValue('sortdir_student', !$prefs->getValue('sortdir_student'));
switch ($actionID) {
case 'search_classes':
/* Get the search parameters. */
- $search_pattern = Util::getFormData('search_pattern');
+ $search_pattern = Horde_Util::getFormData('search_pattern');
/* Get the full, sorted student list for all classes. */
$list = Skoli::listStudents(null,
$baseurl = 'list.php';
if ($actionID == 'search_classes') {
- $baseurl = Util::addParameter(
+ $baseurl = Horde_Util::addParameter(
$baseurl,
array('actionID' => 'search_classes',
'search_pattern' => $search_pattern));
$registry = &Registry::singleton();
/* Which application. */
-$app = Util::getFormData('app');
+$app = Horde_Util::getFormData('app');
if (!$app) {
echo '<ul id="app">';
foreach ($registry->listApps() as $app) {
require_once $appbase . '/lib/base.php';
/* Which preference. */
-$pref = Util::getFormData('pref');
+$pref = Horde_Util::getFormData('pref');
if (!$pref) {
$_prefs = array();
if (is_callable(array('Horde', 'loadConfiguration'))) {
}
/* Which action. */
-if (Util::getPost('pref') == $pref) {
+if (Horde_Util::getPost('pref') == $pref) {
/* POST for saving a pref. */
- $prefs->setValue($pref, Util::getPost('value'));
+ $prefs->setValue($pref, Horde_Util::getPost('value'));
}
/* GET returns the current value, POST returns the new value. */
exit;
}
-$actionID = Util::getFormData('actionID');
+$actionID = Horde_Util::getFormData('actionID');
if (!isset($_SESSION['skoli'])) {
$_SESSION['skoli'] = array();
}
-if (($classid = Util::getFormData('class')) !== null) {
+if (($classid = Horde_Util::getFormData('class')) !== null) {
$_SESSION['skoli']['search_classid'] = $classid;
} else if (isset($_SESSION['skoli']['search_classid'])) {
$classid = $_SESSION['skoli']['search_classid'];
}
-if (($studentid = Util::getFormData('student')) !== null) {
+if (($studentid = Horde_Util::getFormData('student')) !== null) {
$_SESSION['skoli']['search_studentid'] = $studentid;
} else if (isset($_SESSION['skoli']['search_studentid'])) {
$studentid = $_SESSION['skoli']['search_studentid'];
}
-if (($type = Util::getFormData('type')) !== null) {
+if (($type = Horde_Util::getFormData('type')) !== null) {
$_SESSION['skoli']['search_type'] = $type;
} else if (isset($_SESSION['skoli']['search_type'])) {
$type = $_SESSION['skoli']['search_type'];
}
-if (($search = Util::getFormData('stext')) !== null) {
+if (($search = Horde_Util::getFormData('stext')) !== null) {
$_SESSION['skoli']['search_stext'] = $search;
} else if (isset($_SESSION['skoli']['search_stext'])) {
$search = $_SESSION['skoli']['search_stext'];
}
/* Sort out the sorting values */
-$sortby = Util::getFormData('sortby');
-$sortdir = Util::getFormData('sortdir');
+$sortby = Horde_Util::getFormData('sortby');
+$sortdir = Horde_Util::getFormData('sortdir');
if ($sortby === null) {
$sortby = SKOLI_SORT_CLASS;
-} else if ($sortby == Util::getFormData('sortby')) {
+} else if ($sortby == Horde_Util::getFormData('sortby')) {
$sortdir = !$sortdir;
}
if ($sortdir === null) {
$dynamic_sort = false;
$params = array('actionID' => 'search');
- $baseurl = Util::addParameter('search.php', $params);
+ $baseurl = Horde_Util::addParameter('search.php', $params);
echo '<div id="page">';
require SKOLI_TEMPLATES . '/search/header.inc';
if (count($list) > 0) {
(isset($entry['comment']) && $entry['comment'] != '' ? ', ' . $entry['comment'] : '');
break;
}
- $detailswrapped = String::wordwrap($details, $prefs->getValue('entry_details_wrap'), '<br />', true);
+ $detailswrapped = Horde_String::wordwrap($details, $prefs->getValue('entry_details_wrap'), '<br />', true);
$entry['details'] = current(explode('<br />', $detailswrapped));
require SKOLI_TEMPLATES . '/search/entries.inc';
}
<div id="class-list-buttons">
<form method="get" action="create.php">
-<?php echo Util::formInput() ?>
+<?php echo Horde_Util::formInput() ?>
<input type="submit" class="button" value="<?php echo _("Create a new Class") ?>" />
</form>
</div>
<?php $class = $classes[$class_id] ?>
<tr>
<td><?php echo htmlspecialchars($class->get('name')) ?></td>
- <td><a href="<?php echo Util::addParameter($edit_url_base, 'c', $class->getName()) ?>" title="<?php echo _("Edit") ?>"><?php echo $edit_img ?></a></td>
+ <td><a href="<?php echo Horde_Util::addParameter($edit_url_base, 'c', $class->getName()) ?>" title="<?php echo _("Edit") ?>"><?php echo $edit_img ?></a></td>
<?php if (empty($conf['share']['no_sharing'])): ?>
- <td><a onclick="return !popup(this.href);" href="<?php echo Util::addParameter($perms_url_base, 'share', $class->getName()) ?>" target="_blank" title="<?php echo _("Change Permissions") ?>"><?php echo $perms_img ?></a></td>
+ <td><a onclick="return !popup(this.href);" href="<?php echo Horde_Util::addParameter($perms_url_base, 'share', $class->getName()) ?>" target="_blank" title="<?php echo _("Change Permissions") ?>"><?php echo $perms_img ?></a></td>
<?php endif; ?>
- <td><a href="<?php echo Util::addParameter($delete_url_base, 'c', $class->getName()) ?>" title="<?php echo _("Delete") ?>"><?php echo $delete_img ?></a></td>
+ <td><a href="<?php echo Horde_Util::addParameter($delete_url_base, 'c', $class->getName()) ?>" title="<?php echo _("Delete") ?>"><?php echo $delete_img ?></a></td>
</tr>
<?php endforeach; ?>
</tbody>
Horde::includeScriptFiles();
-$bc = Util::nonInputVar('bodyClass');
+$bc = Horde_Util::nonInputVar('bodyClass');
if ($prefs->getValue('show_panel')) {
if ($bc) {
$bc .= ' ';
<link href="<?php echo Horde::applicationUrl('themes/categoryCSS.php') ?>" rel="stylesheet" type="text/css" />
</head>
-<body<?php if ($bc) echo ' class="' . $bc . '"' ?><?php if ($bi = Util::nonInputVar('bodyId')) echo ' id="' . $bi . '"'; ?>>
+<body<?php if ($bc) echo ' class="' . $bc . '"' ?><?php if ($bi = Horde_Util::nonInputVar('bodyId')) echo ' id="' . $bi . '"'; ?>>
<div class="item" style="padding:1em">
<?php echo Horde::label('exportID', _("Select the export format:")) ?><br />
<select name="exportID" id="exportID">
- <option value="<?php echo EXPORT_CSV ?>"<?php echo Util::getFormData('exportID') == EXPORT_CSV ? ' selected="selected"' : '' ?>><?php echo _("Comma separated values (CSV)") ?></option>
- <option value="<?php echo EXPORT_TSV ?>"<?php echo Util::getFormData('exportID') == EXPORT_TSV ? ' selected="selected"' : '' ?>><?php echo _("Tab separated values (TSV)") ?></option>
+ <option value="<?php echo EXPORT_CSV ?>"<?php echo Horde_Util::getFormData('exportID') == EXPORT_CSV ? ' selected="selected"' : '' ?>><?php echo _("Comma separated values (CSV)") ?></option>
+ <option value="<?php echo EXPORT_TSV ?>"<?php echo Horde_Util::getFormData('exportID') == EXPORT_TSV ? ' selected="selected"' : '' ?>><?php echo _("Tab separated values (TSV)") ?></option>
</select><br />
<?php if (count($classes) > 1): ?>
<form action="entry.php" method="post">
-<?php echo Util::formInput() ?>
+<?php echo Horde_Util::formInput() ?>
<input type="hidden" name="actionID" value="delete" />
<input type="hidden" name="entry" value="<?php echo $entry['object_id'] ?>" />
<input type="hidden" name="view" value="<?php echo $viewName ?>" />
<?php
if ($class['_edit']) {
$label = _("New Entry");
- echo Horde::link(Util::addParameter(Horde::applicationUrl('add.php'), 'class', $class['_id']), $label) . Horde::img('add.png', $label, null, $registry->getImageDir('skoli')) . '</a>';
+ echo Horde::link(Horde_Util::addParameter(Horde::applicationUrl('add.php'), 'class', $class['_id']), $label) . Horde::img('add.png', $label, null, $registry->getImageDir('skoli')) . '</a>';
}
?>
</td>
<?php
if ($class['_edit']) {
$label = sprintf(_("Edit \"%s\""), $class['name']);
- echo Horde::link(Util::addParameter(Horde::applicationUrl('classes/edit.php'), 'c', $class['_id']), $label) . Horde::img('edit.png', $label, null, $registry->getImageDir('horde')) . '</a>';
+ echo Horde::link(Horde_Util::addParameter(Horde::applicationUrl('classes/edit.php'), 'c', $class['_id']), $label) . Horde::img('edit.png', $label, null, $registry->getImageDir('horde')) . '</a>';
}
?>
</td>
'class' => $class['_id'],
'student' => 'all'
);
- echo Horde::link(Util::addParameter(Horde::applicationUrl('search.php'), $params), $label) . htmlspecialchars($class['name']) . '</a>';
+ echo Horde::link(Horde_Util::addParameter(Horde::applicationUrl('search.php'), $params), $label) . htmlspecialchars($class['name']) . '</a>';
?>
</td>
<?php if (in_array('lastentry', $student_columns)): ?>
</th>
<?php if (in_array('semesterstart', $class_columns)): ?>
<th id="s<?php echo SKOLI_SORT_SEMESTERSTART ?>"<?php if ($sortby_class == SKOLI_SORT_SEMESTERSTART) echo ' class="' . $sortdirclass_class . '"' ?> width="2%">
- <?php echo Horde::widget(Horde::applicationUrl(Util::addParameter($baseurl, 'sortby_class', SKOLI_SORT_SEMESTERSTART)), _("Sort by Semester Start Date"), 'sortlink', '', '', _("Semester Start")) ?>
+ <?php echo Horde::widget(Horde::applicationUrl(Horde_Util::addParameter($baseurl, 'sortby_class', SKOLI_SORT_SEMESTERSTART)), _("Sort by Semester Start Date"), 'sortlink', '', '', _("Semester Start")) ?>
</th>
<?php endif; if (in_array('semesterend', $class_columns)): ?>
<th id="s<?php echo SKOLI_SORT_SEMESTEREND ?>"<?php if ($sortby_class == SKOLI_SORT_SEMESTEREND) echo ' class="' . $sortdirclass_class . '"' ?> width="2%">
- <?php echo Horde::widget(Horde::applicationUrl(Util::addParameter($baseurl, 'sortby_class', SKOLI_SORT_SEMESTEREND)), _("Sort by Semester End Date"), 'sortlink', '', '', _("Semester End")) ?>
+ <?php echo Horde::widget(Horde::applicationUrl(Horde_Util::addParameter($baseurl, 'sortby_class', SKOLI_SORT_SEMESTEREND)), _("Sort by Semester End Date"), 'sortlink', '', '', _("Semester End")) ?>
</th>
<?php endif; ?>
<th id="s<?php echo SKOLI_SORT_NAME ?>"<?php if ($sortby_class == SKOLI_SORT_NAME) echo ' class="' . $sortdirclass_class . '"' ?>>
- <?php echo Horde::widget(Horde::applicationUrl(Util::addParameter($baseurl, 'sortby_class', SKOLI_SORT_NAME)), _("Sort by Name"), 'sortlink', '', '', _("Name")) ?>
+ <?php echo Horde::widget(Horde::applicationUrl(Horde_Util::addParameter($baseurl, 'sortby_class', SKOLI_SORT_NAME)), _("Sort by Name"), 'sortlink', '', '', _("Name")) ?>
</th>
<?php if (in_array('lastentry', $student_columns)): ?>
<th id="s<?php echo SKOLI_SORT_LASTENTRY ?>"<?php if ($sortby_student == SKOLI_SORT_LASTENTRY) echo ' class="' . $sortdirclass_student . '"' ?> width="2%">
- <?php echo Horde::widget(Horde::applicationUrl(Util::addParameter($baseurl, 'sortby_student', SKOLI_SORT_LASTENTRY)), _("Sort by Last Entry"), 'sortlink', '', '', _("Last Entry")) ?>
+ <?php echo Horde::widget(Horde::applicationUrl(Horde_Util::addParameter($baseurl, 'sortby_student', SKOLI_SORT_LASTENTRY)), _("Sort by Last Entry"), 'sortlink', '', '', _("Last Entry")) ?>
</th>
<?php endif; if (in_array('summarks', $student_columns)): ?>
<th id="s<?php echo SKOLI_SORT_SUMMARKS ?>"<?php if ($sortby_student == SKOLI_SORT_SUMMARKS) echo ' class="' . $sortdirclass_student . '"' ?> width="2%">
- <?php echo Horde::widget(Horde::applicationUrl(Util::addParameter($baseurl, 'sortby_student', SKOLI_SORT_SUMMARKS)), _("Sort by Mark"), 'sortlink', '', '', _("Mark average")) ?>
+ <?php echo Horde::widget(Horde::applicationUrl(Horde_Util::addParameter($baseurl, 'sortby_student', SKOLI_SORT_SUMMARKS)), _("Sort by Mark"), 'sortlink', '', '', _("Mark average")) ?>
</th>
<?php endif; if (in_array('sumabsences', $student_columns)): ?>
<th id="s<?php echo SKOLI_SORT_SUMABSENCES ?>"<?php if ($sortby_student == SKOLI_SORT_SUMABSENCES) echo ' class="' . $sortdirclass_student . '"' ?> width="2%">
- <?php echo Horde::widget(Horde::applicationUrl(Util::addParameter($baseurl, 'sortby_student', SKOLI_SORT_SUMABSENCES)), _("Sort by Absences"), 'sortlink', '', '', _("Absences")) ?>
+ <?php echo Horde::widget(Horde::applicationUrl(Horde_Util::addParameter($baseurl, 'sortby_student', SKOLI_SORT_SUMABSENCES)), _("Sort by Absences"), 'sortlink', '', '', _("Absences")) ?>
</th>
<?php endif; if (in_array('grade', $class_columns)): ?>
<th id="s<?php echo SKOLI_SORT_GRADE ?>"<?php if ($sortby_class == SKOLI_SORT_GRADE) echo ' class="' . $sortdirclass_class . '"' ?> width="2%">
- <?php echo Horde::widget(Horde::applicationUrl(Util::addParameter($baseurl, 'sortby_class', SKOLI_SORT_GRADE)), _("Sort by Grade"), 'sortlink', '', '', _("Grade")) ?>
+ <?php echo Horde::widget(Horde::applicationUrl(Horde_Util::addParameter($baseurl, 'sortby_class', SKOLI_SORT_GRADE)), _("Sort by Grade"), 'sortlink', '', '', _("Grade")) ?>
</th>
<?php endif; if (in_array('semester', $class_columns)): ?>
<th id="s<?php echo SKOLI_SORT_SEMESTER ?>"<?php if ($sortby_class == SKOLI_SORT_SEMESTER) echo ' class="' . $sortdirclass_class . '"' ?> width="2%">
- <?php echo Horde::widget(Horde::applicationUrl(Util::addParameter($baseurl, 'sortby_class', SKOLI_SORT_SEMESTER)), _("Sort by Semester"), 'sortlink', '', '', _("Semester")) ?>
+ <?php echo Horde::widget(Horde::applicationUrl(Horde_Util::addParameter($baseurl, 'sortby_class', SKOLI_SORT_SEMESTER)), _("Sort by Semester"), 'sortlink', '', '', _("Semester")) ?>
</th>
<?php endif; if (in_array('location', $class_columns)): ?>
<th id="s<?php echo SKOLI_SORT_LOCATION ?>"<?php if ($sortby_class == SKOLI_SORT_LOCATION) echo ' class="' . $sortdirclass_class . '"' ?> width="2%">
- <?php echo Horde::widget(Horde::applicationUrl(Util::addParameter($baseurl, 'sortby_class', SKOLI_SORT_LOCATION)), _("Sort by Location"), 'sortlink', '', '', _("Location")) ?>
+ <?php echo Horde::widget(Horde::applicationUrl(Horde_Util::addParameter($baseurl, 'sortby_class', SKOLI_SORT_LOCATION)), _("Sort by Location"), 'sortlink', '', '', _("Location")) ?>
</th>
<?php endif; if (in_array('category', $class_columns)): ?>
<th id="s<?php echo SKOLI_SORT_CATEGORY ?>"<?php if ($sortby_class == SKOLI_SORT_CATEGORY) echo ' class="' . $sortdirclass_class . '"' ?> width="10%">
- <?php echo Horde::widget(Horde::applicationUrl(Util::addParameter($baseurl, 'sortby_class', SKOLI_SORT_CATEGORY)), _("Sort by Category"), 'sortlink', '', '', _("Category")) ?>
+ <?php echo Horde::widget(Horde::applicationUrl(Horde_Util::addParameter($baseurl, 'sortby_class', SKOLI_SORT_CATEGORY)), _("Sort by Category"), 'sortlink', '', '', _("Category")) ?>
<?php
if (Auth::getAuth() && (!$GLOBALS['prefs']->isLocked('categories') ||
!$GLOBALS['prefs']->isLocked('category_colors'))) {
- $categoryUrl = Util::addParameter(Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/prefs.php'), array('app' => 'horde', 'group' => 'categories'));
+ $categoryUrl = Horde_Util::addParameter(Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/prefs.php'), array('app' => 'horde', 'group' => 'categories'));
echo ' ' . Horde::link($categoryUrl, _("Edit categories and colors"), '', '_blank', 'popup(this.href); return false;') . Horde::img('colorpicker.png', _("Edit categories and colors"), '', $GLOBALS['registry']->getImageDir('horde')) . '</a>';
}
?>
<?php
if ($class['_edit']) {
$label = _("New Entry");
- echo Horde::link(Util::addParameter(Horde::applicationUrl('add.php'), array('class'=>$class['_id'], 'student'=>$student['__key'])), $label) . Horde::img('add.png', $label, null, $registry->getImageDir('skoli')) . '</a>';
+ echo Horde::link(Horde_Util::addParameter(Horde::applicationUrl('add.php'), array('class'=>$class['_id'], 'student'=>$student['__key'])), $label) . Horde::img('add.png', $label, null, $registry->getImageDir('skoli')) . '</a>';
}
?>
</td>
'class' => $class['_id'],
'student' => $student['__key']
);
- echo $treeIcon . ' ' . Horde::link(Util::addParameter(Horde::applicationUrl('search.php'), $params), $label) . htmlspecialchars($student[$conf['addresses']['name_field']]) . '</a>';
+ echo $treeIcon . ' ' . Horde::link(Horde_Util::addParameter(Horde::applicationUrl('search.php'), $params), $label) . htmlspecialchars($student[$conf['addresses']['name_field']]) . '</a>';
?>
</td>
<?php if (in_array('lastentry', $student_columns)): ?>
<div id="pageControlsInner">
<form action="<?php echo Horde::selfUrl() ?>" method="post">
-<?php echo Util::formInput() ?>
+<?php echo Horde_Util::formInput() ?>
<h4><?php echo _("Search for Classes:") ?></h4>
<p>
<input id="classSearch" type="text" for="myclasses,sharedclasses" />
'view' => 'EditEntry',
'entry' => $entry['_id']
);
- echo Horde::link(Util::addParameter(Horde::applicationUrl('entry.php'), $params), $label) . Horde::img('edit.png', $label, null, $registry->getImageDir('horde')) . '</a>';
+ echo Horde::link(Horde_Util::addParameter(Horde::applicationUrl('entry.php'), $params), $label) . Horde::img('edit.png', $label, null, $registry->getImageDir('horde')) . '</a>';
}
?>
</td>
'view' => 'Entry',
'entry' => $entry['_id']
);
- echo Horde::link(Util::addParameter(Horde::applicationUrl('entry.php'), $params), _("View Entry")) . htmlspecialchars($entry['student']) . '</a> ';
+ echo Horde::link(Horde_Util::addParameter(Horde::applicationUrl('entry.php'), $params), _("View Entry")) . htmlspecialchars($entry['student']) . '</a> ';
?>
</td>
<td><?php echo htmlspecialchars($entry['date']) ?> </td>
<?php echo Horde::img('edit.png', _("Edit Class"), null, $registry->getImageDir('horde')) ?>
</th>
<th id="s<?php echo SKOLI_SORT_CLASS ?>"<?php if ($sortby == SKOLI_SORT_CLASS) echo ' class="' . $sortdir_class . '"' ?> width="2%">
- <?php echo Horde::widget(Horde::applicationUrl(Util::addParameter($baseurl, 'sortby', SKOLI_SORT_CLASS)), _("Sort by Class"), 'sortlink', '', '', _("Class")) ?>
+ <?php echo Horde::widget(Horde::applicationUrl(Horde_Util::addParameter($baseurl, 'sortby', SKOLI_SORT_CLASS)), _("Sort by Class"), 'sortlink', '', '', _("Class")) ?>
</th>
<th id="s<?php echo SKOLI_SORT_STUDENT ?>"<?php if ($sortby == SKOLI_SORT_STUDENT) echo ' class="' . $sortdir_class . '"' ?> width="2%">
- <?php echo Horde::widget(Horde::applicationUrl(Util::addParameter($baseurl, 'sortby', SKOLI_SORT_STUDENT)), _("Sort by Student Name"), 'sortlink', '', '', _("Student")) ?>
+ <?php echo Horde::widget(Horde::applicationUrl(Horde_Util::addParameter($baseurl, 'sortby', SKOLI_SORT_STUDENT)), _("Sort by Student Name"), 'sortlink', '', '', _("Student")) ?>
</th>
<th id="s<?php echo SKOLI_SORT_DATE ?>"<?php if ($sortby == SKOLI_SORT_DATE) echo ' class="' . $sortdir_class . '"' ?> width="2%">
- <?php echo Horde::widget(Horde::applicationUrl(Util::addParameter($baseurl, 'sortby', SKOLI_SORT_DATE)), _("Sort by Date"), 'sortlink', '', '', _("Date")) ?>
+ <?php echo Horde::widget(Horde::applicationUrl(Horde_Util::addParameter($baseurl, 'sortby', SKOLI_SORT_DATE)), _("Sort by Date"), 'sortlink', '', '', _("Date")) ?>
</th>
<th id="s<?php echo SKOLI_SORT_TYPE ?>"<?php if ($sortby == SKOLI_SORT_TYPE) echo ' class="' . $sortdir_class . '"' ?> width="2%">
- <?php echo Horde::widget(Horde::applicationUrl(Util::addParameter($baseurl, 'sortby', SKOLI_SORT_TYPE)), _("Sort by Type"), 'sortlink', '', '', _("Type")) ?>
+ <?php echo Horde::widget(Horde::applicationUrl(Horde_Util::addParameter($baseurl, 'sortby', SKOLI_SORT_TYPE)), _("Sort by Type"), 'sortlink', '', '', _("Type")) ?>
</th>
<th class="nosort">
<?php echo _("Entry") ?>
// simplify and just check for it's presence or use night.
$title = sprintf("%s %d%s/%d%s", (!empty($data['day']['condition']) ? $data['day']['condition'] : $data['night']['condition']),
$data['temperatureHigh'],
- String::upper($units['temp']),
+ Horde_String::upper($units['temp']),
$data['temperatureLow'],
- String::upper($units['temp']));
+ Horde_String::upper($units['temp']));
$daytime = sprintf(_("Conditions: %s\nHigh: %d%s\nPrecipitation: %d%%\nHumidity: %d%%\nWinds: From the %s at %d%s"),
$data['day']['condition'],
- $data['temperatureHigh'], String::upper($units['temp']),
+ $data['temperatureHigh'], Horde_String::upper($units['temp']),
$data['day']['precipitation'],
$data['day']['humidity'],
$data['day']['windDirection'],
$data['day']['wind'],
- String::upper($units['wind']));
+ Horde_String::upper($units['wind']));
if (!empty($data['day']['windGust']) && $data['day']['windgust'] > 0) {
- $daytime .= sprintf(_(" gusting %d%s"), $data['day']['windgust'], String::upper($units['wind']));
+ $daytime .= sprintf(_(" gusting %d%s"), $data['day']['windgust'], Horde_String::upper($units['wind']));
}
$nighttime = sprintf(_("Conditions: %s\nLow: %d%s\nPrecipitation: %d%%\nHumidity: %d%%\nWinds: From the %s at %d%s"),
$data['night']['condition'],
- $data['temperatureLow'], String::upper($units['temp']),
+ $data['temperatureLow'], Horde_String::upper($units['temp']),
$data['night']['precipitation'],
$data['night']['humidity'],
$data['night']['windDirection'],
$data['night']['wind'],
- String::upper($units['wind']));
+ Horde_String::upper($units['wind']));
if (!empty($data['night']['windGust']) && $data['night']['windgust'] > 0) {
- $nighttime .= sprintf(_(" gusting %d%s"), $data['night']['windgust'], String::upper($units['wind']));
+ $nighttime .= sprintf(_(" gusting %d%s"), $data['night']['windgust'], Horde_String::upper($units['wind']));
}
$description = sprintf(_("Location: %s\nSunrise: %sAM Sunset: %sPM\n\nDay:\n%s\n\nEvening:\n%s"),
$location['name'],
return $objects;
}
-}
\ No newline at end of file
+}
Horde_Autoloader::addClassPattern('/^TimeObjects_/', $rto_dir);
/* Registry. */
-$session_control = Util::nonInputVar('session_control');
+$session_control = Horde_Util::nonInputVar('session_control');
if ($session_control == 'none') {
$registry = &Registry::singleton(Registry::SESSION_NONE);
} elseif ($session_control == 'readonly') {
if (!defined('TIMEOBJECTS_BASE')) {
define('TIMEOBJECTS_BASE', $rto_dir . '/..');
-}
\ No newline at end of file
+}