Skip to content
Snippets Groups Projects
Commit 21b1e365 authored by Brett Bieber's avatar Brett Bieber
Browse files

Remove Departments, this info will be on the Graduate Studies site

parent f0eadaa6
No related branches found
No related tags found
No related merge requests found
......@@ -102,8 +102,6 @@ class UNL_Catalog
if (isset($_GET['view'])) {
switch($_GET['view']) {
case 'colleges':
case 'departments':
case 'department':
case 'subjects':
case 'subject':
case 'courses':
......@@ -126,12 +124,6 @@ class UNL_Catalog
case 'colleges':
$this->showColleges();
break;
case 'departments':
$this->showDepartments();
break;
case 'department':
$this->showDepartment();
break;
case 'subjects':
$this->showSubjects();
break;
......@@ -188,17 +180,12 @@ class UNL_Catalog
$db =& $this->getDatabaseConnection();
$q = $db->escape($q);
$depts_found = $search->departments($q);
// $subjects_found = $search->subjects($q);
$listings_found = $search->listings($q);
$this->p->maincontentarea =
str_replace(array('<!-- catd -->',
// '<!-- cats -->',
'<!-- catl -->'),
array($depts_found,
// $subjects_found,
$listings_found),
str_replace(array('<!-- catl -->'),
array($listings_found),
$this->p->maincontentarea);
/*
......@@ -220,64 +207,6 @@ class UNL_Catalog
$this->p->maincontentarea .= $this->getCourseRenderer()->render($this, 'Index.tpl.php');
}
/**
* Displays all the departments within the departments table.
*/
public function showDepartments()
{
$this->p->doctitle = '<title>Areas of Study | Graduate Studies Bulletin | University of Nebraska-Lincoln</title>';
$d = $this->factory('departments');
$d->orderBy('name');
if ($d->find()) {
$this->p->maincontentarea .= '<h1>Areas of Study</h1><ul>';
while ($d->fetch()) {
if ($d->crosslisted_id) {
$cross_id = $d->getLink('crosslisted_id');
$this->p->maincontentarea .= '<li><a href="'.$this->uri.$cross_id->name.'">'.$d->name.'</a></li>';
} else {
$this->p->maincontentarea .= '<li><a href="'.$this->uri.$d->name.'">'.$d->name.'</a></li>';
}
}
$this->p->maincontentarea .= '</ul>';
}
}
/**
* Displays a department.
*/
public function showDepartment($id = null)
{
if (!$id && isset($_GET['id'])) {
$id = $_GET['id'];
}
$d = $this->factory('departments');
if ($d->get($id)) {
$this->p->maincontentarea .= '<h1>'.$d->name.'</h1>';
$s =& $d->getSubjects();
if ($s) {
$this->p->maincontentarea .= '<div id="courses">'.PHP_EOL;
$s2 =& $d->getSubjects();
$subjects = array();
while ($s2->fetch()) {
array_push($subjects, "<li><a href='#" . $s2->id . "'>" . $s2->name . " (" . $s2->id . ")</a></li>");
}
if (count($subjects) > 1) {
$this->p->maincontentarea .= '<table style="clear:both" class="toc"><tr><td><h2>Subject Areas</h2><ul>'.PHP_EOL;
foreach ($subjects as $li) {
$this->p->maincontentarea .= $li.PHP_EOL;
}
$this->p->maincontentarea .= '</ul></td></tr></table>';
}
while ($s->fetch()) {
$this->showCourses($s->id);
}
$this->p->maincontentarea .= '</div>'.PHP_EOL;
}
} else {
$this->p->maincontentarea .= 'Could not find that department.';
}
}
/**
* Displays all subject codes within the system.
*/
......
......@@ -11,7 +11,6 @@ class UNL_Catalog_Archive
{
$this->layout[] = 'Index';
$this->layout[] = 'Colleges';
$this->layout[] = 'Departments';
$this->file = '/tmp/unl_catalog'.md5(time());
$this->file = '/tmp/unl_catalog.html';
}
......
<?php
require_once dirname(__FILE__).'/../Section.php';
require_once dirname(__FILE__).'/../../../Catalog.php';
class UNL_Catalog_Archive_Section_Departments implements UNL_Catalog_Archive_Section
{
protected $title = 'Areas of Study';
function getTitle()
{
return $this->title;
}
function getPages()
{
$pages = array();
$catalog = new UNL_Catalog();
$d = $catalog->factory('departments');
$d->orderBy('name');
if ($d->find()) {
while ($d->fetch()) {
if ($d->crosslisted_id) {
$cross_id = $d->getLink('crosslisted_id');
}
}
}
return $pages;
}
}
<?php
/**
* Table Definition for department_has_subject
*/
require_once 'DB/DataObject.php';
class UNL_Catalog_Department_has_subject extends DB_DataObject
{
###START_AUTOCODE
/* the code below is auto generated do not remove the above tag */
public $__table = 'department_has_subject'; // table name
public $department_id; // int(10) not_null unsigned
public $subject_id; // string(10) not_null
/* Static get */
function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('UNL_Catalog_Department_has_subject',$k,$v); }
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
}
<?php
/**
* Table Definition for departments
*/
require_once 'DB/DataObject.php';
class UNL_Catalog_Departments extends DB_DataObject
{
###START_AUTOCODE
/* the code below is auto generated do not remove the above tag */
public $__table = 'departments'; // table name
public $id; // int(10) not_null primary_key unsigned auto_increment
public $name; // string(255) not_null
public $college_id; // int(10) not_null unsigned
public $crosslisted_id; // int(11)
/* Static get */
function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('UNL_Catalog_Departments',$k,$v); }
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
function getSubjects()
{
$s =& $this->factory('subjects');
$s->query('SELECT subjects.* FROM subjects, department_has_subject
WHERE department_has_subject.department_id = '.intval($this->id).'
AND department_has_subject.subject_id = subjects.id ORDER BY subjects.name');
return $s;
}
}
......@@ -45,22 +45,6 @@ class UNL_Catalog_Search
<!-- Google Search Result Snippet Ends --></div>';
}
public function departments($q)
{
$departments = $this->catalog->factory('departments');
$departments->whereAdd("name LIKE '%$q%'");
$this->catalog->p->maincontentarea .= '<div id="catd" class="searchtab">';
if ($r = $departments->find()) {
$this->catalog->p->maincontentarea .= '<h2>'.$r.' matching area(s) of study:</h2><ul>';
while ($departments->fetch()) {
$this->catalog->p->maincontentarea .= '<li><a href="'.$this->catalog->uri.$departments->name.'">'.$departments->name.'</a></li>';
}
$this->catalog->p->maincontentarea .= '</ul>';
}
$this->catalog->p->maincontentarea .= '</div>';
return $r;
}
public function subjects($q)
{
$subjects = $this->catalog->factory('subjects');
......
......@@ -40,21 +40,6 @@ description = 66
[creq_bulletin__keys]
[department_has_subject]
department_id = 129
subject_id = 130
[department_has_subject__keys]
[departments]
id = 129
name = 130
college_id = 129
crosslisted_id = 1
[departments__keys]
id = N
[subject_has_course]
subject_id = 130
course_id = 129
......
......@@ -7,13 +7,6 @@ subject_id = subjects:id
subject_id = subjects:id
course_id = courses:id
[department_has_subject]
department_id = departments:id
subject_id = subjects:id
[departments]
crosslisted_id = departments:id
[subject_has_course]
subject_id = subjects:id
......
......@@ -6,7 +6,6 @@ Nebraska&ndash;Lincoln. The dynamic bulletin found here will be changing
periodically throughout the year as needed for updating policies, faculty and
curriculum.</a></p>
<div class="grid9 first">
<h2 class="sec_main"><a href="<?php echo $context->uri; ?>?view=departments">Areas of Study</a></h2>
<h2 class="sec_main"><a href="<?php echo $context->uri; ?>?view=subjects">Courses</a></h2>
</div>
<div class="grid3">
......
<ul>
<li><a href="@@UNL_CATALOG_URI@@">Graduate Bulletin Home</a></li>
<li><a href="@@UNL_CATALOG_URI@@?view=departments">Areas of Study</a></li>
<li><a href="@@UNL_CATALOG_URI@@?view=subjects">Courses</a></li>
</ul>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment