本文整理汇总了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);
}
示例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();
}
示例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);