[PATCH 1/3 (whome)] Add support for dockapps not hosted in the git repository.

Doug Torrance <[email protected]>
Newsgroups gmane.compw.window-managers.windowmaker.devel
Message-ID <[email protected]>
Whether a dockapp is hosted or not is determined by the new "hosted" field
in dockapps.db (1 = hosted, 0 = not hosted);
---
 dockapps/index.php | 51 ++++++++++++++++++++++++++++++++-------------------
 1 file changed, 32 insertions(+), 19 deletions(-)

diff --git a/dockapps/index.php b/dockapps/index.php
index e157fde..d9d8aeb 100644
--- a/dockapps/index.php
+++ b/dockapps/index.php
@@ -38,14 +38,19 @@ include("../header.php");?>
 <h1><a href=".">Dockapps</a></h1>
 <?php
 if ($name) {
+	$hosted = $dockapps[$name]["hosted"];
 	echo "<h2>$name</h2>\n";
 	echo "<b>Category:</b> <a href=\"?category=" .
 		$dockapps[$name]["category"] . "\">" .
 		$dockapps[$name]["category"] .
 		"</a><br/>\n";
-	if ($dockapps[$name]["url"])
-		echo "<b>Original Website</b>: <a href=\"" . $dockapps[$name]["url"] .
+	if ($dockapps[$name]["url"]) {
+		echo "<b>";
+		if ($hosted)
+			echo "Original ";
+		echo "Website</b>: <a href=\"" . $dockapps[$name]["url"] .
 			"\">" . $dockapps[$name]["url"] . "</a><br/>\n";
+	}
 	echo "<b>Description:</b> " . nl2br($dockapps[$name]["description"]) .
 		"<br/>\n";
 	$images = explode(",", $dockapps[$name]["image"]);
@@ -54,24 +59,30 @@ if ($name) {
 		foreach ($images as $image)
 			echo "<img src=\"img/$image\"/>\n";
 	}
-	echo "<h3>Available Versions:</h3>\n";
-	$versions = array();
-	$info = $dockapps[$name];
-	foreach ($info as $key => $value) {
-		if (substr($key, 0, 8) == "version-")
-			array_push($versions,
-				   substr($key, strrpos($key, "-")+1));
-	}
-	foreach ($versions as $version) {
-		echo "<a href=\"?download=$name-$version.tar.gz\">" .
+	if ($hosted) {
+		echo "<h3>Available Versions:</h3>\n";
+		$versions = array();
+		$info = $dockapps[$name];
+		foreach ($info as $key => $value) {
+			if (substr($key, 0, 8) == "version-")
+				array_push($versions,
+				substr($key, strrpos($key, "-")+1));
+		}
+		foreach ($versions as $version) {
+			echo "<a href=\"?download=$name-$version.tar.gz\">" .
 			"$name-$version</a><br/>\n";
-
-	}?>
+		}
+		echo "<p/>\n<i>Note:</i>  By default, the above tarballs will ";
+		echo "save as dockapps-$string.tar.gz, where $string is a ";
+		echo "long string of hexadecimal characters.  You may wish to ";
+		echo "right click and use the <i>Save Link As...</i> option.\n";
+	} else {
+		echo "<p/>\nThis dockapp is not maintained by the Window ";
+		echo "Maker Developers Team.	Please visit the dockapp's ";
+		echo "website for downloads.\n";
+	}
+?>
 <p/>
-<i>Note:</i>  By default, the above tarballs will save as
-dockapps-$string.tar.gz, where $string is a long string of hexadecimal
-characters.  You may wish to right click and use the <i>Save Link As...</i>
-option.
 
 <?php
 } else if ($category) {
@@ -93,7 +104,9 @@ the Window Maker Developers Team.  You can browse the repository itself at
 <p/>
 If you would like to submit a patch to an existing dockapp or add a new dockapp
 to the repository, please follow <a href="http://repo.or.cz/w/wmaker-crm.git/blob/HEAD:/The-perfect-Window-Maker-patch.txt">these directions</a>.
-
+<p/>
+Some of the dockapps listed are not maintained by the Window Maker Developers
+Team.  You may download these dockapps at their respective websites.
 <h2>Categories</h2>
 <?php
 	$categories = array_unique(array_map("getCategory", $dockapps));
-- 
2.1.4


-- 
To unsubscribe, send mail to [email protected].
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.