make_cat_path() make use of arguments instead of globals

This commit is contained in:
Paul van Schayck
2004-12-25 20:11:13 +00:00
committed by WineHQ
parent f5741ea108
commit 2c6592efbd
4 changed files with 14 additions and 13 deletions

View File

@@ -93,11 +93,11 @@ function get_screenshot_img($appId, $versionId="")
/** /**
* TODO: what does it do ? * TODO: what does it do ?
*/ */
function display_catpath($catId) function display_catpath($catId, $appId, $versionId = '')
{ {
$cat = new Category($catId); $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 html_frame_start("",'98%','',2);
echo "<p><b>Category: ". $catFullPath ."</b><br>\n"; echo "<p><b>Category: ". $catFullPath ."</b><br>\n";
echo html_frame_end(); echo html_frame_end();
@@ -275,7 +275,7 @@ if($appId && !$versionId)
apidb_header("Viewing App - ".$data->appName); apidb_header("Viewing App - ".$data->appName);
// cat display // cat display
display_catpath($app->data->catId); display_catpath($app->data->catId, $appId);
// set Vendor // set Vendor
$vendor = $app->getVendor(); $vendor = $app->getVendor();
@@ -449,7 +449,7 @@ else if($appId && $versionId)
apidb_header("Viewing App Version - ".$data->appName); apidb_header("Viewing App Version - ".$data->appName);
// cat // cat
display_catpath($app->data->catId); display_catpath($app->data->catId, $appId, $versionId);
// set URL // set URL
$appLinkURL = ($ver->webPage) ? "<a href='$ver->webPage'>".substr(stripslashes($ver->webPage),0,30)."</a>": "&nbsp;"; $appLinkURL = ($ver->webPage) ? "<a href='$ver->webPage'>".substr(stripslashes($ver->webPage),0,30)."</a>": "&nbsp;";

View File

@@ -42,11 +42,11 @@ function get_screenshot_img($appId, $versionId)
} }
function display_catpath($catId) function display_catpath($catId, $appId, $versionId = '')
{ {
$cat = new Category($catId); $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 html_frame_start("",'98%','',2);
echo "<p><b>Category: ". $catFullPath ."</b><br>\n"; echo "<p><b>Category: ". $catFullPath ."</b><br>\n";
echo html_frame_end(); echo html_frame_end();
@@ -173,7 +173,7 @@ if($appId)
apidb_header("Search for bugs in Bugzila for - ".$data->appName); apidb_header("Search for bugs in Bugzila for - ".$data->appName);
//cat display //cat display
display_catpath($app->data->catId); display_catpath($app->data->catId, $appId);
//set Vendor //set Vendor
$vendor = $app->getVendor(); $vendor = $app->getVendor();

View File

@@ -182,7 +182,7 @@ function versionIdToName($versionId)
/** /**
* create the Category: line at the top of appdb pages$ * create the Category: line at the top of appdb pages$
*/ */
function make_cat_path($path) function make_cat_path($path, $appId = '', $versionId = '')
{ {
$str = ""; $str = "";
$catCount = 0; $catCount = 0;
@@ -198,11 +198,13 @@ function make_cat_path($path)
$catCount++; $catCount++;
} }
if($_REQUEST['appId']) if(!empty($appId))
$str .= " &gt; ".html_ahref(appIdToName($_REQUEST['appId']),"appview.php?appId=".$_REQUEST['appId']); {
$str .= " &gt; ".html_ahref(appIdToName($appId),"appview.php?appId=$appId");
if($_REQUEST['versionId']) if(!empty($versionId))
$str .= " &gt; ".html_ahref(versionIdToName($_REQUEST['versionId']),"appview.php?appId=".$_REQUEST['appId']."&versionId=".$_REQUEST['versionId']); $str .= " &gt; ".html_ahref(versionIdToName($versionId),"appview.php?appId=".$appId."&versionId=".$versionId);
}
return $str; return $str;
} }

View File

@@ -105,7 +105,6 @@ foreach ($cat_array_reversed as $i => $value)
/******************************************************************/ /******************************************************************/
/* add to the list all of the sub sections of the current section */ /* add to the list all of the sub sections of the current section */
$cat = new Category($catId); $cat = new Category($catId);
$catFullPath = make_cat_path($cat->getCategoryPath());
$subs = $cat->getCategoryList(); $subs = $cat->getCategoryList();
if($subs) if($subs)