Location: PHPKode > projects > Absolut Engine > absolut-engine-33870/admin/managermodule.php
<?
@include("coreclass.php");
$ae=new CEngine();
$ae->EngineInitialize();
$ae->RequestVariables();
$ae->UserVerifySession();
$ae->UserVerifyLevel();
@include("header.php");
?>
<div id="content">
<?
if ($ae->action==1)
   {
   echo '<h1>',$ae->textbasic[8],'</h1>';
   $ae->DBQuery("SELECT * FROM ".$ae->table[8]." WHERE ID='".$ae->moduleID."'");
   $ae->DBGetRow();
   $moduleID=$ae->access["ID"];
   $module=$ae->access["module"];
   $version=$ae->access["version"];
   $author=$ae->access["author"];
   $website=$ae->access["website"];
   $description=$ae->access["description"];
   $directory=$ae->access["directory"];
   $menu1=$ae->access["menu1"];
   if ($menu1) $menu1=$ae->textbasic[19]; else $menu1=$ae->textbasic[20];
   $menu2=$ae->access["menu2"];
   if ($menu2) $menu2=$ae->textbasic[19]; else $menu2=$ae->textbasic[20];
   $menu3=$ae->access["menu3"];
   if ($menu3) $menu3=$ae->textbasic[19]; else $menu3=$ae->textbasic[20];
   $guestmodify=$ae->access["guestmodify"];
   if ($guestmodify) $guestmodify=$ae->textbasic[19]; else $guestmodify=$ae->textbasic[20];
   echo '<table cellspacing="0" class="form">';
   echo '<tbody>';
   echo '<tr>';
   echo '<td width="20%"><strong>',$ae->textbasic[63],'</strong></td>';
   echo '<td>',$module,'</td>';
   echo '</tr>';
   echo '<tr>';
   echo '<td><strong>',$ae->textbasic[89],'</strong></td>';
   echo '<td>',$version,'</td>';
   echo '</tr>';
   echo '<tr>';
   echo '<td><strong>',$ae->textbasic[120],'</strong></td>';
   echo '<td>',$author,'</td>';
   echo '</tr>';
   echo '<tr>';
   echo '<td><strong>',$ae->textbasic[91],'</strong></td>';
   echo '<td><a href="',$website,'" onclick="window.open(\'',$website,'\');">',$website,'</a></td>';
   echo '</tr>';
   echo '<tr>';
   echo '<td><strong>',$ae->textbasic[9],'</strong></td>';
  echo '<td>',$description,'</td>';
   echo '</tr>';
   echo '<tr>';
   echo '<td><strong>',$ae->textbasic[10],'</strong></td>';
   echo '<td>modules/',$directory,'/</td>';
   echo '</tr>';
   echo '<tr>';
   echo '<td><strong>',$ae->textbasic[11],'</strong></td>';
   echo '<td>',$menu1,'</td>';
   echo '</tr>';
   echo '<tr>';
   echo '<td><strong>',$ae->textbasic[12],'</strong></td>';
   echo '<td>',$menu2,'</td>';
   echo '</tr>';
   echo '<tr>';
   echo '<td><strong>',$ae->textbasic[13],'</strong></td>';
   echo '<td>',$menu3,'</td>';
   echo '</tr>';
   echo '<tr>';
   echo '<td><strong>',$ae->textbasic[14],'</strong></td>';
   echo '<td>',$guestmodify,'</td>';
   echo '</tr>';
   echo '<tr>';
   echo '<td colspan="2" class="action">';
   echo '<form method="post" action="managermodule.php">';
   echo '<p>';
   echo '<input type="hidden" name="username" value="',$ae->username,'">';
   echo '<input type="hidden" name="session" value="',$ae->session,'">';
   echo '<input type="submit" name="Submit" value="',$ae->textbasic[21],'" class="button" />';
   echo '</p>';
   echo '</form>';
   echo '</td>';
   echo '</tr>';
   echo '</tbody>';
   echo '</table>';
   }
else
   {
   echo '<h1>',$ae->textbasic[51],'</h1>';
   echo '<table cellspacing="0" id="data">';
   echo '<thead>';
   echo '<tr>';
   echo '<td width="30%"><h2>',$ae->textbasic[63],'</h2></td>';
   echo '<td width="3%"><h2>',$ae->textbasic[89],'</h2></td>';
   echo '<td width="57%"><h2>',$ae->textbasic[90],'</h2></td>';
   echo '<td width="10%">&nbsp;</td>';
   echo '</tr>';
   echo '</thead>';
   echo '<tbody>';
   $i=0;
   $ae->DBQuery("SELECT * FROM ".$ae->table[8]." ORDER BY module");
   if (!$ae->rowsnumber)
      {
      echo '<tr>';
      echo '<td colspan="4">';
      echo $ae->textbasic[62];
      echo '</td>';
      echo '</tr>';
      }
   while ($ae->DBGetRow())
         {
         $color=fmod($i,2);
         $i++;
         if ($color==1) echo '<tr>'; else echo '<tr>';
         $moduleID=$ae->access["ID"];
         $module=$ae->access["module"];
         $version=$ae->access["version"];
         $description=$ae->access["description"];
         echo '<td width="30%" class="title"><a href="managermodule.php?action=1&moduleID=',$moduleID,'&username=',$ae->username,'&session=',$ae->session,'">',$module,'</a></td>';
         echo '<td width="3%">',$version,'</td>';
         echo '<td width="57%">',$description,'</td>';
         echo '<td width="10%" class="action">';
         echo '<a href="modify.php?command=53&moduleID=',$moduleID,'&username=',$ae->username,'&session=',$ae->session,'">',$ae->textbasic[92],'</td>';
         echo '</td>';
         echo '</tr>';
         }
   echo '</tbody>';
   echo '</table>';
   echo '<br /><h1>',$ae->textbasic[35],'</h1>';
   echo '<table cellspacing="0" id="data">';
   echo '<thead>';
   echo '<tr>';
   echo '<td width="30%"><h2>',$ae->textbasic[63],'</h2></td>';
   echo '<td width="3%"><h2>',$ae->textbasic[89],'</h2></td>';
   echo '<td width="67%"><h2>',$ae->textbasic[90],'</h2></td>';
   echo '</tr>';
   echo '</thead>';
   echo '<tbody>';
   $i=0;
   $newcounter=0;
   @$dirhandle=opendir('modules/');
   while ((@$moduledir=readdir($dirhandle))!==false)
         {
         if ($moduledir=='.' OR $moduledir=='..') continue;
         if (file_exists('modules/'.$moduledir.'/module.xml'))
            {
            @$moduleinfo=join('',file('modules/'.$moduledir.'/module.xml'));
            eregi("[^<]+<name>([^<]+)</name>",$moduleinfo,$regs);
            $name=$regs[1];
            $regs="";
            eregi("[^<]+<version>([^<]+)</version>",$moduleinfo,$regs);
            $version=$regs[1];
            $regs="";
            eregi("[^<]+<author>([^<]+)</author>",$moduleinfo,$regs);
            $author=$regs[1];
            $regs="";
            eregi("[^<]+<website>([^<]+)</website>",$moduleinfo,$regs);
            $website=$regs[1];
            $regs="";
            eregi("[^<]+<description>([^<]+)</description>",$moduleinfo,$regs);
            $description=$regs[1];
            }
         else continue;
         $ae->DBQuery("SELECT * FROM ".$ae->table[8]." WHERE directory='".$moduledir."'");
         $ae->DBGetRow();
         $currentversion=$ae->access["version"];
         if (!$ae->rowsnumber OR $version<>$currentversion)
            {
            $color=fmod($i,2);
            $i++;
            if ($color==1) echo '<tr>'; else echo '<tr>';
            echo '<td width="30%">',$name,'</td>';
            echo '<td width="3%">',$version,'</td>';
            echo '<td width="67%">',$description,'</td>';
            echo '</tr>';
            $newcounter++;
            }
         }
   if (!$newcounter)
      {
      echo '<tr><td colspan="3">',$ae->textbasic[95],'</td></tr>';
      }
   else
      {
      $color=fmod($i,2);
      if ($color==1) echo '<tr>'; else echo '<tr>';
      echo '<td colspan="3">';
      echo '<form method="post" action="modify.php?command=54">';
      echo '<p>';
      echo '<input type="hidden" name="username" value="',$ae->username,'">';
      echo '<input type="hidden" name="session" value="',$ae->session,'">';
      echo '<input type="submit" value="',$ae->textbasic[52],'" class="button" />';
      echo '</p>';
      echo '</form>';
      echo '</td>';
      echo '</tr>';
      }
   echo '</tbody>';
   echo '</table>';
   }
?>
</div>
<? @include("footer.php"); ?>
Return current item: Absolut Engine