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) { $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 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(); } }