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


PHP Traceback_parm_keep函数代码示例

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


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

示例1: 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

示例2: 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

示例3: RegisterMenus

 /**
  * \brief Customize submenus.
  */
 function RegisterMenus()
 {
     menu_insert("Main::" . $this->MenuList, $this->MenuOrder, $this->Name, $this->MenuTarget);
     // For all other menus, permit coming back here.
     $URI = $this->Name . Traceback_parm_keep(array("page", "item"));
     $Item = GetParm("item", PARM_INTEGER);
     if (!empty($Item)) {
         if (GetParm("mod", PARM_STRING) == $this->Name) {
             menu_insert("Browse::Search", 1);
         } else {
             menu_insert("Browse::Search", 1, $URI, $this->MenuList);
         }
     }
 }
开发者ID:rlintu,项目名称:fossology,代码行数:17,代码来源:search.php

示例4: RegisterMenus

 /**
  * \brief Customize submenus.
  */
 function RegisterMenus()
 {
     menu_insert("Main::" . $this->MenuList, $this->MenuOrder, $this->Name, $this->Name);
     $Upload = GetParm("upload", PARM_INTEGER);
     if (empty($Upload)) {
         return;
     }
     // For the Browse menu, permit switching between detail and simple.
     $URI = $this->Name . Traceback_parm_keep(array("upload", "item"));
     if (GetParm("mod", PARM_STRING) == $this->Name) {
         menu_insert("Browse::Browse", 1);
     } else {
         menu_insert("Browse::Browse", 1, $URI);
     }
     return $this->State == PLUGIN_STATE_READY;
 }
开发者ID:DanielDobre,项目名称:fossology,代码行数:19,代码来源:ui-browse.php

示例5: RegisterMenus

 function RegisterMenus()
 {
     // For all other menus, permit coming back here.
     $URI = $this->Name . Traceback_parm_keep(array("show", "format", "page", "upload", "item"));
     $Item = GetParm("item", PARM_INTEGER);
     $Upload = GetParm("upload", PARM_INTEGER);
     if (!empty($Item) && !empty($Upload)) {
         if (GetParm("mod", PARM_STRING) == $this->Name) {
             menu_insert("Browse::ECC", 1);
             menu_insert("Browse::[BREAK]", 100);
         } else {
             $text = _("View ECC histogram");
             menu_insert("Browse::ECC", 10, $URI, $text);
         }
     }
 }
开发者ID:DanielDobre,项目名称:fossology,代码行数:16,代码来源:ecc-hist.php

示例6: RegisterMenus

 function RegisterMenus()
 {
     menu_insert("Main::Jobs::My Recent Jobs", $this->MenuOrder - 1, $this->Name, $this->MenuTarget);
     if ($_SESSION[Auth::USER_LEVEL] != PLUGIN_DB_ADMIN) {
         return;
     }
     if (GetParm("mod", PARM_STRING) == $this->Name) {
         /* Set micro menu to select either all users or this user */
         $allusers = GetParm("allusers", PARM_INTEGER);
         if ($allusers == 0) {
             $text = _("Show uploads from all users");
             $URI = $this->Name . Traceback_parm_keep(array("page")) . "&allusers=1";
         } else {
             $text = _("Show only your own uploads");
             $URI = $this->Name . Traceback_parm_keep(array("page")) . "&allusers=0";
         }
         menu_insert("showjobs::{$text}", 1, $URI, $text);
     }
 }
开发者ID:DanielDobre,项目名称:fossology,代码行数:19,代码来源:showjobs.php

示例7: RegisterMenus

 /**
  * \brief Customize submenus.
  */
 function RegisterMenus()
 {
     $itemId = GetParm("item", PARM_INTEGER);
     $textFormat = $this->microMenu->getFormatParameter($itemId);
     $pageNumber = GetParm("page", PARM_INTEGER);
     $this->microMenu->addFormatMenuEntries($textFormat, $pageNumber);
     // For all other menus, permit coming back here.
     $uploadId = GetParm("upload", PARM_INTEGER);
     if (!empty($itemId) && !empty($uploadId)) {
         $menuText = "ECC";
         $tooltipText = "Export Control Classification";
         $menuPosition = 56;
         $URI = EccView::NAME . Traceback_parm_keep(array("show", "format", "page", "upload", "item"));
         $this->microMenu->insert(MicroMenu::TARGET_DEFAULT, $menuText, $menuPosition, $this->getName(), $URI, $tooltipText);
     }
     $licId = GetParm("lic", PARM_INTEGER);
     if (!empty($licId)) {
         $this->NoMenu = 1;
     }
 }
开发者ID:DanielDobre,项目名称:fossology,代码行数:23,代码来源:EccView.php

示例8: 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"));
     $Item = GetParm("item", PARM_INTEGER);
     $Upload = GetParm("upload", PARM_INTEGER);
     if (!empty($Item) && !empty($Upload)) {
         if (GetParm("mod", PARM_STRING) == $this->Name) {
             menu_insert("View::View Copyright/Email/Url", 1);
             menu_insert("View-Meta::View Copyright/Email/Url", 1);
         } else {
             $text = _("View Copyright/Email/Url info");
             menu_insert("View::View Copyright/Email/Url", 1, $URI, $text);
             menu_insert("View-Meta::View Copyright/Email/Url", 1, $URI, $text);
         }
     }
     $Lic = GetParm("lic", PARM_INTEGER);
     if (!empty($Lic)) {
         $this->NoMenu = 1;
     }
 }
开发者ID:pombredanne,项目名称:fossology-test,代码行数:24,代码来源:view.php

示例9: number

 /**
 * @brief Output(): 
 * Requires:\n
        filter: optional filter to apply\n
        item1:  uploadtree_pk of the column 1 tree\n
        item2:  uploadtree_pk of the column 2 tree\n
        freeze: column number (1 or 2) to freeze
 */
 function Output()
 {
     if ($this->State != PLUGIN_STATE_READY) {
         return 0;
     }
     $uTime = microtime(true);
     $V = "";
     $UpdCache = GetParm("updcache", PARM_INTEGER);
     /* Remove "updcache" from the GET args and set $this->UpdCache
      * This way all the url's based on the input args won't be
      * polluted with updcache
      * Use Traceback_parm_keep to ensure that all parameters are in order
      */
     $CacheKey = "?mod=" . $this->Name . Traceback_parm_keep(array("item1", "item2", "filter", "col", "freeze", "itemf"));
     if ($UpdCache) {
         $UpdCache = $_GET['updcache'];
         $_SERVER['REQUEST_URI'] = preg_replace("/&updcache=[0-9]*/", "", $_SERVER['REQUEST_URI']);
         unset($_GET['updcache']);
         $V = ReportCachePurgeByKey($CacheKey);
     } else {
         $V = ReportCacheGet($CacheKey);
     }
     $Cached = !empty($V);
     if (!$Cached) {
         $V = $this->htmlContent();
     }
     if (!$this->OutputToStdout) {
         return $V;
     }
     print "{$V}";
     $Time = microtime(true) - $uTime;
     // convert usecs to secs
     $text = _("Elapsed time: %.2f seconds");
     printf("<small>{$text}</small>", $Time);
     if ($Cached) {
         $text = _("cached");
         $text1 = _("Update");
         echo " <i>{$text}</i>   <a href=\"{$_SERVER['REQUEST_URI']}&updcache=1\"> {$text1} </a>";
     } else {
         if ($Time > 0.5) {
             ReportCachePut($CacheKey, $V);
         }
     }
     return;
 }
开发者ID:DanielDobre,项目名称:fossology,代码行数:53,代码来源:bucket-diff.php

示例10: number

    /**
    * @brief Output(): 
    * Requires:\n
           filter: optional filter to apply\n
           item1:  uploadtree_pk of the column 1 tree\n
           item2:  uploadtree_pk of the column 2 tree\n
           freeze: column number (1 or 2) to freeze
    */
    function Output()
    {
        if ($this->State != PLUGIN_STATE_READY) {
            return 0;
        }
        $uTime = microtime(true);
        $V = "";
        /**/
        $UpdCache = GetParm("updcache", PARM_INTEGER);
        /* Remove "updcache" from the GET args and set $this->UpdCache
         * This way all the url's based on the input args won't be
         * polluted with updcache
         * Use Traceback_parm_keep to ensure that all parameters are in order
         */
        $CacheKey = "?mod=" . $this->Name . Traceback_parm_keep(array("item1", "item2", "filter", "col", "freeze", "itemf"));
        if ($UpdCache) {
            $UpdCache = $_GET['updcache'];
            $_SERVER['REQUEST_URI'] = preg_replace("/&updcache=[0-9]*/", "", $_SERVER['REQUEST_URI']);
            unset($_GET['updcache']);
            $V = ReportCachePurgeByKey($CacheKey);
        } else {
            $V = ReportCacheGet($CacheKey);
        }
        /**/
        if (empty($V)) {
            $filter = GetParm("filter", PARM_STRING);
            if (empty($filter)) {
                $filter = "none";
            }
            $FreezeCol = GetParm("freeze", PARM_INTEGER);
            // which column to freeze?  1 or 2 or null
            $ClickedCol = GetParm("col", PARM_INTEGER);
            // which column was clicked on?  1 or 2 or null
            $ItemFrozen = GetParm("itemf", PARM_INTEGER);
            // frozen item or null
            $in_uploadtree_pk1 = GetParm("item1", PARM_INTEGER);
            $in_uploadtree_pk2 = GetParm("item2", PARM_INTEGER);
            if (empty($in_uploadtree_pk1) || empty($in_uploadtree_pk2)) {
                Fatal("Bad input parameters.  Both item1 and item2 must be specified.", __FILE__, __LINE__);
            }
            /* If you click on a item in a frozen column, then you are a dope so ignore $ItemFrozen */
            if ($FreezeCol == $ClickedCol) {
                $ItemFrozen = 0;
                $FreezeCol = 0;
            }
            /* Check item1 upload permission */
            $Item1Row = GetSingleRec("uploadtree", "WHERE uploadtree_pk = {$in_uploadtree_pk1}");
            $UploadPerm = GetUploadPerm($Item1Row['upload_fk']);
            if ($UploadPerm < PERM_READ) {
                $text = _("Permission Denied");
                echo "<h2>{$text} item 1<h2>";
                return;
            }
            /* Check item2 upload permission */
            $Item2Row = GetSingleRec("uploadtree", "WHERE uploadtree_pk = {$in_uploadtree_pk2}");
            $UploadPerm = GetUploadPerm($Item2Row['upload_fk']);
            if ($UploadPerm < PERM_READ) {
                $text = _("Permission Denied");
                echo "<h2>{$text} item 2<h2>";
                return;
            }
            $uploadtree_pk1 = $in_uploadtree_pk1;
            $uploadtree_pk2 = $in_uploadtree_pk2;
            if ($FreezeCol == 1) {
                $uploadtree_pk1 = $ItemFrozen;
            } else {
                if ($FreezeCol == 2) {
                    $uploadtree_pk2 = $ItemFrozen;
                }
            }
            $newURL = Traceback_dir() . "?mod=" . $this->Name . "&item1={$uploadtree_pk1}&item2={$uploadtree_pk2}";
            if (!empty($filter)) {
                $newURL .= "&filter={$filter}";
            }
            // rewrite page with new uploadtree_pks */
            if ($uploadtree_pk1 != $in_uploadtree_pk1 || $uploadtree_pk2 != $in_uploadtree_pk2) {
                print <<<JSOUT
<script type="text/javascript">
  window.location.assign('{$newURL}');
</script>
JSOUT;
            }
            $TreeInfo1 = $this->GetTreeInfo($uploadtree_pk1);
            $TreeInfo2 = $this->GetTreeInfo($uploadtree_pk2);
            $ErrText = _("No license data for tree %d.  Use Jobs > Agents to schedule a license scan.");
            $ErrMsg = '';
            if ($TreeInfo1['agent_pk'] == 0) {
                $ErrMsg = sprintf($ErrText, 1);
            } else {
                if ($TreeInfo2['agent_pk'] == 0) {
                    $ErrMsg = sprintf($ErrText, 2);
                } else {
//.........这里部分代码省略.........
开发者ID:pombredanne,项目名称:fossology-test,代码行数:101,代码来源:bucket-diff.php

示例11: Output

 /**
  * \brief This function returns the scheduler status.
  */
 function Output()
 {
     $uTime = microtime(true);
     if ($this->State != PLUGIN_STATE_READY) {
         return 0;
     }
     $V = "";
     $Upload = GetParm("upload", PARM_INTEGER);
     $UploadPerm = GetUploadPerm($Upload);
     if ($UploadPerm < PERM_READ) {
         $text = _("Permission Denied");
         echo "<h2>{$text}<h2>";
         return;
     }
     $Item = GetParm("item", PARM_INTEGER);
     $tag_pk = GetParm("tag", PARM_INTEGER);
     $updcache = GetParm("updcache", PARM_INTEGER);
     $this->uploadtree_tablename = GetUploadtreeTableName($Upload);
     /* Remove "updcache" from the GET args.
      * This way all the url's based on the input args won't be
      * polluted with updcache
      * Use Traceback_parm_keep to ensure that all parameters are in order */
     $CacheKey = "?mod=" . $this->Name . Traceback_parm_keep(array("upload", "item", "tag", "agent", "orderBy", "orderl", "orderc"));
     if ($updcache) {
         $_SERVER['REQUEST_URI'] = preg_replace("/&updcache=[0-9]*/", "", $_SERVER['REQUEST_URI']);
         unset($_GET['updcache']);
         $V = ReportCachePurgeByKey($CacheKey);
     } else {
         $V = ReportCacheGet($CacheKey);
     }
     if (empty($V)) {
         switch ($this->OutputType) {
             case "XML":
                 break;
             case "HTML":
                 $V .= "<font class='text'>\n";
                 /************************/
                 /* Show the folder path */
                 /************************/
                 $V .= Dir2Browse($this->Name, $Item, NULL, 1, "Browse", -1, '', '', $this->uploadtree_tablename) . "<P />\n";
                 if (!empty($Upload)) {
                     $Uri = preg_replace("/&item=([0-9]*)/", "", Traceback());
                     $V .= js_url();
                     $V .= $this->ShowUploadHist($Item, $Uri, $tag_pk);
                 }
                 $V .= "</font>\n";
                 $text = _("Loading...");
                 /*$V .= "<div id='ajax_waiting'><img src='images/ajax-loader.gif'>$text</div>"; */
                 break;
             case "Text":
                 break;
             default:
         }
         $Cached = false;
     } else {
         $Cached = true;
     }
     if (!$this->OutputToStdout) {
         return $V;
     }
     print "{$V}";
     $Time = microtime(true) - $uTime;
     // convert usecs to secs
     $text = _("Elapsed time: %.2f seconds");
     printf("<small>{$text}</small>", $Time);
     if ($Cached) {
         $text = _("cached");
         $text1 = _("Update");
         echo " <i>{$text}</i>   <a href=\"{$_SERVER['REQUEST_URI']}&updcache=1\"> {$text1} </a>";
     } else {
         /*  Cache Report if this took longer than 1/2 second*/
         if ($Time > 0.5) {
             ReportCachePut($CacheKey, $V);
         }
     }
     return;
 }
开发者ID:pombredanne,项目名称:fossology-test,代码行数:80,代码来源:ui-nomos-license.php

示例12: getView

 /**
  * \brief Generate the view contents in HTML
  *
  * @param resource $inputFile
  * @param string $BackMod
  * @param int $ShowMenu
  * @param int $ShowHeader
  * @param null $ShowText
  * @param bool $ViewOnly
  * @param bool $DispView
  * @param Highlight[] $highlightEntries
  * @param bool $insertBacklink
  *
  * \note This function is intended to be called from other plugins.
  */
 function getView($inputFile = NULL, $BackMod = "browse", $ShowHeader = 1, $ShowText = NULL, $highlightEntries = array(), $insertBacklink = false, $getPageMenuInline = false)
 {
     if ($this->State != PLUGIN_STATE_READY) {
         $output = "Invalid plugin state: " . $this->State;
         return $getPageMenuInline ? array("Error", $output) : $output;
     }
     $Upload = GetParm("upload", PARM_INTEGER);
     if (!empty($Upload) && !$this->uploadDao->isAccessible($Upload, Auth::getGroupId())) {
         $output = "Access denied";
         return $getPageMenuInline ? array("Error", $output) : $output;
     }
     $Item = GetParm("item", PARM_INTEGER);
     $Page = GetParm("page", PARM_INTEGER);
     $licenseId = GetParm("licenseId", PARM_INTEGER);
     if (!$inputFile && empty($Item)) {
         $output = "invalid input file";
         return $getPageMenuInline ? array("Error", $output) : $output;
     }
     $uploadtree_tablename = $this->uploadDao->getUploadtreeTableName($Upload);
     if ($ShowHeader) {
         $Uri = Traceback_uri() . "?mod=browse" . Traceback_parm_keep(array('item', 'show', 'folder', 'upload'));
         /* No item */
         $header = Dir2Browse($BackMod, $Item, NULL, $showBox = 0, "View", -1, '', '', $uploadtree_tablename);
         $this->vars['micromenu'] = $header;
     }
     /* Display file contents */
     $output = "";
     $openedFin = False;
     $Format = $this->microMenu->getFormatParameter($Item);
     if (empty($inputFile)) {
         $inputFile = @fopen(RepPathItem($Item), "rb");
         if ($inputFile) {
             $openedFin = true;
         }
         if (empty($inputFile)) {
             $output = $this->outputWhenFileNotInRepo($Upload, $Item);
             return $getPageMenuInline ? array("Error", $output) : $output;
         }
     }
     rewind($inputFile);
     $Uri = preg_replace('/&page=[0-9]*/', '', Traceback());
     $blockSize = $Format == 'hex' ? $this->blockSizeHex : $this->blockSizeText;
     if (!isset($Page) && !empty($licenseId)) {
         $startPos = -1;
         foreach ($highlightEntries as $highlightEntry) {
             if ($highlightEntry->getLicenseId() == $licenseId && ($startPos == -1 || $startPos > $highlightEntry->getStart())) {
                 $startPos = $highlightEntry->getStart();
             }
         }
         if ($startPos != -1) {
             $Page = floor($startPos / $blockSize);
         }
     }
     if (!empty($ShowText)) {
         echo $ShowText, "<hr>";
     }
     $PageMenu = $this->GetFileJumpMenu($inputFile, $Page, $blockSize, $Uri);
     $PageSize = $blockSize * $Page;
     if (!empty($PageMenu) and !$getPageMenuInline) {
         $output .= "<center>{$PageMenu}</center><br>\n";
     }
     $startAt = $PageSize;
     $endAt = $PageSize + $blockSize;
     $relevantHighlightEntries = array();
     foreach ($highlightEntries as $highlightEntry) {
         if ($highlightEntry->getStart() < $endAt && $highlightEntry->getEnd() >= $startAt) {
             $relevantHighlightEntries[] = $highlightEntry;
         }
     }
     $this->highlightProcessor->sortHighlights($relevantHighlightEntries);
     $splitPositions = $this->highlightProcessor->calculateSplitPositions($relevantHighlightEntries);
     if ($Format == 'hex') {
         $output .= $this->getHex($inputFile, $PageSize, $this->blockSizeHex, $splitPositions);
     } else {
         $output .= $this->getText($inputFile, $PageSize, $Format == 'text' ? 0 : 1, $this->blockSizeText, $splitPositions, $insertBacklink);
     }
     if (!empty($PageMenu) and !$getPageMenuInline) {
         $output .= "<P /><center>{$PageMenu}</center><br>\n";
     }
     if ($openedFin) {
         fclose($inputFile);
     }
     return $getPageMenuInline ? array($PageMenu, $output) : $output;
 }
开发者ID:rlintu,项目名称:fossology,代码行数:99,代码来源:ui-view.php

示例13: countFileListing

 /**
  * @param ItemTreeBounds $itemTreeBounds
  * @return array with keys 'isFlat','iTotalRecords','fileSwitch'
  */
 private function countFileListing(ItemTreeBounds $itemTreeBounds)
 {
     $isFlat = isset($_GET['flatten']);
     $vars['isFlat'] = $isFlat;
     $vars['iTotalRecords'] = $this->uploadDao->countNonArtifactDescendants($itemTreeBounds, $isFlat);
     $uri = Traceback_uri() . '?mod=' . $this->Name . Traceback_parm_keep(array('upload', 'folder', 'show', 'item'));
     $vars['fileSwitch'] = $isFlat ? $uri : $uri . "&flatten=yes";
     return $vars;
 }
开发者ID:DanielDobre,项目名称:fossology,代码行数:13,代码来源:ui-browse-license.php

示例14: createFileListing


//.........这里部分代码省略.........
         }
     }
     if (array_key_exists('ext', $searchMap) && strlen($searchMap['ext']) >= 1) {
         $options[UploadTreeProxy::OPT_EXT] = $searchMap['ext'];
     }
     if (array_key_exists('head', $searchMap) && strlen($searchMap['head']) >= 1) {
         $options[UploadTreeProxy::OPT_HEAD] = $searchMap['head'];
     }
     if (($rfId = GetParm('scanFilter', PARM_INTEGER)) > 0) {
         $options[UploadTreeProxy::OPT_AGENT_SET] = $selectedScanners;
         $options[UploadTreeProxy::OPT_SCAN_REF] = $rfId;
     }
     if (($rfId = GetParm('conFilter', PARM_INTEGER)) > 0) {
         $options[UploadTreeProxy::OPT_GROUP_ID] = Auth::getGroupId();
         $options[UploadTreeProxy::OPT_CONCLUDE_REF] = $rfId;
     }
     $openFilter = GetParm('openCBoxFilter', PARM_RAW);
     if ($openFilter == 'true' || $openFilter == 'checked') {
         $options[UploadTreeProxy::OPT_AGENT_SET] = $selectedScanners;
         $options[UploadTreeProxy::OPT_GROUP_ID] = Auth::getGroupId();
         $options[UploadTreeProxy::OPT_SKIP_ALREADY_CLEARED] = true;
     }
     $descendantView = new UploadTreeProxy($uploadId, $options, $itemTreeBounds->getUploadTreeTableName(), 'uberItems');
     $vars['iTotalDisplayRecords'] = $descendantView->count();
     $columnNamesInDatabase = array($isFlat ? 'ufile_name' : 'lft');
     $defaultOrder = array(array(0, "asc"));
     $orderString = $this->getObject('utils.data_tables_utility')->getSortingString($_GET, $columnNamesInDatabase, $defaultOrder);
     $offset = GetParm('iDisplayStart', PARM_INTEGER);
     $limit = GetParm('iDisplayLength', PARM_INTEGER);
     if ($offset) {
         $orderString .= " OFFSET {$offset}";
     }
     if ($limit) {
         $orderString .= " LIMIT {$limit}";
     }
     /* Get ALL the items under this Uploadtree_pk */
     $sql = $descendantView->getDbViewQuery() . " {$orderString}";
     $dbManager = $this->getObject('db.manager');
     $dbManager->prepare($stmt = __METHOD__ . $orderString, $sql);
     $res = $dbManager->execute($stmt, $descendantView->getParams());
     $descendants = $dbManager->fetchAll($res);
     $dbManager->freeResult($res);
     /* Filter out Children that don't have tag */
     if (!empty($tagId)) {
         TagFilter($descendants, $tagId, $itemTreeBounds->getUploadTreeTableName());
     }
     if (empty($descendants)) {
         $vars['fileData'] = array();
         return $vars;
     }
     if ($isFlat) {
         $firstChild = reset($descendants);
         $lastChild = end($descendants);
         $nameRange = array($firstChild['ufile_name'], $lastChild['ufile_name']);
     } else {
         $nameRange = array();
     }
     /*******    File Listing     ************/
     $pfileLicenses = array();
     foreach ($selectedScanners as $agentName => $agentId) {
         $licensePerPfile = $this->licenseDao->getLicenseIdPerPfileForAgentId($itemTreeBounds, $agentId, $isFlat, $nameRange);
         foreach ($licensePerPfile as $pfile => $licenseRow) {
             foreach ($licenseRow as $licId => $row) {
                 $lic = $this->licenseProjector->getProjectedShortname($licId);
                 $pfileLicenses[$pfile][$lic][$agentName] = $row;
             }
         }
     }
     $alreadyClearedUploadTreeView = new UploadTreeProxy($itemTreeBounds->getUploadId(), $options = array(UploadTreeProxy::OPT_SKIP_THESE => UploadTreeProxy::OPT_SKIP_ALREADY_CLEARED, UploadTreeProxy::OPT_ITEM_FILTER => "AND (lft BETWEEN " . $itemTreeBounds->getLeft() . " AND " . $itemTreeBounds->getRight() . ")", UploadTreeProxy::OPT_GROUP_ID => $groupId), $itemTreeBounds->getUploadTreeTableName(), $viewName = 'already_cleared_uploadtree' . $itemTreeBounds->getUploadId());
     $alreadyClearedUploadTreeView->materialize();
     if (!$isFlat) {
         $this->filesThatShouldStillBeCleared = $alreadyClearedUploadTreeView->countMaskedNonArtifactChildren($itemTreeBounds->getItemId());
     } else {
         $this->filesThatShouldStillBeCleared = $alreadyClearedUploadTreeView->getNonArtifactDescendants($itemTreeBounds);
     }
     $alreadyClearedUploadTreeView->unmaterialize();
     $noLicenseUploadTreeView = new UploadTreeProxy($itemTreeBounds->getUploadId(), $options = array(UploadTreeProxy::OPT_SKIP_THESE => "noLicense", UploadTreeProxy::OPT_ITEM_FILTER => "AND (lft BETWEEN " . $itemTreeBounds->getLeft() . " AND " . $itemTreeBounds->getRight() . ")", UploadTreeProxy::OPT_GROUP_ID => $groupId), $itemTreeBounds->getUploadTreeTableName(), $viewName = 'no_license_uploadtree' . $itemTreeBounds->getUploadId());
     $noLicenseUploadTreeView->materialize();
     if (!$isFlat) {
         $this->filesToBeCleared = $noLicenseUploadTreeView->countMaskedNonArtifactChildren($itemTreeBounds->getItemId());
     } else {
         $this->filesToBeCleared = $noLicenseUploadTreeView->getNonArtifactDescendants($itemTreeBounds);
     }
     $noLicenseUploadTreeView->unmaterialize();
     $allDecisions = $this->clearingDao->getFileClearingsFolder($itemTreeBounds, $groupId, $isFlat);
     $editedMappedLicenses = $this->clearingFilter->filterCurrentClearingDecisions($allDecisions);
     $baseUri = Traceback_uri() . '?mod=license' . Traceback_parm_keep(array('upload', 'folder', 'show'));
     $tableData = array();
     global $Plugins;
     $ModLicView =& $Plugins[plugin_find_id("view-license")];
     $latestSuccessfulAgentIds = $scanJobProxy->getLatestSuccessfulAgentIds();
     foreach ($descendants as $child) {
         if (empty($child)) {
             continue;
         }
         $tableData[] = $this->createFileDataRow($child, $uploadId, $selectedAgentId, $pfileLicenses, $groupId, $editedMappedLicenses, $baseUri, $ModLicView, $UniqueTagArray, $isFlat, $latestSuccessfulAgentIds);
     }
     $vars['fileData'] = $tableData;
     return $vars;
 }
开发者ID:DanielDobre,项目名称:fossology,代码行数:101,代码来源:AjaxExplorer.php

示例15: RegisterMenus

 /**
  * \brief Change the type of output
  * based on user-supplied parameters.
  *
  * \return 1 on success.
  */
 function RegisterMenus()
 {
     if ($this->State != PLUGIN_STATE_READY) {
         return 0;
     }
     $ShowHeader = GetParm('showheader', PARM_INTEGER);
     if (empty($ShowHeader)) {
         $ShowHeader = 0;
     }
     $ThisMod = GetParm("mod", PARM_STRING) == $this->Name ? 1 : 0;
     /*
      * This if stmt is true only for wget.
      * For wget, populate the $_FILES array, just like the UI post would do.
      * Sets the unlink_flag if there is a temp file.
      */
     if ($ThisMod && empty($_POST['showheader']) && $_SERVER['REQUEST_METHOD'] == "POST") {
         $Fin = fopen("php://input", "r");
         $Ftmp = tempnam(NULL, "fosslic-alo-");
         $Fout = fopen($Ftmp, "w");
         while (!feof($Fin)) {
             $Line = fgets($Fin);
             fwrite($Fout, $Line);
         }
         fclose($Fin);
         fclose($Fout);
         /* Populate _FILES from wget so the processing logic only has to look in one
          * place wether the data came from wget or the UI
          */
         if (filesize($Ftmp) > 0) {
             $_FILES['licfile']['tmp_name'] = $Ftmp;
             $_FILES['licfile']['size'] = filesize($Ftmp);
             $_FILES['licfile']['unlink_flag'] = 1;
             $this->NoHTML = 1;
         } else {
             unlink($Ftmp);
             /* If there is no input data, then something is wrong.
              * For example the php POST limit is too low and prevented
              * the data from coming through.  Or there was an apache redirect,
              * which removes the POST data.
              */
             $tooltipText = _("FATAL: your file did not get passed throught.  Make sure this page wasn't a result of a web server redirect, or that it didn't exceed your php POST limit.");
             echo $tooltipText;
         }
     }
     /* Only register with the menu system if the user is logged in. */
     if (!empty($_SESSION['User'])) {
         if ($_SESSION[Auth::USER_LEVEL] >= PLUGIN_DB_WRITE) {
             menu_insert("Main::Upload::One-Shot Analysis", $this->MenuOrder, $this->Name, $this->MenuTarget);
         }
         // Debugging changes to license analysis
         if ($_SESSION[Auth::USER_LEVEL] >= PLUGIN_DB_ADMIN) {
             $URI = $this->Name . Traceback_parm_keep(array("format", "item"));
             $menuText = "One-Shot License";
             $menuPosition = 100;
             $tooltipText = _("One-shot License, real-time license analysis");
             menu_insert("View::[BREAK]", $menuPosition);
             menu_insert("View::{$menuText}", $menuPosition + 1, $URI, $tooltipText);
             menu_insert("View-Meta::[BREAK]", $menuPosition);
             menu_insert("View-Meta::{$menuText}", $menuPosition + 1, $URI, $tooltipText);
         }
     }
 }
开发者ID:DanielDobre,项目名称:fossology,代码行数:68,代码来源:agent-nomos-once.php


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