diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-11-19 19:11:03 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-11-19 19:11:03 +0000 |
commit | f42382e0bff1692e2ddcd1c8eb316836e3020f1e (patch) | |
tree | bd11cb29bbae69f0daff3c0cd9c273203c788dc9 /views/default | |
parent | b70654070d83323853f808beccc6780cfcd51ce4 (diff) | |
download | elgg-f42382e0bff1692e2ddcd1c8eb316836e3020f1e.tar.gz elgg-f42382e0bff1692e2ddcd1c8eb316836e3020f1e.tar.bz2 |
users can delete widgets from layout
git-svn-id: http://code.elgg.org/elgg/trunk@7349 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default')
-rw-r--r-- | views/default/css.php | 18 | ||||
-rw-r--r-- | views/default/widgets/controls.php | 32 | ||||
-rw-r--r-- | views/default/widgets/wrapper.php | 13 |
3 files changed, 56 insertions, 7 deletions
diff --git a/views/default/css.php b/views/default/css.php index 36c5c60ec..c78e7ebd2 100644 --- a/views/default/css.php +++ b/views/default/css.php @@ -861,7 +861,7 @@ li.navigation_more ul li { *************************************** */ .widget_column { float: right; - min-height: 15px; + min-height: 30px; } .widget_1_columns { width: 100%; @@ -879,11 +879,11 @@ li.navigation_more ul li { padding: 0px; text-align: right; margin-bottom: 15px; + margin-right: 5px; } .widgets_add { - width: 96%; - padding: 2%; - margin-bottom: 15px; + padding: 10px; + margin: 0 5px 15px; background: #dedede; } .widgets_add ul { @@ -911,8 +911,18 @@ li.navigation_more ul li { line-height: 30px; } .widget_title h3 { + float: left; padding: 0 5px; } +.widget_title ul, .widget_title li { + float: right; + margin: 0; + padding: 0; + list-style: none; +} +.widget_title li { + margin: 0 4px; +} .widget_content { background-color: #ffffff; padding: 10px; diff --git a/views/default/widgets/controls.php b/views/default/widgets/controls.php new file mode 100644 index 000000000..881057969 --- /dev/null +++ b/views/default/widgets/controls.php @@ -0,0 +1,32 @@ +<?php +/** + * Elgg widget controls + * + * @package Elgg + * @subpackage Core + */ + +$widget = $vars['widget']; + +$params = array( + 'text' => 'delete', + 'href' => '#', //elgg_get_site_url() . "action/widgets/delete?guid=$widget->guid", + 'is_action' => true, + 'class' => 'widget_delete', + 'internalid' => "widget_delete_$widget->guid" +); +$delete_link = elgg_view('output/url', $params); + +$params = array( + 'text' => 'edit', + 'href' => elgg_get_site_url() . "#", + 'is_action' => true, +); +$edit_link = elgg_view('output/url', $params); + +echo <<<___END +<ul> + <li>$delete_link</li> + <li>$edit_link</li> +</ul> +___END; diff --git a/views/default/widgets/wrapper.php b/views/default/widgets/wrapper.php index fd849bdee..55cdd18b6 100644 --- a/views/default/widgets/wrapper.php +++ b/views/default/widgets/wrapper.php @@ -21,15 +21,22 @@ if ($vars['entity'] instanceof ElggObject && $vars['entity']->getSubtype() == 'w $title = elgg_echo("error"); } +$title = "Widget Title"; + $display_view = "widgets/$handler/view"; $edit_view = "widgets/$handler/edit"; ?> <div class="widget draggable" id="widget_<?php echo $widget->guid; ?>"> <div class="widget_title drag_handle"> - <h3>Widget Title</h3> - </div> - <div class="widget_content"> + <h3><?php echo $title; ?></h3> + <?php + if ($widget->canEdit()) { + echo elgg_view('widgets/controls', array('widget' => $widget)); + } + ?> + </div> + <div class="widget_content"> <?php echo elgg_view($display_view, $vars); ?> <p>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p> </div> |