2013-04-29 Sergio Martin <sergio.martin@artica.es>

* include/functions.php
	include/javascript/pandora_modules.js
	include/javascript/pandora.js
	index.php
	ajax.php: Added a simple system of interchange of
	data from php to javascript with invisible divs.
	Fixed ajax call of server plugin components macros
	for bug 3612145



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8078 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2013-04-29 08:59:03 +00:00
parent 87035e196f
commit 8d1836c547
6 changed files with 26 additions and 4 deletions

View File

@ -1,3 +1,14 @@
2013-04-29 Sergio Martin <sergio.martin@artica.es>
* include/functions.php
include/javascript/pandora_modules.js
include/javascript/pandora.js
index.php
ajax.php: Added a simple system of interchange of
data from php to javascript with invisible divs.
Fixed ajax call of server plugin components macros
for bug 3612145
2013-04-26 Sergio Martin <sergio.martin@artica.es>
* include/styles/pandora.css: Fix aesthetical issues

View File

@ -49,7 +49,6 @@ if (isset ($_GET["loginhash"])) {
// Check user
check_login ();
define ('AJAX', true);
/* Enterprise support */

View File

@ -1738,5 +1738,12 @@ function is_snapshot_data ($data){
return 0;
}
/**
* Create an invisible div with a provided ID and value to
* can retrieve it from javascript with function get_php_value(value)
*/
function set_js_value($name, $value) {
html_print_div(array('id' => 'php_to_js_value_' . $name, 'content' => $value, 'hidden' => true));
}
?>

View File

@ -791,3 +791,8 @@ function hidded_sidebar(position, menuW, menuH, icon_width, top_dist, autotop, r
break;
}
}
// Function that recover a previously stored value from php code
function get_php_value(value) {
return $('#php_to_js_value_' + value).html();
}

View File

@ -620,7 +620,7 @@ function load_plugin_macros_fields(row_model_id) {
jQuery.ajax ({
data: params.join ("&"),
type: 'POST',
url: action="ajax.php",
url: action = get_php_value('absolute_homeurl') + "ajax.php",
async: false,
timeout: 10000,
dataType: 'json',

View File

@ -560,6 +560,6 @@ echo '</html>';
$run_time = format_numeric (microtime (true) - $config['start_time'], 3);
echo "\n<!-- Page generated in $run_time seconds -->\n";
// Hidden div to forced title
html_print_div(array('id' => 'forced_title_layer', 'class' => 'forced_title_layer', 'hidden' => true));
// Values from PHP to be recovered from JAVASCRIPT
require('include/php_to_js_values.php');
?>