* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-if (!defined('STATUSNET')) {
- exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
/**
* Some UI extras for now...
}
/**
- * Load JS at runtime if we're logged in.
+ * Load JS at runtime.
*
* @param Action $action
* @return boolean hook result
*/
- function onEndShowScripts($action)
+ function onEndShowScripts(Action $action)
{
- $user = common_current_user();
- if ($user) {
- $action->script($this->path('modplus.js'));
- }
+ $action->script($this->path('js/modplus.js'));
return true;
}
public function onEndShowStylesheets(Action $action) {
- $action->cssLink($this->path('modplus.css'));
- return true;
- }
-
- /**
- * Add ModPlus-related paths to the router table
- *
- * Hook for RouterInitialized event.
- *
- * @param Net_URL_Mapper $m URL mapper
- *
- * @return boolean hook return
- */
- function onStartInitializeRouter($m)
- {
- $m->connect('user/remote/:id',
- array('action' => 'remoteprofile'),
- array('id' => '[\d]+'));
-
+ $action->cssLink($this->path('css/modplus.css'));
return true;
}
* @param NoticeListItem $item
* @return boolean hook value
*/
- function onStartShowNoticeItem(NoticeListItem $item)
+ function onEndShowNoticeItemAuthor(Profile $profile, HTMLOutputter $out)
{
- $this->showProfileOptions($item->out, $item->profile);
+ $this->showProfileOptions($out, $profile);
return true;
}
*/
protected function showProfileOptions(HTMLOutputter $out, Profile $profile)
{
- if (!$profile->isLocal()) {
- $target = common_local_url('remoteprofile', array('id' => $profile->id));
+ if (!$profile->isGroup() && !$profile->isLocal()) {
+ $target = common_local_url('userbyid', array('id' => $profile->getID()));
// TRANS: Label for access to remote profile options.
$label = _m('Remote profile options...');
$out->elementStart('div', 'remote-profile-options');