1<?php
2// (c) Copyright by authors of the Tiki Wiki CMS Groupware Project
3//
4// All Rights Reserved. See copyright.txt for details and a complete list of authors.
5// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
6// $Id$
7
8function prefs_art_list()
9{
10	$article_sort_orders = [
11		'publishDate_desc' => tra('Newest first'),
12	];
13
14	$prefslib = TikiLib::lib('prefs');
15	$advanced_columns = $prefslib->getExtraSortColumns();
16
17	foreach ($advanced_columns as $key => $label) {
18		$article_sort_orders[ $key . '_asc' ] = $label . ' ' . tr('ascending');
19		$article_sort_orders[ $key . '_desc' ] = $label . ' ' . tr('descending');
20	}
21
22	return [
23		'art_sort_mode' => [
24			'name' => tra('Article order'),
25			'description' => tra('Default sort mode for the articles on the list-articles page'),
26			'type' => 'list',
27			'options' => $article_sort_orders,
28			'default' => 'publishDate_desc',
29		],
30		'art_home_title' => [
31			'name' => tra('Title of articles homepage'),
32			'type' => 'list',
33			'description' => tr('Select the default title for the page that displays all articles.'),
34			'options' => [
35				'' => '',
36				'topic' => tra('Topic'),
37				'type' => tra('Type'),
38				'articles' => tra('Articles'),
39			],
40			'default' => '',
41		],
42		'art_list_title' => [
43			'name' => tra('Title'),
44			'type' => 'flag',
45			'default' => 'y',
46		],
47		'art_list_title_len' => [
48			'name' => tra('Title length'),
49			'units' => tra('characters'),
50			'type' => 'text',
51			'size' => '5',
52			'filter' => 'digits',
53			'default' => '50',
54		],
55		'art_list_type' => [
56			'name' => tra('Type'),
57			'type' => 'flag',
58			'default' => 'y',
59		],
60		'art_list_topic' => [
61			'name' => tra('Topic'),
62			'type' => 'flag',
63			'default' => 'y',
64		],
65		'art_list_date' => [
66			'name' => tra('Publication date'),
67			'type' => 'flag',
68			'default' => 'y',
69		],
70		'art_list_expire' => [
71			'name' => tra('Expiration date'),
72			'type' => 'flag',
73			'default' => 'n',
74		],
75		'art_list_visible' => [
76			'name' => tra('Visible'),
77			'type' => 'flag',
78			'default' => 'n',
79		],
80		'art_list_lang' => [
81			'name' => tra('Language'),
82			'type' => 'flag',
83			'default' => 'n',
84		],
85		'art_list_author' => [
86			'name' => tra('Author (owner)'),
87			'type' => 'flag',
88			'default' => 'y',
89		],
90		'art_list_authorName' => [
91			'name' => tra('Author name (as displayed)'),
92			'type' => 'flag',
93			'default' => 'n',
94		],
95		'art_list_rating' => [
96			'name' => tra('Author rating'),
97			'type' => 'flag',
98			'default' => 'n',
99		],
100		'art_list_usersRating' => [
101			'name' => tra('Users rating'),
102			'type' => 'flag',
103			'default' => 'n',
104		],
105		'art_list_reads' => [
106			'name' => tra('Reads'),
107			'type' => 'flag',
108			'default' => 'y',
109			'dependencies' => [
110				'feature_stats',
111			],
112		],
113		'art_list_size' => [
114			'name' => tra('Size'),
115			'type' => 'flag',
116			'default' => 'y',
117		],
118		'art_list_img' => [
119			'name' => tra('Images'),
120			'type' => 'flag',
121			'default' => 'n',
122		],
123		'art_list_id' => [
124			'name' => tra('Id'),
125			'type' => 'flag',
126			'default' => 'y',
127		],
128		'art_list_ispublished' => [
129			'name' => tra('Is published'),
130			'type' => 'flag',
131			'default' => 'y',
132		],
133		'art_trailer_pos' => [
134			'name' => tra('Trailer position'),
135			'type' => 'list',
136			'options' => [
137				'top' => tra('Top'),
138				'between' => tra('Between heading and body'),
139			],
140			'default' => 'top',
141		],
142		'art_header_text_pos' => [
143			'name' => tra('Header text position'),
144			'description' => tra('Header text position') . tra('Requires a smaller image for list view'),
145			'type' => 'list',
146			'options' => [
147				'next' => tra('Next to image'),
148				'below' => tra('Below image'),
149			],
150			'default' => 'next'
151		],
152
153	];
154}
155