public function display($messages = array()) { if ($messages) { foreach ($messages as $title => $message) { $type = ($title == 'rli_error' or $title == 'rli_no_mem_create') ? 'red' : 'green'; if (is_array($message)) { $message = implode(',<br />', $message); } $this->core->message($message, $this->user->lang($title) . ':', $type); } } $this->tpl->assign_vars(array('L_DATA_SOURCE' => $this->user->lang('rli_data_source'), 'L_CONTINUE_OLD' => $this->user->lang('rli_continue_old'), 'L_INSERT' => $this->user->lang('rli_dkp_insert'), 'L_SEND' => $this->user->lang('rli_send'), 'DISABLED' => $this->rli->data_available() ? '' : 'disabled="disabled"', 'PARSER_DD' => new hdropdown('parser', array('options' => getAvailableParsers(), 'value' => $this->rli->config('parser'))), 'S_STEP1' => true)); $this->tpl->add_js("\$('#show_log_form').click(function() {\$('#log_form').show(200)});", 'docready'); $this->core->set_vars(array('page_title' => $this->user->lang('rli_data_source'), 'template_path' => $this->pm->get_data('raidlogimport', 'template_path'), 'template_file' => 'log_insert.html', 'display' => true)); }
public function display($messages = array()) { if ($messages) { $this->rli->__construct(); foreach ($messages as $name) { $this->core->message($name, $this->user->lang('rli_save_suc'), 'green'); } } // select ranks $new_member_rank = $this->pdh->aget('rank', 'name', 0, array($this->pdh->get('rank', 'id_list'))); $parser = getAvailableParsers(); // select raidcount $raidcount = array(); for ($i = 0; $i <= 3; $i++) { $raidcount[$i] = $this->user->lang('raidcount_' . $i); } // select null_sum & standbyraidoptions $standby_raid = array(); for ($i = 0; $i <= 2; $i++) { $standby_raid[$i] = $this->user->lang('standby_raid_' . $i); } // select member_start_event $member_start_event = $this->pdh->aget('event', 'name', 0, array($this->pdh->get('event', 'id_list'))); // select member_display $member_display = array(0 => $this->user->lang('member_display_0'), 1 => $this->user->lang('member_display_1'), 2 => $this->user->lang('member_display_2')); // select raid_note_time $raid_note_time = array(0 => $this->user->lang('raid_note_time_0'), 1 => $this->user->lang('raid_note_time_1')); $k = 2; $holder = array(); foreach ($this->configs as $display_type => $hold) { foreach ($hold as $holde => $names) { foreach ($names as $name) { switch ($display_type) { case 'select': $holder[$holde][$k]['value'] = new hdropdown($name, array('options' => ${$name}, 'value' => $this->rli->config($name))); $holder[$holde][$k]['name'] = $name; break; case 'yes_no': $a = $k; $check_1 = ''; $check_0 = ''; if ($this->rli->config($name)) { $check_1 = "checked='checked'"; } else { $check_0 = "checked='checked'"; } $holder[$holde][$k]['value'] = "<input type='radio' name='" . $name . "' value='1' " . $check_1 . " />" . $this->user->lang('yes') . " "; $holder[$holde][$k]['value'] .= " <input type='radio' name='" . $name . "' value='0' " . $check_0 . " />" . $this->user->lang('no'); $holder[$holde][$k]['name'] = $name; $k = $a; break; case 'normal': $a = $k; if ($name == 'rli_inst_version') { $k = 0; $holder[$holde][$k]['value'] = $this->pm->get_data('raidlogimport', 'version'); } else { $holder[$holde][$k]['value'] = $this->rli->config($name); } $holder[$holde][$k]['name'] = $name; $k = $a; break; case 'text': $holder[$holde][$k]['value'] = "<input type='text' name='" . $name . "' value='" . $this->rli->config($name) . "' class='maininput' />"; $holder[$holde][$k]['name'] = $name; break; case 'special': list($num_of_opt, $name) = explode(':', $name); $value = $this->rli->config($name); $pv = array(0, 1, 2, 4, 8, 16, 32); $holder[$holde][$k]['value'] = ''; for ($i = 1; $i <= $num_of_opt; $i++) { $checked = $value & $pv[$i] ? 'checked="checked"' : ''; $holder[$holde][$k]['value'] .= "<span class='nowrap'><input type='checkbox' name='" . $name . "[]' value='" . $pv[$i] . "' " . $checked . " />" . $this->user->lang($name . '_' . $pv[$i]) . "</span> "; } $holder[$holde][$k]['name'] = $name; break; default: //do nothing break; } $k++; } } } $num = 1; foreach ($holder as $type => $hold) { ksort($hold); if ($type == 'difficulty' and $this->config->get('default_game') != 'wow') { continue; } $this->tpl->assign_block_vars('holder', array('TITLE' => $this->user->lang('title_' . $type), 'NUM' => $num)); $num++; foreach ($hold as $nava) { $add = $this->user->lang($nava['name'] . '_help', false, false) ? $this->user->lang($nava['name'] . '_help') : ''; if ($nava['name'] == 'member_display') { if (extension_loaded('gd')) { $info = gd_info(); $add = sprintf($add, '<span class=\'positive\'>' . $info['GD Version'] . '</span>'); } else { $add = sprintf($add, $this->user->lang('no_gd_lib')); } } if ($this->user->lang($nava['name'] . '_warn', false, false)) { $warn = $this->user->lang($nava['name'] . '_warn'); } else { $warn = ''; } if ($warn != '') { $warn = '<i class="fa fa-exclamation-triangle"></i> ' . $warn; } $this->tpl->assign_block_vars('holder.config', array('NAME' => $this->user->lang($nava['name']), 'HELP' => $add . $warn, 'VALUE' => $nava['value'])); } } $this->tpl->assign_vars(array('L_CONFIG' => $this->user->lang('raidlogimport') . ' ' . $this->user->lang('settings'), 'TAB_JS' => $this->jquery->Tab_header('rli_config'))); $this->core->set_vars(array('page_title' => sprintf($this->user->lang('admin_title_prefix'), $this->config->get('guildtag'), $this->config->get('dkp_name')) . ': ' . $this->user->lang('configuration'), 'template_path' => $this->pm->get_data('raidlogimport', 'template_path'), 'template_file' => 'settings.html', 'display' => true)); }