FOSSology  4.4.0
Open Source License Compliance by Open Source Software
parseBrowseMenu Class Reference
Collaboration diagram for parseBrowseMenu:
Collaboration graph

Public Member Functions

 __construct ($page, $tblId, $title=1)
 
 fromFile ($nodeString)
 
 fromFS ($nodeString)
 
 fromURL ($nodeString)
 
 getAnchors ($node, $uploadName)
 
 parseBrowseMenuFiles ()
 
 parseBrowseFileMinis ()
 
 parseBrowseMenuDirs ()
 
 _createRtnArray ($array, $matches)
 
 _createMiniArray ($array, $matches)
 

Public Attributes

 $page
 
 $browseList = array()
 
 $noRows = FALSE
 
 $emptyTable = FALSE
 

Protected Attributes

 $anchors = array()
 

Private Attributes

 $tableId
 
 $title
 
 $test
 

Detailed Description

Given a fossology Broswe page, parse it and return it.

Parameters
string$pagethe xhtml page to parse
Returns
see the documentation below as the format of the arrays returned can vary (is this true?)
Version
"$Id: parseBrowseMenu.php 3459 2010-09-17 03:41:53Z rrando $"

Created on Aug 19, 2008

revised to use dom methods for the browse page parser in 2010.

Definition at line 23 of file parseBrowseMenu.php.

Member Function Documentation

◆ _createMiniArray()

parseBrowseMenu::_createMiniArray (   $array,
  $matches 
)

function _createMiniArray

combine two arrays into a single associative array. One of the arrays is already associative and had duplicate keys.

Parameters
array,$array
scalar,$matches
Todo:
what does the return array look like! Docuement it!

Definition at line 269 of file parseBrowseMenu.php.

◆ fromFile()

parseBrowseMenu::fromFile (   $nodeString)

function parseBrowseMenuFiles given a fossology browse page parse the browse listing into the upload name, upload link, view, info and download links.

The caller should check either noRows or browseList properties for results.

Returns
void. Sets the associative array browseList to upload names for keys, the array entries look like: Array( [3files.tar.bz2] => Array ( [3files.tar.bz2] => /repo/?mod=browse&upload=1&folder=1&item=1&show=detail [View] => /repo/?mod=view&upload=1&show=detail&item=1 [Info] => /repo/?mod=view_info&upload=1&show=detail&item=1 [Download] => /repo/?mod=download&upload=1&show=detail&item=1 )

[agpl-3.0] => Array ( [View] => /repo/?mod=view&upload=18&show=detail&item=895 [Info] => /repo/?mod=view_info&upload=18&show=detail&item=895 [Download] => /repo/?mod=download&upload=18&show=detail&item=895 )

Note, that when a single file is uploaded (agpl-3.0), there is no link to the upload, only View, Info and Download links.

Sets property noRows if the resulting array is empty and sets $browseList to an empty array if the browse page is blank.

Definition at line 77 of file parseBrowseMenu.php.

◆ parseBrowseFileMinis()

parseBrowseMenu::parseBrowseFileMinis ( )

function parseBrowseFileMinis given a fossology browse page gather up view|meta|download entries, and the links associated with them.

Returns
array of v|m|d keys and links or empty array if none found on that page.
Todo:
clear up what the array looks like I think it's an array of arrays with keys.

Definition at line 214 of file parseBrowseMenu.php.

◆ parseBrowseMenuDirs()

parseBrowseMenu::parseBrowseMenuDirs ( )

function parseBrowseDirs given a fossology browse page gather up directory entries, and the links associated with them.

Returns
array of directory names as keys and links or empty array if none found on that page.

Definition at line 229 of file parseBrowseMenu.php.


The documentation for this class was generated from the following file: