Ignore:
Timestamp:
Nov 22, 2006, 5:41:25 AM (17 years ago)
Author:
rvelices
Message:

feature 440: send mail to admin when comment is entered

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/configuration.php

    r1571 r1617  
    4747  $page['section'] = $_GET['section'];
    4848}
     49
     50$general_checkboxes = array(
     51    'log',
     52    'history_admin',
     53    'history_guest',
     54    'login_history',
     55    'email_admin_on_new_user'
     56   );
     57
     58$comments_checkboxes = array(
     59    'comments_forall',
     60    'comments_validation',
     61    'email_admin_on_comment',
     62    'email_admin_on_comment_validation',
     63  );
     64
    4965//------------------------------ verification and registration of modifications
    5066if (isset($_POST['submit']) and !is_adviser())
     
    5975        array_push($page['errors'], $lang['conf_gallery_url_error']);
    6076      }
    61       $_POST['log'] = empty($_POST['log'])?'false':'true';
    62       $_POST['history_admin'] = empty($_POST['history_admin'])?'false':'true';
    63       $_POST['history_guest'] = empty($_POST['history_guest'])?'false':'true';
    64       $_POST['login_history'] = empty($_POST['login_history'])?'false':'true';
     77      foreach( $general_checkboxes as $checkbox)
     78      {
     79        $_POST[$checkbox] = empty($_POST[$checkbox])?'false':'true';
     80      }
    6581      break;
    6682    }
     
    7490      {
    7591        array_push($page['errors'], $lang['conf_nb_comment_page_error']);
     92      }
     93      foreach( $comments_checkboxes as $checkbox)
     94      {
     95        $_POST[$checkbox] = empty($_POST[$checkbox])?'false':'true';
    7696      }
    7797      break;
     
    161181    ));
    162182
     183$html_check='checked="checked"';
     184
    163185switch ($page['section'])
    164186{
    165187  case 'general' :
    166188  {
    167     $html_check='checked="checked"';
    168 
    169189    $lock_yes = ($conf['gallery_locked']=='true')?'checked="checked"':'';
    170190    $lock_no = ($conf['gallery_locked']=='false')?'checked="checked"':'';
    171     $history_users = ($conf['log']=='true')?$html_check:'';
    172     $history_admin = ($conf['history_admin']=='true')?$html_check:'';
    173     $history_guest = ($conf['history_guest']=='true')?$html_check:'';
    174     $login_history = ($conf['login_history']=='true')?$html_check:'';
    175191
    176192    $template->assign_block_vars(
    177193      'general',
    178194      array(
    179         'HISTORY_USERS'=>$history_users,
    180         'HISTORY_ADMIN'=>$history_admin,
    181         'HISTORY_GUEST'=>$history_guest,
    182         'LOGIN_HISTORY'=>$login_history,
    183195        'GALLERY_LOCKED_YES'=>$lock_yes,
    184196        'GALLERY_LOCKED_NO'=>$lock_no,
     
    190202        'CONF_GALLERY_URL' => $conf['gallery_url'],
    191203        ));
     204
     205    foreach( $general_checkboxes as $checkbox)
     206    {
     207      $template->merge_block_vars(
     208          'general',
     209          array(
     210            strtoupper($checkbox) => ($conf[$checkbox]=='true')?$html_check:''
     211            )
     212        );
     213    }
    192214    break;
    193215  }
    194216  case 'comments' :
    195217  {
    196     $all_yes = ($conf['comments_forall']=='true')?'checked="checked"':'';
    197     $all_no  = ($conf['comments_forall']=='false')?'checked="checked"':'';
    198     $validate_yes = ($conf['comments_validation']=='true')?'checked="checked"':'';
    199     $validate_no = ($conf['comments_validation']=='false')?'checked="checked"':'';
    200 
    201218    $template->assign_block_vars(
    202219      'comments',
    203220      array(
    204221        'NB_COMMENTS_PAGE'=>$conf['nb_comment_page'],
    205         'COMMENTS_ALL_YES'=>$all_yes,
    206         'COMMENTS_ALL_NO'=>$all_no,
    207         'VALIDATE_YES'=>$validate_yes,
    208         'VALIDATE_NO'=>$validate_no
    209222        ));
     223
     224    foreach( $comments_checkboxes as $checkbox)
     225    {
     226      $template->merge_block_vars(
     227          'comments',
     228          array(
     229            strtoupper($checkbox) => ($conf[$checkbox]=='true')?$html_check:''
     230            )
     231        );
     232    }
    210233    break;
    211234  }
Note: See TracChangeset for help on using the changeset viewer.