Rev | Line | |
---|
[3609] | 1 | <?php |
---|
| 2 | |
---|
| 3 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
| 4 | if (!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 |
---|
[9737] | 14 | if (isset($_POST['submit'])) |
---|
[3609] | 15 | { |
---|
| 16 | $datas = array( |
---|
| 17 | 'nb_images' => intval($_POST['nb_images']), |
---|
| 18 | 'cat_display' => $_POST['cat_display'], |
---|
[6415] | 19 | 'cat_selection' => @$_POST['cat_selection'], |
---|
[3609] | 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'], |
---|
[9383] | 31 | 'category_selected' => $datas['cat_selection'], |
---|
[9410] | 32 | ) |
---|
| 33 | ); |
---|
[3609] | 34 | |
---|
[9410] | 35 | $display_options = & $template->get_template_vars('display_options'); |
---|
| 36 | $display_options['on_picture'] = false; |
---|
| 37 | |
---|
[3609] | 38 | $template->set_filenames(array('module_options' => dirname(__FILE__) . '/config.tpl')); |
---|
| 39 | $template->assign_var_from_handle('MODULE_OPTIONS', 'module_options'); |
---|
| 40 | |
---|
[3300] | 41 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.