plugins/admin/PluginManager.php
author Dan
Sun, 06 Dec 2009 18:22:02 -0500
changeset 1146 4a90e6e46937
parent 1081 745200a9cc2a
child 1227 bdac73ed481e
permissions -rw-r--r--
PostgreSQL: fixed Admin:SecurityLog database error
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
519
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
     1
<?php
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
     2
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
     3
/*
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
     4
 * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
1081
745200a9cc2a Fixed some upgrade bugs; added support for choosing one's own date/time formats; rebrand as 1.1.7
Dan
parents: 1000
diff changeset
     5
 * Copyright (C) 2006-2009 Dan Fuhry
519
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
     6
 *
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
     7
 * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
     8
 * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
     9
 *
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    10
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    11
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    12
 */
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    13
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    14
/**
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    15
 * SYNOPSIS OF PLUGIN FRAMEWORK
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    16
 *
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    17
 * The new plugin manager is making an alternative approach to managing plugin files by allowing metadata to be embedded in them
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    18
 * or optionally included from external files. This method is API- and format-compatible with old plugins. The change is being
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    19
 * made because we believe this will provide greater flexibility within plugin files.
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    20
 * 
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    21
 * Plugin files can contain one or more specially formatted comment blocks with metadata, language strings, and installation or
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    22
 * upgrade SQL schemas. For this to work, plugins need to define their version numbers in an Enano-readable and standardized
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    23
 * format, and we think the best way to do this is with JSON. It is important that plugins define both the current version and
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    24
 * a list of all past versions, and then have upgrade sections telling which version they go from and which one they go to.
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    25
 * 
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    26
 * The format for the special comment blocks is:
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    27
 <code>
527
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
    28
 /**!blocktype( param1 = "value1"; [ param2 = "value2"; ... ] )**
519
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    29
 
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    30
 ... block content ...
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    31
 
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    32
 **!* / (remove that last space)
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    33
 </code>
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    34
 * The format inside blocks varies. Metadata and language strings will be in JSON; installation and upgrade schemas will be in
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    35
 * SQL. You can include an external file into a block using the following syntax inside of a block:
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    36
 <code>
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    37
 !include "path/to/file"
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    38
 </code>
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    39
 * The file will always be relative to the Enano root. So if your plugin has a language file in ENANO_ROOT/plugins/fooplugin/,
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    40
 * you would use "plugins/fooplugin/language.json".
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    41
 *
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    42
 * The format for plugin metadata is as follows:
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    43
 <code>
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    44
 /**!info**
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    45
 {
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    46
   "Plugin Name" : "Foo plugin",
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    47
   "Plugin URI" : "http://fooplugin.enanocms.org/",
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    48
   "Description" : "Some short descriptive text",
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    49
   "Author" : "John Doe",
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    50
   "Version" : "0.1",
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    51
   "Author URI" : "http://yourdomain.com/",
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    52
   "Version list" : [ "0.1-alpha1", "0.1-alpha2", "0.1-beta1", "0.1" ]
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    53
 }
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    54
 **!* /
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    55
 </code>
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    56
 * This is the format for language data:
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    57
 <code>
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    58
 /**!language**
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    59
 {
527
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
    60
   // each entry at this level should be an ISO-639-1 language code.
519
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    61
   eng: {
527
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
    62
     // from here on in is the standard langauge file format
519
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    63
     categories: [ 'meta', 'foo', 'bar' ],
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    64
     strings: {
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    65
       meta: {
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    66
         foo: "Foo strings",
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    67
         bar: "Bar strings"
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    68
       },
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    69
       foo: {
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    70
         string_name: "string value",
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    71
         string_name_2: "string value 2"
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    72
       }
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    73
     }
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    74
   }
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    75
 }
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    76
 **!* / (once more, remove the space in there)
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    77
 </code>
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    78
 * Here is the format for installation schemas:
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    79
 <code>
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    80
 /**!install**
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    81
 
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    82
 CREATE TABLE {{TABLE_PREFIX}}foo_table(
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    83
   ...
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    84
 )
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    85
 
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    86
 **!* /
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    87
 </code>
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    88
 * And finally, the format for upgrade schemas:
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    89
 <code>
527
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
    90
 /**!upgrade from = "0.1-alpha1"; to = "0.1-alpha2"; **
519
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    91
 
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    92
 **!* /
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    93
 </code>
527
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
    94
 * As a courtesy to your users, we ask that you also include an "uninstall" block that reverses any changes your plugin makes
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
    95
 * to the database upon installation. The syntax is identical to that of the install block.
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
    96
 * 
519
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    97
 * Remember that upgrades will always be done incrementally, so if the user is upgrading 0.1-alpha2 to 0.1, Enano's plugin
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
    98
 * engine will run the 0.1-alpha2 to 0.1-beta1 upgrader, then the 0.1-beta1 to 0.1 upgrader, going by the versions listed in
527
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
    99
 * the example metadata block above. As with the standard Enano installer, prefixing a query with '@' will cause it to be
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   100
 * performed "blindly", e.g. not checked for errors.
519
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   101
 * 
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   102
 * All of this information is effective as of Enano 1.1.4.
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   103
 */
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   104
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   105
// Plugin manager "2.0"
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   106
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   107
function page_Admin_PluginManager()
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   108
{
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   109
  global $db, $session, $paths, $template, $plugins; // Common objects
999
61d492c43e5f Fixed two bugs: PluginManager: forgot to import cache; PageManager: now queries pages with buffered query (temporary fix)
Dan
parents: 975
diff changeset
   110
  global $lang, $cache;
519
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   111
  if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN )
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   112
  {
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   113
    $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true);
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   114
    echo '<h3>' . $lang->get('adm_err_not_auth_title') . '</h3>';
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   115
    echo '<p>' . $lang->get('adm_err_not_auth_body', array( 'login_link' => $login_link )) . '</p>';
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   116
    return;
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   117
  }
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   118
  
1000
dbefcae6b5cd Fixed: cache was being used during plugin fetch, so newly placed plugin files were not listed
Dan
parents: 999
diff changeset
   119
  $plugin_list = $plugins->get_plugin_list(null, false);
527
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   120
  
519
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   121
  // Are we processing an AJAX request from the smartform?
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   122
  if ( $paths->getParam(0) == 'action.json' )
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   123
  {
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   124
    // Set to application/json to discourage advertisement scripts
812
68060328e9c6 Added CLI installer. Supports interactive, command-line, and internal-call installation. Fixed a few bugs related to anti-SQL injection parser and plugin installation.
Dan
parents: 801
diff changeset
   125
    header('Content-Type: text/javascript');
519
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   126
    
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   127
    // Init return data
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   128
    $return = array('mode' => 'error', 'error' => 'undefined');
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   129
    
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   130
    // Start parsing process
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   131
    try
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   132
    {
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   133
      // Is the request properly sent on POST?
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   134
      if ( isset($_POST['r']) )
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   135
      {
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   136
        // Try to decode the request
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   137
        $request = enano_json_decode($_POST['r']);
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   138
        // Is the action to perform specified?
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   139
        if ( isset($request['mode']) )
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   140
        {
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   141
          switch ( $request['mode'] )
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   142
          {
527
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   143
            case 'install':
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   144
              // did they specify a plugin to operate on?
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   145
              if ( !isset($request['plugin']) )
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   146
              {
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   147
                $return = array(
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   148
                  'mode' => 'error',
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   149
                  'error' => 'No plugin specified.',
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   150
                );
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   151
                break;
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   152
              }
869
58bc29c14a4d Plugins: Added checks and additional warning for authentication plugins.
Dan
parents: 844
diff changeset
   153
              if ( !isset($request['install_confirmed']) )
58bc29c14a4d Plugins: Added checks and additional warning for authentication plugins.
Dan
parents: 844
diff changeset
   154
              {
58bc29c14a4d Plugins: Added checks and additional warning for authentication plugins.
Dan
parents: 844
diff changeset
   155
                if ( $plugins->is_file_auth_plugin($request['plugin']) )
58bc29c14a4d Plugins: Added checks and additional warning for authentication plugins.
Dan
parents: 844
diff changeset
   156
                {
58bc29c14a4d Plugins: Added checks and additional warning for authentication plugins.
Dan
parents: 844
diff changeset
   157
                  $return = array(
58bc29c14a4d Plugins: Added checks and additional warning for authentication plugins.
Dan
parents: 844
diff changeset
   158
                    'confirm_title' => 'acppl_msg_confirm_authext_title',
58bc29c14a4d Plugins: Added checks and additional warning for authentication plugins.
Dan
parents: 844
diff changeset
   159
                    'confirm_body' => 'acppl_msg_confirm_authext_body',
58bc29c14a4d Plugins: Added checks and additional warning for authentication plugins.
Dan
parents: 844
diff changeset
   160
                    'need_confirm' => true,
58bc29c14a4d Plugins: Added checks and additional warning for authentication plugins.
Dan
parents: 844
diff changeset
   161
                    'success' => false
58bc29c14a4d Plugins: Added checks and additional warning for authentication plugins.
Dan
parents: 844
diff changeset
   162
                  );
58bc29c14a4d Plugins: Added checks and additional warning for authentication plugins.
Dan
parents: 844
diff changeset
   163
                  break;
58bc29c14a4d Plugins: Added checks and additional warning for authentication plugins.
Dan
parents: 844
diff changeset
   164
                }
58bc29c14a4d Plugins: Added checks and additional warning for authentication plugins.
Dan
parents: 844
diff changeset
   165
              }
527
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   166
              
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   167
              $return = $plugins->install_plugin($request['plugin'], $plugin_list);
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   168
              break;
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   169
            case 'upgrade':
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   170
              // did they specify a plugin to operate on?
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   171
              if ( !isset($request['plugin']) )
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   172
              {
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   173
                $return = array(
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   174
                  'mode' => 'error',
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   175
                  'error' => 'No plugin specified.',
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   176
                );
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   177
                break;
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   178
              }
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   179
              
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   180
              $return = $plugins->upgrade_plugin($request['plugin'], $plugin_list);
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   181
              break;
555
ac4c6a7f01d8 Added user preference for disabling visual effects in Javascript applets; added re-import button to installed plugins
Dan
parents: 536
diff changeset
   182
            case 'reimport':
ac4c6a7f01d8 Added user preference for disabling visual effects in Javascript applets; added re-import button to installed plugins
Dan
parents: 536
diff changeset
   183
              // did they specify a plugin to operate on?
ac4c6a7f01d8 Added user preference for disabling visual effects in Javascript applets; added re-import button to installed plugins
Dan
parents: 536
diff changeset
   184
              if ( !isset($request['plugin']) )
ac4c6a7f01d8 Added user preference for disabling visual effects in Javascript applets; added re-import button to installed plugins
Dan
parents: 536
diff changeset
   185
              {
ac4c6a7f01d8 Added user preference for disabling visual effects in Javascript applets; added re-import button to installed plugins
Dan
parents: 536
diff changeset
   186
                $return = array(
ac4c6a7f01d8 Added user preference for disabling visual effects in Javascript applets; added re-import button to installed plugins
Dan
parents: 536
diff changeset
   187
                  'mode' => 'error',
ac4c6a7f01d8 Added user preference for disabling visual effects in Javascript applets; added re-import button to installed plugins
Dan
parents: 536
diff changeset
   188
                  'error' => 'No plugin specified.',
ac4c6a7f01d8 Added user preference for disabling visual effects in Javascript applets; added re-import button to installed plugins
Dan
parents: 536
diff changeset
   189
                );
ac4c6a7f01d8 Added user preference for disabling visual effects in Javascript applets; added re-import button to installed plugins
Dan
parents: 536
diff changeset
   190
                break;
ac4c6a7f01d8 Added user preference for disabling visual effects in Javascript applets; added re-import button to installed plugins
Dan
parents: 536
diff changeset
   191
              }
ac4c6a7f01d8 Added user preference for disabling visual effects in Javascript applets; added re-import button to installed plugins
Dan
parents: 536
diff changeset
   192
              
ac4c6a7f01d8 Added user preference for disabling visual effects in Javascript applets; added re-import button to installed plugins
Dan
parents: 536
diff changeset
   193
              $return = $plugins->reimport_plugin_strings($request['plugin'], $plugin_list);
ac4c6a7f01d8 Added user preference for disabling visual effects in Javascript applets; added re-import button to installed plugins
Dan
parents: 536
diff changeset
   194
              break;
527
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   195
            case 'uninstall':
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   196
              // did they specify a plugin to operate on?
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   197
              if ( !isset($request['plugin']) )
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   198
              {
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   199
                $return = array(
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   200
                  'mode' => 'error',
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   201
                  'error' => 'No plugin specified.',
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   202
                );
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   203
                break;
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   204
              }
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   205
              
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   206
              $return = $plugins->uninstall_plugin($request['plugin'], $plugin_list);
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   207
              break;
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   208
            case 'disable':
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   209
            case 'enable':
675
872f0048dd81 [Demo Security] Fixed plugin manager ignoring lockdown settings in demo mode
Dan
parents: 582
diff changeset
   210
              // We're not in demo mode. Right?
872f0048dd81 [Demo Security] Fixed plugin manager ignoring lockdown settings in demo mode
Dan
parents: 582
diff changeset
   211
              if ( defined('ENANO_DEMO_MODE') )
872f0048dd81 [Demo Security] Fixed plugin manager ignoring lockdown settings in demo mode
Dan
parents: 582
diff changeset
   212
              {
872f0048dd81 [Demo Security] Fixed plugin manager ignoring lockdown settings in demo mode
Dan
parents: 582
diff changeset
   213
                $return = array(
872f0048dd81 [Demo Security] Fixed plugin manager ignoring lockdown settings in demo mode
Dan
parents: 582
diff changeset
   214
                    'mode' => 'error',
872f0048dd81 [Demo Security] Fixed plugin manager ignoring lockdown settings in demo mode
Dan
parents: 582
diff changeset
   215
                    'error' => $lang->get('acppl_err_demo_mode')
872f0048dd81 [Demo Security] Fixed plugin manager ignoring lockdown settings in demo mode
Dan
parents: 582
diff changeset
   216
                  );
872f0048dd81 [Demo Security] Fixed plugin manager ignoring lockdown settings in demo mode
Dan
parents: 582
diff changeset
   217
                break;
872f0048dd81 [Demo Security] Fixed plugin manager ignoring lockdown settings in demo mode
Dan
parents: 582
diff changeset
   218
              }
527
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   219
              $flags_col = ( $request['mode'] == 'disable' ) ?
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   220
                            "plugin_flags | "  . PLUGIN_DISABLED :
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   221
                            "plugin_flags & ~" . PLUGIN_DISABLED;
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   222
              // did they specify a plugin to operate on?
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   223
              if ( !isset($request['plugin']) )
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   224
              {
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   225
                $return = array(
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   226
                  'mode' => 'error',
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   227
                  'error' => 'No plugin specified.',
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   228
                );
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   229
                break;
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   230
              }
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   231
              // is the plugin in the directory and already installed?
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   232
              if ( !isset($plugin_list[$request['plugin']]) || (
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   233
                  isset($plugin_list[$request['plugin']]) && !$plugin_list[$request['plugin']]['installed']
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   234
                ))
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   235
              {
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   236
                $return = array(
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   237
                  'mode' => 'error',
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   238
                  'error' => 'Invalid plugin specified.',
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   239
                );
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   240
                break;
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   241
              }
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   242
              // get plugin id
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   243
              $dataset =& $plugin_list[$request['plugin']];
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   244
              if ( empty($dataset['plugin id']) )
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   245
              {
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   246
                $return = array(
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   247
                  'mode' => 'error',
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   248
                  'error' => 'Couldn\'t retrieve plugin ID.',
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   249
                );
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   250
                break;
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   251
              }
529
7803c9db3506 Implemented security logging for plugin management
Dan
parents: 527
diff changeset
   252
              
7803c9db3506 Implemented security logging for plugin management
Dan
parents: 527
diff changeset
   253
              // log action
7803c9db3506 Implemented security logging for plugin management
Dan
parents: 527
diff changeset
   254
              $time        = time();
7803c9db3506 Implemented security logging for plugin management
Dan
parents: 527
diff changeset
   255
              $ip_db       = $db->escape($_SERVER['REMOTE_ADDR']);
7803c9db3506 Implemented security logging for plugin management
Dan
parents: 527
diff changeset
   256
              $username_db = $db->escape($session->username);
7803c9db3506 Implemented security logging for plugin management
Dan
parents: 527
diff changeset
   257
              $file_db     = $db->escape($request['plugin']);
7803c9db3506 Implemented security logging for plugin management
Dan
parents: 527
diff changeset
   258
              // request['mode'] is TRUSTED - the case statement will only process if it is one of {enable,disable}.
7803c9db3506 Implemented security logging for plugin management
Dan
parents: 527
diff changeset
   259
              $q = $db->sql_query('INSERT INTO '.table_prefix."logs(log_type, action, time_id, edit_summary, author, page_text) VALUES\n"
7803c9db3506 Implemented security logging for plugin management
Dan
parents: 527
diff changeset
   260
                                . "  ('security', 'plugin_{$request['mode']}', $time, '$ip_db', '$username_db', '$file_db');");
7803c9db3506 Implemented security logging for plugin management
Dan
parents: 527
diff changeset
   261
              if ( !$q )
7803c9db3506 Implemented security logging for plugin management
Dan
parents: 527
diff changeset
   262
                $db->_die();
7803c9db3506 Implemented security logging for plugin management
Dan
parents: 527
diff changeset
   263
              
527
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   264
              // perform update
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   265
              $q = $db->sql_query('UPDATE ' . table_prefix . "plugins SET plugin_flags = $flags_col WHERE plugin_id = {$dataset['plugin id']};");
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   266
              if ( !$q )
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   267
                $db->die_json();
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   268
              
975
bff25c6113ae Cut out two queries per page with plugin loader routine
Dan
parents: 869
diff changeset
   269
              $cache->purge('plugins');
bff25c6113ae Cut out two queries per page with plugin loader routine
Dan
parents: 869
diff changeset
   270
              
527
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   271
              $return = array(
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   272
                'success' => true
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   273
              );
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   274
              break;
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   275
            case 'import':
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   276
              // import all of the plugin_* config entries
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   277
              $q = $db->sql_query('SELECT config_name, config_value FROM ' . table_prefix . "config WHERE config_name LIKE 'plugin_%';");
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   278
              if ( !$q )
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   279
                $db->die_json();
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   280
              
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   281
              while ( $row = $db->fetchrow($q) )
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   282
              {
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   283
                $plugin_filename = preg_replace('/^plugin_/', '', $row['config_name']);
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   284
                if ( isset($plugin_list[$plugin_filename]) && !@$plugin_list[$plugin_filename]['installed'] )
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   285
                {
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   286
                  $return = $plugins->install_plugin($plugin_filename, $plugin_list);
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   287
                  if ( !$return['success'] )
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   288
                    break 2;
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   289
                  if ( $row['config_value'] == '0' )
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   290
                  {
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   291
                    $fn_db = $db->escape($plugin_filename);
791
e6094f56f941 Fixed a few bugs with plugin management and importing of old plugin metadata
Dan
parents: 699
diff changeset
   292
                    $e = $db->sql_query('UPDATE ' . table_prefix . "plugins SET plugin_flags = plugin_flags | " . PLUGIN_DISABLED . " WHERE plugin_filename = '$fn_db';");
e6094f56f941 Fixed a few bugs with plugin management and importing of old plugin metadata
Dan
parents: 699
diff changeset
   293
                    if ( !$e )
527
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   294
                      $db->die_json();
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   295
                  }
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   296
                }
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   297
              }
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   298
              $db->free_result($q);
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   299
              
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   300
              $q = $db->sql_query('DELETE FROM ' . table_prefix . "config WHERE config_name LIKE 'plugin_%';");
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   301
              if ( !$q )
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   302
                $db->die_json();
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   303
              
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   304
              $return = array('success' => true);
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   305
              break;
519
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   306
            default:
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   307
              // The requested action isn't something this script knows how to do
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   308
              $return = array(
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   309
                'mode' => 'error',
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   310
                'error' => 'Unknown mode "' . $request['mode'] . '" sent in request'
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   311
              );
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   312
              break;
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   313
          }
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   314
        }
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   315
        else
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   316
        {
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   317
          // Didn't specify action
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   318
          $return = array(
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   319
            'mode' => 'error',
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   320
            'error' => 'Missing key "mode" in request'
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   321
          );
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   322
        }
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   323
      }
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   324
      else
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   325
      {
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   326
        // Didn't send a request
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   327
        $return = array(
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   328
          'mode' => 'error',
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   329
          'error' => 'No request specified'
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   330
        );
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   331
      }
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   332
    }
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   333
    catch ( Exception $e )
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   334
    {
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   335
      // Sent a request but it's not valid JSON
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   336
      $return = array(
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   337
          'mode' => 'error',
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   338
          'error' => 'Invalid request - JSON parsing failed'
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   339
        );
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   340
    }
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   341
    
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   342
    echo enano_json_encode($return);
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   343
    
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   344
    return true;
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   345
  }
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   346
  
844
7549f2880c32 Plugin manager: system plugins now sorted to last
Dan
parents: 812
diff changeset
   347
  // Sort so that system plugins come last
7549f2880c32 Plugin manager: system plugins now sorted to last
Dan
parents: 812
diff changeset
   348
  ksort($plugin_list);
7549f2880c32 Plugin manager: system plugins now sorted to last
Dan
parents: 812
diff changeset
   349
  $plugin_list_sorted = array();
7549f2880c32 Plugin manager: system plugins now sorted to last
Dan
parents: 812
diff changeset
   350
  foreach ( $plugin_list as $filename => $data )
7549f2880c32 Plugin manager: system plugins now sorted to last
Dan
parents: 812
diff changeset
   351
  {
7549f2880c32 Plugin manager: system plugins now sorted to last
Dan
parents: 812
diff changeset
   352
    if ( !$data['system plugin'] )
7549f2880c32 Plugin manager: system plugins now sorted to last
Dan
parents: 812
diff changeset
   353
    {
7549f2880c32 Plugin manager: system plugins now sorted to last
Dan
parents: 812
diff changeset
   354
      $plugin_list_sorted[$filename] = $data;
7549f2880c32 Plugin manager: system plugins now sorted to last
Dan
parents: 812
diff changeset
   355
    }
7549f2880c32 Plugin manager: system plugins now sorted to last
Dan
parents: 812
diff changeset
   356
  }
7549f2880c32 Plugin manager: system plugins now sorted to last
Dan
parents: 812
diff changeset
   357
  ksort($plugin_list_sorted);
7549f2880c32 Plugin manager: system plugins now sorted to last
Dan
parents: 812
diff changeset
   358
  foreach ( $plugin_list as $filename => $data )
7549f2880c32 Plugin manager: system plugins now sorted to last
Dan
parents: 812
diff changeset
   359
  {
7549f2880c32 Plugin manager: system plugins now sorted to last
Dan
parents: 812
diff changeset
   360
    if ( $data['system plugin'] )
7549f2880c32 Plugin manager: system plugins now sorted to last
Dan
parents: 812
diff changeset
   361
    {
7549f2880c32 Plugin manager: system plugins now sorted to last
Dan
parents: 812
diff changeset
   362
      $plugin_list_sorted[$filename] = $data;
7549f2880c32 Plugin manager: system plugins now sorted to last
Dan
parents: 812
diff changeset
   363
    }
7549f2880c32 Plugin manager: system plugins now sorted to last
Dan
parents: 812
diff changeset
   364
  }
7549f2880c32 Plugin manager: system plugins now sorted to last
Dan
parents: 812
diff changeset
   365
  
7549f2880c32 Plugin manager: system plugins now sorted to last
Dan
parents: 812
diff changeset
   366
  $plugin_list =& $plugin_list_sorted;
7549f2880c32 Plugin manager: system plugins now sorted to last
Dan
parents: 812
diff changeset
   367
  
519
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   368
  //
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   369
  // Not a JSON request, output normal HTML interface
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   370
  //
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   371
  
526
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   372
  // start printing things out
531
510160f15a69 [HIG] Added a little heading and intro message to the top of the plugin manager
Dan
parents: 529
diff changeset
   373
  echo '<h3>' . $lang->get('acppl_heading_main') . '</h3>';
510160f15a69 [HIG] Added a little heading and intro message to the top of the plugin manager
Dan
parents: 529
diff changeset
   374
  echo '<p>' . $lang->get('acppl_intro') . '</p>';
526
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   375
  ?>
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   376
  <div class="tblholder">
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   377
    <table border="0" cellspacing="1" cellpadding="5">
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   378
      <?php
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   379
      $rowid = '2';
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   380
      foreach ( $plugin_list as $filename => $data )
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   381
      {
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   382
        // print out all plugins
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   383
        $rowid = ( $rowid == '1' ) ? '2' : '1';
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   384
        $plugin_name = ( preg_match('/^[a-z0-9_]+$/', $data['plugin name']) ) ? $lang->get($data['plugin name']) : $data['plugin name'];
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   385
        $plugin_basics = $lang->get('acppl_lbl_plugin_name', array(
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   386
            'plugin' => $plugin_name,
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   387
            'author' => $data['author']
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   388
          ));
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   389
        $color = '';
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   390
        $buttons = '';
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   391
        if ( $data['system plugin'] )
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   392
        {
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   393
          $status = $lang->get('acppl_lbl_status_system');
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   394
        }
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   395
        else if ( $data['installed'] && !( $data['status'] & PLUGIN_DISABLED ) && !( $data['status'] & PLUGIN_OUTOFDATE ) )
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   396
        {
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   397
          // this plugin is all good
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   398
          $color = '_green';
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   399
          $status = $lang->get('acppl_lbl_status_installed');
555
ac4c6a7f01d8 Added user preference for disabling visual effects in Javascript applets; added re-import button to installed plugins
Dan
parents: 536
diff changeset
   400
          $buttons = 'reimport|uninstall|disable';
526
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   401
        }
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   402
        else if ( $data['installed'] && $data['status'] & PLUGIN_OUTOFDATE )
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   403
        {
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   404
          $color = '_red';
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   405
          $status = $lang->get('acppl_lbl_status_need_upgrade');
527
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   406
          $buttons = 'uninstall|upgrade';
526
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   407
        }
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   408
        else if ( $data['installed'] && $data['status'] & PLUGIN_DISABLED )
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   409
        {
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   410
          $color = '_red';
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   411
          $status = $lang->get('acppl_lbl_status_disabled');
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   412
          $buttons = 'uninstall|enable';
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   413
        }
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   414
        else
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   415
        {
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   416
          $color = '_red';
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   417
          $status = $lang->get('acppl_lbl_status_uninstalled');
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   418
          $buttons = 'install';
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   419
        }
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   420
        $uuid = md5($data['plugin name'] . $data['version'] . $filename);
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   421
        $desc = ( preg_match('/^[a-z0-9_]+$/', $data['description']) ) ? $lang->get($data['description']) : $data['description'];
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   422
        $desc = sanitize_html($desc);
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   423
        
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   424
        $additional = '';
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   425
        
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   426
        // filename
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   427
        $additional .= '<b>' . $lang->get('acppl_lbl_filename') . '</b> ' . "{$filename}<br />";
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   428
        
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   429
        // plugin's site
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   430
        $data['plugin uri'] = htmlspecialchars($data['plugin uri']);
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   431
        $additional .= '<b>' . $lang->get('acppl_lbl_plugin_site') . '</b> ' . "<a href=\"{$data['plugin uri']}\">{$data['plugin uri']}</a><br />";
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   432
        
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   433
        // author's site
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   434
        $data['author uri'] = htmlspecialchars($data['author uri']);
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   435
        $additional .= '<b>' . $lang->get('acppl_lbl_author_site') . '</b> ' . "<a href=\"{$data['author uri']}\">{$data['author uri']}</a><br />";
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   436
        
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   437
        // version
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   438
        $additional .= '<b>' . $lang->get('acppl_lbl_version') . '</b> ' . "{$data['version']}<br />";
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   439
        
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   440
        // installed version
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   441
        if ( $data['status'] & PLUGIN_OUTOFDATE )
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   442
        {
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   443
          $additional .= '<b>' . $lang->get('acppl_lbl_installed_version') . '</b> ' . "{$data['version installed']}<br />";
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   444
        }
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   445
        
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   446
        // build list of buttons
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   447
        $buttons_html = '';
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   448
        if ( !empty($buttons) )
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   449
        {
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   450
          $filename_js = addslashes($filename);
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   451
          $buttons = explode('|', $buttons);
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   452
          $colors = array(
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   453
              'install' => 'green',
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   454
              'disable' => 'blue',
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   455
              'enable' => 'blue',
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   456
              'upgrade' => 'green',
555
ac4c6a7f01d8 Added user preference for disabling visual effects in Javascript applets; added re-import button to installed plugins
Dan
parents: 536
diff changeset
   457
              'uninstall' => 'red',
ac4c6a7f01d8 Added user preference for disabling visual effects in Javascript applets; added re-import button to installed plugins
Dan
parents: 536
diff changeset
   458
              'reimport' => 'green'
526
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   459
            );
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   460
          foreach ( $buttons as $button )
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   461
          {
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   462
            $btnface = $lang->get("acppl_btn_$button");
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   463
            $buttons_html .= "<a href=\"#\" onclick=\"ajaxPluginAction('$button', '$filename_js', this); return false;\" class=\"abutton_{$colors[$button]} abutton\">$btnface</a>\n";
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   464
          }
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   465
        }
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   466
        
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   467
        echo "<tr>
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   468
                <td class=\"row{$rowid}$color\">
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   469
                  <div style=\"float: right;\">
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   470
                    <b>$status</b>
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   471
                  </div>
699
c7d737202d59 Removed Adobe Spry and replaced with jQuery. Please report any new bugs on the forums or via IRC. In a related note, auto-completion should work now at least for usernames. Still hacking away at page name completion...
Dan
parents: 685
diff changeset
   472
                  <div style=\"cursor: pointer;\" onclick=\"if ( !this.fx ) { load_component('jquery'); load_component('jquery-ui'); load_component('messagebox'); load_component('ajax'); this.fx = true; } $('#plugininfo_$uuid').toggle('blind', {}, 500);\">
526
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   473
                    $plugin_basics
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   474
                  </div>
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   475
                  <span class=\"menuclear\"></span>
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   476
                  <div id=\"plugininfo_$uuid\" style=\"display: none;\">
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   477
                    $desc
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   478
                    <div style=\"padding: 5px;\">
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   479
                      $additional
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   480
                      <div style=\"float: right; position: relative; top: -10px;\">
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   481
                        $buttons_html
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   482
                      </div>
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   483
                      <span class=\"menuclear\"></span>
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   484
                    </div>
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   485
                  </div>
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   486
                </td>
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   487
              </tr>";
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   488
      }
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   489
      ?>
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   490
    </table>
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   491
  </div>
b2fb50d572c7 New plugin manager half-implemented. Most of the UI/frontend code is done. Moved sql_parse.php to /includes/ to allow use after installation - TODO: check installer, etc. for breakage
Dan
parents: 524
diff changeset
   492
  <?php
527
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   493
  // are there still old style plugin entries?
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   494
  $q = $db->sql_query('SELECT 1 FROM ' . table_prefix . "config WHERE config_name LIKE 'plugin_%';");
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   495
  if ( !$q )
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   496
    $db->_die();
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   497
  
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   498
  $count = $db->numrows();
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   499
  $db->free_result($q);
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   500
  
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   501
  if ( $count > 0 )
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   502
  {
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   503
    echo '<h3>' . $lang->get('acppl_msg_old_entries_title') . '</h3>';
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   504
    echo '<p>' . $lang->get('acppl_msg_old_entries_body') . '</p>';
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   505
    echo '<p><a class="abutton abutton_green" href="#" onclick="ajaxPluginAction(\'import\', \'\', false); return false;">' . $lang->get('acppl_btn_import_old') . '</a></p>';
21e11f564463 (Hopefully) finished new plugin manager and implemented the utilization of it. Still HIGHLY experimental.
Dan
parents: 526
diff changeset
   506
  }
519
94214ec0871c Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
diff changeset
   507
}