Changeset - a569f5a9e624
[Not reviewed]
default
0 4 0
Nathan Brink (binki) - 14 years ago 2011-04-06 00:23:09
ohnobinki@ohnopublishing.net
Add support for displaying a warning at the top of input.php.
4 files changed with 28 insertions and 0 deletions:
0 comments (0 inline, 0 general)
inc/class.page.php
Show inline comments
 
@@ -26,48 +26,49 @@ define('SP_PACKAGE_VERSION', '0.1_pre');
 
define('SP_PACKAGE_STRING', SP_PACKAGE_NAME . '-' . SP_PACKAGE_VERSION);
 

	
 
/*
 
 * Set up include() path for user-supplied libs (in case if his system
 
 * doesn't have libs, such as phpcaptcha
 
 * (securimage/securimage.php)). Users would store such libs in /libs.
 
 *
 
 * Coding note: dirname(dirname('a/b/c')) returns 'a'. This is a
 
 * similar effect to dirname('a/b/c') . DIRECTORY_SEPARATOR . '..'.
 
 */
 
set_include_path(get_include_path() . PATH_SEPARATOR . dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'libs');
 

	
 
/**
 
 * Not sure if there's a better place for this... it'd be a pita to
 
 * make a new include file like doconfig.inc but maybe that'll make
 
 * sense soon.
 
 */
 
/* defaults */
 
$clean_urls = FALSE;
 
$ga_trackers = array();
 
$feedback_emails = array('ez@ethanzonca.com, ngelderloos7@gmail.com, ohnobinki@ohnopublishing.net');
 
$use_captcha = FALSE;
 
$admin_enable_purge = FALSE;
 
$qtips_always = FALSE;
 
$input_warning_banner = FALSE;
 

	
 
$config_inc = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'config.inc';
 
if (file_exists($config_inc)) {
 
  require_once($config_inc);
 
}
 

	
 

	
 
//**************************************************
 
// class.page.php   Author: Ethan Zonca
 
//
 
// Provides an interface for generating a styled
 
// XHTML page, supporting modular script inclusion
 
// and other various features
 
//**************************************************
 
class page
 
{
 

	
 
  /* Site-wide configuration options */
 
  private $base_title = 'SlatePermutate - Find the schedule that works for you!';
 
  private $doctype = 'html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"';
 
  private $htmlargs = 'xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"';
 

	
 
  private $pageGenTime = 0;
 

	
inc/config.inc.example
Show inline comments
 
@@ -113,24 +113,38 @@
 
 *   Specify whether or not to always display qTips to users.
 
 *
 
 * Set to TRUE to display the qTips unconditionally. Set to FALSE to
 
 * only show qTips to the user the first time he visits
 
 * slate_permutate.
 
 *
 
 * The qTip is the little black box which tells a user to enter a
 
 * course number into the input page. For casual users, it directs the
 
 * attention to where the user should start. For advanced users, the
 
 * whole concept may appear silly ;-).
 
 */
 
/* $qtips_always = FALSE; */
 

	
 

	
 
/**
 
 * \brief
 
 *   Specify whether or not to log feedback to disk
 
 *
 
 * Set to TRUE to log to file in addition to email logging (if available).
 
 * $feedback_disk_log_file must be set to a fully-qualified filepath.
 
 * 
 
 */
 
/* $feedback_disk_log = TRUE; */
 
/* $feedback_disk_log_file = "/var/log/sp-feedback.log"; */
 

	
 

	
 
/**
 
 * \brief
 
 *   A banner to display to users on input.php for temporary warnings.
 
 *
 
 * Used to inform users about known data problems, etc.
 
 *
 
 * Set to a string to display a banner. Otherwise, set to FALSE to
 
 * hide the banner. Must be a valid XHTML fragment which may be placed
 
 * into a <div /> verbatim.
 
 */
 
/* $input_warning_banner = FALSE; */
 
/* $input_warning_banner = '<p>Warning: BIOL-111\'s autocomplete data does not include all sections. Please use <a href="http://csx.calvin.edu/sp/input.php?s=7578">schedule 7578</a> to get a correct BIOL-111 entry.</p>'; */
input.php
Show inline comments
 
@@ -135,48 +135,55 @@ if (!empty($_REQUEST['selectschool'])
 
</p>
 
<?php
 
    $inputPage->showSchools($next_page);
 
    $inputPage->foot();
 
    exit;
 
  }
 

	
 
if (!empty($_REQUEST['selectsemester']))
 
  {
 
?>
 
<h2>Semester Selection</h2>
 
<p>
 
  Choose the semester for which you wish you make a schedule from the
 
  list below. If any semester is missing, please <a
 
  href="feedback.php?feedback=My+school+is+missing+the+&lt;semester+name&gt;+semester.">let us know</a>.
 
</p>
 
<?php
 
  $inputPage->showSemesters();
 
  $inputPage->foot();
 
  exit;
 
  }
 

	
 
$inputPage->showSavedScheds($_SESSION);
 
?>
 

	
 
<?php if (!empty($input_warning_banner)): ?>
 
<div class="warning">
 
  <?php echo $input_warning_banner; ?>
 
</div>
 
<?php endif; ?>
 

	
 
<p>
 
  Welcome to SlatePermutate<?php $inputPage->addressStudent(', ', '', FALSE); ?>!
 
  <?php if (school_has_auto($inputPage->get_school())): ?>
 
  To get started, enter in some a course identifier (e.g., <em>
 
  <?php echo school_example_course_id($inputPage->get_school()); ?></em>)
 
  and click the autosuggestion to automatically load available sections
 
  for each class.
 
  <?php else: ?>
 
  To get started, enter a course number and add some sections to it.
 
  Then specify each section's letter/number and what times it meets,
 
  add more courses, and click &ldquo;Find a Schedule&rdquo;.
 
  <!--'-->
 
  <?php endif; ?>
 
</p>
 

	
 
<form method="post" action="process.php" id="scheduleForm">
 
<p class="nospace" style="border-left: 5px solid #999; padding-left: 5px!important; padding-top: 5px!important;"><label>Schedule Name</label><br />
 
<input
 
    id="scheduleName"
 
    style="margin-bottom: 1em;"
 
    class="defText required"
 
    type="text"
 
    size="25"
 
    title="My <?php echo $inputPage->semester['name'] ?> Schedule"
styles/general.css
Show inline comments
 
@@ -370,24 +370,30 @@ a:hover {
 
}
 

	
 
/* qTip2 Styling */
 
.ui-tooltip-dark .ui-tooltip-content{
 
  border-color: #303030;
 
  border-width: 2px;
 
  color: #f3f3f3;
 
  background-color: #505050;
 

	
 
  background: rgba(80,80,80,.9)!important;
 

	
 
  font: normal bold 1.2em sans-serif;
 
}
 

	
 
.course-title-entry
 
{
 
    width: 80%;
 
}
 

	
 
.inPlace {
 
  color: #000;
 
  border: none;
 
  background: transparent;
 
}
 

	
 
.warning
 
{
 
  background: #ffffdd;
 
  border: 1pt solid yellow;
 
}
0 comments (0 inline, 0 general)