<?php
session_name("s".base64_decode($_COOKIE[register]));
session_start ();
$sesspass = "base64_decode($_COOKIE[register])";
if (session_id() == "" and $_SESSION[$sesspass] != session_id()) 
{
	session_unset ();
	session_destroy ();
	header ("location: ../index.php?n=503");
}
if (!session_is_registered("s".base64_decode($_COOKIE[register]))) 
{
	session_unset ();
	session_destroy ();
	header ("location: ../index.php?n=503");
}
if($_POST[submit]){
	require "engine/actions.php";
	if ($_POST[actions] == "langup"){
		$_POST[actions]();
	}
	if ($_POST[actions] == "gadgetup"){
		$_POST[actions]();
	}
	if ($_POST[actions] == "themeup"){
		$_POST[actions]();
	}
	if ($_POST[actions] == "gadgetsupdate"){
		$_POST[actions]();
	}
} ?>
<h1><?php echo $l[addons];?></h1>
<table width="100%" border="0" cellspacing="2" cellpadding="0">

 
  
  <tr>
    <td colspan="2" align="left" valign="top"><h2 id="languages"><?php echo $l[languages];?></h2></td>
  </tr>
  <tr>
    <td width="50%" align="left" valign="top"><fieldset>
      <legend><?php echo $l[languagesinstall];?></legend>
      
      <table width="100%" border="0" cellspacing="2" cellpadding="0">
        <?php languages($s40[lang],$l[deletenotelang],$l[deleteconfirm]);?>
      </table>
    </fieldset></td>
    <td width="50%" align="left" valign="top"><form action="" method="post" enctype="multipart/form-data" name="langup" id="langup" class="form">
      <fieldset>
        <legend><?php echo $l[languagesupload]; echo maxsize();?> </legend>
        <input type="file" name="langzip" id="langzip" />
        <input type="submit" name="button" id="button" value="<?php echo $l[upload];?>" />
        <input name="submit" type="hidden" id="submit" value="true" />
        <input name="actions" type="hidden" id="actions" value="langup" />
      </fieldset>
    </form></td>
  </tr>
  <tr>
    <td colspan="2" align="left" valign="top"><h2 id="gadgets"><?php echo $l[gadgets];?></h2></td>
  </tr>
  <tr>
    <td colspan="2" align="left" valign="top"><form action="" method="post" enctype="multipart/form-data" name="gadgetup" id="gadgetup" class="form">
      <fieldset>
        <legend><?php echo $l[gadgetsupload]; echo maxsize();?></legend>
          <input type="file" name="gadgetzip" id="gadgetzip" />
          <input type="submit" name="button2" id="button2" value="<?php echo $l[upload];?>" />
          <input name="submit" type="hidden" id="submit" value="true" />
          <input name="actions" type="hidden" id="actions" value="gadgetup" />
      </fieldset>
    </form></td>
  </tr>
  <tr>
    <td width="50%" align="left" valign="top">
    <fieldset>
      <legend><?php echo $l[gadgetsactive];?></legend>
      <form id="gadget" name="gadget" method="post" action="" class="form">
      
<table width="100%" border="0" cellspacing="2" cellpadding="0" id="activegadgets">
  <?php gadgets($l[removeconfirm]);?>
</table>
<input name="submit" type="hidden" id="submit" value="true" />
<input name="actions" type="hidden" id="actions" value="gadgetsupdate" />
<input name="input" type="submit" value="<?php echo $l[savechange]; ?>" class="save" />
      </form>
    </fieldset>
    </td>
    <td width="50%" align="left" valign="top"><fieldset><legend><?php echo $l[gadgetsuploaded];?></legend>
    <table width="100%" border="0" cellspacing="2" cellpadding="0" id="activegadgets">
  <?php allgadgets($l[deleteconfirm]);?>
</table>
    </fieldset>
    </td>
  </tr>
  <tr>
    <td align="left" valign="top"><h2 id="themes"><?php echo $l[themes];?></h2></td>
    <td align="left" valign="top">&nbsp;</td>
  </tr>
  <tr>
    <td align="left" valign="top">
    <fieldset>
      <legend><?php echo $l[themesinstall];?></legend>
      
      <table width="100%" border="0" cellspacing="2" cellpadding="0">
        <?php themes($s40[theme],$l[deletenotetheme],$l[deleteconfirm]);?>
      </table>
    </fieldset>
    </td>
    <td align="left" valign="top">
    <form action="" method="post" enctype="multipart/form-data" name="themeup" id="themeup" class="form">
      <fieldset>
        <legend><?php echo $l[themesupload]; echo maxsize();?></legend>
        <input type="file" name="themezip" id="themezip" />
        <input type="submit" name="button" id="button" value="<?php echo $l[upload];?>" />
        <input name="submit" type="hidden" id="submit" value="true" />
        <input name="actions" type="hidden" id="actions" value="themeup" />
      </fieldset>
    </form></td>
  </tr>
</table>
