source: extensions/AdditionalPages/admin/edit_page.inc.php @ 9272

Last change on this file since 9272 was 9272, checked in by patdenice, 10 years ago

New functionalities

File size: 1.1 KB
Line 
1<?php
2
3if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
4
5if (!is_numeric($_GET['edit']))
6{
7  die('Wrong identifier');
8}
9
10// Suppression
11if (isset($_REQUEST['delete']) and isset($_GET['edit']))
12{
13        pwg_query('DELETE FROM ' . ADD_PAGES_TABLE . ' WHERE id = ' . $_GET['edit'] . ';');
14  @unlink($conf['local_data_dir'].'/additional_pages_backup/' . $_GET['edit'] . '.txt');
15  if ($conf['additional_pages']['homepage'] == $_GET['edit'])
16  {
17    $conf['additional_pages']['homepage'] = null;
18    conf_update_param('additional_pages', pwg_db_real_escape_string(serialize($conf['additional_pages'])));
19  }
20  redirect($my_base_url.'&page_deleted=');
21}
22
23$q = 'SELECT id , lang , title , content , users , groups , permalink, standalone
24FROM ' . ADD_PAGES_TABLE . '
25WHERE id = '.$_GET['edit'].';';
26
27$edited_page = mysql_fetch_assoc(pwg_query($q));
28$page_title = l10n('ap_modify');
29$edited_page['homepage'] = $conf['additional_pages']['homepage'] == $edited_page['id'];
30$edited_page['standalone'] = ($edited_page['standalone'] == 'true');
31
32// Lien de suppression
33$template->assign('delete', true);
34
35include(AP_PATH.'admin/add_page.inc.php');
36
37?>
Note: See TracBrowser for help on using the repository browser.