Example #1
0
 function mod_captcha()
 {
     global $PMS;
     $PMS->hookModuleMethod('ModulePage', 'mod_captcha');
     // Register ModulePage
     $this->SELF = $PMS->getModulePageURL('mod_captcha');
     // Self Location
     $this->CAPTCHA_WIDTH = 150;
     // 圖片寬
     $this->CAPTCHA_HEIGHT = 25;
     // 圖片高
     $this->CAPTCHA_LENGTH = 6;
     // 明碼字數
     $this->CAPTCHA_GAP = 20;
     // 明碼字元間隔
     $this->CAPTCHA_TEXTY = 20;
     // 字元直向位置
     $this->CAPTCHA_FONTMETHOD = 0;
     // 字體使用種類 (0: GDF (*.gdf) 1: TrueType Font (*.ttf))
     $this->CAPTCHA_FONTFACE = array('./module/font1.gdf');
     // 使用之字型 (可隨機挑選,惟字型種類需要相同不可混用)
     $this->CAPTCHA_ECOUNT = 2;
     // 圖片混淆用橢圓個數
     AttachLanguage(array($this, '_loadLanguage'));
     // 載入語言檔
 }
Example #2
0
 function mod_tag()
 {
     global $PMS;
     $PMS->hookModuleMethod('ModulePage', __CLASS__);
     // 向系統登記模組專屬獨立頁面
     $this->mypage = $PMS->getModulePageURL(__CLASS__);
     AttachLanguage(array($this, '_loadLanguage'));
     // 載入語言檔
 }
Example #3
0
 function mod_siokara()
 {
     global $PMS;
     AttachLanguage(array($this, '_loadLanguage'));
     // 載入語言檔
     $PMS->hookModuleMethod('ModulePage', 'mod_siokara');
     // 向系統登記模組專屬獨立頁面
     $this->mypage = $PMS->getModulePageURL('mod_siokara');
 }
Example #4
0
 public function testAttachLanguageOldway()
 {
     AttachLanguage(function () {
         global $language;
         $language['testIndex'] = 'testValue';
     });
     $expect = 'testValue';
     $result = _T('testIndex');
     $this->assertEquals($expect, $result);
 }