dirroot.'/blocks/progress/common.php'); include_once($CFG->dirroot.'/blocks/progress/lib.php'); include_once($CFG->libdir.'/ddllib.php'); $count = 0; // of activity/resource found // Allow the title of each block instance to be changed print(''); print(''); // Allow icons to be turned on/off on the block print(''); print(''); // Allow V NOW to be turned on and off print(''); print(''); print('
'.get_string('title','block_progress')); helpbutton('settingTitle',get_string('setting_title','block_progress'),'block_progress'); print(' 
'.get_string('config_icons','block_progress').'   '); helpbutton('whyUseIcons',get_string('why_use_icons','block_progress'),'block_progress'); print(' 
'.get_string('config_now','block_progress').' ').get_string('now_indicator','block_progress'); helpbutton('whyDisplayNow',get_string('why_display_now','block_progress'),'block_progress'); print(' 
'); // Show table headers with help buttons print('

Monitored Activities/Resources'); helpbutton('whatCanBeMonitored',get_string('what_can_be_monitored','block_progress'),'block_progress'); print('

'); print(''); print(''); print(''); print(''); print(''); print(''); print(''); // Go through each type of activity/resource that can be monitored foreach($modules as $module=>$details) { // Get data about activities/resources if this type unset($instances); if($module == 'resource') { $countOfResourceTypes = count($resourcesMonitorable); $sql = 'SELECT id,type,name FROM '.$CFG->prefix.'resource WHERE course=\''.$this->instance->pageid.'\' AND ('; for($i=0; $i<$countOfResourceTypes; $i++) { $sql .= 'type=\''.$resourcesMonitorable[$i].'\''.($i<$countOfResourceTypes-1?' OR ':''); } $sql .= ') ORDER BY name'; $instances = get_records_sql($sql); } else { $table = new XMLDBTable($module); if(table_exists($table)) { $instances = get_records_sql('SELECT id, name'.(array_key_exists('defaultTime',$details)?', '.$details['defaultTime'].' as due':'').' FROM '.$CFG->prefix.$module.' WHERE course=\''.$this->instance->pageid.'\' ORDER BY name'); } } // If there are activities/resources of this type, show them if (isset($instances) && $instances) { // Display the activity/resource type print(''); print(''); // Display each monitorable activity/resource as a row foreach($instances as $i=>$instance) { $count++; print(''); // Button to determine if the activity/resource is to be monitored $monitored = progress_default_value($this->config->{'monitor_'.$module.$instance->id}); print(''); // Output name type and action for activity/resource print(''); // Output name type and action for activity/resource $locked = progress_default_value($this->config->{'locked_'.$module.$instance->id}); if(isset($details['defaultTime']) && $instance->due != 0) { print(''); } else { print(''); } // Attempt to gather date-time info for monitored activity/resource $day = progress_default_value($this->config->{'day_'.$module.$instance->id}); $month = progress_default_value($this->config->{'month_'.$module.$instance->id}); $year = progress_default_value($this->config->{'year_'.$module.$instance->id}); $hour = progress_default_value($this->config->{'hour_'.$module.$instance->id}); $minute = progress_default_value($this->config->{'minute_'.$module.$instance->id}); if(isset($details['defaultTime']) && $instance->due != 0) { $expected = progress_default_value($instance->due); } else { $expected = time(); } if($month) { $expected = mktime($hour,$minute,0,$month,$day,$year); } print(''); if(isset($details['defaultTime']) && $instance->due != 0 && (!isset($locked) || $locked=='on')) { print(''); } print(''); } } } print('
'.get_string('config_header_monitored','block_progress')); helpbutton('whatDoesMonitoredMean',get_string('what_does_monitored_mean','block_progress'),'block_progress'); print(''.get_string('config_header_name','block_progress').''.get_string('config_header_locked','block_progress')); helpbutton('whatLockedMeans',get_string('what_locked_means','block_progress'),'block_progress'); print(''.get_string('config_header_expected','block_progress')); helpbutton('whatExpectedByMeans',get_string('what_expected_by_means','block_progress'),'block_progress'); print('
'.get_string('config_header_type','block_progress').': '.($module=='resource'?get_string('resource','block_progress'):get_string($module,'block_progress').' ('.get_string('activity','block_progress').')').''.get_string('config_header_action','block_progress').': '.get_string($module.'_'.$details['action'],'block_progress')); helpbutton('whatActionsCanBeMonitored',get_string('what_actions_can_be_monitored','block_progress'),'block_progress'); print('
'.$instance->name.''.print_date_selector('day_'.$module.$instance->id, 'month_'.$module.$instance->id, 'year_'.$module.$instance->id, $expected, true).print_time_selector('hour_'.$module.$instance->id, 'minute_'.$module.$instance->id, $expected,5, true).'
'); // When there are no activities/resources that can be monitored, prompt teacher to create some if($count==0) { print(''); } ?>
'.get_string('no_events_message','block_progress').'