当前位置: 首页>>代码示例>>PHP>>正文


PHP UTIL_HtmlTag::stripJs方法代码示例

本文整理汇总了PHP中UTIL_HtmlTag::stripJs方法的典型用法代码示例。如果您正苦于以下问题:PHP UTIL_HtmlTag::stripJs方法的具体用法?PHP UTIL_HtmlTag::stripJs怎么用?PHP UTIL_HtmlTag::stripJs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UTIL_HtmlTag的用法示例。


在下文中一共展示了UTIL_HtmlTag::stripJs方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: process

 /**
  * Adds video clip
  *
  * @return boolean
  */
 public function process()
 {
     $values = $this->getValues();
     $clipService = VIDEO_BOL_ClipService::getInstance();
     $clip = new VIDEO_BOL_Clip();
     $clip->title = htmlspecialchars($values['title']);
     $description = UTIL_HtmlTag::stripJs($values['description']);
     $description = UTIL_HtmlTag::stripTags($description, array('frame', 'style'), array(), true);
     $description = nl2br($description, true);
     $clip->description = $description;
     $clip->userId = OW::getUser()->getId();
     $clip->code = '<iframe src="' . (OW::getRouter()->getBaseUrl() . 'spvideo/proxy/Allmyvideos/pending/') . $values['token'] . '" width="540" height="315" frameborder="0"></iframe>';
     $privacy = OW::getEventManager()->call('plugin.privacy.get_privacy', array('ownerId' => $clip->userId, 'action' => 'video_view_video'));
     $clip->provider = 'allmyvideos';
     $clip->addDatetime = time();
     $clip->status = 'approved';
     $clip->privacy = mb_strlen($privacy) ? $privacy : 'everybody';
     $eventParams = array('pluginKey' => 'video', 'action' => 'add_video');
     if (OW::getEventManager()->call('usercredits.check_balance', $eventParams) === true) {
         OW::getEventManager()->call('usercredits.track_action', $eventParams);
     }
     if ($clipService->addClip($clip)) {
         SPVIDEOLITE_PRO_ALLMYVIDEOS_CLASS_Processing::processTemporaryUpload($values['token'], $values['filename']);
         BOL_TagService::getInstance()->updateEntityTags($clip->id, 'video', $values['tags']);
         return array('result' => true, 'id' => $clip->id);
     }
     return false;
 }
开发者ID:mohamedveto,项目名称:spvideolite,代码行数:33,代码来源:infoform.php

示例2: addVideo

 public function addVideo($userId, $embed, $title, $description, $thumbnailUrl, $text, $addToFeed = true)
 {
     if (!$this->isActive()) {
         return null;
     }
     $title = empty($title) ? $text : $title;
     $title = empty($title) ? '' : $title;
     $description = empty($description) ? '' : $description;
     $clipService = VIDEO_BOL_ClipService::getInstance();
     $clip = new VIDEO_BOL_Clip();
     $clip->title = $title;
     $description = UTIL_HtmlTag::stripJs($description);
     $description = UTIL_HtmlTag::stripTags($description, array('frame', 'style'), array(), true);
     $clip->description = $description;
     $clip->userId = $userId;
     $clip->code = UTIL_HtmlTag::stripJs($embed);
     $prov = new VideoProviders($clip->code);
     $privacy = OW::getEventManager()->call('plugin.privacy.get_privacy', array('ownerId' => $clip->userId, 'action' => 'video_view_video'));
     $clip->provider = $prov->detectProvider();
     $clip->addDatetime = time();
     $clip->status = 'approved';
     $clip->privacy = mb_strlen($privacy) ? $privacy : 'everybody';
     $thumbUrl = empty($thumbnailUrl) ? $prov->getProviderThumbUrl($clip->provider) : $thumbnailUrl;
     if ($thumbUrl != VideoProviders::PROVIDER_UNDEFINED) {
         $clip->thumbUrl = $thumbUrl;
     }
     $clip->thumbCheckStamp = time();
     $clipId = $clipService->addClip($clip);
     if ($addToFeed) {
         // Newsfeed
         $event = new OW_Event('feed.action', array('pluginKey' => 'video', 'entityType' => 'video_comments', 'entityId' => $clipId, 'userId' => $clip->userId), array("content" => array("vars" => array("status" => $text))));
         OW::getEventManager()->trigger($event);
     }
     return $clipId;
 }
开发者ID:vazahat,项目名称:dudex,代码行数:35,代码来源:video_bridge.php

示例3: logMsg

 public function logMsg()
 {
     $service = AJAXIM_BOL_Service::getInstance();
     if ($errorMessage = $service->checkPermissions()) {
         exit(json_encode(array('error' => $errorMessage)));
     }
     if (empty($_POST['to'])) {
         exit(json_encode(array('error' => "Receiver is not defined")));
     }
     if (empty($_POST['message'])) {
         exit(json_encode(array('error' => "Message is empty")));
     }
     $message = UTIL_HtmlTag::stripTags(UTIL_HtmlTag::stripJs($_POST['message']));
     $dto = new AJAXIM_BOL_Message();
     $dto->setFrom(OW::getUser()->getId());
     $dto->setTo($_POST['to']);
     $dto->setMessage($message);
     $dto->setTimestamp(time());
     $dto->setRead(0);
     AJAXIM_BOL_Service::getInstance()->save($dto);
     //$message = AJAXIM_BOL_Service::getInstance()->splitLongMessages($message);
     //$dto->setMessage(UTIL_HtmlTag::autoLink($message));
     $dto->setTimestamp($dto->getTimestamp() * 1000);
     exit(json_encode($dto));
 }
开发者ID:vazahat,项目名称:dudex,代码行数:25,代码来源:action.php

示例4: processSettingList

 public static function processSettingList($settings, $place, $isAdmin)
 {
     if ($place != BOL_ComponentService::PLACE_DASHBOARD && !OW::getUser()->isAdmin()) {
         $settings['content'] = UTIL_HtmlTag::stripJs($settings['content']);
         //$settings['content'] = UTIL_HtmlTag::stripTags($settings['content'], array('frame'), array(), true, true);
     } else {
         $settings['content'] = UTIL_HtmlTag::sanitize($settings['content']);
     }
     return parent::processSettingList($settings, $place, $isAdmin);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:10,代码来源:custom_html_widget.php

示例5: process

 public function process()
 {
     $language = OW::getLanguage();
     $conversationService = MAILBOX_BOL_ConversationService::getInstance();
     $values = $this->getValues();
     $userId = OW::getUser()->getId();
     $actionName = 'send_message';
     $isAuthorized = OW::getUser()->isAuthorized('mailbox', $actionName);
     if (!$isAuthorized) {
         $status = BOL_AuthorizationService::getInstance()->getActionStatus('mailbox', $actionName);
         if ($status['status'] != BOL_AuthorizationService::STATUS_AVAILABLE) {
             return array('result' => false, 'error' => $language->text('mailbox', 'send_message_permission_denied'));
         }
     }
     $checkResult = $conversationService->checkUser($userId, $values['opponentId']);
     if ($checkResult['isSuspended']) {
         return array('result' => false, 'error' => $checkResult['suspendReasonMessage']);
     }
     $values['message'] = UTIL_HtmlTag::stripTags(UTIL_HtmlTag::stripJs($values['message']));
     $event = new OW_Event('mailbox.before_create_conversation', array('senderId' => $userId, 'recipientId' => $values['opponentId'], 'message' => $values['message'], 'subject' => $values['subject']), array('result' => true, 'error' => '', 'message' => $values['message'], 'subject' => $values['subject']));
     OW::getEventManager()->trigger($event);
     $data = $event->getData();
     if (empty($data['result'])) {
         return array('result' => false, 'error' => $data['error']);
     }
     if (!trim(strip_tags($values['subject']))) {
         return array('result' => false, 'error' => $language->text('mailbox', 'subject_is_required'));
     }
     $values['subject'] = $data['subject'];
     $values['message'] = $data['message'];
     $conversation = $conversationService->createConversation($userId, $values['opponentId'], $values['subject'], $values['message']);
     $message = $conversationService->getLastMessage($conversation->id);
     if (!empty($_FILES['attachment']["tmp_name"])) {
         $attachmentService = BOL_AttachmentService::getInstance();
         $uid = $_POST['uid'];
         $maxUploadSize = OW::getConfig()->getValue('base', 'attch_file_max_size_mb');
         $validFileExtensions = json_decode(OW::getConfig()->getValue('base', 'attch_ext_list'), true);
         $dtoArr = $attachmentService->processUploadedFile('mailbox', $_FILES['attachment'], $uid, $validFileExtensions, $maxUploadSize);
         $files = $attachmentService->getFilesByBundleName('mailbox', $uid);
         if (!empty($files)) {
             $conversationService->addMessageAttachments($message->id, $files);
         }
     }
     BOL_AuthorizationService::getInstance()->trackAction('mailbox', $actionName);
     return array('result' => true, 'conversationId' => $message->conversationId);
 }
开发者ID:tammyrocks,项目名称:mailbox,代码行数:46,代码来源:compose_message_form.php

示例6: addClip

 public function addClip($clipInfo)
 {
     $clip = new VIDEO_BOL_Clip();
     $clip->title = htmlspecialchars($clipInfo["title"]);
     $description = UTIL_HtmlTag::stripJs($clipInfo["desc"]);
     $description = UTIL_HtmlTag::stripTags($description, array('frame', 'style'), array(), true);
     $description = nl2br($description, true);
     $clip->description = $description;
     $clip->userId = OW::getUser()->getId();
     $clip->thumbUrl = preg_replace("#(http://|https://)#i", "//", $clipInfo["thumbnail"]);
     $clip->code = UTIL_HtmlTag::stripJs($clipInfo["code"]);
     $prov = new VideoProviders($clip->code);
     $privacy = OW::getEventManager()->call('plugin.privacy.get_privacy', array('ownerId' => $clip->userId, 'action' => 'video_view_video'));
     $clip->provider = $prov->detectProvider();
     $clip->addDatetime = time();
     $clip->status = 'approved';
     $clip->privacy = mb_strlen($privacy) ? $privacy : 'everybody';
     $eventParams = array('pluginKey' => 'video', 'action' => 'add_video');
     if (OW::getEventManager()->call('usercredits.check_balance', $eventParams) === true) {
         OW::getEventManager()->call('usercredits.track_action', $eventParams);
     }
     if ($this->clipService->addClip($clip)) {
         if (isset($clipInfo['tags'])) {
             BOL_TagService::getInstance()->updateEntityTags($clip->id, 'video', explode(',', $clipInfo['tags']));
         }
         // Newsfeed
         $event = new OW_Event('feed.action', array('pluginKey' => 'video', 'entityType' => 'video_comments', 'entityId' => $clip->id, 'userId' => $clip->userId));
         OW::getEventManager()->trigger($event);
         return $clip->id;
     }
     return false;
 }
开发者ID:mohamedveto,项目名称:spvideolite,代码行数:32,代码来源:ajax_upload_form.php

示例7: postMessage

 public function postMessage($params)
 {
     $conversationService = MAILBOX_BOL_ConversationService::getInstance();
     $language = OW::getLanguage();
     if ($errorMessage = $conversationService->checkPermissions()) {
         return array('error' => $errorMessage);
     }
     $userId = OW::getUser()->getId();
     //        $userSendMessageIntervalOk = $conversationService->checkUserSendMessageInterval($userId);
     //        if (!$userSendMessageIntervalOk)
     //        {
     //            $send_message_interval = (int)OW::getConfig()->getValue('mailbox', 'send_message_interval');
     //            return array('error'=>$language->text('mailbox', 'feedback_send_message_interval_exceed', array('send_message_interval'=>$send_message_interval)));
     //        }
     $conversationId = $params['convId'];
     if (!isset($conversationId)) {
         return array('error' => "Conversation is not defined");
     }
     if (empty($params['text'])) {
         return array('error' => $language->text('mailbox', 'chat_message_empty'));
     }
     if (mb_strlen($params['text']) > self::MAX_MESSAGE_TEXT_LENGTH) {
         return array('error' => $language->text('mailbox', 'message_too_long_error', array('maxLength' => self::MAX_MESSAGE_TEXT_LENGTH)));
     }
     $conversation = $conversationService->getConversation($conversationId);
     if (empty($conversation)) {
         $uidParams = explode('_', $params['uid']);
         if (count($uidParams) == 5 && $uidParams[0] == 'mailbox' && $uidParams[1] == 'dialog') {
             $opponentId = (int) $uidParams[3];
             $conversationId = $conversationService->getChatConversationIdWithUserById($userId, $opponentId);
             if ($conversationId != 0) {
                 $conversation = $conversationService->getConversation($conversationId);
             }
         }
     }
     if (empty($conversation)) {
         $conversation = $conversationService->createChatConversation($userId, $opponentId);
         $conversationId = $conversation->getId();
     }
     $opponentId = $conversation->initiatorId == $userId ? $conversation->interlocutorId : $conversation->initiatorId;
     $checkResult = $conversationService->checkUser($userId, $opponentId);
     MAILBOX_BOL_ConversationService::getInstance()->resetUserLastData($opponentId);
     if ($checkResult['isSuspended']) {
         return array('error' => $checkResult['suspendReasonMessage']);
     }
     $mode = $conversationService->getConversationMode($conversationId);
     $actionName = '';
     switch ($mode) {
         case 'chat':
             $firstMessage = $conversationService->getFirstMessage($conversationId);
             if (empty($firstMessage)) {
                 $actionName = 'send_chat_message';
             } else {
                 $actionName = 'reply_to_chat_message';
             }
             $isAuthorized = OW::getUser()->isAuthorized('mailbox', $actionName);
             if (!$isAuthorized) {
                 $status = BOL_AuthorizationService::getInstance()->getActionStatus('mailbox', $actionName);
                 if ($status['status'] != BOL_AuthorizationService::STATUS_AVAILABLE) {
                     //                        return array('error'=>$language->text('mailbox', $actionName.'_permission_denied'));
                     return array('error' => $status['msg']);
                 }
             }
             $params['text'] = UTIL_HtmlTag::stripTags(UTIL_HtmlTag::stripJs($params['text']));
             $params['text'] = nl2br($params['text']);
             break;
         case 'mail':
             $actionName = 'reply_to_message';
             $isAuthorized = OW::getUser()->isAuthorized('mailbox', $actionName);
             if (!$isAuthorized) {
                 $status = BOL_AuthorizationService::getInstance()->getActionStatus('mailbox', $actionName);
                 if ($status['status'] != BOL_AuthorizationService::STATUS_AVAILABLE) {
                     //                        return array('error'=>$language->text('mailbox', $actionName.'_permission_denied'));
                     return array('error' => $status['msg']);
                 }
             }
             $params['text'] = UTIL_HtmlTag::stripJs($params['text']);
             break;
     }
     $event = new OW_Event('mailbox.before_send_message', array('senderId' => $userId, 'recipientId' => $opponentId, 'conversationId' => $conversation->id, 'message' => $params['text']), array('result' => true, 'error' => '', 'message' => $params['text']));
     OW::getEventManager()->trigger($event);
     $data = $event->getData();
     if (!$data['result']) {
         return $data;
     }
     $text = $data['message'];
     try {
         $message = $conversationService->createMessage($conversation, $userId, $text);
         $files = BOL_AttachmentService::getInstance()->getFilesByBundleName('mailbox', $params['uid']);
         if (!empty($files)) {
             $conversationService->addMessageAttachments($message->id, $files);
         }
         if (!empty($params['embedAttachments'])) {
             $oembedParams = json_decode($params['embedAttachments'], true);
             $oembedParams['message'] = $text;
             $messageParams = array('entityType' => 'mailbox', 'eventName' => 'renderOembed', 'params' => $oembedParams);
             $message->isSystem = true;
             $message->text = json_encode($messageParams);
             $conversationService->saveMessage($message);
         }
//.........这里部分代码省略.........
开发者ID:hardikamutech,项目名称:hammu,代码行数:101,代码来源:ajax_service.php

示例8: validateClipCode

 /**
  * Validate clip code integrity
  *
  * @param string $code
  * @param null $provider
  * @return string
  */
 public function validateClipCode($code, $provider = null)
 {
     $textService = BOL_TextFormatService::getInstance();
     $code = UTIL_HtmlTag::stripJs($code);
     $code = UTIL_HtmlTag::stripTags($code, $textService->getVideoParamList('tags'), $textService->getVideoParamList('attrs'));
     $objStart = '<object';
     $objEnd = '</object>';
     $objEndS = '/>';
     $posObjStart = stripos($code, $objStart);
     $posObjEnd = stripos($code, $objEnd);
     $posObjEnd = $posObjEnd ? $posObjEnd : stripos($code, $objEndS);
     if ($posObjStart !== false && $posObjEnd !== false) {
         $posObjEnd += strlen($objEnd);
         return substr($code, $posObjStart, $posObjEnd - $posObjStart);
     } else {
         $embStart = '<embed';
         $embEnd = '</embed>';
         $embEndS = '/>';
         $posEmbStart = stripos($code, $embStart);
         $posEmbEnd = stripos($code, $embEnd) ? stripos($code, $embEnd) : stripos($code, $embEndS);
         if ($posEmbStart !== false && $posEmbEnd !== false) {
             $posEmbEnd += strlen($embEnd);
             return substr($code, $posEmbStart, $posEmbEnd - $posEmbStart);
         } else {
             $frmStart = '<iframe ';
             $frmEnd = '</iframe>';
             $posFrmStart = stripos($code, $frmStart);
             $posFrmEnd = stripos($code, $frmEnd);
             if ($posFrmStart !== false && $posFrmEnd !== false) {
                 $posFrmEnd += strlen($frmEnd);
                 $code = substr($code, $posFrmStart, $posFrmEnd - $posFrmStart);
                 preg_match('/src=(["\'])(.*?)\\1/', $code, $match);
                 if (!empty($match[2])) {
                     $src = $match[2];
                     if (mb_substr($src, 0, 2) == '//') {
                         $src = 'http:' . $src;
                     }
                     $urlArr = parse_url($src);
                     $parts = explode('.', $urlArr['host']);
                     if (count($parts) < 2) {
                         return '';
                     }
                     $d1 = array_pop($parts);
                     $d2 = array_pop($parts);
                     $host = $d2 . '.' . $d1;
                     $resourceList = BOL_TextFormatService::getInstance()->getMediaResourceList();
                     if (!in_array($host, $resourceList) && !in_array($urlArr['host'], $resourceList)) {
                         return '';
                     }
                 }
                 return $code;
             } else {
                 return '';
             }
         }
     }
 }
开发者ID:jorgemunoz8807,项目名称:havanabook,代码行数:64,代码来源:clip_service.php

示例9: process

 /**
  * Updates vwls clip
  *
  * @return boolean
  */
 public function process()
 {
     $values = $this->getValues();
     $clipService = VWLS_BOL_ClipService::getInstance();
     $language = OW::getLanguage();
     if ($values['id']) {
         $clip = $clipService->findClipById($values['id']);
         if ($clip) {
             $clip->title = htmlspecialchars($values['room_name']);
             $clip->roomLimit = $values['room_limit'];
             $clip->user_list = $values['user_list'];
             $clip->moderator_list = $values['moderator_list'];
             $clip->welcome = htmlspecialchars($values['welcome']);
             $cam = $values['resolution'];
             $camArr = explode("x", $cam);
             $clip->camWidth = $camArr[0];
             $clip->camHeight = $camArr[1];
             $clip->camFPS = $values['camera_fps'];
             $clip->micRate = $values['microphone_rate'];
             $clip->soundQuality = $values['soundQuality'];
             $clip->camBandwidth = $values['bandwidth'];
             $clip->floodProtection = $values['flood_protection'];
             $clip->labelColor = $values['label_color'];
             $clip->layoutCode = $values['layout_code'];
             $clip->welcome2 = htmlspecialchars($values['welcome2']);
             $clip->offlineMessage = htmlspecialchars($values['offline_message']);
             $clip->floodProtection2 = $values['flood_protection2'];
             $clip->layoutCode2 = htmlspecialchars($values['layout_code2']);
             $clip->filterRegex = $values['filter_regex'];
             $clip->filterReplace = $values['filter_replace'];
             $permission = $values['show_camera_settings'] . "|";
             $permission .= $values['advanced_camera_settings'] . "|";
             $permission .= $values['configure_source'] . "|";
             $permission .= $values['only_video'] . "|";
             $permission .= $values['no_video'] . "|";
             $permission .= $values['no_embeds'] . "|";
             $permission .= $values['show_timer'] . "|";
             $permission .= $values['write_text'] . "|";
             $permission .= $values['private_textchat'] . "|";
             $permission .= $values['fill_window'] . "|";
             $permission .= $values['write_text2'] . "|";
             $permission .= $values['enable_video'] . "|";
             $permission .= $values['enable_chat'] . "|";
             $permission .= $values['enable_users'] . "|";
             $permission .= $values['fill_window2'] . "|";
             $permission .= $values['verbose_level'] . "|";
             $clip->permission = $permission;
             $clip->online = "no";
             $clip->onlineCount = 0;
             $clip->onlineUser = "0";
             $clip->onlineUsers = "0";
             $description = UTIL_HtmlTag::stripJs($values['description']);
             $description = UTIL_HtmlTag::stripTags($description, array('frame', 'style'), array(), true);
             $clip->description = $description;
             $clip->modifDatetime = time();
             if ($clipService->updateClip($clip)) {
                 BOL_TagService::getInstance()->updateEntityTags($clip->id, 'vwls', TagsField::getTags($values['tags']));
                 return array('result' => true, 'id' => $clip->id);
             }
         }
     } else {
         return array('result' => false, 'id' => $clip->id);
     }
     return false;
 }
开发者ID:vazahat,项目名称:dudex,代码行数:70,代码来源:vwls.php

示例10: process

 public function process($ctrl)
 {
     OW::getCacheManager()->clean(array(PostDao::CACHE_TAG_POST_COUNT));
     $service = PostService::getInstance();
     /* @var $postDao PostService */
     $data = $this->getValues();
     $data['title'] = UTIL_HtmlTag::stripJs($data['title']);
     $postIsNotPublished = $this->post->getStatus() == 2;
     $text = UTIL_HtmlTag::sanitize($data['post']);
     /* @var $post Post */
     $this->post->setTitle($data['title']);
     $this->post->setPost($text);
     $this->post->setIsDraft($_POST['command'] == 'draft');
     $isCreate = empty($this->post->id);
     if ($isCreate) {
         $this->post->setTimestamp(time());
         //Required to make #698 and #822 work together
         if ($_POST['command'] == 'draft') {
             $this->post->setIsDraft(2);
         }
         BOL_AuthorizationService::getInstance()->trackAction('blogs', 'add_blog');
     } else {
         //If post is not new and saved as draft, remove their item from newsfeed
         if ($_POST['command'] == 'draft') {
             OW::getEventManager()->trigger(new OW_Event('feed.delete_item', array('entityType' => 'blog-post', 'entityId' => $this->post->id)));
         } else {
             if ($postIsNotPublished) {
                 // Update timestamp if post was published for the first time
                 $this->post->setTimestamp(time());
             }
         }
     }
     $service->save($this->post);
     $tags = array();
     if (intval($this->post->getId()) > 0) {
         $tags = $data['tf'];
         foreach ($tags as $id => $tag) {
             $tags[$id] = UTIL_HtmlTag::stripTags($tag);
         }
     }
     $tagService = BOL_TagService::getInstance();
     $tagService->updateEntityTags($this->post->getId(), 'blog-post', $tags);
     if ($this->post->isDraft()) {
         $tagService->setEntityStatus('blog-post', $this->post->getId(), false);
         if ($isCreate) {
             OW::getFeedback()->info(OW::getLanguage()->text('blogs', 'create_draft_success_msg'));
         } else {
             OW::getFeedback()->info(OW::getLanguage()->text('blogs', 'edit_draft_success_msg'));
         }
     } else {
         $tagService->setEntityStatus('blog-post', $this->post->getId(), true);
         //Newsfeed
         $event = new OW_Event('feed.action', array('pluginKey' => 'blogs', 'entityType' => 'blog-post', 'entityId' => $this->post->getId(), 'userId' => $this->post->getAuthorId()));
         OW::getEventManager()->trigger($event);
         if ($isCreate) {
             OW::getFeedback()->info(OW::getLanguage()->text('blogs', 'create_success_msg'));
             OW::getEventManager()->trigger(new OW_Event(PostService::EVENT_AFTER_ADD, array('postId' => $this->post->getId())));
         } else {
             OW::getFeedback()->info(OW::getLanguage()->text('blogs', 'edit_success_msg'));
             OW::getEventManager()->trigger(new OW_Event(PostService::EVENT_AFTER_EDIT, array('postId' => $this->post->getId())));
         }
         $ctrl->redirect(OW::getRouter()->urlForRoute('post', array('id' => $this->post->getId())));
     }
 }
开发者ID:jorgemunoz8807,项目名称:havanabook,代码行数:64,代码来源:save.php

示例11: process

 /**
  * Updates video clip
  *
  * @return boolean
  */
 public function process()
 {
     $values = $this->getValues();
     $clipService = VIDEO_BOL_ClipService::getInstance();
     if ($values['id']) {
         $clip = $clipService->findClipById($values['id']);
         if ($clip) {
             $clip->title = htmlspecialchars($values['title']);
             $description = UTIL_HtmlTag::stripJs($values['description']);
             $description = UTIL_HtmlTag::stripTags($description, array('frame', 'style'), array(), true);
             $clip->description = $description;
             if ($clip->code != $values['code']) {
                 $prov = new VideoProviders($values['code']);
                 $clip->provider = $prov->detectProvider();
                 $thumbUrl = $prov->getProviderThumbUrl($clip->provider);
                 if ($thumbUrl != VideoProviders::PROVIDER_UNDEFINED) {
                     $clip->thumbUrl = $thumbUrl;
                 }
                 $clip->thumbCheckStamp = time();
             }
             $clip->code = UTIL_HtmlTag::stripJs($values['code']);
             if ($clipService->updateClip($clip)) {
                 BOL_TagService::getInstance()->updateEntityTags($clip->id, 'video', $values['tags']);
                 return array('result' => true, 'id' => $clip->id);
             }
         }
     } else {
         return array('result' => false, 'id' => null);
     }
     return false;
 }
开发者ID:vazahat,项目名称:dudex,代码行数:36,代码来源:video.php

示例12: process

 /**
  * Updates vwvc clip
  *
  * @return boolean
  */
 public function process()
 {
     $values = $this->getValues();
     $clipService = VWVC_BOL_ClipService::getInstance();
     $language = OW::getLanguage();
     if ($values['id']) {
         $clip = $clipService->findClipById($values['id']);
         if ($clip) {
             $clip->title = htmlspecialchars($values['room_name']);
             $clip->description = htmlspecialchars($values['description']);
             $clip->welcome = htmlspecialchars($values['welcome']);
             $cam = $values['resolution'];
             $camArr = explode("x", $cam);
             $clip->camWidth = $camArr[0];
             $clip->camHeight = $camArr[1];
             $clip->camFPS = $values['camera_fps'];
             $clip->micRate = $values['microphone_rate'];
             $clip->soundQuality = $values['soundQuality'];
             $clip->camBandwidth = $values['bandwidth'];
             $clip->background_url = $values['background_url'];
             $clip->layoutCode = htmlspecialchars($values['layout_code']);
             $permission = $values['fill_window'] . "|";
             $permission .= $values['show_camera_settings'] . "|";
             $permission .= $values['advanced_camera_settings'] . "|";
             $permission .= $values['configure_source'] . "|";
             $permission .= $values['disable_video'] . "|";
             $permission .= $values['disable_sound'] . "|";
             $permission .= $values['panel_rooms'] . "|";
             $permission .= $values['panel_users'] . "|";
             $permission .= $values['panel_files'] . "|";
             $permission .= $values['file_upload'] . "|";
             $permission .= $values['file_delete'] . "|";
             $permission .= $values['tutorial'] . "|";
             $permission .= $values['auto_view_cameras'] . "|";
             $permission .= $values['show_timer'] . "|";
             $permission .= $values['write_text'] . "|";
             $permission .= $values['regular_watch'] . "|";
             $permission .= $values['new_watch'] . "|";
             $permission .= $values['private_textchat'] . "|";
             $permission .= $values['administrator'] . "|";
             $permission .= $values['verbose_level'] . "|";
             $clip->permission = $permission;
             $clip->floodProtection = $values['flood_protection'];
             $clip->filterRegex = $values['filter_regex'];
             $clip->filterReplace = $values['filter_replace'];
             $clip->user_list = $values['user_list'];
             $clip->moderator_list = $values['moderator_list'];
             $clip->modifDatetime = time();
             $description = UTIL_HtmlTag::stripJs($values['description']);
             $description = UTIL_HtmlTag::stripTags($description, array('frame', 'style'), array(), true);
             $clip->description = $description;
             if ($clipService->updateClip($clip)) {
                 BOL_TagService::getInstance()->updateEntityTags($clip->id, 'vwvc', TagsField::getTags($values['tags']));
                 return array('result' => true, 'id' => $clip->id);
             }
         }
     } else {
         return array('result' => false, 'id' => $clip->id);
     }
     return false;
 }
开发者ID:vazahat,项目名称:dudex,代码行数:66,代码来源:vwvc.php

示例13: process

 public function process()
 {
     $values = $this->getValues();
     $videoService = IVIDEO_BOL_Service::getInstance();
     $language = OW::getLanguage();
     if ($values['id']) {
         $video = $videoService->findVideoById($values['id']);
         if ($video) {
             $video->name = htmlspecialchars($values['name']);
             $description = UTIL_HtmlTag::stripJs($values['description']);
             $description = UTIL_HtmlTag::stripTags($description, array('frame', 'style'), array(), true);
             $video->description = $description;
             if ($videoService->updateVideo($video)) {
                 BOL_TagService::getInstance()->updateEntityTags($video->id, 'ivideo-video', TagsField::getTags($values['tags']));
                 return array('result' => true, 'id' => $video->id);
             }
         }
     } else {
         return array('result' => false, 'id' => $video->id);
     }
     return false;
 }
开发者ID:vazahat,项目名称:dudex,代码行数:22,代码来源:action.php

示例14: process

 /**
  * Adds vwvc clip
  *
  * @return boolean
  */
 public function process()
 {
     $values = $this->getValues();
     $clipService = VWVC_BOL_ClipService::getInstance();
     $clip = new VWVC_BOL_Clip();
     $clip->title = htmlspecialchars($values['room_name']);
     $clip->description = htmlspecialchars($values['description']);
     $clip->welcome = htmlspecialchars($values['welcome']);
     $cam = $values['resolution'];
     $camArr = explode("x", $cam);
     $clip->camWidth = $camArr[0];
     $clip->camHeight = $camArr[1];
     $clip->camFPS = $values['camera_fps'];
     $clip->micRate = $values['microphone_rate'];
     $clip->soundQuality = $values['soundQuality'];
     $clip->camBandwidth = $values['bandwidth'];
     $clip->background_url = $values['background_url'];
     $clip->layoutCode = htmlspecialchars($values['layout_code']);
     $permission = $values['fill_window'] . "|";
     $permission .= $values['show_camera_settings'] . "|";
     $permission .= $values['advanced_camera_settings'] . "|";
     $permission .= $values['configure_source'] . "|";
     $permission .= $values['disable_video'] . "|";
     $permission .= $values['disable_sound'] . "|";
     $permission .= $values['panel_rooms'] . "|";
     $permission .= $values['panel_users'] . "|";
     $permission .= $values['panel_files'] . "|";
     $permission .= $values['file_upload'] . "|";
     $permission .= $values['file_delete'] . "|";
     $permission .= $values['tutorial'] . "|";
     $permission .= $values['auto_view_cameras'] . "|";
     $permission .= $values['show_timer'] . "|";
     $permission .= $values['write_text'] . "|";
     $permission .= $values['regular_watch'] . "|";
     $permission .= $values['new_watch'] . "|";
     $permission .= $values['private_textchat'] . "|";
     $permission .= $values['administrator'] . "|";
     $permission .= $values['verbose_level'] . "|";
     $clip->permission = $permission;
     $clip->floodProtection = $values['flood_protection'];
     $clip->filterRegex = $values['filter_regex'];
     $clip->filterReplace = $values['filter_replace'];
     $clip->user_list = $values['user_list'];
     $clip->moderator_list = $values['moderator_list'];
     $clip->online = "no";
     $clip->onlineCount = 0;
     $clip->onlineUser = "0";
     $clip->onlineUsers = "0";
     $description = UTIL_HtmlTag::stripJs($values['description']);
     $description = UTIL_HtmlTag::stripTags($description, array('frame', 'style'), array(), true);
     $clip->description = $description;
     $clip->userId = OW::getUser()->getId();
     //        $clip->code = UTIL_HtmlTag::stripJs($values['code']);
     //        $prov = new VideoProviders($clip->code);
     $privacy = OW::getEventManager()->call('plugin.privacy.get_privacy', array('ownerId' => $clip->userId, 'action' => 'videoconference_view_video'));
     //        $clip->provider = $prov->detectProvider();
     $clip->addDatetime = time();
     $clip->modifDatetime = time();
     $config = OW::getConfig();
     $status = $config->getValue('vwvc', 'status');
     $clip->status = $status;
     $clip->privacy = mb_strlen($privacy) ? $privacy : 'everybody';
     $eventParams = array('pluginKey' => 'vwvc', 'action' => 'add_vwvc');
     if (OW::getEventManager()->call('usercredits.check_balance', $eventParams) === true) {
         OW::getEventManager()->call('usercredits.track_action', $eventParams);
     }
     if ($clipService->addClip($clip)) {
         BOL_TagService::getInstance()->updateEntityTags($clip->id, 'vwvc', TagsField::getTags($values['tags']));
         // Newsfeed
         $event = new OW_Event('feed.action', array('pluginKey' => 'vwvc', 'entityType' => 'vwvc_comments', 'entityId' => $clip->id, 'userId' => $clip->userId));
         OW::getEventManager()->trigger($event);
         return array('result' => true, 'id' => $clip->id);
     }
     return false;
 }
开发者ID:vazahat,项目名称:dudex,代码行数:80,代码来源:add.php

示例15: sendMessage

 protected function sendMessage($userId, $opponentId, $subject, $message, $files = array())
 {
     $conversationService = MAILBOX_BOL_ConversationService::getInstance();
     $checkResult = $conversationService->checkUser($userId, $opponentId);
     if ($checkResult['isSuspended']) {
         return array('result' => false, 'error' => $checkResult['suspendReasonMessage']);
     }
     //        $message = UTIL_HtmlTag::stripTags(UTIL_HtmlTag::stripJs($message));
     $message = UTIL_HtmlTag::stripJs($message);
     //        $message = nl2br($message);
     $event = new OW_Event('mailbox.before_create_conversation', array('senderId' => $userId, 'recipientId' => $opponentId, 'message' => $message, 'subject' => $subject), array('result' => true, 'error' => '', 'message' => $message, 'subject' => $subject));
     OW::getEventManager()->trigger($event);
     $data = $event->getData();
     if (empty($data['result'])) {
         return array('result' => 'permission_denied', 'message' => $data['error']);
     }
     if (!trim(strip_tags($data['subject']))) {
         return array('result' => false, 'error' => OW::getLanguage()->text('mailbox', 'subject_is_required'));
     }
     $subject = $data['subject'];
     $message = $data['message'];
     $conversation = $conversationService->createConversation($userId, $opponentId, $subject, $message);
     $messageDto = $conversationService->getLastMessage($conversation->id);
     if (!empty($files)) {
         $conversationService->addMessageAttachments($messageDto->id, $files);
     }
     BOL_AuthorizationService::getInstance()->trackAction('mailbox', 'send_message');
     $conversationService->resetUserLastData($userId);
     $conversationService->resetUserLastData($opponentId);
     return array('result' => true, 'lastMessageTimestamp' => $messageDto->timeStamp);
 }
开发者ID:tammyrocks,项目名称:mailbox,代码行数:31,代码来源:new_message_form.php


注:本文中的UTIL_HtmlTag::stripJs方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。