From 34e28b1ccb73cb488f36cec692c854f9502cdd18 Mon Sep 17 00:00:00 2001 From: brettp Date: Fri, 9 Oct 2009 20:43:39 +0000 Subject: Reverted back to previous copy removing Justin's search because of views problems in plugins. git-svn-id: http://code.elgg.org/elgg/trunk@3521 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/elgglib.php | 4 ++-- engine/lib/entities.php | 34 --------------------------------- engine/lib/search.php | 50 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 36 deletions(-) create mode 100644 engine/lib/search.php (limited to 'engine/lib') diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index b2a157155..fc87c1dc1 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -719,7 +719,7 @@ $context = get_context(); - $html = elgg_view('entities/entity_list',array( + $html = elgg_view('search/entity_list',array( 'entities' => $entities, 'count' => $count, 'offset' => $offset, @@ -1000,7 +1000,7 @@ * @return string The HTML (etc) representing the listing */ function elgg_view_listing($icon, $info) { - return elgg_view('entities/entity_listing',array('icon' => $icon, 'info' => $info)); + return elgg_view('search/listing',array('icon' => $icon, 'info' => $info)); } /** diff --git a/engine/lib/entities.php b/engine/lib/entities.php index 55a675154..b72eb6ff0 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -63,13 +63,6 @@ */ protected $temp_annotations; - - /** - * Volatile data structure for this object, allows for storage of data - * in-memory that isn't sync'd back to the metadata table. - */ - protected $volatile; - /** * Initialise the attributes array. * This is vital to distinguish between metadata and base parameters. @@ -86,7 +79,6 @@ if (!is_array($this->attributes)) $this->attributes = array(); if (!is_array($this->temp_metadata)) $this->temp_metadata = array(); if (!is_array($this->temp_annotations)) $this->temp_annotations = array(); - if (!is_array($this->volatile)) $this->volatile = array(); $this->attributes['guid'] = ""; $this->attributes['type'] = ""; @@ -182,31 +174,6 @@ return true; } - - /** - * Get a piece of volatile (non-persisted) data on this entity - */ - public function getVolatileData($name) { - if (!is_array($this->volatile)) $this->volatile = array(); - - if (array_key_exists($name, $this->volatile)) { - return $this->volatile[$name]; - } else { - return NULL; - } - } - - - /** - * Get a piece of volatile (non-persisted) data on this entity - */ - public function setVolatileData($name, $value) { - if (!is_array($this->volatile)) $this->volatile = array(); - - $this->volatile[$name] = $value; - } - - /** * Get a given piece of metadata. * @@ -719,7 +686,6 @@ { // Create the array if necessary - all subclasses should test before creating if (!is_array($this->attributes)) $this->attributes = array(); - if (!is_array($this->volatile)) $this->volatile = array(); // Now put these into the attributes array as core values $objarray = (array) $row; diff --git a/engine/lib/search.php b/engine/lib/search.php new file mode 100644 index 000000000..222c0b6e9 --- /dev/null +++ b/engine/lib/search.php @@ -0,0 +1,50 @@ + + * @link http://elgg.org/ + */ + + /** + * Initialise search helper functions. + * + */ + function search_init() + { + register_page_handler('search','search_page_handler'); + } + + /** + * Page handler for search + * + * @param array $page Page elements from pain page handler + */ + function search_page_handler($page) + { + global $CONFIG; + + if(!get_input('tag')) { + set_input('tag', $page[0]); + } + + if (isset($page[0])) { + switch ($page[0]) { + case 'user' : + case 'users' : include_once($CONFIG->path . "search/users.php"); break; + + case 'group' : + case 'groups' : include_once($CONFIG->path . "search/groups.php"); break; + + default: include_once($CONFIG->path . "search/index.php"); + } + } + else + include_once($CONFIG->path . "search/index.php"); + } + + /** Register init system event **/ + register_elgg_event_handler('init','system','search_init'); +?> -- cgit v1.2.3