From: Bharat M. <bh...@us...> - 2002-10-02 08:12:14
|
Update of /cvsroot/gallery/gallery2/modules/netpbm In directory usw-pr-cvs1:/tmp/cvs-serv12754/modules/netpbm Modified Files: AdminNetPbm.inc module.inc Log Message: * Put instructions for installing and playing with the current incarnation of G2 in the README. * Fixed a bug in the template callback code so that it handles block callbacks properly (before it wouldn't fire on the block callback if there was no content) * Dump debug output when we have an error (if debugging is on) * Big API change: Use fetchXxx() instead of getXxx() for any GalleryEntity or map methods that are not changing persistent data. Ie, now we differentiate calls that actually do work (fetch) by from those that just change persistent values (get/set). This required a lot of little text changes all over. * Made some good progress on the layout/module interaction. Layouts can now ask the module for item-sensitive links which will allow the module to take action on the item. For example, the layout asks the comment module for its links, the comment module sends back a link that leads to a view where the user can add a comment to the item. getSummary() and getDetails() are coming. * Moved loadDerivatives() from GalleryLayout into GalleryDerivative. * Moved GalleryDerivativeImage.imageType -> GalleryDerivative.derivativeType This will break any existing database code (I replaced the schema, didn't upgrade it) * Moved GalleryLayout::loadParents() -> GalleryItem->fetchParents() * GalleryUser.password is now GalleryUser.hashedPassword (just a name change) * NetPBM test cases don't fire unless we have an actual path to NetPBM. Index: AdminNetPbm.inc =================================================================== RCS file: /cvsroot/gallery/gallery2/modules/netpbm/AdminNetPbm.inc,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- AdminNetPbm.inc 29 Sep 2002 07:04:06 -0000 1.2 +++ AdminNetPbm.inc 2 Oct 2002 08:11:37 -0000 1.3 @@ -105,11 +105,11 @@ /* Figure out where to redirect upon success */ - $stateVariables['view'] = 'core:SiteAdmin'; - $stateVariables['subView'] = 'netpbm:AdminNetPbm'; + $urlParams['view'] = 'core:SiteAdmin'; + $urlParams['subView'] = 'netpbm:AdminNetPbm'; $templateAdapter = $gallery->getTemplateAdapter(); - $results['redirect'] = $templateAdapter->generateUrl($stateVariables); + $results['redirect'] = $templateAdapter->url($urlParams); return array(GalleryStatus::success(), $results); } @@ -148,24 +148,27 @@ if ($ret->isError()) { return array($ret->wrap(__FILE__, __LINE__), null); } - - foreach (array('jpegtopnm', - 'giftopnm', - $pnmtojpeg, - 'ppmtogif', - 'pnmtopng', - 'pnmscale', - 'pnmfile', - 'ppmquant', - 'pnmcut', - 'pnmrotate', - 'pnmflip') as $binary) { - - $cmd = array($path . $binary, '--version'); - list ($ret, $results) = GalleryUtilities::exec(array($cmd)); - $tests[] = array('name' => $binary, - 'status' => $ret, - 'results' => $results); + + $tests = array(); + if (!empty($path)) { + foreach (array('jpegtopnm', + 'giftopnm', + $pnmtojpeg, + 'ppmtogif', + 'pnmtopng', + 'pnmscale', + 'pnmfile', + 'ppmquant', + 'pnmcut', + 'pnmrotate', + 'pnmflip') as $binary) { + + $cmd = array($path . $binary, '--version'); + list ($ret, $results) = GalleryUtilities::exec(array($cmd)); + $tests[] = array('name' => $binary, + 'status' => $ret, + 'results' => $results); + } } /* Render the HTML body */ Index: module.inc =================================================================== RCS file: /cvsroot/gallery/gallery2/modules/netpbm/module.inc,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- module.inc 21 Sep 2002 18:41:56 -0000 1.3 +++ module.inc 2 Oct 2002 08:11:38 -0000 1.4 @@ -53,9 +53,9 @@ } /** - * @see GalleryModule::getAdminViews + * @see GalleryModule::getSiteAdminViews */ - function getAdminViews() { + function getSiteAdminViews() { global $gallery; return array(GalleryStatus::success(), |