From a4d1da8fd31e35ae64342753e9c1b57470311c19 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Thu, 17 Jun 2010 14:17:32 -0400 Subject: [PATCH] track Ansel's API changes --- ansel/lib/Block/recent_comments.php | 2 +- imp/saveimage.php | 4 ++-- news/add.php | 22 ++++++++++------------ 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/ansel/lib/Block/recent_comments.php b/ansel/lib/Block/recent_comments.php index 7daf8c734..9bdec8e45 100644 --- a/ansel/lib/Block/recent_comments.php +++ b/ansel/lib/Block/recent_comments.php @@ -1,6 +1,6 @@ call('images/hasComments') && +if ($GLOBALS['registry']->images->hasComments() && $GLOBALS['registry']->hasMethod('forums/getThreadsBatch')) { $block_name = _("Recent Photo Comments"); } diff --git a/imp/saveimage.php b/imp/saveimage.php index dcdb3f8db..90e4c42fd 100644 --- a/imp/saveimage.php +++ b/imp/saveimage.php @@ -30,7 +30,7 @@ case 'save_image': 'type' => $mime_part->getType() ); try { - $registry->call('images/saveImage', array(null, $vars->gallery, $image_data)); + $registry->images->saveImage(null, $vars->gallery, $image_data); } catch (Horde_Exception $e) { $notification->push($e); break; @@ -53,7 +53,7 @@ $t->set('uid', htmlspecialchars($vars->uid)); $t->set('image_img', Horde::img('mime/image.png', _("Image"))); /* Build the list of galleries. */ -$t->set('gallerylist', $registry->call('images/selectGalleries', array(null, Horde_Perms::EDIT))); +$t->set('gallerylist', $registry->images->selectGalleries(array('perm' => Horde_Perms::EDIT))); $title = _("Save Image"); require IMP_TEMPLATES . '/common-header.inc'; diff --git a/news/add.php b/news/add.php index 35be07571..839a626dc 100644 --- a/news/add.php +++ b/news/add.php @@ -174,14 +174,14 @@ foreach ($conf['attributes']['languages'] as $key) { // Link to a gallery if ($conf['attributes']['ansel-images'] && $registry->hasMethod('images/listGalleries') - && $registry->call('images/countGalleries', array()) > 0) { + && $registry->images->countGalleries() > 0) { $form->addVariable(_("Enter gallery ID or upload images below"), 'description', 'description', false); - if ($registry->call('images/countGalleries', array()) > 50) { + if ($registry->images->countGalleries() > 50) { $form->addVariable(_("Gallery"), 'gallery', 'int', false, false); } else { - $ansel_galleries = $registry->call('images/listGalleries', array()); + $ansel_galleries = $registry->images->listGalleries(); $galleries = array(); foreach ($ansel_galleries as $gallery_id => $gallery) { $galleries[$gallery_id] = $gallery['attribute_name']; @@ -438,10 +438,9 @@ if ($form->validate()) { if (empty($info['gallery'])) { $abbr = Horde_String::substr(strip_tags($info['body'][$default_lang]['content']), 0, $conf['preview']['list_content']); try { - $result = $registry->call('images/createGallery', - array(null, - array('name' => $info['body'][$default_lang]['title'], - 'desc' => $abbr))); + $result = $registry->images->createGallery(null, + array('name' => $info['body'][$default_lang]['title'], + 'desc' => $abbr)); $info['gallery'] = $result; } catch (Horde_Exception $e) { $notification->push(_("There was an error creating gallery: ") . $e->getMessage(), 'horde.warning'); @@ -452,12 +451,11 @@ if ($form->validate()) { $news->write_db->query('UPDATE ' . $news->prefix . ' SET gallery = ? WHERE id = ?', array($info['gallery'], $id)); foreach ($images_uploaded as $i) { try { - $registry->call('images/saveImage', - array(null, $info['gallery'], + $registry->images->saveImage(null, $info['gallery'], array('filename' => $info['picture_' . $i]['file'], - 'description' => $info['caption_' . ($i == 0 ? $i . '_' . $default_lang: $i)], - 'type' => $info['picture_' . $i]['type'], - 'data' => file_get_contents($info['picture_' . $i]['file'])))); + 'description' => $info['caption_' . ($i == 0 ? $i . '_' . $default_lang: $i)], + 'type' => $info['picture_' . $i]['type'], + 'data' => file_get_contents($info['picture_' . $i]['file']))); } catch (Horde_Exception $e) { $notification->push(_("There was an error with the uploaded image: ") . $e->getMessage(), 'horde.warning'); } -- 2.11.0