本文整理汇总了PHP中Permissions::canDeleteConversationMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP Permissions::canDeleteConversationMessage方法的具体用法?PHP Permissions::canDeleteConversationMessage怎么用?PHP Permissions::canDeleteConversationMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Permissions
的用法示例。
在下文中一共展示了Permissions::canDeleteConversationMessage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
<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()));
?>
示例2: undelete_message
public function undelete_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->canDeleteConversationMessage()) {
$e->add(t('You do not have permission to restore this message.'));
}
}
$er = new EditResponse($e);
if (!$e->has()) {
$message->restore();
$er->setMessage(t('Message restored.'));
}
$er->outputJSON();
}
示例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();
?>
示例4: die
<?php
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');
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->canDeleteConversationMessage()) {
$message->delete();
$r = Request::getInstance();
$types = $r->getAcceptableContentTypes();
if ($types[0] == 'application/json') {
$r = new \Concrete\Core\Application\EditResponse();
$r->setMessage(t('Message deleted successfully.'));
$r->outputJSON();
} else {
Loader::element('conversation/message', array('message' => $message));
}
}
}
}