aboutsummaryrefslogtreecommitdiff
path: root/mod/search/views/default
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-11-06 01:46:36 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-11-06 01:46:36 +0000
commit5d96c9b12fe0ea953ef95af952e588a1898ef1fc (patch)
tree0d4555c86b3d5c744f46cc37e0b7b45a106017e6 /mod/search/views/default
parent06169d33aae4d27129c77baaee9ecb064683e576 (diff)
downloadelgg-5d96c9b12fe0ea953ef95af952e588a1898ef1fc.tar.gz
elgg-5d96c9b12fe0ea953ef95af952e588a1898ef1fc.tar.bz2
Updated search for FTS.
git-svn-id: http://code.elgg.org/elgg/trunk@3619 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/search/views/default')
-rw-r--r--mod/search/views/default/search/css.php23
-rw-r--r--mod/search/views/default/search/listing.php67
-rw-r--r--mod/search/views/default/search/startblurb.php8
-rw-r--r--mod/search/views/default/search/tags/listing.php55
4 files changed, 119 insertions, 34 deletions
diff --git a/mod/search/views/default/search/css.php b/mod/search/views/default/search/css.php
index 27b532727..936fe5c9d 100644
--- a/mod/search/views/default/search/css.php
+++ b/mod/search/views/default/search/css.php
@@ -1,4 +1,4 @@
-.searchtype {
+.searchtype {
background: #FFFACD;
color: black;
}
@@ -9,8 +9,21 @@ padding: 4px;
margin: 6px;
}
+.searchListing {
+ display: block;
+ margin-bottom: 2em;
+}
+
+.searchMatch {
+ background-color: #FFFF66;
+}
+
+.searchTitle {
+ text-decoration: underline;
+}
+
#searchform input.search_input {
- -webkit-border-radius: 4px;
+ -webkit-border-radius: 4px;
-moz-border-radius: 4px;
background-color:#FFFFFF;
border:1px solid #BBBBBB;
@@ -23,7 +36,7 @@ margin: 6px;
height:12px;
}
#searchform input.search_submit_button {
- -webkit-border-radius: 4px;
+ -webkit-border-radius: 4px;
-moz-border-radius: 4px;
color:#333333;
background: #cccccc;
@@ -44,7 +57,7 @@ margin: 6px;
.search_listing {
display: block;
- -webkit-border-radius: 8px;
+ -webkit-border-radius: 8px;
-moz-border-radius: 8px;
background:white;
margin:0 10px 5px 10px;
@@ -58,7 +71,7 @@ margin: 6px;
/* override the entity container piece */
.search_listing .entity_listing {
- -webkit-border-radius: 0px;
+ -webkit-border-radius: 0px;
-moz-border-radius: 0px;
background: transparent;
margin: 0;
diff --git a/mod/search/views/default/search/listing.php b/mod/search/views/default/search/listing.php
index e3ad91ba8..2ed657547 100644
--- a/mod/search/views/default/search/listing.php
+++ b/mod/search/views/default/search/listing.php
@@ -1,35 +1,54 @@
<?php
+/**
+ * Elgg search listing
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @author Curverider Ltd
+ * @link http://elgg.org/
+ */
+?>
- /**
- * Elgg search listing
- *
- * @package Elgg
- * @subpackage Core
+<div class="search_listing">
- * @author Curverider Ltd
+<?php
+$entities = $vars['entities'];
+$count = $vars['count'];
- * @link http://elgg.org/
- */
+if (!is_array($vars['entities']) || !count($vars['entities'])) {
+ return FALSE;
+}
-?>
+$title_str = elgg_echo("item:{$vars['params']['type']}:{$vars['params']['subtype']}");
+$body = elgg_view_title($title_str);
- <div class="search_listing">
-
-<?php
-
-echo $vars['entity_view'];
+echo elgg_view('page_elements/contentwrapper', array('body' => $body));
-if ($vars['search_types'] && is_array($vars['search_types'])) {
- echo '<div class="searchtypes">' . elgg_echo('search:matched');
- foreach ($vars['search_types'] as $st) {
- echo '<span class="searchtype">' . elgg_echo($st) . '</span> ';
+foreach ($entities as $entity) {
+ if ($owner = $entity->getOwnerEntity()) {
+ $owner_icon = $owner->getIcon('tiny');
+ $icon = "<img src=\"$owner_icon\" />";
+ } else {
+ $icon = '';
}
- echo '</div>';
-
+ $title = $entity->getVolatileData('search_matched_title');
+ $description = $entity->getVolatileData('search_matched_description');
+ $url = $entity->getURL();
+ $title = "<a href=\"$url\">$title</a>";
+ $tc = $entity->time_created;
+ $tu = $entity->time_updated;
+ $time = friendly_time(($tu > $tc) ? $tu : $tc);
+
+ echo <<<___END
+<span class="searchListing">
+ <h3 class="searchTitle">$title</h3>
+ <span class="searchDetails">
+ <span class="searchDescription">$description</span><br />
+ $icon - $time - <a href="">More $title_str</a> -
+ </span>
+</span>
+___END;
}
-
-
-
?>
- </div>
+</div> \ No newline at end of file
diff --git a/mod/search/views/default/search/startblurb.php b/mod/search/views/default/search/startblurb.php
index 0115438f2..82d2d62d1 100644
--- a/mod/search/views/default/search/startblurb.php
+++ b/mod/search/views/default/search/startblurb.php
@@ -7,9 +7,7 @@
*/
?>
<div class="contentWrapper">
- <?php
-
- echo sprintf(elgg_echo("tag:search:startblurb"),$vars['tag']);
-
- ?>
+<?php
+ echo sprintf(elgg_echo("tag:search:startblurb"), $vars['query']);
+?>
</div> \ No newline at end of file
diff --git a/mod/search/views/default/search/tags/listing.php b/mod/search/views/default/search/tags/listing.php
new file mode 100644
index 000000000..a5a33c4a4
--- /dev/null
+++ b/mod/search/views/default/search/tags/listing.php
@@ -0,0 +1,55 @@
+<?php
+/**
+ * Elgg search listing
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @author Curverider Ltd
+ * @link http://elgg.org/
+ */
+?>
+
+<div class="search_listing">
+
+<?php
+$entities = $vars['entities'];
+$count = $vars['count'];
+
+if (!is_array($vars['entities']) || !count($vars['entities'])) {
+ return FALSE;
+}
+
+$title_str = elgg_echo("item:{$vars['params']['type']}:{$vars['params']['subtype']}");
+$body = elgg_view_title(elgg_echo('tags'));
+
+echo elgg_view('page_elements/contentwrapper', array('body' => $body));
+
+foreach ($entities as $entity) {
+ if ($owner = $entity->getOwnerEntity()) {
+ $owner_icon = $owner->getIcon('tiny');
+ $icon = "<img src=\"$owner_icon\" />";
+ } else {
+ $icon = '';
+ }
+ $tags = $entity->getVolatileData('search_matched_tags');
+
+ $entity_html = elgg_view_entity($entity);
+ $url = $entity->getURL();
+ $title = "<a href=\"$url\">$title</a>";
+ $tc = $entity->time_created;
+ $tu = $entity->time_updated;
+ $time = friendly_time(($tu > $tc) ? $tu : $tc);
+
+ echo <<<___END
+<span class="searchListing">
+ <h3 class="searchTitle">$title</h3>
+ <span class="searchDetails">
+ $entity_html
+ $tags
+ </span>
+</span>
+___END;
+}
+
+?>
+</div> \ No newline at end of file