當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。