|
280 | 280 | if (defined('NV_IS_SPADMIN')) {
|
281 | 281 | $post = array();
|
282 | 282 | $post['id'] = $nv_Request->get_int('id', 'get');
|
| 283 | + |
283 | 284 | if ($nv_Request->isset_request('edit', 'get')) {
|
284 |
| - if (empty($post['id']) or ! isset($groupsList[$post['id']]) or $post['id'] < 10 or $groupsList[$post['id']]['idsite'] != $global_config['idsite']) { |
| 285 | + if (empty($post['id']) or ! isset($groupsList[$post['id']]) or $groupsList[$post['id']]['idsite'] != $global_config['idsite']) { |
285 | 286 | Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op);
|
286 | 287 | die();
|
287 | 288 | }
|
|
305 | 306 | die($lang_module['title_empty']);
|
306 | 307 | }
|
307 | 308 |
|
308 |
| - |
309 | 309 | // Kiểm tra trùng tên nhóm
|
310 | 310 | $stmt = $db->prepare('SELECT group_id FROM ' . NV_GROUPS_GLOBALTABLE . ' WHERE title LIKE :title AND group_id!= ' . intval($post['id']) . ' AND (idsite=' . $global_config['idsite'] . ' or (idsite=0 AND siteus=1))');
|
311 | 311 | $stmt->bindParam(':title', $post['title'], PDO::PARAM_STR);
|
|
339 | 339 | $post['siteus'] = 0;
|
340 | 340 | }
|
341 | 341 |
|
342 |
| - if (isset($post['id']) and $post['id'] > 3) { |
| 342 | + if (isset($post['id']) and $post['id'] > 9) { |
343 | 343 | $stmt = $db->prepare("UPDATE " . NV_GROUPS_GLOBALTABLE . " SET
|
344 | 344 | title= :title,
|
345 | 345 | description= :description,
|
|
382 | 382 | $post['content'] = nv_editor_br2nl($post['content']);
|
383 | 383 | $post['exp_time'] = ! empty($post['exp_time']) ? date('d/m/Y', $post['exp_time']) : '';
|
384 | 384 | $post['siteus'] = $post['siteus'] ? ' checked="checked"' : '';
|
| 385 | + $post['id'] = $post['group_id']; |
385 | 386 | } else {
|
386 | 387 | $post['title'] = $post['description'] = $post['content'] = $post['exp_time'] = '';
|
387 | 388 | $post['group_type'] = 0;
|
| 389 | + $post['id'] = 0; |
388 | 390 | }
|
389 | 391 |
|
390 | 392 | $post['content'] = htmlspecialchars(nv_editor_br2nl($post['content']));
|
|
415 | 417 | $xtpl->assign('CONTENT', $_cont);
|
416 | 418 | $xtpl->assign('NV_BASE_SITEURL', NV_BASE_SITEURL);
|
417 | 419 | $xtpl->assign('NV_LANG_INTERFACE', NV_LANG_INTERFACE);
|
418 |
| - |
| 420 | + |
| 421 | + if ($post['id'] > 9 or $post['id'] == 0) { |
| 422 | + $xtpl->parse('add.basic_infomation'); |
| 423 | + } |
| 424 | + |
419 | 425 | $xtpl->parse('add');
|
420 | 426 | $contents = $xtpl->text('add');
|
421 | 427 | } else {
|
|
428 | 434 | die();
|
429 | 435 | }
|
430 | 436 |
|
431 |
| -// Danh sach nhom |
| 437 | +// Danh sach nhom (AJAX) |
432 | 438 | if ($nv_Request->isset_request('list', 'get')) {
|
433 | 439 | $weight_op = 1;
|
434 | 440 | foreach ($groupsList as $group_id => $values) {
|
|
450 | 456 | 'link_userlist' => $link_userlist
|
451 | 457 | );
|
452 | 458 |
|
453 |
| - if (defined('NV_IS_SPADMIN') and $group_id > 9 and $values['idsite'] == $global_config['idsite']) { |
| 459 | + if (defined('NV_IS_SPADMIN') and $values['idsite'] == $global_config['idsite']) { |
454 | 460 | $_bg = (empty($global_config['idsite'])) ? $weight_op : 1;
|
| 461 | + |
455 | 462 | for ($i = $_bg; $i <= $groupcount; $i++) {
|
456 | 463 | $opt = array( 'value' => $i, 'selected' => $i == $values['weight'] ? ' selected="selected"' : '' );
|
457 | 464 | $xtpl->assign('NEWWEIGHT', $opt);
|
458 | 465 | $xtpl->parse('list.loop.option');
|
459 | 466 | }
|
| 467 | + |
| 468 | + if ($group_id > 9) { |
| 469 | + $xtpl->parse('list.loop.action.delete'); |
| 470 | + } |
| 471 | + |
460 | 472 | $xtpl->parse('list.loop.action');
|
461 | 473 | } else {
|
462 | 474 | ++$weight_op;
|
|
472 | 484 | $xtpl->assign('LOOP', $loop);
|
473 | 485 | $xtpl->parse('list.loop');
|
474 | 486 | }
|
| 487 | + |
475 | 488 | if (defined('NV_IS_SPADMIN')) {
|
476 | 489 | $xtpl->parse('list.action_js');
|
477 | 490 | }
|
| 491 | + |
478 | 492 | $xtpl->parse('list');
|
479 | 493 | $xtpl->out('list');
|
480 | 494 | exit();
|
|
0 commit comments