source: extensions/PWG_Stuffs/modules/LastComs/config.inc.php @ 3609

Last change on this file since 3609 was 3609, checked in by patdenice, 15 years ago

Convert all php and tpl files in Unix format for my plugins.

File size: 1.1 KB
Line 
1<?php
2
3if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
4if (!isset($datas)) $datas = array(5, 'on', 'default', '', '');
5
6// Enregistrement de la configuration
7if (isset($_POST['submit']) and !is_adviser())
8{
9  if (empty($_POST['nb_comments']))
10  {
11    array_push($page['errors'], l10n('lastcoms_no_nb_comments'));
12  }
13  else
14  {
15    if (!isset($_POST['show_admin_buttons']))
16    {
17      $_POST['show_admin_buttons'] = 'off';
18    }
19    $datas = array(
20      $_POST['nb_comments'],
21      $_POST['show_admin_buttons'],
22      $_POST['nb_cadres'],
23      $_POST['width'],
24      $_POST['height']
25      );
26  }
27}
28
29// Parametrage du template
30$template->assign('nb_cadres', array(
31  'OPTIONS' => array('default' => 'default', 1 => 1, 2 => 2, 3 => 3),
32  'SELECTED' => $datas[2]));
33
34$template->assign(array(
35  'NB_COMMENTS' => $datas[0],
36  'WIDTH'       => $datas[3],
37  'HEIGHT'      => $datas[4]
38));
39if ($datas[1] == 'on')
40{
41  $template->assign(array('SHOW_ADMIN_BUTTONS' => 'checked="checked"'));
42}
43
44$template->set_filenames(array('module_options' => dirname(__FILE__) . '/config.tpl'));
45$template->assign_var_from_handle('MODULE_OPTIONS', 'module_options');
46
47?>
Note: See TracBrowser for help on using the repository browser.