Track Horde popup.js changes
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 31 Jul 2009 20:46:48 +0000 (14:46 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 31 Jul 2009 21:02:12 +0000 (15:02 -0600)
68 files changed:
ansel/faces/gallery.php
ansel/gallery.php
ansel/js/src/googlemap.js
ansel/js/src/slideshow.js
ansel/lib/Ajax/Imple/ImageSaveGeotag.php
ansel/lib/Ansel.php
ansel/lib/Block/recently_added_geodata.php
ansel/lib/View/GalleryRenderer/Gallery.php
ansel/lib/View/GalleryRenderer/GalleryLightbox.php
ansel/lib/Widget/Actions.php
ansel/lib/Widget/Geodata.php
ansel/map_edit.php
ansel/templates/image/crop_image.inc
ansel/templates/image/edit_image.inc
ansel/templates/image/resize_image.inc
ansel/templates/tile/image.inc
ansel/templates/view/gallery.inc
ansel/templates/view/gallerylightbox.inc
ansel/templates/view/image.inc
ansel/templates/view/slideshow.inc
ansel/view.php
fima/accounts.php
fima/ledgers/index.php
fima/lib/Fima.php
fima/postings.php
fima/templates/ledgers_list.php
folks/edit/friends/groups.php
folks/edit/friends/invite.php
folks/templates/edit/groups.php
framework/Model/lib/Horde/Form/VarRenderer/Xhtml.php
gollem/js/src/popup.js [deleted file]
gollem/lib/Gollem.php
gollem/lib/api.php
gollem/manager.php
gollem/templates/javascript_defs.php
ingo/lib/Ingo.php
kronolith/calendars/index.php
kronolith/day.php
kronolith/event.php
kronolith/index.php
kronolith/lib/Kronolith.php
kronolith/lib/View/EditEvent.php
kronolith/month.php
kronolith/new.php
kronolith/templates/calendar_list.php
kronolith/templates/edit/edit.inc
kronolith/week.php
kronolith/workweek.php
kronolith/year.php
nag/lib/Nag.php
nag/list.php
nag/tasklists/index.php
nag/tasks/index.php
nag/templates/list/task_headers.inc
nag/templates/tasklist_list.php
nag/view.php
news/edit.php
news/news.php
news/templates/edit/info.php
news/templates/edit/row.php
news/templates/news/gallery.php
skoli/classes/index.php
skoli/list.php
skoli/templates/classes/list.php
skoli/templates/list/headers.inc
turba/addressbooks/index.php
turba/lib/Turba.php
turba/templates/addressbook_list.php

index 36909c3..8214f94 100644 (file)
@@ -49,6 +49,7 @@ $pager->preserve('gallery',  $gallery_id);
 
 $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';
index 0b4fbe9..fb2d1ed 100644 (file)
@@ -388,6 +388,7 @@ $imple = Horde_Ajax_Imple::factory(array('ansel', 'GallerySlugCheck'),
                                    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';
index 3719779..b42bd7f 100644 (file)
@@ -398,7 +398,7 @@ Ansel_GMap.prototype = {
     _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 '';
index 6c47e54..35bf488 100755 (executable)
@@ -169,14 +169,14 @@ Slide.prototype = {
         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...
index 3548391..d1679d9 100644 (file)
@@ -67,7 +67,7 @@ class Ansel_Ajax_Imple_ImageSaveGeotag extends Horde_Ajax_Imple_Base
             $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">';
index 6da32da..da72f3b 100644 (file)
@@ -651,7 +651,7 @@ class Ansel {
         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') {
index d2a883a..158d1ef 100644 (file)
@@ -55,6 +55,7 @@ class Horde_Block_ansel_recently_added_geodata extends Horde_Block {
         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')) {
index a819368..e6b5b4a 100644 (file)
@@ -122,6 +122,7 @@ class Ansel_View_GalleryRenderer_Gallery extends Ansel_View_GalleryRenderer_Base
             $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();
     }
index b504e93..25c150f 100644 (file)
@@ -28,6 +28,7 @@ class Ansel_View_GalleryRenderer_GalleryLightbox extends Ansel_View_GalleryRende
             Ansel::attachStylesheet('lightbox.css');
             Horde::addScriptFile('effects.js', 'horde', true);
             Horde::addScriptFile('lightbox.js', 'ansel', true);
+            Horde::addScriptFile('popup.js', 'horde', true);
         }
     }
 
index af30393..05f5363 100644 (file)
@@ -175,7 +175,7 @@ class Ansel_Widget_Actions extends Ansel_Widget_Base
         }
 
         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')) {
index b4d3e05..f3d9876 100644 (file)
@@ -41,8 +41,6 @@ class Ansel_Widget_Geodata extends Ansel_Widget_Base
     {
         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");
@@ -64,6 +62,7 @@ class Ansel_Widget_Geodata extends Ansel_Widget_Base
         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">';
@@ -104,7 +103,7 @@ class Ansel_Widget_Geodata extends Ansel_Widget_Base
             } 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">';
index 4eb0b29..3736bd3 100644 (file)
@@ -14,6 +14,7 @@ require_once dirname(__FILE__) . '/lib/base.php';
 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');
 
index 35a0c9c..86a9e30 100644 (file)
@@ -107,8 +107,7 @@ if (Ansel::isAvailable('grayscale')) {
     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>';
index ef09a2f..fa0efe0 100644 (file)
@@ -23,8 +23,7 @@ if (Ansel::isAvailable('grayscale')) {
     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);
index 33d47ae..74be8b3 100644 (file)
@@ -54,8 +54,7 @@ if (Ansel::isAvailable('grayscale')) {
     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);
index c8f305b..62a16bd 100644 (file)
@@ -14,7 +14,7 @@ if ($option_select): ?>
  <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>
index ee100b1..0edd19b 100644 (file)
@@ -82,7 +82,7 @@ function editDates()
         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()
index c3e1f93..96f56d6 100644 (file)
@@ -80,7 +80,7 @@ function editDates()
         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()
index c621c04..ca28593 100644 (file)
@@ -56,7 +56,7 @@ function arrowHandler(e)
         $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'])) {
index a94bff5..559e9ef 100644 (file)
@@ -14,7 +14,7 @@ function stopSlideShow()
  <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)): ?>
@@ -24,7 +24,7 @@ function stopSlideShow()
   <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>
index 2c6b966..46456ba 100644 (file)
@@ -45,7 +45,6 @@ try {
 
 $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;
index 5ecad29..b7fc28f 100644 (file)
@@ -29,7 +29,7 @@ case 'delete_all':
         $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')) {
@@ -60,13 +60,13 @@ foreach ($types as $typeId => $typeLabel) {
 $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 {
@@ -74,7 +74,7 @@ foreach ($accountlist as $accountId => $account) {
         $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;
@@ -83,7 +83,6 @@ foreach ($accountlist as $accountId => $account) {
 /* 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)));
 }
 
index b8bb9e3..ce03959 100644 (file)
@@ -35,7 +35,6 @@ $edit_img = Horde::img('edit.png', _("Edit"), null, $registry->getImageDir('hord
 $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';
index 196e37a..421389d 100644 (file)
@@ -70,7 +70,7 @@ class Fima {
 
         return $accounts;
     }
-    
+
     function getAccount($account)
     {
         $ledger = Fima::getActiveLedger();
@@ -102,7 +102,7 @@ class Fima {
 
         /* 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);
@@ -124,13 +124,13 @@ class Fima {
     function getPostingsCount()
     {
         $ledger = Fima::getActiveLedger();
-        
+
         /* Create a Fima storage instance. */
         $storage = &Fima_Driver::singleton($ledger);
         return $storage->_postingsCount;
     }
-    
-    
+
+
     /**
      * Get grouped results from storage.
      *
@@ -143,7 +143,7 @@ class Fima {
      */
     function getResults($groups = array(), $filters = array()) {
         $ledger = Fima::getActiveLedger();
-        
+
         /* Create a Fima storage instance. */
         $storage = &Fima_Driver::singleton($ledger);
         return $storage->getResults($groups, $filters);
@@ -160,7 +160,7 @@ class Fima {
     function getAssetResults($postingtype, $perdate = null)
     {
         $ledger = Fima::getActiveLedger();
-        
+
         /* Create a Fima storage instance. */
         $storage = &Fima_Driver::singleton($ledger);
         return $storage->getAssetResults($postingtype, $perdate);
@@ -174,7 +174,7 @@ class Fima {
     function getPostingsResult()
     {
         $ledger = Fima::getActiveLedger();
-        
+
         /* Create a Fima storage instance. */
         $storage = &Fima_Driver::singleton($ledger);
         return $storage->_postingsResult;
@@ -250,7 +250,7 @@ class Fima {
     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;
@@ -262,7 +262,7 @@ class Fima {
         if ($blank !== false) {
             $html .= '<option value="">' . htmlspecialchars($blank) . '</option>';
         }
-        
+
         $accounts = Fima::listAccounts($filters);
         foreach ($accounts as $accountId => $account) {
             if ($hideclosed && $account['closed'] && $accountId != $value) {
@@ -276,7 +276,7 @@ class Fima {
             }
             $html .= htmlspecialchars($account['label']) . '</option>';
         }
-        
+
         return $html . "</select>\n";
     }
 
@@ -306,7 +306,7 @@ class Fima {
         if ($blank !== false) {
             $html .= '<option value="">' . htmlspecialchars($blank) . '</option>';
         }
-        
+
         foreach ($types as $typeValue => $typeLabel) {
             $html .= '<option value="' . $typeValue . '"';
             if ($multiple && is_array($value)) {
@@ -316,7 +316,7 @@ class Fima {
             }
             $html .= htmlspecialchars($typeLabel) . '</option>';
         }
-        
+
         return $html . "</select>\n";
     }
 
@@ -346,7 +346,7 @@ class Fima {
         if ($blank !== false) {
             $html .= '<option value="">' . htmlspecialchars($blank) . '</option>';
         }
-        
+
         foreach ($types as $typeValue => $typeLabel) {
             $html .= '<option value="' . $typeValue . '"';
             if ($multiple && is_array($value)) {
@@ -356,7 +356,7 @@ class Fima {
             }
             $html .= htmlspecialchars($typeLabel) . '</option>';
         }
-        
+
         return $html . "</select>\n";
     }
 
@@ -374,14 +374,14 @@ class Fima {
     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)) {
@@ -397,12 +397,12 @@ class Fima {
             $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)) {
@@ -432,10 +432,10 @@ class Fima {
             $html .= Horde::img('calendar.png', _("Set date"), 'align="top" id="' . $name . '_img"', $GLOBALS['registry']->getImageDir('horde'));
             $html .= '</a>' . "\n";
         }
-                 
+
         return $html;
     }
-    
+
     /**
      * Get account types.
      *
@@ -459,7 +459,7 @@ class Fima {
             return $types;
         }
     }
-    
+
     /**
      * Get posting types.
      *
@@ -483,7 +483,7 @@ class Fima {
             return $types;
         }
     }
-    
+
     /**
      * Convert an amount from the interface to a float value.
      *
@@ -494,11 +494,11 @@ class Fima {
     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.
      *
@@ -509,11 +509,11 @@ class Fima {
     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.
      *
@@ -527,23 +527,23 @@ class Fima {
         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.
      *
@@ -591,7 +591,7 @@ class Fima {
             $format = '%x';
             break;
         }
-    
+
         if ($format == '%x') {
             $fmts = array('%Y-%m-%d', '%d/%m/%Y', '%d.%m.%Y', '%m/%d/%Y');
             foreach ($fmts as $fmt) {
@@ -607,7 +607,7 @@ class Fima {
 
         return $format;
     }
-    
+
     /**
      * Convert a date format to a period format useable for reports.
      *
@@ -639,7 +639,7 @@ class Fima {
 
         return $format;
     }
-    
+
     /**
      * Convert wildcards in a text to SQL wildcards.
      *
@@ -650,7 +650,7 @@ class Fima {
     function convertWildcards($text)
     {
         global $prefs;
-        
+
         $wildcards = $prefs->getValue('wildcard_format');
         if ($wildcards == 'dos') {
             $text = str_replace(array('\\*', '\\?'), array(chr(0xe), chr(0xf)), $text);
@@ -663,7 +663,7 @@ class Fima {
         }
         return $text;
     }
-    
+
     /**
      * Initial app setup code.
      */
@@ -737,7 +737,7 @@ class Fima {
         }
 
         $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);
@@ -750,28 +750,28 @@ class Fima {
     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') {
index f7510a7..3e12521 100644 (file)
@@ -185,14 +185,14 @@ case 'save_postings':
         $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] !== '') {
 
@@ -209,14 +209,14 @@ case 'save_postings':
                 } 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);
@@ -226,7 +226,7 @@ case 'save_postings':
                         }
                     }
                 }
-                                
+
                 /* 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) {
@@ -246,7 +246,7 @@ case 'save_postings':
                         $savecount++;
                     }
                 }
-                
+
                 /* Reload invalid or unsaved postings. */
                 if (!$posting_valid) {
                     $postings[] = array('posting_id' => $posting_id,
@@ -260,7 +260,7 @@ case 'save_postings':
                                         'desc' => $posting_desc);
                 }
             }
-        }    
+        }
 
         if ($savecount > 0) {
             $notification->push(sprintf(_("Saved %d postings."), $savecount), 'horde.success');
@@ -323,7 +323,7 @@ case 'update_postings':
         $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;
@@ -347,7 +347,7 @@ case 'update_postings':
     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)) {
@@ -405,7 +405,7 @@ case 'copymove_postings':
         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'])
@@ -413,7 +413,7 @@ case 'copymove_postings':
                 $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']);
 
@@ -430,7 +430,7 @@ case 'copymove_postings':
                 } 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 {
@@ -441,7 +441,7 @@ case 'copymove_postings':
                         $postingscopy[$copyIdAsset]['eo'] = 0;
                         $postingscopy[$copyIdAsset]['desc'] = _("Summarized");
                     }
-                    
+
                     if (isset($postingscopy[$copyIdAccount])) {
                         $postingscopy[$copyIdAccount]['amount'] += $posting['amount'];
                     } else {
@@ -476,7 +476,7 @@ case 'copymove_postings':
         if ($addcount > 0) {
             $notification->push(sprintf($summarize ? _("Summarized %d postings.") : _("Transfered %d postings."), $addcount), 'horde.success');
         }
-        
+
         /* Delete original postings. */
         if (!$keep) {
             $delcount = 0;
@@ -499,7 +499,7 @@ case 'copymove_postings':
     header('Location: ' . Horde::applicationUrl('postings.php', true));
     exit;
     break;
-    
+
 default:
     break;
 }
@@ -507,7 +507,6 @@ default:
 /* 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));
 }
 
@@ -530,7 +529,7 @@ if (isset($_SESSION['fima_search'])) {
         case 'amount_end':   $filters[] = array('amount', Fima::convertAmountToValue($search), '<='); break;
         case 'eo':           $filters[] = array('eo', (int)(bool)$search);
         default:             break;
-        }    
+        }
     }
 }
 
@@ -572,7 +571,7 @@ if ($pageOb['mode'] == 'list') {
     $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'];
@@ -591,7 +590,7 @@ if ($pageOb['mode'] == 'list') {
             $postings[$postingId]['account_type_eo'] = '';
             $postings[$postingId]['account_closed'] = false;
         }
-    
+
         $flag = 0;
         $flagpos = 0;
         foreach ($accounttypes as $typeId => $typeLabel) {
@@ -616,7 +615,7 @@ if ($pageOb['mode'] == 'list') {
         $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']);
     }
 }
 
@@ -672,7 +671,7 @@ if ($pageOb['mode'] == 'edit') {
 
     /* 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;
index 493d648..8da35f0 100644 (file)
@@ -30,7 +30,7 @@
    <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>
index 60183b1..e28eb49 100644 (file)
@@ -118,8 +118,6 @@ $perms_img = Horde::img('perms.png', '', '', $registry->getImageDir('horde'));
 $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';
 
index 14e8411..34e59c8 100644 (file)
@@ -50,8 +50,6 @@ if ($form->validate()) {
     }
 }
 
-Horde::addScriptFile('popup.js', 'horde', true);
-
 require FOLKS_TEMPLATES . '/common-header.inc';
 require FOLKS_TEMPLATES . '/menu.inc';
 
index ff4fa95..c0c7cf7 100644 (file)
@@ -25,7 +25,7 @@ foreach ($groups as $group_id => $group_name) {
     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>';
 }
index aa2e2cb..5447f3e 100644 (file)
@@ -889,11 +889,10 @@ EOT;
         }
 
         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;
diff --git a/gollem/js/src/popup.js b/gollem/js/src/popup.js
deleted file mode 100644 (file)
index f36326b..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/**
- * 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();
-    }
-}
index 7e089d3..311a7b5 100644 (file)
@@ -771,8 +771,7 @@ class Gollem
 
             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);
                 }
index a9fcaef..286c58b 100644 (file)
@@ -525,8 +525,7 @@ function _gollem_getViewLink($dir, $file, $backend = '')
 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);
     }
index 2d2cb51..5896b51 100644 (file)
@@ -426,7 +426,7 @@ if (is_array($list) && $numitem && $read_perms) {
             // 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.
@@ -434,7 +434,7 @@ if (is_array($list) && $numitem && $read_perms) {
 
             // 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;
         }
 
@@ -556,7 +556,6 @@ $js_code = array(
 );
 
 Horde::addScriptFile('manager.js', 'gollem', true);
-Horde::addScriptFile('popup.js', 'gollem', true);
 Horde::addScriptFile('tables.js', 'horde', true);
 
 require GOLLEM_TEMPLATES . '/common-header.inc';
index c8b2c34..71e82e6 100644 (file)
@@ -10,9 +10,6 @@ $var = array(
 
 /* 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."),
index 9b2f9f2..0bfc8d1 100644 (file)
@@ -407,14 +407,10 @@ class Ingo
             $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();
     }
 
 }
index 621c245..93c7a66 100644 (file)
@@ -62,7 +62,6 @@ $edit_img = Horde::img('edit.png', _("Edit"), null, $registry->getImageDir('hord
 $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';
index 72f0324..907f05d 100644 (file)
@@ -16,9 +16,6 @@ $title = $view->getTime($prefs->getValue('date_format'));
 $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) {
index 3718008..4e71f64 100644 (file)
@@ -45,9 +45,6 @@ case 'EditEvent':
 
 $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) {
index db97c72..5606deb 100644 (file)
@@ -23,7 +23,7 @@ if ($logout_link) {
 }
 $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'));
index 11a0eb2..28c3240 100644 (file)
@@ -1893,14 +1893,11 @@ class Kronolith
 
         /* 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();
     }
 
     /**
index 0c6c6fd..9109e29 100644 (file)
@@ -105,6 +105,7 @@ class Kronolith_View_EditEvent {
         $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>';
index 0fcb6cb..f656b90 100644 (file)
@@ -15,9 +15,6 @@ $title = $view->date->strftime('%B %Y');
 $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) {
index 1a5bd66..dd87e63 100644 (file)
@@ -65,6 +65,7 @@ if (isset($url)) {
 
 $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';
index f2d3081..539a86e 100644 (file)
@@ -49,7 +49,7 @@
    <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; ?>
index 9aea181..ac0633e 100644 (file)
@@ -232,7 +232,7 @@ if ($event->alarm) {
 <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>
index 8ff24c3..2624605 100644 (file)
@@ -16,9 +16,6 @@ $title = sprintf(_("Week %d"), $view->week);
 $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) {
index 5848b1b..af0523e 100644 (file)
@@ -16,9 +16,6 @@ $title = sprintf(_("Week %d"), $view->week);
 $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) {
index 17a5450..91c9fed 100644 (file)
@@ -16,9 +16,6 @@ $title = $view->year;
 $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) {
index f85a47b..8a4142e 100644 (file)
@@ -687,14 +687,10 @@ class Nag
 
         /* 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()
index e7fe3ce..52c796f 100644 (file)
@@ -86,7 +86,6 @@ default:
 
 $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);
index a2e182f..0db3a41 100644 (file)
@@ -49,7 +49,6 @@ $edit_img = Horde::img('edit.png', _("Edit"), null, $registry->getImageDir('hord
 $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';
index 8217002..78c3c29 100644 (file)
@@ -45,7 +45,6 @@ $title = sprintf(_("Search: Results for \"%s\""), $search);
 $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);
index 78d2af6..dc0fe17 100644 (file)
@@ -66,7 +66,7 @@ function doPrefsUpdate(column, sortDown)
    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>
index 369de2a..fac2c28 100644 (file)
@@ -30,7 +30,7 @@
    <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>
index 98d9a5e..ddfc563 100644 (file)
@@ -96,7 +96,6 @@ $title = $task->name;
 $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',
index fdc3863..c6851d9 100644 (file)
@@ -193,7 +193,6 @@ $pager = News_Search::getPager($binds[1], $count, $browse_url);
 
 // 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';
index 5057fc9..b3e70bc 100644 (file)
@@ -47,7 +47,6 @@ $title = $row['title'];
 $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';
 
index 1f50548..ef32520 100644 (file)
@@ -109,7 +109,7 @@ if (sizeof($versions)>0) {
         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";
     }
index a58b146..4885213 100644 (file)
@@ -57,7 +57,7 @@ case News::LOCKED:
 <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
index cdf73b7..5f9e370 100644 (file)
@@ -6,13 +6,12 @@ if (empty($row['gallery'])
 }
 
 $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>';
 }
index 7570b4b..3257fe5 100644 (file)
@@ -32,7 +32,6 @@ $edit_img = Horde::img('edit.png', _("Edit"), null, $registry->getImageDir('hord
 $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';
index 7aa3ec9..1f60188 100644 (file)
@@ -100,7 +100,6 @@ default:
     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);
index b833b50..40c0ea1 100644 (file)
@@ -25,7 +25,7 @@
    <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>
index a4e5245..8b3969a 100644 (file)
@@ -86,7 +86,7 @@ function doPrefsUpdate(column, sortDown)
    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>
index 77e993c..6421cb9 100644 (file)
@@ -40,7 +40,6 @@ $edit_img = Horde::img('edit.png', _("Edit"), null, $registry->getImageDir('hord
 $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';
index 40fe877..5d36e06 100644 (file)
@@ -608,12 +608,10 @@ class Turba {
 
         /* 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();
     }
 
 }
index dc19159..dd6cce7 100644 (file)
@@ -30,7 +30,7 @@
    <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>