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


PHP UTIL_HtmlTag::stripTags方法代码示例

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


在下文中一共展示了UTIL_HtmlTag::stripTags方法的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)
 {
     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 $settings;
 }
开发者ID:vazahat,项目名称:dudex,代码行数:10,代码来源:index_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: transferCredits

 public function transferCredits($userId, $receiveUser, $creditValue)
 {
     $debitValue = $creditValue * -1;
     $userCreditsService = USERCREDITS_BOL_CreditsService::getInstance();
     $creditsService = CREDITS_BOL_Service::getInstance();
     $sendItem = $this->logAction($creditsService->getSentActionId(), $userId, $debitValue);
     $receiveItem = $this->logAction($creditsService->getReceiveActionId(), $receiveUser, $creditValue);
     $userCreditsService->increaseBalance($receiveUser, $creditValue);
     $userCreditsService->decreaseBalance($userId, $creditValue);
     $sqlInsert = "INSERT INTO " . OW_DB_PREFIX . "credits_sent_log(senderItem, receiverItem, sender, receiver) \n                             VALUES(:sendItem, :receiveItem, :userId, :receiveUser)";
     $qParams = array('sendItem' => $sendItem, 'receiveItem' => $receiveItem, 'userId' => $userId, 'receiveUser' => $receiveUser);
     OW::getDbo()->query($sqlInsert, $qParams);
     $service = BOL_UserService::getInstance();
     $avatars = BOL_AvatarService::getInstance()->getDataForUserAvatars(array($userId, $receiveUser));
     $names = $service->getDisplayNamesForList(array($userId, $receiveUser));
     $uUrls = $service->getUserUrlsForList(array($userId, $receiveUser));
     if (OW::getConfig()->getValue('credits', 'enableNotification') == '1') {
         //Send notification to receiver
         $avatar = $avatars[$userId];
         $notificationParams = array('pluginKey' => 'credits', 'action' => 'credits-received', 'entityType' => 'received', 'entityId' => $receiveItem, 'userId' => $receiveUser, 'time' => time());
         $sender = '<a href="' . $uUrls[$userId] . '" target="_blank" >' . $names[$userId] . '</a>';
         $notificationData = array('string' => array('key' => 'credits+notify_credits_received', 'vars' => array('sender' => $sender, 'credits' => $creditValue)), 'avatar' => $avatar, 'url' => $uUrls[$userId]);
         $event = new OW_Event('notifications.add', $notificationParams, $notificationData);
         OW::getEventManager()->trigger($event);
     }
     $subject = OW::getLanguage()->text('credits', 'credits_email_subject', array('requester_name' => $names[$userId], 'credits' => $creditValue));
     $content = OW::getLanguage()->text('credits', 'credits_email_content', array('requester_name' => $names[$userId], 'requester_url' => $uUrls[$userId], 'credits' => $creditValue, 'user_url' => $uUrls[$receiveUser], 'name' => $names[$receiveUser]));
     if (OW::getConfig()->getValue('credits', 'enableEmail') == '1') {
         $tmpUser = $service->findUserById($receiveUser);
         $sitemail = OW::getConfig()->getValue('base', 'site_email');
         $sitename = OW::getConfig()->getValue('base', 'site_name');
         $mail = OW::getMailer()->createMail();
         $mail->addRecipientEmail($tmpUser->getEmail());
         $mail->setSender($sitemail, $sitename);
         $mail->setSenderSuffix(true);
         $mail->setSubject($subject);
         $mail->setHtmlContent($content);
         $mail->setTextContent(UTIL_HtmlTag::stripTags($content));
         OW::getMailer()->addToQueue($mail);
     }
     if (OW::getConfig()->getValue('credits', 'enablePM') == '1') {
         $conversation = MAILBOX_BOL_ConversationService::getInstance()->createConversation($userId, $receiveUser, $subject, $content);
     }
     return true;
 }
开发者ID:vazahat,项目名称:dudex,代码行数:45,代码来源:service.php

示例7: validateVideoCode

 /**
  * Validates provided video code, stripping all restricted tags.
  *
  * @param string $code
  * @return string
  */
 public function validateVideoCode($code)
 {
     return UTIL_HtmlTag::stripTags($code, $this->videoParams['tags'], $this->videoParams['attrs']);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:10,代码来源:text_format_service.php

示例8: 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

示例9: 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

示例10: edit


//.........这里部分代码省略.........
     $checkboxId = UTIL_HtmlTag::generateAutoId('chk');
     $tdId = UTIL_HtmlTag::generateAutoId('td');
     $this->assign('tdId', $tdId);
     $this->assign('chId', $checkboxId);
     OW::getDocument()->addScript(OW::getPluginManager()->getPlugin("eventx")->getStaticJsUrl() . 'eventx.js');
     $enableMapSuggestion = OW::getConfig()->getValue('eventx', 'enableMapSuggestion');
     if ($enableMapSuggestion == '1') {
         OW::getDocument()->addScript("http://maps.googleapis.com/maps/api/js?sensor=false&amp;libraries=places");
         OW::getDocument()->addScript(OW::getPluginManager()->getPlugin("eventx")->getStaticJsUrl() . 'jquery.geocomplete.min.js');
     }
     $this->assign('enableMapSuggestion', $enableMapSuggestion);
     OW::getDocument()->addOnloadScript("new eventAddForm(" . json_encode(array('checkbox_id' => $checkboxId, 'end_date_id' => $form->getElement('end_date')->getId(), 'tdId' => $tdId)) . ")");
     if ($event->getImage()) {
         $this->assign('imgsrc', $this->eventService->generateImageUrl($event->getImage(), true));
     }
     $endDateFlag = $event->getEndDateFlag();
     if (OW::getRequest()->isPost()) {
         $endDateFlag = !empty($_POST['endDateFlag']);
         if ($form->isValid($_POST)) {
             $data = $form->getValues();
             $serviceEvent = new OW_Event(EVENTX_BOL_EventService::EVENTX_BEFORE_EVENTX_EDIT, array('eventId' => $event->id), $data);
             OW::getEventManager()->trigger($serviceEvent);
             $data = $serviceEvent->getData();
             $dateArray = explode('/', $data['start_date']);
             $startStamp = mktime(0, 0, 0, $dateArray[1], $dateArray[2], $dateArray[0]);
             if ($data['start_time'] != 'all_day') {
                 $startStamp = mktime($data['start_time']['hour'], $data['start_time']['minute'], 0, $dateArray[1], $dateArray[2], $dateArray[0]);
             }
             if (!empty($_POST['endDateFlag']) && !empty($data['end_date'])) {
                 $dateArray = explode('/', $data['end_date']);
                 $endStamp = mktime(0, 0, 0, $dateArray[1], $dateArray[2], $dateArray[0]);
                 $endStamp = strtotime("+1 day", $endStamp);
                 if ($data['end_time'] != 'all_day') {
                     $hour = 0;
                     $min = 0;
                     if ($data['end_time'] != 'all_day') {
                         $hour = $data['end_time']['hour'];
                         $min = $data['end_time']['minute'];
                     }
                     $dateArray = explode('/', $data['end_date']);
                     $endStamp = mktime($hour, $min, 0, $dateArray[1], $dateArray[2], $dateArray[0]);
                 }
             }
             $event->setStartTimeStamp($startStamp);
             if (empty($endStamp)) {
                 $endStamp = strtotime("+1 day", $startStamp);
                 $endStamp = mktime(0, 0, 0, date('n', $endStamp), date('j', $endStamp), date('Y', $endStamp));
             }
             if ($startStamp > $endStamp) {
                 OW::getFeedback()->error($language->text('eventx', 'add_form_invalid_end_date_error_message'));
                 $this->redirect();
             } else {
                 $event->setEndTimeStamp($endStamp);
                 if (!empty($_FILES['image']['name'])) {
                     if ((int) $_FILES['image']['error'] !== 0 || !is_uploaded_file($_FILES['image']['tmp_name']) || !UTIL_File::validateImage($_FILES['image']['name'])) {
                         OW::getFeedback()->error($language->text('base', 'not_valid_image'));
                         $this->redirect();
                     } else {
                         $event->setImage(uniqid());
                         $this->eventService->saveEventImage($_FILES['image']['tmp_name'], $event->getImage());
                     }
                 }
                 $event->setTitle(htmlspecialchars($data['title']));
                 $event->setLocation(UTIL_HtmlTag::autoLink(strip_tags($data['location'])));
                 $event->setWhoCanView((int) $data['who_can_view']);
                 $event->setWhoCanInvite((int) $data['who_can_invite']);
                 $event->setDescription($data['desc']);
                 $event->setEndDateFlag(!empty($_POST['endDateFlag']));
                 $event->setStartTimeDisable($data['start_time'] == 'all_day');
                 $event->setEndTimeDisable($data['end_time'] == 'all_day');
                 $event->setMaxInvites($data['max_invites']);
                 $this->eventService->saveEvent($event);
                 $eventCategory = isset($data['event_category']) ? $data['event_category'] : 1;
                 $this->eventService->setItemCategories($event->getId(), $eventCategory);
                 if (isset($data['tags'])) {
                     $tags = array();
                     $tags = $data['tags'];
                     foreach ($tags as $id => $tag) {
                         $tags[$id] = UTIL_HtmlTag::stripTags($tag);
                     }
                     BOL_TagService::getInstance()->updateEntityTags($event->id, 'eventx', $tags);
                 }
                 $e = new OW_Event(EVENTX_BOL_EventService::EVENTX_AFTER_EVENTX_EDIT, array('eventId' => $event->id));
                 OW::getEventManager()->trigger($e);
                 OW::getFeedback()->info($language->text('eventx', 'edit_form_success_message'));
                 $this->redirect(OW::getRouter()->urlForRoute('eventx.view', array('eventId' => $event->getId())));
             }
         }
     }
     if (!$endDateFlag) {
         $form->getElement('end_date')->addAttribute('disabled', 'disabled');
         $form->getElement('end_date')->addAttribute('style', 'display:none;');
         $form->getElement('end_time')->addAttribute('disabled', 'disabled');
         $form->getElement('end_time')->addAttribute('style', 'display:none;');
     }
     $this->assign('endDateFlag', $endDateFlag);
     $this->setPageHeading($language->text('eventx', 'edit_page_heading'));
     $this->setPageTitle($language->text('eventx', 'edit_page_title'));
     $this->addForm($form);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:101,代码来源:base.php

示例11: 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);
     $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' => 'video_view_video'));
     $clip->provider = $prov->detectProvider();
     $clip->addDatetime = time();
     $clip->status = 'approved';
     $clip->privacy = mb_strlen($privacy) ? $privacy : 'everybody';
     $thumbUrl = $prov->getProviderThumbUrl($clip->provider);
     if ($thumbUrl != VideoProviders::PROVIDER_UNDEFINED) {
         $clip->thumbUrl = $thumbUrl;
     }
     $clip->thumbCheckStamp = time();
     $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)) {
         BOL_TagService::getInstance()->updateEntityTags($clip->id, 'video', $values['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 array('result' => true, 'id' => $clip->id);
     }
     return false;
 }
开发者ID:vazahat,项目名称:dudex,代码行数:40,代码来源:add.php

示例12: 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

示例13: 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

示例14: 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

示例15: 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


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