Minor tweaks, bypass minifier

This commit is contained in:
Timothy Warren 2016-12-29 13:56:30 -05:00
parent 0e42b583aa
commit b4e470704a
14 changed files with 411 additions and 411 deletions

View File

@ -40,12 +40,12 @@
*/ */
$autoload['libraries'] = [ $autoload['libraries'] = [
'validation_callbacks',
'database', 'database',
'page', 'page',
'todo', 'todo',
'session', 'session',
'form_validation', 'form_validation',
'validation_callbacks'
]; ];
@ -97,7 +97,7 @@ $autoload['config'] = array('sites');
| |
| $autoload['language'] = array('lang1', 'lang2'); | $autoload['language'] = array('lang1', 'lang2');
| |
| NOTE: Do not include the "_lang" part of your file. For example | NOTE: Do not include the "_lang" part of your file. For example
| "codeigniter_lang.php" would be referenced as array('codeigniter'); | "codeigniter_lang.php" would be referenced as array('codeigniter');
| |
*/ */

View File

@ -3,15 +3,15 @@
* Groups configuration for default Minify implementation * Groups configuration for default Minify implementation
* @package Minify * @package Minify
*/ */
$root = "//"; $root = "//";
return array( return array(
/*----- /*-----
Css Css
-----*/ -----*/
'css' => array( 'css' => array(
$root. 'fonts/Puritan/stylesheet.css', $root. 'fonts/Puritan/stylesheet.css',
$root. 'css/todo.css', $root. 'css/todo.css',
@ -19,18 +19,18 @@ return array(
$root. 'js/CLEditor/jquery.cleditor.css', $root. 'js/CLEditor/jquery.cleditor.css',
$root. 'css/jquery-ui.min.css' $root. 'css/jquery-ui.min.css'
), ),
/*----- /*-----
Javascript Javascript
-----*/ -----*/
'js' => array( 'js' => array(
$root. 'js/CLEditor/jquery.cleditor.js', $root. 'js/CLEditor/jquery.cleditor.js',
$root. 'js/CLEditor/jquery.cleditor.xhtml.js', $root. 'js/CLEditor/jquery.cleditor.xhtml.js',
$root. 'js/todo.js', $root. 'js/todo.js',
), ),
'js_mobile' => array( 'js_mobile' => array(
$root. 'js/todo.js', $root. 'js/todo.js',
), ),
); );

View File

@ -9,7 +9,7 @@
*/ */
function check_session() function check_session()
{ {
$CI =& get_instance(); $CI = get_instance();
if($CI->session->userdata('uid') == FALSE) if($CI->session->userdata('uid') == FALSE)
{ {

View File

@ -1,34 +1,34 @@
<?php <?php
/** /**
* Add some convenience methods to form_validation library * Add some convenience methods to form_validation library
*/ */
class MY_Form_validation extends CI_Form_validation { class MY_Form_validation extends CI_Form_validation {
/** /**
* Returns an array of errors for the current form * Returns an array of errors for the current form
* *
* @return array * @return array
*/ */
public function get_error_array() public function get_error_array()
{ {
return array_values($this->_error_array); return array_values($this->_error_array);
} }
/** /**
* Clears out object data * Clears out object data
* *
* @return void * @return void
*/ */
public function reset() public function reset()
{ {
foreach([ foreach([
'_field_data', '_field_data',
'_error_array', '_error_array',
'_error_messages' '_error_messages'
] as $var) { ] as $var) {
$this->$var = array(); $this->$var = array();
} }
} }
} }
// End of libraries/MY_Form_validation.php // End of libraries/MY_Form_validation.php

View File

@ -605,12 +605,19 @@ class Task_model extends CI_Model {
*/ */
public function update_task() public function update_task()
{ {
$due_timestamp = $this->input->post('due') . ' ' .
$this->input->post('due_hour') . ':' .
$this->input->post('due_minute');
$unix_due = strtotime($due_timestamp);
$title = $this->input->post('title');; $title = $this->input->post('title');;
$desc = str_replace('<br>', '<br />', $this->input->post('desc')); $desc = str_replace('<br>', '<br />', $this->input->post('desc'));
$category = $this->input->post('category'); $category = $this->input->post('category');
$priority = $this->input->post('priority'); $priority = $this->input->post('priority');
$status = $this->input->post('status'); $status = $this->input->post('status');
$due = $this->input->post('due'); $due = $unix_due;
$uid = $this->user_id; $uid = $this->user_id;
$task_id = $this->task_id; $task_id = $this->task_id;

View File

@ -69,7 +69,7 @@ class CIU_Loader extends CI_Loader {
// return a new instance of the object // return a new instance of the object
if ( ! is_null($object_name)) if ( ! is_null($object_name))
{ {
$CI =& get_instance(); $CI = get_instance();
if ( ! isset($CI->$object_name)) if ( ! isset($CI->$object_name))
{ {
return $this->_ci_init_class($class, config_item('ciu_subclass_prefix'), $params, $object_name); return $this->_ci_init_class($class, config_item('ciu_subclass_prefix'), $params, $object_name);
@ -82,12 +82,12 @@ class CIU_Loader extends CI_Loader {
} }
include_once($baseclass); include_once($baseclass);
if (file_exists($subclass)) if (file_exists($subclass))
{ {
include_once($subclass); include_once($subclass);
} }
include_once($ciu_subclass); include_once($ciu_subclass);
$this->_ci_loaded_files[] = $ciu_subclass; $this->_ci_loaded_files[] = $ciu_subclass;
@ -113,7 +113,7 @@ class CIU_Loader extends CI_Loader {
// return a new instance of the object // return a new instance of the object
if ( ! is_null($object_name)) if ( ! is_null($object_name))
{ {
$CI =& get_instance(); $CI = get_instance();
if ( ! isset($CI->$object_name)) if ( ! isset($CI->$object_name))
{ {
return $this->_ci_init_class($class, config_item('subclass_prefix'), $params, $object_name); return $this->_ci_init_class($class, config_item('subclass_prefix'), $params, $object_name);
@ -152,7 +152,7 @@ class CIU_Loader extends CI_Loader {
// return a new instance of the object // return a new instance of the object
if ( ! is_null($object_name)) if ( ! is_null($object_name))
{ {
$CI =& get_instance(); $CI = get_instance();
if ( ! isset($CI->$object_name)) if ( ! isset($CI->$object_name))
{ {
return $this->_ci_init_class($class, '', $params, $object_name); return $this->_ci_init_class($class, '', $params, $object_name);
@ -281,7 +281,7 @@ class CIU_Loader extends CI_Loader {
// Save the class name and object name // Save the class name and object name
$this->_ci_classes[$class] = $classvar; $this->_ci_classes[$class] = $classvar;
// Instantiate the class // Instantiate the class
$CI =& get_instance(); $CI = get_instance();
if ($config !== NULL) if ($config !== NULL)
{ {
if ( ! defined('CIUnit_Version')) if ( ! defined('CIUnit_Version'))
@ -334,7 +334,7 @@ class CIU_Loader extends CI_Loader {
} }
$output = $this->_ci_load(array('_ci_view' => $view, '_ci_vars' => $this->_ci_object_to_array($vars), '_ci_return' => TRUE)); $output = $this->_ci_load(array('_ci_view' => $view, '_ci_vars' => $this->_ci_object_to_array($vars), '_ci_return' => TRUE));
$CI =& get_instance(); $CI = get_instance();
$CI->output->add_output($output); $CI->output->add_output($output);
} }
@ -358,12 +358,12 @@ class CIU_Loader extends CI_Loader {
} }
$ciu_helper = CIUPATH.'helpers/'.config_item('ciu_subclass_prefix').$helper.'.php'; $ciu_helper = CIUPATH.'helpers/'.config_item('ciu_subclass_prefix').$helper.'.php';
if (file_exists($ciu_helper)) if (file_exists($ciu_helper))
{ {
include_once($ciu_helper); include_once($ciu_helper);
} }
$ext_helper = APPPATH.'helpers/'.config_item('subclass_prefix').$helper.'.php'; $ext_helper = APPPATH.'helpers/'.config_item('subclass_prefix').$helper.'.php';
// Is this a helper extension request? // Is this a helper extension request?

View File

@ -9,7 +9,7 @@
/* /*
* CodeIgniter source modified for fooStack / CIUnit * CodeIgniter source modified for fooStack / CIUnit
* *
* If you use MY_Output, change the paraent class. * If you use MY_Output, change the paraent class.
*/ */
@ -64,7 +64,7 @@ class CIU_Output extends CI_Output {
function set_no_cache_headers() function set_no_cache_headers()
{ {
//somehow $this can't be used as headers are not set in that case //somehow $this can't be used as headers are not set in that case
$CI =& get_instance(); $CI = get_instance();
$CI->output->soft_set_header('Content-type: text/html; charset=utf-8'); $CI->output->soft_set_header('Content-type: text/html; charset=utf-8');
$CI->output->soft_set_header('Cache-Control: no-cache'); $CI->output->soft_set_header('Cache-Control: no-cache');
log_message('debug', 'no cache headers set in output class'); log_message('debug', 'no cache headers set in output class');
@ -116,7 +116,7 @@ class CIU_Output extends CI_Output {
*/ */
function ob_flush_clean() function ob_flush_clean()
{ {
$CI =& get_instance(); $CI = get_instance();
if (ob_get_level() > $this->_ci_ob_level + 1) if (ob_get_level() > $this->_ci_ob_level + 1)
{ {
ob_end_flush(); ob_end_flush();
@ -152,7 +152,7 @@ class CIU_Output extends CI_Output {
// Grab the super object if we can. // Grab the super object if we can.
if (class_exists('CI_Controller')) if (class_exists('CI_Controller'))
{ {
$CI =& get_instance(); $CI = get_instance();
} }
// -------------------------------------------------------------------- // --------------------------------------------------------------------

View File

@ -113,8 +113,8 @@
* Start the timer... tick tock tick tock... * Start the timer... tick tock tick tock...
* ------------------------------------------------------ * ------------------------------------------------------
*/ */
$BM =& load_class('Benchmark', 'core'); $BM = load_class('Benchmark', 'core');
$GLOBALS['BM'] =& $BM; $GLOBALS['BM'] = $BM;
$BM->mark('total_execution_time_start'); $BM->mark('total_execution_time_start');
$BM->mark('loading_time:_base_classes_start'); $BM->mark('loading_time:_base_classes_start');
@ -124,8 +124,8 @@
* Instantiate the hooks class * Instantiate the hooks class
* ------------------------------------------------------ * ------------------------------------------------------
*/ */
$EXT =& load_class('Hooks', 'core'); $EXT = load_class('Hooks', 'core');
$GLOBALS['EXT'] =& $EXT; $GLOBALS['EXT'] = $EXT;
/* /*
* ------------------------------------------------------ * ------------------------------------------------------
@ -139,8 +139,8 @@
* Instantiate the config class * Instantiate the config class
* ------------------------------------------------------ * ------------------------------------------------------
*/ */
$CFG =& load_class('Config', 'core'); $CFG = load_class('Config', 'core');
$GLOBALS['CFG'] =& $CFG; $GLOBALS['CFG'] = $CFG;
// Do we have any manually set config items in the index.php file? // Do we have any manually set config items in the index.php file?
if (isset($assign_to_config)) if (isset($assign_to_config))
@ -160,24 +160,24 @@
* *
*/ */
$UNI =& load_class('Utf8', 'core'); $UNI = load_class('Utf8', 'core');
$GLOBALS['UNI'] =& $UNI; $GLOBALS['UNI'] = $UNI;
/* /*
* ------------------------------------------------------ * ------------------------------------------------------
* Instantiate the URI class * Instantiate the URI class
* ------------------------------------------------------ * ------------------------------------------------------
*/ */
$URI =& load_class('URI', 'core'); $URI = load_class('URI', 'core');
$GLOBALS['URI'] =& $URI; $GLOBALS['URI'] = $URI;
/* /*
* ------------------------------------------------------ * ------------------------------------------------------
* Instantiate the routing class and set the routing * Instantiate the routing class and set the routing
* ------------------------------------------------------ * ------------------------------------------------------
*/ */
$RTR =& load_class('Router', 'core'); $RTR = load_class('Router', 'core');
$GLOBALS['RTR'] =& $RTR; $GLOBALS['RTR'] = $RTR;
//$RTR->_set_routing(); //$RTR->_set_routing();
// Set any routing overrides that may exist in the main index file // Set any routing overrides that may exist in the main index file
@ -191,8 +191,8 @@
* Instantiate the output class * Instantiate the output class
* ------------------------------------------------------ * ------------------------------------------------------
*/ */
$OUT =& load_class('Output', 'core'); $OUT = load_class('Output', 'core');
$GLOBALS['OUT'] =& $OUT; $GLOBALS['OUT'] = $OUT;
/* /*
* ------------------------------------------------------ * ------------------------------------------------------
@ -215,23 +215,23 @@
* Load the security class for xss and csrf support * Load the security class for xss and csrf support
* ----------------------------------------------------- * -----------------------------------------------------
*/ */
$SEC =& load_class('Security', 'core'); $SEC = load_class('Security', 'core');
$GLOBALS['SEC'] =& $SEC; $GLOBALS['SEC'] = $SEC;
/* /*
* ------------------------------------------------------ * ------------------------------------------------------
* Load the Input class and sanitize globals * Load the Input class and sanitize globals
* ------------------------------------------------------ * ------------------------------------------------------
*/ */
$IN =& load_class('Input', 'core'); $IN = load_class('Input', 'core');
$GLOBALS['IN'] =& $IN; $GLOBALS['IN'] = $IN;
/* /*
* ------------------------------------------------------ * ------------------------------------------------------
* Load the Language class * Load the Language class
* ------------------------------------------------------ * ------------------------------------------------------
*/ */
$LANG =& load_class('Lang', 'core'); $LANG = load_class('Lang', 'core');
/* /*
* ------------------------------------------------------ * ------------------------------------------------------

View File

@ -41,7 +41,7 @@ class CIUnit {
public static $spyc; public static $spyc;
public static $fixture; public static $fixture;
/** /**
* If this class is suppose to be a Singleton shouldn't the constructor be private? * If this class is suppose to be a Singleton shouldn't the constructor be private?
* Correct me if I am wrong but this doesn't prevent multiple instances of this class. * Correct me if I am wrong but this doesn't prevent multiple instances of this class.
@ -69,16 +69,16 @@ class CIUnit {
viewvars(); viewvars();
return self::$controller; return self::$controller;
} }
// the current controller must be archieved before littered // the current controller must be archieved before littered
$loader =& load_class('Loader', 'core'); $loader = load_class('Loader', 'core');
// reset all loaded data // reset all loaded data
$loader->reset(); $loader->reset();
//echo 'Var Dump of self::$controllers -- '; //echo 'Var Dump of self::$controllers -- ';
//var_dump(self::$controllers); //var_dump(self::$controllers);
/* /*
========================================================= =========================================================
I don't understand this section of code. I don't understand this section of code.
@ -94,7 +94,7 @@ class CIUnit {
//'components' => $loader->_ci_components, //'components' => $loader->_ci_components,
//'classes' => $loader->_ci_classes //'classes' => $loader->_ci_classes
} }
=================================================== ===================================================
I don't understand why this code is clearing out I don't understand why this code is clearing out
all the loaded components such as autoloaded models all the loaded components such as autoloaded models
@ -108,14 +108,14 @@ class CIUnit {
//reset saved queries //reset saved queries
self::$controller->db->queries = array(); self::$controller->db->queries = array();
*/ */
//clean output / viewvars as well; //clean output / viewvars as well;
if (isset(self::$controller->output)) if (isset(self::$controller->output))
{ {
output(); output();
viewvars(); viewvars();
} }
//the requested controller was loaded before? //the requested controller was loaded before?
if (isset(self::$controllers[$controller_name])) if (isset(self::$controllers[$controller_name]))
{ {
@ -143,7 +143,7 @@ class CIUnit {
include_once(APPPATH . 'controllers/' . $controller . EXT); include_once(APPPATH . 'controllers/' . $controller . EXT);
} }
} }
self::$current = $controller_name; self::$current = $controller_name;
self::$controllers[$controller_name] = array( self::$controllers[$controller_name] = array(
'address' => new $controller_name(), 'address' => new $controller_name(),
@ -151,12 +151,12 @@ class CIUnit {
); );
self::$controller =& self::$controllers[$controller_name]['address']; self::$controller =& self::$controllers[$controller_name]['address'];
} }
// var_dump(self::$controllers); die(); // var_dump(self::$controllers); die();
// var_dump(self::$controller); die(); // var_dump(self::$controller); die();
//CI_Base::$instance = &self::$controller; //so get_instance() provides the correct controller //CI_Base::$instance = &self::$controller; //so get_instance() provides the correct controller
return self::$controller; return self::$controller;
} }

View File

@ -14,10 +14,10 @@
class CIUnit_TestCase extends PHPUnit_Framework_TestCase class CIUnit_TestCase extends PHPUnit_Framework_TestCase
{ {
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
/** /**
* An associative array of table names. The order of the fixtures * An associative array of table names. The order of the fixtures
* determines the loading and unloading sequence of the fixtures. This is * determines the loading and unloading sequence of the fixtures. This is
* to help account for foreign key restraints in databases. * to help account for foreign key restraints in databases.
* *
* For example: * For example:
@ -39,33 +39,33 @@ class CIUnit_TestCase extends PHPUnit_Framework_TestCase
* @var array * @var array
*/ */
protected $tables = array(); protected $tables = array();
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
/** /**
* The CodeIgniter Framework Instance * The CodeIgniter Framework Instance
* *
* @var object * @var object
*/ */
public $CI; public $CI;
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
/** /**
* Constructor * Constructor
* *
* @param string $name * @param string $name
* @param array $data * @param array $data
* @param string $dataName * @param string $dataName
*/ */
public function __construct($name = NULL, array $data = array(), $dataName = '') public function __construct($name = NULL, array $data = array(), $dataName = '')
{ {
parent::__construct($name, $data, $dataName); parent::__construct($name, $data, $dataName);
$this->CI =& get_instance(); $this->CI = get_instance();
log_message('debug', get_class($this).' CIUnit_TestCase initialized'); log_message('debug', get_class($this).' CIUnit_TestCase initialized');
} }
/** /**
* Set Up * Set Up
* *
@ -83,12 +83,12 @@ class CIUnit_TestCase extends PHPUnit_Framework_TestCase
$this->dbfixt($this->tables); $this->dbfixt($this->tables);
} }
} }
/** /**
* Tear Down * Tear Down
* *
* This method will run after every test. * This method will run after every test.
* *
* @return void * @return void
* *
* @author Eric Jones * @author Eric Jones
@ -101,7 +101,7 @@ class CIUnit_TestCase extends PHPUnit_Framework_TestCase
$this->dbfixt_unload($this->tables); $this->dbfixt_unload($this->tables);
} }
} }
/** /**
* loads a database fixture * loads a database fixture
* for each given fixture, we look up the yaml file and insert that into the corresponding table * for each given fixture, we look up the yaml file and insert that into the corresponding table
@ -122,7 +122,7 @@ class CIUnit_TestCase extends PHPUnit_Framework_TestCase
$table_fixtures = func_get_args(); $table_fixtures = func_get_args();
$this->load_fixt($table_fixtures); $this->load_fixt($table_fixtures);
} }
/** /**
* This is to allow the Unit Tester to specifiy different fixutre files for * This is to allow the Unit Tester to specifiy different fixutre files for
* a given table. An example would be the testing of two different senarios * a given table. An example would be the testing of two different senarios
@ -134,7 +134,7 @@ class CIUnit_TestCase extends PHPUnit_Framework_TestCase
{ {
$fixt_name = $fixt . '_fixt'; $fixt_name = $fixt . '_fixt';
$table = is_int($table) ? $fixt : $table; $table = is_int($table) ? $fixt : $table;
if (!empty($this->$fixt_name)) if (!empty($this->$fixt_name))
{ {
CIUnit::$fixture->load($table, $this->$fixt_name); CIUnit::$fixture->load($table, $this->$fixt_name);
@ -143,12 +143,12 @@ class CIUnit_TestCase extends PHPUnit_Framework_TestCase
{ {
die("The fixture {$fixt_name} failed to load properly\n"); die("The fixture {$fixt_name} failed to load properly\n");
} }
} }
log_message('debug', 'Table fixtures "' . join('", "', $table_fixtures) . '" loaded'); log_message('debug', 'Table fixtures "' . join('", "', $table_fixtures) . '" loaded');
} }
/** /**
* DBFixt Unload * DBFixt Unload
* *
@ -180,7 +180,7 @@ class CIUnit_TestCase extends PHPUnit_Framework_TestCase
// of the database load. Right?? // of the database load. Right??
$table_fixtures = array_reverse($table_fixtures, true); $table_fixtures = array_reverse($table_fixtures, true);
} }
// Iterate over the array unloading the tables // Iterate over the array unloading the tables
foreach ($table_fixtures as $table => $fixture) foreach ($table_fixtures as $table => $fixture)
{ {
@ -206,7 +206,7 @@ class CIUnit_TestCase extends PHPUnit_Framework_TestCase
foreach ( $fixts as $fixt ) foreach ( $fixts as $fixt )
{ {
$fixt_name = $fixt . '_fixt'; $fixt_name = $fixt . '_fixt';
if (file_exists(TESTSPATH . 'fixtures/' . $fixt . '_fixt.yml')) { if (file_exists(TESTSPATH . 'fixtures/' . $fixt . '_fixt.yml')) {
$this->$fixt_name = CIUnit::$spyc->loadFile(TESTSPATH . 'fixtures/' . $fixt . '_fixt.yml'); $this->$fixt_name = CIUnit::$spyc->loadFile(TESTSPATH . 'fixtures/' . $fixt . '_fixt.yml');
} }

21
application/views/footer.php Executable file → Normal file
View File

@ -4,25 +4,12 @@
<footer class="footer"> <footer class="footer">
Generated in <?= $this->benchmark->elapsed_time();?> seconds, <?= $q_num ?> quer<?= ($q_num == 1) ? "y": "ies" ?> Generated in <?= $this->benchmark->elapsed_time();?> seconds, <?= $q_num ?> quer<?= ($q_num == 1) ? "y": "ies" ?>
</footer> </footer>
<!-- Piwik -->
<script type="text/javascript">
var _paq = _paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u=(("https:" == document.location.protocol) ? "https" : "http") + "://static.timshomepage.net/piwik/";
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', 1]);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript';
g.defer=true; g.async=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<noscript><p><img src="http://static.timshomepage.net/piwik/piwik.php?idsite=1" style="border:0" alt="" /></p></noscript>
<!-- End Piwik Code -->
<?php if($this->session->userdata('uid') == 1){$this->output->enable_profiler(TRUE);} ?> <?php if($this->session->userdata('uid') == 1){$this->output->enable_profiler(TRUE);} ?>
<script src="/js/jquery.js"></script> <script src="/js/jquery.js"></script>
<script src="/js/jquery-ui.min.js"></script> <script src="/js/jquery-ui.min.js"></script>
<?= $foot_js ?> <script src="/js/CLEditor/jquery.cleditor.js"></script>
<script src="/js/CLEditor/jquery.cleditor.xhtml.js"></script>
<script src="/js/todo.js"></script>
<?php /*<?= $foot_js ?>*/ ?>
</body> </body>
</html> </html>

10
application/views/header.php Executable file → Normal file
View File

@ -1,9 +1,15 @@
<head> <head>
<?= $meta ?> <?= $meta ?>
<title><?= $title ?></title>
<link rel="icon" href="//todo.timshomepage.net/images/favicon.ico" type="image/x-icon" /> <link rel="icon" href="//todo.timshomepage.net/images/favicon.ico" type="image/x-icon" />
<?= $css ?> <link rel="stylesheet" href="/fonts/Puritan/stylesheet.css" />
<title><?= $title ?></title> <link rel="stylesheet" href="/css/todo.css" />
<link rel="stylesheet" href="/css/message.css" />
<link rel="stylesheet" href="/js/CLEditor/jquery.cleditor.css" />
<link rel="stylesheet" href="/css/jquery-ui.min.css" />
<?php /* <?= $css ?> */ ?>
<?= $head_js ?> <?= $head_js ?>
</head> </head>
<body <?= (!empty($body_id)) ? " id=\"" . $body_id . "\"" : ""; ?>> <body <?= (!empty($body_id)) ? " id=\"" . $body_id . "\"" : ""; ?>>

4
application/views/task/view.php Executable file → Normal file
View File

@ -10,9 +10,9 @@
<?php if($user_perms > PERM_CHECKLIST_ACCESS): ?> <?php if($user_perms > PERM_CHECKLIST_ACCESS): ?>
<p id="editTask"> <p id="editTask">
<?php if($user_perms == PERM_ADMIN_ACCESS){ ?> <?php if($user_perms == PERM_ADMIN_ACCESS): ?>
<a href="#" id="delTask" onclick="if(confirm('Are you sure you want to delete this task')){window.location='<?= site_url('task/delete').'/'.$this->security->xss_clean($this->uri->segment('3')) ?>'}">Delete Task</a> <a href="#" id="delTask" onclick="if(confirm('Are you sure you want to delete this task')){window.location='<?= site_url('task/delete').'/'.$this->security->xss_clean($this->uri->segment('3')) ?>'}">Delete Task</a>
<?php } ?> <?php endif ?>
<a id="editTaskIcon" href="<?= site_url('task/edit').'/'.$task ?>">Edit Task</a> <a id="editTaskIcon" href="<?= site_url('task/edit').'/'.$task ?>">Edit Task</a>
</p> </p>

554
web/index.php Executable file → Normal file
View File

@ -1,278 +1,278 @@
<?php <?php
/** /**
* CodeIgniter * CodeIgniter
* *
* An open source application development framework for PHP 5.2.4 or newer * An open source application development framework for PHP 5.2.4 or newer
* *
* NOTICE OF LICENSE * NOTICE OF LICENSE
* *
* Licensed under the Open Software License version 3.0 * Licensed under the Open Software License version 3.0
* *
* This source file is subject to the Open Software License (OSL 3.0) that is * This source file is subject to the Open Software License (OSL 3.0) that is
* bundled with this package in the files license.txt / license.rst. It is * bundled with this package in the files license.txt / license.rst. It is
* also available through the world wide web at this URL: * also available through the world wide web at this URL:
* http://opensource.org/licenses/OSL-3.0 * http://opensource.org/licenses/OSL-3.0
* If you did not receive a copy of the license and are unable to obtain it * If you did not receive a copy of the license and are unable to obtain it
* through the world wide web, please send an email to * through the world wide web, please send an email to
* licensing@ellislab.com so we can send you a copy immediately. * licensing@ellislab.com so we can send you a copy immediately.
* *
* @package CodeIgniter * @package CodeIgniter
* @author EllisLab Dev Team * @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/)
* @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* @link http://codeigniter.com * @link http://codeigniter.com
* @since Version 1.0 * @since Version 1.0
* @filesource * @filesource
*/ */
/* /*
*--------------------------------------------------------------- *---------------------------------------------------------------
* APPLICATION ENVIRONMENT * APPLICATION ENVIRONMENT
*--------------------------------------------------------------- *---------------------------------------------------------------
* *
* You can load different configurations depending on your * You can load different configurations depending on your
* current environment. Setting the environment also influences * current environment. Setting the environment also influences
* things like logging and error reporting. * things like logging and error reporting.
* *
* This can be set to anything, but default usage is: * This can be set to anything, but default usage is:
* *
* development * development
* testing * testing
* production * production
* *
* NOTE: If you change these, also change the error_reporting() code below * NOTE: If you change these, also change the error_reporting() code below
*/ */
define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development'); define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development');
/* /*
*--------------------------------------------------------------- *---------------------------------------------------------------
* ERROR REPORTING * ERROR REPORTING
*--------------------------------------------------------------- *---------------------------------------------------------------
* *
* Different environments will require different levels of error reporting. * Different environments will require different levels of error reporting.
* 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.
*/ */
switch (ENVIRONMENT) switch (ENVIRONMENT)
{ {
case 'development': case 'development':
error_reporting(-1); error_reporting(-1);
ini_set('display_errors', 1); ini_set('display_errors', 1);
break; break;
case 'testing': case 'testing':
case 'production': case 'production':
error_reporting(-1); error_reporting(-1);
ini_set('display_errors', 0); ini_set('display_errors', 0);
break; break;
default: default:
header('HTTP/1.1 503 Service Unavailable.', TRUE, 503); header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
echo 'The application environment is not set correctly.'; echo 'The application environment is not set correctly.';
exit(1); // EXIT_ERROR exit(1); // EXIT_ERROR
} }
/* /*
*--------------------------------------------------------------- *---------------------------------------------------------------
* SYSTEM FOLDER NAME * SYSTEM FOLDER NAME
*--------------------------------------------------------------- *---------------------------------------------------------------
* *
* This variable must contain the name of your "system" folder. * This variable must contain the name of your "system" folder.
* Include the path if the folder is not in the same directory * Include the path if the folder is not in the same directory
* as this file. * as this file.
*/ */
$system_path = '../system'; $system_path = '../system';
/* /*
*--------------------------------------------------------------- *---------------------------------------------------------------
* APPLICATION FOLDER NAME * APPLICATION FOLDER NAME
*--------------------------------------------------------------- *---------------------------------------------------------------
* *
* If you want this front controller to use a different "application" * If you want this front controller to use a different "application"
* folder than the default one you can set its name here. The folder * folder than the default one you can set its name here. The folder
* can also be renamed or relocated anywhere on your server. If * can also be renamed or relocated anywhere on your server. If
* you do, use a full server path. For more info please see the user guide: * you do, use a full server path. For more info please see the user guide:
* http://codeigniter.com/user_guide/general/managing_apps.html * http://codeigniter.com/user_guide/general/managing_apps.html
* *
* NO TRAILING SLASH! * NO TRAILING SLASH!
*/ */
$application_folder = '../application'; $application_folder = '../application';
/* /*
*--------------------------------------------------------------- *---------------------------------------------------------------
* VIEW FOLDER NAME * VIEW FOLDER NAME
*--------------------------------------------------------------- *---------------------------------------------------------------
* *
* If you want to move the view folder out of the application * If you want to move the view folder out of the application
* folder set the path to the folder here. The folder can be renamed * folder set the path to the folder here. The folder can be renamed
* and relocated anywhere on your server. If blank, it will default * and relocated anywhere on your server. If blank, it will default
* to the standard location inside your application folder. If you * to the standard location inside your application folder. If you
* do move this, use the full server path to this folder. * do move this, use the full server path to this folder.
* *
* NO TRAILING SLASH! * NO TRAILING SLASH!
*/ */
$view_folder = ''; $view_folder = '';
/* /*
* -------------------------------------------------------------------- * --------------------------------------------------------------------
* DEFAULT CONTROLLER * DEFAULT CONTROLLER
* -------------------------------------------------------------------- * --------------------------------------------------------------------
* *
* Normally you will set your default controller in the routes.php file. * Normally you will set your default controller in the routes.php file.
* You can, however, force a custom routing by hard-coding a * You can, however, force a custom routing by hard-coding a
* specific controller class/function here. For most applications, you * specific controller class/function here. For most applications, you
* WILL NOT set your routing here, but it's an option for those * WILL NOT set your routing here, but it's an option for those
* special instances where you might want to override the standard * special instances where you might want to override the standard
* routing in a specific front controller that shares a common CI installation. * routing in a specific front controller that shares a common CI installation.
* *
* IMPORTANT: If you set the routing here, NO OTHER controller will be * IMPORTANT: If you set the routing here, NO OTHER controller will be
* callable. In essence, this preference limits your application to ONE * callable. In essence, this preference limits your application to ONE
* specific controller. Leave the function name blank if you need * specific controller. Leave the function name blank if you need
* to call functions dynamically via the URI. * to call functions dynamically via the URI.
* *
* 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'] = '';
/* /*
* ------------------------------------------------------------------- * -------------------------------------------------------------------
* CUSTOM CONFIG VALUES * CUSTOM CONFIG VALUES
* ------------------------------------------------------------------- * -------------------------------------------------------------------
* *
* The $assign_to_config array below will be passed dynamically to the * The $assign_to_config array below will be passed dynamically to the
* config class when initialized. This allows you to set custom config * config class when initialized. This allows you to set custom config
* items or override any default config values found in the config.php file. * items or override any default config values found in the config.php file.
* This can be handy as it permits you to share one application between * This can be handy as it permits you to share one application between
* multiple front controller files, with each file containing different * multiple front controller files, with each file containing different
* config values. * config values.
* *
* 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';
// -------------------------------------------------------------------- // --------------------------------------------------------------------
// END OF USER CONFIGURABLE SETTINGS. DO NOT EDIT BELOW THIS LINE // END OF USER CONFIGURABLE SETTINGS. DO NOT EDIT BELOW THIS LINE
// -------------------------------------------------------------------- // --------------------------------------------------------------------
/* /*
* --------------------------------------------------------------- * ---------------------------------------------------------------
* Resolve the system path for increased reliability * Resolve the system path for increased reliability
* --------------------------------------------------------------- * ---------------------------------------------------------------
*/ */
// 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 (($_temp = realpath($system_path)) !== FALSE) if (($_temp = realpath($system_path)) !== FALSE)
{ {
$system_path = $_temp.'/'; $system_path = $_temp.'/';
} }
else else
{ {
// 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))
{ {
header('HTTP/1.1 503 Service Unavailable.', TRUE, 503); header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
echo 'Your system folder path does not appear to be set correctly. Please open the following file and correct this: '.pathinfo(__FILE__, PATHINFO_BASENAME); echo 'Your system folder path does not appear to be set correctly. Please open the following file and correct this: '.pathinfo(__FILE__, PATHINFO_BASENAME);
exit(3); // EXIT_CONFIG exit(3); // EXIT_CONFIG
} }
/* /*
* ------------------------------------------------------------------- * -------------------------------------------------------------------
* 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));
// 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))
{ {
if (($_temp = realpath($application_folder)) !== FALSE) if (($_temp = realpath($application_folder)) !== FALSE)
{ {
$application_folder = $_temp; $application_folder = $_temp;
} }
define('APPPATH', $application_folder.DIRECTORY_SEPARATOR); define('APPPATH', $application_folder.DIRECTORY_SEPARATOR);
} }
else else
{ {
if ( ! is_dir(BASEPATH.$application_folder.DIRECTORY_SEPARATOR)) if ( ! is_dir(BASEPATH.$application_folder.DIRECTORY_SEPARATOR))
{ {
header('HTTP/1.1 503 Service Unavailable.', TRUE, 503); header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
echo 'Your application folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF; echo 'Your application folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF;
exit(3); // EXIT_CONFIG exit(3); // EXIT_CONFIG
} }
define('APPPATH', BASEPATH.$application_folder.DIRECTORY_SEPARATOR); define('APPPATH', BASEPATH.$application_folder.DIRECTORY_SEPARATOR);
} }
// The path to the "views" folder // The path to the "views" folder
if ( ! is_dir($view_folder)) if ( ! is_dir($view_folder))
{ {
if ( ! empty($view_folder) && is_dir(APPPATH.$view_folder.DIRECTORY_SEPARATOR)) if ( ! empty($view_folder) && is_dir(APPPATH.$view_folder.DIRECTORY_SEPARATOR))
{ {
$view_folder = APPPATH.$view_folder; $view_folder = APPPATH.$view_folder;
} }
elseif ( ! is_dir(APPPATH.'views'.DIRECTORY_SEPARATOR)) elseif ( ! is_dir(APPPATH.'views'.DIRECTORY_SEPARATOR))
{ {
header('HTTP/1.1 503 Service Unavailable.', TRUE, 503); header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
echo 'Your view folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF; echo 'Your view folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF;
exit(3); // EXIT_CONFIG exit(3); // EXIT_CONFIG
} }
else else
{ {
$view_folder = APPPATH.'views'; $view_folder = APPPATH.'views';
} }
} }
if (($_temp = realpath($view_folder)) !== FALSE) if (($_temp = realpath($view_folder)) !== FALSE)
{ {
$view_folder = $_temp.DIRECTORY_SEPARATOR; $view_folder = $_temp.DIRECTORY_SEPARATOR;
} }
else else
{ {
$view_folder = rtrim($view_folder, '/\\').DIRECTORY_SEPARATOR; $view_folder = rtrim($view_folder, '/\\').DIRECTORY_SEPARATOR;
} }
define('VIEWPATH', $view_folder); define('VIEWPATH', $view_folder);
/* /*
* -------------------------------------------------------------------- * --------------------------------------------------------------------
* LOAD THE BOOTSTRAP FILE * LOAD THE BOOTSTRAP FILE
* -------------------------------------------------------------------- * --------------------------------------------------------------------
* *
* And away we go... * And away we go...
*/ */
require_once '../vendor/autoload.php'; require_once '../vendor/autoload.php';
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 */