diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/digibug/controllers/digibug.php | 6 | ||||
-rw-r--r-- | modules/g2_import/controllers/g2.php | 4 | ||||
-rw-r--r-- | modules/g2_import/helpers/g2_import.php | 7 | ||||
-rw-r--r-- | modules/gallery/config/locale.php | 7 | ||||
-rw-r--r-- | modules/gallery/helpers/system.php | 10 | ||||
-rw-r--r-- | modules/gallery/models/item.php | 2 | ||||
-rw-r--r-- | modules/gallery/tests/System_Helper_Test.php | 7 |
7 files changed, 36 insertions, 7 deletions
diff --git a/modules/digibug/controllers/digibug.php b/modules/digibug/controllers/digibug.php index 4acb6513..672afe57 100644 --- a/modules/digibug/controllers/digibug.php +++ b/modules/digibug/controllers/digibug.php @@ -33,8 +33,8 @@ class Digibug_Controller extends Controller { $proxy->uuid = random::hash(); $proxy->item_id = $item->id; $proxy->save(); - $full_url = url::abs_site("digibug/print_proxy/full/$proxy->uuid"); - $thumb_url = url::abs_site("digibug/print_proxy/thumb/$proxy->uuid"); + $full_url = url::abs_site("digibug/print_proxy/full/$proxy->uuid/$item->id"); + $thumb_url = url::abs_site("digibug/print_proxy/thumb/$proxy->uuid/$item->id"); } $v = new View("digibug_form.html"); @@ -114,7 +114,7 @@ class Digibug_Controller extends Controller { private function _clean_expired() { db::build() ->delete("digibug_proxies") - ->where("request_date", "<=", db::expr("(CURDATE() - INTERVAL 10 DAY)")) + ->where("request_date", "<=", db::expr("(CURDATE() - INTERVAL 90 DAY)")) ->limit(20) ->execute(); } diff --git a/modules/g2_import/controllers/g2.php b/modules/g2_import/controllers/g2.php index 6e60bed0..90984e84 100644 --- a/modules/g2_import/controllers/g2.php +++ b/modules/g2_import/controllers/g2.php @@ -41,7 +41,9 @@ class G2_Controller extends Controller { // (bbcode, embedding) people are using the id style URLs although URL rewriting is enabled. $where = array(array("g2_id", "=", $id)); $view = $input->get("g2_view"); - if ($view) { + if ($view == "core.DownloadItem") { + $where[] = array("resource_type", "IN", array("file", "resize", "thumbnail", "full")); + } else if ($view) { $where[] = array("g2_url", "like", "%g2_view=$view%"); } // else: Assuming that the first search hit is sufficiently good. } else if ($path) { diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php index 3606c7ef..c79a8d36 100644 --- a/modules/g2_import/helpers/g2_import.php +++ b/modules/g2_import/helpers/g2_import.php @@ -560,7 +560,7 @@ class g2_import_Core { $table = g2(GalleryCoreApi::fetchThumbnailsByItemIds(array($g2_album_id))); if (isset($table[$g2_album_id])) { // Backtrack the source id to an item - $g2_source = $table[$g2_album_id]; + $orig_g2_source = $g2_source = $table[$g2_album_id]; while (GalleryUtilities::isA($g2_source, "GalleryDerivative")) { $g2_source = g2(GalleryCoreApi::loadEntitiesById($g2_source->getDerivativeSourceId())); } @@ -584,6 +584,11 @@ class g2_import_Core { array("name" => $g3_album->name)), $e); } + + self::set_map( + $orig_g2_source->getId(), $g3_album->id, + "thumbnail", + self::g2_url(array("view" => "core.DownloadItem", "itemId" => $orig_g2_source->getId()))); } } } diff --git a/modules/gallery/config/locale.php b/modules/gallery/config/locale.php index 13de9098..bce7fb49 100644 --- a/modules/gallery/config/locale.php +++ b/modules/gallery/config/locale.php @@ -32,7 +32,12 @@ $config['language'] = array('en_US', 'English_United States'); * Locale timezone. Set in 'Advanced' settings, falling back to the server's zone. * @see http://php.net/timezones */ -$config['timezone'] = module::get_var("gallery", "timezone", date_default_timezone_get()); +if (file_exists(VARPATH . "database.php")) { + $config['timezone'] = module::get_var("gallery", "timezone", date_default_timezone_get()); +} else { + // Gallery3 is not installed yet -- don't make module::get_var() calls. + $config['timezone'] = date_default_timezone_get(); +} // i18n settings diff --git a/modules/gallery/helpers/system.php b/modules/gallery/helpers/system.php index 9815d588..d2e9c125 100644 --- a/modules/gallery/helpers/system.php +++ b/modules/gallery/helpers/system.php @@ -47,6 +47,7 @@ class system_Core { * It allows the caller to specify a prefix and an extension. * It always places the file in TMPPATH. */ +<<<<<<< HEAD static function temp_filename($prefix = "", $extension = "") { return self::_tempnam(TMPPATH, $prefix, ".$extension", "tempnam"); } @@ -61,6 +62,15 @@ class system_Core { return false; } $filename = $basename . $postfix; +======= + static function temp_filename($prefix="", $extension="") { + do { + $basename = tempnam(TMPPATH, $prefix); + if (!$basename) { + return false; + } + $filename = "$basename.$extension"; +>>>>>>> db734130c5fe10408040b2326b28b102f3131271 $success = !file_exists($filename) && @rename($basename, $filename); if (!$success) { @unlink($basename); diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php index 807c88a7..1704ff6e 100644 --- a/modules/gallery/models/item.php +++ b/modules/gallery/models/item.php @@ -889,7 +889,7 @@ class Item_Model_Core extends ORM_MPTT { if ($this->is_movie()) { $legal_values = array("video/flv", "video/x-flv", "video/mp4"); } if ($this->is_photo()) { - $legal_values = array("image/jpeg", "image/gif", "image/png", "image/tiff"); + $legal_values = array("image/jpeg", "image/gif", "image/png"); } break; diff --git a/modules/gallery/tests/System_Helper_Test.php b/modules/gallery/tests/System_Helper_Test.php index dfe5d9ab..4b395799 100644 --- a/modules/gallery/tests/System_Helper_Test.php +++ b/modules/gallery/tests/System_Helper_Test.php @@ -18,12 +18,17 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class System_Helper_Test extends Gallery_Unit_Test_Case { +<<<<<<< HEAD public function temp_filename_random_test() { +======= + public function temp_filename_test() { +>>>>>>> db734130c5fe10408040b2326b28b102f3131271 $filename = system::temp_filename("file", "ext"); $this->assert_true(file_exists($filename), "File not created"); unlink($filename); $this->assert_pattern($filename, "|/file.*\\.ext$|"); } +<<<<<<< HEAD public function tempnam_collision_test() { require_once('Mock_Built_In.php'); @@ -47,4 +52,6 @@ class System_Helper_Test extends Gallery_Unit_Test_Case { } $this->assert_false($filename, "Operation not aborted"); } +======= +>>>>>>> db734130c5fe10408040b2326b28b102f3131271 } |