/** * Answer a placeholder for a menu target * * @param object MenuOrganizerSiteComponent $organizer * @return Component * @access protected * @since 12/18/07 */ protected function getMenuTargetPlaceholder(MenuOrganizerSiteComponent $organizer) { // Add a placeholder to our target if we don't have any children ob_start(); $authZ = Services::getService("AuthZ"); $idMgr = Services::getService("Id"); if ($authZ->isUserAuthorized($idMgr->getId("edu.middlebury.authorization.add_children"), $organizer->getQualifierId())) { print "<div style='height: 50px; border: 1px solid #F00; margin: 0px 5px 5px 5px; padding: 5px;'>"; print _("This Section has no Pages yet. <br/><br/>Add a Page by clicking the <strong>+ Page</strong> button for this Section and choose 'Page'."); } else { print "<div style='height: 50px; margin: 0px 5px 5px 5px; padding: 5px;'>"; print " "; } print "\n</div>"; $placeholder = new UnstyledBlock(ob_get_clean()); return $placeholder; }
/** * Answer a placeholder for a menu target * * @param object MenuOrganizerSiteComponent $organizer * @return Component * @access protected * @since 12/18/07 */ protected function getMenuTargetPlaceholder(MenuOrganizerSiteComponent $organizer) { // Add a placeholder to our target if we don't have any children ob_start(); print "<div style='height: 50px;'>"; $authZ = Services::getService("AuthZ"); $idMgr = Services::getService("Id"); if ($authZ->isUserAuthorized($idMgr->getId("edu.middlebury.authorization.add_children"), $organizer->getQualifierId())) { print _("This Section has no Pages yet. <br/><br/>Add a Page by clicking the <strong>+ Page</strong> button for this Section and choose 'Page'."); } else { print " "; print "\n</div>"; return new UnstyledBlock(ob_get_clean()); } print "\n</div>"; $placeholder = new UnstyledBlock(ob_get_clean()); $title = str_replace('%1', $organizer->getParentComponent()->getDisplayName(), _("<em>Sub-Menu of</em> %1 <em>Target Placeholder</em>")); $controlsHTML = $this->getControlsHTML($organizer, $title, '', '#F00', '#F99', '#F66'); $placeholder->setPreHTML($controlsHTML); $styleCollection = new StyleCollection('.placeholder_red_outline', 'placeholder_red_outline', 'Red Outline', 'A red outline around a menu placeholder'); $styleCollection->addSP(new BorderSP('1px', 'solid', '#F00')); $placeholder->addStyle($styleCollection); return $placeholder; }
/** * Answer controls for MenuOrganizer SiteComponents * * @param SiteComponent $siteComponent * @return string * @access public * @since 4/17/06 */ public function visitMenuOrganizer(MenuOrganizerSiteComponent $siteComponent) { // $this->controlsStart($siteComponent); $authZ = Services::getService("AuthZ"); $idManager = Services::getService("Id"); $harmoni = Harmoni::instance(); if ($authZ->isUserAuthorized($idManager->getId("edu.middlebury.authorization.modify"), $siteComponent->getQualifierId())) { $url = SiteDispatcher::quickURL('ui1', 'editMenu', array('node' => $siteComponent->getId(), 'returnNode' => SiteDispatcher::getCurrentNodeId(), 'returnAction' => $this->action)); ob_start(); print "\n\t\t\t\t<div style='text-align: center;'>"; print "\n\t\t\t\t\t<a href='" . $url . "'>"; print _("[ menu display options ]"); print "</a>"; print "\n\t\t\t\t</div>"; $controls = ob_get_clean(); } else { $controls = ''; } return $controls; // return $this->controlsEnd($siteComponent); }