We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 951df6b0 authored by Evan Prodromou's avatar Evan Prodromou

button on the group page to post a new message

parent 5db1479a
......@@ -345,6 +345,39 @@ class PrivateGroupPlugin extends Plugin
return true;
}
/**
* To add a "Message" button to the group profile page
*
* @param Action $action The showgroup action being shown
* @param User_group $group The current group
*
* @return boolean hook value
*/
function onEndGroupActionsList($action, $group)
{
$cur = common_current_user();
if (empty($cur)) {
return true;
}
try {
Group_privacy_settings::ensurePost($cur, $group);
} catch (Exception $e) {
return true;
}
$action->elementStart('li', 'entity_send-a-message');
$action->element('a', array('href' => common_local_url('newgroupmessage', array('nickname' => $group->nickname)),
'title' => _('Send a direct message to this group')),
_('Message'));
// $form = new GroupMessageForm($action, $group);
// $form->hidden = true;
// $form->show();
$action->elementEnd('li');
return true;
}
function onPluginVersion(&$versions)
{
$versions[] = array('name' => 'PrivateGroup',
......
......@@ -127,6 +127,12 @@ class NewgroupmessageAction extends Action
}
}
function showNoticeForm()
{
$form = new GroupMessageForm($this, $this->group);
$form->show();
}
function sendNewMessage()
{
$gm = Group_message::send($this->user, $this->group, $this->text);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment