summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/action.php1
-rw-r--r--lib/noticeform.php21
-rw-r--r--lib/router.php3
-rw-r--r--lib/util.php1
4 files changed, 20 insertions, 6 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/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/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;
}