當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ElggObject::canEdit方法代碼示例

本文整理匯總了PHP中ElggObject::canEdit方法的典型用法代碼示例。如果您正苦於以下問題:PHP ElggObject::canEdit方法的具體用法?PHP ElggObject::canEdit怎麽用?PHP ElggObject::canEdit使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ElggObject的用法示例。


在下文中一共展示了ElggObject::canEdit方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: canEdit

 /**
  * Allow non user to remove their registration correctly
  *
  * {@inheritdoc}
  */
 public function canEdit($user_guid = 0)
 {
     global $EVENT_MANAGER_UNDO_REGISTRATION;
     if (!empty($EVENT_MANAGER_UNDO_REGISTRATION)) {
         return true;
     }
     return parent::canEdit($user_guid);
 }
開發者ID:coldtrick,項目名稱:event_manager,代碼行數:13,代碼來源:EventRegistration.php

示例2: threads_create

function threads_create($guid, $params)
{
    if (empty($guid)) {
        $topic = new ElggObject();
        $topic->subtype = 'groupforumtopic';
    } else {
        // load original file object
        $topic = new ElggObject($guid);
        if (!$topic || !$topic->canEdit()) {
            register_error(elgg_echo('discussion:topic:notfound'));
            forward(REFERER);
        }
    }
    // save parameters
    foreach ($params as $key => $value) {
        $topic->{$key} = $value;
    }
    return $topic->save();
}
開發者ID:xingcuntian,項目名稱:threads,代碼行數:19,代碼來源:threads.php

示例3: forward

if (!$container || !$container->canWriteToContainer(0, 'object', 'groupforumtopic')) {
    register_error(elgg_echo('discussion:error:permissions'));
    forward(REFERER);
}
// check whether this is a new topic or an edit
$new_topic = true;
if ($guid > 0) {
    $new_topic = false;
}
if ($new_topic) {
    $topic = new ElggObject();
    $topic->subtype = 'groupforumtopic';
} else {
    // load original file object
    $topic = new ElggObject($guid);
    if (!$topic || !$topic->canEdit()) {
        register_error(elgg_echo('discussion:topic:notfound'));
        forward(REFERER);
    }
}
$topic->title = $title;
$topic->description = $desc;
$topic->status = $status;
$topic->access_id = $access_id;
$topic->container_guid = $container_guid;
$tags = explode(",", $tags);
$topic->tags = $tags;
$result = $topic->save();
if (!$result) {
    register_error(elgg_echo('discussion:error:notsaved'));
    forward(REFERER);
開發者ID:duanhv,項目名稱:mdg-social,代碼行數:31,代碼來源:save.php


注:本文中的ElggObject::canEdit方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。