diff options
Diffstat (limited to 'views/default/forms')
-rw-r--r-- | views/default/forms/admin/menu/save.php | 100 | ||||
-rw-r--r-- | views/default/forms/profile/fields/add.php | 2 | ||||
-rw-r--r-- | views/default/forms/useradd.php | 26 |
3 files changed, 119 insertions, 9 deletions
diff --git a/views/default/forms/admin/menu/save.php b/views/default/forms/admin/menu/save.php new file mode 100644 index 000000000..6c9cd9bd5 --- /dev/null +++ b/views/default/forms/admin/menu/save.php @@ -0,0 +1,100 @@ +<?php +/** + * Form body for setting up site menu + */ + +// get site menu items +global $CONFIG; +$menu = $CONFIG->menus['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->getTitle(); +} +$dropdown_values[''] = elgg_echo('none'); + +?> +<div class="elgg-module elgg-inline-module"> + <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") +)); + +// @todo Could probably make this number configurable +for ($i=0; $i<6; $i++) { + if (array_key_exists($i, $featured_menu_names)) { + $current_value = $featured_menu_names[$i]; + } else { + $current_value = ''; + } + + echo elgg_view('input/pulldown', array( + 'options_values' => $dropdown_values, + 'internalname' => 'featured_menu_names[]', + 'value' => $current_value + )); +} +?> + </div> +</div> + +<div class="elgg-module elgg-inline-module"> + <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-simple-list">'; + +if (is_array($custom_items)) { + foreach ($custom_items as $title => $url) { + $name_input = elgg_view('input/text', array( + 'internalname' => 'custom_menu_titles[]', + 'value' => $title + )); + + $url_input = elgg_view('input/text', array( + 'internalname' => '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( + 'internalname' => 'custom_menu_titles[]', +)); + +$url_input = elgg_view('input/text', array( + 'internalname' => '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/profile/fields/add.php b/views/default/forms/profile/fields/add.php index 50d1600fd..de43b9ec9 100644 --- a/views/default/forms/profile/fields/add.php +++ b/views/default/forms/profile/fields/add.php @@ -25,5 +25,5 @@ $formbody = <<< END $submit_control</p> END; -echo "<p class='margin-top'>" . elgg_echo('profile:explainchangefields') . "</p>"; +echo autop(elgg_echo('profile:explainchangefields')); echo $formbody; diff --git a/views/default/forms/useradd.php b/views/default/forms/useradd.php index 7c1969f1b..8ed0fc2cc 100644 --- a/views/default/forms/useradd.php +++ b/views/default/forms/useradd.php @@ -11,21 +11,31 @@ if ((get_loggedin_user()->isAdmin()) && ($vars['show_admin'])) { $admin_option = true; } -$form_body = "<p><label>" . elgg_echo('name') . "<br />" . elgg_view('input/text' , array('internalname' => 'name')) . "</label></p>"; -$form_body .= "<p><label>" . elgg_echo('username') . "<br />" . elgg_view('input/text' , array('internalname' => 'username')) . "</label></p>"; -$form_body .= "<p><label>" . elgg_echo('email') . "<br />" . elgg_view('input/text' , array('internalname' => 'email')) . "</label></p>"; -$form_body .= "<p><label>" . elgg_echo('password') . "<br />" . elgg_view('input/password' , array('internalname' => 'password')) . "</label></p>"; -$form_body .= "<p><label>" . elgg_echo('passwordagain') . "<br />" . elgg_view('input/password' , array('internalname' => 'password2')) . "</label></p>"; +$form_body = "<p><label>" . elgg_echo('name') . "</label><br />" . elgg_view('input/text' , array('internalname' => 'name')) . "</p>"; +$form_body .= "<p><label>" . elgg_echo('username') . "</label><br />" . elgg_view('input/text' , array('internalname' => 'username')) . "</p>"; +$form_body .= "<p><label>" . elgg_echo('email') . "</label><br />" . elgg_view('input/text' , array('internalname' => 'email')) . "</p>"; +$form_body .= "<p><label>" . elgg_echo('password') . "</label><br />" . elgg_view('input/password' , array('internalname' => 'password')) . "</p>"; +$form_body .= "<p><label>" . elgg_echo('passwordagain') . "</label><br />" . elgg_view('input/password' , array('internalname' => 'password2')) . "</p>"; $form_body .= "<p>"; if ($admin_option) { $form_body .= elgg_view('input/checkboxes', array('internalname' => "admin", 'options' => array(elgg_echo('admin_option')))); + $form_body .= '</p><p>'; } $form_body .= elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('register'))) . "</p>"; ?> -<div class="admin_settings add-user"> - <h3><?php echo elgg_echo('adduser'); ?></h3> - <?php echo elgg_view('input/form', array('action' => "action/useradd", 'body' => $form_body)) ?> +<div class="elgg-module elgg-inline-module"> + <div class="elgg-head"> + <h3><?php echo elgg_echo('adduser'); ?></h3> + </div> + <div class="elgg-body"> + <?php + echo elgg_view('input/form', array( + 'action' => "action/useradd", + 'body' => $form_body, + )); + ?> + </div> </div>
\ No newline at end of file |