diff options
Diffstat (limited to 'views/default/forms')
-rw-r--r-- | views/default/forms/account/settings.php | 2 | ||||
-rw-r--r-- | views/default/forms/admin/menu/save.php | 2 | ||||
-rw-r--r-- | views/default/forms/admin/plugins/change_state.php | 4 | ||||
-rw-r--r-- | views/default/forms/admin/plugins/filter.php | 2 | ||||
-rw-r--r-- | views/default/forms/admin/plugins/sort.php | 2 | ||||
-rw-r--r-- | views/default/forms/admin/site/update_advanced.php | 16 | ||||
-rw-r--r-- | views/default/forms/avatar/crop.php | 63 | ||||
-rw-r--r-- | views/default/forms/login.php | 38 | ||||
-rw-r--r-- | views/default/forms/plugins/settings/save.php | 2 | ||||
-rw-r--r-- | views/default/forms/plugins/usersettings/save.php | 9 | ||||
-rw-r--r-- | views/default/forms/profile/fields/add.php | 22 | ||||
-rw-r--r-- | views/default/forms/profile/fields/reset.php | 2 | ||||
-rw-r--r-- | views/default/forms/register.php | 9 | ||||
-rw-r--r-- | views/default/forms/user/requestnewpassword.php | 12 | ||||
-rw-r--r-- | views/default/forms/useradd.php | 11 | ||||
-rw-r--r-- | views/default/forms/usersettings/save.php | 8 | ||||
-rw-r--r-- | views/default/forms/widgets/save.php | 4 |
17 files changed, 99 insertions, 109 deletions
diff --git a/views/default/forms/account/settings.php b/views/default/forms/account/settings.php index 824b2280b..3967207ce 100644 --- a/views/default/forms/account/settings.php +++ b/views/default/forms/account/settings.php @@ -5,4 +5,6 @@ * 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 index 92a0784df..1a67ffcc4 100644 --- a/views/default/forms/admin/menu/save.php +++ b/views/default/forms/admin/menu/save.php @@ -64,7 +64,7 @@ $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-simple-list">'; +echo '<ul class="elgg-list elgg-list-simple">'; if (is_array($custom_items)) { foreach ($custom_items as $title => $url) { diff --git a/views/default/forms/admin/plugins/change_state.php b/views/default/forms/admin/plugins/change_state.php index ba5d873e7..730c8ff32 100644 --- a/views/default/forms/admin/plugins/change_state.php +++ b/views/default/forms/admin/plugins/change_state.php @@ -9,6 +9,7 @@ $guids = elgg_extract('guids', $vars, array()); $guids = implode(',', $guids); +echo '<div>'; echo elgg_view('input/hidden', array( 'name' => 'guids', 'value' => $guids, @@ -16,5 +17,6 @@ echo elgg_view('input/hidden', array( echo elgg_view('input/submit', array( 'value' => elgg_echo("admin:plugins:{$vars['action']}_all"), - 'class' => 'elgg-button elgg-button-action' + '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 index d00906e6a..fd1b618bc 100644 --- a/views/default/forms/admin/plugins/filter.php +++ b/views/default/forms/admin/plugins/filter.php @@ -7,6 +7,7 @@ * @uses $vvars['sort'] */ +echo '<div>'; echo elgg_view('input/dropdown', array( 'name' => 'category', 'options_values' => $vars['category_options'], @@ -22,3 +23,4 @@ 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 index 284e085e6..7f2246bad 100644 --- a/views/default/forms/admin/plugins/sort.php +++ b/views/default/forms/admin/plugins/sort.php @@ -7,6 +7,7 @@ * @uses $vars['category'] */ +echo '<div class="mtm">'; echo elgg_view('input/dropdown', array( 'name' => 'sort', 'options_values' => $vars['sort_options'], @@ -22,3 +23,4 @@ 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 index fa253967c..e12764092 100644 --- a/views/default/forms/admin/site/update_advanced.php +++ b/views/default/forms/admin/site/update_advanced.php @@ -17,26 +17,26 @@ foreach (array('wwwroot', 'path', 'dataroot') as $field) { } $form_body .= "<div>" . elgg_echo('admin:site:access:warning') . "<br />"; -$form_body .= elgg_echo('installation:sitepermissions'); +$form_body .= "<label>" . elgg_echo('installation:sitepermissions') . "</label>"; $form_body .= elgg_view('input/access', array( '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')), + 'options' => array(elgg_echo('installation:allow_user_default_access:label') => elgg_echo('installation:allow_user_default_access:label')), 'name' => 'allow_user_default_access', 'value' => (elgg_get_config('allow_user_default_access') ? elgg_echo('installation:allow_user_default_access:label') : ""), )) . "</div>"; $form_body .= "<div>" . elgg_echo('installation:simplecache:description') . "<br />"; $form_body .= elgg_view("input/checkboxes", array( - 'options' => array(elgg_echo('installation:simplecache:label')), + 'options' => array(elgg_echo('installation:simplecache:label') => elgg_echo('installation:simplecache:label')), 'name' => 'simplecache_enabled', 'value' => (elgg_get_config('simplecache_enabled') ? elgg_echo('installation:simplecache:label') : ""), )) . "</div>"; $form_body .= "<div>" . elgg_echo('installation:viewpathcache:description') . "<br />"; $form_body .= elgg_view("input/checkboxes", array( - 'options' => array(elgg_echo('installation:viewpathcache:label')), + 'options' => array(elgg_echo('installation:viewpathcache:label') => elgg_echo('installation:viewpathcache:label')), 'name' => 'viewpath_cache_enabled', 'value' => (elgg_get_config('viewpath_cache_enabled') ? elgg_echo('installation:viewpathcache:label') : ""), )) . "</div>"; @@ -52,7 +52,7 @@ $form_body .= '</div>'; // control new user registration $options = array( - 'options' => array(elgg_echo('installation:registration:label')), + 'options' => array(elgg_echo('installation:registration:label') => elgg_echo('installation:registration:label')), 'name' => 'allow_registration', 'value' => elgg_get_config('allow_registration') ? elgg_echo('installation:registration:label') : '', ); @@ -62,7 +62,7 @@ $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')), + 'options' => array(elgg_echo('installation:walled_garden:label') => elgg_echo('installation:walled_garden:label')), 'name' => 'walled_garden', 'value' => $walled_garden ? elgg_echo('installation:walled_garden:label') : '', ); @@ -71,7 +71,7 @@ $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')), + 'options' => array(elgg_echo('installation:httpslogin:label') => elgg_echo('installation:httpslogin:label')), 'name' => 'https_login', 'value' => (elgg_get_config('https_login') ? elgg_echo('installation:httpslogin:label') : "") )) . "</div>"; @@ -83,7 +83,7 @@ if ($disable_api) { $on = (disable_api ? "" : elgg_echo('installation:disableapi:label')); } $form_body .= elgg_view("input/checkboxes", array( - 'options' => array(elgg_echo('installation:disableapi:label')), + 'options' => array(elgg_echo('installation:disableapi:label') => elgg_echo('installation:disableapi:label')), 'name' => 'api', 'value' => $on, )); diff --git a/views/default/forms/avatar/crop.php b/views/default/forms/avatar/crop.php index dc5e3d77f..3e798cb27 100644 --- a/views/default/forms/avatar/crop.php +++ b/views/default/forms/avatar/crop.php @@ -5,11 +5,27 @@ * @uses $vars['entity'] */ -$master_image = $vars['entity']->getIcon('master'); +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"> - <img id="user-avatar" class="mrl" src="<?php echo $master_image; ?>" alt="<?php echo elgg_echo('avatar'); ?>" /> + <?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 @@ -24,46 +40,3 @@ echo elgg_view('input/submit', array('value' => elgg_echo('avatar:create'))); ?> </div> -<!-- grab the required js for icon cropping --> -<script type="text/javascript" src="<?php echo elgg_get_site_url(); ?>vendors/jquery/jquery.imgareaselect-0.9.8/scripts/jquery.imgareaselect.min.js"></script> -<link rel="stylesheet" type="text/css" href="<?php echo elgg_get_site_url(); ?>vendors/jquery/jquery.imgareaselect-0.9.8/css/imgareaselect-deprecated.css" media="screen" /> -<?php //@todo JS 1.8: no ?> -<script type="text/javascript"> - - // display a preview of the users cropped section - function preview(img, selection) { - // catch for the first click on the image - if (selection.width == 0 || selection.height == 0) { - return; - } - - var origWidth = $("#user-avatar").width(); //get the width of the users master photo - var origHeight = $("#user-avatar").height(); //get the height of the users master photo - var scaleX = 100 / selection.width; - var scaleY = 100 / selection.height; - $('#user-avatar-preview > img').css({ - width: Math.round(scaleX * origWidth) + 'px', - height: Math.round(scaleY * origHeight) + 'px', - marginLeft: '-' + Math.round(scaleX * selection.x1) + 'px', - marginTop: '-' + Math.round(scaleY * selection.y1) + 'px' - }); - } - - function selectChange(img, selection) { - // populate the form with the correct coordinates once a user has cropped their image - $('input[name=x1]').val(selection.x1); - $('input[name=x2]').val(selection.x2); - $('input[name=y1]').val(selection.y1); - $('input[name=y2]').val(selection.y2); - } - - $(document).ready(function() { - $('<div id="user-avatar-preview"><img src="<?php echo $master_image; ?>" /></div>').insertAfter($('#user-avatar')); - $('<div id="user-avatar-preview-title"><label><?php echo elgg_echo('avatar:preview'); ?></label></div>').insertBefore($('#user-avatar-preview')); - - // this produces the coordinates - $('#user-avatar').imgAreaSelect({ selectionOpacity: 0, onSelectEnd: selectChange }); - // show the preview - $('#user-avatar').imgAreaSelect({ aspectRatio: '1:1', onSelectChange: preview }); - }); -</script> diff --git a/views/default/forms/login.php b/views/default/forms/login.php index 5cfdcd4c6..6f6cc9906 100644 --- a/views/default/forms/login.php +++ b/views/default/forms/login.php @@ -9,7 +9,11 @@ <div> <label><?php echo elgg_echo('loginusername'); ?></label> - <?php echo elgg_view('input/text', array('name' => 'username')); ?> + <?php echo elgg_view('input/text', array( + 'name' => 'username', + 'class' => 'elgg-autofocus', + )); + ?> </div> <div> <label><?php echo elgg_echo('password'); ?></label> @@ -18,28 +22,28 @@ <?php echo elgg_view('login/extend'); ?> -<div> - <?php echo elgg_view('input/submit', array('value' => elgg_echo('login'))); ?> - - <label class="right mtm"> +<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 ($vars['returntoreferer']) { + if (isset($vars['returntoreferer'])) { echo elgg_view('input/hidden', array('name' => 'returntoreferer', 'value' => 'true')); } ?> -</div> -<ul class="elgg-menu elgg-menu-footer"> -<?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="forgotten_password_link" href="<?php echo elgg_get_site_url(); ?>forgotpassword"> - <?php echo elgg_echo('user:password:lost'); ?> - </a></li> -</ul>
\ No newline at end of file + <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/plugins/settings/save.php b/views/default/forms/plugins/settings/save.php index c3d8f231f..dc7b2fef7 100644 --- a/views/default/forms/plugins/settings/save.php +++ b/views/default/forms/plugins/settings/save.php @@ -1,6 +1,6 @@ <?php /** - * Used to show plugin user settings. + * Used to show plugin settings for both users and admins. * * @package Elgg.Core * @subpackage Plugins diff --git a/views/default/forms/plugins/usersettings/save.php b/views/default/forms/plugins/usersettings/save.php index bf243ae6b..ced88f818 100644 --- a/views/default/forms/plugins/usersettings/save.php +++ b/views/default/forms/plugins/usersettings/save.php @@ -1,4 +1,13 @@ <?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 diff --git a/views/default/forms/profile/fields/add.php b/views/default/forms/profile/fields/add.php index 7961037e6..1ea9c57a9 100644 --- a/views/default/forms/profile/fields/add.php +++ b/views/default/forms/profile/fields/add.php @@ -1,8 +1,6 @@ <?php /** - * Elgg profile index - * - * @package ElggProfile + * Add a new field to the set of custom profile fields */ $label_text = elgg_echo('profile:label'); @@ -10,19 +8,21 @@ $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('text'), - 'longtext' => elgg_echo('longtext'), - 'tags' => elgg_echo('tags'), - 'url' => elgg_echo('url'), - 'email' => elgg_echo('email') + '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 - <p>$label_text: $label_control - $type_text: $type_control - $submit_control</p> + <div>$label_text: $label_control</div> + <div class="elgg-foot">$type_text: $type_control + $submit_control</div> END; echo autop(elgg_echo('profile:explainchangefields')); diff --git a/views/default/forms/profile/fields/reset.php b/views/default/forms/profile/fields/reset.php index 4e0f51dc6..c0bb1b7f4 100644 --- a/views/default/forms/profile/fields/reset.php +++ b/views/default/forms/profile/fields/reset.php @@ -3,8 +3,10 @@ * 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 index 4e0a521ab..411152205 100644 --- a/views/default/forms/register.php +++ b/views/default/forms/register.php @@ -23,6 +23,7 @@ if (elgg_is_sticky_form('register')) { echo elgg_view('input/text', array( 'name' => 'name', 'value' => $name, + 'class' => 'elgg-autofocus', )); ?> </div> @@ -70,12 +71,8 @@ echo elgg_view('register/extend'); // Add captcha hook echo elgg_view('input/captcha'); +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'))); -?> -<script type="text/javascript"> - $(function() { - $('input[name=name]').focus(); - }); -</script>
\ No newline at end of file +echo '</div>'; diff --git a/views/default/forms/user/requestnewpassword.php b/views/default/forms/user/requestnewpassword.php index 22357e728..8a5a18734 100644 --- a/views/default/forms/user/requestnewpassword.php +++ b/views/default/forms/user/requestnewpassword.php @@ -12,15 +12,13 @@ </div> <div> <label><?php echo elgg_echo('username'); ?></label><br /> - <?php echo elgg_view('input/text', array('name' => 'username')); ?> + <?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> -<?php //@todo JS 1.8: no ?> -<script type="text/javascript"> - $(document).ready(function() { - $('input[name=username]').focus(); - }); -</script>
\ No newline at end of file diff --git a/views/default/forms/useradd.php b/views/default/forms/useradd.php index 66f8846e2..4f337e4e4 100644 --- a/views/default/forms/useradd.php +++ b/views/default/forms/useradd.php @@ -17,10 +17,6 @@ if (elgg_is_sticky_form('useradd')) { } } -$admin_option = false; -if ((elgg_get_logged_in_user_entity()->isAdmin()) && ($vars['show_admin'])) { - $admin_option = true; -} ?> <div> <label><?php echo elgg_echo('name');?></label><br /> @@ -67,18 +63,15 @@ if ((elgg_get_logged_in_user_entity()->isAdmin()) && ($vars['show_admin'])) { )); ?> </div> - +<div> <?php -if ($admin_option) { - echo "<div>"; echo elgg_view('input/checkboxes', array( 'name' => "admin", 'options' => array(elgg_echo('admin_option') => 1), 'value' => $admin, )); - echo "</div>"; -} ?> +</div> <div class="elgg-foot"> <?php echo elgg_view('input/submit', array('value' => elgg_echo('register'))); ?> diff --git a/views/default/forms/usersettings/save.php b/views/default/forms/usersettings/save.php index ea53f2571..71323083f 100644 --- a/views/default/forms/usersettings/save.php +++ b/views/default/forms/usersettings/save.php @@ -1,5 +1,11 @@ <?php -$form_body = elgg_view("forms/account/settings"); +/** + * 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'))); diff --git a/views/default/forms/widgets/save.php b/views/default/forms/widgets/save.php index 4ba911cb5..6959b2a82 100644 --- a/views/default/forms/widgets/save.php +++ b/views/default/forms/widgets/save.php @@ -14,7 +14,7 @@ $custom_form_section = elgg_view($edit_view, array('entity' => $widget)); $access = ''; if ($show_access) { - $access = elgg_view('input/access', array( + $access = elgg_echo('access') . ': ' . elgg_view('input/access', array( 'name' => 'params[access_id]', 'value' => $widget->access_id, )); @@ -38,4 +38,4 @@ $body = <<<___END </div> ___END; -echo $body;
\ No newline at end of file +echo $body; |