Jeremy Newman : move menu to htmlmenu so filename matches classname
Jeremy Newman
jnewman at winehq.org
Mon Nov 21 08:38:07 CST 2016
Module: appdb
Branch: master
Commit: 3a51c4a8b93179f0d314e07feff7f5d100912f83
URL: http://source.winehq.org/git/appdb.git/?a=commit;h=3a51c4a8b93179f0d314e07feff7f5d100912f83
Author: Jeremy Newman <jnewman at codeweavers.com>
Date: Mon Nov 14 14:52:24 2016 -0600
move menu to htmlmenu so filename matches classname
set method propery visibility
update constructor
cleanup
---
include/htmlmenu.php | 47 +++++++++++++++++++++++++++++++++++++++++++++++
include/menu.php | 46 ----------------------------------------------
2 files changed, 47 insertions(+), 46 deletions(-)
diff --git a/include/htmlmenu.php b/include/htmlmenu.php
new file mode 100644
index 0000000..3bb9222
--- /dev/null
+++ b/include/htmlmenu.php
@@ -0,0 +1,47 @@
+<?php
+/**
+ * htmlmenu
+ * simple menu rendering
+ */
+class htmlmenu
+{
+ // constructor
+ public function __construct($name, $form = null)
+ {
+ if (!empty($form))
+ echo "<form action=\"$form\" method=\"post\">\n";
+ echo '<li class="top"><p>'.$name.'</p></li>';
+ }
+
+ // add a table row
+ public function add($sName, $shUrl = null, $sAlign = "left")
+ {
+ $oTableRow = new TableRow();
+
+ if($shUrl)
+ {
+ echo "<li><p><a href=\"{$shUrl}\">{$sName}</a></p></li>\n";
+ }
+ else
+ {
+ echo "<li><p>{$sName}</a></li>\n";
+ }
+ }
+
+ // add misc row
+ public function addmisc($sStuff, $sAlign = "left")
+ {
+ echo "<li><p style=\"text-align: $sAlign\">$sStuff</p></li>\n";
+ }
+
+ // menu complete
+ public function done($form = null)
+ {
+ echo '<li class="bot"></li>';
+
+ if (!empty($form))
+ echo "</form>\n";
+ }
+}
+// done
+?>
diff --git a/include/menu.php b/include/menu.php
deleted file mode 100644
index dfa6fc2..0000000
--- a/include/menu.php
+++ /dev/null
@@ -1,46 +0,0 @@
-<?php
-class htmlmenu {
-
- function htmlmenu($name, $form = null)
- {
-
- if ($form)
- echo "<form action=\"$form\" method=\"post\">\n";
-
- echo '
- <li class="top"><p>'.$name.'</p></li>
-';
-
- }
-
- /* add a table row */
- function add($sName, $shUrl = null, $sAlign = "left")
- {
- $oTableRow = new TableRow();
-
- if($shUrl)
- {
- echo " <li><p><a href=\"{$shUrl}\">{$sName}</a></p></li>\n";
- }
- else
- {
- echo " <li><p>{$sName}</a></li>\n";
- }
- }
-
- function addmisc($sStuff, $sAlign = "left")
- {
- echo "<li><p style=\"text-align: $sAlign\">$sStuff</p></li>\n";
- }
-
- function done($form = null)
- {
- echo '
- <li class="bot"></li>
-';
-
- if ($form)
- echo "</form>\n";
- }
-}
-?>
More information about the wine-cvs
mailing list