protected function getPath()
 {
     try {
         $pathGallery = LBoxConfigManagerProperties::gpcn("path_photos_photogalleries");
         $pathGallery = str_replace("<project>", LBOX_PATH_PROJECT, $pathGallery);
         $pathGallery = str_replace("<photogallery_name>", $this->getPhotogallery()->name, $pathGallery);
         $pathGallery = str_replace("<photogallery_url>", $this->getPhotogallery()->getParamDirect("url"), $pathGallery);
         $fileName = $this->instance->getParamDirect("filename");
         $ext = $this->instance->getParamDirect("ext");
         return LBoxUtil::fixPathSlashes("{$pathGallery}/{$fileName}.{$ext}");
     } catch (Exception $e) {
         throw $e;
     }
 }
 /**
  * getter na file path
  * @return string
  */
 protected function getFilePath()
 {
     try {
         if (strlen($this->pathDataSave) < 1) {
             throw new LBoxExceptionFormProcessor(LBoxExceptionFormProcessor::MSG_INSTANCE_VAR_STRING_NOTNULL, LBoxExceptionFormProcessor::CODE_BAD_INSTANCE_VAR);
         }
         $path = $this->pathDataSave;
         $path = str_replace("<project>", LBOX_PATH_PROJECT, $path);
         $path = LBoxUtil::fixPathSlashes($path);
         LBoxUtil::createDirByPath(dirname($path));
         return $path;
     } catch (Exception $e) {
         throw $e;
     }
 }
示例#3
0
 /**
  *
  * @return PHPTAL
  */
 protected function getTAL()
 {
     try {
         if (!$this->TAL instanceof PHPTAL) {
             $this->TAL = new PHPTAL($this->getPathTemplate());
         }
         $translator = new LBoxTranslator($this->getPathTemplate());
         // zajistit existenci ciloveho adresare PHP kodu pro TAL:
         $phptalPhpCodeDestination = LBoxUtil::fixPathSlashes(LBoxConfigSystem::getInstance()->getParamByPath("output/tal/PHPTAL_PHP_CODE_DESTINATION"));
         LBoxUtil::createDirByPath($phptalPhpCodeDestination);
         $this->TAL->setTranslator($translator);
         $this->TAL->setForceReparse(LBoxConfigSystem::getInstance()->getParamByPath("output/tal/PHPTAL_FORCE_REPARSE"));
         $this->TAL->setPhpCodeDestination($phptalPhpCodeDestination);
         $this->TAL->SELF = $this;
         return $this->TAL;
     } catch (Exception $e) {
         throw $e;
     }
 }
示例#4
0
 /**
  * getter na cestu k sablone
  * @return string
  */
 protected function getTemplatePath()
 {
     try {
         return LBoxUtil::fixPathSlashes($this->templatePath . "/" . $this->getTemplateFileName());
     } catch (Exception $e) {
         throw $e;
     }
 }
示例#5
0
 /**
  * vraci celou cestu k sablone control (ovlivnenou atributem filenameTemplate instance control)
  * @return string
  */
 protected function getPathTemplate()
 {
     try {
         $pathTemplatesForms = LBoxConfigSystem::getInstance()->getParamByPath("metarecords/templates/path");
         return LBoxUtil::fixPathSlashes("{$pathTemplatesForms}/" . $this->filenameTemplate);
     } catch (Exception $e) {
         throw $e;
     }
 }
示例#6
0
 /**
  * vraci cesty k lang souborum podle jazyka a sablony, ktera instanci obsluhuje
  * @return array
  */
 protected function getLanguageFilePaths()
 {
     try {
         $lang = LBoxFront::getDisplayLanguage();
         $out = array();
         $out[] = LBoxUtil::fixPathSlashes($this->templatePath . ".{$lang}.xml");
         $out[] = LBoxUtil::fixPathSlashes(LBOX_PATH_FILES_I18N . "/project.{$lang}.xml");
         return $out;
     } catch (Exception $e) {
         throw $e;
     }
 }
示例#7
0
 /**
  * getter na instanci komponenty starajici se o samotne cachovani
  * @return Cache_Lite
  */
 protected function getCache()
 {
     try {
         if ($this->cache instanceof Cache_Lite) {
             return $this->cache;
         }
         $dir = LBoxUtil::fixPathSlashes($this->getDir());
         $dir = substr($dir, -1) == SLASH ? $dir : $dir . SLASH;
         self::createDirByPath($dir);
         $cacheOptions = array("cacheDir" => $dir, "lifeTime" => $this->lifeTime, "hashedDirectoryLevel" => $this->hashedDirectoryLevel);
         if (WIN) {
             $cacheOptions["fileLocking"] = false;
             $cacheOptions["writeControl"] = false;
             $cacheOptions["readControl"] = false;
             $cacheOptions["hashedDirectoryLevel"] = 0;
         }
         $this->cache = new Cache_Lite($cacheOptions);
         $this->cache->_hashedDirectoryUmask = self::$_hashedDirectoryUmask;
         return $this->cache;
     } catch (Exception $e) {
         throw $e;
     }
 }
 /**
  * getter na cestu k fotkam
  * @return string
  */
 protected function getPathPhotos()
 {
     try {
         $pathGallery = LBoxConfigManagerProperties::gpcn("path_photos_photogalleries");
         $pathGallery = str_replace("<project>", LBOX_PATH_PROJECT, $pathGallery);
         $pathGallery = str_replace("<photogallery_name>", $this->get("name"), $pathGallery);
         return LBoxUtil::fixPathSlashes($pathGallery);
     } catch (Exception $e) {
         throw $e;
     }
 }
示例#9
0
文件: index.php 项目: palmic/lbox
    header("HTTP/1.1 404 Not Found");
    die;
}
// firePHP debug
//LBoxFirePHP::log(LBoxConfigSystem::getInstance()->getParamByPath("metanodes/images/path"));
//LBoxFirePHP::table($_FILES['image'], "uploaded image data");
try {
    //////////////////////////////////////////////////////////////////////
    //	saving data
    //////////////////////////////////////////////////////////////////////
    if (strlen($tmpPath = $_FILES['image']['tmp_name']) > 0) {
        $imgName = $_FILES["image"]["name"];
        $userRecord = LBoxXTProject::isLogged() ? LBoxXTProject::getUserXTRecord() : LBoxXTDBFree::getUserXTRecord();
        $dirTarget = LBoxUtil::fixPathSlashes(LBoxConfigSystem::getInstance()->getParamByPath("metanodes/images/path") . SLASH . $userRecord->nick . SLASH . date("Ym"));
        $imgNameTarget = date("YmdHis") . "." . LBoxUtil::getExtByFilename($imgName);
        $imageURL = str_replace('\\', '/', LBoxUtil::fixPathSlashes(str_replace(LBOX_PATH_PROJECT, "", "{$dirTarget}/{$imgNameTarget}")));
        LBoxUtil::createDirByPath($dirTarget);
        if (!move_uploaded_file($tmpPath, "{$dirTarget}" . SLASH . "{$imgNameTarget}")) {
            throw new LBoxExceptionFilesystem(LBoxExceptionFilesystem::MSG_FILE_UPLOAD_ERROR, LBoxExceptionFilesystem::CODE_FILE_UPLOAD_ERROR);
        }
        $ret = new stdclass();
        // PHP base class
        $ret->status = "UPLOADED";
        $ret->image_url = $imageURL;
        header("HTTP/1.1 200 OK");
        header("content-type: text/html");
        die(json_encode($ret));
    }
} catch (Exception $e) {
    throwExceptionToFirePHP($e);
    $ret = new stdclass();
 /**
  * getter na file path
  * @return string
  */
 protected function getFilePath()
 {
     try {
         if (strlen($this->propertyNamePathData) < 1) {
             throw new LBoxExceptionFormProcessor(LBoxExceptionFormProcessor::MSG_INSTANCE_VAR_STRING_NOTNULL, LBoxExceptionFormProcessor::CODE_BAD_INSTANCE_VAR);
         }
         $path = LBoxConfigManagerProperties::gpcn($this->propertyNamePathData);
         $path = str_replace("<project>", LBOX_PATH_PROJECT, $path);
         $path = LBoxUtil::fixPathSlashes($path);
         return $path;
     } catch (Exception $e) {
         throw $e;
     }
 }