public function allow_sfs($key, $value) { global $user, $config; $radio_ary = array(1 => 'YES', 0 => 'NO'); // Determine if cURL is enabled on the server $curl = false; if (function_exists('curl_init')) { $curl = true; } // if false...display a message $message = $curl === false ? 'LOG_SFS_NEED_CURL' : false; return h_radio('config[allow_sfs]', $radio_ary, $key) . ($message !== false ? '<br /><span class="error">' . $user->lang($message) . '</span>' : ''); }
static function allow_email_login($value, $key) { global $db, $config, $user, $phpbb_container; $not_allowed = false; if (!$config['allow_emailreuse']) { $sql = 'SELECT count(user_email_hash) as cnt FROM ' . USERS_TABLE . ' WHERE user_email_hash > 0 GROUP BY user_email_hash HAVING cnt > 1'; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $not_allowed = $row; $helper = $phpbb_container->get('controller.helper'); $message = $row ? $user->lang('DUP_RECORDS', $helper->route('forumhulp_loginwithemail_controller')) : ''; } else { $not_allowed = true; $message = $user->lang['ALLOW_EMAIL_LOGIN']; } $radio_ary = array(1 => 'YES', 0 => 'NO'); return str_replace('value="1"', 'value="1"' . ($not_allowed ? 'disabled' : ''), h_radio('config[allow_email_login]', $radio_ary, $not_allowed ? 0 : $value) . ($not_allowed ? $message : '')); }
/** * @dataProvider h_radio_data */ public function test_h_radio($name, $input_ary, $input_default, $id, $key, $expected) { $this->assertEquals($expected, h_radio($name, $input_ary, $input_default, $id, $key)); }
/** * 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); }
/** * Write secure_allow_deny config field */ function select_allow_deny($value, $key = '') { $radio_ary = array(1 => 'ORDER_ALLOW_DENY', 0 => 'ORDER_DENY_ALLOW'); return h_radio('config[' . $key . ']', $radio_ary, $value, $key); }
/** * Global quick reply enable/disable setting and button to enable in all forums */ function quick_reply($value, $key) { global $user; $radio_ary = array(1 => 'YES', 0 => 'NO'); return h_radio('config[allow_quick_reply]', $radio_ary, $value) . '<br /><br /><input class="button2" type="submit" id="' . $key . '_enable" name="' . $key . '_enable" value="' . $user->lang['ALLOW_QUICK_REPLY_BUTTON'] . '" />'; }
/** * Option to enable/disable removal of 'app.php' from URLs * * Note that if mod_rewrite is on, URLs without app.php will still work, * but any paths generated by the controller helper url() method will not * contain app.php. * * @param int $value The current config value * @param string $key The config key * @return string The HTML for the form field */ function enable_mod_rewrite($value, $key) { global $user, $config; // Determine whether mod_rewrite is enabled on the server // NOTE: This only works on Apache servers on which PHP is NOT // installed as CGI. In that case, there is no way for PHP to // determine whether or not the Apache module is enabled. // // To be clear on the value of $mod_rewite: // null = Cannot determine whether or not the server has mod_rewrite // enabled // false = Can determine that the server does NOT have mod_rewrite // enabled // true = Can determine that the server DOES have mod_rewrite_enabled $mod_rewrite = null; if (function_exists('apache_get_modules')) { $mod_rewrite = (bool) in_array('mod_rewrite', apache_get_modules()); } // If $message is false, mod_rewrite is enabled. // Otherwise, it is not and we need to: // 1) disable the form field // 2) make sure the config value is set to 0 // 3) append the message to the return $value = $mod_rewrite === false ? 0 : $value; $message = $mod_rewrite === null ? 'MOD_REWRITE_INFORMATION_UNAVAILABLE' : ($mod_rewrite === false ? 'MOD_REWRITE_DISABLED' : false); // Let's do some friendly HTML injection if we want to disable the // form field because h_radio() has no pretty way of doing so $field_name = 'config[enable_mod_rewrite]' . ($message === 'MOD_REWRITE_DISABLED' ? '" disabled="disabled' : ''); return h_radio($field_name, array(1 => 'YES', 0 => 'NO'), $value) . ($message !== false ? '<br /><span>' . $user->lang($message) . '</span>' : ''); }
/** * Board disable option and message */ function board_disable($value, $key) { global $user; $radio_ary = array(1 => 'YES', 0 => 'NO'); return h_radio('config[board_disable]', $radio_ary, $value) . '<br /><input id="' . $key . '" type="text" name="config[board_disable_msg]" maxlength="255" size="40" value="' . $this->new_config['board_disable_msg'] . '" />'; }
/** * Select add item button placement method */ function select_add_button_pos($value, $key = '') { global $user, $config; $radio_ary = array(1 => 'ADD_BUTTON_BEFORE', 2 => 'ADD_BUTTON_AFTER', 3 => 'ADD_BUTTON_COL'); return h_radio('config[favorites_add_button_pos]', $radio_ary, $value, $key); }
/** * Global quick edit enable/disable setting and button to enable in all forums * * @param bool $value Value of quickedit settings. 1 if enabled, 0 if disabled * @param string $key The key of the setting * @return string HTML for quickedit settings * @access public */ public static function quickedit_settings($value, $key) { // Called statically so can't use $this->user global $user; $user->add_lang_ext('marc/quickedit', 'quickedit_acp'); $radio_ary = array(1 => 'YES', 0 => 'NO'); return h_radio('config[allow_quick_edit]', $radio_ary, $value) . '<br /><br /><input class="button2" type="submit" id="' . $key . '_enable" name="' . $key . '_enable" value="' . $user->lang('ALLOW_QUICK_EDIT_BUTTON') . '" />'; }
/** * */ function select_featured_vehicle($value, $key = '') { global $user, $config; $radio_ary = array('0' => 'DISABLED', '1' => 'BY_VEHICLE_ID', '2' => 'RANDOM', '4' => 'FROM_BLOCK'); return h_radio('config[enable_featured_vehicle]', $radio_ary, $value, $key); }
function select_eveapi_portrait_size($value, $key = '') { global $user, $config; $radio_ary = array(64 => 'EVEAPI_PORTRAIT_SMALL', 128 => 'EVEAPI_PORTRAIT_MEDIUM', 256 => 'EVEAPI_PORTRAIT_LARGE'); return h_radio('config[eveapi_portrait_size]', $radio_ary, $value, $key); }
/** * Select ip validation * duplicated from includes/acp/acp_board.php */ function select_ip_check($value, $key = '') { $radio_ary = array(4 => 'ALL', 3 => 'CLASS_C', 2 => 'CLASS_B', 0 => 'NO_IP_VALIDATION'); return h_radio('config[ip_check]', $radio_ary, $value, $key); }
/** * Select toplist direction */ function toplist_direction($value, $key) { $radio_ary = array(0 => 'RS_TL_HORIZONTAL', 1 => 'RS_TL_VERTICAL'); $radio_text = h_radio('config[rs_toplist_direction]', $radio_ary, $value, 'rs_toplist_direction', $key); return $radio_text; }
/** * Select default syndication method */ function select_syndication_default($value, $key = '') { global $user, $config; $radio_ary = array(SYNDICATION_ATOM => 'SYNDICATION_ATOM', SYNDICATION_RSS2 => 'SYNDICATION_RSS2'); return h_radio('config[syndication_default]', $radio_ary, $value, $key); }