コード例 #1
0
ファイル: go-pear.php プロジェクト: pankajit/carumba
function displayHTML($page = 'Welcome', $data = array())
{
    global $pfc_packages;
    displayHTMLHeader();
    ?>
<a name="TOP" /></a>
<table border="0" cellspacing="0" cellpadding="0" height="48" width="100%">
  <tr bgcolor="#339900">
    <td align="left" width="120">
      <img src="<?php 
    echo basename(__FILE__);
    ?>
?action=img&amp;img=pearlogo" width="104" height="50" vspace="2" hspace="5" alt="PEAR">
    </td>
    <td align="left" valign="middle" width="20">
      &nbsp;
    </td>
    <td align="left" valign="middle">
      <span class="Headline">Go-PEAR</span>
    </td>
  </tr>

  <tr bgcolor="#003300"><td colspan="3"></td></tr>

  <tr bgcolor="#006600">
    <td align="right" valign="top" colspan="3">
        <span style="color: #ffffff">Version <?php 
    echo GO_PEAR_VER;
    ?>
</span>&nbsp;<br />
    </td>
  </tr>

  <tr bgcolor="#003300"><td colspan="3"></td></tr>
</table>


<table cellpadding="0" cellspacing="0" width="100%">
 <tr valign="top">
  <td bgcolor="#f0f0f0" width="100">
   <table width="200" border="0" cellpadding="4" cellspacing="0">
    <tr valign="top">
     <td style="font-size: 90%" align="left" width="200">
       <br><br>
       <img src="<?php 
    echo basename(__FILE__);
    ?>
?action=img&amp;img=smallpear" border="0">
	   <a href="<?php 
    echo basename(__FILE__);
    ?>
?step=Welcome&restart=1" <?php 
    if ($page == 'Welcome') {
        echo ' class="green"';
    }
    ?>
>
	     Welcome to Go-PEAR
	   </a><br/>

       <img src="<?php 
    echo basename(__FILE__);
    ?>
?action=img&amp;img=smallpear" border="0">
	   <a href="<?php 
    echo basename(__FILE__);
    ?>
?step=config" <?php 
    if ($page == 'config') {
        echo ' class="green"';
    }
    ?>
>
	     Configuration
	   </a><br/>

       <img src="<?php 
    echo basename(__FILE__);
    ?>
?action=img&amp;img=smallpear" border="0">
<?php 
    if ($page == 'install') {
        echo '<span class="green">';
    }
    ?>
 	     Complete installtion<br/>
<?php 
    if ($page == 'install') {
        echo '</span>';
    }
    ?>

     </td>
    </tr>
   </table>
  </td>
  <td bgcolor="#cccccc" width="1" background="/gifs/checkerboard.gif"></td>
  <td>
   <table width="100%" cellpadding="10" cellspacing="0">
    <tr>
     <td valign="top">

<table border="0">
<tr>
  <td width="20">
  </td>
  <td>
<?php 
    if ($page == 'error') {
        ?>
			<span class="title">Error</span><br/>
			<br/>
<?php 
        $value = $data;
        if (preg_match('/ok$/', $value)) {
            $value = preg_replace('/(ok)$/', '<span class="green">\\1</span>', $value);
        }
        if (preg_match('/failed$/', $value)) {
            $value = preg_replace('/(failed)$/', '<span style="color: #ff0000">\\1</span>', $value);
        }
        if (preg_match('/^install ok:/', $value)) {
            $value = preg_replace('/^(install ok:)/', '<span class="green">\\1</span>', $value);
        }
        if (preg_match('/^Warning:/', $value)) {
            $value = '<span style="color: #ff0000">' . $value . '</span>';
        }
        echo nl2br($value);
    } elseif ($page == 'Welcome') {
        ?>
			<span class="title">Welcome to go-pear <?php 
        echo GO_PEAR_VER;
        ?>
!</span><br/>
			<br/>
			Go-pear will install the Web Frontend of the PEAR Installer and all the needed <br/>
			files. This frontend is your tool for PEAR installation and maintenance.<br/>
			<br/>
			Go-pear also lets you download and install the PEAR packages bundled<br/>
			with PHP: <?php 
        echo implode(', ', $GLOBALS['pfc_packages']);
        ?>
.<br/>
			<br/>
			<a href="<?php 
        echo basename(__FILE__);
        ?>
?step=config" class="green">Next &gt;&gt;</a>
<?php 
    } elseif ($page == 'config') {
        if (!empty($GLOBALS['http_proxy'])) {
            list($proxy_host, $proxy_port) = explode(':', $GLOBALS['http_proxy']);
        } else {
            $proxy_host = $proxy_port = '';
        }
        ?>
			<form action="<?php 
        echo basename(__FILE__);
        ?>
?step=install" method="post">
			<span class="title">Configuration</span><br/>
			<br/>
			HTTP proxy (host:port):
			<input type="text" name="proxy[host]" value="<?php 
        echo $proxy_host;
        ?>
">
			<input type="text" name="proxy[port]" value="<?php 
        echo $proxy_port;
        ?>
" size="6">
			<br/><br/><hr/><br/>
			Below is a suggested file layout for your new PEAR installation. <br/>
			<br/>
			<table border="0">
			  <TR>
			    <TD valign="top"><img src="<?php 
        echo basename(__FILE__);
        ?>
?action=img&amp;img=note" border="0"></TD>
				<TD>
		  		  <span class="green">
			        <b>Note:</b> Make sure that PHP has the permission to access the specified<br/>
			        directories.<br/><br/>
			      </span>
                </TD>
			  </TR>
			</table>
			<TABLE border="0">
<?php 
        // Display error messages
        if (isset($GLOBALS['www_errors']) && sizeof($GLOBALS['www_errors'])) {
            $www_errors = $GLOBALS['www_errors'];
            echo "<tr><td>";
            echo '<span class="red">ERROR(S):</span>';
            echo "</td></tr>";
            foreach ($www_errors as $n => $var) {
                echo "<tr><td>";
                echo '<span class="red">' . $GLOBALS['config_desc'][$n] . ': </span>';
                echo "</td><td>";
                echo '<span class="red">' . $www_errors[$n] . '</span>';
                echo "<br>\n";
                echo "</td></tr>\n";
            }
        }
        foreach ($GLOBALS['config_vars'] as $n => $var) {
            printf('<tr><td>%d. %s</td><td><input type="text" name="config[%s]" value="%s"></td></tr>', $n, $GLOBALS['config_desc'][$var], $var, $GLOBALS[$var]);
        }
        ?>
			</TABLE>
			<br/><hr/><br/>
			The following PEAR packages are common ones, and can be installed<br/>
			by go-pear too: <br/>
<?php 
        echo implode(', ', $GLOBALS['pfc_packages']);
        ?>
			.<br/>
			<input type="checkbox" name="install_pfc" <?php 
        if ($GLOBALS['install_pfc']) {
            echo 'checked';
        }
        ?>
> Install those too<br/>
			<br/><br/>
			<table border="0">
			  <TR>
			    <TD valign="top"><img src="<?php 
        echo basename(__FILE__);
        ?>
?action=img&amp;img=note" border="0"></TD>
				<TD>
		  		  <span class="green">
					  <b>Note:</b> Installation might take some time, because go-pear has to download<br/>
					  all needed files from pear.php.net. Just be patient and wait for the next<br/>
					  page to load.<br/>
			      </span>
                </TD>
			  </TR>
			</table>
			<br>
			<input type="checkbox" name="BCmode" id="BCmode" checked> Compatibility-Mode for old non-DOM Browsers<br/>
			<script type="text/javascript">
			<!--
				if (document.getElementById('BCmode')) {
					document.getElementById('BCmode').checked = 0;
				};
			// -->
			</script>

<?php 
        if (WINDOWS && phpversion() == '4.1.1') {
            ?>
					<table border="0">
					  <TR>
					    <TD valign="top"><img src="<?php 
            echo basename(__FILE__);
            ?>
?action=img&amp;img=note" border="0"></TD>
						<TD>
				  		  <span style="color: #ff0000">
							  <b>Warning:</b> Your PHP version (4.1.1) might be imcompatible with go-pear due to a bug<br/>
							  in your PHP binary. If the installation crashes you might want to update your PHP version.</br>
					      </span>
		                </TD>
					  </TR>
					</table>
<?php 
        }
        ?>
			<br/>
			<input type="submit" value="Install" onClick="javascript: submitButton.value='Downloading and installing ... please wait ...'" name="submitButton">
			</form>
<?php 
    } elseif ($page == 'install') {
        ?>
			<span class="title">Installation Complete - Summary</span><br/>
<?php 
        displayHTMLInstallationSummary($data);
    } elseif ($page == 'preinstall') {
        ?>
			<span class="title">Installation in progress ...</span><br/>
			<br/>
			<script language="javascript">
			<!--

				var progress;
				var downlodprogress;
				progress = 0;
				downloadprogress = 0;

				function setprogress(value)
				{
					progress = value;

					prog = document.getElementById('installation_progress');
					prog.innerHTML = progress + " %";
					progress2 = progress / 10;
					progress2 = Math.floor(progress2);
					for (i=0; i < 10; i++)
						document.getElementById('progress_cell_'+i).style.backgroundColor = "#cccccc";
					switch(progress2)
					{
						case 10:
							document.getElementById('progress_cell_9').style.backgroundColor = "#006600";
						case  9:
							document.getElementById('progress_cell_8').style.backgroundColor = "#006600";
						case  8:
							document.getElementById('progress_cell_7').style.backgroundColor = "#006600";
						case  7:
							document.getElementById('progress_cell_6').style.backgroundColor = "#006600";
						case  6:
							document.getElementById('progress_cell_5').style.backgroundColor = "#006600";
						case  5:
							document.getElementById('progress_cell_4').style.backgroundColor = "#006600";
						case  4:
							document.getElementById('progress_cell_3').style.backgroundColor = "#006600";
						case  3:
							document.getElementById('progress_cell_2').style.backgroundColor = "#006600";
						case  2:
							document.getElementById('progress_cell_1').style.backgroundColor = "#006600";
						case  1:
							document.getElementById('progress_cell_0').style.backgroundColor = "#006600";
					};
				}

				function addprogress(value)
				{
					progress += value;
					setprogress(progress);
				}

				function setdownloadfile(value)
				{
					setdownloadprogress(0);

					prog = document.getElementById('download_file');
					prog.innerHTML = 'Downloading '+value+' ...';
				};

				function setdownloadprogress(value)
				{
					downloadprogress = value;

					prog = document.getElementById('download_progress');
					prog.innerHTML = downloadprogress + " %";
					progress2 = downloadprogress / 10;
					progress2 = Math.floor(progress2);
					for (i=0; i < 10; i++)
						document.getElementById('download_progress_cell_'+i).style.backgroundColor = "#cccccc";
					switch(progress2)
					{
						case 10:
							document.getElementById('download_progress_cell_9').style.backgroundColor = "#006600";
						case  9:
							document.getElementById('download_progress_cell_8').style.backgroundColor = "#006600";
						case  8:
							document.getElementById('download_progress_cell_7').style.backgroundColor = "#006600";
						case  7:
							document.getElementById('download_progress_cell_6').style.backgroundColor = "#006600";
						case  6:
							document.getElementById('download_progress_cell_5').style.backgroundColor = "#006600";
						case  5:
							document.getElementById('download_progress_cell_4').style.backgroundColor = "#006600";
						case  4:
							document.getElementById('download_progress_cell_3').style.backgroundColor = "#006600";
						case  3:
							document.getElementById('download_progress_cell_2').style.backgroundColor = "#006600";
						case  2:
							document.getElementById('download_progress_cell_1').style.backgroundColor = "#006600";
						case  1:
							document.getElementById('download_progress_cell_0').style.backgroundColor = "#006600";
					};
				};

			// -->
			</script>
			<table style="border-width: 1px; border-color: #000000" cellspacing="0" cellpadding="0">
			<tr>
			  <td>
			    <table border="0">
				  <tr>
				    <td bgcolor="#cccccc" width="10" height="20" id="progress_cell_0">&nbsp;</td>
				    <td bgcolor="#cccccc" width="10" height="20" id="progress_cell_1">&nbsp;</td>
				    <td bgcolor="#cccccc" width="10" height="20" id="progress_cell_2">&nbsp;</td>
				    <td bgcolor="#cccccc" width="10" height="20" id="progress_cell_3">&nbsp;</td>
				    <td bgcolor="#cccccc" width="10" height="20" id="progress_cell_4">&nbsp;</td>
				    <td bgcolor="#cccccc" width="10" height="20" id="progress_cell_5">&nbsp;</td>
				    <td bgcolor="#cccccc" width="10" height="20" id="progress_cell_6">&nbsp;</td>
				    <td bgcolor="#cccccc" width="10" height="20" id="progress_cell_7">&nbsp;</td>
				    <td bgcolor="#cccccc" width="10" height="20" id="progress_cell_8">&nbsp;</td>
				    <td bgcolor="#cccccc" width="10" height="20" id="progress_cell_9">&nbsp;</td>
				    <td bgcolor="#ffffff" width="10" height="20">&nbsp;</td>
				    <td bgcolor="#ffffff" height="20" id="installation_progress" class="green">0 %</td>
				  </tr>
				</table>
				<br>
			    <table border="0">
				  <tr>
				    <td bgcolor="#cccccc" width="10" height="20" id="download_progress_cell_0">&nbsp;</td>
				    <td bgcolor="#cccccc" width="10" height="20" id="download_progress_cell_1">&nbsp;</td>
				    <td bgcolor="#cccccc" width="10" height="20" id="download_progress_cell_2">&nbsp;</td>
				    <td bgcolor="#cccccc" width="10" height="20" id="download_progress_cell_3">&nbsp;</td>
				    <td bgcolor="#cccccc" width="10" height="20" id="download_progress_cell_4">&nbsp;</td>
				    <td bgcolor="#cccccc" width="10" height="20" id="download_progress_cell_5">&nbsp;</td>
				    <td bgcolor="#cccccc" width="10" height="20" id="download_progress_cell_6">&nbsp;</td>
				    <td bgcolor="#cccccc" width="10" height="20" id="download_progress_cell_7">&nbsp;</td>
				    <td bgcolor="#cccccc" width="10" height="20" id="download_progress_cell_8">&nbsp;</td>
				    <td bgcolor="#cccccc" width="10" height="20" id="download_progress_cell_9">&nbsp;</td>
				    <td bgcolor="#ffffff" width="10" height="20">&nbsp;</td>
				    <td bgcolor="#ffffff" height="20" id="download_progress" class="green">0 %</td>
				    <td bgcolor="#ffffff" width="10" height="20">&nbsp;</td>
				    <td bgcolor="#ffffff" height="20" id="download_file" class="green"></td>
				  </tr>
				</table>
				<br>
				<iframe src="<?php 
        echo basename(__FILE__);
        ?>
?step=install-progress&amp;<?php 
        echo SID;
        ?>
" width="700" height="700" frameborder="0" marginheight="0" marginwidth="0"></iframe>
			  </td>
			</tr>
			</table>
<?php 
    }
    ?>
  </td>
</tr>
</table>


</td>
    </tr>
   </table>
  </td>

 </tr>
</table>
<?php 
    displayHTMLFooter();
}
コード例 #2
0
ファイル: go-pear.php プロジェクト: swat30/safeballot
function displayHTML($page = 'Welcome', $data = array())
{
    global $pfc_packages;
    displayHTMLHeader();
    ?>
<a name="TOP" /></a>
<table border="0" cellspacing="0" cellpadding="0" height="48" width="100%">
  <tr bgcolor="#339900">
    <td align="left" width="120">
      <img src="<?php 
    echo basename(__FILE__);
    ?>
?action=img&amp;img=pearlogo" width="104" height="50" vspace="2" hspace="5" alt="PEAR">
    </td>
    <td align="left" valign="middle" width="20">
      &nbsp;
    </td>
    <td align="left" valign="middle">
      <span class="Headline">Go-PEAR Installer</span>
    </td>
  </tr>

  <tr bgcolor="#003300"><td colspan="3"></td></tr>

  <tr bgcolor="#006600">
    <td align="right" valign="top" colspan="3">
        <span style="color: #ffffff">Version <?php 
    echo GO_PEAR_VER;
    ?>
</span>&nbsp;<br />
    </td>
  </tr>

  <tr bgcolor="#003300"><td colspan="3"></td></tr>
</table>


<table cellpadding="0" cellspacing="0" width="100%">
 <tr valign="top">
  <td bgcolor="#f0f0f0" width="100">
   <table width="200" border="0" cellpadding="4" cellspacing="0">
    <tr valign="top">
     <td style="font-size: 90%" align="left" width="200">
       <p><br />
       <?php 
    $menus = array('Welcome' => 'Welcome to Go-PEAR', 'config' => 'Configuration', 'preinstall' => 'Installation', 'install' => 'Completed');
    $after_current = false;
    // Menu robustness (a bit low, but better then never)
    if ($page == 'error') {
        $_GET['last'] = $_GET['step'];
        $after_current = true;
    } elseif (!array_key_exists($page, $menus)) {
        $page = 'Welcome';
    }
    foreach ($menus as $menu => $descr) {
        print '<img src="' . basename(__FILE__) . '?action=img&amp;img=smallpear" border="0">';
        if (!$after_current) {
            $class = '';
            if ($page == $menu) {
                $class = 'green';
            }
            if (!isset($_GET['last'])) {
                $_GET['last'] = $page;
            }
            print '<a href="' . basename(__FILE__) . '?step=' . $menu . '&last=' . $_GET['last'] . '" class="' . $class . '">' . $descr . '</a><br />';
            if ($_GET['last'] == $menu) {
                $after_current = true;
            }
        } else {
            print '<span class="grey">' . $descr . '</span><br />';
        }
    }
    ?>

     </td>
    </tr>
   </table>
  </td>
  <td bgcolor="#cccccc" width="1" background="/gifs/checkerboard.gif"></td>
  <td>
   <table width="100%" cellpadding="10" cellspacing="0">
    <tr>
     <td valign="top">

<table border="0">
<tr>
  <td width="20">
  </td>
  <td>
<?php 
    if ($page == 'error') {
        ?>
            <span class="title">Error</span><br/>
            <br/>
<?php 
        $value = $data;
        if (preg_match('/ok$/', $value)) {
            $value = preg_replace('/(ok)$/', '<span class="green">\\1</span>', $value);
        }
        if (preg_match('/failed$/', $value)) {
            $value = preg_replace('/(failed)$/', '<span class="red">\\1</span>', $value);
        }
        if (preg_match('/^install ok:/', $value)) {
            $value = preg_replace('/^(install ok:)/', '<span class="green">\\1</span>', $value);
        }
        if (preg_match('/^Warning:/', $value)) {
            $value = '<span style="color: #ff0000">' . $value . '</span>';
        }
        echo nl2br($value);
    } elseif ($page == 'Welcome') {
        ?>
            <span class="title">Welcome to go-pear <?php 
        echo GO_PEAR_VER;
        ?>
!</span><br/>
            <p>
            Go-pear will install Pear, its Web Frontend and all the needed files. This<br/>
            frontend is your tool for PEAR installation and maintenance.
            </p>
            <p>
            Go-pear also lets you download and install the following optional PEAR<br/>
            packages: <?php 
        echo implode(', ', array_keys($GLOBALS['pfc_packages']));
        ?>
.
            </p>

            <a href="<?php 
        echo basename(__FILE__);
        ?>
?step=config&restart=1" class="green">Next &gt;&gt;</a>
<?php 
    } elseif ($page == 'config') {
        if (!empty($GLOBALS['http_proxy'])) {
            list($proxy_host, $proxy_port) = explode(':', $GLOBALS['http_proxy']);
        } else {
            $proxy_host = $proxy_port = '';
        }
        ?>
            <form action="<?php 
        echo basename(__FILE__);
        ?>
?step=install" method="post">
        <!-- Packages stuff -->
        <span class="title">Packages</span>
	    <p>
        The following PEAR packages will be installed. You can select some optional<br />
        packages to be installed by go-pear too:<br />
        </p>
	    <table border="0">
        <tr>
        <th>&nbsp;</th><th>Package</th><th width="65%">Description</th>
        </tr><tr>
        <td>(required)</td><td>PEAR core</td><td>PEAR Base System</td>
        </tr>

        <?php 
        // automatically install frontend
        $frontend = 'PEAR_Frontend_Web-beta';
        print '<tr><td>(required)<input type="hidden" name="' . $frontend . '" value="on" /></td><td>' . $frontend . '</td><td>' . $GLOBALS['pfc_packages'][$frontend] . '</td></tr>';
        unset($GLOBALS['pfc_packages'][$frontend]);
        foreach ($GLOBALS['pfc_packages'] as $var => $descr) {
            $checked = '';
            if (in_array($var, $GLOBALS['install_optional_packages'])) {
                $checked = ' checked';
            }
            printf('<tr><td align="center"><input type="checkbox" name="%s"%s></td><td>%s</td><td>%s</td></tr>', $var, $checked, $var, $descr);
        }
        ?>
        </table>
        <hr />

        <!-- Configuration stuff -->
        <span class="title">Configuration</span>
	    <p>
            Below is a suggested file layout for your new PEAR installation.
        </p>

        <!--
	    <p>
	    <table border="0">
              <tr>
                <td valign="top"><img src="<?php 
        echo basename(__FILE__);
        ?>
?action=img&amp;img=note" border="0"></td>
                <td>
                  <span class="green">
                    <b>Note:</b> Make sure that PHP has the permission to access the specified<br/>
                    directories.
                  </span>
                </td>
              </tr>
            </table>
	    </p>
        -->

            <table border="0" width="80%">
<?php 
        foreach ($GLOBALS['config_vars'] as $n => $var) {
            $error_class = '';
            if (is_array($GLOBALS['config_errors']) && array_key_exists($var, $GLOBALS['config_errors'])) {
                // www_error for this var
                $error_class = ' class="red"';
            }
            printf('<tr><td>%d. %s</td><td><input type="text" name="config[%s]" value="%s"%s></td></tr>', $n, $GLOBALS['config_desc'][$var], $var, $_SESSION['go-pear']['config'][$var], $error_class);
            // prefix dir, check perm (uses GLOBALS: resolved subvars)
            if ($n == 1 && is_dir($GLOBALS[$var]) && !is_writable($GLOBALS[$var])) {
                $error = '<em>WARNING!</em> No permission to create subdirectories in this prefix dir. Unless you fix this, the default configuration will not work.';
                if (!WINDOWS) {
                    $error .= '<p>You can grant this permission by logging on to the server and issuing the following command:<br />
<tt>chmod 0777 ' . $GLOBALS[$var] . '</tt></p>';
                }
                print '<tr><td colspan="2" class="green">' . $error . '</td></tr>';
            }
            if (is_array($GLOBALS['config_errors']) && array_key_exists($var, $GLOBALS['config_errors'])) {
                // www_error for this var
                print '<tr><td colspan="2" class="red">' . $GLOBALS['config_errors'][$var] . '</td></tr>';
            }
        }
        ?>
            </table>
	    </p>
	    <hr />
            
	    <!-- Optional stuff -->
        <span class="title">Optional:</span>

        <ul>
            <p>
            <li />HTTP proxy (host:port)
            <input type="text" name="proxy[host]" value="<?php 
        echo $proxy_host;
        ?>
"> : <input type="text" name="proxy[port]" value="<?php 
        echo $proxy_port;
        ?>
" size="6">
            </p>

	        <p>
            <li />Compatibility-Mode for old non-DOM Browsers <input type="checkbox" name="BCmode" id="BCmode" checked>
            <script type="text/javascript">
            <!--
                if (document.getElementById('BCmode')) {
                    document.getElementById('BCmode').checked = 0;
                };
            // -->
            </script>
	        </p>
        </ul>

<?php 
        if (WINDOWS && phpversion() == '4.1.1') {
            ?>
		    <p>
                    <table border="0">
                      <tr>
                        <td valign="top"><img src="<?php 
            echo basename(__FILE__);
            ?>
?action=img&amp;img=note" border="0"></td>
                        <td>
                          <span style="color: #ff0000">
                              <b>Warning:</b> Your PHP version (4.1.1) might be imcompatible with go-pear due to a bug<br/>
                              in your PHP binary. If the installation crashes you might want to update your PHP version.</br>
                          </span>
                        </td>
                      </tr>
                    </table>
		    </p>
<?php 
        }
        ?>
        <hr />
	    <!-- Closing note -->
	    <p>
            <table border="0">
              <tr>
                <td valign="top"><img src="<?php 
        echo basename(__FILE__);
        ?>
?action=img&amp;img=note" border="0"></td>
                <td>
                  <span class="green">
                      <b>Note:</b> Installation might take some time, because go-pear has to<br/>
                      download all needed files from pear.php.net. Just be patient and wait for<br/>
                      the next page to load.<br/>
                  </span>
                </td>
              </tr>
            </table>
	    </p>

            <input type="submit" value="Install" onClick="javascript: submitButton.value='Downloading and installing ... please wait ...'" name="submitButton">
            </form>

<?php 
    } elseif ($page == 'install') {
        ?>
            <span class="title">Installation Complete - Summary</span><br/>
<?php 
        displayHTMLInstallationSummary($data);
    } elseif ($page == 'preinstall') {
        ?>
            <p>
            <span class="title">Installation in progress ...</span></br >
            <i>(If the page stops loading before the end of the installation, then just reload it)</i></p>
            <script language="javascript">
            <!--

                var progress;
                var downloadprogress;
                progress = 0;
                downloadprogress = 0;

                function setprogress(value)
                {
                    progress = value;

                    prog = document.getElementById('installation_progress');
                    prog.innerHTML = progress + " %";
                    progress2 = progress / 10;
                    progress2 = Math.floor(progress2);
                    for (i=0; i < 10; i++)
                        document.getElementById('progress_cell_'+i).style.backgroundColor = "#cccccc";
                    switch(progress2)
                    {
                        case 10:
                            document.getElementById('progress_cell_9').style.backgroundColor = "#006600";
                        case  9:
                            document.getElementById('progress_cell_8').style.backgroundColor = "#006600";
                        case  8:
                            document.getElementById('progress_cell_7').style.backgroundColor = "#006600";
                        case  7:
                            document.getElementById('progress_cell_6').style.backgroundColor = "#006600";
                        case  6:
                            document.getElementById('progress_cell_5').style.backgroundColor = "#006600";
                        case  5:
                            document.getElementById('progress_cell_4').style.backgroundColor = "#006600";
                        case  4:
                            document.getElementById('progress_cell_3').style.backgroundColor = "#006600";
                        case  3:
                            document.getElementById('progress_cell_2').style.backgroundColor = "#006600";
                        case  2:
                            document.getElementById('progress_cell_1').style.backgroundColor = "#006600";
                        case  1:
                            document.getElementById('progress_cell_0').style.backgroundColor = "#006600";
                    };
                }

                function addprogress(value)
                {
                    progress += value;
                    setprogress(progress);
                }

                function setdownloadfile(value)
                {
                    setdownloadprogress(0);

                    prog = document.getElementById('download_file');
                    prog.innerHTML = 'Downloading '+value+' ...';
                };

                function unsetdownloadfile()
                {
                    setdownloadprogress(0);

                    prog = document.getElementById('download_file');
                    prog.innerHTML = '';
                };

                function setdownloadprogress(value)
                {
                    downloadprogress = value;

                    prog = document.getElementById('download_progress');
                    prog.innerHTML = downloadprogress + " %";
                    progress2 = downloadprogress / 10;
                    progress2 = Math.floor(progress2);
                    for (i=0; i < 10; i++)
                        document.getElementById('download_progress_cell_'+i).style.backgroundColor = "#cccccc";
                    switch(progress2)
                    {
                        case 10:
                            document.getElementById('download_progress_cell_9').style.backgroundColor = "#006600";
                        case  9:
                            document.getElementById('download_progress_cell_8').style.backgroundColor = "#006600";
                        case  8:
                            document.getElementById('download_progress_cell_7').style.backgroundColor = "#006600";
                        case  7:
                            document.getElementById('download_progress_cell_6').style.backgroundColor = "#006600";
                        case  6:
                            document.getElementById('download_progress_cell_5').style.backgroundColor = "#006600";
                        case  5:
                            document.getElementById('download_progress_cell_4').style.backgroundColor = "#006600";
                        case  4:
                            document.getElementById('download_progress_cell_3').style.backgroundColor = "#006600";
                        case  3:
                            document.getElementById('download_progress_cell_2').style.backgroundColor = "#006600";
                        case  2:
                            document.getElementById('download_progress_cell_1').style.backgroundColor = "#006600";
                        case  1:
                            document.getElementById('download_progress_cell_0').style.backgroundColor = "#006600";
                    };
                };

            // -->
            </script>
            <table style="border-width: 1px; border-color: #000000" cellspacing="0" cellpadding="0">
            <tr>
              <td>
                <table border="0">
                  <tr>
                    <td bgcolor="#cccccc" width="10" height="20" id="progress_cell_0">&nbsp;</td>
                    <td bgcolor="#cccccc" width="10" height="20" id="progress_cell_1">&nbsp;</td>
                    <td bgcolor="#cccccc" width="10" height="20" id="progress_cell_2">&nbsp;</td>
                    <td bgcolor="#cccccc" width="10" height="20" id="progress_cell_3">&nbsp;</td>
                    <td bgcolor="#cccccc" width="10" height="20" id="progress_cell_4">&nbsp;</td>
                    <td bgcolor="#cccccc" width="10" height="20" id="progress_cell_5">&nbsp;</td>
                    <td bgcolor="#cccccc" width="10" height="20" id="progress_cell_6">&nbsp;</td>
                    <td bgcolor="#cccccc" width="10" height="20" id="progress_cell_7">&nbsp;</td>
                    <td bgcolor="#cccccc" width="10" height="20" id="progress_cell_8">&nbsp;</td>
                    <td bgcolor="#cccccc" width="10" height="20" id="progress_cell_9">&nbsp;</td>
                    <td bgcolor="#ffffff" width="10" height="20">&nbsp;</td>
                    <td bgcolor="#ffffff" height="20" id="installation_progress" class="green">0 %</td>
                  </tr>
                </table>
                <br>
                <table border="0">
                  <tr>
                    <td bgcolor="#cccccc" width="10" height="20" id="download_progress_cell_0">&nbsp;</td>
                    <td bgcolor="#cccccc" width="10" height="20" id="download_progress_cell_1">&nbsp;</td>
                    <td bgcolor="#cccccc" width="10" height="20" id="download_progress_cell_2">&nbsp;</td>
                    <td bgcolor="#cccccc" width="10" height="20" id="download_progress_cell_3">&nbsp;</td>
                    <td bgcolor="#cccccc" width="10" height="20" id="download_progress_cell_4">&nbsp;</td>
                    <td bgcolor="#cccccc" width="10" height="20" id="download_progress_cell_5">&nbsp;</td>
                    <td bgcolor="#cccccc" width="10" height="20" id="download_progress_cell_6">&nbsp;</td>
                    <td bgcolor="#cccccc" width="10" height="20" id="download_progress_cell_7">&nbsp;</td>
                    <td bgcolor="#cccccc" width="10" height="20" id="download_progress_cell_8">&nbsp;</td>
                    <td bgcolor="#cccccc" width="10" height="20" id="download_progress_cell_9">&nbsp;</td>
                    <td bgcolor="#ffffff" width="10" height="20">&nbsp;</td>
                    <td bgcolor="#ffffff" height="20" id="download_progress" class="green">0 %</td>
                    <td bgcolor="#ffffff" width="10" height="20">&nbsp;</td>
                    <td bgcolor="#ffffff" height="20" id="download_file" class="green"></td>
                  </tr>
                </table>
                <br>
                <iframe src="<?php 
        echo basename(__FILE__);
        ?>
?step=install-progress&amp;<?php 
        echo SID;
        ?>
" width="700" height="700" frameborder="0" marginheight="0" marginwidth="0"></iframe>
              </td>
            </tr>
            </table>
<?php 
    }
    ?>
  </td>
</tr>
</table>


</td>
    </tr>
   </table>
  </td>

 </tr>
</table>
<?php 
    displayHTMLFooter();
}
コード例 #3
0
ファイル: spamcop.php プロジェクト: teammember8/roundcube
if (!sqgetGlobalVar('passed_ent_id', $passed_ent_id, SQ_GET)) {
    $passed_ent_id = 0;
}
if (!sqgetGlobalVar('js_web', $js_web, SQ_GET)) {
    $js_web = 0;
}
sqgetGlobalVar('compose_messages', $compose_messages, SQ_SESSION);
if (!sqgetGlobalVar('composesession', $composesession, SQ_SESSION)) {
    $composesession = 0;
    sqsession_register($composesession, 'composesession');
}
/* END GLOBALS */
// js_web variable is 1 only when link opens web based report page in new window
// and in new window menu line or extra javascript code is not needed.
if ($js_web) {
    displayHTMLHeader(_("SpamCop reporting"));
    echo "<body text=\"{$color['8']}\" bgcolor=\"{$color['4']}\" link=\"{$color['7']}\" vlink=\"{$color['7']}\" alink=\"{$color['7']}\">\n";
} else {
    displayPageHeader($color, $mailbox);
}
/** is spamcop plugin disabled */
if (!is_plugin_enabled('spamcop')) {
    error_box(_("Plugin is disabled."));
    // display footer (closes html tags) and stop script execution
    $oTemplate->display('footer.tpl');
    exit;
}
global $imap_stream_options;
// in case not defined in config
$imap_stream = sqimap_login($username, false, $imapServerAddress, $imapPort, 0, $imap_stream_options);
sqimap_mailbox_select($imap_stream, $mailbox);