[19324] | 1 | <?php |
---|
| 2 | //Initialization |
---|
| 3 | $conf_media_icon_general = unserialize($conf['media_icon_general']); |
---|
| 4 | |
---|
| 5 | //Save config |
---|
| 6 | if (isset($_POST['submit'])) { |
---|
| 7 | //New parameters |
---|
| 8 | $conf_media_icon_general['style'] = $_POST['media_icon_style']; |
---|
| 9 | |
---|
[19372] | 10 | //faire avec foreach |
---|
| 11 | foreach ($conf_media_icon_general['support'] as $media_icon_support => $value) { |
---|
| 12 | if(isset($_POST['media_icon_checkbox']['media_icon_checkbox_'.$media_icon_support]) && ($_POST['media_icon_checkbox']['media_icon_checkbox_'.$media_icon_support] == 1)) |
---|
| 13 | $conf_media_icon_general['support'][$media_icon_support] = 1; |
---|
| 14 | else |
---|
| 15 | $conf_media_icon_general['support'][$media_icon_support] = 0; |
---|
| 16 | } |
---|
| 17 | |
---|
[19324] | 18 | //Save |
---|
| 19 | conf_update_param('media_icon_general', serialize($conf_media_icon_general)); |
---|
| 20 | array_push($page['infos'], l10n('Information data registered in database')); |
---|
| 21 | } |
---|
| 22 | |
---|
| 23 | //Parameters of the template |
---|
[19352] | 24 | $template->assign('media_icon_style',$conf_media_icon_general['style']); |
---|
[19374] | 25 | |
---|
| 26 | $media_icon_style_selected = array(); |
---|
| 27 | foreach ($conf_media_icon_general['styles'] as $media_icon_style) |
---|
| 28 | $media_icon_style_selected[$media_icon_style] = (($conf_media_icon_general['style'] == $media_icon_style) ? 'selected="selected"' : ''); |
---|
| 29 | |
---|
| 30 | $template->assign('media_icon_style_selected', $media_icon_style_selected); |
---|
[19372] | 31 | $template->assign('media_icon_support',$conf_media_icon_general['support']); |
---|
| 32 | $template->assign( |
---|
| 33 | 'media_icon_support_checked', |
---|
| 34 | array( |
---|
| 35 | 'youtube' => (($conf_media_icon_general['support']['youtube'] == 1) ? 'checked = "checked"' : ""), |
---|
| 36 | 'vimeo' => (($conf_media_icon_general['support']['vimeo'] == 1) ? 'checked = "checked"' : ""), |
---|
| 37 | 'dailymotion' => (($conf_media_icon_general['support']['dailymotion'] == 1) ? 'checked = "checked"' : ""), |
---|
| 38 | 'wideo' => (($conf_media_icon_general['support']['wideo'] == 1) ? 'checked = "checked"' : ""), |
---|
| 39 | 'wat' => (($conf_media_icon_general['support']['wat'] == 1) ? 'checked = "checked"' : ""), |
---|
| 40 | 'video' => (($conf_media_icon_general['support']['video'] == 1) ? 'checked = "checked"' : ""), |
---|
| 41 | 'music' => (($conf_media_icon_general['support']['music'] == 1) ? 'checked = "checked"' : ""), |
---|
| 42 | 'pdf' => (($conf_media_icon_general['support']['pdf'] == 1) ? 'checked = "checked"' : ""), |
---|
| 43 | 'document' => (($conf_media_icon_general['support']['document'] == 1) ? 'checked = "checked"' : ""), |
---|
| 44 | 'spreadsheet' => (($conf_media_icon_general['support']['spreadsheet'] == 1) ? 'checked = "checked"' : ""), |
---|
| 45 | 'presentation' => (($conf_media_icon_general['support']['presentation'] == 1) ? 'checked = "checked"' : ""), |
---|
| 46 | ) |
---|
| 47 | ); |
---|
[19352] | 48 | |
---|
[19324] | 49 | //Add our template to the global template |
---|
| 50 | $template->set_filenames( |
---|
| 51 | array( |
---|
[19372] | 52 | 'plugin_admin_content_general' => dirname(__FILE__).'/admin_general.tpl' |
---|
[19352] | 53 | ) |
---|
[19324] | 54 | ); |
---|
| 55 | |
---|
| 56 | //Assign the template contents to ADMIN_CONTENT |
---|
[19372] | 57 | $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content_general'); |
---|
[19324] | 58 | ?> |
---|