Changeset 26265


Ignore:
Timestamp:
06/01/10 21:47:15 (7 years ago)
Author:
jval
Message:

Only manipulate the behavior of delete when current language is part of the workflow(s), refs #1626

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ragnaroek/midcom/midcom.core/midcom/services/multilang.php

    r26264 r26265  
    1717 * workflows modify object deletions to delete full objects instead of just
    1818 * translations. So basically the included languages are all master languages.
    19  * (Current language being part of the included languages is not checked here
    20  * because MidCOM does it already.)
    2119 *
    2220 * lang0:
     
    430428        if (!self::is_real()) return;
    431429
    432         self::set_lang_to_object_lang($object);
    433         self::set_default_lang_to_lang();
     430        $set = false;
     431
     432        if (   $GLOBALS['midcom_config']['multilang_lang0_langs']
     433            && in_array(self::get_lang(), $GLOBALS['midcom_config']['multilang_lang0_langs']))
     434        {
     435            $set = true;
     436        }
     437
     438        else if (   $GLOBALS['midcom_config']['multilang_auto_langs']
     439            && in_array(self::get_lang(), $GLOBALS['midcom_config']['multilang_auto_langs']))
     440        {
     441            $set = true;
     442        }
     443
     444        if ($set)
     445        {
     446            self::set_lang_to_object_lang($object);
     447            self::set_default_lang_to_lang();
     448        }
     449
     450        self::set_langs_back($set);
    434451    }
    435452
     
    469486    }
    470487
    471     function set_langs_back()
    472     {
    473         if (!self::is_real()) return;
    474 
    475         self::set_default_lang_back();
    476         self::set_lang_back();       
     488    function set_langs_back($new_set = null)
     489    {
     490        if (!self::is_real()) return;
     491
     492        static $set = false;
     493
     494        if (is_bool($new_set))
     495        {
     496            $set = $new_set;
     497        }
     498        else if ($set)
     499        {
     500            self::set_default_lang_back();
     501            self::set_lang_back();
     502        }
    477503    }
    478504
Note: See TracChangeset for help on using the changeset viewer.