Exemplo n.º 1
0
 /**
  * Constructor.
  */
 private function __construct()
 {
     $this->themeDao = BOL_ThemeDao::getInstance();
     $this->themeContentDao = BOL_ThemeContentDao::getInstance();
     $this->themeMasterPageDao = BOL_ThemeMasterPageDao::getInstance();
     $this->themeControlDao = BOL_ThemeControlDao::getInstance();
     $this->themeControlValueDao = BOL_ThemeControlValueDao::getInstance();
     $this->themeImageDao = BOL_ThemeImageDao::getInstance();
     $this->userfileImagesDir = OW_DIR_USERFILES . 'themes' . DS;
     $this->userfileImagesUrl = OW_URL_USERFILES . 'themes/';
 }
Exemplo n.º 2
0
 /**
  * Constructor.
  */
 private function __construct()
 {
     $this->themeDao = BOL_ThemeDao::getInstance();
     $this->themeContentDao = BOL_ThemeContentDao::getInstance();
     $this->themeMasterPageDao = BOL_ThemeMasterPageDao::getInstance();
     $this->themeControlDao = BOL_ThemeControlDao::getInstance();
     $this->themeControlValueDao = BOL_ThemeControlValueDao::getInstance();
     $this->themeImageDao = BOL_ThemeImageDao::getInstance();
 }
Exemplo n.º 3
0
 public function ajaxSaveImageData($params)
 {
     $imageId = (int) $params['entityId'];
     $image = $this->themeService->findImageById($imageId);
     if (isset($params['title']) && !empty($params['title'])) {
         $image->title = $params['title'];
     }
     BOL_ThemeImageDao::getInstance()->save($image);
     return array('result' => true, 'imageId' => $imageId);
 }
Exemplo n.º 4
0
foreach ($queryList as $query) {
    try {
        $db->query($query);
    } catch (Exception $e) {
        $logger->addEntry(json_encode($e));
    }
}
$themeService = BOL_ThemeService::getInstance();
$images = $themeService->findAllCssImages();
foreach ($images as $image) {
    try {
        $path = $themeService->getUserfileImagesDir() . $image->getFilename();
        if ($storage->fileExists($path)) {
            if (get_class($storage) == 'UPDATE_AmazonCloudStorage') {
                $tempPath = tempnam($themeService->getUserfileImagesDir(), 'themeTmpImage');
                $info = $storage->copyFileToLocalFS($path, $tempPath);
                $dimensions = getimagesize($tempPath);
                $filesize = UTIL_File::getFileSize($tempPath);
                unlink($tempPath);
            } else {
                $dimensions = getimagesize($path);
                $filesize = UTIL_File::getFileSize($path);
            }
            $image->dimensions = "{$dimensions[0]}x{$dimensions[1]}";
            $image->filesize = $filesize;
            BOL_ThemeImageDao::getInstance()->save($image);
        }
    } catch (Exception $e) {
        $logger->addEntry(json_encode($e));
    }
}