Skip to content

Commit

Permalink
added internship sample page
Browse files Browse the repository at this point in the history
  • Loading branch information
Stardog authored and matt committed Aug 5, 2011
1 parent d18769e commit a7d6c35
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
4 changes: 4 additions & 0 deletions class/UI/Intern_MenuUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ public static function display() {
$auth = Current_User::getAuthorization();
$tags['LOGOUT'] = "<a href='$auth->logout_link'>Logout</a>";

if(Current_User::allow('intern')){
$tags['DEITY'] = 'Admin Options';
$tags['EXAMPLE_LINK'] = PHPWS_Text::secureLink('Example form','intern',array('action' => 'example_form'));
}
if(Current_User::allow('intern', 'edit_major')){
$tags['DEITY'] = 'Admin Options';
$tags['EDIT_MAJORS_LINK'] = PHPWS_Text::secureLink('Edit Majors','intern',array('action' => MAJOR_EDIT));
Expand Down
14 changes: 10 additions & 4 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@

// Show requested page.
switch ($req) {
case 'example_form':
header('Content-type: application/pdf');
readfile(PHPWS_SOURCE_DIR . 'mod/intern/pdf/Internship_Example.pdf');
exit();
break;

case 'edit_internship':
PHPWS_Core::initModClass('intern', 'UI/InternshipUI.php');
$content = InternshipUI::display();
Expand Down Expand Up @@ -215,7 +221,7 @@
$state = new State($_GET['abbr']);
$state->setActive(true);
$state->save();
exit();
exit();
break;
case 'remove_state':
if (!Current_User::allow('intern', 'edit_state')) {
Expand All @@ -225,7 +231,7 @@
$state = new State($_GET['abbr']);
$state->setActive(false);
$state->save();
exit();
exit();
break;
case STATE_EDIT:
if (!Current_User::allow('intern', 'edit_state')) {
Expand All @@ -240,7 +246,7 @@
PHPWS_Core::initModClass('intern', 'Department.php');
if (isset($_REQUEST['add'])) {
if (isset($_REQUEST['all'])) {
// Add user in REQUEST to all departments
// Add user in REQUEST to all departments
Admin::addAll($_REQUEST['username']);
} else {
// Add user in REQUEST to administrator list for the department in REQUEST.
Expand Down Expand Up @@ -288,7 +294,7 @@
NQ::close();
PHPWS_Core::goBack();
break;

case 'unapprove':
if (!Current_User::isDeity()) {
Current_User::disallow();
Expand Down
Binary file added pdf/Internship_Example.pdf
Binary file not shown.
1 change: 1 addition & 0 deletions templates/menu.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<!-- BEGIN admin_section -->
<div class="sub-page-title">Admin Options:</div>
<ul class="menu-list" id="diety-list">
<li>{EXAMPLE_LINK}</li>
<!-- BEGIN majors --><li>{EDIT_MAJORS_LINK}</li><!-- END majors -->
<!-- BEGIN grad --><li>{EDIT_GRAD_LINK}</li><!-- END grad -->
<!-- BEGIN depts --><li>{EDIT_DEPARTMENTS_LINK}</li><!-- END depts -->
Expand Down

0 comments on commit a7d6c35

Please sign in to comment.