19 require_once(BASE.
"wcmf/lib/presentation/class.Controller.php");
20 require_once(BASE.
"wcmf/lib/util/class.InifileParser.php");
21 require_once(BASE.
"wcmf/lib/persistence/class.PersistenceFacade.php");
22 require_once(BASE.
"wcmf/lib/model/class.Node.php");
23 require_once(BASE.
"wcmf/lib/model/class.NodeUtil.php");
24 require_once(BASE.
"wcmf/lib/security/class.RightsManager.php");
25 require_once(BASE.
"wcmf/lib/util/class.StringUtil.php");
26 require_once(BASE.
"wcmf/lib/presentation/ListboxFunctions.php");
27 require_once(BASE.
"wcmf/lib/util/class.Log.php");
65 if (strlen($request->getContext()) == 0)
67 $request->setContext(
'cms');
68 $response->setContext(
'cms');
72 $oid = $request->getValue(
'oid');
76 $request->setValue(
'rootType', $parts[
'type']);
77 $request->setContext($parts[
'type']);
82 $request->setValue(
'rootType', $request->getContext());
85 parent::initialize($request, $response);
108 $lockManager->releaseAllLocks();
115 $rootTypes = $parser->getValue(
'rootTypes',
'cms');
116 if ($rootTypes ===
false || !is_array($rootTypes) || $rootTypes[0] ==
'')
119 $this->_response->setAction(
'failure');
125 $oid = $this->_request->getValue(
'oid');
129 $viewMode =
'detail';
133 if ($this->_request->hasValue(
'depth')) {
134 $buildDepth = $this->_request->getValue(
'depth');
136 $node = &$persistenceFacade->load($oid, $buildDepth);
141 $this->_response->setAction(
'failure');
149 $localization->loadTranslation($node, $this->_request->getValue(
'language'),
true,
true);
153 Log::debug(nl2br($node->toString()), __CLASS__);
163 if (
sizeof($pathData) > 0) {
164 $rootOID = $pathData[0][
'oid'];
168 $template = &$persistenceFacade->create($node->getType(), 1);
172 $possibleParents = array();
173 $possibleParentTypes = array_keys($possibleParentsAll);
174 for ($i=0; $i<
sizeof($possibleParentTypes); $i++)
176 $curParentType = $possibleParentTypes[$i];
177 if ($rightsManager->authorize($curParentType,
'',
ACTION_READ)) {
178 $possibleParents[$curParentType] = &$possibleParentsAll[$curParentType];
181 $this->_response->setValue(
'possibleparents', $possibleParents);
186 $possibleChildren = array();
187 $possibleChildTypes = array_keys($possibleChildrenAll);
188 for ($i=0; $i<
sizeof($possibleChildTypes); $i++)
190 $curChildType = $possibleChildTypes[$i];
191 if ($rightsManager->authorize($curChildType,
'',
ACTION_READ)) {
192 $possibleChildren[$curChildType] = &$possibleChildrenAll[$curChildType];
195 $this->_response->setValue(
'possiblechildren', $possibleChildren);
199 if ($this->_request->getBooleanValue(
'translateValues'))
201 $nodes = array($node);
211 $this->_response->setValue(
'node', $node);
212 $this->_response->setValue(
'lockMsg', $lockMsg);
217 $viewMode =
'overview';
222 $rootType = $this->_request->getValue(
'rootType');
223 if (strlen($rootType) == 0) {
224 $rootType = $rootTypes[0];
232 $this->_response->setValue(
'oid', $oid);
233 $this->_response->setValue(
'rootType', $rootType);
234 $this->_response->setValue(
'rootTemplateNode', $persistenceFacade->create($rootType,
BUILDDEPTH_SINGLE));
235 $this->_response->setValue(
'viewMode', $viewMode);
238 $this->_response->setAction(
'ok');
248 return $this->_request->getValue(
'omitMetaData');
debug($message, $category)
get($message, $parameters=null, $domain='', $lang='')
getPossibleChildren(&$realNode, &$tplNode, $resolveManyToMany=true)
Controller is the base class of all controllers. If a Controller has a view it is expected to reside ...
DisplayController is a simple controller demonstrating how to display a Node using the displaynode...
translateValues(&$nodes, $language=null)
decomposeOID($oid, $validate=true)
isDebugEnabled($category)
getOIDParameter($oid, $param, $validate=true)
getPossibleParents(&$realNode, &$tplNode)
handleLocking(&$object, $name)
initialize(&$request, &$response)