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

Last change on this file since 19390 was 19374, checked in by julien1311, 12 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
RevLine 
[19324]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       
[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();
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);
[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?>
Note: See TracBrowser for help on using the repository browser.