Ejemplo n.º 1
0
 /**
  * Build the content for this action
  * 
  * @return void
  * @access public
  * @since 5/8/07
  */
 function buildContent()
 {
     SegueAjaxPlugin::writeAjaxLib();
     /*********************************************************
      * Other headers and footers
      *********************************************************/
     $harmoni = Harmoni::instance();
     $outputHandler = $harmoni->getOutputHandler();
     UserDataHelper::writeHeadJs();
     ob_start();
     print Segue_MediaLibrary::getHeadHtml();
     $outputHandler->setHead($outputHandler->getHead() . ob_get_clean());
     parent::buildContent();
 }
Ejemplo n.º 2
0
 /**
  * Build the content for this action
  * 
  * @return boolean
  * @access public
  * @since 4/26/05
  */
 function execute()
 {
     ob_start();
     $harmoni = Harmoni::instance();
     /*********************************************************
      * Other headers and footers
      *********************************************************/
     $outputHandler = $harmoni->getOutputHandler();
     // Add our common Harmoni javascript libraries
     require POLYPHONY_DIR . "/main/library/Harmoni.js.inc.php";
     print Segue_MediaLibrary::getHeadHtml();
     $outputHandler->setHead(ob_get_clean());
     UserDataHelper::writeHeadJs();
     // Get the plugin asset id
     $harmoni->request->startNamespace('plugin_manager');
     $id = RequestContext::value('plugin_id');
     if (RequestContext::value('extended') == 'true') {
         $showExtended = true;
     } else {
         $showExtended = false;
     }
     $harmoni->request->endNamespace();
     // Get the plugin asset object
     $repositoryManager = Services::getService("Repository");
     $idManager = Services::getService("Id");
     $repository = $repositoryManager->getRepository($idManager->getId("edu.middlebury.segue.sites_repository"));
     $asset = $repository->getAsset($idManager->getId($id));
     $pluginManager = Services::getService("Plugs");
     $plugin = $pluginManager->getPlugin($asset);
     if (!is_object($plugin)) {
         print $plugin;
     } else {
         if ($showExtended) {
             print $plugin->executeAndGetExtendedMarkup(TRUE);
         } else {
             print $plugin->executeAndGetMarkup(TRUE);
         }
     }
     // 		exit();
     $block = new UnstyledBlock(ob_get_clean());
     return $block;
 }
Ejemplo n.º 3
0
    /**
     * Execute this action.
     * 
     * @return mixed
     * @access public
     * @since 4/25/05
     */
    function execute()
    {
        $title = $this->getHeadingText();
        $harmoni = Harmoni::instance();
        $harmoni->request->startNamespace('media');
        $nodeId = RequestContext::value('node');
        $harmoni->request->endNamespace();
        $POLYPHONY_PATH = POLYPHONY_PATH;
        $MYPATH = MYPATH;
        print <<<END
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
\t<title>{$title}</title>

END;
        require POLYPHONY_DIR . "/main/library/Harmoni.js.inc.php";
        print UserDataHelper::getHeadJs();
        print Segue_MediaLibrary::getHeadHtml();
        print <<<END
\t
\t<script type='text/javascript'>
\t\t// <![CDATA[
\t\t
\t\tMediaLibrary.prototype.onClose = function () { 
\t\t\twindow.close();
\t\t}
\t\t
\t\t// ]]>
\t</script>
\t
</head>
<body onload="this.onUse = function (mediaFile) { window.opener.SetUrl(mediaFile.getUrl());}; MediaLibrary.run('{$nodeId}', this); ">
\t
</body>
</html>


END;
        exit;
    }
Ejemplo n.º 4
0
 /**
  * Add the header controls to the main screen gui component
  * 
  * @param object Component $mainScreen
  * @return object Component The allWrapper
  * @access public
  * @since 4/7/08
  */
 public function addHeaderControls(Component $mainScreen)
 {
     $harmoni = Harmoni::instance();
     /*********************************************************
      * Additional setup
      *********************************************************/
     $rootSiteComponent = SiteDispatcher::getCurrentRootNode();
     $outputHandler = $harmoni->getOutputHandler();
     /*********************************************************
      * Theme
      *********************************************************/
     $outputHandler->setCurrentTheme($rootSiteComponent->getTheme());
     /*********************************************************
      * Other headers and footers
      *********************************************************/
     // Remove any existing title tags from the head text
     print preg_replace("/<title>[^<]*<\\/title>/", "", $outputHandler->getHead());
     //Add our new title
     print "\n\t\t<title>";
     print strip_tags(SiteDispatcher::getCurrentNode()->acceptVisitor(new BreadCrumbsVisitor(SiteDispatcher::getCurrentNode())));
     print "</title>";
     // Add our common Harmoni javascript libraries
     require POLYPHONY_DIR . "/main/library/Harmoni.js.inc.php";
     print Segue_MediaLibrary::getHeadHtml();
     $outputHandler->setHead(ob_get_clean());
     UserDataHelper::writeHeadJs();
     // Add the RSS head links
     RssLinkPrinter::addHeadLinks(SiteDispatcher::getCurrentNode());
     // Add the selection Panel
     Segue_Selection::instance()->addHeadJavascript();
     $allWrapper = new Container(new YLayout(), BLANK, 1);
     if (defined('SEGUE_SITE_HEADER')) {
         $this->siteMessage = $allWrapper->add(new Component($this->getSegueSiteHeader(), BLANK, 1), "100%", null, CENTER, TOP);
     }
     // :: login, links and commands
     $this->headRow = $allWrapper->add(new Container(new XLayout(), BLANK, 1), $rootSiteComponent->getWidth(), null, CENTER, TOP);
     $this->leftHeadColumn = $this->headRow->add($this->getSegueLinksComponent(), null, null, LEFT, TOP);
     $rightHeadColumn = $this->headRow->add(new Container(new YLayout(), BLANK, 1), null, null, CENTER, TOP);
     $rightHeadColumn->add($this->getLoginComponent(), null, null, RIGHT, TOP);
     if ($this->isAuthorizedToExecute()) {
         $rightHeadColumn->add($this->getCommandsComponent(), null, null, RIGHT, TOP);
     }
     $allWrapper->add($mainScreen, $rootSiteComponent->getWidth(), null, CENTER, TOP);
     // :: Top Row ::
     // 		$this->headRow = $mainScreen->add(
     // 			new Container(new XLayout, HEADER, 1),
     // 			"100%", null, CENTER, TOP);
     // 		$this->leftHeadColumn = $this->headRow->add(
     // 			new UnstyledBlock("<h1>".$rootSiteComponent->getTitleMarkup()."</h1>"),
     // 			null, null, LEFT, TOP);
     return $allWrapper;
 }