本文整理汇总了PHP中Object_Abstract::getPath方法的典型用法代码示例。如果您正苦于以下问题:PHP Object_Abstract::getPath方法的具体用法?PHP Object_Abstract::getPath怎么用?PHP Object_Abstract::getPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Object_Abstract
的用法示例。
在下文中一共展示了Object_Abstract::getPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTreeNodeConfig
/**
* @param Object_Abstract $child
* @return array
*/
protected function getTreeNodeConfig($child)
{
$tmpObject = array("id" => $child->getId(), "text" => $child->getKey(), "type" => $child->getType(), "path" => $child->getFullPath(), "basePath" => $child->getPath(), "elementType" => "object", "locked" => $child->isLocked(), "lockOwner" => $child->getLocked() ? true : false);
$tmpObject["isTarget"] = false;
$tmpObject["allowDrop"] = false;
$tmpObject["allowChildren"] = false;
$tmpObject["leaf"] = $child->hasNoChilds();
// $tmpObject["iconCls"] = "pimcore_icon_object";
$tmpObject["isTarget"] = true;
$tmpObject["allowDrop"] = true;
$tmpObject["allowChildren"] = true;
$tmpObject["leaf"] = false;
$tmpObject["cls"] = "";
if ($child->getType() == "folder") {
// $tmpObject["iconCls"] = "pimcore_icon_folder";
$tmpObject["qtipCfg"] = array("title" => "ID: " . $child->getId());
} else {
//assemble object preview URL
$previewUrl = $child->getClass()->getPreviewUrl();
if (!empty($previewUrl)) {
$vars = get_object_vars($child);
$assembled = true;
foreach ($vars as $key => $value) {
if (!empty($value) && strpos($previewUrl, "%" . $key) !== false) {
$previewUrl = str_replace("%" . $key, urlencode($value), $previewUrl);
} else {
if (strpos($previewUrl, "%" . $key) !== false) {
$assembled = false;
break;
}
}
if ($assembled) {
$tmpObject['previewUrl'] = $previewUrl;
}
}
}
$tmpObject["published"] = $child->isPublished();
$tmpObject["className"] = $child->getClass()->getName();
$tmpObject["qtipCfg"] = array("title" => "ID: " . $child->getId(), "text" => 'Type: ' . $child->getClass()->getName());
if (!$child->isPublished()) {
$tmpObject["cls"] .= "pimcore_unpublished ";
}
// if ($child->getClass()->getIcon()) {
// unset($tmpObject["iconCls"]);
// $tmpObject["icon"] = $child->getClass()->getIcon();
// }
}
if ($child->getElementAdminStyle()->getElementIcon()) {
$tmpObject["icon"] = $child->getO_elementAdminStyle()->getElementIcon();
}
if ($child->getElementAdminStyle()->getElementIconClass()) {
$tmpObject["iconCls"] = $child->getO_elementAdminStyle()->getElementIconClass();
}
if ($child->getElementAdminStyle()->getElementCssClass()) {
$tmpObject["cls"] .= $child->getO_elementAdminStyle()->getElementCssClass() . " ";
}
$tmpObject["expanded"] = $child->hasNoChilds();
$tmpObject["permissions"] = $child->getUserPermissions($this->getUser());
if ($child->isLocked()) {
$tmpObject["cls"] .= "pimcore_treenode_locked ";
}
if ($child->getLocked()) {
$tmpObject["cls"] .= "pimcore_treenode_lockOwner ";
}
return $tmpObject;
}
示例2: getTreeNodeConfig
/**
* @param Object_Abstract $child
* @return array
*/
protected function getTreeNodeConfig($child)
{
$tmpObject = array("id" => $child->getId(), "text" => $child->getKey(), "type" => $child->getType(), "path" => $child->getFullPath(), "basePath" => $child->getPath(), "elementType" => "object", "locked" => $child->isLocked(), "lockOwner" => $child->getLocked() ? true : false);
$tmpObject["isTarget"] = false;
$tmpObject["allowDrop"] = false;
$tmpObject["allowChildren"] = false;
$tmpObject["leaf"] = $child->hasNoChilds();
// $tmpObject["iconCls"] = "pimcore_icon_object";
$tmpObject["isTarget"] = true;
$tmpObject["allowDrop"] = true;
$tmpObject["allowChildren"] = true;
$tmpObject["leaf"] = false;
$tmpObject["cls"] = "";
if ($child->getType() == "folder") {
// $tmpObject["iconCls"] = "pimcore_icon_folder";
$tmpObject["qtipCfg"] = array("title" => "ID: " . $child->getId());
} else {
$tmpObject["published"] = $child->isPublished();
$tmpObject["className"] = $child->getClass()->getName();
$tmpObject["qtipCfg"] = array("title" => "ID: " . $child->getId(), "text" => 'Type: ' . $child->getClass()->getName());
if (!$child->isPublished()) {
$tmpObject["cls"] .= "pimcore_unpublished ";
}
// if ($child->getClass()->getIcon()) {
// unset($tmpObject["iconCls"]);
// $tmpObject["icon"] = $child->getClass()->getIcon();
// }
}
if ($child->getElementAdminStyle()->getElementIcon()) {
$tmpObject["icon"] = $child->getO_elementAdminStyle()->getElementIcon();
}
if ($child->getElementAdminStyle()->getElementIconClass()) {
$tmpObject["iconCls"] = $child->getO_elementAdminStyle()->getElementIconClass();
}
if ($child->getElementAdminStyle()->getElementCssClass()) {
$tmpObject["cls"] .= $child->getO_elementAdminStyle()->getElementCssClass() . " ";
}
$tmpObject["expanded"] = $child->hasNoChilds();
$tmpObject["permissions"] = $child->getUserPermissions($this->getUser());
if ($child->isLocked()) {
$tmpObject["cls"] .= "pimcore_treenode_locked ";
}
if ($child->getLocked()) {
$tmpObject["cls"] .= "pimcore_treenode_lockOwner ";
}
return $tmpObject;
}