Changeset 59


Ignore:
Timestamp:
03/03/2009 10:23:57 PM (3 years ago)
Author:
amir
Message:

Minor fixes:
Don't load js library when not in edit mode.
Enable translating the widget's checkbox (i.e. edit translation)
Use allign instead of ltr/rtl in widget.

Location:
trunk/WordPress/plugin/transposh
Files:
2 edited

Legend:

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

    r58 r59  
    278278function insert_javascript_includes() 
    279279{ 
    280     global $plugin_url; 
     280    global $plugin_url, $is_edit_mode, $wp_query; 
     281 
     282    if (!($wp_query->query_vars[EDIT_PARAM] == "1" || 
     283         $wp_query->query_vars[EDIT_PARAM] == "true")) 
     284    { 
     285        //check permission later - for now just make sure we don't load the 
     286        //js code when it is not needed 
     287        return; 
     288    } 
     289     
    281290 
    282291    $overlib_dir = "$plugin_url/js/overlibmws"; 
  • trunk/WordPress/plugin/transposh/transposh_widget.php

    r46 r59  
    102102     
    103103        echo $before_widget . $before_title . __(no_translate("Transposh")) . $after_title; 
    104         echo "<span class=\"" . NO_TRANSLATE_CLASS . "\" >"; 
    105      
     104             
    106105        switch ($options['style']) { 
    107106                case 1: // flags 
    108107            //keep the flags in the same direction regardless of the overall page direction 
    109             echo "<div dir=rtl>";  
    110              
     108            echo "<div style=\"text-align: left;\" class=\"" . NO_TRANSLATE_CLASS . "\" >";  
     109 
    111110            global $plugin_url; 
    112111            $using_permalinks = $wp_rewrite->using_permalinks(); 
     
    131130                                } 
    132131                        } 
    133  
    134132            echo "</div>"; 
    135133             
     
    141139 
    142140            echo "<form action=\"$page_url\" method=\"post\">"; 
     141            echo "<span class=\"" . NO_TRANSLATE_CLASS . "\" >"; 
    143142                        echo "<select name=\"lang\"     id=\"lang\" onchange=\"Javascript:this.form.submit();\">"; 
    144143                        echo "<option value=\"none\">[Language]</option>"; 
     
    153152                                { 
    154153                                        $is_selected = ($lang == $code ? "selected=\"selected\"" : "" ); 
    155                                         echo "<option value=\"$code\" $is_selected>" . no_translate($language) . "</option>"; 
     154                                        echo "<option value=\"$code\" $is_selected>" . $language . "</option>"; 
    156155                    $is_showing_languages = TRUE; 
    157156                                } 
    158157                        } 
    159158                        echo "</select><br/>"; 
     159            echo "</span>"; // the no_translate for the language list 
    160160        } 
    161161 
     
    169169            echo "<input type=\"checkbox\" name=\"" . EDIT_PARAM . "\" value=\"1\"" . 
    170170                ($is_edit ? "checked=\"1\"" : "0") . 
    171                 "\" onClick=\"this.form.submit();\"/>Edit Translation<br/>"; 
     171                "\" onClick=\"this.form.submit();\"/>&nbsp;Edit Translation"; 
    172172        } 
    173173         
     
    181181 
    182182    echo "</form>"; 
    183     echo "</span>"; // the no_translate for the widget 
    184183 
    185184    echo $after_widget; 
Note: See TracChangeset for help on using the changeset viewer.