本文整理汇总了PHP中AJXP_Node::isRoot方法的典型用法代码示例。如果您正苦于以下问题:PHP AJXP_Node::isRoot方法的具体用法?PHP AJXP_Node::isRoot怎么用?PHP AJXP_Node::isRoot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AJXP_Node
的用法示例。
在下文中一共展示了AJXP_Node::isRoot方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: switchAction
//.........这里部分代码省略.........
if (!is_array($res)) {
$url = $res;
} else {
list($hash, $url) = $res;
$newMeta = array("id" => $hash, "type" => "minisite");
if ($httpHash != null && $hash != $httpHash) {
$originalHash = $httpHash;
}
}
print $url;
} else {
$data = $this->accessDriver->makePublicletOptions($file, $httpVars["password"], $httpVars["expiration"], $httpVars["downloadlimit"], $this->repository);
$customData = array();
foreach ($httpVars as $key => $value) {
if (substr($key, 0, strlen("PLUGINS_DATA_")) == "PLUGINS_DATA_") {
$customData[substr($key, strlen("PLUGINS_DATA_"))] = $value;
}
}
if (count($customData)) {
$data["PLUGINS_DATA"] = $customData;
}
list($hash, $url) = $this->writePubliclet($data, $this->accessDriver, $this->repository);
$newMeta = array("id" => $hash, "type" => "file");
if (isset($httpVars["format"]) && $httpVars["format"] == "json") {
header("Content-type:application/json");
echo json_encode(array("element_id" => $hash, "publiclet_link" => $url));
} else {
header("Content-type:text/plain");
echo $url;
}
flush();
}
}
if ($newMeta != null && $ajxpNode->hasMetaStore() && !$ajxpNode->isRoot()) {
$this->addShareInMeta($ajxpNode, $newMeta["type"], $newMeta["id"], $originalHash);
}
AJXP_Controller::applyHook("msg.instant", array("<reload_shared_elements/>", ConfService::getRepository()->getId()));
// as the result can be quite small (e.g error code), make sure it's output in case of OB active.
flush();
break;
case "toggle_link_watch":
$file = AJXP_Utils::decodeSecureMagic($httpVars["file"]);
$watchValue = $httpVars["set_watch"] == "true" ? true : false;
$folder = false;
$shNode = new AJXP_Node($this->urlBase . $file);
if (isset($httpVars["element_type"]) && $httpVars["element_type"] == "folder") {
$folder = true;
$node = new AJXP_Node($this->baseProtocol . "://" . $httpVars["repository_id"] . "/");
} else {
$node = new AJXP_Node($this->urlBase . $file);
}
$this->getSharesFromMeta($shNode, $shares, false);
if (!count($shares)) {
break;
}
if (isset($httpVars["element_id"]) && isset($shares[$httpVars["element_id"]])) {
$elementId = $httpVars["element_id"];
} else {
$sKeys = array_keys($shares);
$elementId = $sKeys[0];
}
if ($this->watcher !== false) {
if (!$folder) {
if ($watchValue) {
$this->watcher->setWatchOnFolder($node, AuthService::getLoggedUser()->getId(), MetaWatchRegister::$META_WATCH_USERS_READ, array($elementId));
} else {