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


PHP Conversation::getByID方法代码示例

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


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

示例1: loadConversation

 protected function loadConversation($cnvID)
 {
     $conversation = \Conversation::getByID($cnvID);
     if (is_object($conversation) && $conversation->getConversationSubscriptionEnabled()) {
         $cp = new \Permissions($conversation);
         if ($cp->canViewConversation()) {
             $u = new \User();
             $this->user = $u;
             $this->conversation = $conversation;
             $this->set('conversation', $conversation);
             $this->set('isSubscribed', $conversation->isUserSubscribed($u));
             $this->setViewObject(new \View('/dialogs/conversation/subscribe'));
         }
     }
     if (!$conversation) {
         throw new \Exception(t('Access Denied.'));
     }
 }
开发者ID:ceko,项目名称:concrete5-1,代码行数:18,代码来源:subscribe.php

示例2: getUrlFromNotice

 public static function getUrlFromNotice(Notice $notice, $anchor = true)
 {
     $conv = Conversation::getByID($notice->conversation);
     return $conv->getUrl($anchor ? $notice->getID() : null);
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:5,代码来源:Conversation.php

示例3: defined

<?php

defined('C5_EXECUTE') or die("Access Denied.");
use Concrete\Core\Permission\Access\Entity\Entity as PermissionAccessEntity;
use Concrete\Core\Permission\Duration as PermissionDuration;
if ($_REQUEST['cnvID'] > 0) {
    $conversation = Conversation::getByID($_REQUEST['cnvID']);
}
$cnp = new Permissions($conversation);
if ($cnp->canEditConversationPermissions()) {
    if ($_REQUEST['task'] == 'add_access_entity' && Loader::helper("validation/token")->validate('add_access_entity')) {
        $pk = PermissionKey::getByID($_REQUEST['pkID']);
        $pk->setPermissionObject($conversation);
        $pa = PermissionAccess::getByID($_REQUEST['paID'], $pk);
        $pe = PermissionAccessEntity::getByID($_REQUEST['peID']);
        $pd = PermissionDuration::getByID($_REQUEST['pdID']);
        $pa->addListItem($pe, $pd, $_REQUEST['accessType']);
    }
    if ($_REQUEST['task'] == 'remove_access_entity' && Loader::helper("validation/token")->validate('remove_access_entity')) {
        $pk = PermissionKey::getByID($_REQUEST['pkID']);
        $pk->setPermissionObject($conversation);
        $pa = PermissionAccess::getByID($_REQUEST['paID'], $pk);
        $pe = PermissionAccessEntity::getByID($_REQUEST['peID']);
        $pa->removeListItem($pe);
    }
    if ($_REQUEST['task'] == 'save_permission' && Loader::helper("validation/token")->validate('save_permission')) {
        $pk = PermissionKey::getByID($_REQUEST['pkID']);
        $pk->setPermissionObject($conversation);
        $pa = PermissionAccess::getByID($_REQUEST['paID'], $pk);
        $pa->save($_POST);
    }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:31,代码来源:conversation.php

示例4: defined

defined('C5_EXECUTE') or die("Access Denied.");
use Concrete\Core\Conversation\Message\Message as ConversationMessage;
$ax = Loader::helper('ajax');
$vs = Loader::helper('validation/strings');
$ve = Loader::helper('validation/error');
$u = new User();
$pageObj = Page::getByID($_POST['cID']);
$areaObj = Area::get($pageObj, $_POST['blockAreaHandle']);
$blockObj = Block::getByID($_POST['bID'], $pageObj, $areaObj);
$cnvMessageSubject = null;
if (!is_object($blockObj)) {
    $ve->add(t('Invalid Block Object.'));
}
if (Loader::helper('validation/numbers')->integer($_POST['cnvID'])) {
    $cn = Conversation::getByID($_POST['cnvID']);
}
if (!is_object($cn)) {
    $ve->add(t('Invalid conversation.'));
} else {
    $pp = new Permissions($cn);
    if (!$pp->canAddConversationMessage()) {
        $ve->add(t('You do not have access to add a message to this conversation.'));
    }
}
if (!is_object($pageObj)) {
    $ve->add(t('Invalid Page.'));
}
if (!is_object($blockObj)) {
    $ve->add(t('Invalid Page.'));
}
开发者ID:meixelsberger,项目名称:concrete5-5.7.0,代码行数:30,代码来源:add_message.php

示例5: doPreparation

 protected function doPreparation()
 {
     $this->conv = Conversation::getByID($this->int('id'));
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:4,代码来源:conversation.php

示例6: defined

<?php

defined('C5_EXECUTE') or die("Access Denied.");
use Concrete\Core\Conversation\Message\MessageList as ConversationMessageList;
use Concrete\Core\Conversation\Message\ThreadedList as ConversationMessageThreadedList;
$cnv = Conversation::getByID(Request::post('cnvID'));
if (is_object($cnv)) {
    $displayForm = true;
    $enableOrdering = Request::post('enableOrdering') == 1 ? true : false;
    $enablePosting = Request::post('enablePosting') == 1 ? Conversation::POSTING_ENABLED : Conversation::POSTING_DISABLED_MANUALLY;
    $paginate = Request::post('paginate') == 1 ? true : false;
    $enableCommentRating = Request::post('enableCommentRating');
    $cp = new Permissions($cnv);
    if (!$cp->canAddConversationMessage()) {
        $enablePosting = Conversation::POSTING_DISABLED_PERMISSIONS;
    }
    if (in_array(Request::post('displayMode'), array('flat'))) {
        $displayMode = Request::post('displayMode');
    } else {
        $displayMode = 'threaded';
    }
    $addMessageLabel = t('Add Message');
    if (Request::post('addMessageLabel')) {
        $addMessageLabel = Core::make('helper/security')->sanitizeString(Request::post('addMessageLabel'));
    }
    switch (Request::post('task')) {
        case 'get_messages':
            $displayForm = false;
            break;
    }
    switch ($displayMode) {
开发者ID:kreativmind,项目名称:concrete5-5.7.0,代码行数:31,代码来源:view_ajax.php


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