EndShowNoticeForm: after showing the notice form (after <form>)
- $action: action being executed
+StartShowEntryForms: microapp entry form tab data
+- &$tabs: tab assoc array with 'tag' => (title, href to create new entry)
+
StartGrantRole: when a role is being assigned
- $profile: profile that will have the role
- $role: string name of the role
function showNoticeForm()
{
// TRANS: Tab on the notice form.
- $tabs = array('status' => _m('TAB','Status'));
+ $tabs = array('status' => array('title' => _m('TAB','Status'),
+ 'href' => common_local_url('newnotice')));
$this->elementStart('div', 'input_forms');
$this->elementStart('ul', array('class' => 'nav',
'id' => 'input_form_nav'));
- foreach ($tabs as $tag => $title) {
+ foreach ($tabs as $tag => $data) {
+ $tag = htmlspecialchars($tag);
$attrs = array('id' => 'input_form_nav_'.$tag,
'class' => 'input_form_nav_tab');
$this->elementStart('li', $attrs);
$this->element('a',
- array('href' => 'javascript:SN.U.switchInputFormTab("'.$tag.'")'),
- $title);
+ array('onclick' => 'return SN.U.switchInputFormTab("'.$tag.'");',
+ 'href' => $data['href']),
+ $data['title']);
$this->elementEnd('li');
}
$form->show();
$this->elementEnd('div');
- foreach ($tabs as $tag => $title) {
+ foreach ($tabs as $tag => $data) {
$attrs = array('class' => 'input_form',
'id' => 'input_form_'.$tag);
*/
abstract function deleteRelated($notice);
+ /**
+ *
+ */
+ public function newFormAction() {
+ // such as 'newbookmark' or 'newevent' route
+ return 'new'.$this->tag();
+ }
+
/**
* Check if a given notice object should be handled by this micro-app
* plugin.
function onStartShowEntryForms(&$tabs)
{
- $tabs[$this->tag()] = $this->appTitle();
+ $tabs[$this->tag()] = array('title' => $this->appTitle(),
+ 'href' => common_local_url($this->newFormAction()),
+ );
return true;
}