1 |
2
|
Manuela
|
<?php
|
2 |
|
|
/**
|
3 |
|
|
*
|
4 |
|
|
* @category modules
|
5 |
|
|
* @package JsAdmin
|
6 |
|
|
* @author WebsiteBaker Project, modified by Swen Uth for Website Baker 2.7
|
7 |
|
|
* @copyright (C) 2006, Stepan Riha
|
8 |
|
|
* @copyright WebsiteBaker Org. e.V.
|
9 |
|
|
* @link http://websitebaker.org/
|
10 |
|
|
* @license http://www.gnu.org/licenses/gpl.html
|
11 |
|
|
* @platform WebsiteBaker 2.8.3
|
12 |
|
|
* @requirements PHP 5.3.6 and higher
|
13 |
|
|
* @version $Id$
|
14 |
|
|
* @filesource $HeadURL$
|
15 |
|
|
* @lastmodified $Date$
|
16 |
|
|
*
|
17 |
|
|
*/
|
18 |
|
|
|
19 |
|
|
/* -------------------------------------------------------- */
|
20 |
|
|
// Must include code to prevent this file from being accessed directly
|
21 |
|
|
if(defined('WB_PATH') == false) { exit('Cannot access '.basename(__DIR__).'/'.basename(__FILE__).' directly'); }
|
22 |
|
|
/* -------------------------------------------------------- */
|
23 |
|
|
|
24 |
|
|
$aJsonRespond['modules'] = $aRequestVars['module'];
|
25 |
|
|
$aJsonRespond['success'] = true;
|
26 |
|
|
$aJsonRespond['modules_dir'] = '/modules/'.$aRequestVars['module'];
|
27 |
|
|
|
28 |
|
|
// Get id
|
29 |
|
|
if (isset($aRequestVars['post_id'])){
|
30 |
|
|
$table = TABLE_PREFIX.'mod_news_posts';
|
31 |
|
|
$id = (int)$aRequestVars['move_id'];
|
32 |
|
|
$id_field = 'post_id';
|
33 |
|
|
$common_field = 'section_id';
|
34 |
|
|
$sFieldOrderName = 'position';
|
35 |
|
|
$aJsonRespond['message'] = 'Activity position '.$id.' successfully changed';
|
36 |
|
|
} else
|
37 |
|
|
if (isset($aRequestVars['group_id'])){
|
38 |
|
|
$table = TABLE_PREFIX.'mod_news_groups';
|
39 |
|
|
$id = (int)$aRequestVars['move_id'];
|
40 |
|
|
$id_field = 'group_id';
|
41 |
|
|
$common_field = 'section_id';
|
42 |
|
|
$sFieldOrderName = 'position';
|
43 |
|
|
$aJsonRespond['message'] = 'Activity position '.$id.' successfully changed';
|
44 |
|
|
} else {
|
45 |
|
|
$aJsonRespond['message'] = 'ajax operation failed';
|
46 |
|
|
$aJsonRespond['success'] = false;
|
47 |
|
|
exit (json_encode($aJsonRespond));
|
48 |
|
|
}
|