/** * 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; }