function onStartShowNoticeFormData($form)
{
- $form->out->element('style', null, 'label#notice_data-text-label { display: none }');
+ $form->out->element('style',
+ null,
+ 'label#notice_data-text-label { display: none }');
$form->out->element('input', array('type' => 'text',
'id' => 'notice_title',
'name' => 'notice_title',
return true;
}
+
+ /**
+ * Remove title when the notice is deleted
+ *
+ * @param Notice $notice Notice being deleted
+ *
+ * @return boolean hook value
+ */
+
+ function onNoticeDeleteRelated($notice)
+ {
+ $nt = Notice_title::staticGet('notice_id', $notice->id);
+
+ if (!empty($nt)) {
+ $nt->delete();
+ }
+
+ return true;
+ }
}