[TYPO3] TSConfig restrict languages by pagetree
Xavier Perseguers
typo3 at perseguers.ch
Wed Aug 13 13:21:44 CEST 2008
Hi Grégory,
> Is there a mean (by TSConfig or anything else) to restrict editiing of a
> specific language under a given page tree? and this only for a specific
> user (gasp) since the site administrator should be able to edit content
> in any language.
> By the way, contents stored in this shared page tree are not standard
> CTypes but table entries, so i might be able to digg into the TCA for
> that, is it possible to make conditions in the TCA?
I did something like that for a website where I wanted the default
language to be sometimes English, German or French and then being able
to translate it into the other languages. And for this I had to create
the English language as another possible language overlay. Default
language being said to be French, English or German with pageTS:
mod.SHARED {
defaultLanguageFlag = fr.gif
defaultLanguageLabel = French
}
I then had to "remove" one of the available translation languages that
was shown with TemplaVoila (or the default page form too but I use TV
and as such did the stuff for it). The idea was to remove French as
translation in this case when default language was already in French,
leaving only German and English as overlay languages. For this I created
a new option to mod.SHARED:
mod.SHARED {
disableLanguages = 2
}
where 2 stands for the UID of sys_language French in my website and then
XCLASSed TV to use this new option:
class ux_tx_templavoila_module1 extends tx_templavoila_module1 {
function getAvailableLanguages($id=0, $onlyIsoCoded=true,
$setDefault=true, $setMulti=false) {
$languages = parent::getAvailableLanguages($id, $onlyIsoCoded,
$setDefault, $setMulti);
$disableLanguages = t3lib_div::trimExplode(',',
$this->modSharedTSconfig['properties']['disableLanguages'], 1);
foreach ($disableLanguages as $pid) {
unset($languages[$pid]);
}
return $languages;
}
}
I hope you'll get an idea for your problem.
--
Xavier Perseguers
http://xavier.perseguers.ch/en/tutorials/typo3.html
More information about the TYPO3-english
mailing list