source: extensions/PWG_Stuffs/modules/Recent/config.inc.php @ 9383

Revision 9383, 1012 bytes checked in by patdenice, 9 years ago (diff)

Add display option. Optimizations.

Line 
1<?php
2
3if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
4if (!isset($datas))
5{
6  $datas = array(
7    'nb_images'     => 10,
8    'cat_display'   => 'all',
9    'cat_selection' => array(),
10  );
11}
12
13// Enregistrement de la configuration
14if (isset($_POST['submit']) and !is_adviser())
15{
16  $datas = array(
17    'nb_images' => intval($_POST['nb_images']),
18    'cat_display' => $_POST['cat_display'],
19    'cat_selection' => @$_POST['cat_selection'],
20    );
21  unset($_POST['on_picture']);
22}
23
24// Parametrage du template
25$query = 'SELECT id,name,uppercats,global_rank FROM '.CATEGORIES_TABLE.';';
26display_select_cat_wrapper($query,array(),'category_selection');
27
28$template->assign(array(
29  'NB_IMAGES' => $datas['nb_images'],
30  'cat_display' => $datas['cat_display'],
31  'category_selected' => $datas['cat_selection'],
32  'on_picture_option' => false,
33));
34
35$template->set_filenames(array('module_options' => dirname(__FILE__) . '/config.tpl'));
36$template->assign_var_from_handle('MODULE_OPTIONS', 'module_options');
37
38?>
Note: See TracBrowser for help on using the repository browser.