Source for file _ajax_admin.php
Documentation is available at _ajax_admin.php
* @package linea21.modules
* @author Simon Georget <simon@linea21.com>
* @license http://opensource.org/licenses/gpl-3.0.html
include_once('../lib/functions_auth.php');
include_once('../config/define.php');
include_once('../lib/lib_common.php');
include_once('../class/class.comment.php');
include_once('../languages/' . U_L . '/lang_comment.' . CHARSET . '.php');
include_once(themePath('../comment/display.php'));
//////////// Check Droits utilisateur ////////////
$a = parse_url($_SERVER['HTTP_REFERER'], PHP_URL_QUERY);
////////////////////////////////////////
include_once('../class/system/class.'. SQL. '.php');
$GLOBALS['sql_object'] = new $sql_entity;
$GLOBALS['sql_object'] -> DBInitialise();
$GLOBALS['sql_object'] -> DBConnexion();
if($todo == 'disapprove') {
$r = $comm->disapprove($id, $GLOBALS['sql_object']);
$msg = _t('comment', 'disapproved');
$isnew = $comm->isnew($id, $GLOBALS['sql_object']);
$comment = $comm->get(array('given_id' => $id, 'status' => array('P', 'D', 'E')), $GLOBALS['sql_object']);
$arr['module'] = $comment[0]['comment_module'];
$arr['module_id'] = $comment[0]['comment_module_id'];
$arr['user_id'] = $comment[0]['comment_user_id'];
$arr['name'] = $comment[0]['comment_name'];
$arr['email'] = $comment[0]['comment_email'];
$arr['body'] = $comment[0]['comment_body'];
$r = $comm->approve($id, $GLOBALS['sql_object']);
$msg = _t('comment', 'approved');
$r = $comm->delete($id, $GLOBALS['sql_object']);
// new validated comments notified to users, if needed
if(isset ($arr) && $arr['module'] != 'contribute') {
notifyusers($arr,$id, $comm, true);
echo '{"status":1,"el": "#com-'. $id. '", "action": "'. $todo. '", "page": "'. $page. '", "msg": "'. $msg. '"}';
echo '{"status":0,"el": "#com-'. $id. '", "action": "'. $todo. '", "page": "'. $page. '", "msg": "'. $msg. '"}';
|