Ignore:
Timestamp:
Dec 20, 2013, 9:14:40 PM (10 years ago)
Author:
mistic100
Message:

add configuration page

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/AdminTools/maintain.inc.php

    r25617 r26061  
    22defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
    33
    4 // class AdminTools_maintain extends PluginMaintain
    5 // {
    6   // private $installed = false;
     4class AdminTools_maintain extends PluginMaintain
     5{
     6  private $installed = false;
     7 
     8  private $default_conf = array(
     9    'default_open' => true,
     10    'closed_position' => 'left',
     11    'public_quick_edit' => true,
     12    );
    713
    8   // function install($plugin_version, &$errors=array())
    9   // {
    10     // global $conf;
     14  function install($plugin_version, &$errors=array())
     15  {
     16    global $conf;
    1117
    12     // if (empty($conf['AdminTools']))
    13     // {
    14       // $conf['AdminTools'] = serialize(array(
    15         // ));
     18    if (empty($conf['AdminTools']))
     19    {
     20      $conf['AdminTools'] = serialize($this->default_conf);
     21      conf_update_param('AdminTools', $conf['AdminTools']);
     22    }
    1623
    17       // conf_update_param('AdminTools', $conf['AdminTools']);
    18     // }
     24    $this->installed = true;
     25  }
    1926
    20     // $this->installed = true;
    21   // }
     27  function activate($plugin_version, &$errors=array())
     28  {
     29    if (!$this->installed)
     30    {
     31      $this->install($plugin_version, $errors);
     32    }
     33  }
    2234
    23   // function activate($plugin_version, &$errors=array())
    24   // {
    25     // if (!$this->installed)
    26     // {
    27       // $this->install($plugin_version, $errors);
    28     // }
    29   // }
     35  function deactivate()
     36  {
     37  }
    3038
    31   // function deactivate()
    32   // {
    33   // }
    34 
    35   // function uninstall()
    36   // {
    37     // conf_delete_param('AdminTools');
    38   // }
    39 // }
     39  function uninstall()
     40  {
     41    conf_delete_param('AdminTools');
     42  }
     43}
Note: See TracChangeset for help on using the changeset viewer.