aboutsummaryrefslogtreecommitdiff
path: root/mod/search/start.php
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-07 02:38:51 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-07 02:38:51 +0000
commitccca9564b23d6f860d46ccdb86a7578e74b7a534 (patch)
tree72fbe19572d8006a0babb8782cd514bb8d05a731 /mod/search/start.php
parentcb5ecaff25b858117a57ede78f353661a520c9d4 (diff)
downloadelgg-ccca9564b23d6f860d46ccdb86a7578e74b7a534.tar.gz
elgg-ccca9564b23d6f860d46ccdb86a7578e74b7a534.tar.bz2
Fixes #2335 #2336 clean up and minor standardization of search plugin - needs html/css clean up
git-svn-id: http://code.elgg.org/elgg/trunk@8057 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/search/start.php')
-rw-r--r--mod/search/start.php20
1 files changed, 7 insertions, 13 deletions
diff --git a/mod/search/start.php b/mod/search/start.php
index ac61963d4..71473632c 100644
--- a/mod/search/start.php
+++ b/mod/search/start.php
@@ -1,14 +1,13 @@
<?php
/**
- * Elgg core search.
+ * Elgg search plugin
*
- * @package Elgg
- * @subpackage Core
*/
+elgg_register_event_handler('init','system','search_init');
+
/**
- * Initialise search helper functions.
- *
+ * Initialize search plugin
*/
function search_init() {
global $CONFIG;
@@ -20,8 +19,6 @@ function search_init() {
// register some default search hooks
elgg_register_plugin_hook_handler('search', 'object', 'search_objects_hook');
elgg_register_plugin_hook_handler('search', 'user', 'search_users_hook');
-
- // @todo pull this out into groups
elgg_register_plugin_hook_handler('search', 'group', 'search_groups_hook');
// tags and comments are a bit different.
@@ -223,7 +220,7 @@ function search_consolidate_substrings($offsets, $lengths) {
$end_pos = $offset + $length;
// find the next entry that doesn't overlap
- while(array_key_exists($i+1, $offsets) && $end_pos > $offsets[$i+1]) {
+ while (array_key_exists($i+1, $offsets) && $end_pos > $offsets[$i+1]) {
$i++;
if (!array_key_exists($i, $offsets)) {
break;
@@ -329,7 +326,7 @@ function search_remove_ignored_words($query, $format = 'array') {
*
* @param array $results
* @param array $params
- * @param string $view_type = listing, entity or listing
+ * @param string $view_type = listing, entity or layout
* @return string
*/
function search_get_search_view($params, $view_type) {
@@ -456,7 +453,7 @@ function search_get_order_by_sql($entities_table, $type_table, $sort, $order) {
default:
case 'relevance':
// default is relevance descending.
- // acending relevancy is silly and complicated.
+ // ascending relevancy is silly and complicated.
$on = '';
break;
case 'created':
@@ -488,6 +485,3 @@ function search_get_order_by_sql($entities_table, $type_table, $sort, $order) {
return $order_by;
}
-/** Register init system event **/
-
-elgg_register_event_handler('init','system','search_init');