public function render() { $defaultAvatarUrl = BOL_AvatarService::getInstance()->getDefaultAvatarUrl(); $this->assign('defaultAvatarUrl', $defaultAvatarUrl); $js = "OW.Mailbox.conversationController = new MAILBOX_ConversationView();"; OW::getDocument()->addOnloadScript($js, 3006); //TODO check this config $enableAttachments = OW::getConfig()->getValue('mailbox', 'enable_attachments'); $this->assign('enableAttachments', $enableAttachments); $replyToMessageActionPromotedText = ''; $isAuthorizedReplyToMessage = OW::getUser()->isAuthorized('mailbox', 'reply_to_message'); $isAuthorizedReplyToMessage = $isAuthorizedReplyToMessage || OW::getUser()->isAuthorized('mailbox', 'send_chat_message'); if (!$isAuthorizedReplyToMessage) { $status = BOL_AuthorizationService::getInstance()->getActionStatus('mailbox', 'reply_to_message'); if ($status['status'] == BOL_AuthorizationService::STATUS_PROMOTED) { $replyToMessageActionPromotedText = $status['msg']; } } $this->assign('isAuthorizedReplyToMessage', $isAuthorizedReplyToMessage); $isAuthorizedReplyToChatMessage = OW::getUser()->isAuthorized('mailbox', 'reply_to_chat_message'); if (!$isAuthorizedReplyToChatMessage) { $status = BOL_AuthorizationService::getInstance()->getActionStatus('mailbox', 'reply_to_chat_message'); if ($status['status'] == BOL_AuthorizationService::STATUS_PROMOTED) { $replyToMessageActionPromotedText = $status['msg']; } } $this->assign('isAuthorizedReplyToChatMessage', $isAuthorizedReplyToChatMessage); $this->assign('replyToMessageActionPromotedText', $replyToMessageActionPromotedText); if ($isAuthorizedReplyToMessage) { $text = new WysiwygTextarea('mailbox_message'); $text->setId('conversationTextarea'); $this->assign('mailbox_message', $text->renderInput()); } return parent::render(); }
/** * Class constructor */ public function __construct($photoId) { parent::__construct('photo-edit-form'); $this->setAjax(true); $this->setAction(OW::getRouter()->urlFor('PHOTO_CTRL_Photo', 'ajaxUpdatePhoto')); $language = OW::getLanguage(); $photo = PHOTO_BOL_PhotoService::getInstance()->findPhotoById($photoId); $album = PHOTO_BOL_PhotoAlbumService::getInstance()->findAlbumById($photo->albumId); $userId = OW::getUser()->getId(); // photo id field $photoIdField = new HiddenField('id'); $photoIdField->setRequired(true); $this->addElement($photoIdField); // photo album Field $albumField = new SuggestField('album'); $responderUrl = OW::getRouter()->urlFor('PHOTO_CTRL_Upload', 'suggestAlbum', array('userId' => $userId)); $albumField->setResponderUrl($responderUrl); if ($album) { $albumField->setValue($album->name); } $albumField->setRequired(true); $albumField->setLabel($language->text('photo', 'album')); $this->addElement($albumField); // description Field $descField = new WysiwygTextarea('description', null, false); $descField->setId("photo-desc-area"); $this->addElement($descField->setLabel($language->text('photo', 'description'))); $tags = array(); $entityTags = BOL_TagService::getInstance()->findEntityTags($photo->id, 'photo'); if ($entityTags) { $tags = array(); foreach ($entityTags as $entityTag) { $tags[] = $entityTag->label; } $tagsField = new TagsInputField('tags'); $tagsField->setValue($tags); } else { $tagsField = new TagsInputField('tags'); } $this->addElement($tagsField->setLabel($language->text('photo', 'tags'))); $submit = new Submit('edit'); $submit->setValue($language->text('photo', 'btn_edit')); $this->addElement($submit); }
/** * Class constructor */ public function __construct($clipId) { parent::__construct('videoEditForm'); $this->setAjax(true); $this->setAction(OW::getRouter()->urlFor('GVIDEOVIEWER_CTRL_Index', 'ajaxUpdateVideo')); $language = OW::getLanguage(); // clip id field $clipIdField = new HiddenField('id'); $clipIdField->setRequired(true); $this->addElement($clipIdField); // title Field $titleField = new TextField('title'); $titleField->addValidator(new StringValidator(1, 128)); $titleField->setRequired(true); $this->addElement($titleField->setLabel($language->text('video', 'title'))); // description Field $descField = new WysiwygTextarea('description'); $descField->setId("video-desc-area"); $this->addElement($descField->setLabel($language->text('video', 'description'))); $code = new Textarea('code'); $code->setRequired(true); $this->addElement($code->setLabel($language->text('video', 'code'))); $entityTags = BOL_TagService::getInstance()->findEntityTags($clipId, 'video'); if ($entityTags) { $tags = array(); foreach ($entityTags as $entityTag) { $tags[] = $entityTag->label; } $tagsField = new TagsInputField('tags'); $tagsField->setValue($tags); } else { $tagsField = new TagsInputField('tags'); } $this->addElement($tagsField->setLabel($language->text('video', 'tags'))); $submit = new Submit('edit'); $submit->setValue($language->text('video', 'btn_edit')); $this->addElement($submit); }