summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2009-12-03 12:51:21 -0800
committerZach Copley <zach@status.net>2009-12-03 12:51:21 -0800
commitbf4ed35a90d5cc906dbae7c097551fb3a10f14d6 (patch)
tree6e4e4c172865c81ca8bc05672cd5e5f9256fc0fb /lib
parent7ed3328c47ee9aac1d7663bce0c6c6349f7b2570 (diff)
parent9e0f89ba4ff1695c0137faa89c08f8b5c60050ac (diff)
Merge branch '0.9.x'
* 0.9.x: (141 commits) Reload the admin design panel page to show the new CSS when the Only pick up new default site colors if the theme has NOT changed. Delete design when user chooses to restore default design, instead Localisation updates for !StatusNet from !translatewiki.net !sntrans Do not rebuild/add .mo files by default If an XHR notice is sent form a page that has no timeline, show a Revert "If the page doesn't have .notices, silently skip the notice XHR response" Revert "Clear/reset the XHR notice form on pages where there is no timeline" Clear/reset the XHR notice form on pages where there is no timeline If the page doesn't have .notices, silently skip the notice XHR response Remove useless debugging statement Moved form control styles (i.e., border and radius) out of base add pluginhandler to list of daemons to shut down Using box-shadow only on the current navigation item Updated theme readme Fix regression in password settings: users have been unable to change their passwords since introduction of ChangePassword event (later StartChangePassword) November 5 in commit d6ddb84132d7b9510ba82064c67f2a39822dab49 Ticket 2048: make OMB posting HTTP timeout configurable as $config['omb']['timeout']; defaults to 5 seconds instead of 20-second default in Yadis library ticket 1100: add Drupal source link Fix makefile wildcards for locale compilation (now works on Ubuntu 8.04) typo fix: '$this' now spelled correctly. Looks like this'll fix acceptance of 'source' param for direct messages posted to API ... Conflicts: js/util.js locale/ar/LC_MESSAGES/statusnet.po locale/bg/LC_MESSAGES/statusnet.po locale/ca/LC_MESSAGES/statusnet.po locale/cs/LC_MESSAGES/statusnet.po locale/de/LC_MESSAGES/statusnet.po locale/el/LC_MESSAGES/statusnet.po locale/en_GB/LC_MESSAGES/statusnet.po locale/es/LC_MESSAGES/statusnet.po locale/fi/LC_MESSAGES/statusnet.po locale/fr/LC_MESSAGES/statusnet.po locale/ga/LC_MESSAGES/statusnet.po locale/he/LC_MESSAGES/statusnet.po locale/is/LC_MESSAGES/statusnet.po locale/it/LC_MESSAGES/statusnet.po locale/ja/LC_MESSAGES/statusnet.po locale/ko/LC_MESSAGES/statusnet.po locale/mk/LC_MESSAGES/statusnet.po locale/nb/LC_MESSAGES/statusnet.po locale/nl/LC_MESSAGES/statusnet.po locale/nn/LC_MESSAGES/statusnet.po locale/pl/LC_MESSAGES/statusnet.po locale/pt/LC_MESSAGES/statusnet.po locale/pt_BR/LC_MESSAGES/statusnet.po locale/ru/LC_MESSAGES/statusnet.po locale/statusnet.po locale/sv/LC_MESSAGES/statusnet.po locale/te/LC_MESSAGES/statusnet.po locale/tr/LC_MESSAGES/statusnet.po locale/uk/LC_MESSAGES/statusnet.po locale/vi/LC_MESSAGES/statusnet.po locale/zh_CN/LC_MESSAGES/statusnet.po locale/zh_TW/LC_MESSAGES/statusnet.po plugins/Realtime/realtimeupdate.js
Diffstat (limited to 'lib')
-rw-r--r--lib/designsettings.php2
-rw-r--r--lib/imagefile.php4
-rw-r--r--lib/language.php1
-rw-r--r--lib/noticelist.php28
-rw-r--r--lib/popularnoticesection.php5
-rw-r--r--lib/profileaction.php10
-rw-r--r--lib/rssaction.php12
-rw-r--r--lib/searchaction.php4
-rw-r--r--lib/searchgroupnav.php4
-rw-r--r--lib/userprofile.php57
10 files changed, 85 insertions, 42 deletions
diff --git a/lib/designsettings.php b/lib/designsettings.php
index 7b8c78c30..b70ba0dfc 100644
--- a/lib/designsettings.php
+++ b/lib/designsettings.php
@@ -107,7 +107,7 @@ class DesignSettingsAction extends AccountSettingsAction
'type' => 'file',
'id' => 'design_background-image_file'));
$this->element('p', 'form_guide', _('You can upload your personal ' .
- 'background image. The maximum file size is 2Mb.'));
+ 'background image. The maximum file size is 2MB.'));
$this->element('input', array('name' => 'MAX_FILE_SIZE',
'type' => 'hidden',
'id' => 'MAX_FILE_SIZE',
diff --git a/lib/imagefile.php b/lib/imagefile.php
index cf1668f20..6bc8e599b 100644
--- a/lib/imagefile.php
+++ b/lib/imagefile.php
@@ -214,9 +214,9 @@ class ImageFile
$value = ImageFile::maxFileSizeInt();
if ($value > 1024 * 1024) {
- return ($value/(1024*1024)).'Mb';
+ return ($value/(1024*1024)) . _('MB');
} else if ($value > 1024) {
- return ($value/(1024)).'kB';
+ return ($value/(1024)) . _('kB');
} else {
return $value;
}
diff --git a/lib/language.php b/lib/language.php
index a99bf89e3..4fc45bafe 100644
--- a/lib/language.php
+++ b/lib/language.php
@@ -172,6 +172,7 @@ function get_all_languages() {
'fr-fr' => array('q' => 1, 'lang' => 'fr', 'name' => 'French', 'direction' => 'ltr'),
'ga' => array('q' => 0.5, 'lang' => 'ga', 'name' => 'Galician', 'direction' => 'ltr'),
'he' => array('q' => 0.5, 'lang' => 'he', 'name' => 'Hebrew', 'direction' => 'rtl'),
+ 'hsb' => array('q' => 0.8, 'lang' => 'hsb', 'name' => 'Upper Sorbian', 'direction' => 'ltr'),
'is' => array('q' => 0.1, 'lang' => 'is', 'name' => 'Icelandic', 'direction' => 'ltr'),
'it' => array('q' => 1, 'lang' => 'it', 'name' => 'Italian', 'direction' => 'ltr'),
'jp' => array('q' => 0.5, 'lang' => 'ja', 'name' => 'Japanese', 'direction' => 'ltr'),
diff --git a/lib/noticelist.php b/lib/noticelist.php
index 5877827ff..21cec528f 100644
--- a/lib/noticelist.php
+++ b/lib/noticelist.php
@@ -392,15 +392,19 @@ class NoticeListItem extends Widget
$name = $location->getName();
- if (empty($name)) {
- // XXX: Could be a translation issue. Fall back to... something?
- return;
- }
-
$lat = $this->notice->lat;
$lon = $this->notice->lon;
$latlon = (!empty($lat) && !empty($lon)) ? $lat.';'.$lon : '';
+ if (empty($name)) {
+ $latdms = $this->decimalDegreesToDMS(abs($lat));
+ $londms = $this->decimalDegreesToDMS(abs($lon));
+ $name = sprintf(
+ _('%1$u°%2$u\'%3$u"%4$s %5$u°%6$u\'%7$u"%8$s'),
+ $latdms['deg'],$latdms['min'], $latdms['sec'],($lat>0?_('N'):_('S')),
+ $londms['deg'],$londms['min'], $londms['sec'],($lon>0?_('E'):_('W')));
+ }
+
$url = $location->getUrl();
$this->out->elementStart('span', array('class' => 'location'));
@@ -418,6 +422,20 @@ class NoticeListItem extends Widget
$this->out->elementEnd('span');
}
+ function decimalDegreesToDMS($dec)
+ {
+
+ $vars = explode(".",$dec);
+ $deg = $vars[0];
+ $tempma = "0.".$vars[1];
+
+ $tempma = $tempma * 3600;
+ $min = floor($tempma / 60);
+ $sec = $tempma - ($min*60);
+
+ return array("deg"=>$deg,"min"=>$min,"sec"=>$sec);
+ }
+
/**
* Show the source of the notice
*
diff --git a/lib/popularnoticesection.php b/lib/popularnoticesection.php
index 35b914a50..9fbc9d2dd 100644
--- a/lib/popularnoticesection.php
+++ b/lib/popularnoticesection.php
@@ -68,8 +68,9 @@ class PopularNoticeSection extends NoticeSection
}
$qry .= ' GROUP BY notice.id,notice.profile_id,notice.content,notice.uri,' .
'notice.rendered,notice.url,notice.created,notice.modified,' .
- 'notice.reply_to,notice.is_local,notice.source,notice.conversation ' .
- 'ORDER BY weight DESC';
+ 'notice.reply_to,notice.is_local,notice.source,notice.conversation, ' .
+ 'notice.lat,notice.lon,location_id,location_ns' .
+ ' ORDER BY weight DESC';
$offset = 0;
$limit = NOTICES_PER_SECTION + 1;
diff --git a/lib/profileaction.php b/lib/profileaction.php
index e3a39ad8b..2d4d23265 100644
--- a/lib/profileaction.php
+++ b/lib/profileaction.php
@@ -166,6 +166,7 @@ class ProfileAction extends OwnerDesignAction
$subs_count = $this->profile->subscriptionCount();
$subbed_count = $this->profile->subscriberCount();
$notice_count = $this->profile->noticeCount();
+ $group_count = $this->user->getGroups()->N;
$this->elementStart('div', array('id' => 'entity_statistics',
'class' => 'section'));
@@ -202,6 +203,15 @@ class ProfileAction extends OwnerDesignAction
$this->element('dd', 'subscribers', $subbed_count);
$this->elementEnd('dl');
+ $this->elementStart('dl', 'entity_groups');
+ $this->elementStart('dt');
+ $this->element('a', array('href' => common_local_url('usergroups',
+ array('nickname' => $this->profile->nickname))),
+ _('Groups'));
+ $this->elementEnd('dt');
+ $this->element('dd', 'groups', $group_count);
+ $this->elementEnd('dl');
+
$this->elementStart('dl', 'entity_notices');
$this->element('dt', null, _('Notices'));
$this->element('dd', null, $notice_count);
diff --git a/lib/rssaction.php b/lib/rssaction.php
index 3b303f73e..d591c99ed 100644
--- a/lib/rssaction.php
+++ b/lib/rssaction.php
@@ -176,8 +176,10 @@ class Rss10Action extends Action
$this->showChannel();
$this->showImage();
- foreach ($this->notices as $n) {
- $this->showItem($n);
+ if (count($this->notices)) {
+ foreach ($this->notices as $n) {
+ $this->showItem($n);
+ }
}
$this->showCreators();
@@ -203,8 +205,10 @@ class Rss10Action extends Action
$this->elementStart('items');
$this->elementStart('rdf:Seq');
- foreach ($this->notices as $notice) {
- $this->element('rdf:li', array('rdf:resource' => $notice->uri));
+ if (count($this->notices)) {
+ foreach ($this->notices as $notice) {
+ $this->element('rdf:li', array('rdf:resource' => $notice->uri));
+ }
}
$this->elementEnd('rdf:Seq');
diff --git a/lib/searchaction.php b/lib/searchaction.php
index 130b28ff5..bb71a2ba1 100644
--- a/lib/searchaction.php
+++ b/lib/searchaction.php
@@ -123,8 +123,8 @@ class SearchAction extends Action
if (!common_config('site', 'fancy')) {
$this->hidden('action', $this->trimmed('action'));
}
- $this->input('q', 'Keyword(s)', $q);
- $this->submit('search', 'Search');
+ $this->input('q', _('Keyword(s)'), $q);
+ $this->submit('search', _('Search'));
$this->elementEnd('li');
$this->elementEnd('ul');
$this->elementEnd('fieldset');
diff --git a/lib/searchgroupnav.php b/lib/searchgroupnav.php
index 677365ea9..e843dc096 100644
--- a/lib/searchgroupnav.php
+++ b/lib/searchgroupnav.php
@@ -79,9 +79,9 @@ class SearchGroupNav extends Widget
}
$this->out->menuItem(common_local_url('peoplesearch', $args), _('People'),
_('Find people on this site'), $action_name == 'peoplesearch', 'nav_search_people');
- $this->out->menuItem(common_local_url('noticesearch', $args), _('Notice'),
+ $this->out->menuItem(common_local_url('noticesearch', $args), _('Notices'),
_('Find content of notices'), $action_name == 'noticesearch', 'nav_search_notice');
- $this->out->menuItem(common_local_url('groupsearch', $args), _('Group'),
+ $this->out->menuItem(common_local_url('groupsearch', $args), _('Groups'),
_('Find groups on this site'), $action_name == 'groupsearch', 'nav_search_group');
$this->action->elementEnd('ul');
}
diff --git a/lib/userprofile.php b/lib/userprofile.php
index ee205af85..07e575085 100644
--- a/lib/userprofile.php
+++ b/lib/userprofile.php
@@ -304,34 +304,43 @@ class UserProfile extends Widget
}
$this->out->elementEnd('li');
- if ($cur->hasRight(Right::SANDBOXUSER)) {
- $this->out->elementStart('li', 'entity_sandbox');
- if ($this->user->isSandboxed()) {
- $usf = new UnSandboxForm($this->out, $this->profile, $r2args);
- $usf->show();
- } else {
- $sf = new SandboxForm($this->out, $this->profile, $r2args);
- $sf->show();
+ if ($cur->hasRight(Right::SANDBOXUSER) ||
+ $cur->hasRight(Right::SILENCEUSER) ||
+ $cur->hasRight(Right::DELETEUSER)) {
+ $this->out->elementStart('li', 'entity_moderation');
+ $this->out->element('p', null, _('Moderate'));
+ $this->out->elementStart('ul');
+ if ($cur->hasRight(Right::SANDBOXUSER)) {
+ $this->out->elementStart('li', 'entity_sandbox');
+ if ($this->user->isSandboxed()) {
+ $usf = new UnSandboxForm($this->out, $this->profile, $r2args);
+ $usf->show();
+ } else {
+ $sf = new SandboxForm($this->out, $this->profile, $r2args);
+ $sf->show();
+ }
+ $this->out->elementEnd('li');
}
- $this->out->elementEnd('li');
- }
- if ($cur->hasRight(Right::SILENCEUSER)) {
- $this->out->elementStart('li', 'entity_silence');
- if ($this->user->isSilenced()) {
- $usf = new UnSilenceForm($this->out, $this->profile, $r2args);
- $usf->show();
- } else {
- $sf = new SilenceForm($this->out, $this->profile, $r2args);
- $sf->show();
+ if ($cur->hasRight(Right::SILENCEUSER)) {
+ $this->out->elementStart('li', 'entity_silence');
+ if ($this->user->isSilenced()) {
+ $usf = new UnSilenceForm($this->out, $this->profile, $r2args);
+ $usf->show();
+ } else {
+ $sf = new SilenceForm($this->out, $this->profile, $r2args);
+ $sf->show();
+ }
+ $this->out->elementEnd('li');
}
- $this->out->elementEnd('li');
- }
- if ($cur->hasRight(Right::DELETEUSER)) {
- $this->out->elementStart('li', 'entity_delete');
- $df = new DeleteUserForm($this->out, $this->profile, $r2args);
- $df->show();
+ if ($cur->hasRight(Right::DELETEUSER)) {
+ $this->out->elementStart('li', 'entity_delete');
+ $df = new DeleteUserForm($this->out, $this->profile, $r2args);
+ $df->show();
+ $this->out->elementEnd('li');
+ }
+ $this->out->elementEnd('ul');
$this->out->elementEnd('li');
}
}