function showConfig($option)
{
    global $_CB_framework, $_CB_database, $ueConfig;
    global $_CB_adminpath;
    cbimport('cb.adminfilesystem');
    $adminFS =& cbAdminFileSystem::getInstance();
    $configfile = $_CB_adminpath . "/ue_config.php";
    //Add code to check if config file is writeable.
    if ($adminFS->isUsingStandardPHP() && !is_writable($configfile)) {
        @chmod($configfile, 0766);
        $permission = is_writable($configfile);
        if (!$permission) {
            echo "<center><h1><font color=red>" . _UE_WARNING . "...</font></h1><BR>";
            echo "<b>" . _UE_YOUR_CONFIG_FILE . ": {$configfile} <font color=red>" . _UE_IS_NOT_WRITABLE . "</font></b><br />";
            echo "<b>" . _UE_NEED_TO_CHMOD_CONFIG . "</b></center><br /><br />";
        }
    }
    $lists = array();
    // make a standard yes/no list
    $yesno = array();
    $yesno[] = moscomprofilerHTML::makeOption('0', _UE_NO);
    $yesno[] = moscomprofilerHTML::makeOption('1', _UE_YES);
    $admin_allowcbregistration = array();
    $admin_allowcbregistration[] = moscomprofilerHTML::makeOption('0', _UE_REG_ALLOWREG_SAME_AS_GLOBAL);
    $admin_allowcbregistration[] = moscomprofilerHTML::makeOption('1', _UE_REG_ALLOWREG_YES);
    $conNotifyTypes = array();
    $conNotifyTypes[] = moscomprofilerHTML::makeOption('0', _UE_NONE);
    $conNotifyTypes[] = moscomprofilerHTML::makeOption('1', CBTxt::T('Email'));
    $conNotifyTypes[] = moscomprofilerHTML::makeOption('2', CBTxt::T('PMS'));
    $conNotifyTypes[] = moscomprofilerHTML::makeOption('3', CBTxt::T('PMS+Email'));
    $dateformats = array();
    $dateformats[] = moscomprofilerHTML::makeOption('Y/m/d', CBTxt::T('yyyy/mm/dd'));
    $dateformats[] = moscomprofilerHTML::makeOption('d/m/y', CBTxt::T('dd/mm/yy'));
    $dateformats[] = moscomprofilerHTML::makeOption('y/m/d', CBTxt::T('yy/mm/dd'));
    $dateformats[] = moscomprofilerHTML::makeOption('d/m/Y', CBTxt::T('dd/mm/yyyy'));
    $dateformats[] = moscomprofilerHTML::makeOption('m/d/y', CBTxt::T('mm/dd/yy'));
    $dateformats[] = moscomprofilerHTML::makeOption('m/d/Y', CBTxt::T('mm/dd/yyyy'));
    $dateformats[] = moscomprofilerHTML::makeOption('Y-m-d', CBTxt::T('yyyy-mm-dd'));
    $dateformats[] = moscomprofilerHTML::makeOption('d-m-y', CBTxt::T('dd-mm-yy'));
    $dateformats[] = moscomprofilerHTML::makeOption('y-m-d', CBTxt::T('yy-mm-dd'));
    $dateformats[] = moscomprofilerHTML::makeOption('d-m-Y', CBTxt::T('dd-mm-yyyy'));
    $dateformats[] = moscomprofilerHTML::makeOption('m-d-y', CBTxt::T('mm-dd-yy'));
    $dateformats[] = moscomprofilerHTML::makeOption('m-d-Y', CBTxt::T('mm-dd-yyyy'));
    $dateformats[] = moscomprofilerHTML::makeOption('Y.m.d', CBTxt::T('yyyy.mm.dd'));
    $dateformats[] = moscomprofilerHTML::makeOption('d.m.y', CBTxt::T('dd.mm.yy'));
    $dateformats[] = moscomprofilerHTML::makeOption('y.m.d', CBTxt::T('yy.mm.dd'));
    $dateformats[] = moscomprofilerHTML::makeOption('d.m.Y', CBTxt::T('dd.mm.yyyy'));
    $dateformats[] = moscomprofilerHTML::makeOption('m.d.y', CBTxt::T('mm.dd.yy'));
    $dateformats[] = moscomprofilerHTML::makeOption('m.d.Y', CBTxt::T('mm.dd.yyyy'));
    $calendartypes = array();
    $calendartypes[] = moscomprofilerHTML::makeOption('2', _UE_CALENDAR_TYPE_DROPDOWN_POPUP);
    $calendartypes[] = moscomprofilerHTML::makeOption('1', _UE_CALENDAR_TYPE_POPUP);
    $nameformats = array();
    $nameformats[] = moscomprofilerHTML::makeOption('1', _UE_REG_NAMEFORMAT_NAME_ONLY);
    $nameformats[] = moscomprofilerHTML::makeOption('2', _UE_REG_NAMEFORMAT_NAME_USERNAME);
    $nameformats[] = moscomprofilerHTML::makeOption('3', _UE_REG_NAMEFORMAT_USERNAME_ONLY);
    $nameformats[] = moscomprofilerHTML::makeOption('4', _UE_REG_NAMEFORMAT_USERNAME_NAME);
    $imgToolBox = new imgToolBox();
    $imgToolBox->_IM_path = $ueConfig['im_path'];
    $imgToolBox->_NETPBM_path = $ueConfig['netpbm_path'];
    $imageLibs = $imgToolBox->getImageLibs();
    $conversiontype = array();
    if (array_key_exists('imagemagick', $imageLibs) || $ueConfig['conversiontype'] == '1') {
        $conversiontype[] = moscomprofilerHTML::makeOption('1', CBTxt::T('ImageMagick'));
    }
    if (array_key_exists('netpbm', $imageLibs) || $ueConfig['conversiontype'] == '2') {
        $conversiontype[] = moscomprofilerHTML::makeOption('2', CBTxt::T('NetPBM'));
    }
    if (array_key_exists('gd1', $imageLibs['gd']) || $ueConfig['conversiontype'] == '3') {
        $conversiontype[] = moscomprofilerHTML::makeOption('3', CBTxt::T('GD1 library'));
    }
    if (array_key_exists('gd2', $imageLibs['gd']) || $ueConfig['conversiontype'] == '4') {
        $conversiontype[] = moscomprofilerHTML::makeOption('4', CBTxt::T('GD2 library'));
    }
    $namestyles = array();
    $namestyles[] = moscomprofilerHTML::makeOption('1', _UE_REG_NAMEFORMAT_SINGLE_FIELD);
    $namestyles[] = moscomprofilerHTML::makeOption('2', _UE_REG_NAMEFORMAT_TWO_FIELDS);
    $namestyles[] = moscomprofilerHTML::makeOption('3', _UE_REG_NAMEFORMAT_THREE_FIELDS);
    $emailhandling = array();
    $emailhandling[] = moscomprofilerHTML::makeOption('1', _UE_REG_EMAILDISPLAY_EMAIL_ONLY);
    $emailhandling[] = moscomprofilerHTML::makeOption('2', _UE_REG_EMAILDISPLAY_EMAIL_W_MAILTO);
    $emailhandling[] = moscomprofilerHTML::makeOption('3', _UE_REG_EMAILDISPLAY_EMAIL_W_FORM);
    $emailhandling[] = moscomprofilerHTML::makeOption('4', _UE_REG_EMAILDISPLAY_EMAIL_NO);
    $emailreplyto = array();
    $emailreplyto[] = moscomprofilerHTML::makeOption('1', _UE_A_FROM_USER);
    $emailreplyto[] = moscomprofilerHTML::makeOption('2', _UE_A_FROM_ADMIN);
    $email_checker = array();
    $email_checker[] = moscomprofilerHTML::makeOption('0', _UE_NO);
    $email_checker[] = moscomprofilerHTML::makeOption('1', _UE_REG_EMAILCHECKER_VALID_EMAIL_ONLY);
    $email_checker[] = moscomprofilerHTML::makeOption('2', _UE_REG_EMAILCHECKER_NOT_REGISTERED_AND_VALID_EMAIL);
    $connectionDisplay = array();
    $connectionDisplay[] = moscomprofilerHTML::makeOption('0', _UE_PUBLIC);
    $connectionDisplay[] = moscomprofilerHTML::makeOption('1', _UE_PRIVATE);
    $enableSpoofCheck = array();
    $enableSpoofCheck[] = moscomprofilerHTML::makeOption('0', _UE_NO);
    $enableSpoofCheck[] = moscomprofilerHTML::makeOption('1', _UE_YES);
    $noVersionCheck = array();
    $noVersionCheck[] = moscomprofilerHTML::makeOption('0', _UE_AUTOMATIC);
    $noVersionCheck[] = moscomprofilerHTML::makeOption('1', _UE_MANUAL);
    $userprofileEdits = array();
    $userprofileEdits[] = moscomprofilerHTML::makeOption('0', _UE_NO);
    $userprofileEdits[] = moscomprofilerHTML::makeOption('1', _UE_MODERATORS_AND_ABOVE);
    //FIXME in CB 2.0: this conflicts with J1.6 ' registered group
    $userprofileEdits[] = moscomprofilerHTML::makeOption($_CB_framework->acl->mapGroupNamesToValues('Administrator'), _UE_ADMINS_AND_SUPERADMINS_ONLY);
    $userprofileEdits[] = moscomprofilerHTML::makeOption($_CB_framework->acl->mapGroupNamesToValues('Superadministrator'), _UE_SUPERADMINS_ONLY);
    $reg_show_icons_explain = array();
    $reg_show_icons_explain[] = moscomprofilerHTML::makeOption('0', _UE_NO);
    $reg_show_icons_explain[] = moscomprofilerHTML::makeOption('1', _UE_TOP);
    $reg_show_icons_explain[] = moscomprofilerHTML::makeOption('2', _UE_BOTTOM);
    $reg_show_icons_explain[] = moscomprofilerHTML::makeOption('3', _UE_TOP_AND_BOTTOM);
    $icons_display = array();
    $icons_display[] = moscomprofilerHTML::makeOption('0', _UE_NO);
    $icons_display[] = moscomprofilerHTML::makeOption('1', _UE_REQUIRED_ONLY);
    $icons_display[] = moscomprofilerHTML::makeOption('2', _UE_PROFILE_ONLY);
    $icons_display[] = moscomprofilerHTML::makeOption('3', _UE_REQUIRED_AND_PROFILE_ONLY);
    $icons_display[] = moscomprofilerHTML::makeOption('4', _UE_INFO_ONLY);
    $icons_display[] = moscomprofilerHTML::makeOption('5', _UE_REQUIRED_AND_INFO_ONLY);
    $icons_display[] = moscomprofilerHTML::makeOption('6', _UE_PROFILE_AND_INFO_ONLY);
    $icons_display[] = moscomprofilerHTML::makeOption('7', _UE_REQUIRED_PROFILE_AND_INFO);
    //TBD NEXT 9 LINES: CB 1.2 RC 2+4 + CB 1.2 specific : remove after !
    if (!defined('_UE_USERNAME_OR_EMAIL')) {
        DEFINE('_UE_USERNAME_OR_EMAIL', 'Username or email');
    }
    if (!defined('_UE_USERNAME_OR_AUTH')) {
        DEFINE('_UE_USERNAME_OR_AUTH', 'Username, email or enabled CMS authentication plugins');
    }
    if (!defined('_UE_LOGIN_TYPE')) {
        DEFINE('_UE_LOGIN_TYPE', 'Login field type');
    }
    if (!defined('_UE_LOGIN_TYPE_DESC')) {
        DEFINE('_UE_LOGIN_TYPE_DESC', 'Login can be by username + password, username or email + password, or email + password. The CB login module also adapts accordingly.');
    }
    $login_type = array();
    $login_type[] = moscomprofilerHTML::makeOption('0', _UE_USERNAME);
    $login_type[] = moscomprofilerHTML::makeOption('1', _UE_USERNAME_OR_EMAIL);
    $login_type[] = moscomprofilerHTML::makeOption('2', _UE_EMAIL);
    $login_type[] = moscomprofilerHTML::makeOption('3', _UE_USERNAME_OR_AUTH);
    $translation_debug = array();
    $translation_debug[] = moscomprofilerHTML::makeOption('0', _UE_NO);
    $translation_debug[] = moscomprofilerHTML::makeOption('1', CBTxt::T("Display text markers"));
    $translation_debug[] = moscomprofilerHTML::makeOption('2', CBTxt::T("Display html and text markers"));
    $translation_debug[] = moscomprofilerHTML::makeOption('3', CBTxt::T("Display markers and list untranslated strings"));
    $translation_debug[] = moscomprofilerHTML::makeOption('4', CBTxt::T("Display markers and list all strings"));
    $usedivs = array();
    $usedivs[] = moscomprofilerHTML::makeOption('0', CBTxt::T("Use tables"));
    $usedivs[] = moscomprofilerHTML::makeOption('1', CBTxt::T("Use divs (table-less output)"));
    // ensure user can't add group higher than themselves
    $gtree = $_CB_framework->acl->get_groups_below_me();
    $gtree2 = array();
    $gtree2[] = moscomprofilerHTML::makeOption(-2, '- ' . _UE_GROUPS_EVERYBODY . ' -');
    // '- Everybody -'
    $gtree2[] = moscomprofilerHTML::makeOption(-1, '- ' . _UE_GROUPS_ALL_REG_USERS . ' -');
    // '- All Registered Users -'
    $gtree2 = array_merge($gtree2, $_CB_framework->acl->get_group_children_tree(null, 'USERS', false));
    // Fix initial configuration of gid 0:
    $mygrps = array();
    if ($gtree) {
        foreach ($gtree as $treegrp) {
            $mygrps[] = $treegrp->value;
        }
    }
    if (!isset($ueConfig['imageApproverGid']) || $ueConfig['imageApproverGid'] == '0' || !in_array($ueConfig['imageApproverGid'], $mygrps)) {
        $image_approval = $_CB_framework->acl->mapGroupNamesToValues('Administrator');
        // Joomla 1.6 super-admin to fix the default ueConfig for 1.6.
    } else {
        $image_approval = $ueConfig['imageApproverGid'];
    }
    $mygtree2 = array();
    foreach ($gtree2 as $treegrp) {
        $mygtree2[] = $treegrp->value;
    }
    if (!isset($ueConfig['allow_profileviewbyGID']) || $ueConfig['allow_profileviewbyGID'] == '0' || !in_array($ueConfig['allow_profileviewbyGID'], $mygtree2)) {
        $allow_profileviewbyGID = $_CB_framework->acl->mapGroupNamesToValues('Administrator');
        // Joomla 1.6 super-admin to fix the default ueConfig for 1.6.
    } else {
        $allow_profileviewbyGID = $ueConfig['allow_profileviewbyGID'];
    }
    $lists['imageApproverGid'] = moscomprofilerHTML::selectList($gtree, 'cfg_imageApproverGid', '', 'value', 'text', $image_approval, 2, false, false);
    $lists['allow_profileviewbyGID'] = moscomprofilerHTML::selectList($gtree2, 'cfg_allow_profileviewbyGID', '', 'value', 'text', $allow_profileviewbyGID, 2, false, false);
    //$lists['allow_listviewbyGID']=moscomprofilerHTML::selectList( $gtree2, 'cfg_allow_listviewbyGID', 'size="4"', 'value', 'text', $ueConfig['allow_listviewbyGID'], 2 );
    // registered users only
    $tempdir = array();
    $_CB_database->setQuery("SELECT `name`,`folder` FROM `#__comprofiler_plugin` WHERE `type`='templates' AND `published`=1 ORDER BY ordering");
    //echo $_CB_database->getQuery();
    $templates = $_CB_database->loadObjectList();
    foreach ($templates as $template) {
        $tempdir[] = moscomprofilerHTML::makeOption($template->folder, $template->name);
    }
    /*
    require($_CB_framework->getCfg('absolute_path').'/components/com_comprofiler/plugin/user/plug_yancintegration/yanc.php');
    $getNewslettersTab= new getNewslettersTab();
    $newslettersList = $getNewslettersTab->getNewslettersList();
    $newslettersRegList = array();
    if ($newslettersList !== false) {
    	foreach ($newslettersList AS $nl) {
    		$newslettersRegList[] = moscomprofilerHTML::makeOption( $nl->id, $nl->list_name);
    	}
    }
    */
    $cbFielfs = new cbFields();
    $badHtmlFilter =& $cbFielfs->getInputFilter(array(), array(), 1, 1);
    $lists['_filteredbydefault'] = implode(' ', $badHtmlFilter->tagBlacklist);
    if (!isset($ueConfig['html_filter_allowed_tags'])) {
        $ueConfig['html_filter_allowed_tags'] = '';
    }
    $lists['allow_email_display'] = moscomprofilerHTML::selectList($emailhandling, 'cfg_allow_email_display', 'class="inputbox" size="1"', 'value', 'text', $ueConfig['allow_email_display'], 2);
    $lists['allow_email_replyto'] = moscomprofilerHTML::selectList($emailreplyto, 'cfg_allow_email_replyto', 'class="inputbox" size="1"', 'value', 'text', isset($ueConfig['allow_email_replyto']) ? $ueConfig['allow_email_replyto'] : '1', 2);
    $lists['name_format'] = moscomprofilerHTML::selectList($nameformats, 'cfg_name_format', 'class="inputbox" size="1"', 'value', 'text', $ueConfig['name_format'], 2);
    $lists['name_style'] = moscomprofilerHTML::selectList($namestyles, 'cfg_name_style', 'class="inputbox" size="1"', 'value', 'text', $ueConfig['name_style'], 2);
    $lists['date_format'] = moscomprofilerHTML::selectList($dateformats, 'cfg_date_format', 'class="inputbox" size="1"', 'value', 'text', $ueConfig['date_format'], 2);
    $lists['calendar_type'] = moscomprofilerHTML::selectList($calendartypes, 'cfg_calendar_type', 'class="inputbox" size="1"', 'value', 'text', isset($ueConfig['calendar_type']) ? $ueConfig['calendar_type'] : '2', 2);
    $lists['usernameedit'] = moscomprofilerHTML::selectList($yesno, 'cfg_usernameedit', 'class="inputbox" size="1"', 'value', 'text', $ueConfig['usernameedit'], 2);
    $lists['allow_profilelink'] = moscomprofilerHTML::selectList($yesno, 'cfg_allow_profilelink', 'class="inputbox" size="1"', 'value', 'text', $ueConfig['allow_profilelink'], 2);
    $lists['allow_email'] = moscomprofilerHTML::selectList($yesno, 'cfg_allow_email', 'class="inputbox" size="1"', 'value', 'text', $ueConfig['allow_email'], 2);
    $lists['allow_onlinestatus'] = moscomprofilerHTML::selectList($yesno, 'cfg_allow_onlinestatus', 'class="inputbox" size="1"', 'value', 'text', $ueConfig['allow_onlinestatus'], 2);
    $lists['allow_website'] = moscomprofilerHTML::selectList($yesno, 'cfg_allow_website', 'class="inputbox" size="1"', 'value', 'text', $ueConfig['allow_website'], 2);
    $lists['icons_display'] = moscomprofilerHTML::selectList($icons_display, 'cfg_icons_display', 'class="inputbox" size="1"', 'value', 'text', isset($ueConfig['icons_display']) ? $ueConfig['icons_display'] : '7', 2);
    $lists['login_type'] = moscomprofilerHTML::selectList($login_type, 'cfg_login_type', 'class="inputbox" size="1"', 'value', 'text', isset($ueConfig['login_type']) ? $ueConfig['login_type'] : '0', 2);
    $lists['reg_enable_toc'] = moscomprofilerHTML::selectList($yesno, 'cfg_reg_enable_toc', 'class="inputbox" size="1"', 'value', 'text', $ueConfig['reg_enable_toc'], 2);
    $lists['admin_allowcbregistration'] = moscomprofilerHTML::selectList($admin_allowcbregistration, 'cfg_reg_admin_allowcbregistration', 'class="inputbox" size="1"', 'value', 'text', isset($ueConfig['reg_admin_allowcbregistration']) ? $ueConfig['reg_admin_allowcbregistration'] : '0', 2);
    $lists['emailpass'] = moscomprofilerHTML::selectList($yesno, 'cfg_emailpass', 'class="inputbox" size="1"', 'value', 'text', isset($ueConfig['emailpass']) ? $ueConfig['emailpass'] : '******', 2);
    $lists['admin_approval'] = moscomprofilerHTML::selectList($yesno, 'cfg_reg_admin_approval', 'class="inputbox" size="1"', 'value', 'text', $ueConfig['reg_admin_approval'], 2);
    $lists['confirmation'] = moscomprofilerHTML::selectList($yesno, 'cfg_reg_confirmation', 'class="inputbox" size="1"', 'value', 'text', $ueConfig['reg_confirmation'], 2);
    $lists['reg_username_checker'] = moscomprofilerHTML::selectList($yesno, 'cfg_reg_username_checker', 'class="inputbox" size="1"', 'value', 'text', isset($ueConfig['reg_username_checker']) ? $ueConfig['reg_username_checker'] : '0', 2);
    $lists['reg_email_checker'] = moscomprofilerHTML::selectList($email_checker, 'cfg_reg_email_checker', 'class="inputbox" size="1"', 'value', 'text', isset($ueConfig['reg_email_checker']) ? $ueConfig['reg_email_checker'] : '0', 2);
    $lists['reg_show_login_on_page'] = moscomprofilerHTML::selectList($yesno, 'cfg_reg_show_login_on_page', 'class="inputbox" size="1"', 'value', 'text', isset($ueConfig['reg_show_login_on_page']) ? $ueConfig['reg_show_login_on_page'] : '0', 2);
    $lists['reg_show_icons_explain'] = moscomprofilerHTML::selectList($reg_show_icons_explain, 'cfg_reg_show_icons_explain', 'class="inputbox" size="1"', 'value', 'text', isset($ueConfig['reg_show_icons_explain']) ? $ueConfig['reg_show_icons_explain'] : '3', 2);
    $lists['allowAvatar'] = moscomprofilerHTML::selectList($yesno, 'cfg_allowAvatar', 'class="inputbox" size="1"', 'value', 'text', $ueConfig['allowAvatar'], 2);
    $lists['allowAvatarUpload'] = moscomprofilerHTML::selectList($yesno, 'cfg_allowAvatarUpload', 'class="inputbox" size="1"', 'value', 'text', $ueConfig['allowAvatarUpload'], 2);
    $lists['avatarResizeAlways'] = moscomprofilerHTML::selectList($yesno, 'cfg_avatarResizeAlways', 'class="inputbox" size="1"', 'value', 'text', isset($ueConfig['avatarResizeAlways']) ? $ueConfig['avatarResizeAlways'] : '1', 2);
    $lists['allowAvatarGallery'] = moscomprofilerHTML::selectList($yesno, 'cfg_allowAvatarGallery', 'class="inputbox" size="1"', 'value', 'text', $ueConfig['allowAvatarGallery'], 2);
    $lists['avatarUploadApproval'] = moscomprofilerHTML::selectList($yesno, 'cfg_avatarUploadApproval', 'class="inputbox" size="1"', 'value', 'text', $ueConfig['avatarUploadApproval'], 2);
    $lists['allowUserReports'] = moscomprofilerHTML::selectList($yesno, 'cfg_allowUserReports', 'class="inputbox" size="1"', 'value', 'text', $ueConfig['allowUserReports'], 2);
    $lists['allowModeratorsUserEdit'] = moscomprofilerHTML::selectList($userprofileEdits, 'cfg_allowModeratorsUserEdit', 'class="inputbox" size="1"', 'value', 'text', isset($ueConfig['allowModeratorsUserEdit']) ? $ueConfig['allowModeratorsUserEdit'] : '0', 2);
    $lists['allowUserBanning'] = moscomprofilerHTML::selectList($yesno, 'cfg_allowUserBanning', 'class="inputbox" size="1"', 'value', 'text', $ueConfig['allowUserBanning'], 2);
    $lists['adminrequiredfields'] = moscomprofilerHTML::selectList($yesno, 'cfg_adminrequiredfields', 'class="inputbox" size="1"', 'value', 'text', $ueConfig['adminrequiredfields'], 2);
    $lists['moderatorEmail'] = moscomprofilerHTML::selectList($yesno, 'cfg_moderatorEmail', 'class="inputbox" size="1"', 'value', 'text', $ueConfig['moderatorEmail'], 2);
    $lists['allowModUserApproval'] = moscomprofilerHTML::selectList($yesno, 'cfg_allowModUserApproval', 'class="inputbox" size="1"', 'value', 'text', $ueConfig['allowModUserApproval'], 2);
    $lists['templatedir'] = moscomprofilerHTML::selectList($tempdir, 'cfg_templatedir', 'class="inputbox" size="1"', 'value', 'text', $ueConfig['templatedir'], 2);
    $lists['showEmptyTabs'] = moscomprofilerHTML::selectList($yesno, 'cfg_showEmptyTabs', 'class="inputbox" size="1"', 'value', 'text', isset($ueConfig['showEmptyTabs']) ? $ueConfig['showEmptyTabs'] : 0, 2);
    $lists['showEmptyFields'] = moscomprofilerHTML::selectList($yesno, 'cfg_showEmptyFields', 'class="inputbox" size="1"', 'value', 'text', isset($ueConfig['showEmptyFields']) ? $ueConfig['showEmptyFields'] : 0, 2);
    $lists['nesttabs'] = moscomprofilerHTML::selectList($yesno, 'cfg_nesttabs', 'class="inputbox" size="1"', 'value', 'text', $ueConfig['nesttabs'], 2);
    $lists['xhtmlComply'] = moscomprofilerHTML::selectList($yesno, 'cfg_xhtmlComply', 'class="inputbox" size="1"', 'value', 'text', $ueConfig['xhtmlComply'], 2);
    $lists['frontend_userparams'] = moscomprofilerHTML::selectList($yesno, 'cfg_frontend_userparams', 'class="inputbox" size="1"', 'value', 'text', isset($ueConfig['frontend_userparams']) ? $ueConfig['frontend_userparams'] : (in_array($_CB_framework->getCfg("frontend_userparams"), array('1', null)) ? '1' : '0'), 2);
    $lists['use_divs'] = moscomprofilerHTML::selectList($usedivs, 'cfg_use_divs', 'class="inputbox" size="1"', 'value', 'text', isset($ueConfig['use_divs']) ? $ueConfig['use_divs'] : 0, 2);
    $lists['conversiontype'] = moscomprofilerHTML::selectList($conversiontype, 'cfg_conversiontype', 'class="inputbox" size="1"', 'value', 'text', $ueConfig['conversiontype'], 2);
    $lists['allowConnections'] = moscomprofilerHTML::selectList($yesno, 'cfg_allowConnections', 'class="inputbox" size="1"', 'value', 'text', $ueConfig['allowConnections'], 2);
    $lists['useMutualConnections'] = moscomprofilerHTML::selectList($yesno, 'cfg_useMutualConnections', 'class="inputbox" size="1"', 'value', 'text', $ueConfig['useMutualConnections'], 2);
    $lists['autoAddConnections'] = moscomprofilerHTML::selectList($yesno, 'cfg_autoAddConnections', 'class="inputbox" size="1"', 'value', 'text', $ueConfig['autoAddConnections'], 2);
    $lists['conNotifyTypes'] = moscomprofilerHTML::selectList($conNotifyTypes, 'cfg_conNotifyType', 'class="inputbox" size="1"', 'value', 'text', $ueConfig['conNotifyType'], 2);
    $lists['connectionDisplay'] = moscomprofilerHTML::selectList($connectionDisplay, 'cfg_connectionDisplay', 'class="inputbox" size="1"', 'value', 'text', $ueConfig['connectionDisplay'], 2);
    $lists['connectionPath'] = moscomprofilerHTML::selectList($yesno, 'cfg_connectionPath', 'class="inputbox" size="1"', 'value', 'text', $ueConfig['connectionPath'], 2);
    $lists['enableSpoofCheck'] = moscomprofilerHTML::selectList($enableSpoofCheck, 'cfg_enableSpoofCheck', 'class="inputbox" size="1"', 'value', 'text', isset($ueConfig['enableSpoofCheck']) ? $ueConfig['enableSpoofCheck'] : '1', 2);
    $lists['noVersionCheck'] = moscomprofilerHTML::selectList($noVersionCheck, 'cfg_noVersionCheck', 'class="inputbox" size="1"', 'value', 'text', isset($ueConfig['noVersionCheck']) ? $ueConfig['noVersionCheck'] : '0', 2);
    $lists['translations_debug'] = moscomprofilerHTML::selectList($translation_debug, 'cfg_translations_debug', 'class="inputbox" size="1"', 'value', 'text', isset($ueConfig['translations_debug']) ? $ueConfig['translations_debug'] : '0', 2);
    HTML_comprofiler::showConfig($ueConfig, $lists, $option);
}
/**
 * CB 1.0 COMPATIBILITY FUNCTION: DO NOT USE FOR NEW DEVELOPMENT !
 * replaced by cbGetField temporarly
 * @access private
 *
 * @param unknown_type $oType
 * @param unknown_type $oValue
 * @param unknown_type $user
 * @param unknown_type $prefix
 * @param unknown_type $imgMode
 * @param unknown_type $linkURL
 * @param unknown_type $field
 * @return unknown
 */
function getFieldValue($oType, $oValue = null, $user = null, $prefix = null, $imgMode = 0, $linkURL = null, $field = null)
{
    global $ueConfig, $_CB_database, $_CB_framework, $_PLUGINS;
    $oReturn = "";
    switch ($oType) {
        case 'checkbox':
            if ($oValue != '' && $oValue != null) {
                if ($oValue == 1) {
                    $oReturn = _UE_YES;
                } elseif ($oValue == 0) {
                    $oReturn = _UE_NO;
                } else {
                    $oReturn = null;
                }
            }
            break;
        case 'select':
        case 'radio':
            $oReturn = htmlspecialchars(getLangDefinition($oValue));
            break;
        case 'multiselect':
        case 'multicheckbox':
            $oReturn = array();
            $oReturn = explode("|*|", htmlspecialchars($oValue));
            for ($i = 0; $i < count($oReturn); $i++) {
                $oReturn[$i] = htmlspecialchars(getLangDefinition($oReturn[$i]));
            }
            $oReturn = implode(', ', $oReturn);
            break;
        case 'date':
            if ($oValue != '' || $oValue != null) {
                if ($oValue != '0000-00-00 00:00:00' && $oValue != '0000-00-00') {
                    $oReturn = cbFormatDate(htmlspecialchars($oValue));
                } else {
                    $oReturn = "";
                }
            }
            break;
        case 'primaryemailaddress':
            if ($ueConfig['allow_email_display'] == 3 || $imgMode != 0) {
                $oValueText = _UE_SENDEMAIL;
            } else {
                $oValueText = htmlspecialchars($oValue);
            }
            $emailIMG = '<img src="' . $_CB_framework->getCfg('live_site') . '/components/com_comprofiler/images/email.gif" border="0" alt="' . _UE_SENDEMAIL . '" title="' . _UE_SENDEMAIL . '" />';
            switch ($imgMode) {
                case 0:
                    $linkItemImg = null;
                    $linkItemSep = null;
                    $linkItemTxt = $oValueText;
                    break;
                case 1:
                    $linkItemImg = $emailIMG;
                    $linkItemSep = null;
                    $linkItemTxt = null;
                    break;
                case 2:
                    $linkItemImg = $emailIMG;
                    $linkItemSep = ' ';
                    $linkItemTxt = $oValueText;
                    break;
            }
            //if no email or 4 (do not display email) then return empty string
            if ($oValue == null || $ueConfig['allow_email_display'] == 4 || $imgMode != 0 && $ueConfig['allow_email_display'] == 1) {
                $oReturn = "";
            } else {
                switch ($ueConfig['allow_email_display']) {
                    case 1:
                        //display email only
                        $oReturn = moscomprofilerHTML::emailCloaking(htmlspecialchars($oValue), 0);
                        break;
                    case 2:
                        //mailTo link
                        // cloacking doesn't cloack the text of the hyperlink, if that text does contain email addresses		//TODO: fix it.
                        if (!$linkItemImg && $linkItemTxt == htmlspecialchars($oValue)) {
                            $oReturn = moscomprofilerHTML::emailCloaking(htmlspecialchars($oValue), 1, '', 0);
                        } elseif ($linkItemImg && $linkItemTxt != htmlspecialchars($oValue)) {
                            $oReturn = moscomprofilerHTML::emailCloaking(htmlspecialchars($oValue), 1, $linkItemImg . $linkItemSep . $linkItemTxt, 0, false);
                        } elseif ($linkItemImg && $linkItemTxt == htmlspecialchars($oValue)) {
                            $oReturn = moscomprofilerHTML::emailCloaking(htmlspecialchars($oValue), 1, $linkItemImg, 0, false) . $linkItemSep;
                            $oReturn .= moscomprofilerHTML::emailCloaking(htmlspecialchars($oValue), 1, '', 0);
                        } elseif (!$linkItemImg && $linkItemTxt != htmlspecialchars($oValue)) {
                            $oReturn = moscomprofilerHTML::emailCloaking(htmlspecialchars($oValue), 1, $linkItemTxt, 0);
                        }
                        break;
                    case 3:
                        //email Form (with cloacked email address if visible)
                        $oReturn = "<a href=\"" . cbSef("index.php?option=com_comprofiler&amp;task=emailUser&amp;uid=" . $user->id . getCBprofileItemid(true)) . "\" title=\"" . _UE_MENU_SENDUSEREMAIL_DESC . "\">" . $linkItemImg . $linkItemSep;
                        if ($linkItemTxt && $linkItemTxt != _UE_SENDEMAIL) {
                            $oReturn .= moscomprofilerHTML::emailCloaking($linkItemTxt, 0);
                        } else {
                            $oReturn .= $linkItemTxt;
                        }
                        $oReturn .= "</a>";
                        break;
                }
            }
            break;
        case 'pm':
            $pmIMG = '<img src="' . $_CB_framework->getCfg('live_site') . '/components/com_comprofiler/images/pm.gif" border="0" alt="' . _UE_PM_USER . '" title="' . _UE_PM_USER . '" />';
            $oReturn = "";
            global $_CB_PMS;
            $resultArray = $_CB_PMS->getPMSlinks($user->id, $_CB_framework->myId(), "", "", 1);
            // toid,fromid,subject,message,1: link to compose new PMS message for $toid user.
            if (count($resultArray) > 0) {
                foreach ($resultArray as $res) {
                    if (is_array($res)) {
                        switch ($imgMode) {
                            case 0:
                                $linkItem = getLangDefinition($res["caption"]);
                                break;
                            case 1:
                                $linkItem = $pmIMG;
                                break;
                            case 2:
                                $linkItem = $pmIMG . ' ' . getLangDefinition($res["caption"]);
                                break;
                        }
                        $oReturn .= "<a href=\"" . cbSef($res["url"]) . "\" title=\"" . getLangDefinition($res["tooltip"]) . "\">" . $linkItem . "</a>";
                    }
                }
            }
            break;
        case 'emailaddress':
            if ($oValue == null) {
                $oReturn = '';
            } else {
                if ($ueConfig['allow_email'] == 1) {
                    $oReturn = moscomprofilerHTML::emailCloaking(htmlspecialchars($oValue), 1, "", 0);
                } else {
                    $oReturn = moscomprofilerHTML::emailCloaking(htmlspecialchars($oValue), 0);
                }
            }
            break;
        case 'webaddress':
            if ($oValue == null) {
                $oReturn = "";
            } elseif ($ueConfig['allow_website'] == 1) {
                $oReturn = array();
                $oReturn = explode("|*|", $oValue);
                if (count($oReturn) < 2) {
                    $oReturn[1] = $oReturn[0];
                }
                $oReturn = "<a href=\"http://" . htmlspecialchars($oReturn[0]) . "\" target=\"_blank\" rel=\"nofollow\">" . htmlspecialchars($oReturn[1]) . "</a>";
            } else {
                $oReturn = $oValue;
            }
            break;
        case 'image':
            $cbUser =& CBuser::getInstance(null);
            $cbUser->loadCbRow($user);
            $oValue = $cbUser->avatarFilePath();
            /*
            			if(is_dir($_CB_framework->getCfg('absolute_path')."/components/com_comprofiler/plugin/language/".$_CB_framework->getCfg( 'lang' )."/images")) $fileLang=$_CB_framework->getCfg( 'lang' );
            			else $fileLang="default_language";
            
            			if($user->avatarapproved==0) $oValue="components/com_comprofiler/plugin/language/".$fileLang."/images/tnpendphoto.jpg";
            			elseif(($user->avatar=='' || $user->avatar==null) && $user->avatarapproved==1) $oValue = "components/com_comprofiler/plugin/language/".$fileLang."/images/tnnophoto.jpg";
            			elseif(strpos($user->avatar,"gallery/")===false) $oValue="images/comprofiler/tn".$oValue;
            			else $oValue="images/comprofiler/".$oValue;
            
            			if(!is_file($_CB_framework->getCfg('absolute_path')."/".$oValue)) $oValue = "components/com_comprofiler/plugin/language/".$fileLang."/images/tnnophoto.jpg";
            			if(is_file($_CB_framework->getCfg('absolute_path')."/".$oValue)) {
            */
            $onclick = null;
            $aTag = null;
            if ($ueConfig['allow_profilelink'] == 1) {
                $profileURL = cbSef("index.php?option=com_comprofiler&amp;task=userProfile&amp;user="******"onclick=\"javascript:window.location='".$profileURL."'\"";
                $aTag = "<a href=\"" . $profileURL . "\">";
            }
            $oReturn = $aTag . "<img src=\"" . $oValue . "\" " . $onclick . " alt=\"\" style=\"border-style: none;\" />" . ($aTag ? "</a>" : "");
            /*
            			}
            */
            break;
        case 'status':
            if ($ueConfig['allow_onlinestatus'] == 1) {
                if (isset($user)) {
                    $_CB_database->setQuery("SELECT COUNT(*) FROM #__session WHERE userid = " . (int) $user->id . " AND guest = 0");
                    $isonline = $_CB_database->loadResult();
                } else {
                    $isonline = $oValue;
                }
                if ($isonline > 0) {
                    $oValue = _UE_ISONLINE;
                    // $img			=	'online.png';
                    $class = 'cb_online';
                    // $onlineIMG= "<img src=\"components/com_comprofiler/images/online.gif\" border=\"0\" alt=\"".$oValue."\" title=\"".$oValue."\" />";
                } else {
                    $oValue = _UE_ISOFFLINE;
                    // $img			=	'offline.png';
                    $class = 'cb_offline';
                    // $onlineIMG= "<img src=\"components/com_comprofiler/images/offline.gif\" border=\"0\" alt=\"".$oValue."\" title=\"".$oValue."\" />";
                }
                switch ($imgMode) {
                    case 0:
                        $oReturn = $oValue;
                        break;
                    case 1:
                        //$oReturn=$onlineIMG;
                        $oReturn = '<span class="' . $class . '" title="' . htmlspecialchars($oValue) . '">&nbsp;</span>';
                        break;
                    case 2:
                        //$oReturn=$onlineIMG.' '.$oValue;
                        $oReturn = '<span class="' . $class . '"><span>' . htmlspecialchars($oValue) . '</span></span>';
                        break;
                }
            }
            break;
        case 'formatname':
            if ($linkURL && $ueConfig['allow_profilelink'] == 1) {
                $oReturn = "<a href=\"" . $linkURL . "\">";
            }
            $oReturn .= getNameFormat($user->name, $user->username, $ueConfig['name_format']);
            if ($linkURL && $ueConfig['allow_profilelink'] == 1) {
                $oReturn .= "</a>";
            }
            break;
        case 'textarea':
            $oReturn = nl2br(htmlspecialchars($oValue));
            break;
        case 'delimiter':
            if ($field !== null && $user !== null) {
                $oReturn = cbReplaceVars(getLangDefinition(cbUnHtmlspecialchars($field->description)), $user);
                //TBD: unhtml is kept for backwards database compatibility until CB 2.0
            } else {
                $oReturn = cbReplaceVars(getLangDefinition($oValue), $user);
            }
            break;
        case 'editorta':
            $cbFielfs = new cbFields();
            $badHtmlFilter =& $cbFielfs->getInputFilter(array(), array(), 1, 1);
            if (isset($ueConfig['html_filter_allowed_tags']) && $ueConfig['html_filter_allowed_tags']) {
                $badHtmlFilter->tagBlacklist = array_diff($badHtmlFilter->tagBlacklist, explode(" ", $ueConfig['html_filter_allowed_tags']));
            }
            $oReturn = $cbFielfs->clean($badHtmlFilter, $oValue);
            unset($cbFielfs);
            break;
        case 'predefined':
            if ($linkURL && $ueConfig['allow_profilelink'] == 1) {
                $oReturn = "<a href=\"" . $linkURL . "\">";
            }
            $oReturn .= htmlspecialchars(cbUnHtmlspecialchars($oValue));
            // needed for #__users:name (has &039; instead of ' in it...)		//TBD: unhtml is kept for backwards database compatibility until CB 2.0
            if ($linkURL && $ueConfig['allow_profilelink'] == 1) {
                $oReturn .= "</a>";
            }
            break;
        case 'text':
        default:
            if ($field != null) {
                $args = array(&$field, &$user, 'html', 'profile');
                $oReturn = $_PLUGINS->callField($oType, 'getField', $args, $field);
            } else {
                $oReturn = htmlspecialchars($oValue);
            }
            break;
    }
    if ($prefix != null && ($oReturn != null || $oReturn != '')) {
        $oReturn = $prefix . $oReturn;
    }
    return $oReturn;
}
 /**
  * Returns a field in specified format
  *
  * @param  moscomprofilerFields  $field
  * @param  moscomprofilerUser    $user
  * @param  string                $output  'html', 'xml', 'json', 'php', 'csvheader', 'csv', 'rss', 'fieldslist', 'htmledit'
  * @param  string                $reason  'profile' for user profile view, 'edit' for profile edit, 'register' for registration, 'list' for user-lists
  * @param  int                   $list_compare_types   IF reason == 'search' : 0 : simple 'is' search, 1 : advanced search with modes, 2 : simple 'any' search
  * @return mixed                
  */
 function getField(&$field, &$user, $output, $reason, $list_compare_types)
 {
     global $_CB_framework, $ueConfig;
     $value = $user->get(implode('', $field->getTableColumns()));
     switch ($output) {
         case 'html':
         case 'rss':
             $cbFields = new cbFields();
             $badHtmlFilter =& $cbFields->getInputFilter(array(), array(), 1, 1);
             if (isset($ueConfig['html_filter_allowed_tags']) && $ueConfig['html_filter_allowed_tags']) {
                 $badHtmlFilter->tagBlacklist = array_diff($badHtmlFilter->tagBlacklist, explode(" ", $ueConfig['html_filter_allowed_tags']));
             }
             $html = $cbFields->clean($badHtmlFilter, $value);
             unset($cbFields);
             break;
         case 'htmledit':
             if ($reason == 'search') {
                 $fsize = $field->size;
                 if ($field->size > 120) {
                     $field->size = null;
                 }
                 $html = $this->_fieldEditToHtml($field, $user, $reason, 'input', 'text', $value, '');
                 $field->size = $fsize;
                 $html = $this->_fieldSearchModeHtml($field, $user, $html, 'text', $list_compare_types);
             } elseif (!$this->_isReadOnly($field, $user, $reason)) {
                 $cbFields = new cbFields();
                 $badHtmlFilter =& $cbFields->getInputFilter(array(), array(), 1, 1);
                 if (isset($ueConfig['html_filter_allowed_tags']) && $ueConfig['html_filter_allowed_tags']) {
                     $badHtmlFilter->tagBlacklist = array_diff($badHtmlFilter->tagBlacklist, explode(" ", $ueConfig['html_filter_allowed_tags']));
                 }
                 $value = $cbFields->clean($badHtmlFilter, $value);
                 unset($cbFields);
                 $html = $_CB_framework->displayCmsEditor($field->name, $value, 600, 350, $field->cols, $field->rows) . $this->_fieldIconsHtml($field, $user, $output, $reason, null, $field->type, $value, 'input', null, true, $this->_isRequired($field, $user, $reason) && !$this->_isReadOnly($field, $user, $reason));
                 $this->_addSaveAndValidateCode($field, $user, $reason);
             } else {
                 $html = null;
             }
             break;
         case 'json':
         case 'php':
         case 'xml':
         case 'csvheader':
         case 'fieldslist':
         case 'csv':
         default:
             return parent::getField($field, $user, $output, $reason, $list_compare_types);
             break;
     }
     return $html;
 }