Changeset 7929 in spip-zone


Ignore:
Timestamp:
Dec 14, 2006, 6:27:59 PM (12 years ago)
Author:
renato@…
Message:

multilang text for sections when multilanguage is active but not at section level;
do not process init a multilang form after an ajax request when no target is set

Location:
_plugins_/_dev_/_ze_laboratoire_/multilang_mot_cles
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • _plugins_/_dev_/_ze_laboratoire_/multilang_mot_cles/multilang_mot_cles.php

    r7858 r7929  
    1010
    1111function multilang_mot_cles_header_prive($flux) {
    12         if($GLOBALS['meta']['multi_rubriques']=="oui" || $GLOBALS['meta']['multi_articles']=="oui") {
     12        $multi_lang = $GLOBALS['meta']['multi_rubriques']=="oui" || $GLOBALS['meta']['multi_articles']=="oui";
     13        if($multi_lang) {
    1314                $active_langs = "'".str_replace(",","','",$GLOBALS['meta']['langues_multilingue'])."'";
    1415                $flux .= "<script type='text/javascript' src='".find_in_path("multilang_mots.js")."'></script>\n".
     
    2021                "multilang_init_lang({'page':'exec=articles_edit','root':'#page','forms':'#liste_images form,#liste_documents form','fields':'input,textarea'});\n".
    2122                "multilang_init_lang({'page':'exec=articles','root':'#portfolio,#documents','fields':'input,textarea'});\n".
    22                 "onAjaxLoad(function(){forms_init_multi({'target':this})});\n".
    23                 "});\n".
     23                "onAjaxLoad(function(){forms_init_multi({'target':this})});\n";
     24        }
     25       
     26        if($GLOBALS['meta']['multi_rubriques']!="oui") {
     27                $flux .= "multilang_init_lang({'page':'exec=rubriques_edit','root':'div.cadre-formulaire','fields':'input[@name=\'titre\'],textarea'});\n";
     28        }
     29       
     30        if($multi_lang) {
     31                $flux .= "});\n".
    2432                "</script>\n";
    25         }
     33        }       
     34       
    2635        return $flux;
    2736}
  • _plugins_/_dev_/_ze_laboratoire_/multilang_mot_cles/multilang_mots.js

    r7858 r7929  
    8080        if(target) {
    8181                //Verify the target is really a form to be internationalized (in case of an ajax request fired by onAjaxLoad)
     82                if(target==document) return;
    8283                init_forms = $(target).find('form');
    8384                if(!init_forms.length || !in_set(init_forms,$(multilang_forms_selector,multilang_root))) return;
Note: See TracChangeset for help on using the changeset viewer.