Example #1
0
    exit;
}
if ($a->checkAuth()) {
} else {
    exit;
}
$plugins_root = 'tools/';
$plugins = new plugins($plugins_root);
$plugins->getPlugins(true);
$plugins_list = $plugins->getPluginsList();
$PLUGIN_HEAD = '';
$PLUGIN_BODY = '';
if (!empty($_REQUEST['p']) && !empty($plugins_list[$_REQUEST['p']]) && $plugins_list[$_REQUEST['p']]['active']) {
    $p = $_REQUEST['p'];
    $buffer = new buffer();
    $buffer->init();
    include $plugins_root . $p . '/index.php';
    $PLUGIN_BODY = $buffer->getContent();
    $buffer->clean();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="fr" xml:lang="fr">
<head>
  <title><?php 
echo _t('YESWIKI_TOOLS_CONFIG');
?>
</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
Example #2
0
    $a->start();
    exit;
}
if ($a->checkAuth()) {
} else {
    exit;
}
$plugins_root = 'tools/';
$plugins = new plugins($plugins_root);
$plugins->getPlugins(true);
$plugins_list = $plugins->getPluginsList();
$PLUGIN_HEAD = '';
$PLUGIN_BODY = '';
if (!empty($_REQUEST['p']) && !empty($plugins_list[$_REQUEST['p']]) && $plugins_list[$_REQUEST['p']]['active']) {
    $p = $_REQUEST['p'];
    buffer::init();
    include $plugins_root . $p . '/index.php';
    $PLUGIN_BODY = buffer::getContent();
    buffer::clean();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="fr" xml:lang="fr">
<head>
  <title>Configuration extension(s) de WikiNi</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
</head>

<body>
Example #3
0
File: ajax.php Project: rigidus/ea
 function start()
 {
     db::connect();
     if (!router::get(1)) {
         return true;
     }
     self::$map = array('mode' => router::get(0), 'app' => router::get(1), 'module' => 'main', 'action' => router::get(2));
     if (router::get(3)) {
         self::set('module', router::get(2));
         self::set('action', router::get(3));
     }
     s::set('SYS_PATH', 'http://' . SERVER . SYS_DIR);
     define('APP', APPS . self::get('app') . '/');
     s::set('APP', APP);
     define('MODULE', APP . self::get('module') . '/');
     s::set('MODULE', MODULE);
     /*
     	Lang items
     */
     if (self::get('mode') == 'webAjax') {
         web::getSite();
         $lang = lang::gets(LANG_INDEX, SITE_ID);
         /*
         	Authentification webUser
         */
         web::observer();
     } else {
         define('LANG_INDEX', SYS_INDEX);
         $lang = lang::gets(LANG_INDEX);
         admin::observer();
         if (defined('ADMIN_USER_SITE_ID')) {
             define('ADMIN_SITE_ID', ADMIN_USER_SITE_ID);
             s::set('ADMIN_SITE_ID', ADMIN_USER_SITE_ID);
             $group_rules = ini::parse(SYS_ROOT . 'conf/admin/groups.ini', ADMIN_USER_GROUP_ID);
             define('RULE', $group_rules['rule']);
             db::table('admin_sites');
             db::where('site_id', ADMIN_USER_SITE_ID);
             db::limit(1);
             define('ADMIN_SITE', db::get('site_domain'));
             s::set('ADMIN_SITE', ADMIN_SITE);
         }
     }
     /*
     	Set params
     */
     params::send();
     $tmpl = params::get('tmpl');
     $sys = false;
     if (self::get('mode') == 'adminAjax') {
         $sys = true;
     }
     buffer::init(0, self::get('app'), false, $tmpl);
     if (self::get('mode') == 'webAjax') {
         load::handler(self::get('app'), self::get('module'), self::get('action'));
     } else {
         load::module(self::get('app'), self::get('module'), self::get('action'));
     }
     /*
     	Get plugin action
     */
     ob_start();
     /*
     	запуск обработчика с возвратом данных
     	тут два варианта либо данные просто выводим если нет шаблона, а если есть то сначала обрабатываем шаблон
     
     	если буффер полный выводим информацию из него
     */
     $buffer = buffer::gets();
     if ($buffer[0]) {
         if ($sys) {
             buffer::$module = self::get('module');
         }
         $section = params::get('section');
         echo buffer::get($buffer[0]['app'], $buffer[0]['tmpl'], $buffer[0]['data'], $section, $sys);
     }
     $code = ob_get_contents();
     ob_clean();
     s::$mode = 'code';
     s::setTmpl($code, $lang);
     s::display();
 }
Example #4
0
 function getHandlers($code)
 {
     self::$code = $code;
     self::analyse();
     foreach (self::$handlers as $k => $v) {
         buffer::init($k, $v['app'], $v['replace'], $v['tmpl']);
         if (isset($v['params'])) {
             params::send($v['params']);
         }
         load::handler($v['app'], $v['module'], $v['action']);
     }
     self::setHandlers();
     if (self::$handlers_repeat) {
         foreach (self::$handlers_repeat as $k => $v) {
             buffer::init($k, $v['app'], $v['replace'], $v['tmpl']);
             if (isset($v['params'])) {
                 params::send($v['params']);
             }
             load::handler($v['app'], $v['module'], $v['action']);
         }
         self::setHandlersRepeat();
     }
     return self::$code;
 }