From f7d48ed34a30eab22a6218c07a443b47b237b501 Mon Sep 17 00:00:00 2001 From: laetzer Date: Sat, 18 Oct 2008 23:27:52 +0000 Subject: admin sets content types which can be tagged; add/delete tags via input field; removed 'drop tags' outside of edit view, removed listing of linked tags near input field --- admin/admin_tags_inc.php | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) (limited to 'admin') diff --git a/admin/admin_tags_inc.php b/admin/admin_tags_inc.php index d3c357c..1ba873b 100644 --- a/admin/admin_tags_inc.php +++ b/admin/admin_tags_inc.php @@ -1,25 +1,25 @@ array( - 'label' => 'Tags In View', - 'note' => 'Shows the tags in the "view" location', - 'type' => 'toggle', - ), "tags_in_nav" => array( - 'label' => 'Tags In Nav', + 'label' => 'Nav', 'note' => 'Shows the tags in the "nav" location', 'type' => 'toggle', ), "tags_in_body" => array( - 'label' => 'Tags In Body', + 'label' => 'Body', 'note' => 'Shows the tags in the "body" location', 'type' => 'toggle', ), + "tags_in_view" => array( + 'label' => 'View', + 'note' => 'Shows the tags in the "view" location', + 'type' => 'toggle', + ), ); $gBitSmarty->assign( 'formTagsDisplayOptions', $formTagsDisplayOptions ); @@ -102,6 +102,15 @@ $formTagLists = array( ); $gBitSmarty->assign( 'formTagLists',$formTagLists ); +// list of content types that can be tagged +// 'sample' is presented anyways, if sample package is installed +// 'bitcomment' (?) ... isFeatureActive('tags_on_comments') +$exclude = array( 'bituser', 'tikisticky', 'sample', 'bitcomment'); +foreach( $gLibertySystem->mContentTypes as $cType ) { + if( !in_array( $cType['content_type_guid'], $exclude ) ) { + $formTaggable['guids']['tags_tag_'.$cType['content_type_guid']] = $cType['content_description']; + } +} if( !empty( $_REQUEST['tags_preferences'] ) ) { $tags = array_merge($formTagsDisplayOptions, $formTagsStripOptions, $formTagLists); @@ -115,6 +124,19 @@ if( !empty( $_REQUEST['tags_preferences'] ) ) { simple_set_value( $item, TAGS_PKG_NAME ); } } + foreach( array_keys( $formTaggable['guids'] ) as $taggable ) { + $gBitSystem->storeConfig( $taggable, ( ( !empty( $_REQUEST['taggable_content'] ) && in_array( $taggable, $_REQUEST['taggable_content'] ) ) ? 'y' : NULL ), TAGS_PKG_NAME ); + } + +} + +// check the correct packages in the package selection +foreach( $gLibertySystem->mContentTypes as $cType ) { + if( $gBitSystem->getConfig( 'tags_tag_'.$cType['content_type_guid'] ) ) { + $formTaggable['checked'][] = 'tags_tag_'.$cType['content_type_guid']; + } } +$gBitSmarty->assign( 'formTaggable', $formTaggable ); + ?> \ No newline at end of file -- cgit v1.3