[9407] | 1 | <?php |
---|
| 2 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
| 3 | global $template, $conf, $user; |
---|
| 4 | include_once(PHPWG_ROOT_PATH .'admin/include/tabsheet.class.php'); |
---|
| 5 | load_language('plugin.lang', TITLE_PATH); |
---|
| 6 | $my_base_url = get_admin_plugin_menu_link(__FILE__); |
---|
| 7 | |
---|
| 8 | // +-----------------------------------------------------------------------+ |
---|
| 9 | // | Check Access and exit when user status is not ok | |
---|
| 10 | // +-----------------------------------------------------------------------+ |
---|
| 11 | check_status(ACCESS_ADMINISTRATOR); |
---|
| 12 | |
---|
| 13 | // Gestion des onglets |
---|
| 14 | if (!isset($_GET['tab'])) |
---|
| 15 | $page['tab'] = 'plugtitle'; |
---|
| 16 | else |
---|
| 17 | $page['tab'] = $_GET['tab']; |
---|
| 18 | |
---|
| 19 | $tabsheet = new tabsheet(); |
---|
| 20 | $tabsheet->add('plugtitle', |
---|
| 21 | l10n('title_tab_plgtitle'), |
---|
| 22 | $my_base_url.'&tab=plugtitle'); |
---|
| 23 | $tabsheet->select($page['tab']); |
---|
| 24 | $tabsheet->assign(); |
---|
| 25 | |
---|
| 26 | // Tab Title on specials pages |
---|
| 27 | switch ($page['tab']) |
---|
| 28 | { |
---|
| 29 | case 'plugtitle': |
---|
| 30 | |
---|
| 31 | $titlepagelistT = array( |
---|
| 32 | l10n('title_select'), |
---|
| 33 | '----------------------', |
---|
| 34 | l10n('Home'), |
---|
| 35 | l10n('Best rated'), |
---|
| 36 | l10n('Most visited'), |
---|
| 37 | l10n('Recent pictures'), |
---|
| 38 | l10n('Recent categories'), |
---|
| 39 | l10n('Favorites'), |
---|
| 40 | l10n('Tags'), |
---|
| 41 | l10n('Comments'), |
---|
| 42 | l10n('About'), |
---|
| 43 | l10n('search'), |
---|
| 44 | l10n('Random pictures'), |
---|
| 45 | l10n('Notification'), |
---|
| 46 | ); |
---|
| 47 | |
---|
| 48 | $titlepagelist = array( |
---|
| 49 | '', |
---|
| 50 | '', |
---|
| 51 | 'home', |
---|
| 52 | 'best_rated', |
---|
| 53 | 'most_visited', |
---|
| 54 | 'recent_pics', |
---|
| 55 | 'recent_cats', |
---|
| 56 | 'favorites', |
---|
| 57 | 'tags', |
---|
| 58 | 'comments', |
---|
| 59 | 'about', |
---|
| 60 | 'search', |
---|
| 61 | 'random', |
---|
| 62 | 'notification', |
---|
| 63 | ); |
---|
| 64 | |
---|
| 65 | $template->assign( |
---|
| 66 | 'gestionA', |
---|
| 67 | array( |
---|
| 68 | )); |
---|
| 69 | |
---|
| 70 | $template->assign('titlepagelist', $titlepagelist); |
---|
| 71 | $template->assign('titlepagelistT', $titlepagelistT); |
---|
| 72 | |
---|
| 73 | //edit title |
---|
| 74 | if (isset($_POST['subtitlespecialET']) and (!$_POST['titlelist'])==0 and !is_adviser()) |
---|
| 75 | { |
---|
| 76 | $lire=$_POST['titlelist']; |
---|
| 77 | $query = ' |
---|
| 78 | select id,page,title |
---|
| 79 | FROM ' . TITLE_TABLE . ' |
---|
| 80 | WHERE page = \''.$lire.'\' |
---|
| 81 | ;'; |
---|
| 82 | $result = pwg_query($query); |
---|
| 83 | |
---|
| 84 | $row = mysql_fetch_array($result); |
---|
| 85 | $titlepage=$row['page']; |
---|
| 86 | $titletitle=$row['title']; |
---|
| 87 | |
---|
| 88 | $selected2 = ""; |
---|
| 89 | |
---|
| 90 | $template->assign( |
---|
| 91 | 'title_edit', |
---|
| 92 | array( |
---|
| 93 | 'VALUE' => $titlepage, |
---|
| 94 | 'CONTENT' => $titletitle, |
---|
| 95 | 'SELECTED' => $selected2 |
---|
| 96 | )); |
---|
| 97 | } |
---|
| 98 | |
---|
| 99 | //insert title in database |
---|
| 100 | if (isset($_POST['subtitlespecial']) and !is_adviser()) |
---|
| 101 | { |
---|
| 102 | $query = ' |
---|
| 103 | UPDATE ' . TITLE_TABLE . ' |
---|
| 104 | SET title= \''.$_POST['inser'].'\' |
---|
| 105 | WHERE page = \''.$_POST['invisible'].'\' |
---|
| 106 | ;'; |
---|
| 107 | $result = pwg_query($query); |
---|
| 108 | } |
---|
| 109 | |
---|
| 110 | break; |
---|
| 111 | |
---|
| 112 | } |
---|
| 113 | |
---|
| 114 | $template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/admin.tpl')); |
---|
| 115 | $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); |
---|
| 116 | ?> |
---|