aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/default/admin/plugins.php3
-rw-r--r--views/default/core/settings/account/name.php21
-rw-r--r--views/default/css/admin.php1
-rw-r--r--views/default/css/elements/components.php11
-rw-r--r--views/default/css/elements/core.php17
-rw-r--r--views/default/css/elements/forms.php2
-rw-r--r--views/default/css/elements/layout.php3
-rw-r--r--views/default/css/elements/modules.php15
-rw-r--r--views/default/css/elements/navigation.php33
-rw-r--r--views/default/css/elements/typography.php2
-rw-r--r--views/default/errors/404.php8
-rw-r--r--views/default/errors/default.php8
-rw-r--r--views/default/forms/admin/site/update_advanced.php2
-rw-r--r--views/default/forms/admin/site/update_basic.php2
-rw-r--r--views/default/forms/user/requestnewpassword.php2
-rw-r--r--views/default/graphics/ajax_loader.php12
-rw-r--r--views/default/input/userpicker.php1
-rw-r--r--views/default/js/admin.php45
-rw-r--r--views/default/js/lightbox.php4
-rw-r--r--views/default/navigation/menu/default.php13
-rw-r--r--views/default/navigation/menu/elements/item.php6
-rw-r--r--views/default/navigation/menu/elements/section.php17
-rw-r--r--views/default/navigation/menu/site.php9
-rw-r--r--views/default/navigation/pagination.php7
-rw-r--r--views/default/object/elements/summary.php4
-rw-r--r--views/default/object/plugin/full.php2
-rw-r--r--views/default/object/widget/elements/controls.php49
-rw-r--r--views/default/page/admin.php27
-rw-r--r--views/default/page/components/gallery.php2
-rw-r--r--views/default/page/default.php21
-rw-r--r--views/default/page/error.php14
-rw-r--r--views/default/page/layouts/error.php12
-rw-r--r--views/default/widgets/control_panel/content.php24
-rw-r--r--views/rss/page/components/gallery.php8
-rw-r--r--views/xml/xml-rpc/output.php11
35 files changed, 240 insertions, 178 deletions
diff --git a/views/default/admin/plugins.php b/views/default/admin/plugins.php
index c3e7e3ab0..b793175e0 100644
--- a/views/default/admin/plugins.php
+++ b/views/default/admin/plugins.php
@@ -8,6 +8,9 @@
* @subpackage Admin.Plugins
*/
+elgg_load_js('lightbox');
+elgg_load_css('lightbox');
+
elgg_generate_plugin_entities();
$installed_plugins = elgg_get_plugins('any');
$show_category = get_input('category', 'all');
diff --git a/views/default/core/settings/account/name.php b/views/default/core/settings/account/name.php
index 69ffcecaf..f719a84de 100644
--- a/views/default/core/settings/account/name.php
+++ b/views/default/core/settings/account/name.php
@@ -4,12 +4,23 @@
*
* @package Elgg
* @subpackage Core
-
-
*/
$user = elgg_get_page_owner_entity();
-
-// all hidden, but necessary for properly updating user details
-echo elgg_view('input/hidden', array('name' => 'name', 'value' => $user->name));
+?>
+<div class="elgg-module elgg-module-info">
+ <div class="elgg-head">
+ <h3><?php echo elgg_echo('user:name:label'); ?></h3>
+ </div>
+ <div class="elgg-body">
+ <p>
+ <?php echo elgg_echo('name'); ?>:
+ <?php
+ echo elgg_view('input/text', array('name' => 'name', 'value' => $user->name));
+ ?>
+ </p>
+ </div>
+</div>
+<?php
+// need the user's guid to make sure the correct user gets updated
echo elgg_view('input/hidden', array('name' => 'guid', 'value' => $user->guid));
diff --git a/views/default/css/admin.php b/views/default/css/admin.php
index c02d43512..dc1b503cb 100644
--- a/views/default/css/admin.php
+++ b/views/default/css/admin.php
@@ -138,6 +138,7 @@ p {
visibility: hidden;
height: 0 !important;
line-height: 0;
+ overflow: hidden;
font-size: xx-large;
content: " x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x ";
}
diff --git a/views/default/css/elements/components.php b/views/default/css/elements/components.php
index f675ab7cb..77313fa1a 100644
--- a/views/default/css/elements/components.php
+++ b/views/default/css/elements/components.php
@@ -7,17 +7,6 @@
* @package Elgg.Core
* @subpackage UI
*/
-/**
- * elgg-body fills the space available to it.
- * It uses hidden text to expand itself. The combination of auto width, overflow
- * hidden, and the hidden text creates this effect.
- *
- * This allows us to float fixed width divs to either side of an .elgg-body div
- * without having to specify the body div's width.
- *
- * @todo check what happens with long <pre> tags or large images
- * @todo Move this to its own file -- it is very complicated and should not have to be overridden.
- */
?>
/* ***************************************
diff --git a/views/default/css/elements/core.php b/views/default/css/elements/core.php
index ace6048bb..74f21ee59 100644
--- a/views/default/css/elements/core.php
+++ b/views/default/css/elements/core.php
@@ -46,13 +46,28 @@
*overflow:visible;
}
-<?php //@todo isn't this only needed if we use display:table-cell? ?>
+<?php
+/**
+ * elgg-body fills the space available to it.
+ * It uses hidden text to expand itself. The combination of auto width, overflow
+ * hidden, and the hidden text creates this effect.
+ *
+ * This allows us to float fixed width divs to either side of an .elgg-body div
+ * without having to specify the body div's width.
+ *
+ * @todo check what happens with long <pre> tags or large images
+ * @todo Move this to its own file -- it is very complicated and should not have to be overridden.
+ */
+
+//@todo isn't this only needed if we use display:table-cell?
+?>
.elgg-body:after,
.elgg-col-last:after {
display: block;
visibility: hidden;
height: 0 !important;
line-height: 0;
+ overflow: hidden;
/* Stretch to fill up available space */
font-size: xx-large;
diff --git a/views/default/css/elements/forms.php b/views/default/css/elements/forms.php
index e358c86e7..81db81747 100644
--- a/views/default/css/elements/forms.php
+++ b/views/default/css/elements/forms.php
@@ -41,7 +41,7 @@ input, textarea {
box-sizing: border-box;
}
-input:focus, textarea:focus {
+input[type=text]:focus, textarea:focus {
border: solid 1px #4690d6;
background: #e4ecf5;
color:#333;
diff --git a/views/default/css/elements/layout.php b/views/default/css/elements/layout.php
index 42d898439..25a2bffb7 100644
--- a/views/default/css/elements/layout.php
+++ b/views/default/css/elements/layout.php
@@ -81,6 +81,9 @@
.elgg-layout-two-sidebar {
background: transparent url(<?php echo elgg_get_site_url(); ?>_graphics/two_sidebar_background.gif) repeat-y right top;
}
+.elgg-layout-error {
+ margin-top: 20px;
+}
.elgg-sidebar {
position: relative;
padding: 20px 10px;
diff --git a/views/default/css/elements/modules.php b/views/default/css/elements/modules.php
index ef85d4dd5..7750c208f 100644
--- a/views/default/css/elements/modules.php
+++ b/views/default/css/elements/modules.php
@@ -158,16 +158,7 @@
.elgg-module-widget.elgg-state-draggable > .elgg-head {
cursor: move;
}
-.elgg-module-widget > .elgg-head a {
- position: absolute;
- top: 4px;
- display: inline-block;
- width: 18px;
- height: 18px;
- padding: 2px 2px 0 0;
-}
a.elgg-widget-collapse-button {
- left: 5px;
color: #c5c5c5;
}
a.elgg-widget-collapse-button:hover,
@@ -181,12 +172,6 @@ a.elgg-widget-collapse-button:before {
a.elgg-widget-collapsed:before {
content: "\25BA";
}
-a.elgg-widget-delete-button {
- right: 5px;
-}
-a.elgg-widget-edit-button {
- right: 25px;
-}
.elgg-module-widget > .elgg-body {
background-color: white;
width: 100%;
diff --git a/views/default/css/elements/navigation.php b/views/default/css/elements/navigation.php
index bf1046dda..62f370069 100644
--- a/views/default/css/elements/navigation.php
+++ b/views/default/css/elements/navigation.php
@@ -130,9 +130,9 @@
}
.elgg-menu-topbar > li > a {
- padding: 2px 15px 0;
+ padding-top: 2px;
color: #eee;
- margin-top: 1px;
+ margin: 1px 15px 0;
}
.elgg-menu-topbar > li > a:hover {
@@ -372,7 +372,10 @@
position: absolute;
z-index: 10000;
- width: 165px;
+ overflow: hidden;
+
+ min-width: 165px;
+ max-width: 250px;
border: solid 1px;
border-color: #E5E5E5 #999 #999 #E5E5E5;
background-color: #FFF;
@@ -531,4 +534,26 @@
*************************************** */
.elgg-menu-extras {
margin-bottom: 15px;
-} \ No newline at end of file
+}
+
+/* ***************************************
+ WIDGET MENU
+*************************************** */
+.elgg-menu-widget > li {
+ position: absolute;
+ top: 4px;
+ display: inline-block;
+ width: 18px;
+ height: 18px;
+ padding: 2px 2px 0 0;
+}
+
+.elgg-menu-widget > .elgg-menu-item-collapse {
+ left: 5px;
+}
+.elgg-menu-widget > .elgg-menu-item-delete {
+ right: 5px;
+}
+.elgg-menu-widget > .elgg-menu-item-settings {
+ right: 25px;
+}
diff --git a/views/default/css/elements/typography.php b/views/default/css/elements/typography.php
index f080a29b2..d93b28d2c 100644
--- a/views/default/css/elements/typography.php
+++ b/views/default/css/elements/typography.php
@@ -139,7 +139,7 @@ h6 { font-size: 0.8em; }
.elgg-output dt { font-weight: bold }
.elgg-output dd { margin: 0 0 1em 1em }
-.elgg-output ul, ol {
+.elgg-output ul, .elgg-output ol {
margin: 0 1.5em 1.5em 0;
padding-left: 1.5em;
}
diff --git a/views/default/errors/404.php b/views/default/errors/404.php
new file mode 100644
index 000000000..8bc35acdd
--- /dev/null
+++ b/views/default/errors/404.php
@@ -0,0 +1,8 @@
+<?php
+/**
+ * Page not found error
+ */
+
+$message = elgg_echo('error:404');
+
+echo "<h2>$message</h2>";
diff --git a/views/default/errors/default.php b/views/default/errors/default.php
new file mode 100644
index 000000000..a0582eba2
--- /dev/null
+++ b/views/default/errors/default.php
@@ -0,0 +1,8 @@
+<?php
+/**
+ * General error
+ */
+
+$message = elgg_echo('error:default');
+
+echo "<h2>$message</h2>";
diff --git a/views/default/forms/admin/site/update_advanced.php b/views/default/forms/admin/site/update_advanced.php
index e12764092..5155fc415 100644
--- a/views/default/forms/admin/site/update_advanced.php
+++ b/views/default/forms/admin/site/update_advanced.php
@@ -91,7 +91,7 @@ $form_body .= "</div>";
$form_body .= elgg_view('input/hidden', array('name' => 'settings', 'value' => 'go'));
-$form_body .= '<div class="elgg-divide-top">';
+$form_body .= '<div class="elgg-foot">';
$form_body .= elgg_view('input/submit', array('value' => elgg_echo("save")));
$form_body .= '</div>';
diff --git a/views/default/forms/admin/site/update_basic.php b/views/default/forms/admin/site/update_basic.php
index 66722aef2..88870bc60 100644
--- a/views/default/forms/admin/site/update_basic.php
+++ b/views/default/forms/admin/site/update_basic.php
@@ -24,7 +24,7 @@ $form_body .= elgg_view("input/dropdown", array(
'options_values' => $languages,
)) . "</div>";
-$form_body .= '<div class="elgg-divide-top">';
+$form_body .= '<div class="elgg-foot">';
$form_body .= elgg_view('input/submit', array('value' => elgg_echo("save")));
$form_body .= '</div>';
diff --git a/views/default/forms/user/requestnewpassword.php b/views/default/forms/user/requestnewpassword.php
index 8a5a18734..c90971eaf 100644
--- a/views/default/forms/user/requestnewpassword.php
+++ b/views/default/forms/user/requestnewpassword.php
@@ -11,7 +11,7 @@
<?php echo elgg_echo('user:password:text'); ?>
</div>
<div>
- <label><?php echo elgg_echo('username'); ?></label><br />
+ <label><?php echo elgg_echo('loginusername'); ?></label><br />
<?php echo elgg_view('input/text', array(
'name' => 'username',
'class' => 'elgg-autofocus',
diff --git a/views/default/graphics/ajax_loader.php b/views/default/graphics/ajax_loader.php
index 1a9046178..d5ce87ea9 100644
--- a/views/default/graphics/ajax_loader.php
+++ b/views/default/graphics/ajax_loader.php
@@ -6,6 +6,7 @@
* @subpackage Core
*
* @uses $vars['id'] CSS id
+ * @uses $vars['class'] Optional additional CSS class
* @uses $vars['hidden'] Begin hidden? (true)
*/
@@ -13,15 +14,18 @@ if (isset($vars['id'])) {
$id = "id=\"{$vars['id']}\"";
}
+$class = 'elgg-ajax-loader';
+if (isset($vars['class'])) {
+ $class = "$class {$vars['class']}";
+}
+
if (elgg_extract('hidden', $vars, true)) {
- $hidden = 'hidden';
-} else {
- $hidden = '';
+ $class = "$class hidden";
}
$loader = <<< END
-<div class="elgg-ajax-loader $hidden" $id></div>
+<div class="$class" $id></div>
END;
diff --git a/views/default/input/userpicker.php b/views/default/input/userpicker.php
index 246c462da..91a397e37 100644
--- a/views/default/input/userpicker.php
+++ b/views/default/input/userpicker.php
@@ -20,6 +20,7 @@
*/
elgg_load_js('elgg.userpicker');
+elgg_load_js('jquery.ui.autocomplete.html');
function user_picker_add_user($user_id) {
$user = get_entity($user_id);
diff --git a/views/default/js/admin.php b/views/default/js/admin.php
index d4dd06822..5cefba512 100644
--- a/views/default/js/admin.php
+++ b/views/default/js/admin.php
@@ -17,9 +17,6 @@ elgg.admin.init = function () {
$(this).stop().slideUp('medium');
});
- // plugin screenshot modal
- $('.elgg-plugin-screenshot a').click(elgg.admin.displayPluginScreenshot);
-
// draggable plugin reordering
$('#elgg-plugin-list > ul').sortable({
items: 'li:has(> .elgg-state-draggable)',
@@ -74,48 +71,6 @@ elgg.admin.movePlugin = function(e, ui) {
};
/**
- * Display a plugin screenshot.
- *
- * @param {Object} e The event object.
- * @return void
- */
-elgg.admin.displayPluginScreenshot = function(e) {
- e.preventDefault();
- var lb = $('.elgg-plugin-screenshot-lightbox');
-
- if (lb.length < 1) {
- $('body').append('<div class="elgg-plugin-screenshot-lightbox"></div>');
- lb = $('.elgg-plugin-screenshot-lightbox');
-
- lb.click(function() {
- lb.hide();
- });
-
- $(document).click(function(e) {
- var target = $(e.target);
- if (target.is('a') && target.hasClass('elgg-plugin-screenshot-lightbox')) {
- lb.hide();
- e.preventDefault();
- }
- });
- }
-
- var html = '<img class="pas" src="' + $(this).attr('href') + '">';
- var desc = $(this).find('img').attr('alt');
-
- if (desc) {
- html = '<h2 class="pam">' + desc + '</h2>' + html;
- }
-
- lb.html(html);
-
- top_pos = $(window).scrollTop() + 10 + 'px';
- left_pos = $(window).scrollLeft() + 5 + 'px';
-
- lb.css('top', top_pos).css('left', left_pos).show();
-};
-
-/**
* In-line editing for custom profile fields
*
* @param string value The new value
diff --git a/views/default/js/lightbox.php b/views/default/js/lightbox.php
index 5f3764756..c45d46098 100644
--- a/views/default/js/lightbox.php
+++ b/views/default/js/lightbox.php
@@ -5,6 +5,10 @@
* Usage
* Apply the class elgg-lightbox to links.
*
+ * Advanced Usage
+ * Elgg is distributed with the Fancybox jQuery library. Please go to
+ * http://fancybox.net for more information on the options of this lightbox.
+ *
* Overriding
* In a plugin, override this view and override the registration for the
* lightbox JavaScript and CSS (@see elgg_views_boot()).
diff --git a/views/default/navigation/menu/default.php b/views/default/navigation/menu/default.php
index 0fa391433..006deb3ea 100644
--- a/views/default/navigation/menu/default.php
+++ b/views/default/navigation/menu/default.php
@@ -2,15 +2,17 @@
/**
* Default menu
*
- * @uses $vars['name']
- * @uses $vars['menu']
- * @uses $vars['class']
- * @uses $vars['show_section_headers']
+ * @uses $vars['name'] Name of the menu
+ * @uses $vars['menu'] Array of menu items
+ * @uses $vars['class'] Additional CSS class for the menu
+ * @uses $vars['item_class'] Additional CSS class for each menu item
+ * @uses $vars['show_section_headers'] Do we show headers for each section?
*/
// we want css classes to use dashes
$vars['name'] = preg_replace('/[^a-z0-9\-]/i', '-', $vars['name']);
$headers = elgg_extract('show_section_headers', $vars, false);
+$item_class = elgg_extract('item_class', $vars, '');
$class = "elgg-menu elgg-menu-{$vars['name']}";
if (isset($vars['class'])) {
@@ -23,6 +25,7 @@ foreach ($vars['menu'] as $section => $menu_items) {
'class' => "$class elgg-menu-{$vars['name']}-$section",
'section' => $section,
'name' => $vars['name'],
- 'show_section_headers' => $headers
+ 'show_section_headers' => $headers,
+ 'item_class' => $item_class,
));
}
diff --git a/views/default/navigation/menu/elements/item.php b/views/default/navigation/menu/elements/item.php
index 5d6a7e367..22383ce0b 100644
--- a/views/default/navigation/menu/elements/item.php
+++ b/views/default/navigation/menu/elements/item.php
@@ -4,6 +4,9 @@
*
* @package Elgg.Core
* @subpackage Navigation
+ *
+ * @uses $vars['item'] ElggMenuItem
+ * @uses $vars['item_class'] Additional CSS class for the menu item
*/
$item = $vars['item'];
@@ -21,6 +24,9 @@ if ($children) {
}
$item_class = $item->getItemClass();
+if (isset($vars['item_class']) && $vars['item_class']) {
+ $item_class .= ' ' . $vars['item_class'];
+}
echo "<li class=\"$item_class\">";
echo $item->getContent();
diff --git a/views/default/navigation/menu/elements/section.php b/views/default/navigation/menu/elements/section.php
index 92a259776..c0e9ba750 100644
--- a/views/default/navigation/menu/elements/section.php
+++ b/views/default/navigation/menu/elements/section.php
@@ -2,15 +2,17 @@
/**
* Menu group
*
- * @uses $vars['items']
- * @uses $vars['class']
- * @uses $vars['name']
- * @uses $vars['section']
- * @uses $vars['show_section_headers']
+ * @uses $vars['items'] Array of menu items
+ * @uses $vars['class'] Additional CSS class for the section
+ * @uses $vars['name'] Name of the menu
+ * @uses $vars['section'] The section name
+ * @uses $vars['item_class'] Additional CSS class for each menu item
+ * @uses $vars['show_section_headers'] Do we show headers for each section
*/
$headers = elgg_extract('show_section_headers', $vars, false);
$class = elgg_extract('class', $vars, '');
+$item_class = elgg_extract('item_class', $vars, '');
if ($headers) {
$name = elgg_extract('name', $vars);
@@ -20,6 +22,9 @@ if ($headers) {
echo "<ul class=\"$class\">";
foreach ($vars['items'] as $menu_item) {
- echo elgg_view('navigation/menu/elements/item', array('item' => $menu_item));
+ echo elgg_view('navigation/menu/elements/item', array(
+ 'item' => $menu_item,
+ 'item_class' => $item_class,
+ ));
}
echo '</ul>';
diff --git a/views/default/navigation/menu/site.php b/views/default/navigation/menu/site.php
index 38b42bda9..24c21dd57 100644
--- a/views/default/navigation/menu/site.php
+++ b/views/default/navigation/menu/site.php
@@ -6,12 +6,15 @@
* @uses $vars['menu']['more']
*/
+$default_items = elgg_extract('default', $vars['menu'], array());
+$more_items = elgg_extract('more', $vars['menu'], array());
+
echo '<ul class="elgg-menu elgg-menu-site elgg-menu-site-default clearfix">';
-foreach ($vars['menu']['default'] as $menu_item) {
+foreach ($default_items as $menu_item) {
echo elgg_view('navigation/menu/elements/item', array('item' => $menu_item));
}
-if (isset($vars['menu']['more']) && !empty($vars['menu']['more'])) {
+if ($more_items) {
echo '<li class="elgg-more">';
$more = elgg_echo('more');
@@ -19,7 +22,7 @@ if (isset($vars['menu']['more']) && !empty($vars['menu']['more'])) {
echo elgg_view('navigation/menu/elements/section', array(
'class' => 'elgg-menu elgg-menu-site elgg-menu-site-more',
- 'items' => $vars['menu']['more'],
+ 'items' => $more_items,
));
echo '</li>';
diff --git a/views/default/navigation/pagination.php b/views/default/navigation/pagination.php
index 4df5cf575..ad4689d83 100644
--- a/views/default/navigation/pagination.php
+++ b/views/default/navigation/pagination.php
@@ -25,7 +25,12 @@ if (!$limit = (int) elgg_extract('limit', $vars, 10)) {
$count = (int) elgg_extract('count', $vars, 0);
$offset_key = elgg_extract('offset_key', $vars, 'offset');
-$base_url = elgg_extract('baseurl', $vars, current_page_url());
+// some views pass an empty string for base_url
+if (isset($vars['base_url']) && $vars['base_url']) {
+ $base_url = $vars['base_url'];
+} else {
+ $base_url = current_page_url();
+}
$num_pages = elgg_extract('num_pages', $vars, 10);
$delta = ceil($num_pages / 2);
diff --git a/views/default/object/elements/summary.php b/views/default/object/elements/summary.php
index 8d82bc52a..22db03f51 100644
--- a/views/default/object/elements/summary.php
+++ b/views/default/object/elements/summary.php
@@ -46,7 +46,9 @@ if ($tags !== false) {
if ($metadata) {
echo $metadata;
}
-echo "<h3>$title_link</h3>";
+if ($title_link) {
+ echo "<h3>$title_link</h3>";
+}
echo "<div class=\"elgg-subtext\">$subtitle</div>";
echo $tags;
diff --git a/views/default/object/plugin/full.php b/views/default/object/plugin/full.php
index db4e4dbcc..8955178a6 100644
--- a/views/default/object/plugin/full.php
+++ b/views/default/object/plugin/full.php
@@ -156,7 +156,7 @@ if ($screenshots) {
$screenshot_full = "{$vars['url']}admin_plugin_screenshot/{$plugin->getID()}/full/{$screenshot['path']}";
$screenshot_src = "{$vars['url']}admin_plugin_screenshot/{$plugin->getID()}/thumbnail/{$screenshot['path']}";
- $screenshots_html .= "<li class=\"elgg-plugin-screenshot prm ptm\"><a href=\"$screenshot_full\">"
+ $screenshots_html .= "<li class=\"elgg-plugin-screenshot prm ptm\"><a class=\"elgg-lightbox\" href=\"$screenshot_full\">"
. "<img src=\"$screenshot_src\" alt=\"$alt\"></a></li>";
}
}
diff --git a/views/default/object/widget/elements/controls.php b/views/default/object/widget/elements/controls.php
index 6d06d28bc..d1d630c4f 100644
--- a/views/default/object/widget/elements/controls.php
+++ b/views/default/object/widget/elements/controls.php
@@ -6,44 +6,11 @@
* @uses $vars['show_edit'] Whether to show the edit button (true)
*/
-$widget = $vars['widget'];
-$show_edit = elgg_extract('show_edit', $vars, true);
-
-$params = array(
- 'text' => ' ',
- 'href' => "#elgg-widget-content-$widget->guid",
- 'class' => 'elgg-widget-collapse-button',
- 'rel' => 'toggle',
-);
-$collapse_link = elgg_view('output/url', $params);
-
-$delete_link = $edit_link = '';
-if ($widget->canEdit()) {
- $params = array(
- 'text' => elgg_view_icon('delete-alt'),
- 'title' => elgg_echo('widget:delete', array($widget->getTitle())),
- 'href' => "action/widgets/delete?guid=$widget->guid",
- 'is_action' => true,
- 'is_trusted' => true,
- 'class' => 'elgg-widget-delete-button',
- 'id' => "elgg-widget-delete-button-$widget->guid"
- );
- $delete_link = elgg_view('output/url', $params);
-
- if ($show_edit) {
- $params = array(
- 'text' => elgg_view_icon('settings-alt'),
- 'title' => elgg_echo('widget:edit'),
- 'href' => "#widget-edit-$widget->guid",
- 'class' => "elgg-widget-edit-button",
- 'rel' => 'toggle',
- );
- $edit_link = elgg_view('output/url', $params);
- }
-}
-
-echo <<<___END
- $collapse_link
- $delete_link
- $edit_link
-___END;
+echo elgg_view_menu('widget', array(
+ 'entity' => elgg_extract('widget', $vars),
+ 'params' => array(
+ 'show_edit' => elgg_extract('show_edit', $vars, true)
+ ),
+ 'sort_by' => 'priority',
+ 'class' => 'elgg-menu-hz',
+));
diff --git a/views/default/page/admin.php b/views/default/page/admin.php
index cd03541d5..7045edd91 100644
--- a/views/default/page/admin.php
+++ b/views/default/page/admin.php
@@ -5,16 +5,11 @@
* @package Elgg
* @subpackage Core
*
- * @uses $vars['title'] The page title
- * @uses $vars['body'] The main content of the page
+ * @uses $vars['title'] The page title
+ * @uses $vars['body'] The main content of the page
* @uses $vars['sysmessages'] A 2d array of various message registers, passed from system_messages()
*/
-// Set the content type
-header("Content-type: text/html; charset=UTF-8");
-
-$messages = $vars['sysmessages'];
-
$notices_html = '';
$notices = elgg_get_admin_notices();
if ($notices) {
@@ -25,6 +20,16 @@ if ($notices) {
$notices_html = "<div class=\"elgg-admin-notices\">$notices_html</div>";
}
+// render content before head so that JavaScript and CSS can be loaded. See #4032
+$messages = elgg_view('page/elements/messages', array('object' => $vars['sysmessages']));
+$header = elgg_view('admin/header', $vars);
+$body = $vars['body'];
+$footer = elgg_view('admin/footer', $vars);
+
+
+// Set the content type
+header("Content-type: text/html; charset=UTF-8");
+
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
@@ -36,21 +41,21 @@ if ($notices) {
<div class="elgg-inner">
<div class="elgg-page-header">
<div class="elgg-inner clearfix">
- <?php echo elgg_view('admin/header'); ?>
+ <?php echo $header; ?>
</div>
</div>
<div class="elgg-page-messages">
- <?php echo elgg_view('page/elements/messages', array('object' => $messages)); ?>
+ <?php echo $messages; ?>
<?php echo $notices_html; ?>
</div>
<div class="elgg-page-body">
<div class="elgg-inner">
- <?php echo $vars['body']; ?>
+ <?php echo $body; ?>
</div>
</div>
<div class="elgg-page-footer">
<div class="elgg-inner">
- <?php echo elgg_view('admin/footer'); ?>
+ <?php echo $footer; ?>
</div>
</div>
</div>
diff --git a/views/default/page/components/gallery.php b/views/default/page/components/gallery.php
index 149ceeaf8..e8b3f477e 100644
--- a/views/default/page/components/gallery.php
+++ b/views/default/page/components/gallery.php
@@ -16,7 +16,7 @@
*/
$items = $vars['items'];
-if (!is_array($items) && sizeof($items) == 0) {
+if (!is_array($items) || sizeof($items) == 0) {
return true;
}
diff --git a/views/default/page/default.php b/views/default/page/default.php
index 0e27cda52..892069fad 100644
--- a/views/default/page/default.php
+++ b/views/default/page/default.php
@@ -6,8 +6,8 @@
* @package Elgg
* @subpackage Core
*
- * @uses $vars['title'] The page title
- * @uses $vars['body'] The main content of the page
+ * @uses $vars['title'] The page title
+ * @uses $vars['body'] The main content of the page
* @uses $vars['sysmessages'] A 2d array of various message registers, passed from system_messages()
*/
@@ -21,6 +21,13 @@ if (elgg_get_context() == 'admin') {
return true;
}
+// render content before head so that JavaScript and CSS can be loaded. See #4032
+$topbar = elgg_view('page/elements/topbar', $vars);
+$messages = elgg_view('page/elements/messages', array('object' => $vars['sysmessages']));
+$header = elgg_view('page/elements/header', $vars);
+$body = elgg_view('page/elements/body', $vars);
+$footer = elgg_view('page/elements/footer', $vars);
+
// Set the content type
header("Content-type: text/html; charset=UTF-8");
@@ -33,30 +40,30 @@ header("Content-type: text/html; charset=UTF-8");
<body>
<div class="elgg-page elgg-page-default">
<div class="elgg-page-messages">
- <?php echo elgg_view('page/elements/messages', array('object' => $vars['sysmessages'])); ?>
+ <?php echo $messages; ?>
</div>
<?php if (elgg_is_logged_in()): ?>
<div class="elgg-page-topbar">
<div class="elgg-inner">
- <?php echo elgg_view('page/elements/topbar', $vars); ?>
+ <?php echo $topbar; ?>
</div>
</div>
<?php endif; ?>
<div class="elgg-page-header">
<div class="elgg-inner">
- <?php echo elgg_view('page/elements/header', $vars); ?>
+ <?php echo $header; ?>
</div>
</div>
<div class="elgg-page-body">
<div class="elgg-inner">
- <?php echo elgg_view('page/elements/body', $vars); ?>
+ <?php echo $body; ?>
</div>
</div>
<div class="elgg-page-footer">
<div class="elgg-inner">
- <?php echo elgg_view('page/elements/footer', $vars); ?>
+ <?php echo $footer; ?>
</div>
</div>
</div>
diff --git a/views/default/page/error.php b/views/default/page/error.php
new file mode 100644
index 000000000..b7ba3ae9b
--- /dev/null
+++ b/views/default/page/error.php
@@ -0,0 +1,14 @@
+<?php
+/**
+ * Page shell for errors
+ *
+ * This is for errors that are not unhandled exceptions. Those are handled
+ * through the failsafe viewtype to guarantee that no further exceptions occur.
+ * An example error would be 404 (page not found).
+ *
+ * @uses $vars['title'] The page title
+ * @uses $vars['body'] The main content of the page
+ * @uses $vars['sysmessages'] A 2d array of various message registers, passed from system_messages()
+ */
+
+echo elgg_view('page/default', $vars);
diff --git a/views/default/page/layouts/error.php b/views/default/page/layouts/error.php
new file mode 100644
index 000000000..cdce28a8e
--- /dev/null
+++ b/views/default/page/layouts/error.php
@@ -0,0 +1,12 @@
+<?php
+/**
+ * Error layout
+ */
+
+$class = 'elgg-layout-error';
+if (isset($vars['class'])) {
+ $class = "$class {$vars['class']}";
+}
+$vars['class'] = $class;
+
+echo elgg_view('page/layouts/one_column', $vars);
diff --git a/views/default/widgets/control_panel/content.php b/views/default/widgets/control_panel/content.php
new file mode 100644
index 000000000..d2db54bc6
--- /dev/null
+++ b/views/default/widgets/control_panel/content.php
@@ -0,0 +1,24 @@
+<?php
+/**
+ * Admin control panel widget
+ */
+
+elgg_register_menu_item('admin_control_panel', array(
+ 'name' => 'flush',
+ 'text' => elgg_echo('admin:cache:flush'),
+ 'href' => 'action/admin/site/flush_cache',
+ 'is_action' => true,
+ 'link_class' => 'elgg-button elgg-button-action',
+));
+
+elgg_register_menu_item('admin_control_panel', array(
+ 'name' => 'upgrade',
+ 'text' => elgg_echo('upgrade'),
+ 'href' => 'upgrade.php',
+ 'link_class' => 'elgg-button elgg-button-action',
+));
+
+echo elgg_view_menu('admin_control_panel', array(
+ 'class' => 'elgg-menu-hz',
+ 'item_class' => 'mrm',
+));
diff --git a/views/rss/page/components/gallery.php b/views/rss/page/components/gallery.php
new file mode 100644
index 000000000..690416e5b
--- /dev/null
+++ b/views/rss/page/components/gallery.php
@@ -0,0 +1,8 @@
+<?php
+/*
+ * RSS gallery view
+ *
+ * @uses $vars['items']
+ */
+
+echo elgg_view('page/components/list', $vars);
diff --git a/views/xml/xml-rpc/output.php b/views/xml/xml-rpc/output.php
deleted file mode 100644
index 4276029d1..000000000
--- a/views/xml/xml-rpc/output.php
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-/**
- * Elgg XML output for XML-RPC
- *
- * @package Elgg
- * @subpackage Core
- */
-
-$result = $vars['result'];
-
-echo "$result"; \ No newline at end of file