array('StatusNet', array('baseurl' => 'http://identi.ca'))
);
- function onEndShowStatusNetStyles($action) {
- $action->cssLink('plugins/ShareNotice/css/sharenotice.css');
+ public function onEndShowStylesheets(Action $action) {
+ $action->cssLink($this->path('css/sharenotice.css'));
return true;
}
protected function statusText()
{
- // TRANS: Leave this message unchanged.
+ // TRANS: %s is notice content that is shared on Twitter, Facebook or another platform.
$pattern = _m('"%s"');
- $url = $this->notice->bestUrl();
+ $url = $this->notice->getUrl();
$suffix = ' ' . $url;
$room = $this->maxLength() - mb_strlen($suffix) - (mb_strlen($pattern) - mb_strlen('%s'));
$content = $this->notice->content;
+ // TRANS: Truncation symbol.
+ $truncation_symbol = _m('…');
+ $truncation_symbol_length = mb_strlen($truncation_symbol);
if (mb_strlen($content) > $room) {
- $content = mb_substr($content, 0, $room - 1) . '…';
+ $content = mb_substr($content, 0, $room - $truncation_symbol_length) . $truncation_symbol;
}
return sprintf($pattern, $content) . $suffix;
public function targetUrl()
{
$args = array(
- 'u' => $this->notice->bestUrl(),
+ 'u' => $this->notice->getUrl(),
// TRANS: %s is notice content that is shared on Twitter, Facebook or another platform.
't' => sprintf(_m('"%s"'), $this->notice->content),
);
*
* @return boolean hook value
*/
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$url = 'http://status.net/wiki/Plugin:ShareNotice';
$versions[] = array('name' => 'ShareNotice',
- 'version' => STATUSNET_VERSION,
+ 'version' => GNUSOCIAL_VERSION,
'author' => 'Brion Vibber',
'homepage' => $url,
'rawdescription' =>