Esempio n. 1
0
// default map location coords
echo elgg_format_element('div', [], elgg_view_input('text', array('name' => 'params[default_coords]', 'value' => $plugin->default_coords, 'label' => elgg_echo('sharemaps:settings:default_coords'), 'help' => elgg_echo('sharemaps:settings:default_coords:help'))));
// Map width
echo elgg_format_element('div', [], elgg_view_input('text', array('name' => 'params[map_width]', 'value' => $plugin->map_width, 'label' => elgg_echo('sharemaps:settings:map_width'), 'help' => elgg_echo('sharemaps:settings:map_width:help'), 'style' => 'width: 200px;')));
// Map height
echo elgg_format_element('div', [], elgg_view_input('text', array('name' => 'params[map_height]', 'value' => $plugin->map_height, 'label' => elgg_echo('sharemaps:settings:map_height'), 'help' => elgg_echo('sharemaps:settings:map_height:help'), 'style' => 'width: 200px;')));
// allow or not the upload of maps
$map_upload = $plugin->map_upload;
if (empty($map_upload)) {
    $map_upload = SHAREMAPS_GENERAL_YES;
}
echo elgg_format_element('div', [], elgg_view_input('dropdown', array('name' => 'params[map_upload]', 'value' => $map_upload, 'options_values' => $potential_yes_no, 'label' => elgg_echo('sharemaps:settings:map_upload'), 'help' => elgg_echo('sharemaps:settings:map_upload:help'))));
// allow or not to insert google maps links
$map_creation = $plugin->map_creation;
if (empty($map_creation)) {
    $map_creation = SHAREMAPS_GENERAL_YES;
}
echo elgg_format_element('div', [], elgg_view_input('dropdown', array('name' => 'params[map_creation]', 'value' => $map_creation, 'options_values' => $potential_yes_no, 'label' => elgg_echo('sharemaps:settings:map_creation'), 'help' => elgg_echo('sharemaps:settings:map_creation:help'))));
// allow or not to insert google maps links
$gmaps_links = $plugin->gmaps_links;
if (empty($gmaps_links)) {
    $gmaps_links = SHAREMAPS_GENERAL_NO;
}
echo elgg_format_element('div', [], elgg_view_input('dropdown', array('name' => 'params[gmaps_links]', 'value' => $gmaps_links, 'options_values' => $potential_yes_no, 'label' => elgg_echo('sharemaps:settings:gmaps_links'), 'help' => elgg_echo('sharemaps:settings:gmaps_links:help'))));
// select where to load map regarding description
$map_description = $plugin->map_description;
if (empty($map_description)) {
    $map_description = SHAREMAPS_GENERAL_BEFORE;
}
echo elgg_format_element('div', [], elgg_view_input('dropdown', array('name' => 'params[map_description]', 'value' => $map_description, 'options_values' => $potential_before_after, 'label' => elgg_echo('sharemaps:settings:map_description'), 'help' => elgg_echo('sharemaps:settings:map_description:help'))));
Esempio n. 2
0
$end_date = (int) gmmktime(0, 0, 0, date('n', $endtime), date('j', $endtime), date('Y', $endtime));
// get sticky form values
$title = elgg_get_sticky_value('wizard', 'title', $title);
$start_date = (int) elgg_get_sticky_value('wizard', 'start_date', $start_date);
$end_date = (int) elgg_get_sticky_value('wizard', 'end_date', $end_date);
$show_users = elgg_get_sticky_value('wizard', 'show_users', $show_users);
$user_can_close = elgg_get_sticky_value('wizard', 'user_can_close', $user_can_close);
$display_mode = elgg_get_sticky_value('wizard', 'display_mode', $display_mode);
$forward_url = elgg_get_sticky_value('wizard', 'forward_url', $forward_url);
// clear sticky form
elgg_clear_sticky_form('wizard');
// define some options
$hour_options = range(0, 23);
$min_options = range(0, 59);
// make form
echo elgg_view_input('text', ['label' => elgg_echo('title'), 'name' => 'title', 'value' => $title, 'required' => true]);
// trigger mode
echo elgg_view_input('radio', ['name' => 'show_users', 'label' => elgg_echo('wizard:edit:show_users'), 'options' => [elgg_echo('wizard:edit:show_users:new_users') => 'new_users', elgg_echo('wizard:edit:show_users:everybody') => 'everybody'], 'value' => empty($show_users) ? 'everybody' : $show_users, 'required' => true]);
echo elgg_view_input('checkboxes', ['name' => 'user_can_close', 'options' => [elgg_echo('wizard:edit:user_can_close') => 1], 'value' => empty($user_can_close) ? 0 : $user_can_close, 'help' => elgg_echo('wizard:edit:user_can_close:description')]);
// start date
echo elgg_view_input('date', ['label' => elgg_echo('wizard:edit:start_date'), 'name' => 'start_date', 'value' => $start_date, 'timestamp' => true, 'required' => true, 'help' => elgg_echo('wizard:edit:start_date:description')]);
// end date
echo elgg_view_input('date', ['label' => elgg_echo('wizard:edit:end_date'), 'name' => 'end_date', 'value' => empty($endtime) ? '' : $end_date, 'timestamp' => true, 'help' => elgg_echo('wizard:edit:end_date:description')]);
// display mode
echo elgg_view_input('radio', ['name' => 'display_mode', 'label' => elgg_echo('wizard:edit:display_mode'), 'help' => elgg_echo('wizard:edit:display_mode:help'), 'options' => [elgg_echo('wizard:edit:display_mode:full_screen') => 'full_screen', elgg_echo('wizard:edit:display_mode:overlay') => 'overlay'], 'value' => empty($display_mode) ? 'full_screen' : $display_mode, 'required' => true]);
// forward url
echo elgg_view_input('text', ['name' => 'forward_url', 'label' => elgg_echo('wizard:edit:forward_url'), 'help' => elgg_echo('wizard:edit:forward_url:help'), 'value' => $forward_url]);
// submit
echo '<div class="elgg-foot">';
echo elgg_view('input/submit', ['value' => elgg_echo('save')]);
echo '</div>';
<?php

$user = elgg_extract('user', $vars);
if (!$user instanceof ElggUser) {
    return;
}
echo elgg_view('notifications/subscriptions/personal', $vars);
echo elgg_view('notifications/subscriptions/collections', $vars);
if (elgg_is_active_plugin('groups')) {
    echo elgg_view('notifications/subscriptions/groups', $vars);
}
echo elgg_view_input('hidden', array('name' => 'guid', 'value' => $user->guid));
echo elgg_view_input('submit', array('value' => elgg_echo('save'), 'field_class' => 'elgg-foot'));
Esempio n. 4
0
<?php

$container_guid = (int) elgg_extract('container_guid', $vars);
if ($container_guid) {
    return;
}
$dbprefix = elgg_get_config('dbprefix');
$user = elgg_get_logged_in_user_entity();
$groups = new ElggBatch('elgg_get_entities_from_relationship', array('relationship' => 'member', 'relationship_guid' => (int) $user->guid, 'inverse_relationship' => false, 'limit' => 0));
$options_values = array();
foreach ($groups as $group) {
    if ($group->canWriteToContainer(0, 'group', 'discussion')) {
        $options_values["{$group->guid}"] = $group->name;
    }
}
$options_values = elgg_trigger_plugin_hook('allowed_containers', 'object:discussion', $vars, $options_values);
if (empty($options_values)) {
    // @todo: do we need to terminate form rendering all together?
}
asort($options_values);
$placeholder = array('' => elgg_echo('discussion:group:container:select'));
$options_values = $placeholder + $options_values;
echo elgg_view_input('select', array('options_values' => $options_values, 'class' => 'select-discussion-container', 'required' => true, 'label' => elgg_echo('discussion:group:container')));
?>
<script>
	require(['input/discussions/container']);
</script>

Esempio n. 5
0
<?php

echo elgg_view_input('text', ['label' => elgg_echo('elasticsearch:inspect:guid'), 'help' => elgg_echo('elasticsearch:inspect:guid:help'), 'name' => 'guid', 'value' => get_input('guid')]);
// build footer
$footer = elgg_view_input('submit', ['value' => elgg_echo('elasticsearch:inspect:submit')]);
echo elgg_format_element('div', ['class' => 'elgg-foot'], $footer);
Esempio n. 6
0
    // using the first entity to check supported options
    $migrate = new $class($entities[0]);
    $rows = '<tr>';
    $rows .= '<th>' . elgg_echo('title') . '</th>';
    if ($migrate->canBackDate()) {
        $rows .= '<th>' . elgg_echo('entity_tools:created') . '</th>';
    }
    if ($migrate->canChangeOwner()) {
        $rows .= '<th>' . elgg_echo('entity_tools:owner') . '</th>';
    }
    if ($migrate->canChangeContainer()) {
        $rows .= '<th>' . elgg_echo('entity_tools:container') . '</th>';
    }
    $rows .= '</tr>';
    foreach ($entities as $entity) {
        $rows .= elgg_view('entity_tools/listing/entity', ['entity' => $entity]);
    }
    echo elgg_format_element('table', ['id' => 'entity-tools-listing-table', 'class' => 'elgg-table mbm'], $rows);
    $entity_options['count'] = true;
    $count = elgg_get_entities($entity_options);
    echo elgg_view('navigation/pagination', ['count' => $count, 'offset' => $offset, 'limit' => $limit]);
} else {
    echo elgg_echo('notfound');
}
if (elgg_get_page_owner_guid() != elgg_get_logged_in_user_guid()) {
    echo elgg_format_element('div', ['class' => 'elgg-subtext'], elgg_echo('entity_tools:forms:owner_listing:disclaimer'));
}
echo elgg_view_input('hidden', ['name' => 'subtype', 'value' => $subtype]);
echo '<div class="elgg-foot">';
echo elgg_view('input/submit', ['value' => elgg_echo('save'), 'class' => 'elgg-button-submit', 'data-confirm' => elgg_echo('question:areyousure')]);
echo '</div>';
Esempio n. 7
0
<?php

echo elgg_view_input('file', ['name' => 'file', 'required' => true]);
echo elgg_view('input/submit', ['value' => elgg_echo('upload')]);
Esempio n. 8
0
File: groups.php Progetto: elgg/elgg
<?php

/**
 * Saves subsription notification settings by group
 *
 * @uses $vars['user'] ElggUser
 */
$user = elgg_extract('user', $vars);
if (!elgg_instanceof($user, 'user')) {
    return;
}
echo elgg_view_input('hidden', ['name' => 'guid', 'value' => $user->guid]);
echo elgg_format_element('p', ['class' => 'elgg-text-help'], elgg_echo('notifications:subscriptions:groups:description'));
$records = elgg_view('notifications/subscriptions/groups', $vars);
echo elgg_format_element('div', ['class' => 'elgg-subscriptions'], $records);
$footer = elgg_view_input('submit', ['value' => elgg_echo('save')]);
elgg_set_form_footer($footer);
Esempio n. 9
0
File: forms.php Progetto: elgg/elgg
<?php

$ipsum = elgg_view('developers/ipsum');
?>
<form action="#">
	<fieldset>
		<legend>Fieldset Legend</legend>
		<?php 
echo elgg_view_field(array('#type' => 'text', 'required' => true, 'name' => 'f1', 'id' => 'f1', 'value' => 'input text', '#label' => 'Text input (.elgg-input-text):', '#help' => 'This is how help text looks'));
echo elgg_view_field(array('#type' => 'password', 'name' => 'f2', 'id' => 'f2', 'value' => 'password', '#label' => 'Password input (.elgg-input-password):'));
echo elgg_view_field(array('#type' => 'radio', 'name' => 'f3', 'id' => 'f3', 'options' => array('a (.elgg-input-radio)' => 1, 'b (.elgg-input-radio)' => 2), '#label' => 'Radio input (.elgg-input-radios):'));
echo elgg_view_field(array('#type' => 'checkbox', 'name' => 'f4s', 'id' => 'f4s', 'value' => 1, 'default' => false, 'required' => true, 'label' => 'a (.elgg-input-checkbox)', '#help' => 'Single checkbox .elgg-input-checkbox wrapped in .elgg-input-single-checkbox (only label)'));
echo elgg_view_field(array('#type' => 'checkbox', 'name' => 'f4s', 'id' => 'f4s', 'value' => 1, 'default' => false, 'required' => true, '#label' => 'a (.elgg-input-checkbox)', '#help' => 'Single checkbox .elgg-input-checkbox wrapped in .elgg-input-single-checkbox (only #label)'));
echo elgg_view_field(array('#type' => 'checkbox', 'name' => 'f4s2', 'id' => 'f4s2', 'value' => 1, 'default' => false, 'required' => true, '#label' => 'a (.elgg-input-checkbox) - Field label', 'label' => 'a (.elgg-input-checkbox) - Input label', '#help' => 'Single checkbox .elgg-input-checkbox wrapped in .elgg-input-single-checkbox (label and #label)'));
echo elgg_view_input('checkbox', array('name' => 'f4s3', 'id' => 'f4s3', 'value' => 1, 'default' => false, 'required' => true, 'label' => 'a (.elgg-input-checkbox)', 'help' => 'Single checkbox .elgg-input-checkbox wrapped in .elgg-input-single-checkbox using elgg_view_input'));
echo elgg_view_field(array('#type' => 'checkboxes', 'name' => 'f4', 'id' => 'f4', 'options' => array('a (.elgg-input-checkbox)' => 1, 'b (.elgg-input-checkbox)' => 2), '#label' => 'Checkboxes input (.elgg-input-checkboxes):'));
echo elgg_view_field(array('#type' => 'select', 'name' => 'f5', 'id' => 'f5', 'options' => array('option 1', 'option 2', ['text' => 'disabled', 'disabled' => true]), '#label' => 'Select input (dropdown) (.elgg-input-dropdown) with a disabled option:'));
echo elgg_view_field(array('#type' => 'select', 'name' => 'f51[]', 'id' => 'f51', 'options_values' => array('value 1' => 'option 1', 'value 2' => 'option 2', 'value 3' => 'option 3'), 'multiple' => true, '#label' => 'Select input (multiselect) (.elgg-input-dropdown):'));
echo elgg_view_field(array('#type' => 'access', 'name' => 'f6', 'id' => 'f6', 'value' => ACCESS_PUBLIC, '#label' => 'Access input (.elgg-input-access):'));
echo elgg_view_field(array('#type' => 'file', 'name' => 'f7', 'id' => 'f7', '#label' => 'File input (.elgg-input-file):'));
echo elgg_view_field(array('#type' => 'url', 'name' => 'f8', 'id' => 'f8', 'value' => 'http://elgg.org/', '#label' => 'URL input (.elgg-input-url):'));
echo elgg_view_field(array('#type' => 'tags', 'name' => 'f9', 'id' => 'f9', 'value' => 'one, two, three', '#label' => 'Tags input (.elgg-input-tags):'));
echo elgg_view_field(array('#type' => 'email', 'name' => 'f10', 'id' => 'f10', 'value' => '*****@*****.**', '#label' => 'Email input (.elgg-input-email):'));
echo elgg_view_field(array('#type' => 'autocomplete', 'name' => 'f11', 'id' => 'f11', 'match_on' => array('groups', 'friends'), '#label' => 'Autocomplete input (.elgg-input-autocomplete):'));
echo elgg_view_field(array('#type' => 'date', 'name' => 'f12', 'id' => 'f12', 'value' => '2012-12-31', '#label' => 'Date input (.elgg-input-date):'));
$year = date('Y');
echo elgg_view_field(array('#type' => 'date', 'name' => 'f12-custom', 'id' => 'f12-custom', 'value' => "{$year}/02/01", 'timestamp' => true, 'datepicker_options' => array('dateFormat' => 'yy/mm/dd', 'changeMonth' => false, 'changeYear' => false, 'minDate' => "{$year}/01/15", 'maxDate' => "{$year}/02/15"), '#label' => 'Date input (.elgg-input-date) with custom options:', '#help' => 'Select a date from 15 Jan to 15 Feb'));
echo elgg_view_field(array('#type' => 'userpicker', 'name' => 'f13', 'id' => 'f13', '#label' => 'User picker input (.elgg-user-picker):'));
echo elgg_view_field(array('#type' => 'userpicker', 'name' => 'f16', 'id' => 'f16', 'limit' => 1, '#label' => 'User picker input (with max 1 results) (.elgg-user-picker):'));
echo elgg_view_field(array('#type' => 'plaintext', 'name' => 'f15', 'id' => 'f15', 'value' => $ipsum, '#label' => 'Plain textarea input (.elgg-input-plaintext):'));
echo elgg_view_field(array('#type' => 'longtext', 'name' => 'f14', 'id' => 'f14', 'value' => $ipsum, '#label' => 'Long textarea input (.elgg-input-longtext):'));
Esempio n. 10
0
    $output_as_tags = $entity->output_as_tags;
    $blank_available = $entity->blank_available;
    $admin_only = $entity->admin_only;
    if (!array_key_exists($metadata_type, $options_values)) {
        $options_values[$metadata_type] = $metadata_type;
    }
}
$yes_no_options = ['yes' => elgg_echo('option:yes'), 'no' => elgg_echo('option:no')];
$no_yes_options = array_reverse($yes_no_options);
$formbody .= elgg_view_input('text', ['name' => 'metadata_name', 'value' => $metadata_name, 'required' => true, 'label' => elgg_echo('profile_manager:admin:metadata_name')]);
$formbody .= elgg_view_input('text', ['name' => 'metadata_label', 'value' => $metadata_label, 'label' => elgg_echo('profile_manager:admin:metadata_label')]);
$formbody .= elgg_view_input('text', ['name' => 'metadata_input_label', 'value' => $metadata_input_label, 'label' => elgg_echo('profile_manager:admin:metadata_input_label'), 'help' => elgg_echo('profile_manager:admin:metadata_input_label:help')]);
$formbody .= elgg_view_input('text', ['name' => 'metadata_hint', 'value' => $metadata_hint, 'label' => elgg_echo('profile_manager:admin:metadata_hint')]);
$formbody .= elgg_view_input('text', ['name' => 'metadata_placeholder', 'value' => $metadata_placeholder, 'label' => elgg_echo('profile_manager:admin:metadata_placeholder')]);
$formbody .= elgg_view_input('select', ['name' => 'metadata_type', 'options_values' => $options_values, 'value' => $metadata_type, 'label' => elgg_echo('profile_manager:admin:field_type'), 'onchange' => 'elgg.profile_manager.change_field_type();']);
$formbody .= elgg_view_input('text', ['name' => 'metadata_options', 'value' => $metadata_options, 'label' => elgg_echo('profile_manager:admin:metadata_options')]);
$options_table = '';
$options = ['show_on_register', 'mandatory', 'user_editable', 'output_as_tags', 'blank_available', 'admin_only'];
foreach ($options as $option) {
    $class = elgg_extract($option, $option_classes, '');
    $options_table .= '<tr>';
    $options_table .= '<td>' . elgg_echo("profile_manager:admin:{$option}") . ':</td>';
    $options_table .= '<td>';
    $options_table .= elgg_view('input/dropdown', ['name' => $option, 'options_values' => $no_yes_options, 'value' => ${$option}, 'class' => 'mhs custom_fields_form_field_option' . $class]);
    $options_table .= '</td>';
    $options_table .= elgg_format_element('td', [], elgg_echo("profile_manager:admin:{$option}:description"));
    $options_table .= '</tr>';
}
$options_table = elgg_format_element('table', [], $options_table);
$options_title = elgg_echo('profile_manager:admin:additional_options');
$options_title .= elgg_view('output/pm_hint', ['id' => 'more_info_profile_field_additional', 'text' => elgg_echo('profile_manager:tooltips:profile_field_additional')]);
Esempio n. 11
0
<?php

$widget = elgg_extract('entity', $vars);
$event_guids = $widget->event_guids;
echo elgg_view_input('objectpicker', ['values' => $event_guids, 'name' => 'params[event_guids]', 'subtype' => 'event', 'label' => elgg_echo('event_manager:widgets:highlighted_events:edit:event_guids'), 'help' => elgg_echo('event_manager:widgets:highlighted_events:description'), 'sortable' => true]);
echo elgg_view('input/checkbox', ['label' => elgg_echo('event_manager:widgets:highlighted_events:edit:show_past_events'), 'name' => 'params[show_past_events]', 'value' => 1, 'checked' => (bool) $widget->show_past_events]);
Esempio n. 12
0
<?php

$widget = elgg_extract('entity', $vars);
$file_count = (int) $widget->file_count;
if ($file_count < 1) {
    $file_count = 4;
}
echo elgg_view_input('select', ['label' => elgg_echo('file:num_files'), 'name' => 'params[file_count]', 'options' => range(1, 10), 'value' => $file_count]);
Esempio n. 13
0
<?php

$entity = elgg_extract('entity', $vars);
echo elgg_view_input('select', array('name' => 'params[show_statistics]', 'value' => isset($entity->show_statistics) ? $entity->show_statistics : true, 'label' => elgg_echo('user:settings:show_statistics'), 'options_values' => array(0 => elgg_echo('option:no'), 1 => elgg_echo('option:yes'))));
echo elgg_view_input('select', array('name' => 'params[show_language]', 'value' => isset($entity->show_language) ? $entity->show_language : true, 'label' => elgg_echo('user:settings:show_language'), 'options_values' => array(0 => elgg_echo('option:no'), 1 => elgg_echo('option:yes'))));
Esempio n. 14
0
File: record.php Progetto: elgg/elgg
    $relationships = explode(',', $relationships_concat);
    foreach ($relationships as $relationship) {
        if (0 === strpos($relationship, 'notify')) {
            $method = str_replace('notify', '', $relationship);
            $preferred_methods[$method] = $method;
        }
    }
} else {
    foreach ($methods as $method) {
        if (check_entity_relationship($user->guid, "notify{$method}", $entity->guid)) {
            $preferred_methods[$method] = $method;
        }
    }
}
$method_options = [];
foreach ($methods as $method) {
    $label = elgg_echo("notification:method:{$method}");
    $method_options[$label] = $method;
}
?>
<div class="elgg-subscription-record">
	<div class="elgg-subscription-description">
		<?php 
echo elgg_view_image_block($icon, $name);
?>
	</div>
	<?php 
echo elgg_view_input('checkboxes', ['name' => "subscriptions[{$entity->guid}]", 'options' => $method_options, 'value' => $preferred_methods, 'align' => 'horizontal', 'field_class' => 'elgg-subscription-methods']);
?>
</div>
Esempio n. 15
0
$message_type = elgg_extract('message_type', $vars);
$recipient_guids = elgg_extract('recipient_guids', $vars, array());
$subject = elgg_extract('subject', $vars, '');
$message = elgg_extract('body', $vars, '');
$multiple = elgg_extract('multiple', $vars, false);
$has_subject = elgg_extract('has_subject', $vars, true);
$allows_attachments = elgg_extract('allows_attachments', $vars, false);
echo elgg_view_input('hidden', array('name' => 'message_type', 'value' => $message_type));
echo elgg_view_input('hidden', array('name' => 'original_guid', 'value' => $original_message->guid));
if (!$original_message) {
    echo elgg_view_input('tokeninput', array('name' => 'recipients', 'value' => $recipient_guids, 'multiple' => $multiple, 'callback' => 'hypeJunction\\Inbox\\Search\\Recipients::search', 'query' => array('message_type' => $message_type), 'label' => $multiple ? elgg_echo('inbox:message:recipients') : elgg_echo('inbox:message:recipient')));
} else {
    foreach ($recipient_guids as $guid) {
        echo elgg_view_input('hidden', array('name' => 'recipients[]', 'value' => $guid));
    }
}
if ($has_subject) {
    if (!$original_message) {
        echo elgg_view_input('text', array('name' => 'subject', 'value' => $subject, 'label' => elgg_echo('inbox:message:subject')));
    } else {
        $subject = $original_message->getReplySubject();
        echo elgg_view_input('hidden', array('name' => 'subject', 'value' => $subject));
    }
}
echo elgg_view_input('inbox/message', array('name' => 'body', 'value' => $message, 'rows' => 5, 'label' => $original_message ? '' : elgg_echo('inbox:message:body')));
echo elgg_view('forms/messages/send/extend', $vars);
if ($allows_attachments) {
    echo elgg_view_input('attachments', ['name' => 'message_attachments', 'expand' => false, 'field_class' => 'clearfix']);
}
echo elgg_view_input('submit', array('value' => elgg_echo('inbox:message:send'), 'field_class' => 'elgg-foot'));
Esempio n. 16
0
    $title = '';
    $desc = '';
    $parent = get_input('folder_guid', 0);
    if (!empty($parent) && ($parent_entity = get_entity($parent))) {
        $access_id = $parent_entity->access_id;
    } else {
        if ($page_owner instanceof ElggGroup) {
            $access_id = $page_owner->group_acl;
        } else {
            $access_id = ACCESS_DEFAULT;
        }
    }
    $submit_text = elgg_echo('save');
}
echo elgg_view('input/hidden', ['name' => 'page_owner', 'value' => $page_owner->getGUID()]);
echo elgg_view_input('text', ['label' => elgg_echo('file_tools:forms:edit:title'), 'name' => 'title', 'value' => $title]);
echo elgg_view_input('longtext', ['label' => elgg_echo('file_tools:forms:edit:description'), 'name' => 'description', 'value' => $desc]);
echo elgg_view_input('folder_select', ['label' => elgg_echo('file_tools:forms:edit:parent'), 'name' => 'file_tools_parent_guid', 'folder' => $folder, 'value' => $parent, 'container_guid' => $page_owner->getGUID(), 'type' => 'folder']);
// set context to influence access
elgg_push_context('file_tools');
echo elgg_view_input('access', ['label' => elgg_echo('access'), 'name' => 'access_id', 'value' => $access_id, 'type' => 'object', 'subtype' => 'folder', 'entity' => $folder]);
// restore context
elgg_pop_context();
if (!empty($folder)) {
    $change_access = elgg_view_input('checkbox', ['label' => elgg_echo('file_tools:forms:edit:change_children_access'), 'name' => 'change_children_access', 'value' => 'yes', 'checked' => true]);
    $change_access .= elgg_view_input('checkbox', ['label' => elgg_echo('file_tools:forms:edit:change_files_access'), 'name' => 'change_files_access', 'value' => 'yes', 'checked' => true]);
    echo elgg_format_element('div', ['id' => 'file_tools_edit_form_access_extra'], $change_access);
}
echo '<div class="elgg-foot">';
echo elgg_view('input/submit', ['value' => $submit_text]);
echo '</div>';
Esempio n. 17
0
<?php

/**
 *
 */
echo elgg_view_input('file', array('name' => 'file'));
echo elgg_view_input('submit', array('value' => elgg_echo('upload')));
Esempio n. 18
0
<?php

$user = elgg_extract('entity', $vars, elgg_get_page_owner_entity());
if (!$user instanceof ElggUser) {
    return;
}
$title = elgg_echo('user:set:language');
$content = elgg_view_input('select', array('name' => 'language', 'value' => $user->language, 'options_values' => get_installed_translations(), 'label' => elgg_echo('user:language:label')));
echo elgg_view_module('info', $title, $content);
Esempio n. 19
0
<?php

$user = elgg_get_logged_in_user_entity();
$metadata_name = elgg_extract('name', $vars);
$profile_fields = elgg_get_config('profile_fields');
if (empty($profile_fields) || !isset($profile_fields[$metadata_name])) {
    return;
}
$type = elgg_extract($metadata_name, $profile_fields);
$sticky_values = elgg_get_sticky_value('wizard', 'profile');
$value = $user->{$metadata_name};
if (!empty($sticky_values)) {
    $value = elgg_extract($metadata_name, $sticky_values, $value);
}
$label = $metadata_name;
if (elgg_language_key_exists("profile:{$metadata_name}")) {
    $label = elgg_echo("profile:{$metadata_name}");
}
$params = ['label' => $label, 'name' => "profile[{$metadata_name}]", 'required' => 'required', 'value' => $value, 'required' => true];
$params = $params + $vars;
echo elgg_view_input($type, $params);
Esempio n. 20
0
<?php

$question = elgg_extract('entity', $vars);
$value = elgg_extract('value', $vars);
if (!$question instanceof EventRegistrationQuestion) {
    return;
}
$fieldtypes = ['Textfield' => 'text', 'Textarea' => 'plaintext', 'Dropdown' => 'dropdown', 'Radiobutton' => 'radio'];
if (!array_key_exists($question->fieldtype, $fieldtypes)) {
    return;
}
$input_type = $fieldtypes[$question->fieldtype];
echo elgg_view_input($input_type, ['label' => $question->title, 'name' => 'question_' . $question->getGUID(), 'value' => $value, 'required' => (bool) $question->required, 'options' => $question->getOptions(), 'field_class' => 'mbn']);
Esempio n. 21
0
<?php

$entity = elgg_extract('entity', $vars);
echo elgg_view_input('select', ['name' => 'params[linkify]', 'value' => $entity->linkify, 'options_values' => [0 => elgg_echo('option:no'), 1 => elgg_echo('option:yes')], 'label' => elgg_echo('scraper:settings:linkify'), 'help' => elgg_echo('scraper:settings:linkify:help')]);
if (elgg_is_active_plugin('bookmarks')) {
    echo elgg_view_input('select', ['name' => 'params[bookmarks]', 'value' => $entity->bookmarks, 'options_values' => [0 => elgg_echo('option:no'), 1 => elgg_echo('option:yes')], 'label' => elgg_echo('scraper:settings:bookmarks'), 'help' => elgg_echo('scraper:settings:bookmarks:help')]);
}
Esempio n. 22
0
<?php

$entity = elgg_extract('entity', $vars);
echo elgg_view_input('select', array('name' => 'params[friend_list_visibility]', 'value' => isset($entity->friend_list_visibility) ? $entity->friend_list_visibility : ACCESS_PUBLIC, 'options_values' => array(ACCESS_PRIVATE => elgg_echo('user:friends:visibility:private'), ACCESS_FRIENDS => elgg_echo('user:friends:visibility:friends'), ACCESS_LOGGED_IN => elgg_echo('user:friends:visibility:logged_in'), ACCESS_PUBLIC => elgg_echo('user:friends:visibility:public')), 'label' => elgg_echo('user:friends:friend_list_visibility'), 'help' => elgg_echo('user:friends:friend_list_visibility:help')));
echo elgg_view_input('select', array('name' => 'params[allow_visibility_override]', 'value' => isset($entity->allow_visibility_override) ? $entity->allow_visibility_override : true, 'options_values' => array(0 => elgg_echo('option:no'), 1 => elgg_echo('option:yes')), 'label' => elgg_echo('user:friends:allow_visibility_override'), 'help' => elgg_echo('user:friends:allow_visibility_override:help')));
echo elgg_view_input('select', array('name' => 'params[show_collections]', 'value' => isset($entity->show_collections) ? $entity->show_collections : true, 'options_values' => array(0 => elgg_echo('option:no'), 1 => elgg_echo('option:yes')), 'label' => elgg_echo('user:friends:show_collections'), 'help' => elgg_echo('user:friends:show_collections:help')));
echo elgg_view_input('select', array('name' => 'params[allow_revoke]', 'value' => isset($entity->allow_revoke) ? $entity->allow_revoke : true, 'options_values' => array(0 => elgg_echo('option:no'), 1 => elgg_echo('option:yes')), 'label' => elgg_echo('user:friends:allow_revoke'), 'help' => elgg_echo('user:friends:allow_revoke:help')));
Esempio n. 23
0
        $fields .= elgg_view_input('select', array('name' => 'filter', 'value' => elgg_extract('filter', $vars, ''), 'options_values' => $filter_options_values, 'class' => 'elgg-sortable-list-select', 'label' => elgg_echo("sort:{$entity_type}:filter:label"), 'field_class' => 'elgg-sortable-list-select-field'));
    }
}
if (elgg_extract('show_search', $vars, false)) {
    $fields .= elgg_view_input('text', array('name' => 'query', 'value' => elgg_extract('query', $vars), 'class' => 'elgg-sortable-list-query', 'label' => elgg_echo("sort:{$entity_type}:search:label"), 'field_class' => 'elgg-sortable-list-query-field', 'placeholder' => elgg_echo("sort:{$entity_type}:search:placeholder")));
}
if (elgg_extract('show_sort', $vars, false)) {
    $sort_options = elgg_extract('sort_options', $vars);
    if (!empty($sort_options)) {
        $sort_options_values = array();
        foreach ($sort_options as $sort_option) {
            $sort_options_values[$sort_option] = elgg_echo("sort:{$entity_type}:{$sort_option}");
        }
        $fields .= elgg_view_input('select', array('name' => 'sort', 'value' => elgg_extract('sort', $vars, 'time_created::desc'), 'options_values' => $sort_options_values, 'class' => 'elgg-sortable-list-select', 'label' => elgg_echo("sort:{$entity_type}:label"), 'field_class' => 'elgg-sortable-list-select-field'));
    }
}
if (!$fields) {
    return;
}
if (elgg_extract('expand_form', $vars, true)) {
    echo elgg_format_element('div', ['class' => 'elgg-sortable-list-fieldset'], $fields);
} else {
    echo elgg_view('output/url', ['href' => '#', 'text' => elgg_view_icon('filter') . elgg_echo('sort:menu:filter'), 'class' => 'elgg-sortable-list-form-toggle']);
    echo elgg_format_element('div', ['class' => 'elgg-sortable-list-fieldset hidden'], $fields);
}
echo elgg_view_input('hidden', ['name' => 'entity_type', 'value' => $entity_type]);
echo elgg_view_input('submit', ['class' => 'hidden', 'field_class' => 'hidden']);
?>
<script>
	require(['forms/lists/sort']);
</script>
Esempio n. 24
0
<?php

/**
 * Form fields for general event information
 */
echo elgg_view_input('text', ['label' => elgg_echo('title'), 'name' => 'title', 'value' => $vars['title'], 'required' => true]);
$gm_event_start = gmmktime(0, 0, 0, gmdate('m', $vars['event_start']), gmdate('d', $vars['event_start']), gmdate('Y', $vars['event_start']));
$gm_event_end = gmmktime(0, 0, 0, gmdate('m', $vars['event_end']), gmdate('d', $vars['event_end']), gmdate('Y', $vars['event_end']));
// Starting time
$event_start_input = elgg_view('input/date', ['name' => 'event_start', 'id' => 'event_start', 'timestamp' => true, 'value' => $gm_event_start, 'class' => 'event_manager_event_edit_date']);
$start_time_input = elgg_view('input/time', ['name' => 'start_time', 'value' => $vars['event_start']]);
$start = elgg_view('elements/forms/field', ['label' => elgg_view('elements/forms/label', ['label' => elgg_echo('event_manager:edit:form:start'), 'id' => 'event_start', 'required' => true]), 'input' => $event_start_input . $start_time_input, 'class' => 'event-manager-forms-label-inline man']);
// Ending time
$event_end_input = elgg_view('input/date', ['name' => 'event_end', 'id' => 'event_end', 'timestamp' => true, 'value' => $gm_event_end, 'class' => 'event_manager_event_edit_date']);
$end_time_input = elgg_view('input/time', ['name' => 'end_time', 'value' => $vars['event_end']]);
$end = elgg_view('elements/forms/field', ['label' => elgg_view('elements/forms/label', ['label' => elgg_echo('event_manager:edit:form:end'), 'id' => 'event_end', 'required' => true]), 'input' => $event_end_input . $end_time_input, 'class' => 'event-manager-forms-label-inline man']);
echo "<div class='elgg-col elgg-col-1of2'>{$start}</div>";
echo "<div class='elgg-col elgg-col-1of2'>{$end}</div>";
Esempio n. 25
0
<?php

/**
 * Elgg welcome plugin change email ajax form
 *
 * @author Gerard Kanters
 * @author Wouter van Os
 * @author Juho Jaakkola
 *
 * @website https://www.centillien.com
 *
 * @copyright Centillien 2016
 */
$user_guid = $vars['user_guid'];
$username = $vars['user_name'];
$action = elgg_add_action_tokens_to_url(elgg_get_site_url() . 'action/welcome/change_user_email/?user_guid=' . $user_guid);
if (function_exists('elgg_view_input')) {
    $body = '';
    $body .= elgg_view_input('text', ['name' => 'new_email', 'label' => elgg_echo('welcome:new_user_email', [$username]), 'required' => true]);
    $body .= elgg_view_input('submit', ['value' => elgg_echo('welcome:change_email'), 'field_class' => 'elgg-foot']);
} else {
    $body = "<div style=\"width:600px;\"><label>" . elgg_echo('welcome:new_user_email', array($username)) . "</label>";
    $body .= elgg_view('input/text', array('name' => 'new_email')) . "<br><br>";
    $body .= elgg_view('input/submit', array('value' => elgg_echo('welcome:change_email'))) . '</div>';
}
echo elgg_view('input/form', array('action' => $action, 'body' => $body));
Esempio n. 26
0
/**
 * Configure global notification settings
 * 
 * @uses $vars['user'] Subscriber
 */
$user = elgg_extract('user', $vars);
if (!$user instanceof ElggUser) {
    return;
}
$methods = elgg_get_notification_methods();
if (empty($methods)) {
    return;
}
$method_options = [];
foreach ($methods as $method) {
    $label = elgg_echo("notification:method:{$method}");
    $method_options[$label] = $method;
}
?>
<div class="elgg-subscription-record">
	<div class="elgg-subscription-description">
		<?php 
echo elgg_echo('notifications:subscriptions:personal:description');
?>
	</div>
	<?php 
$value = array_keys(array_filter($user->getNotificationSettings()));
echo elgg_view_input('checkboxes', ['name' => 'personal', 'options' => $method_options, 'default' => false, 'value' => $value, 'align' => 'horizontal', 'field_class' => 'elgg-subscription-methods']);
?>
</div>
Esempio n. 27
0
// make default options
$noyes_options = ['no' => elgg_echo('option:no'), 'yes' => elgg_echo('option:yes')];
// Default time view
$time_notation_options = ['date' => elgg_echo('file_tools:usersettings:time:date'), 'days' => elgg_echo('file_tools:usersettings:time:days')];
// sorting
$sort_options = ['e.time_created' => elgg_echo('file_tools:list:sort:time_created'), 'oe.title' => elgg_echo('title'), 'oe.description' => elgg_echo('description'), 'simpletype' => elgg_echo('file_tools:list:sort:type')];
$sort_direction = ['asc' => elgg_echo('file_tools:list:sort:asc'), 'desc' => elgg_echo('file_tools:list:sort:desc')];
$list_length = (int) $plugin->list_length;
if ($list_length == 0) {
    $list_length = 50;
}
$list_length_options = [-1 => elgg_echo('file_tools:settings:list_length:unlimited')];
$list_length_options += array_combine(range(10, 200, 10), range(10, 200, 10));
// get settings
$allowed_extensions = file_tools_allowed_extensions();
// Allowed extensions
echo elgg_view_input('text', ['label' => elgg_echo('file_tools:settings:allowed_extensions'), 'help' => elgg_echo('file_tools:settings:allowed_extensions:help'), 'name' => 'params[allowed_extensions]', 'value' => implode(',', $allowed_extensions)]);
// Use folder structure
echo elgg_view_input('select', ['label' => elgg_echo('file_tools:settings:user_folder_structure'), 'name' => 'params[user_folder_structure]', 'value' => $plugin->user_folder_structure, 'options_values' => $noyes_options]);
// default time notation
echo elgg_view_input('select', ['label' => elgg_echo('file_tools:usersettings:time:default'), 'name' => 'params[file_tools_default_time_display]', 'options_values' => $time_notation_options, 'value' => $plugin->file_tools_default_time_display]);
// default sorting options
echo '<div>';
echo '<label>' . elgg_echo('file_tools:settings:sort:default') . '</label>';
echo '&nbsp;' . elgg_view('input/select', ['name' => 'params[sort]', 'value' => $plugin->sort, 'options_values' => $sort_options]);
echo '&nbsp;';
echo elgg_view('input/select', ['name' => 'params[sort_direction]', 'value' => $plugin->sort_direction, 'options_values' => $sort_direction]);
echo '</div>';
// limit folder listing
echo elgg_view_input('select', ['label' => elgg_echo('file_tools:settings:list_length'), 'name' => 'params[list_length]', 'value' => $list_length, 'options_values' => $list_length_options]);
Esempio n. 28
0
<?php

$widget = elgg_extract('entity', $vars);
$num_display = (int) $widget->num_display;
$type_to_show = $widget->type_to_show;
// set default value
if ($num_display < 1) {
    $num_display = 5;
}
echo elgg_view_input('text', ['label' => elgg_echo('event_manager:widgets:events:numbertodisplay'), 'name' => 'params[num_display]', 'value' => $num_display]);
if (in_array($widget->context, ['dashboard', 'profile'])) {
    echo elgg_view_input('dropdown', ['label' => elgg_echo('event_manager:widgets:events:showevents'), 'name' => 'params[type_to_show]', 'value' => $type_to_show, 'options_values' => ['all' => elgg_echo('all'), 'owning' => elgg_echo('event_manager:widgets:events:showevents:icreated'), 'attending' => elgg_echo('event_manager:widgets:events:showevents:attendingto')]]);
}
if (!$widget->getOwnerEntity() instanceof ElggSite) {
    return;
}
$group_guid = $widget->group_guid;
if (elgg_view_exists('input/grouppicker')) {
    if (!empty($group_guid) && !is_array($group_guid)) {
        $group_guid = [$group_guid];
    }
    echo elgg_view_input('hidden', ['name' => 'params[group_guid]', 'value' => 0]);
    echo elgg_view_input('grouppicker', ['label' => elgg_echo('event_manager:widgets:events:group'), 'name' => 'params[group_guid]', 'values' => $group_guid, 'limit' => 1]);
} else {
    echo elgg_view_input('text', ['name' => elgg_echo('event_manager:widgets:events:group_guid'), 'name' => 'params[group_guid]', 'value' => $group_guid]);
}
Esempio n. 29
0
<?php

$plugin = elgg_extract('entity', $vars);
$separator = csv_exporter_get_separator();
echo elgg_view_input('text', ['label' => elgg_echo('csv_exporter:settings:separator'), 'name' => 'params[separator]', 'value' => $separator, 'maxlength' => 1]);
echo elgg_view_input('text', ['label' => elgg_echo('csv_exporter:settings:retention'), 'help' => elgg_echo('csv_exporter:settings:retention:description'), 'name' => 'params[retention]', 'value' => $plugin->retention]);
Esempio n. 30
0
$description = null;
$title = null;
if ($entity instanceof \ColdTrick\EventManager\Event\Day) {
    // assume day edit mode
    $guid = $entity->getGUID();
    $parent_guid = $entity->owner_guid;
    $title = $entity->title;
    $description = $entity->description;
    $date = $entity->date;
} else {
    // entity is a event
    $parent_guid = $entity->getGUID();
    // make nice default date
    $days = $entity->getEventDays();
    $last_day = end($days);
    if (!$last_day) {
        $date = $entity->getStartTimestamp() + 3600 * 24;
    } else {
        $date = $last_day->date + 3600 * 24;
    }
}
$form_body = elgg_view_input('date', ['label' => elgg_echo('event_manager:edit:form:start_day'), 'name' => 'date', 'id' => 'date', 'timestamp' => true, 'value' => $date, 'required' => true]);
$form_body .= elgg_view_input('text', ['label' => elgg_echo('title'), 'name' => 'description', 'value' => $description]);
$form_body .= elgg_view_input('text', ['label' => elgg_echo('description'), 'name' => 'title', 'value' => $title]);
$form_body .= elgg_view_input('submit', ['value' => elgg_echo('submit'), 'class' => 'mtm']);
$form_body .= elgg_view('input/hidden', ['name' => 'guid', 'value' => $guid]);
$form_body .= elgg_view('input/hidden', ['name' => 'parent_guid', 'value' => $parent_guid]);
$body = elgg_view('input/form', ['id' => 'event_manager_form_program_day', 'name' => 'event_manager_form_program_day', 'action' => 'javascript:elgg.event_manager.program_add_day($(\'#event_manager_form_program_day\'))', 'body' => $form_body]);
elgg_load_js('lightbox');
elgg_load_css('lightbox');
echo elgg_view_module('info', elgg_echo('event_manager:form:program:day'), $body, ['id' => 'event-manager-program-day-lightbox']);