diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/action.php | 1 | ||||
-rw-r--r-- | lib/default.php | 3 | ||||
-rw-r--r-- | lib/language.php | 16 | ||||
-rw-r--r-- | lib/mail.php | 4 | ||||
-rw-r--r-- | lib/noticeform.php | 21 | ||||
-rw-r--r-- | lib/repeatform.php | 4 | ||||
-rw-r--r-- | lib/router.php | 3 | ||||
-rw-r--r-- | lib/util.php | 1 |
8 files changed, 44 insertions, 9 deletions
diff --git a/lib/action.php b/lib/action.php index dac0e2583..35df03566 100644 --- a/lib/action.php +++ b/lib/action.php @@ -252,6 +252,7 @@ class Action extends HTMLOutputter // lawsuit if (Event::handle('StartShowJQueryScripts', array($this))) { $this->script('js/jquery.min.js'); $this->script('js/jquery.form.js'); + $this->script('js/jquery.cookie.js'); $this->script('js/jquery.joverlay.min.js'); Event::handle('EndShowJQueryScripts', array($this)); } diff --git a/lib/default.php b/lib/default.php index 42d4623b1..8a70ed3fa 100644 --- a/lib/default.php +++ b/lib/default.php @@ -226,7 +226,8 @@ $default = 'message' => array('contentlimit' => null), 'location' => - array('namespace' => 1), // 1 = geonames, 2 = Yahoo Where on Earth + array('share' => 'user', // whether to share location; 'always', 'user', 'never' + 'sharedefault' => true), 'omb' => array('timeout' => 5), // HTTP request timeout in seconds when contacting remote hosts for OMB updates 'logincommand' => diff --git a/lib/language.php b/lib/language.php index d8f529201..f5ee7fac5 100644 --- a/lib/language.php +++ b/lib/language.php @@ -32,6 +32,21 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } +// Locale category constants are usually predefined, but may not be +// on some systems such as Win32. +$LC_CATEGORIES = array('LC_CTYPE', + 'LC_NUMERIC', + 'LC_TIME', + 'LC_COLLATE', + 'LC_MONETARY', + 'LC_MESSAGES', + 'LC_ALL'); +foreach ($LC_CATEGORIES as $key => $name) { + if (!defined($name)) { + define($name, $key); + } +} + if (!function_exists('gettext')) { require_once("php-gettext/gettext.inc"); } @@ -283,6 +298,7 @@ function get_all_languages() { 'en' => array('q' => 1, 'lang' => 'en', 'name' => 'English (US)', 'direction' => 'ltr'), 'es' => array('q' => 1, 'lang' => 'es', 'name' => 'Spanish', 'direction' => 'ltr'), 'fi' => array('q' => 1, 'lang' => 'fi', 'name' => 'Finnish', 'direction' => 'ltr'), + 'fa' => array('q' => 1, 'lang' => 'fa', 'name' => 'Persian', 'direction' => 'rtl'), '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'), diff --git a/lib/mail.php b/lib/mail.php index dffac3262..472a88e06 100644 --- a/lib/mail.php +++ b/lib/mail.php @@ -599,6 +599,10 @@ function mail_notify_attn($user, $notice) $sender = $notice->getProfile(); + if ($sender->id == $user->id) { + return; + } + if (!$sender->hasRight(Right::EMAILONREPLY)) { return; } diff --git a/lib/noticeform.php b/lib/noticeform.php index 593a1e932..d35655a0b 100644 --- a/lib/noticeform.php +++ b/lib/noticeform.php @@ -110,6 +110,8 @@ class NoticeForm extends Form $this->user = common_current_user(); } + $this->profile = $this->user->getProfile(); + if (common_config('attachments', 'uploads')) { $this->enctype = 'multipart/form-data'; } @@ -198,12 +200,21 @@ class NoticeForm extends Form $this->out->hidden('notice_return-to', $this->action, 'returnto'); } $this->out->hidden('notice_in-reply-to', $this->inreplyto, 'inreplyto'); - $this->out->hidden('notice_data-lat', empty($this->lat) ? null : $this->lat, 'lat'); - $this->out->hidden('notice_data-lon', empty($this->lon) ? null : $this->lon, 'lon'); - $this->out->hidden('notice_data-location_id', empty($this->location_id) ? null : $this->location_id, 'location_id'); - $this->out->hidden('notice_data-location_ns', empty($this->location_ns) ? null : $this->location_ns, 'location_ns'); - Event::handle('StartShowNoticeFormData', array($this)); + if ($this->user->shareLocation()) { + $this->out->hidden('notice_data-lat', empty($this->lat) ? (empty($this->profile->lat) ? null : $this->profile->lat) : $this->lat, 'lat'); + $this->out->hidden('notice_data-lon', empty($this->lon) ? (empty($this->profile->lon) ? null : $this->profile->lon) : $this->lon, 'lon'); + $this->out->hidden('notice_data-location_id', empty($this->location_id) ? (empty($this->profile->location_id) ? null : $this->profile->location_id) : $this->location_id, 'location_id'); + $this->out->hidden('notice_data-location_ns', empty($this->location_ns) ? (empty($this->profile->location_ns) ? null : $this->profile->location_ns) : $this->location_ns, 'location_ns'); + + $this->out->elementStart('div', array('id' => 'notice_data-location_wrap', + 'class' => 'success', + 'title' => common_local_url('geocode'))); + $this->out->checkbox('notice_data-location_enabled', _('Share your location'), true); + $this->out->elementEnd('div'); + } + + Event::handle('EndShowNoticeFormData', array($this)); } } diff --git a/lib/repeatform.php b/lib/repeatform.php index 50e5d6dbe..4f1c8aa32 100644 --- a/lib/repeatform.php +++ b/lib/repeatform.php @@ -104,7 +104,7 @@ class RepeatForm extends Form */ function formLegend() { - $this->out->element('legend', null, _('Repeat this notice')); + $this->out->element('legend', null, _('Repeat this notice?')); } /** @@ -129,7 +129,7 @@ class RepeatForm extends Form function formActions() { $this->out->submit('repeat-submit-' . $this->notice->id, - _('Repeat'), 'submit', null, _('Repeat this notice')); + _('Yes'), 'submit', null, _('Repeat this notice')); } /** diff --git a/lib/router.php b/lib/router.php index 474e05996..7ec962460 100644 --- a/lib/router.php +++ b/lib/router.php @@ -100,7 +100,8 @@ class Router 'sandbox', 'unsandbox', 'silence', 'unsilence', 'repeat', - 'deleteuser'); + 'deleteuser', + 'geocode'); foreach ($main as $a) { $m->connect('main/'.$a, array('action' => $a)); diff --git a/lib/util.php b/lib/util.php index ed81aeba1..df3110ddd 100644 --- a/lib/util.php +++ b/lib/util.php @@ -1416,6 +1416,7 @@ function common_memcache() } else { $cache->addServer($servers); } + $cache->setCompressThreshold(20000, 0.2); } return $cache; } |