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


PHP FD::_方法代码示例

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


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

示例1: onPrepareStream

 public function onPrepareStream(SocialStreamItem &$stream, $includePrivacy = true)
 {
     if ($stream->context != 'relationship') {
         return;
     }
     $params = $this->getParams();
     if (!$params->get('stream_approve', true)) {
         return;
     }
     // Get the actor
     $actor = $stream->actor;
     // check if the actor is ESAD profile or not, if yes, we skip the rendering.
     if (!$actor->hasCommunityAccess()) {
         $stream->title = '';
         return;
     }
     $my = FD::user();
     $privacy = FD::privacy($my->id);
     if ($includePrivacy && !$privacy->validate('core.view', $stream->contextId, 'relationship', $stream->actor->id)) {
         return;
     }
     $stream->color = '#DC554F';
     $stream->fonticon = 'ies-heart';
     $stream->label = FD::_('APP_USER_RELATIONSHIP_STREAM_TOOLTIP', true);
     $stream->display = SOCIAL_STREAM_DISPLAY_FULL;
     $registry = FD::registry($stream->params);
     $this->set('type', $registry->get('type'));
     $this->set('actor', $stream->actor);
     $this->set('target', $stream->targets[0]);
     $stream->title = parent::display('streams/' . $stream->verb . '.title');
     if ($includePrivacy) {
         $stream->privacy = $privacy->form($stream->contextId, 'relationship', $stream->actor->id, 'core.view', false, $stream->uid);
     }
     return true;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:35,代码来源:relationship.php

示例2: onPrepareStream

 public function onPrepareStream(SocialStreamItem &$item, $includePrivacy = true)
 {
     // We only want to process related items
     if ($item->cluster_type !== SOCIAL_TYPE_EVENT || empty($item->cluster_id)) {
         return;
     }
     // Context are split into events and nodes
     // "events" context are stream items that are related to event item
     // "guests" context are stream items that are related to guests of the event
     // Only process "events" context here
     // "guests" context are processed in the app/event/guests app
     if ($item->context !== 'events') {
         return;
     }
     $event = FD::event($item->cluster_id);
     // Only show Social sharing in public group
     if (!$event->isOpen()) {
         $item->sharing = false;
     }
     if (!$event->canViewItem()) {
         return;
     }
     if (!$this->getParams()->get('stream_' . $item->verb, true)) {
         return;
     }
     $item->display = SOCIAL_STREAM_DISPLAY_FULL;
     $item->color = '#f06050';
     $item->fonticon = 'ies-calendar';
     $item->label = FD::_('APP_EVENT_EVENTS_STREAM_TOOLTIP', true);
     $actor = $item->actor;
     $this->set('event', $event);
     $this->set('actor', $actor);
     // streams/create.title
     // streams/feature.title
     // streams/update.title
     $item->title = parent::display('streams/' . $item->verb . '.title');
     $item->content = '';
     if ($event->isGroupEvent()) {
         $this->set('group', $event->getGroup());
         $item->content = parent::display('streams/content');
     }
     // APP_EVENT_EVENTS_STREAM_OPENGRAPH_UPDATE
     // APP_EVENT_EVENTS_STREAM_OPENGRAPH_CREATE
     // APP_EVENT_EVENTS_STREAM_OPENGRAPH_FEATURE
     $item->opengraph->addDescription(JText::sprintf('APP_EVENT_EVENTS_STREAM_OPENGRAPH_' . strtoupper($item->verb), $actor->getName(), $event->getName()));
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:46,代码来源:events.php

示例3: onPrepareStream

 /**
  * Prepares the stream item
  *
  * @since	1.0
  * @access	public
  * @param	SocialStreamItem	The stream object.
  * @param	bool				Determines if we should respect the privacy
  */
 public function onPrepareStream(SocialStreamItem &$item, $includePrivacy = true)
 {
     if ($item->context != 'article') {
         return;
     }
     // Define standard stream looks
     $item->display = SOCIAL_STREAM_DISPLAY_FULL;
     $item->color = '#1616d3';
     $item->icon = '<i class="ies-copy" data-original-title="' . FD::_('APP_ARTICLE_STREAM_TOOLTIP', true) . '" data-es-provide="tooltip"></i>';
     if ($item->verb == 'create') {
         $this->prepareCreateArticleStream($item);
     }
     if ($item->verb == 'update') {
         $this->prepareUpdateArticleStream($item);
     }
     if ($item->verb == 'read') {
         $this->prepareReadArticleStream($item);
     }
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:27,代码来源:ajax.php

示例4:

    ?>
" data-es-provide="tooltip" data-placement="bottom">
                    <i class="ies-locked"></i>
                    <?php 
    echo JText::_('COM_EASYSOCIAL_EVENTS_PRIVATE_EVENT');
    ?>
                </span>
                <?php 
}
?>

                <?php 
if ($event->isInviteOnly()) {
    ?>
                <span class="label label-warning" data-original-title="<?php 
    echo FD::_('COM_EASYSOCIAL_EVENTS_INVITE_EVENT_TOOLTIP', true);
    ?>
" data-es-provide="tooltip" data-placement="bottom">
                    <i class="ies-locked muted"></i>
                    <?php 
    echo JText::_('COM_EASYSOCIAL_EVENTS_INVITE_EVENT');
    ?>
                </span>
                <?php 
}
?>
            </h4>

            <p class="mb-10 mt-10 blog-description">
                <?php 
echo $this->html('string.truncater', $event->getDescription(), 250);
开发者ID:knigherrant,项目名称:decopatio,代码行数:31,代码来源:content.php

示例5: defined

<?php

/**
* @package		EasySocial
* @copyright	Copyright (C) 2010 - 2014 Stack Ideas Sdn Bhd. All rights reserved.
* @license		GNU/GPL, see LICENSE.php
* EasySocial is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
defined('_JEXEC') or die('Unauthorized Access');
?>
<i class="ies-folder-3" 
    data-story-attachment-icon 
    data-es-provide="tooltip" 
    data-placement="top" 
    data-original-title="<?php 
echo FD::_('APP_USER_FILES_PANEL_TOOLTIP', true);
?>
"></i>
开发者ID:knigherrant,项目名称:decopatio,代码行数:22,代码来源:panel.button.php

示例6: onPrepareStream

 /**
  * Prepares the stream item
  *
  * @since	1.0
  * @access	public
  * @param	SocialStreamItem	The stream object.
  * @param	bool				Determines if we should respect the privacy
  */
 public function onPrepareStream(SocialStreamItem &$item, $includePrivacy = true)
 {
     if ($item->context !== 'feeds') {
         return;
     }
     // Get app params
     $params = $this->getParams();
     if (!$params->get('stream_create', true)) {
         return;
     }
     // Get the feed table
     $rss = FD::table('Rss');
     $rss->load($item->contextId);
     if (!$rss->id || !$item->contextId) {
         return;
     }
     $group = FD::group($item->cluster_id);
     $actor = $item->actor;
     $app = $this->getApp();
     $this->set('app', $app);
     $this->set('rss', $rss);
     $this->set('actor', $actor);
     $this->set('group', $group);
     $item->color = '#e67e22';
     $item->display = SOCIAL_STREAM_DISPLAY_FULL;
     $item->fonticon = 'ies-feed';
     $item->label = FD::_('APP_USER_FEED_STREAM_TOOLTIP', true);
     $item->title = parent::display('streams/' . $item->verb . '.title');
     $item->content = parent::display('streams/' . $item->verb . '.content');
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:38,代码来源:feeds.php

示例7: defined

<?php

/**
* @package		EasySocial
* @copyright	Copyright (C) 2010 - 2014 Stack Ideas Sdn Bhd. All rights reserved.
* @license		GNU/GPL, see LICENSE.php
* EasySocial is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
defined('_JEXEC') or die('Unauthorized Access');
?>
<i class="ies-checkbox-checked" data-story-attachment-icon data-es-provide="tooltip" data-original-title="<?php 
echo FD::_('APP_GROUP_TASKS_STORY_TOOLTIP', true);
?>
" data-placement="top"></i>
开发者ID:knigherrant,项目名称:decopatio,代码行数:18,代码来源:panel.button.php

示例8: defined

<?php

/**
* @package      EasySocial
* @copyright    Copyright (C) 2010 - 2014 Stack Ideas Sdn Bhd. All rights reserved.
* @license      GNU/GPL, see LICENSE.php
* EasySocial is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
defined('_JEXEC') or die('Unauthorized Access');
?>
<i class="ies-calendar-2" data-story-attachment-icon data-es-provide="tooltip" data-placement="top" data-original-title="<?php 
echo FD::_('APP_USER_EVENTS_PANEL_TOOLTIP', true);
?>
" data-story-event-panel-button></i>
开发者ID:knigherrant,项目名称:decopatio,代码行数:18,代码来源:panel.button.php

示例9: featured

 /**
  * Renders publish / unpublish icon.
  *
  * @since	1.0
  * @access	public
  * @param	object	The object to check against.
  * @param	string	The controller to be called.
  * @param	string	The key for the object.
  * @param	Array	An optional array of tasks
  *
  * @author	Mark Lee <mark@stackideas.com>
  */
 public static function featured($obj, $controllerName = '', $key = '', $task = '', $allowed = true, $tooltip = array())
 {
     // If primary key is not provided, then we assume that we should use 'state' as the key property.
     $key = !empty($key) ? $key : 'default';
     $task = !empty($task) ? $task : 'toggleDefault';
     switch ($obj->{$key}) {
         case SOCIAL_STATE_PUBLISHED:
             $class = 'featured';
             $tooltip = '';
             if ($allowed) {
                 $tooltip = isset($tooltip[1]) ? $tooltip[1] : FD::_('COM_EASYSOCIAL_GRID_TOOLTIP_UNFEATURE_ITEM', true);
             }
             break;
         default:
             $class = 'default';
             $tooltip = isset($tooltip[0]) ? $tooltip[0] : FD::_('COM_EASYSOCIAL_GRID_TOOLTIP_FEATURE_ITEM', true);
             break;
     }
     $theme = FD::get('Themes');
     $theme->set('task', $task);
     $theme->set('class', $class);
     $theme->set('tooltip', $tooltip);
     $theme->set('allowed', $allowed);
     return $theme->output('admin/html/grid.published');
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:37,代码来源:grid.php

示例10: onPrepareStream

 /**
  * Responsible to generate the stream content for profiles apps.
  *
  * @since	1.0
  * @access	public
  * @param	object	$params		A standard object with key / value binding.
  *
  * @return	none
  */
 public function onPrepareStream(SocialStreamItem &$item, $includePrivacy = true)
 {
     if ($item->context != 'profiles') {
         return;
     }
     // Get the application params
     $params = $this->getParams();
     if ($item->verb == 'update' && !$params->get('stream_update', true)) {
         return;
     }
     if ($item->verb == 'register' && !$params->get('stream_register', true)) {
         return;
     }
     $my = FD::user();
     // Decorate the stream
     $item->display = SOCIAL_STREAM_DISPLAY_MINI;
     if ($item->verb == 'register') {
         $item->color = '#FF7553';
         $item->fonticon = 'ies-user-add';
         $item->label = FD::_('APP_USER_PROFILES_REGISTER_STREAM_TOOLTIP', true);
     }
     // When user updates their profile.
     if ($item->verb == 'update') {
         $item->color = '#1FBCA7';
         $item->fonticon = 'ies-briefcase';
         $item->label = FD::_('APP_USER_PROFILES_UPDATE_PROFILE_STREAM_TOOLTIP', true);
     }
     $actor = $item->actor;
     if (!$actor->hasCommunityAccess()) {
         $item->title = '';
         return;
     }
     $genderValue = $actor->getFieldData('GENDER');
     $gender = 'THEIR';
     if ($genderValue == 1) {
         $gender = 'MALE';
     }
     if ($genderValue == 2) {
         $gender = 'FEMALE';
     }
     // Override the likes
     $item->likes = FD::likes($item->uid, 'userprofile', $item->verb, SOCIAL_APPS_GROUP_USER, $item->uid);
     // Override the comments
     $comments = FD::comments($item->uid, 'userprofile', $item->verb, SOCIAL_APPS_GROUP_USER, array('url' => FRoute::stream(array('layout' => 'item', 'id' => $item->uid))), $item->uid);
     $item->comments = $comments;
     $this->set('gender', $gender);
     $this->set('actor', $item->actor);
     $item->title = parent::display('streams/' . $item->verb . '.title');
     return true;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:59,代码来源:profiles.php

示例11: onPrepareStream

 /**
  * Generates the stream title of group.
  *
  * @since	1.0
  * @access	public
  * @param	object	$params		A standard object with key / value binding.
  *
  * @return	none
  */
 public function onPrepareStream(SocialStreamItem &$stream, $includePrivacy = true)
 {
     if ($stream->context != 'links') {
         return;
     }
     // Group access
     $group = FD::group($stream->cluster_id);
     if (!$group) {
         return;
     }
     if (!$group->canViewItem()) {
         return;
     }
     //get links object, in this case, is the stream_item
     $uid = $stream->uid;
     $stream->color = '#5580BE';
     $stream->fonticon = 'ies-link';
     $stream->label = FD::_('APP_GROUP_LINKS_STREAM_TOOLTIP', true);
     // Apply likes on the stream
     $likes = FD::likes();
     $likes->get($stream->uid, $stream->context, $stream->verb, SOCIAL_APPS_GROUP_GROUP, $stream->uid);
     $stream->likes = $likes;
     // Apply comments on the stream
     $comments = FD::comments($stream->uid, $stream->context, $stream->verb, SOCIAL_APPS_GROUP_GROUP, array('url' => FRoute::stream(array('layout' => 'item', 'id' => $stream->uid))), $stream->uid);
     $stream->comments = $comments;
     // Apply repost on the stream
     $repost = FD::get('Repost', $stream->uid, SOCIAL_TYPE_STREAM, SOCIAL_APPS_GROUP_GROUP);
     $stream->repost = $repost;
     $my = FD::user();
     $privacy = FD::privacy($my->id);
     if ($includePrivacy && !$privacy->validate('story.view', $uid, SOCIAL_TYPE_LINKS, $stream->actor->id)) {
         return;
     }
     $actor = $stream->actor;
     $target = count($stream->targets) > 0 ? $stream->targets[0] : '';
     $stream->display = SOCIAL_STREAM_DISPLAY_FULL;
     $assets = $stream->getAssets();
     if (empty($assets)) {
         return;
     }
     // Get the assets
     $assets = $assets[0];
     // Get app params
     $params = $this->getParams();
     // Retrieve the link that is stored.
     $hash = md5($assets->get('link'));
     // Load the link object
     $link = FD::table('Link');
     $link->load(array('hash' => $hash));
     // Get the link data
     $linkObj = json_decode($link->data);
     // Determine if there's any embedded object
     $oembed = isset($linkObj->oembed) ? $linkObj->oembed : '';
     $image = FD::links()->getImageLink($assets, $params);
     // Fix video issues with youtube when site is on https
     $oembed = FD::links()->fixOembedLinks($oembed);
     // Get the contents and truncate accordingly
     $content = $assets->get('content', '');
     if ($params->get('stream_link_truncate')) {
         $content = JString::substr(strip_tags($content), 0, $params->get('stream_link_truncate_length', 250)) . JText::_('COM_EASYSOCIAL_ELLIPSES');
     }
     $this->set('image', $image);
     $this->set('content', $content);
     $this->set('params', $params);
     $this->set('oembed', $oembed);
     $this->set('assets', $assets);
     $this->set('actor', $actor);
     $this->set('target', $target);
     $this->set('stream', $stream);
     $this->set('group', $group);
     $stream->title = parent::display('streams/title.' . $stream->verb);
     $stream->preview = parent::display('streams/preview.' . $stream->verb);
     return true;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:83,代码来源:links.php

示例12: onPrepareStream

 /**
  * Triggered when the prepare stream is rendered
  *
  * @since    1.2
  * @access    public
  * @param    string
  * @return
  */
 public function onPrepareStream(SocialStreamItem &$item, $includePrivacy = true)
 {
     if ($item->context != 'tasks') {
         return;
     }
     // Event access checking
     $event = FD::event($item->cluster_id);
     if (!$event) {
         return;
     }
     if (!$event->canViewItem()) {
         return;
     }
     $item->display = SOCIAL_STREAM_DISPLAY_FULL;
     $item->color = '#658ea6';
     $item->fonticon = 'ies-checkbox-checked';
     $item->label = FD::_('APP_EVENT_TASKS_STREAM_TOOLTIP', true);
     // Get the verb
     $verb = $item->verb;
     // Do not allow reposting on milestone items
     $item->repost = false;
     if ($verb == 'createTask') {
         $this->prepareCreatedTaskStream($item, $includePrivacy);
     }
     if ($verb == 'createMilestone') {
         $this->prepareCreateMilestoneStream($item, $includePrivacy);
     }
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:36,代码来源:tasks.php

示例13: onPrepareStream

 /**
  * Prepares the stream item.
  *
  * @since   1.3
  * @access  public
  */
 public function onPrepareStream(SocialStreamItem &$item, $includePrivacy = true)
 {
     // We only want to process related items
     if ($item->cluster_type !== SOCIAL_TYPE_EVENT || empty($item->cluster_id)) {
         return;
     }
     // If the event is a invite-only event, then we do not want the stream to show on user's stream.
     // The stream still has to be generated because the same stream item is displayed on both user and event's stream.
     $event = FD::event($item->cluster_id);
     // Only show Social sharing in public event
     if ($event->type != SOCIAL_EVENT_TYPE_PUBLIC) {
         $item->sharing = false;
     }
     // If the event is pending and is a new item, this means this event is created from the story form, and we want to show a message stating that the event is in pending
     if ($event->isPending() && !empty($item->isNew)) {
         $item->title = JText::_('APP_USER_EVENTS_STREAM_EVENT_PENDING_APPROVAL');
         $item->display = SOCIAL_STREAM_DISPLAY_MINI;
         return;
     }
     // If event is not published, we do not want to render the stream.
     if (!$event->isPublished()) {
         return;
     }
     if ($event->isInviteOnly() && !$event->getGuest()->isGuest()) {
         return;
     }
     if (!in_array($item->context, array('events', 'guests', 'tasks', 'discussions'))) {
         return;
     }
     $item->display = SOCIAL_STREAM_DISPLAY_FULL;
     $item->color = '#f06050';
     $item->fonticon = 'ies-calendar';
     $item->label = FD::_('APP_USER_EVENTS_STREAM_TOOLTIP', true);
     if ($event->isGroupEvent()) {
         $item->label = FD::_('APP_USER_EVENTS_GROUP_EVENT_STREAM_TOOLTIP', true);
     }
     if ($item->context === 'events' || $item->context === 'guests') {
         // Context are split into events and guests
         // "events" context are stream items that are related to event item
         // "guests" context are stream items that are related to guests of the event
         // From events
         // stream_feature
         // stream_create
         // stream_update
         // From guests
         // stream_makeadmin
         // stream_going
         // stream_notgoing
         if (!$this->getParams()->get('stream_' . $item->verb, true)) {
             return;
         }
         // Event stream items should just be mini
         // $item->display = SOCIAL_STREAM_DISPLAY_MINI;
         // This goes to user/events/streams in accordance to verb
         // $this->processStream($item);
         $this->set('event', $event);
         $this->set('actor', $item->actor);
         if ($event->isGroupEvent()) {
             $this->set('group', $event->getGroup());
         }
         // streams/create.title
         // streams/feature.title
         // streams/makeadmin.title
         // streams/going.title
         // streams/notgoing.title
         // streams/update.title
         $item->title = parent::display('streams/events/' . $item->verb . '.title');
         $item->content = parent::display('streams/events/content');
         // APP_USER_EVENTS_STREAM_OPENGRAPH_CREATE
         // APP_USER_EVENTS_STREAM_OPENGRAPH_FEATURE
         // APP_USER_EVENTS_STREAM_OPENGRAPH_MAKEADMIN
         // APP_USER_EVENTS_STREAM_OPENGRAPH_UPDATE
         // APP_USER_EVENTS_STREAM_OPENGRAPH_GOING
         // APP_USER_EVENTS_STREAM_OPENGRAPH_NOTGOING
         $item->opengraph->addDescription(JText::sprintf('APP_USER_EVENTS_STREAM_OPENGRAPH_' . strtoupper($item->verb), $item->actor->getName(), $event->getName()));
         return;
     }
     if ($item->context === 'discussions') {
         $this->processDiscussionStream($item, $includePrivacy);
         return;
     }
     if ($item->context === 'tasks') {
         $this->processTaskStream($item, $includePrivacy);
         return;
     }
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:92,代码来源:events.php

示例14: prepareGroupTask

 private function prepareGroupTask(SocialStreamItem &$item, $group, $includePrivacy)
 {
     $item->display = SOCIAL_STREAM_DISPLAY_FULL;
     $item->color = '#658ea6';
     $item->fonticon = 'ies-checkbox-checked';
     $item->label = FD::_('APP_GROUPS_TASKS_STREAM_TOOLTIP', true);
     // Get the verb
     $verb = $item->verb;
     if ($verb == 'createTask') {
         $this->prepareCreatedTaskStream($item, $includePrivacy);
     }
     if ($verb == 'createMilestone') {
         $this->prepareCreateMilestoneStream($item, $includePrivacy);
     }
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:15,代码来源:groups.php

示例15: onPrepareStream

 /**
  * Prepares the stream item
  *
  * @since	1.0
  * @access	public
  * @param	SocialStreamItem	The stream object.
  * @param	bool				Determines if we should respect the privacy
  */
 public function onPrepareStream(SocialStreamItem &$item, $includePrivacy = true)
 {
     if ($item->context != 'k2') {
         return;
     }
     // Decorate the stream item
     $item->display = SOCIAL_STREAM_DISPLAY_FULL;
     $item->color = '#415457';
     $item->fonticon = 'ies-list-2';
     $item->label = FD::_('APP_USER_K2_STREAM_TOOLTIP', true);
     // Get application params
     $params = $this->getParams();
     if ($item->verb == 'create' && $params->get('stream_create', true)) {
         $this->prepareCreateArticleStream($item);
     }
     if ($item->verb == 'update' && $params->get('stream_update', true)) {
         $this->prepareUpdateArticleStream($item);
     }
     if ($item->verb == 'read' && $params->get('stream_read', true)) {
         $this->prepareReadArticleStream($item);
     }
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:30,代码来源:k2.php


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