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


PHP BxDolProfile::getInstanceByContentAndType方法代码示例

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


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

示例1: __construct

 public function __construct($aObject, $oTemplate = false)
 {
     parent::__construct($aObject, $oTemplate);
     $CNF = $this->_oModule->_oConfig->CNF;
     $iProfileId = bx_process_input(bx_get('profile_id'), BX_DATA_INT);
     $iContentId = bx_process_input(bx_get('id'), BX_DATA_INT);
     if ($iProfileId) {
         $this->_oProfile = BxDolProfile::getInstance($iProfileId);
     }
     if (!$this->_oProfile && $iContentId) {
         $this->_oProfile = BxDolProfile::getInstanceByContentAndType($iContentId, $this->MODULE);
     }
     if ($this->_oProfile) {
         $this->_aProfileInfo = $this->_oProfile->getInfo();
         $this->_aContentInfo = $this->_oModule->_oDb->getContentInfoById($this->_aProfileInfo['content_id']);
         $this->addMarkers($this->_aProfileInfo);
         $this->addMarkers(array('profile_id' => $this->_oProfile->id()));
         if (isLogged()) {
             $oConn = BxDolConnection::getObjectInstance('sys_profiles_friends');
             if ($oConn->isConnectedNotMutual(bx_get_logged_profile_id(), $this->_oProfile->id())) {
                 $this->addMarkers(array('title_add_friend' => _t($CNF['T']['menu_item_title_befriend_sent']), 'title_remove_friend' => _t($CNF['T']['menu_item_title_unfriend_cancel_request'])));
             } elseif ($oConn->isConnectedNotMutual($this->_oProfile->id(), bx_get_logged_profile_id())) {
                 $this->addMarkers(array('title_add_friend' => _t($CNF['T']['menu_item_title_befriend_confirm']), 'title_remove_friend' => _t($CNF['T']['menu_item_title_unfriend_reject_request'])));
             } else {
                 $this->addMarkers(array('title_add_friend' => _t($CNF['T']['menu_item_title_befriend']), 'title_remove_friend' => _t($CNF['T']['menu_item_title_unfriend'])));
             }
         }
     }
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:29,代码来源:BxBaseModProfileMenuView.php

示例2: __construct

 public function __construct($aObject, $oTemplate = false)
 {
     parent::__construct($aObject, $oTemplate);
     $CNF =& $this->_oModule->_oConfig->CNF;
     $aInformers = array();
     // get profile info
     $iProfileId = bx_process_input(bx_get('profile_id'), BX_DATA_INT);
     $iContentId = bx_process_input(bx_get('id'), BX_DATA_INT);
     if ($iProfileId) {
         $this->_oProfile = BxDolProfile::getInstance($iProfileId);
     }
     if (!$this->_oProfile && $iContentId) {
         $this->_oProfile = BxDolProfile::getInstanceByContentAndType($iContentId, $this->MODULE);
     }
     if ($this->_oProfile) {
         $this->_aProfileInfo = $this->_oProfile->getInfo();
         $this->_aContentInfo = $this->_oModule->_oDb->getContentInfoById($this->_aProfileInfo['content_id']);
     }
     if (!$this->_aContentInfo || !$this->_oProfile) {
         return;
     }
     // select view profile submenu
     $oMenuSubmenu = BxDolMenu::getObjectInstance('sys_site_submenu');
     $oMenuSubmenu->setObjectSubmenu($CNF['OBJECT_MENU_SUBMENU_VIEW_ENTRY'], array('title' => $this->_oProfile->getDisplayName(), 'link' => $this->_oProfile->getUrl(), 'icon' => $CNF['ICON']));
     // add replaceable markers
     $this->addMarkers($this->_aProfileInfo);
     // every content field can be used as marker
     $this->addMarkers(array('profile_id' => $this->_oProfile->id()));
     // profile id field
     $this->addMarkers(array('display_name' => $this->_oProfile->getDisplayName()));
     // profile display name
     $this->addMarkers(array('profile_link' => $this->_oProfile->getUrl()));
     // profile link
     // display message if profile isn't active
     if (bx_get_logged_profile_id() == $this->_oProfile->id() && !empty($CNF['INFORMERS']['status'])) {
         $sStatus = $this->_aContentInfo['profile_status'];
         if (isset($CNF['INFORMERS']['status']['map'][$sStatus])) {
             $aInformers[] = array('name' => $CNF['INFORMERS']['status']['name'], 'msg' => _t($CNF['INFORMERS']['status']['map'][$sStatus]), 'type' => BX_INFORMER_ALERT);
         }
     }
     // display message if it is possible to switch to this profile
     $oProfile = $this->_aContentInfo ? BxDolProfile::getInstanceByContentTypeAccount($this->_aContentInfo['id'], $this->MODULE) : false;
     if ($oProfile) {
         $oProfile->checkSwitchToProfile($this->_oTemplate);
     }
     // add informers
     if ($aInformers) {
         $oInformer = BxDolInformer::getInstance($this->_oTemplate);
         if ($oInformer) {
             foreach ($aInformers as $a) {
                 $oInformer->add($a['name'], $this->_replaceMarkers($a['msg']), $a['type']);
             }
         }
     }
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:55,代码来源:BxBaseModProfilePageEntry.php

示例3: _checkAllowedConnect

 protected function _checkAllowedConnect(&$aDataEntry, $isPerformAction, $sObjConnection, $isMutual, $isInvertResult, $isSwap = false)
 {
     if (!$this->_iProfileId) {
         return _t('_sys_txt_access_denied');
     }
     $CNF =& $this->_oConfig->CNF;
     $oProfile = BxDolProfile::getInstanceByContentAndType($aDataEntry[$CNF['FIELD_ID']], $this->_aModule['name']);
     if (!$oProfile || $oProfile->id() == $this->_iProfileId) {
         return _t('_sys_txt_access_denied');
     }
     $oConn = BxDolConnection::getObjectInstance($sObjConnection);
     if ($isSwap) {
         $isConnected = $oConn->isConnected($oProfile->id(), $this->_iProfileId, $isMutual);
     } else {
         $isConnected = $oConn->isConnected($this->_iProfileId, $oProfile->id(), $isMutual);
     }
     if ($isInvertResult) {
         $isConnected = !$isConnected;
     }
     return $isConnected ? _t('_sys_txt_access_denied') : CHECK_ACTION_RESULT_ALLOWED;
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:21,代码来源:BxBaseModProfileModule.php

示例4: checkAllowedDelete

 /**
  * @return CHECK_ACTION_RESULT_ALLOWED if access is granted or error message if access is forbidden.
  */
 public function checkAllowedDelete(&$aDataEntry, $isPerformAction = false)
 {
     // moderator always has access
     if ($this->_isModerator($isPerformAction)) {
         return CHECK_ACTION_RESULT_ALLOWED;
     }
     // check ACL and owner (checked by account! not as profile as ususal)
     $aCheck = checkActionModule($this->_iProfileId, 'delete entry', $this->getName(), $isPerformAction);
     bx_import('BxDolProfile');
     $oProfile = BxDolProfile::getInstanceByContentAndType($aDataEntry[$this->_oConfig->CNF['FIELD_ID']], $this->_aModule['name']);
     if (!$oProfile) {
         return _t('_sys_txt_error_occured');
     }
     if ($oProfile->getAccountId() == $this->_iAccountId && $aCheck[CHECK_ACTION_RESULT] === CHECK_ACTION_RESULT_ALLOWED) {
         return CHECK_ACTION_RESULT_ALLOWED;
     }
     return _t('_sys_txt_access_denied');
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:21,代码来源:BxBaseModProfileModule.php

示例5: checkMyself

 public function checkMyself($iContentId)
 {
     $iLogged = (int) bx_get_logged_profile_id();
     if (empty($iLogged)) {
         return false;
     }
     $oProfile = BxDolProfile::getInstanceByContentAndType((int) $iContentId, $this->_oConfig->getName());
     if (!$oProfile) {
         return false;
     }
     return $oProfile->id() == $iLogged;
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:12,代码来源:BxBaseModProfileModule.php

示例6: serviceGetBlockViewProfile

 public function serviceGetBlockViewProfile($sProfileModule = 'bx_persons', $iProfileId = 0, $iStart = -1, $iPerPage = -1, $sFilter = '', $aModules = array(), $iTimeline = -1)
 {
     if (empty($iProfileId) && !empty($sProfileModule) && bx_get('id') !== false) {
         $oProfile = BxDolProfile::getInstanceByContentAndType(bx_process_input(bx_get('id'), BX_DATA_INT), $sProfileModule);
         if (!empty($oProfile)) {
             $iProfileId = $oProfile->id();
         }
     }
     if (!$iProfileId) {
         return array();
     }
     $sJsObject = $this->_oConfig->getJsObject('view');
     $aParams = $this->_prepareParams(BX_BASE_MOD_NTFS_TYPE_OWNER, $iProfileId, $iStart, $iPerPage, $sFilter, $aModules, $iTimeline);
     $aParams['per_page'] = (int) $iPerPage > 0 ? $iPerPage : $this->_oConfig->getPerPage('profile');
     $this->_iOwnerId = $aParams['owner_id'];
     list($sUserName, $sUserUrl) = $this->getUserInfo($aParams['owner_id']);
     $aMenu = array(array('id' => 'timeline-view-all', 'name' => 'timeline-view-all', 'class' => '', 'link' => 'javascript:void(0)', 'onclick' => 'javascript:' . $sJsObject . '.changeFilter(this)', 'target' => '_self', 'title' => _t('_bx_timeline_menu_item_view_all'), 'active' => 1), array('id' => 'timeline-view-owner', 'name' => 'timeline-view-owner', 'class' => '', 'link' => 'javascript:void(0)', 'onclick' => 'javascript:' . $sJsObject . '.changeFilter(this)', 'target' => '_self', 'title' => _t('_bx_timeline_menu_item_view_owner', $sUserName)), array('id' => 'timeline-view-other', 'name' => 'timeline-view-other', 'class' => '', 'link' => 'javascript:void(0)', 'onclick' => 'javascript:' . $sJsObject . '.changeFilter(this)', 'target' => '_self', 'title' => _t('_bx_timeline_menu_item_view_other')), array('id' => 'timeline-get-rss', 'name' => 'timeline-get-rss', 'class' => '', 'link' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'rss/' . $iProfileId . '/', 'target' => '_blank', 'title' => _t('_bx_timeline_menu_item_get_rss')));
     bx_import('BxTemplMenuInteractive');
     $oMenu = new BxTemplMenuInteractive(array('template' => 'menu_interactive_vertical.html', 'menu_id' => 'timeline-view-all', 'menu_items' => $aMenu));
     $oMenu->setSelected('', 'timeline-view-all');
     $sContent = $this->_oTemplate->getViewBlock($aParams);
     return array('content' => $sContent, 'menu' => $oMenu);
 }
开发者ID:Baloo7super,项目名称:dolphin,代码行数:23,代码来源:BxTimelineModule.php

示例7: _getProfileObject

 protected function _getProfileObject($iId)
 {
     $oProfile = BxDolProfile::getInstanceByContentAndType((int) $iId, $this->_oModule->_oConfig->getName());
     if (!$oProfile) {
         $oProfile = BxDolProfileUndefined::getInstance();
     }
     return $oProfile;
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:8,代码来源:BxBaseModProfileGridAdministration.php

示例8: serviceGetBlockViewProfile

 public function serviceGetBlockViewProfile($sProfileModule = 'bx_persons', $iProfileContentId = 0, $iStart = -1, $iPerPage = -1, $sFilter = '', $aModules = array(), $iTimeline = -1)
 {
     if (empty($sProfileModule)) {
         return array();
     }
     if (empty($iProfileContentId) && bx_get('id') !== false) {
         $iProfileContentId = bx_process_input(bx_get('id'), BX_DATA_INT);
     }
     $oProfile = BxDolProfile::getInstanceByContentAndType($iProfileContentId, $sProfileModule);
     if (empty($oProfile)) {
         return array();
     }
     return $this->getBlockView($oProfile->id(), $iStart, $iPerPage, $sFilter, $aModules, $iTimeline);
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:14,代码来源:BxTimelineModule.php


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