diff options
-rw-r--r-- | actions/widgets/add.php | 1 | ||||
-rw-r--r-- | engine/lib/widgets.php | 2 | ||||
-rw-r--r-- | js/lib/ui.widgets.js | 7 | ||||
-rw-r--r-- | views/default/css.php | 12 | ||||
-rw-r--r-- | views/default/layouts/widgets.php | 7 | ||||
-rw-r--r-- | views/default/widgets/add_panel.php (renamed from views/default/widgets/add.php) | 2 | ||||
-rw-r--r-- | views/default/widgets/settings.php (renamed from views/default/widgets/editwrapper.php) | 0 | ||||
-rw-r--r-- | views/default/widgets/wrapper.php | 2 |
8 files changed, 22 insertions, 11 deletions
diff --git a/actions/widgets/add.php b/actions/widgets/add.php index eebbd1438..001c139d8 100644 --- a/actions/widgets/add.php +++ b/actions/widgets/add.php @@ -11,7 +11,6 @@ $handler = get_input('handler'); $context = get_input('context'); $column = get_input('column', 1); -$guid = false; if (!empty($user_guid)) { $user = get_entity($user_guid); if ($user && $user->canEdit()) { diff --git a/engine/lib/widgets.php b/engine/lib/widgets.php index 1343e1319..1646c18d4 100644 --- a/engine/lib/widgets.php +++ b/engine/lib/widgets.php @@ -57,7 +57,7 @@ function elgg_get_widgets($user_guid, $context) { * @since 1.8 */ function elgg_create_widget($owner_guid, $handler, $access_id = null) { - if (empty($owner_guid) || empty($handler) || !elgg_widget_type_exists($handler)) { + if (empty($owner_guid) || empty($handler) || !elgg_is_widget_type($handler)) { return false; } diff --git a/js/lib/ui.widgets.js b/js/lib/ui.widgets.js index bee4b2126..ac55d0e7f 100644 --- a/js/lib/ui.widgets.js +++ b/js/lib/ui.widgets.js @@ -12,6 +12,9 @@ elgg.ui.widgets.init = function() { handle: 'div.drag_handle',
forcePlaceholderSize: true,
placeholder: 'widget_placeholder',
+ //containment: '.widget_layout',
+ opacity: 0.8,
+ revert: 500,
stop: function(event, ui) {
elgg.action('widgets/move', {
data: {
@@ -26,11 +29,11 @@ elgg.ui.widgets.init = function() { });
$('#widget_add_button a').bind('click', function(event) {
- $('.widgets_add').slideToggle('medium');
+ $('.widgets_add_panel').slideToggle('medium');
event.preventDefault();
});
- $('.widgets_add a').bind('click', function(event) {
+ $('.widgets_add_panel a').bind('click', function(event) {
elgg.action('widgets/add', {
data: {
handler: $(this).attr('id'),
diff --git a/views/default/css.php b/views/default/css.php index 29930d445..286beeece 100644 --- a/views/default/css.php +++ b/views/default/css.php @@ -881,21 +881,21 @@ li.navigation_more ul li { margin-bottom: 15px; margin-right: 5px; } -.widgets_add { +.widgets_add_panel { padding: 10px; margin: 0 5px 15px; background: #dedede; } -.widgets_add ul { +.widgets_add_panel ul { padding: 0; margin: 0; } -.widgets_add li { +.widgets_add_panel li { float: left; margin: 2px 10px; list-style: none; } -.widgets_add li a { +.widgets_add_panel li a { display: block; width: 200px; padding: 4px; @@ -906,7 +906,11 @@ li.navigation_more ul li { padding: 2px; margin: 0 5px 15px; } +.widget:hover { + background-color: #cccccc; +} .widget_title { + background-color: #dedede; height: 30px; line-height: 30px; } diff --git a/views/default/layouts/widgets.php b/views/default/layouts/widgets.php index 055b0453e..692d01acc 100644 --- a/views/default/layouts/widgets.php +++ b/views/default/layouts/widgets.php @@ -25,9 +25,11 @@ if (elgg_can_edit_widgets()) { 'widgets' => $widgets, 'context' => $context, ); - echo elgg_view('widgets/add', $params); + echo elgg_view('widgets/add_panel', $params); } +echo '<div class="widget_layout">'; + echo $vars['box']; $widget_class = "widget_{$num_columns}_columns"; @@ -43,4 +45,7 @@ for ($column_index = 1; $column_index <= $num_columns; $column_index++) { echo '</div>'; } +echo '<div class="clearfloat"></div>'; +echo '</div>'; + elgg_pop_context();
\ No newline at end of file diff --git a/views/default/widgets/add.php b/views/default/widgets/add_panel.php index c8576cf06..70d80f41c 100644 --- a/views/default/widgets/add.php +++ b/views/default/widgets/add_panel.php @@ -6,7 +6,7 @@ $widget_types = elgg_get_widget_types(); $context = $vars['context']; ?> -<div class="widgets_add hidden"> +<div class="widgets_add_panel hidden"> <p> <?php echo elgg_echo('widgets:add:description'); ?> </p> diff --git a/views/default/widgets/editwrapper.php b/views/default/widgets/settings.php index 73166b718..73166b718 100644 --- a/views/default/widgets/editwrapper.php +++ b/views/default/widgets/settings.php diff --git a/views/default/widgets/wrapper.php b/views/default/widgets/wrapper.php index 8e92c119b..6963989f9 100644 --- a/views/default/widgets/wrapper.php +++ b/views/default/widgets/wrapper.php @@ -35,7 +35,7 @@ $can_edit = $widget->canEdit(); </div> <?php if ($can_edit) { - echo elgg_view('widgets/editwrapper', array('widget' => $widget)); + echo elgg_view('widgets/settings', array('widget' => $widget)); } ?> <div class="widget_content"> |