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

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

add the capacity to choose the supported files

  • Property svn:eol-style set to LF
File size: 2.8 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$template->assign(
26        'media_icon_style_selected',
27        array(
28                'logo' => (($conf_media_icon_general['style'] == 'logo') ? 'selected = "selected"' : ""),
29                'photo' => (($conf_media_icon_general['style'] == 'photo') ? 'selected = "selected"' : ""),
30                'folder' => (($conf_media_icon_general['style'] == 'folder') ? 'selected = "selected"' : ""),
31                'foldercolor' => (($conf_media_icon_general['style'] == 'foldercolor') ? 'selected = "selected"' : ""),
32        )
33);
34$template->assign('media_icon_support',$conf_media_icon_general['support']);
35$template->assign(
36        'media_icon_support_checked',
37        array(
38                'youtube' => (($conf_media_icon_general['support']['youtube'] == 1) ? 'checked = "checked"' : ""),
39                'vimeo' => (($conf_media_icon_general['support']['vimeo'] == 1) ? 'checked = "checked"' : ""),
40                'dailymotion' => (($conf_media_icon_general['support']['dailymotion'] == 1) ? 'checked = "checked"' : ""),
41                'wideo' => (($conf_media_icon_general['support']['wideo'] == 1) ? 'checked = "checked"' : ""),
42                'wat' => (($conf_media_icon_general['support']['wat'] == 1) ? 'checked = "checked"' : ""),
43                'video' => (($conf_media_icon_general['support']['video'] == 1) ? 'checked = "checked"' : ""),
44                'music' => (($conf_media_icon_general['support']['music'] == 1) ? 'checked = "checked"' : ""),
45                'pdf' => (($conf_media_icon_general['support']['pdf'] == 1) ? 'checked = "checked"' : ""),
46                'document' => (($conf_media_icon_general['support']['document'] == 1) ? 'checked = "checked"' : ""),
47                'spreadsheet' => (($conf_media_icon_general['support']['spreadsheet'] == 1) ? 'checked = "checked"' : ""),
48                'presentation' => (($conf_media_icon_general['support']['presentation'] == 1) ? 'checked = "checked"' : ""),
49        )
50);
51
52//Add our template to the global template
53$template->set_filenames(
54        array(
55                'plugin_admin_content_general' => dirname(__FILE__).'/admin_general.tpl'
56        )
57);
58 
59//Assign the template contents to ADMIN_CONTENT
60$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content_general');
61?>
Note: See TracBrowser for help on using the repository browser.