aboutsummaryrefslogtreecommitdiff
path: root/mod/search/views
diff options
context:
space:
mode:
Diffstat (limited to 'mod/search/views')
-rw-r--r--mod/search/views/default/page_elements/searchbox.php4
-rw-r--r--mod/search/views/default/search/css.php67
-rw-r--r--mod/search/views/default/search/entity_list.php66
-rw-r--r--mod/search/views/default/search/gallery.php55
-rw-r--r--mod/search/views/default/search/gallery_listing.php16
-rw-r--r--mod/search/views/default/search/listing.php35
-rw-r--r--mod/search/views/default/search/startblurb.php15
7 files changed, 258 insertions, 0 deletions
diff --git a/mod/search/views/default/page_elements/searchbox.php b/mod/search/views/default/page_elements/searchbox.php
new file mode 100644
index 000000000..4bab36be9
--- /dev/null
+++ b/mod/search/views/default/page_elements/searchbox.php
@@ -0,0 +1,4 @@
+<form id="searchform" action="<?php echo $vars['url']; ?>pg/search/" method="get">
+ <input type="text" size="21" name="tag" value="<?php echo elgg_echo('search'); ?>" onclick="if (this.value=='<?php echo elgg_echo('search'); ?>') { this.value='' }" class="search_input" />
+ <input type="submit" value="<?php echo elgg_echo('search:go'); ?>" class="search_submit_button" />
+</form>
diff --git a/mod/search/views/default/search/css.php b/mod/search/views/default/search/css.php
new file mode 100644
index 000000000..27b532727
--- /dev/null
+++ b/mod/search/views/default/search/css.php
@@ -0,0 +1,67 @@
+.searchtype {
+background: #FFFACD;
+color: black;
+}
+
+.searchtypes {
+border: 1px #EEEEEE solid;
+padding: 4px;
+margin: 6px;
+}
+
+#searchform input.search_input {
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ background-color:#FFFFFF;
+ border:1px solid #BBBBBB;
+ color:#999999;
+ font-size:12px;
+ font-weight:bold;
+ margin:0pt;
+ padding:2px;
+ width:180px;
+ height:12px;
+}
+#searchform input.search_submit_button {
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ color:#333333;
+ background: #cccccc;
+ border:none;
+ font-size:12px;
+ font-weight:bold;
+ margin:0px;
+ padding:2px;
+ width:auto;
+ height:18px;
+ cursor:pointer;
+}
+#searchform input.search_submit_button:hover {
+ color:#ffffff;
+ background: #4690d6;
+}
+
+
+.search_listing {
+ display: block;
+ -webkit-border-radius: 8px;
+ -moz-border-radius: 8px;
+ background:white;
+ margin:0 10px 5px 10px;
+ padding:5px;
+}
+
+.entity_gallery_item .search_listing {
+ background: none;
+ text-align: center;
+}
+
+/* override the entity container piece */
+.search_listing .entity_listing {
+ -webkit-border-radius: 0px;
+ -moz-border-radius: 0px;
+ background: transparent;
+ margin: 0;
+ padding: 0;
+}
+
diff --git a/mod/search/views/default/search/entity_list.php b/mod/search/views/default/search/entity_list.php
new file mode 100644
index 000000000..d709210df
--- /dev/null
+++ b/mod/search/views/default/search/entity_list.php
@@ -0,0 +1,66 @@
+<?php
+$context = $vars['context'];
+$offset = $vars['offset'];
+$entities = $vars['entities'];
+$limit = $vars['limit'];
+$count = $vars['count'];
+$baseurl = $vars['baseurl'];
+$context = $vars['context'];
+$viewtype = $vars['viewtype'];
+$pagination = $vars['pagination'];
+$fullview = $vars['fullview'];
+
+$html = "";
+$nav = "";
+if (isset($vars['viewtypetoggle'])) {
+ $viewtypetoggle = $vars['viewtypetoggle'];
+} else {
+ $viewtypetoggle = true;
+}
+
+if ($context == "search" && $count > 0 && $viewtypetoggle) {
+ $nav .= elgg_view("navigation/viewtype",array(
+
+ 'baseurl' => $baseurl,
+ 'offset' => $offset,
+ 'count' => $count,
+ 'viewtype' => $viewtype,
+
+ ));
+}
+
+if ($pagination)
+ $nav .= elgg_view('navigation/pagination',array(
+
+ 'baseurl' => $baseurl,
+ 'offset' => $offset,
+ 'count' => $count,
+ 'limit' => $limit,
+
+ ));
+
+$html .= $nav;
+
+if ($viewtype == "list") {
+ if (is_array($entities) && sizeof($entities) > 0) {
+ foreach($entities as $entity) {
+ // print out the entity
+ $ev = elgg_view_entity($entity, $fullview);
+ // then add the search decorations around it
+ $html .= elgg_view('search/listing', array('entity_view' => $ev,
+ 'search_types' => $entity->getVolatileData('search')));
+
+ }
+ }
+} else if ($viewtype == "gallery") {
+ if (is_array($entities) && sizeof($entities) > 0) {
+ $html .= elgg_view("search/gallery",array('entities' => $entities));
+ }
+}
+
+if ($count) {
+ $html .= $nav;
+}
+echo $html;
+
+?>
diff --git a/mod/search/views/default/search/gallery.php b/mod/search/views/default/search/gallery.php
new file mode 100644
index 000000000..753a38684
--- /dev/null
+++ b/mod/search/views/default/search/gallery.php
@@ -0,0 +1,55 @@
+<?php
+
+ /**
+ * Elgg gallery view
+ *
+ * @package Elgg
+ * @subpackage Core
+
+ * @author Curverider Ltd
+
+ * @link http://elgg.org/
+ */
+
+ $entities = $vars['entities'];
+ if (is_array($entities) && sizeof($entities) > 0) {
+
+?>
+
+ <table class="entity_gallery">
+
+<?php
+
+ $col = 0;
+ foreach($entities as $entity) {
+ if ($col == 0) {
+
+ echo "<tr>";
+
+ }
+ echo "<td class=\"entity_gallery_item\">";
+
+ $ev = elgg_view_entity($entity, $fullview);
+
+ echo elgg_view('search/listing', array('entity_view' => $ev,
+ 'search_types' => $entity->getVolatileData('search')));
+
+
+ echo "</td>";
+ $col++;
+ if ($col > 3) {
+ echo "</tr>";
+ $col = 0;
+ }
+ }
+ if ($col > 0) echo "</tr>";
+
+?>
+
+ </table>
+
+<?php
+
+ }
+
+?> \ No newline at end of file
diff --git a/mod/search/views/default/search/gallery_listing.php b/mod/search/views/default/search/gallery_listing.php
new file mode 100644
index 000000000..bbecaf202
--- /dev/null
+++ b/mod/search/views/default/search/gallery_listing.php
@@ -0,0 +1,16 @@
+<?php
+/**
+ * Elgg search listing: gallery view
+ *
+ * DEPRECATED VIEW: use entities/gallery_listing instead
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @author Curverider Ltd
+ * @link http://elgg.org/
+ */
+
+
+ echo elgg_view('entities/gallery_listing', $vars);
+
+?> \ No newline at end of file
diff --git a/mod/search/views/default/search/listing.php b/mod/search/views/default/search/listing.php
new file mode 100644
index 000000000..e3ad91ba8
--- /dev/null
+++ b/mod/search/views/default/search/listing.php
@@ -0,0 +1,35 @@
+<?php
+
+ /**
+ * Elgg search listing
+ *
+ * @package Elgg
+ * @subpackage Core
+
+ * @author Curverider Ltd
+
+ * @link http://elgg.org/
+ */
+
+?>
+
+ <div class="search_listing">
+
+<?php
+
+echo $vars['entity_view'];
+
+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> ';
+ }
+ echo '</div>';
+
+}
+
+
+
+
+?>
+ </div>
diff --git a/mod/search/views/default/search/startblurb.php b/mod/search/views/default/search/startblurb.php
new file mode 100644
index 000000000..0115438f2
--- /dev/null
+++ b/mod/search/views/default/search/startblurb.php
@@ -0,0 +1,15 @@
+<?php
+/**
+ * @package Elgg
+ * @subpackage Core
+ * @author Curverider Ltd
+ * @link http://elgg.org/
+ */
+?>
+<div class="contentWrapper">
+ <?php
+
+ echo sprintf(elgg_echo("tag:search:startblurb"),$vars['tag']);
+
+ ?>
+</div> \ No newline at end of file