diff options
Diffstat (limited to 'mod')
-rw-r--r-- | mod/blog/actions/blog/save.php | 17 | ||||
-rw-r--r-- | mod/blog/views/default/forms/blog/save.php | 21 | ||||
-rw-r--r-- | mod/dashboard/start.php | 2 | ||||
-rw-r--r-- | mod/dashboard/views/default/dashboard/blurb.php | 2 | ||||
-rw-r--r-- | mod/dashboard/views/default/dashboard/css.php | 10 | ||||
-rw-r--r-- | mod/file/pages/file/view.php | 8 | ||||
-rw-r--r-- | mod/file/views/default/forms/file/upload.php | 4 | ||||
-rw-r--r-- | mod/file/views/default/object/file.php | 8 | ||||
-rw-r--r-- | mod/members/pages/members/search.php | 8 | ||||
-rw-r--r-- | mod/thewire/languages/en.php | 2 | ||||
-rw-r--r-- | mod/thewire/start.php | 2 | ||||
-rw-r--r-- | mod/thewire/views/default/thewire/reply.php | 7 | ||||
-rw-r--r-- | mod/twitter/views/default/twitter/css.php | 2 | ||||
-rw-r--r-- | mod/twitter_api/languages/en.php | 2 |
14 files changed, 67 insertions, 28 deletions
diff --git a/mod/blog/actions/blog/save.php b/mod/blog/actions/blog/save.php index c42845037..8be67ec6c 100644 --- a/mod/blog/actions/blog/save.php +++ b/mod/blog/actions/blog/save.php @@ -8,6 +8,9 @@ // start a new sticky form session in case of failure elgg_make_sticky_form('blog'); +// save or preview +$save = (bool)get_input('save'); + // store errors to pass along $error = FALSE; $error_forward_url = REFERER; @@ -106,6 +109,11 @@ foreach ($values as $name => $default) { } } +// if preview, force status to be draft +if ($save == false) { + $values['status'] = 'draft'; +} + // assign values to the entity, stopping on error. if (!$error) { foreach ($values as $name => $value) { @@ -148,12 +156,13 @@ if (!$error) { $blog->save(); } } elseif ($old_status == 'published' && $status == 'draft') { - $q = "DELETE FROM {$db_prefix}river - WHERE object_guid = $blog->guid AND action_type = 'create'"; - delete_data($q); + elgg_delete_river(array( + 'object_guid' => $blog->guid, + 'action_type' => 'create', + )); } - if ($blog->status == 'published') { + if ($blog->status == 'published' || $save == false) { forward($blog->getURL()); } else { forward("blog/edit/$blog->guid"); diff --git a/mod/blog/views/default/forms/blog/save.php b/mod/blog/views/default/forms/blog/save.php index cf5a4032e..d99f45f01 100644 --- a/mod/blog/views/default/forms/blog/save.php +++ b/mod/blog/views/default/forms/blog/save.php @@ -5,6 +5,8 @@ * @package Blog */ +$blog = get_entity($vars['guid']); + $draft_warning = $vars['draft_warning']; if ($draft_warning) { $draft_warning = '<span class="message warning">' . $draft_warning . '</span>'; @@ -12,6 +14,7 @@ if ($draft_warning) { $action_buttons = ''; $delete_link = ''; +$preview_button = ''; if ($vars['guid']) { // add a delete button if editing @@ -19,12 +22,24 @@ if ($vars['guid']) { $delete_link = elgg_view('output/confirmlink', array( 'href' => $delete_url, 'text' => elgg_echo('delete'), - 'class' => 'elgg-button elgg-button-delete elgg-state-disabled' + 'class' => 'elgg-button elgg-button-delete elgg-state-disabled float-alt' )); } -$save_button = elgg_view('input/submit', array('value' => elgg_echo('save'))); -$action_buttons = $save_button . $delete_link; +// published blogs do not get the preview button +if (!$vars['guid'] || ($blog && $blog->status != 'published')) { + $preview_button = elgg_view('input/submit', array( + 'value' => elgg_echo('preview'), + 'name' => 'preview', + 'class' => 'mls', + )); +} + +$save_button = elgg_view('input/submit', array( + 'value' => elgg_echo('save'), + 'name' => 'save', +)); +$action_buttons = $save_button . $preview_button . $delete_link; $title_label = elgg_echo('title'); $title_input = elgg_view('input/text', array( diff --git a/mod/dashboard/start.php b/mod/dashboard/start.php index 4fa048b3d..9de1ee4af 100644 --- a/mod/dashboard/start.php +++ b/mod/dashboard/start.php @@ -8,6 +8,8 @@ elgg_register_event_handler('init', 'system', 'dashboard_init'); function dashboard_init() { elgg_register_page_handler('dashboard', 'dashboard_page_handler'); + elgg_extend_view('css/elgg', 'dashboard/css'); + elgg_register_menu_item('topbar', array( 'name' => 'dashboard', 'href' => 'dashboard', diff --git a/mod/dashboard/views/default/dashboard/blurb.php b/mod/dashboard/views/default/dashboard/blurb.php index 202be1dc5..9293e513a 100644 --- a/mod/dashboard/views/default/dashboard/blurb.php +++ b/mod/dashboard/views/default/dashboard/blurb.php @@ -9,7 +9,7 @@ <?php echo elgg_view('output/longtext', array( 'id' => 'dashboard-info', - 'class' => 'elgg-inner elgg-border-plain pam mhs mbl mtn', + 'class' => 'elgg-inner pam mhs mtn', 'value' => elgg_echo("dashboard:nowidgets"), )); diff --git a/mod/dashboard/views/default/dashboard/css.php b/mod/dashboard/views/default/dashboard/css.php new file mode 100644 index 000000000..f49293293 --- /dev/null +++ b/mod/dashboard/views/default/dashboard/css.php @@ -0,0 +1,10 @@ +<?php +/** + * User dashboard CSS + */ +?> + +#dashboard-info { + border: 2px solid #dedede; + margin-bottom: 15px; +} diff --git a/mod/file/pages/file/view.php b/mod/file/pages/file/view.php index daa2a400e..45e112d4d 100644 --- a/mod/file/pages/file/view.php +++ b/mod/file/pages/file/view.php @@ -25,11 +25,17 @@ elgg_push_breadcrumb($title); $content = elgg_view_entity($file, true); $content .= elgg_view_comments($file); +$download = elgg_view('output/url', array( + 'href' => "mod/file/download.php?file_guid=$file->guid", + 'text' => elgg_echo("file:download"), + 'class' => 'elgg-button elgg-button-action float-alt', +)); + $body = elgg_view_layout('content', array( 'content' => $content, 'title' => $title, 'filter' => '', - 'header' => '', + 'buttons' => $download, )); echo elgg_view_page($title, $body); diff --git a/mod/file/views/default/forms/file/upload.php b/mod/file/views/default/forms/file/upload.php index 001e66674..b8a7a1668 100644 --- a/mod/file/views/default/forms/file/upload.php +++ b/mod/file/views/default/forms/file/upload.php @@ -16,8 +16,10 @@ $ajax = elgg_extract('ajax', $vars, FALSE); if ($guid) { $file_label = elgg_echo("file:replace"); + $submit_label = elgg_echo('save'); } else { $file_label = elgg_echo("file:file"); + $submit_label = elgg_echo('upload'); } ?> @@ -63,7 +65,7 @@ if ($guid) { echo elgg_view('input/hidden', array('name' => 'file_guid', 'value' => $guid)); } -echo elgg_view('input/submit', array('value' => elgg_echo("save"))); +echo elgg_view('input/submit', array('value' => $submit_label)); ?> </div> diff --git a/mod/file/views/default/object/file.php b/mod/file/views/default/object/file.php index 93a21c8e6..c6ac2a429 100644 --- a/mod/file/views/default/object/file.php +++ b/mod/file/views/default/object/file.php @@ -67,12 +67,6 @@ if ($full && !elgg_in_context('gallery')) { $extra = elgg_view("file/specialcontent/$base_type/default", $vars); } - $download = elgg_view('output/url', array( - 'href' => "mod/file/download.php?file_guid=$file->guid", - 'text' => elgg_echo("file:download"), - 'class' => 'elgg-button elgg-button-action', - )); - $header = elgg_view_title($file->title); $params = array( @@ -87,12 +81,10 @@ if ($full && !elgg_in_context('gallery')) { $file_info = elgg_view_image_block($file_icon, $list_body); echo <<<HTML -$header $file_info <div class="file elgg-content"> $body $extra - <p>$download</p> </div> HTML; diff --git a/mod/members/pages/members/search.php b/mod/members/pages/members/search.php index 39b54990e..94127768a 100644 --- a/mod/members/pages/members/search.php +++ b/mod/members/pages/members/search.php @@ -19,16 +19,16 @@ if ($vars['search_type'] == 'tag') { $users = $results['entities']; $content = elgg_view_entity_list($users, $count, $offset, $limit, false, false, true); } else { - $name = get_input('name'); + $name = sanitize_string(get_input('name')); $title = elgg_echo('members:title:searchname', array($name)); - global $CONFIG; + $db_prefix = elgg_get_config('dbprefix'); $params = array( 'type' => 'user', 'full_view' => false, - 'joins' => array("join {$CONFIG->dbprefix}users_entity u on e.guid=u.guid"), - 'wheres' => array("(u.name like \"%{$name}%\" or u.username like \"%{$name}%\")"), + 'joins' => array("JOIN {$db_prefix}users_entity u ON e.guid=u.guid"), + 'wheres' => array("(u.name LIKE \"%{$name}%\" OR u.username LIKE \"%{$name}%\")"), ); $content .= elgg_list_entities($params); } diff --git a/mod/thewire/languages/en.php b/mod/thewire/languages/en.php index 1b9d71c56..9b2b480ae 100644 --- a/mod/thewire/languages/en.php +++ b/mod/thewire/languages/en.php @@ -13,7 +13,7 @@ $english = array( 'thewire:user' => "%s's wire posts", 'thewire:friends' => "Friends' wire posts", 'thewire:reply' => "Reply", - 'thewire:replying' => "Replying to %s who wrote", + 'thewire:replying' => "Replying to %s (@%s) who wrote", 'thewire:thread' => "Thread", 'thewire:charleft' => "characters remaining", 'thewire:tags' => "Wire posts tagged with '%s'", diff --git a/mod/thewire/start.php b/mod/thewire/start.php index 0e6bd7794..2d66c475c 100644 --- a/mod/thewire/start.php +++ b/mod/thewire/start.php @@ -401,7 +401,7 @@ function thewire_setup_entity_menu_items($hook, $type, $value, $params) { 'text' => elgg_echo('thewire:previous'), 'href' => "thewire/previous/$entity->guid", 'priority' => 160, - 'class' => 'thewire-previous', + 'link_class' => 'thewire-previous', 'title' => elgg_echo('thewire:previous:help'), ); $value[] = ElggMenuItem::factory($options); diff --git a/mod/thewire/views/default/thewire/reply.php b/mod/thewire/views/default/thewire/reply.php index 3794e1454..341b691b1 100644 --- a/mod/thewire/views/default/thewire/reply.php +++ b/mod/thewire/views/default/thewire/reply.php @@ -5,7 +5,10 @@ $post = $vars['post']; $poster = $post->getOwnerEntity(); - +$poster_details = array( + htmlspecialchars($poster->name, ENT_QUOTES, 'UTF-8'), + htmlspecialchars($poster->username, ENT_QUOTES, 'UTF-8'), +); ?> -<b><?php echo elgg_echo('thewire:replying', array($poster->name)); ?>: </b> +<b><?php echo elgg_echo('thewire:replying', $poster_details); ?>: </b> <?php echo $post->description;
\ No newline at end of file diff --git a/mod/twitter/views/default/twitter/css.php b/mod/twitter/views/default/twitter/css.php index cb58e8fb1..eb0cda98a 100644 --- a/mod/twitter/views/default/twitter/css.php +++ b/mod/twitter/views/default/twitter/css.php @@ -54,7 +54,7 @@ p.twitter_username .input-text { padding:2px; margin:0 0 5px 0; } -#twitter_widget li a { +#twitter_widget li > a { display:block; margin:0 0 0 4px; } diff --git a/mod/twitter_api/languages/en.php b/mod/twitter_api/languages/en.php index b63cebcf8..940a49d9b 100644 --- a/mod/twitter_api/languages/en.php +++ b/mod/twitter_api/languages/en.php @@ -23,7 +23,7 @@ $english = array( 'twitter_api:revoke:success' => 'Twitter access has been revoked.', 'twitter_api:login' => 'Allow existing users who have connected their Twitter account to sign in with Twitter?', - 'twitter_api:new_users' => 'Allow new users to sign up using their Twitter account even if manual registration is disabled?', + 'twitter_api:new_users' => 'Allow new users to sign up using their Twitter account even if user registration is disabled?', 'twitter_api:login:success' => 'You have been logged in.', 'twitter_api:login:error' => 'Unable to login with Twitter.', 'twitter_api:login:email' => "You must enter a valid email address for your new %s account.", |