@@ -59,30 +59,32 @@ function Template($root = ".", $theme= "", $path = "template")
5959 $ this ->smarty ->compile_check = $ conf ['template_compile_check ' ];
6060 $ this ->smarty ->force_compile = $ conf ['template_force_compile ' ];
6161
62- if (!isset ($ conf ['local_data_dir_checked ' ]))
62+ if (!isset ($ conf ['data_dir_checked ' ]))
6363 {
64- mkgetdir ($ conf ['local_data_dir ' ], MKGETDIR_DEFAULT &~MKGETDIR_DIE_ON_ERROR );
65- if (!is_writable ($ conf ['local_data_dir ' ]))
64+ $ dir = PHPWG_ROOT_PATH .$ conf ['data_location ' ];
65+ mkgetdir ($ dir , MKGETDIR_DEFAULT &~MKGETDIR_DIE_ON_ERROR );
66+ if (!is_writable ($ dir ))
6667 {
6768 load_language ('admin.lang ' );
6869 fatal_error (
6970 sprintf (
7071 l10n ('Give write access (chmod 777) to "%s" directory at the root of your Piwigo installation ' ),
71- basename ( $ conf ['local_data_dir ' ])
72+ $ conf ['data_location ' ]
7273 ),
7374 l10n ('an error happened ' ),
7475 false // show trace
7576 );
7677 }
7778 if (function_exists ('pwg_query ' )) {
78- conf_update_param ('local_data_dir_checked ' , ' true ' );
79+ conf_update_param ('data_dir_checked ' , 1 );
7980 }
8081 }
8182
8283 if (!isset ($ conf ['combined_dir_checked ' ]))
8384 {
84- mkgetdir (PWG_COMBINED_DIR , MKGETDIR_DEFAULT &~MKGETDIR_DIE_ON_ERROR );
85- if (!is_writable (PWG_COMBINED_DIR ))
85+ $ dir = PHPWG_ROOT_PATH .PWG_COMBINED_DIR ;
86+ mkgetdir ($ dir , MKGETDIR_DEFAULT &~MKGETDIR_DIE_ON_ERROR );
87+ if (!is_writable ($ dir ))
8688 {
8789 load_language ('admin.lang ' );
8890 fatal_error (
@@ -95,12 +97,12 @@ function Template($root = ".", $theme= "", $path = "template")
9597 );
9698 }
9799 if (function_exists ('pwg_query ' )) {
98- conf_update_param ('combined_dir_checked ' , ' true ' );
100+ conf_update_param ('combined_dir_checked ' , 1 );
99101 }
100102 }
101103
102104
103- $ compile_dir = $ conf ['local_data_dir ' ].'/ templates_c ' ;
105+ $ compile_dir = PHPWG_ROOT_PATH . $ conf ['data_location ' ].'templates_c ' ;
104106 mkgetdir ( $ compile_dir );
105107
106108 $ this ->smarty ->compile_dir = $ compile_dir ;
@@ -1181,7 +1183,6 @@ private static function cmp_by_mode_and_order($s1, $s2)
11811183/*Allows merging of javascript and css files into a single one.*/
11821184final class FileCombiner
11831185{
1184- const OUT_SUB_DIR = PWG_COMBINED_DIR ;
11851186 private $ type ; // js or css
11861187 private $ files = array ();
11871188 private $ versions = array ();
@@ -1193,11 +1194,11 @@ function FileCombiner($type)
11931194
11941195 static function clear_combined_files ()
11951196 {
1196- $ dir = opendir (PHPWG_ROOT_PATH .self :: OUT_SUB_DIR );
1197+ $ dir = opendir (PHPWG_ROOT_PATH .PWG_COMBINED_DIR );
11971198 while ($ file = readdir ($ dir ))
11981199 {
11991200 if ( get_extension ($ file )=='js ' || get_extension ($ file )=='css ' )
1200- unlink (PHPWG_ROOT_PATH .self :: OUT_SUB_DIR .$ file );
1201+ unlink (PHPWG_ROOT_PATH .PWG_COMBINED_DIR .$ file );
12011202 }
12021203 closedir ($ dir );
12031204 }
@@ -1242,7 +1243,7 @@ function combine(&$out_file, &$out_version)
12421243 $ key = join ('> ' , $ key );
12431244
12441245 $ file = base_convert (crc32 ($ key ),10 ,36 );
1245- $ file = self :: OUT_SUB_DIR . $ file . '. ' . $ this ->type ;
1246+ $ file = PWG_COMBINED_DIR . $ file . '. ' . $ this ->type ;
12461247
12471248 $ exists = file_exists ( PHPWG_ROOT_PATH . $ file );
12481249 if ($ exists )
0 commit comments