Changeset 9323 for extensions
- Timestamp:
- Feb 20, 2011, 1:14:40 PM (14 years ago)
- Location:
- extensions/AdditionalPages
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/AdditionalPages/additional_page.php
r9312 r9323 5 5 global $template, $user; 6 6 7 $identifier = $page['ap_homepage'] ? $conf[' additional_pages']['homepage'] : $tokens[1];7 $identifier = $page['ap_homepage'] ? $conf['AP']['homepage'] : $tokens[1]; 8 8 9 9 if (function_exists('get_extended_desc')) … … 99 99 ); 100 100 101 if ($conf[' additional_pages']['show_home'] and !$page['ap_homepage'])101 if ($conf['AP']['show_home'] and !$page['ap_homepage']) 102 102 { 103 103 $template->assign('PLUGIN_INDEX_ACTIONS' , ' -
extensions/AdditionalPages/admin/add_page.inc.php
r9314 r9323 56 56 57 57 $user_access = 'NULL'; 58 if ($conf[' additional_pages']['user_perm'])58 if ($conf['AP']['user_perm']) 59 59 { 60 60 $user_access = !empty($_POST['users']) ? '"'.implode(',', $_POST['users']).'"' : '""'; … … 104 104 105 105 // Homepage 106 if (isset($_POST['homepage']) xor $conf[' additional_pages']['homepage'] == $edited_page['id'])107 { 108 $conf[' additional_pages']['homepage'] = isset($_POST['homepage']) ? $edited_page['id'] : null;109 conf_update_param('additional_pages', pwg_db_real_escape_string(serialize($conf[' additional_pages'])));106 if (isset($_POST['homepage']) xor $conf['AP']['homepage'] == $edited_page['id']) 107 { 108 $conf['AP']['homepage'] = isset($_POST['homepage']) ? $edited_page['id'] : null; 109 conf_update_param('additional_pages', pwg_db_real_escape_string(serialize($conf['AP']))); 110 110 } 111 111 … … 152 152 153 153 // Groups options 154 if ($conf[' additional_pages']['group_perm'])154 if ($conf['AP']['group_perm']) 155 155 { 156 156 $query = 'SELECT id, name FROM '.GROUPS_TABLE.' ORDER BY name ASC;'; … … 169 169 170 170 // Users options 171 if ($conf[' additional_pages']['user_perm'])171 if ($conf['AP']['user_perm']) 172 172 { 173 173 $users_id = array('guest', 'generic', 'normal', 'admin', 'webmaster'); … … 185 185 186 186 // User level options 187 if ($conf[' additional_pages']['level_perm'])187 if ($conf['AP']['level_perm']) 188 188 { 189 189 foreach ($conf['available_permission_levels'] as $level) … … 201 201 $template->assign(array( 202 202 'AP_TITLE' => $page_title, 203 'NAME' => $edited_page['title'],204 'PERMALINK' => $edited_page['permalink'],203 'NAME' => htmlspecialchars($edited_page['title']), 204 'PERMALINK' => htmlspecialchars($edited_page['permalink']), 205 205 'HOMEPAGE' => $edited_page['homepage'], 206 206 'STANDALONE' => $edited_page['standalone'], 207 'CONTENT' => $edited_page['content'])); 207 'CONTENT' => htmlspecialchars($edited_page['content']) 208 ) 209 ); 208 210 209 211 $template->set_filename('plugin_admin_content', dirname(__FILE__) . '/template/add_page.tpl'); -
extensions/AdditionalPages/admin/config.inc.php
r9314 r9323 8 8 if (isset($_POST['submit'])) 9 9 { 10 if (!$conf[' additional_pages']['user_perm'] and isset($_POST['user_perm']))10 if (!$conf['AP']['user_perm'] and isset($_POST['user_perm'])) 11 11 { 12 12 pwg_query('UPDATE '.ADD_PAGES_TABLE.' SET users = "guest,generic,normal,admin,webmaster";'); 13 13 } 14 if ($conf[' additional_pages']['user_perm'] and !isset($_POST['user_perm']))14 if ($conf['AP']['user_perm'] and !isset($_POST['user_perm'])) 15 15 { 16 16 pwg_query('UPDATE '.ADD_PAGES_TABLE.' SET users = NULL;'); 17 17 } 18 if ($conf[' additional_pages']['level_perm'] and !isset($_POST['level_perm']))18 if ($conf['AP']['level_perm'] and !isset($_POST['level_perm'])) 19 19 { 20 20 $default_user = get_default_user_info(true); 21 21 pwg_query('UPDATE '.ADD_PAGES_TABLE.' SET level = '.$default_user['level'].';'); 22 22 } 23 if ($conf[' additional_pages']['group_perm'] and !isset($_POST['group_perm']))23 if ($conf['AP']['group_perm'] and !isset($_POST['group_perm'])) 24 24 { 25 25 pwg_query('UPDATE '.ADD_PAGES_TABLE.' SET groups = NULL;'); … … 30 30 foreach ($params as $param) 31 31 { 32 $conf[' additional_pages'][$param] = isset($_POST[$param]);32 $conf['AP'][$param] = isset($_POST[$param]); 33 33 } 34 34 35 $conf[' additional_pages']['languages'] = array();35 $conf['AP']['languages'] = array(); 36 36 foreach($_POST['menu_lang'] as $language_code => $name) 37 37 { 38 38 if (!empty($name)) 39 $conf[' additional_pages']['languages'][$language_code] = $name;39 $conf['AP']['languages'][$language_code] = $name; 40 40 } 41 41 42 conf_update_param('additional_pages', pwg_db_real_escape_string(serialize($conf[' additional_pages'])));42 conf_update_param('additional_pages', pwg_db_real_escape_string(serialize($conf['AP']))); 43 43 44 44 if (isset($_POST['show_menu']) xor (!isset($mb_conf['mbAdditionalPages']) or $mb_conf['mbAdditionalPages'] > 0)) … … 60 60 'LANGUAGE_NAME' => l10n('Default'), 61 61 'LANGUAGE_CODE' => 'default', 62 'VALUE' => @$conf[' additional_pages']['languages']['default'],62 'VALUE' => @$conf['AP']['languages']['default'], 63 63 ) 64 64 ); … … 68 68 'LANGUAGE_NAME' => $language_name, 69 69 'LANGUAGE_CODE' => $language_code, 70 'VALUE' => isset($conf[' additional_pages']['languages'][$language_code]) ? $conf['additional_pages']['languages'][$language_code] : '',70 'VALUE' => isset($conf['AP']['languages'][$language_code]) ? $conf['AP']['languages'][$language_code] : '', 71 71 ) 72 72 ); … … 74 74 75 75 // Parametrage du template 76 $template->assign('ap_conf', $conf[' additional_pages']);76 $template->assign('ap_conf', $conf['AP']); 77 77 78 78 if (!isset($mb_conf['mbAdditionalPages']) or $mb_conf['mbAdditionalPages'] == abs($mb_conf['mbAdditionalPages'])) -
extensions/AdditionalPages/admin/edit_page.inc.php
r9312 r9323 14 14 @unlink($conf['local_data_dir'].'/additional_pages_backup/' . $_GET['edit'] . '.txt'); 15 15 16 if ($conf[' additional_pages']['homepage'] == $_GET['edit'])16 if ($conf['AP']['homepage'] == $_GET['edit']) 17 17 { 18 $conf[' additional_pages']['homepage'] = null;19 conf_update_param('additional_pages', pwg_db_real_escape_string(serialize($conf[' additional_pages'])));18 $conf['AP']['homepage'] = null; 19 conf_update_param('additional_pages', pwg_db_real_escape_string(serialize($conf['AP']))); 20 20 } 21 21 … … 33 33 $edited_page['users'] = !empty($edited_page['users']) ? explode(',', $edited_page['users']) : array(); 34 34 $edited_page['groups'] = !empty($edited_page['groups']) ? explode(',', $edited_page['groups']) : array(); 35 $edited_page['homepage'] = $conf[' additional_pages']['homepage'] == $edited_page['id'];35 $edited_page['homepage'] = $conf['AP']['homepage'] == $edited_page['id']; 36 36 $edited_page['standalone'] = ($edited_page['standalone'] == 'true'); 37 37 -
extensions/AdditionalPages/admin/manage.inc.php
r9313 r9323 50 50 $template->assign(array( 51 51 'F_ACTION' => $my_base_url.'&tab=manage', 52 'HOMEPAGE' => $conf[' additional_pages']['homepage'],52 'HOMEPAGE' => $conf['AP']['homepage'], 53 53 ) 54 54 ); -
extensions/AdditionalPages/admin/upgrade.inc.php
r9310 r9323 18 18 } 19 19 20 if ($conf[' additional_pages'] === false)20 if ($conf['AP'] === false) 21 21 { 22 22 load_conf_from_db('param = "additional_pages"'); … … 62 62 $position = $row['pos']; 63 63 if ($row['pos'] === '0') 64 $position = '-100 ';64 $position = '-1000'; 65 65 elseif (empty($row['pos'])) 66 66 $position = '0'; … … 70 70 $query = ' 71 71 UPDATE '.$prefixeTable.'additionalpages 72 SET title = "'. addslashes($title).'",72 SET title = "'.pwg_db_real_escape_string($title).'", 73 73 pos = '.$position.', 74 74 lang = '.$language.', … … 108 108 } 109 109 110 $conf[' additional_pages'] = $new_conf;110 $conf['AP'] = $new_conf; 111 111 112 112 conf_update_param('additional_pages', pwg_db_real_escape_string(serialize($new_conf))); 113 113 } 114 114 115 if (!isset($conf[' additional_pages']['level_perm']))115 if (!isset($conf['AP']['level_perm'])) 116 116 { 117 117 $query = ' … … 128 128 pwg_query($query); 129 129 130 $conf[' additional_pages']['level_perm'] = false;130 $conf['AP']['level_perm'] = false; 131 131 132 conf_update_param('additional_pages', pwg_db_real_escape_string(serialize($conf[' additional_pages'])));132 conf_update_param('additional_pages', pwg_db_real_escape_string(serialize($conf['AP']))); 133 133 } 134 134 -
extensions/AdditionalPages/main.inc.php
r9312 r9323 17 17 define('ADD_PAGES_TABLE' , $prefixeTable . 'additionalpages'); 18 18 19 $conf[' additional_pages'] = @unserialize($conf['additional_pages']);19 $conf['AP'] = @unserialize($conf['additional_pages']); 20 20 21 21 // Need upgrade? 22 if (!isset($conf[' additional_pages']['level_perm']))22 if (!isset($conf['AP']['level_perm'])) 23 23 include(AP_PATH.'admin/upgrade.inc.php'); 24 24 … … 39 39 $page['ap_homepage'] = (count($tokens) == 1 and empty($tokens[0])); 40 40 41 if (($tokens[0] == 'page' and !empty($tokens[1])) or ($page['ap_homepage'] and !is_null($conf[' additional_pages']['homepage'])))41 if (($tokens[0] == 'page' and !empty($tokens[1])) or ($page['ap_homepage'] and !is_null($conf['AP']['homepage']))) 42 42 include(AP_PATH . 'additional_page.php'); 43 43 … … 83 83 if (!empty($data)) 84 84 { 85 $title = isset($conf[' additional_pages']['languages'][$user['language']]) ?86 $conf[' additional_pages']['languages'][$user['language']] :87 @$conf[' additional_pages']['languages']['default'];85 $title = isset($conf['AP']['languages'][$user['language']]) ? 86 $conf['AP']['languages'][$user['language']] : 87 @$conf['AP']['languages']['default']; 88 88 89 89 $template->set_template_dir(AP_PATH.'template/'); -
extensions/AdditionalPages/maintain.inc.php
r9310 r9323 39 39 40 40 $query = 'INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment) 41 VALUES ("additional_pages" , "'.pwg_db_real_escape_string(serialize($config)).'" , "Additional Pages config configuration");';41 VALUES ("additional_pages" , "'.pwg_db_real_escape_string(serialize($config)).'" , "Additional Pages configuration");'; 42 42 pwg_query($query); 43 43 }
Note: See TracChangeset
for help on using the changeset viewer.