port from perforce
This commit is contained in:
103
web/dialog.php
Normal file
103
web/dialog.php
Normal file
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
|
||||
function Dialog($as_Title, $as_Content, $ab_Dots = true)
|
||||
{
|
||||
?>
|
||||
<table class="dialog">
|
||||
<tr>
|
||||
<td class="tl"></td>
|
||||
<td class="tc"><?php if ($ab_Dots) echo "::";?> <?php echo $as_Title; ?></td>
|
||||
<td class="tr"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="lc"></td>
|
||||
<td class="c"><?php echo $as_Content; ?></td>
|
||||
<td class="rc"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="bl"></td>
|
||||
<td class="bc"></td>
|
||||
<td class="br"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
|
||||
function ProfileDialog($as_Title, $as_Picture, $as_Content)
|
||||
{
|
||||
$ls_Content = "
|
||||
<table class=\"profile\">
|
||||
<tr>
|
||||
<td><img style=\"width:200px;\" src=\"$as_Picture\"></img></td>
|
||||
<td class=\"content\">$as_Content</td>
|
||||
</tr>
|
||||
</table>";
|
||||
Dialog($as_Title, $ls_Content);
|
||||
}
|
||||
|
||||
function StringList($as_Items_)
|
||||
{
|
||||
$ls_Result = "<table class=\"string-list\">";
|
||||
foreach ($as_Items_ as $ls_Index => $ls_Value)
|
||||
{
|
||||
$ls_Result .= "<tr><td class=\"list-item\">$ls_Index:</td><td>$ls_Value</td></tr>";
|
||||
}
|
||||
$ls_Result .= "</table>";
|
||||
return $ls_Result;
|
||||
}
|
||||
|
||||
function GuestBook($as_Items_)
|
||||
{
|
||||
if (!is_array($as_Items_))
|
||||
return "There are no entries in our guestbook yet!";
|
||||
|
||||
$ls_Result = "<table class=\"guestbook\">";
|
||||
foreach ($as_Items_ as $ls_Entry_)
|
||||
{
|
||||
$ls_Result .= "<tr><td class=\"guest-date\">:: {$ls_Entry_["date"]}</td><td class=\"guest-poster\">{$ls_Entry_["poster"]}</td></tr><tr><td class=\"guest-text\" colspan=\"2\">{$ls_Entry_["text"]}</td></tr>";
|
||||
}
|
||||
$ls_Result .= "</table>";
|
||||
return $ls_Result;
|
||||
}
|
||||
|
||||
function GuestForm()
|
||||
{
|
||||
$ls_Result = "<form id=\"guestform\" name=\"guestform\"><table id=\"gbform\" class=\"form\">";
|
||||
$ls_Result .= "<tr><td class=\"label\">Handle:</td><td><input type=\"text\" id=\"poster\" name=\"poster\"></input></td></tr>";
|
||||
$ls_Result .= "<tr><td class=\"label\">Text:</td><td><textarea id=\"text\" name=\"text\"></textarea></td></tr>";
|
||||
$ls_Result .= "<tr><td class=\"submit\" colspan=\"2\"><a href=\"javascript:gbsubmit();\">post</a></td></tr>";
|
||||
$ls_Result .= "</table></form>";
|
||||
return $ls_Result;
|
||||
}
|
||||
|
||||
function UrlBar($as_Items_)
|
||||
{
|
||||
$ls_Result = "<div class=\"url-bar\">";
|
||||
$ls_Urls_ = array();
|
||||
foreach ($as_Items_ as $ls_Index => $ls_Value)
|
||||
{
|
||||
$ls_Urls_[] = "<a href=\"$ls_Index\">$ls_Value</a>";
|
||||
}
|
||||
$ls_Result .= implode(" :: ", $ls_Urls_);
|
||||
$ls_Result .= "</div>";
|
||||
return $ls_Result;
|
||||
}
|
||||
|
||||
function MusicEntry($as_Items_)
|
||||
{
|
||||
$ls_Player = "<object width=\"17\" height=\"17\" data=\"musicplayer.swf?&b_bgcolor=ffffff&b_fgcolor=000000&b_colors=,,,ff0000&\" type=\"application/x-shockwave-flash\"><param value=\"musicplayer.swf?&b_bgcolor=ffffff&b_fgcolor=000000&b_colors=,,,ff0000&\" name=\"movie\"/><param value=\"transparent\" name=\"wmode\"/><param value=\"high\" name=\"quality\"/><param value=\"song_url={$as_Items_["url"]}\" name=\"FlashVars\"/><embed width=\"17\" height=\"17\" flashvars=\"song_url={$as_Items_["url"]}\" src=\"musicplayer.swf?&b_bgcolor=ffffff&b_fgcolor=000000&b_colors=,,,ff0000&\"/></object>";
|
||||
|
||||
Dialog("<table class=\"music\"><tr><td>:: " . $as_Items_["title"] . " (" . $as_Items_["duration"] . ")</td><td class=\"player\">" . $ls_Player . "</td></tr></table>", StringList($as_Items_["description"]), false);
|
||||
}
|
||||
|
||||
function Email($as_User)
|
||||
{
|
||||
return '<a href="javascript:location=\'mailto:' . $as_User . '\u0040\u0062\u006c\u0075\u002d\u0066\u006c\u0061\u006d\u0065\u002e\u006f\u0072\u0067\';void 0"><script type="text/javascript">document.write(\'' . $as_User . '\u0040\u0062\u006c\u0075\u002d\u0066\u006c\u0061\u006d\u0065\u002e\u006f\u0072\u0067\')</script></a>';
|
||||
}
|
||||
|
||||
function Url($as_Href)
|
||||
{
|
||||
return "<a href=\"$as_Href\">$as_Href</a>";
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user