Ignore:
Timestamp:
May 14, 2012, 6:42:14 PM (12 years ago)
Author:
ddtddt
Message:

[extensions] - PersoFooter - clean code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/PersoFooter/admin/admin.php

    r11216 r14972  
    3333{
    3434  case 'gest':
     35   
     36  $template->assign('gestA',
     37    array('PFTBASE' => $conf['persoFooter'],));
    3538
    36 //charge Perso About
    37 $query = '
    38 select param,value
    39         FROM ' . CONFIG_TABLE . '
    40   WHERE param = "persoFooter"
    41         ;';
    42 $result = pwg_query($query);
    43 
    44 $row = mysql_fetch_array($result);
    45    
    46   $template->assign(
    47     'gestA',
    48     array(
    49       'PFTBASE' => $row['value'],
    50       ));
    51 
    52 
    53 //insértion de meta dans la table
    5439if (isset($_POST['submitpft']))
    5540        {
    56         $query = '
    57 UPDATE ' . CONFIG_TABLE . '
    58   SET value= \''.$_POST['perso_footer'].'\'
    59   WHERE param = "persoFooter"
    60     ;';
    61 $result = pwg_query($query);
    62 
    63   $template->assign(
     41conf_update_param('persoFooter', $_POST['perso_footer']);
     42$template->assign(
    6443    'gestA',
    65     array(
    66       'PFTBASE' => stripslashes($_POST['perso_footer']),
    67       ));
    68 
     44    array('PFTBASE' => stripslashes($_POST['perso_footer']),));
    6945        }
    70 
    71     break;
    72 
    73 // Tab help
     46  break;
    7447  case 'help':
    7548$template->assign(
    7649    'gestB',
    77         array(
    78           'meta'=>l10n('meta_name'),
    79           ));
    80         break;
    81        
     50        array('meta'=>l10n('nul'),));
     51  break;
    8252}
    8353
Note: See TracChangeset for help on using the changeset viewer.