Permalink
Browse files

Merge branch 'MDL-36990_master-neu' of git://github.com/grabs/moodle

  • Loading branch information...
2 parents 2a28b5d + 205c618 commit e1864424978333ede4a6ebed74299b596c9aa3d9 @nebgor nebgor committed Mar 13, 2013
Showing with 24 additions and 30 deletions.
  1. +20 −16 mod/feedback/edit.php
  2. +4 −0 mod/feedback/styles.css
  3. +0 −14 mod/feedback/yui/dragdrop/dragdrop.js
View
@@ -159,14 +159,16 @@
$PAGE->set_title(format_string($feedback->name));
//Adding the javascript module for the items dragdrop.
-if ($do_show == 'edit' and $CFG->enableajax) {
- $PAGE->requires->strings_for_js(array(
- 'pluginname',
- 'move_item',
- 'position',
- ), 'feedback');
- $PAGE->requires->yui_module('moodle-mod_feedback-dragdrop', 'M.mod_feedback.init_dragdrop',
- array(array('cmid' => $cm->id)));
+if (count($feedbackitems) > 1) {
+ if ($do_show == 'edit' and $CFG->enableajax) {
+ $PAGE->requires->strings_for_js(array(
+ 'pluginname',
+ 'move_item',
+ 'position',
+ ), 'feedback');
+ $PAGE->requires->yui_module('moodle-mod_feedback-dragdrop', 'M.mod_feedback.init_dragdrop',
+ array(array('cmid' => $cm->id)));
+ }
}
echo $OUTPUT->header();
@@ -333,14 +335,16 @@
echo '</span>';
}
//Print the move-button
- echo '<span class="feedback_item_command_move">';
- $moveurl = new moodle_url($url, array('moveitem'=>$feedbackitem->id));
- $buttonlink = $moveurl->out();
- $strbutton = get_string('move_item', 'feedback');
- echo '<a class="editing_move" title="'.$strbutton.'" href="'.$buttonlink.'">
- <img alt="'.$strbutton.'" src="'.$OUTPUT->pix_url('t/move') . '" />
- </a>';
- echo '</span>';
+ if (count($feedbackitems) > 1) {
+ echo '<span class="feedback_item_command_move">';
+ $moveurl = new moodle_url($url, array('moveitem'=>$feedbackitem->id));
+ $buttonlink = $moveurl->out();
+ $strbutton = get_string('move_item', 'feedback');
+ echo '<a class="editing_move" title="'.$strbutton.'" href="'.$buttonlink.'">
+ <img alt="'.$strbutton.'" src="'.$OUTPUT->pix_url('t/move') . '" />
+ </a>';
+ echo '</span>';
+ }
//Print the button to edit the item
if ($feedbackitem->typ != 'pagebreak') {
echo '<span class="feedback_item_command_edit">';
View
@@ -96,3 +96,7 @@ ul#feedback_draglist {
padding: 0;
margin: 0;
}
+
+div#feedback_dragarea {
+ width:95%;
+}
@@ -193,20 +193,6 @@ YUI.add('moodle-mod_feedback-dragdrop', function(Y) {
},
/**
- * Handles the drag:dropmiss event.
- *
- * @param e the event
- * @return void
- */
- drag_dropmiss_handler : function(e) {
- var msg = {
- name : 'dropmiss',
- message : 'dropmiss'
- };
- return new M.core.exception(msg);
- },
-
- /**
* Save the new item order.
*
* @param cmid the coursemodule id

0 comments on commit e186442

Please sign in to comment.