[10852] | 1 | <?php |
---|
| 2 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
| 3 | |
---|
| 4 | global $conf, $template; |
---|
| 5 | load_language('plugin.lang', B2F_PATH); |
---|
| 6 | $conf['back2front'] = explode(',', $conf['back2front']); |
---|
| 7 | |
---|
[11219] | 8 | include_once(B2F_PATH.'functions.inc.php'); |
---|
| 9 | |
---|
[10852] | 10 | // Enregistrement de la configuration |
---|
| 11 | if (isset($_POST['submit'])) |
---|
| 12 | { |
---|
[12361] | 13 | $conf['back2front'] = array( |
---|
[10981] | 14 | $conf['back2front'][0], |
---|
| 15 | $_POST['switch_mode'], |
---|
[11219] | 16 | $_POST['transition'], |
---|
| 17 | $_POST['position'], |
---|
| 18 | serialize(stripslashes_deep(str_replace(array("'",'"',','), null, $_POST['link_name']))), |
---|
[12361] | 19 | isset($_POST['show_thumbnail']), |
---|
[10981] | 20 | ); |
---|
[12361] | 21 | |
---|
[10981] | 22 | conf_update_param('back2front', implode (',', $conf['back2front'])); |
---|
[12361] | 23 | array_push($page['infos'], l10n('Information data registered in database')); |
---|
[10852] | 24 | } |
---|
| 25 | |
---|
[11219] | 26 | // Gestion des langues pour le bloc menu |
---|
| 27 | $conf['back2front'][4] = unserialize($conf['back2front'][4]); |
---|
| 28 | $template->append('link_name', array( |
---|
| 29 | 'LANGUAGE_NAME' => l10n('Default'), |
---|
| 30 | 'LANGUAGE_CODE' => 'default', |
---|
| 31 | 'VALUE' => @$conf['back2front'][4]['default'], |
---|
| 32 | ) |
---|
| 33 | ); |
---|
| 34 | foreach (get_languages() as $language_code => $language_name) |
---|
| 35 | { |
---|
[12361] | 36 | $template->append('link_name', array( |
---|
[11219] | 37 | 'LANGUAGE_NAME' => $language_name, |
---|
| 38 | 'LANGUAGE_CODE' => $language_code, |
---|
| 39 | 'VALUE' => isset($conf['back2front'][4][$language_code]) ? $conf['back2front'][4][$language_code] : '', |
---|
| 40 | ) |
---|
| 41 | ); |
---|
| 42 | } |
---|
| 43 | |
---|
[10852] | 44 | $template->assign(array( |
---|
[11219] | 45 | 'B2F_PATH' => B2F_PATH, |
---|
[12361] | 46 | 'SWITCH_MODE' => $conf['back2front'][1], |
---|
| 47 | 'TRANSITION' => $conf['back2front'][2], |
---|
[11219] | 48 | 'POSITION' => $conf['back2front'][3], |
---|
[12361] | 49 | 'SHOW_THUMBNAIL' => $conf['back2front'][5], |
---|
[10852] | 50 | )); |
---|
[12361] | 51 | |
---|
[10852] | 52 | $template->set_filename('back2front_conf', dirname(__FILE__).'/template/admin.tpl'); |
---|
| 53 | $template->assign_var_from_handle('ADMIN_CONTENT', 'back2front_conf'); |
---|
| 54 | |
---|
| 55 | ?> |
---|