Beispiel #1
0
 /**
  * Returns a friendly title
  */
 public function getFriendlyTitle()
 {
     $result = $this->friendly_title;
     if ($result) {
         return $result;
     }
     // this sometimes happens, prefill with new friendly title
     $result = static_make_friendly_title($this->title);
     return $result;
 }
Beispiel #2
0
<?php

elgg_make_sticky_form('static');
$guid = (int) get_input('guid');
$owner_guid = (int) get_input('owner_guid');
$parent_guid = (int) get_input('parent_guid');
$title = get_input('title');
$friendly_title = get_input('friendly_title', $title);
$friendly_title = static_make_friendly_title($friendly_title, $guid);
$description = get_input('description');
$access_id = (int) get_input('access_id', ACCESS_PUBLIC);
$enable_comments = get_input('enable_comments');
$moderators = get_input('moderators');
$remove_icon = (int) get_input('remove_thumbnail');
if (empty($title) || empty($description)) {
    register_error(elgg_echo('static:action:edit:error:title_description'));
    forward(REFERER);
}
if (empty($friendly_title)) {
    register_error(elgg_echo('static:action:edit:error:friendly_title'));
    forward(REFERER);
}
$owner = get_entity($owner_guid);
if (!elgg_instanceof($owner, 'group')) {
    $owner = elgg_get_site_entity();
}
$can_write = $owner->canWriteToContainer(0, 'object', 'static');
if ($can_write) {
    $ia = elgg_set_ignore_access(true);
}
if ($parent_guid) {