CooCooWakka : LanguageAction

首页 :: 索引 :: 修订历史 :: 最新评论 :: CooCooWakkaGroup :: 登陆/注册 :: 你好, 38.103.63.62
你的足迹: » LanguageAction
====LanguageAction==== 这是一个给用户选择界面语言的插件。暂时不与CooCooWakka一同发布。 (只有CooCooWakka的charset设置为utf-8时,才能工作。) 需要PEAR_HTML_QUICKFORM或者CooCooWakka 0.0.8以上。 使用方法: 新建文件actions/language.php: %%(php) <? require_once "HTML/QuickForm.php"; if(strtolower($this->getconfigvalue("charset"))=="utf-8"){ $langs["schinese-utf"]="schinese"; $langs["tchinese-utf"]="tchinese"; $langs["english"]="english"; } $form = new HTML_QuickForm('langForm','',$this->Href()); $form->addElement("select","sellang","Choose Language:",$langs,array("onChange"=>"langForm.submit()")); if($form->validate()){ $lang=$form->getElementValue("sellang"); $this->SetPersistentCookie("language",$lang[0]); $this->redirect($this->Href()); } $form->display(); ?> %% 然后在适当的CooCooWakka页面中加入: ""{{language}}"" 就可以使用了。 test

SourceForge.net Logo Creative Commons License
请享受共创成果的同时,尊重他人劳动。本站点内容如未特别声明,全部遵循 Creative Commons License by-nc-sa协议发布。