diff options
Diffstat (limited to 'mod')
-rw-r--r-- | mod/blog/start.php | 5 | ||||
-rw-r--r-- | mod/bookmarks/start.php | 5 | ||||
-rw-r--r-- | mod/file/start.php | 5 | ||||
-rw-r--r-- | mod/file/views/default/object/file.php | 2 | ||||
-rw-r--r-- | mod/groups/lib/groups.php | 2 | ||||
-rw-r--r-- | mod/groups/views/default/groups/css.php | 4 | ||||
-rw-r--r-- | mod/groups/views/default/groups/profile/summary.php | 4 | ||||
-rw-r--r-- | mod/notifications/actions/groupsave.php | 13 | ||||
-rw-r--r-- | mod/twitter/languages/en.php | 9 | ||||
-rw-r--r-- | mod/twitter/views/default/widgets/twitter/content.php | 39 | ||||
-rw-r--r-- | mod/twitter/views/default/widgets/twitter/edit.php | 32 |
11 files changed, 74 insertions, 46 deletions
diff --git a/mod/blog/start.php b/mod/blog/start.php index 8cbaf5cca..eb6eee05f 100644 --- a/mod/blog/start.php +++ b/mod/blog/start.php @@ -124,9 +124,12 @@ function blog_page_handler($page) { $params = blog_get_page_content_archive($user->guid, $page[2], $page[3]); break; case 'view': - case 'read': // Elgg 1.7 compatibility $params = blog_get_page_content_read($page[1]); break; + case 'read': // Elgg 1.7 compatibility + register_error(elgg_echo("changebookmark")); + forward("blog/view/{$page[1]}"); + break; case 'add': gatekeeper(); $params = blog_get_page_content_edit($page_type, $page[1]); diff --git a/mod/bookmarks/start.php b/mod/bookmarks/start.php index 66e22b565..3846f5165 100644 --- a/mod/bookmarks/start.php +++ b/mod/bookmarks/start.php @@ -125,11 +125,14 @@ function bookmarks_page_handler($page) { include "$pages/friends.php"; break; - case "read": case "view": set_input('guid', $page[1]); include "$pages/view.php"; break; + case 'read': // Elgg 1.7 compatibility + register_error(elgg_echo("changebookmark")); + forward("bookmarks/view/{$page[1]}"); + break; case "add": gatekeeper(); diff --git a/mod/file/start.php b/mod/file/start.php index 172042332..7ea050ce3 100644 --- a/mod/file/start.php +++ b/mod/file/start.php @@ -121,8 +121,11 @@ function file_page_handler($page) { file_register_toggle(); include "$file_dir/friends.php"; break; - case 'view': case 'read': // Elgg 1.7 compatibility + register_error(elgg_echo("changebookmark")); + forward("file/view/{$page[1]}"); + break; + case 'view': set_input('guid', $page[1]); include "$file_dir/view.php"; break; diff --git a/mod/file/views/default/object/file.php b/mod/file/views/default/object/file.php index b3f530183..64f19c483 100644 --- a/mod/file/views/default/object/file.php +++ b/mod/file/views/default/object/file.php @@ -68,6 +68,7 @@ if ($full && !elgg_in_context('gallery')) { $params = array( 'entity' => $file, + 'title' => false, 'metadata' => $metadata, 'subtitle' => $subtitle, ); @@ -79,7 +80,6 @@ if ($full && !elgg_in_context('gallery')) { echo elgg_view('object/elements/full', array( 'entity' => $file, - 'title' => false, 'icon' => $file_icon, 'summary' => $summary, 'body' => $body, diff --git a/mod/groups/lib/groups.php b/mod/groups/lib/groups.php index ea7308d39..d8d0f568d 100644 --- a/mod/groups/lib/groups.php +++ b/mod/groups/lib/groups.php @@ -152,7 +152,7 @@ function groups_handle_mine_page() { elgg_register_title_button(); - $content = elgg_list_entities_from_relationship_count(array( + $content = elgg_list_entities_from_relationship(array( 'type' => 'group', 'relationship' => 'member', 'relationship_guid' => elgg_get_page_owner_guid(), diff --git a/mod/groups/views/default/groups/css.php b/mod/groups/views/default/groups/css.php index f475f7d9e..6f710ddab 100644 --- a/mod/groups/views/default/groups/css.php +++ b/mod/groups/views/default/groups/css.php @@ -10,8 +10,8 @@ margin-right: 10px; } .groups-profile img { - width: 100%; - height: auto; + width: 100%; + height: auto; } .groups-stats { background: #eeeeee; diff --git a/mod/groups/views/default/groups/profile/summary.php b/mod/groups/views/default/groups/profile/summary.php index 6eca9745e..f1221f19a 100644 --- a/mod/groups/views/default/groups/profile/summary.php +++ b/mod/groups/views/default/groups/profile/summary.php @@ -16,7 +16,9 @@ $group = $vars['entity']; $owner = $group->getOwnerEntity(); if (!$owner) { - return true; + // not having an owner is very bad so we throw an exception + $msg = elgg_echo('InvalidParameterException:IdNotExistForGUID', array('group owner', $group->guid)); + throw new InvalidParameterException($msg); } ?> diff --git a/mod/notifications/actions/groupsave.php b/mod/notifications/actions/groupsave.php index 7838f7e63..2dd2a6db3 100644 --- a/mod/notifications/actions/groupsave.php +++ b/mod/notifications/actions/groupsave.php @@ -30,14 +30,11 @@ if ($groupmemberships = elgg_get_entities_from_relationship($options)) { } } -// Load important global vars -global $NOTIFICATION_HANDLERS; -foreach($NOTIFICATION_HANDLERS as $method => $foo) { - $subscriptions[$method] = get_input($method.'subscriptions'); - $personal[$method] = get_input($method.'personal'); - $collections[$method] = get_input($method.'collections'); - if (!empty($groups)) { - foreach($groups as $group) { +if (!empty($groups)) { + global $NOTIFICATION_HANDLERS; + foreach ($NOTIFICATION_HANDLERS as $method => $foo) { + $subscriptions[$method] = get_input($method.'subscriptions', array()); + foreach ($groups as $group) { if (in_array($group, $subscriptions[$method])) { add_entity_relationship($user->guid, 'notify'.$method, $group); } else { diff --git a/mod/twitter/languages/en.php b/mod/twitter/languages/en.php index 29700744a..11e745ba1 100644 --- a/mod/twitter/languages/en.php +++ b/mod/twitter/languages/en.php @@ -4,13 +4,14 @@ */ $english = array( - 'twitter:title' => 'Twitter', 'twitter:info' => 'Display your latest tweets', - 'twitter:username' => 'Enter your twitter username.', - 'twitter:num' => 'The number of tweets to show.', + 'twitter:username' => 'Your twitter username', + 'twitter:num' => 'Number of tweets to show*', 'twitter:visit' => 'visit my twitter', - 'twitter:notset' => 'This Twitter widget is not yet set to go. To display your latest tweets, click on - edit - and fill in your details', + 'twitter:notset' => 'This widget needs to be configured. To display your latest tweets, click the customize icon and fill in your Twitter username.', + 'twitter:invalid' => 'This widget is configured with an invalid Twitter username. Click the customize icon to correct it.', + 'twitter:apibug' => "*Due to a bug in the Twitter 1.0 API, you may see fewer tweets than you ask for.", ); add_translation("en", $english); diff --git a/mod/twitter/views/default/widgets/twitter/content.php b/mod/twitter/views/default/widgets/twitter/content.php index c616d944c..caefd369a 100644 --- a/mod/twitter/views/default/widgets/twitter/content.php +++ b/mod/twitter/views/default/widgets/twitter/content.php @@ -6,26 +6,37 @@ * @package ElggTwitter */ -//some required params - $username = $vars['entity']->twitter_username; + +if (empty($username)) { + echo "<p>" . elgg_echo("twitter:notset") . "</p>"; + return; +} + +$username_is_valid = preg_match('~^[a-zA-Z0-9_]{1,20}$~', $username); +if (!$username_is_valid) { + echo "<p>" . elgg_echo("twitter:invalid") . "</p>"; + return; +} + + $num = $vars['entity']->twitter_num; +if (empty($num)) { + $num = 5; +} -// if the twitter username is empty, then do not show -if ($username) { +// @todo upgrade to 1.1 API https://dev.twitter.com/docs/api/1.1/get/statuses/home_timeline +$script_url = "https://api.twitter.com/1/statuses/user_timeline/" . urlencode($username) . ".json" + . "?callback=twitterCallback2&count=" . (int) $num; ?> - <div id="twitter_widget"> <ul id="twitter_update_list"></ul> - <p class="visit_twitter"><a href="http://twitter.com/<?php echo $username; ?>"><?php echo elgg_echo("twitter:visit"); ?></a></p> + <p class="visit_twitter"><?php echo elgg_view('output/url', array( + 'text' => elgg_echo("twitter:visit"), + 'href' => 'http://twitter.com/' . urlencode($username), + 'is_trusted' => true, + )) ?></p> <script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script> - <script type="text/javascript" src="https://api.twitter.com/1/statuses/user_timeline/<?php echo $username; ?>.json?callback=twitterCallback2&count=<?php echo $num; ?>"></script> + <script type="text/javascript" src="<?php echo htmlspecialchars($script_url, ENT_QUOTES, 'UTF-8') ?>"></script> </div> - -<?php -} else { - - echo "<p>" . elgg_echo("twitter:notset") . ".</p>"; - -} diff --git a/mod/twitter/views/default/widgets/twitter/edit.php b/mod/twitter/views/default/widgets/twitter/edit.php index 5da3a7e55..c3fc6f0d5 100644 --- a/mod/twitter/views/default/widgets/twitter/edit.php +++ b/mod/twitter/views/default/widgets/twitter/edit.php @@ -1,16 +1,24 @@ <?php - /** - * Elgg twitter edit page - * - * @package ElggTwitter - */ +/** + * Elgg twitter edit page + * + * @package ElggTwitter + */ ?> - <p> - <?php echo elgg_echo("twitter:username"); ?> - <input type="text" name="params[twitter_username]" value="<?php echo htmlentities($vars['entity']->twitter_username); ?>" /> - <br /><?php echo elgg_echo("twitter:num"); ?> - <input type="text" name="params[twitter_num]" value="<?php echo htmlentities($vars['entity']->twitter_num); ?>" /> - - </p>
\ No newline at end of file +<div> + <?php echo elgg_echo("twitter:username"); ?> + <?php echo elgg_view('input/text', array( + 'name' => 'params[twitter_username]', + 'value' => $vars['entity']->twitter_username, + )) ?> +</div> +<div> + <?php echo elgg_echo("twitter:num"); ?> + <?php echo elgg_view('input/text', array( + 'name' => 'params[twitter_num]', + 'value' => $vars['entity']->twitter_num, + )) ?> + <span class="elgg-text-help"><?php echo elgg_echo("twitter:apibug"); ?></span> +</div>
\ No newline at end of file |