aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--LICENSE.txt (renamed from LICENCE.txt)0
-rw-r--r--engine/classes/ElggMenuItem.php34
-rw-r--r--languages/en.php3
-rw-r--r--mod/blog/actions/blog/save.php17
-rw-r--r--mod/blog/views/default/forms/blog/save.php21
-rw-r--r--mod/dashboard/start.php2
-rw-r--r--mod/dashboard/views/default/dashboard/blurb.php2
-rw-r--r--mod/dashboard/views/default/dashboard/css.php10
-rw-r--r--mod/file/pages/file/view.php8
-rw-r--r--mod/file/views/default/forms/file/upload.php4
-rw-r--r--mod/file/views/default/object/file.php8
-rw-r--r--mod/members/pages/members/search.php8
-rw-r--r--mod/thewire/languages/en.php2
-rw-r--r--mod/thewire/start.php2
-rw-r--r--mod/thewire/views/default/thewire/reply.php7
-rw-r--r--mod/twitter/views/default/twitter/css.php2
-rw-r--r--mod/twitter_api/languages/en.php2
-rw-r--r--views/default/css/elgg.php7
-rw-r--r--views/default/page/default.php2
-rw-r--r--views/default/widgets/friends/content.php16
20 files changed, 110 insertions, 47 deletions
diff --git a/LICENCE.txt b/LICENSE.txt
index f833d881e..f833d881e 100644
--- a/LICENCE.txt
+++ b/LICENSE.txt
diff --git a/engine/classes/ElggMenuItem.php b/engine/classes/ElggMenuItem.php
index 157ed9ceb..cd6267ad6 100644
--- a/engine/classes/ElggMenuItem.php
+++ b/engine/classes/ElggMenuItem.php
@@ -132,7 +132,7 @@ class ElggMenuItem {
$item->setItemClass($options['item_class']);
unset($options['item_class']);
}
-
+
foreach ($options as $key => $value) {
$item->$key = $value;
}
@@ -153,9 +153,20 @@ class ElggMenuItem {
public function getName() {
return $this->name;
}
+
+ /**
+ * Set the display text of the menu item
+ *
+ * @param string $text The display text
+ *
+ * @return void
+ */
+ public function setText($text) {
+ $this->text = $text;
+ }
/**
- * Get the display text of the menu
+ * Get the display text of the menu item
*
* @return string
*/
@@ -164,6 +175,15 @@ class ElggMenuItem {
}
/**
+ * Set the URL of the menu item
+ *
+ * @return void
+ */
+ public function setHref($href) {
+ $this->href = $href;
+ }
+
+ /**
* Get the URL of the menu item
*
* @return string
@@ -465,7 +485,7 @@ class ElggMenuItem {
* @params array $vars Options to pass to output/url if a link
*
* @return string
- *
+ *
* @todo View code in a model. How do we feel about that?
*/
public function getContent(array $vars = array()) {
@@ -475,7 +495,7 @@ class ElggMenuItem {
}
$vars['text'] = $this->text;
-
+
if ($this->href) {
$vars['href'] = $this->href;
}
@@ -483,15 +503,15 @@ class ElggMenuItem {
if ($this->linkClass) {
$vars['class'] = $this->getLinkClass();
}
-
+
if ($this->rel) {
$vars['rel'] = $this->rel;
}
-
+
if ($this->title) {
$vars['title'] = $this->title;
}
-
+
if ($this->is_action) {
$vars['is_action'] = $this->is_action;
}
diff --git a/languages/en.php b/languages/en.php
index 5751f2a71..2e76ee2e7 100644
--- a/languages/en.php
+++ b/languages/en.php
@@ -383,7 +383,7 @@ $english = array(
'profile:editdefault:delete:success' => 'Default profile item deleted!',
'profile:defaultprofile:reset' => 'Default system profile reset',
'profile:resetdefault' => 'Reset default profile',
- 'profile:explainchangefields' => "You can replace the existing profile fields with your own using the form below. \n\n Give the new profile field a label, for example, 'Favorite team', then select the field type (eg. text, url, tags), and click the 'Add' button. To re-order the fields drag on the handle next to the field label. To edit a field label - click on the label's text to make it editable. \n\n At any time you can revert back to the default profile set up, but you will loose any information already entered into custom fields on profile pages.",
+ 'profile:explainchangefields' => "You can replace the existing profile fields with your own using the form below. \n\n Give the new profile field a label, for example, 'Favorite team', then select the field type (eg. text, url, tags), and click the 'Add' button. To re-order the fields drag on the handle next to the field label. To edit a field label - click on the label's text to make it editable. \n\n At any time you can revert back to the default profile set up, but you will lose any information already entered into custom fields on profile pages.",
'profile:editdefault:success' => 'Item successfully added to default profile',
'profile:editdefault:fail' => 'Default profile could not be saved',
@@ -775,6 +775,7 @@ $english = array(
'cancel' => "Cancel",
'saving' => "Saving ...",
'update' => "Update",
+ 'preview' => "Preview",
'edit' => "Edit",
'delete' => "Delete",
'accept' => "Accept",
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.",
diff --git a/views/default/css/elgg.php b/views/default/css/elgg.php
index 675af860d..4960e6ade 100644
--- a/views/default/css/elgg.php
+++ b/views/default/css/elgg.php
@@ -26,13 +26,12 @@ if ($old_css_view != elgg_get_config('viewpath')) {
Base CSS
* CSS reset
* core
- * helpers
+ * helpers (moved to end to have a higher priority)
* grid
*******************************************************************************/
echo elgg_view('css/elements/reset', $vars);
echo elgg_view('css/elements/core', $vars);
-echo elgg_view('css/elements/helpers', $vars);
echo elgg_view('css/elements/grid', $vars);
@@ -61,5 +60,9 @@ echo elgg_view('css/elements/layout', $vars);
echo elgg_view('css/elements/misc', $vars);
+// included last to have higher priority
+echo elgg_view('css/elements/helpers', $vars);
+
+
// in case plugins are still extending the old 'css' view, display it
echo elgg_view('css', $vars);
diff --git a/views/default/page/default.php b/views/default/page/default.php
index 9effce1ec..0e27cda52 100644
--- a/views/default/page/default.php
+++ b/views/default/page/default.php
@@ -17,7 +17,7 @@ if (elgg_get_context() == 'admin') {
elgg_deprecated_notice("admin plugins should route through 'admin'.", 1.8);
elgg_admin_add_plugin_settings_menu();
elgg_unregister_css('elgg');
- echo elgg_view('page/shells/admin', $vars);
+ echo elgg_view('page/admin', $vars);
return true;
}
diff --git a/views/default/widgets/friends/content.php b/views/default/widgets/friends/content.php
index 4c5ef5b4a..ec842a252 100644
--- a/views/default/widgets/friends/content.php
+++ b/views/default/widgets/friends/content.php
@@ -13,12 +13,12 @@ $num = (int) $vars['entity']->num_display;
// get the correct size
$size = $vars['entity']->icon_size;
-$html = $owner->listFriends('', $num, array(
- 'size' => $size,
- 'gallery' => true,
-));
-if ($html) {
- echo $html;
-} else {
-
+if (elgg_instanceof($owner, 'user')) {
+ $html = $owner->listFriends('', $num, array(
+ 'size' => $size,
+ 'gallery' => true,
+ ));
+ if ($html) {
+ echo $html;
+ }
}