diff options
Diffstat (limited to 'views/default/forms')
26 files changed, 935 insertions, 247 deletions
diff --git a/views/default/forms/account/settings.php b/views/default/forms/account/settings.php new file mode 100644 index 000000000..3967207ce --- /dev/null +++ b/views/default/forms/account/settings.php @@ -0,0 +1,10 @@ +<?php +/** + * Account settings form used for user settings + * + * This form is extended by Elgg with the views in core/settings/account. + * Plugins can additionally extend it and then register for the + * 'usersettings:save', 'user' plugin hook. + * + * This view is included by "forms/usersettings/save" + */ diff --git a/views/default/forms/admin/menu/save.php b/views/default/forms/admin/menu/save.php new file mode 100644 index 000000000..1a67ffcc4 --- /dev/null +++ b/views/default/forms/admin/menu/save.php @@ -0,0 +1,102 @@ +<?php +/** + * Form body for setting up site menu + */ + +// @todo Could probably make this number configurable +$num_featured_items = 6; + +// get site menu items +$menu = elgg_get_config('menus'); +$menu = $menu['site']; +$builder = new ElggMenuBuilder($menu); +$menu = $builder->getMenu('name'); +$menu_items = $menu['default']; + +$featured_menu_names = elgg_get_config('site_featured_menu_names'); + +$dropdown_values = array(); +foreach ($menu_items as $item) { + $dropdown_values[$item->getName()] = $item->getText(); +} +$dropdown_values[' '] = elgg_echo('none'); + +?> +<div class="elgg-module elgg-module-inline"> + <div class="elgg-head"> + <h3><?php echo elgg_echo('admin:menu_items:configure'); ?></h3> + </div> + <div class="elgg-body"> +<?php +echo elgg_view('output/longtext', array( + 'value' => elgg_echo("admin:menu_items:description") +)); + +for ($i=0; $i<$num_featured_items; $i++) { + if ($featured_menu_names && array_key_exists($i, $featured_menu_names)) { + $current_value = $featured_menu_names[$i]; + } else { + $current_value = ' '; + } + + echo elgg_view('input/dropdown', array( + 'options_values' => $dropdown_values, + 'name' => 'featured_menu_names[]', + 'value' => $current_value + )); +} +?> + </div> +</div> + +<div class="elgg-module elgg-module-inline"> + <div class="elgg-head"> + <h3><?php echo elgg_echo('admin:add_menu_item'); ?></h3> + </div> + <div class="elgg-body"> +<?php +echo elgg_view('output/longtext', array( + 'value' => elgg_echo("admin:add_menu_item:description") +)); + +$custom_items = elgg_get_config('site_custom_menu_items'); + +$name_str = elgg_echo('name'); +$url_str = elgg_echo('admin:plugins:label:website'); + +echo '<ul class="elgg-list elgg-list-simple">'; + +if (is_array($custom_items)) { + foreach ($custom_items as $title => $url) { + $name_input = elgg_view('input/text', array( + 'name' => 'custom_menu_titles[]', + 'value' => $title + )); + + $url_input = elgg_view('input/text', array( + 'name' => 'custom_menu_urls[]', + 'value' => $url + )); + + echo "<li>$name_str: $name_input $url_str: $url_input $delete</li>"; + } +} + +$new = elgg_echo('new'); +$name_input = elgg_view('input/text', array( + 'name' => 'custom_menu_titles[]', +)); + +$url_input = elgg_view('input/text', array( + 'name' => 'custom_menu_urls[]', +)); + +echo "<li class='custom_menuitem'>$name_str: $name_input $url_str: $url_input</li> +</ul>"; + +?> + </div> +</div> +<?php + +echo elgg_view('input/submit', array('value' => elgg_echo('save'))); diff --git a/views/default/forms/admin/plugins/change_state.php b/views/default/forms/admin/plugins/change_state.php new file mode 100644 index 000000000..730c8ff32 --- /dev/null +++ b/views/default/forms/admin/plugins/change_state.php @@ -0,0 +1,22 @@ +<?php +/** + * Activate/deactive all plugins specified by guids array + * + * @uses $vars['guids'] Array of GUIDs + * @uses $vars['action'] 'activate' or 'deactivate' + */ + +$guids = elgg_extract('guids', $vars, array()); +$guids = implode(',', $guids); + +echo '<div>'; +echo elgg_view('input/hidden', array( + 'name' => 'guids', + 'value' => $guids, +)); + +echo elgg_view('input/submit', array( + 'value' => elgg_echo("admin:plugins:{$vars['action']}_all"), + 'class' => 'elgg-button elgg-button-action mrm' +)); +echo '</div>'; diff --git a/views/default/forms/admin/plugins/filter.php b/views/default/forms/admin/plugins/filter.php new file mode 100644 index 000000000..fd1b618bc --- /dev/null +++ b/views/default/forms/admin/plugins/filter.php @@ -0,0 +1,26 @@ +<?php +/** + * Category filter for plugins + * + * @uses $vars['category'] + * @uses $vars['category_options'] + * @uses $vvars['sort'] + */ + +echo '<div>'; +echo elgg_view('input/dropdown', array( + 'name' => 'category', + 'options_values' => $vars['category_options'], + 'value' => $vars['category'], +)); + +echo elgg_view('input/hidden', array( + 'name' => 'sort', + 'value' => $vars['sort'], +)); + +echo elgg_view('input/submit', array( + 'value' => elgg_echo('filter'), + 'class' => 'elgg-button elgg-button-action', +)); +echo '</div>'; diff --git a/views/default/forms/admin/plugins/sort.php b/views/default/forms/admin/plugins/sort.php new file mode 100644 index 000000000..7f2246bad --- /dev/null +++ b/views/default/forms/admin/plugins/sort.php @@ -0,0 +1,26 @@ +<?php +/** + * Sort plugins form body + * + * @uses $vars['sort'] + * @uses $vars['sort_options'] + * @uses $vars['category'] + */ + +echo '<div class="mtm">'; +echo elgg_view('input/dropdown', array( + 'name' => 'sort', + 'options_values' => $vars['sort_options'], + 'value' => $vars['sort'], +)); + +echo elgg_view('input/hidden', array( + 'name' => 'category', + 'value' => $vars['category'], +)); + +echo elgg_view('input/submit', array( + 'value' => elgg_echo('sort'), + 'class' => 'elgg-button elgg-button-action' +)); +echo '</div>'; diff --git a/views/default/forms/admin/site/update_advanced.php b/views/default/forms/admin/site/update_advanced.php new file mode 100644 index 000000000..14b74e4f9 --- /dev/null +++ b/views/default/forms/admin/site/update_advanced.php @@ -0,0 +1,101 @@ +<?php +/** + * @todo cleanup + */ +$form_body = ""; + +foreach (array('wwwroot', 'path', 'dataroot') as $field) { + $form_body .= "<div>"; + $form_body .= elgg_echo('installation:' . $field) . "<br />"; + $warning = elgg_echo('installation:warning:' . $field); + if ($warning != 'installation:warning:' . $field) { + echo "<b>" . $warning . "</b><br />"; + } + $value = elgg_get_config($field); + $form_body .= elgg_view("input/text",array('name' => $field, 'value' => $value)); + $form_body .= "</div>"; +} + +$form_body .= "<div>" . elgg_echo('admin:site:access:warning') . "<br />"; +$form_body .= "<label>" . elgg_echo('installation:sitepermissions') . "</label>"; +$form_body .= elgg_view('input/access', array( + 'options_values' => array( + ACCESS_PRIVATE => elgg_echo("PRIVATE"), + ACCESS_FRIENDS => elgg_echo("access:friends:label"), + ACCESS_LOGGED_IN => elgg_echo("LOGGED_IN"), + ACCESS_PUBLIC => elgg_echo("PUBLIC") + ), + 'name' => 'default_access', + 'value' => elgg_get_config('default_access'), +)) . "</div>"; +$form_body .= "<div>" . elgg_echo('installation:allow_user_default_access:description') . "<br />"; +$form_body .= elgg_view("input/checkboxes", array( + 'options' => array(elgg_echo('installation:allow_user_default_access:label') => 1), + 'name' => 'allow_user_default_access', + 'value' => (elgg_get_config('allow_user_default_access') ? 1 : 0), +)) . "</div>"; +$form_body .= "<div>" . elgg_echo('installation:simplecache:description') . "<br />"; +$form_body .= elgg_view("input/checkboxes", array( + 'options' => array(elgg_echo('installation:simplecache:label') => 1), + 'name' => 'simplecache_enabled', + 'value' => (elgg_get_config('simplecache_enabled') ? 1 : 0), +)) . "</div>"; +$form_body .= "<div>" . elgg_echo('installation:systemcache:description') . "<br />"; +$form_body .= elgg_view("input/checkboxes", array( + 'options' => array(elgg_echo('installation:systemcache:label') => 1), + 'name' => 'system_cache_enabled', + 'value' => (elgg_get_config('system_cache_enabled') ? 1 : 0), +)) . "</div>"; + +$debug_options = array('0' => elgg_echo('installation:debug:none'), 'ERROR' => elgg_echo('installation:debug:error'), 'WARNING' => elgg_echo('installation:debug:warning'), 'NOTICE' => elgg_echo('installation:debug:notice')); +$form_body .= "<div>" . elgg_echo('installation:debug'); +$form_body .= elgg_view('input/dropdown', array( + 'options_values' => $debug_options, + 'name' => 'debug', + 'value' => elgg_get_config('debug'), +)); +$form_body .= '</div>'; + +// control new user registration +$options = array( + 'options' => array(elgg_echo('installation:registration:label') => 1), + 'name' => 'allow_registration', + 'value' => elgg_get_config('allow_registration') ? 1 : 0, +); +$form_body .= '<div>' . elgg_echo('installation:registration:description'); +$form_body .= '<br />' .elgg_view('input/checkboxes', $options) . '</div>'; + +// control walled garden +$walled_garden = elgg_get_config(walled_garden); +$options = array( + 'options' => array(elgg_echo('installation:walled_garden:label') => 1), + 'name' => 'walled_garden', + 'value' => $walled_garden ? 1 : 0, +); +$form_body .= '<div>' . elgg_echo('installation:walled_garden:description'); +$form_body .= '<br />' . elgg_view('input/checkboxes', $options) . '</div>'; + +$form_body .= "<div>" . elgg_echo('installation:httpslogin') . "<br />"; +$form_body .= elgg_view("input/checkboxes", array( + 'options' => array(elgg_echo('installation:httpslogin:label') => 1), + 'name' => 'https_login', + 'value' => (elgg_get_config('https_login') ? 1 : 0) +)) . "</div>"; + +$form_body .= "<div>" . elgg_echo('installation:disableapi') . "<br />"; +$disable_api = elgg_get_config('disable_api'); +$on = $disable_api ? 0 : 1; +$form_body .= elgg_view("input/checkboxes", array( + 'options' => array(elgg_echo('installation:disableapi:label') => 1), + 'name' => 'api', + 'value' => $on, +)); +$form_body .= "</div>"; + +$form_body .= elgg_view('input/hidden', array('name' => 'settings', 'value' => 'go')); + +$form_body .= '<div class="elgg-foot">'; +$form_body .= elgg_view('input/submit', array('value' => elgg_echo("save"))); +$form_body .= '</div>'; + +echo $form_body; diff --git a/views/default/forms/admin/site/update_basic.php b/views/default/forms/admin/site/update_basic.php new file mode 100644 index 000000000..88870bc60 --- /dev/null +++ b/views/default/forms/admin/site/update_basic.php @@ -0,0 +1,31 @@ +<?php +/** + * @todo cleanup + */ +$form_body = ""; + +foreach (array('sitename','sitedescription', 'siteemail') as $field) { + $form_body .= "<div>"; + $form_body .= elgg_echo('installation:' . $field) . "<br />"; + $warning = elgg_echo('installation:warning:' . $field); + if ($warning != 'installation:warning:' . $field) { + echo "<b>" . $warning . "</b><br />"; + } + $value = elgg_get_config($field); + $form_body .= elgg_view("input/text",array('name' => $field, 'value' => $value)); + $form_body .= "</div>"; +} + +$languages = get_installed_translations(); +$form_body .= "<div>" . elgg_echo('installation:language'); +$form_body .= elgg_view("input/dropdown", array( + 'name' => 'language', + 'value' => elgg_get_config('language'), + 'options_values' => $languages, +)) . "</div>"; + +$form_body .= '<div class="elgg-foot">'; +$form_body .= elgg_view('input/submit', array('value' => elgg_echo("save"))); +$form_body .= '</div>'; + +echo $form_body;
\ No newline at end of file diff --git a/views/default/forms/avatar/crop.php b/views/default/forms/avatar/crop.php new file mode 100644 index 000000000..3e798cb27 --- /dev/null +++ b/views/default/forms/avatar/crop.php @@ -0,0 +1,42 @@ +<?php +/** + * Avatar crop form + * + * @uses $vars['entity'] + */ + +elgg_load_js('jquery.imgareaselect'); +elgg_load_js('elgg.avatar_cropper'); +elgg_load_css('jquery.imgareaselect'); + +$master_img = elgg_view('output/img', array( + 'src' => $vars['entity']->getIconUrl('master'), + 'alt' => elgg_echo('avatar'), + 'class' => 'mrl', + 'id' => 'user-avatar-cropper', +)); + +$preview_img = elgg_view('output/img', array( + 'src' => $vars['entity']->getIconUrl('master'), + 'alt' => elgg_echo('avatar'), +)); + +?> +<div class="clearfix"> + <?php echo $master_img; ?> + <div id="user-avatar-preview-title"><label><?php echo elgg_echo('avatar:preview'); ?></label></div> + <div id="user-avatar-preview"><?php echo $preview_img; ?></div> +</div> +<div class="elgg-foot"> +<?php +$coords = array('x1', 'x2', 'y1', 'y2'); +foreach ($coords as $coord) { + echo elgg_view('input/hidden', array('name' => $coord, 'value' => $vars['entity']->$coord)); +} + +echo elgg_view('input/hidden', array('name' => 'guid', 'value' => $vars['entity']->guid)); + +echo elgg_view('input/submit', array('value' => elgg_echo('avatar:create'))); + +?> +</div> diff --git a/views/default/forms/avatar/upload.php b/views/default/forms/avatar/upload.php new file mode 100644 index 000000000..d91e8575e --- /dev/null +++ b/views/default/forms/avatar/upload.php @@ -0,0 +1,16 @@ +<?php +/** + * Avatar upload form + * + * @uses $vars['entity'] + */ + +?> +<div> + <label><?php echo elgg_echo("avatar:upload"); ?></label><br /> + <?php echo elgg_view("input/file",array('name' => 'avatar')); ?> +</div> +<div class="elgg-foot"> + <?php echo elgg_view('input/hidden', array('name' => 'guid', 'value' => $vars['entity']->guid)); ?> + <?php echo elgg_view('input/submit', array('value' => elgg_echo('upload'))); ?> +</div> diff --git a/views/default/forms/comments/add.php b/views/default/forms/comments/add.php new file mode 100644 index 000000000..9acabf3ea --- /dev/null +++ b/views/default/forms/comments/add.php @@ -0,0 +1,37 @@ +<?php +/** + * Elgg comments add form + * + * @package Elgg + * + * @uses ElggEntity $vars['entity'] The entity to comment on + * @uses bool $vars['inline'] Show a single line version of the form? + */ + + +if (isset($vars['entity']) && elgg_is_logged_in()) { + + $inline = elgg_extract('inline', $vars, false); + + if ($inline) { + echo elgg_view('input/text', array('name' => 'generic_comment')); + echo elgg_view('input/submit', array('value' => elgg_echo('comment'))); + } else { +?> + <div> + <label><?php echo elgg_echo("generic_comments:add"); ?></label> + <?php echo elgg_view('input/longtext', array('name' => 'generic_comment')); ?> + </div> + <div class="elgg-foot"> +<?php + echo elgg_view('input/submit', array('value' => elgg_echo("generic_comments:post"))); +?> + </div> +<?php + } + + echo elgg_view('input/hidden', array( + 'name' => 'entity_guid', + 'value' => $vars['entity']->getGUID() + )); +} diff --git a/views/default/forms/event_calendar/edit.php b/views/default/forms/event_calendar/edit.php deleted file mode 100644 index 747dae0f0..000000000 --- a/views/default/forms/event_calendar/edit.php +++ /dev/null @@ -1,233 +0,0 @@ -<?php -$event = $vars['event']; -$fd = $vars['form_data']; - -$schedule_options = array( - elgg_echo('event_calendar:all_day_label') => 'all_day', - elgg_echo('event_calendar:schedule_type:fixed')=>'fixed', -); - -if (elgg_is_active_plugin('event_poll')) { - $schedule_options = array_merge(array(elgg_echo('event_calendar:schedule_type:poll')=>'poll'),$schedule_options); -} - -$event_calendar_fewer_fields = elgg_get_plugin_setting('fewer_fields', 'event_calendar'); -$event_calendar_repeating_events = elgg_get_plugin_setting('repeating_events', 'event_calendar'); - -$event_calendar_region_display = elgg_get_plugin_setting('region_display', 'event_calendar'); -$event_calendar_type_display = elgg_get_plugin_setting('type_display', 'event_calendar'); -$event_calendar_spots_display = elgg_get_plugin_setting('spots_display', 'event_calendar'); - -$event_calendar_more_required = elgg_get_plugin_setting('more_required', 'event_calendar'); -$event_calendar_bbb_server_url = elgg_get_plugin_setting('bbb_server_url', 'event_calendar'); - -if ($event_calendar_more_required == 'yes') { - $required_fields = array('title','venue','start_date','start_time', - 'brief_description','region','event_type','fees','contact','organiser', - 'event_tags','spots'); -} else { - $required_fields = array('title','venue','start_date'); -} -$all_fields = array('title','venue','start_time','start_date','end_time','end_date', - 'brief_description','region','event_type','fees','contact','organiser','event_tags', - 'long_description','spots','personal_manage'); - -$prefix = array(); -foreach ($all_fields as $fn) { - if (in_array($fn,$required_fields)) { - $prefix[$fn] = elgg_echo('event_calendar:required').' '; - } else { - $prefix[$fn] = elgg_echo('event_calendar:optional').' '; - } -} - -if ($event) { - $event_action = 'manage_event'; - $event_guid = $event->guid; -} else { - $event_action = 'add_event'; - $event_guid = 0; -} - -$title = $fd['title']; -$brief_description = $fd['description']; -$venue = $fd['venue']; - -$fees = $fd['fees']; -if ($event_calendar_spots_display) { - $spots = $fd['spots']; -} -if ($event_calendar_region_display) { - $region = $fd['region']; -} -if ($event_calendar_type_display) { - $event_type = $fd['event_type']; -} -$contact = $fd['contact']; -$organiser = $fd['organiser']; -$event_tags = $fd['tags']; -$all_day = $fd['all_day']; -$schedule_type = $fd['schedule_type']; -$long_description = $fd['long_description']; - -$body = '<div>'; - -$body .= elgg_view('input/hidden',array('name'=>'event_action', 'value'=>$event_action)); -$body .= elgg_view('input/hidden',array('name'=>'event_guid', 'value'=>$event_guid)); - -$body .= '<fieldset>'; -$body .= '<legend>' . elgg_echo('event_calendar:basic:header') . '</legend>'; - -$body .= '<p><label>'.elgg_echo("event_calendar:title_label").'</label>'; -$body .= elgg_view("input/text",array('name' => 'title', 'value' => $title)); -$body .= '</p>'; -$body .= '<p class="event-calendar-description">'.$prefix['title'].elgg_echo('event_calendar:title_description').'</p>'; - -$body .= '<p><label>'.elgg_echo("event_calendar:venue_label").'</label>'; -$body .= elgg_view("input/text",array('name' => 'venue', 'value' => $venue)); -$body .= '</p>'; -$body .= '<p class="event-calendar-description">'.$prefix['venue'].elgg_echo('event_calendar:venue_description').'</p>'; - -if ($event_calendar_fewer_fields != 'yes') { - $body .= '<p><label>'.elgg_echo("event_calendar:brief_description_label").'</label>'; - $body .= elgg_view("input/text",array('name' => 'description', 'value' => $brief_description)); - $body .= '</p>'; - $body .= '<p class="event-calendar-description">'.$prefix['brief_description'].elgg_echo('event_calendar:brief_description_description').'</p>'; - -} else { - $body .= '<label>'.elgg_echo("event_calendar:long_description_label").'</label>'; - $body .= elgg_view("input/longtext",array('name' => 'long_description', 'value' => $long_description)); - $body .= '<p class="event-calendar-description">'.$prefix['long_description'].elgg_echo('event_calendar:long_description_description').'</p>'; -} - -$body .= '<p><label>'.elgg_echo("event_calendar:event_tags_label").'</label>'; -$body .= elgg_view("input/tags",array('name' => 'tags', 'value' => $event_tags)); -$body .= '</p>'; -$body .= '<p class="event-calendar-description">'.$prefix['event_tags'].elgg_echo('event_calendar:event_tags_description').'</p>'; - -if ($event || !$vars['group_guid']) { - $body .= '<p><label>'.elgg_echo("event_calendar:calendar_label").'</label>'; - $body .= elgg_view('event_calendar/container',array('container_guid'=>$vars['group_guid'])); - $body .= '</p>'; - $body .= '<p class="event-calendar-description">'.$prefix['calendar'].elgg_echo('event_calendar:calendar_description').'</p>'; -} else { - $body .= elgg_view('input/hidden',array('name'=>'group_guid', 'value'=>$vars['group_guid'])); -} - -if($event_calendar_bbb_server_url) { - $body .= '<p>'; - if ($fd['web_conference']) { - $body .= elgg_view('input/checkbox',array('name'=>'web_conference','value'=>1,'checked'=>'checked')); - } else { - $body .= elgg_view('input/checkbox',array('name'=>'web_conference','value'=>1)); - } - $body .= elgg_echo('event_calendar:web_conference_label'); - $body .= '</p>'; -} - -$body .= '</fieldset>'; - -$body .= '<fieldset>'; -$body .= '<legend>'.elgg_echo('event_calendar:schedule:header').'</legend>'; -$body .= elgg_view('input/radio',array('name'=>'schedule_type','value'=>$schedule_type,'options'=>$schedule_options)); - -$vars['prefix'] = $prefix; - -$body .= elgg_view('event_calendar/schedule_section',$vars); - -if ($event_calendar_spots_display == 'yes') { - $body .= '<p><label>'.elgg_echo("event_calendar:spots_label").'<br />'; - $body .= elgg_view("input/text",array('name' => 'spots', 'value' => $spots)); - $body .= '</label></p>'; - $body .= '<p class="event-calendar-description">'.$prefix['spots'].elgg_echo('event_calendar:spots_description').'</p>'; -} - -$body .= '<div class="event-calendar-edit-bottom"></div>'; -$body .= '</fieldset>'; - -$body .= elgg_view('event_calendar/personal_manage_section',$vars); - -$body .= elgg_view('event_calendar/share_section',$vars); - -if ($event_calendar_region_display == 'yes' || $event_calendar_type_display == 'yes' || $event_calendar_fewer_fields != 'yes') { - $body .= '<fieldset>'; - - if ($event_calendar_region_display == 'yes') { - $region_list = trim(elgg_get_plugin_setting('region_list', 'event_calendar')); - $region_list_handles = elgg_get_plugin_setting('region_list_handles', 'event_calendar'); - // make sure that we are using Unix line endings - $region_list = str_replace("\r\n","\n",$region_list); - $region_list = str_replace("\r","\n",$region_list); - if ($region_list) { - $options = array(); - $options[] = '-'; - foreach(explode("\n",$region_list) as $region_item) { - $region_item = trim($region_item); - if ($region_list_handles == 'yes') { - $options[$region_item] = elgg_echo('event_calendar:region:'.$region_item); - } else { - $options[$region_item] = $region_item; - } - } - $body .= '<p><label>'.elgg_echo("event_calendar:region_label").'</label>'; - $body .= elgg_view("input/dropdown",array('name' => 'region','value'=>$region,'options_values'=>$options)); - $body .= '</p>'; - $body .= '<p class="event-calendar-description">'.$prefix['region'].elgg_echo('event_calendar:region_description').'</p>'; - } - } - - if ($event_calendar_type_display == 'yes') { - $type_list = trim(elgg_get_plugin_setting('type_list', 'event_calendar')); - $type_list_handles = elgg_get_plugin_setting('type_list_handles', 'event_calendar'); - // make sure that we are using Unix line endings - $type_list = str_replace("\r\n","\n",$type_list); - $type_list = str_replace("\r","\n",$type_list); - if ($type_list) { - $options = array(); - $options[] = '-'; - foreach(explode("\n",$type_list) as $type_item) { - $type_item = trim($type_item); - if ($type_list_handles == 'yes') { - $options[$type_item] = elgg_echo('event_calendar:type:'.$type_item); - } else { - $options[$type_item] = $type_item; - } - } - $body .= '<p><label>'.elgg_echo("event_calendar:type_label").'</label>'; - $body .= elgg_view("input/dropdown",array('name' => 'event_type','value'=>$event_type,'options_values'=>$options)); - $body .= '</p>'; - $body .= '<p class="event-calendar-description">'.$prefix['event_type'].elgg_echo('event_calendar:type_description').'</p>'; - } - } - - if ($event_calendar_fewer_fields != 'yes') { - - $body .= '<p><label>'.elgg_echo("event_calendar:fees_label").'</label>'; - $body .= elgg_view("input/text",array('name' => 'fees', 'value' => $fees)); - $body .= '</p>'; - $body .= '<p class="event-calendar-description">'.$prefix['fees'].elgg_echo('event_calendar:fees_description').'</p>'; - - $body .= '<p><label>'.elgg_echo("event_calendar:contact_label").'</label>'; - $body .= elgg_view("input/text",array('name' => 'contact', 'value' => $contact)); - $body .= '</p>'; - $body .= '<p class="event-calendar-description">'.$prefix['contact'].elgg_echo('event_calendar:contact_description').'</p>'; - - $body .= '<p><label>'.elgg_echo("event_calendar:organiser_label").'</label>'; - $body .= elgg_view("input/text",array('name' => 'organiser', 'value' => $organiser)); - $body .= '</p>'; - $body .= '<p class="event-calendar-description">'.$prefix['organiser'].elgg_echo('event_calendar:organiser_description').'</p>'; - - $body .= '<p><label>'.elgg_echo("event_calendar:long_description_label").'</label>'; - $body .= elgg_view("input/longtext",array('name' => 'long_description', 'value' => $long_description)); - $body .= '</p>'; - $body .= '<p class="event-calendar-description">'.$prefix['long_description'].elgg_echo('event_calendar:long_description_description').'</p>'; - } - - $body .= '</fieldset>'; -} - -$body .= elgg_view('input/submit', array('name'=>'submit','value'=>elgg_echo('event_calendar:submit'))); - -$body .= '</div>'; - -echo $body; diff --git a/views/default/forms/event_calendar/manage_subscribers.php b/views/default/forms/event_calendar/manage_subscribers.php deleted file mode 100644 index 8039c5015..000000000 --- a/views/default/forms/event_calendar/manage_subscribers.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php -$event = $vars['event']; -$users = event_calendar_get_users_for_event($event->guid,0); -$guids = array(); -foreach($users as $user) { - $guids[] = $user->guid; -} -// TODO: if the event container is a group need to restrict user picker to the members of the group? -$content = elgg_view('input/userpicker_plus',array('value'=> $guids)); -$content .= '<br /><br />'; -$content .= elgg_view('input/hidden',array('name'=>'event_guid','value'=>$event->guid)); -$content .= elgg_view('input/submit',array('value'=>elgg_echo('submit'),'name'=>'submit_manage_subscribers','id'=>'submit-manage-subscribers')); - -echo $content; diff --git a/views/default/forms/friends/collections/add.php b/views/default/forms/friends/collections/add.php new file mode 100644 index 000000000..04c87346b --- /dev/null +++ b/views/default/forms/friends/collections/add.php @@ -0,0 +1,53 @@ +<?php +/** + * Form body for editing or adding a friend collection + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['collection'] Optionally, the collection to edit + */ + +// Set title, form destination +if (isset($vars['collection'])) { + $title = $vars['collection']->name; + $highlight = 'default'; +} else { + $title = ""; + $highlight = 'all'; +} + +echo "<div class=\"mtm\"><label>" . elgg_echo("friends:collectionname") . "<br/>"; +echo elgg_view("input/text", array( + "name" => "collection_name", + "value" => $title, + )); +echo "</label></div>"; + +echo "<div>"; +if ($vars['collection_members']) { + echo elgg_echo("friends:collectionfriends") . "<br />"; + foreach ($vars['collection_members'] as $mem) { + echo elgg_view_entity_icon($mem, 'tiny'); + echo $mem->name; + } +} +echo "</div>"; + +echo "<div><label>" . elgg_echo("friends:addfriends") . "</label>"; +echo elgg_view('input/friendspicker', array( + 'entities' => $vars['friends'], + 'name' => 'friends_collection', + 'highlight' => $highlight, +)); +echo "</div>"; + +echo '<div class="elgg-foot">'; +if (isset($vars['collection'])) { + echo elgg_view('input/hidden', array( + 'name' => 'collection_id', + 'value' => $vars['collection']->id, + )); +} +echo elgg_view('input/submit', array('name' => 'submit', 'value' => elgg_echo('save'))); +echo '</div>'; diff --git a/views/default/forms/login.php b/views/default/forms/login.php new file mode 100644 index 000000000..d2c6e6221 --- /dev/null +++ b/views/default/forms/login.php @@ -0,0 +1,49 @@ +<?php +/** + * Elgg login form + * + * @package Elgg + * @subpackage Core + */ +?> + +<div> + <label><?php echo elgg_echo('loginusername'); ?></label> + <?php echo elgg_view('input/text', array( + 'name' => 'username', + 'class' => 'elgg-autofocus', + )); + ?> +</div> +<div> + <label><?php echo elgg_echo('password'); ?></label> + <?php echo elgg_view('input/password', array('name' => 'password')); ?> +</div> + +<?php echo elgg_view('login/extend', $vars); ?> + +<div class="elgg-foot"> + <label class="mtm float-alt"> + <input type="checkbox" name="persistent" value="true" /> + <?php echo elgg_echo('user:persistent'); ?> + </label> + + <?php echo elgg_view('input/submit', array('value' => elgg_echo('login'))); ?> + + <?php + if (isset($vars['returntoreferer'])) { + echo elgg_view('input/hidden', array('name' => 'returntoreferer', 'value' => 'true')); + } + ?> + + <ul class="elgg-menu elgg-menu-general mtm"> + <?php + if (elgg_get_config('allow_registration')) { + echo '<li><a class="registration_link" href="' . elgg_get_site_url() . 'register">' . elgg_echo('register') . '</a></li>'; + } + ?> + <li><a class="forgot_link" href="<?php echo elgg_get_site_url(); ?>forgotpassword"> + <?php echo elgg_echo('user:password:lost'); ?> + </a></li> + </ul> +</div> diff --git a/views/default/forms/members/name_search.php b/views/default/forms/members/name_search.php new file mode 100644 index 000000000..5f6b9a4b6 --- /dev/null +++ b/views/default/forms/members/name_search.php @@ -0,0 +1,9 @@ +<?php + +$params = array( + 'name' => 'name', + 'class' => 'mbm', +); +echo elgg_view('input/text', $params); + +echo elgg_view('input/submit', array('value' => elgg_echo('search'))); diff --git a/views/default/forms/members/tag_search.php b/views/default/forms/members/tag_search.php new file mode 100644 index 000000000..4fe9bb32a --- /dev/null +++ b/views/default/forms/members/tag_search.php @@ -0,0 +1,12 @@ +<?php +/** + * Simple members search by tag form + */ + +$params = array( + 'name' => 'tag', + 'class' => 'mbm', +); +echo elgg_view('input/text', $params); + +echo elgg_view('input/submit', array('value' => elgg_echo('search'))); diff --git a/views/default/forms/plugins/settings/save.php b/views/default/forms/plugins/settings/save.php new file mode 100644 index 000000000..dc7b2fef7 --- /dev/null +++ b/views/default/forms/plugins/settings/save.php @@ -0,0 +1,31 @@ +<?php +/** + * Used to show plugin settings for both users and admins. + * + * @package Elgg.Core + * @subpackage Plugins + */ + +$plugin = $vars['entity']; +$plugin_id = $plugin->getID(); +$user_guid = elgg_extract('user_guid', $vars, elgg_get_logged_in_user_guid()); + +// Do we want to show admin settings or user settings +$type = elgg_extract('type', $vars, ''); + +if ($type != 'user') { + $type = ''; +} + +if (elgg_view_exists("{$type}settings/$plugin_id/edit")) { + elgg_deprecated_notice("{$type}settings/$plugin_id/edit was deprecated in favor of plugins/$plugin_id/{$type}settings", 1.8); + echo elgg_view("{$type}settings/$plugin_id/edit", $vars); +} else { + echo elgg_view("plugins/$plugin_id/{$type}settings", $vars); +} + +echo '<div class="elgg-foot">'; +echo elgg_view('input/hidden', array('name' => 'plugin_id', 'value' => $plugin_id)); +echo elgg_view('input/hidden', array('name' => 'user_guid', 'value' => $user_guid)); +echo elgg_view('input/submit', array('value' => elgg_echo('save'))); +echo '</div>'; diff --git a/views/default/forms/plugins/usersettings/save.php b/views/default/forms/plugins/usersettings/save.php new file mode 100644 index 000000000..ced88f818 --- /dev/null +++ b/views/default/forms/plugins/usersettings/save.php @@ -0,0 +1,14 @@ +<?php +/** + * Plugin user settings + * + * Calls the plugin admin settings form body with type set to 'user' + * + * @package Elgg.Core + * @subpackage Plugins + */ + +$vars['type'] = 'user'; + +// Can't use elgg_view_form() because it overrides the $vars['action'] parameter +echo elgg_view('forms/plugins/settings/save', $vars);
\ No newline at end of file diff --git a/views/default/forms/profile/edit.php b/views/default/forms/profile/edit.php new file mode 100644 index 000000000..9538b779e --- /dev/null +++ b/views/default/forms/profile/edit.php @@ -0,0 +1,68 @@ +<?php +/** + * Edit profile form + * + * @uses vars['entity'] + */ + +?> + +<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 + +$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 { + $value = $metadata->value; + $access_id = $metadata->access_id; + } + } else { + $value = ''; + $access_id = ACCESS_DEFAULT; + } + +?> +<div> + <label><?php echo elgg_echo("profile:{$shortname}") ?></label> + <?php + $params = array( + 'name' => $shortname, + 'value' => $value, + ); + echo elgg_view("input/{$valtype}", $params); + $params = array( + 'name' => "accesslevel[$shortname]", + 'value' => $access_id, + ); + echo elgg_view('input/access', $params); + ?> +</div> +<?php + } +} +?> +<div class="elgg-foot"> +<?php + echo elgg_view('input/hidden', array('name' => 'guid', 'value' => $vars['entity']->guid)); + echo elgg_view('input/submit', array('value' => elgg_echo('save'))); +?> +</div> diff --git a/views/default/forms/profile/fields/add.php b/views/default/forms/profile/fields/add.php new file mode 100644 index 000000000..2087ec299 --- /dev/null +++ b/views/default/forms/profile/fields/add.php @@ -0,0 +1,29 @@ +<?php +/** + * Add a new field to the set of custom profile fields + */ + +$label_text = elgg_echo('profile:label'); +$type_text = elgg_echo('profile:type'); + +$label_control = elgg_view('input/text', array('name' => 'label')); +$type_control = elgg_view('input/dropdown', array('name' => 'type', 'options_values' => array( + 'text' => elgg_echo('profile:field:text'), + 'longtext' => elgg_echo('profile:field:longtext'), + 'tags' => elgg_echo('profile:field:tags'), + 'url' => elgg_echo('profile:field:url'), + 'email' => elgg_echo('profile:field:email'), + 'location' => elgg_echo('profile:field:location'), + 'date' => elgg_echo('profile:field:date'), +))); + +$submit_control = elgg_view('input/submit', array('name' => elgg_echo('add'), 'value' => elgg_echo('add'))); + +$formbody = <<< END + <div>$label_text: $label_control</div> + <div class="elgg-foot">$type_text: $type_control + $submit_control</div> +END; + +echo elgg_autop(elgg_echo('profile:explainchangefields')); +echo $formbody; diff --git a/views/default/forms/register.php b/views/default/forms/register.php new file mode 100644 index 000000000..c0ee66f76 --- /dev/null +++ b/views/default/forms/register.php @@ -0,0 +1,80 @@ +<?php +/** + * Elgg register form + * + * @package Elgg + * @subpackage Core + */ + +elgg_load_js('elgg.register'); + +$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'); +} + +?> +<div class="mtm"> + <label><?php echo elgg_echo('name'); ?></label><br /> + <?php + echo elgg_view('input/text', array( + 'name' => 'name', + 'value' => $name, + 'class' => 'elgg-autofocus', + )); + ?> +</div> +<div> + <label><?php echo elgg_echo('email'); ?></label><br /> + <?php + echo elgg_view('input/text', array( + 'name' => 'email', + 'value' => $email, + )); + ?> +</div> +<div> + <label><?php echo elgg_echo('username'); ?></label><br /> + <?php + echo elgg_view('input/text', array( + 'name' => 'username', + 'value' => $username, + )); + ?> +</div> +<div> + <label><?php echo elgg_echo('password'); ?></label><br /> + <?php + echo elgg_view('input/password', array( + 'name' => 'password', + 'value' => $password, + )); + ?> +</div> +<div> + <label><?php echo elgg_echo('passwordagain'); ?></label><br /> + <?php + echo elgg_view('input/password', array( + 'name' => 'password2', + 'value' => $password2, + )); + ?> +</div> + +<?php +// view to extend to add more fields to the registration form +echo elgg_view('register/extend', $vars); + +// Add captcha hook +echo elgg_view('input/captcha', $vars); + +echo '<div class="elgg-foot">'; +echo elgg_view('input/hidden', array('name' => 'friend_guid', 'value' => $vars['friend_guid'])); +echo elgg_view('input/hidden', array('name' => 'invitecode', 'value' => $vars['invitecode'])); +echo elgg_view('input/submit', array('name' => 'submit', 'value' => elgg_echo('register'))); +echo '</div>'; diff --git a/views/default/forms/user/passwordreset.php b/views/default/forms/user/passwordreset.php new file mode 100644 index 000000000..5946fa7c0 --- /dev/null +++ b/views/default/forms/user/passwordreset.php @@ -0,0 +1,20 @@ +<?php +/** + * Reset user password form + */ + +echo elgg_autop(elgg_echo('user:resetpassword:reset_password_confirm')); + +echo elgg_view('input/hidden', array( + 'name' => 'u', + 'value' => $vars['guid'], +)); + +echo elgg_view('input/hidden', array( + 'name' => 'c', + 'value' => $vars['code'], +)); + +echo elgg_view('input/submit', array( + 'value' => elgg_echo('resetpassword') +)); diff --git a/views/default/forms/user/requestnewpassword.php b/views/default/forms/user/requestnewpassword.php new file mode 100644 index 000000000..c90971eaf --- /dev/null +++ b/views/default/forms/user/requestnewpassword.php @@ -0,0 +1,24 @@ +<?php +/** + * Elgg forgotten password. + * + * @package Elgg + * @subpackage Core + */ +?> + +<div class="mtm"> + <?php echo elgg_echo('user:password:text'); ?> +</div> +<div> + <label><?php echo elgg_echo('loginusername'); ?></label><br /> + <?php echo elgg_view('input/text', array( + 'name' => 'username', + 'class' => 'elgg-autofocus', + )); + ?> +</div> +<?php echo elgg_view('input/captcha'); ?> +<div class="elgg-foot"> + <?php echo elgg_view('input/submit', array('value' => elgg_echo('request'))); ?> +</div> diff --git a/views/default/forms/useradd.php b/views/default/forms/useradd.php new file mode 100644 index 000000000..4f337e4e4 --- /dev/null +++ b/views/default/forms/useradd.php @@ -0,0 +1,78 @@ +<?php +/** + * Elgg add user form. + * + * @package Elgg + * @subpackage Core + * + */ + +$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('name');?></label><br /> + <?php + echo elgg_view('input/text', array( + 'name' => 'name', + 'value' => $name, + )); + ?> +</div> +<div> + <label><?php echo elgg_echo('username'); ?></label><br /> + <?php + echo elgg_view('input/text', array( + 'name' => 'username', + 'value' => $username, + )); + ?> +</div> +<div> + <label><?php echo elgg_echo('email'); ?></label><br /> + <?php + echo elgg_view('input/text', array( + 'name' => 'email', + 'value' => $email, + )); + ?> +</div> +<div> + <label><?php echo elgg_echo('password'); ?></label><br /> + <?php + echo elgg_view('input/password', array( + 'name' => 'password', + 'value' => $password, + )); + ?> +</div> +<div> + <label><?php echo elgg_echo('passwordagain'); ?></label><br /> + <?php + echo elgg_view('input/password', array( + 'name' => 'password2', + 'value' => $password2, + )); + ?> +</div> +<div> +<?php + echo elgg_view('input/checkboxes', array( + 'name' => "admin", + 'options' => array(elgg_echo('admin_option') => 1), + 'value' => $admin, + )); +?> +</div> + +<div class="elgg-foot"> + <?php echo elgg_view('input/submit', array('value' => elgg_echo('register'))); ?> +</div>
\ No newline at end of file diff --git a/views/default/forms/usersettings/save.php b/views/default/forms/usersettings/save.php new file mode 100644 index 000000000..71323083f --- /dev/null +++ b/views/default/forms/usersettings/save.php @@ -0,0 +1,14 @@ +<?php +/** + * User account settings. + * + * Plugins should extend "forms/account/settings" to add to the settings. + */ + +$form_body = elgg_view("forms/account/settings", $vars); + +$form_body .= '<div class="elgg-foot">'; +$form_body .= elgg_view('input/submit', array('value' => elgg_echo('save'))); +$form_body .= '</div>'; + +echo $form_body;
\ No newline at end of file diff --git a/views/default/forms/widgets/save.php b/views/default/forms/widgets/save.php new file mode 100644 index 000000000..6959b2a82 --- /dev/null +++ b/views/default/forms/widgets/save.php @@ -0,0 +1,41 @@ +<?php +/** + * Elgg widget edit settings + * + * @uses $vars['widget'] + * @uses $vars['show_access'] + */ + +$widget = $vars['widget']; +$show_access = elgg_extract('show_access', $vars, true); + +$edit_view = "widgets/$widget->handler/edit"; +$custom_form_section = elgg_view($edit_view, array('entity' => $widget)); + +$access = ''; +if ($show_access) { + $access = elgg_echo('access') . ': ' . elgg_view('input/access', array( + 'name' => 'params[access_id]', + 'value' => $widget->access_id, + )); +} + +if (!$custom_form_section && !$access) { + return true; +} + +$hidden = elgg_view('input/hidden', array('name' => 'guid', 'value' => $widget->guid)); +$submit = elgg_view('input/submit', array('value' => elgg_echo('save'))); + +$body = <<<___END + $custom_form_section + <div> + $access + </div> + <div class="elgg-foot"> + $hidden + $submit + </div> +___END; + +echo $body; |