mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-13 18:27:35 +00:00
Bug 251050. Use installTrigger for install links.
This commit is contained in:
parent
a3b1eda480
commit
05db62bc34
@ -157,5 +157,53 @@ function uriparams() {
|
||||
return $uriparams;
|
||||
}
|
||||
|
||||
// -----------------------------
|
||||
// function installtrigger() -- print installtrigger function for extension/theme installation on page.
|
||||
// Usage null uriparams(string functionname)
|
||||
// -----------------------------
|
||||
|
||||
function installtrigger($functionname) {
|
||||
if ($functionname=="extensions") {
|
||||
echo'
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
|
||||
function install( aEvent, extName, iconURL) {
|
||||
var p = new XMLHttpRequest();
|
||||
p.open("GET", "'.$sitehostname.'/core/install.php?uri="+aEvent.target.href, false);
|
||||
p.send(null);
|
||||
|
||||
var params = new Array();
|
||||
params[extName] = {
|
||||
URL: aEvent.target.href,
|
||||
IconURL: iconURL,
|
||||
toString: function () { return this.URL; }
|
||||
};
|
||||
InstallTrigger.install(params);
|
||||
return false;
|
||||
}
|
||||
|
||||
-->
|
||||
</script>
|
||||
';
|
||||
|
||||
|
||||
} else if ($functionname=="themes") {
|
||||
echo'
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
function installTheme( aEvent, extName) {
|
||||
var p = new XMLHttpRequest();
|
||||
p.open("GET", "/core/install.php?uri="+aEvent.target.href, false);
|
||||
p.send(null);
|
||||
|
||||
InstallTrigger.installChrome(InstallTrigger.SKIN,aEvent.target.href,extName);
|
||||
return false;
|
||||
}
|
||||
-->
|
||||
</script>
|
||||
';
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -63,6 +63,8 @@ $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mys
|
||||
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/core/update.css">
|
||||
|
||||
<?php
|
||||
installtrigger("extensions");
|
||||
|
||||
include"$page_header";
|
||||
$type = "E";
|
||||
$category=$_GET["category"];
|
||||
@ -365,9 +367,9 @@ if (!$page or $page=="general") {
|
||||
<DIV class=\"moreinfoinstall\">";
|
||||
|
||||
if ($appname=="Thunderbird") {
|
||||
echo"<A HREF=\"install.php?id=$id&vid=$vid\" TITLE=\"Download $name $version (Right-Click to Download)\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float:left;\" ALT=\"\"> ( Download Now )</A><BR>";
|
||||
echo"<A HREF=\"/core/install.php?passthrough=yes&uri=$uri\" onclick=\"return install(event,'$name $version for Thunderbird', '/images/default.png');\" TITLE=\"Right-Click to Download $name $version\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float:left;\" ALT=\"\"> ( Download Now )</A><BR>";
|
||||
} else {
|
||||
echo"<A HREF=\"install.php/$filename?id=$id&vid=$vid\" TITLE=\"Install $name $version (Right-Click to Download)\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float:left;\" ALT=\"\"> ( Install Now )</A><BR>";
|
||||
echo"<a href=\"$uri\" onclick=\"return install(event,'$name $version', '/images/default.png');\" TITLE=\"Install $name $version (Right-Click to Download)\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float:left;\" ALT=\"\"> ( Install Now )</A><BR>";
|
||||
}
|
||||
|
||||
echo"<SPAN class=\"filesize\"> $filesize KB, ($time @ $speed"."k)</SPAN></DIV>";
|
||||
@ -526,7 +528,13 @@ if (!$page or $page=="general") {
|
||||
|
||||
//Icon Bar Modules
|
||||
echo"<DIV style=\"height: 34px\">";
|
||||
echo"<DIV class=\"iconbar\"><A HREF=\"install.php/$filename?id=$id&vid=$vid\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 TITLE=\"Install $name (Right-Click to Download)\" ALT=\"\">Install</A><BR><SPAN class=\"filesize\">Size: $filesize kb</SPAN></DIV>";
|
||||
echo"<DIV class=\"iconbar\">";
|
||||
if ($appname=="Thunderbird") {
|
||||
echo"<A HREF=\"/core/install.php?passthrough=yes&uri=$uri\" onclick=\"return install(event,'$name $version for Thunderbird', '/images/default.png');\">";
|
||||
} else {
|
||||
echo"<a href=\"$uri\" onclick=\"return install(event,'$name $version', '/images/default.png');\">";
|
||||
}
|
||||
echo"<IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 TITLE=\"Install $name (Right-Click to Download)\" ALT=\"\">Install</A><BR><SPAN class=\"filesize\">Size: $filesize kb</SPAN></DIV>";
|
||||
echo"<DIV class=\"iconbar\"><IMG SRC=\"/images/".strtolower($appname)."_icon.png\" BORDER=0 HEIGHT=34 WIDTH=34 ALT=\"\"> For $appname:<BR> $minappver - $maxappver</DIV>";
|
||||
if($osname !=="ALL") {
|
||||
echo"<DIV class=\"iconbar\"><IMG SRC=\"/images/".strtolower($osname)."_icon.png\" BORDER=0 HEIGHT=34 WIDTH=34 ALT=\"\">For $osname<BR>only</DIV>";
|
||||
@ -786,6 +794,7 @@ if ($num_pages>1) {
|
||||
|
||||
</DIV>
|
||||
<?php
|
||||
|
||||
} // End Pages
|
||||
|
||||
echo"</DIV>\n";
|
||||
|
@ -97,6 +97,8 @@ echo"<link rel=\"alternate\" type=\"application/rss+xml\" title=\"RSS\" href=\"h
|
||||
|
||||
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/core/update.css">
|
||||
<?php
|
||||
installtrigger("extensions");
|
||||
|
||||
include"$page_header";
|
||||
|
||||
// -----------------------------------------------
|
||||
@ -391,9 +393,9 @@ echo"<BR>";
|
||||
echo"<DIV style=\"margin-top: 30px; height: 34px\">";
|
||||
echo"<DIV class=\"iconbar\">";
|
||||
if ($appname=="Thunderbird") {
|
||||
echo"<A HREF=\"moreinfo.php?".uriparams()."&id=$id\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 TITLE=\"More Info about $name\" ALT=\"\">More Info</A>";
|
||||
echo"<A HREF=\"moreinfo.php?".uriparams()."&id=$id\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 TITLE=\"More Info about $name\" ALT=\"\">More Info</A>";
|
||||
} else {
|
||||
echo"<A HREF=\"install.php/$filename?id=$id&vid=$vid\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 TITLE=\"Install $name\" ALT=\"\">Install</A>";
|
||||
echo"<a href=\"$uri\" onclick=\"return install(event,'$name $version', '/images/default.png');\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 TITLE=\"Install $name\" ALT=\"\">Install</A>";
|
||||
}
|
||||
echo"<BR><SPAN class=\"filesize\"> $filesize kb</SPAN></DIV>";
|
||||
echo"<DIV class=\"iconbar\"><IMG SRC=\"/images/".strtolower($appname)."_icon.png\" BORDER=0 HEIGHT=34 WIDTH=34 ALT=\"\"> For $appname:<BR> $minappver - $maxappver</DIV>";
|
||||
|
@ -67,6 +67,8 @@ $pagetitle = $pagetitles[$_GET["page"]];
|
||||
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/core/update.css">
|
||||
|
||||
<?php
|
||||
installtrigger("themes");
|
||||
|
||||
include"$page_header";
|
||||
$type = "T";
|
||||
$category=$_GET["category"];
|
||||
@ -322,9 +324,9 @@ echo"
|
||||
<SPAN style=\"itemdescription\">Released on $verdateadded</SPAN><BR>
|
||||
<DIV class=\"moreinfoinstall\">";
|
||||
if ($appname=="Thunderbird") {
|
||||
echo"<A HREF=\"install.php?id=$id&vid=$vid\" TITLE=\"Download $name $version\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float:left;\" ALT=\"\"> ( Download Now )</A><BR>";
|
||||
echo"<A HREF=\"/core/install.php?passthrough=yes&uri=$uri\" onclick=\"return installTheme(event,'$name $version for Thunderbird');\" TITLE=\"Right-Click to Download $name $version\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float:left;\" ALT=\"\"> ( Download Now )</A><BR>";
|
||||
} else {
|
||||
echo"<A HREF=\"javascript:void(InstallTrigger.installChrome(InstallTrigger.SKIN,'$uri','$name'))\" TITLE=\"Install $name $version (Right-Click to Download)\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float:left;\" ALT=\"\"> ( Install Now )</A><BR>";
|
||||
echo"<a href=\"$uri\" onclick=\"return installTheme(event,'$name $version');\" TITLE=\"Install $name $version (Right-Click to Download)\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 STYLE=\"float:left;\" ALT=\"\"> ( Install Now )</A><BR>";
|
||||
}
|
||||
echo"
|
||||
<SPAN class=\"filesize\"> $filesize KB, ($time @ $speed"."k)</SPAN></DIV>
|
||||
@ -345,7 +347,7 @@ echo"<BR>";
|
||||
|
||||
if ($application=="thunderbird") {
|
||||
echo"<SPAN style=\"font-size: 10pt; color: #00F\">Theme Install Instructions for Thunderbird Users:</SPAN><BR>
|
||||
<SPAN style=\"font-size: 8pt;\">(1) Click the link above to Download and save the file to your hard disk.<BR>
|
||||
<SPAN style=\"font-size: 8pt;\">(1) Right-Click the link above to Download and save the file to your hard disk.<BR>
|
||||
(2) In Mozilla Thunderbird, open the theme manager (Tools Menu/Themes)<BR>
|
||||
(3) Click the Install button, and locate/select the file you downloaded and click \"OK\"</SPAN><BR>
|
||||
";
|
||||
@ -469,7 +471,12 @@ if ($notes) {echo"$notes<br><br>\n"; }
|
||||
//Icon Bar Modules
|
||||
echo"<DIV style=\"height: 34px\">";
|
||||
echo"<DIV class=\"iconbar\">";
|
||||
echo"<A HREF=\"javascript:void(InstallTrigger.installChrome(InstallTrigger.SKIN,'$uri','$name'))\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 TITLE=\"Install $name\" ALT=\"\">Install</A><BR><SPAN class=\"filesize\">Size: $filesize kb</SPAN></DIV>";
|
||||
if ($appname=="Thunderbird") {
|
||||
echo"<A HREF=\"/core/install.php?passthrough=yes&uri=$uri\" onclick=\"return installTheme(event,'$name $version for Thunderbird');\" TITLE=\"Download $name $version (Right-Click to Download)\">";
|
||||
} else {
|
||||
echo"<a href=\"$uri\" onclick=\"return installTheme(event,'$name $version');\">";
|
||||
}
|
||||
echo"<IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 TITLE=\"Install $name\" ALT=\"\">Install</A><BR><SPAN class=\"filesize\">Size: $filesize kb</SPAN></DIV>";
|
||||
echo"<DIV class=\"iconbar\"><IMG SRC=\"/images/".strtolower($appname)."_icon.png\" BORDER=0 HEIGHT=34 WIDTH=34 ALT=\"\"> For $appname:<BR> $minappver - $maxappver</DIV>";
|
||||
if($osname !=="ALL") { echo"<DIV class=\"iconbar\"><IMG SRC=\"/images/".strtolower($osname)."_icon.png\" BORDER=0 HEIGHT=34 WIDTH=34 ALT=\"\">For $osname<BR>only</DIV>"; }
|
||||
echo"</DIV><BR>\n";
|
||||
|
@ -97,6 +97,8 @@ echo"<link rel=\"alternate\" type=\"application/rss+xml\" title=\"RSS\" href=\"h
|
||||
|
||||
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/core/update.css">
|
||||
<?php
|
||||
installtrigger("themes");
|
||||
|
||||
include"$page_header";
|
||||
|
||||
// -----------------------------------------------
|
||||
@ -392,9 +394,9 @@ echo"<BR>";
|
||||
echo"<DIV style=\"margin-top: 30px; height: 34px\">";
|
||||
echo"<DIV class=\"iconbar\">";
|
||||
if ($appname=="Thunderbird") {
|
||||
echo"<A HREF=\"moreinfo.php?".uriparams()."&id=$id\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 TITLE=\"More Info about $name\" ALT=\"\">More Info</A>";
|
||||
echo"<A HREF=\"moreinfo.php?".uriparams()."&id=$id\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 TITLE=\"More Info about $name\" ALT=\"\">More Info</A>";
|
||||
} else {
|
||||
echo"<A HREF=\"javascript:void(InstallTrigger.installChrome(InstallTrigger.SKIN,'$uri','$name'))\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 TITLE=\"Install $name\" ALT=\"\">Install</A>";
|
||||
echo"<a href=\"$uri\" onclick=\"return installTheme(event,'$name $version');\"><IMG SRC=\"/images/download.png\" BORDER=0 HEIGHT=34 WIDTH=34 TITLE=\"Install $name\" ALT=\"\">Install</A>";
|
||||
}
|
||||
echo"<BR><SPAN class=\"filesize\"> $filesize kb</SPAN></DIV>";
|
||||
echo"<DIV class=\"iconbar\"><IMG SRC=\"/images/".strtolower($appname)."_icon.png\" BORDER=0 HEIGHT=34 WIDTH=34 ALT=\"\"> For $appname:<BR> $minappver - $maxappver</DIV>";
|
||||
|
Loading…
Reference in New Issue
Block a user