Ignore:
Timestamp:
Dec 9, 2012, 6:34:58 PM (12 years ago)
Author:
julien1311
Message:

add the capacity to choose the supported files

Location:
extensions/Media_Icon/admin
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • extensions/Media_Icon/admin/admin.css

    r19353 r19372  
     1div.media_icon_admin_element {
     2        width: 20%;
     3        font-weight: bold;
     4        float: left;
     5        margin: 1,5em 1,5em;
     6}
     7
     8.media_icon_bold_center {
     9        font-weight: bold;
     10        text-align: center;
     11}
     12
     13.media_icon_important {
     14        font-weight: bold;
     15}
     16       
    117.showInfo {
    218  position:static;
     
    1733        margin-right: auto;
    1834        margin-bottom: 2em;
     35        font-weight: normal;
    1936}
    2037
  • extensions/Media_Icon/admin/admin_advanced.php

    r19324 r19372  
    5757$template->set_filenames(
    5858        array(
    59                 'plugin_admin_content' => dirname(__FILE__).'/admin_advanced.tpl'
     59                'plugin_admin_content_advanced' => dirname(__FILE__).'/admin_advanced.tpl'
    6060        )   
    6161);
    6262 
    6363//Assign the template contents to ADMIN_CONTENT
    64 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
     64$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content_advanced');
    6565?>
  • extensions/Media_Icon/admin/admin_general.php

    r19352 r19372  
    77        //New parameters
    88        $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        }
    917       
    1018        //Save
     
    2432        )
    2533);
     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);
    2651
    2752//Add our template to the global template
    2853$template->set_filenames(
    2954        array(
    30                 'plugin_admin_content' => dirname(__FILE__).'/admin_general.tpl'
     55                'plugin_admin_content_general' => dirname(__FILE__).'/admin_general.tpl'
    3156        )
    3257);
    3358 
    3459//Assign the template contents to ADMIN_CONTENT
    35 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
     60$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content_general');
    3661?>
  • extensions/Media_Icon/admin/admin_general.tpl

    r19353 r19372  
    1 {html_head}{literal}
    2 <style type="text/css">
    3         div.media_icon_admin_element {
    4                 width: 20%;
    5                 font-weight: bold;
    6                 float: left;
    7                 margin: 1,5em 1,5em;
    8         }
    9  
    10         .properties label {
    11                 font-weight: bold;
    12                 text-align: center;
    13         }
    14 
    15         .properties p {
    16                 font-weight: normal;
    17                 margin-top: 1em;
    18                 text-align: center;
    19         }
    20 
    21         .media_icon_important {
    22                 font-weight: bold;
    23         }
    24 </style>
    25 {/literal}{/html_head}
    261{footer_script}{literal}
    272jQuery(".showInfo").tipTip({
     
    4217        <fieldset>
    4318    <legend>{'Style'|@translate}</legend>
    44         <p>
    45                 <label for="media_icon_select">{'Icon style:'|@translate}</label>
     19        <p class="media_icon_bold_center">
     20                {'Icon style:'|@translate}
    4621        </p>
    47         <p>     
     22        <p class="media_icon_bold_center">     
    4823                <select id="media_icon_select" name="media_icon_style">
    49                         <option value="logo"{$media_icon_style_selected.logo}>{'Logo'|@translate}</option>
    50                         <option value="photo"{$media_icon_style_selected.photo}>{'Photo'|@translate}</option>
    51                         <option value="folder"{$media_icon_style_selected.folder}>{'Folder'|@translate}</option>
    52                         <option value="foldercolor"{$media_icon_style_selected.foldercolor}>{'Folder color'|@translate}</option>
     24                        <option value="logo" {$media_icon_style_selected.logo}>{'Logo'|@translate}</option>
     25                        <option value="photo" {$media_icon_style_selected.photo}>{'Photo'|@translate}</option>
     26                        <option value="folder" {$media_icon_style_selected.folder}>{'Folder'|@translate}</option>
     27                        <option value="foldercolor" {$media_icon_style_selected.foldercolor}>{'Folder color'|@translate}</option>
    5328                </select>
    5429        </p>
    55         <p>
    56                 <label>{'Type of files you want to add an icon to:'|@translate}</label>
     30        <p class="media_icon_bold_center">
     31                {'Types of files you want to add an icon to:'|@translate}
    5732        </p>
    5833        <p>
    5934                <div id="media_icon_admin_checkbox_left">
    60                         {'Youtube videos'|@translate} <input type="checkbox" name="media_icon_checkbox_youtube" value="1"><br />
    61                         {'Vimeo videos'|@translate} <input type="checkbox" name="media_icon_checkbox_vimeo" value="1"><br />
    62                         {'Dailymotion videos'|@translate} <input type="checkbox" name="media_icon_checkbox_dailymotion" value="1"><br />
    63                         {'Wideo videos'|@translate} <input type="checkbox" name="media_icon_checkbox_wideo" value="1"><br />
    64                         {'Wat videos'|@translate} <input type="checkbox" name="media_icon_checkbox_wat" value="1"><br />
    65                         {'Videos'|@translate} <input type="checkbox" name="media_icon_checkbox_video" value="1">
     35                        <label>{'Youtube videos'|@translate} <input type="checkbox" name="media_icon_checkbox[media_icon_checkbox_youtube]" value="1" {$media_icon_support_checked.youtube}></label><br />
     36                        <label>{'Vimeo videos'|@translate} <input type="checkbox" name="media_icon_checkbox[media_icon_checkbox_vimeo]" value="1" {$media_icon_support_checked.vimeo}></label><br />
     37                        <label>{'Dailymotion videos'|@translate} <input type="checkbox" name="media_icon_checkbox[media_icon_checkbox_dailymotion]" value="1" {$media_icon_support_checked.dailymotion}></label><br />
     38                        <label>{'Wat videos'|@translate} <input type="checkbox" name="media_icon_checkbox[media_icon_checkbox_wat]" value="1" {$media_icon_support_checked.wat}></label><br />
     39                        <label>{'Wideo videos'|@translate} <input type="checkbox" name="media_icon_checkbox[media_icon_checkbox_wideo]" value="1" {$media_icon_support_checked.wideo}></label><br />
     40                        <label>{'Videos'|@translate} <input type="checkbox" name="media_icon_checkbox[media_icon_checkbox_video]" value="1" {$media_icon_support_checked.video}></label>
    6641                </div>
    6742                <div id="media_icon_admin_checkbox_right">
    68                         <input type="checkbox" name="media_icon_checkbox_music" value="1"> {'Musics'|@translate}<br />
    69                         <input type="checkbox" name="media_icon_checkbox_pdf" value="1"> {'pdf files'|@translate}<br />
    70                         <input type="checkbox" name="media_icon_checkbox_document" value="1"> {'Documents'|@translate}<br />
    71                         <input type="checkbox" name="media_icon_checkbox_spreadsheet" value="1"> {'Spreadsheets'|@translate}<br />
    72                         <input type="checkbox" name="media_icon_checkbox_presentation" value="1"> {'Presentations'|@translate}
     43                        <label><input type="checkbox" name="media_icon_checkbox[media_icon_checkbox_music]" value="1" {$media_icon_support_checked.music}> {'Musics'|@translate}</label><br />
     44                        <label><input type="checkbox" name="media_icon_checkbox[media_icon_checkbox_pdf]" value="1" {$media_icon_support_checked.pdf}> {'pdf files'|@translate}</label><br />
     45                        <label><input type="checkbox" name="media_icon_checkbox[media_icon_checkbox_document]" value="1" {$media_icon_support_checked.document}> {'Documents'|@translate}</label><br />
     46                        <label><input type="checkbox" name="media_icon_checkbox[media_icon_checkbox_spreadsheet]" value="1" {$media_icon_support_checked.spreadsheet}> {'Spreadsheets'|@translate}</label><br />
     47                        <label><input type="checkbox" name="media_icon_checkbox[media_icon_checkbox_presentation]" value="1" {$media_icon_support_checked.presentation}> {'Presentations'|@translate}</label>
    7348                </div>
    7449        </p>
    7550        <div class="clear"></div>
    76         <p>{'Click on submit to see changes.'|@translate}</p>
     51        <p class="media_icon_bold_center">
     52                {'Click on submit to see changes.'|@translate}
     53        </p>
    7754        </fieldset>
    7855 
     
    8259<fieldset>
    8360        <legend>{'Result'|@translate}</legend>
    84         <div class="media_icon_admin_element">{'Youtube videos'|@translate} <a class="showInfo" title="{'Videos added with'|@translate} <a href='http://piwigo.org/ext/extension_view.php?eid=136'>Embedded Videos</a>">i</a><span class="media_icon_admin media_icon_admin_youtube_{$media_icon_style}"></span></div>
    85         <div class="media_icon_admin_element">{'Vimeo videos'|@translate} <a class="showInfo" title="{'Videos added with'|@translate} <a href='http://piwigo.org/ext/extension_view.php?eid=136'>Embedded Videos</a>">i</a><span class="media_icon_admin media_icon_admin_vimeo_{$media_icon_style}"></span></div>
    86         <div class="media_icon_admin_element">{'Dailymotion videos'|@translate} <a class="showInfo" title="{'Videos added with'|@translate} <a href='http://piwigo.org/ext/extension_view.php?eid=136'>Embedded Videos</a>">i</a><span class="media_icon_admin media_icon_admin_dailymotion_{$media_icon_style}"></span></div>
    87         <div class="media_icon_admin_element">{'Wat videos'|@translate} <a class="showInfo" title="{'Videos added with'|@translate} <a href='http://piwigo.org/ext/extension_view.php?eid=136'>Embedded Videos</a>">i</a><span class="media_icon_admin media_icon_admin_wat_{$media_icon_style}"></span></div>
    88         <div class="media_icon_admin_element">{'Wideo videos'|@translate} <a class="showInfo" title="{'Videos added with'|@translate} <a href='http://piwigo.org/ext/extension_view.php?eid=136'>Embedded Videos</a>">i</a><span class="media_icon_admin media_icon_admin_wideo_{$media_icon_style}"></span></div>
    89         <div class="media_icon_admin_element">{'Videos'|@translate} <a class="showInfo" title="{'Files supported: webm, webmv, ogv, m4v, flv, mp4'|@translate}">i</a><span class="media_icon_admin media_icon_admin_video_{$media_icon_style}"></span></div>
    90         <div class="media_icon_admin_element">{'Musics'|@translate} <a class="showInfo" title="{'Files supported: mp3, ogg, oga, m4a, webma, fla, wav'|@translate}">i</a><span class="media_icon_admin media_icon_admin_music_{$media_icon_style}"></span></div>
    91         <div class="media_icon_admin_element">{'pdf files'|@translate} <a class="showInfo" title="{'Files supported: pdf'|@translate}">i</a><span class="media_icon_admin media_icon_admin_pdf_{$media_icon_style}"></span></div>
    92         <div class="media_icon_admin_element">{'Documents'|@translate} <a class="showInfo" title="{'Files supported: doc, docx and odt'|@translate}">i</a><span class="media_icon_admin media_icon_admin_document_{$media_icon_style}"></span></div>
    93         <div class="media_icon_admin_element">{'Spreadsheets'|@translate} <a class="showInfo" title="{'Files supported: xls, xlsx and ods'|@translate}">i</a><span class="media_icon_admin media_icon_admin_spreadsheet_{$media_icon_style}"></span></div>
    94         <div class="media_icon_admin_element">{'Presentations'|@translate} <a class="showInfo" title="{'Files supported: ppt, pptx and odp'|@translate}">i</a><span class="media_icon_admin media_icon_admin_presentation_{$media_icon_style}"></span></div>
     61        <div class="media_icon_admin_element">{'Youtube videos'|@translate} <a class="showInfo" title="{'Videos added with'|@translate} <a href='http://piwigo.org/ext/extension_view.php?eid=136'>Embedded Videos</a>">i</a>{if $media_icon_support.youtube eq 1}<span class="media_icon_admin media_icon_admin_youtube_{$media_icon_style}">{else}<span class="media_icon_admin">{'Not displayed'|@translate}{/if}</span></div>
     62        <div class="media_icon_admin_element">{'Vimeo videos'|@translate} <a class="showInfo" title="{'Videos added with'|@translate} <a href='http://piwigo.org/ext/extension_view.php?eid=136'>Embedded Videos</a>">i</a>{if $media_icon_support.vimeo eq 1}<span class="media_icon_admin media_icon_admin_vimeo_{$media_icon_style}">{else}<span class="media_icon_admin">{'Not displayed'|@translate}{/if}</span></div>
     63        <div class="media_icon_admin_element">{'Dailymotion videos'|@translate} <a class="showInfo" title="{'Videos added with'|@translate} <a href='http://piwigo.org/ext/extension_view.php?eid=136'>Embedded Videos</a>">i</a>{if $media_icon_support.dailymotion eq 1}<span class="media_icon_admin media_icon_admin_dailymotion_{$media_icon_style}">{else}<span class="media_icon_admin">{'Not displayed'|@translate}{/if}</span></div>
     64        <div class="media_icon_admin_element">{'Wat videos'|@translate} <a class="showInfo" title="{'Videos added with'|@translate} <a href='http://piwigo.org/ext/extension_view.php?eid=136'>Embedded Videos</a>">i</a>{if $media_icon_support.wat eq 1}<span class="media_icon_admin media_icon_admin_wat_{$media_icon_style}">{else}<span class="media_icon_admin">{'Not displayed'|@translate}{/if}</span></div>
     65        <div class="media_icon_admin_element">{'Wideo videos'|@translate} <a class="showInfo" title="{'Videos added with'|@translate} <a href='http://piwigo.org/ext/extension_view.php?eid=136'>Embedded Videos</a>">i</a>{if $media_icon_support.wideo eq 1}<span class="media_icon_admin media_icon_admin_wideo_{$media_icon_style}">{else}<span class="media_icon_admin">{'Not displayed'|@translate}{/if}</span></div>
     66        <div class="media_icon_admin_element">{'Videos'|@translate} <a class="showInfo" title="{'Files supported: webm, webmv, ogv, m4v, flv, mp4'|@translate}">i</a>{if $media_icon_support.video eq 1}<span class="media_icon_admin media_icon_admin_video_{$media_icon_style}">{else}<span class="media_icon_admin">{'Not displayed'|@translate}{/if}</span></div>
     67        <div class="media_icon_admin_element">{'Musics'|@translate} <a class="showInfo" title="{'Files supported: mp3, ogg, oga, m4a, webma, fla, wav'|@translate}">i</a>{if $media_icon_support.music eq 1}<span class="media_icon_admin media_icon_admin_music_{$media_icon_style}">{else}<span class="media_icon_admin">{'Not displayed'|@translate}{/if}</span></div>
     68        <div class="media_icon_admin_element">{'pdf files'|@translate} <a class="showInfo" title="{'Files supported: pdf'|@translate}">i</a>{if $media_icon_support.pdf eq 1}<span class="media_icon_admin media_icon_admin_pdf_{$media_icon_style}">{else}<span class="media_icon_admin">{'Not displayed'|@translate}{/if}</span></div>
     69        <div class="media_icon_admin_element">{'Documents'|@translate} <a class="showInfo" title="{'Files supported: doc, docx and odt'|@translate}">i</a>{if $media_icon_support.document eq 1}<span class="media_icon_admin media_icon_admin_document_{$media_icon_style}">{else}<span class="media_icon_admin">{'Not displayed'|@translate}{/if}</span></div>
     70        <div class="media_icon_admin_element">{'Spreadsheets'|@translate} <a class="showInfo" title="{'Files supported: xls, xlsx and ods'|@translate}">i</a>{if $media_icon_support.spreadsheet eq 1}<span class="media_icon_admin media_icon_admin_spreadsheet_{$media_icon_style}">{else}<span class="media_icon_admin">{'Not displayed'|@translate}{/if}</span></div>
     71        <div class="media_icon_admin_element">{'Presentations'|@translate} <a class="showInfo" title="{'Files supported: ppt, pptx and odp'|@translate}">i</a>{if $media_icon_support.presentation eq 1}<span class="media_icon_admin media_icon_admin_presentation_{$media_icon_style}">{else}<span class="media_icon_admin">{'Not displayed'|@translate}{/if}</span></div>
    9572</fieldset>
  • extensions/Media_Icon/admin/admin_help.php

    r19353 r19372  
    33$template->set_filenames(
    44        array(
    5                 'plugin_admin_content' => dirname(__FILE__).'/admin_help.tpl'
     5                'plugin_admin_content_help' => dirname(__FILE__).'/admin_help.tpl'
    66        )
    77);
    88 
    99//Assign the template contents to ADMIN_CONTENT
    10 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
     10$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content_help');
    1111?>
Note: See TracChangeset for help on using the changeset viewer.