Ignore:
Timestamp:
Dec 14, 2010, 2:47:24 PM (13 years ago)
Author:
patdenice
Message:

feature 2060: Remove adviser mode.
First commit: only php files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/check_integrity.class.php

    r5287 r8126  
    7878
    7979    // Treatments
    80     if (!is_adviser())
    81     {
    82       if (isset($_POST['c13y_submit_correction']) and isset($_POST['c13y_selection']))
    83       {
    84         $corrected_count = 0;
    85         $not_corrected_count = 0;
     80    if (isset($_POST['c13y_submit_correction']) and isset($_POST['c13y_selection']))
     81    {
     82      $corrected_count = 0;
     83      $not_corrected_count = 0;
     84
     85      foreach ($this->retrieve_list as $i => $c13y)
     86      {
     87        if (!empty($c13y['correction_fct']) and
     88            $c13y['is_callable'] and
     89            in_array($c13y['id'], $_POST['c13y_selection']))
     90        {
     91          if (is_array($c13y['correction_fct_args']))
     92          {
     93            $args = $c13y['correction_fct_args'];
     94          }
     95          else
     96          if (!is_null($c13y['correction_fct_args']))
     97          {
     98            $args = array($c13y['correction_fct_args']);
     99          }
     100          else
     101          {
     102            $args = array();
     103          }
     104          $this->retrieve_list[$i]['corrected'] = call_user_func_array($c13y['correction_fct'], $args);
     105
     106          if ($this->retrieve_list[$i]['corrected'])
     107          {
     108            $corrected_count += 1;
     109          }
     110          else
     111          {
     112            $not_corrected_count += 1;
     113          }
     114        }
     115      }
     116
     117      if ($corrected_count > 0)
     118      {
     119        $page['infos'][] =
     120          l10n_dec('%d anomaly has been corrected.', '%d anomalies have been detected corrected.',
     121            $corrected_count);
     122      }
     123      if ($not_corrected_count > 0)
     124      {
     125        $page['errors'][] =
     126          l10n_dec('%d anomaly has not been corrected.', '%d anomalies have not been corrected.',
     127            $not_corrected_count);
     128      }
     129    }
     130    else
     131    {
     132      if (isset($_POST['c13y_submit_ignore']) and isset($_POST['c13y_selection']))
     133      {
     134        $ignored_count = 0;
    86135
    87136        foreach ($this->retrieve_list as $i => $c13y)
    88137        {
    89           if (!empty($c13y['correction_fct']) and
    90               $c13y['is_callable'] and
    91               in_array($c13y['id'], $_POST['c13y_selection']))
    92           {
    93             if (is_array($c13y['correction_fct_args']))
    94             {
    95               $args = $c13y['correction_fct_args'];
    96             }
    97             else
    98             if (!is_null($c13y['correction_fct_args']))
    99             {
    100               $args = array($c13y['correction_fct_args']);
    101             }
    102             else
    103             {
    104               $args = array();
    105             }
    106             $this->retrieve_list[$i]['corrected'] = call_user_func_array($c13y['correction_fct'], $args);
    107 
    108             if ($this->retrieve_list[$i]['corrected'])
    109             {
    110               $corrected_count += 1;
    111             }
    112             else
    113             {
    114               $not_corrected_count += 1;
    115             }
    116           }
    117         }
    118 
    119         if ($corrected_count > 0)
     138          if (in_array($c13y['id'], $_POST['c13y_selection']))
     139          {
     140            $this->build_ignore_list[] = $c13y['id'];
     141            $this->retrieve_list[$i]['ignored'] = true;
     142            $ignored_count += 1;
     143          }
     144        }
     145
     146        if ($ignored_count > 0)
    120147        {
    121148          $page['infos'][] =
    122             l10n_dec('%d anomaly has been corrected.', '%d anomalies have been detected corrected.',
    123               $corrected_count);
    124         }
    125         if ($not_corrected_count > 0)
    126         {
    127           $page['errors'][] =
    128             l10n_dec('%d anomaly has not been corrected.', '%d anomalies have not been corrected.',
    129               $not_corrected_count);
    130         }
    131       }
    132       else
    133       {
    134         if (isset($_POST['c13y_submit_ignore']) and isset($_POST['c13y_selection']))
    135         {
    136           $ignored_count = 0;
    137 
    138           foreach ($this->retrieve_list as $i => $c13y)
    139           {
    140             if (in_array($c13y['id'], $_POST['c13y_selection']))
    141             {
    142               $this->build_ignore_list[] = $c13y['id'];
    143               $this->retrieve_list[$i]['ignored'] = true;
    144               $ignored_count += 1;
    145             }
    146           }
    147 
    148           if ($ignored_count > 0)
    149           {
    150             $page['infos'][] =
    151               l10n_dec('%d anomaly has been ignored.', '%d anomalies have been ignored.',
    152                 $ignored_count);
    153           }
     149            l10n_dec('%d anomaly has been ignored.', '%d anomalies have been ignored.',
     150              $ignored_count);
    154151        }
    155152      }
Note: See TracChangeset for help on using the changeset viewer.