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

[extensions] - PersoAbout - clean code

File:
1 edited

Legend:

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

    r9851 r14971  
    3434  case 'gest':
    3535
    36 //charge Perso About
    37 $query = '
    38 select param,value
    39         FROM ' . CONFIG_TABLE . '
    40   WHERE param = "persoAbout"
    41         ;';
    42 $result = pwg_query($query);
     36$template->assign(
     37    'gestA',
     38    array('PPABASE' => $conf['persoAbout'],));
    4339
    44 $row = mysql_fetch_array($result);
    45    
    46   $template->assign(
    47     'gestA',
    48     array(
    49       'PPABASE' => $row['value'],
    50       ));
    51 
    52 
    53 //insértion de meta dans la table
    5440if (isset($_POST['submitppa']) and !is_adviser())
    5541        {
    56         $query = '
    57 UPDATE ' . CONFIG_TABLE . '
    58   SET value= \''.$_POST['perso_about'].'\'
    59   WHERE param = "persoAbout"
    60     ;';
    61 $result = pwg_query($query);
     42 conf_update_param('persoAbout', $_POST['perso_about']);
    6243
    6344  $template->assign(
    6445    'gestA',
    65     array(
    66       'PPABASE' => stripslashes($_POST['perso_about']),
    67       ));
    68 
     46    array('PPABASE' => stripslashes($_POST['perso_about']),));
    6947        }
    70 
    71     break;
     48  break;
    7249
    7350// Tab help
     
    7552$template->assign(
    7653    'gestB',
    77         array(
    78           'meta'=>l10n('meta_name'),
    79           ));
    80         break;
     54        array('meta'=>l10n('null'),));
     55  break;
    8156       
    8257}
Note: See TracChangeset for help on using the changeset viewer.