Function Reference: geodir_admin_fields
Summary
Admin fields
Description
Loops though the geodirectory options array and outputs each field.
Global Values
- $geodirectory
- (object) (required) GeoDirectory plugin object.
- Default: None
- $sitepress
- (object) (required) Sitepress WPML object.
- Default: None
Package
GeoDirectory
Parameters
- $options
- (array) (required) The options array.
- Default: None
Change Log
Since: 1.0.0
Source File
geodir_admin_fields() is located in geodirectory-admin/admin_functions.php [Line: 910]
Source Code
function geodir_admin_fields($options) { global $geodirectory; $first_title = true; $tab_id = ''; $i = 0; foreach ($options as $value) : if (!isset($value['name'])) $value['name'] = ''; if (!isset($value['class'])) $value['class'] = ''; if (!isset($value['css'])) $value['css'] = ''; if (!isset($value['std'])) $value['std'] = ''; $desc = ''; switch ($value['type']) : case 'dummy_installer': $post_type = isset($value['post_type']) ? $value['post_type'] : 'gd_place'; geodir_autoinstall_admin_header($post_type); break; case 'title': if ($i == 0) { echo '
';
}
$i++;
if (isset($value['id']) && $value['id'])
$tab_id = $value['id'];
if (isset($value['desc']) && $value['desc'])
$desc = ':- ' . $value['desc'] . '';
if (isset($value['name']) && $value['name']) {
if ($first_title === true) {
$first_title = false;
} else {
echo '
';
}
echo '';
}
/**
* Called after a GeoDirectory settings title is output in the GD settings page.
*
* The action is called dynamically geodir_settings_$value['id'].
*
* @since 1.0.0
*/
do_action('geodir_settings_' . sanitize_title($value['id']));
break;
case 'no_tabs':
echo '
';
echo '
';
break;
case 'sectionstart':
if (isset($value['desc']) && $value['desc'])
$desc = ' - ' . $value['desc'] . '';
if (isset($value['name']) && $value['name'])
echo '' . "\n\n";
break;
case 'sectionend':
/**
* Called before a GeoDirectory settings sectionend is output in the GD settings page.
*
* The action is called dynamically geodir_settings_$value['id']_end.
*
* @since 1.0.0
*/
if (isset($value['id']) && $value['id']) do_action('geodir_settings_' . sanitize_title($value['id']) . '_end');
echo '
';
/**
* Called after a GeoDirectory settings sectionend is output in the GD settings page.
*
* The action is called dynamically geodir_settings_$value['id']_end.
*
* @since 1.0.0
*/
if (isset($value['id']) && $value['id']) do_action('geodir_settings_' . sanitize_title($value['id']) . '_after');
break;
case 'text':
?>
placeholder=""
style=" "
value=""/>
placeholder=""
style=" "
value=""/>
placeholder=""
style=""
value=""/>
false, 'textarea_rows' => 10);
wp_editor($content, esc_attr($value['id']), $editor_settings);
?>
get_default_language();
$current_lang = $sitepress->get_current_language();
if ($current_lang != 'all' && $current_lang != $default_lang) {
$disabled = "disabled='disabled'";
$switch_lang = $current_lang;
$sitepress->switch_lang('all', true);
}
}
//
$page_setting = (int)get_option($value['id']);
$args = array('name' => $value['id'],
'id' => $value['id'],
'sort_column' => 'menu_order',
'sort_order' => 'ASC',
'show_option_none' => ' ',
'class' => $value['class'],
'echo' => false,
'selected' => $page_setting);
if (isset($value['args'])) $args = wp_parse_args($value['args'], $args);
?>
switch_lang($switch_lang, true);
}
break;
case 'single_select_country' :
$country_setting = (string)get_option($value['id']);
if (strstr($country_setting, ':')) :
$country = current(explode(':', $country_setting));
$state = end(explode(':', $country_setting));
else :
$country = $country_setting;
$state = '*';
endif;
?>
countries->countries;
asort($countries);
$selections = (array)get_option($value['id']);
?>
";
}
?>
' . $value['name'] . $desc . '
'; /** * Called after a GeoDirectory settings sectionstart is output in the GD settings page. * * The action is called dynamically geodir_settings_$value['id']_start. * * @since 1.0.0 */ if (isset($value['id']) && $value['id']) do_action('geodir_settings_' . sanitize_title($value['id']) . '_start'); echo '/> labels->singular_name, 'geodirectory'); ?> |