Changeset 100


Ignore:
Timestamp:
03/24/2009 07:54:48 PM (3 years ago)
Author:
ofer
Message:

Fixed problematic HTML which prevented our option screen from showing correctly on IE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/WordPress/plugin/transposh/transposh_admin.php

    r69 r100  
    2020 * Provide the admin page for configuring the translation options. eg.  what languages ? 
    2121 * who is allowed to translate ? 
    22  * 
    2322 */ 
    2423 
     
    2625require_once("constants.php"); 
    2726 
    28  
    2927/* 
    3028 * Add transposh to the admin menu. 
    31  * 
    3229 */ 
    3330function transposh_admin_menu() 
     
    3633} 
    3734 
    38  
    3935/* 
    4036 * Create the admin page. 
    41  * 
    4237 */ 
    4338function transposh_admin_page() 
     
    7368/* 
    7469 * Insert supported languages section in admin page 
    75  * 
    7670 */ 
    7771function insert_supported_langs() 
     
    7973        global $languages, $plugin_url; 
    8074 
    81         echo ' 
    82     <script type="text/javascript" > 
    83         function chbx_change(lang) 
    84         { 
    85             var view = lang + "_view"; 
    86             if(document.getElementById(view).checked) 
    87             { 
    88                 var edit = lang + "_edit"; 
    89                 document.getElementById(edit).checked = true; 
    90             } 
    91  
    92         } 
    93     </script> 
    94  
    95     <table> 
    96     <tr>'; 
    97  
     75        echo '<script type="text/javascript">'. 
     76        'function chbx_change(lang)'. 
     77        '{'. 
     78            'var view = lang + "_view";'. 
     79            'if(document.getElementById(view).checked)'. 
     80            '{'. 
     81               'var edit = lang + "_edit";'. 
     82                'document.getElementById(edit).checked = true;'. 
     83            '}'. 
     84        '}'. 
     85    '</script>'; 
     86        echo '<table><tr>'; 
    9887 
    9988        $columns = 2; 
     
    10190        for($hdr=0; $hdr < $columns; $hdr++) 
    10291        { 
    103                 echo '<th>Language</th><th>Viewable</th><th>Translatable</th> 
    104               <th>Default</th><th style="padding-right: 80px"></th>'; 
     92                echo '<th>Language</th><th>Viewable</th><th>Translatable</th>'. 
     93             '<th>Default</th><th style="padding-right: 80px"></th>'; 
    10594        } 
    10695 
     
    112101                if($i % $columns == 0) 
    113102                { 
    114                         echo '</tr>'; 
     103                        echo '<tr>'; 
    115104                } 
    116105                echo "\n"; 
     
    118107                $i++; 
    119108 
    120                 echo "<td><img src=\"$plugin_url/flags/$flag.png\"/>&nbsp;$language</td>"; 
     109                echo "<td><img src=\"$plugin_url/flags/$flag.png\" alt=\"\"/>&nbsp;$language</td>"; 
    121110                echo '<td align="center">  <input type="checkbox" id="' . $code .'_view" name="' . 
    122                 $code . '_view" onChange="chbx_change(\'' . $code . '\')"' . is_viewable($code) . '/></td>'; 
     111                $code . '_view" onChange="chbx_change(\'' . $code . '\')" ' . is_viewable($code) . '/></td>'; 
    123112                echo "\n"; 
    124113                echo '<td align="center">  <input type="checkbox" id="' . $code . '_edit" name="' . 
    125114                $code . '_edit" ' . is_editable($code). '/></td>'; 
    126115                echo "\n"; 
    127                 echo "<td align=\"center\"><input type=\"radio\" name=\"default_lang\" value=\"$code\"" . 
    128                 is_default_lang($code). "/> </td>"; 
     116                echo "<td align=\"center\"><input type=\"radio\" name=\"default_lang\" value=\"$code\" " . 
     117                is_default_lang($code). "/></td>"; 
    129118 
    130119                if($i % $columns == 0) 
     
    134123                else 
    135124                { 
    136                         echo "<td><style padding-right: 60px></style></td>"; 
     125                        echo "<td style=\"padding-right: 60px\"></td>"; 
    137126                } 
    138127                echo "\n"; 
     
    153142        if(strstr($langs, $code)) 
    154143        { 
    155                 return "checked"; 
     144                return 'checked="checked"'; 
    156145        } 
    157146 
     
    168157        if(strstr($langs, $code)) 
    169158        { 
    170                 return "checked"; 
     159                return 'checked="checked"'; 
    171160        } 
    172161 
     
    191180        if($default ==  $code) 
    192181        { 
    193                 return "checked"; 
     182                return 'checked="checked"'; 
    194183        } 
    195184 
     
    199188/* 
    200189 * Insert permissiions section in the admin page 
    201  * 
    202190 */ 
    203191function insert_permissions() 
     
    209197        { 
    210198                echo '<input type="checkbox" value="1" name="' . $role_name . '" ' . can_translate($role_name) . 
    211              '" />' . $role_name . '&nbsp&nbsp&nbsp</input>'; 
     199             '/>' . $role_name . '&nbsp;&nbsp;&nbsp;'; 
    212200        } 
    213201 
    214202        //Add our own custom role 
    215         echo '<input type="checkbox" value="1" name="anonymous"'     . 
    216         can_translate('anonymous') . '" /> Anonymous</input>'; 
     203        echo '<input type="checkbox" value="1" name="anonymous" '. 
     204        can_translate('anonymous') . '/> Anonymous'; 
    217205} 
    218206 
     
    227215        if(get_option(ENABLE_PERMALINKS_REWRITE)) 
    228216        { 
    229                 $checked = 'checked'; 
    230         } 
    231  
    232         echo '<input type="checkbox" value="1" name="enable_permalinks"'. $checked . '"/>'. 
     217                $checked = 'checked="checked"'; 
     218        } 
     219 
     220        echo '<input type="checkbox" value="1" name="enable_permalinks" '. $checked . '/>'. 
    233221                 'Rewrite URLs to be search engine friendly, '. 
    234222                 'e.g.  (http://wordpress.org/<strong> en</strong>). '. 
    235          'Requires that permalinks will be enabled.'. 
    236          '</input>'; 
     223         'Requires that permalinks will be enabled.'; 
    237224} 
    238225 
     
    240227 * Insert the option to enable/disable automatic translation. 
    241228 * Enabled by default. 
    242  * 
    243229 */ 
    244230function insert_auto_translate_option() 
     
    247233        if(get_option(ENABLE_AUTO_TRANSLATE,1)) 
    248234        { 
    249                 $checked = 'checked'; 
    250         } 
    251  
    252         echo '<input type="checkbox" value="1" name="enable_autotranslate"'.$checked.'"/>'. 
    253              'Allow automatic translation of pages (currently using Google Translate).'. 
    254              '</input>'; 
     235                $checked = 'checked="checked"'; 
     236        } 
     237 
     238        echo '<input type="checkbox" value="1" name="enable_autotranslate" '.$checked.'/>'. 
     239             'Allow automatic translation of pages (currently using Google Translate)'; 
    255240} 
    256241 
     
    267252                if(isset($role) && $role->has_cap(TRANSLATOR)) 
    268253                { 
    269                         return 'checked'; 
     254                        return 'checked="checked"'; 
    270255                } 
    271256        } 
     
    275260                if($allow_anonymous == "1") 
    276261                { 
    277                         return 'checked'; 
     262                        return 'checked="checked"'; 
    278263                } 
    279264        } 
     
    284269/* 
    285270 * Handle newly posted admin options. 
    286  * 
    287271 */ 
    288272function update_admin_options() 
     
    351335        } 
    352336 
    353         echo '<div id="message"class="updated fade">'; 
    354         echo ('<p> Changes saved</p>'); 
     337        echo '<div id="message" class="updated fade">'; 
     338        echo '<p>Changes saved</p>'; 
    355339        echo '</div>'; 
    356340} 
Note: See TracChangeset for help on using the changeset viewer.