Line | |
---|
1 | <?php |
---|
2 | |
---|
3 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
4 | if (!isset($datas)) |
---|
5 | { |
---|
6 | $datas = array( |
---|
7 | 'nb_images' => 5, |
---|
8 | 'cat_display' => 'all', |
---|
9 | 'cat_selection' => array(), |
---|
10 | ); |
---|
11 | } |
---|
12 | |
---|
13 | // Enregistrement de la configuration |
---|
14 | if (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.';'; |
---|
26 | display_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 | )); |
---|
33 | |
---|
34 | $template->set_filenames(array('module_options' => dirname(__FILE__) . '/config.tpl')); |
---|
35 | $template->assign_var_from_handle('MODULE_OPTIONS', 'module_options'); |
---|
36 | |
---|
37 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.