当前位置: 首页>>代码示例>>PHP>>正文


PHP AJXP_Plugin::getName方法代码示例

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


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

示例1: recursiveLoadPlugin

 /**
  * Load plugin class with dependencies first
  *
  * @param AJXP_Plugin $plugin
  * @param array $pluginsPool
  */
 private function recursiveLoadPlugin($plugin, $pluginsPool)
 {
     if ($plugin->loadingState != "") {
         return;
     }
     $dependencies = $plugin->getDependencies();
     $plugin->loadingState = "lock";
     foreach ($dependencies as $dependencyId) {
         if (isset($pluginsPool[$dependencyId])) {
             $this->recursiveLoadPlugin($pluginsPool[$dependencyId], $pluginsPool);
         } else {
             if (strpos($dependencyId, "+") !== false) {
                 foreach (array_keys($pluginsPool) as $pId) {
                     if (strpos($pId, str_replace("+", "", $dependencyId)) === 0) {
                         $this->recursiveLoadPlugin($pluginsPool[$pId], $pluginsPool);
                     }
                 }
             }
         }
     }
     $plugType = $plugin->getType();
     if (!isset($this->registry[$plugType])) {
         $this->registry[$plugType] = array();
     }
     $options = $this->confStorage->loadPluginConfig($plugType, $plugin->getName());
     if ($plugin->isEnabled() || isset($options["AJXP_PLUGIN_ENABLED"]) && $options["AJXP_PLUGIN_ENABLED"] === true) {
         $plugin = $this->instanciatePluginClass($plugin);
     }
     $plugin->loadConfigs($options);
     $this->registry[$plugType][$plugin->getName()] = $plugin;
     $plugin->loadingState = "loaded";
 }
开发者ID:Nanomani,项目名称:pydio-core,代码行数:38,代码来源:class.AJXP_PluginsService.php

示例2: listActions

 public function listActions($dir, $root = NULL, $hash = null, $returnNodes = false)
 {
     $allNodes = array();
     $parts = explode("/", $dir);
     $pServ = AJXP_PluginsService::getInstance();
     $activePlugins = $pServ->getActivePlugins();
     $types = $pServ->getDetectedPlugins();
     if (count($parts) == 1) {
         // list all types
         if (!$returnNodes) {
             AJXP_XMLWriter::sendFilesListComponentConfig('<columns switchGridMode="filelist" template_name="ajxp_conf.plugins_folder">
         <column messageId="ajxp_conf.101" attributeName="ajxp_label" sortType="String"/>
         </columns>');
         }
         ksort($types);
         foreach ($types as $t => $tPlugs) {
             $meta = array("icon" => "folder_development.png", "plugin_id" => $t);
             $nodeKey = "/{$root}/actions/" . $t;
             if (in_array($nodeKey, $this->currentBookmarks)) {
                 $meta = array_merge($meta, array("ajxp_bookmarked" => "true", "overlay_icon" => "bookmark.png"));
             }
             $xml = AJXP_XMLWriter::renderNode($nodeKey, ucfirst($t), false, $meta, true, false);
             if ($returnNodes) {
                 $allNodes[$nodeKey] = $xml;
             } else {
                 print $xml;
             }
         }
     } else {
         if (count($parts) == 2) {
             // list plugs
             $type = $parts[1];
             if (!$returnNodes) {
                 AJXP_XMLWriter::sendFilesListComponentConfig('<columns switchDisplayMode="detail" template_name="ajxp_conf.plugins_folder">
             <column messageId="ajxp_conf.101" attributeName="ajxp_label" sortType="String"/>
             <column messageId="ajxp_conf.103" attributeName="actions" sortType="String"/>
         </columns>');
             }
             $pObject = new AJXP_Plugin("", "");
             foreach ($types[$type] as $pId => $pObject) {
                 $actions = $pObject->getManifestRawContent("//action/@name", "xml", true);
                 $actLabel = array();
                 if ($actions->length) {
                     foreach ($actions as $node) {
                         $actLabel[] = $node->nodeValue;
                     }
                 }
                 $meta = array("icon" => "preferences_plugin.png", "plugin_id" => $pObject->getId(), "actions" => implode(", ", $actLabel));
                 $nodeKey = "/{$root}/actions/{$type}/" . $pObject->getName();
                 if (in_array($nodeKey, $this->currentBookmarks)) {
                     $meta = array_merge($meta, array("ajxp_bookmarked" => "true", "overlay_icon" => "bookmark.png"));
                 }
                 $xml = AJXP_XMLWriter::renderNode($nodeKey, $pObject->getManifestLabel(), false, $meta, true, false);
                 if ($returnNodes) {
                     $allNodes[$nodeKey] = $xml;
                 } else {
                     print $xml;
                 }
             }
         } else {
             if (count($parts) == 3) {
                 // list actions
                 $type = $parts[1];
                 $name = $parts[2];
                 $mess = ConfService::getMessages();
                 if (!$returnNodes) {
                     AJXP_XMLWriter::sendFilesListComponentConfig('<columns switchDisplayMode="full" template_name="ajxp_conf.plugins_folder">
             <column messageId="ajxp_conf.101" attributeName="ajxp_label" sortType="String" defaultWidth="10%"/>
             <column messageId="ajxp_conf.103" attributeName="parameters" sortType="String" fixedWidth="30%"/>
         </columns>');
                 }
                 $pObject = new AJXP_Plugin("", "");
                 $pObject = $types[$type][$name];
                 $actions = $pObject->getManifestRawContent("//action", "xml", true);
                 $allNodesAcc = array();
                 if ($actions->length) {
                     foreach ($actions as $node) {
                         $xPath = new DOMXPath($node->ownerDocument);
                         $callbacks = $xPath->query("processing/serverCallback", $node);
                         if (!$callbacks->length) {
                             continue;
                         }
                         $callback = $callbacks->item(0);
                         $actName = $actLabel = $node->attributes->getNamedItem("name")->nodeValue;
                         $text = $xPath->query("gui/@text", $node);
                         if ($text->length) {
                             $actLabel = $actName . " (" . $mess[$text->item(0)->nodeValue] . ")";
                         }
                         $params = $xPath->query("processing/serverCallback/input_param", $node);
                         $paramLabel = array();
                         if ($callback->getAttribute("developerComment") != "") {
                             $paramLabel[] = "<span class='developerComment'>" . $callback->getAttribute("developerComment") . "</span>";
                         }
                         $restPath = "";
                         if ($callback->getAttribute("restParams")) {
                             $restPath = "/api/{$actName}/" . ltrim($callback->getAttribute("restParams"), "/");
                         }
                         if ($restPath != null) {
                             $paramLabel[] = "<span class='developerApiAccess'>" . "API Access : " . $restPath . "</span>";
                         }
//.........这里部分代码省略.........
开发者ID:biggtfish,项目名称:cms,代码行数:101,代码来源:class.ajxp_confAccessDriver.php


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