[ Index ]
 

Code source de e107 0.7.8

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/e107_admin/ -> plugin.php (source)

   1  <?php
   2  /*
   3  + ----------------------------------------------------------------------------+
   4  |     e107 website system
   5  |
   6  |     ©Steve Dunstan 2001-2002
   7  |     http://e107.org
   8  |     jalist@e107.org
   9  |
  10  |     Released under the terms and conditions of the
  11  |     GNU General Public License (http://gnu.org).
  12  |
  13  |     $Source: /cvsroot/e107/e107_0.7/e107_admin/plugin.php,v $
  14  |     $Revision: 1.71 $
  15  |     $Date: 2007/02/04 21:42:26 $
  16  |     $Author: e107steved $
  17  +----------------------------------------------------------------------------+
  18  */
  19  
  20  require_once ("../class2.php");
  21  if (!getperms("Z")) {
  22      header("location:".e_BASE."index.php");
  23      exit;
  24  }
  25  $e_sub_cat = 'plug_manage';
  26  require_once ("auth.php");
  27  require_once(e_HANDLER.'plugin_class.php');
  28  require_once(e_HANDLER.'file_class.php');
  29  $plugin = new e107plugin;
  30  
  31  $tmp = explode('.', e_QUERY);
  32  $action = $tmp[0];
  33  $id = intval($tmp[1]);
  34  
  35  if (isset($_POST['upload'])) {
  36      if (!$_POST['ac'] == md5(ADMINPWCHANGE)) {
  37          exit;
  38      }
  39  
  40      extract($_FILES);
  41      /* check if e_PLUGIN dir is writable ... */
  42      if(!is_writable(e_PLUGIN)) {
  43          /* still not writable - spawn error message */
  44          $ns->tablerender(EPL_ADLAN_40, EPL_ADLAN_39);
  45      } else {
  46          /* e_PLUGIN is writable - continue */
  47          $pref['upload_storagetype'] = "1";
  48          require_once(e_HANDLER."upload_handler.php");
  49          $fileName = $file_userfile['name'][0];
  50          $fileSize = $file_userfile['size'][0];
  51          $fileType = $file_userfile['type'][0];
  52  
  53          if(strstr($file_userfile['type'][0], "gzip")) {
  54              $fileType = "tar";
  55          } else if (strstr($file_userfile['type'][0], "zip")) {
  56              $fileType = "zip";
  57          } else {
  58              /* not zip or tar - spawn error message */
  59              $ns->tablerender(EPL_ADLAN_40, EPL_ADLAN_41);
  60              require_once ("footer.php");
  61              exit;
  62          }
  63  
  64          if ($fileSize) {
  65  
  66              $opref = $pref['upload_storagetype'];
  67              $pref['upload_storagetype'] = 1;        /* temporarily set upload type pref to flatfile */
  68              $uploaded = file_upload(e_PLUGIN);
  69              $pref['upload_storagetype'] = $opref;
  70  
  71              $archiveName = $uploaded[0]['name'];
  72  
  73              /* attempt to unarchive ... */
  74  
  75              if($fileType == "zip") {
  76                  require_once(e_HANDLER."pclzip.lib.php");
  77                  $archive = new PclZip(e_PLUGIN.$archiveName);
  78                  $unarc = ($fileList = $archive -> extract(PCLZIP_OPT_PATH, e_PLUGIN, PCLZIP_OPT_SET_CHMOD, 0666));
  79              } else {
  80                  require_once(e_HANDLER."pcltar.lib.php");
  81                  $unarc = ($fileList = PclTarExtract($archiveName, e_PLUGIN));
  82              }
  83  
  84              if(!$unarc) {
  85                  /* unarc failed ... */
  86                  if($fileType == "zip") {
  87                      $error = EPL_ADLAN_46." '".$archive -> errorName(TRUE)."'";
  88                  } else {
  89                      $error = EPL_ADLAN_47.PclErrorString().", ".EPL_ADLAN_48.intval(PclErrorCode());
  90                  }
  91                  $ns->tablerender(EPL_ADLAN_40, EPL_ADLAN_42." ".$archiveName." ".$error);
  92                  require_once ("footer.php");
  93                  exit;
  94              }
  95  
  96              /* ok it looks like the unarc succeeded - continue */
  97  
  98              /* get folder name ... */
  99              $folderName = substr($fileList[0]['stored_filename'], 0, (strpos($fileList[0]['stored_filename'], "/")));
 100  
 101              if(file_exists(e_PLUGIN.$folderName."/plugin.php")) {
 102                  /* upload is a plugin */
 103                  $ns->tablerender(EPL_ADLAN_40, EPL_ADLAN_43);
 104              } else {
 105                  /* upload is a menu */
 106                  $ns->tablerender(EPL_ADLAN_40, EPL_ADLAN_45);
 107              }
 108  
 109              /* attempt to delete uploaded archive */
 110              @unlink(e_PLUGIN.$archiveName);
 111          }
 112      }
 113  }
 114  
 115  
 116  if ($action == 'uninstall')
 117  {
 118      if(!isset($_POST['uninstall_confirm']))
 119      {
 120          show_uninstall_confirm();
 121          exit;
 122      }
 123  
 124      $id = intval($id);
 125      $plug = $plugin->getinfo($id);
 126      //Uninstall Plugin
 127      if ($plug['plugin_installflag'] == TRUE ) {
 128          include(e_PLUGIN.$plug['plugin_path'].'/plugin.php');
 129  
 130          $func = $eplug_folder.'_uninstall';
 131          if (function_exists($func)) {
 132              $text .= call_user_func($func);
 133          }
 134  
 135          if($_POST['delete_tables'])
 136          {
 137              if (is_array($eplug_table_names))
 138              {
 139                  $result = $plugin->manage_tables('remove', $eplug_table_names);
 140                  if ($result !== TRUE)
 141                  {
 142                      $text .= EPL_ADLAN_27.' <b>'.$mySQLprefix.$result.'</b> - '.EPL_ADLAN_30.'<br />';
 143                  }
 144                  else
 145                  {
 146                      $text .= EPL_ADLAN_28."<br />";
 147                  }
 148              }
 149          }
 150          else
 151          {
 152              $text .= "Tables not deleted during uninstall process by request<br />";
 153          }
 154  
 155          if (is_array($eplug_prefs)) {
 156              $plugin->manage_prefs('remove', $eplug_prefs);
 157              $text .= EPL_ADLAN_29."<br />";
 158          }
 159  
 160          if (is_array($eplug_comment_ids)) {
 161              $text .= ($plugin->manage_comments('remove', $eplug_comment_ids)) ? EPL_ADLAN_50."<br />" : "";
 162          }
 163  
 164  
 165          if ($eplug_module) {
 166              $plugin->manage_plugin_prefs('remove', 'modules', $eplug_folder);
 167          }
 168  
 169          if ($eplug_status) {
 170              $plugin->manage_plugin_prefs('remove', 'plug_status', $eplug_folder);
 171          }
 172  
 173          if ($eplug_latest) {
 174              $plugin->manage_plugin_prefs('remove', 'plug_latest', $eplug_folder);
 175          }
 176  
 177  
 178  
 179          if (is_array($eplug_array_pref))
 180          {
 181              foreach($eplug_array_pref as $key => $val)
 182              {
 183                  $plugin->manage_plugin_prefs('remove', $key, $eplug_folder, $val);
 184              }
 185          }
 186  
 187          if (is_array($eplug_sc))
 188          {
 189              $plugin->manage_plugin_prefs('remove', 'plug_sc', $eplug_folder, $eplug_sc);
 190          }
 191  
 192          if (is_array($eplug_bb))
 193          {
 194              $plugin->manage_plugin_prefs('remove', 'plug_bb', $eplug_folder, $eplug_bb);
 195          }
 196  
 197          if (is_array($eplug_user_prefs)) {
 198              if (!is_object($sql)){ $sql = new db; }
 199              $sql->db_Select("core", " e107_value", " e107_name='user_entended'");
 200              $row = $sql->db_Fetch();
 201              $user_entended = unserialize($row[0]);
 202              $user_entended = array_values(array_diff($user_entended, array_keys($eplug_user_prefs)));
 203              if ($user_entended == NULL) {
 204                  $sql->db_Delete("core", "e107_name='user_entended'");
 205              } else {
 206                  $tmp = addslashes(serialize($user_entended));
 207                  $sql->db_Update("core", "e107_value='$tmp' WHERE e107_name='user_entended' ");
 208              }
 209              while (list($key, $e_user_pref) = each($eplug_user_prefs)) {
 210                  unset($user_pref[$key]);
 211              }
 212              save_prefs("user");
 213          }
 214  
 215          if ($eplug_menu_name) {
 216              $sql->db_Delete('menus', "menu_name='$eplug_menu_name' ");
 217          }
 218  
 219          if ($eplug_link) {
 220              $plugin->manage_link('remove', '', $eplug_link_name);
 221          }
 222  
 223          if ($eplug_userclass) {
 224              $plugin->manage_userclass('remove', $eplug_userclass);
 225          }
 226  
 227          $plugin -> manage_search('remove', $eplug_folder);
 228  
 229          $plugin -> manage_notify('remove', $eplug_folder);
 230  
 231          $sql->db_Update('plugin', "plugin_installflag=0, plugin_version='{$eplug_version}' WHERE plugin_id='{$id}' ");
 232  
 233          if($_POST['delete_files'])
 234          {
 235              include_once(e_HANDLER."file_class.php");
 236              $fi = new e_file;
 237              $result = $fi->rmtree(e_PLUGIN.$eplug_folder);
 238              $text .= ($result ? "<br />All files removed from ".e_PLUGIN.$eplug_folder : '<br />File deletion failed<br />'.EPL_ADLAN_31.' <b>'.e_PLUGIN.$eplug_folder.'</b> '.EPL_ADLAN_32);
 239          }
 240          else
 241          {
 242              $text .= '<br />'.EPL_ADLAN_31.' <b>'.e_PLUGIN.$eplug_folder.'</b> '.EPL_ADLAN_32;
 243          }
 244          $ns->tablerender(EPL_ADLAN_1.' '.$tp->toHtml($eplug_name,"","defs,emotes_off, no_make_clickable"), $text);
 245          $text = "";
 246          $plugin -> save_addon_prefs();
 247      }
 248  }
 249  
 250  if ($action == 'install') {
 251      $plugin->install_plugin(intval($id));
 252      $plugin ->save_addon_prefs();
 253  }
 254  
 255  if ($action == 'upgrade') {
 256      $plug = $plugin->getinfo($id);
 257      include(e_PLUGIN.$plug['plugin_path'].'/plugin.php');
 258  
 259      $func = $eplug_folder.'_upgrade';
 260      if (function_exists($func)) {
 261          $text .= call_user_func($func);
 262      }
 263  
 264      if (is_array($upgrade_alter_tables)) {
 265          $result = $plugin->manage_tables('upgrade', $upgrade_alter_tables);
 266          if (!$result) {
 267              $text .= EPL_ADLAN_9.'<br />';
 268          } else {
 269              $text .= EPL_ADLAN_7."<br />";
 270          }
 271      }
 272  
 273      if ($eplug_module) {
 274          $plugin->manage_plugin_prefs('add', 'modules', $eplug_folder);
 275      } else {
 276          $plugin->manage_plugin_prefs('remove', 'modules', $eplug_folder);
 277      }
 278  
 279      if ($eplug_status) {
 280          $plugin->manage_plugin_prefs('add', 'plug_status', $eplug_folder);
 281      } else {
 282          $plugin->manage_plugin_prefs('remove', 'plug_status', $eplug_folder);
 283      }
 284  
 285      if ($eplug_latest) {
 286          $plugin->manage_plugin_prefs('add', 'plug_latest', $eplug_folder);
 287      } else {
 288          $plugin->manage_plugin_prefs('remove', 'plug_latest', $eplug_folder);
 289      }
 290  
 291      if (is_array($upgrade_add_eplug_sc))
 292      {
 293          $plugin->manage_plugin_prefs('add', 'plug_sc', $eplug_folder, $eplug_sc);
 294      }
 295  
 296      if (is_array($upgrade_remove_eplug_sc))
 297      {
 298          $plugin->manage_plugin_prefs('remove', 'plug_sc', $eplug_folder, $eplug_sc);
 299      }
 300  
 301      if (is_array($upgrade_add_eplug_bb))
 302      {
 303          $plugin->manage_plugin_prefs('add', 'plug_bb', $eplug_folder, $eplug_bb);
 304      }
 305  
 306      if (is_array($upgrade_remove_eplug_bb))
 307      {
 308          $plugin->manage_plugin_prefs('remove', 'plug_bb', $eplug_folder, $eplug_bb);
 309      }
 310  
 311      if (is_array($upgrade_add_prefs)) {
 312          $plugin->manage_prefs('add', $upgrade_add_prefs);
 313          $text .= EPL_ADLAN_8.'<br />';
 314      }
 315  
 316      if (is_array($upgrade_remove_prefs)) {
 317          $plugin->manage_prefs('remove', $upgrade_remove_prefs);
 318      }
 319  
 320      if (is_array($upgrade_add_array_pref))
 321      {
 322        foreach($upgrade_add_array_pref as $key => $val)
 323        {
 324          $plugin->manage_plugin_prefs('add', $key, $eplug_folder, $val);
 325        }
 326      }
 327  
 328      if (is_array($upgrade_remove_array_pref))
 329      {
 330        foreach($upgrade_remove_array_pref as $key => $val)
 331        {
 332          $plugin->manage_plugin_prefs('remove', $key, $eplug_folder, $val);
 333        }
 334      }
 335  
 336      if (is_array($upgrade_add_user_prefs)) {
 337          if (!is_object($sql)){ $sql = new db; }
 338          $sql->db_Select("core", " e107_value", " e107_name='user_entended'");
 339          $row = $sql->db_Fetch();
 340          $user_entended = unserialize($row[0]);
 341          while (list($key, $e_user_pref) = each($eplug_user_prefs)) {
 342              $user_entended[] = $e_user_pref;
 343          }
 344          $tmp = addslashes(serialize($user_entended));
 345          if ($sql->db_Select("core", " e107_value", " e107_name='user_entended'")) {
 346              $sql->db_Update("core", "e107_value='$tmp' WHERE e107_name='user_entended' ");
 347          } else {
 348              $sql->db_Insert("core", "'user_entended', '$tmp' ");
 349          }
 350          $text .= EPL_ADLAN_8."<br />";
 351      }
 352  
 353      if (is_array($upgrade_remove_user_prefs)) {
 354          if (!is_object($sql)){ $sql = new db; }  
 355          $sql->db_Select("core", " e107_value", " e107_name='user_entended'");
 356          $row = $sql->db_Fetch();
 357          $user_entended = unserialize($row[0]);
 358          $user_entended = array_values(array_diff($user_entended, $eplug_user_prefs));
 359          if ($user_entended == NULL) {
 360              $sql->db_Delete("core", "e107_name='user_entended'");
 361          } else {
 362              $tmp = addslashes(serialize($user_entended));
 363              $sql->db_Update("core", "e107_value='$tmp' WHERE e107_name='user_entended' ");
 364          }
 365      }
 366  
 367      $plugin -> manage_search('upgrade', $eplug_folder);
 368      $plugin -> manage_notify('upgrade', $eplug_folder);
 369  
 370      $eplug_addons = $plugin -> getAddons($eplug_folder);
 371  
 372      $text .= (isset($eplug_upgrade_done)) ? '<br />'.$eplug_upgrade_done : "<br />".LAN_UPGRADE_SUCCESSFUL;
 373      $sql->db_Update('plugin', "plugin_version ='{$eplug_version}', plugin_addons='{$eplug_addons}' WHERE plugin_id='$id' ");
 374      $ns->tablerender(EPL_ADLAN_34, $text);
 375  
 376      $plugin -> save_addon_prefs();
 377  }
 378  
 379  
 380  // Check for new plugins, create entry in plugin table ...
 381  
 382  $plugin->update_plugins_table();
 383  
 384  // ----------------------------------------------------------
 385  //        render plugin information ...
 386  
 387  /* plugin upload form */
 388  
 389  if(!is_writable(e_PLUGIN)) {
 390      $ns->tablerender(EPL_ADLAN_40, EPL_ADLAN_44);
 391  } else {
 392      $text = "<div style='text-align:center'>
 393      <form enctype='multipart/form-data' method='post' action='".e_SELF."'>
 394      <table style='".ADMIN_WIDTH."' class='fborder'>
 395      <tr>
 396      <td class='forumheader3' style='width: 50%;'>".EPL_ADLAN_37."</td>
 397      <td class='forumheader3' style='width: 50%;'>
 398      <input type='hidden' name='MAX_FILE_SIZE' value='1000000' />
 399      <input type='hidden' name='ac' value='".md5(ADMINPWCHANGE)."' />
 400      <input class='tbox' type='file' name='file_userfile[]' size='50' />
 401      </td>
 402      </tr>
 403      <tr>
 404      <td colspan='2' style='text-align:center' class='forumheader'>
 405      <input class='button' type='submit' name='upload' value='".EPL_ADLAN_38."' />
 406      </td>
 407      </tr>
 408      </table>
 409      </form>
 410      <br />\n";
 411  }
 412  // Uninstall and Install sorting should be fixed once and for all now !
 413  $installed = $plugin->getall(1);
 414  $uninstalled = $plugin->getall(0);
 415  
 416  $text .= "<table style='".ADMIN_WIDTH."' class='fborder'>";
 417  $text .= "<tr><td class='fcaption' colspan='3'>".EPL_ADLAN_22."</td></tr>";
 418  $text .= render_plugs($installed);
 419  $text .= "<tr><td class='fcaption' colspan='3'>".EPL_ADLAN_23."</td></tr>";
 420  $text .= render_plugs($uninstalled);
 421  
 422  
 423  function render_plugs($pluginList){
 424      global $tp;
 425  
 426      foreach($pluginList as $plug) {
 427      //Unset any possible eplug_ variables set by last plugin.php
 428          $defined_vars = array_keys(get_defined_vars());
 429          foreach($defined_vars as $varname) {
 430              if (substr($varname, 0, 6) == 'eplug_' || substr($varname, 0, 8) == 'upgrade_') {
 431                  unset($$varname);
 432              }
 433          }
 434  
 435          include(e_PLUGIN.$plug['plugin_path'].'/plugin.php');
 436  
 437          // See whether plugin needs install - it does if any of the 'configuration' variables are set
 438           if ($eplug_conffile || is_array($eplug_table_names) || is_array($eplug_prefs) || is_array($eplug_array_pref) || is_array($eplug_user_prefs) || is_array($eplug_sc) || is_array($eplug_bb) || $eplug_module || $eplug_userclass || $eplug_status || $eplug_latest) {
 439              $img = (!$plug['plugin_installflag'] ? "<img src='".e_IMAGE."admin_images/uninstalled.png' alt='' />" : "<img src='".e_IMAGE."admin_images/installed.png' alt='' />");
 440          } else {
 441              $img = "<img src='".e_IMAGE."admin_images/noinstall.png' alt='' />";
 442          }
 443  
 444          if ($plug['plugin_version'] != $eplug_version && $plug['plugin_installflag']) {
 445              $img = "<img src='".e_IMAGE."admin_images/upgrade.png' alt='' />";
 446          }
 447  
 448          $plugin_icon = $eplug_icon ? "<img src='".e_PLUGIN.$eplug_icon."' alt='' style='border:0px;vertical-align: bottom; width: 32px; height: 32px' />" : E_32_CAT_PLUG;
 449          if ($eplug_conffile && $plug['plugin_installflag'] == TRUE) {
 450              $conf_title = LAN_CONFIGURE.' '.$tp->toHtml($eplug_name,"","defs,emotes_off, no_make_clickable");
 451              $plugin_icon = "<a title='{$conf_title}' href='".e_PLUGIN.$eplug_folder.'/'.$eplug_conffile."' >".$plugin_icon.'</a>';
 452          }
 453  
 454          $text .= "
 455          <tr>
 456          <td class='forumheader3' style='width:160px; text-align:center; vertical-align:top'>
 457          <table style='width:100%'><tr><td style='text-align:left;width:40px;vertical-align:top'>
 458          ".$plugin_icon."
 459          </td><td>
 460          $img <b>".$tp->toHTML($plug['plugin_name'],FALSE,"defs,emotes_off, no_make_clickable")."</b><br />".EPL_ADLAN_11." {$plug['plugin_version']}
 461          <br />";
 462  
 463          $text .="</td>
 464          </tr></table>
 465          </td>
 466          <td class='forumheader3' style='vertical-align:top'>
 467          <table cellspacing='3' style='width:98%'>
 468          <tr><td style='vertical-align:top;width:15%'><b>".EPL_ADLAN_12."</b>:</td><td style='vertical-align:top'><a href='mailto:$eplug_email' title='$eplug_email'>$eplug_author</a>&nbsp;";
 469          if($eplug_url){
 470              $text .= "&nbsp;&nbsp;[ <a href='$eplug_url' title='$eplug_url' >".EPL_WEBSITE."</a> ] ";
 471          }
 472          $text .="</td></tr>
 473          <tr><td style='vertical-align:top'><b>".EPL_ADLAN_14."</b>:</td><td style='vertical-align:top'> $eplug_description&nbsp;";
 474          if ($eplug_readme) {
 475              $text .= "[ <a href='".e_PLUGIN.$eplug_folder."/".$eplug_readme."'>".$eplug_readme."</a> ]";
 476          }
 477  
 478          $text .="</td></tr>
 479          <tr><td style='vertical-align:top'><b>".EPL_ADLAN_13."</b>:</td><td style='vertical-align:top'><span style='vertical-align:top'> $eplug_compatible&nbsp;</span>";
 480          if ($eplug_compliant) {
 481              $text .= "&nbsp;&nbsp;<img src='".e_IMAGE."generic/valid-xhtml11_small.png' alt='' style='margin-top:0px' />";
 482          }
 483          $text .="</td></tr>\n";
 484  
 485  
 486          $text .= "</table></td>";
 487          $text .= "<td class='forumheader3' style='width:70px;text-align:center'>";
 488          if ($eplug_conffile || $eplug_module || is_array($eplug_table_names) || is_array($eplug_prefs) || is_array($eplug_user_prefs) || is_array($eplug_sc) || is_array($eplug_bb) || $eplug_status || $eplug_latest) {
 489              $text .= ($plug['plugin_installflag'] ? "<input type='button' class='button' onclick=\"location.href='".e_SELF."?uninstall.{$plug['plugin_id']}'\" title='".EPL_ADLAN_1."' value='".EPL_ADLAN_1."' /> " : "<input type='button' class='button' onclick=\"location.href='".e_SELF."?install.{$plug['plugin_id']}'\" title='".EPL_ADLAN_0."' value='".EPL_ADLAN_0."' />");
 490          } else {
 491                 if ($eplug_menu_name) {
 492                  $text .= EPL_NOINSTALL.str_replace("..", "", e_PLUGIN.$plug['plugin_path'])."/ ".EPL_DIRECTORY;
 493              } else {
 494                  $text .= EPL_NOINSTALL_1.str_replace("..", "", e_PLUGIN.$plug['plugin_path'])."/ ".EPL_DIRECTORY;
 495                  if($plug['plugin_installflag'] == FALSE){
 496                      global $sql;
 497                      $sql->db_Delete('plugin', "plugin_installflag=0 AND (plugin_path='{$plug['plugin_path']}' OR plugin_path='{$plug['plugin_path']}/' )  ");
 498                  }
 499              }
 500          }
 501  
 502          if ($plug['plugin_version'] != $eplug_version && $plug['plugin_installflag']) {
 503              $text .= "<br /><input type='button' class='button' onclick=\"location.href='".e_SELF."?upgrade.{$plug['plugin_id']}'\" title='".EPL_UPGRADE." to v".$eplug_version."' value='".EPL_UPGRADE."' />";
 504          }
 505  
 506          $text .="</td>";
 507          $text .= "</tr>";
 508      }
 509  
 510  
 511  return $text;
 512  }
 513  
 514  $text .= "</table>
 515      <div style='text-align:center'><br />
 516      <img src='".e_IMAGE."admin_images/uninstalled.png' alt='' /> ".EPL_ADLAN_23."&nbsp;&nbsp;
 517      <img src='".e_IMAGE."admin_images/installed.png' alt='' /> ".EPL_ADLAN_22."&nbsp;&nbsp;
 518      <img src='".e_IMAGE."admin_images/upgrade.png' alt='' /> ".EPL_ADLAN_24."&nbsp;&nbsp;
 519      <img src='".e_IMAGE."admin_images/noinstall.png' alt='' /> ".EPL_ADLAN_25."</div></div>";
 520  
 521  $ns->tablerender(EPL_ADLAN_16, $text);
 522  // ----------------------------------------------------------
 523  
 524  require_once ("footer.php");
 525  exit;
 526  
 527  
 528  function show_uninstall_confirm()
 529  {
 530      global $plugin, $tp, $id, $ns;
 531      $id = intval($id);
 532      $plug = $plugin->getinfo($id);
 533  
 534      if ($plug['plugin_installflag'] == TRUE )
 535      {
 536          include(e_PLUGIN.$plug['plugin_path'].'/plugin.php');
 537      }
 538  
 539      if(is_writable(e_PLUGIN.$plug['plugin_path']))
 540      {
 541          $del_text = "
 542          <select class='tbox' name='delete_files'>
 543          <option value='0'>".LAN_NO."</option>
 544          <option value='1'>".LAN_YES."</option>
 545          </select>
 546          ";
 547      }
 548      else
 549      {
 550          $del_text = "
 551          ".EPL_ADLAN_53."
 552          <input type='hidden' name='delete_files' value='0' />
 553          ";
 554      }
 555  
 556      $text = "
 557      <form action='".e_SELF."?".e_QUERY."' method='post'>
 558      <table style='".ADMIN_WIDTH."' class='fborder'>
 559      <tr>
 560          <td colspan='2' class='forumheader'>".EPL_ADLAN_54." ".$tp->toHtml($eplug_name,"","defs,emotes_off, no_make_clickable")."</td>
 561      </tr>
 562      <tr>
 563          <td class='forumheader3'>".EPL_ADLAN_55."</td>
 564          <td class='forumheader3'>".LAN_YES."</td>
 565      </tr>
 566      <tr>
 567          <td class='forumheader3' style='width:75%'>
 568              ".EPL_ADLAN_57."<div class='smalltext'>".EPL_ADLAN_58."</div>
 569          </td>
 570          <td class='forumheader3'>
 571              <select class='tbox' name='delete_tables'>
 572              <option value='1'>".LAN_YES."</option>
 573              <option value='0'>".LAN_NO."</option>
 574              </select>
 575          </td>
 576      </tr>
 577      <tr>
 578          <td class='forumheader3'>".EPL_ADLAN_59."<div class='smalltext'>".EPL_ADLAN_60."</div></td>
 579          <td class='forumheader3'>{$del_text}</td>
 580      </tr>
 581      <tr>
 582          <td colspan='2' class='forumheader' style='text-align:center'><input class='button' type='submit' name='uninstall_confirm' value=\"".EPL_ADLAN_3."\" />&nbsp;&nbsp;<input class='button' type='submit' name='uninstall_cancel' value='".EPL_ADLAN_62."' onclick=\"location.href='".e_SELF."'; return false;\"/></td>
 583      </tr>
 584      </table>
 585      </form>
 586      ";
 587      $ns->tablerender(EPL_ADLAN_63." ".$tp->toHtml($eplug_name,"","defs,emotes_off, no_make_clickable"), $text);
 588      require_once(e_ADMIN."footer.php");
 589      exit;
 590  }
 591  
 592  ?>


Généré le : Sun Apr 1 01:23:32 2007 par Balluche grâce à PHPXref 0.7