1<?php
2/**
3 * AJAX call handler for tabinclude plugin
4 *
5 * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
6 * @author     Ikuo Obataya <I.Obataya@gmail.com>
7 */
8if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../../').'/');
9if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
10require_once(DOKU_INC.'inc/init.php');
11require_once(DOKU_INC.'inc/common.php');
12require_once(DOKU_INC.'inc/pageutils.php');
13require_once(DOKU_INC.'inc/auth.php');
14require_once(DOKU_INC.'inc/template.php');
15require_once(DOKU_INC.'inc/html.php');
16
17//close session
18session_write_close();
19
20global $conf;
21global $ID;
22global $INPUT;
23
24//fix for Opera XMLHttpRequests
25$postData = http_get_raw_post_data();
26if(!count($_POST) && !empty($postData)){
27    parse_str($postData, $_POST);
28}
29
30$ID=$_POST['page'];
31if(auth_quickaclcheck($ID) < AUTH_READ) die('No permission to read');
32
33$link = $ID;
34if(strpos($ID,":")===0) $link = substr($ID,1);
35$ACT = 'show';
36$ti = plugin_load('helper','tabinclude');
37$goto = $ti->getLang('gotohere');
38$pagelink = tpl_link(wl($link),$goto,'',true);
39
40if($ti->getConf('goto_link_header')!=0)
41echo '<div class="dwpl-ti-permalink-header">'.$pagelink.'</div>'.NL;
42
43tpl_include_page($ID,true);
44
45if($ti->getConf('goto_link_footer')!=0)
46echo '<div class="dwpl-ti-permalink-footer">'.$pagelink.'</div>'.NL;
47