From 32ba76313667d8555c65dd2dad225d8161a1811a Mon Sep 17 00:00:00 2001 From: wjames5 Date: Mon, 7 May 2007 20:59:45 +0000 Subject: fix listing sort options and pagination links --- LibertyTag.php | 26 ++++++++++++++++++++++++-- templates/list_content.tpl | 30 +++++++++++++++++++----------- templates/list_tags.tpl | 2 +- 3 files changed, 44 insertions(+), 14 deletions(-) diff --git a/LibertyTag.php b/LibertyTag.php index 97f34b2..22169c6 100755 --- a/LibertyTag.php +++ b/LibertyTag.php @@ -360,10 +360,32 @@ class LibertyTag extends LibertyBase { $bindVars = array(); $sort_mode_prefix = 'tg'; - if( empty( $pParamHash['sort_mode'] ) ) { + + $sortHash = array( + 'content_id_desc', + 'content_id_asc', + 'modifier_user_desc', + 'modifier_user_asc', + 'modifier_real_name_desc', + 'modifier_real_name_asc', + 'creator_user_desc', + 'creator_user_asc', + 'creator_real_name_desc', + 'creator_real_name_asc', + 'title_asc', + 'title_desc', + 'content_type_guid_asc', + 'content_type_guid_desc', + 'ip_asc', + 'ip_desc', + 'last_modified_asc', + 'last_modified_desc', + ); + + if( empty( $pParamHash['sort_mode'] ) || in_array( $pParamHash['sort_mode'], $sortHash ) ) { $pParamHash['sort_mode'] = 'tag_asc'; } - + /** * @TODO this all needs to go in in some other getList type method * and these are just sketches - need to be different kinds of queries in most cases diff --git a/templates/list_content.tpl b/templates/list_content.tpl index b4fe9a7..acfd727 100644 --- a/templates/list_content.tpl +++ b/templates/list_content.tpl @@ -32,8 +32,9 @@ {smartlink ititle="Title" tags=$tagsReq isort=title list_page=$listInfo.current_page user_id=$user_id content_type_guid=$contentSelect find=$listInfo.find idefault=1} {smartlink ititle="Content Type" tags=$tagsReq isort=content_type_guid list_page=$listInfo.current_page user_id=$user_id content_type_guid=$contentSelect find=$listInfo.find} {smartlink ititle="Author" tags=$tagsReq isort=$isort_author list_page=$listInfo.current_page user_id=$user_id content_type_guid=$contentSelect find=$listInfo.find} - {smartlink ititle="Most recent editor" tags=$tagsReq isort=$isort_editor list_page=$listInfo.current_page user_id=$user_id content_type_guid=$contentSelect find=$listInfo.find} - {smartlink ititle="IP" tags=$tagsReq isort=ip list_page=$listInfo.current_page user_id=$user_id content_type_guid=$contentSelect find=$listInfo.find} + {smartlink ititle="Most recent editor" tags=$tagsReq isort=$isort_editor list_page=$listInfo.current_page user_id=$user_id content_type_guid=$contentSelect find=$listInfo.find} + {smartlink ititle="Last Modified" tags=$tagsReq isort=last_modified list_page=$listInfo.current_page user_id=$user_id content_type_guid=$content_type_guids find=$listInfo.find} + {smartlink ititle="IP" tags=$tagsReq isort=ip list_page=$listInfo.current_page user_id=$user_id content_type_guid=$contentSelect find=$listInfo.find} {foreach from=$contentList item=item} @@ -41,20 +42,27 @@ {$item.display_link} {assign var=content_type_guid value=`$item.content_type_guid`}{$contentTypes.$content_type_guid} {displayname real_name=$item.creator_real_name user=$item.creator_user} - {displayname real_name=$item.modifier_real_name user=$item.modifier_user} - {$item.last_modified|bit_short_date} - {$item.ip} + {displayname real_name=$item.modifier_real_name user=$item.modifier_user} + {$item.last_modified|bit_short_date} + {$item.ip} {/foreach} - {pagination} - -
-

{tr}Tags{/tr}

-
+ {pagination tags=$tagsReq} + + +
+

{tr}Tags{/tr}

+
- {include file="bitpackage:tags/tags_cloud.tpl"} +
+ {if $cloud} + {include file="bitpackage:tags/tags_cloud.tpl"} + {else} + {include file="bitpackage:tags/tags_list.tpl"} + {/if}
+ {/strip} diff --git a/templates/list_tags.tpl b/templates/list_tags.tpl index e0f2349..a26b559 100644 --- a/templates/list_tags.tpl +++ b/templates/list_tags.tpl @@ -1,4 +1,4 @@ -
{bithelp}
+ {strip}
-- cgit v1.3