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


PHP Permissions::canFlagConversationMessage方法代码示例

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


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

示例1: foreach

                </thead>
                <tbody>
                <?php 
if (count($messages) > 0) {
    $dh = Core::make('date');
    foreach ($messages as $msg) {
        $cnv = $msg->getConversationObject();
        if (is_object($cnv)) {
            $page = $cnv->getConversationPageObject();
        }
        $msgID = $msg->getConversationMessageID();
        $cnvID = $cnv->getConversationID();
        $p = new Permissions($cnv);
        $author = $msg->getConversationMessageAuthorObject();
        $formatter = $author->getFormatter();
        $displayUnflagOption = $p->canFlagConversationMessage() && $msg->isConversationMessageFlagged();
        $displayUndeleteOption = $p->canDeleteConversationMessage() && $msg->isConversationMessageDeleted();
        $displayApproveOption = $p->canApproveConversationMessage() && (!$msg->isConversationMessageDeleted() && !$msg->isConversationMessageApproved() && !$msg->isConversationMessageFlagged());
        if (!$displayUnflagOption) {
            $displayFlagOption = $p->canFlagConversationMessage() && !$msg->isConversationMessageDeleted();
        }
        $displayDeleteOption = $p->canDeleteConversationMessage() && !$msg->isConversationMessageDeleted();
        ?>
                        <tr>
                            <!-- <td><?php 
        echo $form->checkbox('cnvMessageID[]', $msg->getConversationMessageID());
        ?>
</td> -->
                            <td>
                                <?php 
        echo $dh->formatDateTime(strtotime($msg->getConversationMessageDateTime()));
开发者ID:ceko,项目名称:concrete5-1,代码行数:31,代码来源:messages.php

示例2: unflag_message

 public function unflag_message()
 {
     $e = Core::make('error');
     $message = ConversationMessage::getByID($this->post('cnvMessageID'));
     if (!is_object($message)) {
         $e->add(t('Invalid message'));
     } else {
         $mp = new \Permissions($message);
         if (!$mp->canFlagConversationMessage()) {
             $e->add(t('You do not have permission to flag this message.'));
         }
     }
     $er = new EditResponse($e);
     if (!$e->has()) {
         $spamFlag = ConversationFlagType::getByHandle('spam');
         $message->unflag($spamFlag);
         $er->setMessage(t('Message unflagged.'));
     }
     $er->outputJSON();
 }
开发者ID:ceko,项目名称:concrete5-1,代码行数:20,代码来源:messages.php

示例3: die

<?php

defined('C5_EXECUTE') or die("Access Denied.");
$im = Loader::helper('image');
$mp = new Permissions($message);
$canDeleteMessage = $mp->canDeleteConversationMessage();
$canFlagMessage = $mp->canFlagConversationMessage();
$canEditMessage = $mp->canEditConversationMessage();
$canRateMessage = $mp->canRateConversationMessage();
$ui = $message->getConversationMessageUserObject();
$class = 'message ccm-conversation-message ccm-conversation-message-level' . $message->getConversationMessageLevel();
if ($message->isConversationMessageDeleted()) {
    $class .= ' ccm-conversation-message-deleted';
}
if ($dateFormat == 'custom' && $customDateFormat) {
    $dateFormat = array($customDateFormat);
}
if (!$message->isConversationMessageApproved()) {
    $class .= ' ccm-conversation-message-flagged';
}
$cnvMessageID = $message->getConversationMessageID();
$cnvID = $message->getConversationID();
$c = Page::getByID($_REQUEST['cID']);
$cnvMessageURL = urlencode($c->getCollectionLink(true) . '#cnv' . $cnvID . 'Message' . $cnvMessageID);
if (!$message->isConversationMessageDeleted() && $message->isConversationMessageApproved() || $message->conversationMessageHasActiveChildren()) {
    $author = $message->getConversationMessageAuthorObject();
    $formatter = $author->getFormatter();
    ?>
	<div data-conversation-message-id="<?php 
    echo $message->getConversationMessageID();
    ?>
开发者ID:yakamoz-fang,项目名称:concrete,代码行数:31,代码来源:message.php

示例4: die

<?php

defined('C5_EXECUTE') or die("Access Denied.");
use Concrete\Core\Conversation\Message\Message as ConversationMessage;
use Concrete\Core\Conversation\FlagType\FlagType as ConversationFlagType;
$ax = Loader::helper('ajax');
$vs = Loader::helper('validation/strings');
$ve = Loader::helper('validation/error');
$as = Loader::helper('validation/antispam');
if (Loader::helper('validation/numbers')->integer($_POST['cnvMessageID']) && $_POST['cnvMessageID'] > 0) {
    $message = ConversationMessage::getByID($_POST['cnvMessageID']);
    if (is_object($message)) {
        $mp = new Permissions($message);
        if ($mp->canFlagConversationMessage()) {
            $flagtype = ConversationFlagType::getByHandle('spam');
            $message->flag($flagtype);
            $message->unapprove();
            $as->report($message->getConversationMessageBody(), $message->getConversationMessageUserObject(), $message->getConversationMessageSubmitIP(), $message->getConversationMessageSubmitUserAgent());
            Loader::element('conversation/message', array('message' => $message));
        }
    }
}
开发者ID:meixelsberger,项目名称:concrete5-5.7.0,代码行数:22,代码来源:flag_message.php


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