$title = sprintf(_("Searching for faces in %s"), Horde::link(Ansel::getUrlFor('view', array('gallery' => $gallery_id, 'view' => 'Gallery'))) . $gallery->get('name') . '</a>');
Horde::addScriptFile('stripe.js', 'horde', true);
+Horde::addScriptFile('popup.js', 'horde', true);
require ANSEL_TEMPLATES . '/common-header.inc';
require ANSEL_TEMPLATES . '/menu.inc';
require ANSEL_TEMPLATES . '/faces/gallery.inc';
array('slug' => $gallery_slug,
'bindTo' => 'gallery_slug'));
$imple->attach();
+Horde::addScriptFile('popup.js', 'horde', true);
require ANSEL_TEMPLATES . '/menu.inc';
require ANSEL_TEMPLATES . '/gallery/gallery.inc';
require $registry->get('templates', 'horde') . '/common-footer.inc';
_getRelocateLink: function(iid) {
if (options.hasEdit) {
var a = new Element('a', {href: this.options.relocateUrl + '?image=' + iid}).update(this.options.relocateText);
- a.observe('click', function(e) {popup(this.options.relocateUrl + '?image=' + iid, 750, 600); e.stop();}.bind(this));
+ a.observe('click', function(e) { Horde.popup({ url: this.options.relocateUrl, params: 'image=' + iid, width: 600, height: 750 }); e.stop();}.bind(this));
return a;
} else {
return '';
Element.setHref($('breadcrumb_gallery'), SlideController.baseUrl + '/view.php' + params + '&view=Gallery');
if ($('image_properties_link')) {
Element.setHref('image_properties_link', SlideController.baseUrl + '/image.php' + params + '&actionID=modify&share=' + SlideController.galleryShare);
- Element.setOnClick('image_properties_link', function(){SlideController.pause();popup(this.href);return false;});
+ Element.setOnClick('image_properties_link', function(){SlideController.pause();Horde.popup({ url: this.href });return false;});
}
if ($('image_edit_link')) {
Element.setHref('image_edit_link', SlideController.baseUrl + '/image.php' + params + '&actionID=editimage');
}
if ($('image_ecard_link')) {
Element.setHref('image_ecard_link', SlideController.baseUrl + '/img/ecard.php?image=' + SlideController.photos[SlideController.photoId][3] + '&gallery=' + SlideController.galleryId);
- Element.setOnClick('image_ecard_link', function(){SlideController.pause();popup(this.href);return false;});
+ Element.setOnClick('image_ecard_link', function(){SlideController.pause();Horde.popup({ url: this.href });return false;});
}
if ($('image_delete_link')) {
//TODO : Guess we should have PHP save the localized text for this...
$image->geotag('', '', '');
// Now get the "add geotag" stuff
$addurl = Horde_Util::addParameter(Horde::applicationUrl('map_edit.php'), 'image', $img);
- $addLink = Horde::link($addurl, '', '', '', 'popup(\'' . Horde_Util::addParameter(Horde::applicationUrl('map_edit.php'), 'image', $img) . '\'); return false;');
+ $addLink = Horde::link($addurl, '', '', '', Horde::popupJs(Horde::applicationUrl('map_edit.php'), array('params' => array('image' => $img), 'urlencode' => true)) . 'return false;');
$imgs = $GLOBALS['ansel_storage']->getRecentImagesGeodata(Horde_Auth::getAuth());
if (count($imgs) > 0) {
$imgsrc = '<div class="ansel_location_sameas">';
if ($conf['menu']['print'] && ($pl = Horde_Util::nonInputVar('print_link'))) {
$menu->add($pl, _("_Print"), 'print.png',
$registry->getImageDir('horde'), '_blank',
- 'popup(this.href); return false;');
+ Horde::popupJs($pl, array('urlencode' => true)) . 'return false;');
}
if ($returnType == 'object') {
Horde::addExternalScriptFile('http://maps.google.com/maps?file=api&v=2&sensor=false&key=' . $GLOBALS['conf']['api']['googlemaps'], 'ansel');
Horde::addExternalScriptFile('http://gmaps-utility-library.googlecode.com/svn/trunk/markermanager/1.1/src/markermanager.js', 'ansel');
Horde::addScriptFile('googlemap.js');
+ Horde::addScriptFile('popup.js', 'horde', true);
if ($this->_params['gallery'] != 'all') {
$gallery = $this->_getGallery();
if (is_a($gallery, 'PEAR_Error')) {
$action_links[] = Horde::link('#', '', 'widget', '', 'copySelected(); return false;') . _("Copy") . '</a>';
}
+ Horde::addScriptFiles('popup.js', 'horde', true);
include ANSEL_TEMPLATES . '/view/gallery.inc';
return ob_get_clean();
}
Ansel::attachStylesheet('lightbox.css');
Horde::addScriptFile('effects.js', 'horde', true);
Horde::addScriptFile('lightbox.js', 'ansel', true);
+ Horde::addScriptFile('popup.js', 'horde', true);
}
}
}
if ($this->_view->gallery->get('owner') == Horde_Auth::getAuth()) {
- $html .= '<li>' . Horde::link('#','','popup widget', '', "popup('" . Horde_Util::addParameter(Horde::applicationUrl('perms.php'), 'cid', $this->_view->gallery->id) . "');") . Horde::img('perms.png', '', '', $GLOBALS['registry']->getImageDir('horde')) . ' ' . _("Set permissions") . '</a></li>';
+ $html .= '<li>' . Horde::link('#', '', 'popup widget', '', Horde::popupJs(Horde::applicationUrl('perms.php'), array('params' => array('cid' => $this->_view->gallery->id), 'urlencode' => true)) . 'return false;') . Horde::img('perms.png', '', '', $GLOBALS['registry']->getImageDir('horde')) . ' ' . _("Set permissions") . '</a></li>';
} elseif (!empty($conf['report_content']['driver']) &&
(($conf['report_content']['allow'] == 'authenticated' && Horde_Auth::isAuthenticated()) ||
$conf['report_content']['allow'] == 'all')) {
{
global $ansel_storage;
- Horde::addScriptFile('popup.js', 'horde');
-
$geodata = $ansel_storage->getImagesGeodata($this->_params['images']);
$url = Horde::applicationUrl('map_edit.php', true);
$rtext = _("Relocate this image");
Horde::addExternalScriptFile('http://maps.google.com/maps?file=api&v=2&sensor=false&key=' . $GLOBALS['conf']['api']['googlemaps'], 'ansel');
Horde::addExternalScriptFile('http://gmaps-utility-library.googlecode.com/svn/trunk/markermanager/1.1/src/markermanager.js', 'ansel');
Horde::addScriptFile('googlemap.js');
+ Horde::addScriptFile('popup.js', 'horde', true);
$html = $this->_htmlBegin() . "\n";
$content = '<div id="ansel_geo_widget">';
} elseif ($permsEdit) {
// Image view, but no geotags, provide ability to add it.
$addurl = Horde_Util::addParameter(Horde::applicationUrl('map_edit.php'), 'image', $this->_params['images'][0]);
- $addLink = Horde::link($addurl, '', '', '', 'popup(\'' . Horde_Util::addParameter(Horde::applicationUrl('map_edit.php'), 'image', $this->_params['images'][0]) . '\', 750, 600); return false;');
+ $addLink = Horde::link($addurl, '', '', '', Horde::popupJs(Horde::applicationUrl('map_edit.php'), array('params' => array('image' => $this->_params['images'][0]), 'urlencode' => true)) . 'return false;');
$imgs = $ansel_storage->getRecentImagesGeodata(Horde_Auth::getAuth());
if (count($imgs) > 0) {
$imgsrc = '<div class="ansel_location_sameas">';
Horde::addExternalScriptFile('http://maps.google.com/maps?file=api&v=2&sensor=false&key=' . $GLOBALS['conf']['api']['googlemaps'], 'ansel');
Horde::addScriptFile('googlemap.js', 'ansel');
Horde::addScriptFile('googlemap_edit.js', 'ansel');
+Horde::addScriptFile('popup.js', 'horde', true);
$image_id = Horde_Util::getFormData('image');
echo Horde::link(Horde_Util::addParameter($imageurl, 'actionID', 'previewgrayscale')) . Horde::img('image/grayscale.png', '', '', $registry->getImageDir('horde')) . ' ' . _("Grayscale") . '</a> ';
}
if (Ansel::isAvailable('text_watermark')) {
- Horde::addScriptFile('popup.js', 'horde', true);
- echo Horde::link(Horde::applicationUrl(Horde_Util::addParameter($imageurl, array('actionID' => 'setwatermark', 'share' => $gallery->getName()))), '', '', '_blank', 'return !popup(this.href, 450, 250);') . Horde::img('text.png') . ' ' . _("Watermark") . '</a> ';
+ echo Horde::link('#', '', '', '_blank', Horde::popupJs(Horde::applicationUrl($imageurl), array('params' => array('actionID' => 'setwatermark', 'share' => $gallery->getName()), 'width' => 450, 'height' => 250, 'urlencode' => true)) . 'return false;') . Horde::img('text.png') . ' ' . _("Watermark") . '</a> ';
}
$selfUrl = Horde::selfUrl(true);
echo Horde::link(Horde::applicationUrl(Horde_Util::addParameter($selfUrl, array('actionID' => 'cropedit')))) . Horde::img('image/crop.png', '', '', $registry->getImageDir('horde')) . _("Crop") . '</a>';
echo Horde::link(Horde_Util::addParameter($imageurl, 'actionID', 'previewgrayscale')) . Horde::img('image/grayscale.png', '', '', $registry->getImageDir('horde')) . ' ' . _("Grayscale") . '</a> ';
}
if (Ansel::isAvailable('TextWatermark')) {
- Horde::addScriptFile('popup.js', 'horde', true);
- echo Horde::link(Horde::applicationUrl(Horde_Util::addParameter($imageurl, array('actionID' => 'setwatermark', 'share' => $gallery->getName()))), '', '', '_blank', 'return !popup(this.href, 450, 250);') . Horde::img('text.png') . ' ' . _("Watermark") . '</a> ';
+ echo Horde::link('#', '', '', '_blank', Horde::popupJs(Horde::applicationUrl($imageurl), array('params' => array('actionID' => 'setwatermark', 'share' => $gallery->getName()), 'width' => 450, 'height' => 250, 'urlencode' => true)) . 'return false;') . Horde::img('text.png') . ' ' . _("Watermark") . '</a> ';
}
$selfUrl = Horde::selfUrl(true);
echo Horde::link(Horde_Util::addParameter($imageurl, 'actionID', 'previewgrayscale')) . Horde::img('image/grayscale.png', '', '', $registry->getImageDir('horde')) . ' ' . _("Grayscale") . '</a> ';
}
if (Ansel::isAvailable('text_watermark')) {
- Horde::addScriptFile('popup.js', 'horde', true);
- echo Horde::link(Horde::applicationUrl(Horde_Util::addParameter($imageurl, array('actionID' => 'setwatermark', 'share' => $gallery->getName()))), '', '', '_blank', 'return !popup(this.href, 450, 250);') . Horde::img('text.png') . ' ' . _("Watermark") . '</a> ';
+ echo Horde::link('#', '', '', '_blank', Horde::popupJs(Horde::applicationUrl($imageurl), array('params' => array('actionID' => 'setwatermark', 'share' => $gallery->getName()), 'width' => 450, 'height' => 250, 'urlencode' => true)) . 'return false;') . Horde::img('text.png') . ' ' . _("Watermark") . '</a> ';
}
$selfUrl = Horde::selfUrl(true);
<div>
<span class="light">
<?php if ($option_edit): ?>
- <?php echo Horde::link(Horde::applicationUrl(Horde_Util::addParameter($image_url, array('actionID' => 'modify'))), '', '', '_blank', 'popup(this.href); return false;') . _("Properties") ?></a>
+ <?php echo Horde::link(Horde::applicationUrl(Horde_Util::addParameter($image_url, array('actionID' => 'modify'))), '', '', '_blank', Horde::popupJs(Horde::applicationUrl($image_url), array('params' => array('actionID' => 'modify', 'urlencode' => true))) . 'return false;') . _("Properties") ?></a>
| <?php echo Horde::link(Horde::applicationUrl(Horde_Util::addParameter($image_url, 'actionID', 'editimage'))) . _("Edit") ?></a>
<?php endif; ?>
</span>
alert('<?php echo addslashes(_("You must choose photos to edit.")) ?>');
return false;
}
- popup(imageDateUrl, 600, 250);
+ Horde.popup({ url: imageDateUrl, width: 600, height: 250 });
}
function downloadSelected()
alert('<?php echo addslashes(_("You must choose photos to edit.")) ?>');
return false;
}
- popup(imageDateUrl, 600, 250);
+ Horde.popup({ url: imageDateUrl, width: 600, height: 250 });
}
function downloadSelected()
$actionHTML = '';
if ($this->gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT) && empty($this->_params['api'])) {
$needSeperator = true;
- $actionHTML .= Horde::link(Horde::applicationUrl(Horde_Util::addParameter($imageActionUrl, array('actionID' => 'modify', 'ret' => 'image'))), '', '', '_blank', 'popup(this.href); return false;', '', '', array('id' => 'image_properties_link')) . _("Properties") . '</a>';
+ $actionHTML .= Horde::link('#', '', '', '_blank', Horde::popupJs(Horde::applicationUrl($imageActionUrl), array('params' => array('actionID' => 'modify', 'ret' => 'image'), 'urlencode' => true)) . 'return false;', '', '', array('id' => 'image_properties_link')) . _("Properties") . '</a>';
$actionHTML .= ' | ' . Horde::link(Horde::applicationUrl(Horde_Util::addParameter($imageActionUrl, 'actionID', 'editimage')), '', '', '', '', '', '', array('id' => 'image_edit_link')) . _("Edit") . '</a>';
}
if ($this->gallery->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE) && empty($this->_params['api'])) {
<tr class="control">
<td>
<?php if ($this->gallery->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)): ?>
- <?php echo Horde::link(Horde::applicationUrl(Horde_Util::addParameter($imageActionUrl, array('actionID' => 'modify', 'share' => $this->gallery->getName(), 'ret' => 'image'))), '', '', '_blank', 'SlideController.pause();popup(this.href); return false;', '', '', array('id' => 'image_properties_link')) . _("Properties") ?></a>
+ <?php echo Horde::link(Horde::applicationUrl(Horde_Util::addParameter($imageActionUrl, array('actionID' => 'modify', 'share' => $this->gallery->getName(), 'ret' => 'image'))), '', '', '_blank', 'SlideController.pause();' . Horde::popupJs(Horde::applicationUrl($imageActionUrl), array('params' => array('actionID' => 'modify', 'share' => $this->gallery->getName(), 'ret' => 'image'), 'urlencode' => true)) . 'return false;', '', '', array('id' => 'image_properties_link')) . _("Properties") ?></a>
| <?php echo Horde::link(Horde::applicationUrl(Horde_Util::addParameter($imageActionUrl, 'actionID', 'editimage')), '', '', '', '', '', '', array('id' => 'image_edit_link')) . _("Edit") ?></a>
<?php endif; ?>
<?php if ($this->gallery->hasPermission(Horde_Auth::getAuth(), PERMS_DELETE)): ?>
<td class="rightAlign">
<?php if (!empty($conf['ecard']['enable'])): ?>
- <?php echo Horde::link($ecardurl, '', '', '_blank', 'SlideController.pause();popup(this.href); return false;', '', '', array('id' => 'image_ecard_link')) . _("Send an Ecard") ?></a> |
+ <?php echo Horde::link($ecardurl, '', '', '_blank', 'SlideController.pause();' . Horde::popupJs($ecardurl, array('urlencode' => true)) . 'return false;', '', '', array('id' => 'image_ecard_link')) . _("Send an Ecard") ?></a> |
<?php endif; ?>
<?php echo Horde::link(Horde::applicationUrl(Horde_Util::addParameter('img/download.php', 'image', $imageId)), '', '', '', 'SlideController.pause();', '', '', array('id' => 'image_download_link')) . _("Download Original Photo") ?></a>
</td>
$title = $view->getTitle();
$view_html = $view->html();
-Horde::addScriptFile('popup.js', 'horde', true);
require ANSEL_TEMPLATES . '/common-header.inc';
require ANSEL_TEMPLATES . '/menu.inc';
echo $view_html;
$notification->push(_("Access denied deleting all accounts and postings."), 'horde.error');
} else {
$storage = &Fima_Driver::singleton($ledger);
-
+
/* Delete all. */
$result = $storage->deleteAll();
if (is_a($result, 'PEAR_Error')) {
$accountlist = Fima::listAccounts();
foreach ($accountlist as $accountId => $account) {
$accounts[$accountId] = $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']);
} else {
$accounts[$accountId]['parent_number'] = '';
$accounts[$accountId]['parent_name'] = '';
}
-
+
$accounts[$accountId]['icon'] = $accounts[$accounts[$accountId]['parent_id']]['icon'];
$accounts[$accountId]['closed'] = $account['closed'];
$accounts[$accountId]['expanded'] = false;
/* Print. */
$print_view = (bool)Horde_Util::getFormData('print');
if (!$print_view) {
- Horde::addScriptFile('popup.js', 'horde', true);
$print_link = Horde::applicationUrl(Horde_Util::addParameter('accounts.php', array('print' => 1)));
}
$perms_img = Horde::img('perms.png', _("Change Permissions"), null, $registry->getImageDir('horde'));
$delete_img = Horde::img('delete.png', _("Delete"), null, $registry->getImageDir('horde'));
-Horde::addScriptFile('popup.js', 'horde', true);
Horde::addScriptFile('tables.js', 'turba', true);
$title = _("Manage Ledgers");
require FIMA_TEMPLATES . '/common-header.inc';
return $accounts;
}
-
+
function getAccount($account)
{
$ledger = Fima::getActiveLedger();
/* Create a Fima storage instance. */
$storage = &Fima_Driver::singleton($ledger);
- $storage->retrievePostings($filters,
+ $storage->retrievePostings($filters,
array('posting_' . $prefs->getValue('sortby') . ' ' . ($prefs->getValue('sortdir') ? 'DESC' : 'ASC'),
'posting_' . $prefs->getValue('altsortby')),
$limit);
function getPostingsCount()
{
$ledger = Fima::getActiveLedger();
-
+
/* Create a Fima storage instance. */
$storage = &Fima_Driver::singleton($ledger);
return $storage->_postingsCount;
}
-
-
+
+
/**
* Get grouped results from storage.
*
*/
function getResults($groups = array(), $filters = array()) {
$ledger = Fima::getActiveLedger();
-
+
/* Create a Fima storage instance. */
$storage = &Fima_Driver::singleton($ledger);
return $storage->getResults($groups, $filters);
function getAssetResults($postingtype, $perdate = null)
{
$ledger = Fima::getActiveLedger();
-
+
/* Create a Fima storage instance. */
$storage = &Fima_Driver::singleton($ledger);
return $storage->getAssetResults($postingtype, $perdate);
function getPostingsResult()
{
$ledger = Fima::getActiveLedger();
-
+
/* Create a Fima storage instance. */
$storage = &Fima_Driver::singleton($ledger);
return $storage->_postingsResult;
function buildAccountWidget($name, $value = '', $params = null, $blank = false, $multiple = false, $filters = array(), $hideclosed = false)
{
$accounts = Fima::listAccounts($filters);
-
+
$html = '<select id="' . $name . '" name="' . $name . '"';
if (!is_null($params)) {
$html .= ' ' . $params;
if ($blank !== false) {
$html .= '<option value="">' . htmlspecialchars($blank) . '</option>';
}
-
+
$accounts = Fima::listAccounts($filters);
foreach ($accounts as $accountId => $account) {
if ($hideclosed && $account['closed'] && $accountId != $value) {
}
$html .= htmlspecialchars($account['label']) . '</option>';
}
-
+
return $html . "</select>\n";
}
if ($blank !== false) {
$html .= '<option value="">' . htmlspecialchars($blank) . '</option>';
}
-
+
foreach ($types as $typeValue => $typeLabel) {
$html .= '<option value="' . $typeValue . '"';
if ($multiple && is_array($value)) {
}
$html .= htmlspecialchars($typeLabel) . '</option>';
}
-
+
return $html . "</select>\n";
}
if ($blank !== false) {
$html .= '<option value="">' . htmlspecialchars($blank) . '</option>';
}
-
+
foreach ($types as $typeValue => $typeLabel) {
$html .= '<option value="' . $typeValue . '"';
if ($multiple && is_array($value)) {
}
$html .= htmlspecialchars($typeLabel) . '</option>';
}
-
+
return $html . "</select>\n";
}
function buildDateWidget($name, $value = 0, $params = null, $blank = false, $periodonly = false)
{
$value = ($value !== 0) ? explode('-', date('Y-n-j', $value)) : array(date('Y'), 0, 0);
-
+
/* Year. */
$html = '<input id="' . $name . '[year]" name="' . $name . '[year]" type="text" value="' . $value[0] . '" onchange="updateWday(\'' . $name . '\');" size="4" maxlength="4"';
if (!is_null($params)) {
$html .= ' ' . $params;
}
$html .= ' />' . "\n";
-
+
/* Month. */
$html .= '- <select id="' . $name . '[month]" name="' . $name . '[month]" onchange="updateWday(\'' . $name . '\');"';
if (!is_null($params)) {
$html .= htmlspecialchars(strftime('%b', mktime(0, 0, 0, $i, 1))) . '</option>';
}
$html .= '</select>' . "\n";
-
+
/* Period only? */
if ($periodonly) {
return $html;
}
-
+
/* Day. */
$html .= '- <select id="' . $name . '[day]" name="' . $name . '[day]" onchange="updateWday(\'' . $name . '\');"';
if (!is_null($params)) {
$html .= Horde::img('calendar.png', _("Set date"), 'align="top" id="' . $name . '_img"', $GLOBALS['registry']->getImageDir('horde'));
$html .= '</a>' . "\n";
}
-
+
return $html;
}
-
+
/**
* Get account types.
*
return $types;
}
}
-
+
/**
* Get posting types.
*
return $types;
}
}
-
+
/**
* Convert an amount from the interface to a float value.
*
function convertAmountToValue($amount)
{
global $prefs;
-
+
$format = $prefs->getValue('amount_format');
return (float)str_replace(array($format{0}, $format{1}), array('', '.'), $amount);
}
-
+
/**
* Convert a float number to an amount for the interface.
*
function convertValueToAmount($value)
{
global $prefs;
-
+
$format = $prefs->getValue('amount_format');
return number_format($value, 2, $format{1}, $format{0});
}
-
+
/*
* Convert a formatted date to a unix timestamp.
*
if ($date == '') {
return false;
}
-
+
if (preg_match('/[^%a-zA-Z]/', $format, $seperator) === false) {
return false;
}
-
+
$formatparts = explode($seperator[0], $format);
$dateparts = explode($seperator[0], $date);
-
+
foreach ($formatparts as $key => $fmt) {
$dateparts[$fmt] = $dateparts[$key];
}
-
+
$stamp = mktime(0, 0, 0, $dateparts['%m'], $dateparts['%d'], $dateparts['%Y']);
-
+
return $stamp;
}
-
+
/**
* Convert a date format to a format useable when entering postings.
*
$format = '%x';
break;
}
-
+
if ($format == '%x') {
$fmts = array('%Y-%m-%d', '%d/%m/%Y', '%d.%m.%Y', '%m/%d/%Y');
foreach ($fmts as $fmt) {
return $format;
}
-
+
/**
* Convert a date format to a period format useable for reports.
*
return $format;
}
-
+
/**
* Convert wildcards in a text to SQL wildcards.
*
function convertWildcards($text)
{
global $prefs;
-
+
$wildcards = $prefs->getValue('wildcard_format');
if ($wildcards == 'dos') {
$text = str_replace(array('\\*', '\\?'), array(chr(0xe), chr(0xf)), $text);
}
return $text;
}
-
+
/**
* Initial app setup code.
*/
}
$GLOBALS['prefs']->setValue('display_ledgers', serialize($GLOBALS['display_ledgers']));
-
+
/* Update active ledger. */
if (($changeledger = Horde_Util::getFormData('changeledger')) !== null) {
$GLOBALS['prefs']->setValue('active_ledger', $changeledger);
function getMenu($returnType = 'object')
{
global $conf, $registry, $browser, $print_link;
-
+
$actionID = Horde_Util::getFormData('actionID');
-
+
$menu = new Horde_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(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');
-
+
if (Horde_Auth::getAuth()) {
$menu->add(Horde::applicationUrl('ledgers/index.php'), _("_My Ledgers"), 'accounts.png');
}
-
+
/* Reports. */
$menu->add(Horde::applicationUrl('report.php'), _("_Reports"), 'report.png');
-
+
/* Import/Export. */
$menu->add(Horde::applicationUrl('data.php'), _("_Import/Export"), 'data.png', $registry->getImageDir('horde'));
/* Print. */
if (isset($print_link)) {
- $menu->add($print_link, _("_Print"), 'print.png', $registry->getImageDir('horde'), '_blank', 'popup(this.href); return false;', '__noselection');
+ $menu->add($print_link, _("_Print"), 'print.png', $registry->getImageDir('horde'), '_blank', Horde::popupJs($print_link, array('urlencode' => true)) . 'return false;', '__noselection');
}
if ($returnType == 'object') {
$posting_eos = Horde_Util::getFormData('eo');
$posting_amounts = Horde_Util::getFormData('amount');
$posting_descs = Horde_Util::getFormData('desc');
-
+
$postings = array();
$savecount = 0;
-
+
$storage = &Fima_Driver::singleton($ledger);
foreach($postingset as $index => $posting_id) {
$posting_valid = true;
-
+
if ($posting_dates[$index] !== '' || $posting_assets[$index] !== '' || $posting_accounts[$index] !== '' ||
$posting_amounts[$index] !== '' || $posting_descs[$index] !== '') {
} elseif ($posting_date <= $closedperiod) {
$posting_valid = false;
}
-
+
/* Check asset account and account. */
if ($posting_asset === '' || $posting_account === '') {
$posting_valid = false;
} elseif ($posting_asset === $posting_account) {
continue;
}
-
+
/* Fix amount sign. */
if ($prefs->getValue('expenses_sign') == 0) {
$account = Fima::getAccount($posting_account);
}
}
}
-
+
/* If $posting_id is set, we're modifying an existing account. Otherwise,
* we're adding a new posting with the provided attributes. */
if ($posting_valid) {
$savecount++;
}
}
-
+
/* Reload invalid or unsaved postings. */
if (!$posting_valid) {
$postings[] = array('posting_id' => $posting_id,
'desc' => $posting_desc);
}
}
- }
+ }
if ($savecount > 0) {
$notification->push(sprintf(_("Saved %d postings."), $savecount), 'horde.success');
$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);
$shiftcount = 0;
header('Location: ' . Horde::applicationUrl('postings.php', true));
exit;
break;
-
+
case 'copymove_postings':
$share = &$GLOBALS['fima_shares']->getShare($ledger);
if (!$share->hasPermission(Horde_Auth::getAuth(), PERMS_EDIT)) {
if ($summarize != 'none') {
$accounts = Fima::listAccounts();
$postingscopy = array();
-
+
foreach ($postings as $postingId => $posting) {
$asset = (isset($accounts[$posting['asset']]))
? (($accounts[$posting['asset']]['parent_id'] !== null) ? $accounts[$posting['asset']]['parent_id'] : $accounts[$posting['asset']]['account_id'])
$account = (isset($accounts[$posting['account']]))
? (($accounts[$posting['account']]['parent_id'] !== null) ? $accounts[$posting['account']]['parent_id'] : $accounts[$posting['account']]['account_id'])
: $posting['account'];
-
+
if ($summarize == 'combine') {
$copyId = $asset . '_' . $account . '_' . strftime('%Y%m', $posting['date']);
} elseif ($summarize == 'post') {
$copyIdAsset = $asset . '_' . strftime('%Y%m', $posting['date']);
$copyIdAccount = $account . '_' . strftime('%Y%m', $posting['date']);
-
+
if (isset($postingscopy[$copyIdAsset])) {
$postingscopy[$copyIdAsset]['amount'] += $posting['amount'];
} else {
$postingscopy[$copyIdAsset]['eo'] = 0;
$postingscopy[$copyIdAsset]['desc'] = _("Summarized");
}
-
+
if (isset($postingscopy[$copyIdAccount])) {
$postingscopy[$copyIdAccount]['amount'] += $posting['amount'];
} else {
if ($addcount > 0) {
$notification->push(sprintf($summarize ? _("Summarized %d postings.") : _("Transfered %d postings."), $addcount), 'horde.success');
}
-
+
/* Delete original postings. */
if (!$keep) {
$delcount = 0;
header('Location: ' . Horde::applicationUrl('postings.php', true));
exit;
break;
-
+
default:
break;
}
/* Print. */
$print_view = (bool)Horde_Util::getFormData('print');
if (!$print_view && $pageOb['mode'] == 'list') {
- Horde::addScriptFile('popup.js', 'horde', true);
$print_link = Horde_Util::addParameter(Horde::applicationUrl('postings.php'), array('print' => 1));
}
case 'amount_end': $filters[] = array('amount', Fima::convertAmountToValue($search), '<='); break;
case 'eo': $filters[] = array('eo', (int)(bool)$search);
default: break;
- }
+ }
}
}
$flags = array();
foreach ($postings as $postingId => $posting) {
$postings[$postingId]['desc'] = htmlspecialchars($posting['desc']);
-
+
if (isset($accounts[$posting['asset']])) {
$postings[$postingId]['asset_label'] = htmlspecialchars($accounts[$posting['asset']]['label']);
$postings[$postingId]['asset_closed'] = $accounts[$posting['asset']]['closed'];
$postings[$postingId]['account_type_eo'] = '';
$postings[$postingId]['account_closed'] = false;
}
-
+
$flag = 0;
$flagpos = 0;
foreach ($accounttypes as $typeId => $typeLabel) {
$pageOb['postings_count'] = sprintf(_("%s to %s of %s Postings"),
($pageOb['page'] - 1) * $pageOb['postings_perpage'] + 1,
min($pageOb['page'] * $pageOb['postings_perpage'], $pageOb['postings_total']),
- $pageOb['postings_total']);
+ $pageOb['postings_total']);
}
}
/* Add current date in first field if no postings. */
foreach ($postings as $key => $value) {
- if ($value['date'] == '') {
+ if ($value['date'] == '') {
$notification->push('document.getElementById(\'date1\').value = \'' . strftime($datefmt) . '\';', 'javascript');
}
break;
<td><?php echo htmlspecialchars($ledger->get('name')) ?></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 Horde_Util::addParameter($perms_url_base, 'share', $ledger->getName()) ?>" target="_blank" title="<?php echo _("Change Permissions") ?>"><?php echo $perms_img ?></a></td>
+ <td><a onclick="<?php echo Horde::popupJs($perms_url_base, array('params' => array('share' => $ledger->getName()), 'urlencode' => true)) ?>return false;" 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 Horde_Util::addParameter($delete_url_base, 'l', $ledger->getName()) ?>" title="<?php echo _("Delete") ?>"><?php echo $delete_img ?></a></td>
</tr>
$members_url = Horde::applicationUrl('edit/friends/friends.php');
$members_img = Horde::img('group.png', '', '', $registry->getImageDir('horde'));
-Horde::addScriptFile('popup.js', 'horde', true);
-
require FOLKS_TEMPLATES . '/common-header.inc';
require FOLKS_TEMPLATES . '/menu.inc';
}
}
-Horde::addScriptFile('popup.js', 'horde', true);
-
require FOLKS_TEMPLATES . '/common-header.inc';
require FOLKS_TEMPLATES . '/menu.inc';
if ($friends->hasCapability('groups_add')) {
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 '<td><a href="#" onclick="' . Horde::popupJs($perms_url, array('params' => array('cid' => $group_id), 'urlencode' => true)) . '">' . $perms_img . ' ' . _("Permissions") . '</a></td>';
}
echo '</tr>';
}
}
if ($GLOBALS['browser']->hasFeature('javascript')) {
- Horde::addScriptFile('popup.js', 'horde', true);
$imgId = $varname .'goto';
$html .= '<div id="goto" class="headerbox"
style="position:absolute;visibility:hidden;padding:0"></div>';
- $html .= Horde::link('#', _("Select an object"), '', '', 'obrowserWindow = popup(\'' . $GLOBALS['registry']->get('webroot', 'horde') . '/services/obrowser/' . '\'); obrowserWindowName = obrowserWindow.name; return false;') . Horde::img('tree/leaf.png', _("Object"), 'id="' . $imgId . '" align="middle"', $GLOBALS['registry']->getImageDir('horde')) . "</a>\n";
+ $html .= Horde::link('#', _("Select an object"), '', '', 'obrowserWindow = ' Horde::popupJs($GLOBALS['registry']->get('webroot', 'horde') . '/services/obrowser/') . 'obrowserWindowName = obrowserWindow.name; return false;') . Horde::img('tree/leaf.png', _("Object"), 'id="' . $imgId . '" align="middle"', $GLOBALS['registry']->getImageDir('horde')) . "</a>\n";
}
return $html;
+++ /dev/null
-/**
- * Gollem Popup JavaScript.
- *
- * Provides the javascript to open popup windows.
- * This file should be included via Horde::addScriptFile().
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- */
-
-/**
- * Open a popup window.
- *
- * @param string $url The URL to open in the popup window.
- * @param integer $width The width of the popup window. (Default: 600 px)
- * @param integer $height The height of the popup window. (Default: 500 px)
- * @param string $args Any additional args to pass to the script.
- * (Default: no args)
- */
-function popup_gollem(url, width, height, args)
-{
- if (!width) {
- width = 600;
- }
- var screen_width = screen.width;
- if (width > (screen_width - 75)) {
- width = screen_width - 75;
- }
-
- if (!height) {
- height = 500;
- }
- var screen_width = screen.width;
- if (width > (screen_width - 75)) {
- width = screen_width - 75;
- }
-
- var now = new Date();
- var name = now.getTime();
-
- if (url.indexOf('?') == -1) {
- var glue = '?';
- } else {
- var glue = '&';
- }
-
- if (args != '') {
- url = url + glue + unescape(args) + '&uniq=' + name;
- } else {
- url = url + glue + 'uniq=' + name;
- }
-
- param = 'toolbar=no,location=no,status=yes,scrollbars=yes,resizable=yes,width=' + width + ',height=' + height + ',left=0,top=0';
- win = window.open(url, name, param);
- if (!win) {
- alert(GollemText.popup_block);
- } else {
- if (typeof win.name == 'undefined') {
- win.name = name;
- }
- if (typeof win.opener == 'undefined') {
- win.opener = self;
- }
- win.focus();
- }
-}
if ($_SESSION['gollem']['backends'][$backend_key]['quota_val'] != -1) {
if ($GLOBALS['browser']->hasFeature('javascript')) {
- Horde::addScriptFile('popup.js');
- $quota_url = "javascript:popup_gollem('" . Horde::applicationUrl('quota.php') . "',300,300,'" . addslashes('backend=' . $backend_key) . "');";
+ $quota_url = 'javascript:' . Horde::popupJs(Horde::applicationUrl('quota.php'), array('params' => ('backend' => $backend_key), 'height' => 300, 'width' => 300, 'urlencode' => true));
} else {
$quota_url = Horde_Util::addParameter(Horde::applicationUrl('quota.php'), 'backend', $backend_key);
}
function _gollem_selectlistLink($link_text, $link_style, $formid,
$icon = false, $selectid = '')
{
- Horde::addScriptFile('popup.js', 'gollem');
- $link = Horde::link('#', $link_text, $link_style, '_blank', "popup_gollem('" . Horde::applicationUrl(Horde_Util::addParameter('selectlist.php', array('formid' => $formid, 'cacheid' => $selectid))) . "', 300, 500); return false;");
+ $link = Horde::link('#', $link_text, $link_style, '_blank', Horde::popupJs(Horde::applicationUrl('selectlist.php'), array('params' => array('formid' => $formid, 'cacheid' => $selectid), 'height' => 500, 'width' => 300, 'urlencode' => true)) . 'return false;');
if ($icon) {
$link_text = Horde::img('gollem.png', $link_text);
}
// Edit link if possible.
if (strpos($mime_type, 'text/') === 0) {
$url = Horde_Util::addParameter($edit_url, array('actionID' => 'edit_file', 'type' => $val['type'], 'file' => $val['name'], 'dir' => $currdir, 'driver' => $GLOBALS['gollem_be']['driver']));
- $item['edit'] = Horde::link($url, '', '', '_blank', 'popup(this.href); return false;') . $edit_img . '</a>';
+ $item['edit'] = Horde::link('#', '', '', '_blank', Horde::popupJs($url) . 'return false;') . $edit_img . '</a>';
}
// We can always download files.
// Try a view link.
$url = Horde_Util::addParameter($view_url, array('actionID' => 'view_file', 'type' => $val['type'], 'file' => $val['name'], 'dir' => $currdir, 'driver' => $GLOBALS['gollem_be']['driver']));
- $item['link'] = Horde::link($url, '', '', '_blank', 'popup(this.href); return false;') . $name . '</a>';
+ $item['link'] = Horde::link('#', '', '', '_blank', Horde::popupJs($url) . 'return false;') . $name . '</a>';
break;
}
);
Horde::addScriptFile('manager.js', 'gollem', true);
-Horde::addScriptFile('popup.js', 'gollem', true);
Horde::addScriptFile('tables.js', 'horde', true);
require GOLLEM_TEMPLATES . '/common-header.inc';
/* Gettext strings used in core javascript files. */
$gettext = array_map('addslashes', array(
- /* Strings used in popup.js */
- 'popup_block' => _("A popup window could not be opened. Perhaps you have set your browser to block popup windows?"),
-
/* Strings used in login.js */
'login_username' => _("Please provide your username."),
'login_password' => _("Please provide your password."),
$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(\'' . Horde_Util::addParameter(Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/shares/edit.php', true), array('app' => 'ingo', 'share' => htmlspecialchars($_SESSION['ingo']['backend']['id'] . ':' . Horde_Auth::getAuth())), null, false) . '\');return false;');
+ $menu->add('#', _("_Permissions"), 'perms.png', $GLOBALS['registry']->getImageDir('horde'), '', Horde::popupJs(Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/shares/edit.php', true), array('params' => array('app' => 'ingo', 'share' => $_SESSION['ingo']['backend']['id'] . ':' . Horde_Auth::getAuth()), 'urlencode' => true)) . 'return false;');
}
- if ($returnType == 'object') {
- return $menu;
- } else {
- return $menu->render();
- }
+ return ($returnType == 'object') ? $menu : $menu->render();
}
}
$perms_img = Horde::img('perms.png', _("Change Permissions"), null, $registry->getImageDir('horde'));
$delete_img = Horde::img('delete.png', _("Delete"), null, $registry->getImageDir('horde'));
-Horde::addScriptFile('popup.js', 'horde', true);
Horde::addScriptFile('tables.js', 'horde', true);
$title = _("Manage Calendars");
require KRONOLITH_TEMPLATES . '/common-header.inc';
$print_view = (bool)Horde_Util::getFormData('print');
Horde::addScriptFile('tooltips.js', 'horde', true);
-if (!$print_view) {
- Horde::addScriptFile('popup.js', 'horde', true);
-}
require KRONOLITH_TEMPLATES . '/common-header.inc';
if ($print_view) {
$title = $view->getTitle();
$print_view = (bool)Horde_Util::getFormData('print');
-if (!$print_view) {
- Horde::addScriptFile('popup.js', 'horde', true);
-}
require KRONOLITH_TEMPLATES . '/common-header.inc';
if ($print_view) {
}
$help_link = Horde::getServiceLink('help', 'kronolith');
if ($help_link) {
- $help_link = Horde::widget($help_link, _("Help"), 'helplink', 'help', 'popup(this.href); return false;');
+ $help_link = Horde::widget($help_link, _("Help"), 'helplink', 'help', Horde::popupJs($help_link, array('urlencode' => true)) . 'return false;');
}
$today = Kronolith::currentDate();
$remote_calendars = @unserialize($prefs->getValue('remote_cals'));
/* Print. */
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');
+ Horde::addScriptFiles('popup.js', 'horde', true);
+ $menu->add(Horde_Util::addParameter($view->link(), 'print', 1), _("_Print"), 'print.png', $registry->getImageDir('horde'), '_blank', 'Horde.popup({ url: kronolithPrintLink ? kronolithPrintLink : this.href });return false;', '__noselection');
}
- if ($returnType == 'object') {
- return $menu;
- } else {
- return $menu->render();
- }
+ return ($returnType == 'object') ? $menu : $menu->render();
}
/**
$tags = implode(',', array_values($tags));
echo '<div id="EditEvent"' . ($active ? '' : ' style="display:none"') . '>';
+ Horde::addScriptFiles('popup.js', 'horde', true);
require KRONOLITH_TEMPLATES . '/edit/javascript.inc';
require KRONOLITH_TEMPLATES . '/edit/edit.inc';
echo '</div>';
$print_view = (bool)Horde_Util::getFormData('print');
Horde::addScriptFile('tooltips.js', 'horde', true);
-if (!$print_view) {
- Horde::addScriptFile('popup.js', 'horde', true);
-}
require KRONOLITH_TEMPLATES . '/common-header.inc';
if ($print_view) {
$title = _("Add a new event");
$calendars = Kronolith::listCalendars(false, PERMS_EDIT | PERMS_DELEGATE);
+Horde::addScriptFiles('popup.js', 'horde', true);
require KRONOLITH_TEMPLATES . '/common-header.inc';
require KRONOLITH_TEMPLATES . '/menu.inc';
require KRONOLITH_TEMPLATES . '/edit/javascript.inc';
<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 Horde_Util::addParameter($perms_url_base, 'share', $calendar->getName()) ?>" target="_blank" title="<?php echo _("Change Permissions") ?>"><?php echo $perms_img ?></a></td>
+ <td><a onclick="<?php echo Horde::popupJs($perms_url_base, array('params' => array('share' => $calendar->getName()), 'urlencode' => true)) ?>return false" 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 Horde_Util::addParameter($delete_url_base, 'c', $calendar->getName()) ?>" title="<?php echo _("Delete") ?>"><?php echo $delete_img ?></a></td>
<?php endif; ?>
<tr>
<td></td>
<td colspan="4">
- <?php echo Horde::link(Horde::applicationUrl('attendees.php'), '', 'button', '_blank', 'date = $H({ year: $F(\'start_year\'), month: $F(\'start_month\'), mday: $F(\'start_day\') }); this.href += (this.href.indexOf(\'?\') == -1 ? \'?\' : \'&\') + date.toQueryString(); return !popup(this.href);') . _("Edit Attendees") . '</a>' ?>
+ <?php echo Horde::link(Horde::applicationUrl('attendees.php'), '', 'button', '_blank', 'date = $H({ year: $F(\'start_year\'), month: $F(\'start_month\'), mday: $F(\'start_day\') }); this.href += (this.href.indexOf(\'?\') == -1 ? \'?\' : \'&\') + date.toQueryString();Horde.popup({ url: this.href });return false;') . _("Edit Attendees") . '</a>' ?>
</td>
</tr>
</tbody>
$print_view = (bool)Horde_Util::getFormData('print');
Horde::addScriptFile('tooltips.js', 'horde', true);
-if (!$print_view) {
- Horde::addScriptFile('popup.js', 'horde', true);
-}
require KRONOLITH_TEMPLATES . '/common-header.inc';
if ($print_view) {
$print_view = (bool)Horde_Util::getFormData('print');
Horde::addScriptFile('tooltips.js', 'horde', true);
-if (!$print_view) {
- Horde::addScriptFile('popup.js', 'horde', true);
-}
require KRONOLITH_TEMPLATES . '/common-header.inc';
if ($print_view) {
$print_view = (bool)Horde_Util::getFormData('print');
Horde::addScriptFile('tooltips.js', 'horde', true);
-if (!$print_view) {
- Horde::addScriptFile('popup.js', 'horde', true);
-}
require KRONOLITH_TEMPLATES . '/common-header.inc';
if ($print_view) {
/* Print. */
if ($conf['menu']['print'] && isset($print_link)) {
- $menu->add($print_link, _("_Print"), 'print.png', $registry->getImageDir('horde'), '_blank', 'popup(this.href); return false;', '__noselection');
+ $menu->add($print_link, _("_Print"), 'print.png', $registry->getImageDir('horde'), '_blank', Horde::popupJs($print_link, array('urlencode' => true)) . 'return false;', '__noselection');
}
- if ($returnType == 'object') {
- return $menu;
- } else {
- return $menu->render();
- }
+ return ($returnType == 'object') $menu : $menu->render();
}
function status()
$print_view = (bool)$vars->print;
if (!$print_view) {
- Horde::addScriptFile('popup.js', 'horde', true);
Horde::addScriptFile('tooltips.js', 'horde', true);
Horde::addScriptFile('effects.js', 'horde', true);
Horde::addScriptFile('QuickFinder.js', 'horde', true);
$perms_img = Horde::img('perms.png', _("Change Permissions"), null, $registry->getImageDir('horde'));
$delete_img = Horde::img('delete.png', _("Delete"), null, $registry->getImageDir('horde'));
-Horde::addScriptFile('popup.js', 'horde', true);
Horde::addScriptFile('tables.js', 'horde', true);
$title = _("Manage Task Lists");
require NAG_TEMPLATES . '/common-header.inc';
$print_view = null;
$actionID = null;
-Horde::addScriptFile('popup.js', 'horde', true);
Horde::addScriptFile('tooltips.js', 'horde', true);
Horde::addScriptFile('effects.js', 'horde', true);
Horde::addScriptFile('QuickFinder.js', 'horde', true);
if (Horde_Auth::getAuth() && (!$GLOBALS['prefs']->isLocked('categories') ||
!$GLOBALS['prefs']->isLocked('category_colors'))) {
$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>';
+ echo ' ' . Horde::link($categoryUrl, _("Edit categories and colors"), '', '_blank', Horde::popupJs($categoryUrl, array('urlencode' => true)) . 'return false;') . Horde::img('colorpicker.png', _("Edit categories and colors"), '', $GLOBALS['registry']->getImageDir('horde')) . '</a>';
}
?>
</th>
<td><?php $url = $webdav ? $subscribe_url_base . $tasklist->get('owner') . '/' . $tasklist->getName() . '.ics' : Horde_Util::addParameter($subscribe_url_base, 't', $tasklist->getName(), false) ?><a href="<?php echo htmlspecialchars($url) ?>" title="<?php echo _("Click or copy this URL to display this task list") ?>" target="_blank"><?php echo htmlspecialchars(shorten_url($url)) ?></a></td>
<td><a href="<?php echo Horde_Util::addParameter($edit_url_base, 't', $tasklist->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 Horde_Util::addParameter($perms_url_base, 'share', $tasklist->getName()) ?>" target="_blank" title="<?php echo _("Change Permissions") ?>"><?php echo $perms_img ?></a></td>
+ <td><a onclick="<?php Horde::popupJs($perms_url_base, array('params' => array('share' => $tasklist->getName()), 'urlencode' => true)) ?>return false;" target="_blank" title="<?php echo _("Change Permissions") ?>"><?php echo $perms_img ?></a></td>
<?php endif; ?>
<td><a href="<?php echo Horde_Util::addParameter($delete_url_base, 't', $tasklist->getName()) ?>" title="<?php echo _("Delete") ?>"><?php echo $delete_img ?></a></td>
</tr>
$print_view = (bool)Horde_Util::getFormData('print');
$links = array();
if (!$print_view) {
- Horde::addScriptFile('popup.js', 'horde', true);
Horde::addScriptFile('stripe.js', 'horde', true);
$taskurl = Horde_Util::addParameter('task.php',
// Output
Horde::addScriptFile('tables.js', 'horde', true);
-Horde::addScriptFile('popup.js', 'horde', true);
require_once NEWS_TEMPLATES . '/common-header.inc';
require_once NEWS_TEMPLATES . '/menu.inc';
$template_path = News::getTemplatePath($row['category1'], 'news');
$browse_url = Horde::applicationUrl('browse.php');
-Horde::addScriptFile('popup.js', 'horde', true);
require_once NEWS_TEMPLATES . '/common-header.inc';
require_once NEWS_TEMPLATES . '/menu.inc';
echo Horde::link(Horde_Util::addParameter($url,'version', $version['version']),_("Renew")) . _("Renew") . '</a> | ';
$url = Horde_Util::addParameter(Horde::applicationUrl('diff.php'), array('id' => $id, 'version' => $version['version']));
- echo Horde::link('#', _("Diff"), '', '', "popup('$url')") . _("Diff") . '</a> ';
+ echo Horde::link('#', _("Diff"), '', '', Horde::popupJs($url, array('urlencode' => true)) . 'return false;') . _("Diff") . '</a> ';
echo ')<br />' . "\n";
}
<td>
<?php
$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>';
+echo Horde::link('#', $row['view_count'], '', '', Horde::popupJs($url, array('urlencode' => true)) . 'return false', $row['view_count']) . number_format($row['view_count']) . '</a>';
?>
</td>
<?php
}
$path = $GLOBALS['registry']->get('webroot', 'horde') . '/vfs/.horde/ansel/';
-$dim = $conf['images']['image_height'] . ',' . $conf['images']['image_width'];
echo '<br /><div style="text-lign: center;">';
foreach ($images as $image_id => $image) {
$img_url = substr($image_id, -2) . '/%s/' . $image_id . '.jpg';
echo "\n" . '<div class="imggallery">' .
- Horde::link('#', $image['name'], '', '', 'popup(\'' . $path . sprintf($img_url, 'screen') . '\',' . $dim . ')') . "\n" .
+ Horde::link('#', $image['name'], '', '', Horde::popupJs($path . sprintf($img_url, 'screen'), array('width' => $conf['images']['image_width'], 'height' => $conf['images']['image_height'], 'urlencode' => true)). 'return false') . "\n" .
'<img src="' . $path . sprintf($img_url, 'thumb') . '" />' .
$image['caption']. '</a></div>';
}
$perms_img = Horde::img('perms.png', _("Change Permissions"), null, $registry->getImageDir('horde'));
$delete_img = Horde::img('delete.png', _("Delete"), null, $registry->getImageDir('horde'));
-Horde::addScriptFile('popup.js', 'horde', true);
Horde::addScriptFile('tables.js', 'horde', true);
$title = _("Manage Classes");
require SKOLI_TEMPLATES . '/common-header.inc';
break;
}
-Horde::addScriptFile('popup.js', 'horde', true);
Horde::addScriptFile('tooltips.js', 'horde', true);
Horde::addScriptFile('effects.js', 'horde', true);
Horde::addScriptFile('QuickFinder.js', 'horde', true);
<td><?php echo htmlspecialchars($class->get('name')) ?></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 Horde_Util::addParameter($perms_url_base, 'share', $class->getName()) ?>" target="_blank" title="<?php echo _("Change Permissions") ?>"><?php echo $perms_img ?></a></td>
+ <td><a onclick="<?php Horde::popupJs($perms_url_base, array('params' => array('share' => $class->getName()), 'urlencode' => true)) ?>return false;" 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 Horde_Util::addParameter($delete_url_base, 'c', $class->getName()) ?>" title="<?php echo _("Delete") ?>"><?php echo $delete_img ?></a></td>
</tr>
if (Horde_Auth::getAuth() && (!$GLOBALS['prefs']->isLocked('categories') ||
!$GLOBALS['prefs']->isLocked('category_colors'))) {
$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>';
+ echo ' ' . Horde::link($categoryUrl, _("Edit categories and colors"), '', '_blank', Horde::popupJs($categoryUrl, array('urlencode' => true)) . 'return false;') . Horde::img('colorpicker.png', _("Edit categories and colors"), '', $GLOBALS['registry']->getImageDir('horde')) . '</a>';
}
?>
</th>
$perms_img = Horde::img('perms.png', _("Change Permissions"), null, $registry->getImageDir('horde'));
$delete_img = Horde::img('delete.png', _("Delete"), null, $registry->getImageDir('horde'));
-Horde::addScriptFile('popup.js', 'horde', true);
Horde::addScriptFile('tables.js', 'horde', true);
$title = _("Manage Address Books");
require TURBA_TEMPLATES . '/common-header.inc';
/* Print. */
if (isset($GLOBALS['print_link'])) {
- $menu->add($GLOBALS['print_link'], _("_Print"), 'print.png', $GLOBALS['registry']->getImageDir('horde'), '_blank', 'return !popup(this.href);', '__noselection');
+ $menu->add($GLOBALS['print_link'], _("_Print"), 'print.png', $GLOBALS['registry']->getImageDir('horde'), '_blank', Horde::popupJs($GLOBALS['print_link'], array('urlencode' => true)) . 'return false);', '__noselection');
}
- return ($returnType == 'object')
- ? $menu
- : $menu->render();
+ return ($returnType == 'object') ? $menu : $menu->render();
}
}
<td><?php echo htmlspecialchars($addressbook->get('name')) ?></td>
<td><a href="<?php echo Horde_Util::addParameter($edit_url_base, 'a', $addressbook->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 Horde_Util::addParameter($perms_url_base, 'share', $addressbook->getName()) ?>" target="_blank" title="<?php echo _("Change Permissions") ?>"><?php echo $perms_img ?></a></td>
+ <td><a onclick="<?php Horde::popupJs($perms_url_base, array('params' => array('share' => $addressbook->getName()))) ?>return false;" href="<?php echo Horde_Util::addParameter($perms_url_base, 'share', $addressbook->getName()) ?>" target="_blank" title="<?php echo _("Change Permissions") ?>"><?php echo $perms_img ?></a></td>
<?php endif; ?>
<td><a href="<?php echo Horde_Util::addParameter($delete_url_base, 'a', $addressbook->getName()) ?>" title="<?php echo _("Delete") ?>"><?php echo $delete_img ?></a></td>
</tr>