本文整理汇总了PHP中AJXP_Node::setDriver方法的典型用法代码示例。如果您正苦于以下问题:PHP AJXP_Node::setDriver方法的具体用法?PHP AJXP_Node::setDriver怎么用?PHP AJXP_Node::setDriver使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AJXP_Node
的用法示例。
在下文中一共展示了AJXP_Node::setDriver方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getParent
/**
* @return AJXP_Node|null
*/
public function getParent()
{
if (empty($this->urlParts["path"]) || $this->urlParts["path"] == "/") {
return null;
}
$parent = new AJXP_Node(dirname($this->_url));
$parent->setDriver($this->_accessDriver);
return $parent;
}
示例2: editMeta
public function editMeta($actionName, $httpVars, $fileVars)
{
if (!isset($this->actions[$actionName])) {
return;
}
if (is_a($this->accessDriver, "demoAccessDriver")) {
throw new Exception("Write actions are disabled in demo mode!");
}
$repo = $this->accessDriver->repository;
$user = AuthService::getLoggedUser();
if (!AuthService::usersEnabled() && $user != null && !$user->canWrite($repo->getId())) {
throw new Exception("You have no right on this action.");
}
$selection = new UserSelection();
$selection->initFromHttpVars($httpVars);
$currentFile = $selection->getUniqueFile();
$urlBase = $this->accessDriver->getResourceUrl($currentFile);
$ajxpNode = new AJXP_Node($urlBase);
$newValues = array();
$def = $this->getMetaDefinition();
$ajxpNode->setDriver($this->accessDriver);
AJXP_Controller::applyHook("node.before_change", array(&$ajxpNode));
foreach ($def as $key => $data) {
if (isset($httpVars[$key])) {
$newValues[$key] = AJXP_Utils::decodeSecureMagic($httpVars[$key]);
} else {
if (!isset($original)) {
$original = $ajxpNode->retrieveMetadata("users_meta", false, AJXP_METADATA_SCOPE_GLOBAL);
}
if (isset($original) && isset($original[$key])) {
$newValues[$key] = $original[$key];
}
}
}
$ajxpNode->setMetadata("users_meta", $newValues, false, AJXP_METADATA_SCOPE_GLOBAL);
AJXP_Controller::applyHook("node.meta_change", array($ajxpNode));
AJXP_XMLWriter::header();
AJXP_XMLWriter::writeNodesDiff(array("UPDATE" => array($ajxpNode->getPath() => $ajxpNode)), true);
AJXP_XMLWriter::close();
}