aboutsummaryrefslogtreecommitdiff
path: root/views/default
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2013-02-14 14:02:41 +0100
committerSem <sembrestels@riseup.net>2013-02-14 14:02:41 +0100
commitc6bf8d8ab9463722da4e1e0323c3383e08b8924e (patch)
tree975d1bf211346000aab5e69d6e3478cd417084cd /views/default
parenteedfbb15b8d1e81e2e11b34f02b68df6700b288d (diff)
downloadelgg-c6bf8d8ab9463722da4e1e0323c3383e08b8924e.tar.gz
elgg-c6bf8d8ab9463722da4e1e0323c3383e08b8924e.tar.bz2
Using correct language in html tag and putting a placeholder in the search box.
Diffstat (limited to 'views/default')
-rw-r--r--views/default/page/admin.php4
-rw-r--r--views/default/page/default.php4
-rw-r--r--views/default/page/elements/head.php8
-rw-r--r--views/default/page/walled_garden.php4
-rw-r--r--views/default/search/search_box.php41
5 files changed, 50 insertions, 11 deletions
diff --git a/views/default/page/admin.php b/views/default/page/admin.php
index 7d0449096..a6d6bf6e1 100644
--- a/views/default/page/admin.php
+++ b/views/default/page/admin.php
@@ -32,7 +32,7 @@ header("Content-type: text/html; charset=UTF-8");
?>
<!DOCTYPE html>
-<html lang="en">
+<html lang="<?php echo get_current_language(); ?>">
<head>
<?php echo elgg_view('page/elements/head', $vars); ?>
</head>
@@ -63,4 +63,4 @@ header("Content-type: text/html; charset=UTF-8");
<?php echo elgg_view('page/elements/foot'); ?>
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/views/default/page/default.php b/views/default/page/default.php
index f75fa1908..a0e6d4037 100644
--- a/views/default/page/default.php
+++ b/views/default/page/default.php
@@ -35,7 +35,7 @@ header("Content-type: text/html; charset=UTF-8");
?>
<!DOCTYPE html>
-<html lang="en">
+<html lang="<?php echo get_current_language(); ?>">
<head>
<?php echo elgg_view('page/elements/head', $vars); ?>
</head>
@@ -71,4 +71,4 @@ header("Content-type: text/html; charset=UTF-8");
</div>
<?php echo elgg_view('page/elements/foot'); ?>
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/views/default/page/elements/head.php b/views/default/page/elements/head.php
index b1556b547..e7951c4ff 100644
--- a/views/default/page/elements/head.php
+++ b/views/default/page/elements/head.php
@@ -14,7 +14,7 @@ if (empty($vars['title'])) {
global $autofeed;
if (isset($autofeed) && $autofeed == true) {
- $url = full_url();
+ $url = current_page_url();
if (substr_count($url,'?')) {
$url .= "&view=rss";
} else {
@@ -33,12 +33,10 @@ END;
$js = elgg_get_loaded_js('head');
$css = elgg_get_loaded_css();
-$version = get_version();
$release = get_version(true);
?>
<meta charset="utf-8" />
- <meta name="ElggRelease" content="<?php echo $release; ?>" />
- <meta name="ElggVersion" content="<?php echo $version; ?>" />
+ <meta name="generator" content="Elgg <?php echo $release; ?>" />
<title><?php echo $title; ?></title>
<?php echo elgg_view('page/elements/shortcut_icon', $vars); ?>
@@ -76,4 +74,4 @@ $metatags = elgg_view('metatags', $vars);
if ($metatags) {
elgg_deprecated_notice("The metatags view has been deprecated. Extend page/elements/head instead", 1.8);
echo $metatags;
-} \ No newline at end of file
+}
diff --git a/views/default/page/walled_garden.php b/views/default/page/walled_garden.php
index e1d57dac8..77c901d8c 100644
--- a/views/default/page/walled_garden.php
+++ b/views/default/page/walled_garden.php
@@ -9,7 +9,7 @@
header("Content-type: text/html; charset=UTF-8");
?>
<!DOCTYPE html>
-<html lang="en">
+<html lang="<?php echo get_current_language(); ?>">
<head>
<?php echo elgg_view('page/elements/head', $vars); ?>
</head>
@@ -24,4 +24,4 @@ header("Content-type: text/html; charset=UTF-8");
</div>
<?php echo elgg_view('page/elements/foot'); ?>
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/views/default/search/search_box.php b/views/default/search/search_box.php
new file mode 100644
index 000000000..c1ea40705
--- /dev/null
+++ b/views/default/search/search_box.php
@@ -0,0 +1,41 @@
+<?php
+/**
+ * Search box
+ *
+ * @uses $vars['value'] Current search query
+ * @uses $vars['class'] Additional class
+ */
+
+if (array_key_exists('value', $vars)) {
+ $value = $vars['value'];
+} elseif ($value = get_input('q', get_input('tag', NULL))) {
+ $value = $value;
+}
+
+$class = "elgg-search";
+if (isset($vars['class'])) {
+ $class = "$class {$vars['class']}";
+}
+
+// @todo - why the strip slashes?
+$value = stripslashes($value);
+
+// @todo - create function for sanitization of strings for display in 1.8
+// encode <,>,&, quotes and characters above 127
+if (function_exists('mb_convert_encoding')) {
+ $display_query = mb_convert_encoding($value, 'HTML-ENTITIES', 'UTF-8');
+} else {
+ // if no mbstring extension, we just strip characters
+ $display_query = preg_replace("/[^\x01-\x7F]/", "", $value);
+}
+$display_query = htmlspecialchars($display_query, ENT_QUOTES, 'UTF-8', false);
+
+?>
+
+<form class="<?php echo $class; ?>" action="<?php echo elgg_get_site_url(); ?>search" method="get">
+ <fieldset>
+ <input type="text" class="search-input" size="21" name="q" value="<?php echo $display_query; ?>" placeholder="<?php echo elgg_echo('search'); ?>" />
+ <input type="hidden" name="search_type" value="all" />
+ <input type="submit" value="<?php echo elgg_echo('search:go'); ?>" class="search-submit-button" />
+ </fieldset>
+</form>