From c8f62956115245d023c5f049524e450f3fbcd5d6 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Mon, 7 Nov 2011 20:31:07 -0500 Subject: Refs #4007 previous solution to admin population in ElggUser was throwing warnings --- views/default/js/initialize_elgg.php | 1 + 1 file changed, 1 insertion(+) (limited to 'views') diff --git a/views/default/js/initialize_elgg.php b/views/default/js/initialize_elgg.php index 09e0b27bc..f8234f84f 100644 --- a/views/default/js/initialize_elgg.php +++ b/views/default/js/initialize_elgg.php @@ -41,6 +41,7 @@ if ($user instanceof ElggUser) { $user_json['subtype'] = $user->getSubtype(); $user_json['url'] = $user->getURL(); + $user_json['admin'] = $user->isAdmin(); echo 'elgg.session.user = new elgg.ElggUser(' . json_encode($user_json) . ');'; } -- cgit v1.2.3 From 42e3a3353eb524fc984f72e2b525d5597444d1aa Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Tue, 8 Nov 2011 06:28:14 -0500 Subject: Refs #3150 can pass description to RSS page shell --- views/rss/page/default.php | 43 +++++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 18 deletions(-) (limited to 'views') diff --git a/views/rss/page/default.php b/views/rss/page/default.php index 246ec972e..c973e3fd0 100644 --- a/views/rss/page/default.php +++ b/views/rss/page/default.php @@ -2,17 +2,13 @@ /** * Elgg RSS output pageshell * - * @package Elgg - * @subpackage Core + * @package Elgg.Core + * + * @uses $vars['title'] The title of the RSS feed + * @uses $vars['body'] The items for the RSS feed as a string + * @uses $vars['descrption'] The description for the RSS feed */ -header("Content-Type: text/xml"); - -// allow caching as required by stupid MS products for https feeds. -header('Pragma: public', TRUE); - -echo ""; - // Set title if (empty($vars['title'])) { $title = elgg_get_config('sitename'); @@ -23,17 +19,28 @@ if (empty($vars['title'])) { // Remove RSS from URL $url = str_replace('?view=rss', '', full_url()); $url = str_replace('&view=rss', '', $url); +$url = htmlspecialchars($url, ENT_NOQUOTES, 'UTF-8'); -?> +$body = elgg_extract('body', $vars, ''); +$description = elgg_extract('description', $vars, ''); - > +$namespaces = elgg_view('extensions/xmlns'); +$extensions = elgg_view('extensions/channel'); + + +// allow caching as required by stupid MS products for https feeds. +header('Pragma: public', true); +header("Content-Type: text/xml"); + +echo ""; +echo << - <![CDATA[<?php echo $title; ?>]]> - - - + <![CDATA[$title]]> + $url + + $extensions + $body +END; -- cgit v1.2.3 From d570fa64707367bf84746ccce50575052ff843db Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 12 Nov 2011 09:02:59 -0500 Subject: added a input class for text boxes so that they aren't super long --- views/default/css/admin.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'views') diff --git a/views/default/css/admin.php b/views/default/css/admin.php index fde34873d..9205e528a 100644 --- a/views/default/css/admin.php +++ b/views/default/css/admin.php @@ -443,6 +443,9 @@ textarea { .elgg-input-thin { width: 400px; } +.elgg-input-natural { + width: auto; +} .elgg-button { font-size: 14px; -- cgit v1.2.3 From 88d597c63a9691c9714e9db4dbe676028e548be8 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 12 Nov 2011 11:10:34 -0500 Subject: added bottom margin to info modules for plugin settings --- views/default/css/admin.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'views') diff --git a/views/default/css/admin.php b/views/default/css/admin.php index 9205e528a..c02d43512 100644 --- a/views/default/css/admin.php +++ b/views/default/css/admin.php @@ -320,6 +320,9 @@ p { .elgg-module-main > .elgg-head { margin-bottom: 5px; } +.elgg-module-info > .elgg-head { + margin-bottom: 10px; +} .elgg-module-inline { margin: 20px 0; } -- cgit v1.2.3 From e8006ee9715b8c615f4670d8e6b10b3dd8bbd459 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sun, 13 Nov 2011 16:20:03 -0500 Subject: need to unset the trusted link key --- views/default/output/confirmlink.php | 1 + 1 file changed, 1 insertion(+) (limited to 'views') diff --git a/views/default/output/confirmlink.php b/views/default/output/confirmlink.php index 953c15f1b..532790a38 100644 --- a/views/default/output/confirmlink.php +++ b/views/default/output/confirmlink.php @@ -41,6 +41,7 @@ if (isset($vars['class'])) { unset($vars['encode_text']); unset($vars['text']); unset($vars['confirm']); +unset($vars['is_trusted']); $attributes = elgg_format_attributes($vars); echo "$text"; -- cgit v1.2.3 From 6483d9d446e7fa50e16823fe20514a45416880e2 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sun, 13 Nov 2011 16:22:57 -0500 Subject: Fixes #4082 adds output/img --- engine/lib/users.php | 11 ++++++----- mod/bookmarks/views/default/bookmarks/bookmarklet.php | 9 ++++++--- views/default/core/avatar/upload.php | 7 +++++-- views/default/forms/avatar/crop.php | 17 +++++++++++++---- views/default/icon/default.php | 7 +++++-- views/default/icon/user/default.php | 12 +++++++++--- views/default/output/img.php | 12 ++++++++++++ 7 files changed, 56 insertions(+), 19 deletions(-) create mode 100644 views/default/output/img.php (limited to 'views') diff --git a/engine/lib/users.php b/engine/lib/users.php index 4072740f9..9cb8ddfa7 100644 --- a/engine/lib/users.php +++ b/engine/lib/users.php @@ -1476,14 +1476,15 @@ function users_pagesetup() { // topbar if ($viewer) { - - $icon_url = $viewer->getIconURL('topbar'); - $class = 'elgg-border-plain elgg-transition'; - $title = elgg_echo('profile'); elgg_register_menu_item('topbar', array( 'name' => 'profile', 'href' => $viewer->getURL(), - 'text' => "\"$viewer-name\" title=\"$title\" class=\"$class\" />", + 'text' => elgg_view('output/img', array( + 'src' => $viewer->getIconURL('topbar'), + 'alt' => $viewer->name, + 'title' => elgg_echo('profile'), + 'class' => 'elgg-border-plain elgg-transition', + )), 'priority' => 100, 'link_class' => 'elgg-topbar-avatar', )); diff --git a/mod/bookmarks/views/default/bookmarks/bookmarklet.php b/mod/bookmarks/views/default/bookmarks/bookmarklet.php index 1d0b25498..b3e9737fe 100644 --- a/mod/bookmarks/views/default/bookmarks/bookmarklet.php +++ b/mod/bookmarks/views/default/bookmarks/bookmarklet.php @@ -20,13 +20,16 @@ if (!$name && ($user = elgg_get_logged_in_user_entity())) { } $url = elgg_get_site_url(); - +$img = elgg_view('output/img', array( + 'src' => 'mod/bookmarks/graphics/bookmarklet.gif', + 'alt' => $title, +)); $bookmarklet = "getIconUrl('medium'); +$user_avatar = elgg_view('output/img', array( + 'src' => $vars['entity']->getIconUrl('medium'), + 'alt' => elgg_echo('avatar'), +)); $current_label = elgg_echo('avatar:current'); @@ -23,7 +26,7 @@ $upload_form = elgg_view_form('avatar/upload', $form_params, $vars); $image = <<
- avatar + $user_avatar HTML; diff --git a/views/default/forms/avatar/crop.php b/views/default/forms/avatar/crop.php index f622fd60f..3e798cb27 100644 --- a/views/default/forms/avatar/crop.php +++ b/views/default/forms/avatar/crop.php @@ -9,14 +9,23 @@ elgg_load_js('jquery.imgareaselect'); elgg_load_js('elgg.avatar_cropper'); elgg_load_css('jquery.imgareaselect'); -$master_image = $vars['entity']->getIconUrl('master'); +$master_img = elgg_view('output/img', array( + 'src' => $vars['entity']->getIconUrl('master'), + 'alt' => elgg_echo('avatar'), + 'class' => 'mrl', + 'id' => 'user-avatar-cropper', +)); + +$preview_img = elgg_view('output/img', array( + 'src' => $vars['entity']->getIconUrl('master'), + 'alt' => elgg_echo('avatar'), +)); ?>
- <?php echo elgg_echo('avatar'); ?> +
-
- +
getIconURL($vars['size']); -$img = "\"$title\""; +$img = elgg_view('output/img', array( + 'src' => $entity->getIconURL($vars['size']), + 'alt' => $title, + 'class' => $class, +)); if ($url) { $params = array( diff --git a/views/default/icon/user/default.php b/views/default/icon/user/default.php index a208ec41a..c0b0e7483 100644 --- a/views/default/icon/user/default.php +++ b/views/default/icon/user/default.php @@ -47,7 +47,7 @@ if ($js) { $img_class = ''; if (isset($vars['img_class'])) { - $img_class = "class=\"{$vars['img_class']}\""; + $img_class = $vars['img_class']; } $use_hover = elgg_extract('use_hover', $vars, true); @@ -62,8 +62,14 @@ if (isset($vars['hover'])) { $spacer_url = elgg_get_site_url() . '_graphics/spacer.gif'; -$icon_url = $user->getIconURL($size); -$icon = "\"$name\""; +$icon_url = elgg_format_url($user->getIconURL($size)); +$icon = elgg_view('output/img', array( + 'src' => $spacer_url, + 'alt' => $name, + 'title' => $name, + 'class' => $img_class, + 'style' => "background: url($icon_url) no-repeat;", +)); $show_menu = $use_hover && (elgg_is_admin_logged_in() || !$user->isBanned()); diff --git a/views/default/output/img.php b/views/default/output/img.php new file mode 100644 index 000000000..d3f596801 --- /dev/null +++ b/views/default/output/img.php @@ -0,0 +1,12 @@ +"; -- cgit v1.2.3 From 7fb01974030d89b4b7c64578b2640ead3b2175e7 Mon Sep 17 00:00:00 2001 From: cash Date: Fri, 18 Nov 2011 22:03:22 -0500 Subject: Fixes #3929 used a combination of min-width/max-width and overflow hidden to provide better support for long names --- views/default/css/elements/navigation.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'views') diff --git a/views/default/css/elements/navigation.php b/views/default/css/elements/navigation.php index bf1046dda..6515fc975 100644 --- a/views/default/css/elements/navigation.php +++ b/views/default/css/elements/navigation.php @@ -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; -- cgit v1.2.3 From 71b9a1c21e3eec65f577a05a8e1ff86548e3aa4c Mon Sep 17 00:00:00 2001 From: cash Date: Fri, 18 Nov 2011 22:09:23 -0500 Subject: line between settings and save button not needed --- views/default/forms/admin/site/update_advanced.php | 2 +- views/default/forms/admin/site/update_basic.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'views') 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 .= "
"; $form_body .= elgg_view('input/hidden', array('name' => 'settings', 'value' => 'go')); -$form_body .= '
'; +$form_body .= '
'; $form_body .= elgg_view('input/submit', array('value' => elgg_echo("save"))); $form_body .= '
'; 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, )) . "
"; -$form_body .= '
'; +$form_body .= '
'; $form_body .= elgg_view('input/submit', array('value' => elgg_echo("save"))); $form_body .= '
'; -- cgit v1.2.3 From 7cc4c3139d8d75335bd7e9b21d99257ff8d3cc72 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 19 Nov 2011 07:45:33 -0500 Subject: Fixes #641 users can submit email address to reset password --- actions/login.php | 1 - actions/user/requestnewpassword.php | 5 +++++ languages/en.php | 10 +++++----- views/default/forms/user/requestnewpassword.php | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) (limited to 'views') diff --git a/actions/login.php b/actions/login.php index 5934d1423..c717faadd 100644 --- a/actions/login.php +++ b/actions/login.php @@ -28,7 +28,6 @@ if (empty($username) || empty($password)) { } // check if logging in with email address -// @todo Are usernames with @ not allowed? if (strpos($username, '@') !== FALSE && ($users = get_user_by_email($username))) { $username = $users[0]->username; } diff --git a/actions/user/requestnewpassword.php b/actions/user/requestnewpassword.php index 5dfa24952..f1d4fa43c 100644 --- a/actions/user/requestnewpassword.php +++ b/actions/user/requestnewpassword.php @@ -8,6 +8,11 @@ $username = get_input('username'); +// allow email addresses +if (strpos($username, '@') !== false && ($users = get_user_by_email($username))) { + $username = $users[0]->username; +} + $user = get_user_by_username($username); if ($user) { if (send_new_password_request($user->guid)) { diff --git a/languages/en.php b/languages/en.php index af97e112d..1576ed73d 100644 --- a/languages/en.php +++ b/languages/en.php @@ -20,7 +20,7 @@ $english = array( 'login' => "Log in", 'loginok' => "You have been logged in.", 'loginerror' => "We couldn't log you in. Please check your credentials and try again.", - 'login:empty' => "Username and password are required.", + 'login:empty' => "Username/email and password are required.", 'login:baduser' => "Unable to load your user account.", 'auth:nopams' => "Internal error. No user authentication method installed.", @@ -222,8 +222,8 @@ $english = array( 'RegistrationException:EmptyPassword' => 'The password fields cannot be empty', 'RegistrationException:PasswordMismatch' => 'Passwords must match', 'LoginException:BannedUser' => 'You have been banned from this site and cannot log in', - 'LoginException:UsernameFailure' => 'We could not log you in. Please check your username and password.', - 'LoginException:PasswordFailure' => 'We could not log you in. Please check your username and password.', + 'LoginException:UsernameFailure' => 'We could not log you in. Please check your username/email and password.', + 'LoginException:PasswordFailure' => 'We could not log you in. Please check your username/email and password.', 'LoginException:AccountLocked' => 'Your account has been locked for too many log in failures.', 'LoginException:ChangePasswordFailure' => 'Failed current password check.', @@ -531,7 +531,7 @@ $english = array( 'user:password:resetreq:success' => 'Successfully requested a new password, email sent', 'user:password:resetreq:fail' => 'Could not request a new password.', - 'user:password:text' => 'To request a new password, enter your username below and click the Request button.', + 'user:password:text' => 'To request a new password, enter your username or email address below and click the Request button.', 'user:persistent' => 'Remember me', @@ -1064,7 +1064,7 @@ Your password has been reset to: %s", Somebody (from the IP address %s) has requested a new password for their account. -If you requested this click on the link below, otherwise ignore this email. +If you requested this, click on the link below. Otherwise ignore this email. %s ", 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 @@
-
+
'username', 'class' => 'elgg-autofocus', -- cgit v1.2.3 From 5f3935de2012b2bd88c0d6ba227570b54ce10bc6 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 19 Nov 2011 07:59:33 -0500 Subject: Fixes #4102 handling no menu items for site menu --- views/default/navigation/menu/site.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'views') 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 '
    '; -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 '
  • '; $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 '
  • '; -- cgit v1.2.3 From ed13a36bfd53a3a0a66a4d52849e096ccb4ae5b5 Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 19 Nov 2011 12:11:52 -0500 Subject: don't display

    if no title --- views/default/object/elements/summary.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'views') 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 "

    $title_link

    "; +if ($title_link) { + echo "

    $title_link

    "; +} echo "
    $subtitle
    "; echo $tags; -- cgit v1.2.3 From 6ad10da8fb3195a063634df23558430625d6c2a5 Mon Sep 17 00:00:00 2001 From: cash Date: Sun, 20 Nov 2011 08:10:47 -0500 Subject: fixed error in css for .elgg-output ordered lists --- views/default/css/elements/typography.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'views') 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; } -- cgit v1.2.3 From 5d1d38ec7944b656a9766c6d64b2eb133dc4c156 Mon Sep 17 00:00:00 2001 From: cash Date: Wed, 23 Nov 2011 10:45:54 -0500 Subject: Fixes #4145 using margin rather than padding for topbar menu items --- views/default/css/elements/navigation.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'views') diff --git a/views/default/css/elements/navigation.php b/views/default/css/elements/navigation.php index 6515fc975..d5b20896a 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 { -- cgit v1.2.3 From 2eb8c06a0200764787cc2dba5854e1d926e93acc Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Fri, 25 Nov 2011 13:47:57 -0500 Subject: returning from gallery view if no items in the gallery --- views/default/page/components/gallery.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'views') 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; } -- cgit v1.2.3 From da649f2a1d4c3c3b6aaeeb3ba71dd8915b2c56fb Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sun, 27 Nov 2011 17:57:04 -0500 Subject: rss view type needed a gallery view --- views/rss/page/components/gallery.php | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 views/rss/page/components/gallery.php (limited to 'views') 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 @@ + Date: Sun, 27 Nov 2011 19:52:14 -0500 Subject: Fixes #3954 using lightbox for plugin screenshots --- views/default/admin/plugins.php | 3 +++ views/default/js/admin.php | 45 ------------------------------------ views/default/object/plugin/full.php | 2 +- 3 files changed, 4 insertions(+), 46 deletions(-) (limited to 'views') 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/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)', @@ -73,48 +70,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('
    '); - 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 = ''; - var desc = $(this).find('img').attr('alt'); - - if (desc) { - html = '

    ' + desc + '

    ' + 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 * 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 .= "
  • " + $screenshots_html .= "
  • " . "\"$alt\"
  • "; } } -- cgit v1.2.3 From 65afed116e377c5a17bd6faf278ae9b71dd5abdf Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sun, 27 Nov 2011 20:23:51 -0500 Subject: Fixes #3982 fixing scrolling issue with elgg-body --- views/default/css/admin.php | 1 + views/default/css/elements/components.php | 11 ----------- views/default/css/elements/core.php | 17 ++++++++++++++++- 3 files changed, 17 insertions(+), 12 deletions(-) (limited to 'views') 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
     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;
     }
     
    -
    + 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;
    -- 
    cgit v1.2.3
    
    
    From d51459b56adaea48eb50ba9d6ef140751077de74 Mon Sep 17 00:00:00 2001
    From: Cash Costello 
    Date: Sun, 27 Nov 2011 21:34:41 -0500
    Subject: Fixes #3953 adds back the ability to change display name from
     settings page
    
    ---
     actions/profile/edit.php                     |  7 +------
     views/default/core/settings/account/name.php | 21 ++++++++++++++++-----
     2 files changed, 17 insertions(+), 11 deletions(-)
    
    (limited to 'views')
    
    diff --git a/actions/profile/edit.php b/actions/profile/edit.php
    index e86053b07..8ca60f246 100644
    --- a/actions/profile/edit.php
    +++ b/actions/profile/edit.php
    @@ -62,12 +62,7 @@ if ($name) {
     		register_error(elgg_echo('user:name:fail'));
     	} elseif ($owner->name != $name) {
     		$owner->name = $name;
    -		// @todo this is weird...giving two notifications?
    -		if ($owner->save()) {
    -			system_message(elgg_echo('user:name:success'));
    -		} else {
    -			register_error(elgg_echo('user:name:fail'));
    -		}
    +		$owner->save();
     	}
     }
     
    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));
    +?>
    +
    +
    +

    +
    +
    +

    + : + 'name', 'value' => $user->name)); + ?> +

    +
    +
    + 'guid', 'value' => $user->guid)); -- cgit v1.2.3 From e8717d0bbcd7d0b719ec3d85943135e83e58b716 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sun, 27 Nov 2011 21:45:15 -0500 Subject: Fixes #3773 added documentation hint for using advanced features of fancybox --- views/default/js/lightbox.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'views') 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()). -- cgit v1.2.3 From 57675a8b65a703ceb507176d0ac7bd29d6cff1bd Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Mon, 28 Nov 2011 08:06:25 -0500 Subject: Fixes #4052 removed the :focus styling on every input element --- views/default/css/elements/forms.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'views') 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; -- cgit v1.2.3 From 31fe96fa61b1ec489994e8819336fda8746a4386 Mon Sep 17 00:00:00 2001 From: cash Date: Thu, 1 Dec 2011 22:00:40 -0500 Subject: added support for passing classes to ajax loader --- views/default/graphics/ajax_loader.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'views') 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 -
    +
    END; -- cgit v1.2.3 From 77c79deec262938410fe02e6cba7cb0568de703b Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sun, 4 Dec 2011 13:49:35 -0500 Subject: Fixes #4032 rendering page elements before head/foot --- views/default/page/admin.php | 27 ++++++++++++++++----------- views/default/page/default.php | 21 ++++++++++++++------- 2 files changed, 30 insertions(+), 18 deletions(-) (limited to 'views') 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 = "
    $notices_html
    "; } +// 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"); + ?> @@ -36,21 +41,21 @@ if ($notices) {
    - +
    - $messages)); ?> +
    - +
    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");
    - $vars['sysmessages'])); ?> +
    - +
    - +
    - +
    -- cgit v1.2.3 From c2cddede38dbb29d53167e296981a678759e0648 Mon Sep 17 00:00:00 2001 From: cash Date: Mon, 5 Dec 2011 21:54:09 -0500 Subject: first version of a 404 page --- engine/lib/pagehandler.php | 31 +++++++++++++++++++++++++++++++ languages/en.php | 3 +++ views/default/errors/404.php | 8 ++++++++ views/default/errors/default.php | 8 ++++++++ views/default/page/error.php | 14 ++++++++++++++ views/default/page/layouts/error.php | 6 ++++++ 6 files changed, 70 insertions(+) create mode 100644 views/default/errors/404.php create mode 100644 views/default/errors/default.php create mode 100644 views/default/page/error.php create mode 100644 views/default/page/layouts/error.php (limited to 'views') diff --git a/engine/lib/pagehandler.php b/engine/lib/pagehandler.php index aba921416..16be6e3b2 100644 --- a/engine/lib/pagehandler.php +++ b/engine/lib/pagehandler.php @@ -110,3 +110,34 @@ function elgg_unregister_page_handler($handler) { unset($CONFIG->pagehandler[$handler]); } + +/** + * Serve an error page + * + * @param string $hook The name of the hook + * @param string $type The type of the hook + * @param bool $result The current value of the hook + * @param array $params Parameters related to the hook + */ +function elgg_error_page_handler($hook, $type, $result, $params) { + if (elgg_view_exists("errors/$type")) { + $content = elgg_view("errors/$type", $params); + } else { + $content = elgg_view("errors/default", $params); + } + $body = elgg_view_layout('error', array('content' => $content)); + echo elgg_view_page($title, $body, 'error'); + exit; +} + +/** + * Initializes the page handler/routing system + * + * @return void + * @access private + */ +function page_handler_init() { + elgg_register_plugin_hook_handler('forward', '404', 'elgg_error_page_handler'); +} + +elgg_register_event_handler('init', 'system', 'page_handler_init'); diff --git a/languages/en.php b/languages/en.php index 036ca8883..eecb2f1aa 100644 --- a/languages/en.php +++ b/languages/en.php @@ -240,6 +240,9 @@ $english = array( 'changebookmark' => 'Please change your bookmark for this page', 'noaccess' => 'This content has been removed, is invalid, or you do not have permission to view it.', + 'error:default' => 'Oops...something went wrong.', + 'error:404' => 'Sorry. We could not find the page that you requested.', + /** * API */ 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 @@ +$message"; 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 @@ +$message"; 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 @@ + Date: Tue, 6 Dec 2011 11:50:59 +0100 Subject: delete action expects widget_guid instead of guid --- views/default/object/widget/elements/controls.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'views') diff --git a/views/default/object/widget/elements/controls.php b/views/default/object/widget/elements/controls.php index 6d06d28bc..866dcc787 100644 --- a/views/default/object/widget/elements/controls.php +++ b/views/default/object/widget/elements/controls.php @@ -22,7 +22,7 @@ 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", + 'href' => "action/widgets/delete?widget_guid=$widget->guid", 'is_action' => true, 'is_trusted' => true, 'class' => 'elgg-widget-delete-button', -- cgit v1.2.3 From cb20d84a4ce17c8071e8f474b82341ec1aec083d Mon Sep 17 00:00:00 2001 From: cash Date: Thu, 8 Dec 2011 19:28:56 -0500 Subject: added the ability to pass a class to be applied to all menu item
  • elements --- views/default/navigation/menu/default.php | 13 ++++++++----- views/default/navigation/menu/elements/item.php | 6 ++++++ views/default/navigation/menu/elements/section.php | 17 +++++++++++------ 3 files changed, 25 insertions(+), 11 deletions(-) (limited to 'views') 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 "
  • "; 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 "
      "; 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 '
    '; -- cgit v1.2.3 From 1ec7692c1639e8415cd9984d9ad040ec28bd9755 Mon Sep 17 00:00:00 2001 From: cash Date: Thu, 8 Dec 2011 20:09:36 -0500 Subject: Fixes #4185, #2111 adds control panel widget --- actions/admin/site/flush_cache.php | 10 ++++++++++ engine/lib/admin.php | 5 +++-- languages/en.php | 6 ++++++ views/default/widgets/control_panel/content.php | 24 ++++++++++++++++++++++++ 4 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 actions/admin/site/flush_cache.php create mode 100644 views/default/widgets/control_panel/content.php (limited to 'views') diff --git a/actions/admin/site/flush_cache.php b/actions/admin/site/flush_cache.php new file mode 100644 index 000000000..b81f5fc83 --- /dev/null +++ b/actions/admin/site/flush_cache.php @@ -0,0 +1,10 @@ + array of handlers in order, top to bottom $adminWidgets = array( - 1 => array('admin_welcome'), + 1 => array('control_panel', 'admin_welcome'), 2 => array('online_users', 'new_users', 'content_stats'), ); diff --git a/languages/en.php b/languages/en.php index 036ca8883..a2e6e152e 100644 --- a/languages/en.php +++ b/languages/en.php @@ -610,6 +610,12 @@ $english = array( // argh, this is ugly 'admin:widget:admin_welcome:outro' => '
    Be sure to check out the resources available through the footer links and thank you for using Elgg!', + 'admin:widget:control_panel' => 'Control panel', + 'admin:widget:control_panel:help' => "Provides easy access to common controls", + + 'admin:cache:flush' => 'Flush the caches', + 'admin:cache:flushed' => "The site's caches have been flushed", + 'admin:footer:faq' => 'Administration FAQ', 'admin:footer:manual' => 'Administration Manual', 'admin:footer:community_forums' => 'Elgg Community Forums', 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 @@ + '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', +)); -- cgit v1.2.3 From be930396dfd7c722d9c90d8987a49823710e6717 Mon Sep 17 00:00:00 2001 From: cash Date: Thu, 8 Dec 2011 21:15:36 -0500 Subject: Fixes #4189 correctly getting the base url in pagination view --- views/default/navigation/pagination.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'views') 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); -- cgit v1.2.3 From dfaa80f0a44afe6faed0212e61c3edef48afc64d Mon Sep 17 00:00:00 2001 From: cash Date: Wed, 14 Dec 2011 20:02:25 -0500 Subject: Fixes #3341 removed xml-rpc code from Elgg - see xml-rpc plugin if you need an xml-rpc endpoint --- engine/classes/ElggSite.php | 2 - engine/classes/XMLRPCArrayParameter.php | 56 --------- engine/classes/XMLRPCBase64Parameter.php | 28 ----- engine/classes/XMLRPCBoolParameter.php | 30 ----- engine/classes/XMLRPCCall.php | 62 ---------- engine/classes/XMLRPCDateParameter.php | 33 ----- engine/classes/XMLRPCDoubleParameter.php | 29 ----- engine/classes/XMLRPCErrorResponse.php | 36 ------ engine/classes/XMLRPCIntParameter.php | 29 ----- engine/classes/XMLRPCParameter.php | 16 --- engine/classes/XMLRPCResponse.php | 71 ----------- engine/classes/XMLRPCStringParameter.php | 30 ----- engine/classes/XMLRPCStructParameter.php | 55 --------- engine/classes/XMLRPCSuccessResponse.php | 22 ---- engine/handlers/page_handler.php | 8 +- engine/handlers/xml-rpc_handler.php | 44 ------- engine/lib/xml-rpc.php | 203 ------------------------------- engine/start.php | 2 +- htaccess_dist | 3 - install/ElggInstaller.php | 2 +- languages/en.php | 9 -- views/xml/xml-rpc/output.php | 11 -- 22 files changed, 8 insertions(+), 773 deletions(-) delete mode 100644 engine/classes/XMLRPCArrayParameter.php delete mode 100644 engine/classes/XMLRPCBase64Parameter.php delete mode 100644 engine/classes/XMLRPCBoolParameter.php delete mode 100644 engine/classes/XMLRPCCall.php delete mode 100644 engine/classes/XMLRPCDateParameter.php delete mode 100644 engine/classes/XMLRPCDoubleParameter.php delete mode 100644 engine/classes/XMLRPCErrorResponse.php delete mode 100644 engine/classes/XMLRPCIntParameter.php delete mode 100644 engine/classes/XMLRPCParameter.php delete mode 100644 engine/classes/XMLRPCResponse.php delete mode 100644 engine/classes/XMLRPCStringParameter.php delete mode 100644 engine/classes/XMLRPCStructParameter.php delete mode 100644 engine/classes/XMLRPCSuccessResponse.php delete mode 100644 engine/handlers/xml-rpc_handler.php delete mode 100644 engine/lib/xml-rpc.php delete mode 100644 views/xml/xml-rpc/output.php (limited to 'views') diff --git a/engine/classes/ElggSite.php b/engine/classes/ElggSite.php index 5c44d4076..0d03cbd28 100644 --- a/engine/classes/ElggSite.php +++ b/engine/classes/ElggSite.php @@ -421,8 +421,6 @@ class ElggSite extends ElggEntity { 'action/security/refreshtoken', 'ajax/view/js/languages', 'upgrade\.php', - 'xml-rpc\.php', - 'mt/mt-xmlrpc\.cgi', 'css/.*', 'js/.*' ); diff --git a/engine/classes/XMLRPCArrayParameter.php b/engine/classes/XMLRPCArrayParameter.php deleted file mode 100644 index a8edccba7..000000000 --- a/engine/classes/XMLRPCArrayParameter.php +++ /dev/null @@ -1,56 +0,0 @@ -addField($v); - } - } - } - - /** - * Add a field to the container. - * - * @param XMLRPCParameter $value The value. - * - * @return void - */ - public function addField(XMLRPCParameter $value) { - if (!is_array($this->value)) { - $this->value = array(); - } - - $this->value[] = $value; - } - - /** - * Converts XML array to string - * - * @return string - */ - function __toString() { - $params = ""; - foreach ($this->value as $value) { - $params .= "$value"; - } - - return "$params"; - } -} diff --git a/engine/classes/XMLRPCBase64Parameter.php b/engine/classes/XMLRPCBase64Parameter.php deleted file mode 100644 index 7db0a761c..000000000 --- a/engine/classes/XMLRPCBase64Parameter.php +++ /dev/null @@ -1,28 +0,0 @@ -value = base64_encode($blob); - } - - /** - * Convert to string - * - * @return string - */ - function __toString() { - return "{$value}"; - } -} diff --git a/engine/classes/XMLRPCBoolParameter.php b/engine/classes/XMLRPCBoolParameter.php deleted file mode 100644 index 607841cb8..000000000 --- a/engine/classes/XMLRPCBoolParameter.php +++ /dev/null @@ -1,30 +0,0 @@ -value = (bool)$value; - } - - /** - * Convert to string - * - * @return string - */ - function __toString() { - $code = ($this->value) ? "1" : "0"; - return "{$code}"; - } -} diff --git a/engine/classes/XMLRPCCall.php b/engine/classes/XMLRPCCall.php deleted file mode 100644 index 8eeba0c29..000000000 --- a/engine/classes/XMLRPCCall.php +++ /dev/null @@ -1,62 +0,0 @@ -_parse($xml); - } - - /** - * Return the method name associated with the call. - * - * @return string - */ - public function getMethodName() { return $this->methodname; } - - /** - * Return the parameters. - * Returns a nested array of XmlElement. - * - * @see XmlElement - * @return array - */ - public function getParameters() { return $this->params; } - - /** - * Parse the xml into its components according to spec. - * This first version is a little primitive. - * - * @param string $xml XML - * - * @return void - */ - private function _parse($xml) { - $xml = xml_to_object($xml); - - // sanity check - if ((isset($xml->name)) && (strcasecmp($xml->name, "methodCall") != 0)) { - throw new CallException(elgg_echo('CallException:NotRPCCall')); - } - - // method name - $this->methodname = $xml->children[0]->content; - - // parameters - $this->params = $xml->children[1]->children; - } -} diff --git a/engine/classes/XMLRPCDateParameter.php b/engine/classes/XMLRPCDateParameter.php deleted file mode 100644 index 93bbbd8f5..000000000 --- a/engine/classes/XMLRPCDateParameter.php +++ /dev/null @@ -1,33 +0,0 @@ -value = $timestamp; - - if (!$timestamp) { - $this->value = time(); - } - } - - /** - * Convert to string - * - * @return string - */ - function __toString() { - $value = date('c', $this->value); - return "{$value}"; - } -} diff --git a/engine/classes/XMLRPCDoubleParameter.php b/engine/classes/XMLRPCDoubleParameter.php deleted file mode 100644 index b7834650e..000000000 --- a/engine/classes/XMLRPCDoubleParameter.php +++ /dev/null @@ -1,29 +0,0 @@ -value = (float)$value; - } - - /** - * Convert to string - * - * @return string - */ - function __toString() { - return "{$this->value}"; - } -} diff --git a/engine/classes/XMLRPCErrorResponse.php b/engine/classes/XMLRPCErrorResponse.php deleted file mode 100644 index 425c075cc..000000000 --- a/engine/classes/XMLRPCErrorResponse.php +++ /dev/null @@ -1,36 +0,0 @@ -addParameter( - new XMLRPCStructParameter( - array ( - 'faultCode' => new XMLRPCIntParameter($code), - 'faultString' => new XMLRPCStringParameter($message) - ) - ) - ); - } - - /** - * Output to XML. - * - * @return string - */ - public function __toString() { - return "{$this->parameters[0]}"; - } -} diff --git a/engine/classes/XMLRPCIntParameter.php b/engine/classes/XMLRPCIntParameter.php deleted file mode 100644 index 0fc146165..000000000 --- a/engine/classes/XMLRPCIntParameter.php +++ /dev/null @@ -1,29 +0,0 @@ -value = (int)$value; - } - - /** - * Convert to string - * - * @return string - */ - function __toString() { - return "{$this->value}"; - } -} diff --git a/engine/classes/XMLRPCParameter.php b/engine/classes/XMLRPCParameter.php deleted file mode 100644 index ffbad8082..000000000 --- a/engine/classes/XMLRPCParameter.php +++ /dev/null @@ -1,16 +0,0 @@ -parameters)) { - $this->parameters = array(); - } - - $this->parameters[] = $param; - } - - /** - * Add an integer - * - * @param int $value Value - * - * @return void - */ - public function addInt($value) { - $this->addParameter(new XMLRPCIntParameter($value)); - } - - /** - * Add a string - * - * @param string $value Value - * - * @return void - */ - public function addString($value) { - $this->addParameter(new XMLRPCStringParameter($value)); - } - - /** - * Add a double - * - * @param int $value Value - * - * @return void - */ - public function addDouble($value) { - $this->addParameter(new XMLRPCDoubleParameter($value)); - } - - /** - * Add a boolean - * - * @param bool $value Value - * - * @return void - */ - public function addBoolean($value) { - $this->addParameter(new XMLRPCBoolParameter($value)); - } -} diff --git a/engine/classes/XMLRPCStringParameter.php b/engine/classes/XMLRPCStringParameter.php deleted file mode 100644 index 35b28214b..000000000 --- a/engine/classes/XMLRPCStringParameter.php +++ /dev/null @@ -1,30 +0,0 @@ -value = $value; - } - - /** - * Convert to XML string - * - * @return string - */ - function __toString() { - $value = htmlentities($this->value); - return "{$value}"; - } -} diff --git a/engine/classes/XMLRPCStructParameter.php b/engine/classes/XMLRPCStructParameter.php deleted file mode 100644 index 694ddf5df..000000000 --- a/engine/classes/XMLRPCStructParameter.php +++ /dev/null @@ -1,55 +0,0 @@ - $v) { - $this->addField($k, $v); - } - } - } - - /** - * Add a field to the container. - * - * @param string $name The name of the field. - * @param XMLRPCParameter $value The value. - * - * @return void - */ - public function addField($name, XMLRPCParameter $value) { - if (!is_array($this->value)) { - $this->value = array(); - } - - $this->value[$name] = $value; - } - - /** - * Convert to string - * - * @return string - */ - function __toString() { - $params = ""; - foreach ($this->value as $k => $v) { - $params .= "$k$v"; - } - - return "$params"; - } -} diff --git a/engine/classes/XMLRPCSuccessResponse.php b/engine/classes/XMLRPCSuccessResponse.php deleted file mode 100644 index e02e82c5c..000000000 --- a/engine/classes/XMLRPCSuccessResponse.php +++ /dev/null @@ -1,22 +0,0 @@ -parameters as $param) { - $params .= "$param\n"; - } - - return "$params"; - } -} diff --git a/engine/handlers/page_handler.php b/engine/handlers/page_handler.php index 1ed295b7d..7eca37bb1 100644 --- a/engine/handlers/page_handler.php +++ b/engine/handlers/page_handler.php @@ -13,12 +13,16 @@ * * cache * * services * * export - * * mt - * * xml-rpc.php + * * js + * * css * * rewrite.php * * tag (deprecated, reserved for backwards compatibility) * * pg (deprecated, reserved for backwards compatibility) * + * These additionally are reserved for the xml-rpc plugin + * * mt + * * xml-rpc.php + * * {@link page_handler()} explodes the pages string by / and sends it to * the page handler function as registered by {@link elgg_register_page_handler()}. * If a valid page handler isn't found, plugins have a chance to provide a 404. diff --git a/engine/handlers/xml-rpc_handler.php b/engine/handlers/xml-rpc_handler.php deleted file mode 100644 index 2ee29e5b7..000000000 --- a/engine/handlers/xml-rpc_handler.php +++ /dev/null @@ -1,44 +0,0 @@ - $result))); diff --git a/engine/lib/xml-rpc.php b/engine/lib/xml-rpc.php deleted file mode 100644 index bfe1a8645..000000000 --- a/engine/lib/xml-rpc.php +++ /dev/null @@ -1,203 +0,0 @@ -name == 'param') { - $object = $object->children[0]->children[0]; - } - - switch ($object->name) { - case 'string': - return $object->content; - - case 'array': - foreach ($object->children[0]->children as $child) { - $value[] = xmlrpc_scalar_value($child); - } - return $value; - - case 'struct': - foreach ($object->children as $child) { - if (isset($child->children[1]->children[0])) { - $value[$child->children[0]->content] = xmlrpc_scalar_value($child->children[1]->children[0]); - } else { - $value[$child->children[0]->content] = $child->children[1]->content; - } - } - return $value; - - case 'boolean': - return (boolean) $object->content; - - case 'i4': - case 'int': - return (int) $object->content; - - case 'double': - return (double) $object->content; - - case 'dateTime.iso8601': - return (int) strtotime($object->content); - - case 'base64': - return base64_decode($object->content); - - case 'value': - return xmlrpc_scalar_value($object->children[0]); - - default: - // @todo unsupported, throw an error - return false; - } -} - -// Functions for adding handlers ////////////////////////////////////////////////////////// - -/** XML-RPC Handlers */ -global $XML_RPC_HANDLERS; -$XML_RPC_HANDLERS = array(); - -/** - * Register a method handler for a given XML-RPC method. - * - * @param string $method Method parameter. - * @param string $handler The handler function. This function accepts - * one XMLRPCCall object and must return a XMLRPCResponse object. - * - * @return bool - */ -function register_xmlrpc_handler($method, $handler) { - global $XML_RPC_HANDLERS; - - $XML_RPC_HANDLERS[$method] = $handler; -} - -/** - * Trigger a method call and pass the relevant parameters to the funciton. - * - * @param XMLRPCCall $parameters The call and parameters. - * - * @return XMLRPCCall - * @access private - */ -function trigger_xmlrpc_handler(XMLRPCCall $parameters) { - global $XML_RPC_HANDLERS; - - // Go through and see if we have a handler - if (isset($XML_RPC_HANDLERS[$parameters->getMethodName()])) { - $handler = $XML_RPC_HANDLERS[$parameters->getMethodName()]; - $result = $handler($parameters); - - if (!($result instanceof XMLRPCResponse)) { - $msg = elgg_echo('InvalidParameterException:UnexpectedReturnFormat', - array($parameters->getMethodName())); - throw new InvalidParameterException($msg); - } - - // Result in right format, return it. - return $result; - } - - // if no handler then throw exception - $msg = elgg_echo('NotImplementedException:XMLRPCMethodNotImplemented', - array($parameters->getMethodName())); - throw new NotImplementedException($msg); -} - -/** - * PHP Error handler function. - * This function acts as a wrapper to catch and report PHP error messages. - * - * @see http://uk3.php.net/set-error-handler - * - * @param int $errno Error number - * @param string $errmsg Human readable message - * @param string $filename Filename - * @param int $linenum Line number - * @param array $vars Vars - * - * @return void - * @access private - */ -function _php_xmlrpc_error_handler($errno, $errmsg, $filename, $linenum, $vars) { - $error = date("Y-m-d H:i:s (T)") . ": \"" . $errmsg . "\" in file " - . $filename . " (line " . $linenum . ")"; - - switch ($errno) { - case E_USER_ERROR: - error_log("ERROR: " . $error); - - // Since this is a fatal error, we want to stop any further execution but do so gracefully. - throw new Exception("ERROR: " . $error); - break; - - case E_WARNING : - case E_USER_WARNING : - error_log("WARNING: " . $error); - break; - - default: - error_log("DEBUG: " . $error); - } -} - -/** - * PHP Exception handler for XMLRPC. - * - * @param Exception $exception The exception - * - * @return void - * @access private - */ -function _php_xmlrpc_exception_handler($exception) { - - error_log("*** FATAL EXCEPTION (XML-RPC) *** : " . $exception); - - $code = $exception->getCode(); - - if ($code == 0) { - $code = -32400; - } - - $result = new XMLRPCErrorResponse($exception->getMessage(), $code); - - $vars = array('result' => $result); - - $content = elgg_view("xml-rpc/output", $vars); - - echo elgg_view_page($exception->getMessage(), $content); -} diff --git a/engine/start.php b/engine/start.php index 00bdc3197..454dc7377 100644 --- a/engine/start.php +++ b/engine/start.php @@ -100,7 +100,7 @@ $lib_files = array( 'opendd.php', 'pagehandler.php', 'pam.php', 'plugins.php', 'private_settings.php', 'relationships.php', 'river.php', 'sites.php', 'statistics.php', 'tags.php', 'user_settings.php', 'users.php', - 'upgrade.php', 'web_services.php', 'widgets.php', 'xml.php', 'xml-rpc.php', + 'upgrade.php', 'web_services.php', 'widgets.php', 'xml.php', //backwards compatibility 'deprecated-1.7.php', 'deprecated-1.8.php', diff --git a/htaccess_dist b/htaccess_dist index 526299b94..88285f81b 100644 --- a/htaccess_dist +++ b/htaccess_dist @@ -115,9 +115,6 @@ RewriteRule ^services\/api\/([A-Za-z0-9\_\-]+)\/(.*)$ engine/handlers/service_ha RewriteRule ^export\/([A-Za-z]+)\/([0-9]+)\/?$ engine/handlers/export_handler.php?view=$1&guid=$2 RewriteRule ^export\/([A-Za-z]+)\/([0-9]+)\/([A-Za-z]+)\/([A-Za-z0-9\_]+)\/$ engine/handlers/export_handler.php?view=$1&guid=$2&type=$3&idname=$4 -RewriteRule xml-rpc.php engine/handlers/xml-rpc_handler.php -RewriteRule mt/mt-xmlrpc.cgi engine/handlers/xml-rpc_handler.php - # rule for rewrite module test during install - can be removed after installation RewriteRule ^rewrite.php$ install.php diff --git a/install/ElggInstaller.php b/install/ElggInstaller.php index d556ba744..367d23b4d 100644 --- a/install/ElggInstaller.php +++ b/install/ElggInstaller.php @@ -790,7 +790,7 @@ class ElggInstaller { 'private_settings.php', 'relationships.php', 'river.php', 'sites.php', 'statistics.php', 'tags.php', 'user_settings.php', 'users.php', 'upgrade.php', 'web_services.php', - 'widgets.php', 'xml.php', 'xml-rpc.php', 'deprecated-1.7.php', + 'widgets.php', 'xml.php', 'deprecated-1.7.php', 'deprecated-1.8.php', ); diff --git a/languages/en.php b/languages/en.php index 036ca8883..17587b178 100644 --- a/languages/en.php +++ b/languages/en.php @@ -208,10 +208,6 @@ $english = array( 'SecurityException:InvalidAPIKey' => "Invalid or missing API Key.", 'NotImplementedException:CallMethodNotImplemented' => "Call method '%s' is currently not supported.", - 'NotImplementedException:XMLRPCMethodNotImplemented' => "XML-RPC method call '%s' not implemented.", - 'InvalidParameterException:UnexpectedReturnFormat' => "Call to method '%s' returned an unexpected result.", - 'CallException:NotRPCCall' => "Call does not appear to be a valid XML-RPC call", - 'PluginException:NoPluginName' => "The plugin name could not be found", 'SecurityException:authenticationfailed' => "User could not be authenticated", @@ -1079,11 +1075,6 @@ If you requested this, click on the link below. Otherwise ignore this email. 'user:default_access:success' => "Your new default access level was saved.", 'user:default_access:failure' => "Your new default access level could not be saved.", -/** - * XML-RPC - */ - 'xmlrpc:noinputdata' => "Input data missing", - /** * Comments */ 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 @@ - Date: Thu, 15 Dec 2011 19:31:33 -0500 Subject: Fixes #4214 added missing dependency for userpicker --- js/lib/ui.userpicker.js | 2 +- views/default/input/userpicker.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'views') diff --git a/js/lib/ui.userpicker.js b/js/lib/ui.userpicker.js index 8287ba91c..7298da114 100644 --- a/js/lib/ui.userpicker.js +++ b/js/lib/ui.userpicker.js @@ -93,7 +93,7 @@ elgg.userpicker.viewUser = function(info) { html += "
    " + info.icon + "
    "; html += "
    " + deleteLink + "
    "; html += "
    " + info.name + "
    "; - html += " Date: Thu, 15 Dec 2011 05:20:57 +0100 Subject: Fix #4200: Converting widgets controls into an elgg menu --- engine/lib/navigation.php | 50 +++++++++++++++++++++++ js/lib/ui.widgets.js | 2 +- views/default/css/elements/modules.php | 15 ------- views/default/css/elements/navigation.php | 24 ++++++++++- views/default/object/widget/elements/controls.php | 49 ++++------------------ 5 files changed, 82 insertions(+), 58 deletions(-) (limited to 'views') diff --git a/engine/lib/navigation.php b/engine/lib/navigation.php index 176790188..956ca220a 100644 --- a/engine/lib/navigation.php +++ b/engine/lib/navigation.php @@ -384,6 +384,55 @@ function elgg_entity_menu_setup($hook, $type, $return, $params) { return $return; } +/** + * Widget menu is a set of widget controls + * @access private + */ +function elgg_widget_menu_setup($hook, $type, $return, $params) { + + $widget = $params['entity']; + $show_edit = elgg_extract('show_edit', $params, true); + + $collapse = array( + 'name' => 'collapse', + 'text' => ' ', + 'href' => "#elgg-widget-content-$widget->guid", + 'class' => 'elgg-widget-collapse-button', + 'rel' => 'toggle', + 'priority' => 1 + ); + $return[] = ElggMenuItem::factory($collapse); + + if ($widget->canEdit()) { + $delete = array( + 'name' => 'delete', + 'text' => elgg_view_icon('delete-alt'), + 'title' => elgg_echo('widget:delete', array($widget->getTitle())), + 'href' => "action/widgets/delete?widget_guid=$widget->guid", + 'is_action' => true, + 'class' => 'elgg-widget-delete-button', + 'id' => "elgg-widget-delete-button-$widget->guid", + 'priority' => 900 + ); + $return[] = ElggMenuItem::factory($delete); + + if ($show_edit) { + $edit = array( + 'name' => 'settings', + 'text' => elgg_view_icon('settings-alt'), + 'title' => elgg_echo('widget:edit'), + 'href' => "#widget-edit-$widget->guid", + 'class' => "elgg-widget-edit-button", + 'rel' => 'toggle', + 'priority' => 800, + ); + $return[] = ElggMenuItem::factory($edit); + } + } + + return $return; +} + /** * Adds a delete link to "generic_comment" annotations * @access private @@ -418,6 +467,7 @@ function elgg_nav_init() { elgg_register_plugin_hook_handler('prepare', 'menu:site', 'elgg_site_menu_setup'); elgg_register_plugin_hook_handler('register', 'menu:river', 'elgg_river_menu_setup'); elgg_register_plugin_hook_handler('register', 'menu:entity', 'elgg_entity_menu_setup'); + elgg_register_plugin_hook_handler('register', 'menu:widget', 'elgg_widget_menu_setup'); elgg_register_plugin_hook_handler('register', 'menu:annotation', 'elgg_annotation_menu_setup'); } diff --git a/js/lib/ui.widgets.js b/js/lib/ui.widgets.js index f12ae02c1..a44585843 100644 --- a/js/lib/ui.widgets.js +++ b/js/lib/ui.widgets.js @@ -107,7 +107,7 @@ elgg.ui.widgets.move = function(event, ui) { * @return void */ elgg.ui.widgets.remove = function(event) { - var $widget = $(this).parent().parent(); + var $widget = $(this).closest('.elgg-module-widget'); // if widget type is single instance type, enable the add buton var type = $widget.attr('class'); 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 d5b20896a..62f370069 100644 --- a/views/default/css/elements/navigation.php +++ b/views/default/css/elements/navigation.php @@ -534,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/object/widget/elements/controls.php b/views/default/object/widget/elements/controls.php index 866dcc787..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?widget_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', +)); -- cgit v1.2.3 From f003120fba687d14630b690c50e2316f717eca7d Mon Sep 17 00:00:00 2001 From: cash Date: Mon, 19 Dec 2011 20:49:30 -0500 Subject: added more spacing to error layout --- engine/lib/pagehandler.php | 2 ++ views/default/css/elements/layout.php | 3 +++ views/default/page/layouts/error.php | 6 ++++++ 3 files changed, 11 insertions(+) (limited to 'views') diff --git a/engine/lib/pagehandler.php b/engine/lib/pagehandler.php index 16be6e3b2..ffcfc5b6a 100644 --- a/engine/lib/pagehandler.php +++ b/engine/lib/pagehandler.php @@ -114,6 +114,8 @@ function elgg_unregister_page_handler($handler) { /** * Serve an error page * + * @todo not sending status codes yet + * * @param string $hook The name of the hook * @param string $type The type of the hook * @param bool $result The current value of the hook 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(_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/page/layouts/error.php b/views/default/page/layouts/error.php index 5b3109964..cdce28a8e 100644 --- a/views/default/page/layouts/error.php +++ b/views/default/page/layouts/error.php @@ -3,4 +3,10 @@ * 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); -- cgit v1.2.3