Allow for hirarchical definition of language data between template and custom-template

The shop-system should allow language definitions in [B]both [/B]the “[B]basic[/B]” template [B]and [/B]the “[B]custom[/B]” template.

Currently, as far as i can see, it is using language definitions in both templates [B]exclusively[/B], i.e. if language definitions are found in the “custom” template, the “basic” templates’ language definitions are not used.

Solution:

Modify “[B]protected function _getLangFilesPathArray( $blAdmin, $iLang )[/B]” in “[B]oxLang[/B]” to

    protected function _getLangFilesPathArray( $blAdmin, $iLang )
    {
        $aLangFiles = false;
        if ( ( $sDir = dirname( $this->getConfig()->getLanguagePath( 'lang.php', $blAdmin, $iLang ) ) ) ) {
            //get all lang files
            //#M681: content of cust_lang.php should be prefered to lang.php
            $aLangFiles = glob( $sDir."/*_lang.php" );
            array_unshift( $aLangFiles, $sDir."/lang.php");
            //Avenger
            //Include language files from custom theme
            $oxConfig=oxconfig::getInstance();
            $sCustomTheme=$oxConfig->getConfigParam( 'sCustomTheme');
            if ($sCustomTheme)
            {
              $sTheme=$oxConfig->getConfigParam( 'sTheme');
              $sDir=str_replace($sTheme,$sCustomTheme,$sDir);
              $aCustomLangFiles = glob( $sDir."/*_lang.php");
              if (sizeof($aCustomLangFiles))
              {
                $aLangFiles=array_merge($aLangFiles,$aCustomLangFiles);
              }
            }
            //Avenger
        }
        return $aLangFiles;
    }

[B]Note[/B]: For this to work properly, there [B]must not[/B] be a “[B]lang.php[/B]” in the custom templates’ language directory!

This feature is important for template developers…

We are using in our shops our own “[B]basic[/B]” template, which is valid for [B]all [/B]shops we design (and which holds some 99.5% of all “[B]tpl[/B]”-files), and a “[B]custom[/B]” template for [B]each [/B]shop, in order to reflect the differences between the shops.

And to support different/additional language definitions for the individual shops, it is preferable to have [B]custom-template based[/B] language definitions, instead of putting them all into the basic-templates language definitions.

(We have devised this split templating structure in order to be able to do template updates for [B]many [/B]customers without the need to do this for every shop individually, which imo would not be manageable. The 4.2.0 update taught us this lesson…)

[QUOTE=avenger;20849]The shop-system should allow language definitions in [B]both [/B]the “[B]basic[/B]” template [B]and [/B]the “[B]custom[/B]” template.
[/QUOTE]

I second this request. Took me quite some time to find out that the cust_lang.php is not used if no lang.php exists in the custom theme :mad:

Bye
Carsten