-
Notifications
You must be signed in to change notification settings - Fork 3
/
config.php
executable file
·68 lines (62 loc) · 2.86 KB
/
config.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
/**
* Plugin plxMinifyCache
*
* @package PLX
* @version 1.4
* @date 20/04/2013
* @author i M@N
**/
if(!defined('PLX_ROOT')) exit;
# Control du token du formulaire
plxToken::validateFormToken($_POST);
if(!empty($_POST)) {
if (!empty($_POST['delay']) ) {
$plxPlugin->setParam('delay', $_POST['delay'], 'cdata');
$plxPlugin->setParam('exclude', implode(',',$_POST['exclude']), 'string');
$plxPlugin->setParam('minify', implode(',',$_POST['minify']), 'string');
} else {
$plxPlugin->setParam('delay', '3600', 'cdata');
$plxPlugin->setParam('exclude', 'article,post', 'string');
$plxPlugin->setParam('minify', 'css,javascript', 'string');
}
$plxPlugin->saveParams();
header('Location: parametres_plugin.php?p=plxMinifyCache');
exit;
}
$exclude = $plxPlugin->getParam('exclude')=='' ? '' : $plxPlugin->getParam('exclude');
$minify = $plxPlugin->getParam('minify')=='' ? '' : $plxPlugin->getParam('minify');
?>
<h2><?php $plxPlugin->lang('L_TITLE') ?></h2>
<p><?php $plxPlugin->lang('L_DESCRIPTION') ?></p>
<form action="parametres_plugin.php?p=plxMinifyCache" method="post">
<?php $plxPlugin->lang('L_DELAY') ?> :
<?php plxUtils::printInput('delay', plxUtils::strCheck($plxPlugin->getParam('delay')), 'text','2-5'); ?>
<br />
<span class="field">
<label><?php $plxPlugin->lang('L_EXCLUDE') ?> :</label>
<?php
$nocache = explode(',', $exclude);
$selected = (is_array($nocache) AND in_array('article', $nocache)) ? ' checked="checked"' : '';
echo ' <input type="checkbox" id="article" name="exclude[]"'.$selected.' value="article" /><label for="article"> '.$plxPlugin->lang(L_ARTICLE).'</label>';
$selected = (is_array($nocache) AND in_array('search', $nocache)) ? ' checked="checked"' : '';
echo ' <input type="checkbox" id="search" name="exclude[]"'.$selected.' value="search" /><label for="search"> '.$plxPlugin->lang(L_SEARCH).'</label>';
echo ' <input type="checkbox" id="post" name="exclude[]" checked="checked" value="post" disabled="" /><label for="post"> '.$plxPlugin->lang(L_POST).'</label>';
?>
<br />
<label><?php $plxPlugin->lang('L_MINIFY') ?> :</label>
<?php
$minified = explode(',', $minify);
$selected = (is_array($minified) AND in_array('javascript', $minified)) ? ' checked="checked"' : '';
echo '<input type="checkbox" id="javascript" name="minify[]"'.$selected.' value="javascript" /><label for="javascript"> JavaScript</label>';
$selected = (is_array($minified) AND in_array('css', $minified)) ? ' checked="checked"' : '';
echo ' <input type="checkbox" id="css" name="minify[]"'.$selected.' value="css" /><label for="css"> CSS</label>';
?>
</span>
<br />
<strong><?php $plxPlugin->lang('L_DEFAULT') ?></strong>
<br />
<?php echo plxToken::getTokenPostMethod() ?>
<input type="submit" name="submit" value="<?php $plxPlugin->lang('L_SAVE') ?>" />
</form>