Changeset 2552

Show
Ignore:
Timestamp:
04/27/11 20:11:20 (13 months ago)
Author:
paparazzia
Message:

fix #387 : basics finished
- default value handling when required (lang_ihm)
- theme enhancements (background color for mselect, centering)
- complet admin interface (permissions handling)
see #154 also

Location:
trunk
Files:
1 added
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/lib/phpcommon/playersPrefs.class.php

    r2548 r2552  
    5959    function getPrefValue($key) { 
    6060        $value = $this->playerclass->getPref($key); 
    61         if (is_null($value)) return null; 
     61        if (is_null($value)) { 
     62            switch($key) { 
     63                case 'lang_ihm' : 
     64                    return getCurrentLang(); 
     65                default : 
     66                    return null; 
     67            } 
     68        } 
    6269        return $value['pref_value']; 
    6370    } 
     
    108115 
    109116    function baseDropDown($key, $list) { 
    110         $value = $this->playerclass->getPref($key); 
     117        $value = $this->getPrefValue($key); 
    111118        $str = "<select name=\"pref_$key\" class=\"selectpref\" id=\"".$this->getId($key)."\">"; 
    112119        foreach ($list as $k =>$v) { 
    113120            $str .= "<option value=\"$k\""; 
    114             if ($k == $value['pref_value']) $str .= " selected"; 
     121            if ($k == $value) $str .= " selected"; 
    115122            $str .= ">$v</option>"; 
    116123        } 
     
    120127 
    121128    function baseDropDownMultiple($key, $list) { 
    122         $value = $this->playerclass->getPref($key); 
    123         $values = explode(',', $value['pref_value']); 
     129        $value = $this->getPrefValue($key); 
     130        $values = explode(',', $value); 
    124131        $str = "<select title=\"".getLocalizedString("pref_helper_$key")."\" name=\"pref_$key"."[]\" multiple class=\"selectpref\" id=\"".$this->getId($key)."\">"; 
    125132        foreach ($list as $k =>$v) { 
     
    137144        $str = "<select size=\"2\" name=\"perm_$key"."[]\" multiple class=\"selectperm\" id=\"perm-".$this->getId($key)."\">"; 
    138145        foreach ($plist as $k =>$v) { 
    139             $str .= "<option value=\"$k\""; 
     146            $str .= "<option class=\"selectperm\" value=\"$k\""; 
    140147            if ($value['permissions'] & $k) $str .= " selected"; 
    141148            $str .= ">$v</option>"; 
  • trunk/site/admin/players_prefs.php

    r2539 r2552  
    55 
    66include('adminheader.php'); 
    7  
     7require('playersPrefs.class.php'); 
    88/* RACE TABLE */ 
    99 
     
    6161); 
    6262 
     63$opts['fdd']['permissions'] = array( 
     64  'name'     => 'Permissions', 
     65  'help'     => nl2br("Permissions"), 
     66  'select|FLDV'   => 'M', 
     67  'select|ACP'   => 'C', 
     68  'values2' => Array( 
     69      VLM_ACL_BOATSIT => "Boatsitter", 
     70      VLM_ACL_AUTH => "VLM Players", 
     71      ), 
     72  'sql' => 'MAKE_SET(`PMEtable0`.`permissions`, 1, 2)', 
     73//  'maxlen'   => 11, 
     74//  'default'  => '0', 
     75  'sort'     => true 
     76); 
     77 
     78 
    6379$opts['fdd']['updated'] = array( 
    6480  'name'     => 'Last change', 
     
    6884); 
    6985 
     86$opts['triggers']['update']['before'][0] = 'players_prefs.TBU.trigger.php'; 
     87 
     88//force basic pme class. 
     89require_once('../externals/phpMyEdit/phpMyEdit.class.php'); 
     90$pmeinstance = new phpMyEdit($opts); 
     91 
    7092include('adminfooter.php'); 
    7193 
  • trunk/site/includes/strings.inc

    r2547 r2552  
    1717 
    1818    "This is not your boat, only boat owner may abandon !" => "This is not your boat, only boat owner may abandon !", 
    19     "Please connect to create your first boat" => "Please connect to create your first boat", 
    20      
     19    "Please connect to create your first boat" => "Please connect to create your first boat",     
    2120    "You seem to try to use an old account with boat" => "You seem to try to use an old account with boat", 
    2221    "You should do following steps" => "You should do following steps", 
     
    454453  'fr' =>  
    455454  array ( 
     455    'Visible for' => 'Visible pour', 
    456456    'pref_helper_contact_taverne' => 'Copiez l\'url de votre profil ou entrez votre identifiant numérique', 
    457457    'pref_helper_contact_revatua' => 'Copiez l\'url de votre profil ou entrez votre identifiant numérique', 
     
    481481    'prefsgroup_lang' => 'Préférences de langue', 
    482482    'pref_lang_ihm' => 'Langue de l\'interface', 
    483     'pref_lang_communication' => 'Langue(s) que vous parlez suffisament pour communiquer', 
     483    'pref_lang_communication' => 'Langue(s) connue(s)', 
    484484    'prefsgroup_contact' => 'Infos pour vous contacter', 
    485485    'pref_contact_email' => 'Courriel', 
  • trunk/site/manage_profil.php

    r2546 r2552  
    3434    echo "<div>"; 
    3535    echo "<form name=\"prefs\" method=\"post\">"; 
    36     echo "<table>"; 
     36    echo "<table class=\"prefsetter\">"; 
    3737 
    3838    echoSaveCancel(); 
     
    4848        foreach ($pg as $pkey) { 
    4949            echo "<tr class=\"prefsetter\">"; 
    50             echo "<td>".getLocalizedString("pref_$pkey")."</td>"; 
    51             echo "<td>".$pp->getform($pkey)."</td>"; 
    52             echo "<td>".$pp->permissions($pkey)."</td>"; 
     50            echo "<td class=\"prefsetter\">".getLocalizedString("pref_$pkey")."</td>"; 
     51            echo "<td class=\"prefsetter\">".$pp->getform($pkey)."</td>"; 
     52            echo "<td class=\"prefsetter\">".$pp->permissions($pkey)."</td>"; 
    5353            echo "</tr>"; 
    5454        } 
  • trunk/site/style/base-style.css

    r2547 r2552  
    483483} 
    484484 
    485  
    486485.racesummary-type1 { 
    487486  font-style: italic; 
     
    492491          background-color: #eeeeee; 
    493492} 
     493 
     494td.prefsetter { 
     495  vertical-align: top; 
     496} 
     497 
     498select.selectperm { 
     499        background-color: #eeeeee; 
     500        overflow: auto; 
     501        empty-cells: hide;       
     502} 
     503 
     504option { 
     505        background-color: #eeeeee; 
     506}