本文整理汇总了PHP中Pimcore_Tool::getIdPathForElement方法的典型用法代码示例。如果您正苦于以下问题:PHP Pimcore_Tool::getIdPathForElement方法的具体用法?PHP Pimcore_Tool::getIdPathForElement怎么用?PHP Pimcore_Tool::getIdPathForElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pimcore_Tool
的用法示例。
在下文中一共展示了Pimcore_Tool::getIdPathForElement方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDataByIdAction
public function getDataByIdAction()
{
// check for lock
if (Element_Editlock::isLocked($this->_getParam("id"), "document")) {
$this->_helper->json(array("editlock" => Element_Editlock::getByElement($this->_getParam("id"), "document")));
}
Element_Editlock::lock($this->_getParam("id"), "document");
$page = Document_Page::getById($this->_getParam("id"));
$page = $this->getLatestVersion($page);
$page->getVersions();
$page->getScheduledTasks();
$page->idPath = Pimcore_Tool::getIdPathForElement($page);
$page->userPermissions = $page->getUserPermissions();
$page->setLocked($page->isLocked());
// get depending redirects
$redirectList = new Redirect_List();
$redirectList->setCondition("target = ?", $page->getId());
$page->redirects = $redirectList->load();
// unset useless data
$page->setElements(null);
$page->childs = null;
// cleanup properties
$this->minimizeProperties($page);
if ($page->isAllowed("view")) {
$this->_helper->json($page);
}
$this->_helper->json(false);
}
示例2: getDataByIdAction
public function getDataByIdAction()
{
// check for lock
if (Element_Editlock::isLocked($this->_getParam("id"), "asset")) {
$this->_helper->json(array("editlock" => Element_Editlock::getByElement($this->_getParam("id"), "asset")));
}
Element_Editlock::lock($this->_getParam("id"), "asset");
$asset = Asset::getById(intval($this->_getParam("id")));
if (!$asset instanceof Asset) {
$this->_helper->json(array("success" => false, "message" => "asset doesn't exist"));
}
$asset->setProperties(Element_Service::minimizePropertiesForEditmode($asset->getProperties()));
$asset->getVersions();
$asset->getScheduledTasks();
$asset->idPath = Pimcore_Tool::getIdPathForElement($asset);
$asset->userPermissions = $asset->getUserPermissions();
$asset->setLocked($asset->isLocked());
if ($asset instanceof Asset_Text) {
$asset->getData();
}
if ($asset instanceof Asset_Image) {
$imageInfo = array();
if ($asset->getWidth() && $asset->getHeight()) {
$imageInfo["dimensions"] = array();
$imageInfo["dimensions"]["width"] = $asset->getWidth();
$imageInfo["dimensions"]["height"] = $asset->getHeight();
}
if (function_exists("exif_read_data") && is_file($asset->getFileSystemPath())) {
$supportedTypes = array(IMAGETYPE_JPEG, IMAGETYPE_TIFF_II, IMAGETYPE_TIFF_MM);
if (in_array(exif_imagetype($asset->getFileSystemPath()), $supportedTypes)) {
$exif = @exif_read_data($asset->getFileSystemPath());
if (is_array($exif)) {
$imageInfo["exif"] = array();
foreach ($exif as $name => $value) {
if (is_string($value) && strlen($value) < 50 || is_numeric($value)) {
$imageInfo["exif"][$name] = $value;
}
}
}
}
}
$asset->imageInfo = $imageInfo;
}
if ($asset->isAllowed("view")) {
$this->_helper->json($asset);
}
$this->_helper->json(array("success" => false, "message" => "missing_permission"));
}
示例3: getDataByIdAction
public function getDataByIdAction()
{
// check for lock
if (Element_Editlock::isLocked($this->_getParam("id"), "document")) {
$this->_helper->json(array("editlock" => Element_Editlock::getByElement($this->_getParam("id"), "document")));
}
Element_Editlock::lock($this->_getParam("id"), "document");
$link = Document_Link::getById($this->_getParam("id"));
$link->getPermissionsForUser($this->getUser());
$link->setObject(null);
$link->idPath = Pimcore_Tool::getIdPathForElement($link);
$this->minimizeProperties($link);
if ($link->isAllowed("view")) {
$this->_helper->json($link);
}
$this->_helper->json(false);
}
示例4: getDataByIdAction
public function getDataByIdAction()
{
// check for lock
if (Element_Editlock::isLocked($this->_getParam("id"), "document")) {
$this->_helper->json(array("editlock" => Element_Editlock::getByElement($this->_getParam("id"), "document")));
}
Element_Editlock::lock($this->_getParam("id"), "document");
$folder = Document_Folder::getById($this->_getParam("id"));
$folder->idPath = Pimcore_Tool::getIdPathForElement($folder);
$folder->userPermissions = $folder->getUserPermissions();
$folder->setLocked($folder->isLocked());
$this->minimizeProperties($folder);
if ($folder->isAllowed("view")) {
$this->_helper->json($folder);
}
$this->_helper->json(false);
}
示例5: getDataByIdAction
public function getDataByIdAction()
{
// check for lock
if (Element_Editlock::isLocked($this->_getParam("id"), "document")) {
$this->_helper->json(array("editlock" => Element_Editlock::getByElement($this->_getParam("id"), "document")));
}
Element_Editlock::lock($this->_getParam("id"), "document");
$snippet = Document_Snippet::getById($this->_getParam("id"));
$modificationDate = $snippet->getModificationDate();
$snippet = $this->getLatestVersion($snippet);
$snippet->getVersions();
$snippet->getScheduledTasks();
$snippet->idPath = Pimcore_Tool::getIdPathForElement($snippet);
$snippet->userPermissions = $snippet->getUserPermissions();
$snippet->setLocked($snippet->isLocked());
$this->minimizeProperties($snippet);
// unset useless data
$snippet->setElements(null);
if ($snippet->isAllowed("view")) {
$this->_helper->json($snippet);
}
$this->_helper->json(false);
}
示例6: getDataByIdAction
public function getDataByIdAction()
{
// check for lock
if (Element_Editlock::isLocked($this->_getParam("id"), "document")) {
$this->_helper->json(array("editlock" => Element_Editlock::getByElement($this->_getParam("id"), "document")));
}
Element_Editlock::lock($this->_getParam("id"), "document");
$email = Document_Email::getById($this->_getParam("id"));
$email = $this->getLatestVersion($email);
$email->getVersions();
$email->idPath = Pimcore_Tool::getIdPathForElement($email);
$email->userPermissions = $email->getUserPermissions();
$email->setLocked($email->isLocked());
// unset useless data
$email->setElements(null);
$email->childs = null;
// cleanup properties
$this->minimizeProperties($email);
if ($email->isAllowed("view")) {
$this->_helper->json($email);
}
$this->_helper->json(false);
}
示例7: getFolderAction
public function getFolderAction()
{
// check for lock
if (Element_Editlock::isLocked($this->_getParam("id"), "object")) {
$this->_helper->json(array("editlock" => Element_Editlock::getByElement($this->_getParam("id"), "object")));
}
Element_Editlock::lock($this->_getParam("id"), "object");
$object = Object_Abstract::getById(intval($this->_getParam("id")));
if ($object->isAllowed("view")) {
$objectData = array();
$objectData["general"] = array();
$objectData["idPath"] = Pimcore_Tool::getIdPathForElement($object);
$allowedKeys = array("o_published", "o_key", "o_id", "o_type");
foreach (get_object_vars($object) as $key => $value) {
if (strstr($key, "o_") && in_array($key, $allowedKeys)) {
$objectData["general"][$key] = $value;
}
}
$objectData["general"]["o_locked"] = $object->isLocked();
$objectData["properties"] = Element_Service::minimizePropertiesForEditmode($object->getProperties());
$objectData["userPermissions"] = $object->getUserPermissions();
$objectData["classes"] = $object->getResource()->getClasses();
$this->_helper->json($objectData);
} else {
Logger::debug("prevented getting folder id [ " . $object->getId() . " ] because of missing permissions");
$this->_helper->json(array("success" => false, "message" => "missing_permission"));
}
}
示例8: getAction
public function getAction()
{
// check for lock
if (Element_Editlock::isLocked($this->_getParam("id"), "object")) {
$this->_helper->json(array("editlock" => Element_Editlock::getByElement($this->_getParam("id"), "object")));
}
Element_Editlock::lock($this->_getParam("id"), "object");
$object = Object_Abstract::getById(intval($this->_getParam("id")));
// set the latest available version for editmode
$object = $this->getLatestVersion($object);
$object->getPermissionsForUser($this->getUser());
if ($object->isAllowed("view")) {
$objectData = array();
$objectData["idPath"] = Pimcore_Tool::getIdPathForElement($object);
$objectData["previewUrl"] = $object->getClass()->getPreviewUrl();
$objectData["layout"] = $object->getClass()->getLayoutDefinitions();
$this->getDataForObject($object);
$objectData["data"] = $this->objectData;
$objectData["metaData"] = $this->metaData;
$objectData["general"] = array();
$allowedKeys = array("o_published", "o_key", "o_id", "o_modificationDate", "o_classId", "o_className", "o_locked");
foreach (get_object_vars($object) as $key => $value) {
if (strstr($key, "o_") && in_array($key, $allowedKeys)) {
$objectData["general"][$key] = $value;
}
}
$objectData["properties"] = Element_Service::minimizePropertiesForEditmode($object->getProperties());
//$objectData["permissions"] = $object->getO_permissions();
$objectData["userPermissions"] = $object->getUserPermissions($this->getUser());
$objectData["versions"] = $object->getVersions();
$objectData["scheduledTasks"] = $object->getScheduledTasks();
$objectData["allowedClasses"] = $object->getClass();
if ($object instanceof Object_Concrete) {
$objectData["lazyLoadedFields"] = $object->getLazyLoadedFields();
}
$objectData["childdata"]["id"] = $object->getId();
$objectData["childdata"]["data"]["classes"] = $object->getResource()->getClasses();
$this->_helper->json($objectData);
} else {
Logger::debug("prevented getting object id [ " . $object->getId() . " ] because of missing permissions");
$this->_helper->json(array("success" => false, "message" => "missing_permission"));
}
}
示例9: gridObjectData
/**
* @param Object_Abstract $object
* @return array
*/
public static function gridObjectData($object, $fields = null)
{
$data = Element_Service::gridElementData($object);
if ($object instanceof Object_Concrete) {
$data["classname"] = $object->geto_ClassName();
$data["idPath"] = Pimcore_Tool::getIdPathForElement($object);
$data['inheritedFields'] = array();
if (empty($fields)) {
$fields = array_keys($object->getclass()->getFieldDefinitions());
}
foreach ($fields as $key) {
$brickType = null;
$brickGetter = null;
$dataKey = $key;
$keyParts = explode("~", $key);
$def = $object->getClass()->getFieldDefinition($key);
if (count($keyParts) > 1) {
$brickType = $keyParts[0];
$brickKey = $keyParts[1];
$key = self::getFieldForBrickType($object->getclass(), $brickType);
$brickClass = Object_Objectbrick_Definition::getByKey($brickType);
$def = $brickClass->getFieldDefinition($brickKey);
}
if (!empty($key)) {
// some of the not editable field require a special response
$getter = "get" . ucfirst($key);
$brickGetter = null;
if (!empty($brickKey)) {
$brickGetter = "get" . ucfirst($brickKey);
}
// if the definition is not set try to get the definition from localized fields
if (!$def) {
if ($locFields = $object->getClass()->getFieldDefinition("localizedfields")) {
$def = $locFields->getFieldDefinition($key);
}
}
//relation type fields with remote owner do not have a getter
if (method_exists($object, $getter)) {
//system columns must not be inherited
if (in_array($key, Object_Concrete::$systemColumnNames)) {
$data[$dataKey] = $object->{$getter}();
} else {
$valueObject = self::getValueForObject($object, $getter, $brickType, $brickGetter);
$data['inheritedFields'][$dataKey] = array("inherited" => $valueObject->objectid != $object->getId(), "objectid" => $valueObject->objectid);
if (method_exists($def, "getDataForGrid")) {
$tempData = $def->getDataForGrid($valueObject->value, $object);
if ($def instanceof Object_Class_Data_Localizedfields) {
foreach ($tempData as $tempKey => $tempValue) {
$data[$tempKey] = $tempValue;
}
} else {
$data[$dataKey] = $tempData;
}
} else {
$data[$dataKey] = $valueObject->value;
}
}
}
}
}
}
return $data;
}