当前位置: 首页>>代码示例>>PHP>>正文


PHP Asset::getFullPath方法代码示例

本文整理汇总了PHP中Asset::getFullPath方法的典型用法代码示例。如果您正苦于以下问题:PHP Asset::getFullPath方法的具体用法?PHP Asset::getFullPath怎么用?PHP Asset::getFullPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Asset的用法示例。


在下文中一共展示了Asset::getFullPath方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getChild

 /**
  * Returns a children by the filename
  *
  * @param string $asset
  * @return array
  */
 function getChild($name)
 {
     $nameParts = explode("/", $name);
     $name = Pimcore_File::getValidFilename($nameParts[count($nameParts) - 1]);
     //$name = implode("/",$nameParts);
     if (is_string($name)) {
         $parentPath = $this->asset->getFullPath();
         if ($parentPath == "/") {
             $parentPath = "";
         }
         if (!($asset = Asset::getByPath($parentPath . "/" . $name))) {
             throw new Sabre_DAV_Exception_FileNotFound('File not found: ' . $name);
         }
     } else {
         if ($name instanceof Asset) {
             $asset = $name;
         }
     }
     if ($asset instanceof Asset) {
         if ($asset->getType() == "folder") {
             return new Asset_WebDAV_Folder($asset);
         } else {
             return new Asset_WebDAV_File($asset);
         }
     }
     throw new Sabre_DAV_Exception_FileNotFound('File not found: ' . $name);
 }
开发者ID:shanky0110,项目名称:pimcore-custom,代码行数:33,代码来源:Folder.php

示例2: getDependencyForFrontend

 /**
  * @param Document|Asset|Object_Abstract $element
  * @return array
  */
 public static function getDependencyForFrontend($element)
 {
     if ($element instanceof Document) {
         return array("id" => $element->getId(), "path" => $element->getFullPath(), "type" => "document", "subtype" => $element->getType());
     } else {
         if ($element instanceof Asset) {
             return array("id" => $element->getId(), "path" => $element->getFullPath(), "type" => "asset", "subtype" => $element->getType());
         } else {
             if ($element instanceof Object_Abstract) {
                 return array("id" => $element->getId(), "path" => $element->getFullPath(), "type" => "object", "subtype" => $element->geto_Type());
             }
         }
     }
 }
开发者ID:ngocanh,项目名称:pimcore,代码行数:18,代码来源:Service.php

示例3: getTreeNodeConfig

 /**
  * @param Asset $asset
  * @return array|string
  */
 protected function getTreeNodeConfig($asset)
 {
     $tmpAsset = array("id" => $asset->getId(), "text" => $asset->getFilename(), "type" => $asset->getType(), "path" => $asset->getFullPath(), "basePath" => $asset->getPath(), "locked" => $asset->isLocked(), "lockOwner" => $asset->getLocked() ? true : false, "elementType" => "asset", "permissions" => array("remove" => $asset->isAllowed("delete"), "settings" => $asset->isAllowed("settings"), "rename" => $asset->isAllowed("rename"), "publish" => $asset->isAllowed("publish"), "view" => $asset->isAllowed("view")));
     // set type specific settings
     if ($asset->getType() == "folder") {
         $tmpAsset["leaf"] = false;
         $tmpAsset["expanded"] = $asset->hasNoChilds();
         $tmpAsset["iconCls"] = "pimcore_icon_folder";
         $tmpAsset["permissions"]["create"] = $asset->isAllowed("create");
     } else {
         $tmpAsset["leaf"] = true;
         $tmpAsset["iconCls"] = "pimcore_icon_" . Pimcore_File::getFileExtension($asset->getFilename());
     }
     $tmpAsset["qtipCfg"] = array("title" => "ID: " . $asset->getId());
     if ($asset->getType() == "image") {
         try {
             $tmpAsset["qtipCfg"] = array("title" => "ID: " . $asset->getId(), "text" => '<img src="/admin/asset/get-image-thumbnail/id/' . $asset->getId() . '/width/130/aspectratio/true" width="130" />', "width" => 140);
             // this is for backward-compatibilty, to calculate the dimensions if they are not there
             if (!$asset->getCustomSetting("imageDimensionsCalculated")) {
                 $asset->save();
             }
             if ($asset->getCustomSetting("imageWidth") && $asset->getCustomSetting("imageHeight")) {
                 $tmpAsset["imageWidth"] = $asset->getCustomSetting("imageWidth");
                 $tmpAsset["imageHeight"] = $asset->getCustomSetting("imageHeight");
             }
         } catch (Exception $e) {
             Logger::debug("Cannot get dimensions of image, seems to be broken.");
         }
     } else {
         if ($asset->getType() == "video") {
             try {
                 if (Pimcore_Video::isAvailable()) {
                     $tmpAsset["qtipCfg"] = array("title" => "ID: " . $asset->getId(), "text" => '<img src="/admin/asset/get-video-thumbnail/id/' . $asset->getId() . '/width/130/aspectratio/true" width="130" />', "width" => 140);
                 }
             } catch (Exception $e) {
                 Logger::debug("Cannot get dimensions of video, seems to be broken.");
             }
         }
     }
     $tmpAsset["cls"] = "";
     if ($asset->isLocked()) {
         $tmpAsset["cls"] .= "pimcore_treenode_locked ";
     }
     if ($asset->getLocked()) {
         $tmpAsset["cls"] .= "pimcore_treenode_lockOwner ";
     }
     return $tmpAsset;
 }
开发者ID:shanky0110,项目名称:pimcore-custom,代码行数:52,代码来源:AssetController.php

示例4: getDataForEditmode

 /**
  * @see Object_Class_Data::getDataForEditmode
  * @param Asset|Document|Object_Abstract $data
  * @param null|Object_Abstract $object
  * @return array
  */
 public function getDataForEditmode($data, $object = null)
 {
     if ($data) {
         $r = array("id" => $data->getId(), "path" => $data->getFullPath());
         if ($data instanceof Document) {
             $r["subtype"] = $data->getType();
             $r["type"] = "document";
         } else {
             if ($data instanceof Asset) {
                 $r["subtype"] = $data->getType();
                 $r["type"] = "asset";
             } else {
                 if ($data instanceof Object_Abstract) {
                     $r["subtype"] = $data->getO_Type();
                     $r["type"] = "object";
                 }
             }
         }
         return $r;
     }
     return;
 }
开发者ID:ngocanh,项目名称:pimcore,代码行数:28,代码来源:Href.php


注:本文中的Asset::getFullPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。