source: extensions/Media_Icon/admin/admin_general.php @ 19374

Last change on this file since 19374 was 19374, checked in by julien1311, 11 years ago

new icon sets
remove photo set => copyright
improvements to help page

  • Property svn:eol-style set to LF
File size: 2.7 KB
Line 
1<?php
2//Initialization
3$conf_media_icon_general = unserialize($conf['media_icon_general']);
4
5//Save config
6if (isset($_POST['submit'])) { 
7        //New parameters
8        $conf_media_icon_general['style'] = $_POST['media_icon_style'];
9       
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       
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
24$template->assign('media_icon_style',$conf_media_icon_general['style']);
25
26$media_icon_style_selected = array();
27foreach ($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);
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);
48
49//Add our template to the global template
50$template->set_filenames(
51        array(
52                'plugin_admin_content_general' => dirname(__FILE__).'/admin_general.tpl'
53        )
54);
55 
56//Assign the template contents to ADMIN_CONTENT
57$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content_general');
58?>
Note: See TracBrowser for help on using the repository browser.