Ignore:
Timestamp:
Jul 14, 2011, 4:01:17 PM (13 years ago)
Author:
nikrou
Message:

Make plugin works as expected using webservice.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/user_tags/include/t4u_config.class.php

    r11081 r11741  
    2222class t4u_Config
    2323{
    24     private
    25       $config = array(),
    26       $plugin_dir;
     24  private $config = array();
     25  protected static $instance;
    2726
    2827  public function __construct($plugin_dir, $plugin_name) {
     
    3534
    3635    if (!file_exists($this->get_config_filename())) {
     36      $this->setDefaults();
    3737      $this->save_config();
    3838    }
    3939  }
     40
     41  public static function getInstance() {
     42    if (!isset(self::$instance)) {
     43      self::$instance = new t4u_Config(T4U_PLUGIN_ROOT, T4U_PLUGIN_NAME);
     44    }
     45    return self::$instance;
     46  }
     47
    4048
    4149  public function load_config() {
     
    4553      $this->config = $c;
    4654    }
    47     $this->setDefaults();
    4855  }
    4956
     
    100107 
    101108  public function getActionUrl($action, $method='POST') {
    102     $url = get_root_url().'admin.php?page=plugin';
    103     $file = basename($this->plugin_dir) . '/' .'admin.php';
    104     if (strtoupper($method)=='POST') {
    105         $url .= '&section='.urlencode($file);
    106         $url .= '&action='.urlencode($action);
    107     } else {
    108         $url .= '&section='.$file;
    109         $url .= '&action='.$action;
    110     }
     109    $ws = get_root_url();
     110    $ws .= 'ws.php?format=json&method=user_tags.tags.list';
    111111
    112     return $url;
     112    /* $url = get_root_url().'admin.php?page=plugin'; */
     113    /* $file = basename($this->plugin_dir) . '/' .'admin.php'; */
     114    /* if (strtoupper($method)=='POST') { */
     115    /*  $url .= '&section='.urlencode($file); */
     116    /*  $url .= '&action='.urlencode($action); */
     117    /* } else { */
     118    /*  $url .= '&section='.$file; */
     119    /*  $url .= '&action='.$action; */
     120    /* } */
     121
     122    return $ws;
    113123  }
    114124
Note: See TracChangeset for help on using the changeset viewer.