From: Douglas C. <dc...@us...> - 2005-05-01 09:23:23
|
Update of /cvsroot/gallery/gallery2/modules/rewrite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20792 Modified Files: AdminRewrite.inc RewriteModuleExtras.inc SetupRewrite.inc module.inc Log Message: * Added Troubleshooting section if mod_rewrite tests fails. * Added check for empty patterns and an unit test for this. * Remade the way the help for Keywords is displayed. This opens up for adding more help to the rules in the future. * Fixed the UrlGenerator so it wont generate gallery2/?g2_bleh URLs, it adds the baseFile so URLs becomes gallery2/main.php?g2_bleh. * Fixed the htaccess template to accept absolute URLs in baseFile. Index: RewriteModuleExtras.inc =================================================================== RCS file: /cvsroot/gallery/gallery2/modules/rewrite/RewriteModuleExtras.inc,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- RewriteModuleExtras.inc 17 Apr 2005 09:28:20 -0000 1.7 +++ RewriteModuleExtras.inc 1 May 2005 09:23:15 -0000 1.8 @@ -174,6 +174,7 @@ return $ret->wrap(__FILE__, __LINE__); } + case '0.9.3': break; default: Index: SetupRewrite.inc =================================================================== RCS file: /cvsroot/gallery/gallery2/modules/rewrite/SetupRewrite.inc,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- SetupRewrite.inc 17 Apr 2005 09:28:20 -0000 1.5 +++ SetupRewrite.inc 1 May 2005 09:23:15 -0000 1.6 @@ -119,6 +119,9 @@ return array($ret->wrap(__FILE__, __LINE__), null); } + $jsUrl = $urlGenerator->generateUrl(array('href' => 'lib/javascript/BlockToggle.js')); + $template->javascript($jsUrl); + $template->setVariable('SetupRewrite', $SetupRewrite); $template->setVariable('controller', 'rewrite:SetupRewrite'); Index: module.inc =================================================================== RCS file: /cvsroot/gallery/gallery2/modules/rewrite/module.inc,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- module.inc 27 Apr 2005 20:06:16 -0000 1.10 +++ module.inc 1 May 2005 09:23:15 -0000 1.11 @@ -39,7 +39,7 @@ $this->setId('rewrite'); $this->setName('URL Rewrite'); $this->setDescription($gallery->i18n('Enables short URLs using mod_rewrite.')); - $this->setVersion('0.9.3'); /* Update RewriteModuleExtras::upgrade also! */ + $this->setVersion('0.9.4'); /* Update RewriteModuleExtras::upgrade also! */ $this->setGroup('gallery', $this->translate('Gallery')); $this->setCallbacks('getSiteAdminViews'); $this->setRequiredCoreApi(array(5, 0)); @@ -86,7 +86,7 @@ $baseUrl = $baseUrlComponents['path']; if (preg_match('/\/(upgrade|install)\/index.php$/', $baseUrl)) { $baseUrl = dirname(dirname($baseUrl)); - $baseUrl .= $baseUrl != '/' ? '/' : ''; + $baseUrl .= ($baseUrl != '/') ? '/' : ''; } $ret = $this->setParameter('galleryLocation', $baseUrl); if ($ret->isError()) { Index: AdminRewrite.inc =================================================================== RCS file: /cvsroot/gallery/gallery2/modules/rewrite/AdminRewrite.inc,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- AdminRewrite.inc 28 Apr 2005 11:39:33 -0000 1.5 +++ AdminRewrite.inc 1 May 2005 09:23:15 -0000 1.6 @@ -62,6 +62,11 @@ $activeRules[$moduleId] = array(); foreach (array_keys($form['shortUrls'][$moduleId]) as $ruleId) { if (isset($form['shortUrls'][$moduleId][$ruleId]['active'])) { + if (empty($form['shortUrls'][$moduleId][$ruleId]['pattern'])) { + $error[] = 'form[error][empty]'; + break 2; + } + if (isset($dupe[$form['shortUrls'][$moduleId][$ruleId]['pattern']])) { $error[] = 'form[error][dupe]'; break 2; @@ -365,6 +370,9 @@ $form['formName'] = 'AdminRewrite'; } + $jsUrl = $urlGenerator->generateUrl(array('href' => 'lib/javascript/BlockToggle.js')); + $template->javascript($jsUrl); + $template->setVariable('AdminRewrite', $AdminRewrite); $template->setVariable('controller', 'rewrite:AdminRewrite'); |