make_cat_path() make use of arguments instead of globals
This commit is contained in:
@@ -93,11 +93,11 @@ function get_screenshot_img($appId, $versionId="")
|
||||
/**
|
||||
* TODO: what does it do ?
|
||||
*/
|
||||
function display_catpath($catId)
|
||||
function display_catpath($catId, $appId, $versionId = '')
|
||||
{
|
||||
$cat = new Category($catId);
|
||||
|
||||
$catFullPath = make_cat_path($cat->getCategoryPath());
|
||||
$catFullPath = make_cat_path($cat->getCategoryPath(), $appId, $versionId);
|
||||
echo html_frame_start("",'98%','',2);
|
||||
echo "<p><b>Category: ". $catFullPath ."</b><br>\n";
|
||||
echo html_frame_end();
|
||||
@@ -275,7 +275,7 @@ if($appId && !$versionId)
|
||||
apidb_header("Viewing App - ".$data->appName);
|
||||
|
||||
// cat display
|
||||
display_catpath($app->data->catId);
|
||||
display_catpath($app->data->catId, $appId);
|
||||
|
||||
// set Vendor
|
||||
$vendor = $app->getVendor();
|
||||
@@ -449,7 +449,7 @@ else if($appId && $versionId)
|
||||
apidb_header("Viewing App Version - ".$data->appName);
|
||||
|
||||
// cat
|
||||
display_catpath($app->data->catId);
|
||||
display_catpath($app->data->catId, $appId, $versionId);
|
||||
|
||||
// set URL
|
||||
$appLinkURL = ($ver->webPage) ? "<a href='$ver->webPage'>".substr(stripslashes($ver->webPage),0,30)."</a>": " ";
|
||||
|
||||
6
bugs.php
6
bugs.php
@@ -42,11 +42,11 @@ function get_screenshot_img($appId, $versionId)
|
||||
}
|
||||
|
||||
|
||||
function display_catpath($catId)
|
||||
function display_catpath($catId, $appId, $versionId = '')
|
||||
{
|
||||
$cat = new Category($catId);
|
||||
|
||||
$catFullPath = make_cat_path($cat->getCategoryPath());
|
||||
$catFullPath = make_cat_path($cat->getCategoryPath(),$appId, $versionId);
|
||||
echo html_frame_start("",'98%','',2);
|
||||
echo "<p><b>Category: ". $catFullPath ."</b><br>\n";
|
||||
echo html_frame_end();
|
||||
@@ -173,7 +173,7 @@ if($appId)
|
||||
apidb_header("Search for bugs in Bugzila for - ".$data->appName);
|
||||
|
||||
//cat display
|
||||
display_catpath($app->data->catId);
|
||||
display_catpath($app->data->catId, $appId);
|
||||
|
||||
//set Vendor
|
||||
$vendor = $app->getVendor();
|
||||
|
||||
@@ -182,7 +182,7 @@ function versionIdToName($versionId)
|
||||
/**
|
||||
* create the Category: line at the top of appdb pages$
|
||||
*/
|
||||
function make_cat_path($path)
|
||||
function make_cat_path($path, $appId = '', $versionId = '')
|
||||
{
|
||||
$str = "";
|
||||
$catCount = 0;
|
||||
@@ -198,11 +198,13 @@ function make_cat_path($path)
|
||||
$catCount++;
|
||||
}
|
||||
|
||||
if($_REQUEST['appId'])
|
||||
$str .= " > ".html_ahref(appIdToName($_REQUEST['appId']),"appview.php?appId=".$_REQUEST['appId']);
|
||||
if(!empty($appId))
|
||||
{
|
||||
$str .= " > ".html_ahref(appIdToName($appId),"appview.php?appId=$appId");
|
||||
|
||||
if($_REQUEST['versionId'])
|
||||
$str .= " > ".html_ahref(versionIdToName($_REQUEST['versionId']),"appview.php?appId=".$_REQUEST['appId']."&versionId=".$_REQUEST['versionId']);
|
||||
if(!empty($versionId))
|
||||
$str .= " > ".html_ahref(versionIdToName($versionId),"appview.php?appId=".$appId."&versionId=".$versionId);
|
||||
}
|
||||
|
||||
return $str;
|
||||
}
|
||||
|
||||
@@ -105,7 +105,6 @@ foreach ($cat_array_reversed as $i => $value)
|
||||
/******************************************************************/
|
||||
/* add to the list all of the sub sections of the current section */
|
||||
$cat = new Category($catId);
|
||||
$catFullPath = make_cat_path($cat->getCategoryPath());
|
||||
$subs = $cat->getCategoryList();
|
||||
|
||||
if($subs)
|
||||
|
||||
Reference in New Issue
Block a user