Closed GoogleCodeExporter closed 9 years ago
I think a load-ajax.php would make sense so that we could maybe pass something
like:
load-ajax.php?id={plugin}&func={plugin_function}
This way it keeps the same concept by loading a specified function from the
loaded plugin file.
Original comment by talkingt...@gmail.com
on 1 Nov 2010 at 9:07
Example of what I have done to create this functionality:
load-ajax.php
<?php
/**
* Load Plugin Function via AJAX
*
* Loads the plugin function pass to it
*
* @package GetSimple
* @subpackage Plugins
*/
// Setup inclusions
$load['plugin'] = true;
// Include common.php
include('inc/common.php');
// Variable Settings
login_cookie_check();
// Setup this plugin
$plugin_id = $_GET['id'];
global $plugin_info;
if (function_exists($_GET['func'])) {
call_user_func_array($_GET['func'],array());
} else {
echo 'Invalid Function';
}
?>
Original comment by talkingt...@gmail.com
on 1 Nov 2010 at 11:47
this looks ok, but im having trouble seeing why this is needed. Im sure you can
present a good case for this, but can you explain it a little more?
Original comment by ccagle8
on 7 Nov 2010 at 1:10
sure.
I ran across a position where i needed to get json back for a jquery plugin I
was using with my plugin. While I know most have made workarounds to do such
things (working out of plugin folder directories and including files, etc..), I
really just saw a way to keep security high while giving developers much more
built in flexibility. in this case I simply could make a single function that
outputted json and have native access to all the things that the plugin would
normally have.
Basically, it picks up where load.php can't help (since it outputs template). A
simple native way to communicate via ajax could be very helpful towards future
development.
Original comment by talkingt...@gmail.com
on 7 Nov 2010 at 9:26
This issue was closed by revision r267.
Original comment by ccagle8
on 12 Nov 2010 at 6:51
Original issue reported on code.google.com by
talkingt...@gmail.com
on 1 Nov 2010 at 9:00