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

Make plugin works as expected using webservice.

File:
1 copied

Legend:

Unmodified
Added
Removed
  • extensions/user_tags/include/autoload.inc.php

    r11099 r11741  
    2020// +-----------------------------------------------------------------------+
    2121
    22 if (!defined('PHPWG_ROOT_PATH')) {
    23   die('Hacking attempt!');
     22global $__t4u_autoload;
     23$__t4u_autoload['t4u_Ws'] = T4U_PLUGIN_ROOT . '/include/t4u_ws.class.php';
     24$__t4u_autoload['t4u_Config'] = T4U_PLUGIN_ROOT . '/include/t4u_config.class.php';
     25$__t4u_autoload['t4u_Content'] = T4U_PLUGIN_ROOT . '/include/t4u_content.class.php';
     26
     27
     28if (function_exists('spl_autoload_register')) {
     29  spl_autoload_register('t4u_autoload');
     30} else {
     31  function __autoload($name) {
     32    t4u_autoload($name);
     33  }
    2434}
    2535
    26 if (!empty($_GET['action']) && in_array($_GET['action'], array('add', 'get'))) {
    27   include_once T4U_PLUGIN_ROOT . "/include/t4u_admin_action.inc.php";
     36function t4u_autoload($name) {
     37  global $__t4u_autoload;
     38
     39  if (!empty($__t4u_autoload[$name])) {
     40    require_once $__t4u_autoload[$name];
     41  }
    2842}
    29 
    30 include_once T4U_PLUGIN_ROOT . "/include/t4u_content.class.php";
    31 
    32 $public_content = new t4u_Content($plugin_config);
    33 add_event_handler('render_element_content',
    34                   array($public_content, 'render_element_content'),
    35                   EVENT_HANDLER_PRIORITY_NEUTRAL,
    36                   2
    37                   );
    38 ?>
Note: See TracChangeset for help on using the changeset viewer.