source: extensions/ConcoursPhoto/admin/params.php @ 19407

Last change on this file since 19407 was 8946, checked in by tiico, 14 years ago

Prepare v2.0.0 for Concours photo plugin :

  • Add exaequo checking for the result (beta)
  • Add EN language
  • Correct "concours not displayed" when no group is selected in admin page. Now, concours is available for all registered user (not depending on the group appartenance)
  • Add option to allow author to vote for their photos (disable check based on username=authorname)
  • Add option to allow user to change the score after a validation
  • Add to guest the possibility to vote for a concours (BETA)
  • Some correction (code and database structure)
File size: 2.2 KB
Line 
1<?php
2
3if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
4include_once(CONCOURS_PATH . 'admin/functions.inc.php');
5
6global $template;
7
8// General parameters for the concours
9$concours = new Concours();
10
11if (isset($_POST['submit'])) { 
12  $concours->my_config['active_menubar'] = isset($_POST['active_menubar']);
13  $concours->my_config['nbconcours_menubar'] = $_POST['nbconcours_menubar'];
14
15  $concours->my_config['mask_author'] = isset($_POST['mask_author']);
16  $concours->my_config['thumb_note'] = isset($_POST['thumb_note']);
17
18  $concours->my_config['check_exaequo'] = isset($_POST['check_exaequo']);
19
20  $concours->my_config['author_vote_available'] = isset($_POST['author_vote_available']);
21  $concours->my_config['concours_change_score'] = isset($_POST['concours_change_score']);
22
23  $concours->save_config();
24  array_push($page['infos'], l10n('concours_saveOK'));
25}
26
27for($jj=0; $jj < 10; $jj++)
28{
29        $template->append('NBCONCOURS',array('ID' => $jj,'NAME' => $jj,'SELECTED' => ($concours->my_config['nbconcours_menubar'] == $jj ? 'selected' : '')));
30        $i++;   
31}
32
33$template->assign(array(
34        'SHOW_MENUBAR'                  => ($concours->my_config['active_menubar'] ? 'checked="checked"' : ''),
35    'MASK_AUTHOR'                       => ($concours->my_config['mask_author'] ? 'checked="checked"' : ''),
36    'THUMB_NOTE'                        => ($concours->my_config['thumb_note'] ? 'checked="checked"' : ''),
37    'CHECK_EXAEQUO'         => ($concours->my_config['check_exaequo'] ? 'checked="checked"' : ''),
38    'AUTHOR_VOTE_AVAILABLE' => ($concours->my_config['author_vote_available'] ? 'checked="checked"' : ''),
39    'CHANGE_SCORE'          => ($concours->my_config['concours_change_score'] ? 'checked="checked"' : ''),
40
41        ));
42
43$result = array();
44$result = get_csvfile_result();         
45$o=0;
46foreach($result as $file)
47{
48        $template->append('FILE',array('NAME' => $file['name'],
49                                                                   'LINK' => $file['link'],
50                                                                   'CONC_ID' => $file['conc_id'],
51                                                                   'CONC_NAME' => $file['conc_name'],
52                                                                   'CONC_DESCR' => $file['conc_descr']
53                                        ));
54}
55
56$template->set_filename('plugin_admin_content', dirname(__FILE__) . '/template/params.tpl');
57$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
58
59?>
Note: See TracBrowser for help on using the repository browser.