Пример #1
0
 public function display($arrValues = false)
 {
     registry::load("form");
     $arrFields = $this->fields();
     $form = register('form', array('sso_settings'));
     $form->use_fieldsets = true;
     $form->use_dependency = true;
     $form->lang_prefix = 'es_sl_';
     $form->add_fieldsets($arrFields);
     if (!$arrValues && $this->in->get('slaveid', 0)) {
         $arrValues = $this->pdh->get('eqdkp_sso', 'data', array($this->in->get('slaveid', 0)));
         //Encrypt some Values
         $crypt = register('encrypt', array($this->sso->get_own_master_key()));
         $arrValues['db_host'] = $crypt->decrypt($arrValues['db_host']);
         $arrValues['db_user'] = $crypt->decrypt($arrValues['db_user']);
         $arrValues['db_password'] = $crypt->decrypt($arrValues['db_password']);
         $arrValues['db_database'] = $crypt->decrypt($arrValues['db_database']);
         $arrValues['db_prefix'] = $crypt->decrypt($arrValues['db_prefix']);
     }
     $form->output($arrValues);
     $this->tpl->assign_var('SLAVEID', $this->in->get('slaveid', 0));
     $this->core->set_vars(array('page_title' => $this->user->lang('settings'), 'template_path' => $this->pm->get_data('eqdkp_sso', 'template_path'), 'template_file' => 'admin/slaves.html', 'header_format' => 'simple', 'display' => true));
 }
Пример #2
0
 public function display()
 {
     $this->pdh->enqueue_hook('eqdkp_sso_update');
     $this->pdh->process_hook_queue();
     registry::load("form");
     $arrFields = $this->fields();
     $form = register('form', array('sso_settings'));
     $form->reset_fields();
     $form->use_fieldsets = true;
     $form->use_dependency = true;
     $form->lang_prefix = 'es_';
     $form->add_fieldsets($arrFields);
     $arrValues = $this->config->get_config('eqdkp_sso');
     //Decrypt some values;
     if (isset($arrValues['master_key'])) {
         $arrValues['master_key'] = $this->encrypt->decrypt($arrValues['master_key']);
     }
     if (isset($arrValues['db_host'])) {
         $arrValues['db_host'] = $this->encrypt->decrypt($arrValues['db_host']);
     }
     if (isset($arrValues['db_user'])) {
         $arrValues['db_user'] = $this->encrypt->decrypt($arrValues['db_user']);
     }
     if (isset($arrValues['db_password'])) {
         $arrValues['db_password'] = $this->encrypt->decrypt($arrValues['db_password']);
     }
     if (isset($arrValues['db_database'])) {
         $arrValues['db_database'] = $this->encrypt->decrypt($arrValues['db_database']);
     }
     if (isset($arrValues['db_prefix'])) {
         $arrValues['db_prefix'] = $this->encrypt->decrypt($arrValues['db_prefix']);
     }
     $form->output($arrValues);
     $arrIDList = $this->pdh->get('eqdkp_sso', 'id_list');
     foreach ($arrIDList as $intID) {
         $data = $this->pdh->get('eqdkp_sso', 'data', array($intID));
         $this->tpl->assign_block_vars('field_row', array('ID' => $intID, 'NAME' => $data['name'], 'DOMAIN' => $data['domain'], 'UNIQUEID' => $data['uniqueid'], 'COOKIE_NAME' => $data['cookie_name'], 'DEL_HASH' => $this->CSRFGetToken('del')));
     }
     $this->jquery->Dialog('editSlave', $this->user->lang('es_edit_slave'), array('url' => 'slaves.php' . $this->SID . "&slaveid='+id+'", 'withid' => 'id', 'width' => 920, 'height' => 740, 'onclose' => 'settings.php' . $this->SID));
     $this->tpl->assign_vars(array('S_INSERT_MASTER' => $this->blnMasterTest));
     $this->core->set_vars(array('page_title' => $this->user->lang('settings'), 'template_path' => $this->pm->get_data('eqdkp_sso', 'template_path'), 'template_file' => 'admin/settings.html', 'display' => true));
 }
Пример #3
0
 public function edit($foptions = '', $ftype = '')
 {
     if ($this->in->exists('id')) {
         $options = $this->apa->get_apa_edit_form($this->in->get('id'));
         $type = $this->apa->get_data('type', $this->in->get('id'));
     } else {
         $type = $this->in->get('type');
         $options = $this->apa->get_apa_add_form($type);
     }
     $options = $foptions ? $foptions : $options;
     $type = $ftype ? $ftype : $type;
     if (!$options || !is_array($options)) {
         $this->display();
     }
     registry::load('form');
     foreach ($options as $name => $option) {
         if ($name == 'pools') {
             $option['options'] = $this->pdh->aget('multidkp', 'name', 0, array($this->pdh->get('multidkp', 'id_list')));
             if (!$this->in->exists('id')) {
                 $used = $this->apa->get_pools_used($type);
                 foreach ($used as $dkpid) {
                     if (!in_array($dkpid, $option['value'])) {
                         unset($option['options'][$dkpid]);
                     }
                 }
             }
         }
         $lang = $this->user->lang('apa_' . $type . '_' . $name, false, false) ? $this->user->lang('apa_' . $type . '_' . $name) : '';
         $help = $this->user->lang('apa_' . $type . '_' . $name . '_help', false, false) ? $this->user->lang('apa_' . $type . '_' . $name . '_help') : '';
         $this->tpl->assign_block_vars('input', array('NAME' => $lang ? $lang : $this->user->lang('apa_' . $name, true, false), 'HELP' => $help ? $help : $this->user->lang('apa_' . $name . '_help', false, false), 'FIELD' => form::field($name, $option), 'FUNC' => $name == 'calc_func' ? true : false));
         $lang = $help = '';
     }
     $job_list = $this->apa->list_apas();
     //Add function button
     $beforeclose = "\$('#calc_func').append('<option value=\"func_'+\$('body').data('func_name')+'\">func_'+\$('body').data('func_name')+'<option>');";
     $this->jquery->dialog('edit_function', $this->user->lang('apa_edit_function'), array('url' => "manage_auto_points.php" . $this->SID . "&simple_head=true&edit_func=true", 'width' => '650', 'height' => '600', 'beforeclose' => $beforeclose));
     $this->tpl->add_js("\n\t\t\t\$('#add_func').click(function(){\n\t\t\t\tedit_function();\n\t\t\t});", 'docready');
     //fetch events
     $events_dd = $this->pdh->aget('event', 'name', 0, array($this->pdh->get('event', 'id_list')));
     asort($events_dd);
     //fetch mdkppools
     $pool_dd = $this->pdh->aget('multidkp', 'name', 0, array($this->pdh->get('multidkp', 'id_list')));
     asort($pool_dd);
     $this->tpl->assign_vars(array('HEAD_TEXT' => $this->in->exists('id') ? sprintf($this->user->lang('apa_edit'), "'" . $this->user->lang('apa_of_type') . " " . $this->user->lang('apa_type_' . $type) . "'") : sprintf($this->user->lang('apa_add'), "'" . $this->user->lang('apa_type_' . $type) . "'"), 'HIDDEN_NAME' => $this->in->exists('id') ? 'id' : 'type', 'HIDDEN_VAL' => $this->in->exists('id') ? $this->in->get('id') : $type));
     $this->core->set_vars(array('page_title' => $this->user->lang('apa_manager'), 'template_file' => 'admin/manage_auto_points_edit.html', 'header_format' => $this->simple_head, 'display' => true));
 }
Пример #4
0
    public function edit($messages = false, $name = false)
    {
        // The JavaScript Magic...
        $this->tpl->add_js('
	// Return a helper with preserved width of cells
	var fixHelper = function(e, ui) {
		ui.children().each(function() {
			$(this).width($(this).width());
		});
		return ui;
	};

	$(".sortingtable tbody").sortable({
		helper: fixHelper,
		cancel: \'.not-sortable, .th_add, .td_add\',
	});

	// Delete the row
	$(document).on("click", ".del_me", function(){
		var mydelid		= jQuery.trim($(this).parent().parent().find(".delete_id").text());
		var mypreset	= jQuery.trim($(this).parent().parent().find(".presetname").text());
		$("#dp"+mydelid).removeAttr("disabled");
		$("#button_"+mydelid).removeAttr("disabled");
		$("#dp"+mydelid).append("<option value=\'"+mypreset+"\'>"+mypreset+"</option>");
		var body = $(this).parent().parent().parent();
		$(this).parent().parent().remove();
		if(body.children().length == 1) {
			body.find(".del_me").css("display", "none");
		}
	});	

	$(".add_row_button").click(function() {
		var key = parseInt($(this).attr("id").substr(7));

		//reenable deletion
		$("#table_"+key+" > tbody").find(".del_me").removeAttr("style");
		
		var row = $("#table_"+key+" > tbody > tr:last").clone();
		var prefix		= jQuery.trim($(".prefix_id", row).text());
		var id			= jQuery.trim($(".delete_id", row).text());
		var selected	= jQuery.trim($("#dp"+id).val());
		var name		= jQuery.trim($("#dp"+id+ " :selected").text());
		

		// The name of the field
		$(".presetname", row).empty();
		$(".presetname", row).append(name);

		// The value fields
		$(".sortable", row).attr("name", prefix+"[sortable]["+selected+"]");
		$("label.sortable input", row).attr("name", prefix+"[sortable]["+selected+"]");		
		$(".default_sort", row).val(selected);
		$(".td_add", row).attr("name", prefix+"[td_add]["+selected+"]");
		$(".th_add", row).attr("name", prefix+"[th_add]["+selected+"]");

		// Remove the option in select
		$("#dp"+id+" option[value=\'"+selected+"\']").remove();

		// Disable if no selection available
		if($("#dp"+id+" option").length == 0){
			$("#dp"+id).attr("disabled","disabled");
			$("#button_"+id).attr("disabled","disabled");
		}
		$("#table_"+key+" > tbody > tr:last").after(row);
	});

	$(".sortingtable tr:odd").addClass("row1");
	$(".sortingtable tr:even").addClass("row2");
	$("#lb_columns").change(function(){
		if($(this).val() == "classid") {
			$("#leaderboard_classid").removeAttr("style");
			$("#leaderboard_defaultrole").css("display", "none");
		} else {
			$("#leaderboard_classid").css("display", "none");
			$("#leaderboard_defaultrole").removeAttr("style");
		}
	});', 'docready');
        $layout_name = $name ? $name : $this->in->get('layout');
        if (!$this->pdh->user_layout_exists($layout_name)) {
            $layout_name = $this->pdh->make_editable($layout_name);
        }
        if (!$layout_name) {
            $this->display(array('title' => $this->user->lang('error'), 'text' => $this->user->lang('layout_not_exists'), 'color' => 'red'));
        }
        $this->pdh->auto_update_layout($layout_name);
        $layout_def = $this->pdh->get_eqdkp_layout($layout_name);
        //Tabs
        $this->jquery->Tab_header('plus_pm_pages_tabs');
        //Get all defined pages from current system file
        $pages = $this->pdh->get_page_list();
        $page_id = 1;
        $page_object_id = 1;
        $page_tabs = '';
        $table_sort_dirs['asc'] = $this->user->lang('lm_sort_asc');
        $table_sort_dirs['desc'] = $this->user->lang('lm_sort_desc');
        registry::load('form');
        //general options
        if (is_array($layout_def['options']) && !empty($layout_def['options'])) {
            foreach ($layout_def['options'] as $key => $value) {
                $name = 'params_' . $key;
                $this->tpl->assign_block_vars('param_row', array('NAME' => $value['lang'], 'FIELD' => form::field($name, $value)));
            }
        }
        //substitutions
        if (is_array($layout_def['substitutions']) && !empty($layout_def['substitutions'])) {
            foreach ($layout_def['substitutions'] as $key => $value) {
                $name = 'subs_' . $key;
                $this->tpl->assign_block_vars('subs_row', array('NAME' => $value['lang'], 'FIELD' => form::field($name, $value)));
            }
        }
        //iterate through all pages
        foreach ($pages as $page) {
            $this->tpl->assign_block_vars('page_list', array('ID' => $page_id, 'NAME' => $this->user->lang('lm_page_' . $page, true), 'ADMIN' => strpos($page, 'admin') !== false ? true : false));
            //get page settings
            $page_settings = $layout_def['pages'][$page];
            //default values
            if (!$page_settings) {
                $page_settings = $this->pdh->get_page_settings($page);
            }
            $this->tpl->assign_block_vars('page_row', array('ID' => $page_id, 'S_LEADERBORD' => $page == 'listmembers' ? true : false, 'S_ROSTER' => $page == 'roster' ? true : false));
            //Leaderbord-Settings
            if ($page == 'listmembers') {
                $column_type = isset($page_settings['listmembers_leaderboard']['column_type']) ? $page_settings['listmembers_leaderboard']['column_type'] : 'classid';
                $this->tpl->assign_vars(array('LB_MAXPERCOLUMN' => $page_settings['listmembers_leaderboard']['maxpercolumn'], 'LB_MAXPERROW' => $page_settings['listmembers_leaderboard']['maxperrow'], 'LB_SORTDIR' => new hdropdown('lb_sortdir', array('options' => $table_sort_dirs, 'value' => $page_settings['listmembers_leaderboard']['sort_direction'])), 'LB_COLUMN_DD' => new hdropdown('lb_columns', array('options' => array('classid' => $this->user->lang('class'), 'defaultrole' => $this->user->lang('role')), 'value' => $column_type)), 'LB_POOL_DD' => new hdropdown('lb_default_pool', array('options' => $this->pdh->aget('multidkp', 'name', 0, array($this->pdh->get('multidkp', 'id_list'))), 'value' => $page_settings['listmembers_leaderboard']['default_pool'])), 'CLASSDISPLAY' => $column_type == 'classid' ? '' : 'style="display: none;"', 'ROLEDISPLAY' => $column_type == 'defaultrole' ? '' : 'style="display: none;"'));
                if ($page_settings['listmembers_leaderboard']['column_type'] == 'classid') {
                    $classes = $page_settings['listmembers_leaderboard']['columns'];
                    $roles = $this->pdh->get('roles', 'id_list');
                } else {
                    $classes = array_keys($this->game->get_primary_classes(array('id_0')));
                    $roles = $page_settings['listmembers_leaderboard']['columns'];
                }
                $arrGameClasses = array_keys($this->game->get('classes', 'id_0'));
                $arrDiff = array_diff($arrGameClasses, $classes);
                foreach ($arrDiff as $val) {
                    array_push($classes, $val);
                }
                foreach ($classes as $class) {
                    $this->tpl->assign_block_vars('page_row.class_row', array('CLASS' => $class, 'NAME' => $this->game->decorate('primary', $class) . ' ' . $this->game->get_name('primary', $class)));
                }
                foreach ($roles as $role) {
                    $this->tpl->assign_block_vars('page_row.role_row', array('ROLE' => $role, 'NAME' => $this->game->decorate('roles', $role) . ' ' . $this->pdh->get('roles', 'name', array($role))));
                }
            }
            //Roster-Settings
            if ($page == 'roster') {
                $this->tpl->assign_vars(array('ROSTER_DD' => new hdropdown('roster_classorrole', array('options' => array('class' => $this->user->lang('class'), 'role' => $this->user->lang('role'), 'raidgroup' => $this->user->lang('raidevent_raid_groupsmenu'), 'rank' => $this->user->lang('rank'), 'none' => $this->user->lang('none')), 'value' => $this->config->get('roster_classorrole'))), 'ROSTER_SHOW_TWINKS' => $this->config->get('roster_show_twinks') ? ' checked="checked"' : '', 'ROSTER_SHOW_HIDDEN' => $this->config->get('roster_show_hidden') ? ' checked="checked"' : ''));
            }
            //SK Startlist
            /*
            if ($page == 'listmembers' && ($layout_def['base_layout'] == 'sk' || $layout_def['base_layout'] == 'sk_bottom' || $layout_def['base_layout'] == 'sk_fixed')){
            					
            }
            */
            //iterate through defined objects
            foreach ($page_settings as $page_object => $options) {
                $add_setts = array();
                //for now only show html pdh tag tables (hptt)
                if (substr($page_object, 0, 4) == 'hptt') {
                    $potential_presets = array_keys($this->pdh->get_preset_list($options['table_main_sub'], $options['table_subs'], array_keys($layout_def['subs'])));
                    $pps = array();
                    foreach ($potential_presets as $id => $pset) {
                        $pps[$pset] = $this->pdh->get_preset_description($pset) ? $this->pdh->get_preset_description($pset, true) : $pset;
                    }
                    foreach ($options['table_presets'] as $column_id => $column_options) {
                        $preset = $column_options['name'];
                        unset($pps[$preset]);
                    }
                    if (!isset($options['table_sort_dir'])) {
                        $options['table_sort_dir'] = 'desc';
                    }
                    if (in_array('%dkp_id%', $options['table_subs']) && '%dkp_id%' != $options['table_main_sub']) {
                        $this->init_multipools();
                        if (!isset($options['default_pool'])) {
                            $options['default_pool'] = 0;
                        }
                        if (!isset($options['default_pool_ov'])) {
                            $options['default_pool_ov'] = 1;
                        }
                        $add_setts[] = array('LANG' => $this->user->lang('lm_default_pool'), 'FIELD' => new hdropdown($page . '[' . $page_object . '][default_pool]', array('options' => $this->multi_pools, 'value' => $options['default_pool'])));
                        $arrOvPools = $this->multi_pools;
                        unset($arrOvPools[0]);
                        $add_setts[] = array('LANG' => $this->user->lang('lm_default_pool_ov'), 'FIELD' => new hdropdown($page . '[' . $page_object . '][default_pool_ov]', array('options' => $arrOvPools, 'value' => $options['default_pool_ov'])));
                    }
                    $this->tpl->assign_block_vars('page_row.page_object_row', array('TABLE_TITLE' => $this->user->lang('lm_' . $page_object), 'ID' => $page_object_id, 'NAME' => $page_object, 'DROPDOWN' => new hdropdown('dp' . $page_object_id, array('options' => $pps, 'id' => 'dp' . $page_object_id, 'disabled' => count($pps) == 0 ? true : false)), 'PREFIX' => $page . '[' . $page_object . ']', 'NUMBERS' => new hradio($page . '[' . $page_object . '][numbers]', array('value' => $options['show_numbers'])), 'TABLE_SORT_DIR' => new hdropdown($page . '[' . $page_object . '][table_sort_dir]', array('options' => $table_sort_dirs, 'value' => $options['table_sort_dir'], 'id' => $page . '_' . $page_object . '_sort_dir')), 'DISABLED' => count($pps) == 0 ? 'disabled="disabled"' : '', 'S_ADD_SETTS' => count($add_setts) > 0 ? true : false));
                    foreach ($options['table_presets'] as $column_id => $column_options) {
                        $preset = $column_options['name'];
                        $this->tpl->assign_block_vars('page_row.page_object_row.preset_row', array('NAME' => $this->pdh->get_preset_description($preset) ? $this->pdh->get_preset_description($preset, true) : $preset, 'SORTABLE' => new hradio($page . '[' . $page_object . '][sortable][' . $preset . ']', array('value' => $column_options['sort'], 'class' => 'sortable')), 'CODE' => $preset, 'DEFAULT_SORT' => isset($options['table_sort_col']) && $options['table_sort_col'] == $column_id ? 'checked="checked"' : '', 'TH_ADD' => sanitize($column_options['th_add']), 'TD_ADD' => sanitize($column_options['td_add']), 'ID' => $page_object_id));
                    }
                    if (count($add_setts)) {
                        foreach ($add_setts as $sett) {
                            $this->tpl->assign_block_vars('page_row.page_object_row.add_setts', $sett);
                        }
                    }
                    $page_object_id++;
                }
            }
            $page_id++;
        }
        $this->tpl->assign_vars(array('FILENAME' => $layout_name, 'DESCRIPTION' => $this->pdh->get_eqdkp_layout_description($layout_name)));
        $this->core->set_vars(array('page_title' => $this->user->lang('lm_title'), 'template_file' => 'admin/manage_pagelayouts_edit.html', 'display' => true));
    }
Пример #5
0
    public function get_output()
    {
        $games = array();
        $this->game = registry::register('game', array(true, $this->in->get('inst_lang')));
        //set lang_name in game-class
        foreach ($this->game->get_games() as $sgame) {
            $games[$sgame] = $this->game->game_name($sgame);
        }
        // Build the default language & Locales dropdowns
        if (!$this->def_lang) {
            $this->def_lang = $this->in->get('inst_lang');
        }
        if (!$this->def_game_lang) {
            $this->def_game_lang = $this->in->get('inst_lang');
        }
        if (!$this->def_server_path) {
            $this->def_server_path = str_replace('install/index.php', '', $this->env->phpself);
        }
        if (!$this->def_timezone) {
            $this->def_timezone = date_default_timezone_get();
        }
        if (!$this->def_startday) {
            $this->def_startday = $this->in->get('inst_lang') == 'german' ? 'monday' : 'sunday';
        }
        $langs = sdir($this->root_path . 'language');
        foreach ($langs as $slang) {
            if (!is_file($this->root_path . 'language/' . $slang . '/lang_main.php')) {
                continue;
            }
            include $this->root_path . 'language/' . $slang . '/lang_main.php';
            $lang_name_tp = $lang['ISO_LANG_NAME'] ? $lang['ISO_LANG_NAME'] . ' (' . $lang['ISO_LANG_SHORT'] . ')' : ucfirst($slang);
            $language_array[$slang] = isset($lang['ISO_LANG_NAME']) ? $lang['ISO_LANG_NAME'] : ucfirst($slang);
            $locale_array[$lang['ISO_LANG_SHORT']] = $lang_name_tp;
            if ($slang == $this->def_lang && !$this->def_locale) {
                $this->def_locale = $lang['ISO_LANG_SHORT'];
            }
        }
        $startdays = array('sunday' => $this->lang['sunday'], 'monday' => $this->lang['monday']);
        registry::load('timehandler');
        $content = '<table class="no-borders" style="border-collapse: collapse;" width="100%">
						<tr>
							<th class="" colspan="2">' . $this->lang['lang_config'] . '</th>
						</tr>
						<tr>
							<td align="right"><strong>' . $this->lang['default_lang'] . ':</strong></td>
							<td>' . new hdropdown('default_lang', array('options' => $language_array, 'value' => $this->def_lang)) . '</td>
						</tr>
						<tr>
							<td align="right"><strong>' . $this->lang['default_locale'] . ':</strong></td>
							<td>' . new hdropdown('default_locale', array('options' => $locale_array, 'value' => $this->def_locale)) . '</td>
						</tr>
						<tr>
							<th class="" colspan="2">' . $this->lang['game_config'] . '</th>
						</tr>
						<tr>
							<td colspan="2">
								<div class="infobox infobox-large infobox-blue clearfix">
									<i class="fa fa-info-circle fa-4x pull-left"></i>' . $this->lang['game_info'] . '
								</div>
							</td>
						</tr>
						<tr>
							<td align="right"><strong>' . $this->lang['default_game'] . ':</strong></td>
							<td>' . new hdropdown('game', array('options' => $games, 'value' => $this->def_game)) . ' <select name="game_lang" id="game_lang">' . self::ajax_out(false, $this->def_game) . '</select></td>
						</tr>
						<tr>
							<th class="" colspan="2">' . $this->lang['server_config'] . '</th>
						</tr>
						<tr>
							<td align="right"><strong>' . $this->lang['server_path'] . ':</strong></td>
							<td><input type="text" name="server_path" size="25" value="' . $this->def_server_path . '" class="input" /></td>
						</tr>
						<tr>
							<td align="right"><strong>' . $this->lang['timezone'] . ':</strong></td>
							<td>' . new hdropdown('timezone', array('options' => timehandler::fetch_timezones(), 'value' => $this->def_timezone)) . '</td>
						</tr>
						<tr>
							<td align="right"><strong>' . $this->lang['startday'] . ':</strong></td>
							<td>' . new hdropdown('startday', array('options' => $startdays, 'value' => $this->def_startday)) . '</td>
						</tr>
					</table>';
        return $content;
    }
Пример #6
0
 /**
  * display
  * Display the page
  *
  * @param    array  $messages   Array of Messages to output
  */
 public function display()
 {
     registry::load("form");
     $arrFields = $this->fields();
     $form = register('form', array('ci_import'));
     $form->reset_fields();
     $form->use_fieldsets = true;
     $form->use_dependency = true;
     $form->lang_prefix = 'ci_';
     $form->add_fieldsets($arrFields);
     $arrValues = array();
     $form->output($arrValues);
     // -- EQDKP ---------------------------------------------------------------
     $this->core->set_vars(array('page_title' => $this->user->lang('ci_import'), 'template_path' => $this->pm->get_data('cmsimport', 'template_path'), 'template_file' => 'admin/import_init.html', 'display' => true));
 }
Пример #7
0
 public function display()
 {
     if ($this->config->get('cmsbridge_active') == 1 && !$this->bridge->status) {
         $this->bridge->deactivate_bridge();
         $this->core->message($this->user->lang('bridge_disabled_message'), $this->user->lang('error'), 'red');
     }
     if ($this->config->get('cmsbridge_active') != 1) {
         $this->delete_settings();
     }
     registry::load("form");
     $arrPrefix = $this->get_prefix($this->config->get('cmsbridge_notsamedb'));
     $arrPrefix = array_merge(array('' => ''), $arrPrefix);
     $arrKeys = array_keys($arrPrefix);
     if ($this->in->get('edit') == 'true') {
         $this->core->message($this->user->lang('pk_succ_saved'), $this->user->lang('pk_save_title'), 'green');
     }
     $a_linkMode = array('0' => $this->user->lang('pk_set_link_type_self'), '1' => $this->user->lang('pk_set_link_type_link'), '2' => $this->user->lang('pk_set_link_type_iframe'), '4' => $this->user->lang('pk_set_link_type_D_iframe_womenues'), '5' => $this->user->lang('pk_set_link_type_D_iframe_woblocks'));
     $arrSelectedGroups = $this->config->get('cmsbridge_active') == 1 ? $this->bridge->get_user_groups(true) : array();
     //Bridge Settings
     $settings = $this->bridge->get_settings();
     $form = register('form', array('bridge_settings'));
     if (is_array($settings)) {
         $form->add_fields($settings);
         //Build Settings Array
         foreach ($settings as $name => $confvars) {
             $arrValues[$name] = $this->config->get($name);
         }
         $form->output($arrValues);
     }
     $arrBridges = $this->bridge->get_available_bridges();
     ksort($arrBridges);
     $arrSyncFields = $this->bridge->get_available_sync_fields();
     $this->tpl->assign_vars(array('MS_USERGROUPS' => $this->jquery->MultiSelect('usergroups', $arrSelectedGroups, explode(',', $this->config->get('cmsbridge_groups')), array('height' => 170, 'width' => 300)), 'S_BRIDGE_ACTIVE' => $this->config->get('cmsbridge_active') == 1 ? true : false, 'S_PROFILEFIELDS_INFO' => $this->config->get('cmsbridge_active') == 1 && count($arrSyncFields) ? true : false, 'S_BRIDGE_SETTINGS' => is_array($settings) && count($settings) > 0 ? true : false, 'DD_SYSTEMS' => new hdropdown('cms_type', array('options' => $arrBridges, 'value' => $this->config->get('cmsbridge_type'), 'js' => 'onchange="onchange_type()"')), 'S_SAMEDB' => $this->config->get('cmsbridge_notsamedb') == '0' && $this->config->get('cmsbridge_active') == 1 ? true : false, 'S_NOTSAMEDB' => $this->config->get('cmsbridge_notsamedb') == '1' && $this->config->get('cmsbridge_active') == 1 ? true : false, 'DB_HOST' => $this->crypt->decrypt($this->config->get('cmsbridge_host')) == '' ? $this->dbhost : $this->crypt->decrypt($this->config->get('cmsbridge_host')), 'DB_USER' => $this->crypt->decrypt($this->config->get('cmsbridge_user')) == '' ? $this->dbuser : $this->crypt->decrypt($this->config->get('cmsbridge_user')), 'DB_PW' => $this->crypt->decrypt($this->config->get('cmsbridge_password')) == '' ? '' : $this->crypt->decrypt($this->config->get('cmsbridge_password')), 'DB_DATABASE' => $this->crypt->decrypt($this->config->get('cmsbridge_database')), 'DD_PREFIX' => new hdropdown('db_prefix', array('options' => $arrPrefix, 'value' => $this->config->get('cmsbridge_prefix'), 'js' => 'onchange="onchange_prefix()"')), 'OWN_PREFIX' => !in_array($this->config->get('cmsbridge_prefix'), $arrPrefix) ? $this->config->get('cmsbridge_prefix') : '', 'S_ACTIVATE_MESSAGE' => $this->in->get('activate') == 'true' ? true : false, 'DD_EMBEDD_OPTIONS' => new hdropdown('cms_embedded', array('options' => $a_linkMode, 'value' => $this->config->get('cmsbridge_embedded'))), 'CMS_URL' => $this->config->get('cmsbridge_url'), 'CMS_PWRESET_URL' => $this->config->get('cmsbridge_pwreset_url'), 'CMS_REG_URL' => $this->config->get('cmsbridge_reg_url'), 'S_ONLYCMSUSERLOGIN' => (int) $this->config->get('cmsbridge_onlycmsuserlogin') ? true : false, 'MS_SYNC_USERGROUPS' => $this->jquery->MultiSelect('sync_usergroups', $arrSelectedGroups, explode(',', $this->config->get('cmsbridge_sync_groups')), array('height' => 170, 'width' => 300))));
     $this->core->set_vars(array('page_title' => $this->user->lang('manage_bridge'), 'template_file' => 'admin/manage_bridge.html', 'display' => true));
 }