diff options
Diffstat (limited to 'views/default/forms')
27 files changed, 984 insertions, 77 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/regenerate_secret.php b/views/default/forms/admin/site/regenerate_secret.php new file mode 100644 index 000000000..af269b801 --- /dev/null +++ b/views/default/forms/admin/site/regenerate_secret.php @@ -0,0 +1,24 @@ +<?php + +$strength = $vars['strength']; + +?> +<p><?php echo elgg_echo('admin:site:secret:intro'); ?></p> + +<table class="elgg-table"> + <tr> + <th><?php echo elgg_echo('site_secret:current_strength'); ?></th> + <td class="elgg-strength-<?php echo $strength; ?>"> + <h4><?php echo elgg_echo("site_secret:strength:$strength"); ?></h4> + <div><?php echo elgg_echo("site_secret:strength_msg:$strength"); ?></div> + </td> + </tr> +</table> + +<div class="elgg-foot"> + <?php echo elgg_view('input/submit', array( + 'value' => elgg_echo('admin:site:secret:regenerate'), + 'class' => 'elgg-requires-confirmation elgg-button elgg-button-submit', + )); ?> + <p class="elgg-text-help mts"><?php echo elgg_echo('admin:site:secret:regenerate:help'); ?></p> +</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/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/groups/edit.php b/views/default/forms/groups/edit.php deleted file mode 100644 index 72b017832..000000000 --- a/views/default/forms/groups/edit.php +++ /dev/null @@ -1,77 +0,0 @@ -<?php -/** - * Curated Groups -- Form - * - * @package Lorea - * @subpackage CuratedGroups - * - * Copyright 2011-2012 Lorea Faeries <federation@lorea.org> - * - * This file is part of the CuratedGroups plugin for Elgg. - * - * CuratedGroups is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * CuratedGroups is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/>. - */ - - $creator=false; - // check if user is admin - if (isadminloggedin()) $creator=true; - - // check if user is one of the specified group creators - if (!$creator) { - $creators_text = str_replace(' ', '', elgg_get_plugin_setting("creators", "curatedgroups")); - $creators = explode(",", $creators_text); - if (!empty($creators)) { - if (in_array(elgg_get_logged_in_user_entity()->username, $creators)) { - $creator = true; - // Compatibility with CuratedGroups 1.0 - } elseif (in_array(elgg_get_logged_in_user_guid(), $creators)) { - $creator = true; - } - } - } - - // check if user is admin of the current group (for editing an - // existing group) - if (!$creator && isset($vars['entity'])) { - if ($vars['entity']->canEdit()) - $creator = true; - } - - // check if user is admin of the parent group if defined (for - // subgroups) - if (!$creator) { - $parent_guid = (int)get_input("parent", 0); - if (!empty($parent_guid)) { - $parent = get_entity($parent_guid); - if ($parent->canEdit()) - $creator = true; - } - } - - // show group creation form if we're a creator, otherwise show the not - // allowed message - if ($creator) { - if (elgg_is_active_plugin("subgroups")) - include elgg_get_plugins_path() . "subgroups/views/default/forms/groups/edit.php"; - else - include elgg_get_plugins_path() . "groups/views/default/forms/groups/edit.php"; - } - else { - $message = elgg_get_plugin_setting("message", "curatedgroups"); - if (empty($message)) - $message = elgg_echo("curatedgroups:message"); - echo $message; - } -?> 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..116529905 --- /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("plugins/$plugin_id/{$type}settings")) { + echo elgg_view("plugins/$plugin_id/{$type}settings", $vars); +} elseif (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); +} + +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..cb0a37ca4 --- /dev/null +++ b/views/default/forms/profile/edit.php @@ -0,0 +1,81 @@ +<?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 + +$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 { + $value = $metadata->value; + $access_id = $metadata->access_id; + } + } else { + $value = ''; + $access_id = ACCESS_DEFAULT; + } + + // sticky form values take precedence over saved ones + if (isset($sticky_values[$shortname])) { + $value = $sticky_values[$shortname]; + } + if (isset($sticky_values['accesslevel'][$shortname])) { + $access_id = $sticky_values['accesslevel'][$shortname]; + } + +?> +<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 + } +} + +elgg_clear_sticky_form('profile:edit'); + +?> +<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/profile/fields/reset.php b/views/default/forms/profile/fields/reset.php new file mode 100644 index 000000000..c0bb1b7f4 --- /dev/null +++ b/views/default/forms/profile/fields/reset.php @@ -0,0 +1,12 @@ +<?php +/** + * Reset profile fields form + */ + +echo '<div class="elgg-foot">'; +$params = array( + 'value' => elgg_echo('profile:resetdefault'), + 'class' => 'elgg-button-cancel', +); +echo elgg_view('input/submit', $params); +echo '</div>'; 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; |