Skip to content
This repository has been archived by the owner on Dec 6, 2019. It is now read-only.

Commit

Permalink
refs #71 Added die() line to template files
Browse files Browse the repository at this point in the history
  • Loading branch information
nabeelio committed Jul 16, 2012
1 parent 520b976 commit 5857779
Show file tree
Hide file tree
Showing 79 changed files with 186 additions and 107 deletions.
3 changes: 2 additions & 1 deletion core/templates/acarsmap.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<?php
/**
* These are some options for the ACARS map, you can change here
*
Expand Down
145 changes: 73 additions & 72 deletions core/templates/activity_list.php
Original file line number Diff line number Diff line change
@@ -1,73 +1,74 @@
<h3>Activity Feed</h3>
<?php

foreach($allactivities as $activity) {

/* Use the activity->type to determine the type of activity (duh?)
Constants are in app.config.php
Like here, I put a specific link to the PIREP at the end of the message
You can use the if/else's to add specific images?
$activity->refid is the ID of the thing it's referring to, so if it's a
new PIREP, the refid will be the ID of the PIREP
$activity-> also contains all the fields about the pilot who this notice
is about
*/

$link_title = '';
$link_href = '';
if($activity->type == ACTIVITY_NEW_PIREP) {

$link_href = url('/pireps/view/'.$activity->refid);
$link_title = 'View Flight Report';

} elseif($activity->type == ACTIVITY_TWITTER) {

$link_href = 'http://twitter.com/#!/'.Config::get('TWITTER_AIRLINE_ACCOUNT').'/status/'.$activity->refid;
$link_title = 'View Tweet';

} elseif($activity->type == ACTIVITY_NEW_PILOT) {
$link_href = url('/profile/view/'.$activity->pilotid);
$link_title = 'View Profile';
}
?>
<p>
<?php
/* Example, if it's a twitter status update (ACTIVITY_TWITTER),
then show an image (in this case, a small Twitter icon) */
if($activity->type == ACTIVITY_TWITTER) {
echo '<img src="'.fileurl('/lib/images/twitter.png').'" alt="twitter update" />';
}

?>
<?php
/* If there is a pilot associated with this feed update, show their name
and a link to their profile page */
if($activity->pilotid != 0) {
$pilotCode = PilotData::getPilotCode($activity->code, $activity->pilotid);
?>

<a href="<?php echo url('/profile/view/'.$activity->pilotid);?>">
<?php echo $pilotCode.' '.$activity->firstname.' '.$activity->lastname?>
</a>

<?php
} /* End if pilot ID != 0 */
?>

<?php
/* Show the activity message itself */
echo stripslashes($activity->message);
?>

<?php
if($link_href != '') {
echo ' <a href="'.$link_href.'">'.$link_title.'</a>';
}
?>
</p>
<?php
}
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<h3>Activity Feed</h3>
<?php

foreach($allactivities as $activity) {

/* Use the activity->type to determine the type of activity (duh?)
Constants are in app.config.php
Like here, I put a specific link to the PIREP at the end of the message
You can use the if/else's to add specific images?
$activity->refid is the ID of the thing it's referring to, so if it's a
new PIREP, the refid will be the ID of the PIREP
$activity-> also contains all the fields about the pilot who this notice
is about
*/

$link_title = '';
$link_href = '';
if($activity->type == ACTIVITY_NEW_PIREP) {

$link_href = url('/pireps/view/'.$activity->refid);
$link_title = 'View Flight Report';

} elseif($activity->type == ACTIVITY_TWITTER) {

$link_href = 'http://twitter.com/#!/'.Config::get('TWITTER_AIRLINE_ACCOUNT').'/status/'.$activity->refid;
$link_title = 'View Tweet';

} elseif($activity->type == ACTIVITY_NEW_PILOT) {
$link_href = url('/profile/view/'.$activity->pilotid);
$link_title = 'View Profile';
}
?>
<p>
<?php
/* Example, if it's a twitter status update (ACTIVITY_TWITTER),
then show an image (in this case, a small Twitter icon) */
if($activity->type == ACTIVITY_TWITTER) {
echo '<img src="'.fileurl('/lib/images/twitter.png').'" alt="twitter update" />';
}

?>
<?php
/* If there is a pilot associated with this feed update, show their name
and a link to their profile page */
if($activity->pilotid != 0) {
$pilotCode = PilotData::getPilotCode($activity->code, $activity->pilotid);
?>

<a href="<?php echo url('/profile/view/'.$activity->pilotid);?>">
<?php echo $pilotCode.' '.$activity->firstname.' '.$activity->lastname?>
</a>

<?php
} /* End if pilot ID != 0 */
?>

<?php
/* Show the activity message itself */
echo stripslashes($activity->message);
?>

<?php
if($link_href != '') {
echo ' <a href="'.$link_href.'">'.$link_title.'</a>';
}
?>
</p>
<?php
}
?>
1 change: 1 addition & 0 deletions core/templates/contact_form.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<h3>Contact Us</h3>
<form method="post" action="<?php echo url('/contact'); ?>">
<table width='100%' border='0'>
Expand Down
1 change: 1 addition & 0 deletions core/templates/contact_sent.php
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<h3>Thanks!</h3>
<p>Your request has been submitted, we will be in touch shortly.</p>
1 change: 1 addition & 0 deletions core/templates/core_error.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<?php
echo '<div id="error" class="'.$class.'">'.$message.'</div>';
?>
1 change: 1 addition & 0 deletions core/templates/core_htmlhead.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<?php
/**
* STOP! HAMMER TIME!
Expand Down
1 change: 1 addition & 0 deletions core/templates/core_htmlreq.php
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<div class="jqmWindow" id="jqmdialog"></div>
1 change: 1 addition & 0 deletions core/templates/core_message.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<div id="messagebox">
<?php echo $message;?>
</div>
1 change: 1 addition & 0 deletions core/templates/core_navigation.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<li><a href="<?php echo url('/'); ?>">home</a></li>
<?php
if(!Auth::LoggedIn())
Expand Down
1 change: 1 addition & 0 deletions core/templates/core_success.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<?php
echo '<div id="success">'.$message.'</div>';
?>
1 change: 1 addition & 0 deletions core/templates/download_item.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<div align="center">
<p>Your download will start in a few seconds, or <a href="<?php echo $download->link;?>">click here to manually start.</a></p>
</div>
Expand Down
1 change: 1 addition & 0 deletions core/templates/downloads_list.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<h1>Downloads</h1>

<?php
Expand Down
1 change: 1 addition & 0 deletions core/templates/email_lostpassword.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
Dear <?php echo $firstname .' '. $lastname; ?>,

Your password was reset, it is: <?php echo $newpw?>
Expand Down
1 change: 1 addition & 0 deletions core/templates/email_pilot_retired.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
Hi <?php echo $pilot->firstname.' '.$pilot->lastname?>,

You have been marked as retired because you have been inactive for more than <?php echo Config::Get('PILOT_INACTIVE_TIME')?> days. To be un-retired, you must file a PIREP.
Expand Down
1 change: 1 addition & 0 deletions core/templates/email_registered.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
Dear <?php echo $firstname .' '. $lastname; ?>,

Your account have been made at <?php echo SITE_NAME?>, but your account has not yet been activated. You will receive an email when your registration has been activated by someone on our staff.
Expand Down
1 change: 1 addition & 0 deletions core/templates/email_registrationaccepted.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
Dear <?php echo $pilot->firstname.' '.$pilot->lastname ?>,
Your registration for <?php echo SITE_NAME?> was accepted! Please visit us
at <a href="<?php echo SITE_URL?>"><?php echo SITE_NAME?></a> to login and complete your registration
Expand Down
1 change: 1 addition & 0 deletions core/templates/email_registrationdenied.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
Dear <?php echo $pilot->firstname.' '.$pilot->lastname?>,
Your registration for <?php echo SITE_NAME; ?> was denied. Please contact an admin at <a href="<?php echo url('/');?>"><?php echo url('/');?></a> to dispute this.

Expand Down
1 change: 1 addition & 0 deletions core/templates/finance_balancesheet.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<?php
Template::Show('finance_header.tpl');
?>
Expand Down
1 change: 1 addition & 0 deletions core/templates/finance_header.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<br /><div style="float: right;">
<form action="<?php echo url('/finances/viewreport'); ?>" method="get">
<strong>Select Report: </strong>
Expand Down
1 change: 1 addition & 0 deletions core/templates/finance_summarysheet.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<?php
/*
* DO NOT EDIT THIS TEMPLATE UNLESS:
Expand Down
1 change: 1 addition & 0 deletions core/templates/flown_routes_map.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<?php
/**
*
Expand Down
1 change: 1 addition & 0 deletions core/templates/frontpage_main.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<div id="mainbox">
<?php

Expand Down
1 change: 1 addition & 0 deletions core/templates/frontpage_recentbids.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<?php
if(!$lastbids)
{
Expand Down
1 change: 1 addition & 0 deletions core/templates/frontpage_recentpilots.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<?php
foreach($pilot_list as $pilot) {
?>
Expand Down
1 change: 1 addition & 0 deletions core/templates/frontpage_reports.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<?php
if(!$pirep_list) {
echo 'No reports have been filed';
Expand Down
1 change: 1 addition & 0 deletions core/templates/fsacars_config.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
[Log]
Log=<?php echo SITE_URL?>/action.php/acars/fsacars/pirep
Mail=
Expand Down
1 change: 1 addition & 0 deletions core/templates/fsfk_liveacars_config.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
[ACARS_CONFIG]
ADDRESS=<?php echo actionurl('/fsfk/acars'); ?>

Expand Down
3 changes: 2 additions & 1 deletion core/templates/fsfk_log_flightcritique.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<?php
/* This template is for FSFK log for the flight critique.
Be careful, it's a bit fragile
*/
Expand Down
1 change: 1 addition & 0 deletions core/templates/fsfk_log_flightdata.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<div class="fsfk_section_title" >Flight Details</div>
<table class="fsfk_flightplan">
<thead>
Expand Down
1 change: 1 addition & 0 deletions core/templates/fsfk_log_flightimages.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<div class="fsfk_section_title">Flight Images</div>
<?php
/*
Expand Down
1 change: 1 addition & 0 deletions core/templates/fsfk_pirep_config.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
[WEB_CONFIG]
ADDRESS=<?php echo actionurl('/fsfk/pirep'); ?>

Expand Down
1 change: 1 addition & 0 deletions core/templates/fsfk_vaconfig.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
[VA_CONFIG]
DOWNLOADURL = <?php echo actionurl('/fsfk/vaconfig_template'); ?>

Expand Down
1 change: 1 addition & 0 deletions core/templates/fspax_config.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
menu_name=<?php echo substr(SITE_NAME, 0, 49);?>;
base_url=<?php echo SITE_URL; ?>;
path_stats=index.php/acars;
Expand Down
1 change: 1 addition & 0 deletions core/templates/login_already.php
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<h3>Error!</h3>
<p>You are already logged in!</p>
1 change: 1 addition & 0 deletions core/templates/login_complete.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<?php
if($redir == '')
$redir = SITE_URL;
Expand Down
1 change: 1 addition & 0 deletions core/templates/login_forgotpassword.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<form action="<?php echo url('/login/forgotpassword');?>" method="post">
<p><strong>Enter your email address to get a new password: </strong>
<input type="text" name="email" />
Expand Down
1 change: 1 addition & 0 deletions core/templates/login_form.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<h1>Login</h1>
<form name="loginform" action="<?php echo url('/login');?>" method="post">
<?php echo "<?xml version='1.0'?>"; ?>
Expand Down
1 change: 1 addition & 0 deletions core/templates/login_notfound.php
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<p>This email address was not found in our database. If you feel this was an error, please contact an administrator.</p>
1 change: 1 addition & 0 deletions core/templates/login_passwordreset.php
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<h3>Password Reset</h3>
<p>Your new password has been sent to your email!</p>
1 change: 1 addition & 0 deletions core/templates/login_rejected.php
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<h3>Sorry!</h3>
<p>Your registration was not accepted. Please contact the administrator for additional details.</p>
2 changes: 2 additions & 0 deletions core/templates/login_unconfirmed.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<h3>Unconfirmed</h3>

<p>Sorry! Your registration has not yet been checked by an administrator. Please try again later. You will receive an email when your registration has been accepted</p>
37 changes: 19 additions & 18 deletions core/templates/maintenance.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
<?php
/* This page should be a complete HTML page */
?>
<html>
<head>
<title>Down for maintenance - phpVMS Virtual Airline</title>
<style type="text/css">
body { font-family: verdana; font-size: 16px; color: #001B6B }
h1 { font-weight:16px;font-size:18px;color:#6B001B;margin:0 0 4px 0; }
div#codon_crit_error { border:#999 1px solid;background-color:#fff;padding:20px 20px 12px 20px;}
</style>
</head>
<body>
<div id="codon_crit_error" >
<h1>Down for maintenance</h1>
<p>We are currently down for maintenance, please check back soon.</p>
</div>
</body>
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<?php
/* This page should be a complete HTML page */
?>
<html>
<head>
<title>Down for maintenance - phpVMS Virtual Airline</title>
<style type="text/css">
body { font-family: verdana; font-size: 16px; color: #001B6B }
h1 { font-weight:16px;font-size:18px;color:#6B001B;margin:0 0 4px 0; }
div#codon_crit_error { border:#999 1px solid;background-color:#fff;padding:20px 20px 12px 20px;}
</style>
</head>
<body>
<div id="codon_crit_error" >
<h1>Down for maintenance</h1>
<p>We are currently down for maintenance, please check back soon.</p>
</div>
</body>
</html>
1 change: 1 addition & 0 deletions core/templates/news_newsitem.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<h3><?php echo $subject;?></strong></h3>
<p>Posted by <?php echo $postedby;?> on <?php echo $postdate;?></p>
<p><?php echo html_entity_decode($body);?></p>
Expand Down
Loading

0 comments on commit 5857779

Please sign in to comment.