File:  [mozdev] / cdn / www / pxHlp_ext / extensionSetup.html
Revision 1.3: download - view: text, annotated - select for diffs - revision graph
Mon Feb 17 00:20:03 2003 UTC (16 years, 11 months ago) by cdn
Branches: MAIN
CVS tags: HEAD
php

    1: <?php
    2: 
    3: // $Id: extensionSetup.html,v 1.3 2003/02/17 00:20:03 cdn Exp $
    4: 
    5: // Functions needed for an XPI install
    6: // Simplified version of Chris Cooks' install script
    7: 
    8: /*
    9: function doneFn(name,result) {}
   10: 
   11: function isValidUa() {
   12:   // Returns true if script is run in the Phoenix browser
   13:   
   14:   var ua=navigator.userAgent.toLowerCase();
   15:   if(ua.indexOf('gecko')!=-1 && ua.indexOf('phoenix')!=-1) {
   16:       return true;
   17:   }
   18:   return false;
   19: }
   20: 
   21: function doXPIInstall(file,name) {
   22:   if(!isValidUa()) {
   23:   	alert('This extension is not supported by your browser.');
   24:   	return false;
   25:   }
   26:   var xpi = new Object();
   27:   xpi[name] = file;
   28:   InstallTrigger.install(xpi,doneFn);
   29: }
   30: */
   31: 
   32: // here down js->php
   33: 
   34: /*
   35: function checkDateWindow(dateString) { // Input string of yyyy-mm-dd
   36:   var newDaysWindow = 7 * (1000 * 60 * 60 * 24); // Only new for 7 days
   37:   var dateArray = dateString.split('-');
   38:   var newDate = (new Date( dateArray[0], dateArray[1] - 1, dateArray[2])).valueOf() + newDaysWindow;
   39:   return ( newDate > (new Date()).valueOf() );
   40: }
   41: */
   42: 
   43: $extensionArray = array();
   44: 
   45: /*
   46: function makeExtensionGrid() {
   47:   if (extensionArray.length == 0) {
   48:     document.write('<p><b><i>A <a href="javascript:">JavaScript Error</a> has probably occurred</i></b></p>');
   49:   }
   50:   document.write('<ul>');
   51:   for (var i = 0; i < extensionArray.length; i++) {
   52:     document.write('<div>');
   53:     document.write('<li><a href="#');
   54:     document.write(escape(extensionArray[i].name));
   55:     document.write('">');
   56:     document.write(extensionArray[i].name);
   57:     document.write('</a></li>');
   58:   }
   59:   document.write('</ul>');
   60: }
   61: 
   62: function listExtensions() {
   63: 	document.write('<p>This list contains most known Phoenix Extensions. There are currently ' + extensionArray.length + ' extensions available here.</p>');
   64:   for (var i = 0; i < extensionArray.length; i++) {
   65:     document.write('<a name="');
   66:     document.write(extensionArray[i].name);
   67:     document.write('"></a>');
   68:     document.write('<table class="extensions"><thead><tr><td colspan="4">');
   69:     document.write(extensionArray[i].name);
   70:     document.write('</td></tr></thead>');
   71:     document.write('<tbody><tr>');
   72:     document.write('<td class="label">Size:</td><td class="size">');
   73:     document.write(extensionArray[i].size);
   74:     document.write(' KB</td>');
   75:     document.write('<td class="label">Author:</td><td>');
   76:     for (var j=0; j < extensionArray[i].author.length; j++) {
   77:       if (j > 0 && extensionArray[i].author.length > 1 ) {
   78:         document.write(', ');
   79:       }
   80:       if (extensionArray[i].authorEmail[j] != '') {
   81:         document.write('<a href="mailto:');
   82:         document.write(extensionArray[i].authorEmail[j]);
   83:         document.write('">');
   84:       }
   85:       document.write(extensionArray[i].author[j]);
   86:       if (extensionArray[i].authorEmail[j] != '') {
   87:         document.write('</a>');
   88:       }
   89:     }
   90:     document.write('</td></tr><tr><td class="label">Install:</td><td><a href="');
   91:     document.write(extensionArray[i].installFile);
   92:     document.write('">Click Here</a></td><td class="label">Homepage:</td><td>');
   93:     if (extensionArray[i].homepage != '') {
   94:       document.write('<a href="');
   95:       document.write(extensionArray[i].homepage);
   96:       document.write('">');
   97:       document.write(extensionArray[i].homepage);
   98:       document.write('</a>');
   99:     }
  100:     else {
  101:       document.write('N/A');
  102:     }
  103:     document.write('</td></tr><tr><td colspan="4">');
  104:     document.write(extensionArray[i].description);
  105:     document.write('</td></tr></tbody></table>');
  106:   }
  107: }
  108: */
  109: 
  110: function listExtensions()
  111: {
  112: 
  113:   $ret = '<p>This list contains most known Phoenix Extensions. There are currently ' . count($extensionArray) . ' extensions available here.</p>';
  114: 
  115:   return $ret;
  116: 
  117: }
  118: 
  119: ?>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>