Commit 0bed187f authored by Jonny Bradley's avatar Jonny Bradley

[bp r29148,29149,29150] from wysiwyg_ckeditor_update - splitting feature_ajax.

[ENH] ajax: splitting feature_ajax part 1. New pref for xajax
Part 2. Low level xajax pref checks in smarty blocks, smarty and lib. Also added missing pref tests in tiki-index.php
Part 3. replacement of feature_ajax with ajax_xajax in other files using xajax directly. Other areas (such as Google maps, auto save etc untouched).
parent e271e0bf
......@@ -170,7 +170,7 @@ class TikiDb_LegacyErrorHandler implements TikiDb_ErrorHandler
header("Cache-Control: no-cache, pre-check=0, post-check=0");
if ($prefs['feature_ajax'] == 'y') {
if ($prefs['ajax_xajax'] === 'y') {
global $ajaxlib;
include_once('lib/ajax/xajax/xajax_core/xajaxAIO.inc.php');
if ($ajaxlib && $ajaxlib->canProcessRequest()) {
......
......@@ -12,7 +12,7 @@ if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
}
global $prefs;
if ($prefs['feature_ajax'] == 'y') {
if ($prefs['ajax_xajax'] === 'y') {
require_once("lib/ajax/xajax/xajax_core/xajaxAIO.inc.php");
if (!defined ('XAJAX_GET')) define ('XAJAX_GET', 0);
......
......@@ -12,7 +12,7 @@ if (strpos($_SERVER['SCRIPT_NAME'], basename(__FILE__)) !== false) {
}
global $prefs;
if ($prefs['feature_ajax'] !== 'y' or $prefs['wysiwyg_htmltowiki'] !== 'y' ) {
if ($prefs['ajax_xajax'] !== 'y' or $prefs['wysiwyg_htmltowiki'] !== 'y' ) {
return;
}
......
......@@ -131,7 +131,7 @@ class Smarty_Tikiwiki extends Smarty
}
// Enable AJAX
if ( $prefs['feature_ajax'] == 'y' && $_smarty_display ) {
if ( $prefs['ajax_xajax'] === 'y' && $_smarty_display ) {
global $ajaxlib; require_once('lib/ajax/ajaxlib.php');
$ajaxlib->registerTemplate('tiki-site_header_login.tpl');
$ajaxlib->registerTemplate($tpl);
......@@ -144,14 +144,14 @@ class Smarty_Tikiwiki extends Smarty
$this->assign('mid_data', $data);
if ($prefs['feature_fullscreen'] != 'y' || empty($_SESSION['fullscreen']) || $_SESSION['fullscreen'] != 'y')
include_once('tiki-modules.php');
if ($prefs['feature_ajax'] == 'y' && $_smarty_display ) {
if ( $prefs['ajax_xajax'] === 'y' && $_smarty_display ) {
$ajaxlib->processRequests();
}
} elseif ($_smarty_tpl_file == 'confirm.tpl' || $_smarty_tpl_file == 'error.tpl' || $_smarty_tpl_file == 'information.tpl' || $_smarty_tpl_file == 'error_ticket.tpl' || $_smarty_tpl_file == 'error_simple.tpl') {
include_once('tiki-modules.php');
// Enable AJAX
if ( $prefs['feature_ajax'] == 'y' && $_smarty_display ) {
if ( $prefs['ajax_xajax'] === 'y' && $_smarty_display ) {
$_POST['xajaxargs'][0] = $_smarty_tpl_file;
global $ajaxlib; require_once('lib/ajax/ajaxlib.php');
$ajaxlib->registerTemplate('tiki-site_header_login.tpl');
......
......@@ -9,6 +9,15 @@ function prefs_ajax_list() {
return array(
'ajax_xajax' => array(
'name' => tra('Ajax Xajax'),
'description' => tra('Use "xajax" library to "ajaxify" most Tiki pages.'),
'help' => 'Ajax',
'type' => 'flag',
'dependencies' => array(
'feature_ajax',
),
),
'ajax_autosave' => array(
'name' => tra('Ajax auto-save'),
'description' => tra('Saves your edits as you go along enabling you to recover your work after an "interruption". Also enables "Live" preview and is required for wysiwyg plugin processing.'),
......@@ -18,6 +27,6 @@ function prefs_ajax_list() {
'feature_ajax',
),
),
);
}
......@@ -123,4 +123,5 @@ JS
if ($prefs['feature_ajax'] != 'y') {
$prefs['ajax_autosave'] = 'n';
$prefs['ajax_xajax'] = 'n';
}
......@@ -1456,6 +1456,7 @@ function get_default_prefs() {
'feature_htmlpurifier_output' => 'n',
'feature_ajax' => 'n',
'ajax_autosave' => 'n',
'ajax_xajax' => 'y',
'feature_antibot' => 'y',
'feature_banners' => 'n',
'feature_banning' => 'n',
......
......@@ -43,7 +43,7 @@ function smarty_block_ajax_href($params, $content, &$smarty, $repeat) {
$func = isset($params['function']) ? $params['function']: $def_func; // preserve previous behaviour
$last_user = htmlspecialchars($user);
if ( $prefs['feature_ajax'] != 'y' || $prefs['javascript_enabled'] == 'n' ) {
if ( $prefs['ajax_xajax'] !== 'y' || $prefs['javascript_enabled'] == 'n' ) {
return " href=\"$url\" ";
} else {
$max_tikitabs = 50; // Same value as in header.tpl, <body> tag onload's param
......
......@@ -20,7 +20,7 @@ if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
* params are the same as smarty 'query' function + some special params starting with an underscore:
* _sort_field : name of the field used for sorting,
* _sort_arg : name of the URL argument that contains the field to use for sorting. Defaults to 'sort',
* _ajax : if set to 'n', will force disabling AJAX even if the ajax feature is enabled,
* _ajax : if set to 'n', will force disabling AJAX even if the ajax_xajax feature is enabled,
* _tag : if set to 'n', will only return an URL, not the full A tag + text (AJAX and sorting features are not available in this case),
* _class : CSS class to use for the A tag
* _template : (see smarty query function 'template' param)
......@@ -86,14 +86,14 @@ function smarty_block_self_link($params, $content, &$smarty, $repeat = false) {
}
$params['_type'] = $default_type;
if ( $prefs['feature_ajax'] == 'y' && $params['_ajax'] == 'y') unset ($params['_anchor']);
if ( $prefs['ajax_xajax'] === 'y' && $params['_ajax'] === 'y') { unset ($params['_anchor']); }
$ret = smarty_function_query($params, $smarty);
}
if ( $params['_tag'] == 'y' ) {
if ( empty($params['_disabled']) ) {
if ( $params['_ajax'] == 'y' && $params['_script'] == '' ) {
if ( $params['_ajax'] === 'y' && $params['_script'] === '' ) {
require_once $smarty->_get_plugin_filepath('block', 'ajax_href');
if ( ! isset($params['_htmlelement']) ) $params['_htmlelement'] = 'tiki-center';
if ( ! isset($params['_onclick']) ) $params['_onclick'] = '';
......@@ -111,7 +111,7 @@ function smarty_block_self_link($params, $content, &$smarty, $repeat = false) {
$smarty,
false
);
if ($prefs['feature_ajax'] == 'y') {
if ($prefs['ajax_xajax'] === 'y' || empty($params['_onclick'])) {
unset($params['_onclick']);
}
} else {
......
......@@ -439,7 +439,7 @@ class TikiAccessLib extends TikiLib
function is_xajax_request() {
global $prefs;
return ( $prefs['feature_ajax'] == 'y' && isset($_POST['xajaxargs']) );
return ( $prefs['ajax_xajax'] === 'y' && isset($_POST['xajaxargs']) );
}
function is_machine_request() {
......
......@@ -7,7 +7,7 @@
$section = 'user_messages';
require_once ('tiki-setup.php');
if ($prefs['feature_ajax'] == "y") {
if ($prefs['ajax_xajax'] == "y") {
require_once ('lib/ajax/ajaxlib.php');
}
include_once ('lib/messu/messulib.php');
......@@ -131,7 +131,7 @@ $smarty->assign('percentage', $percentage);
include_once ('tiki-section_options.php');
include_once ('tiki-mytiki_shared.php');
ask_ticket('messu-mailbox');
if ($prefs['feature_ajax'] == "y") {
if ($prefs['ajax_xajax'] == "y") {
function user_messages_ajax() {
global $ajaxlib, $xajax;
$ajaxlib->registerTemplate("messu-mailbox.tpl");
......
......@@ -8,7 +8,7 @@
/*
* AJAXified Shoutbox module (jonnybradley for mpvolt Aug/Sept 2008)
*
* Prefers Ajax enabled (Admin/Features/Experimental - feature_ajax) but will work the old way without it
* Prefers Ajax enabled (Admin/Features/Experimental - ajax_xajax) but will work the old way without it
* Anonymous may need tiki_p_view_shoutbox and tiki_p_post_shoutbox setting (in Group admin)
* Enable Admin/Wiki/Wiki Features/feature_antibot to prevent spam ("Anonymous editors must input anti-bot code")
*
......@@ -87,7 +87,7 @@ function module_shoutbox( $mod_reference, $module_params ) {
include_once ('lib/shoutbox/shoutboxlib.php');
if ($tiki_p_view_shoutbox == 'y') {
if ($prefs['feature_ajax'] != 'y') {
if ($prefs['ajax_xajax'] !== 'y') {
$setup_parsed_uri = parse_url($_SERVER['REQUEST_URI']);
if (isset($setup_parsed_uri['query'])) {
......@@ -107,7 +107,7 @@ function module_shoutbox( $mod_reference, $module_params ) {
} else {
$shout_father.= '?';
}
} else { // $prefs['feature_ajax'] == 'y'
} else { // $prefs['ajax_xajax'] == 'y'
$shout_father = 'tiki-shoutbox.php?';
global $ajaxlib;
require_once('lib/ajax/ajaxlib.php');
......@@ -123,7 +123,7 @@ function module_shoutbox( $mod_reference, $module_params ) {
}
if ($tiki_p_post_shoutbox == 'y') {
if ($prefs['feature_ajax'] == 'y') {
if ($prefs['ajax_xajax'] == 'y') {
if (!isset($_REQUEST['xajax'])) { // xajaxRequestUri needs to be set to tiki-shoutbox.php in JS before calling the func
$ajaxlib->registerFunction('processShout');
}
......@@ -144,7 +144,7 @@ function module_shoutbox( $mod_reference, $module_params ) {
$smarty->assign('waittext', isset($module_params['waittext']) ? $module_params['waittext'] : tra('Please wait...'));
$smarty->assign('tweet', isset($module_params['tweet']) &&($tikilib->get_user_preference($user,'twitter_token')!='') ? $module_params['tweet'] : "0");
$smarty->assign('facebook', isset($module_params['facebook']) &&($tikilib->get_user_preference($user,'facebook_token')!='') ? $module_params['facebook'] : "0");
if ($prefs['feature_ajax'] == 'y') {
if ($prefs['ajax_xajax'] == 'y') {
if (!isset($_REQUEST['xajax'])) {
$ajaxlib->registerTemplate('mod-shoutbox.tpl');
}
......
......@@ -15,7 +15,7 @@ function module_webmail_inbox_info() {
return array(
'name' => tra('Webmail Inbox'),
'description' => tra('Displays Webmail Inbox.'),
'prefs' => array('feature_webmail', 'feature_ajax'),
'prefs' => array('feature_webmail', 'ajax_xajax'),
'params' => array(
'accountid' => array(
'name' => tra('Account Id'),
......
......@@ -11,7 +11,7 @@
<form name='confirm' action="{$confirmaction|escape}" method="post">
{query _type='form_input' _keepall='y' ticket=$ticket daconfirm='y'}
{button href="#" _onclick="javascript:document.forms['confirm'].submit();return false;" _text="{tr}Click here to confirm your action{/tr}"}
{if $prefs.feature_ajax eq 'y' and isset($last_mid_template)}
{if $prefs.ajax_xajax eq 'y' and isset($last_mid_template)}
{button href=$last_mid_php _template=$last_mid_template _text="{tr}Go back{/tr}"}
{else}
{button href="#" _onclick="javascript:history.back(); return false;" _text="{tr}Go back{/tr}"}
......
......@@ -2,7 +2,7 @@
{if $tiki_p_view_shoutbox eq 'y'}
{tikimodule title=$tpl_module_title name="shoutbox" flip=$module_params.flip decorations=$module_params.decorations nobox=$module_params.nobox notitle=$module_params.notitle}
{if $tiki_p_post_shoutbox eq 'y'}
{if $prefs.feature_ajax == 'y'}{literal}
{if $prefs.ajax_xajax eq 'y'}{literal}
<script type="text/javascript">
<!--//--><![CDATA[//><!--
function submitShout() {
......@@ -34,7 +34,7 @@
</script>
{/literal}{/if}
{js_maxlength textarea=shout_msg maxlength=255}
{if $prefs.feature_ajax != 'y'}<form action="{$shout_ownurl}" method="post" onsubmit="return verifyForm(this);" id="shout_form">{else}
{if $prefs.ajax_xajax neq 'y'}<form action="{$shout_ownurl}" method="post" onsubmit="return verifyForm(this);" id="shout_form">{else}
<form action="javascript:void(null);" onsubmit="return submitShout();" id="shout_form" name="shout_form">
<input type="hidden" id="shout_remove" name="shout_remove" value="0" />
<input type="hidden" id="shout_edit" name="shout_edit" value="0" />{/if}
......@@ -71,7 +71,7 @@
{/if}
{$shout_msgs[ix].message}
{if $tiki_p_admin_shoutbox eq 'y' || $user == $shout_msgs[ix].user }
{if $prefs.feature_ajax == 'y'}
{if $prefs.ajax_xajax eq 'y'}
[<a onclick="removeShout({$shout_msgs[ix].msgId});return false" href="#" class="linkmodule tips" title="|{tr}Delete this shout{/tr}">x</a>|<a href="tiki-shoutbox.php?msgId={$shout_msgs[ix].msgId}" class="linkmodule tips" title="|{tr}Edit this shout{/tr}">e</a>]
{else}
[<a href="{$shout_ownurl}shout_remove={$shout_msgs[ix].msgId}" class="linkmodule">x</a>|<a href="tiki-shoutbox.php?msgId={$shout_msgs[ix].msgId}" class="linkmodule">e</a>]
......
......@@ -28,7 +28,7 @@
{/if}
{*icon _id='resultset_last' class=''*}
</div>
{if $prefs.feature_ajax}
{if $prefs.ajax_xajax}
<a title="{tr}Refresh{/tr}" onclick="doRefreshWebmail(0, true);return false;">
{icon _id='arrow_refresh' class='webmail_refresh_icon icon'}
{icon _id='img/spinner.gif' class='webmail_refresh_busy icon' style='display:none'}
......
......@@ -8,8 +8,8 @@
{if $trackerEditFormId}&nbsp;<strong class='mandatory_star'>*</strong>&nbsp;{/if}
</td>
<td>
<input type="text" id="email" name="email" {if $prefs.feature_ajax eq 'y' && !$userTrackerData}onkeyup="return check_mail()" onblur="return check_mail()"{/if}/>
{if $prefs.feature_ajax eq 'y'}
<input type="text" id="email" name="email" {if $prefs.ajax_xajax eq 'y' && !$userTrackerData}onkeyup="return check_mail()" onblur="return check_mail()"{/if}/>
{if $prefs.ajax_xajax eq 'y'}
<span id="ajax_msg_mail" style="vertical-align: middle;"></span>
{/if}
{if $prefs.validateUsers eq 'y' and $prefs.validateEmail ne 'y'}
......
......@@ -7,8 +7,8 @@
{if $trackerEditFormId}&nbsp;<strong class='mandatory_star'>*</strong>&nbsp;{/if}
</td>
<td>
<input type="text" name="name" id="name" {if $prefs.feature_ajax eq 'y' && !$userTrackerData} onkeyup="return check_name()" onblur="return check_name()"{/if} />
{if $prefs.feature_ajax eq 'y'}
<input type="text" name="name" id="name" {if $prefs.ajax_xajax eq 'y' && !$userTrackerData} onkeyup="return check_name()" onblur="return check_name()"{/if} />
{if $prefs.ajax_xajax eq 'y'}
<span id="ajax_msg_name" style="vertical-align: middle;"></span>
{/if}
{if $prefs.login_is_email eq 'y'}
......
......@@ -5,12 +5,12 @@
<tr>
<td><label for="pass1">{tr}Password:{/tr}</label>{if $trackerEditFormId}&nbsp;<strong class='mandatory_star'>*</strong>&nbsp;{/if}</td>
<td>
<input id='pass1' type="password" name="pass" onkeypress="regCapsLock(event)" onkeyup="{if $prefs.feature_ajax neq 'y' && !$userTrackerData}runPassword(this.value, 'mypassword');checkPasswordsMatch('#pass2', '#pass1', '#mypassword2_text');{elseif !$userTrackerData}check_pass();{/if}" />
<input id='pass1' type="password" name="pass" onkeypress="regCapsLock(event)" onkeyup="{if $prefs.ajax_xajax neq 'y' && !$userTrackerData}runPassword(this.value, 'mypassword');checkPasswordsMatch('#pass2', '#pass1', '#mypassword2_text');{elseif !$userTrackerData}check_pass();{/if}" />
<div style="float:right;margin-left:5px;">
<div id="mypassword_text"></div>
<div id="mypassword_bar" style="font-size: 5px; height: 2px; width: 0px;"></div>
</div>
{if $prefs.feature_ajax ne 'y'}
{if $prefs.ajax_xajax ne 'y'}
{if $prefs.min_pass_length > 1}<div class="highlight"><em>{tr}Minimum {$prefs.min_pass_length} characters long{/tr}</em></div>{/if}
{if $prefs.pass_chr_num eq 'y'}<div class="highlight"><em>{tr}Password must contain both letters and numbers{/tr}</em></div>{/if}
{/if}
......
......@@ -8,16 +8,16 @@
{if $trackerEditFormId}&nbsp;<strong class='mandatory_star'>*</strong>&nbsp;{/if}
</td>
<td>
<input id='pass2' type="password" name="passAgain" onkeypress="regCapsLock(event)" onkeyup="{if $prefs.feature_ajax neq 'y' && !$userTrackerData}checkPasswordsMatch('#pass2', '#pass1', '#mypassword2_text');{elseif !$userTrackerData}check_pass();{/if}" />
<input id='pass2' type="password" name="passAgain" onkeypress="regCapsLock(event)" onkeyup="{if $prefs.ajax_xajax neq 'y' && !$userTrackerData}checkPasswordsMatch('#pass2', '#pass1', '#mypassword2_text');{elseif !$userTrackerData}check_pass();{/if}" />
<div style="float:right;margin-left:5px;">
<div id="mypassword2_text"></div>
</div>
{if $prefs.feature_ajax eq'y'}<span id="checkpass"></span>{/if}
{if $prefs.ajax_xajax eq'y'}<span id="checkpass"></span>{/if}
{if $prefs.generate_password eq 'y'}
<p>
<input id='genepass' name="genepass" type="text" tabindex="0" style="display: none" />
<span id="genPass">
{if $prefs.feature_ajax eq 'y'}
{if $prefs.ajax_xajax eq 'y'}
{button href="#" _onclick="check_pass();" _text="{tr}Generate a password{/tr}"}
{else}
{button href="#" _onclick="" _text="{tr}Generate a password{/tr}"}
......
......@@ -150,6 +150,6 @@
{self_link page="socialnetworks" _class="icon tips" _title="{tr}Social networks{/tr}|{tr}Configure social networks integration{/tr}"}{icon _id="img/mytiki/socialnetworks_32.png" alt="{tr}Social networks{/tr}" class="reflect" style="vertical-align: middle" width="32" height="32"}{/self_link}
{/if}
{if $prefs.feature_ajax eq 'y' and $prefs.feature_jquery_reflection eq 'y'}{jq}$('img.reflect').reflect({});{/jq}{/if}{* for ajax *}
{if $prefs.feature_ajax eq 'y' and $prefs.feature_jquery_tooltips eq 'y'}{jq}$('.tips').cluetip({splitTitle: '|', showTitle: false, width: '150px', cluezIndex: 400, fx: {open: 'fadeIn', openSpeed: 'fast'} });{/jq}{/if}
{if $prefs.ajax_xajax eq 'y' and $prefs.feature_jquery_reflection eq 'y'}{jq}$('img.reflect').reflect({});{/jq}{/if}{* for ajax *}
{if $prefs.ajax_xajax eq 'y' and $prefs.feature_jquery_tooltips eq 'y'}{jq}$('.tips').cluetip({ splitTitle: '|', cluezIndex: 400, width: 'auto', fx: {open: 'fadeIn', openSpeed: 'fast'}, clickThrough: true });{/jq}{/if}
<br class="clear" />
......@@ -77,6 +77,7 @@
<legend> {tr}AJAX{/tr} </legend>
{preference name=feature_ajax}
<div class="adminoptionboxchild half_width" id="feature_ajax_childcontainer">
{preference name=ajax_xajax}
{preference name=ajax_autosave}
{preference name=feature_wiki_save_draft}
</div>
......
{* $Id$ *}
{if $prefs.feature_ajax eq 'y'}
{$xajax_js}
{if $prefs.ajax_xajax eq 'y'}
{$xajax_js}
{/if}
<div id="ajaxLoading">{tr}Loading...{/tr}</div>
<div id="ajaxLoadingBG">&nbsp;</div>
<div id="ajaxDebug"></div>
{/if}
......@@ -71,8 +71,8 @@
<div id="mypassword_text"></div>
<div id="mypassword_bar" style="font-size: 5px; height: 2px; width: 0px;"></div>
</div>
<input type="password" name="pass" id="pass1" onkeypress="regCapsLock(event)" onkeyup="runPassword(this.value, 'mypassword');{if $prefs.feature_ajax eq 'y'}check_pass();{/if}" />
{if $prefs.feature_ajax ne 'y'}
<input type="password" name="pass" id="pass1" onkeypress="regCapsLock(event)" onkeyup="runPassword(this.value, 'mypassword');{if $prefs.ajax_xajax eq 'y'}check_pass();{/if}" />
{if $prefs.ajax_xajax ne 'y'}
{if $prefs.min_pass_length > 1}
<div class="highlight"><em>{tr}Minimum {$prefs.min_pass_length} characters long{/tr}</em></div>{/if}
{if $prefs.pass_chr_num eq 'y'}
......
......@@ -62,7 +62,7 @@
{/if}
<div class="simplebox highlight" id="divRegCapson" style="visibility:hidden">{icon _id=error style="vertical-align:middle"} {tr}CapsLock is on.{/tr}</div>
{if $prefs.feature_ajax eq 'y'}
{if $prefs.ajax_xajax eq 'y'}
<script src="lib/registration/register_ajax.js" type="text/javascript"></script>
{/if}
......
......@@ -6,7 +6,7 @@
// $Id$
require_once ('tiki-setup.php');
if ($prefs['feature_ajax'] == "y") {
if ($prefs['ajax_xajax'] == "y") {
require_once ('lib/ajax/ajaxlib.php');
}
if (empty($prefs['feature_jpgraph'])) {
......
......@@ -16,7 +16,7 @@ include_once ('lib/calendar/calrecurrence.php');
if ($prefs['feature_groupalert'] == 'y') {
include_once ('lib/groupalert/groupalertlib.php');
}
if ($prefs['feature_ajax'] == "y") {
if ($prefs['ajax_xajax'] == "y") {
require_once ('lib/ajax/ajaxlib.php');
}
......@@ -517,7 +517,7 @@ $smarty->assign('calendar', $calendar);
$smarty->assign('calendarId', $calID);
if (array_key_exists('CalendarViewGroups',$_SESSION) && count($_SESSION['CalendarViewGroups']) == 1)
$smarty->assign('calendarView',$_SESSION['CalendarViewGroups'][0]);
if ($prefs['feature_ajax'] == "y") {
if ($prefs['ajax_xajax'] == "y") {
function edit_calendar_ajax() {
global $ajaxlib, $xajax;
$ajaxlib->registerTemplate("tiki-calendar_edit_item.tpl");
......
......@@ -15,7 +15,7 @@ include_once ('lib/calendar/calendarlib.php');
include_once ('lib/categories/categlib.php');
include_once ('lib/newsletters/nllib.php');
if ($prefs['feature_ajax'] == "y") {
if ($prefs['ajax_xajax'] == "y") {
require_once ('lib/ajax/ajaxlib.php');
}
......
......@@ -31,8 +31,12 @@ include_once ('lib/wiki/wikilib.php');
include_once ('lib/structures/structlib.php');
include_once ('lib/notifications/notificationlib.php');
if ($prefs['feature_ajax'] === 'y') {
require_once ("lib/ajax/ajaxlib.php");
require_once ("lib/wiki/wiki-ajax.php");
if ($prefs['ajax_xajax'] === 'y') {
require_once ("lib/ajax/ajaxlib.php");
}
if ($prefs['feature_wiki_save_draft'] === 'y') {
require_once ("lib/wiki/wiki-ajax.php");
}
}
require_once ("lib/wiki/editlib.php");
require_once ("lib/ajax/tikitohtml.php");
......
......@@ -38,8 +38,14 @@ if( $prefs['feature_wiki_structure'] == 'y' ) {
}
include_once('lib/wiki/wikilib.php');
include_once('lib/stats/statslib.php');
include_once('lib/ajax/ajaxlib.php');
require_once ("lib/wiki/wiki-ajax.php");
if ($prefs['feature_ajax'] === 'y') {
if ($prefs['ajax_xajax'] === 'y') {
require_once ("lib/ajax/ajaxlib.php");
}
if ($prefs['feature_wiki_save_draft'] === 'y') {
require_once ("lib/wiki/wiki-ajax.php");
}
}
require_once ("lib/wiki/renderlib.php");
$auto_query_args = array('page','best_lang','bl','page_id','pagenum','page_ref_id','mode','sort_mode',
......
......@@ -7,9 +7,13 @@
$section = 'wiki page';
require_once('tiki-setup.php');
if ($prefs['feature_ajax'] == "y") {
include_once('lib/ajax/ajaxlib.php');
require_once ("lib/wiki/wiki-ajax.php");
if ($prefs['feature_ajax'] === 'y') {
if ($prefs['ajax_xajax'] === 'y') {
require_once ("lib/ajax/ajaxlib.php");
}
if ($prefs['feature_wiki_save_draft'] === 'y') {
require_once ("lib/wiki/wiki-ajax.php");
}
}
include_once('lib/structures/structlib.php');
......@@ -210,7 +214,7 @@ if ($prefs['feature_theme_control'] == 'y') {
include('tiki-tc.php');
}
ask_ticket('index-p');
if ($prefs['feature_ajax'] == "y") {
if ($prefs['ajax_xajax'] == "y") {
function wiki_ajax() {
global $ajaxlib, $xajax;
......
......@@ -53,7 +53,7 @@ if (!function_exists('ms_newMapObj')) {
$smarty->display('error.tpl');
die;
}
$access->check_feature(array('feature_maps','feature_ajax'));
$access->check_feature(array('feature_maps','ajax_xajax'));
$access->check_permission('tiki_p_map_view');
//setting up xajax
require_once ("lib/ajax/xajax/xajax_core/xajaxAIO.inc.php");
......
......@@ -7,7 +7,7 @@
$section = 'calendar';
require_once ('tiki-setup.php');
if ($prefs['feature_ajax'] == "y") {
if ($prefs['ajax_xajax'] == "y") {
require_once ('lib/ajax/ajaxlib.php');
}
include_once ('lib/minical/minicallib.php');
......@@ -166,7 +166,7 @@ $smarty->assign('topics', $topics['data']);
include_once ('tiki-section_options.php');
include_once ('tiki-mytiki_shared.php');
ask_ticket('minical');
if ($prefs['feature_ajax'] == "y") {
if ($prefs['ajax_xajax'] == "y") {
function user_minical_ajax() {
global $ajaxlib, $xajax;
$ajaxlib->registerTemplate("tiki-minical.tpl");
......
......@@ -7,7 +7,7 @@
$section = 'mytiki';
require_once ('tiki-setup.php');
if ($prefs['feature_ajax'] == "y") {
if ($prefs['ajax_xajax'] == "y") {
require_once ('lib/ajax/ajaxlib.php');
}
include_once ('lib/wiki/wikilib.php');
......@@ -117,7 +117,7 @@ if ($prefs['feature_articles'] == 'y') {
}
}
include_once ('tiki-section_options.php');
if ($prefs['feature_ajax'] == "y") {
if ($prefs['ajax_xajax'] == "y") {
function mytiki_ajax() {
global $ajaxlib, $xajax;
$ajaxlib->registerTemplate("tiki-my_tiki.tpl");
......
......@@ -7,7 +7,7 @@
$section = 'mytiki';
require_once ('tiki-setup.php');
if ($prefs['feature_ajax'] == "y") {
if ($prefs['ajax_xajax'] == "y") {
require_once ('lib/ajax/ajaxlib.php');
}
include_once ('lib/notepad/notepadlib.php');
......@@ -101,7 +101,7 @@ $smarty->assign_by_ref('channels', $channels["data"]);
include_once ('tiki-section_options.php');
include_once ('tiki-mytiki_shared.php');
ask_ticket('notepad-list');
if ($prefs['feature_ajax'] == "y") {
if ($prefs['ajax_xajax'] == "y") {
function user_notepad_ajax() {
global $ajaxlib, $xajax;
$ajaxlib->registerTemplate("tiki-notepad_list.tpl");
......
......@@ -101,7 +101,7 @@ $smarty->assign('metatag_robots', 'NOINDEX, NOFOLLOW');
// xajax
if ($prefs['feature_ajax'] == 'y') {
if ($prefs['ajax_xajax'] == 'y') {
global $ajaxlib;
include_once ('lib/ajax/ajaxlib.php');
// include_once ('tiki-regsiter_ajax.php');
......
......@@ -214,8 +214,12 @@ if ($prefs['javascript_enabled'] != 'n') {
$headerlib->add_jsfile( 'lib/jquery_tiki/tiki-jquery.js' );
if ( $prefs['feature_ajax'] === 'y' ) {
$headerlib->add_jsfile('lib/ajax/tiki-ajax.js');
$headerlib->add_jsfile('lib/wiki/wiki-ajax.js');
if ($prefs['ajax_xajax'] === 'y') {
$headerlib->add_jsfile('lib/ajax/tiki-ajax.js');
}
if ($prefs['feature_wiki_save_draft'] === 'y') {
$headerlib->add_jsfile('lib/wiki/wiki-ajax.js');
}
if ( $prefs['ajax_autosave'] === 'y' ) {
$headerlib->add_jsfile('lib/ajax/autosave.js');
}
......
......@@ -98,7 +98,7 @@ function processShout($formValues, $destDiv = 'mod-shoutbox') {
$objResponse->assign($destDiv, "innerHTML", $data);
return $objResponse;
}
if ($prefs['feature_ajax'] == 'y') {
if ($prefs['ajax_xajax'] == 'y') {
global $ajaxlib;
include_once ('lib/ajax/ajaxlib.php');
$ajaxlib->registerFunction('processShout');
......
......@@ -7,7 +7,7 @@
$section = 'mytiki';
require_once ('tiki-setup.php');
if ($prefs['feature_ajax'] == "y") {
if ($prefs['ajax_xajax'] == "y") {
require_once ('lib/ajax/ajaxlib.php');
}
include_once ('lib/usermodules/usermoduleslib.php');
......@@ -66,7 +66,7 @@ $smarty->assign_by_ref('assignables', $assignables);
$smarty->assign_by_ref('modules', $modules);
include_once ('tiki-mytiki_shared.php');
ask_ticket('user-modules');
if ($prefs['feature_ajax'] == "y") {
if ($prefs['ajax_xajax'] == "y") {
function user_modules_ajax() {
global $ajaxlib, $xajax;
$ajaxlib->registerTemplate("tiki-user_assigned_modules.tpl");
......
......@@ -7,7 +7,7 @@
$section = 'mytiki';
require_once ('tiki-setup.php');
if ($prefs['feature_ajax'] == "y") {
if ($prefs['ajax_xajax'] == "y") {
require_once ('lib/ajax/ajaxlib.php');
}
include_once ('lib/bookmarks/bookmarklib.php');
......@@ -93,7 +93,7 @@ $smarty->assign('folders', $folders);
include_once ('tiki-mytiki_shared.php');
ask_ticket('user-bookmarks');
include_once ('tiki-section_options.php');
if ($prefs['feature_ajax'] == "y") {
if ($prefs['ajax_xajax'] == "y") {
function user_bookmarks_ajax() {
global $ajaxlib, $xajax;
$ajaxlib->registerTemplate("tiki-user_bookmarks.tpl");
......
......@@ -6,7 +6,7 @@
// $Id$
require_once ('tiki-setup.php');
if ($prefs['feature_ajax'] == "y") {
if ($prefs['ajax_xajax'] == "y") {
require_once ('lib/ajax/ajaxlib.php');
}
include_once ('lib/messu/messulib.php');
......@@ -195,7 +195,7 @@ if ($prefs['user_tracker_infos']) {
$smarty->assign_by_ref('userItem', $items['data'][0]);
}
ask_ticket('user-information');
if ($prefs['feature_ajax'] == "y") {
if ($prefs['ajax_xajax'] == "y") {
function user_information_ajax() {
global $ajaxlib, $xajax;
$ajaxlib->registerTemplate("tiki-user_information.tpl");
......
......@@ -7,7 +7,7 @@
$section = 'mytiki';
require_once ('tiki-setup.php');
if ($prefs['feature_ajax'] == "y") {
if ($prefs['ajax_xajax'] == "y") {
require_once ('lib/ajax/ajaxlib.php');
}
include_once ('lib/modules/modlib.php');
......@@ -398,7 +398,7 @@ if ($prefs['feature_wiki'] == 'y' and $prefs['feature_wiki_userpage'] == 'y') {
$smarty->assign_by_ref('tikifeedback', $tikifeedback);
include_once ('tiki-section_options.php');
ask_ticket('user-prefs');
if ($prefs['feature_ajax'] == "y") {
if ($prefs['ajax_xajax'] == "y") {
function user_preferences_ajax() {
global $ajaxlib, $xajax;
$ajaxlib->registerTemplate("tiki-user_preferences.tpl");
......
......@@ -7,7 +7,7 @@
$section = 'mytiki';
require_once ('tiki-setup.php');
if ($prefs['feature_ajax'] == "y") {
if ($prefs['ajax_xajax'] == "y") {
require_once ('lib/ajax/ajaxlib.php');
}
include_once ('lib/tasks/tasklib.php');
......@@ -647,7 +647,7 @@ $smarty->assign('img_me_waiting_width', $img_me_waiting_width);
$smarty->assign('img_not_accepted', $img_not_accepted);
$smarty->assign('img_not_accepted_height', $img_not_accepted_height);
$smarty->assign('img_not_accepted_width', $img_not_accepted_width);
if ($prefs['feature_ajax'] == "y") {
if ($prefs['ajax_xajax'] == "y") {
function user_tasks_ajax() {
global $ajaxlib, $xajax;
$ajaxlib->registerTemplate("tiki-user_tasks.tpl");
......
......@@ -9,7 +9,7 @@ $section = 'mytiki';
include_once ('tiki-setup.php');
include_once('lib/reportslib.php');
if ($prefs['feature_ajax'] == "y") {
if ($prefs['ajax_xajax'] == "y") {
require_once ('lib/ajax/ajaxlib.php');
}
......@@ -177,7 +177,7 @@ if ($prefs['feature_messages'] == 'y' && $tiki_p_messages == 'y') {
$eok = $userlib->get_user_email($user);
$smarty->assign('email_ok', empty($eok) ? 'n' : 'y');
ask_ticket('user-watches');
if ($prefs['feature_ajax'] == "y") {
if ($prefs['ajax_xajax'] == "y") {
function user_watches_ajax() {
global $ajaxlib, $xajax;
$ajaxlib->registerTemplate("tiki-user_watches.tpl");
......