From f9aa70c258578d907cdeb1e9d5b26fffca5bede6 Mon Sep 17 00:00:00 2001 From: brettp Date: Fri, 9 Oct 2009 19:33:33 +0000 Subject: Pulled in Justin's search changes from github. git-svn-id: http://code.elgg.org/elgg/trunk@3520 36083f99-b078-4883-b0ff-0f9b5a30f544 --- .../views/default/page_elements/searchbox.php | 4 ++ mod/search/views/default/search/css.php | 61 ++++++++++++++++++++ mod/search/views/default/search/entity_list.php | 66 ++++++++++++++++++++++ mod/search/views/default/search/gallery.php | 55 ++++++++++++++++++ mod/search/views/default/search/listing.php | 35 ++++++++++++ 5 files changed, 221 insertions(+) create mode 100644 mod/search/views/default/page_elements/searchbox.php create mode 100644 mod/search/views/default/search/css.php create mode 100644 mod/search/views/default/search/entity_list.php create mode 100644 mod/search/views/default/search/gallery.php create mode 100644 mod/search/views/default/search/listing.php (limited to 'mod/search/views/default') 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 @@ +
+ + +
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 @@ + 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 @@ + 0) { + +?> + + + +"; + + } + echo ""; + $col++; + if ($col > 3) { + echo ""; + $col = 0; + } + } + if ($col > 0) echo ""; + +?> + + + + \ 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 @@ + + +
+ +Matched: '; + foreach ($vars['search_types'] as $st) { + echo '' . elgg_echo($st) . ' '; + } + echo '
'; + + } + + + + +?> + -- cgit v1.2.3