Changeset 6051 for trunk/include/ws_functions.inc.php
- Timestamp:
- May 3, 2010, 11:56:22 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/ws_functions.inc.php
r6049 r6051 2137 2137 } 2138 2138 2139 $relative_dir = preg_replace('#^'.PHPWG_ROOT_PATH.'#', '', $conf['upload_dir']); 2140 2141 $ret['message'] = null; 2139 $ret['message'] = ready_for_upload_message(); 2142 2140 $ret['ready_for_upload'] = true; 2143 2141 2142 if (!empty($ret['message'])) 2143 { 2144 $ret['ready_for_upload'] = false; 2145 } 2146 2147 return $ret; 2148 } 2149 2150 function ready_for_upload_message() 2151 { 2152 global $conf; 2153 2154 $relative_dir = preg_replace('#^'.PHPWG_ROOT_PATH.'#', '', $conf['upload_dir']); 2155 2144 2156 if (!is_dir($conf['upload_dir'])) 2145 2157 { 2146 2158 if (!is_writable(dirname($conf['upload_dir']))) 2147 2159 { 2148 $ret['message'] =sprintf(2160 return sprintf( 2149 2161 l10n('Create the "%s" directory at the root of your Piwigo installation'), 2150 2162 $relative_dir … … 2160 2172 if (!is_writable($conf['upload_dir'])) 2161 2173 { 2162 $ret['message'] =sprintf(2174 return sprintf( 2163 2175 l10n('Give write access (chmod 777) to "%s" directory at the root of your Piwigo installation'), 2164 2176 $relative_dir … … 2168 2180 } 2169 2181 2170 if (!empty($ret['message'])) 2171 { 2172 $ret['ready_for_upload'] = false; 2173 } 2174 2175 return $ret; 2182 return null; 2176 2183 } 2177 2184 ?>
Note: See TracChangeset
for help on using the changeset viewer.