diff options
Diffstat (limited to 'modules/g2_import')
-rw-r--r-- | modules/g2_import/helpers/g2_import.php | 9 | ||||
-rw-r--r-- | modules/g2_import/models/g2_map.php | 2 | ||||
-rw-r--r-- | modules/g2_import/views/admin_g2_import.html.php | 1 |
3 files changed, 9 insertions, 3 deletions
diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php index 515eb73d..8de5ce44 100644 --- a/modules/g2_import/helpers/g2_import.php +++ b/modules/g2_import/helpers/g2_import.php @@ -157,6 +157,7 @@ class g2_import_Core { $ret = GalleryEmbed::init(); if ($ret) { + Kohana_Log::add("error", "Gallery 2 call failed with: " . $ret->getAsText()); return false; } @@ -1199,6 +1200,11 @@ class g2_import_Core { $g2_map->g3_id = $g3_id; $g2_map->g2_id = $g2_id; $g2_map->resource_type = $resource_type; + + if (strpos($g2_url, self::$g2_base_url) === 0) { + $g2_url = substr($g2_url, strlen(self::$g2_base_url)); + } + $g2_map->g2_url = $g2_url; $g2_map->save(); self::$map[$g2_id] = $g3_id; @@ -1211,13 +1217,12 @@ class g2_import_Core { static function g2_url($params) { global $gallery; - $url = $gallery->getUrlGenerator()->generateUrl( + return $gallery->getUrlGenerator()->generateUrl( $params, array("forceSessionId" => false, "htmlEntities" => false, "urlEncode" => false, "useAuthToken" => false)); - return str_replace(self::$g2_base_url, "", $url); } static function lower_error_reporting() { diff --git a/modules/g2_import/models/g2_map.php b/modules/g2_import/models/g2_map.php index a20f48d6..8b96050d 100644 --- a/modules/g2_import/models/g2_map.php +++ b/modules/g2_import/models/g2_map.php @@ -17,5 +17,5 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -class G2_Map_Model extends ORM { +class G2_Map_Model_Core extends ORM { } diff --git a/modules/g2_import/views/admin_g2_import.html.php b/modules/g2_import/views/admin_g2_import.html.php index 564bea9f..cb13363a 100644 --- a/modules/g2_import/views/admin_g2_import.html.php +++ b/modules/g2_import/views/admin_g2_import.html.php @@ -89,6 +89,7 @@ Options +FollowSymLinks RewriteEngine On RewriteBase <?= html::clean(g2_import::$g2_base_url) ?> + RewriteRule ^(.*)$ <?= url::site("g2/map?path=\$1") ?> [QSA,L,R=301] </IfModule></textarea> </div> |