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


PHP menu_insert函数代码示例

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


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

示例1: PostInitialize

 /**
  * \brief This function is called before the plugin
  * is used and after all plugins have been initialized.
  * 
  * \return on success, false on failure.
  * \note Do not assume that the plugin exists!  Actually check it!
  * Purpose: Only allow people who are logged in to edit their own properties.
  */
 function PostInitialize()
 {
     global $Plugins;
     if ($this->State != PLUGIN_STATE_VALID) {
         return 0;
     }
     // don't run
     if ($_SESSION['User'] == "Default User") {
         /* Only valid if the user is logged in. */
         $this->State = PLUGIN_STATE_INVALID;
         return 0;
     }
     // Make sure dependencies are met
     foreach ($this->Dependency as $key => $val) {
         $id = plugin_find_id($val);
         if ($id < 0) {
             $this->Destroy();
             return 0;
         }
     }
     // It worked, so mark this plugin as ready.
     $this->State = PLUGIN_STATE_READY;
     // Add this plugin to the menu
     if ($this->MenuList !== "") {
         menu_insert("Main::" . $this->MenuList, $this->MenuOrder, $this->Name, $this->MenuTarget);
     }
     return $this->State == PLUGIN_STATE_READY;
 }
开发者ID:pombredanne,项目名称:fossology-test,代码行数:36,代码来源:user-edit-self.php

示例2: RegisterMenus

 /**
  * \brief Register copyright agent in "Agents" menu
  */
 function RegisterMenus()
 {
     if ($this->State != PLUGIN_STATE_READY) {
         return 0;
     }
     menu_insert("Agents::" . $this->Title, 0, $this->Name);
 }
开发者ID:pombredanne,项目名称:fossology-test,代码行数:10,代码来源:agent.php

示例3: RegisterMenus

 protected function RegisterMenus()
 {
     parent::RegisterMenus();
     if (!$this->isRequiresLogin() || $this->isLoggedIn()) {
         menu_insert("Main::Organize::Uploads::Move or Copy", 0, $this->name, $this->name);
     }
 }
开发者ID:DanielDobre,项目名称:fossology,代码行数:7,代码来源:AdminContentMove.php

示例4: PostInitialize

 function PostInitialize()
 {
     global $Plugins;
     if ($this->State != PLUGIN_STATE_VALID) {
         return 0;
     }
     // don't run
     // Make sure dependencies are met
     foreach ($this->Dependency as $key => $val) {
         $id = plugin_find_id($val);
         if ($id < 0) {
             Destroy();
             return 0;
         }
     }
     // Add default menus (with no actions linked to plugins)
     menu_insert("Main::Upload", 70);
     menu_insert("Main::Jobs", 60);
     menu_insert("Main::Organize", 50);
     menu_insert("Main::Help", -1);
     menu_insert("Main::Help::Documentation", 0, NULL, NULL, NULL, "<a href='http://www.fossology.org/projects/fossology/wiki/User_Documentation'>Documentation</a>");
     // It worked, so mark this plugin as ready.
     $this->State = PLUGIN_STATE_READY;
     return $this->State == PLUGIN_STATE_READY;
 }
开发者ID:pombredanne,项目名称:fossology-test,代码行数:25,代码来源:ui-menus.php

示例5: RegisterMenus

 /**
  * \brief Customize submenus.
  */
 function RegisterMenus()
 {
     $tooltipText = _("View file information");
     menu_insert("Browse-Pfile::Info", 5, $this->Name, $tooltipText);
     // For the Browse menu, permit switching between detail and summary.
     $Parm = Traceback_parm_keep(array("upload", "item", "format"));
     $URI = $this->Name . $Parm;
     $menuPosition = 60;
     $menuText = "Info";
     if (GetParm("mod", PARM_STRING) == $this->Name) {
         menu_insert("View::[BREAK]", 61);
         menu_insert("View::[BREAK]", 50);
         menu_insert("View::{$menuText}", $menuPosition);
         menu_insert("View-Meta::[BREAK]", 61);
         menu_insert("View-Meta::[BREAK]", 50);
         menu_insert("View-Meta::{$menuText}", $menuPosition);
         menu_insert("Browse::Info", -3);
     } else {
         $tooltipText = _("View information about this file");
         menu_insert("View::[BREAK]", 61);
         menu_insert("View::[BREAK]", 50);
         menu_insert("View::{$menuText}", $menuPosition, $URI, $tooltipText);
         menu_insert("View-Meta::[BREAK]", 61);
         menu_insert("View-Meta::[BREAK]", 50);
         menu_insert("View-Meta::{$menuText}", $menuPosition, $URI, $tooltipText);
         menu_insert("Browse::Info", -3, $URI, $tooltipText);
     }
 }
开发者ID:DanielDobre,项目名称:fossology,代码行数:31,代码来源:ui-view-info.php

示例6: RegisterMenus

 /**
  * \brief Register additional menus.
  */
 function RegisterMenus()
 {
     global $SysConf;
     if ($this->State != PLUGIN_STATE_READY) {
         return 0;
     }
     // don't run
     /* Get the users.default_bucketpool_fk */
     $AuthRec = GetArrayval('auth', $SysConf);
     if (empty($AuthRec)) {
         return 0;
     }
     $user_pk = $SysConf['auth']['UserId'];
     /* Unless the user is authenticated, we can't do anything. */
     if (empty($user_pk)) {
         return 0;
     }
     /* Get users default bucketpool so we know which bucketpool to use. */
     $usersRec = GetSingleRec("users", "where user_pk='{$user_pk}'");
     $default_bucketpool_fk = $usersRec['default_bucketpool_fk'];
     if (empty($default_bucketpool_fk)) {
         return 0;
     }
     /* fake menu item used to identify plugin agents */
     menu_insert("Agents::" . $this->Title, 0, $this->Name);
 }
开发者ID:pombredanne,项目名称:fossology-test,代码行数:29,代码来源:agent-bucket.php

示例7: RegisterMenus

 /**
  * \brief Customize submenus.
  */
 function RegisterMenus()
 {
     // For all other menus, permit coming back here.
     $URI = $this->Name . Traceback_parm_keep(array("show", "format", "page", "upload", "item"));
     $MenuDisplayString = _("License List");
     $MenuDisplayStringDL = _("License List Download");
     $Item = GetParm("item", PARM_INTEGER);
     $Upload = GetParm("upload", PARM_INTEGER);
     if (empty($Item) || empty($Upload)) {
         return;
     }
     if (GetParm("mod", PARM_STRING) == $this->Name) {
         menu_insert("Browse::{$MenuDisplayString}", 1);
         menu_insert("Browse::{$MenuDisplayStringDL}", 1, $URI . "&output=dltext");
     } else {
         menu_insert("Browse::{$MenuDisplayString}", 1, $URI, $MenuDisplayString);
         menu_insert("Browse::{$MenuDisplayStringDL}", 1, $URI . "&output=dltext", $MenuDisplayStringDL);
         /* bobg - This is to use a select list in the micro menu to replace the above List
             and Download, but put this select list in a form
             $LicChoices = array("Lic Download" => "Download", "Lic display" => "Display");
             $LicChoice = Array2SingleSelect($LicChoices, $SLName="LicDL");
             menu_insert("Browse::Nomos License List Download2", 1, $URI . "&output=dltext", NULL,NULL, $LicChoice);
            */
     }
 }
开发者ID:DanielDobre,项目名称:fossology,代码行数:28,代码来源:ui-license-list.php

示例8: RegisterMenus

 /**
  * \brief Customize submenus.
  */
 function RegisterMenus()
 {
     $topMenuList = "Main::" . "Help::Getting Started";
     $menuOrder = 0;
     menu_insert($topMenuList . '::Overview', $menuOrder - 10, $this->getName() . "&show=welcome");
     menu_insert($topMenuList . '::License Browser', $menuOrder, $this->getName() . "&show=licensebrowser");
 }
开发者ID:DanielDobre,项目名称:fossology,代码行数:10,代码来源:GettingStartedPage.php

示例9: preInstall

 function preInstall()
 {
     $bucketPool = $this->getDefaultBucketPool();
     if (!empty($bucketPool)) {
         menu_insert("Agents::" . $this->Title, 0, $this->Name);
     }
 }
开发者ID:DanielDobre,项目名称:fossology,代码行数:7,代码来源:agent-bucket.php

示例10: PostInitialize

 /**
  * \brief This is where we check for
  * changes to the full-debug setting.
  */
 function PostInitialize()
 {
     if ($this->State != PLUGIN_STATE_VALID) {
         return 0;
     }
     // don't re-run
     // Make sure dependencies are met
     foreach ($this->Dependency as $key => $val) {
         $id = plugin_find_id($val);
         if ($id < 0) {
             $this->Destroy();
             return 0;
         }
     }
     $FullMenuDebug = GetParm("fullmenu", PARM_INTEGER);
     if ($FullMenuDebug == 2) {
         $_SESSION['fullmenudebug'] = 1;
     }
     if ($FullMenuDebug == 1) {
         $_SESSION['fullmenudebug'] = 0;
     }
     // It worked, so mark this plugin as ready.
     $this->State = PLUGIN_STATE_READY;
     // Add this plugin to the menu
     if ($this->MenuList !== "") {
         menu_insert("Main::" . $this->MenuList, $this->MenuOrder, $this->Name, $this->MenuTarget);
     }
     return 1;
 }
开发者ID:pombredanne,项目名称:fossology-test,代码行数:33,代码来源:core-debug-menus.php

示例11: RegisterMenus

 /**
  * \brief Register additional menus.
  **/
 function RegisterMenus()
 {
     if ($this->State != PLUGIN_STATE_READY) {
         return 0;
     }
     // don't run
     /* fake menu item used to identify plugin agents */
     menu_insert("Agents::" . $this->Title, 0, $this->Name);
 }
开发者ID:pombredanne,项目名称:fossology-test,代码行数:12,代码来源:agent_adj2nest.php

示例12: preInstall

 function preInstall()
 {
     $dbManager = $GLOBALS['container']->get('db.manager');
     $latestPkgAgent = $dbManager->getSingleRow("SELECT agent_enabled FROM agent WHERE agent_name=\$1 ORDER BY agent_ts LIMIT 1", array('pkgagent'));
     if (isset($latestPkgAgent) && !$dbManager->booleanFromDb($latestPkgAgent['agent_enabled'])) {
         return 0;
     }
     menu_insert("Agents::" . $this->Title, 0, $this->Name);
 }
开发者ID:DanielDobre,项目名称:fossology,代码行数:9,代码来源:agent-pkgagent.php

示例13: preInstall

 function preInstall()
 {
     $text = _("Generate SPDX report");
     menu_insert("Browse-Pfile::Export&nbsp;SPDX&nbsp;RDF", 0, self::NAME, $text);
     menu_insert("UploadMulti::Generate&nbsp;SPDX", 0, self::NAME, $text);
     $text = _("Generate SPDX report in tag:value format");
     menu_insert("Browse-Pfile::Export&nbsp;SPDX&nbsp;tag:value", 0, self::NAME . '&outputFormat=spdx2tv', $text);
     $text = _("Generate Debian Copyright file");
     menu_insert("Browse-Pfile::Export&nbsp;DEP5", 0, self::NAME . '&outputFormat=dep5', $text);
 }
开发者ID:DanielDobre,项目名称:fossology,代码行数:10,代码来源:SpdxTwoGeneratorUi.php

示例14: RegisterMenus

 /**
  * \brief Customize submenus.
  */
 function RegisterMenus()
 {
     if ($this->State != PLUGIN_STATE_READY) {
         return 0;
     }
     $URL = $this->Name . "&add=y";
     $text = _("Add new license");
     menu_insert("Main::" . $this->MenuList . "::Add License", 0, $URL, $text);
     $URL = $this->Name;
     $text = _("Select license family");
     menu_insert("Main::" . $this->MenuList . "::Select License", 0, $URL, $text);
 }
开发者ID:rlintu,项目名称:fossology,代码行数:15,代码来源:admin-license-file.php

示例15: RegisterMenus

 /**
  * \brief Customize submenus.
  */
 function RegisterMenus()
 {
     // micro-menu
     $bucketagent_pk = GetParm("bapk", PARM_INTEGER);
     $uploadtree_pk = GetParm("item", PARM_INTEGER);
     $bucket_pk = GetParm("bpk", PARM_INTEGER);
     $bucketpool_pk = GetParm("bp", PARM_INTEGER);
     $nomosagent_pk = GetParm("napk", PARM_INTEGER);
     $URL = $this->Name . "&bapk={$bucketagent_pk}&item={$uploadtree_pk}&bpk={$bucket_pk}&bp={$bucketpool_pk}&napk={$nomosagent_pk}&page=-1";
     $text = _("Show All Files");
     menu_insert($this->Name . "::Show All", 0, $URL, $text);
 }
开发者ID:DanielDobre,项目名称:fossology,代码行数:15,代码来源:ui-list-bucket-files.php


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