core:include and TMPL_IMPORT (multilang)
Status: Pre-Alpha
Brought to you by:
jeffmoore
Back from the beyond ;) Been messing around with a
changing DocuWiki into something more WACT shaped,
which leads into having to do something interesting
with the multilang filescheme.
Part of the localization of the UI involves being able
to embed snippets of HTML - something it little more
than the varfile format and core:import are really
suitable for.
Anyway - hacked the core:include tag (see attached
patch) to allow an import attibute in the include tag,
which corresponds to the TMPL_IMPORT constant for the
multilang filescheme.
If the general idea looks good, will do the tests and
commit.
Unified diff (3 lines context) for framework/template/tags/core/include.tag.php
Logged In: YES
user_id=31876
I don't think that the import tag is the right place for this. I think this
illustrates a limitation in the multilangl filescheme:
case TMPL_INCLUDE:
$filename = $fileroot . '/templates' . $file;
break;
case TMPL_IMPORT:
$filename = $fileroot . '/lang/' .
$GLOBALS['CurrentLanguage'] . $file;
break;
so imports are allowed to vary by language, but includes are not. Rather
than change the include operation to pretend to be a import operation, it
would probably be better to modify the multilang filescheme to allow
templates to vary by language.