summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2006-02-10 23:19:38 +0000
committerLester Caine <lester@lsces.co.uk>2006-02-10 23:19:38 +0000
commit79113dd7e11ccb846b12669990dfd4f5bd209f9a (patch)
tree5cd1fc3e9a0aaef949ec6885c72d51870a0e4279 /modules
parentc9f729fab275c902ee7b5d3663e3d2ef405550b4 (diff)
downloadsearch-79113dd7e11ccb846b12669990dfd4f5bd209f9a.tar.gz
search-79113dd7e11ccb846b12669990dfd4f5bd209f9a.tar.bz2
search-79113dd7e11ccb846b12669990dfd4f5bd209f9a.zip
Make $contentTypes creation conditional on not already existing
Bodge this should be a system value - with the content set filtered on user permissions?
Diffstat (limited to 'modules')
-rw-r--r--modules/mod_global_search.php14
-rw-r--r--modules/mod_package_search.php34
2 files changed, 25 insertions, 23 deletions
diff --git a/modules/mod_global_search.php b/modules/mod_global_search.php
index cf6e931..175e837 100644
--- a/modules/mod_global_search.php
+++ b/modules/mod_global_search.php
@@ -1,6 +1,6 @@
<?php
/**
- * $Header: /cvsroot/bitweaver/_bit_search/modules/mod_global_search.php,v 1.3 2005/12/18 22:31:56 squareing Exp $
+ * $Header: /cvsroot/bitweaver/_bit_search/modules/mod_global_search.php,v 1.4 2006/02/10 23:19:36 lsces Exp $
*
* Copyright (c) 2004 bitweaver.org
* Copyright (c) 2003 tikwiki.org
@@ -8,15 +8,17 @@
* All Rights Reserved. See copyright.txt for details and a complete list of authors.
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details
*
- * $Id: mod_global_search.php,v 1.3 2005/12/18 22:31:56 squareing Exp $
+ * $Id: mod_global_search.php,v 1.4 2006/02/10 23:19:36 lsces Exp $
* @author Luis Argerich (lrargerich@yahoo.com)
* @package search
* @subpackage modules
*/
global $gLibertySystem;
-//vd($gLibertySystem->mContentTypes);
-foreach( $gLibertySystem->mContentTypes as $cType ) {
- $contentTypes[$cType['content_type_guid']] = $cType['content_description'];
+
+if ( empty($contentTypes) ) {
+ foreach( $gLibertySystem->mContentTypes as $cType ) {
+ $contentTypes[$cType['content_type_guid']] = $cType['content_description'];
+ }
+ $gBitSmarty->assign( 'contentTypes', $contentTypes );
}
-$gBitSmarty->assign( 'contentTypes', $contentTypes );
?>
diff --git a/modules/mod_package_search.php b/modules/mod_package_search.php
index 8a9285d..d20ea32 100644
--- a/modules/mod_package_search.php
+++ b/modules/mod_package_search.php
@@ -1,6 +1,6 @@
<?php
/**
- * $Header: /cvsroot/bitweaver/_bit_search/modules/mod_package_search.php,v 1.5 2006/02/09 11:12:45 lsces Exp $
+ * $Header: /cvsroot/bitweaver/_bit_search/modules/mod_package_search.php,v 1.6 2006/02/10 23:19:36 lsces Exp $
*
* Copyright (c) 2004 bitweaver.org
* Copyright (c) 2003 tikwiki.org
@@ -8,7 +8,7 @@
* All Rights Reserved. See copyright.txt for details and a complete list of authors.
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details
*
- * $Id: mod_package_search.php,v 1.5 2006/02/09 11:12:45 lsces Exp $
+ * $Id: mod_package_search.php,v 1.6 2006/02/10 23:19:36 lsces Exp $
* @author Luis Argerich (lrargerich@yahoo.com)
* @package search
* @subpackage modules
@@ -26,23 +26,23 @@
$searchTemplateRsrc = 'bitpackage:search/global_mini_search.tpl';
$searchTitle = '';
}
- foreach( $gLibertySystem->mContentTypes as $contentType ) {
- switch ($contentType["content_type_guid"]) {
- case "bitarticle" : $perm = "bit_p_read_article"; break;
- case "bitpage" : $perm = "bit_p_view"; break;
- case "bitblogpost" : $perm = "bit_p_read_blog"; break;
- case "bitcomment" : $perm = "bit_p_read_comments"; break;
- case "fisheyegallery" : $perm = "bit_p_view_fisheye"; break;
- default : $perm = ""; break;
+ if ( empty($contentTypes) ) {
+ foreach( $gLibertySystem->mContentTypes as $contentType ) {
+/* switch ($contentType["content_type_guid"]) {
+ case "bitarticle" : $perm = "bit_p_read_article"; break;
+ case "bitpage" : $perm = "bit_p_view"; break;
+ case "bitblogpost" : $perm = "bit_p_read_blog"; break;
+ case "bitcomment" : $perm = "bit_p_read_comments"; break;
+ case "fisheyegallery" : $perm = "bit_p_view_fisheye"; break;
+ default : $perm = ""; break;
+ }
+ $show = false; */
+// if (!empty($perm) and $gBitUser->hasPermission($perm)) {
+ $contentTypes[$contentTypeX["content_type_guid"]] = $contentType["content_description"];
+// }
}
- $show = false;
-// if (!empty($perm) and $gBitUser->hasPermission($perm)) {
- $contentTypes[] = $contentType["content_type_guid"];
- $contentDescriptions[] = $contentType["content_description"];
-// }
+ $gBitSmarty->assign( 'contentTypes', $contentTypes );
}
- $gBitSmarty->assign( 'contentTypes', $contentTypes );
- $gBitSmarty->assign( 'contentDescriptions', $contentDescriptions );
$gBitSmarty->assign( 'searchTitle', $searchTitle );
$gBitSmarty->assign( 'miniSearchRsrc', $searchTemplateRsrc );