diff options
Diffstat (limited to 'views/default')
-rw-r--r-- | views/default/admin/statistics/server/php.php | 17 | ||||
-rw-r--r-- | views/default/core/avatar/upload.php | 12 | ||||
-rw-r--r-- | views/default/core/river/filter.php | 16 | ||||
-rw-r--r-- | views/default/core/walled_garden/body.php | 11 | ||||
-rw-r--r-- | views/default/core/walled_garden/login.php | 8 | ||||
-rw-r--r-- | views/default/core/walled_garden/lost_password.php | 8 | ||||
-rw-r--r-- | views/default/core/walled_garden/register.php | 8 | ||||
-rw-r--r-- | views/default/css/walled_garden.php | 13 | ||||
-rw-r--r-- | views/default/js/walled_garden.php | 54 | ||||
-rw-r--r-- | views/default/object/elements/summary.php | 4 | ||||
-rw-r--r-- | views/default/object/plugin.php | 4 | ||||
-rw-r--r-- | views/default/output/tagcloud.php | 12 | ||||
-rw-r--r-- | views/default/page/elements/comments.php | 2 | ||||
-rw-r--r-- | views/default/page/layouts/walled_garden.php | 16 | ||||
-rw-r--r-- | views/default/river/elements/body.php | 2 | ||||
-rw-r--r-- | views/default/river/elements/summary.php | 11 |
16 files changed, 116 insertions, 82 deletions
diff --git a/views/default/admin/statistics/server/php.php b/views/default/admin/statistics/server/php.php index 4a59b95fb..7c6a51383 100644 --- a/views/default/admin/statistics/server/php.php +++ b/views/default/admin/statistics/server/php.php @@ -8,6 +8,15 @@ if (!$php_log) { $php_log = elgg_echo('admin:server:error_log'); } +$post_max_size = elgg_get_ini_setting_in_bytes('post_max_size'); +$upload_max_filesize = elgg_get_ini_setting_in_bytes('upload_max_filesize'); + +$post_max_size_warning = ''; +if ($upload_max_filesize > $post_max_size) { + // @todo show a link to something like http://nigel.mcnie.name/blog/uploadmaxfilesizepostmaxsize-experimentation ? + $post_max_size_warning = elgg_echo('admin:server:warning:post_max_too_small'); +} + ?> <table class="elgg-table-alt"> <tr class="odd"> @@ -30,4 +39,12 @@ if (!$php_log) { <td><b><?php echo elgg_echo('admin:server:label:mem_used'); ?> :</b></td> <td><?php echo number_format(memory_get_peak_usage()); ?></td> </tr> + <tr class="even"> + <td><b><?php echo elgg_echo('admin:server:label:post_max_size'); ?> :</b></td> + <td><?php echo number_format($post_max_size); ?></td> + </tr> + <tr class="odd"> + <td><b><?php echo elgg_echo('admin:server:label:upload_max_filesize'); ?> :</b></td> + <td><?php echo number_format($upload_max_filesize) . ' ' . $post_max_size_warning; ?></td> + </tr> </table> diff --git a/views/default/core/avatar/upload.php b/views/default/core/avatar/upload.php index 29aa59c9c..6f9124192 100644 --- a/views/default/core/avatar/upload.php +++ b/views/default/core/avatar/upload.php @@ -12,12 +12,12 @@ $user_avatar = elgg_view('output/img', array( $current_label = elgg_echo('avatar:current'); -$revert_button = ''; +$remove_button = ''; if ($vars['entity']->icontime) { - $revert_button = elgg_view('output/url', array( - 'text' => elgg_echo('revert'), - 'title' => elgg_echo('avatar:revert'), - 'href' => 'action/avatar/revert?guid=' . elgg_get_page_owner_guid(), + $remove_button = elgg_view('output/url', array( + 'text' => elgg_echo('remove'), + 'title' => elgg_echo('avatar:remove'), + 'href' => 'action/avatar/remove?guid=' . elgg_get_page_owner_guid(), 'is_action' => true, 'class' => 'elgg-button elgg-button-cancel mll', )); @@ -39,7 +39,7 @@ $image = <<<HTML <label>$current_label</label><br /> $user_avatar </div> -$revert_button +$remove_button HTML; $body = <<<HTML diff --git a/views/default/core/river/filter.php b/views/default/core/river/filter.php index 87380b561..9b7fadaa8 100644 --- a/views/default/core/river/filter.php +++ b/views/default/core/river/filter.php @@ -34,17 +34,5 @@ if ($selector) { $params['value'] = $selector; } echo elgg_view('input/dropdown', $params); -?> -<?php //@todo JS 1.8: no ?> -<script type="text/javascript"> -elgg.register_hook_handler('init', 'system', function() { - $('#elgg-river-selector').change(function() { - var url = window.location.href; - if (window.location.search.length) { - url = url.substring(0, url.indexOf('?')); - } - url += '?' + $(this).val(); - elgg.forward(url); - }); -}); -</script> + +elgg_load_js('elgg.ui.river'); diff --git a/views/default/core/walled_garden/body.php b/views/default/core/walled_garden/body.php deleted file mode 100644 index 67d8e0c37..000000000 --- a/views/default/core/walled_garden/body.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php -/** - * Walled garden body - */ - -echo elgg_view('core/walled_garden/login'); -echo elgg_view('core/walled_garden/lost_password'); - -if (elgg_get_config('allow_registration')) { - echo elgg_view('core/walled_garden/register'); -} diff --git a/views/default/core/walled_garden/login.php b/views/default/core/walled_garden/login.php index 0a8b4a908..42b79607d 100644 --- a/views/default/core/walled_garden/login.php +++ b/views/default/core/walled_garden/login.php @@ -14,7 +14,7 @@ $menu = elgg_view_menu('walled_garden', array( $login_box = elgg_view('core/account/login_box', array('module' => 'walledgarden-login')); -$content = <<<HTML +echo <<<HTML <div class="elgg-col elgg-col-1of2"> <div class="elgg-inner"> <h1 class="elgg-heading-walledgarden"> @@ -29,9 +29,3 @@ $content = <<<HTML </div> </div> HTML; - -echo elgg_view_module('walledgarden', '', $content, array( - 'class' => 'elgg-walledgarden-double', - 'header' => ' ', - 'footer' => ' ', -)); diff --git a/views/default/core/walled_garden/lost_password.php b/views/default/core/walled_garden/lost_password.php index ce75b558b..82f8caf50 100644 --- a/views/default/core/walled_garden/lost_password.php +++ b/views/default/core/walled_garden/lost_password.php @@ -5,15 +5,9 @@ $title = elgg_echo('user:password:lost'); $body = elgg_view_form('user/requestnewpassword'); -$lost = <<<HTML +echo <<<HTML <div class="elgg-inner"> <h3>$title</h3> $body </div> HTML; - -echo elgg_view_module('walledgarden', '', $lost, array( - 'class' => 'elgg-walledgarden-single elgg-walledgarden-password hidden', - 'header' => ' ', - 'footer' => ' ', -)); diff --git a/views/default/core/walled_garden/register.php b/views/default/core/walled_garden/register.php index 7f6aac99b..1ce2f8716 100644 --- a/views/default/core/walled_garden/register.php +++ b/views/default/core/walled_garden/register.php @@ -9,15 +9,9 @@ $body = elgg_view_form('register', array(), array( 'invitecode' => get_input('invitecode'), )); -$content = <<<__HTML +echo <<<__HTML <div class="elgg-inner"> <h2>$title</h2> $body </div> __HTML; - -echo elgg_view_module('walledgarden', '', $content, array( - 'class' => 'elgg-walledgarden-single elgg-walledgarden-register hidden', - 'header' => ' ', - 'footer' => ' ', -));
\ No newline at end of file diff --git a/views/default/css/walled_garden.php b/views/default/css/walled_garden.php index ea2543587..f6f7f97dc 100644 --- a/views/default/css/walled_garden.php +++ b/views/default/css/walled_garden.php @@ -54,8 +54,8 @@ $url = elgg_get_site_url(); padding: 0 8px; } -.elgg-walledgarden-single > .elgg-body > .elgg-inner { - padding: 0 8px; +.elgg-walledgarden-single > .elgg-body { + padding: 0 18px; } .elgg-module-walledgarden-login { @@ -68,7 +68,14 @@ $url = elgg_get_site_url(); } .elgg-heading-walledgarden { - color: #666666; margin-top: 60px; line-height: 1.1em; } + +h1, h2, h3, h4, h5, h6 { + color: #666; +} + +a { + color: #999; +}
\ No newline at end of file diff --git a/views/default/js/walled_garden.php b/views/default/js/walled_garden.php index 46c2934ff..13ec83c04 100644 --- a/views/default/js/walled_garden.php +++ b/views/default/js/walled_garden.php @@ -2,9 +2,10 @@ /** * Walled garden JavaScript * - * @todo update for new JS lib + * @since 1.8 */ +// note that this assumes the button view is not using single quotes $cancel_button = elgg_view('input/button', array( 'value' => elgg_echo('cancel'), 'class' => 'elgg-button-cancel mlm', @@ -13,28 +14,43 @@ $cancel_button = trim($cancel_button); ?> -$(document).ready(function() { +elgg.provide('elgg.walled_garden'); - // add cancel button to inline forms - $(".elgg-walledgarden-password").find('input.elgg-button-submit').after('<?php echo $cancel_button; ?>'); - $('.elgg-walledgarden-register').find('input.elgg-button-submit').after('<?php echo $cancel_button; ?>'); +elgg.walled_garden.init = function () { - $(".forgot_link").click(function(event) { - event.preventDefault(); - $(".elgg-walledgarden-password").fadeToggle(); - }); + $('.forgot_link').click(elgg.walled_garden.load('lost_password')); + $('.registration_link').click(elgg.walled_garden.load('register')); - $(".registration_link").click(function(event) { + $('input.elgg-button-cancel').live('click', function(event) { + if ($('.elgg-walledgarden-single').is(':visible')) { + $('.elgg-walledgarden-double').fadeToggle(); + $('.elgg-walledgarden-single').fadeToggle(); + $('.elgg-walledgarden-single').remove(); + } event.preventDefault(); - $(".elgg-walledgarden-register").fadeToggle(); }); +}; - $('input.elgg-button-cancel').click(function(event) { - if ($(".elgg-walledgarden-password").is(':visible')) { - $(".forgot_link").click(); - } else if ($('.elgg-walledgarden-register').is(':visible')) { - $(".registration_link").click(); - } +/** + * Creates a closure for loading walled garden content through ajax + * + * @param {String} view Name of the walled garden view + * @return {Object} + */ +elgg.walled_garden.load = function(view) { + return function(event) { + var id = '#elgg-walledgarden-' + view; + id = id.replace('_', '-'); + elgg.get('walled_garden/' + view, { + 'success' : function(data) { + $('.elgg-body-walledgarden').append(data); + $(id).find('input.elgg-button-submit').after('<?php echo $cancel_button; ?>'); + $('#elgg-walledgarden-login').fadeToggle(); + $(id).fadeToggle(); + }, + }); event.preventDefault(); - }); -});
\ No newline at end of file + }; +}; + +elgg.register_hook_handler('init', 'system', elgg.walled_garden.init);
\ No newline at end of file diff --git a/views/default/object/elements/summary.php b/views/default/object/elements/summary.php index 22db03f51..c0f3ad340 100644 --- a/views/default/object/elements/summary.php +++ b/views/default/object/elements/summary.php @@ -13,7 +13,7 @@ * @uses $vars['title'] Title link (optional) false = no title, '' = default * @uses $vars['metadata'] HTML for entity menu and metadata (optional) * @uses $vars['subtitle'] HTML for the subtitle (optional) - * @uses $vars['tags'] HTML for the tags (optional) + * @uses $vars['tags'] HTML for the tags (default is tags on entity, pass false for no tags) * @uses $vars['content'] HTML for the entity content (optional) */ @@ -39,7 +39,7 @@ $subtitle = elgg_extract('subtitle', $vars, ''); $content = elgg_extract('content', $vars, ''); $tags = elgg_extract('tags', $vars, ''); -if ($tags !== false) { +if ($tags === '') { $tags = elgg_view('output/tags', array('tags' => $entity->tags)); } diff --git a/views/default/object/plugin.php b/views/default/object/plugin.php index 2f64cfcc9..5c7138e96 100644 --- a/views/default/object/plugin.php +++ b/views/default/object/plugin.php @@ -7,6 +7,10 @@ * */ +if (!elgg_in_context('admin')) { + forward('/', 403); +} + $plugin = $vars['entity']; if (!$plugin->isValid()) { diff --git a/views/default/output/tagcloud.php b/views/default/output/tagcloud.php index 22b6cf49d..a212becd8 100644 --- a/views/default/output/tagcloud.php +++ b/views/default/output/tagcloud.php @@ -47,9 +47,15 @@ if (!empty($vars['tagcloud']) && is_array($vars['tagcloud'])) { if ($size < 100) { $size = 100; } - $url = elgg_get_site_url()."search?q=". urlencode($tag->tag) . "&search_type=tags$type$subtype"; - $url = elgg_format_url($url); - $cloud .= "<a href=\"$url\" style=\"font-size: $size%\" title=\"".addslashes($tag->tag)." ($tag->total)\">" . htmlspecialchars($tag->tag, ENT_QUOTES, 'UTF-8') . "</a>"; + $url = "search?q=". urlencode($tag->tag) . "&search_type=tags$type$subtype"; + + $cloud .= elgg_view('output/url', array( + 'text' => $tag->tag, + 'href' => $url, + 'style' => "font-size: $size%;", + 'title' => "$tag->tag ($tag->total)", + 'rel' => 'tag' + )); } $cloud .= elgg_view('tagcloud/extend'); diff --git a/views/default/page/elements/comments.php b/views/default/page/elements/comments.php index ebc7d3df5..cf9b5f08b 100644 --- a/views/default/page/elements/comments.php +++ b/views/default/page/elements/comments.php @@ -12,7 +12,7 @@ $show_add_form = elgg_extract('show_add_form', $vars, true); $id = ''; if (isset($vars['id'])) { - $id = "id =\"{$vars['id']}\""; + $id = "id=\"{$vars['id']}\""; } $class = 'elgg-comments'; diff --git a/views/default/page/layouts/walled_garden.php b/views/default/page/layouts/walled_garden.php new file mode 100644 index 000000000..6ecd941ef --- /dev/null +++ b/views/default/page/layouts/walled_garden.php @@ -0,0 +1,16 @@ +<?php +/** + * Walled Garden layout + * + * @uses $vars['content'] Main content + * @uses $vars['class'] CSS classes + * @uses $vars['id'] CSS id + */ + +$class = elgg_extract('class', $vars, 'elgg-walledgarden-single'); +echo elgg_view_module('walledgarden', '', $vars['content'], array( + 'class' => $class, + 'id' => elgg_extract('id', $vars, ''), + 'header' => ' ', + 'footer' => ' ', +)); diff --git a/views/default/river/elements/body.php b/views/default/river/elements/body.php index 6894b81e2..2cd7f2289 100644 --- a/views/default/river/elements/body.php +++ b/views/default/river/elements/body.php @@ -18,7 +18,7 @@ $menu = elgg_view_menu('river', array( )); // river item header -$timestamp = elgg_get_friendly_time($item->getPostedTime()); +$timestamp = elgg_view_friendly_time($item->getPostedTime()); $summary = elgg_extract('summary', $vars, elgg_view('river/elements/summary', array('item' => $vars['item']))); if ($summary === false) { diff --git a/views/default/river/elements/summary.php b/views/default/river/elements/summary.php index 84941131f..4402c6f65 100644 --- a/views/default/river/elements/summary.php +++ b/views/default/river/elements/summary.php @@ -40,5 +40,14 @@ if ($container instanceof ElggGroup) { $group_string = elgg_echo('river:ingroup', array($group_link)); } +// check summary translation keys. +// will use the $type:$subtype if that's defined, otherwise just uses $type +$key = "river:$action:$type:$subtype"; +$summary = elgg_echo($key, array($subject_link, $object_link)); + +if ($summary == $key) { + $key = "river:$action:$type"; + $summary = elgg_echo($key, array($subject_link, $object_link)); +} -echo elgg_echo("river:$action:$type:$subtype", array($subject_link, $object_link));
\ No newline at end of file +echo $summary;
\ No newline at end of file |