aboutsummaryrefslogtreecommitdiff
path: root/views/default
diff options
context:
space:
mode:
Diffstat (limited to 'views/default')
-rw-r--r--views/default/friends/picker.php20
-rw-r--r--views/default/page_elements/html_begin.php36
2 files changed, 30 insertions, 26 deletions
diff --git a/views/default/friends/picker.php b/views/default/friends/picker.php
index 9e1d556f6..78c10e394 100644
--- a/views/default/friends/picker.php
+++ b/views/default/friends/picker.php
@@ -9,9 +9,11 @@
* @uses $vars['entities'] The array of ElggUser objects
*/
-// Let the system know that the friends picker is in use
-global $pickerinuse;
-$pickerinuse = true;
+$base = elgg_get_site_url();
+$viewtype = elgg_get_viewtype();
+elgg_register_js("{$base}vendors/jquery/jquery.easing.1.3.packed.js", 'jquery.easing');
+elgg_register_js("{$base}_css/js.php?lastcache={$vars['config']->lastcache}&js=friendsPickerv1&viewtype=$viewtype", 'friendsPicker');
+
$chararray = elgg_echo('friendspicker:chararray');
// Initialise internalname
@@ -22,8 +24,12 @@ if (!isset($vars['internalname'])) {
}
// Are we highlighting default or all?
-if (empty($vars['highlight'])) $vars['highlight'] = 'default';
-if ($vars['highlight'] != 'all') $vars['highlight'] = 'default';
+if (empty($vars['highlight'])) {
+ $vars['highlight'] = 'default';
+}
+if ($vars['highlight'] != 'all') {
+ $vars['highlight'] = 'default';
+}
// Initialise values
if (!isset($vars['value'])) {
@@ -45,7 +51,9 @@ if (isset($vars['callback'])) {
// We need to count the number of friends pickers on the page.
if (!isset($vars['friendspicker'])) {
global $friendspicker;
- if (!isset($friendspicker)) $friendspicker = 0;
+ if (!isset($friendspicker)) {
+ $friendspicker = 0;
+ }
$friendspicker++;
} else {
$friendspicker = $vars['friendspicker'];
diff --git a/views/default/page_elements/html_begin.php b/views/default/page_elements/html_begin.php
index 9b4e79268..ebd4c008a 100644
--- a/views/default/page_elements/html_begin.php
+++ b/views/default/page_elements/html_begin.php
@@ -35,6 +35,9 @@ END;
$feedref = "";
}
+$js = elgg_get_js('head');
+$css = elgg_get_css();
+
// we won't trust server configuration but specify utf-8
header('Content-type: text/html; charset=utf-8');
@@ -50,29 +53,19 @@ $release = get_version(true);
<title><?php echo $title; ?></title>
<link rel="SHORTCUT ICON" href="<?php echo elgg_get_site_url(); ?>_graphics/favicon.ico" />
- <script type="text/javascript" src="<?php echo elgg_get_site_url(); ?>vendors/jquery/jquery-1.4.2.min.js"></script>
- <script type="text/javascript" src="<?php echo elgg_get_site_url(); ?>vendors/jquery/jquery-ui-1.7.2.min.js"></script>
- <script type="text/javascript" src="<?php echo elgg_get_site_url(); ?>vendors/jquery/jquery.form.js"></script>
- <script type="text/javascript" src="<?php echo elgg_get_site_url(); ?>_css/js.php?lastcache=<?php echo $vars['config']->lastcache; ?>&amp;js=initialise_elgg&amp;viewtype=<?php echo $vars['view']; ?>"></script>
-
- <?php
- echo elgg_view('scripts/initialize_elgg');
- echo $feedref;
- ?>
-
<?php
- global $pickerinuse;
- if (isset($pickerinuse) && $pickerinuse == true) {
+foreach ($js as $script) {
?>
- <!-- only needed on pages where we have friends collections and/or the friends picker -->
- <script type="text/javascript" src="<?php echo elgg_get_site_url(); ?>vendors/jquery/jquery.easing.1.3.packed.js"></script>
- <script type="text/javascript" src="<?php echo elgg_get_site_url(); ?>_css/js.php?lastcache=<?php echo $vars['config']->lastcache; ?>&amp;js=friendsPickerv1&amp;viewtype=<?php echo $vars['view']; ?>"></script>
+ <script type="text/javascript" src="<?php echo $script; ?>"></script>
<?php
- }
-?>
- <!-- include the default css file -->
- <link rel="stylesheet" href="<?php echo elgg_get_site_url(); ?>_css/css.css?lastcache=<?php echo $vars['config']->lastcache; ?>&amp;viewtype=<?php echo $vars['view']; ?>" type="text/css" />
+}
+foreach ($css as $link) {
+?>
+ <link rel="stylesheet" href="<?php echo $link; ?>" type="text/css" />
+<?php
+}
+?>
<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="<?php echo elgg_get_site_url(); ?>views/default/css_ie6.php" />
<![endif]-->
@@ -81,7 +74,10 @@ $release = get_version(true);
<link rel="stylesheet" type="text/css" href="<?php echo elgg_get_site_url(); ?>views/default/css_ie.php" />
<![endif]-->
<?php
- echo elgg_view('metatags', $vars);
+
+echo elgg_view('scripts/initialize_elgg');
+echo $feedref;
+echo elgg_view('metatags', $vars);
?>
</head>