mirror of
https://github.com/Ekokumppanit/ystavakylaecard.git
synced 2026-01-26 03:04:00 +00:00
Coding standard fixes. Routes: Error page override works now. Welcome controller: Return false where needed. Header-view: lnk-helper function to help highlight current page matching links. ecards-helper: lnk() and checkboxes(), needs commenting. new-view: values for javascript, Image name for dropdown. style.css: better colours, footer links not so prominent, helper classes, moved cursor: move from users without javascript. scripts.js: documentation.
This commit is contained in:
@@ -31,14 +31,16 @@ define('DIR_WRITE_MODE', 0777);
|
|||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define('FOPEN_READ', 'rb');
|
define('FOPEN_READ', 'rb');
|
||||||
define('FOPEN_READ_WRITE', 'r+b');
|
define('FOPEN_READ_WRITE', 'r+b');
|
||||||
define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care
|
define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care
|
||||||
define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care
|
define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care
|
||||||
define('FOPEN_WRITE_CREATE', 'ab');
|
define('FOPEN_WRITE_CREATE', 'ab');
|
||||||
define('FOPEN_READ_WRITE_CREATE', 'a+b');
|
define('FOPEN_READ_WRITE_CREATE', 'a+b');
|
||||||
define('FOPEN_WRITE_CREATE_STRICT', 'xb');
|
define('FOPEN_WRITE_CREATE_STRICT', 'xb');
|
||||||
define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');
|
define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* End of file constants.php */
|
/* End of file constants.php */
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ if (empty($route)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$route['default_controller'] = "welcome";
|
$route['default_controller'] = "welcome";
|
||||||
$route['404_override'] = 'error404';
|
$route['404_override'] = 'welcome/error404';
|
||||||
|
|
||||||
$route['uusi'] = $route['default_controller']."/newCard";
|
$route['uusi'] = $route['default_controller']."/newCard";
|
||||||
$route['kaikki'] = $route['default_controller']."/ecards";
|
$route['kaikki'] = $route['default_controller']."/ecards";
|
||||||
|
|||||||
@@ -95,6 +95,8 @@ class Welcome extends CI_Controller
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function upload()
|
public function upload()
|
||||||
|
|||||||
77
application/helpers/ecards_helper.php
Normal file
77
application/helpers/ecards_helper.php
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* lnk helps return anchor tag with class when current_url() is site_url($match)
|
||||||
|
*
|
||||||
|
* @param string $url Your link inside the application, not for outside links
|
||||||
|
* @param string $text Link text
|
||||||
|
* @param string $match What url to match against, use like $url
|
||||||
|
* @param string $class What class should be added if urls match
|
||||||
|
*
|
||||||
|
* @author Ismo Vuorinen <ismo.vuorinen@tampere.fi>
|
||||||
|
*
|
||||||
|
* @return string Formatted anchor tag with everything needed
|
||||||
|
*/
|
||||||
|
function lnk($url = null, $text = null, $match = null, $class = ' active')
|
||||||
|
{
|
||||||
|
// $url should be "controller/action", no need to give full url
|
||||||
|
$url = site_url($url);
|
||||||
|
|
||||||
|
// Test matching, are we on the page we want to match against?
|
||||||
|
if (empty($match)) {
|
||||||
|
$match = current_url();
|
||||||
|
} else {
|
||||||
|
$match = site_url($match);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return correctly formatted link
|
||||||
|
if ($url == $match) {
|
||||||
|
return '<a class="' . $class . '" href="' . $url . '">' . $text . '</a>';
|
||||||
|
} else {
|
||||||
|
return '<a href="'. $url .'">' . $text . '</a>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkboxed(
|
||||||
|
$name,
|
||||||
|
$data,
|
||||||
|
$value,
|
||||||
|
$label,
|
||||||
|
$data_id = null,
|
||||||
|
$disabled = false,
|
||||||
|
$disabletext = null
|
||||||
|
) {
|
||||||
|
$fieldname = null;
|
||||||
|
$labelname = null;
|
||||||
|
$string = null;
|
||||||
|
|
||||||
|
$fieldname = 'data['.$data_id.']['.$name.']';
|
||||||
|
$labelname = $fieldname .'['. $data .']';
|
||||||
|
|
||||||
|
$string = '<input type="radio" '
|
||||||
|
. 'name="' . $fieldname .'" '
|
||||||
|
. 'id="' . $labelname . '" '
|
||||||
|
. 'value="'. $value.'"';
|
||||||
|
|
||||||
|
if ($data == $value) {
|
||||||
|
$string .= ' checked';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($disabletext)) {
|
||||||
|
$disabletext = 'Ei voida julkaista lähettäjän päätöksestä';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($disabled) {
|
||||||
|
$string .= ' disabled';
|
||||||
|
$label = '<span data-tooltip class="has-tip tip-top" '
|
||||||
|
. 'data-width="180" title="' . $disabletext . '">' . $label . '</span>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$string .= '>';
|
||||||
|
|
||||||
|
if (!empty($label)) {
|
||||||
|
$string = '<label>' . $string . $label . '</label>';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $string;
|
||||||
|
}
|
||||||
@@ -7,14 +7,14 @@ if (empty($page_title)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
?><!DOCTYPE html>
|
?><!DOCTYPE html>
|
||||||
<!--[if IE 8]> <html class="no-js lt-ie9" lang="fi"> <![endif]-->
|
<!--[if IE 8]><html class="no-js lt-ie9" lang="fi"><![endif]-->
|
||||||
<!--[if gt IE 8]><!--> <html class="no-js" lang="fi"> <!--<![endif]-->
|
<!--[if gt IE 8]><!--> <html class="no-js" lang="fi"><!--<![endif]-->
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width" />
|
<meta name="viewport" content="width=device-width" />
|
||||||
<link rel="icon" href="<?php echo site_url('/favicon.ico'); ?>">
|
<link rel="icon" href="<?php echo site_url('/favicon.ico'); ?>">
|
||||||
<title><?php echo implode(" » ", $page_title); ?></title>
|
<title><?php echo implode(" » ", $page_title); ?></title>
|
||||||
<?php
|
<?php
|
||||||
// Assets spark
|
// Assets spark
|
||||||
assets_css(
|
assets_css(
|
||||||
array(
|
array(
|
||||||
@@ -44,29 +44,30 @@ if (empty($page_title)) {
|
|||||||
<section class="top-bar-section">
|
<section class="top-bar-section">
|
||||||
<ul class="left">
|
<ul class="left">
|
||||||
<li class="divider"></li>
|
<li class="divider"></li>
|
||||||
<li><a class="active" href="<?php echo site_url("uusi"); ?>">Luo omasi!</a></li>
|
<li><?= lnk("uusi", "Luo omasi!"); ?></li>
|
||||||
<li class="divider"></li>
|
<li class="divider"></li>
|
||||||
<li><a href="<?php echo site_url("kaikki"); ?>">Listaa kaikki</a></li>
|
<li><?= lnk("kaikki", "Listaa kaikki"); ?></li>
|
||||||
<li class="divider"></li>
|
<li class="divider"></li>
|
||||||
<li class="has-dropdown">
|
<li class="has-dropdown">
|
||||||
<a href="<?php echo site_url("info"); ?>">Tietoa</a>
|
<?= lnk("info", "Tietoa"); ?>
|
||||||
<ul class="dropdown">
|
<ul class="dropdown">
|
||||||
<li><a href="<?php echo site_url("info"); ?>#rekisteri">Rekisteriseloste</a></li>
|
<li><?= lnk("info#rekisteri", "Rekisteriseloste"); ?></li>
|
||||||
<li><a href="<?php echo site_url("info"); ?>#yhteystiedot">Yhteystiedot</a></li>
|
<li><?= lnk("info#yhteystiedot", "Yhteystiedot"); ?></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if (isset($user) and ! empty($user)) {
|
if (isset($user) and ! empty($user)) {
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<ul class="left">
|
<ul class="left">
|
||||||
<li class="has-dropdown adminmenu">
|
<li class="has-dropdown adminmenu">
|
||||||
<a href="<?php echo site_url("yllapito"); ?>">Ylläpito</a>
|
<a href="<?php echo site_url("yllapito"); ?>">
|
||||||
<ul class="dropdown">
|
<ul class="dropdown">
|
||||||
<li class="has-dropdown">
|
<li class="has-dropdown">
|
||||||
<a href="<?php echo site_url("yllapito/kortit"); ?>">Hallitse kortteja</a>
|
<?= lnk("yllapito/ecards", "Hallitse kortteja"); ?>
|
||||||
<ul class="dropdown">
|
<ul class="dropdown">
|
||||||
<li>
|
<li>
|
||||||
<a href="<?php echo site_url("yllapito/ecards/moderate");?>">
|
<a href="<?php echo site_url("yllapito/ecards/moderate");?>">
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="small-12 large-9 columns">
|
<div class="small-12 large-9 columns">
|
||||||
<input required type="text" id="sender_name"
|
<input required type="text" id="sender_name"
|
||||||
name="sender_name" placeholder="Lähettäjän nimi">
|
name="sender_name" value="" placeholder="Lähettäjän nimi">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="small-12 large-9 columns">
|
<div class="small-12 large-9 columns">
|
||||||
<input required type="email" id="sender_email"
|
<input required type="email" id="sender_email"
|
||||||
name="sender_email" placeholder="Lähettäjän email">
|
name="sender_email" value="" placeholder="Lähettäjän email">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="small-12 large-9 columns">
|
<div class="small-12 large-9 columns">
|
||||||
<input required type="text" id="receiver_name"
|
<input required type="text" id="receiver_name"
|
||||||
name="receiver_name" placeholder="Vastaanottajan nimi">
|
name="receiver_name" value="" placeholder="Vastaanottajan nimi">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -62,7 +62,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="small-12 large-9 columns">
|
<div class="small-12 large-9 columns">
|
||||||
<input required type="email" id="receiver_email"
|
<input required type="email" id="receiver_email"
|
||||||
name="receiver_email" placeholder="Vastaanottajan email">
|
name="receiver_email" value="" placeholder="Vastaanottajan email">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -79,12 +79,12 @@
|
|||||||
<?php
|
<?php
|
||||||
if (! empty($images)) {
|
if (! empty($images)) {
|
||||||
foreach ($images as $i => $image) {
|
foreach ($images as $i => $image) {
|
||||||
|
$name = pathinfo($image, PATHINFO_FILENAME);
|
||||||
|
|
||||||
?> <option data-img-src='<?php echo
|
?> <option data-img-src='<?php echo $image;
|
||||||
$image;
|
|
||||||
?>' value='<?php
|
?>' value='<?php
|
||||||
echo $i;
|
echo $image;
|
||||||
?>'>Cute Kitten <?=$i;?></option><?php
|
?>'>Kuva: <?=$name;?></option><?php
|
||||||
echo "\n";
|
echo "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -102,7 +102,7 @@ if (! empty($images)) {
|
|||||||
</div>
|
</div>
|
||||||
<div class="small-12 large-9 columns">
|
<div class="small-12 large-9 columns">
|
||||||
<input type="text" maxlength="200" id="message_title"
|
<input type="text" maxlength="200" id="message_title"
|
||||||
name="message_title" placeholder="Moikka!">
|
name="message_title" value="" placeholder="Moikka!">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -166,9 +166,6 @@ if (! empty($images)) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,13 +21,30 @@ h1, h2, h3 {
|
|||||||
font-family: Georgia, 'Sans serif';
|
font-family: Georgia, 'Sans serif';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.center {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.center * {
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
.top-bar-section .adminmenu > a {
|
.top-bar-section .adminmenu > a {
|
||||||
background-color: #333 !important;
|
background-color: #805219 !important;
|
||||||
}
|
}
|
||||||
.top-bar-section .adminmenu a.logout {
|
.top-bar-section .adminmenu a.logout {
|
||||||
background-color: #900 !important;
|
background-color: #900 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.pagefooter a {
|
||||||
|
color: #333;
|
||||||
|
border-bottom: 1px dashed #333;
|
||||||
|
margin: 0 2px;
|
||||||
|
}
|
||||||
|
.pagefooter a:hover {
|
||||||
|
color: #000;
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
.progress span {
|
.progress span {
|
||||||
display: block;
|
display: block;
|
||||||
padding: 4px 5px;
|
padding: 4px 5px;
|
||||||
@@ -37,13 +54,13 @@ h1, h2, h3 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.progress span.queue {
|
.progress span.queue {
|
||||||
background: #111;
|
background: #699938;
|
||||||
}
|
}
|
||||||
.progress span.public {
|
.progress span.public {
|
||||||
background: #333;
|
background: #9ecb45;
|
||||||
}
|
}
|
||||||
.progress span.private {
|
.progress span.private {
|
||||||
background: #555;
|
background: #f69637;
|
||||||
}
|
}
|
||||||
.progress span.hidden {
|
.progress span.hidden {
|
||||||
background: #777;
|
background: #777;
|
||||||
@@ -112,6 +129,8 @@ h1, h2, h3 {
|
|||||||
left: 0px;
|
left: 0px;
|
||||||
border: 1px solid #333;
|
border: 1px solid #333;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.postcard_preview {
|
.postcard_preview {
|
||||||
@@ -135,8 +154,7 @@ h1, h2, h3 {
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
text-shadow: 0px 0px 10px rgba(150, 150, 150, 1);
|
text-shadow: 0px 0px 10px rgba(150, 150, 150, 1);
|
||||||
width: 90%;
|
width: 90%;
|
||||||
cursor: move;
|
border: 1px dashed transparent;
|
||||||
border: 1px dashed #666;
|
|
||||||
}
|
}
|
||||||
#message_title_preview {
|
#message_title_preview {
|
||||||
top: 20px;
|
top: 20px;
|
||||||
@@ -150,6 +168,8 @@ h1, h2, h3 {
|
|||||||
|
|
||||||
.ui-draggable-dragging,
|
.ui-draggable-dragging,
|
||||||
.ui-resizable-resizing {
|
.ui-resizable-resizing {
|
||||||
|
cursor: move;
|
||||||
|
border: 1px dashed #666;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
background: rgba(255, 255, 255, 0.5);
|
background: rgba(255, 255, 255, 0.5);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ jQuery(document).ready(function($) {
|
|||||||
$('div#message_text_preview').text(message_text_preview_text);
|
$('div#message_text_preview').text(message_text_preview_text);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// Sizing and placement of preview elements
|
// Sizing and placement of preview elements
|
||||||
$('#message_title_preview, #message_text_preview')
|
$('#message_title_preview, #message_text_preview')
|
||||||
.draggable({
|
.draggable({
|
||||||
@@ -80,11 +79,11 @@ jQuery(document).ready(function($) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Set panel height on initiation
|
||||||
$('#previewpanel').height( $('#previewimage').height() );
|
$('#previewpanel').height( $('#previewimage').height() );
|
||||||
|
|
||||||
setElementPlaces();
|
setElementPlaces(); // Populate our image place fields
|
||||||
checkSizesTimer();
|
checkSizesTimer(); // If we change window size, make everything adjust
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* checkSizesTimer changes inputs
|
* checkSizesTimer changes inputs
|
||||||
|
|||||||
144
index.php
144
index.php
@@ -19,12 +19,16 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
$config_baselocation = dirname(__FILE__) . '/application/config/';
|
$config_baselocation = dirname(__FILE__) . '/application/config/';
|
||||||
if( is_readable( $config_baselocation . 'development/_config.php' ) ) {
|
if (is_readable($config_baselocation . 'production/config.php')) {
|
||||||
define('ENVIRONMENT', 'development');
|
define('ENVIRONMENT', 'production');
|
||||||
} elseif( is_readable( $config_baselocation . 'production/_config.php' ) ) {
|
}
|
||||||
define('ENVIRONMENT', 'production');
|
if (is_readable($config_baselocation . 'development/config.php') && ! defined('ENVIRONMENT')) {
|
||||||
} else {
|
define('ENVIRONMENT', 'development');
|
||||||
die("No config found {$config_baselocation}/development/config.php nor {$config_baselocation}/production/config.php");
|
}
|
||||||
|
|
||||||
|
if (! defined('ENVIRONMENT')) {
|
||||||
|
die("No config found {$config_baselocation}/development/config.php "
|
||||||
|
."nor {$config_baselocation}/production/config.php");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -36,22 +40,19 @@ if( is_readable( $config_baselocation . 'development/_config.php' ) ) {
|
|||||||
* By default development will show errors but testing and live will hide them.
|
* By default development will show errors but testing and live will hide them.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (defined('ENVIRONMENT'))
|
if (defined('ENVIRONMENT')) {
|
||||||
{
|
switch (ENVIRONMENT)
|
||||||
switch (ENVIRONMENT)
|
{
|
||||||
{
|
case 'development':
|
||||||
case 'development':
|
error_reporting(E_ALL);
|
||||||
error_reporting(E_ALL);
|
break;
|
||||||
break;
|
case 'testing':
|
||||||
|
case 'production':
|
||||||
case 'testing':
|
error_reporting(0);
|
||||||
case 'production':
|
break;
|
||||||
error_reporting(0);
|
default:
|
||||||
break;
|
exit('The application environment is not set correctly.');
|
||||||
|
}
|
||||||
default:
|
|
||||||
exit('The application environment is not set correctly.');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -64,7 +65,7 @@ if (defined('ENVIRONMENT'))
|
|||||||
* as this file.
|
* as this file.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
$system_path = 'system';
|
$system_path = 'system';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*---------------------------------------------------------------
|
*---------------------------------------------------------------
|
||||||
@@ -80,7 +81,7 @@ if (defined('ENVIRONMENT'))
|
|||||||
* NO TRAILING SLASH!
|
* NO TRAILING SLASH!
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
$application_folder = 'application';
|
$application_folder = 'application';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* --------------------------------------------------------------------
|
* --------------------------------------------------------------------
|
||||||
@@ -102,15 +103,15 @@ if (defined('ENVIRONMENT'))
|
|||||||
* Un-comment the $routing array below to use this feature
|
* Un-comment the $routing array below to use this feature
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
// The directory name, relative to the "controllers" folder. Leave blank
|
// The directory name, relative to the "controllers" folder. Leave blank
|
||||||
// if your controller is not in a sub-folder within the "controllers" folder
|
// if your controller is not in a sub-folder within the "controllers" folder
|
||||||
// $routing['directory'] = '';
|
// $routing['directory'] = '';
|
||||||
|
|
||||||
// The controller class file name. Example: Mycontroller
|
// The controller class file name. Example: Mycontroller
|
||||||
// $routing['controller'] = '';
|
// $routing['controller'] = '';
|
||||||
|
|
||||||
// The controller function you wish to be called.
|
// The controller function you wish to be called.
|
||||||
// $routing['function'] = '';
|
// $routing['function'] = '';
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -128,7 +129,7 @@ if (defined('ENVIRONMENT'))
|
|||||||
* Un-comment the $assign_to_config array below to use this feature
|
* Un-comment the $assign_to_config array below to use this feature
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
// $assign_to_config['name_of_config_item'] = 'value of config item';
|
// $assign_to_config['name_of_config_item'] = 'value of config item';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -142,62 +143,59 @@ if (defined('ENVIRONMENT'))
|
|||||||
* ---------------------------------------------------------------
|
* ---------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Set the current directory correctly for CLI requests
|
// Set the current directory correctly for CLI requests
|
||||||
if (defined('STDIN'))
|
if (defined('STDIN')) {
|
||||||
{
|
chdir(dirname(__FILE__));
|
||||||
chdir(dirname(__FILE__));
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (realpath($system_path) !== FALSE)
|
if (realpath($system_path) !== false) {
|
||||||
{
|
$system_path = realpath($system_path).'/';
|
||||||
$system_path = realpath($system_path).'/';
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// ensure there's a trailing slash
|
// ensure there's a trailing slash
|
||||||
$system_path = rtrim($system_path, '/').'/';
|
$system_path = rtrim($system_path, '/').'/';
|
||||||
|
|
||||||
// Is the system path correct?
|
// Is the system path correct?
|
||||||
if ( ! is_dir($system_path))
|
if (! is_dir($system_path)) {
|
||||||
{
|
exit("Your system folder path does not appear to be set correctly. "
|
||||||
exit("Your system folder path does not appear to be set correctly. Please open the following file and correct this: ".pathinfo(__FILE__, PATHINFO_BASENAME));
|
."Please open the following file and correct this: "
|
||||||
}
|
. pathinfo(__FILE__, PATHINFO_BASENAME)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* -------------------------------------------------------------------
|
* -------------------------------------------------------------------
|
||||||
* Now that we know the path, set the main path constants
|
* Now that we know the path, set the main path constants
|
||||||
* -------------------------------------------------------------------
|
* -------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
// The name of THIS file
|
// The name of THIS file
|
||||||
define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
|
define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
|
||||||
|
|
||||||
// The PHP file extension
|
// The PHP file extension
|
||||||
// this global constant is deprecated.
|
// this global constant is deprecated.
|
||||||
define('EXT', '.php');
|
define('EXT', '.php');
|
||||||
|
|
||||||
// Path to the system folder
|
// Path to the system folder
|
||||||
define('BASEPATH', str_replace("\\", "/", $system_path));
|
define('BASEPATH', str_replace("\\", "/", $system_path));
|
||||||
|
|
||||||
// Path to the front controller (this file)
|
// Path to the front controller (this file)
|
||||||
define('FCPATH', str_replace(SELF, '', __FILE__));
|
define('FCPATH', str_replace(SELF, '', __FILE__));
|
||||||
|
|
||||||
// Name of the "system folder"
|
// Name of the "system folder"
|
||||||
define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/'));
|
define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/'));
|
||||||
|
|
||||||
|
|
||||||
// The path to the "application" folder
|
// The path to the "application" folder
|
||||||
if (is_dir($application_folder))
|
if (is_dir($application_folder)) {
|
||||||
{
|
define('APPPATH', $application_folder.'/');
|
||||||
define('APPPATH', $application_folder.'/');
|
} else {
|
||||||
}
|
if (! is_dir(BASEPATH.$application_folder.'/')) {
|
||||||
else
|
exit("Your application folder path does not appear to be set correctly. "
|
||||||
{
|
."Please open the following file and correct this: ".SELF);
|
||||||
if ( ! is_dir(BASEPATH.$application_folder.'/'))
|
}
|
||||||
{
|
|
||||||
exit("Your application folder path does not appear to be set correctly. Please open the following file and correct this: ".SELF);
|
|
||||||
}
|
|
||||||
|
|
||||||
define('APPPATH', BASEPATH.$application_folder.'/');
|
define('APPPATH', BASEPATH.$application_folder.'/');
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* --------------------------------------------------------------------
|
* --------------------------------------------------------------------
|
||||||
@@ -210,4 +208,4 @@ if (defined('ENVIRONMENT'))
|
|||||||
require_once BASEPATH.'core/CodeIgniter.php';
|
require_once BASEPATH.'core/CodeIgniter.php';
|
||||||
|
|
||||||
/* End of file index.php */
|
/* End of file index.php */
|
||||||
/* Location: ./index.php */
|
/* Location: ./index.php */
|
||||||
|
|||||||
Reference in New Issue
Block a user