diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-11-18 16:13:34 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-11-18 16:13:34 +0000 |
commit | c5854870424d87372bcc86a7edf75b9bf8841825 (patch) | |
tree | 99dc5d53e82ba6decf27846e574ac9826f5743b2 /views/default/widgets | |
parent | 522fccf9ed173e3a5a68b3a616a3b7e1961bc22b (diff) | |
download | elgg-c5854870424d87372bcc86a7edf75b9bf8841825.tar.gz elgg-c5854870424d87372bcc86a7edf75b9bf8841825.tar.bz2 |
Refs #1793 added ability to add widgets to layout through ajax
git-svn-id: http://code.elgg.org/elgg/trunk@7338 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/widgets')
-rw-r--r-- | views/default/widgets/add.php | 26 | ||||
-rw-r--r-- | views/default/widgets/add_button.php | 2 |
2 files changed, 21 insertions, 7 deletions
diff --git a/views/default/widgets/add.php b/views/default/widgets/add.php index 2cc06dab7..9687c5bea 100644 --- a/views/default/widgets/add.php +++ b/views/default/widgets/add.php @@ -3,18 +3,32 @@ $widgets = $vars['widgets']; $widget_types = get_widget_types(); +$context = $vars['context']; + ?> <div class="widgets_add hidden"> <p> <?php echo elgg_echo('widgets:add:description'); ?> </p> <ul> - <?php - foreach ($widget_types as $widget_type) { - $link = elgg_view('output/url', array('text' => $widget_type->name, 'href' => '#')); - echo "<li>$link</li>"; - } - ?> +<?php + foreach ($widget_types as $handler => $widget_type) { + $options = array( + 'text' => $widget_type->name, + 'href' => '#', + 'internalid' => $handler, + ); + $link = elgg_view('output/url', $options); + echo "<li>$link</li>"; + } +?> </ul> +<?php + $params = array( + 'internalname' => 'widget_context', + 'value' => $context + ); + echo elgg_view('input/hidden', $params); +?> <div class="clearfloat"></div> </div> diff --git a/views/default/widgets/add_button.php b/views/default/widgets/add_button.php index 8ec36b086..2957513b6 100644 --- a/views/default/widgets/add_button.php +++ b/views/default/widgets/add_button.php @@ -1,7 +1,7 @@ <?php ?> -<div class="widget" id="widget_add_button"> +<div id="widget_add_button"> <?php $options = array( 'href' => '#', |