diff --git a/README b/README index ad644bcecf7cd269a0a9f77942bb510acb3a1da6..e6012662de8028bd9769486fb4fd020b0e55a960 100644 --- a/README +++ b/README @@ -40,15 +40,6 @@ Log In to Database: SSH to ucommsrv, run mysql -u ... -Add a Subject Code: - - Add record in the 'subjects' table in MySQL. - - -Link Subject Code to AREA of Study: - - Add record to 'department_has_subject' table. - Setup: copy config.sample.php to config.inc.php diff --git a/src/UNL/Catalog.php b/src/UNL/Catalog.php index 0faa4ec3c7238ff6787be2c0777e4aefe05dc62c..4978e6506c7acd803a30ec3c66c699ea7dba02cc 100644 --- a/src/UNL/Catalog.php +++ b/src/UNL/Catalog.php @@ -77,8 +77,6 @@ class UNL_Catalog { if (isset($_GET['view'])) { switch($_GET['view']) { - case 'subjects': - case 'subject': case 'courses': case 'course': case 'search': @@ -96,12 +94,6 @@ class UNL_Catalog public function run() { switch($this->view) { - case 'subjects': - $this->showSubjects(); - break; - case 'subject': - $this->showSubject(); - break; case 'courses': $this->showCourses(); break; @@ -152,7 +144,6 @@ class UNL_Catalog $db =& $this->getDatabaseConnection(); $q = $db->escape($q); -// $subjects_found = $search->subjects($q); $listings_found = $search->listings($q); $this->p->maincontentarea = @@ -160,10 +151,6 @@ class UNL_Catalog array($listings_found), $this->p->maincontentarea); - /* - if (($depts_found + $subjects_found + $listings_found) == 0) { - $this->p->maincontentarea .= '<p>No course matches could be found for that, you might try searching for something else.</p>'; - }*/ } else { $this->p->maincontentarea .= '<h2>Please enter a search string</h2>'; } @@ -179,44 +166,6 @@ class UNL_Catalog $this->p->maincontentarea .= $this->getCourseRenderer()->render($this, 'Index.tpl.php'); } - /** - * Displays all subject codes within the system. - */ - public function showSubjects() - { - $this->p->doctitle = '<title>Courses | Graduate Studies Bulletin | University of Nebraska-Lincoln</title>'; - $subject = $this->factory('subjects'); - $subject->orderBy('id'); - if ($subject->find()) { - $format = 'html'; - if (isset($_GET['format'])) { - $format = $_GET['format']; - } - - - switch ($format) { - case 'html': - default: - $this->p->maincontentarea .= '<h1>Choose a Subject Code</h1><ul>'; - while ($subject->fetch()) { - $this->p->maincontentarea .= '<li><a href="'.$subject->getURI($this).'">'.$subject->id.'</a> '.$subject->name.'</li>'; - } - $this->p->maincontentarea .= '</ul>'; - break; - case 'xml': - $this->p->maincontentarea .= '<?xml version="1.0" encoding="UTF-8" ?> - <subjects xmlns:xlink="http://www.w3.org/1999/xlink">'; - while ($subject->fetch()) { - $this->p->maincontentarea .= '<s xlink:href="'.$subject->getURI($this).'" xml:id="'.$subject->id.'">'.htmlspecialchars($subject->name).'</s>'.PHP_EOL; - } - $this->p->maincontentarea .= '</subjects>'; - break; - } - } else { - $this->p->maincontentarea .= 'No subjects could be found.'; - } - } - /** * Pseudo function for displaying all courses within a subject area. * diff --git a/src/UNL/Catalog/Search.php b/src/UNL/Catalog/Search.php index 4c9767af9d9076d9732135e325fe9af7effbf2fc..01a1b5b057fb8b6312487bafd53f2cc49425f235 100644 --- a/src/UNL/Catalog/Search.php +++ b/src/UNL/Catalog/Search.php @@ -45,39 +45,4 @@ class UNL_Catalog_Search <!-- Google Search Result Snippet Ends --></div>'; } - public function subjects($q) - { - $subjects = $this->catalog->factory('subjects'); - $subjects->whereAdd("id LIKE '%$q%' OR name LIKE '%$q%'"); - $subjects->orderBy('name'); - $this->catalog->p->maincontentarea .= '<div id="cats" class="searchtab">'; - if ($r = $subjects->find()) { - $this->catalog->p->maincontentarea .= '<h2>'.$r.' matching subject areas:</h2><ul>'; - while ($subjects->fetch()) { - $this->catalog->p->maincontentarea .= '<li><a href="'.$subjects->getURI($this->catalog).'">'.$subjects->name.' ('.$subjects->id.')</a></li>'; - } - $this->catalog->p->maincontentarea .= '</ul>'; - } - $this->catalog->p->maincontentarea .= '</div>'; - return $r; - } - - public function listings($q) - { - $where = "subject_id LIKE '%$q%' OR number LIKE '%$q%' OR title LIKE '%$q%'"; - $listings = $this->catalog->factory('course_listings'); - $courses = $this->catalog->factory('courses'); - $listings->joinAdd($courses); - $listings->whereAdd($where); - $listings->orderBy('subject_id, number'); - $this->catalog->p->maincontentarea .= '<div id="catl" class="searchtab">'; - if ($r = $listings->find()) { - $this->catalog->p->maincontentarea .= '<h2>'.$r.' matching courses:</h2>'; - while ($listings->fetch()) { - $this->catalog->showCourse($listings, true); - } - } - $this->catalog->p->maincontentarea .= '</div>'; - return $r; - } } diff --git a/src/UNL/Catalog/Subjects.php b/src/UNL/Catalog/Subjects.php deleted file mode 100644 index c8b7e7d69716fa1258952252b74da74cb48eab36..0000000000000000000000000000000000000000 --- a/src/UNL/Catalog/Subjects.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php -/** - * Table Definition for subjects - */ -require_once 'DB/DataObject.php'; - -class UNL_Catalog_Subjects extends DB_DataObject -{ - ###START_AUTOCODE - /* the code below is auto generated do not remove the above tag */ - - public $__table = 'subjects'; // table name - public $id; // string(10) not_null primary_key - public $name; // string(255) not_null - public $description; // blob(65535) not_null blob - - /* Static get */ - function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('UNL_Catalog_Subjects',$k,$v); } - - /* the code above is auto generated do not remove the tag below */ - ###END_AUTOCODE - - public function getURI(UNL_Catalog $catalog) - { - switch ($catalog->uri_format) { - case 'REST': - case 'rest': - return $catalog->uri.$this->id.'/'; - break; - case 'querystring': - default: - return $catalog->uri.'courses/'.$this->id; - } - } -} diff --git a/src/UNL/Catalog/catalog.ini b/src/UNL/Catalog/catalog.ini deleted file mode 100644 index 0330ebb3828c40fbb232036bc7777ebc3941643a..0000000000000000000000000000000000000000 --- a/src/UNL/Catalog/catalog.ini +++ /dev/null @@ -1,8 +0,0 @@ - -[subjects] -id = 130 -name = 130 -description = 194 - -[subjects__keys] -id = K diff --git a/src/UNL/Catalog/catalog.links.ini b/src/UNL/Catalog/catalog.links.ini deleted file mode 100644 index 64cbbebf1a1f9eaca227bfd465401e8b83601c9a..0000000000000000000000000000000000000000 --- a/src/UNL/Catalog/catalog.links.ini +++ /dev/null @@ -1 +0,0 @@ -[subjects] \ No newline at end of file diff --git a/www/templates/Index.tpl.php b/www/templates/Index.tpl.php index 66879bd3e12058fdf14a134814e82e8c131180e3..93715886efd41c3ffc7b20681b5b9463f2d51a51 100644 --- a/www/templates/Index.tpl.php +++ b/www/templates/Index.tpl.php @@ -5,6 +5,3 @@ information about all programs of graduate study offered at the University of Nebraska–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=subjects">Courses</a></h2> -</div> diff --git a/www/templates/navigation.html b/www/templates/navigation.html index 7613f2f747149970e40487e6cc89d4023bdefa73..6c7671cd33c6905e14092a5c1f01acaf77d949ee 100644 --- a/www/templates/navigation.html +++ b/www/templates/navigation.html @@ -1,4 +1,3 @@ <ul> <li><a href="@@UNL_CATALOG_URI@@">Graduate Bulletin Home</a></li> - <li><a href="@@UNL_CATALOG_URI@@?view=subjects">Courses</a></li> </ul>