/** * Pull together variables for the save form * * @param Pool $entity Pool object * @return array $values Array of form values */ function pool_prepare_form_vars($entity = null) { $values = array('guid' => null, 'title' => null, 'description' => null, 'interval' => null, 'interval_time' => null, 'time' => null, 'access_id' => null, 'owner_guid' => null, 'container_guid' => null); if ($entity) { foreach ($values as $name => $value) { $values[$name] = $entity->{$name}; } } if (elgg_is_sticky_form('task_pool')) { $sticky_values = elgg_get_sticky_values('task_pool'); foreach ($sticky_values as $key => $value) { $values[$key] = $value; } } elgg_clear_sticky_form('task_pool'); return $values; }
/** * Prepares variables for the group edit form view. * * @param mixed $group ElggGroup or null. If a group, uses values from the group. * @return array */ function groups_prepare_form_vars($group = null) { $values = array('name' => '', 'membership' => ACCESS_PUBLIC, 'vis' => ACCESS_PUBLIC, 'guid' => null, 'entity' => null, 'owner_guid' => elgg_get_logged_in_user_guid(), 'content_access_mode' => ElggGroup::CONTENT_ACCESS_MODE_UNRESTRICTED); // handle customizable profile fields $fields = elgg_get_config('group'); if ($fields) { foreach ($fields as $name => $type) { $values[$name] = ''; } } // handle tool options $tools = elgg_get_config('group_tool_options'); if ($tools) { foreach ($tools as $group_option) { $option_name = $group_option->name . "_enable"; $values[$option_name] = $group_option->default_on ? 'yes' : 'no'; } } // get current group settings if ($group) { foreach (array_keys($values) as $field) { if (isset($group->{$field})) { $values[$field] = $group->{$field}; } } if ($group->access_id != ACCESS_PUBLIC && $group->access_id != ACCESS_LOGGED_IN) { // group only access - this is done to handle access not created when group is created $values['vis'] = ACCESS_PRIVATE; } else { $values['vis'] = $group->access_id; } // The content_access_mode was introduced in 1.9. This method must be // used for backwards compatibility with groups created before 1.9. $values['content_access_mode'] = $group->getContentAccessMode(); $values['entity'] = $group; } // get any sticky form settings if (elgg_is_sticky_form('groups')) { $sticky_values = elgg_get_sticky_values('groups'); foreach ($sticky_values as $key => $value) { $values[$key] = $value; } } elgg_clear_sticky_form('groups'); return $values; }
/** * Pull together variables for the save form * * @param ElggEntity $schedule * @return array $values */ function scheduling_prepare_form_vars(ElggEntity $schedule = null) { $values = array('guid' => 0, 'title' => '', 'description' => '', 'owner_guid' => elgg_get_logged_in_user_guid(), 'container_guid' => 0, 'access_id' => ACCESS_PUBLIC); if ($schedule) { foreach ($values as $field => $value) { if (isset($schedule->{$field})) { $values[$field] = $schedule->{$field}; } } } if (elgg_is_sticky_form('scheduling')) { $sticky_values = elgg_get_sticky_values('scheduling'); foreach ($sticky_values as $key => $value) { $values[$key] = $value; } } elgg_clear_sticky_form('scheduling'); return $values; }
/** * Prepare the group settings form variables * * @param ElggObject $group A group object. * @return array */ function markdown_wiki_group_settings_prepare_form_vars($group = null) { $values = array('markdown_wiki_all_enabled' => get_input('markdown_wiki_all_enabled', false)); if ($group) { foreach (array_keys($values) as $field) { if (isset($group->{$field})) { $values[$field] = $group->{$field}; } } } if (elgg_is_sticky_form('markdown_wiki_settings')) { $sticky_values = elgg_get_sticky_values('markdown_wiki_settings'); foreach ($sticky_values as $key => $value) { $values[$key] = $value; } } elgg_clear_sticky_form('markdown_wiki_settings'); return $values; }
/** * Prepare the add/edit form variables * * @param ElggObject $golfscore golfscore object. * @return array */ function golfscore_prepare_form_vars($golfscore = null) { $values = array('title' => get_input('title', ''), 'address' => get_input('address', ''), 'description' => '', 'access_id' => ACCESS_DEFAULT, 'tags' => '', 'shares' => array(), 'container_guid' => elgg_get_page_owner_guid(), 'guid' => null, 'entity' => $golfscore); if ($golfscore) { foreach (array_keys($values) as $field) { if (isset($golfscore->{$field})) { $values[$field] = $golfscore->{$field}; } } } if (elgg_is_sticky_form('golfscore')) { $sticky_values = elgg_get_sticky_values('golfscore'); foreach ($sticky_values as $key => $value) { $values[$key] = $value; } } elgg_clear_sticky_form('golfscore'); return $values; }
/** * Prepare the add/edit form variables * * @param ElggObject $question A question object. * @return array */ function answers_prepare_form_vars($question = null) { $values = array('title' => get_input('search', ''), 'description' => '', 'access_id' => ACCESS_DEFAULT, 'tags' => '', 'container_guid' => elgg_get_page_owner_guid(), 'guid' => null, 'entity' => $question); if ($question) { foreach (array_keys($values) as $field) { if (isset($question->{$field})) { $values[$field] = $question->{$field}; } } } if (elgg_is_sticky_form('question')) { $sticky_values = elgg_get_sticky_values('question'); foreach ($sticky_values as $key => $value) { $values[$key] = $value; } } elgg_clear_sticky_form('question'); return $values; }
/** * Prepare the add/edit form variables * * @param ElggObject $page * @return array */ function pages_prepare_form_vars($page = null, $parent_guid = 0) { // input names => defaults $values = array('title' => '', 'description' => '', 'access_id' => ACCESS_DEFAULT, 'write_access_id' => ACCESS_DEFAULT, 'tags' => '', 'container_guid' => elgg_get_page_owner_guid(), 'guid' => null, 'entity' => $page, 'parent_guid' => $parent_guid); if ($page) { foreach (array_keys($values) as $field) { if (isset($page->{$field})) { $values[$field] = $page->{$field}; } } } if (elgg_is_sticky_form('page')) { $sticky_values = elgg_get_sticky_values('page'); foreach ($sticky_values as $key => $value) { $values[$key] = $value; } } elgg_clear_sticky_form('page'); return $values; }
/** * Pull together variables for the edit form * * @param ElggObject $event * @return array */ function sched_conf_prepare_edit_form_vars($conf = NULL) { // input names => defaults $values = array('title' => NULL, 'description' => NULL, 'application' => NULL, 'application_code' => NULL, 'immediate' => NULL, 'start_date' => NULL, 'start_time_h' => NULL, 'start_time_m' => NULL, 'tags' => NULL, 'access_id' => ACCESS_DEFAULT, 'group_guid' => NULL, 'guid' => NULL, 'start_time' => NULL); if ($conf) { foreach (array_keys($values) as $field) { if (isset($conf->{$field})) { $values[$field] = $conf->{$field}; } } } if (elgg_is_sticky_form('sched_conf')) { $sticky_values = elgg_get_sticky_values('sched_conf'); foreach ($sticky_values as $key => $value) { $values[$key] = $value; } } elgg_clear_sticky_form('sched_conf'); return $values; }
/** * Add amapnews form parameters * * @param type $entity_unit * @return type */ function amapnews_prepare_form_vars($entity_unit = null) { // input names => defaults $values = array('title' => '', 'description' => '', 'excerpt' => '', 'featured' => '', 'photo' => '', 'tags' => '', 'connected_guid' => null, 'access_id' => ACCESS_DEFAULT, 'container_guid' => elgg_get_page_owner_guid(), 'entity' => $entity_unit, 'guid' => null, 'comments_on' => NULL); if ($entity_unit) { foreach (array_keys($values) as $field) { if (isset($entity_unit->{$field})) { $values[$field] = $entity_unit->{$field}; } } } if (elgg_is_sticky_form('amapnews')) { $sticky_values = elgg_get_sticky_values('amapnews'); foreach ($sticky_values as $key => $value) { $values[$key] = $value; } } elgg_clear_sticky_form('amapnews'); return $values; }
/** * Prepare the add/edit form variables * * @param ElggObject $video A video object. * @return array */ function videos_prepare_form_vars($video = null) { // input names => defaults $values = array('title' => get_input('title', ''), 'video_url' => get_input('video_url', ''), 'description' => '', 'access_id' => ACCESS_DEFAULT, 'tags' => '', 'container_guid' => elgg_get_page_owner_guid(), 'guid' => null, 'entity' => $video); if ($video) { foreach (array_keys($values) as $field) { if (isset($video->{$field})) { $values[$field] = $video->{$field}; } } } if (elgg_is_sticky_form('videos')) { $sticky_values = elgg_get_sticky_values('videos'); foreach ($sticky_values as $key => $value) { $values[$key] = $value; } } elgg_clear_sticky_form('videos'); return $values; }
/** * Prepare the add/edit form variables * * @param ElggObject $task * @return array */ function tasks_prepare_form_vars($task = null, $parent_guid = 0) { // input names => defaults $values = array('title' => '', 'description' => '', 'start_date' => '', 'end_date' => '', 'task_type' => '', 'status' => '', 'assigned_to' => '', 'percent_done' => '', 'work_remaining' => '', 'access_id' => ACCESS_DEFAULT, 'write_access_id' => ACCESS_DEFAULT, 'tags' => '', 'container_guid' => elgg_get_page_owner_guid(), 'guid' => null, 'entity' => $task, 'parent_guid' => $parent_guid); if ($task) { foreach (array_keys($values) as $field) { if (isset($task->{$field})) { $values[$field] = $task->{$field}; } } } if (elgg_is_sticky_form('task')) { $sticky_values = elgg_get_sticky_values('task'); foreach ($sticky_values as $key => $value) { $values[$key] = $value; } } elgg_clear_sticky_form('task'); return $values; }
function vouchers_prepare_form_vars($voucher = null) { // input names => defaults $values = array('title' => '', 'code' => '', 'code_type' => '', 'code_end' => '', 'description' => '', 'amount' => '', 'amount_type' => '', 'access_id' => ACCESS_DEFAULT, 'tags' => '', 'container_guid' => elgg_get_page_owner_guid(), 'entity' => $voucher, 'valid_from' => '', 'valid_until' => '', 'price' => 0, 'points' => 0, 'howmany' => '', 'currency' => '', 'weburl' => '', 'vimage' => '', 'qrcode' => '', 'zone' => '', 'terms' => '', 'excerpt' => '', 'guid' => null, 'comments_on' => NULL); if ($voucher) { foreach (array_keys($values) as $field) { if (isset($voucher->{$field})) { $values[$field] = $voucher->{$field}; } } } if (elgg_is_sticky_form('vouchers')) { $sticky_values = elgg_get_sticky_values('vouchers'); foreach ($sticky_values as $key => $value) { $values[$key] = $value; } } elgg_clear_sticky_form('vouchers'); return $values; }
/** * Prepare the map creation form variables * * @param type $drawmap * @return type */ function sharemaps_prepare_form_vars_drawmap($drawmap = null) { // input names => defaults $values = array('title' => '', 'description' => '', 'access_id' => ACCESS_DEFAULT, 'tags' => '', 'container_guid' => elgg_get_page_owner_guid(), 'guid' => null, 'dm_markers' => '', 'entity' => $drawmap); if ($drawmap) { foreach (array_keys($values) as $field) { if (isset($drawmap->{$field})) { $values[$field] = $drawmap->{$field}; } } } if (elgg_is_sticky_form('drawmap')) { $sticky_values = elgg_get_sticky_values('drawmap'); foreach ($sticky_values as $key => $value) { $values[$key] = $value; } } elgg_clear_sticky_form('drawmap'); return $values; }
/** * Prepare discussion topic form variables * * @param ElggObject $topic Topic object if editing * @return array */ function discussion_prepare_form_vars($topic = NULL) { // input names => defaults $values = array('title' => '', 'description' => '', 'status' => '', 'access_id' => ACCESS_DEFAULT, 'tags' => '', 'container_guid' => elgg_get_page_owner_guid(), 'guid' => null, 'topic' => $topic); if ($topic) { foreach (array_keys($values) as $field) { if (isset($topic->{$field})) { $values[$field] = $topic->{$field}; } } } if (elgg_is_sticky_form('topic')) { $sticky_values = elgg_get_sticky_values('topic'); foreach ($sticky_values as $key => $value) { $values[$key] = $value; } } elgg_clear_sticky_form('topic'); return $values; }
/** * Prepare the add/edit form variables * * @param ElggObject $project * @return array */ function projects_prepare_form_vars($project = null, $parent_guid = 0) { // input names => defaults $values = array('title' => '', 'description' => '', 'project_type' => '', 'cost' => '', 'organization' => '', 'funding' => '', 'status' => '', 'start_date' => '', 'end_date' => '', 'assigned_to[]' => '', 'access_id' => ACCESS_DEFAULT, 'write_access_id' => ACCESS_DEFAULT, 'tags' => '', 'upload' => '', 'container_guid' => elgg_get_page_owner_guid(), 'guid' => null, 'entity' => $project, 'parent_guid' => $parent_guid); if ($project) { foreach (array_keys($values) as $field) { if (isset($project->{$field})) { $values[$field] = $project->{$field}; } } $opis = elgg_get_entities_from_relationship(array("relationship" => "opi", "relationship_guid" => $project->guid, "inverse_relationship" => true)); $values['opis'] = $opis; } if (elgg_is_sticky_form('project')) { $sticky_values = elgg_get_sticky_values('project'); foreach ($sticky_values as $key => $value) { $values[$key] = $value; } } elgg_clear_sticky_form('project'); return $values; }
/** * Pull together market variables for the save/edit form * * @param Market $post * @return array */ function market_prepare_form_vars($post = NULL) { $values = array('title' => NULL, 'description' => NULL, 'price' => NULL, 'access_id' => ACCESS_DEFAULT, 'marketcategory' => NULL, 'market_type' => NULL, 'location' => NULL, 'custom' => NULL, 'tags' => NULL, 'container_guid' => elgg_get_page_owner_guid(), 'guid' => NULL); if ($post) { foreach (array_keys($values) as $field) { if (isset($post->{$field})) { $values[$field] = $post->{$field}; } } } if (elgg_is_sticky_form('market')) { $sticky_values = elgg_get_sticky_values('market'); foreach ($sticky_values as $key => $value) { $values[$key] = $value; } } elgg_clear_sticky_form('market'); if (!$post) { return $values; } return $values; }
/** * Prepare the add/edit form variables * * @param ElggObject $task * @return array */ function task_prepare_form_vars($task = null, $list_guid = 0) { // input names => defaults $values = array('title' => get_input('title', ''), 'description' => '', 'priority' => '', 'access_id' => ACCESS_DEFAULT, 'write_access_id' => ACCESS_DEFAULT, 'tags' => '', 'container_guid' => elgg_get_page_owner_guid(), 'guid' => null, 'entity' => $task, 'list_guid' => $list_guid, 'referer_guid' => get_input('referer_guid', '')); if ($task) { foreach (array_keys($values) as $field) { if (isset($task->{$field})) { $values[$field] = $task->{$field}; } } } if (elgg_is_sticky_form('task')) { $sticky_values = elgg_get_sticky_values('task'); foreach ($sticky_values as $key => $value) { $values[$key] = $value; } } elgg_clear_sticky_form('task'); if ($referer = get_input('referer')) { $link = elgg_view('output/url', array('href' => $referer, 'text' => elgg_echo('tasks:this:moreinfo:here'))); $values['description'] .= "<p>" . elgg_echo('tasks:this:moreinfo', array($link)) . "</p>"; } return $values; }
/** * Prepare the add/edit form variables * * @param ElggObject $page * @param int $parent_guid * @param ElggAnnotation $revision * @return array */ function pages_prepare_form_vars($page = null, $parent_guid = 0, $revision = null) { // input names => defaults $values = array('title' => '', 'description' => '', 'access_id' => ACCESS_DEFAULT, 'write_access_id' => ACCESS_DEFAULT, 'tags' => '', 'container_guid' => elgg_get_page_owner_guid(), 'guid' => null, 'entity' => $page, 'parent_guid' => $parent_guid); if ($page) { foreach (array_keys($values) as $field) { if (isset($page->{$field})) { $values[$field] = $page->{$field}; } } } if (elgg_is_sticky_form('page')) { $sticky_values = elgg_get_sticky_values('page'); foreach ($sticky_values as $key => $value) { $values[$key] = $value; } } elgg_clear_sticky_form('page'); // load the revision annotation if requested if ($revision instanceof ElggAnnotation && $revision->entity_guid == $page->getGUID()) { $values['description'] = $revision->value; } return $values; }
/** * Pull together blog variables for the save form * * @param ElggBlog $post * @param ElggAnnotation $revision * @return array */ function blog_prepare_form_vars($post = NULL, $revision = NULL) { // input names => defaults $values = array('title' => NULL, 'description' => NULL, 'status' => 'published', 'access_id' => ACCESS_DEFAULT, 'comments_on' => 'On', 'excerpt' => NULL, 'tags' => NULL, 'container_guid' => NULL, 'guid' => NULL, 'draft_warning' => ''); if ($post) { foreach (array_keys($values) as $field) { if (isset($post->{$field})) { $values[$field] = $post->{$field}; } } } if (elgg_is_sticky_form('blog')) { $sticky_values = elgg_get_sticky_values('blog'); foreach ($sticky_values as $key => $value) { $values[$key] = $value; } } elgg_clear_sticky_form('blog'); if (!$post) { return $values; } // load the revision annotation if requested if ($revision instanceof ElggAnnotation && $revision->entity_guid == $post->getGUID()) { $values['revision'] = $revision; $values['description'] = $revision->value; } // display a notice if there's an autosaved annotation // and we're not editing it. if ($auto_save_annotations = $post->getAnnotations('blog_auto_save', 1)) { $auto_save = $auto_save_annotations[0]; } else { $auto_save == FALSE; } if ($auto_save && $auto_save->id != $revision->id) { $values['draft_warning'] = elgg_echo('blog:messages:warning:draft'); } return $values; }
<?php /** * Elgg No Name plugin * * Delete 'Display Name' field from register and useradd forms * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 * @author pianist * @URL http://elgghacks.com * @copyright http://o.wzm.me/totemz/v/2015/elgg-hacks */ $name = $username = $email = $password = $password2 = $admin = ''; if (elgg_is_sticky_form('useradd')) { extract(elgg_get_sticky_values('useradd')); elgg_clear_sticky_form('useradd'); if (is_array($admin)) { $admin = $admin[0]; } } ?> <div> <label><?php echo elgg_echo('username'); ?> </label><br /> <?php echo elgg_view('input/text', array('name' => 'username', 'value' => $username)); ?> </div> <div> <label><?php
} $tabbed = false; if (elgg_get_plugin_setting('edit_profile_mode', 'profiles_go') == 'tabbed') { $tabbed = true; } $result = ''; // profile icon $profile_icon = elgg_get_plugin_setting('profile_icon_on_register', 'profiles_go'); if ($profile_icon == 'yes' || $profile_icon == 'optional') { $result .= elgg_view('input/profile_icon'); } $categorized_fields = profiles_go_get_categorized_fields(null, true, true); $fields = $categorized_fields['fields']; $cats = $categorized_fields['categories']; if (elgg_is_sticky_form('profiles_go_register')) { $sticky_values = elgg_get_sticky_values('profiles_go_register'); extract($sticky_values); elgg_clear_sticky_form('profiles_go_register'); } if (empty($custom_profile_fields_custom_profile_type)) { $custom_profile_fields_custom_profile_type = elgg_get_plugin_setting('default_profile_type', 'profiles_go'); } if (elgg_get_plugin_setting('profile_type_selection', 'profiles_go') !== 'admin') { $result .= elgg_view('profiles_go/register/profile_type_selection', ['value' => $custom_profile_fields_custom_profile_type]); } else { $result .= elgg_view('input/hidden', ['name' => 'custom_profile_fields_custom_profile_type', 'value' => $custom_profile_fields_custom_profile_type]); } if (!empty($fields)) { $tabbed_cat_titles = ''; $tabbed_cat_content = ''; $tab_selected = false;
$profile_icon = elgg_get_plugin_setting("profile_icon_on_register", "profile_manager"); $profile_type_selection = elgg_get_plugin_setting("profile_type_selection", "profile_manager"); $tabbed = false; if (elgg_get_plugin_setting("edit_profile_mode", "profile_manager") == "tabbed") { $tabbed = true; } echo "<fieldset>"; // mandatory profile icon if ($profile_icon == "yes") { echo elgg_view("input/profile_icon"); } $categorized_fields = profile_manager_get_categorized_fields(null, true, true); $fields = $categorized_fields['fields']; $cats = $categorized_fields['categories']; if (elgg_is_sticky_form('profile_manager_register')) { extract(elgg_get_sticky_values('profile_manager_register')); elgg_clear_sticky_form('profile_manager_register'); } if ($profile_type_selection != "admin") { $types_options = array("type" => "object", "subtype" => CUSTOM_PROFILE_FIELDS_PROFILE_TYPE_SUBTYPE, "limit" => 0, "owner_guid" => $vars["config"]->site_guid); if ($types = elgg_get_entities($types_options)) { $types_options_values = array(); $types_options_values[""] = elgg_echo("profile_manager:profile:edit:custom_profile_type:default"); foreach ($types as $type) { $types_options_values[$type->guid] = $type->getTitle(); // preparing descriptions of profile types $description = $type->getDescription(); if (!empty($description)) { $types_description .= "<div id='" . $type->guid . "' class='custom_profile_type_description'>"; $types_description .= $description; $types_description .= "</div>";
/** * Prepares variables for the group edit form view. * * @param mixed $group ElggGroup or null. If a group, uses values from the group. * @return array */ function groups_prepare_form_vars($group = null) { $values = array('name' => '', 'membership' => ACCESS_PUBLIC, 'vis' => ACCESS_PUBLIC, 'guid' => null, 'entity' => null); // handle customizable profile fields $fields = elgg_get_config('group'); if ($fields) { foreach ($fields as $name => $type) { $values[$name] = ''; } } // handle tool options $tools = elgg_get_config('group_tool_options'); if ($tools) { foreach ($tools as $group_option) { $option_name = $group_option->name . "_enable"; $values[$option_name] = $group_option->default_on ? 'yes' : 'no'; } } // get current group settings if ($group) { foreach (array_keys($values) as $field) { if (isset($group->{$field})) { $values[$field] = $group->{$field}; } } if ($group->access_id != ACCESS_PUBLIC && $group->access_id != ACCESS_LOGGED_IN) { // group only access - this is done to handle access not created when group is created $values['vis'] = ACCESS_PRIVATE; } else { $values['vis'] = $group->access_id; } $values['entity'] = $group; } // get any sticky form settings if (elgg_is_sticky_form('groups')) { $sticky_values = elgg_get_sticky_values('groups'); foreach ($sticky_values as $key => $value) { $values[$key] = $value; } } elgg_clear_sticky_form('groups'); return $values; }
forward(REFERER); } $container = $entity->getContainerEntity(); elgg_set_page_owner_guid($container->guid); //elgg_push_breadcrumb(elgg_echo('events:calendar'), "calendar/all"); if (elgg_instanceof($container, 'user')) { elgg_push_breadcrumb($container->name, "calendar/owner/{$container->username}"); } else { if (elgg_instanceof($container, 'group')) { elgg_push_breadcrumb($container->name, "calendar/group/{$container->guid}"); } } elgg_push_breadcrumb($entity->getDisplayName(), $entity->getURL()); $title = elgg_echo('events:edit'); elgg_push_breadcrumb($title); if (elgg_is_sticky_form('events/edit')) { $vars = elgg_get_sticky_values('events/edit'); elgg_clear_sticky_form('events/edit'); } else { $vars = array(); } $vars['entity'] = $entity; $vars['container'] = $container; $vars['dateautoinit'] = 1; $content = elgg_view_form('events/edit', array('enctype' => 'multipart/form-data'), $vars); if (elgg_is_xhr()) { echo $content; } else { $layout = elgg_view_layout('content', array('title' => $title, 'content' => $content, 'filter' => false)); echo elgg_view_page($title, $layout); }
/** * Get sticky values * * @param string $action Action name * @return mixed */ public function getStickyValues($action = '') { return elgg_get_sticky_values($action); }
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; }
<?php /** * Elgg register form * * @package Elgg * @subpackage Core */ $password = $password2 = ''; $username = get_input('u'); $email = get_input('e'); $name = get_input('n'); if (elgg_is_sticky_form('register')) { extract(elgg_get_sticky_values('register')); elgg_clear_sticky_form('register'); } // must accept terms if ($accept_terms = elgg_get_plugin_setting("registration_terms", "profile_manager")) { $link_begin = "<a target='_blank' href='" . $accept_terms . "'>"; $link_end = "</a>"; $terms .= "<div class='mandatory'>"; $terms .= "<input type='checkbox' name='accept_terms' value='yes' /> "; $terms .= "<label>" . sprintf(elgg_echo("profile_manager:registration:accept_terms"), $link_begin, $link_end) . "</label>"; $terms .= "</div>"; } echo "<div id='profile_manager_register_left'>"; ?> <fieldset> <div class="mtm mandatory"> <label><?php
* @uses vars['entity'] * @override views/default/forms/profile/edit.php */ ?> <div> <label><?php echo elgg_echo('user:name:label'); ?> </label> <?php echo elgg_view('input/text', array('name' => 'name', 'value' => $vars['entity']->name)); ?> </div> <?php $sticky_values = elgg_get_sticky_values('profile:edit'); $profile_fields = elgg_get_config('profile_fields'); if (is_array($profile_fields) && count($profile_fields) > 0) { foreach ($profile_fields as $shortname => $valtype) { $metadata = elgg_get_metadata(array('guid' => $vars['entity']->guid, 'metadata_name' => $shortname, 'limit' => false)); if ($metadata) { if (is_array($metadata)) { $value = ''; foreach ($metadata as $md) { if (!empty($value)) { $value .= ', '; } $value .= $md->value; $access_id = $md->access_id; } } else {
} $tabbed = false; if (elgg_get_plugin_setting('edit_profile_mode', 'profile_manager') == 'tabbed') { $tabbed = true; } $result = ''; // profile icon $profile_icon = elgg_get_plugin_setting('profile_icon_on_register', 'profile_manager'); if ($profile_icon == 'yes' || $profile_icon == 'optional') { $result .= elgg_view('input/profile_icon'); } $categorized_fields = profile_manager_get_categorized_fields(null, true, true); $fields = $categorized_fields['fields']; $cats = $categorized_fields['categories']; if (elgg_is_sticky_form('profile_manager_register')) { $sticky_values = elgg_get_sticky_values('profile_manager_register'); extract($sticky_values); elgg_clear_sticky_form('profile_manager_register'); } if (empty($custom_profile_fields_custom_profile_type)) { $custom_profile_fields_custom_profile_type = elgg_get_plugin_setting('default_profile_type', 'profile_manager'); } if (elgg_get_plugin_setting('profile_type_selection', 'profile_manager') !== 'admin') { $result .= elgg_view('profile_manager/register/profile_type_selection', ['value' => $custom_profile_fields_custom_profile_type]); } else { $result .= elgg_view('input/hidden', ['name' => 'custom_profile_fields_custom_profile_type', 'value' => $custom_profile_fields_custom_profile_type]); } if (!empty($fields)) { $tabbed_cat_titles = ''; $tabbed_cat_content = ''; $tab_selected = false;
/** * Pull together variables for the edit form * * @param ElggObject $poll * @return array * * TODO - put choices in sticky form as well */ function polls_prepare_edit_body_vars($poll = NULL) { // input names => defaults $values = array('question' => NULL, 'tags' => NULL, 'front_page' => NULL, 'access_id' => ACCESS_DEFAULT, 'guid' => NULL, 'multiple_choices' => false); if ($poll) { foreach (array_keys($values) as $field) { if (isset($poll->{$field})) { $values[$field] = $poll->{$field}; } } } if (elgg_is_sticky_form('polls')) { $sticky_values = elgg_get_sticky_values('polls'); foreach ($sticky_values as $key => $value) { $values[$key] = $value; } } elgg_clear_sticky_form('polls'); return $values; }