aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2011-06-27 07:26:16 -0400
committerCash Costello <cash.costello@gmail.com>2011-06-27 07:26:16 -0400
commitd450c043eeabbe5d0d5466cba59045fd3a1888c9 (patch)
tree0702d87fb9d50193119cbd27422490bc6952401a
parente82534d0bceb80f7a9e7ba8f00748ee1eb32b214 (diff)
downloadelgg-d450c043eeabbe5d0d5466cba59045fd3a1888c9.tar.gz
elgg-d450c043eeabbe5d0d5466cba59045fd3a1888c9.tar.bz2
Refs #3407 using elgg-form and elgg-foot in core forms. Plugins next
-rw-r--r--mod/blog/lib/blog.php1
-rw-r--r--mod/blog/views/default/forms/blog/save.php2
-rw-r--r--mod/groups/lib/groups.php2
-rw-r--r--mod/groups/views/default/forms/groups/edit.php2
-rw-r--r--mod/groups/views/default/forms/groups/invite.php2
-rw-r--r--mod/groups/views/default/groups/edit.php5
-rw-r--r--mod/notifications/views/default/forms/notificationsettings/save.php7
-rw-r--r--mod/notifications/views/default/notifications/subscriptions/form.php2
-rw-r--r--mod/notifications/views/default/notifications/subscriptions/forminternals.php8
-rw-r--r--views/default/core/settings/account.php2
-rw-r--r--views/default/css/elements/forms.php4
-rw-r--r--views/default/forms/avatar/crop.php2
-rw-r--r--views/default/forms/avatar/upload.php2
-rw-r--r--views/default/forms/comments/add.php2
-rw-r--r--views/default/forms/friends/collections/add.php4
-rw-r--r--views/default/forms/plugins/settings/save.php4
-rw-r--r--views/default/forms/profile/edit.php2
-rw-r--r--views/default/forms/user/requestnewpassword.php2
-rw-r--r--views/default/forms/useradd.php2
-rw-r--r--views/default/forms/usersettings/save.php2
-rw-r--r--views/default/forms/widgets/save.php2
-rw-r--r--views/default/input/form.php15
22 files changed, 42 insertions, 34 deletions
diff --git a/mod/blog/lib/blog.php b/mod/blog/lib/blog.php
index d13b2244e..0f81597eb 100644
--- a/mod/blog/lib/blog.php
+++ b/mod/blog/lib/blog.php
@@ -262,6 +262,7 @@ function blog_get_page_content_edit($page, $guid = 0, $revision = NULL) {
$vars = array();
$vars['id'] = 'blog-post-edit';
$vars['name'] = 'blog_post';
+ $vars['class'] = 'elgg-form-alt';
if ($page == 'edit') {
$blog = get_entity((int)$guid);
diff --git a/mod/blog/views/default/forms/blog/save.php b/mod/blog/views/default/forms/blog/save.php
index d99f45f01..79309b6ef 100644
--- a/mod/blog/views/default/forms/blog/save.php
+++ b/mod/blog/views/default/forms/blog/save.php
@@ -150,7 +150,7 @@ $body_input
$categories_input
-<div class="elgg-form-footer-alt">
+<div class="elgg-foot">
<div class="elgg-subtext mbm">
$save_status <span class="blog-save-status-time">$saved</span>
</div>
diff --git a/mod/groups/lib/groups.php b/mod/groups/lib/groups.php
index c47ad0ab2..2747f360b 100644
--- a/mod/groups/lib/groups.php
+++ b/mod/groups/lib/groups.php
@@ -350,7 +350,7 @@ function groups_handle_invite_page($guid) {
if ($group && $group->canEdit()) {
$content = elgg_view_form('groups/invite', array(
'id' => 'invite_to_group',
- 'class' => 'mtm',
+ 'class' => 'elgg-form-alt mtm',
), array(
'entity' => $group,
));
diff --git a/mod/groups/views/default/forms/groups/edit.php b/mod/groups/views/default/forms/groups/edit.php
index b67134c63..26436ef01 100644
--- a/mod/groups/views/default/forms/groups/edit.php
+++ b/mod/groups/views/default/forms/groups/edit.php
@@ -126,7 +126,7 @@ if ($tools) {
}
}
?>
-<div class="elgg-form-footer-alt">
+<div class="elgg-foot">
<?php
if (isset($vars['entity'])) {
diff --git a/mod/groups/views/default/forms/groups/invite.php b/mod/groups/views/default/forms/groups/invite.php
index 83139c2ee..ef3131782 100644
--- a/mod/groups/views/default/forms/groups/invite.php
+++ b/mod/groups/views/default/forms/groups/invite.php
@@ -12,7 +12,7 @@ $friends = elgg_get_logged_in_user_entity()->getFriends('', 0);
if ($friends) {
echo elgg_view('input/friendspicker', array('entities' => $friends, 'name' => 'user_guid', 'highlight' => 'all'));
- echo '<div class="elgg-form-footer">';
+ echo '<div class="elgg-foot">';
echo elgg_view('input/hidden', array('name' => 'forward_url', 'value' => $forward_url));
echo elgg_view('input/hidden', array('name' => 'group_guid', 'value' => $group->guid));
echo elgg_view('input/submit', array('value' => elgg_echo('invite')));
diff --git a/mod/groups/views/default/groups/edit.php b/mod/groups/views/default/groups/edit.php
index 5076cc49a..24a1c3f1e 100644
--- a/mod/groups/views/default/groups/edit.php
+++ b/mod/groups/views/default/groups/edit.php
@@ -7,6 +7,9 @@
$entity = elgg_extract('entity', $vars, null);
-$form_vars = array('enctype' => 'multipart/form-data');
+$form_vars = array(
+ 'enctype' => 'multipart/form-data',
+ 'class' => 'elgg-form-alt',
+);
$body_vars = array('entity' => $entity);
echo elgg_view_form('groups/edit', $form_vars, $body_vars);
diff --git a/mod/notifications/views/default/forms/notificationsettings/save.php b/mod/notifications/views/default/forms/notificationsettings/save.php
index 0306080b8..ff32d8558 100644
--- a/mod/notifications/views/default/forms/notificationsettings/save.php
+++ b/mod/notifications/views/default/forms/notificationsettings/save.php
@@ -5,4 +5,9 @@
echo elgg_view('notifications/subscriptions/personal');
echo elgg_view('notifications/subscriptions/collections');
-echo elgg_view('notifications/subscriptions/forminternals'); \ No newline at end of file
+echo elgg_view('notifications/subscriptions/forminternals');
+
+?>
+<div class="elgg-foot">
+<?php echo elgg_view('input/submit', array('value' => elgg_echo('save'))); ?>
+</div>
diff --git a/mod/notifications/views/default/notifications/subscriptions/form.php b/mod/notifications/views/default/notifications/subscriptions/form.php
index 008e98554..f2f6238f9 100644
--- a/mod/notifications/views/default/notifications/subscriptions/form.php
+++ b/mod/notifications/views/default/notifications/subscriptions/form.php
@@ -8,4 +8,4 @@ echo elgg_view('subscriptions/form/additions',$vars);
// Display a description
-echo elgg_view_form('notificationsettings/save');
+echo elgg_view_form('notificationsettings/save', array('class' => 'elgg-form-alt'));
diff --git a/mod/notifications/views/default/notifications/subscriptions/forminternals.php b/mod/notifications/views/default/notifications/subscriptions/forminternals.php
index b059db487..106eadc54 100644
--- a/mod/notifications/views/default/notifications/subscriptions/forminternals.php
+++ b/mod/notifications/views/default/notifications/subscriptions/forminternals.php
@@ -324,12 +324,4 @@ if (!isset($vars['replacement'])) {
}
?>
-
- <div class="elgg-form-footer-alt">
-<?php
-echo elgg_view('input/submit', array(
- 'value' => elgg_echo('save'),
-));
-?>
- </p>
</div>
diff --git a/views/default/core/settings/account.php b/views/default/core/settings/account.php
index 22a58c58a..0c3792ece 100644
--- a/views/default/core/settings/account.php
+++ b/views/default/core/settings/account.php
@@ -6,4 +6,4 @@
* @subpackage Core
*/
-echo elgg_view_form('usersettings/save'); \ No newline at end of file
+echo elgg_view_form('usersettings/save', array('class' => 'elgg-form-alt')); \ No newline at end of file
diff --git a/views/default/css/elements/forms.php b/views/default/css/elements/forms.php
index af7b2be19..5924b8134 100644
--- a/views/default/css/elements/forms.php
+++ b/views/default/css/elements/forms.php
@@ -16,9 +16,7 @@ fieldset > div {
fieldset > div:last-child {
margin-bottom: 0;
}
-.elgg-form-footer {
-}
-.elgg-form-footer-alt {
+.elgg-form-alt > fieldset > .elgg-foot {
border-top: 1px solid #CCC;
padding: 10px 0;
}
diff --git a/views/default/forms/avatar/crop.php b/views/default/forms/avatar/crop.php
index 3deec66bd..68b5a69eb 100644
--- a/views/default/forms/avatar/crop.php
+++ b/views/default/forms/avatar/crop.php
@@ -11,7 +11,7 @@ $master_image = $vars['entity']->getIcon('master');
<div class="clearfix">
<img id="user-avatar" class="mrl" src="<?php echo $master_image; ?>" alt="<?php echo elgg_echo('avatar'); ?>" />
</div>
-<div>
+<div class="elgg-foot">
<?php
$coords = array('x1', 'x2', 'y1', 'y2');
foreach ($coords as $coord) {
diff --git a/views/default/forms/avatar/upload.php b/views/default/forms/avatar/upload.php
index b099b8c4c..d91e8575e 100644
--- a/views/default/forms/avatar/upload.php
+++ b/views/default/forms/avatar/upload.php
@@ -10,7 +10,7 @@
<label><?php echo elgg_echo("avatar:upload"); ?></label><br />
<?php echo elgg_view("input/file",array('name' => 'avatar')); ?>
</div>
-<div class="elgg-form-footer">
+<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
index 40e574338..9acabf3ea 100644
--- a/views/default/forms/comments/add.php
+++ b/views/default/forms/comments/add.php
@@ -22,7 +22,7 @@ if (isset($vars['entity']) && elgg_is_logged_in()) {
<label><?php echo elgg_echo("generic_comments:add"); ?></label>
<?php echo elgg_view('input/longtext', array('name' => 'generic_comment')); ?>
</div>
- <div>
+ <div class="elgg-foot">
<?php
echo elgg_view('input/submit', array('value' => elgg_echo("generic_comments:post")));
?>
diff --git a/views/default/forms/friends/collections/add.php b/views/default/forms/friends/collections/add.php
index 644c7adb9..04c87346b 100644
--- a/views/default/forms/friends/collections/add.php
+++ b/views/default/forms/friends/collections/add.php
@@ -42,7 +42,7 @@ echo elgg_view('input/friendspicker', array(
));
echo "</div>";
-echo "<div>";
+echo '<div class="elgg-foot">';
if (isset($vars['collection'])) {
echo elgg_view('input/hidden', array(
'name' => 'collection_id',
@@ -50,4 +50,4 @@ if (isset($vars['collection'])) {
));
}
echo elgg_view('input/submit', array('name' => 'submit', 'value' => elgg_echo('save')));
-echo "</div>";
+echo '</div>';
diff --git a/views/default/forms/plugins/settings/save.php b/views/default/forms/plugins/settings/save.php
index efe6d7792..c3d8f231f 100644
--- a/views/default/forms/plugins/settings/save.php
+++ b/views/default/forms/plugins/settings/save.php
@@ -24,8 +24,8 @@ if (elgg_view_exists("{$type}settings/$plugin_id/edit")) {
echo elgg_view("plugins/$plugin_id/{$type}settings", $vars);
}
-echo "<div>";
+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>";
+echo '</div>';
diff --git a/views/default/forms/profile/edit.php b/views/default/forms/profile/edit.php
index aaf9ac01e..222935344 100644
--- a/views/default/forms/profile/edit.php
+++ b/views/default/forms/profile/edit.php
@@ -59,7 +59,7 @@ if (is_array($profile_fields) && count($profile_fields) > 0) {
}
}
?>
-<div>
+<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')));
diff --git a/views/default/forms/user/requestnewpassword.php b/views/default/forms/user/requestnewpassword.php
index 970938327..22357e728 100644
--- a/views/default/forms/user/requestnewpassword.php
+++ b/views/default/forms/user/requestnewpassword.php
@@ -15,7 +15,7 @@
<?php echo elgg_view('input/text', array('name' => 'username')); ?>
</div>
<?php echo elgg_view('input/captcha'); ?>
-<div>
+<div class="elgg-foot">
<?php echo elgg_view('input/submit', array('value' => elgg_echo('request'))); ?>
</div>
<?php //@todo JS 1.8: no ?>
diff --git a/views/default/forms/useradd.php b/views/default/forms/useradd.php
index fcb93a6c6..66f8846e2 100644
--- a/views/default/forms/useradd.php
+++ b/views/default/forms/useradd.php
@@ -80,6 +80,6 @@ if ($admin_option) {
}
?>
-<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
index 35871144b..ea53f2571 100644
--- a/views/default/forms/usersettings/save.php
+++ b/views/default/forms/usersettings/save.php
@@ -1,7 +1,7 @@
<?php
$form_body = elgg_view("forms/account/settings");
-$form_body .= '<div class="elgg-form-footer-alt">';
+$form_body .= '<div class="elgg-foot">';
$form_body .= elgg_view('input/submit', array('value' => elgg_echo('save')));
$form_body .= '</div>';
diff --git a/views/default/forms/widgets/save.php b/views/default/forms/widgets/save.php
index aeef37429..4ba911cb5 100644
--- a/views/default/forms/widgets/save.php
+++ b/views/default/forms/widgets/save.php
@@ -32,7 +32,7 @@ $body = <<<___END
<div>
$access
</div>
- <div>
+ <div class="elgg-foot">
$hidden
$submit
</div>
diff --git a/views/default/input/form.php b/views/default/input/form.php
index 6d5824cd8..df30133b3 100644
--- a/views/default/input/form.php
+++ b/views/default/input/form.php
@@ -1,14 +1,17 @@
<?php
/**
* Create a form for data submission.
- * Use this view for forms rather than creating a form tag in the wild as it provides
- * extra security which help prevent CSRF attacks.
+ * Use this view for forms as it provides protection against CSRF attacks.
*
* @package Elgg
* @subpackage Core
*
* @uses $vars['body'] The body of the form (made up of other input/xxx views and html
+ * @uses $vars['action'] The action URL of the form
+ * @uses $vars['method'] The submit method: post (default) or get
+ * @uses $vars['enctype'] Set to 'multipart/form-data' if uploading a file
* @uses $vars['disable_security'] turn off CSRF security by setting to true
+ * @uses $vars['class'] Additional class for the form
*/
$defaults = array(
@@ -18,6 +21,12 @@ $defaults = array(
$vars = array_merge($defaults, $vars);
+if (isset($vars['class'])) {
+ $vars['class'] = "elgg-form {$vars['class']}";
+} else {
+ $vars['class'] = 'elgg-form';
+}
+
$vars['action'] = elgg_normalize_url($vars['action']);
$vars['method'] = strtolower($vars['method']);
@@ -32,4 +41,4 @@ unset($vars['disable_security']);
$attributes = elgg_format_attributes($vars);
-echo "<form $attributes><fieldset>$body</fieldset></form>"; \ No newline at end of file
+echo "<form $attributes><fieldset>$body</fieldset></form>";