Procházet zdrojové kódy

Don't forget to add the order on the cust fields list

Signed-off-by: Suki <[email protected]>
Suki před 10 roky
rodič
revize
18ab9efaf9

+ 21 - 3
Sources/ManageSettings.php

@@ -1237,7 +1237,7 @@ function ShowCustomProfiles()
 		'id' => 'custom_profile_fields',
 		'title' => $txt['custom_profile_title'],
 		'base_href' => $scripturl . '?action=admin;area=featuresettings;sa=profile',
-		'default_sort_col' => 'field_name',
+		'default_sort_col' => 'field_order',
 		'no_items_label' => $txt['custom_profile_none'],
 		'items_per_page' => 25,
 		'get_items' => array(
@@ -1250,6 +1250,23 @@ function ShowCustomProfiles()
 			'function' => 'list_getProfileFieldSize',
 		),
 		'columns' => array(
+			'field_order' => array(
+				'header' => array(
+					'value' => $txt['custom_profile_fieldorder'],
+				),
+				'data' => array(
+					'function' => create_function('$rowData', '
+						global $scripturl;
+
+						return $rowData[\'field_order\'];
+					'),
+					'style' => 'width: 12%;',
+				),
+				'sort' => array(
+					'default' => 'field_order',
+					'reverse' => 'field_order DESC',
+				),
+			),
 			'field_name' => array(
 				'header' => array(
 					'value' => $txt['custom_profile_fieldname'],
@@ -1387,7 +1404,7 @@ function list_getProfileFields($start, $items_per_page, $sort, $standardFields)
 	{
 		// Load all the fields.
 		$request = $smcFunc['db_query']('', '
-			SELECT id_field, col_name, field_name, field_desc, field_type, active, placement
+			SELECT id_field, col_name, field_name, field_desc, field_type, field_order, active, placement
 			FROM {db_prefix}custom_fields
 			ORDER BY {raw:sort}
 			LIMIT {int:start}, {int:items_per_page}',
@@ -1447,7 +1464,8 @@ function EditCustomProfiles()
 		$result = $smcFunc['db_query']('', '
 				SELECT
 					id_field, col_name, field_name, field_order
-				FROM {db_prefix}custom_fields',
+				FROM {db_prefix}custom_fields
+				ORDER BY field_order ASC',
 				array(
 					'current_field' => $context['fid'],
 				)

+ 1 - 0
Themes/default/languages/ManageSettings.english.php

@@ -212,6 +212,7 @@ $txt['custom_profile_desc'] = 'From this page you can create your own custom pro
 $txt['custom_profile_active'] = 'Active';
 $txt['custom_profile_fieldname'] = 'Field Name';
 $txt['custom_profile_fieldtype'] = 'Field Type';
+$txt['custom_profile_fieldorder'] = 'Field Order';
 $txt['custom_profile_make_new'] = 'New Field';
 $txt['custom_profile_none'] = 'You have not created any custom profile fields yet!';
 $txt['custom_profile_icon'] = 'Icon';