source: extensions/PHP_Optimisateur/plugins/charlies_content/setup.php @ 10337

Last change on this file since 10337 was 10337, checked in by mistic100, 13 years ago

new version 1.4, new plugin for Charlies Content, NConvert updated

File size: 1.3 KB
Line 
1<?php
2load_plugin_lang('charlies_content');
3
4switch ($PLUGIN_ACTION) {
5        // Affichage simple de la configuration
6        case 'read_config':
7                // vérifie que ffmpeg est bien présent
8                if (!file_exists('include/ffmpeg.exe') AND $plugin_config['active']) {
9                        $ERRORS['fatal'][] = 'charlies_content.error_ffmpeg';
10                }
11                               
12                $PAGE['content'] .= '
13                <table>
14                        <tr>
15                                <td>'.l10n('charlies_content.video_time').' :</td>
16                                <td>'.bool_to_string($plugin_config['video_time']).($plugin_config['video_time']!=='rand' ? ' sec':'om').'</td>
17                        </tr>
18                </table>';
19                break;
20       
21       
22        // Actions avant enregistrement
23        case 'save_config':
24                if (!is_decimal($_POST['Plugins']['charlies_content']['video_time']) AND $_POST['Plugins']['charlies_content']['video_time'] != 'rand') {
25                        $_POST['Plugins']['charlies_content']['video_time'] = 'rand';
26                        $ERRORS['conf'][] = array(l10n('charlies_content.video_time'), 'must_be_integer');
27                }
28
29                break;
30
31               
32        // Formulaire d'édition
33        case 'edit_config':
34                $PAGE['content'] .='
35                <table>
36                        <tr>
37                                <td>'.l10n('charlies_content.video_time').' :</td>
38                                <td>
39                                        <input type="text" name="Plugins[charlies_content][video_time]" value="'.$plugin_config['video_time'].'" size="3"/>sec
40                                        <i>'.l10n('charlies_content.rand').'</i>
41                                </td>
42                        </tr>
43                </table>';
44                break;
45} 
46?>
Note: See TracBrowser for help on using the repository browser.