public function getCommandByObjectId(IdRequestObject $idRequestObject) { $object = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $idRequestObject->getId()); if ($object instanceof steam_link) { return new \Explorer\Commands\Index(); } }
public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject) { $idRequestObject = new \IdRequestObject(); $idRequestObject->setId($this->id); $extensions = \ExtensionMaster::getInstance()->getExtensionByType("IObjectExtension"); $commands = array(); foreach ($extensions as $extension) { if (strstr(strtolower(get_class($extension)), "portlet")) { $command = $extension->getCreateNewCommand($idRequestObject); if ($command) { $commands[] = $command; } } } $object = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $this->id); $dialog = new \Widgets\Dialog(); $dialog->setTitle("Erstelle ein neues Objekt in Spalte " . $object->get_name()); $dialog->setCloseButtonLabel(null); $dialog->setPositionX($this->params["mouseX"]); $dialog->setPositionY($this->params["mouseY"]); $html = "<div id=\"wizard\" style=\"margin-left: 20px; margin-right: 20px\">"; foreach ($commands as $command) { $namespaces = $command->getExtension()->getUrlNamespaces(); $html .= "<a href=\"\" onclick=\"sendRequest('{$command->getCommandName()}', {'id':{$this->id}}, 'wizard', 'wizard', null, null, '{$namespaces[0]}');return false;\" title=\"{$command->getExtension()->getObjectReadableDescription()}\"><img src=\"{$command->getExtension()->getObjectIconUrl()}\"> {$command->getExtension()->getObjectReadableName()}</a><br>"; } $html .= "<div style=\"float:right\"><a class=\"button pill negative\" onclick=\"closeDialog();return false;\" href=\"#\">Abbrechen</a></div></div><div id=\"wizard_wrapper\"></div>"; $rawHtml = new \Widgets\RawHtml(); $rawHtml->setHtml($html); $dialog->addWidget($rawHtml); $ajaxResponseObject->setStatus("ok"); $ajaxResponseObject->addWidget($dialog); return $ajaxResponseObject; }
public function getCommandByObjectId(IdRequestObject $idRequestObject) { $object = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $idRequestObject->getId()); if ($object instanceof steam_docextern) { return new \Explorer\Commands\ViewDocument(); } }
public function getCommandByObjectId(IdRequestObject $idRequestObject) { $forumObject = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $idRequestObject->getId()); if ($forumObject instanceof steam_messageboard) { return new \Forum\Commands\Index(); } }
public function getCommandByObjectId(IdRequestObject $idRequestObject) { $object = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $idRequestObject->getId()); $type = getObjectType($object); if (array_search($type, array("referenceFolder", "userHome", "groupWorkroom", "room", "container")) !== false) { return new \Explorer\Commands\Index(); } }
public function getCommandByObjectId(IdRequestObject $idRequestObject) { $pyramidObject = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $idRequestObject->getId()); $pyramidType = $pyramidObject->get_attribute("OBJ_TYPE"); if ($pyramidType != "0" && strStartsWith($pyramidType, "container_pyramiddiscussion")) { return new \Pyramiddiscussion\Commands\Index(); } return null; }
public function getCommandByObjectId(IdRequestObject $idRequestObject) { $galleryObject = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $idRequestObject->getId()); $galleryType = $galleryObject->get_attribute("bid:collectiontype"); if ($galleryType === "gallery") { return new \Gallery\Commands\Index(); } return null; }
public function getCommandByObjectId(IdRequestObject $idRequestObject) { $TCRObject = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $idRequestObject->getId()); $TCRType = $TCRObject->get_attribute("OBJ_TYPE"); if ($TCRType != "0" && $TCRType == "TCR_CONTAINER") { return new \TCR\Commands\Index(); } return null; }
public function getCommandByObjectId(IdRequestObject $idRequestObject) { $waveObject = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $idRequestObject->getId()); $waveType = $waveObject->get_attribute("OBJ_TYPE"); if ($waveType === "container_waveside") { return new \Wave\Commands\Index(); } return null; }
public function getCommandByObjectId(IdRequestObject $idRequestObject) { $RapidfeedbackObject = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $idRequestObject->getId()); $RapidfeedbackType = $RapidfeedbackObject->get_attribute("OBJ_TYPE"); if ($RapidfeedbackType != "0" && $RapidfeedbackType == "RAPIDFEEDBACK_CONTAINER") { return new \Rapidfeedback\Commands\Index(); } return null; }
public function getCommandByObjectId(IdRequestObject $idRequestObject) { $obj = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $idRequestObject->getId()); $status = $obj->get_attribute("worksheet_valid"); if ($status === 1) { return new \Worksheet\Commands\Index(); } return null; }
public function getCommandByObjectId(IdRequestObject $idRequestObject, $method = "view") { $object = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $idRequestObject->getId()); if ($object instanceof steam_room && $object->get_attribute("OBJ_TYPE") == PORTFOLIO_PREFIX . "ARTEFACT") { if ($method == "competences") { return new \Portfolio\Commands\SetCompetence(); } return new \Portfolio\Commands\ViewArtefact(); } }
public function getCommandByObjectId(IdRequestObject $idRequestObject) { $portletObject = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $idRequestObject->getId()); $portletType = $portletObject->get_attribute("bid:portlet"); if (!($portletType === "media")) { return false; } if ($idRequestObject->getMethod() == "view") { return new \PortletMedia\Commands\Index(); } }
public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject) { $idRequestObject = new \IdRequestObject(); $idRequestObject->setId($this->id); $columnObject = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $this->id); foreach ($GLOBALS["STEAM"]->get_current_steam_user()->get_inventory() as $steamObject) { $portletType = $steamObject->get_attribute("bid:portlet"); $isPortlet = false; if ($portletType != 0) { switch ($portletType) { case "msg": $isPortlet = true; break; case "appointment": $isPortlet = true; break; case "termplan": $isPortlet = true; break; case "topic": $isPortlet = true; break; case "headline": $isPortlet = true; break; case "poll": $isPortlet = true; break; case "media": $isPortlet = true; break; case "rss": $isPortlet = true; break; default: $isPortlet = false; break; } } if ($isPortlet) { $steamObject->move($columnObject); } } $ajaxResponseObject->setStatus("ok"); $jswrapper = new \Widgets\JSWrapper(); $jswrapper->setJs(<<<END \t\twindow.location.reload(); END ); $ajaxResponseObject->addWidget($jswrapper); return $ajaxResponseObject; }
public function getCommandByObjectId(IdRequestObject $idRequestObject) { //check if the portlet is valid for this object $portletObject = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $idRequestObject->getId()); $portletType = $portletObject->get_attribute("bid:portlet"); if (!($portletType === "msg")) { return false; } //return command if ($idRequestObject->getMethod() == "view") { return new \PortletMsg\Commands\Index(); } if ($idRequestObject->getMethod() == "properties") { return new \PortletMsg\Commands\Properties(); } }
public function getCommandByObjectId(IdRequestObject $idRequestObject) { $portalObject = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $idRequestObject->getId()); //is this a portlet? then abort TEST $portletType = $portalObject->get_attribute("bid:portlet"); //TODO: replace this with a better test if ($portletType === "msg" || $portletType === "rss" || $portletType === "headline" || $portletType === "appointment" || $portletType === "media" || $portletType === "poll" || $portletType === "topic") { return; } else { //return false; } $portalType = $portalObject->get_attribute("OBJ_TYPE"); if ($portalType === "container_portal_bid") { if ($idRequestObject->getMethod() == "view") { return new \Portal\Commands\Index(); } if ($idRequestObject->getMethod() == "properties") { return new \Portal\Commands\Index(); } } }
public function getCommandByObjectId(IdRequestObject $idRequestObject) { //can handle $usableObject = false; $portalColumnObject = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $idRequestObject->getId()); $portalType = $portalColumnObject->get_attribute("OBJ_TYPE"); if ($portalType === "container_portalColumn_bid") { //go on; } else { return false; } //is this a portlet? then abort TEST $portletType = $portalColumnObject->get_attribute("bid:portlet"); if ($portletType === "msg") { return false; } else { //return false; } if ($idRequestObject->getMethod() == "view") { return new \PortalColumn\Commands\Index(); } }
public function getWidgetsByObjectId($objectId, $method = "view", $params = array()) { $idRequestObject = new IdRequestObject(); $idRequestObject->setId($objectId); $idRequestObject->setMethod($method); $idRequestObject->setParams($params); $command = $this->getCommandByObjectId($objectId, $method); if ($command instanceof IIdCommand) { if ($command->validateData($idRequestObject)) { $command->processData($idRequestObject); $idResponseObject = $command->idResponse(new IdResponseObject()); if ($idResponseObject == null) { throw new Exception("idResponseObject is null for command " . get_class($command)); } return $idResponseObject->getWidgets(); } else { throw new Exception("Command validation error for {$objectId}."); } } return ""; }