コード例 #1
0
ファイル: DownloadItem.class.php プロジェクト: jacboy/JCoins
 /**
  * @see \wcf\system\jcoins\shop\item\type\IShopItem::boughtAction()
  */
 public function boughtAction(array $paramters)
 {
     parent::boughtAction($paramters);
     $paramters = $this->prepare($paramters);
     if ($paramters['redirect'] == 1) {
         return array('location' => $paramters['source']);
     }
     // @TODO
     return array('location' => LinkHandler::getInstance()->getLink('JCoinsShopDownload', array('id' => $paramters['itemID'])));
 }
コード例 #2
0
 /**
  * @see \wcf\system\jcoins\shop\item\type\IShopItem::buy()
  */
 public function buy(array $paramters)
 {
     parent::buy($paramters);
     $paramters = $this->prepare($paramters);
     $data = array('userID' => WCF::getSession()->userID, 'username' => WCF::getSession()->getUser()->username, 'time' => TIME_NOW, 'isDraft' => 0, 'participantCanInvite' => 0, 'subject' => $paramters['subject']);
     $messageData = array('message' => $paramters['text'], 'enableBBCodes' => 1, 'enableHtml' => 0, 'enableSmilies' => 1, 'showSignature' => 1);
     $conversationData = array('data' => $data, 'messageData' => $messageData, 'participants' => array($paramters['userid']));
     $action = new ConversationAction(array(), 'create', $conversationData);
     $conversation = $action->executeAction();
     if ($paramters['close'] == 1) {
         $action = new ConversationAction(array($conversation['returnValues']), 'close', array());
         $action->executeAction();
     }
 }