Changeset 14971 for extensions


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

[extensions] - PersoAbout - clean code

Location:
extensions/PersoAbout
Files:
5 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}
  • extensions/PersoAbout/admin/admin.tpl

    r8115 r14971  
    77         <fieldset id="mainConf">
    88                        <span class="property">
    9                                 <label for="ppaperso">{'ppa_perso'|@translate}</label>
     9                                <label for="ppaperso">{'ppa_perso'|@translate}</label><br><br>
    1010                        </span>
    1111                        <textarea rows="5" cols="50" class="description" name="perso_about" id="perso_about">{$gestA.PPABASE}</textarea>
  • extensions/PersoAbout/language/en_UK/plugin.lang.php

    r11241 r14971  
    44//Tab gest
    55$lang['ppa_tab_gest'] = 'Management';
    6 $lang['ppa_perso'] = 'Personal About';
     6$lang['ppa_perso'] = 'Paragraph personnel to about page';
    77
    88//Tab help
  • extensions/PersoAbout/language/fr_FR/plugin.lang.php

    r9425 r14971  
    44//Tab gest
    55$lang['ppa_tab_gest'] = 'Gestion';
    6 $lang['ppa_perso'] = 'A propos perso';
     6$lang['ppa_perso'] = 'Paragraphe personnel pour la page about';
    77
    88//Tab help
  • extensions/PersoAbout/main.inc.php

    r8116 r14971  
    3030function ppa()
    3131 {
    32         global $template;
     32        global $template, $conf;
    3333        $template->set_prefilter('about', 'ppaT');
    3434       
    35         $PAED = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'ExtendedDescription';"));
     35$PAED = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'ExtendedDescription';"));
    3636if($PAED['state'] == 'active') add_event_handler('AP_render_content', 'get_user_language_desc');
    3737
    38 $query = '
    39 select param,value
    40         FROM ' . CONFIG_TABLE . '
    41   WHERE param = "persoAbout"
    42         ;';
    43 $result = pwg_query($query);
    44 $row = mysql_fetch_array($result);
    45 $pat=trigger_event('AP_render_content', $row['value']);
     38$pat=trigger_event('AP_render_content', $conf['persoAbout']);
    4639                 if (!empty($pat))
    4740                        {
Note: See TracChangeset for help on using the changeset viewer.