Preparado para primera subida
git-svn-id: https://192.168.0.254/svn/Proyectos.ConstruccionesCNJ_Web/trunk@18 a1d75475-e439-6a4c-b115-a3aab481e8ec
|
Before Width: | Height: | Size: 67 KiB |
|
Before Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 73 KiB |
|
Before Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 75 KiB |
|
Before Width: | Height: | Size: 156 KiB |
|
Before Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 78 KiB |
|
Before Width: | Height: | Size: 107 KiB |
|
Before Width: | Height: | Size: 69 KiB |
|
Before Width: | Height: | Size: 80 KiB |
|
Before Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 94 KiB |
|
Before Width: | Height: | Size: 106 KiB |
|
Before Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 69 KiB |
|
Before Width: | Height: | Size: 71 KiB |
|
Before Width: | Height: | Size: 87 KiB |
|
Before Width: | Height: | Size: 74 KiB |
|
Before Width: | Height: | Size: 92 KiB |
6651
Source/gallery2/g2data_2e6106f57b/upgrade_eea1d827db.log
Normal file
@ -1,2 +1,2 @@
|
||||
1.2.0.4
|
||||
2.2.2
|
||||
1.2.0.5
|
||||
2.2.3
|
||||
@ -1,4 +1,4 @@
|
||||
# $Id: el.po 16475 2007-05-31 17:44:01Z mindless $
|
||||
# $Id: el.po 16476 2007-05-31 18:15:59Z mindless $
|
||||
#
|
||||
# Gallery - a web based photo album viewer and editor
|
||||
# Copyright (C) 2000-2007 Bharat Mediratta
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# $Id: hu.po 16475 2007-05-31 17:44:01Z mindless $
|
||||
# $Id: hu.po 16476 2007-05-31 18:15:59Z mindless $
|
||||
#
|
||||
# Gallery - a web based photo album viewer and editor
|
||||
# Copyright (C) 2000-2007 Bharat Mediratta
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# $Id: pt.po 16475 2007-05-31 17:44:01Z mindless $
|
||||
# $Id: pt.po 16476 2007-05-31 18:15:59Z mindless $
|
||||
#
|
||||
# Gallery - a web based photo album viewer and editor
|
||||
# Copyright (C) 2000-2007 Bharat Mediratta
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# $Id: sr.po 16501 2007-06-02 18:37:40Z jozefs $
|
||||
# $Id: sr.po 16509 2007-06-05 01:25:06Z mindless $
|
||||
#
|
||||
# Gallery - a web based photo album viewer and editor
|
||||
# Copyright (C) 2000-2007 Bharat Mediratta
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
*
|
||||
* @package GalleryCore
|
||||
* @author Bharat Mediratta <bharat@menalto.com>
|
||||
* @version $Revision: 16630 $
|
||||
* @version $Revision: 16996 $
|
||||
* @static
|
||||
*/
|
||||
class CoreModuleExtras {
|
||||
@ -2212,6 +2212,8 @@ class CoreModuleExtras {
|
||||
/* 2.2.2 Bugfix Release - Not used */
|
||||
case '1.2.0.3':
|
||||
/* 2.2.2 Bugfix Release */
|
||||
case '1.2.0.4':
|
||||
/* 2.2.3 Security Release */
|
||||
|
||||
/* Store Entities.inc and Maps.inc definitions in the Schema table. */
|
||||
$gallery->guaranteeTimeLimit(30);
|
||||
@ -2574,6 +2576,7 @@ if (!isset($gallery) || !method_exists($gallery, \'setConfig\')) {
|
||||
case '1.2.0.1':
|
||||
case '1.2.0.2':
|
||||
case '1.2.0.3':
|
||||
case '1.2.0.4':
|
||||
|
||||
case 'end of upgrade path':
|
||||
/*
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# $Revision: 16636 $
|
||||
# $Revision: 16999 $
|
||||
# File crc32 crc32(crlf) size size(crlf) or R File
|
||||
modules/core/AdminCore.inc 2448414203 2986494712 11002 11360
|
||||
modules/core/AdminCreateGroup.inc 2264869130 1145511965 3620 3746
|
||||
@ -19,7 +19,7 @@ modules/core/AdminToolkitPriority.inc 187729627 221793192 3244 3349
|
||||
modules/core/AdminUsers.inc 2220718479 165072603 7032 7264
|
||||
modules/core/Callbacks.inc 3414775313 32377629 6599 6809
|
||||
modules/core/ChangeLanguage.inc 2203055387 4084050931 1514 1563
|
||||
modules/core/CoreModuleExtras.inc 1221988706 1277895183 101067 104289
|
||||
modules/core/CoreModuleExtras.inc 4137866910 2300659302 101135 104360
|
||||
modules/core/CreateThumbnailOption.inc 2043871615 3096809131 2288 2363
|
||||
modules/core/DownloadItem.inc 2728495747 2454205779 5430 5616
|
||||
modules/core/ErrorPage.inc 4217687436 3526276519 6632 6847
|
||||
@ -270,7 +270,7 @@ modules/core/locale/uk/LC_MESSAGES/modules_core.mo 1399762056 1399762056 110879
|
||||
modules/core/locale/vi/LC_MESSAGES/modules_core.mo 2998938853 2998938853 81579 81579
|
||||
modules/core/locale/zh_CN/LC_MESSAGES/modules_core.mo 3401054278 3401054278 79379 79379
|
||||
modules/core/locale/zh_TW/LC_MESSAGES/modules_core.mo 2096570485 2096570485 99452 99452
|
||||
modules/core/module.inc 3898334575 402974461 16407 16903
|
||||
modules/core/module.inc 2463485008 3128131111 16407 16903
|
||||
modules/core/po/GNUmakefile 1866879166 2808215985 98 103
|
||||
modules/core/po/af.po 3827306461 3127092828 98817 102528
|
||||
modules/core/po/ar.po 2975738929 3642575605 105214 108822
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
* The implementation of the core-module
|
||||
* @package GalleryCore
|
||||
* @author Bharat Mediratta <bharat@menalto.com>
|
||||
* @version $Revision: 16630 $
|
||||
* @version $Revision: 16996 $
|
||||
*/
|
||||
class CoreModule extends GalleryModule {
|
||||
|
||||
@ -31,10 +31,10 @@ class CoreModule extends GalleryModule {
|
||||
|
||||
$this->setId('core');
|
||||
$this->setName($gallery->i18n('Core'));
|
||||
$this->setGalleryVersion('2.2.2');
|
||||
$this->setGalleryVersion('2.2.3');
|
||||
|
||||
/* Don't forget to update CoreModuleExtras::upgrade and _prepareConfigUpgrade too! */
|
||||
$this->setVersion('1.2.0.4');
|
||||
$this->setVersion('1.2.0.5');
|
||||
|
||||
$this->setDescription($gallery->i18n('Gallery 2 Core Module'));
|
||||
$this->setGroup('gallery', $gallery->i18n('Gallery'));
|
||||
|
||||
@ -21,16 +21,16 @@
|
||||
/**
|
||||
* @package Exif
|
||||
* @author Bharat Mediratta <bharat@menalto.com>
|
||||
* @version $Revision: 15513 $
|
||||
* @version $Revision: 16117 $
|
||||
*/
|
||||
class ExifCallbacks {
|
||||
|
||||
function callback($params, &$smarty, $callback, $userId=null) {
|
||||
global $gallery;
|
||||
static $blockNum = 0;
|
||||
|
||||
switch ($callback) {
|
||||
case 'LoadExifInfo':
|
||||
|
||||
GalleryCoreApi::requireOnce('modules/exif/classes/ExifHelper.class');
|
||||
|
||||
list ($ret, $item) = GalleryCoreApi::loadEntitiesById($params['itemId']);
|
||||
@ -59,11 +59,7 @@ class ExifCallbacks {
|
||||
}
|
||||
}
|
||||
|
||||
if ($mode == 'detailed') {
|
||||
$filter = EXIF_DETAILED;
|
||||
} else {
|
||||
$filter = EXIF_SUMMARY;
|
||||
}
|
||||
$filter = ($mode == 'detailed') ? EXIF_DETAILED : EXIF_SUMMARY;
|
||||
|
||||
list ($ret, $exifData) = ExifHelper::getExifData($path, $filter);
|
||||
if ($ret) {
|
||||
@ -84,9 +80,12 @@ class ExifCallbacks {
|
||||
return null;
|
||||
}
|
||||
|
||||
$ajaxBlockNum = GalleryUtilities::getRequestVariables('blockNum');
|
||||
$thisBlockNum = !empty($ajaxBlockNum) ? $ajaxBlockNum : ++$blockNum;
|
||||
$block =& $smarty->_tpl_vars['block'];
|
||||
$block['exif']['LoadExifInfo']['exifData'] = $exifData;
|
||||
$block['exif']['LoadExifInfo']['mode'] = $mode;
|
||||
$block['exif']['LoadExifInfo'] = array('exifData' => $exifData,
|
||||
'mode' => $mode,
|
||||
'blockNum' => $thisBlockNum);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
# $Revision: 16041 $
|
||||
# $Revision: 16119 $
|
||||
# File crc32 crc32(crlf) size size(crlf) or R File
|
||||
modules/exif/AdminExif.inc 3117261894 2300706519 12337 12759
|
||||
modules/exif/Callbacks.inc 103002432 2944520880 2661 2758
|
||||
modules/exif/Callbacks.inc 2057565291 3678160435 2812 2908
|
||||
modules/exif/ExifDescriptionOption.inc 3532722632 3573413726 6865 7077
|
||||
modules/exif/SwitchDetailMode.inc 3475094652 236308377 1685 1739
|
||||
modules/exif/Preloads.inc 2335892792 4271190542 1237 1276
|
||||
modules/exif/SwitchDetailMode.inc 2377449304 3599189213 3325 3443
|
||||
modules/exif/classes/ExifExtractor.class 4049714568 1453411827 2960 3051
|
||||
modules/exif/classes/ExifHelper.class 1727291833 2058777346 38688 39682
|
||||
modules/exif/classes/ExifInterface_1_0.class 1590320328 3291885412 1697 1743
|
||||
@ -21,164 +22,7 @@ modules/exif/lib/exifer/makers/gps.inc 1286151642 1491221359 8686 8914
|
||||
modules/exif/lib/exifer/makers/nikon.inc 1448861190 4110014028 11554 11885
|
||||
modules/exif/lib/exifer/makers/olympus.inc 140708777 2666258797 5762 5940
|
||||
modules/exif/lib/exifer/makers/sanyo.inc 1069425848 1741212083 5403 5571
|
||||
modules/exif/locale/af/LC_MESSAGES/modules_exif.mo 2985036685 2985036685 14284 14284
|
||||
modules/exif/locale/ar/LC_MESSAGES/modules_exif.mo 1182930423 1182930423 776 776
|
||||
modules/exif/locale/ca/LC_MESSAGES/modules_exif.mo 2598007355 2598007355 14769 14769
|
||||
modules/exif/locale/cs/LC_MESSAGES/modules_exif.mo 1022434325 1022434325 16345 16345
|
||||
modules/exif/locale/da/LC_MESSAGES/modules_exif.mo 2064277617 2064277617 12881 12881
|
||||
modules/exif/locale/de/LC_MESSAGES/modules_exif.mo 3668372319 3668372319 16697 16697
|
||||
modules/exif/locale/en_GB/LC_MESSAGES/modules_exif.mo 716107925 716107925 2204 2204
|
||||
modules/exif/locale/es/LC_MESSAGES/modules_exif.mo 4285922269 4285922269 17351 17351
|
||||
modules/exif/locale/eu/LC_MESSAGES/modules_exif.mo 839548901 839548901 16873 16873
|
||||
modules/exif/locale/fi/LC_MESSAGES/modules_exif.mo 3934583458 3934583458 14236 14236
|
||||
modules/exif/locale/fr/LC_MESSAGES/modules_exif.mo 209110248 209110248 18029 18029
|
||||
modules/exif/locale/ga/LC_MESSAGES/modules_exif.mo 700095934 700095934 6082 6082
|
||||
modules/exif/locale/hu/LC_MESSAGES/modules_exif.mo 2646987915 2646987915 2796 2796
|
||||
modules/exif/locale/is/LC_MESSAGES/modules_exif.mo 395428149 395428149 461 461
|
||||
modules/exif/locale/it/LC_MESSAGES/modules_exif.mo 2469996994 2469996994 14183 14183
|
||||
modules/exif/locale/ja/LC_MESSAGES/modules_exif.mo 2071778005 2071778005 15013 15013
|
||||
modules/exif/locale/ko/LC_MESSAGES/modules_exif.mo 678905503 678905503 5797 5797
|
||||
modules/exif/locale/lt/LC_MESSAGES/modules_exif.mo 4001995413 4001995413 13100 13100
|
||||
modules/exif/locale/nl/LC_MESSAGES/modules_exif.mo 2956177726 2956177726 11312 11312
|
||||
modules/exif/locale/no/LC_MESSAGES/modules_exif.mo 3907638070 3907638070 17165 17165
|
||||
modules/exif/locale/pl/LC_MESSAGES/modules_exif.mo 2809322709 2809322709 7333 7333
|
||||
modules/exif/locale/pt_BR/LC_MESSAGES/modules_exif.mo 3378495283 3378495283 14598 14598
|
||||
modules/exif/locale/ro/LC_MESSAGES/modules_exif.mo 417855386 417855386 13516 13516
|
||||
modules/exif/locale/ru/LC_MESSAGES/modules_exif.mo 501935401 501935401 18421 18421
|
||||
modules/exif/locale/sk/LC_MESSAGES/modules_exif.mo 1054578487 1054578487 905 905
|
||||
modules/exif/locale/sr/LC_MESSAGES/modules_exif.mo 923899796 923899796 11659 11659
|
||||
modules/exif/locale/sv/LC_MESSAGES/modules_exif.mo 75810470 75810470 16656 16656
|
||||
modules/exif/locale/tr/LC_MESSAGES/modules_exif.mo 3235773638 3235773638 4343 4343
|
||||
modules/exif/locale/uk/LC_MESSAGES/modules_exif.mo 3836509529 3836509529 910 910
|
||||
modules/exif/locale/vi/LC_MESSAGES/modules_exif.mo 3948801453 3948801453 13160 13160
|
||||
modules/exif/locale/zh_CN/LC_MESSAGES/modules_exif.mo 3194160196 3194160196 15927 15927
|
||||
modules/exif/locale/zh_TW/LC_MESSAGES/modules_exif.mo 3755581989 3755581989 15990 15990
|
||||
modules/exif/module.inc 2400396839 1329456284 5876 6090
|
||||
modules/exif/po/GNUmakefile 1866879166 2808215985 98 103
|
||||
modules/exif/po/af.po 777222646 3742721251 17161 17981
|
||||
modules/exif/po/ar.po 1852043323 3870983686 12122 12927
|
||||
modules/exif/po/ca.po 2476038960 2936616094 18030 18851
|
||||
modules/exif/po/cs.po 2007605235 223317691 18772 19599
|
||||
modules/exif/po/da.po 3735017970 4272017543 16469 17283
|
||||
modules/exif/po/de.po 95344085 2494521001 18246 19067
|
||||
modules/exif/po/en_GB.po 2624184170 3415714095 17297 18108
|
||||
modules/exif/po/es.po 2023216301 2320153742 18697 19518
|
||||
modules/exif/po/eu.po 3549589514 4207110085 17886 18700
|
||||
modules/exif/po/fi.po 3615890630 4084860934 17185 18003
|
||||
modules/exif/po/fr.po 667684708 1556754822 19075 19893
|
||||
modules/exif/po/ga.po 2901918997 2360961448 15720 16569
|
||||
modules/exif/po/hu.po 2536400678 86788799 12729 13530
|
||||
modules/exif/po/is.po 264154262 1596408353 11968 12772
|
||||
modules/exif/po/it.po 4087438922 739269073 18243 19060
|
||||
modules/exif/po/ja.po 3998340582 3044354868 17929 18734
|
||||
modules/exif/po/ko.po 2013772530 1719829594 14287 15093
|
||||
modules/exif/po/lt.po 4166056879 851151069 17378 18203
|
||||
modules/exif/po/nl.po 2289290572 2810822899 18176 19001
|
||||
modules/exif/po/no.po 3327227622 477226255 17862 18676
|
||||
modules/exif/po/pl.po 2924410477 2887980519 18494 19317
|
||||
modules/exif/po/pt_BR.po 792235732 25590126 17494 18316
|
||||
modules/exif/po/ro.po 1008417197 3029775945 18294 19113
|
||||
modules/exif/po/ru.po 1685671956 1126850651 23447 24282
|
||||
modules/exif/po/sk.po 2418272217 1052347243 12395 13213
|
||||
modules/exif/po/sr.po 655185375 1513027968 16458 17288
|
||||
modules/exif/po/strings.raw 1612065085 2266695676 8541 8799
|
||||
modules/exif/po/sv.po 853024203 3747860105 17991 18815
|
||||
modules/exif/po/tr.po 2416286529 3041403439 13394 14206
|
||||
modules/exif/po/uk.po 2598016800 1447774658 12400 13208
|
||||
modules/exif/po/vi.po 2332385175 2391713903 17527 18341
|
||||
modules/exif/po/zh_CN.po 3758372037 1091870196 17000 17818
|
||||
modules/exif/po/zh_TW.po 1595821920 262299784 16405 17205
|
||||
modules/exif/module.inc 2018612868 295758289 5897 6112
|
||||
modules/exif/templates/AdminExif.tpl 2508315230 3099847713 8772 8989
|
||||
modules/exif/templates/blocks/ExifInfo.tpl 776765192 3255852043 1638 1691
|
||||
modules/exif/templates/blocks/ExifInfo.tpl 3529296902 1736447513 2876 2962
|
||||
modules/exif/templates/blocks/blocks.inc 4231301880 329849114 111 116
|
||||
R modules/exif/classes/ExifPropertiesMap.class
|
||||
R modules/exif/classes/GalleryStorage/DatabaseStorage/schema/GNUmakefile
|
||||
R modules/exif/classes/GalleryStorage/DatabaseStorage/schema/platform/GNUmakefile
|
||||
R modules/exif/classes/GalleryStorage/DatabaseStorage/schema/platform/mysql/ExifPropertiesMap.sql
|
||||
R modules/exif/classes/GalleryStorage/DatabaseStorage/schema/platform/mysql/GNUmakefile
|
||||
R modules/exif/classes/GalleryStorage/DatabaseStorage/schema/platform/mysql
|
||||
R modules/exif/classes/GalleryStorage/DatabaseStorage/schema/platform/oracle/ExifPropertiesMap.sql
|
||||
R modules/exif/classes/GalleryStorage/DatabaseStorage/schema/platform/oracle/GNUmakefile
|
||||
R modules/exif/classes/GalleryStorage/DatabaseStorage/schema/platform/oracle
|
||||
R modules/exif/classes/GalleryStorage/DatabaseStorage/schema/platform/postgres/ExifPropertiesMap.sql
|
||||
R modules/exif/classes/GalleryStorage/DatabaseStorage/schema/platform/postgres/GNUmakefile
|
||||
R modules/exif/classes/GalleryStorage/DatabaseStorage/schema/platform/postgres
|
||||
R modules/exif/classes/GalleryStorage/DatabaseStorage/schema/platform
|
||||
R modules/exif/classes/GalleryStorage/DatabaseStorage/schema/schema.tpl
|
||||
R modules/exif/classes/GalleryStorage/DatabaseStorage/schema/xml-src/GNUmakefile
|
||||
R modules/exif/classes/GalleryStorage/DatabaseStorage/schema/xml-src
|
||||
R modules/exif/classes/GalleryStorage/DatabaseStorage/schema
|
||||
R modules/exif/classes/GalleryStorage/DatabaseStorage
|
||||
R modules/exif/classes/interfaces/ExifPropertiesMap.inc
|
||||
R modules/exif/classes/interfaces/GNUmakefile
|
||||
R modules/exif/classes/interfaces
|
||||
R modules/exif/locale/cs_CZ/LC_MESSAGES/modules_exif.mo
|
||||
R modules/exif/locale/cs_CZ/LC_MESSAGES
|
||||
R modules/exif/locale/cs_CZ
|
||||
R modules/exif/locale/da_DK/LC_MESSAGES/modules_exif.mo
|
||||
R modules/exif/locale/da_DK/LC_MESSAGES
|
||||
R modules/exif/locale/da_DK
|
||||
R modules/exif/locale/de_DE/LC_MESSAGES/modules_exif.mo
|
||||
R modules/exif/locale/de_DE/LC_MESSAGES
|
||||
R modules/exif/locale/de_DE
|
||||
R modules/exif/locale/es_ES/LC_MESSAGES/modules_exif.mo
|
||||
R modules/exif/locale/es_ES/LC_MESSAGES
|
||||
R modules/exif/locale/es_ES
|
||||
R modules/exif/locale/eu_ES/LC_MESSAGES/modules_exif.mo
|
||||
R modules/exif/locale/eu_ES/LC_MESSAGES
|
||||
R modules/exif/locale/eu_ES
|
||||
R modules/exif/locale/fr_FR/LC_MESSAGES/modules_exif.mo
|
||||
R modules/exif/locale/fr_FR/LC_MESSAGES
|
||||
R modules/exif/locale/fr_FR
|
||||
R modules/exif/locale/ga_IE/LC_MESSAGES/modules_exif.mo
|
||||
R modules/exif/locale/ga_IE/LC_MESSAGES
|
||||
R modules/exif/locale/ga_IE
|
||||
R modules/exif/locale/is_IS/LC_MESSAGES/modules_exif.mo
|
||||
R modules/exif/locale/is_IS/LC_MESSAGES
|
||||
R modules/exif/locale/is_IS
|
||||
R modules/exif/locale/it_IT/LC_MESSAGES/modules_exif.mo
|
||||
R modules/exif/locale/it_IT/LC_MESSAGES
|
||||
R modules/exif/locale/it_IT
|
||||
R modules/exif/locale/ja_JP/LC_MESSAGES/modules_exif.mo
|
||||
R modules/exif/locale/ja_JP/LC_MESSAGES
|
||||
R modules/exif/locale/ja_JP
|
||||
R modules/exif/locale/nl_NL/LC_MESSAGES/modules_exif.mo
|
||||
R modules/exif/locale/nl_NL/LC_MESSAGES
|
||||
R modules/exif/locale/nl_NL
|
||||
R modules/exif/locale/no_NO/LC_MESSAGES/modules_exif.mo
|
||||
R modules/exif/locale/no_NO/LC_MESSAGES
|
||||
R modules/exif/locale/no_NO
|
||||
R modules/exif/locale/ru_RU/LC_MESSAGES/modules_exif.mo
|
||||
R modules/exif/locale/ru_RU/LC_MESSAGES
|
||||
R modules/exif/locale/ru_RU
|
||||
R modules/exif/locale/sr_YU/LC_MESSAGES/modules_exif.mo
|
||||
R modules/exif/locale/sr_YU/LC_MESSAGES
|
||||
R modules/exif/locale/sr_YU
|
||||
R modules/exif/locale/sv_SE/LC_MESSAGES/modules_exif.mo
|
||||
R modules/exif/locale/sv_SE/LC_MESSAGES
|
||||
R modules/exif/locale/sv_SE
|
||||
R modules/exif/locale/tr_TR/LC_MESSAGES/modules_exif.mo
|
||||
R modules/exif/locale/tr_TR/LC_MESSAGES
|
||||
R modules/exif/locale/tr_TR
|
||||
R modules/exif/locale/vi_VN/LC_MESSAGES/modules_exif.mo
|
||||
R modules/exif/locale/vi_VN/LC_MESSAGES
|
||||
R modules/exif/locale/vi_VN
|
||||
R modules/exif/po/cs_CZ.po
|
||||
R modules/exif/po/da_DK.po
|
||||
R modules/exif/po/de_DE.po
|
||||
R modules/exif/po/es_ES.po
|
||||
R modules/exif/po/eu_ES.po
|
||||
R modules/exif/po/fr_FR.po
|
||||
R modules/exif/po/ga_IE.po
|
||||
R modules/exif/po/is_IS.po
|
||||
R modules/exif/po/it_IT.po
|
||||
R modules/exif/po/ja_JP.po
|
||||
R modules/exif/po/nl_NL.po
|
||||
R modules/exif/po/no_NO.po
|
||||
R modules/exif/po/ru_RU.po
|
||||
R modules/exif/po/sr_YU.po
|
||||
R modules/exif/po/sv_SE.po
|
||||
R modules/exif/po/tr_TR.po
|
||||
R modules/exif/po/vi_VN.po
|
||||
R modules/exif/templates/Empty.tpl
|
||||
R modules/exif/templates/ExifItemDetails.tpl
|
||||
|
||||
39
Source/gallery2/modules/exif/Preloads.inc
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/*
|
||||
* Gallery - a web based photo album viewer and editor
|
||||
* Copyright (C) 2000-2007 Bharat Mediratta
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @package Exif
|
||||
* @author Alan Harder <alan.harder@sun.com>
|
||||
* @version $Revision: 16117 $
|
||||
*/
|
||||
class ExifPreloads {
|
||||
function preload(&$template, $preload, $paramSet) {
|
||||
static $loaded;
|
||||
if (!empty($loaded[$preload])) {
|
||||
return null;
|
||||
}
|
||||
$loaded[$preload] = 1;
|
||||
|
||||
$template->javascript('lib/yui/yahoo-min.js');
|
||||
$template->javascript('lib/yui/connection-min.js');
|
||||
return null;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -19,11 +19,12 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* This controller will switch the detail mode in the session and return to the previous page
|
||||
* Switch the detail mode in the session and return to the previous page.
|
||||
* This controller is used if the browser is not using javascript.
|
||||
* @package Exif
|
||||
* @subpackage UserInterface
|
||||
* @author Bharat Mediratta <bharat@menalto.com>
|
||||
* @version $Revision: 15513 $
|
||||
* @version $Revision: 16117 $
|
||||
*/
|
||||
class SwitchDetailModeController extends GalleryController {
|
||||
|
||||
@ -49,6 +50,69 @@ class SwitchDetailModeController extends GalleryController {
|
||||
|
||||
return array(null, $results);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This view provides raw html for the exif block, used in ajax calls to switch mode.
|
||||
* @author Alan Harder <alan.harder@sun.com>
|
||||
*/
|
||||
class SwitchDetailModeView extends GalleryView {
|
||||
|
||||
/**
|
||||
* @see GalleryView::isImmediate
|
||||
*/
|
||||
function isImmediate() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see GalleryView::isAllowedInEmbedOnly
|
||||
*/
|
||||
function isAllowedInEmbedOnly() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see GalleryView::renderImmediate
|
||||
*/
|
||||
function renderImmediate($status, $error) {
|
||||
global $gallery;
|
||||
$session =& $gallery->getSession();
|
||||
|
||||
list ($ret, $item) = $this->_getItem();
|
||||
if ($ret) {
|
||||
return $ret;
|
||||
}
|
||||
$ret = GalleryCoreApi::assertHasItemPermission($item->getId(), 'core.view');
|
||||
if ($ret) {
|
||||
return $ret;
|
||||
}
|
||||
|
||||
$mode = GalleryUtilities::getRequestVariables('mode');
|
||||
if ($mode != 'summary' && $mode != 'detailed') {
|
||||
$mode = 'summary';
|
||||
}
|
||||
|
||||
/* Store the new mode in the session */
|
||||
$session->put('exif.module.LoadExifInfo.mode', $mode);
|
||||
|
||||
if (!headers_sent()) {
|
||||
header("Content-type: text/plain; charset=UTF-8");
|
||||
}
|
||||
|
||||
GalleryCoreApi::requireOnce('modules/core/classes/GalleryTemplate.class');
|
||||
$template = new GalleryTemplate(dirname(dirname(dirname(__FILE__))));
|
||||
$template->setVariable('l10Domain', 'modules_exif');
|
||||
$template->setVariable('ajax', true);
|
||||
$template->setVariable('item', (array)$item);
|
||||
$template->setVariable('theme', array('actingUserId' => $gallery->getActiveUserId()));
|
||||
|
||||
$ret = $template->display('gallery:modules/exif/templates/blocks/ExifInfo.tpl');
|
||||
if ($ret) {
|
||||
return $ret;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
* @author Bharat Mediratta <bharat@menalto.com>
|
||||
* @author Georg Rehfeld <rehfeld@georg-rehfeld.de>
|
||||
* @author Jozsef R.Nagy <jozsef.rnagy@site.hu>
|
||||
* @version $Revision: 16034 $
|
||||
* @version $Revision: 16117 $
|
||||
*/
|
||||
class ExifModule extends GalleryModule {
|
||||
|
||||
@ -37,7 +37,7 @@ class ExifModule extends GalleryModule {
|
||||
$this->setId('exif');
|
||||
$this->setName($gallery->i18n('EXIF/IPTC'));
|
||||
$this->setDescription($gallery->i18n('Extract EXIF/IPTC data from JPEG photos'));
|
||||
$this->setVersion('1.1.0'); /* Update upgrade() function below too */
|
||||
$this->setVersion('1.1.0.1'); /* Update upgrade() function below too */
|
||||
$this->setGroup('data', $gallery->i18n('Extra Data'));
|
||||
$this->setCallbacks('getSiteAdminViews');
|
||||
$this->setRequiredCoreApi(array(7, 10));
|
||||
@ -131,6 +131,7 @@ class ExifModule extends GalleryModule {
|
||||
case '1.0.7':
|
||||
case '1.0.8':
|
||||
case '1.0.9':
|
||||
case '1.1.0':
|
||||
|
||||
case 'end of upgrade path':
|
||||
/*
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{*
|
||||
* $Revision: 15342 $
|
||||
* $Revision: 16117 $
|
||||
* If you want to customize this file, do not edit it directly since future upgrades
|
||||
* may overwrite it. Instead, copy it into a new directory called "local" and edit that
|
||||
* version. Gallery will look for that file first and use it if it exists.
|
||||
@ -10,44 +10,77 @@
|
||||
{g->callback type="exif.LoadExifInfo" itemId=$item.id}
|
||||
|
||||
{if !empty($block.exif.LoadExifInfo.exifData)}
|
||||
<div class="{$class}">
|
||||
{assign var="exif" value=$block.exif.LoadExifInfo}
|
||||
{if empty($ajax)}
|
||||
{if $exif.blockNum == 1}
|
||||
<script type="text/javascript">
|
||||
// <![CDATA[
|
||||
function exifSwitchDetailMode(num, itemId, mode) {ldelim}
|
||||
url = '{g->url arg1="view=exif.SwitchDetailMode" arg2="itemId=__ITEMID__"
|
||||
arg3="mode=__MODE__" arg4="blockNum=__NUM__" htmlEntities=false forceDirect=true}';
|
||||
document.getElementById('ExifInfoLabel' + num).innerHTML =
|
||||
'{g->text text="Loading.." forJavascript=true}';
|
||||
{literal}
|
||||
YAHOO.util.Connect.asyncRequest('GET',
|
||||
url.replace('__ITEMID__', itemId).replace('__MODE__', mode).replace('__NUM__', num),
|
||||
{success: handleExifResponse, failure: handleExifFail, argument: num}, null);
|
||||
return false;
|
||||
}
|
||||
function handleExifResponse(http) {
|
||||
document.getElementById('ExifInfoBlock' + http.argument).innerHTML = http.responseText;
|
||||
}
|
||||
function handleExifFail(http) {
|
||||
document.getElementById('ExifInfoLabel' + http.argument).innerHTML = '';
|
||||
}
|
||||
// ]]>
|
||||
</script>{/literal}
|
||||
{/if}
|
||||
<div id="ExifInfoBlock{$exif.blockNum}" class="{$class}">
|
||||
{/if}
|
||||
|
||||
<h3> {g->text text="Photo Properties"} </h3>
|
||||
|
||||
{if isset($block.exif.LoadExifInfo.mode)}
|
||||
<div>
|
||||
{if ($block.exif.LoadExifInfo.mode == 'summary')}
|
||||
{if isset($exif.mode)}
|
||||
<div>{strip}
|
||||
{if ($exif.mode == 'summary')}
|
||||
{g->text text="summary"}
|
||||
{else}
|
||||
<a href="{g->url arg1="controller=exif.SwitchDetailMode" arg2="mode=summary" arg3="return=true"}">
|
||||
<a href="{g->url arg1="controller=exif.SwitchDetailMode"
|
||||
arg2="mode=summary" arg3="return=true"}"
|
||||
onclick="return exifSwitchDetailMode({$exif.blockNum},{$item.id},'summary')">
|
||||
{g->text text="summary"}
|
||||
</a>
|
||||
{/if}
|
||||
|
||||
{if ($block.exif.LoadExifInfo.mode == 'detailed')}
|
||||
|
||||
{if ($exif.mode == 'detailed')}
|
||||
{g->text text="details"}
|
||||
{else}
|
||||
<a href="{g->url arg1="controller=exif.SwitchDetailMode" arg2="mode=detailed" arg3="return=true"}">
|
||||
<a href="{g->url arg1="controller=exif.SwitchDetailMode"
|
||||
arg2="mode=detailed" arg3="return=true"}"
|
||||
onclick="return exifSwitchDetailMode({$exif.blockNum},{$item.id},'detailed')">
|
||||
{g->text text="details"}
|
||||
</a>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<span id="ExifInfoLabel{$exif.blockNum}" style="padding-left:1.5em"></span>
|
||||
{/strip}</div>
|
||||
{/if}
|
||||
|
||||
{if !empty($block.exif.LoadExifInfo.exifData)}
|
||||
{if !empty($exif.exifData)}
|
||||
<table class="gbDataTable">
|
||||
{section name=outer loop=$block.exif.LoadExifInfo.exifData step=2}
|
||||
{section name=outer loop=$exif.exifData step=2}
|
||||
<tr>
|
||||
{section name=inner loop=$block.exif.LoadExifInfo.exifData start=$smarty.section.outer.index max=2}
|
||||
{section name=inner loop=$exif.exifData start=$smarty.section.outer.index max=2}
|
||||
<td class="gbEven">
|
||||
{g->text text=$block.exif.LoadExifInfo.exifData[inner].title}
|
||||
{g->text text=$exif.exifData[inner].title}
|
||||
</td>
|
||||
<td class="gbOdd">
|
||||
{$block.exif.LoadExifInfo.exifData[inner].value}
|
||||
{$exif.exifData[inner].value}
|
||||
</td>
|
||||
{/section}
|
||||
</tr>
|
||||
{/section}
|
||||
</table>
|
||||
{/if}
|
||||
</div>
|
||||
{if empty($ajax)}</div>{/if}
|
||||
{/if}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# $Id: el.po 16475 2007-05-31 17:44:01Z mindless $
|
||||
# $Id: el.po 16476 2007-05-31 18:15:59Z mindless $
|
||||
#
|
||||
# Gallery - a web based photo album viewer and editor
|
||||
# Copyright (C) 2000-2007 Bharat Mediratta
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# $Id: sr.po 16501 2007-06-02 18:37:40Z jozefs $
|
||||
# $Id: sr.po 16509 2007-06-05 01:25:06Z mindless $
|
||||
#
|
||||
# Gallery - a web based photo album viewer and editor
|
||||
# Copyright (C) 2000-2007 Bharat Mediratta
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# $Revision: 16636 $
|
||||
# $Revision: 16666 $
|
||||
# File crc32 crc32(crlf) size size(crlf) or R File
|
||||
modules/linkitem/ItemAddLinkItem.inc 1446560054 2152531137 8126 8380
|
||||
modules/linkitem/LinkItemOption.inc 1206993501 263542032 2529 2613
|
||||
@ -12,7 +12,7 @@ modules/linkitem/classes/GalleryStorage/xml-src/A_GalleryLinkItem_1.0.xml 298054
|
||||
modules/linkitem/classes/LinkItemToolkit.class 4050126237 3766852566 4401 4525
|
||||
modules/linkitem/images/arrow.png 2771826340 2771826340 330 330
|
||||
modules/linkitem/images/link.jpg 3372251726 3372251726 9207 9207
|
||||
modules/linkitem/module.inc 2374684836 2687375665 5802 5998
|
||||
modules/linkitem/module.inc 19118761 3536617954 5802 5998
|
||||
modules/linkitem/templates/ItemAddLinkItem.tpl 3168698319 903434845 2000 2057
|
||||
modules/linkitem/templates/LinkItemOption.tpl 3696569324 169892703 633 652
|
||||
modules/linkitem/templates/LinkItemSiteAdmin.tpl 2428580714 1345386496 3099 3164
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
/**
|
||||
* @package LinkItem
|
||||
* @author Alan Harder <alan.harder@sun.com>
|
||||
* @version $Revision: 16634 $
|
||||
* @version $Revision: 16665 $
|
||||
*/
|
||||
class LinkItemModule extends GalleryModule /* and GalleryEventListener */ {
|
||||
|
||||
|
||||
@ -21,11 +21,12 @@
|
||||
/**
|
||||
* @package Rating
|
||||
* @author Don Seiler <don@seiler.us>
|
||||
* @version $Revision: 15513 $
|
||||
* @version $Revision: 17083 $
|
||||
*/
|
||||
class RatingCallbacks {
|
||||
|
||||
function callback($params, &$smarty, $callback, $userId) {
|
||||
global $gallery;
|
||||
|
||||
switch ($callback) {
|
||||
case 'LoadRating':
|
||||
@ -73,14 +74,17 @@ class RatingCallbacks {
|
||||
return $ret;
|
||||
}
|
||||
|
||||
list ($ret, $permission) = GalleryCoreApi::hasItemPermission($itemId,
|
||||
'rating.add',
|
||||
$userId);
|
||||
list ($ret, $permission) =
|
||||
GalleryCoreApi::hasItemPermission($itemId, 'rating.add', $userId);
|
||||
if ($ret) {
|
||||
return $ret;
|
||||
}
|
||||
$RatingData[$itemId]['canRate'] = ($permission ? true : false);
|
||||
$RatingSummary = array('ratingValues' => array(1, 2, 3, 4, 5), 'firstCall' => true);
|
||||
|
||||
$session =& $gallery->getSession();
|
||||
$authToken = $session->isPersistent() ? $session->getAuthToken() : '';
|
||||
$RatingSummary = array('ratingValues' => array(1, 2, 3, 4, 5),
|
||||
'firstCall' => true, 'authToken' => $authToken);
|
||||
|
||||
$block =& $smarty->_tpl_vars['block'];
|
||||
$block['rating']['RatingData'] = $RatingData[$itemId];
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
# $Revision: 16041 $
|
||||
# $Revision: 17084 $
|
||||
# File crc32 crc32(crlf) size size(crlf) or R File
|
||||
modules/rating/Callbacks.inc 17180340 3325927566 2694 2789
|
||||
modules/rating/Callbacks.inc 1327081973 1366574839 2854 2953
|
||||
modules/rating/Preloads.inc 1602869504 3615487821 1336 1378
|
||||
modules/rating/RatingAlbum.inc 185505335 752697163 6533 6740
|
||||
modules/rating/RatingCallback.inc 4294590479 2160412630 2518 2611
|
||||
modules/rating/RatingCallback.inc 1211742722 620961112 2827 2927
|
||||
modules/rating/RatingItemEdit.inc 338179528 723090888 2403 2482
|
||||
modules/rating/RatingSiteAdmin.inc 3118608410 4185625557 5657 5839
|
||||
modules/rating/classes/GNUmakefile 1995366819 843025639 51 52
|
||||
@ -11,7 +11,7 @@ modules/rating/classes/GalleryStorage/GNUmakefile 1465776782 2009162633 61 62
|
||||
modules/rating/classes/GalleryStorage/schema.tpl 1776101869 2052189475 6501 6708
|
||||
modules/rating/classes/Maps.inc 3736103824 2523464981 970 975
|
||||
modules/rating/classes/Maps.xml 219510663 3143016974 1831 1902
|
||||
modules/rating/classes/RatingHelper.class 300088266 3930609022 7278 7522
|
||||
modules/rating/classes/RatingHelper.class 939099060 3046185108 7325 7570
|
||||
modules/rating/classes/RatingSortOrder.class 36365079 1551545683 1793 1847
|
||||
modules/rating/images/star_07.gif 2895369100 2895369100 175 175
|
||||
modules/rating/images/star_r_0.0.gif 3117757632 3117757632 109 109
|
||||
@ -20,79 +20,11 @@ modules/rating/images/star_r_1.0.gif 950031169 950031169 190 190
|
||||
modules/rating/images/star_u_1.0.gif 968361793 968361793 185 185
|
||||
modules/rating/images/star_u_noborder.gif 773766236 773766236 171 171
|
||||
modules/rating/images/transparent.gif 1799978585 1799978585 177 177
|
||||
modules/rating/locale/af/LC_MESSAGES/modules_rating.mo 2241615775 2241615775 1045 1045
|
||||
modules/rating/locale/ar/LC_MESSAGES/modules_rating.mo 4093876903 4093876903 1036 1036
|
||||
modules/rating/locale/ca/LC_MESSAGES/modules_rating.mo 1572101706 1572101706 1025 1025
|
||||
modules/rating/locale/cs/LC_MESSAGES/modules_rating.mo 123997580 123997580 3314 3314
|
||||
modules/rating/locale/da/LC_MESSAGES/modules_rating.mo 3174931344 3174931344 2604 2604
|
||||
modules/rating/locale/de/LC_MESSAGES/modules_rating.mo 4038624404 4038624404 3366 3366
|
||||
modules/rating/locale/en_GB/LC_MESSAGES/modules_rating.mo 3650053756 3650053756 662 662
|
||||
modules/rating/locale/es/LC_MESSAGES/modules_rating.mo 4009275270 4009275270 3487 3487
|
||||
modules/rating/locale/et/LC_MESSAGES/modules_rating.mo 195130076 195130076 2956 2956
|
||||
modules/rating/locale/eu/LC_MESSAGES/modules_rating.mo 2858528250 2858528250 2177 2177
|
||||
modules/rating/locale/fi/LC_MESSAGES/modules_rating.mo 1169971153 1169971153 3338 3338
|
||||
modules/rating/locale/fr/LC_MESSAGES/modules_rating.mo 2715773778 2715773778 3386 3386
|
||||
modules/rating/locale/he/LC_MESSAGES/modules_rating.mo 4045083347 4045083347 2375 2375
|
||||
modules/rating/locale/hu/LC_MESSAGES/modules_rating.mo 1681236382 1681236382 1002 1002
|
||||
modules/rating/locale/it/LC_MESSAGES/modules_rating.mo 1698544586 1698544586 3375 3375
|
||||
modules/rating/locale/ja/LC_MESSAGES/modules_rating.mo 4079204198 4079204198 2752 2752
|
||||
modules/rating/locale/ko/LC_MESSAGES/modules_rating.mo 3364679757 3364679757 2342 2342
|
||||
modules/rating/locale/lt/LC_MESSAGES/modules_rating.mo 1314781617 1314781617 1095 1095
|
||||
modules/rating/locale/lv/LC_MESSAGES/modules_rating.mo 2718218197 2718218197 3183 3183
|
||||
modules/rating/locale/nl/LC_MESSAGES/modules_rating.mo 2437899326 2437899326 1957 1957
|
||||
modules/rating/locale/no/LC_MESSAGES/modules_rating.mo 921023054 921023054 3292 3292
|
||||
modules/rating/locale/pl/LC_MESSAGES/modules_rating.mo 2935557767 2935557767 3405 3405
|
||||
modules/rating/locale/ro/LC_MESSAGES/modules_rating.mo 4050865546 4050865546 2757 2757
|
||||
modules/rating/locale/ru/LC_MESSAGES/modules_rating.mo 747504794 747504794 3105 3105
|
||||
modules/rating/locale/sk/LC_MESSAGES/modules_rating.mo 958276979 958276979 989 989
|
||||
modules/rating/locale/sl/LC_MESSAGES/modules_rating.mo 4005966609 4005966609 753 753
|
||||
modules/rating/locale/sr/LC_MESSAGES/modules_rating.mo 1961872384 1961872384 1020 1020
|
||||
modules/rating/locale/sv/LC_MESSAGES/modules_rating.mo 840759296 840759296 3342 3342
|
||||
modules/rating/locale/tr/LC_MESSAGES/modules_rating.mo 3041859735 3041859735 1642 1642
|
||||
modules/rating/locale/uk/LC_MESSAGES/modules_rating.mo 3001633814 3001633814 3047 3047
|
||||
modules/rating/locale/vi/LC_MESSAGES/modules_rating.mo 977487930 977487930 1020 1020
|
||||
modules/rating/locale/zh_CN/LC_MESSAGES/modules_rating.mo 1579973797 1579973797 2019 2019
|
||||
modules/rating/locale/zh_TW/LC_MESSAGES/modules_rating.mo 4199440416 4199440416 3009 3009
|
||||
modules/rating/module.inc 4201839413 2877706302 8775 9089
|
||||
modules/rating/po/GNUmakefile 1866879166 2808215985 98 103
|
||||
modules/rating/po/af.po 434903513 2061039217 3340 3486
|
||||
modules/rating/po/ar.po 912558673 61257967 3317 3461
|
||||
modules/rating/po/ca.po 4258477810 328809351 3412 3559
|
||||
modules/rating/po/cs.po 2894664737 2908432280 4338 4492
|
||||
modules/rating/po/da.po 3289378567 2279709160 4018 4168
|
||||
modules/rating/po/de.po 753519286 1722526669 4515 4671
|
||||
modules/rating/po/en_GB.po 1106551226 391191040 4011 4158
|
||||
modules/rating/po/es.po 1062170591 43103412 4504 4655
|
||||
modules/rating/po/et.po 3706576854 2478264442 4191 4341
|
||||
modules/rating/po/eu.po 2368710775 167022444 3859 4009
|
||||
modules/rating/po/fi.po 1646160430 1718842898 4467 4621
|
||||
modules/rating/po/fr.po 753250553 954505425 4328 4477
|
||||
modules/rating/po/he.po 3247987839 1116425719 4298 4453
|
||||
modules/rating/po/hu.po 3556632715 2702574587 3373 3521
|
||||
modules/rating/po/it.po 4141208041 3666350468 4274 4422
|
||||
modules/rating/po/ja.po 2643468325 2973591816 4165 4311
|
||||
modules/rating/po/ko.po 2487902023 874826645 3994 4142
|
||||
modules/rating/po/lt.po 3062646651 3826036006 3455 3603
|
||||
modules/rating/po/lv.po 3816302127 4105887919 4337 4490
|
||||
modules/rating/po/nl.po 260933764 2525156518 3940 4092
|
||||
modules/rating/po/no.po 1133698216 1115333272 4306 4456
|
||||
modules/rating/po/pl.po 767978402 2771017307 4334 4485
|
||||
modules/rating/po/ro.po 4161013395 1503731680 4078 4231
|
||||
modules/rating/po/ru.po 480164770 2809673718 5150 5312
|
||||
modules/rating/po/sk.po 134085635 3365098699 3521 3675
|
||||
modules/rating/po/sl.po 1373872457 891325033 3246 3392
|
||||
modules/rating/po/sr.po 17505911 1699798177 3291 3436
|
||||
modules/rating/po/strings.raw 606110976 2076974686 1722 1772
|
||||
modules/rating/po/sv.po 2342590734 2640905583 4279 4427
|
||||
modules/rating/po/tr.po 4022169480 305797683 3766 3919
|
||||
modules/rating/po/uk.po 1440538658 102728407 5094 5256
|
||||
modules/rating/po/vi.po 1435756876 1951081533 3328 3472
|
||||
modules/rating/po/zh_CN.po 2362515582 3662960353 3699 3847
|
||||
modules/rating/po/zh_TW.po 2428231215 2039694189 3967 4113
|
||||
modules/rating/module.inc 1199459320 2208849775 8955 9274
|
||||
modules/rating/rating.css 4190610765 1827259626 1355 1422
|
||||
modules/rating/rating.js 2562043307 2326475413 3066 3157
|
||||
modules/rating/templates/RatingImagePreload.tpl 2647571222 2722570816 592 607
|
||||
modules/rating/templates/RatingInterface.tpl 3362107028 1809251489 1804 1842
|
||||
modules/rating/rating.js 1480632445 3860676435 3159 3252
|
||||
modules/rating/templates/RatingImagePreload.tpl 1992695474 2245937245 719 739
|
||||
modules/rating/templates/RatingInterface.tpl 2334592577 483526333 1823 1862
|
||||
modules/rating/templates/RatingItemEdit.tpl 1362965059 2188375635 840 856
|
||||
modules/rating/templates/RatingSiteAdmin.tpl 3479141144 672969830 3933 4043
|
||||
modules/rating/templates/blocks/Rating.tpl 2134211530 112905348 640 658
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
* This view handles calls from the javascript (AJAX) side and returns data by printing results.
|
||||
* @package Rating
|
||||
* @author Don Seiler <don@seiler.us>
|
||||
* @version $Revision: 15513 $
|
||||
* @version $Revision: 17083 $
|
||||
*/
|
||||
class RatingCallbackView extends GalleryView {
|
||||
|
||||
@ -54,7 +54,7 @@ class RatingCallbackView extends GalleryView {
|
||||
header("Content-type: text/plain; charset=UTF-8");
|
||||
}
|
||||
|
||||
switch($command) {
|
||||
switch ($command) {
|
||||
case 'rate':
|
||||
list ($ret, $permission) = GalleryCoreApi::hasItemPermission($itemId, 'rating.add');
|
||||
if ($ret) {
|
||||
@ -79,10 +79,17 @@ class RatingCallbackView extends GalleryView {
|
||||
'count' => $results['votes'],
|
||||
'arg1' => $results['votes']));
|
||||
|
||||
$session =& $gallery->getSession();
|
||||
print $results['itemId'] . "\n"
|
||||
. $results['rating'] . "\n"
|
||||
. $results['votesString'] . "\n"
|
||||
. $results['userRating'];
|
||||
. $results['userRating'] . "\n"
|
||||
. $session->getAuthToken();
|
||||
/*
|
||||
* If this was the first rating from an anonymous user then their session just became
|
||||
* persistent (see RatingHelper::rateItem); return the authToken so it can be used
|
||||
* in future rating requests.
|
||||
*/
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
* @package Rating
|
||||
* @subpackage Classes
|
||||
* @author Don Seiler <don@seiler.us>
|
||||
* @version $Revision: 15513 $
|
||||
* @version $Revision: 16917 $
|
||||
* @static
|
||||
*/
|
||||
class RatingHelper {
|
||||
@ -54,7 +54,8 @@ class RatingHelper {
|
||||
'rating' => GalleryUtilities::roundToString($rating, 3),
|
||||
'votes' => (int)$result[2],
|
||||
'averagePercent' => GalleryUtilities::roundToString(($rating * 100 / 5), 3),
|
||||
'stars' => round($rating * 2)
|
||||
'stars' => round($rating * 2),
|
||||
'userRating' => 'N/A', 'userStars' => 0
|
||||
);
|
||||
|
||||
if ($rating == 0) {
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
* Provides item rating mechanism for Gallery2
|
||||
* @package Rating
|
||||
* @author Don Seiler <don@seiler.us>
|
||||
* @version $Revision: 16034 $
|
||||
* @version $Revision: 17083 $
|
||||
*/
|
||||
class RatingModule extends GalleryModule {
|
||||
|
||||
@ -32,7 +32,7 @@ class RatingModule extends GalleryModule {
|
||||
$this->setId('rating');
|
||||
$this->setName($gallery->i18n('Rating'));
|
||||
$this->setDescription($gallery->i18n('Item Rating Interface'));
|
||||
$this->setVersion('1.0.8'); /* Update upgrade() too */
|
||||
$this->setVersion('1.0.8.2'); /* Update upgrade() too */
|
||||
$this->setCallbacks('getSiteAdminViews|getItemSummaries|registerEventListeners');
|
||||
$this->setGroup('data', $gallery->i18n('Extra Data'));
|
||||
$this->setRequiredCoreApi(array(7, 10));
|
||||
@ -109,7 +109,10 @@ class RatingModule extends GalleryModule {
|
||||
$template->javascript('modules/rating/rating.js');
|
||||
|
||||
$template->setVariable('l10Domain', $this->getL10Domain());
|
||||
$RatingSummary = array('ratingValues' => array(1, 2, 3, 4, 5), 'firstCall' => true);
|
||||
$session =& $gallery->getSession();
|
||||
$authToken = $session->isPersistent() ? $session->getAuthToken() : '';
|
||||
$RatingSummary = array('ratingValues' => array(1, 2, 3, 4, 5),
|
||||
'firstCall' => true, 'authToken' => $authToken);
|
||||
|
||||
/* Check to see if album rating is allowed */
|
||||
list ($ret, $allowAlbumRating) = GalleryCoreApi::getPluginParameter('module', 'rating',
|
||||
@ -210,6 +213,8 @@ class RatingModule extends GalleryModule {
|
||||
case '1.0.5':
|
||||
case '1.0.6':
|
||||
case '1.0.7':
|
||||
case '1.0.8':
|
||||
case '1.0.8.1':
|
||||
|
||||
case 'end of upgrade path':
|
||||
break;
|
||||
|
||||
@ -17,6 +17,7 @@
|
||||
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
function rateItem(itemId, rating, url) {
|
||||
url = url.replace('__AUTHTOKEN__', galleryAuthToken);
|
||||
YAHOO.util.Connect.asyncRequest(
|
||||
'GET', url, {success: handleRatingResponse, failure: null, scope: null}, null);
|
||||
}
|
||||
@ -31,6 +32,7 @@ function updateItemRating(results) {
|
||||
var rating = results[1];
|
||||
var votes = results[2];
|
||||
var userRating = results[3];
|
||||
galleryAuthToken = results[4];
|
||||
|
||||
updateElementDisplay('rating.rating.' + itemId, rating);
|
||||
updateElementDisplay('rating.votes.' + itemId, votes);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{*
|
||||
* $Revision: 15342 $
|
||||
* $Revision: 17083 $
|
||||
* If you want to customize this file, do not edit it directly since future upgrades
|
||||
* may overwrite it. Instead, copy it into a new directory called "local" and edit that
|
||||
* version. Gallery will look for that file first and use it if it exists.
|
||||
@ -13,3 +13,8 @@
|
||||
<div class="giRatingFullUserNo"></div>
|
||||
<div class="giRatingFullUserYes"></div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
// <![CDATA[
|
||||
var galleryAuthToken = '{$RatingSummary.authToken}';
|
||||
// ]]>
|
||||
</script>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{*
|
||||
* $Revision: 15342 $
|
||||
* $Revision: 17083 $
|
||||
* If you want to customize this file, do not edit it directly since future upgrades
|
||||
* may overwrite it. Instead, copy it into a new directory called "local" and edit that
|
||||
* version. Gallery will look for that file first and use it if it exists.
|
||||
@ -12,7 +12,8 @@
|
||||
{foreach from=$RatingSummary.ratingValues item=ratingValue}{if $RatingData.canRate}<a
|
||||
href="javascript:rateItem({$RatingData.itemId}, {$ratingValue}, '{g->url
|
||||
arg1="view=rating.RatingCallback" arg2="command=rate"
|
||||
arg3="itemId=`$RatingData.itemId`" arg4="rating=$ratingValue" useAuthToken=1}')"
|
||||
arg3="itemId=`$RatingData.itemId`" arg4="rating=$ratingValue"
|
||||
arg5="authToken=__AUTHTOKEN__"}')"
|
||||
onmouseover="updateStarDisplay({$RatingData.itemId}, {$ratingValue}); return true"
|
||||
onmouseout="resetStarDisplay({$RatingData.itemId}); return true">{/if}<img
|
||||
src="{g->url href="modules/rating/images/transparent.gif"}"
|
||||
|
||||
65
Source/gallery2/modules/reupload/MANIFEST
Normal file
@ -0,0 +1,65 @@
|
||||
# $Revision: 16999 $
|
||||
# File crc32 crc32(crlf) size size(crlf) or R File
|
||||
modules/reupload/ReuploadPhotoOption.inc 3964836976 3438483170 7153 7377
|
||||
modules/reupload/locale/af/LC_MESSAGES/modules_reupload.mo 896656505 896656505 1012 1012
|
||||
modules/reupload/locale/ar/LC_MESSAGES/modules_reupload.mo 2017986001 2017986001 1000 1000
|
||||
modules/reupload/locale/ca/LC_MESSAGES/modules_reupload.mo 1972086934 1972086934 1024 1024
|
||||
modules/reupload/locale/cs/LC_MESSAGES/modules_reupload.mo 633360802 633360802 2317 2317
|
||||
modules/reupload/locale/da/LC_MESSAGES/modules_reupload.mo 84628116 84628116 2336 2336
|
||||
modules/reupload/locale/de/LC_MESSAGES/modules_reupload.mo 2096223262 2096223262 2451 2451
|
||||
modules/reupload/locale/en_GB/LC_MESSAGES/modules_reupload.mo 4003431696 4003431696 641 641
|
||||
modules/reupload/locale/es/LC_MESSAGES/modules_reupload.mo 3658091275 3658091275 2436 2436
|
||||
modules/reupload/locale/eu/LC_MESSAGES/modules_reupload.mo 2944874301 2944874301 1030 1030
|
||||
modules/reupload/locale/fi/LC_MESSAGES/modules_reupload.mo 3517117345 3517117345 1012 1012
|
||||
modules/reupload/locale/fr/LC_MESSAGES/modules_reupload.mo 2455260583 2455260583 2458 2458
|
||||
modules/reupload/locale/hu/LC_MESSAGES/modules_reupload.mo 494728685 494728685 2320 2320
|
||||
modules/reupload/locale/it/LC_MESSAGES/modules_reupload.mo 3115232968 3115232968 2289 2289
|
||||
modules/reupload/locale/ja/LC_MESSAGES/modules_reupload.mo 14525650 14525650 2708 2708
|
||||
modules/reupload/locale/ko/LC_MESSAGES/modules_reupload.mo 3048859999 3048859999 2408 2408
|
||||
modules/reupload/locale/lt/LC_MESSAGES/modules_reupload.mo 799368857 799368857 1080 1080
|
||||
modules/reupload/locale/nl/LC_MESSAGES/modules_reupload.mo 133744660 133744660 2342 2342
|
||||
modules/reupload/locale/no/LC_MESSAGES/modules_reupload.mo 2605860372 2605860372 2299 2299
|
||||
modules/reupload/locale/pl/LC_MESSAGES/modules_reupload.mo 3770357514 3770357514 2660 2660
|
||||
modules/reupload/locale/ro/LC_MESSAGES/modules_reupload.mo 914423823 914423823 1026 1026
|
||||
modules/reupload/locale/ru/LC_MESSAGES/modules_reupload.mo 2040322659 2040322659 3235 3235
|
||||
modules/reupload/locale/sk/LC_MESSAGES/modules_reupload.mo 1411963736 1411963736 784 784
|
||||
modules/reupload/locale/sr/LC_MESSAGES/modules_reupload.mo 1919860272 1919860272 1031 1031
|
||||
modules/reupload/locale/sv/LC_MESSAGES/modules_reupload.mo 921873718 921873718 2326 2326
|
||||
modules/reupload/locale/tr/LC_MESSAGES/modules_reupload.mo 1957567915 1957567915 2430 2430
|
||||
modules/reupload/locale/uk/LC_MESSAGES/modules_reupload.mo 420810265 420810265 1155 1155
|
||||
modules/reupload/locale/vi/LC_MESSAGES/modules_reupload.mo 87439155 87439155 1024 1024
|
||||
modules/reupload/locale/zh_CN/LC_MESSAGES/modules_reupload.mo 2449654531 2449654531 2168 2168
|
||||
modules/reupload/locale/zh_TW/LC_MESSAGES/modules_reupload.mo 4145871873 4145871873 2160 2160
|
||||
modules/reupload/module.inc 1284162666 1319619740 1857 1913
|
||||
modules/reupload/po/GNUmakefile 1866879166 2808215985 98 103
|
||||
modules/reupload/po/af.po 940246838 2093335771 2757 2851
|
||||
modules/reupload/po/ar.po 2210450356 2563682936 2715 2806
|
||||
modules/reupload/po/ca.po 2248450115 325544422 2859 2954
|
||||
modules/reupload/po/cs.po 1420222613 131224724 3300 3399
|
||||
modules/reupload/po/da.po 113786680 2733545953 3295 3392
|
||||
modules/reupload/po/de.po 1124565121 924158776 3438 3538
|
||||
modules/reupload/po/en_GB.po 3310890542 4093038074 3230 3326
|
||||
modules/reupload/po/es.po 1390705537 4266264185 3519 3621
|
||||
modules/reupload/po/eu.po 2128999760 3350849111 2793 2887
|
||||
modules/reupload/po/fi.po 4243761811 845275550 2852 2948
|
||||
modules/reupload/po/fr.po 2506633220 2253911831 3423 3522
|
||||
modules/reupload/po/hu.po 3843807443 1475979045 3425 3526
|
||||
modules/reupload/po/it.po 3449703043 4266303262 3327 3425
|
||||
modules/reupload/po/ja.po 2429978662 2443256545 3756 3852
|
||||
modules/reupload/po/ko.po 1414773339 445704307 3374 3469
|
||||
modules/reupload/po/lt.po 44745381 36639606 2882 2978
|
||||
modules/reupload/po/nl.po 893328773 3177575244 3300 3397
|
||||
modules/reupload/po/no.po 1425395230 2214209730 3373 3472
|
||||
modules/reupload/po/pl.po 574246641 770326361 3653 3757
|
||||
modules/reupload/po/ro.po 2549764909 1403187974 2803 2899
|
||||
modules/reupload/po/ru.po 791229907 1024786300 4317 4420
|
||||
modules/reupload/po/sk.po 3534503059 341235861 2799 2897
|
||||
modules/reupload/po/sr.po 250618174 2169868416 2752 2845
|
||||
modules/reupload/po/strings.raw 1673460572 233895089 1137 1160
|
||||
modules/reupload/po/sv.po 1347371747 1807691577 3285 3382
|
||||
modules/reupload/po/tr.po 657376590 2282395461 3397 3496
|
||||
modules/reupload/po/uk.po 2698008853 976519307 3083 3179
|
||||
modules/reupload/po/vi.po 128417224 868201578 2741 2833
|
||||
modules/reupload/po/zh_CN.po 2170950895 4144877966 3091 3181
|
||||
modules/reupload/po/zh_TW.po 65090378 2107124760 3083 3173
|
||||
modules/reupload/templates/ReuploadPhotoOption.tpl 725034240 1979712235 2002 2053
|
||||
224
Source/gallery2/modules/reupload/ReuploadPhotoOption.inc
Normal file
@ -0,0 +1,224 @@
|
||||
<?php
|
||||
/*
|
||||
* Gallery - a web based photo album viewer and editor
|
||||
* Copyright (C) 2000-2007 Bharat Mediratta
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/**
|
||||
* This ItemEditOption will handle the reupload of a photo
|
||||
* @package Reupload
|
||||
* @subpackage UserInterface
|
||||
* @author Piotr P. Karwasz <piotr.karwasz@ens.fr>
|
||||
* @version $Revision: 16994 $
|
||||
*/
|
||||
class ReuploadPhotoOption extends ItemEditOption {
|
||||
|
||||
/**
|
||||
* @see ItemEditOption::handleRequestAfterEdit
|
||||
*/
|
||||
function handleRequestAfterEdit($form, &$item, &$preferred) {
|
||||
global $gallery;
|
||||
$platform =& $gallery->getPlatform();
|
||||
|
||||
$status = $error = array();
|
||||
|
||||
if (!empty($form['tmp_name']['reupload']) && !empty($form['size']['reupload'])) {
|
||||
$inputFileName = $form['tmp_name']['reupload'];
|
||||
|
||||
list ($ret, $module) = GalleryCoreApi::loadPlugin('module', 'reupload');
|
||||
if ($ret) {
|
||||
return array($ret, null, null);
|
||||
}
|
||||
|
||||
if (!$platform->is_uploaded_file($inputFileName)
|
||||
|| !$platform->file_exists($inputFileName)) {
|
||||
return array(GalleryCoreApi::error(ERROR_BAD_PARAMETER), null, null);
|
||||
}
|
||||
|
||||
list ($ret, $hasLinkedEntity) = $this->_hasLinkedEntity($item);
|
||||
if ($ret) {
|
||||
return array($ret, null, null);
|
||||
}
|
||||
if ($hasLinkedEntity) {
|
||||
/* UI does not allow this */
|
||||
return array(GalleryCoreApi::error(ERROR_BAD_PARAMETER), null, null);
|
||||
}
|
||||
|
||||
list ($ret, $path) = $item->fetchPath();
|
||||
if ($ret) {
|
||||
return array($ret, null, null);
|
||||
}
|
||||
|
||||
/*
|
||||
* The parent must be read locked at this point to make sure that it's
|
||||
* not going to be moved around while we're copying a file to its directory.
|
||||
*/
|
||||
list ($ret, $lockIds[]) = GalleryCoreApi::acquireReadLockParents($item->getId());
|
||||
if ($ret) {
|
||||
return array($ret, null, null);
|
||||
}
|
||||
list ($ret, $lockIds[]) = GalleryCoreApi::acquireWriteLock($item->getId());
|
||||
if ($ret) {
|
||||
return array($ret, null, null);
|
||||
}
|
||||
list ($ret, $item) = $item->refresh();
|
||||
if ($ret) {
|
||||
GalleryCoreApi::releaseLocks($lockIds);
|
||||
return array($ret, null, null);
|
||||
}
|
||||
|
||||
/* take backup first */
|
||||
$tmpfname = $platform->tempnam($gallery->getConfig('data.gallery.tmp'), 'tmp_');
|
||||
if (!$tmpfname) {
|
||||
GalleryCoreApi::releaseLocks($lockIds);
|
||||
return array(GalleryCoreApi::error(ERROR_PLATFORM_FAILURE), null, null);
|
||||
}
|
||||
if (!$platform->copy($path, $tmpfname)) {
|
||||
$platform->unlink($tmpfname);
|
||||
GalleryCoreApi::releaseLocks($lockIds);
|
||||
return array(GalleryCoreApi::error(ERROR_PLATFORM_FAILURE), null, null);
|
||||
}
|
||||
if (!$platform->copy($inputFileName, $path)) {
|
||||
$platform->unlink($tmpfname);
|
||||
GalleryCoreApi::releaseLocks($lockIds);
|
||||
return array(GalleryCoreApi::error(ERROR_PLATFORM_FAILURE), null, null);
|
||||
}
|
||||
|
||||
$ret = $item->rescan();
|
||||
if ($ret) {
|
||||
if ($gallery->getDebug()) {
|
||||
$gallery->debug('Failed to rescan item after reupload. ' .
|
||||
'This is the error stack trace: ' . $ret->getAsText());
|
||||
}
|
||||
$platform->copy($tmpfname, $path);
|
||||
$platform->unlink($tmpfname);
|
||||
GalleryCoreApi::releaseLocks($lockIds);
|
||||
$error[] = 'form[error][reupload][toolkit]';
|
||||
return array(null, $error, $status);
|
||||
}
|
||||
|
||||
$ret = $item->save();
|
||||
if ($ret) {
|
||||
$platform->copy($tmpfname, $path);
|
||||
$platform->unlink($tmpfname);
|
||||
GalleryCoreApi::releaseLocks($lockIds);
|
||||
return array($ret, null, null);
|
||||
}
|
||||
|
||||
$platform->unlink($tmpfname);
|
||||
$ret = GalleryCoreApi::releaseLocks($lockIds);
|
||||
if ($ret) {
|
||||
return array($ret, null, null);
|
||||
}
|
||||
|
||||
$ret = GalleryCoreApi::invalidateDerivativeDimensionsBySourceIds(
|
||||
array($item->getId()));
|
||||
if ($ret) {
|
||||
return array($ret, null, null);
|
||||
}
|
||||
|
||||
$status[] = $module->translate('Reuploaded file successfully.');
|
||||
} else {
|
||||
/*
|
||||
* The only way to reupload the file is through the browser,
|
||||
* which leaves out those who wants to reupload larger files
|
||||
*/
|
||||
if (!empty($form['name']['reupload'])) {
|
||||
/* if we tried and failed to upload the file */
|
||||
$error[] = 'form[error][reupload][failure]';
|
||||
}
|
||||
}
|
||||
return array(null, $error, $status);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ItemEditOption::loadTemplate
|
||||
*/
|
||||
function loadTemplate(&$template, &$form, $item, $thumbnail) {
|
||||
list ($ret, $module) = GalleryCoreApi::loadPlugin('module', 'reupload');
|
||||
if ($ret) {
|
||||
return array($ret, null, null);
|
||||
}
|
||||
|
||||
if ($template->hasVariable('ItemAdmin')) {
|
||||
$ItemAdmin =& $template->getVariableByReference('ItemAdmin');
|
||||
$ItemAdmin['enctype'] = 'multipart/form-data';
|
||||
} else {
|
||||
$ItemAdmin = array('enctype' => 'multipart/form-data');
|
||||
$template->setVariable('ItemAdmin', $ItemAdmin);
|
||||
}
|
||||
|
||||
$fileUploadsBool = GalleryUtilities::getPhpIniBool('file_uploads');
|
||||
|
||||
$maxFileSize = ini_get('upload_max_filesize');
|
||||
if (preg_match("/(\d+)M/", $maxFileSize, $matches)) {
|
||||
$maxFileSize = $matches[1] * 1024 * 1024;
|
||||
}
|
||||
|
||||
if ($maxFileSize >= 1024 * 1024) {
|
||||
$maxFileSize = $module->translate(array('one' => '%d megabyte',
|
||||
'many' => '%d megabytes',
|
||||
'count' => (int)($maxFileSize / (1024 * 1024)),
|
||||
'arg1' => (int)($maxFileSize / (1024 * 1024))));
|
||||
} else if ($maxFileSize >= 1024) {
|
||||
$maxFileSize = $module->translate(array('one' => '%d kilobytes',
|
||||
'many' => '%d kilobytes',
|
||||
'count' => (int)($maxFileSize / (1024)),
|
||||
'arg1' => (int)($maxFileSize / (1024))));
|
||||
}
|
||||
|
||||
list ($ret, $hasLinkedEntity) = $this->_hasLinkedEntity($item);
|
||||
if ($ret) {
|
||||
return array($ret, null, null);
|
||||
}
|
||||
|
||||
$template->setVariable('ReuploadPhotoOption',
|
||||
array('maxFileSize' => $maxFileSize,
|
||||
'uploadsPermitted' => $fileUploadsBool,
|
||||
'hasLinkedEntity' => $hasLinkedEntity));
|
||||
|
||||
return array(null, 'modules/reupload/templates/ReuploadPhotoOption.tpl',
|
||||
'modules_reupload');
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ItemEditOption::isAppropriate
|
||||
*/
|
||||
function isAppropriate($item, $thumbnail) {
|
||||
return array(null, GalleryUtilities::isA($item, 'GalleryPhotoItem'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if item is part of a linked(replica) set.
|
||||
* @param GalleryItem $item
|
||||
* @return array GalleryStatus a status code
|
||||
* bool true if linked
|
||||
* @access private
|
||||
*/
|
||||
function _hasLinkedEntity($item) {
|
||||
$hasLink = $item->isLinked();
|
||||
if (!$hasLink) {
|
||||
list ($ret, $linkedIds) = GalleryCoreApi::fetchEntitiesLinkedTo($item->getId());
|
||||
if ($ret) {
|
||||
return array($ret, null);
|
||||
}
|
||||
$hasLink = !empty($linkedIds);
|
||||
}
|
||||
return array(null, $hasLink);
|
||||
}
|
||||
}
|
||||
?>
|
||||
56
Source/gallery2/modules/reupload/module.inc
Normal file
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/*
|
||||
* Gallery - a web based photo album viewer and editor
|
||||
* Copyright (C) 2000-2007 Bharat Mediratta
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Reupload a file without destroying metadata information
|
||||
*
|
||||
* @package Reupload
|
||||
* @author Piotr P. Karwasz <piotr.karwasz@ens.fr>
|
||||
* @version $Revision: 16994 $
|
||||
*/
|
||||
class ReuploadModule extends GalleryModule {
|
||||
|
||||
function ReuploadModule() {
|
||||
global $gallery;
|
||||
$this->setId('reupload');
|
||||
$this->setName($gallery->i18n('Reupload'));
|
||||
$this->setDescription($gallery->i18n('Allows reupload of pictures.'));
|
||||
$this->setVersion('1.0.5.1');
|
||||
$this->setGroup('data', $gallery->i18n('Extra Data'));
|
||||
$this->setCallbacks('');
|
||||
$this->setRequiredCoreApi(array(7, 4));
|
||||
$this->setRequiredModuleApi(array(3, 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see GalleryModule::performFactoryRegistrations
|
||||
*/
|
||||
function performFactoryRegistrations() {
|
||||
$ret = GalleryCoreApi::registerFactoryImplementation(
|
||||
'ItemEditOption', 'ReuploadPhotoOption', 'ReuploadPhotoOption',
|
||||
'modules/reupload/ReuploadPhotoOption.inc', 'reupload',
|
||||
array('ItemEditRotateAndScalePhoto'));
|
||||
if ($ret) {
|
||||
return $ret;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
?>
|
||||
104
Source/gallery2/modules/reupload/po/pl.po
Normal file
@ -0,0 +1,104 @@
|
||||
# $Id: pl.po 16994 2007-08-29 20:31:54Z mindless $
|
||||
#
|
||||
# Gallery - a web based photo album viewer and editor
|
||||
# Copyright (C) 2000-2007 Bharat Mediratta
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or (at
|
||||
# your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Gallery: Reupload 1.0.5\n"
|
||||
"POT-Creation-Date: 2006-02-23 10:15+0100\n"
|
||||
"PO-Revision-Date: 2007-08-27 12:01+0100\n"
|
||||
"Last-Translator: Kappana <kappana@gnoms.net>\n"
|
||||
"Language-Team: Polish <gallery-devel@lists.sourceforge.net>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? "
|
||||
"1 : 2);\n"
|
||||
"X-Poedit-Language: Polish\n"
|
||||
"X-Poedit-Country: POLAND\n"
|
||||
|
||||
msgid "Reuploaded file successfully."
|
||||
msgstr "Plik został zaktualizowany"
|
||||
|
||||
#, c-format
|
||||
msgid "%d megabyte"
|
||||
msgid_plural "%d megabytes"
|
||||
msgstr[0] "%d MB"
|
||||
msgstr[1] "%d MB"
|
||||
msgstr[2] "%d MB"
|
||||
|
||||
#, c-format
|
||||
msgid "%d kilobytes"
|
||||
msgid_plural "%d kilobytes"
|
||||
msgstr[0] "%d kB"
|
||||
msgstr[1] "%d kB"
|
||||
msgstr[2] "%d kB"
|
||||
|
||||
msgid "Reupload"
|
||||
msgstr "Aktualizacja plików"
|
||||
|
||||
msgid "Allows reupload of pictures."
|
||||
msgstr "Pozwala na ponowne przesłanie i nadpisanie istniejących plików"
|
||||
|
||||
msgid "Extra Data"
|
||||
msgstr "Dodatkowe dane"
|
||||
|
||||
msgid "Reupload Photo"
|
||||
msgstr "Aktualizacja zdjęcia"
|
||||
|
||||
msgid ""
|
||||
"Your webserver is configured to disallow file uploads from your web browser at this time. "
|
||||
"Please contact your system administrator for assistance."
|
||||
msgstr ""
|
||||
"Serwer WWW jest skonfigurowany w ten sposób, aby nie było możliwe ponowne przesyłanie i "
|
||||
"nadpisywanie istniejących plików. Aby to zmienić, proszę skontaktować się z administratorem."
|
||||
|
||||
msgid "Upload a new revision of this picture instead of the old one."
|
||||
msgstr "Wyślij nową wersję tego zdjęcia."
|
||||
|
||||
msgid "You cannot reupload this item because it shares its data file with other items."
|
||||
msgstr ""
|
||||
"Nie można zaktualizować tej pozycji ponieważ plik tej pozycji jest współdzielony z innymi "
|
||||
"pozycjami."
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
"<b>Note:</b> The new file cannot be larger than %s. If you want to upload a larger file you "
|
||||
"must ask your system administrator to allow larger uploads."
|
||||
msgstr ""
|
||||
"<b>Uwaga: </b> Nowy plik nie może być większy niż %s. Aby wysłać większy plik, proszę "
|
||||
"skontaktować się z administratorem systemu w celu zwiększenia limitu na przesyłane dane."
|
||||
|
||||
msgid "File"
|
||||
msgstr "Plik"
|
||||
|
||||
msgid "Reupload File"
|
||||
msgstr "Zaktualizuj plik"
|
||||
|
||||
msgid "Unable to reupload file."
|
||||
msgstr "Nie można zaktualizować pliku"
|
||||
|
||||
#, c-format
|
||||
msgid "Please check the size and try again. The new file cannot be larger than %s."
|
||||
msgstr "Proszę sprawdzić rozmiar i spróbować ponownie. Nowy plik nie może być większy niż %s."
|
||||
|
||||
msgid ""
|
||||
"Unable to reupload file. Are you sure the file is of the same type (image, movie) as the "
|
||||
"original?"
|
||||
msgstr ""
|
||||
"Nie można zaktualizować pliku. Czy jesteś pewnien, że przesyłany plik jest tego samego "
|
||||
"rodzaju (zdjęcie, film) co oryginał?"
|
||||
23
Source/gallery2/modules/reupload/po/strings.raw
Normal file
@ -0,0 +1,23 @@
|
||||
# $Id: strings.raw 16994 2007-08-29 20:31:54Z mindless $
|
||||
|
||||
/* ReuploadPhotoOption.inc */
|
||||
gettext("Reuploaded file successfully.")
|
||||
ngettext("%d megabyte", "%d megabytes")
|
||||
ngettext("%d kilobytes", "%d kilobytes")
|
||||
|
||||
/* module.inc */
|
||||
gettext("Reupload")
|
||||
gettext("Allows reupload of pictures.")
|
||||
gettext("Extra Data")
|
||||
|
||||
/* templates/ReuploadPhotoOption.tpl */
|
||||
gettext("Reupload Photo")
|
||||
gettext("Your webserver is configured to disallow file uploads from your web browser at this time. Please contact your system administrator for assistance.")
|
||||
gettext("Upload a new revision of this picture instead of the old one.")
|
||||
gettext("You cannot reupload this item because it shares its data file with other items.")
|
||||
gettext("<b>Note:</b> The new file cannot be larger than %s. If you want to upload a larger file you must ask your system administrator to allow larger uploads.")
|
||||
gettext("File")
|
||||
gettext("Reupload File")
|
||||
gettext("Unable to reupload file.")
|
||||
gettext("Please check the size and try again. The new file cannot be larger than %s.")
|
||||
gettext("Unable to reupload file. Are you sure the file is of the same type (image, movie) as the original?")
|
||||
@ -0,0 +1,51 @@
|
||||
{*
|
||||
* $Revision: 16994 $
|
||||
* If you want to customize this file, do not edit it directly since future upgrades
|
||||
* may overwrite it. Instead, copy it into a new directory called "local" and edit that
|
||||
* version. Gallery will look for that file first and use it if it exists.
|
||||
*}
|
||||
<div class="gbBlock">
|
||||
<h3> {g->text text="Reupload Photo"} </h3>
|
||||
|
||||
{if !$ReuploadPhotoOption.uploadsPermitted}
|
||||
<div class="giError">
|
||||
{g->text text="Your webserver is configured to disallow file uploads from your web browser at this time. Please contact your system administrator for assistance."}
|
||||
</div>
|
||||
{else}
|
||||
<p class="giDescription">
|
||||
{g->text text="Upload a new revision of this picture instead of the old one."}
|
||||
</p>
|
||||
|
||||
{if $ReuploadPhotoOption.hasLinkedEntity}
|
||||
<b>{g->text text="You cannot reupload this item because it shares its data file with other items."}</b>
|
||||
{else}
|
||||
{if $ReuploadPhotoOption.maxFileSize != 0}
|
||||
<p class="giDescription">
|
||||
{g->text text="<b>Note:</b> The new file cannot be larger than %s. If you want to upload a larger file you must ask your system administrator to allow larger uploads."
|
||||
arg1=$ReuploadPhotoOption.maxFileSize}
|
||||
</p>
|
||||
{/if}
|
||||
|
||||
<h4> {g->text text="File"} </h4>
|
||||
<input type="file" size="60" name="{g->formVar var="form[reupload]"}"/>
|
||||
|
||||
<input type="submit" class="inputTypeSubmit"
|
||||
name="{g->formVar var="form[action][save]"}" value="{g->text text="Reupload File"}"/>
|
||||
|
||||
{if isset($form.error.reupload.failure)}
|
||||
<div class="giError">
|
||||
{g->text text="Unable to reupload file."}
|
||||
{if $ReuploadPhotoOption.maxFileSize > 0}
|
||||
{g->text text="Please check the size and try again. The new file cannot be larger than %s."
|
||||
arg1=$ReuploadPhotoOption.maxFileSize}
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
{if isset($form.error.reupload.toolkit)}
|
||||
<div class="gbBlock giError">
|
||||
{g->text text="Unable to reupload file. Are you sure the file is of the same type (image, movie) as the original?"}
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
@ -0,0 +1,208 @@
|
||||
<?php
|
||||
/*
|
||||
* Gallery - a web based photo album viewer and editor
|
||||
* Copyright (C) 2000-2007 Bharat Mediratta
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Reupload controller tests
|
||||
* @package Reupload
|
||||
* @subpackage PHPUnit
|
||||
* @author Piotr P. Karwasz <piotr.karwasz@ens.fr>
|
||||
* @version $Revision: 16994 $
|
||||
*/
|
||||
class ReuploadOptionTest extends ItemEditOptionTestCase {
|
||||
function ReuploadOptionTest($methodName) {
|
||||
$this->ItemEditOptionTestCase($methodName, 'reupload', 'ReuploadPhotoOption');
|
||||
}
|
||||
|
||||
function setUp() {
|
||||
global $gallery;
|
||||
parent::setUp();
|
||||
|
||||
list ($ret, $this->_album) = $this->_createRandomAlbum($this->_getRootId());
|
||||
if ($ret) {
|
||||
print $ret->getAsHtml();
|
||||
return $this->failWithStatus($ret);
|
||||
}
|
||||
|
||||
$this->_markForCleanup($this->_album);
|
||||
|
||||
/* Register a dummy toolkit */
|
||||
$ret = GalleryCoreApi::registerFactoryImplementation(
|
||||
'GalleryToolkit', 'ReuploadOptionTestToolkit', 'ReuploadOptionTestToolkit',
|
||||
'modules/reupload/test/phpunit/ReuploadOptionTest.class', 'reuploadTest', null);
|
||||
if ($ret) {
|
||||
print $ret->getAsHtml();
|
||||
return $this->failWithStatus($ret);
|
||||
}
|
||||
$this->_markToolkitForCleanup('ReuploadOptionTestToolkit');
|
||||
|
||||
$ret = GalleryCoreApi::registerToolkitProperty('ReuploadOptionTestToolkit',
|
||||
array('image/known'), 'dimensions', 'int,int', 'desc');
|
||||
if ($ret) {
|
||||
print $ret->getAsHtml();
|
||||
return $this->failWithStatus($ret);
|
||||
}
|
||||
|
||||
list ($ret, $this->_item) =
|
||||
$this->_createRandomDataItem($this->_album->getId(), 'image/known');
|
||||
if ($ret) {
|
||||
print $ret->getAsHtml();
|
||||
return $this->failWithStatus($ret);
|
||||
}
|
||||
$this->_itemSize = $this->_item->getSize();
|
||||
|
||||
/* create custom platform to return dummy filesize, imagesize, etc. */
|
||||
$gallery->setPlatform(new ReuploadOptionTestPlatform($gallery->getPlatform()));
|
||||
}
|
||||
|
||||
function testReupload() {
|
||||
$form['tmp_name']['reupload'] = 'bogus.tmp';
|
||||
$form['size']['reupload'] = 800;
|
||||
$form['serialNumber'] = $this->_item->getSerialNumber();
|
||||
|
||||
/* Perform the request and verify that we succeeded */
|
||||
list ($errors, $warnings) = $this->_handleRequestAfterEdit($form, $this->_item);
|
||||
$this->assertEquals(array(), $errors, 'Errors');
|
||||
$this->assertEquals(array($this->_translate('Reuploaded file successfully.')),
|
||||
$warnings, 'Warnings');
|
||||
$this->assertEquals(800, $this->_item->getSize(), 'Item size');
|
||||
}
|
||||
|
||||
/*
|
||||
* This imitates the case when the file couldn't be uploaded.
|
||||
* We are assuming that the reason is that filesize exceeds the limit
|
||||
* which is most common case.
|
||||
*/
|
||||
function testReuploadFailure() {
|
||||
$form['tmp_name']['reupload'] = '';
|
||||
$form['name']['reupload'] = 'itried.jpg';
|
||||
$form['size']['reupload'] = 0;
|
||||
$form['serialNumber'] = $this->_item->getSerialNumber();
|
||||
|
||||
/* Perform the request and verify that we failed and filesize didn't change */
|
||||
list ($errors, $warnings) = $this->_handleRequestAfterEdit($form, $this->_item);
|
||||
$this->assertEquals(array('form[error][reupload][failure]'), $errors, 'Errors');
|
||||
$this->assertEquals(array(), $warnings, 'Warnings');
|
||||
$this->assertEquals($this->_itemSize, $this->_item->getSize(), 'Item size');
|
||||
}
|
||||
|
||||
/* This imitates the case when the new file has different mime type than the old one */
|
||||
function testReuploadToolkitFailure() {
|
||||
$form['tmp_name']['reupload'] = 'bogus.mpeg';
|
||||
$form['size']['reupload'] = 1500;
|
||||
$form['serialNumber'] = $this->_item->getSerialNumber();
|
||||
GalleryUtilities::putRequestVariable('dimensions', 'bad_data');
|
||||
|
||||
/* Perform the request and verify that we failed and filesize didn't change */
|
||||
list ($errors, $warnings) = $this->_handleRequestAfterEdit($form, $this->_item);
|
||||
$this->assertEquals(array('form[error][reupload][toolkit]'), $errors, 'Errors');
|
||||
$this->assertEquals(array(), $warnings, 'Warnings');
|
||||
/* Size might been changed, but transaction was aborted */
|
||||
list ($ret, $item) = $this->_item->refresh();
|
||||
if ($ret) {
|
||||
print $ret->getAsHtml();
|
||||
return $this->failWithStatus($ret);
|
||||
}
|
||||
$this->assertEquals($this->_itemSize, $item->getSize(), 'Item size');
|
||||
}
|
||||
|
||||
/*
|
||||
* This imitates the case when we didn't even try to upload the file
|
||||
* Shouldn't be any errors!
|
||||
*/
|
||||
function testReuploadNothing() {
|
||||
$form['tmp_name']['reupload'] = '';
|
||||
$form['name']['reupload'] = '';
|
||||
$form['size']['reupload'] = 0;
|
||||
$form['serialNumber'] = $this->_item->getSerialNumber();
|
||||
|
||||
/* Perform the request and verify that we failed and filesize didn't change */
|
||||
list ($errors, $warnings) = $this->_handleRequestAfterEdit($form, $this->_item);
|
||||
$this->assertEquals(array(), $errors, 'Errors');
|
||||
$this->assertEquals(array(), $warnings, 'Warnings');
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify that attempt to reupload to a linked entity is blocked (UI doesn't allow it).
|
||||
*/
|
||||
function testReuploadLinkedEntity() {
|
||||
list ($ret, $linkedEntity) = $this->_createLinkedItem($this->_album->getId(), $this->_item);
|
||||
if ($ret) {
|
||||
return $ret;
|
||||
}
|
||||
|
||||
$form['tmp_name']['reupload'] = 'bogus.tmp';
|
||||
$form['size']['reupload'] = 800;
|
||||
$form['serialNumber'] = $this->_item->getSerialNumber();
|
||||
|
||||
/* Perform the request and verify that we failed */
|
||||
$this->_handleRequestAfterEdit($form, $this->_item, ERROR_BAD_PARAMETER);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test platform
|
||||
*/
|
||||
class ReuploadOptionTestPlatform extends GalleryPlatform {
|
||||
function ReuploadOptionTestPlatform($originalPlatform) {
|
||||
$this->_savedPlatform = $originalPlatform;
|
||||
}
|
||||
|
||||
function is_uploaded_file($file) {
|
||||
return true;
|
||||
}
|
||||
|
||||
function file_exists($file) {
|
||||
return !strstr($file,'albumtest');
|
||||
}
|
||||
|
||||
function unlink($file) {
|
||||
return true;
|
||||
}
|
||||
|
||||
function copy($input, $output) {
|
||||
return true;
|
||||
}
|
||||
|
||||
function filesize($path) {
|
||||
return 800;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test toolkit
|
||||
*/
|
||||
class ReuploadOptionTestToolkit extends GalleryToolkit {
|
||||
/**
|
||||
* @see GalleryToolkit::getProperty
|
||||
*/
|
||||
function getProperty($mimeType, $propertyName, $file) {
|
||||
if ($propertyName == 'dimensions') {
|
||||
$dimensionRequest = GalleryUtilities::getRequestVariables('dimensions');
|
||||
if ($dimensionRequest == 'bad_data') {
|
||||
return array(GalleryCoreApi::error(ERROR_BAD_DATA_TYPE), null);
|
||||
} else {
|
||||
return array(null, array(2603, 1966));
|
||||
}
|
||||
}
|
||||
return array(GalleryCoreApi::error(ERROR_UNIMPLEMENTED), null);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@ -1,92 +1,6 @@
|
||||
# $Revision: 16636 $
|
||||
# $Revision: 16666 $
|
||||
# File crc32 crc32(crlf) size size(crlf) or R File
|
||||
modules/shutterfly/PrintPhotos.inc 2556871678 4141413962 6787 6999
|
||||
modules/shutterfly/PrintPhotos.inc 1500661381 1854036671 6787 6999
|
||||
modules/shutterfly/classes/ShutterflyCartPlugin.class 3148012052 2708917180 2082 2145
|
||||
modules/shutterfly/locale/af/LC_MESSAGES/modules_shutterfly.mo 4137365090 4137365090 721 721
|
||||
modules/shutterfly/locale/cs/LC_MESSAGES/modules_shutterfly.mo 3336451554 3336451554 886 886
|
||||
modules/shutterfly/locale/da/LC_MESSAGES/modules_shutterfly.mo 1776362304 1776362304 722 722
|
||||
modules/shutterfly/locale/de/LC_MESSAGES/modules_shutterfly.mo 2347266850 2347266850 793 793
|
||||
modules/shutterfly/locale/en_GB/LC_MESSAGES/modules_shutterfly.mo 405699738 405699738 457 457
|
||||
modules/shutterfly/locale/es/LC_MESSAGES/modules_shutterfly.mo 2290006704 2290006704 813 813
|
||||
modules/shutterfly/locale/eu/LC_MESSAGES/modules_shutterfly.mo 4253229854 4253229854 717 717
|
||||
modules/shutterfly/locale/fi/LC_MESSAGES/modules_shutterfly.mo 3020629196 3020629196 847 847
|
||||
modules/shutterfly/locale/fr/LC_MESSAGES/modules_shutterfly.mo 3804831218 3804831218 742 742
|
||||
modules/shutterfly/locale/is/LC_MESSAGES/modules_shutterfly.mo 2559113618 2559113618 421 421
|
||||
modules/shutterfly/locale/it/LC_MESSAGES/modules_shutterfly.mo 1450031882 1450031882 750 750
|
||||
modules/shutterfly/locale/ja/LC_MESSAGES/modules_shutterfly.mo 3654593710 3654593710 763 763
|
||||
modules/shutterfly/locale/ko/LC_MESSAGES/modules_shutterfly.mo 129723486 129723486 819 819
|
||||
modules/shutterfly/locale/nl/LC_MESSAGES/modules_shutterfly.mo 3987191018 3987191018 763 763
|
||||
modules/shutterfly/locale/no/LC_MESSAGES/modules_shutterfly.mo 1587586981 1587586981 793 793
|
||||
modules/shutterfly/locale/pl/LC_MESSAGES/modules_shutterfly.mo 2605044609 2605044609 851 851
|
||||
modules/shutterfly/locale/ru/LC_MESSAGES/modules_shutterfly.mo 1759440214 1759440214 907 907
|
||||
modules/shutterfly/locale/sr/LC_MESSAGES/modules_shutterfly.mo 2523712830 2523712830 795 795
|
||||
modules/shutterfly/locale/sv/LC_MESSAGES/modules_shutterfly.mo 3738142713 3738142713 827 827
|
||||
modules/shutterfly/locale/tr/LC_MESSAGES/modules_shutterfly.mo 469920630 469920630 788 788
|
||||
modules/shutterfly/locale/zh_CN/LC_MESSAGES/modules_shutterfly.mo 1034308011 1034308011 649 649
|
||||
modules/shutterfly/locale/zh_TW/LC_MESSAGES/modules_shutterfly.mo 1672933735 1672933735 781 781
|
||||
modules/shutterfly/module.inc 1334715086 1000497923 4229 4375
|
||||
modules/shutterfly/po/GNUmakefile 1866879166 2808215985 98 103
|
||||
modules/shutterfly/po/af.po 15213025 3356514400 1700 1752
|
||||
modules/shutterfly/po/cs.po 2110308253 3774085379 1778 1830
|
||||
modules/shutterfly/po/da.po 1021636279 1124709370 1668 1716
|
||||
modules/shutterfly/po/de.po 1608077188 855000369 1785 1837
|
||||
modules/shutterfly/po/en_GB.po 1874870876 2358293883 1662 1710
|
||||
modules/shutterfly/po/es.po 2481117095 3567370329 1807 1858
|
||||
modules/shutterfly/po/eu.po 2889747112 1116268367 1597 1646
|
||||
modules/shutterfly/po/fi.po 3465613783 4060603069 1957 2012
|
||||
modules/shutterfly/po/fr.po 4145958873 1230411112 1673 1722
|
||||
modules/shutterfly/po/is.po 3324715778 1074436786 1512 1560
|
||||
modules/shutterfly/po/it.po 3469669614 2824482877 1626 1674
|
||||
modules/shutterfly/po/ja.po 3993029737 533534279 1639 1687
|
||||
modules/shutterfly/po/ko.po 98219034 1034312948 1743 1795
|
||||
modules/shutterfly/po/nl.po 1307791955 4070280534 1727 1777
|
||||
modules/shutterfly/po/no.po 2279626670 2988707793 1788 1839
|
||||
modules/shutterfly/po/pl.po 2611889567 2029208033 1736 1786
|
||||
modules/shutterfly/po/ru.po 4246536760 4087413434 1979 2034
|
||||
modules/shutterfly/po/sr.po 2108572326 3434507313 1673 1722
|
||||
modules/shutterfly/po/strings.raw 1553599558 1155958852 300 311
|
||||
modules/shutterfly/po/sv.po 903565190 2902255335 1707 1756
|
||||
modules/shutterfly/po/tr.po 963992739 2123227608 1672 1722
|
||||
modules/shutterfly/po/zh_CN.po 1530817950 114005678 1732 1784
|
||||
modules/shutterfly/po/zh_TW.po 1362724431 3238024022 1665 1714
|
||||
modules/shutterfly/templates/PrintPhotos.tpl 726738513 3186354616 2272 2327
|
||||
R modules/shutterfly/locale/cs_CZ/LC_MESSAGES/modules_shutterfly.mo
|
||||
R modules/shutterfly/locale/cs_CZ/LC_MESSAGES
|
||||
R modules/shutterfly/locale/cs_CZ
|
||||
R modules/shutterfly/locale/de_DE/LC_MESSAGES/modules_shutterfly.mo
|
||||
R modules/shutterfly/locale/de_DE/LC_MESSAGES
|
||||
R modules/shutterfly/locale/de_DE
|
||||
R modules/shutterfly/locale/fr_FR/LC_MESSAGES/modules_shutterfly.mo
|
||||
R modules/shutterfly/locale/fr_FR/LC_MESSAGES
|
||||
R modules/shutterfly/locale/fr_FR
|
||||
R modules/shutterfly/locale/is_IS/LC_MESSAGES/modules_shutterfly.mo
|
||||
R modules/shutterfly/locale/is_IS/LC_MESSAGES
|
||||
R modules/shutterfly/locale/is_IS
|
||||
R modules/shutterfly/locale/it_IT/LC_MESSAGES/modules_shutterfly.mo
|
||||
R modules/shutterfly/locale/it_IT/LC_MESSAGES
|
||||
R modules/shutterfly/locale/it_IT
|
||||
R modules/shutterfly/locale/ja_JP/LC_MESSAGES/modules_shutterfly.mo
|
||||
R modules/shutterfly/locale/ja_JP/LC_MESSAGES
|
||||
R modules/shutterfly/locale/ja_JP
|
||||
R modules/shutterfly/locale/nl_NL/LC_MESSAGES/modules_shutterfly.mo
|
||||
R modules/shutterfly/locale/nl_NL/LC_MESSAGES
|
||||
R modules/shutterfly/locale/nl_NL
|
||||
R modules/shutterfly/locale/ru_RU/LC_MESSAGES/modules_shutterfly.mo
|
||||
R modules/shutterfly/locale/ru_RU/LC_MESSAGES
|
||||
R modules/shutterfly/locale/ru_RU
|
||||
R modules/shutterfly/locale/sr_YU/LC_MESSAGES/modules_shutterfly.mo
|
||||
R modules/shutterfly/locale/sr_YU/LC_MESSAGES
|
||||
R modules/shutterfly/locale/sr_YU
|
||||
R modules/shutterfly/locale/tr_TR/LC_MESSAGES/modules_shutterfly.mo
|
||||
R modules/shutterfly/locale/tr_TR/LC_MESSAGES
|
||||
R modules/shutterfly/locale/tr_TR
|
||||
R modules/shutterfly/po/cs_CZ.po
|
||||
R modules/shutterfly/po/de_DE.po
|
||||
R modules/shutterfly/po/fr_FR.po
|
||||
R modules/shutterfly/po/is_IS.po
|
||||
R modules/shutterfly/po/it_IT.po
|
||||
R modules/shutterfly/po/ja_JP.po
|
||||
R modules/shutterfly/po/nl_NL.po
|
||||
R modules/shutterfly/po/ru_RU.po
|
||||
R modules/shutterfly/po/sr_YU.po
|
||||
R modules/shutterfly/po/tr_TR.po
|
||||
modules/shutterfly/module.inc 3506017372 3688249782 4229 4375
|
||||
modules/shutterfly/templates/PrintPhotos.tpl 2043612498 1594839499 2272 2327
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
* @package Shutterfly
|
||||
* @subpackage UserInterface
|
||||
* @author Alan Harder <alan.harder@sun.com>
|
||||
* @version $Revision: 16471 $
|
||||
* @version $Revision: 16476 $
|
||||
*/
|
||||
class PrintPhotosView extends GalleryView {
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
*
|
||||
* @package Shutterfly
|
||||
* @author Alan Harder <alan.harder@sun.com>
|
||||
* @version $Revision: 16471 $
|
||||
* @version $Revision: 16476 $
|
||||
*/
|
||||
class ShutterflyModule extends GalleryModule {
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# $Id: da.po 16607 2007-06-14 18:54:55Z mindless $
|
||||
# $Id: da.po 16665 2007-06-19 21:41:35Z mindless $
|
||||
#
|
||||
# Gallery - a web based photo album viewer and editor
|
||||
# Copyright (C) 2000-2007 Bharat Mediratta
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# $Id: sr.po 16501 2007-06-02 18:37:40Z jozefs $
|
||||
# $Id: sr.po 16509 2007-06-05 01:25:06Z mindless $
|
||||
#
|
||||
# Gallery - a web based photo album viewer and editor
|
||||
# Copyright (C) 2000-2007 Bharat Mediratta
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{*
|
||||
* $Revision: 16471 $
|
||||
* $Revision: 16476 $
|
||||
* If you want to customize this file, do not edit it directly since future upgrades
|
||||
* may overwrite it. Instead, copy it into a new directory called "local" and edit that
|
||||
* version. Gallery will look for that file first and use it if it exists.
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
# $Revision: 16636 $
|
||||
# $Revision: 16666 $
|
||||
# File crc32 crc32(crlf) size size(crlf) or R File
|
||||
modules/thumbnail/CustomThumbnailOption.inc 2822861495 3668260572 4206 4334
|
||||
modules/thumbnail/ThumbnailModuleExtras.inc 2270063101 812374126 12322 12752
|
||||
modules/thumbnail/ThumbnailModuleExtras.inc 3477036938 2851943598 12322 12752
|
||||
modules/thumbnail/ThumbnailSiteAdmin.inc 3339803865 2935011340 5423 5599
|
||||
modules/thumbnail/classes/Entities.inc 467279930 2632856511 817 831
|
||||
modules/thumbnail/classes/GNUmakefile 1995366819 843025639 51 52
|
||||
@ -14,6 +14,6 @@ modules/thumbnail/classes/ThumbnailImage.class 4112218221 3437099463 14603 15163
|
||||
modules/thumbnail/classes/ThumbnailToolkit.class 847933823 1543264739 3313 3406
|
||||
modules/thumbnail/images/G2audio.jpg 3650686913 3650686913 15472 15472
|
||||
modules/thumbnail/images/G2video.jpg 4287254857 4287254857 15777 15777
|
||||
modules/thumbnail/module.inc 3918464833 3697016308 5527 5716
|
||||
modules/thumbnail/module.inc 644850217 3431045233 5527 5716
|
||||
modules/thumbnail/templates/CustomThumbnail.tpl 1480586344 49996831 1419 1459
|
||||
modules/thumbnail/templates/ThumbnailSiteAdmin.tpl 1573761086 2838803332 5365 5528
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
* @package Thumbnail
|
||||
* @author Alan Harder <alan.harder@sun.com>
|
||||
* @author Andy Staudacher <ast@gmx.ch>
|
||||
* @version $Revision: 16635 $
|
||||
* @version $Revision: 16665 $
|
||||
* @static
|
||||
*/
|
||||
class ThumbnailModuleExtras {
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
*
|
||||
* @package Thumbnail
|
||||
* @author Alan Harder <alan.harder@sun.com>
|
||||
* @version $Revision: 16635 $
|
||||
* @version $Revision: 16665 $
|
||||
*/
|
||||
class ThumbnailModule extends GalleryModule {
|
||||
|
||||
|
||||
363
Source/gallery2/modules/webdav/ItemAddWebDav.inc
Normal file
@ -0,0 +1,363 @@
|
||||
<?php
|
||||
/*
|
||||
* Gallery - a web based photo album viewer and editor
|
||||
* Copyright (C) 2000-2007 Bharat Mediratta
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
GalleryCoreApi::requireOnce('modules/webdav/classes/WebDavHelper.class');
|
||||
|
||||
/**
|
||||
* Add items with WebDAV. Handle WebDAV PUT requests and describe to users how to add items with
|
||||
* WebDAV.
|
||||
* @package WebDav
|
||||
* @subpackage UserInterface
|
||||
* @author Jack Bates <ms419@freezone.co.uk>
|
||||
* @version $Revision: 16994 $
|
||||
*/
|
||||
class ItemAddWebDav extends ItemAddPlugin {
|
||||
|
||||
/**
|
||||
* @see ItemAddPlugin::handleRequest
|
||||
*/
|
||||
function handleRequest($form, &$item) {
|
||||
$requestMethod = strtolower(GalleryUtilities::getServerVar('REQUEST_METHOD'));
|
||||
if ($requestMethod != 'put') {
|
||||
return array(GalleryCoreApi::error(ERROR_REQUEST_FORGED), null, null);
|
||||
}
|
||||
|
||||
$path = GalleryUtilities::getRequestVariables('path');
|
||||
|
||||
/* Check resource is not locked */
|
||||
$ret = WebDavHelper::checkLocks($path);
|
||||
if ($ret) {
|
||||
return array($ret, null, null);
|
||||
}
|
||||
|
||||
/* Prepare data-structure from PUT request */
|
||||
list ($ret, $webDavOptions, $stream, $mimeType) = WebDavHelper::putRequestHelper();
|
||||
if ($ret) {
|
||||
return array($ret, null, null);
|
||||
}
|
||||
|
||||
/* If the mime type is unknown try to get a mime type from the file name */
|
||||
list ($ret, $mimeExtensions) = GalleryCoreApi::convertMimeToExtensions($mimeType);
|
||||
if ($mimeType == 'application/octet-stream'
|
||||
|| $mimeType == 'application/unknown'
|
||||
|| empty($mimeExtensions)) {
|
||||
$extension = GalleryUtilities::getFileExtension(basename($path));
|
||||
list ($ret, $mimeType) = GalleryCoreApi::convertExtensionToMime($extension);
|
||||
if ($ret) {
|
||||
$mimeType = 'application/unknown';
|
||||
}
|
||||
}
|
||||
|
||||
list ($ret, $itemId) = GalleryCoreApi::fetchItemIdByPath($path);
|
||||
if ($ret) {
|
||||
if ($ret->getErrorCode() & ERROR_MISSING_OBJECT) {
|
||||
/* Item doesn't already exist at this path. Create it. */
|
||||
list ($ret, $error, $status) = $this->_addItem(
|
||||
$item, $webDavOptions, $stream, $mimeType, $path);
|
||||
if ($ret) {
|
||||
return array($ret, null, null);
|
||||
}
|
||||
|
||||
return array(null, $error, $status);
|
||||
}
|
||||
|
||||
return array($ret, null, null);
|
||||
}
|
||||
|
||||
$ret = GalleryCoreApi::assertHasItemPermission($itemId, 'core.edit');
|
||||
if ($ret) {
|
||||
return array($ret, null, null);
|
||||
}
|
||||
|
||||
list ($ret, $error, $status) = $this->_replaceItem(
|
||||
$item, $webDavOptions, $stream, $mimeType, $path, $itemId);
|
||||
if ($ret) {
|
||||
return array($ret, null, null);
|
||||
}
|
||||
|
||||
return array(null, $error, $status);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add new item.
|
||||
* @param object GalleryItem $parentItem The parent item of the item to be added
|
||||
* @param array $webDavOptions WebDAV library options
|
||||
* @param resource $stream request body file handle
|
||||
* @param string $mimeType request content type
|
||||
* @param string $path the path to the destination in the Gallery hierarchy
|
||||
* @see ItemAddPlugin::handleRequest for the returned data
|
||||
* @access private
|
||||
*/
|
||||
function _addItem($parentItem, $webDavOptions, $stream, $mimeType, $path) {
|
||||
global $gallery;
|
||||
$platform =& $gallery->getPlatform();
|
||||
|
||||
/* Following pattern from ItemAddWebCam */
|
||||
$tmpDir = $gallery->getConfig('data.gallery.tmp');
|
||||
$tmpFile = $platform->tempnam($tmpDir, 'webdav');
|
||||
|
||||
$handle = $platform->fopen($tmpFile, 'wb');
|
||||
if (!$handle) {
|
||||
return array(GalleryCoreApi::error(ERROR_PLATFORM_FAILURE), null, null);
|
||||
}
|
||||
|
||||
while (!$platform->feof($stream)) {
|
||||
$buf = $platform->fread($stream, 4096);
|
||||
if ($platform->fwrite($handle, $buf) != 4096) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$platform->fclose($handle);
|
||||
|
||||
$originalPath = GalleryUtilities::getRequestVariables('originalPath');
|
||||
$title = empty($originalPath) ? basename($path) : basename($originalPath);
|
||||
list ($ret, $newItem) = GalleryCoreApi::addItemToAlbum($tmpFile, basename($path),
|
||||
$title, '', '', $mimeType, $parentItem->getId());
|
||||
@$platform->unlink($tmpFile);
|
||||
if ($ret) {
|
||||
return array($ret, null, null);
|
||||
}
|
||||
|
||||
WebDavServer::setResponseStatus('201 Created');
|
||||
return array(null, array(), array('addedFiles' => array(array(
|
||||
'fileName' => basename($path), 'id' => $newItem->getId()))));
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace existing item.
|
||||
* @param object GalleryItem $parentItem The parent item of the item to be added
|
||||
* @param array $webDavOptions WebDAV library options
|
||||
* @param resource $stream request body file handle
|
||||
* @param string $mimeType request content type
|
||||
* @param string $path the path to the destination in the Gallery hierarchy
|
||||
* @param int $itemId The id of the item to be replaced
|
||||
* @see ItemAddPlugin::handleRequest for the returned data
|
||||
* @access private
|
||||
*/
|
||||
function _replaceItem($parentItem, $webDavOptions, $stream, $mimeType, $path, $itemId) {
|
||||
global $gallery;
|
||||
$platform =& $gallery->getPlatform();
|
||||
|
||||
/*
|
||||
* The parent is already read-locked by the ItemAddController. Read-lock the whole ancestor
|
||||
* sequence to ensure that filesystem path stays the same.
|
||||
*/
|
||||
list ($ret, $lockIds[]) = GalleryCoreApi::acquireReadLockParents($parentItem->getId());
|
||||
if ($ret) {
|
||||
return array($ret, null, null);
|
||||
}
|
||||
|
||||
/* Write lock the item we're replacing */
|
||||
list ($ret, $lockIds[]) = GalleryCoreApi::acquireWriteLock($itemId);
|
||||
if ($ret) {
|
||||
GalleryCoreApi::releaseLocks($lockIds);
|
||||
return array($ret, null, null);
|
||||
}
|
||||
|
||||
list ($ret, $item) = GalleryCoreApi::loadEntitiesById($itemId);
|
||||
if ($ret) {
|
||||
GalleryCoreApi::releaseLocks($lockIds);
|
||||
return array($ret, null, null);
|
||||
}
|
||||
|
||||
list ($ret, $hasLink) = $this->_hasLinkedEntity($item);
|
||||
if ($ret || $hasLink) {
|
||||
GalleryCoreApi::releaseLocks($lockIds);
|
||||
return array($ret ? $ret : GalleryCoreApi::error(ERROR_PERMISSION_DENIED), null, null);
|
||||
}
|
||||
|
||||
/* Replace the file content */
|
||||
list ($ret, $filePath) = $item->fetchPath();
|
||||
if ($ret) {
|
||||
GalleryCoreApi::releaseLocks($lockIds);
|
||||
return array($ret, null, null);
|
||||
}
|
||||
|
||||
if (($handle = $platform->fopen($filePath, 'wb')) === false) {
|
||||
GalleryCoreApi::releaseLocks($lockIds);
|
||||
return array(GalleryCoreApi::error(ERROR_PLATFORM_FAILURE), null, null);
|
||||
}
|
||||
|
||||
/* Format PUT response */
|
||||
$ret = WebDavHelper::putResponseHelper($webDavOptions, $handle);
|
||||
if ($ret) {
|
||||
GalleryCoreApi::releaseLocks($lockIds);
|
||||
return array($ret, null, null);
|
||||
}
|
||||
|
||||
/* Get a new item by mime type */
|
||||
list ($ret, $newItem) = GalleryCoreApi::newItemByMimeType($mimeType);
|
||||
if ($ret) {
|
||||
GalleryCoreApi::releaseLocks($lockIds);
|
||||
return array($ret, null, null);
|
||||
}
|
||||
if (!isset($newItem)) {
|
||||
GalleryCoreApi::releaseLocks($lockIds);
|
||||
return array(GalleryCoreApi::error(ERROR_MISSING_OBJECT, __FILE__, __LINE__,
|
||||
'Failed to get new item by mime type: ' . $mimeType), null, null);
|
||||
}
|
||||
|
||||
$ret = $newItem->create($parentItem->getId(), $filePath, $mimeType);
|
||||
if ($ret) {
|
||||
GalleryCoreApi::releaseLocks($lockIds);
|
||||
return array($ret, null, null);
|
||||
}
|
||||
|
||||
/* Make the new item as close a copy of the original item as possible */
|
||||
list ($ret, $newItem) = WebDavHelper::mirrorEntity($item, $newItem);
|
||||
if ($ret) {
|
||||
GalleryCoreApi::releaseLocks($lockIds);
|
||||
return array($ret, null, null);
|
||||
}
|
||||
|
||||
/* Fall back on an unknown item if the new class doesn't support the file content */
|
||||
$ret = $newItem->rescan();
|
||||
if ($ret) {
|
||||
if (!($ret->getErrorCode() & ERROR_BAD_DATA_TYPE)) {
|
||||
GalleryCoreApi::releaseLocks($lockIds);
|
||||
return array($ret, null, null);
|
||||
}
|
||||
|
||||
$gallery->debug('Error in ItemEditWebDav::handleRequest: ' . $newItem->getClassName()
|
||||
. ' doesn\'t support the file content. Falling back on an unknown item.');
|
||||
|
||||
list ($ret, $newItem) = GalleryCoreApi::newFactoryInstanceById('GalleryEntity',
|
||||
'GalleryUnknownItem');
|
||||
if ($ret) {
|
||||
GalleryCoreApi::releaseLocks($lockIds);
|
||||
return array($ret, null, null);
|
||||
}
|
||||
if (!isset($newItem)) {
|
||||
GalleryCoreApi::releaseLocks($lockIds);
|
||||
return array(GalleryCoreApi::error(ERROR_MISSING_OBJECT, __FILE__, __LINE__,
|
||||
'Failed to get GalleryUnknownItem instance'), null, null);
|
||||
}
|
||||
|
||||
$ret = $newItem->create($parentItem->getId(), $filePath, $mimeType);
|
||||
if ($ret) {
|
||||
GalleryCoreApi::releaseLocks($lockIds);
|
||||
return array($ret, null, null);
|
||||
}
|
||||
|
||||
/* Make the new item as close a copy of the original item as possible */
|
||||
list ($ret, $newItem) = WebDavHelper::mirrorEntity($item, $newItem);
|
||||
if ($ret) {
|
||||
GalleryCoreApi::releaseLocks($lockIds);
|
||||
return array($ret, null, null);
|
||||
}
|
||||
|
||||
$ret = $newItem->rescan();
|
||||
if ($ret) {
|
||||
GalleryCoreApi::releaseLocks($lockIds);
|
||||
return array($ret, null, null);
|
||||
}
|
||||
}
|
||||
|
||||
/* Follow pattern from ItemAddWebCam */
|
||||
$tmpDir = $gallery->getConfig('data.gallery.tmp');
|
||||
$tmpFile = $platform->tempnam($tmpDir, 'webdav');
|
||||
|
||||
/* Backup the file content */
|
||||
if (!$platform->copy($filePath, $tmpFile)) {
|
||||
GalleryCoreApi::releaseLocks($lockIds);
|
||||
return array(GalleryCoreApi::error(ERROR_PLATFORM_FAILURE), null, null);
|
||||
}
|
||||
|
||||
$ret = $item->delete();
|
||||
if ($ret) {
|
||||
@$platform->unlink($tmpFile);
|
||||
GalleryCoreApi::releaseLocks($lockIds);
|
||||
return array($ret, null, null);
|
||||
}
|
||||
|
||||
/*
|
||||
* Restore the file content. If this fails, we rollback the database transaction but the
|
||||
* file content is missing.
|
||||
*/
|
||||
if (!$platform->copy($tmpFile, $filePath)) {
|
||||
@$platform->unlink($tmpFile);
|
||||
GalleryCoreApi::releaseLocks($lockIds);
|
||||
return array(GalleryCoreApi::error(ERROR_PLATFORM_FAILURE), null, null);
|
||||
}
|
||||
@$platform->unlink($tmpFile);
|
||||
|
||||
$newItem->setPersistentFlag(STORAGE_FLAG_NEWLY_CREATED);
|
||||
$ret = $newItem->save();
|
||||
if ($ret) {
|
||||
GalleryCoreApi::releaseLocks($lockIds);
|
||||
return array($ret, null, null);
|
||||
}
|
||||
|
||||
$ret = GalleryCoreApi::addExistingItemToAlbum($newItem, $parentItem->getId(), true);
|
||||
if ($ret) {
|
||||
GalleryCoreApi::releaseLocks($lockIds);
|
||||
return array($ret, null, null);
|
||||
}
|
||||
|
||||
$ret = GalleryCoreApi::releaseLocks($lockIds);
|
||||
if ($ret) {
|
||||
return array($ret, null, null);
|
||||
}
|
||||
|
||||
return array(null, array(), array(
|
||||
'addedFiles' => array(array('fileName' => basename($path),
|
||||
'id' => $newItem->getId()))));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ItemAddPlugin::loadTemplate
|
||||
*/
|
||||
function loadTemplate(&$template, &$form, $item) {
|
||||
return array(null, 'modules/webdav/templates/ItemAddWebDav.tpl', null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ItemAddPlugin::getTitle
|
||||
*/
|
||||
function getTitle() {
|
||||
list ($ret, $module) = GalleryCoreApi::loadPlugin('module', 'webdav');
|
||||
if ($ret) {
|
||||
return array($ret, null);
|
||||
}
|
||||
|
||||
return array(null, $module->translate('WebDAV'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if item is part of a linked(replica) set.
|
||||
* @param GalleryItem $item
|
||||
* @return array GalleryStatus a status code,
|
||||
* bool true if linked
|
||||
* @access private
|
||||
*/
|
||||
function _hasLinkedEntity($item) {
|
||||
$hasLink = $item->isLinked();
|
||||
if (!$hasLink) {
|
||||
list ($ret, $linkedIds) = GalleryCoreApi::fetchEntitiesLinkedTo($item->getId());
|
||||
if ($ret) {
|
||||
return array($ret, null);
|
||||
}
|
||||
$hasLink = !empty($linkedIds);
|
||||
}
|
||||
return array(null, $hasLink);
|
||||
}
|
||||
}
|
||||
?>
|
||||
58
Source/gallery2/modules/webdav/MANIFEST
Normal file
@ -0,0 +1,58 @@
|
||||
# $Revision: 16999 $
|
||||
# File crc32 crc32(crlf) size size(crlf) or R File
|
||||
modules/webdav/Callbacks.inc 2358814663 3453825565 1439 1486
|
||||
modules/webdav/DownloadDavMount.inc 926099365 1573674116 2786 2878
|
||||
modules/webdav/ItemAddWebDav.inc 4164261739 1762299526 11656 12019
|
||||
modules/webdav/WebDav.inc 296137277 2916812957 7614 7841
|
||||
modules/webdav/WebDavMount.inc 1838621692 2805740046 1587 1636
|
||||
modules/webdav/WebDavSiteAdmin.inc 553960122 2291144207 1698 1752
|
||||
modules/webdav/WebDavWorks.inc 2574696807 3621906002 1308 1352
|
||||
modules/webdav/classes/GNUmakefile 1995366819 843025639 51 52
|
||||
modules/webdav/classes/GalleryStorage/GNUmakefile 1465776782 2009162633 61 62
|
||||
modules/webdav/classes/GalleryStorage/schema.tpl 3361478170 1381064364 2241 2323
|
||||
modules/webdav/classes/Maps.inc 3097969041 2458683522 580 584
|
||||
modules/webdav/classes/Maps.xml 389449069 1930493512 1049 1087
|
||||
modules/webdav/classes/WebDavHelper.class 2911014187 3694723953 60702 62726
|
||||
modules/webdav/classes/WebDavRewriteHelper.class 107529024 2731722737 2434 2512
|
||||
modules/webdav/data/options/.htaccess 1142116337 350654909 1316 1345
|
||||
modules/webdav/lib/HTTP/WebDAV/Server.php 2461613593 933395689 74761 77305
|
||||
modules/webdav/lib/HTTP/WebDAV/Tools/_parse_lockinfo.php 11587171 140948099 6213 6442
|
||||
modules/webdav/lib/HTTP/WebDAV/Tools/_parse_propfind.php 2397186960 1499307163 4574 4737
|
||||
modules/webdav/lib/HTTP/WebDAV/Tools/_parse_proppatch.php 3422974363 1239742415 5688 5904
|
||||
modules/webdav/locale/cs/LC_MESSAGES/modules_webdav.mo 1047684311 1047684311 1214 1214
|
||||
modules/webdav/locale/da/LC_MESSAGES/modules_webdav.mo 2510260108 2510260108 6771 6771
|
||||
modules/webdav/locale/de/LC_MESSAGES/modules_webdav.mo 3114598404 3114598404 9485 9485
|
||||
modules/webdav/locale/en_GB/LC_MESSAGES/modules_webdav.mo 1413919835 1413919835 453 453
|
||||
modules/webdav/locale/es/LC_MESSAGES/modules_webdav.mo 2921815291 2921815291 8066 8066
|
||||
modules/webdav/locale/fi/LC_MESSAGES/modules_webdav.mo 721612248 721612248 513 513
|
||||
modules/webdav/locale/fr/LC_MESSAGES/modules_webdav.mo 423636460 423636460 9951 9951
|
||||
modules/webdav/locale/it/LC_MESSAGES/modules_webdav.mo 951994282 951994282 9203 9203
|
||||
modules/webdav/locale/ja/LC_MESSAGES/modules_webdav.mo 509026931 509026931 1345 1345
|
||||
modules/webdav/locale/no/LC_MESSAGES/modules_webdav.mo 1385045948 1385045948 9161 9161
|
||||
modules/webdav/locale/pl/LC_MESSAGES/modules_webdav.mo 362302417 362302417 9502 9502
|
||||
modules/webdav/locale/sr/LC_MESSAGES/modules_webdav.mo 670662386 670662386 8882 8882
|
||||
modules/webdav/locale/sv/LC_MESSAGES/modules_webdav.mo 2854839760 2854839760 8890 8890
|
||||
modules/webdav/locale/zh_TW/LC_MESSAGES/modules_webdav.mo 1556634049 1556634049 8314 8314
|
||||
modules/webdav/module.inc 4020788211 4197467341 11479 11866
|
||||
modules/webdav/po/GNUmakefile 1866879166 2808215985 98 103
|
||||
modules/webdav/po/cs.po 2370490924 2825959302 7255 7485
|
||||
modules/webdav/po/da.po 739748635 3882574025 10362 10611
|
||||
modules/webdav/po/de.po 1545511418 278375015 11455 11724
|
||||
modules/webdav/po/en_GB.po 3614209927 764415759 9762 10005
|
||||
modules/webdav/po/es.po 121984932 3758559391 11394 11662
|
||||
modules/webdav/po/fi.po 3605972956 2108268604 6204 6413
|
||||
modules/webdav/po/fr.po 1051384353 3429803373 11111 11365
|
||||
modules/webdav/po/it.po 3154788012 3047748031 10336 10582
|
||||
modules/webdav/po/ja.po 65674916 3910984321 6413 6617
|
||||
modules/webdav/po/no.po 3049735091 3622850934 10410 10658
|
||||
modules/webdav/po/pl.po 1563022598 814780260 10710 10960
|
||||
modules/webdav/po/sr.po 1502528896 3411280706 10007 10251
|
||||
modules/webdav/po/strings.raw 1636664032 2040123002 4443 4497
|
||||
modules/webdav/po/sv.po 215764433 2139329400 10080 10324
|
||||
modules/webdav/po/zh_TW.po 3457626786 1651552820 9954 10200
|
||||
modules/webdav/templates/ItemAddWebDav.tpl 1353965866 1079974098 387 396
|
||||
modules/webdav/templates/WebDavMount.tpl 2057727104 3263326614 1678 1719
|
||||
modules/webdav/templates/WebDavSiteAdmin.tpl 1888656763 3892656047 8485 8626
|
||||
modules/webdav/templates/blocks/WebDavUrl.tpl 2356653701 4082093646 430 440
|
||||
modules/webdav/templates/blocks/blocks.inc 740358944 826543430 102 107
|
||||
R modules/webdav/classes/WebDavActivatePluginEventListener.class
|
||||
2024
Source/gallery2/modules/webdav/classes/WebDavHelper.class
Normal file
387
Source/gallery2/modules/webdav/module.inc
Normal file
@ -0,0 +1,387 @@
|
||||
<?php
|
||||
/*
|
||||
* Gallery - a web based photo album viewer and editor
|
||||
* Copyright (C) 2000-2007 Bharat Mediratta
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/**
|
||||
* WebDAV Module. Mount Gallery on your desktop.
|
||||
* @package WebDav
|
||||
* @author Jack Bates <ms419@freezone.co.uk>
|
||||
* @version $Revision: 16994 $
|
||||
*/
|
||||
class WebDavModule extends GalleryModule /* and GalleryEventListener */ {
|
||||
|
||||
function WebDavModule() {
|
||||
global $gallery;
|
||||
|
||||
$this->setId('webdav');
|
||||
$this->setName($gallery->i18n('WebDAV'));
|
||||
$this->setVersion('1.0.0.3'); /* Update upgrade() too! */
|
||||
$this->setDescription($gallery->i18n('Mount Gallery on your desktop.'));
|
||||
$this->setGroup('interfaces', $gallery->i18n('Remote Interfaces'));
|
||||
$this->setCallbacks('getItemLinks|getSiteAdminViews|registerEventListeners');
|
||||
$this->setRequiredCoreApi(array(7, 17));
|
||||
$this->setRequiredModuleApi(array(3, 5));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see GalleryModule::performFactoryRegistrations
|
||||
*/
|
||||
function performFactoryRegistrations() {
|
||||
$ret = GalleryCoreApi::registerFactoryImplementation(
|
||||
'ItemAddPlugin', 'ItemAddWebDav', 'ItemAddWebDav',
|
||||
'modules/webdav/ItemAddWebDav.inc', 'webdav', null);
|
||||
if ($ret) {
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see GalleryModule::registerEventListeners
|
||||
*/
|
||||
function registerEventListeners() {
|
||||
return GalleryCoreApi::registerEventListener(
|
||||
'Gallery::ActivatePlugin', new WebDavModule(), true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see GalleryModule::upgrade
|
||||
*/
|
||||
function upgrade($currentVersion) {
|
||||
global $gallery;
|
||||
|
||||
switch ($currentVersion) {
|
||||
case null:
|
||||
/* Initial install */
|
||||
|
||||
/* Activate essential rewrite rules */
|
||||
$ret = $this->_activateRewriteRules();
|
||||
if ($ret && !($ret->getErrorCode() & ERROR_CONFIGURATION_REQUIRED)) {
|
||||
return $ret;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case '0.0.3':
|
||||
/* Add WebDavSiteAdmin and WebDavLockMap */
|
||||
|
||||
case '0.0.4':
|
||||
/* Add modules/webdav/webdav.php and WebDavUrlGenerator */
|
||||
|
||||
case '0.0.5':
|
||||
/* Add WebDavInitEventListener */
|
||||
|
||||
case '0.0.6':
|
||||
/* Add item link */
|
||||
|
||||
case '0.2.0':
|
||||
/*
|
||||
* Activate essential short URL rules automatically
|
||||
* Set HTTP response status on all errors
|
||||
*/
|
||||
|
||||
case '0.3.0':
|
||||
/*
|
||||
* Eliminate WebDavUrlGenerator, WebDavInitEventListener and WebDavSiteAdmin
|
||||
* Register WebDavActivatePluginEventListener
|
||||
*/
|
||||
|
||||
case '0.4.0':
|
||||
/*
|
||||
* Move parsePath from WebDavHelper to WebDavRewriteHelper, to avoid loading
|
||||
* WebDavHelper just to generate URLs
|
||||
*/
|
||||
|
||||
case '0.4.1':
|
||||
/* Add GalleryView::isControllerLike to WebDAV view */
|
||||
|
||||
case '0.4.2':
|
||||
/* Add support for the php-cgi server API */
|
||||
|
||||
case '0.6.0':
|
||||
/* Remove view with WebDAV permission */
|
||||
$ret = GalleryCoreApi::unregisterModulePermissions($this->getId());
|
||||
if ($ret) {
|
||||
return $ret;
|
||||
}
|
||||
case '0.6.1':
|
||||
/*
|
||||
* Add dependency on latest changes in GalleryModule::getRewriteRules and on
|
||||
* GalleryUrlGenerator::generateUrl's protocol option.
|
||||
*/
|
||||
|
||||
case '0.6.2':
|
||||
/* Add configuration checks */
|
||||
case '0.7.0':
|
||||
/* Add whitelist for external interface */
|
||||
case '0.7.1':
|
||||
/* Rename WebDavMount to DownloadDavMount */
|
||||
case '0.7.2':
|
||||
/* Add HttpAuth check through interface */
|
||||
case '0.7.3':
|
||||
/* Version 1.0.0 for Gallery 2.2 release */
|
||||
|
||||
case '1.0.0':
|
||||
/* Avoid matching paths starting with 'w[^/]' with URL rewrite rule keyword */
|
||||
$ret = $this->_activateRewriteRules();
|
||||
if ($ret && !($ret->getErrorCode() & ERROR_CONFIGURATION_REQUIRED)) {
|
||||
return $ret;
|
||||
}
|
||||
case '1.0.0.1':
|
||||
/* Fix entity-type bug (1681406) */
|
||||
case '1.0.0.2':
|
||||
|
||||
case 'end of upgrade path':
|
||||
break;
|
||||
|
||||
default:
|
||||
return GalleryCoreApi::error(ERROR_BAD_PLUGIN, __FILE__, __LINE__,
|
||||
sprintf('Unknown module version %s', $currentVersion));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see GalleryModule::activate
|
||||
* @todo The explicit rewrite module version check can be removed on the next major Module API
|
||||
* version.
|
||||
*/
|
||||
function activate($postActivationEvent=true) {
|
||||
/* Ensure the rewrite module is compatible, 'pattern' is optional since v1.1.8 of rewrite */
|
||||
list ($ret, $modules) = GalleryCoreApi::fetchPluginList('module');
|
||||
if ($ret) {
|
||||
return array($ret, null);
|
||||
}
|
||||
|
||||
if (isset($modules['rewrite'])) {
|
||||
list ($ret, $rewrite) = GalleryCoreApi::loadPlugin('module', 'rewrite', true);
|
||||
if ($ret) {
|
||||
return array($ret, null);
|
||||
}
|
||||
|
||||
if (version_compare($rewrite->getVersion(), '1.1.8', '<')) {
|
||||
return array(GalleryCoreApi::error(ERROR_CONFIGURATION_REQUIRED), null);
|
||||
}
|
||||
}
|
||||
|
||||
list ($ret, $redirect) = parent::activate($postActivationEvent);
|
||||
if ($ret) {
|
||||
return array($ret, null);
|
||||
}
|
||||
|
||||
return array(null, $redirect);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see GalleryModule::getItemLinks
|
||||
*/
|
||||
function getItemLinks($items, $wantsDetailedLinks, $permissions, $userId) {
|
||||
$links = array();
|
||||
foreach ($items as $item) {
|
||||
if (!$item->getCanContainChildren() || empty($wantsDetailedLinks[$item->getId()])) {
|
||||
continue;
|
||||
}
|
||||
$links[$item->getId()][] = array(
|
||||
'text' => $this->translate('Mount with WebDAV'),
|
||||
'params' => array('view' => 'webdav.WebDavMount',
|
||||
'itemId' => $item->getId()));
|
||||
}
|
||||
|
||||
return array(null, $links);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see GalleryModule::getSiteAdminViews
|
||||
*/
|
||||
function getSiteAdminViews() {
|
||||
return array(null, array(array('name' => $this->translate($this->getName()),
|
||||
'view' => 'webdav.WebDavSiteAdmin')));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see GalleryModule::getRewriteRules
|
||||
*/
|
||||
function getRewriteRules() {
|
||||
global $gallery;
|
||||
$urlGenerator =& $gallery->getUrlGenerator();
|
||||
|
||||
$rules = array();
|
||||
|
||||
/* Use short URL because most WebDAV clients don't support query strings */
|
||||
$rules['connect'] = array(
|
||||
'comment' => $this->translate('Connect to WebDAV'),
|
||||
'help' => $this->translate(
|
||||
'Use short URL because most WebDAV clients don\'t support query strings.'
|
||||
. ' The Windows WebDAV client requires that you don\'t add a slash before the'
|
||||
. ' %path% variable.'),
|
||||
'match' => array('controller' => 'webdav.WebDav'),
|
||||
'pattern' => 'w%path%',
|
||||
'keywords' => array(
|
||||
'path' => array(
|
||||
'pattern' => '(/[^?]*)?',
|
||||
'function' => array('webdav', 'WebDavRewriteHelper', 'parsePath'),
|
||||
'help' => $this->translate('Path to an item (eg. /album/image.jpg.html)'))));
|
||||
|
||||
/* Give davmount resources the correct extension */
|
||||
$rules['davmount'] = array(
|
||||
'comment' => $this->translate('Mount WebDAV'),
|
||||
'help' => $this->translate(
|
||||
'Give davmount resources the correct extension.'),
|
||||
'match' => array('view' => 'webdav.DownloadDavMount'),
|
||||
|
||||
/* TODO: How to work with the root album? */
|
||||
'pattern' => 'v/%path%.davmount',
|
||||
'keywords' => array(
|
||||
'path' => array(
|
||||
'pattern' => '([^?]+)',
|
||||
'function' => array('rewrite', 'RewriteSimpleHelper', 'parsePath'),
|
||||
'help' => $this->translate('Path to an item (eg. /album/image.jpg.html)'))),
|
||||
'onLoad' => array('rewrite', 'RewriteSimpleHelper', 'loadItemIdFromPath'));
|
||||
|
||||
/*
|
||||
* Only define the rule to redirect OPTIONS requests so we can set DAV headers if it is
|
||||
* already active, or if OPTIONS responses are missing DAV headers
|
||||
*/
|
||||
list ($ret, $rewriteApi) = GalleryCoreApi::newFactoryInstance('RewriteApi');
|
||||
if ($ret) {
|
||||
if ($gallery->getDebug()) {
|
||||
$gallery->debug('Error in WebDavModule::getRewriteRules: ' . $ret->getAsText());
|
||||
}
|
||||
return $rules;
|
||||
}
|
||||
if (!isset($rewriteApi)) {
|
||||
return $rules;
|
||||
}
|
||||
|
||||
list ($ret, $isCompatible) = $rewriteApi->isCompatibleWithApi(array(1, 1));
|
||||
if ($ret) {
|
||||
if ($gallery->getDebug()) {
|
||||
$gallery->debug('Error in WebDavModule::getRewriteRules: ' . $ret->getAsText());
|
||||
}
|
||||
return $rules;
|
||||
}
|
||||
if (!$isCompatible) {
|
||||
return $rules;
|
||||
}
|
||||
|
||||
list ($ret, $activeRules) = $rewriteApi->fetchActiveRulesForModule($this->getId());
|
||||
if ($ret) {
|
||||
if ($gallery->getDebug()) {
|
||||
$gallery->debug('Error in WebDavModule::getRewriteRules: ' . $ret->getAsText());
|
||||
}
|
||||
return $rules;
|
||||
}
|
||||
if (!in_array('options', $activeRules)) {
|
||||
/* Check that OPTIONS responses include the DAV headers */
|
||||
GalleryCoreApi::requireOnce('modules/webdav/classes/WebDavHelper.class');
|
||||
if (WebDavHelper::checkDavHeaders($urlGenerator->generateUrl(
|
||||
array('controller' => 'webdav.WebDav'),
|
||||
array('forceFullUrl' => true,
|
||||
'htmlEntities' => false)))) {
|
||||
return $rules;
|
||||
}
|
||||
}
|
||||
|
||||
/* Redirect OPTIONS requests so we can set DAV headers */
|
||||
$rules['options'] = array(
|
||||
'comment' => $this->translate('OPTIONS Requests'),
|
||||
'help' => $this->translate(
|
||||
'Redirect OPTIONS requests so we can set DAV headers.'),
|
||||
|
||||
/* Use trailing '/' to avoid 301 Moved Permanently */
|
||||
'match' => array('href' => 'modules/webdav/data/options/'),
|
||||
'conditions' => array(array('test' => 'REQUEST_METHOD',
|
||||
'pattern' => 'OPTIONS')));
|
||||
|
||||
return $rules;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see GalleryEventListener::handleEvent
|
||||
*/
|
||||
function handleEvent($event) {
|
||||
switch ($event->getEventName()) {
|
||||
case 'Gallery::ActivatePlugin':
|
||||
$data = $event->getData();
|
||||
if ($data['pluginType'] != 'module' || $data['pluginId'] != 'rewrite') {
|
||||
return array(null, null);
|
||||
}
|
||||
|
||||
$ret = $this->_activateRewriteRules();
|
||||
if ($ret && !($ret->getErrorCode() & ERROR_CONFIGURATION_REQUIRED)) {
|
||||
return array($ret, null);
|
||||
}
|
||||
|
||||
return array(null, null);
|
||||
|
||||
case 'Gallery::Error':
|
||||
$data = $event->getData();
|
||||
if (($data['error']->getErrorCode() & ERROR_PERMISSION_DENIED)) {
|
||||
/* Prompt for authentication */
|
||||
list ($ret, $httpAuthInterface) =
|
||||
GalleryCoreApi::newFactoryInstance('HttpAuthInterface_1_0');
|
||||
if ($ret) {
|
||||
return array($ret, null);
|
||||
}
|
||||
if (isset($httpAuthInterface)) {
|
||||
$ret = $httpAuthInterface->requestAuthentication();
|
||||
if ($ret) {
|
||||
return array($ret, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Suppress generating HTML error pages for WebDAV clients */
|
||||
return array(null, array('suppressBody' => true));
|
||||
}
|
||||
|
||||
return array(null, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Activate essential rewrite rules.
|
||||
* @return object GalleryStatus a status code
|
||||
*/
|
||||
function _activateRewriteRules() {
|
||||
list ($ret, $rewriteApi) = GalleryCoreApi::newFactoryInstance('RewriteApi');
|
||||
if ($ret) {
|
||||
return $ret;
|
||||
}
|
||||
if (!isset($rewriteApi)) {
|
||||
return GalleryCoreApi::error(ERROR_CONFIGURATION_REQUIRED);
|
||||
}
|
||||
|
||||
list ($ret, $isCompatible) = $rewriteApi->isCompatibleWithApi(array(1, 1));
|
||||
if ($ret) {
|
||||
return $ret;
|
||||
}
|
||||
if (!$isCompatible) {
|
||||
return GalleryCoreApi::error(ERROR_CONFIGURATION_REQUIRED);
|
||||
}
|
||||
|
||||
list ($ret, $success) = $rewriteApi->activateRewriteRulesForModule($this->getId());
|
||||
if ($ret) {
|
||||
return $ret;
|
||||
}
|
||||
if (!$success) {
|
||||
return GalleryCoreApi::error(ERROR_CONFIGURATION_REQUIRED);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
?>
|
||||