Beispiel #1
0
 public function deliver($from, $to, $title, $message, $parent1 = 0, $parent2 = 0)
 {
     require_once 'GWF_PM.php';
     $pm1 = GWF_PM::fakePM($from, $to, $title, $message, $from, GWF_PM::OUTBOX, $parent1);
     $pm1->setOption(GWF_PM::READ, true);
     if (false === $pm1->insert()) {
         return -1;
     }
     $pm2 = GWF_PM::fakePM($from, $to, $title, $message, $to, GWF_PM::INBOX, $parent2, $pm1->getID());
     $pm2->setOption(GWF_PM::OTHER_READ, true);
     if (false === $pm2->insert()) {
         return -2;
     }
     if (false === $pm1->saveVar('pm_otherid', $pm2->getID())) {
         return -3;
     }
     if (false === GWF_Counter::increaseCount('gwf3_pms_sent', 1)) {
         return -4;
     }
     if (!$this->cfgEmailOnPM()) {
         return 0;
     }
     $this->includeClass('GWF_EMailOnPM');
     return GWF_EMailOnPM::deliver($this, $pm2);
 }
Beispiel #2
0
 private function createNewPM(GWF_Form $form)
 {
     return GWF_PM::fakePM($this->user->getID(), $this->getReceiver()->getID(), $form->getVar('title'), $form->getVar('message'));
 }
Beispiel #3
0
 private function templatePreview(GWF_Form $form)
 {
     $tVars = array('pm' => GWF_PM::fakePM($this->pm->getSender()->getID(), $this->pm->getReceiver()->getID(), $form->getVar('title'), $form->getVar('message')), 'actions' => false, 'title' => $this->module->lang('ft_preview'), 'unread' => array());
     return $this->module->templatePHP('show.php', $tVars);
 }