<?php
$blocksArr = '';

$blocksArr['my_menu']['name']     = _MD_TCW_SYSTEM_BLOCK_MY_MENU;
$blocksArr['my_menu']['tpl']      = 'my_menu.html';
$blocksArr['my_menu']['position'] = 'side';

// $login_method   = '';
$modhandler     = &xoops_gethandler('module');
$config_handler = &xoops_gethandler('config');

$TadLoginXoopsModule = &$modhandler->getByDirname("tad_login");
if ($TadLoginXoopsModule) {
    global $xoopsConfig;
    include_once XOOPS_ROOT_PATH . "/modules/tad_login/language/{$xoopsConfig['language']}/county.php";

    $config_handler = &xoops_gethandler('config');
    $modConfig      = &$config_handler->getConfigsByCat(0, $TadLoginXoopsModule->getVar('mid'));

    $auth_method = $modConfig['auth_method'];
    // if ($_GET['test'] == '1') {
    //     die(var_export($auth_method));
    // }
    foreach ($auth_method as $method) {
        $method_const = "_" . strtoupper($method);
        $loginTitle   = sprintf(_MD_TCW_OPENID_LOGIN, constant($method_const));
        // if ($_GET['test'] == '1') {
        //     echo _MD_TCW_OPENID_LOGIN . "-{$loginTitle}-{$method}-{$method_const}-<br>";
        // }
        $login_defval[]            = $method;
        $login_method[$loginTitle] = $method;

    }
}

$blocksArr['login']['name']     = _MD_TCW_SYSTEM_BLOCK_LOGIN;
$blocksArr['login']['tpl']      = 'login.html';
$blocksArr['login']['position'] = 'side';
if ($TadLoginXoopsModule) {
    $blocksArr['login']['config']['login_method'] = $login_defval;
    $blocksArr['login']['colset']['login_method'] = array('label' => _MD_TCW_NEWS_BLOCK_LOGIN_METHOD, 'type' => 'checkbox', 'options' => $login_method);
}

$blocksArr['search']['name']     = _MD_TCW_SYSTEM_BLOCK_SEARCH;
$blocksArr['search']['tpl']      = 'search.html';
$blocksArr['search']['position'] = 'side';

$blocksArr['qrcode']['name']     = _MD_TCW_SYSTEM_BLOCK_QRCODE;
$blocksArr['qrcode']['tpl']      = 'qrcode.html';
$blocksArr['qrcode']['position'] = 'side';

$blocksArr['web_list']['name']     = _MD_TCW_SYSTEM_BLOCK_WEBLIST;
$blocksArr['web_list']['tpl']      = 'web_list.html';
$blocksArr['web_list']['position'] = 'side';

$blocksArr['rrssb']['name']     = _MD_TCW_SYSTEM_BLOCK_RRSSB;
$blocksArr['rrssb']['tpl']      = 'rrssb.html';
$blocksArr['rrssb']['position'] = 'side';

$blocksArr['moedict']['name']     = _MD_TCW_SYSTEM_BLOCK_MOEDICT;
$blocksArr['moedict']['tpl']      = 'moedict.html';
$blocksArr['moedict']['position'] = 'side';

$blocksArr['dreye']['name']     = _MD_TCW_SYSTEM_BLOCK_DREYE;
$blocksArr['dreye']['tpl']      = 'dreye.html';
$blocksArr['dreye']['position'] = 'side';

$blocksArr['wiki']['name']     = _MD_TCW_SYSTEM_BLOCK_WIKI;
$blocksArr['wiki']['tpl']      = 'wiki.html';
$blocksArr['wiki']['position'] = 'side';

$blocksArr['pm25']['name']     = _MD_TCW_SYSTEM_BLOCK_PM25;
$blocksArr['pm25']['tpl']      = 'pm25.html';
$blocksArr['pm25']['position'] = 'side';

$blocksArr['psi']['name']     = _MD_TCW_SYSTEM_BLOCK_PSI;
$blocksArr['psi']['tpl']      = 'psi.html';
$blocksArr['psi']['position'] = 'side';

$blockConfig['system'] = $blocksArr;
