tiki-listpages_content.tpl 13.3 KB
Newer Older
1 2
{* $Id$ *}

pkdille's avatar
pkdille committed
3 4 5
{if $cant_pages > 1 or $initial or $find}
	{initials_filter_links}
{/if}
6 7

{if $tiki_p_remove eq 'y' or $prefs.feature_wiki_multiprint eq 'y'}
sylvieg's avatar
sylvieg committed
8 9 10 11 12
	{if $checkboxes_on eq 'n'}
		{assign var='checkboxes_on' value='n'}
	{else}
		{assign var='checkboxes_on' value='y'}
	{/if}
13
{else}
pkdille's avatar
pkdille committed
14
	{assign var='checkboxes_on' value='n'}
15 16
{/if}

pkdille's avatar
pkdille committed
17
{if $find ne '' and $listpages|@count ne '0'}
chealer's avatar
chealer committed
18
	<p>{tr}Found{/tr} &quot;{$find|escape}&quot; {tr}in{/tr} {$listpages|@count} {tr}pages{/tr}.</p>
19 20 21
{/if}


22
{if $checkboxes_on eq 'y'}
pkdille's avatar
pkdille committed
23
	<form name="checkboxes_on" method="post" action="{$smarty.server.PHP_SELF}">
24
{/if}
25 26

{assign var='pagefound' value='n'}
pkdille's avatar
pkdille committed
27

28
<table class="normal">
pkdille's avatar
pkdille committed
29 30 31
	<tr>
		{if $checkboxes_on eq 'y' && count($listpages) > 0}
			<th>
32
				{select_all checkbox_names='checked[]'}
pkdille's avatar
pkdille committed
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
			</th>
			{assign var='cntcol' value='1'}
		{else}
			{assign var='cntcol' value='0'}
		{/if}

		{if $prefs.wiki_list_id eq 'y'}
			{assign var='cntcol' value=$cntcol+1}
			<th>
				{self_link _sort_arg='sort_mode' _sort_field='page_id'}{tr}Id{/tr}{/self_link}
			</th>
		{/if}

		{if $prefs.wiki_list_name eq 'y'}
			{assign var='cntcol' value=$cntcol+1}
			<th>
				{self_link _sort_arg='sort_mode' _sort_field='pageName'}{tr}Page{/tr}{/self_link}
			</th>
		{/if}

		{foreach from=$wplp_used key=lc item=ln}
			<th>{$ln|escape}</th>
		{/foreach}

		{if $prefs.wiki_list_hits eq 'y'}
			{assign var='cntcol' value=$cntcol+1}
changi67's avatar
changi67 committed
59
			<th>{self_link _sort_arg='sort_mode' _sort_field='hits'}{tr}Hits{/tr}{/self_link}</th>
pkdille's avatar
pkdille committed
60 61 62 63 64 65
		{/if}

		{if $prefs.wiki_list_lastmodif eq 'y' or $prefs.wiki_list_comment eq 'y'}
			{assign var='cntcol' value=$cntcol+1}
			<th>
				{assign var='lastmod_sortfield' value='lastModif'}
66
				{assign var='lastmod_shorttitle' value="{tr}Last mod{/tr}"}
pkdille's avatar
pkdille committed
67
				{if $prefs.wiki_list_lastmodif eq 'y' and $prefs.wiki_list_comment eq 'y'}
68
					{assign var='lastmod_title' value="{tr}Last modification{/tr} / {tr}Comment{/tr}"}
pkdille's avatar
pkdille committed
69
				{elseif $prefs.wiki_list_lastmodif eq 'y'}
70
					{assign var='lastmod_title' value="{tr}Last modification{/tr}"}
pkdille's avatar
pkdille committed
71
				{else}
72
					{assign var='lastmod_title' value="{tr}Comment{/tr}"}
pkdille's avatar
pkdille committed
73
					{assign var='lastmod_sortfield' value='comment'}
74
					{assign var='lastmod_shorttitle' value="{tr}Comment{/tr}"}
pkdille's avatar
pkdille committed
75 76 77 78 79 80 81 82
				{/if}
				{self_link _sort_arg='sort_mode' _sort_field=$lastmod_sortfield _title=$lastmod_title}{$lastmod_shorttitle}{/self_link}
			</th>
		{/if}

		{if $prefs.wiki_list_creator eq 'y'}
			{assign var='cntcol' value=$cntcol+1}
			<th>
83
				{self_link _sort_arg='sort_mode' _sort_field='creator' _title="{tr}Page creator{/tr}"}{tr}Creator{/tr}{/self_link}
pkdille's avatar
pkdille committed
84 85 86 87 88 89
			</th>
		{/if}

		{if $prefs.wiki_list_user eq 'y'}
			{assign var='cntcol' value=$cntcol+1}
			<th>
90
				{self_link _sort_arg='sort_mode' _sort_field='user' _title="{tr}Last author{/tr}"}{tr}Last author{/tr}{/self_link}
pkdille's avatar
pkdille committed
91 92 93 94 95 96
			</th>
		{/if}

		{if $prefs.wiki_list_lastver eq 'y'}
			{assign var='cntcol' value=$cntcol+1}
			<th>
97
				{self_link _sort_arg='sort_mode' _sort_field='version' _title="{tr}Last version{/tr}"}{tr}Last ver.{/tr}{/self_link}
pkdille's avatar
pkdille committed
98 99 100 101 102 103 104 105 106 107 108 109 110
			</th>
		{/if}

		{if $prefs.wiki_list_status eq 'y'}
			{assign var='cntcol' value=$cntcol+1}
			<th style="text-align:center;">
				{self_link _sort_arg='sort_mode' _sort_field='flag' _icon='lock_gray'}{tr}Status of the page{/tr}{/self_link}
			</th>
		{/if}

		{if $prefs.wiki_list_versions eq 'y'}
			{assign var='cntcol' value=$cntcol+1}
			<th>
111
				{self_link _sort_arg='sort_mode' _sort_field='versions' _title="{tr}Versions{/tr}"}{tr}Vers.{/tr}{/self_link}
pkdille's avatar
pkdille committed
112 113 114 115 116 117
			</th>
		{/if}

		{if $prefs.wiki_list_links eq 'y'}
			{assign var='cntcol' value=$cntcol+1}
			<th>
118
				{self_link _sort_arg='sort_mode' _sort_field='links' _title="{tr}Links to other items in page{/tr}"}{tr}Links{/tr}{/self_link}
pkdille's avatar
pkdille committed
119 120 121 122 123 124
			</th>
		{/if}

		{if $prefs.wiki_list_backlinks eq 'y'}
			{assign var='cntcol' value=$cntcol+1}
			<th>
125
				{self_link _sort_arg='sort_mode' _sort_field='backlinks' _title="{tr}Links to this page in other pages{/tr}"}{tr}Backl.{/tr}{/self_link}
pkdille's avatar
pkdille committed
126 127 128 129 130 131
			</th>
		{/if}

		{if $prefs.wiki_list_size eq 'y'}
			{assign var='cntcol' value=$cntcol+1}
			<th>
132
				{self_link _sort_arg='sort_mode' _sort_field='size' _title="{tr}Page size{/tr}"}{tr}Size{/tr}{/self_link}
pkdille's avatar
pkdille committed
133 134 135 136 137 138
			</th>
		{/if}

		{if $prefs.wiki_list_language eq 'y'}
			{assign var='cntcol' value=$cntcol+1}
			<th>
139
				{self_link _sort_arg='sort_mode' _sort_field='lang' _title="{tr}Language{/tr}"}{tr}Lang.{/tr}{/self_link}
pkdille's avatar
pkdille committed
140 141 142 143 144 145 146 147 148 149 150 151 152
			</th>
		{/if}

		{if $prefs.wiki_list_categories eq 'y'}
			{assign var='cntcol' value=$cntcol+1}
			<th>{tr}Categories{/tr}</th>
		{/if}

		{if $prefs.wiki_list_categories_path eq 'y'}
			{assign var='cntcol' value=$cntcol+1}
			<th>{tr}Categories{/tr}</th>
		{/if}

153 154 155 156 157 158 159
		{if $prefs.wiki_list_rating eq 'y'}
			{assign var='cntcol' value=$cntcol+1}
			<th>
				{self_link _sort_arg='sort_mode' _sort_field='rating' _title="{tr}Ratings{/tr}"}{tr}Ratings{/tr}{/self_link}
			</th>
		{/if}

pkdille's avatar
pkdille committed
160 161 162 163 164 165 166 167 168 169
		{if $show_actions eq 'y'}
			{assign var='cntcol' value=$cntcol+1}
			<th>{tr}Actions{/tr}</th>
		{/if}
	</tr>

	{cycle values="even,odd" print=false}
	{section name=changes loop=$listpages}
	{if $find eq $listpages[changes].pageName}
		{assign var='pagefound' value='y'}
170 171
	{/if}

172
	<tr class="{cycle}">
pkdille's avatar
pkdille committed
173
		{if $checkboxes_on eq 'y'}
174
			<td class="checkbox">
pkdille's avatar
pkdille committed
175 176 177 178 179
				<input type="checkbox" name="checked[]" value="{$listpages[changes].pageName|escape}"/>
			</td>
		{/if}

		{if $prefs.wiki_list_id eq 'y'}
180
			<td class="integer">
chealer's avatar
chealer committed
181
				<a href="{$listpages[changes].pageName|sefurl}" class="link" title="{tr}View page{/tr}&nbsp;{$listpages[changes].pageName|escape}">{$listpages[changes].page_id}</a>
pkdille's avatar
pkdille committed
182 183 184 185
			</td>
		{/if}

		{if $prefs.wiki_list_name eq 'y'}
186
			<td class="text">
187
				{object_link type=wiki id=$listpages[changes].pageName url=$listpages[changes].pageName|sefurl:'wiki':'':$all_langs title=$listpages[changes].pageName|truncate:$prefs.wiki_list_name_len:"...":true}
pkdille's avatar
pkdille committed
188 189 190 191 192
				{if $prefs.wiki_list_description eq 'y' && $listpages[changes].description neq ""}
					<div class="subcomment">
						{$listpages[changes].description|truncate:$prefs.wiki_list_description_len:"...":true}
					</div>
				{/if}
193 194 195
				{if !empty($listpages[changes].snippet)}
					<div class="subcomment">{$listpages[changes].snippet}</div>
				{/if}
pkdille's avatar
pkdille committed
196 197 198 199
			</td>
		{/if}

		{foreach from=$wplp_used key=lc item=ln}
200
			<td class="text">
pkdille's avatar
pkdille committed
201
				{if $listpages[changes].translations[$lc]}
chealer's avatar
chealer committed
202 203
					<a href="{$listpages[changes].translations[$lc]|sefurl}" class="link" title="{tr}View page{/tr}&nbsp;{$listpages[changes].translations[$lc]|escape}">
						{$listpages[changes].translations[$lc]|escape}
pkdille's avatar
pkdille committed
204 205 206 207 208 209
					</a>
				{/if}
			</td>
		{/foreach}

		{if $prefs.wiki_list_hits eq 'y'}	
210
			<td class="integer">
pkdille's avatar
pkdille committed
211 212 213 214 215
				{$listpages[changes].hits}
			</td>
		{/if}

		{if $prefs.wiki_list_lastmodif eq 'y' or $prefs.wiki_list_comment eq 'y'}
216
			<td class="date">
pkdille's avatar
pkdille committed
217 218 219 220 221 222 223 224 225 226 227 228
				{if $prefs.wiki_list_lastmodif eq 'y'}
					<div>{$listpages[changes].lastModif|tiki_short_datetime}</div>
				{/if}
				{if $prefs.wiki_list_comment eq 'y' && $listpages[changes].comment neq ""}
					<div>
						<i>{$listpages[changes].comment|truncate:$prefs.wiki_list_comment_len:"...":true}</i>
					</div>
				{/if}
			</td>
		{/if}

		{if $prefs.wiki_list_creator eq 'y'}
229
			<td class="username">
pkdille's avatar
pkdille committed
230 231 232 233 234
				{$listpages[changes].creator|userlink}
			</td>
		{/if}

		{if $prefs.wiki_list_user eq 'y'}
235
			<td class="username">
pkdille's avatar
pkdille committed
236 237 238 239 240
				{$listpages[changes].user|userlink}
			</td>
		{/if}

		{if $prefs.wiki_list_lastver eq 'y'}
241
			<td class="integer">
pkdille's avatar
pkdille committed
242 243 244 245 246
				{$listpages[changes].version}
			</td>
		{/if}

		{if $prefs.wiki_list_status eq 'y'}
247
			<td class="icon">
pkdille's avatar
pkdille committed
248
				{if $listpages[changes].flag eq 'locked'}
249
					{icon _id='lock' alt="{tr}Locked{/tr}"}
pkdille's avatar
pkdille committed
250
				{else}
251
					{icon _id='lock_break' alt="{tr}unlocked{/tr}"}
pkdille's avatar
pkdille committed
252 253 254 255 256 257
				{/if}
			</td>
		{/if}

		{if $prefs.wiki_list_versions eq 'y'}
			{if $prefs.feature_history eq 'y' and $tiki_p_wiki_view_history eq 'y'}
258
				<td class="integer">
pkdille's avatar
pkdille committed
259 260 261 262 263
					<a class="link" href="tiki-pagehistory.php?page={$listpages[changes].pageName|escape:"url"}">
						{$listpages[changes].versions}
					</a>
				</td>
			{else}
264
				<td class="integer">
pkdille's avatar
pkdille committed
265 266 267 268 269 270
					{$listpages[changes].versions}
				</td>
			{/if}
		{/if}

		{if $prefs.wiki_list_links eq 'y'}
271
			<td class="integer">
pkdille's avatar
pkdille committed
272 273 274 275 276 277
				{$listpages[changes].links}
			</td>
		{/if}

		{if $prefs.wiki_list_backlinks eq 'y'}
			{if $prefs.feature_backlinks eq 'y'}
278
				<td class="integer">
pkdille's avatar
pkdille committed
279 280 281 282 283
					<a class="link" href="tiki-backlinks.php?page={$listpages[changes].pageName|escape:"url"}">
						{$listpages[changes].backlinks}
					</a>
				</td>
			{else}
284
				<td class="integer">{$listpages[changes].backlinks}</td>
pkdille's avatar
pkdille committed
285 286 287 288
			{/if}
		{/if}

		{if $prefs.wiki_list_size eq 'y'}
289
			<td class="integer">{$listpages[changes].len|kbsize}</td>
pkdille's avatar
pkdille committed
290 291 292
		{/if}

		{if $prefs.wiki_list_language eq 'y'}
293
			<td class="text">
pkdille's avatar
pkdille committed
294 295 296 297 298
				{$listpages[changes].lang}
			</td>
		{/if}

		{if $prefs.wiki_list_categories eq 'y'}
299
			<td class="text">
pkdille's avatar
pkdille committed
300 301
				{foreach item=categ from=$listpages[changes].categname name=categ}
					{if !$smarty.foreach.categ.first}<br />{/if}
chealer's avatar
chealer committed
302
					{$categ|escape}
pkdille's avatar
pkdille committed
303 304 305 306 307
				{/foreach}
			</td>
		{/if}

		{if $prefs.wiki_list_categories_path eq 'y'}
308
			<td class="text">
pkdille's avatar
pkdille committed
309 310
				{foreach item=categpath from=$listpages[changes].categpath}
					{if !$smarty.foreach.categpath.first}<br />{/if}
chealer's avatar
chealer committed
311
					{$categpath|escape}
pkdille's avatar
pkdille committed
312 313 314 315
				{/foreach}
			</td>
		{/if}

316 317 318 319 320 321
		{if $prefs.wiki_list_rating eq 'y'}
			<td class="integer">
				{$listpages[changes].rating}
			</td>
		{/if}

pkdille's avatar
pkdille committed
322
		{if $show_actions eq 'y'}
323
			<td class="action">
pkdille's avatar
pkdille committed
324 325
				{if $listpages[changes].perms.tiki_p_edit eq 'y'}
					<a class="link" href="tiki-editpage.php?page={$listpages[changes].pageName|escape:"url"}">{icon _id='page_edit'}</a>
326
					<a class="link" href="tiki-copypage.php?page={$listpages[changes].pageName|escape:"url"}&amp;version=last">{icon _id='page_copy' alt="{tr}Copy{/tr}"}</a>
pkdille's avatar
pkdille committed
327 328 329
				{/if}

				{if $prefs.feature_history eq 'y' and $listpages[changes].perms.tiki_p_wiki_view_history eq 'y'}
330
					<a class="link" href="tiki-pagehistory.php?page={$listpages[changes].pageName|escape:"url"}">{icon _id='page_white_stack' alt="{tr}History{/tr}"}</a>
pkdille's avatar
pkdille committed
331 332 333 334
				{/if}

				{if $listpages[changes].perms.tiki_p_assign_perm_wiki_page eq 'y'}
					<a class="link" href="tiki-objectpermissions.php?objectName={$listpages[changes].pageName|escape:"url"}&amp;objectType=wiki+page&amp;permType=wiki&amp;objectId={$listpages[changes].pageName|escape:"url"}">
335
						{icon _id='key' alt="{tr}Perms{/tr}"}
pkdille's avatar
pkdille committed
336 337 338 339
					</a>
				{/if}

				{if $listpages[changes].perms.tiki_p_remove eq 'y'}
340
					<a class="link" href="tiki-removepage.php?page={$listpages[changes].pageName|escape:"url"}&amp;version=last">{icon _id='cross' alt="{tr}Remove{/tr}"}</a>
pkdille's avatar
pkdille committed
341 342 343 344 345
				{/if}
			</td>
		{/if}
		</tr>
	{sectionelse}
346 347
		{capture assign='find_htmlescaped'}{$find|escape}{/capture}
		{if $find ne ''}	
changi67's avatar
changi67 committed
348
			{norecords _colspan=$cntcol _text="{tr}No pages found with:{/tr} &quot;$find_htmlescaped&quot;."}
349
		{elseif $find ne '' && $initial ne ''}
changi67's avatar
changi67 committed
350
			{norecords _colspan=$cntcol _text="{tr}No pages found with:{/tr} &quot;$find_htmlescaped&quot; and starting with &quot; $initial &quote;."}
351
		{elseif $find ne '' && $aliases_were_found == 'y'}
changi67's avatar
changi67 committed
352
			{norecords _colspan=$cntcol _text="{tr}No pages found with:{/tr} &quot;$find_htmlescaped&dquot;. <br/>However, some page aliases fitting the query were found (see Aliases section above)."}
353
		{elseif $find ne '' && $initial ne '' && $aliases_were_found == 'y'}
changi67's avatar
changi67 committed
354
			{norecords _colspan=$cntcol _text="{tr}No pages found with:{/tr} &quot;$find_htmlescaped&quot;and starting with &quot; $initial &quote;. <br/>However, some page aliases fitting the query were found (see Aliases section above)."}
355
		{else}
changi67's avatar
changi67 committed
356
			{norecords _colspan=$cntcol _text="{tr}No pages found.{/tr}"}
357
		{/if}
pkdille's avatar
pkdille committed
358
	{/section}
359 360
</table>

pkdille's avatar
pkdille committed
361 362
{if $checkboxes_on eq 'y' && count($listpages) > 0} {* what happens to the checked items? *}
	<p align="left"> {*on the left to have it close to the checkboxes*}
chealer's avatar
chealer committed
363
		<label for="submit_mult">{tr}Perform action with checked:{/tr}</label>
364
		<select name="submit_mult" id="submit_mult" onchange="this.form.submit();">
pkdille's avatar
pkdille committed
365 366 367 368 369 370 371
			<option value="" selected="selected">...</option>
			{if $tiki_p_remove eq 'y'} 
				<option value="remove_pages" >{tr}Remove{/tr}</option>
			{/if}

			{if $prefs.feature_wiki_multiprint eq 'y'}
				<option value="print_pages" >{tr}Print{/tr}</option>
killianebel's avatar
killianebel committed
372 373 374 375

			        {if $prefs.print_pdf_from_url neq 'none'}
					<option value="export_pdf" >{tr}PDF{/tr}</option>
				{/if}
pkdille's avatar
pkdille committed
376 377 378 379 380 381
			{/if}

			{if $prefs.feature_wiki_usrlock eq 'y' and ($tiki_p_lock eq 'y' or $tiki_p_admin_wiki eq 'y')}
				<option value="lock_pages" >{tr}Lock{/tr}</option>
				<option value="unlock_pages" >{tr}Unlock{/tr}</option>
			{/if}
382 383 384 385
			{if $tiki_p_admin eq 'y'}
				<option value="zip">{tr}Xml Zip{/tr}</option>
			{/if}

pkdille's avatar
pkdille committed
386 387 388
			{* add here e.g. <option value="categorize" >{tr}categorize{/tr}</option> *}
		</select>                
	</p>
389 390 391 392 393 394 395 396
	<script type='text/javascript'>
		<!--
		// Fake js to allow the use of the <noscript> tag (so non-js-users can still submit)
		//-->
	</script>
	<noscript>
		<input type="submit" value="{tr}OK{/tr}" />
	</noscript>
pkdille's avatar
pkdille committed
397 398
{/if}

399
{if $find and $tiki_p_edit eq 'y' and $pagefound eq 'n' and $alias_found eq 'n'}
chealer's avatar
chealer committed
400 401
	{capture assign='find_htmlescaped'}{$find|escape}{/capture}
	{capture assign='find_urlescaped'}{$find|escape:'url'}{/capture}
sylvieg's avatar
sylvieg committed
402
	<div class="navbar">
403
		 {button _text="{tr}Create Page:{/tr} $find_htmlescaped" href="tiki-editpage.php?page=$find_urlescaped&lang=$find_lang&templateId=$template_id&template_name=$template_name&categId=$create_page_with_categId" _title="{tr}Create{/tr}"}
sylvieg's avatar
sylvieg committed
404
	</div>
pkdille's avatar
pkdille committed
405
{/if}
406
{if $checkboxes_on eq 'y'}
407
</form>
408
{/if}
409
{pagination_links cant=$cant step=$maxRecords offset=$offset clean=$clean}{/pagination_links}