From cc1044392dfaa31179a447a105cf1df52f90391e Mon Sep 17 00:00:00 2001 From: John Bintz Date: Sun, 24 Jan 2010 13:38:07 -0500 Subject: [PATCH] upload path --- classes/backends/ComicPressBackendFilesystem.inc | 2 ++ .../backends/partials/backend-filesystem/options-admin.inc | 4 ++-- test/backends/ComicPressBackendFilesystemFactoryTest.php | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/classes/backends/ComicPressBackendFilesystem.inc b/classes/backends/ComicPressBackendFilesystem.inc index 16f4bdd..913745a 100644 --- a/classes/backends/ComicPressBackendFilesystem.inc +++ b/classes/backends/ComicPressBackendFilesystem.inc @@ -120,6 +120,8 @@ class ComicPressBackendFilesystemFactory { function _replace_type($post, $type) { return $type; } + function _replace_upload_path($post, $type) { return get_option('upload_path'); } + function _replace_type_folder($post, $type) { $comicpress = ComicPress::get_instance(); diff --git a/classes/backends/partials/backend-filesystem/options-admin.inc b/classes/backends/partials/backend-filesystem/options-admin.inc index 8d76576..53afe3b 100644 --- a/classes/backends/partials/backend-filesystem/options-admin.inc +++ b/classes/backends/partials/backend-filesystem/options-admin.inc @@ -1,9 +1,9 @@ -

+

- + diff --git a/test/backends/ComicPressBackendFilesystemFactoryTest.php b/test/backends/ComicPressBackendFilesystemFactoryTest.php index fd457fe..e5526f9 100644 --- a/test/backends/ComicPressBackendFilesystemFactoryTest.php +++ b/test/backends/ComicPressBackendFilesystemFactoryTest.php @@ -117,6 +117,7 @@ class ComicPressBackendFilesystemFactoryTest extends PHPUnit_Framework_TestCase ), 2 ), + array('%wordpress%/%upload-path%/comic/%date-Y%/%date-Y-m-d%*.jpg', array('/wordpress/upload/comic/2009/2009-01-01*.jpg')), ); } @@ -140,6 +141,8 @@ class ComicPressBackendFilesystemFactoryTest extends PHPUnit_Framework_TestCase wp_set_post_categories(1, array(2)); wp_set_post_categories(2, array(4)); + update_option('upload_path', 'upload'); + $fs->search_string = $string; $comicpress = ComicPress::get_instance(true);