Changeset - d8a9840d3319
[Not reviewed]
default
0 2 0
Ethan Zonca - 15 years ago 2011-01-15 20:18:42
ez@ethanzonca.com
Minor changes
2 files changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
admin.php
Show inline comments
 
@@ -69,49 +69,49 @@ require_once('inc/admin.inc');
 
	$result = 'Rehash Failed';
 
      else
 
	$result = 'Rehash Successful';
 
      if ($crawl_schools !== NULL)
 
	$result .= ': ' . implode(', ', $crawl_schools);
 
    }
 
    else if(isset($_GET['purge']))
 
      {
 
	$purge_date = NULL;
 
	if(isset($_GET['purgetodate']))
 
	  {
 
	    $t = strptime($_REQUEST['purgetodate'], '%Y-%m-%d');
 
	    $purge_date = mktime($t['tm_hour'], $t['tm_min'], $t['tm_sec'], $t['tm_mon'], $t['tm_mday'], $t['tm_year'] + 1900);
 
	  }
 

	
 
	$schedule_store = schedule_store_init();
 
	if (!$schedule_store)
 
	  return 'Purging saved schedules failed: unable to initialize schedule_store handle.';
 

	
 
	$num_purged = schedule_store_purge_range($schedule_store, 0, $purge_date);
 
	if ($num_purged === FALSE)
 
	  {
 
	    $result = 'Purging saved scheduled failed.';
 
	    if (!$admin_enable_purge)
 
	      $result .= ' To enable purging saved schedules, since this is an irreversable operation, you must set $admin_enable_purge = TRUE in config.inc.';
 
	      $result .= ' Purging is disabled. To enable purging, set $admin_enable_purge = TRUE in config.inc.';
 
	  }
 
	else
 
	  {
 
	    $result .= 'Purged ' . $num_purged . ' schedules';
 
	    if ($purge_date !== NULL)
 
	      $result .= ' up to ' . $purge_date;
 
	  }
 
      }
 
    return $result;
 
  }
 

	
 
  function getLastRehash(){
 
    $stats = stat("cache/schools");
 
    if(!$stats){
 
      return false;
 
    }
 
    return date("F j, Y, g:i a", $stats[9]);
 
  }
 

	
 
  function schoolsDropList()
 
  {
 
    $school_ids = school_list();
 
    echo '<select name="rehash_school">';
 
    foreach($school_ids as $school_id)
scripts/scheduleInput.js
Show inline comments
 
@@ -197,49 +197,49 @@ function genSectionHtml_n(cnum, name, sy
 
		    + '<input type="hidden" name="postData[' + cnum + '][' + snum + '][type]" value="' + type + '" />'
 
		    + '</td></tr>';
 
		return result;
 
	}
 

	
 
/**
 
 * Outputs an <option/> element. It will inlcude selected="selected"
 
 * if the value param equals the test_value param.
 
 */
 
function genOptionHtml(value, content, test_value)
 
{
 
    var selected = ' selected="selected"';
 
    if (value != test_value)
 
	selected = '';
 
    return '<option value="' + value + '"' + selected + '>' + content + "</option>\n";
 
}
 

	
 

	
 
/** Add tooltips for user guidance */
 
function addTips() {
 

	
 
  var tr = jQuery('tr');
 
  var td = tr.eq(tr.length-2);
 
  jQuery('td:first', td).qtip({
 
    content: 'Type your class ID (such as PEF-1010)',
 
    content: 'Start typing your class ID (such as PEF-1010) and click a suggestion to add sections',
 
    style: {
 
      border: { 
 
        width: 3,
 
        radius: 4,
 
        color: '#333'
 
      },
 
      name: 'dark',
 
      tip: true
 
    },
 
    show: { effect: { type: 'fade', length: 2000 } },
 
    show: { ready: true }, 
 
/*    hide: { when: { event: 'inactive' } }, */
 
    corner: { target: 'topMiddle', tooltip: 'bottomMiddle' },
 
  });
 
}
 

	
 
/**
 
 * \brief
 
 *   Add a section to a class.
 
 */
 
function add_section_n(cnum, name, synonym, stime, etime, days, prof, location, type)
 
{
 
    jQuery('.pclass'+cnum).after(genSectionHtml_n(cnum, name, synonym, stime, etime, days, prof, location, type));
 
    sectionsOfClass[cnum] ++;
0 comments (0 inline, 0 general)