• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP UTIL_String类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: generateCache

 public function generateCache($languageId)
 {
     $event = new BASE_CLASS_EventCollector('base.add_global_lang_keys');
     OW::getEventManager()->trigger($event);
     $globalVars = call_user_func_array('array_merge', $event->getData());
     $values = $this->keyDao->findAllWithValues($languageId);
     $result = array();
     // fix begin
     // remove cache files from \ow_pluginfiles\base\lang_{1,2}.php and open site in debug mode
     $valuesReserv = $this->keyDao->findAllWithValues($languageId == 1 ? 2 : 1);
     foreach ($valuesReserv as $v) {
         $key = $v['prefix'] . '+' . $v['key'];
         $v['value'] = UTIL_String::replaceVars($v['value'], $globalVars);
         $result[$key] = $v['value'];
     }
     // fix end
     foreach ($values as $v) {
         $key = $v['prefix'] . '+' . $v['key'];
         $v['value'] = UTIL_String::replaceVars($v['value'], $globalVars);
         $result[$key] = $v['value'];
     }
     $cacheContent = "<?php\n\$language[{$languageId}] = " . var_export($result, true) . ";\n?>";
     $filename = $this->languageCacheDir . 'lang_' . $languageId . '.php';
     file_put_contents($filename, $cacheContent);
     @chmod($filename, 0666);
     $this->loadFromCahce();
 }
开发者ID:vazahat,项目名称:dudex,代码行数:27,代码来源:language_service.php


示例2: getAboutMeContent

 protected function getAboutMeContent()
 {
     $settings = BOL_ComponentEntityService::getInstance()->findSettingList('profile-BASE_CMP_AboutMeWidget', $this->user->id, array('content'));
     if (empty($settings['content'])) {
         return null;
     }
     return $this->length === null ? $settings['content'] : UTIL_String::truncate($settings['content'], $this->length, "...");
 }
开发者ID:vazahat,项目名称:dudex,代码行数:8,代码来源:profile_about.php


示例3: generateToken

 /**
  * Generates and returns CSRF token
  * 
  * @return string
  */
 public static function generateToken()
 {
     $tokenList = self::getTokenList();
     $token = base64_encode(time() . UTIL_String::getRandomString(32));
     $tokenList[$token] = time();
     self::saveTokenList($tokenList);
     return $token;
 }
开发者ID:ZyXelP,项目名称:oxwall,代码行数:13,代码来源:csrf.php


示例4: __construct

 public function __construct(BASE_CLASS_WidgetParameter $params)
 {
     parent::__construct();
     $service = LinkService::getInstance();
     $userId = $params->additionalParamList['entityId'];
     if ($userId != OW::getUser()->getId() && !OW::getUser()->isAuthorized('links', 'view')) {
         $this->setVisible(false);
         return;
     }
     /* Check privacy permissions */
     $eventParams = array('action' => LinkService::PRIVACY_ACTION_VIEW_LINKS, 'ownerId' => $userId, 'viewerId' => OW::getUser()->getId());
     try {
         OW::getEventManager()->getInstance()->call('privacy_check_permission', $eventParams);
     } catch (RedirectException $ex) {
         $this->setVisible(false);
         return;
     }
     /* */
     if ($service->countUserLinks($userId) == 0 && !$params->customizeMode) {
         $this->setVisible(false);
         return;
     }
     $this->assign('displayname', BOL_UserService::getInstance()->getDisplayName($userId));
     $this->assign('username', BOL_UserService::getInstance()->getUsername($userId));
     $list = array();
     $count = $params->customParamList['count'];
     $userLinkList = $service->findUserLinkList($userId, 0, $count);
     $idList = array();
     foreach ($userLinkList as $item) {
         /* Check privacy permissions */
         if ($item->userId != OW::getUser()->getId() && !OW::getUser()->isAuthorized('links')) {
             $eventParams = array('action' => LinkService::PRIVACY_ACTION_VIEW_LINKS, 'ownerId' => $item->userId, 'viewerId' => OW::getUser()->getId());
             try {
                 OW::getEventManager()->getInstance()->call('privacy_check_permission', $eventParams);
             } catch (RedirectException $ex) {
                 continue;
             }
         }
         /* */
         $list[] = $item;
         $idList[] = $item->id;
     }
     $commentInfo = array();
     if (!empty($idList)) {
         $commentInfo = BOL_CommentService::getInstance()->findCommentCountForEntityList('link', $idList);
         $tb = array();
         foreach ($list as $key => $item) {
             if (mb_strlen($item->getDescription()) > 100) {
                 $item->setDescription(UTIL_String::truncate($item->getDescription(), 100, '...'));
             }
             $list[$key]->setDescription(strip_tags($item->getDescription()));
             $tb[$item->getId()] = array(array('label' => '<span class="ow_txt_value">' . $commentInfo[$item->getId()] . '</span> ' . OW::getLanguage()->text('links', 'comments'), 'href' => OW::getRouter()->urlForRoute('link', array('id' => $item->getId()))), array('label' => UTIL_DateTime::formatDate($item->getTimestamp()), 'class' => 'ow_ic_date'));
         }
         $this->assign('tb', $tb);
     }
     $this->assign('list', $list);
     $this->setSettingValue(self::SETTING_TOOLBAR, array(array('label' => OW::getLanguage()->text('base', 'view_all'), 'href' => OW::getRouter()->urlForRoute('links-user', array('user' => BOL_UserService::getInstance()->getUserName($userId))))));
 }
开发者ID:vazahat,项目名称:dudex,代码行数:58,代码来源:user_links_widget.php


示例5: smarty_modifier_more

/**
 * Smarty truncate modifier.
 *
 * @author Sergey Kambalin <[email protected]>
 * @package ow.ow_smarty.plugin
 * @since 1.0
 */
function smarty_modifier_more($string, $length)
{
    $truncated = UTIL_String::truncate($string, $length);
    if (strlen($string) - strlen($truncated) < 50) {
        return $string;
    }
    $uniqId = uniqid("more-");
    $seeMoreEmbed = '<a href="javascript://" class="ow_small" onclick="$(\'#' . $uniqId . '\').attr(\'data-collapsed\', 0);" style="padding-left:4px;">' . OW::getLanguage()->text("base", "comments_see_more_label") . '</a>';
    return '<span class="ow_more_text" data-collapsed="1" id="' . $uniqId . '">' . '<span data-text="full">' . $string . '</span>' . '<span data-text="truncated">' . $truncated . '...' . $seeMoreEmbed . '</span>' . '</span>';
}
开发者ID:hardikamutech,项目名称:loov,代码行数:17,代码来源:modifier.more.php


示例6: onBeforeRender

 public function onBeforeRender()
 {
     parent::onBeforeRender();
     if (!empty($this->oembed['title'])) {
         $this->oembed['title'] = UTIL_String::truncate($this->oembed['title'], 23, '...');
     }
     if (!empty($this->oembed['description'])) {
         $this->oembed['description'] = UTIL_String::truncate($this->oembed['description'], 40, '...');
     }
     $this->assign('message', $this->message);
     $this->assign('data', $this->oembed);
 }
开发者ID:tammyrocks,项目名称:mailbox,代码行数:12,代码来源:oembed_attachment.php


示例7: redirect

 /**
  * Makes permanent redirect to provided URL or URI.
  *
  * @param string $redirectTo
  */
 public function redirect($redirectTo = null)
 {
     // if empty redirect location -> current URI is used
     if ($redirectTo === null) {
         $redirectTo = OW::getRequest()->getRequestUri();
     }
     // if URI is provided need to add site home URL
     if (!strstr($redirectTo, 'http://') && !strstr($redirectTo, 'https://')) {
         $redirectTo = OW::getRouter()->getBaseUrl() . UTIL_String::removeFirstAndLastSlashes($redirectTo);
     }
     UTIL_Url::redirect($redirectTo);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:17,代码来源:action_controller.php


示例8: getRealRequestUri

 /**
  * Removes site installation subfolder from request URI
  * 
  * @param string $urlHome
  * @param string $requestUri
  * @return string
  */
 public static function getRealRequestUri($urlHome, $requestUri)
 {
     $urlArray = parse_url($urlHome);
     $originalUri = UTIL_String::removeFirstAndLastSlashes($requestUri);
     $originalPath = UTIL_String::removeFirstAndLastSlashes($urlArray['path']);
     if ($originalPath === '') {
         return $originalUri;
     }
     $uri = mb_substr($originalUri, mb_strpos($originalUri, $originalPath) + mb_strlen($originalPath));
     $uri = trim(UTIL_String::removeFirstAndLastSlashes($uri));
     return $uri ? self::secureUri($uri) : '';
 }
开发者ID:hardikamutech,项目名称:loov,代码行数:19,代码来源:url.php


示例9: __construct

 public function __construct(BASE_CLASS_WidgetParameter $params)
 {
     parent::__construct();
     $service = PostService::getInstance();
     $count = $params->customParamList['count'];
     $previewLength = $params->customParamList['previewLength'];
     $list = $service->findList(0, $count);
     if ((empty($list) || false && !OW::getUser()->isAuthorized('blogs', 'add') && !OW::getUser()->isAuthorized('blogs', 'view')) && !$params->customizeMode) {
         $this->setVisible(false);
         return;
     }
     $posts = array();
     $userService = BOL_UserService::getInstance();
     $postIdList = array();
     foreach ($list as $dto) {
         /* @var $dto Post */
         if (mb_strlen($dto->getTitle()) > 50) {
             $dto->setTitle(UTIL_String::splitWord(UTIL_String::truncate($dto->getTitle(), 50, '...')));
         }
         $text = $service->processPostText($dto->getPost());
         $posts[] = array('dto' => $dto, 'text' => UTIL_String::splitWord(UTIL_String::truncate($text, $previewLength)), 'truncated' => mb_strlen($text) > $previewLength, 'url' => OW::getRouter()->urlForRoute('user-post', array('id' => $dto->getId())));
         $idList[] = $dto->getAuthorId();
         $postIdList[] = $dto->id;
     }
     $commentInfo = array();
     if (!empty($idList)) {
         $avatars = BOL_AvatarService::getInstance()->getDataForUserAvatars($idList, true, false);
         $this->assign('avatars', $avatars);
         $urls = BOL_UserService::getInstance()->getUserUrlsForList($idList);
         $commentInfo = BOL_CommentService::getInstance()->findCommentCountForEntityList('blog-post', $postIdList);
         $toolbars = array();
         foreach ($list as $dto) {
             $toolbars[$dto->getId()] = array(array('class' => 'ow_icon_control ow_ic_user', 'href' => isset($urls[$dto->getAuthorId()]) ? $urls[$dto->getAuthorId()] : '#', 'label' => isset($avatars[$dto->getAuthorId()]['title']) ? $avatars[$dto->getAuthorId()]['title'] : ''), array('class' => 'ow_remark ow_ipc_date', 'label' => UTIL_DateTime::formatDate($dto->getTimestamp())));
         }
         $this->assign('tbars', $toolbars);
     }
     $this->assign('commentInfo', $commentInfo);
     $this->assign('list', $posts);
     if ($service->countPosts() > 0) {
         $toolbar = array();
         if (OW::getUser()->isAuthorized('blogs', 'add')) {
             $toolbar[] = array('label' => OW::getLanguage()->text('blogs', 'add_new'), 'href' => OW::getRouter()->urlForRoute('post-save-new'));
         }
         if (OW::getUser()->isAuthorized('blogs', 'view')) {
             $toolbar[] = array('label' => OW::getLanguage()->text('blogs', 'go_to_blog'), 'href' => Ow::getRouter()->urlForRoute('blogs'));
         }
         if (!empty($toolbar)) {
             $this->setSettingValue(self::SETTING_TOOLBAR, $toolbar);
         }
     }
 }
开发者ID:vazahat,项目名称:dudex,代码行数:51,代码来源:blog_widget.php


示例10: question

 public function question($params)
 {
     $questionId = (int) $params['qid'];
     $question = $this->service->findQuestion($questionId);
     if (empty($question)) {
         throw new Redirect404Exception();
     }
     $language = OW::getLanguage();
     OW::getDocument()->setTitle($language->text('equestions', 'question_page_title'));
     OW::getDocument()->setDescription($language->text('equestions', 'question_page_description', array('question' => UTIL_String::truncate(strip_tags($question->text), 200))));
     OW::getNavigation()->activateMenuItem(OW_Navigation::MAIN, 'equestions', 'main_menu_list');
     $cmp = new EQUESTIONS_CMP_Question($questionId, null, null, array('focusToPost' => isset($_GET['f'])));
     $this->addComponent('question', $cmp);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:14,代码来源:questions.php


示例11: feedOnProjectAdd

 public function feedOnProjectAdd(OW_Event $e)
 {
     $params = $e->getParams();
     if ($params['entityType'] != 'ocsfundraising_project') {
         return;
     }
     $service = OCSFUNDRAISING_BOL_Service::getInstance();
     $project = $service->getGoalById($params['entityId']);
     if (!$project) {
         return;
     }
     $content = array("format" => "image_content", "vars" => array("image" => $project['dto']->image ? $service->generateImageUrl($project['dto']->image, false) : null, "thumbnail" => $project['dto']->image ? $service->generateImageUrl($project['dto']->image) : null, "title" => UTIL_String::truncate(strip_tags($project['dto']->name), 100, '...'), "description" => UTIL_String::truncate(strip_tags($project['dto']->description), 150, '...'), "url" => array("routeName" => "ocsfundraising.project", "vars" => array('id' => $project['dto']->id)), "iconClass" => "ow_ic_folder"));
     $data = array('time' => (int) $project['dto']->startStamp, 'ownerId' => $project['dto']->ownerId, 'string' => array('key' => 'ocsfundraising+feed_add_project_label'), 'content' => $content, 'view' => array('iconClass' => 'ow_ic_folder'));
     $e->setData($data);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:15,代码来源:event_handler.php


示例12: __construct

 /**
  * @param OW_Route $route
  * @param callback $serviceCallback
  * @param string $dtoProperty
  */
 public function __construct(OW_Route $route, $serviceCallback, $dtoProperty, $pathProperty, $entityType)
 {
     $this->route = $route;
     $objArr = (array) $route;
     $name = $objArr["OW_RouterouteName"];
     $path = UTIL_String::removeFirstAndLastSlashes($objArr["OW_RouteroutePath"]);
     $da = $objArr["OW_RoutedispatchAttrs"];
     $paramsOptions = $objArr["OW_RouterouteParamOptions"];
     parent::__construct($name, $path, $da['controller'], $da['action'], $paramsOptions);
     $this->serviceCallback = $serviceCallback;
     $this->seoService = OASEO_BOL_Service::getInstance();
     $this->entityType = $entityType;
     $this->dtoProperty = $dtoProperty;
     $this->pathProperty = $pathProperty;
     $this->pathArray = explode('/', $path);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:21,代码来源:slug_route.php


示例13: onBeforeRender

 public function onBeforeRender()
 {
     parent::onBeforeRender();
     $tplList = array();
     foreach ($this->response['feed']['entry'] as $item) {
         $vid = $item['media$group']['yt$videoid']['$t'];
         $uploaded = strtotime($item['media$group']['yt$uploaded']['$t']);
         $duration = $item['media$group']['yt$duration']['seconds'];
         $description = UTIL_String::truncate(strip_tags($item['media$group']['media$description']['$t']), 130, ' ...');
         $title = UTIL_String::truncate(strip_tags($item['media$group']['media$title']['$t']), 65, ' ...');
         $thumb = $item['media$group']['media$thumbnail'][0]['url'];
         $image = $item['media$group']['media$thumbnail'][1]['url'];
         $oembed = array('thumbnail_url' => $image, 'type' => 'video', 'title' => $title, 'description' => $description, 'html' => '<iframe class="attp-yt-iframe" width="300" height="230" src="http://www.youtube.com/embed/' . $vid . '?autoplay=1" frameborder="0" allowfullscreen></iframe>');
         $tplList[] = array('title' => $title, 'description' => $description, 'thumb' => $thumb, 'video' => $vid, 'duration' => round($duration / 60), 'uploaded' => $uploaded, 'date' => UTIL_DateTime::formatDate($uploaded), 'oembed' => json_encode($oembed));
     }
     $this->assign('list', $tplList);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:17,代码来源:youtube_list.php


示例14: text

 public function text($prefix, $key, array $vars = null)
 {
     if (empty($prefix) || empty($key)) {
         return $prefix . '+' . $key;
     }
     $text = null;
     try {
         $text = BOL_LanguageService::getInstance()->getText(BOL_LanguageService::getInstance()->getCurrent()->getId(), $prefix, $key);
     } catch (Exception $e) {
         return $prefix . '+' . $key;
     }
     if ($text === null) {
         return $prefix . '+' . $key;
     }
     $text = UTIL_String::replaceVars($text, $vars);
     return $text;
 }
开发者ID:vazahat,项目名称:dudex,代码行数:17,代码来源:language.php


示例15: findUserVideos

 public function findUserVideos($userId, $start, $offset)
 {
     $clipDao = VIDEO_BOL_ClipDao::getInstance();
     $example = new OW_Example();
     $example->andFieldEqual('status', 'approved');
     $example->andFieldEqual('userId', $userId);
     $example->setOrder('`addDatetime` DESC');
     $example->setLimitClause($start, $offset);
     $list = $clipDao->findListByExample($example);
     $out = array();
     foreach ($list as $video) {
         $id = $video->id;
         $videoThumb = VIDEO_BOL_ClipService::getInstance()->getClipThumbUrl($id);
         $out[$id] = array('id' => $id, 'embed' => $video->code, 'title' => UTIL_String::truncate($video->title, 65, ' ...'), 'description' => UTIL_String::truncate($video->description, 130, ' ...'), 'thumb' => $videoThumb == 'undefined' ? null : $videoThumb, 'date' => UTIL_DateTime::formatDate($video->addDatetime), 'permalink' => OW::getRouter()->urlForRoute('view_clip', array('id' => $id)));
         $out[$id]['oembed'] = json_encode(array('type' => 'video', 'thumbnail_url' => $out[$id]['thumb'], 'html' => $out[$id]['embed'], 'title' => $out[$id]['title'], 'description' => $out[$id]['description']));
     }
     return $out;
 }
开发者ID:vazahat,项目名称:dudex,代码行数:18,代码来源:video_bridge.php


示例16: onInvite

 public function onInvite(OW_Event $event)
 {
     $params = $event->getParams();
     $eventId = $params['eventId'];
     $eventDto = EVENT_BOL_EventService::getInstance()->findEvent($params['eventId']);
     $eventUrl = OW::getRouter()->urlForRoute('event.view', array('eventId' => $eventDto->id));
     $eventTitle = UTIL_String::truncate($eventDto->title, 100, '...');
     $userId = OW::getUser()->getId();
     $userDto = OW::getUser()->getUserObject();
     $userUrl = BOL_UserService::getInstance()->getUserUrlForUsername($userDto->username);
     $userDisplayName = BOL_UserService::getInstance()->getDisplayName($userId);
     $avatars = BOL_AvatarService::getInstance()->getDataForUserAvatars(array($userId));
     $avatar = $avatars[$userId];
     $users = array($userId);
     $stringAssigns = array('event' => '<a href="' . $eventUrl . '">' . $eventTitle . '</a>');
     $stringAssigns['user1'] = '<a href="' . $userUrl . '">' . $userDisplayName . '</a>';
     $contentImage = null;
     if (!empty($eventDto->image)) {
         $eventSrc = EVENT_BOL_EventService::getInstance()->generateImageUrl($eventDto->image, true);
         $contentImage = array('src' => $eventSrc, 'url' => $eventUrl, 'title' => $eventTitle);
     }
     //$userCount = count($data['users']);
     //        $userIds = array();
     //        for ( $i = 0; $i < $userCount; $i++ )
     //        {
     //            $user = $data['users'][$i];
     //            $stringAssigns['user' . ($i+1)] = '<a href="' . $user['url'] . '">' . $user['name'] . '</a>';
     //
     //            if ( $i >= 2 )
     //            {
     //                $userIds[] = $user['userId'];
     //            }
     //        }
     //$stringAssigns['otherUsers'] = '<a href="javascript://" onclick="OW.showUsers(' . json_encode($users) . ');">' .
     //OW::getLanguage()->text('event', 'invitation_join_string_other_users', array( 'count' => count($users) )) . '</a>';
     // $languageKey = $userCount > 2 ? 'invitation_join_string_many' : 'invitation_join_string_' . $userCount;
     $languageKey = 'invitation_join_string_' . 1;
     $invitationEvent = new OW_Event('invitations.add', array('pluginKey' => 'event', 'entityType' => self::INVITATION_JOIN, 'entityId' => $eventDto->id, 'userId' => $params['userId'], 'time' => time(), 'action' => 'event-invitation'), array('string' => array('key' => 'event+' . $languageKey, 'vars' => $stringAssigns), 'users' => $users, 'avatar' => $avatar, 'contentImage' => $contentImage));
     OW::getEventManager()->trigger($invitationEvent);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:40,代码来源:invitation_handler.php


示例17: text

 public function text($prefix, $key, array $vars = null)
 {
     if (empty($prefix) || empty($key)) {
         return $prefix . '+' . $key;
     }
     $text = null;
     try {
         $text = BOL_LanguageService::getInstance()->getText(BOL_LanguageService::getInstance()->getCurrent()->getId(), $prefix, $key);
     } catch (Exception $e) {
         return $prefix . '+' . $key;
     }
     if ($text === null) {
         return $prefix . '+' . $key;
     }
     $event = new OW_Event("core.get_text", array("prefix" => $prefix, "key" => $key, "vars" => $vars));
     $this->eventManager->trigger($event);
     if ($event->getData() !== null) {
         return $event->getData();
     }
     $text = UTIL_String::replaceVars($text, $vars);
     return $text;
 }
开发者ID:vBulleteen,项目名称:oxwall,代码行数:22,代码来源:language.php


示例18: onBeforeQuestionAdd

 public function onBeforeQuestionAdd(OW_Event $event)
 {
     $params = $event->getParams();
     $data = $event->getData();
     if (empty($params['settings']['context']['type']) || $params['settings']['context']['type'] != 'groups') {
         return;
     }
     if (!$this->isActive()) {
         return;
     }
     $context = $params['settings']['context'];
     $service = GROUPS_BOL_Service::getInstance();
     $groupId = (int) $context['id'];
     $group = $service->findGroupById($groupId);
     $url = $service->getGroupUrl($group);
     $title = UTIL_String::truncate(strip_tags($group->title), 100, '...');
     $context['label'] = $title;
     $context['url'] = $url;
     $data['settings']['context'] = $context;
     $data['privacy'] = 'groups';
     $event->setData($data);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:22,代码来源:groups_bridge.php


示例19: prepareButton

 public function prepareButton($params)
 {
     $appId = OW::getConfig()->getValue('contactimporter', 'facebook_app_id');
     if (empty($appId)) {
         return;
     }
     $staticUrl = OW::getPluginManager()->getPlugin('contactimporter')->getStaticUrl();
     $document = OW::getDocument();
     $document->addScript($staticUrl . 'js/facebook.js');
     $userId = OW::getUser()->getId();
     $fbLibUrl = 'http://connect.facebook.net/en_US/all.js';
     $code = UTIL_String::getRandomString(20);
     BOL_UserService::getInstance()->saveUserInvitation($userId, $code);
     $urlForInvite = OW::getRequest()->buildUrlQueryString(OW::getRouter()->urlForRoute('base_join'), array('code' => $code));
     $js = UTIL_JsGenerator::newInstance();
     $js->newObject(array('window', 'CONTACTIMPORTER_FaceBook'), 'CI_Facebook', array($fbLibUrl, $userId, $urlForInvite));
     $fbParams = array('appId' => $appId, 'status' => true, 'cookie' => true, 'xfbml' => true);
     $js->callFunction(array('CONTACTIMPORTER_FaceBook', 'init'), array($fbParams));
     $document->addOnloadScript((string) $js);
     OW::getLanguage()->addKeyForJs('contactimporter', 'facebook_inv_message_text');
     OW::getLanguage()->addKeyForJs('contactimporter', 'facebook_after_invite_feedback');
     return array('iconUrl' => $staticUrl . 'img/f.png', 'onclick' => "CONTACTIMPORTER_FaceBook.request(); return false;");
 }
开发者ID:sirpros,项目名称:contactimporter,代码行数:23,代码来源:facebook_provider.php


示例20: onInvite

 public function onInvite(OW_Event $event)
 {
     $params = $event->getParams();
     $eventDto = EVENTX_BOL_EventService::getInstance()->findEvent($params['eventId']);
     $eventUrl = OW::getRouter()->urlForRoute('eventx.view', array('eventId' => $eventDto->id));
     $eventTitle = UTIL_String::truncate($eventDto->title, 100, '...');
     $userId = OW::getUser()->getId();
     $userDto = OW::getUser()->getUserObject();
     $userUrl = BOL_UserService::getInstance()->getUserUrlForUsername($userDto->username);
     $userDisplayName = BOL_UserService::getInstance()->getDisplayName($userId);
     $avatars = BOL_AvatarService::getInstance()->getDataForUserAvatars(array($userId));
     $avatar = $avatars[$userId];
     $users = array($userId);
     $stringAssigns = array('event' => '<a href="' . $eventUrl . '">' . $eventTitle . '</a>');
     $stringAssigns['user1'] = '<a href="' . $userUrl . '">' . $userDisplayName . '</a>';
     $contentImage = null;
     if (!empty($eventDto->image)) {
         $eventSrc = EVENTX_BOL_EventService::getInstance()->generateImageUrl($eventDto->image, true);
         $contentImage = array('src' => $eventSrc, 'url' => $eventUrl, 'title' => $eventTitle);
     }
     $languageKey = 'invitation_join_string_' . 1;
     $invitationEvent = new OW_Event('invitations.add', array('pluginKey' => 'eventx', 'entityType' => self::INVITATION_JOIN, 'entityId' => $eventDto->id, 'userId' => $params['userId'], 'time' => time(), 'action' => 'event-invitation'), array('string' => array('key' => 'eventx+' . $languageKey, 'vars' => $stringAssigns), 'users' => $users, 'avatar' => $avatar, 'contentImage' => $contentImage));
     OW::getEventManager()->trigger($invitationEvent);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:24,代码来源:invitation_handler.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP UUID类代码示例发布时间:2022-05-23
下一篇:
PHP UTIL_Profiler类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap