source: extensions/AdditionalPages/trunk/admin/manage.inc.php @ 19429

Revision 19429, 1.7 KB checked in by mistic100, 7 years ago (diff)

replace $conflocal_data_dir by $confdata_location

Line 
1<?php
2
3if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
4
5if (isset($_GET['page_saved']))
6{
7  array_push($page['infos'], l10n('ap_saved_page'));
8}
9if (isset($_GET['page_deleted']))
10{
11  array_push($page['infos'], l10n('ap_deleted_page'));
12}
13
14if (isset($_POST['submit']))
15{
16  asort($_POST['position'], SORT_NUMERIC);
17  $pos = 1;
18  foreach($_POST['position'] as $id => $old_pos)
19  {
20    $num = isset($_POST['hide_'.$id]) ? -1 : +1;
21    $query = '
22UPDATE ' . ADD_PAGES_TABLE . '
23  SET pos = '.$num*abs($pos++).'
24  WHERE id = '.$id.'
25LIMIT 1
26;';
27    pwg_query($query);
28  }
29  array_push($page['infos'], l10n('ap_conf_saved'));
30}
31
32if (defined('EXTENDED_DESC_PATH'))
33{
34  add_event_handler('AP_render_title', 'get_user_language_desc');
35}
36
37$languages = get_languages();
38
39$query = 'SELECT id, pos, lang, title, standalone, permalink
40FROM '.ADD_PAGES_TABLE.'
41ORDER BY ABS(pos) ASC, id ASC
42;';
43$result = pwg_query($query);
44
45while ($row = pwg_db_fetch_assoc($result))
46{
47  $row['U_PAGE'] = make_index_url(array('section'=>'page')).'/'.(isset($row['permalink']) ? $row['permalink'] : $row['id']);
48  $row['U_EDIT'] = get_root_url().'admin.php?page=plugin-'.AP_DIR.'-edit_page&amp;edit='.$row['id'];
49  $row['U_DELETE'] = get_root_url().'admin.php?page=plugin-'.AP_DIR.'-edit_page&amp;edit='.$row['id'].'&amp;delete=';
50
51  $row['title'] = trigger_event('AP_render_title', $row['title']);
52  $row['language'] = @$languages[$row['lang']];
53
54  $template->append('pages', $row);
55}
56
57$template->assign(array(
58  'F_ACTION' => $my_base_url.'&amp;tab=manage',
59  'HOMEPAGE' => $conf['AP']['homepage'],
60  )
61);
62
63$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/template/manage.tpl'));
64$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
65
66?>
Note: See TracBrowser for help on using the repository browser.