/**
  * @see Page::readData()
  */
 public function readData()
 {
     parent::readData();
     // Lade Content
     $uwp = new UserWantedPosterData($this->userID);
     $this->uwpData = $uwp->readEntry();
     // Wandle BBCode um und newlines
     if (isset($this->uwpData['text'])) {
         $bbcode = new MessageParser();
         $this->uwpData['text'] = $bbcode->parse($this->uwpData['text'], $this->uwpData['enableSmilies'], $this->uwpData['enableHtml'], $this->uwpData['enableBBCodes']);
     }
 }
 /**
  * @see Page::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     $tplData = UserWantedPosterData::getTemplate($this->tplID);
     if (!empty($tplData['templateID']) && empty($_POST['fDo'])) {
         $this->subject = $tplData['templateName'];
         $this->text = $tplData['text'];
         $this->enableSmilies = $tplData['enableSmilies'];
         $this->enableHtml = $tplData['enableHtml'];
         $this->enableBBCodes = $tplData['enableBBCodes'];
         $this->enabled = $tplData['enabled'];
     }
     WCF::getTPL()->assign(array('thisPage' => $this->thisPage, 'tplID' => $this->tplID, 'subject' => $this->subject, 'text' => $this->text, 'enableSmilies' => $this->enableSmilies, 'enableHtml' => $this->enableHtml, 'enableBBCodes' => $this->enableBBCodes, 'enabled' => $this->enabled, 'tplCount' => UserWantedPosterData::countTemplates(), 'tplList' => UserWantedPosterData::getTemplateList(), 'tplData' => $tplData));
 }
 /**
  * @see Page::readData()
  */
 public function readData()
 {
     parent::readData();
     $uwp = new UserWantedPosterData();
     $this->uwpData = $uwp->readEntries($this->sortField, $this->sortOrder, $this->pageNo, $this->itemsPerPage);
 }
 /**
  * @see Page::show()
  */
 public function show()
 {
     // check permission
     if (!WCF::getUser()->getPermission('mod.wantedPoster.canModifyEntries') && ($this->userID != WCF::getUser()->userID || !WCF::getUser()->getPermission('user.wantedPoster.canViewWantedPoster') || !WCF::getUser()->getPermission('user.wantedPoster.canUseWantedPoster'))) {
         require_once WCF_DIR . 'lib/system/exception/PermissionDeniedException.class.php';
         throw new PermissionDeniedException();
     }
     // get max text length
     $this->maxTextLength = WCF::getUser()->getPermission('user.wantedPoster.maxLength');
     if (WCF::getUser()->getPermission('user.wantedPoster.canViewMembersListTab') && WCF::getUser()->getPermission('user.membersList.canView')) {
         HeaderMenu::setActiveMenuItem('wcf.header.menu.memberslist');
     } else {
         if (WCF::getUser()->getPermission('user.wantedPoster.canViewHeaderMenu')) {
             HeaderMenu::setActiveMenuItem('wcf.header.menu.userWantedPoster');
         }
     }
     // set active tab
     UserCPMenu::getInstance()->setActiveMenuItem('wcf.user.usercp.menu.link.profile.wantedPoster');
     // Lade Content
     $uwp = new UserWantedPosterData($this->userID);
     $this->uwpData = $uwp->readEntry();
     if (isset($this->uwpData['text'])) {
         $this->text = $this->uwpData['text'];
     }
     // check upload permission
     if (!WCF::getUser()->getPermission('user.wantedPoster.canUploadAttachment')) {
         $this->showAttachments = false;
     }
     // get attachments editor
     require_once WCF_DIR . 'lib/data/message/attachment/AttachmentsEditor.class.php';
     $this->attachmentsEditor = new AttachmentsEditor($this->userID, 'wantedPoster', WCF::getUser()->getPermission('user.wantedPoster.maxAttachmentSize'), WCF::getUser()->getPermission('user.wantedPoster.allowedAttachmentExtensions'), WCF::getUser()->getPermission('user.wantedPoster.maxAttachmentCount'));
     // show form
     parent::show();
 }