Guest User

Untitled

a guest
Nov 28th, 2017
330
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. $ACTIVITIES_LIST = $this->_customdata[1];
  2. $START_REPETITIONS = 1;
  3. $MAX_ACTIVITIES = count($ACTIVITIES_LIST);
  4.  
  5. $repeatarray = array();
  6.  
  7. $activity_group = array();
  8. $activity_group[] =& $mform->createElement( 'select', 'activity', get_string('form_simple_label_activity',
  9. 'gradereport_scgr'), $ACTIVITIES_LIST);
  10.  
  11. $activity_group[] =& $mform->createElement( 'text', 'custom_weighting_activity',
  12. get_string('form_simple_label_custom_weighting_act_1',
  13. 'gradereport_scgr') );
  14.  
  15. $repeatarray[] = $mform->addGroup( $activity_group, 'activitygroup', get_string('form_simple_label_activity',
  16. 'gradereport_scgr'), array(' '));
  17.  
  18.  
  19. $repeateloptions = array();
  20. $repeateloptions['activitygroup']['helpbutton'] = array('helper_chooseactivity', 'gradereport_scgr');
  21.  
  22. $repeateloptions['activitygroup']['custom_weighting_activity']['default'] = '1';
  23. $mform->setDefault('custom_weighting_activity', '1');
  24.  
  25. $repeateloptions['custom_weighting_activity']['disabledif'] = array('custom_weighting', 'eq', 0);
  26. $mform->disabledIf('custom_weighting', 'custom_weighting_activity', $condition = 'eq', $value=0);
  27.  
  28. var_dump($repeateloptions);
  29.  
  30. $mform->addHelpButton('activitygroup', 'helper_chooseactivity', 'gradereport_scgr');
  31.  
  32. $this->repeat_elements($repeatarray, $START_REPETITIONS,
  33. $repeateloptions, 'activitygroup_repeats', 'activitygroup_add_fields', 1, null, true);
Advertisement
Add Comment
Please, Sign In to add comment