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.php61
-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/listing.php35
5 files changed, 221 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..08c681f63
--- /dev/null
+++ b/mod/search/views/default/search/css.php
@@ -0,0 +1,61 @@
+.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;
+}
+
+/* override the entity container piece */
+.search_listing .entity_listing {
+ -webkit-border-radius: 0px;
+ -moz-border-radius: 0px;
+ background: transparent;
+ margin: 0;
+ padding: 0;
+} \ No newline at end of file
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..56291ba3a
--- /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) {
+ $ev = elgg_view_entity($entity, $fullview);
+
+ $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/listing.php b/mod/search/views/default/search/listing.php
new file mode 100644
index 000000000..f27116a9f
--- /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">Matched: ';
+ foreach ($vars['search_types'] as $st) {
+ echo '<span class="searchtype">' . elgg_echo($st) . '</span> ';
+ }
+ echo '</div>';
+
+ }
+
+
+
+
+?>
+ </div>