• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP get_default_access函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_default_access函数的典型用法代码示例。如果您正苦于以下问题:PHP get_default_access函数的具体用法?PHP get_default_access怎么用?PHP get_default_access使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: process_page

function process_page(ElggObject $page)
{
    $tags_to_groups = array('ib' => 10113262, 'inkomstenbelasting' => 10113262, 'ob' => 12967492, 'btw' => 12967492, 'omzetbelasting' => 12967492, 'lh' => 10112672, 'loonheffingen' => 10112672, 'open forum' => 7746192, 'toeslagen' => 7746232, 'Toeslagen' => 7746232, 'vennootschapsbelasting' => 7746292);
    $container_guid = false;
    if (!$page->tags) {
        return;
    }
    if (!is_array($page->tags)) {
        $tags = array($page->tags);
    } else {
        $tags = $page->tags;
    }
    foreach ($tags_to_groups as $tag => $group_guid) {
        if (in_array($tag, $tags)) {
            $container_guid = $group_guid;
            continue;
        }
    }
    $news = new ElggObject();
    $news->subtype = "news";
    $news->title = $page->title;
    $news->description = $page->description;
    $news->tags = $page->tags;
    $news->owner_guid = $page->owner_guid;
    $news->container_guid = $container_guid;
    $news->access_id = get_default_access();
    $news->save();
    $news->time_created = $page->time_created;
    $news->time_updated = $page->time_updated;
    $news->save();
}
开发者ID:pleio,项目名称:rijkshuisstijl,代码行数:31,代码来源:ffd-copy-news.php


示例2: createWidget

 /**
  * @see elgg_create_widget
  * @access private
  * @since 1.9.0
  */
 public function createWidget($owner_guid, $handler, $context, $access_id = null)
 {
     if (empty($owner_guid) || empty($handler) || !$this->validateType($handler)) {
         return false;
     }
     $owner = get_entity($owner_guid);
     if (!$owner) {
         return false;
     }
     $widget = new \ElggWidget();
     $widget->owner_guid = $owner_guid;
     $widget->container_guid = $owner_guid;
     // @todo - will this work for group widgets?
     if (isset($access_id)) {
         $widget->access_id = $access_id;
     } else {
         $widget->access_id = get_default_access();
     }
     if (!$widget->save()) {
         return false;
     }
     // private settings cannot be set until \ElggWidget saved
     $widget->handler = $handler;
     $widget->context = $context;
     return $widget->getGUID();
 }
开发者ID:cyrixhero,项目名称:Elgg,代码行数:31,代码来源:WidgetsService.php


示例3: getSite

 static function getSite($a, $args, $c)
 {
     $site = elgg_get_site_entity();
     $accessIds = [];
     foreach (get_write_access_array() as $id => $description) {
         $accessIds[] = ["id" => $id, "description" => $description];
     }
     return ["guid" => $site->guid, "title" => $site->title, "menu" => [["guid" => "menu:" . 1, "title" => "Blog", "link" => "/blog", "js" => true], ["guid" => "menu:" . 2, "title" => "Nieuws", "link" => "/news", "js" => true], ["guid" => "menu:" . 3, "title" => "Forum", "link" => "/forum", "js" => true]], "accessIds" => $accessIds, "defaultAccessId" => get_default_access()];
 }
开发者ID:pleio,项目名称:rijkshuisstijl,代码行数:9,代码来源:Resolver.php


示例4: profile_river_updates

function profile_river_updates($event, $type, $object)
{
    $user = get_entity($object->guid);
    if ($user instanceof ElggUser) {
        $view = 'river/user/default/profileupdate';
        elgg_delete_river(array('subject_guid' => $user->guid, 'view' => $view));
        elgg_create_river_item(array('view' => $view, 'action_type' => 'update', 'subject_guid' => $user->guid, 'object_guid' => $user->guid, 'access_id' => get_default_access($user)));
    }
    return true;
}
开发者ID:iionly,项目名称:profile_river_updates,代码行数:10,代码来源:start.php


示例5: put

 /**
  * {@inheritdoc}
  */
 public function put(ParameterBag $params)
 {
     $owner = get_entity($params->guid);
     if (!$owner->canEdit()) {
         throw new GraphException("You are not allowed to modify this user's profile", HttpResponse::HTTP_FORBIDDEN);
     }
     $profile_fields = (array) elgg_get_config('profile_fields');
     $access_id = $params->access_id !== null ? $params->access_id : get_default_access($owner);
     $input = array();
     foreach ($profile_fields as $field => $valuetype) {
         // Making sure the consumer has sent these fields with the request
         if (isset($params->{$field}) && $this->request->get($field) !== null) {
             $value = $params->{$field};
             $value = _elgg_html_decode($value);
             if (!is_array($value) && $valuetype != 'longtext' && elgg_strlen($value) > 250) {
                 throw new GraphException(elgg_echo('profile:field_too_long', array(elgg_echo("profile:{$field}")), HttpResponse::HTTP_BAD_REQUEST));
             }
             if ($value && $valuetype == 'url' && !preg_match('~^https?\\://~i', $value)) {
                 $value = "http://{$value}";
             }
             if ($valuetype == 'tags') {
                 $value = string_to_tag_array($value);
             }
             if ($valuetype == 'email' && !empty($value) && !is_email_address($value)) {
                 throw new GraphException(elgg_echo('profile:invalid_email', array(elgg_echo("profile:{$field}"))), HttpResponse::HTTP_BAD_REQUEST);
             }
             $input[$field] = $value;
         }
     }
     // go through custom fields
     if (sizeof($input) > 0) {
         foreach ($input as $shortname => $value) {
             $options = array('guid' => $owner->guid, 'metadata_name' => $shortname, 'limit' => false);
             elgg_delete_metadata($options);
             if (!is_null($value) && $value !== '') {
                 // only create metadata for non empty values (0 is allowed) to prevent metadata records
                 // with empty string values #4858
                 if (is_array($value)) {
                     $i = 0;
                     foreach ($value as $interval) {
                         $i++;
                         $multiple = $i > 1 ? TRUE : FALSE;
                         create_metadata($owner->guid, $shortname, $interval, 'text', $owner->guid, $access_id, $multiple);
                     }
                 } else {
                     create_metadata($owner->getGUID(), $shortname, $value, 'text', $owner->getGUID(), $access_id);
                 }
             }
         }
         $owner->save();
         // Notify of profile update
         elgg_trigger_event('profileupdate', $owner->type, $owner);
     }
     return $this->get($params);
 }
开发者ID:hypejunction,项目名称:hypegraph,代码行数:58,代码来源:UserProfile.php


示例6: put

 /**
  * {@inheritdoc}
  */
 public function put(ParameterBag $params)
 {
     $action = new SavePost();
     $action->post = get_entity($params->guid);
     $action->poster = $action->post ? $action->post->getOwnerEntity() : elgg_get_logged_in_user_entity();
     $action->container = $action->post ? $action->post->getContainerEntity() : $action->poster;
     $action->subtype = Post::SUBTYPE;
     if ($action->post) {
         foreach (array('status', 'address', 'location', 'access_id', 'tags') as $key) {
             if ($params->{$key} === null) {
                 $params->{$key} = $action->post->{$key};
             }
         }
     }
     $action->status = $params->status;
     $action->address = $params->address;
     $action->location = $params->location;
     $action->tags = $params->tags;
     $action->friend_guids = array();
     $action->upload_guids = array();
     $action->attachment_guids = array();
     $action->make_bookmark = $params->make_bookmark && !$action->post;
     $action->access_id = isset($params->access_id) ? $params->access_id : get_default_access($action->poster);
     $friend_uids = (array) $params->friend_uids;
     foreach ($friend_uids as $uid) {
         $action->friend_guids[] = $this->graph->get($uid)->guid;
     }
     $attachment_uids = (array) $params->attachment_uids;
     foreach ($attachment_uids as $uid) {
         $action->attachment_guids[] = $this->graph->get($uid)->guid;
     }
     $upload_uids = (array) $params->upload_uids;
     foreach ($upload_uids as $uid) {
         $upload = $this->graph->get($uid);
         if ($upload && $upload->origin == 'graph' && $upload->access_id == ACCESS_PRIVATE) {
             $action->upload_guids[] = $upload->guid;
         } else {
             hypeGraph()->logger->log("Can not use node {$uid} as upload. Only resources uploaded via Graph API with private access can be attached.", "ERROR");
         }
     }
     try {
         if ($action->validate() !== false) {
             $action->execute();
         }
         if (!$action->post) {
             throw new \Exception(implode(', ', $action->getResult()->getErrors()));
         }
     } catch (\Exception $ex) {
         throw new GraphException($ex->getMessage());
     }
     return ['nodes' => [$action->post, $action->river, $action->bookmark]];
 }
开发者ID:hypejunction,项目名称:hypegraph,代码行数:55,代码来源:Wall.php


示例7: follow_tags_save_follow_tags

/**
 * Save FollowTags
 *
 */
function follow_tags_save_follow_tags($input, $id, $notify)
{
    // Get FollowTagObject and Delete all Tag Relationships
    $user = elgg_get_logged_in_user_entity();
    $access_id = get_default_access($user);
    $followTags = get_entity($id);
    if ($followTags->getSubtype() == 'FollowTags') {
        $followTags->deleteRelationships();
        $followTags->description = $input;
        $followTags->title = $user->name;
        $followTags->access_id = $access_id;
        // Convert the Taginput string to array and save to FollowTagObj
        $tagarray = string_to_tag_array($input);
        $followTags->tags = $tagarray;
        $saved = $followTags->save();
    }
    if (!$saved) {
        return false;
    }
    return true;
}
开发者ID:centillien,项目名称:follow_tags,代码行数:25,代码来源:functions.php


示例8: elgg_extract

<?php

$question = elgg_extract('entity', $vars);
$show_group_selector = (bool) elgg_extract('show_group_selector', $vars, true);
$editing = true;
$container_options = false;
$show_access_options = true;
$access_setting = false;
if (!$question) {
    $editing = false;
    $question = new ElggQuestion();
    $question->container_guid = elgg_get_page_owner_guid();
    $question->access_id = get_default_access(null, ['entity_type' => $question->getType(), 'entity_subtype' => $question->getSubtype(), 'container_guid' => $question->getContainerGUID()]);
}
$container = $question->getContainerEntity();
$title = ['name' => 'title', 'id' => 'question_title', 'value' => elgg_get_sticky_value('question', 'title', $question->title), 'required' => true];
$description = ['name' => 'description', 'id' => 'question_description', 'value' => elgg_get_sticky_value('question', 'description', $question->description)];
$tags = ['name' => 'tags', 'id' => 'question_tags', 'value' => elgg_get_sticky_value('question', 'tags', $question->tags)];
$comment_options = ['name' => 'comments_enabled', 'id' => 'questions-comments', 'value' => elgg_get_sticky_value('question', 'comments_enabled', $question->comments_enabled), 'options_values' => ['on' => elgg_echo('on'), 'off' => elgg_echo('off')], 'class' => 'mls'];
if ($container instanceof ElggUser) {
    $access_setting = questions_get_personal_access_level();
    if ($access_setting !== false) {
        $show_access_options = false;
    }
} elseif ($container instanceof ElggGroup) {
    $access_setting = questions_get_group_access_level($container);
    if ($access_setting !== false) {
        $show_access_options = false;
    }
}
$access_id = ['name' => 'access_id', 'id' => 'question_access_id', 'value' => (int) elgg_get_sticky_value('question', 'access_id', $question->access_id)];
开发者ID:epsylon,项目名称:Hydra-dev,代码行数:31,代码来源:save.php


示例9: elgg_extract

<?php

/**
 * Save album form body
 *
 * @author Cash Costello
 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2
 */
$title = elgg_extract('title', $vars, '');
$description = elgg_extract('description', $vars, '');
$tags = elgg_extract('tags', $vars, '');
$access_id = elgg_extract('access_id', $vars, get_default_access());
$container_guid = elgg_extract('container_guid', $vars, elgg_get_page_owner_guid());
$guid = elgg_extract('guid', $vars, 0);
?>

<div>
	<label><?php 
echo elgg_echo('album:title');
?>
</label>
	<?php 
echo elgg_view('input/text', array('name' => 'title', 'value' => $title));
?>
</div>
<div>
	<label><?php 
echo elgg_echo('album:desc');
?>
</label>
	<?php 
开发者ID:pingwangcs,项目名称:51zhaohu,代码行数:31,代码来源:save.php


示例10: foreach

    }
}
// go through custom fields
if (sizeof($input) > 0) {
    foreach ($input as $shortname => $value) {
        remove_metadata($profile_owner->guid, $shortname);
        if (isset($accesslevel[$shortname])) {
            $access_id = (int) $accesslevel[$shortname];
        } else {
            // this should never be executed since the access level should always be set
            $access_id = ACCESS_DEFAULT;
        }
        if (is_array($value)) {
            $i = 0;
            foreach ($value as $interval) {
                $i++;
                $multiple = $i > 1 ? TRUE : FALSE;
                create_metadata($profile_owner->guid, $shortname, $interval, 'text', $profile_owner->guid, $access_id, $multiple);
            }
        } else {
            create_metadata($profile_owner->getGUID(), $shortname, $value, 'text', $profile_owner->getGUID(), $access_id);
        }
    }
    $profile_owner->save();
    // Notify of profile update
    trigger_elgg_event('profileupdate', $user->type, $user);
    //add to river
    add_to_river('river/user/default/profileupdate', 'update', $_SESSION['user']->guid, $_SESSION['user']->guid, get_default_access($_SESSION['user']));
    system_message(elgg_echo("profile:saved"));
}
forward($profile_owner->getUrl());
开发者ID:adamboardman,项目名称:Elgg,代码行数:31,代码来源:edit.php


示例11: subsite_manager_set_missing_subsite_profile_fields

function subsite_manager_set_missing_subsite_profile_fields($user_guid = 0)
{
    $result = false;
    $accesslevel = get_input('accesslevel');
    elgg_make_sticky_form("subsite_missing_profile_fields");
    if (empty($user_guid)) {
        $user_guid = elgg_get_logged_in_user_guid();
    }
    if (!empty($user_guid) && ($user = get_user($user_guid))) {
        $form_vars = elgg_get_sticky_values("subsite_missing_profile_fields");
        $profile_fields = array();
        // filter the input
        foreach ($form_vars as $key => $value) {
            if (strpos($key, "custom_profile_fields_") === 0) {
                $key = substr($key, 22);
                $profile_fields[$key] = $value;
            }
        }
        if (!empty($profile_fields)) {
            foreach ($profile_fields as $key => $value) {
                remove_metadata($user->getGUID(), $key);
                if (!empty($value)) {
                    if ($accesslevel && array_key_exists($key, $accesslevel)) {
                        $access_id = $accesslevel[$key];
                    } else {
                        $access_id = get_default_access($user);
                    }
                    if (is_array($value)) {
                        foreach ($value as $index => $v) {
                            $multiple = false;
                            if ($index > 0) {
                                $multiple = true;
                            }
                            create_metadata($user->getGUID(), $key, $v, "text", $user->getGUID(), $access_id, $multiple);
                        }
                    } else {
                        create_metadata($user->getGUID(), $key, $value, "text", $user->getGUID(), $access_id);
                    }
                }
            }
            // in javascript we trust ;)
            $result = true;
        } else {
            $result = true;
        }
    }
    return $result;
}
开发者ID:pleio,项目名称:subsite_manager,代码行数:48,代码来源:functions.php


示例12: addEntity

 static function addEntity($input)
 {
     if (!in_array($input["type"], array("group", "object"))) {
         throw new Exception("invalid_type");
     }
     switch ($input["type"]) {
         case "group":
             $entity = new \ElggGroup();
             $entity->name = $input["name"];
         case "object":
             if (!in_array($input["subtype"], array("news", "comment"))) {
                 throw new Exception("invalid_subtype");
             }
             $entity = new \ElggObject();
             $entity->title = $input["title"];
             $entity->subtype = $input["subtype"];
         default:
             $entity->description = $input["description"];
             $entity->access_id = (int) $input["accessId"] || get_default_access();
             $entity->tags = $input["tags"];
             if ((int) $input["containerGuid"]) {
                 $entity->container_guid = (int) $input["containerGuid"];
             }
     }
     $result = $entity->save();
     if ($result) {
         return ["guid" => $entity->guid];
     }
     throw new Exception("could_not_save");
 }
开发者ID:pleio,项目名称:rijkshuisstijl,代码行数:30,代码来源:Mutations.php


示例13: elgg_view

</div>

<div class="elgg-field">
	<?php 
echo '<label>' . elgg_view('input/checkbox', array('name' => 'show_once', 'value' => 1, 'default' => false, 'checked' => (bool) $entity->show_once)) . elgg_echo('modal_info:show_once') . '</label>';
?>
</div>

<div class="elgg-field">
	<?php 
echo '<label>' . elgg_view('input/checkbox', array('name' => 'can_dismiss', 'value' => 1, 'default' => false, 'checked' => (bool) $entity->can_dismiss)) . elgg_echo('modal_info:can_dismiss') . '</label>';
?>
</div>

<div class="elgg-field">
	<label><?php 
echo elgg_echo('access');
?>
</label>
	<?php 
echo elgg_view('input/access', array('name' => 'access_id', 'value' => $entity->access_id ?: get_default_access(), 'required' => true));
?>
</div>

<div class="elgg-field elgg-foot">
	<?php 
echo elgg_view('input/hidden', array('name' => 'guid', 'value' => $entity->guid));
echo elgg_view('input/hidden', array('name' => 'container_guid', 'value' => $container->guid));
echo elgg_view('input/submit', array('value' => elgg_echo('save')));
?>
</div>
开发者ID:hypeJunction,项目名称:Elgg-modal_info,代码行数:31,代码来源:edit.php


示例14: defaultwidgets_reset_access

function defaultwidgets_reset_access($event, $object_type, $object)
{
    global $defaultwidget_access;
    // turn on permissions override
    $defaultwidget_access = true;
    // the widgets are disabled, so turn on the ability to see disabled entities
    $access_status = access_get_show_hidden_status();
    access_show_hidden_entities(true);
    $widgets = get_entities('object', 'widget', $object->getGUID());
    if ($widgets) {
        foreach ($widgets as $widget) {
            $widget->access_id = get_default_access();
            $widget->save();
        }
    }
    access_show_hidden_entities($access_status);
    // turn off permissions override
    $defaultwidget_access = false;
    return true;
}
开发者ID:eokyere,项目名称:elgg,代码行数:20,代码来源:start.php


示例15: foreach

                if (!empty($metadata_value) || $metadata_value === 0) {
                    if (!empty($use_default_access)) {
                        // use create_metadata to listen to ACCESS_DEFAULT
                        if (is_array($metadata_value)) {
                            $i = 0;
                            foreach ($metadata_value as $interval) {
                                $i++;
                                if ($i == 1) {
                                    $multiple = false;
                                } else {
                                    $multiple = true;
                                }
                                create_metadata($new_user->guid, $metadata_name, $interval, 'text', $new_user->guid, get_default_access($new_user), $multiple);
                            }
                        } else {
                            create_metadata($new_user->guid, $metadata_name, $metadata_value, 'text', $new_user->guid, get_default_access($new_user));
                        }
                    } else {
                        $new_user->{$metadata_name} = $metadata_value;
                    }
                }
            }
        }
        system_message(elgg_echo("adduser:ok", array(elgg_get_site_entity()->name)));
    } else {
        register_error(elgg_echo("adduser:bad"));
    }
} catch (RegistrationException $r) {
    register_error($r->getMessage());
}
forward(REFERER);
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:31,代码来源:useradd.php


示例16: elgg_extract

<?php

$entity = elgg_extract("entity", $vars);
if (!empty($entity)) {
    $title = elgg_get_sticky_value("newsletter_edit", "title", $entity->title);
    $subject = elgg_get_sticky_value("newsletter_edit", "subject", $entity->subject);
    $description = elgg_get_sticky_value("newsletter_edit", "description", $entity->description);
    $access_id = (int) elgg_get_sticky_value("newsletter_edit", "access_id", $entity->access_id);
    $tags = elgg_get_sticky_value("newsletter_edit", "tags", $entity->tags);
    echo elgg_view("input/hidden", array("name" => "guid", "value" => $entity->getGUID()));
    $container_guid = $entity->container_guid;
} else {
    $title = elgg_get_sticky_value("newsletter_edit", "title");
    $subject = elgg_get_sticky_value("newsletter_edit", "subject");
    $description = elgg_get_sticky_value("newsletter_edit", "description");
    $access_id = (int) elgg_get_sticky_value("newsletter_edit", "access_id", get_default_access());
    $tags = elgg_get_sticky_value("newsletter_edit", "tags");
    $container_guid = (int) elgg_extract("container_guid", $vars);
}
elgg_clear_sticky_form("newsletter_edit");
echo "<div>";
echo "<label for='newsletter-title'>" . elgg_echo("title") . "</label>";
echo elgg_view("input/text", array("name" => "title", "value" => $title, "id" => "newsletter-title"));
echo "</div>";
echo "<div>";
echo "<label for='newsletter-subject'>" . elgg_echo("newsletter:edit:subject") . "</label>";
echo elgg_view("input/text", array("name" => "subject", "value" => $subject, "id" => "newsletter-subject"));
echo "</div>";
echo "<div>";
echo "<label for='newsletter-description'>" . elgg_echo("description") . "</label>";
echo elgg_view("input/longtext", array("name" => "description", "value" => $description, "id" => "newsletter-description"));
开发者ID:pleio,项目名称:newsletter,代码行数:31,代码来源:edit.php


示例17: elgg_echo

        <?php 
}
?>
    </div>
</div><br />

<div>
    <label for="tags"><?php 
echo elgg_echo("tags");
?>
</label><br />
    <?php 
echo elgg_view('input/tags', array('name' => 'tags', 'value' => elgg_get_sticky_value('news', 'tags', $entity->tags)));
?>
</div><br />

<div>
    <label for="tags"><?php 
echo elgg_echo("access");
?>
</label><br />
    <?php 
echo elgg_view('input/access', array('name' => 'access_id', 'value' => $entity->access_id ? $entity->access_id : get_default_access()));
?>
</div><br />

<?php 
echo elgg_view("input/submit", array('value' => $entity ? elgg_echo('edit') : elgg_echo('add')));
if ($entity) {
    echo elgg_view("output/confirmlink", array('text' => elgg_echo('delete'), 'href' => '/action/news/delete?guid=' . $entity->guid, 'class' => 'elgg-button elgg-button-delete', 'is_action' => true));
}
开发者ID:pleio,项目名称:news,代码行数:31,代码来源:edit.php


示例18: profile_manager_create_user_event

/**
 * function to add custom profile fields to user on register
 * 
 * @param $event
 * @param $object_type
 * @param $object
 * @return unknown_type
 */
function profile_manager_create_user_event($event, $object_type, $object)
{
    $custom_profile_fields = array();
    // retrieve all field that were on the register page
    foreach ($_POST as $key => $value) {
        if (strpos($key, "custom_profile_fields_") === 0) {
            $key = substr($key, 22);
            $custom_profile_fields[$key] = get_input("custom_profile_fields_" . $key);
        }
    }
    if (count($custom_profile_fields) > 0) {
        $categorized_fields = profile_manager_get_categorized_fields(null, true, true);
        $configured_fields = $categorized_fields['fields'];
        // set ignore access
        $ia = elgg_get_ignore_access();
        elgg_set_ignore_access(true);
        foreach ($custom_profile_fields as $shortname => $value) {
            // determine if $value should be an array
            if (!is_array($value) && !empty($configured_fields)) {
                // only do something if it not is already an array
                foreach ($configured_fields as $configured_field) {
                    if ($configured_field->metadata_name == $shortname) {
                        if ($configured_field->metadata_type == "tags" || $configured_field->output_as_tags == "yes") {
                            $value = string_to_tag_array($value);
                            // no need to continue this foreach
                            break;
                        }
                    }
                }
            }
            // use create_metadata to listen to default access
            if (is_array($value)) {
                $i = 0;
                foreach ($value as $interval) {
                    $i++;
                    if ($i == 1) {
                        $multiple = false;
                    } else {
                        $multiple = true;
                    }
                    create_metadata($object->guid, $shortname, $interval, 'text', $object->guid, get_default_access($object), $multiple);
                }
            } else {
                create_metadata($object->guid, $shortname, $value, 'text', $object->guid, get_default_access($object));
            }
        }
        // restore ignore access
        elgg_set_ignore_access($ia);
    }
    if (isset($_FILES["profile_icon"])) {
        add_profile_icon($object);
    }
}
开发者ID:remy40,项目名称:gvrs,代码行数:61,代码来源:events.php


示例19: array

<?php

// defaults
$fields = array("guid" => ELGG_ENTITIES_ANY_VALUE, "title" => ELGG_ENTITIES_ANY_VALUE, "shortdescription" => ELGG_ENTITIES_ANY_VALUE, "tags" => ELGG_ENTITIES_ANY_VALUE, "description" => ELGG_ENTITIES_ANY_VALUE, "comments_on" => 1, "venue" => ELGG_ENTITIES_ANY_VALUE, "location" => ELGG_ENTITIES_ANY_VALUE, "latitude" => ELGG_ENTITIES_ANY_VALUE, "longitude" => ELGG_ENTITIES_ANY_VALUE, "region" => ELGG_ENTITIES_ANY_VALUE, "event_type" => ELGG_ENTITIES_ANY_VALUE, "website" => ELGG_ENTITIES_ANY_VALUE, "contact_details" => ELGG_ENTITIES_ANY_VALUE, "fee" => ELGG_ENTITIES_ANY_VALUE, "twitter_hash" => ELGG_ENTITIES_ANY_VALUE, "organizer" => ELGG_ENTITIES_ANY_VALUE, "organizer_rsvp" => 0, "start_day" => date(EVENT_MANAGER_FORMAT_DATE_EVENTDAY, time()), "end_day" => ELGG_ENTITIES_ANY_VALUE, "start_time" => time(), "end_ts" => time() + 3600, "registration_ended" => ELGG_ENTITIES_ANY_VALUE, "endregistration_day" => ELGG_ENTITIES_ANY_VALUE, "with_program" => ELGG_ENTITIES_ANY_VALUE, "registration_needed" => ELGG_ENTITIES_ANY_VALUE, "register_nologin" => ELGG_ENTITIES_ANY_VALUE, "show_attendees" => 1, "hide_owner_block" => ELGG_ENTITIES_ANY_VALUE, "notify_onsignup" => ELGG_ENTITIES_ANY_VALUE, "max_attendees" => ELGG_ENTITIES_ANY_VALUE, "waiting_list_enabled" => ELGG_ENTITIES_ANY_VALUE, "access_id" => get_default_access(), "container_guid" => elgg_get_page_owner_entity()->getGUID(), "event_interested" => 0, "event_presenting" => 0, "event_exhibiting" => 0, "event_organizing" => 0, "registration_completed" => ELGG_ENTITIES_ANY_VALUE);
//check to see if event belongs to a group
$container_entity = get_entity($fields['container_guid']);
if (elgg_instanceof($container_entity, "group")) {
    if ($access_id = -1) {
        $fields['access_id'] = $container_entity->group_acl;
    }
}
$region_options = event_manager_event_region_options();
$type_options = event_manager_event_type_options();
if ($event = $vars['entity']) {
    // edit mode
    $fields["guid"] = $event->getGUID();
    $fields["location"] = $event->getLocation();
    $fields["latitude"] = $event->getLatitude();
    $fields["longitude"] = $event->getLongitude();
    $fields["tags"] = string_to_tag_array($event->tags);
    if ($event->icontime) {
        $currentIcon = '<img src="' . $event->getIcon() . '" />';
    }
    foreach ($fields as $field => $value) {
        if (!in_array($field, array("guid", "location", "latitude", "longitude"))) {
            $fields[$field] = $event->{$field};
        }
    }
    // convert timestamp to date notation for correct display
    if (!empty($fields["start_day"])) {
        $fields["start_day"] = date(EVENT_MANAGER_FORMAT_DATE_EVENTDAY, $fields["start_day"]);
开发者ID:amcfarlane1251,项目名称:ongarde,代码行数:31,代码来源:edit.php


示例20: form_get_data_for_profile_edit_form

function form_get_data_for_profile_edit_form($form, $entity = null, $group_profile_category = '')
{
    if ($entity) {
        $data = form_get_data_from_profile($form->getGUID(), $entity);
    } else {
        if ($group_profile_category) {
            $item = new stdClass();
            $item->name = 'group_profile_category';
            $item->value = $group_profile_category;
            $data = array('group_profile_category' => $item);
        }
    }
    $tab_data = array();
    $tabs = form_display_by_tab($form, $data, true);
    if ($tabs) {
        foreach ($tabs as $tab => $tab_items) {
            $tab_data[$tab] = '';
            foreach ($tab_items as $item) {
                if ($entity instanceof ElggUser) {
                    // add access control pulldowns
                    $internalname = $item->internalname;
                    if (isset($data[$internalname])) {
                        $access_id = $data[$internalname]->access_id;
                    } else {
                        if ($item->default_access || $item->default_access === 0) {
                            $access_id = $item->default_access;
                        } else {
                            $access_id = get_default_access();
                        }
                    }
                    $access_bit = '<p class="form-field-access">';
                    $access_bit .= elgg_view('input/access', array('internalname' => 'flexprofile_access[' . $internalname . ']', 'value' => $access_id));
                    $access_bit .= '</p>';
                } else {
                    $access_bit = '';
                }
                $tab_data[$tab] .= $item->html . $access_bit;
            }
        }
    }
    return $tab_data;
}
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:42,代码来源:profile.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_default_area函数代码示例发布时间:2022-05-15
下一篇:
PHP get_default函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap