]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Removed hard-coded search box and replaced with extended header/extend view from...
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Mon, 8 Mar 2010 20:17:41 +0000 (20:17 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Mon, 8 Mar 2010 20:17:41 +0000 (20:17 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@5309 36083f99-b078-4883-b0ff-0f9b5a30f544

mod/search/start.php
mod/search/views/default/page_elements/searchbox.php [deleted file]
mod/search/views/default/search/search_box.php [new file with mode: 0644]
views/default/page_elements/elgg_header.php
views/default/page_elements/html_begin.php

index a6a0bead25e82150240b74903127b83eb5f4efae..3467420b7339359eb52f87b9225069d082650f0a 100644 (file)
@@ -1,12 +1,12 @@
 <?php
 /**
  * Elgg core search.
  *
  * @package Elgg
  * @subpackage Core
  * @author Curverider Ltd <info@elgg.com>, The MITRE Corporation <http://www.mitre.org>
  * @link http://elgg.org/
  */
+ * Elgg core search.
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @author Curverider Ltd <info@elgg.com>, The MITRE Corporation <http://www.mitre.org>
+ * @link http://elgg.org/
+ */
 
 /**
  * Initialise search helper functions.
@@ -51,6 +51,9 @@ function search_init() {
 
        // add in CSS for search elements
        elgg_extend_view('css', 'search/css');
+
+       // extend view for elgg topbar search box
+       elgg_extend_view('header/extend', 'search/search_box');
 }
 
 /**
diff --git a/mod/search/views/default/page_elements/searchbox.php b/mod/search/views/default/page_elements/searchbox.php
deleted file mode 100644 (file)
index f70a6ad..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-<?php
-
-if (array_key_exists('value', $vars)) {
-       $value = $vars['value'];
-} elseif ($value = get_input('q', get_input('tag', NULL))) {
-       $value = $value;
-} else {
-       $value = elgg_echo('search');
-}
-
-$value = stripslashes($value);
-
-?>
-
-<form id="searchform" action="<?php echo $vars['url']; ?>pg/search/" method="get">
-       <input type="text" size="21" name="q" value="<?php echo $value; ?>" 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/search_box.php b/mod/search/views/default/search/search_box.php
new file mode 100644 (file)
index 0000000..d53efca
--- /dev/null
@@ -0,0 +1,20 @@
+<?php
+
+if (array_key_exists('value', $vars)) {
+       $value = $vars['value'];
+} elseif ($value = get_input('q', get_input('tag', NULL))) {
+       $value = $value;
+} else {
+       $value = elgg_echo('search');
+}
+
+$value = stripslashes($value);
+
+?>
+
+<div id="elgg_search">
+       <form id="searchform" action="<?php echo $vars['url']; ?>pg/search/" method="get">
+               <input type="text" size="21" name="q" value="<?php echo elgg_echo('search'); ?>" onblur="if (this.value=='') { this.value='<?php echo elgg_echo('search'); ?>' }" onfocus="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>
+</div>
\ No newline at end of file
index 5653686072ba34223ee9e5693da824b60357beb3..0f99334df52243f19d09d033dd5873db39fce13c 100644 (file)
                        // insert a view which can be extended
                        echo elgg_view('header/extend');
                ?>
-               
-               <div id="elgg_search">
-                       <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'); ?>" onblur="if (this.value=='') { this.value='<?php echo elgg_echo('search'); ?>' }" onfocus="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>
-               </div>
-
        </div>
 </div>
\ No newline at end of file
index 68a6950c228adaff6f1eb67b267e9533628a0ec2..2784f2629f29ef9b9a432e28eedcfc98327f7886 100644 (file)
@@ -2,6 +2,7 @@
 /**
  * Start html output.
  * The standard HTML header that displays across the site
+ *
  * @uses $vars['config'] The site configuration settings, imported
  * @uses $vars['title'] The page title
  * @uses $vars['body'] The main content of the page
@@ -57,7 +58,9 @@ $release = get_version(true);
 
        <?php
                echo $feedref;
-               echo elgg_view('metatags',$vars);
+               if (elgg_view_exists('metatags')) {
+                       echo elgg_view('metatags', $vars);
+               }
 
        // this was previously required because of an odd browser canvas drawing bug
        // in firefox.  It seems to not be require with the new layout...?
@@ -65,7 +68,6 @@ $release = get_version(true);
 //             jQuery(document).ready(function($) {
 //             });
 //     </script>
-
        ?>
 
 <?php