Location: PHPKode > projects > Redaxscript > includes/admin/settings.php
<?php

/* admin settings form */

function admin_settings_form()
{
	hook(__FUNCTION__ . '_start');
	$output = '<h2 class="title_content">' . l('settings') . '</h2>';
	$output .= form_element('form', 'form_settings', 'js_check_required js_note_required js_accordion form_admin accordion', '', '', '', 'action="' . REWRITE_STRING . 'admin/update/settings" method="post"');

	/* collect general set */

	$output .= '<fieldset class="js_set_accordion js_set_accordion_active set_accordion set_accordion_active">';
	$output .= '<legend class="js_title_accordion js_title_accordion_active title_accordion title_accordion_active">' . l('general') . '</legend>';
	$output .= '<ul class="js_box_accordion box_accordion">';

	/* build languages select */

	$language_directory = read_directory('languages', 'misc.php');
	if (count($language_directory) > 1)
	{
		$language_array[l('detect')] = 'detect';
	}
	foreach ($language_directory as $value)
	{
		$value = substr($value, 0, 2);
		$language_array[l($value)] = $value;
	}
	$output .= '<li>' . select_element('language', 'field_select', 'language', $language_array, s('language'), l('language')) . '</li>';

	/* build templates select */

	$templates_directory = read_directory('templates', 'admin');
	$output .= '<li>' . select_element('template', 'field_select', 'template', $templates_directory, s('template'), l('template')) . '</li>';
	$output .= '</ul></fieldset>';

	/* collect metadata set */

	$output .= '<fieldset class="js_set_accordion set_accordion">';
	$output .= '<legend class="js_title_accordion title_accordion">' . l('metadata') . '</legend>';
	$output .= '<ul class="js_box_accordion box_accordion">';
	$output .= '<li>' . form_element('text', 'title', 'field_text', 'title', s('title'), l('title'), 'maxlength="50"') . '</li>';
	$output .= '<li>' . form_element('text', 'author', 'field_text', 'author', s('author'), l('author'), 'maxlength="50"') . '</li>';
	$output .= '<li>' . form_element('text', 'copyright', 'field_text', 'copyright', s('copyright'), l('copyright'), 'maxlength="50"') . '</li>';
	$output .= '<li>' . form_element('textarea', 'description', 'js_auto_resize field_textarea_small', 'description', s('description'), l('description'), 'rows="1" cols="15"') . '</li>';
	$output .= '<li>' . form_element('textarea', 'keywords', 'js_auto_resize field_textarea_small', 'keywords', s('keywords'), l('keywords'), 'rows="1" cols="15"') . '</li>';
	$output .= '<li>' . select_element('robots', 'field_select', 'robots', array(
		l('index') => 'all',
		l('index_no') => 'none'
	), s('robots'), l('robots')) . '</li>';
	$output .= '</ul></fieldset>';

	/* collect contact set */

	$output .= '<fieldset class="js_set_accordion set_accordion">';
	$output .= '<legend class="js_title_accordion title_accordion">' . l('contact') . '</legend>';
	$output .= '<ul class="js_box_accordion box_accordion">';
	$output .= '<li>' . form_element('email', 'email', 'js_required field_text field_required', 'email', s('email'), l('email'), 'maxlength="50" required="required"') . '</li>';
	$output .= '<li>' . form_element('text', 'subject', 'field_text', 'subject', s('subject'), l('subject'), 'maxlength="50"') . '</li>';
	$output .= '<li>' . select_element('notification', 'field_select', 'notification', array(
		l('enable') => 1,
		l('disable') => 0
	), s('notification'), l('notification')) . '</li>';
	$output .= '</ul></fieldset>';

	/* collect formatting set */

	$output .= '<fieldset class="js_set_accordion set_accordion">';
	$output .= '<legend class="js_title_accordion title_accordion">' . l('formatting') . '</legend>';
	$output .= '<ul class="js_box_accordion box_accordion">';
	$output .= '<li>' . form_element('text', 'charset', 'js_required field_text field_required', 'charset', s('charset'), l('charset'), 'maxlength="10" required="required"') . '</li>';
	$output .= '<li>' . form_element('text', 'divider', 'field_text', 'divider', s('divider'), l('divider'), 'maxlength="10"') . '</li>';
	$output .= '<li>' . select_element('time', 'field_select', 'time', array(
		'H:i',
		'h:i'
	), s('time'), l('time')) . '</li>';
	$output .= '<li>' . select_element('date', 'field_select', 'date', array(
		'd.m.Y',
		'm.d.Y',
		'Y.d.m'
	), s('date'), l('date')) . '</li>';
	$output .= '</ul></fieldset>';

	/* collect contents set */

	$output .= '<fieldset class="js_set_accordion set_accordion">';
	$output .= '<legend class="js_title_accordion title_accordion">' . l('contents') . '</legend>';
	$output .= '<ul class="js_box_accordion box_accordion">';
	$homepage_array[l('none')] = 0;
	$homepage_query = 'SELECT id, title FROM ' . PREFIX . 'articles ORDER BY rank ASC';
	$homepage_result = mysql_query($homepage_query);
	if ($homepage_result)
	{
		while ($r = mysql_fetch_assoc($homepage_result))
		{
			$homepage_array[$r['title']] = $r['id'];
		}
	}
	$output .= '<li>' . select_element('homepage', 'field_select', 'homepage', $homepage_array, s('homepage'), l('homepage')) . '</li>';
	$output .= '<li>' . form_element('text', 'limit', 'js_required field_text field_required', 'limit', s('limit'), l('limit'), 'maxlength="2" required="required"') . '</li>';
	$output .= '<li>' . select_element('order', 'field_select', 'order', array(
		l('ascending') => 'asc',
		l('descending') => 'desc'
	), s('order'), l('order')) . '</li>';
	$output .= '<li>' . select_element('paginator', 'field_select', 'paginator', array(
		l('enable') => 1,
		l('disable') => 0
	), s('paginator'), l('paginator')) . '</li>';
	$output .= '</ul></fieldset>';

	/* collect comments set */

	$output .= '<fieldset class="js_set_accordion set_accordion">';
	$output .= '<legend class="js_title_accordion title_accordion">' . l('comments') . '</legend>';
	$output .= '<ul class="js_box_accordion box_accordion">';
	$output .= '<li>' . select_element('moderation', 'field_select', 'moderation', array(
		l('enable') => 1,
		l('disable') => 0
	), s('moderation'), l('moderation')) . '</li>';
	$output .= '</ul></fieldset>';

	/* collect users set */

	$output .= '<fieldset class="js_set_accordion set_accordion">';
	$output .= '<legend class="js_title_accordion title_accordion">' . l('users') . '</legend>';
	$output .= '<ul class="js_box_accordion box_accordion">';
	$output .= '<li>' . select_element('registration', 'field_select', 'registration', array(
		l('enable') => 1,
		l('disable') => 0
	), s('registration'), l('registration')) . '</li>';
	$output .= '<li>' . select_element('verification', 'field_select', 'verification', array(
		l('enable') => 1,
		l('disable') => 0
	), s('verification'), l('verification')) . '</li>';
	$output .= '<li>' . select_element('reminder', 'field_select', 'reminder', array(
		l('enable') => 1,
		l('disable') => 0
	), s('reminder'), l('reminder')) . '</li>';
	$output .= '</ul></fieldset>';

	/* collect security set */

	$output .= '<fieldset class="js_set_accordion js_set_accordion_last set_accordion set_accordion_last">';
	$output .= '<legend class="js_title_accordion title_accordion">' . l('security') . '</legend>';
	$output .= '<ul class="js_box_accordion box_accordion">';
	$output .= '<li>' . select_element('captcha', 'field_select', 'captcha', array(
		l('random') => 1,
		l('addition') => 2,
		l('subtraction') => 3,
		l('disable') => 0
	), s('captcha'), l('captcha')) . '</li>';
	$output .= '<li>' . select_element('blocker', 'field_select', 'blocker', array(
		l('enable') => 1,
		l('disable') => 0
	), s('blocker'), l('blocker')) . '</li>';
	$output .= '</ul></fieldset>';

	/* collect premature output */

	$output .= form_element('hidden', '', '', 'token', TOKEN);

	/* cancel button */

	$output .= '<a class="field_button_large field_button_backward" href="' . REWRITE_STRING . 'admin"><span><span>' . l('cancel') . '</span></span></a>';

	/* submit button */

	$output .= form_element('button', '', 'js_submit field_button_large field_button_forward', 'update', l('save'));
	$output .= '</form>';
	echo $output;
	hook(__FUNCTION__ . '_end');
}
?>
Return current item: Redaxscript