auth = $auth; $this->config = $config; $this->controller_helper = $controller_helper; $this->db = $db; $this->request = $request; $this->styles_table = $styles_table; } /** * Get an array of disallowed forums * * @param bool $disallow_access Whether the array for disallowing access * should be filled * @return array Array of forums the user is not allowed to access */ public function get_disallowed_forums($disallow_access) { if ($disallow_access == true) { $disallow_access = array_unique(array_keys($this->auth->acl_getf('!f_read', true))); } else { $disallow_access = array(); } return $disallow_access; } /** * Generate select box * * @param string $key Key of select box * @param array $select_ary Array of select box options * @param array $selected_options Array of selected options * @param bool $multiple Whether multiple options should be selectable * * @return string HTML code of select box * @access public */ public function generate_select_box($key, $select_ary, $selected_options, $multiple = false) { // Build options $options = ''; return $options; } /** * Generate forum select box * * @param string $value Value of select box * @param string $key Key of select box * * @return string HTML code of select box * @access public */ public function generate_forum_select($value, $key) { $forum_list = make_forum_select(false, false, true, true, true, false, true); $selected_options = $select_ary = array(); if (isset($this->config[$key]) && strlen($this->config[$key]) > 0) { $selected_options = explode(',', $this->config[$key]); } // Build forum options foreach ($forum_list as $f_id => $f_row) { $select_ary[] = array( 'value' => $f_id, 'title' => $f_row['padding'] . $f_row['forum_name'], 'disabled' => $f_row['disabled'], ); } return $this->generate_select_box($key, $select_ary, $selected_options, true); } /** * Store selected forums * * @param string $key Key name * * @return null * @access public */ public function store_selected_forums($key) { // Get selected extensions $values = $this->request->variable($key, array(0 => '')); $news = implode(',', $values); $this->config->set($key, $news); } /** * Wrapper method for controller_helper::route() * * @param string $route Route name * @param array $params Route parameters * @param bool $is_amp * @param bool $session_id * @param bool $reference_type * * @return string URL for route */ public function route($route, $params = array(), $is_amp = true, $session_id = false, $reference_type = UrlGeneratorInterface::ABSOLUTE_PATH) { return $this->controller_helper->route($route, $params, $is_amp, $session_id, $reference_type); } /** * Display radio buttons for left/right choice * * @param int $value Selected value * @param string $key Key of config variable * * @return string */ public function display_left_right($value, $key) { $radio_ary = array(0 => 'PORTAL_SHOW_ALL_LEFT', 1 => 'PORTAL_SHOW_ALL_RIGHT'); return h_radio($key, $radio_ary, $value, $key); } /** * Store left right choice * * @param string $key Config key */ public function store_left_right($key) { // Get selected side $value = $this->request->variable($key, 0); $this->config->set($key, $value); } /** * Show available styles * * @return string Select with available styles */ public function display_fa_styles(): string { $portal_fa_styles = json_decode($this->config->offsetGet('board3_portal_fa_styles')); if (!$portal_fa_styles) { $portal_fa_styles = []; } $options = ''; $query = 'SELECT style_name FROM ' . $this->styles_table; $result = $this->db->sql_query($query); while ($row = $this->db->sql_fetchrow($result)) { $options .= '