Changeset 58
- Timestamp:
- 06/02/08 14:46:23
- Files:
-
- trunk/apps/main/modules/applications/actions/actions.class.php (modified) (3 diffs)
- trunk/config/ProjectConfiguration.class.php (modified) (1 diff)
- trunk/lib/model/Application.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/apps/main/modules/applications/actions/actions.class.php
r57 r58 348 348 * @param Application $application The Application object instance 349 349 */ 350 protected function processUploadedImage($file, Application &$application)350 protected function processUploadedImage($file, Application $application) 351 351 { 352 352 if (is_null($file)) … … 354 354 return null; 355 355 } 356 356 357 357 $thumb = ImagesTools::createThumb ( 358 358 $file, 359 359 sfConfig::get('sf_upload_dir').DIRECTORY_SEPARATOR.sfConfig::get('app_applications_upload_dir', 'applications'), 360 md5($application _data->getName()).'.jpg',360 md5($application->getName()).'.jpg', 361 361 sfConfig::get('app_applications_screenshot_width', 200), 362 362 sfConfig::get('app_applications_screenshot_height', 140), … … 365 365 ); 366 366 367 $application->setScreenshotPath($thumb); 367 if ($thumb) 368 { 369 $application->setScreenshotPath($thumb); 370 $application->save(); 371 } 368 372 } 369 373 trunk/config/ProjectConfiguration.class.php
r54 r58 22 22 } 23 23 } 24 25 public function getWebDir() 26 { 27 return sfConfig::get('sf_web_dir'); 28 } 29 30 public function getUploadDir() 31 { 32 return sfConfig::get('sf_upload_dir'); 33 } 34 35 public function getUploadDirName() 36 { 37 $t = explode('/', sfConfig::get('sf_upload_dir')); 38 return (count($t) > 0) ? array_pop($t) : null; 39 } 24 40 } trunk/lib/model/Application.php
r57 r58 122 122 return sfConfig::get('app_applications_default_screenshot'); 123 123 } 124 $t = explode('/', sfConfig::get('sf_upload_dir'));// FIXME: move this somewhere else 125 $base_dir = array_pop($t); 124 126 return sprintf('/%s/%s/%s', 125 sfConfig::get('sf_upload_dir_name'),127 $base_dir, 126 128 sfConfig::get('app_applications_upload_dir', 'applications'), 127 129 $this->getScreenshotPath());
