• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Harmoni类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Harmoni的典型用法代码示例。如果您正苦于以下问题:PHP Harmoni类的具体用法?PHP Harmoni怎么用?PHP Harmoni使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Harmoni类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: execute

 /**
  * Execute this action.
  * 
  * @param object Harmoni $harmoni
  * @return mixed
  * @access public
  * @since 4/25/05
  */
 function execute()
 {
     if (!$this->isAuthorizedToExecute()) {
         throw new PermissionDeniedException();
     }
     $harmoni = Harmoni::instance();
     $harmoni->request->startNamespace("harmoni-authentication");
     $query = RequestContext::value("user");
     $harmoni->request->endNamespace();
     header('Content-type: text/plain');
     if (!strlen($query)) {
         exit;
     }
     $authNMethodManager = Services::getService("AuthNMethods");
     $types = $authNMethodManager->getAuthNTypes();
     while ($types->hasNext()) {
         $type = $types->next();
         $method = $authNMethodManager->getAuthNMethodForType($type);
         $foundTokens = $method->getTokensBySearch($query);
         while ($foundTokens->hasNext()) {
             $tokens = $foundTokens->next();
             print $method->getDisplayNameForTokens($tokens) . " (" . $type->getKeyword() . ")|type=\"" . $type->asString() . "\" id=\"" . $tokens->getIdentifier() . "\"\n";
         }
     }
     exit;
 }
开发者ID:adamfranco,项目名称:polyphony,代码行数:34,代码来源:search_users.act.php


示例2: buildContent

 /**
  * Build the content for this action
  * 
  * @return boolean
  * @access public
  * @since 4/26/05
  */
 function buildContent()
 {
     $actionRows = $this->getActionRows();
     $harmoni = Harmoni::instance();
     $repository = $this->getRepository();
     $repositoryId = $this->getRepositoryId();
     // function links
     ob_start();
     print _("Collection") . ": ";
     RepositoryPrinter::printRepositoryFunctionLinks($harmoni, $repository);
     $layout = new Block(ob_get_contents(), 3);
     ob_end_clean();
     $actionRows->add($layout, null, null, CENTER, CENTER);
     ob_start();
     print "<p>";
     print _("Some <em>Collections</em>, <em>Exhibitions</em>, <em>Assets</em>, and <em>Slide-Shows</em> may be restricted to certain users or groups of users. Log in above to ensure your greatest access to all parts of the system.");
     print "</p>";
     $introText = new Block(ob_get_contents(), 3);
     ob_end_clean();
     $actionRows->add($introText, null, null, CENTER, CENTER);
     // Print out the search types
     ob_start();
     $searchModules = Services::getService("RepositorySearchModules");
     $searchTypes = $repository->getSearchTypes();
     while ($searchTypes->hasNext()) {
         $searchType = $searchTypes->next();
         $typeString = $searchType->getDomain() . "::" . $searchType->getAuthority() . "::" . $searchType->getKeyword();
         print "\n<h3>" . $typeString . "</h3>";
         print "\n" . $searchModules->createSearchForm($repository, $searchType, $harmoni->request->quickURL("collection", "searchresults", array("collection_id" => $repositoryId->getIdString(), "asset_type" => urlencode($typeString))));
     }
     $searchFields = new Block(ob_get_contents(), 3);
     ob_end_clean();
     $actionRows->add($searchFields, "100%", null, LEFT, CENTER);
 }
开发者ID:adamfranco,项目名称:concerto,代码行数:41,代码来源:search.act.php


示例3: buildContent

    /**
     * Build the content for this action
     * 
     * @return void
     * @access public
     * @since 4/26/05
     */
    function buildContent()
    {
        $actionRows = $this->getActionRows();
        $harmoni = Harmoni::instance();
        // Set our textdomain
        $defaultTextDomain = textdomain("polyphony");
        ob_start();
        $harmoni->request->startNamespace("harmoni-authentication");
        $action = $harmoni->history->getReturnURL("polyphony/authentication");
        $usernameField = $harmoni->request->getName("username");
        $passwordField = $harmoni->request->getName("password");
        $usernameText = _("Username/Email");
        $passwordText = _("Password");
        $submitLabel = _('Log In');
        print <<<END
\t\t
\t\t<center><form name='login' action='{$action}' method='post'>
\t\t\t{$usernameText}: <input type='text' name='{$usernameField}' />
\t\t\t<br />{$passwordText}: <input type='password' name='{$passwordField}' />
\t\t\t<br /><input type='submit' value='{$submitLabel}'/>
\t\t</form></center>
\t\t
END;
        $actionRows->add(new Block(ob_get_contents(), 2), "100%", null, CENTER, CENTER);
        ob_end_clean();
        $harmoni->request->endNamespace();
        // go back to the default text domain
        textdomain($defaultTextDomain);
    }
开发者ID:adamfranco,项目名称:polyphony,代码行数:36,代码来源:username_password_form.act.php


示例4: getVisitorLoginLink

function getVisitorLoginLink()
{
    $harmoni = Harmoni::instance();
    $authN = Services::getService("AuthN");
    // Visitor Registration Link
    $authTypes = $authN->getAuthenticationTypes();
    $hasVisitorType = false;
    $visitorType = new Type("Authentication", "edu.middlebury.harmoni", "Visitors");
    while ($authTypes->hasNext()) {
        $authType = $authTypes->next();
        if ($visitorType->isEqual($authType)) {
            $hasVisitorType = true;
            break;
        }
    }
    if ($hasVisitorType && !$authN->isUserAuthenticatedWithAnyType()) {
        $harmoni->request->startNamespace('polyphony');
        $url = $harmoni->request->mkURL("auth", "login_type");
        $url->setValue("type", urlencode($visitorType->asString()));
        // Add return info to the visitor registration url
        $visitorReturnModules = array('view', 'ui1', 'ui2', 'versioning');
        if (in_array($harmoni->request->getRequestedModule(), $visitorReturnModules)) {
            $url->setValue('returnModule', $harmoni->request->getRequestedModule());
            $url->setValue('returnAction', $harmoni->request->getRequestedAction());
            $url->setValue('returnKey', 'node');
            $url->setValue('returnValue', SiteDispatcher::getCurrentNodeId());
        }
        $harmoni->request->endNamespace();
        return "\n\t<a href='" . $url->write() . "'>" . _("Visitor Login") . "</a>";
    }
    return null;
}
开发者ID:adamfranco,项目名称:segue,代码行数:32,代码来源:authentication-cas_default.conf.php


示例5: generateMainMenu

 /**
  * Generates a menu layout based on the current action.
  * @param string $actionString A dotted-pair action string of the form
  *		"module.action" .
  * @return object MenuLayout
  * @static
  */
 static function generateMainMenu()
 {
     $harmoni = Harmoni::instance();
     list($module, $action) = explode(".", $harmoni->request->getRequestedModuleAction());
     $mainMenu = new Menu(new YLayout(), 1);
     // :: Home ::
     $mainMenu_item = new MenuItemLink(_("Home"), $harmoni->request->quickURL("home", "welcome"), $module == "home" && $action == "welcome" ? TRUE : FALSE, 1);
     $mainMenu->add($mainMenu_item, "100%", null, LEFT, CENTER);
     // 		$mainMenu_item = new MenuItemLink(
     // 			_("Plugin Tests"),
     // 			$harmoni->request->quickURL("plugin_manager", "test"),
     // 			($module == "plugin_manager")?TRUE:FALSE,1);
     // 		$mainMenu->add($mainMenu_item, "100%", null, LEFT, CENTER);
     $mainMenu_item = new MenuItemLink(_("Portal"), $harmoni->request->quickURL('portal', "list"), $module == "portal" && $action == 'list' ? TRUE : FALSE, 1);
     $mainMenu->add($mainMenu_item, "100%", null, LEFT, CENTER);
     if (defined('DATAPORT_SEGUE1_URL') && defined('DATAPORT_SEGUE1_SECRET_KEY') && defined('DATAPORT_SEGUE1_SECRET_VALUE')) {
         $mainMenu_item = new MenuItemLink(_("Migrate Sites"), $harmoni->request->quickURL('dataport', "choose_site"), $module == "dataport" && $action == 'choose_site' ? TRUE : FALSE, 1);
         $mainMenu->add($mainMenu_item, "100%", null, LEFT, CENTER);
     }
     $mainMenu_item8 = new MenuItemLink(_("User Tools"), $harmoni->request->quickURL("user", "main"), preg_match("/^user\$/", $module) ? TRUE : FALSE, 1);
     $mainMenu->add($mainMenu_item8, "100%", null, LEFT, CENTER);
     $mainMenu_item7 = new MenuItemLink(_("Admin Tools"), $harmoni->request->quickURL("admin", "main"), preg_match("/^admin\$/", $module) ? TRUE : FALSE, 1);
     $mainMenu->add($mainMenu_item7, "100%", null, LEFT, CENTER);
     return $mainMenu;
 }
开发者ID:adamfranco,项目名称:segue,代码行数:32,代码来源:SegueMenuGenerator.class.php


示例6: buildContent

 /**
  * Build the content for this action
  * 
  * @return void
  * @access public
  * @since 4/26/05
  */
 function buildContent()
 {
     $actionRows = $this->getActionRows();
     $harmoni = Harmoni::instance();
     $idManager = Services::getService("Id");
     $repositoryManager = Services::getService("Repository");
     $repository = $repositoryManager->getRepository($idManager->getId("edu.middlebury.concerto.exhibition_repository"));
     $asset = $repository->getAsset($idManager->getId(RequestContext::value('slideshow_id')));
     // Remove it from its set.
     $exhibitionId = $idManager->getId(RequestContext::value('exhibition_id'));
     $setManager = Services::getService("Sets");
     $exhibitionSet = $setManager->getPersistentSet($exhibitionId);
     $exhibitionSet->removeItem($asset->getId());
     // Log the action
     if (Services::serviceRunning("Logging")) {
         $loggingManager = Services::getService("Logging");
         $log = $loggingManager->getLogForWriting("Concerto");
         $formatType = new Type("logging", "edu.middlebury", "AgentsAndNodes", "A format in which the acting Agent[s] and the target nodes affected are specified.");
         $priorityType = new Type("logging", "edu.middlebury", "Event_Notice", "Normal events.");
         $item = new AgentNodeEntryItem("Delete Node", "Slideshow deleted:\n<br/>&nbsp; &nbsp; &nbsp;" . $asset->getDisplayName());
         $item->addNodeId($asset->getId());
         $item->addNodeId($idManager->getId(RequestContext::value('exhibition_id')));
         $log->appendLogWithTypes($item, $formatType, $priorityType);
     }
     $repository->deleteAsset($idManager->getId(RequestContext::value('slideshow_id')));
     RequestContext::locationHeader($harmoni->request->quickURL("exhibitions", "browse_exhibition", array("exhibition_id" => RequestContext::value('exhibition_id'))));
 }
开发者ID:adamfranco,项目名称:concerto,代码行数:34,代码来源:delete_slideshow.act.php


示例7: buildContent

 /**
  * Build the content for this action
  * 
  * @return void
  * @access public
  * @since 4/26/05
  */
 function buildContent()
 {
     $actionRows = $this->getActionRows();
     $harmoni = Harmoni::instance();
     $idManager = Services::getService("Id");
     $repositoryManager = Services::getService("Repository");
     $repositoryId = $idManager->getId(RequestContext::value('collection_id'));
     $repository = $repositoryManager->getRepository($repositoryId);
     $displayName = $repository->getDisplayName();
     // Delete all of the tags for the assets in the repository
     $itemsToDelete = array();
     $assets = $repository->getAssets();
     while ($assets->hasNext()) {
         $asset = $assets->next();
         $itemsToDelete[] = TaggedItem::forId($asset->getId(), 'concerto');
     }
     $tagManager = Services::getService('Tagging');
     $tagManager->deleteItems($itemsToDelete, 'concerto');
     $repositoryManager->deleteRepository($idManager->getId(RequestContext::value('collection_id')));
     // Log the success or failure
     if (Services::serviceRunning("Logging")) {
         $loggingManager = Services::getService("Logging");
         $log = $loggingManager->getLogForWriting("Concerto");
         $formatType = new Type("logging", "edu.middlebury", "AgentsAndNodes", "A format in which the acting Agent[s] and the target nodes affected are specified.");
         $priorityType = new Type("logging", "edu.middlebury", "Event_Notice", "Normal events.");
         $item = new AgentNodeEntryItem("Delete Node", "Repository deleted:\n<br/>&nbsp; &nbsp; &nbsp;" . $displayName);
         $item->addNodeId($repositoryId);
         $log->appendLogWithTypes($item, $formatType, $priorityType);
     }
     RequestContext::locationHeader($harmoni->request->quickURL("collections", "namebrowse"));
 }
开发者ID:adamfranco,项目名称:concerto,代码行数:38,代码来源:delete.act.php


示例8: execute

 /**
  * Execute the action
  * 
  * @return mixed
  * @access public
  */
 public function execute()
 {
     try {
         if (!$this->isAuthorizedToExecute()) {
             throw new PermissionDeniedException();
         }
         ob_start();
         $harmoni = Harmoni::instance();
         $component = SiteDispatcher::getCurrentNode();
         $site = SiteDispatcher::getCurrentRootNode();
         $slotMgr = SlotManager::instance();
         $slot = $slotMgr->getSlotBySiteId($site->getId());
         $exportDirname = $slot->getShortname() . "-html";
         $exportDir = DATAPORT_TMP_DIR . "/" . $exportDirname;
         $archivePath = DATAPORT_TMP_DIR . '/' . $exportDirname . ".zip";
         if (!file_exists($exportDir)) {
             header('HTTP/1.1 404 Not Found');
             print "Not Found";
             exit;
         }
         header("Content-Type: text/html;");
         $this->printStatus($exportDir);
     } catch (PermissionDeniedException $e) {
         header('HTTP/1.1 403 Forbidden');
         header("Content-Type: text/plain;");
         print _("You are not authorized to monitor the export this component.");
         exit;
     }
     exit;
 }
开发者ID:adamfranco,项目名称:segue,代码行数:36,代码来源:check_html_export.act.php


示例9: buildContent

 /**
  * Build the content for this action
  * 
  * @return boolean
  * @access public
  * @since 4/26/05
  */
 function buildContent()
 {
     $actionRows = $this->getActionRows();
     $harmoni = Harmoni::instance();
     ob_start();
     CollectionsPrinter::printFunctionLinks();
     $layout = new Block(ob_get_contents(), STANDARD_BLOCK);
     ob_end_clean();
     $actionRows->add($layout, null, null, CENTER, CENTER);
     $type = HarmoniType::fromString(urldecode(RequestContext::value('type')));
     $repositoryManager = Services::getService("Repository");
     // Get the Repositories
     $allRepositories = $repositoryManager->getRepositoriesByType($type);
     // put the repositories into an array and order them.
     // @todo, do authorization checking
     $repositoryArray = array();
     while ($allRepositories->hasNext()) {
         $repository = $allRepositories->next();
         $repositoryArray[$repository->getDisplayName()] = $repository;
     }
     ksort($repositoryArray);
     // print the Results
     $resultPrinter = new ArrayResultPrinter($repositoryArray, 2, 20, "printrepositoryShort", $harmoni);
     $resultPrinter->addLinksStyleProperty(new MarginTopSP("10px"));
     $resultLayout = $resultPrinter->getLayout();
     $actionRows->add($resultLayout, null, null, CENTER, CENTER);
 }
开发者ID:adamfranco,项目名称:concerto,代码行数:34,代码来源:browsetype.act.php


示例10: execute

 /**
  * Execute this action. This is a template method that handles setting up
  * components of the screen as well as authorization, delegating the various
  * parts to descendent classes.
  * 
  * @return mixed
  * @access public
  * @since 4/25/05
  */
 public final function execute()
 {
     $harmoni = Harmoni::instance();
     $pageTitle = $harmoni->config->get('programTitle');
     // Our Rows for action content
     $actionRows = $this->getActionRows();
     // Check authorization
     if (!$this->isAuthorizedToExecute()) {
         $actionRows->add(new Block($this->getUnauthorizedMessage(), ALERT_BLOCK), "100%", null, CENTER, TOP);
         return $actionRows;
     }
     // Add a heading if specified
     if ($headingText = $this->getHeadingText()) {
         $actionRows->add(new Heading($headingText, 1), "100%", null, LEFT, CENTER);
     }
     if ($this->getTitleText()) {
         $pageTitle .= ": " . $this->getTitleText();
     }
     // Set the page title and other new header items
     $outputHandler = $harmoni->getOutputHandler();
     ob_start();
     // 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(preg_replace("/<(\\/)?(em|i|b|strong)>/", "*", $pageTitle));
     print "</title>";
     // Add our common Harmoni javascript libraries
     require POLYPHONY_DIR . "/main/library/Harmoni.js.inc.php";
     $outputHandler->setHead(ob_get_clean());
     // Pass content generation off to our child classes
     $this->buildContent();
     return $actionRows;
 }
开发者ID:adamfranco,项目名称:polyphony,代码行数:43,代码来源:MainWindowAction.class.php


示例11: addBrowserWarning

    /**
     * Add a supported-browser warning
     *
     * @return void
     * @access public
     * @since 12/20/07
     * @static
     */
    public static function addBrowserWarning()
    {
        $harmoni = Harmoni::instance();
        $outputHandler = $harmoni->getOutputHandler();
        $polyphonyPath = POLYPHONY_PATH;
        $msieWarning = _('The \'New Mode\' editing interface does not support old versions of Microsoft Internet Explorer.\\n\\nPlease use the \'Classic Mode\' editing interface or use one of the following browsers:\\n\\tFirefox\\n\\tOpera\\n\\tSafari\\n\\tInternet Explorer (version 7 and later)');
        $warning = <<<END
\t\t
\t\t<script src='{$polyphonyPath}/javascript/brwsniff.js' type='text/javascript'></script>
\t\t<script type='text/javascript'>
\t\t// <![CDATA[
\t\t
\t\tvar br = getBrowser();
\t\t
\t\t// Display warning for old MSIE
\t\tif (br[0] == 'msie' && getMajorVersion(br[1]) < 7) {
\t\t\talert("{$msieWarning}");
\t\t}
\t\t
\t\t// ]]>
\t\t</script>

END;
        $outputHandler->setHead($outputHandler->getHead() . $warning);
    }
开发者ID:adamfranco,项目名称:segue,代码行数:33,代码来源:UI2.class.php


示例12: visitBlock

 /**
  * Visit a Block
  * 
  * @param object BlockSiteComponent $siteComponent
  * @return mixed
  * @access public
  * @since 8/31/07
  */
 public function visitBlock(BlockSiteComponent $siteComponent)
 {
     // check to see if user is authorized to view block
     $authZ = Services::getService("AuthZ");
     $idManager = Services::getService("Id");
     if (!$authZ->isUserAuthorized($idManager->getId("edu.middlebury.authorization.view_comments"), $idManager->getId($siteComponent->getId()))) {
         return;
     }
     $harmoni = Harmoni::instance();
     //get all comments for site component
     $commentsManager = CommentManager::instance();
     $comments = $commentsManager->getAllComments($siteComponent->getAsset());
     while ($comments->hasNext()) {
         $comment = $comments->next();
         $item = $this->addItem(new RSSItem());
         $item->setTitle($comment->getSubject());
         $item->setLink(SiteDispatcher::quickURL("view", "html", array("node" => $siteComponent->getId())) . "#comment_" . $comment->getIdString(), true);
         $item->setPubDate($comment->getModificationDate());
         $agentMgr = Services::getService("Agent");
         $agent = $comment->getAuthor();
         $item->setAuthor($agent->getDisplayName());
         $item->setCommentsLink(SiteDispatcher::quickURL("view", "html", array("node" => $siteComponent->getId())));
         $pluginMgr = Services::getService("PluginManager");
         $plugin = $pluginMgr->getPlugin($comment->getAsset());
         $item->setDescription($plugin->executeAndGetMarkup());
         // MediaFile eclosures.
         try {
             foreach ($plugin->getRelatedMediaFiles() as $file) {
                 $item->addEnclosure($file->getUrl(), $file->getSize()->value(), $file->getMimeType());
             }
         } catch (UnimplementedException $e) {
         }
     }
 }
开发者ID:adamfranco,项目名称:segue,代码行数:42,代码来源:comments.act.php


示例13: buildContent

 /**
  * Build the content for this action
  * 
  * @return boolean
  * @access public
  * @since 4/26/05
  */
 function buildContent()
 {
     $actionRows = $this->getActionRows();
     $harmoni = Harmoni::instance();
     $repository = $this->getRepository();
     // get the search type.
     $searchType = HarmoniType::fromString(urldecode(RequestContext::value('search_type')));
     // Get the Search criteria
     $searchModules = Services::getService("RepositorySearchModules");
     $searchCriteria = $searchModules->getSearchCriteria($repository, $searchType);
     // function links
     ob_start();
     print _("Collection") . ": ";
     RepositoryPrinter::printRepositoryFunctionLinks($harmoni, $repository);
     $layout = new Block(ob_get_contents(), 2);
     ob_end_clean();
     $actionRows->add($layout, null, null, CENTER, CENTER);
     ob_start();
     print "<p>";
     print _("Some <em>Collections</em>, <em>Exhibitions</em>, <em>Assets</em>, and <em>Slide-Shows</em> may be restricted to certain users or groups of users. Log in above to ensure your greatest access to all parts of the system.");
     print "</p>";
     $introText = new Block(ob_get_contents(), 2);
     ob_end_clean();
     $actionRows->add($introText, null, null, CENTER, CENTER);
     //***********************************
     // Get the assets to display
     //***********************************
     $assets = $repository->getAssetsBySearch($searchCriteria, $searchType, new HarmoniProperties(new Type('Repository', 'edu.middlebury', 'null')));
     //***********************************
     // print the results
     //***********************************
     $resultPrinter = new IteratorResultPrinter($assets, 2, 6, "printAssetShort", $harmoni);
     $resultLayout = $resultPrinter->getLayout();
     $actionRows->add($resultLayout, "100%", null, LEFT, CENTER);
 }
开发者ID:adamfranco,项目名称:concerto,代码行数:42,代码来源:searchresults.act.php


示例14: instance

 /**
  * This class implements the Singleton pattern. There is only ever
  * one instance of the this class and it is accessed only via the 
  * ClassName::instance() method.
  * 
  * @return object 
  * @access public
  * @since 5/26/05
  * @static
  */
 public static function instance()
 {
     if (!isset(self::$instance)) {
         self::$instance = new Harmoni();
     }
     return self::$instance;
 }
开发者ID:adamfranco,项目名称:harmoni,代码行数:17,代码来源:Harmoni.class.php


示例15: getTags

 /**
  * Answer all the tags in Segue by everyon 
  * 
  * @return object TagIterator
  * @access public
  * @since 11/8/06
  */
 function getTags()
 {
     $harmoni = Harmoni::instance();
     $tagManager = Services::getService("Tagging");
     $tags = $tagManager->getTags(TAG_SORT_ALFA, $this->getNumTags());
     return $tags;
 }
开发者ID:adamfranco,项目名称:segue,代码行数:14,代码来源:segue.act.php


示例16: buildContent

 /**
  * Build the content for this action
  * 
  * @return boolean
  * @access public
  * @since 4/26/05
  */
 function buildContent()
 {
     $actionRows = $this->getActionRows();
     $harmoni = Harmoni::instance();
     ob_start();
     CollectionsPrinter::printFunctionLinks();
     print "<p>";
     print _("Below are listed the available <em>Collections</em>, organized by type, then name.");
     print "</p>\n<p>";
     print _("Some <em>Collections</em>, <em>Exhibitions</em>, <em>Assets</em>, and <em>Slide-Shows</em> may be restricted to certain users or groups of users. Log in above to ensure your greatest access to all parts of the system.");
     print "</p>";
     $actionRows->add(new Block(ob_get_contents(), STANDARD_BLOCK), "100%", null, CENTER, CENTER);
     ob_end_clean();
     $exhibitionRepositoryType = new Type('System Repositories', 'edu.middlebury.concerto', 'Exhibitions');
     $repositoryManager = Services::getService("Repository");
     // Get all the types
     $types = $repositoryManager->getRepositoryTypes();
     // put the drs into an array and order them.
     $typeArray = array();
     while ($types->hasNext()) {
         $type = $types->next();
         // include all but Exhibitions repository.
         if (!$exhibitionRepositoryType->isEqual($type)) {
             $typeArray[HarmoniType::typeToString($type)] = $type;
         }
     }
     ksort($typeArray);
     // print the Results
     $resultPrinter = new ArrayResultPrinter($typeArray, 2, 20, "printTypeShort");
     $resultPrinter->addLinksStyleProperty(new MarginTopSP("10px"));
     $resultLayout = $resultPrinter->getLayout();
     $actionRows->add($resultLayout, null, null, CENTER, CENTER);
 }
开发者ID:adamfranco,项目名称:concerto,代码行数:40,代码来源:typebrowse.act.php


示例17: getCommandsComponent

 /**
  * Answer a links back to the main Segue pages
  * 
  * @return object GUIComponent
  * @access public
  * @since 1/12/07
  */
 function getCommandsComponent()
 {
     $harmoni = Harmoni::instance();
     ob_start();
     print "<div class='commands'>";
     print "<a href='";
     print SiteDispatcher::quickURL('view', 'html');
     print "' title='" . _("Go to View-Mode") . "'>";
     print _("view") . "</a>";
     print " | <a href='";
     print SiteDispatcher::quickURL('ui2', 'editview');
     print "' title='" . _("Go to Edit-Mode") . "'>";
     print _("edit") . "</a>";
     print " | <a href='";
     print SiteDispatcher::quickURL('ui2', 'headerfooter');
     print "' title='" . _("Go to Header/Footer Edit-Mode") . "'>";
     print _("header/footer") . "</a>";
     print " | " . _("arrange");
     // Add permissions button
     $authZ = Services::getService("AuthZ");
     $idManager = Services::getService("Id");
     // Rather than checking the entire site, we will just check the current node.
     // This forces users who are not site-wide admins to browse to the place where
     // they are administrators in order to see the permissions button, but
     // cuts load-times for non-admins on a given large site from 35s to 1.4s.
     if ($authZ->isUserAuthorized($idManager->getId("edu.middlebury.authorization.view_authorizations"), SiteDispatcher::getCurrentNode()->getQualifierId())) {
         $url = SiteDispatcher::quickURL("roles", "choose_agent", array("node" => SiteDispatcher::getCurrentNodeId(), "returnModule" => $harmoni->request->getRequestedModule(), "returnAction" => $harmoni->request->getRequestedAction()));
         print " | \n\t<a href='#' onclick='window.location = \"{$url}\".urlDecodeAmpersands(); return false;'>";
         print _("roles") . "</a>";
     }
     print " | " . self::getUiSwitchForm();
     print "</div>";
     $ret = new Component(ob_get_clean(), BLANK, 2);
     return $ret;
 }
开发者ID:adamfranco,项目名称:segue,代码行数:42,代码来源:arrangeview.act.php


示例18: buildContent

 /**
  * Build the content for this action
  * 
  * @return boolean
  * @access public
  * @since 4/26/05
  */
 function buildContent()
 {
     $actionRows = $this->getActionRows();
     $harmoni = Harmoni::instance();
     $harmoni->request->startNamespace("basket");
     $idManager = Services::getService("Id");
     $authZ = Services::getService("AuthZ");
     $basket = Basket::instance();
     $basket->clean();
     $basket->reset();
     //***********************************
     // Things to do with your basket
     //***********************************
     ob_start();
     print _("Basket") . ": ";
     //      perhaps there will be enough links sometime for this function
     //		BasketPrinter::printBasketFunctionLinks($harmoni, $basket);
     print "<a href=\"" . $harmoni->request->quickURL("basket", "export") . "\">" . _("Export Selection(<em>Assets</em>)") . "</a>";
     print " | ";
     print "<a href=\"" . $harmoni->request->quickURL("basket", "empty") . "\">" . _("Empty Selection") . "</a>";
     $layout = new Block(ob_get_contents(), STANDARD_BLOCK);
     ob_end_clean();
     $actionRows->add($layout, "100%", null, CENTER, CENTER);
     //***********************************
     // print the results
     //***********************************
     $resultPrinter = new IteratorResultPrinter($basket, 3, 6, "printAssetShort");
     $resultLayout = $resultPrinter->getLayout("viewAction::canView");
     $actionRows->add($resultLayout, "100%", null, LEFT, CENTER);
     $harmoni->request->endNamespace();
 }
开发者ID:adamfranco,项目名称:polyphony,代码行数:38,代码来源:view.act.php


示例19: execute

 /**
  * Execute the Action
  * 
  * @param object Harmoni $harmoni
  * @return mixed
  * @access public
  * @since 4/3/06
  */
 function execute()
 {
     // redirect
     $harmoni = Harmoni::instance();
     $newUrl = $harmoni->request->mkURLWithPassthrough('view', 'html');
     RequestContext::sendTo($newUrl->write());
 }
开发者ID:adamfranco,项目名称:segue,代码行数:15,代码来源:view.act.php


示例20: printFunctionLinks

 /**
  * Print links for the various functions that are possible to do.
  * 
  * @return void
  * @access public
  * @date 8/6/04
  * @static
  */
 static function printFunctionLinks()
 {
     $links = array();
     $harmoni = Harmoni::instance();
     $actionString = $harmoni->getCurrentAction();
     //===== NameBrowse Link =====//
     if ($actionString != "collections.namebrowse") {
         $links[] = "<a href='" . $harmoni->request->quickURL("collections", "namebrowse") . "'>" . _("Browse") . "</a>";
     } else {
         $links[] = _("Browse");
     }
     //===== TypeBrowse Link =====//
     if ($actionString != "collections.typebrowse") {
         $links[] = "<a href='" . $harmoni->request->quickURL("collections", "typebrowse") . "'>" . _("Browse by Type") . "</a>";
     } else {
         $links[] = _("browse by type");
     }
     //===== Search Link =====//
     if ($actionString != "collections.search") {
         $links[] = "<a href='" . $harmoni->request->quickURL("collections", "search") . "'>" . _("Search") . "</a>";
     } else {
         $links[] = _("search");
     }
     //===== Create Link =====//
     require_once MYDIR . "/main/modules/collection/create.act.php";
     $createAction = new createAction();
     if ($createAction->isAuthorizedToExecute()) {
         // 		if (true) {
         $links[] = "<a href='" . $harmoni->request->quickURL("collection", "create") . "'>" . _("Create a new <em>Collection</em>") . "</a>";
         //===== Import Link =====//
         $links[] = "<a href='" . $harmoni->request->quickURL("collections", "import") . "'>" . _("Import <em>Collection(s)</em>") . "</a>";
     }
     print implode("\n\t | ", $links);
 }
开发者ID:adamfranco,项目名称:concerto,代码行数:42,代码来源:CollectionsPrinter.static.php



注:本文中的Harmoni类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Hash类代码示例发布时间:2022-05-23
下一篇:
PHP Handler类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap