Commit b4e47070 by Timothy J Warren

Minor tweaks, bypass minifier

parent 0e42b583
......@@ -40,12 +40,12 @@
*/
$autoload['libraries'] = [
'validation_callbacks',
'database',
'page',
'todo',
'session',
'form_validation',
'validation_callbacks'
];
......@@ -97,7 +97,7 @@ $autoload['config'] = array('sites');
|
| $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');
|
*/
......
......@@ -3,15 +3,15 @@
* Groups configuration for default Minify implementation
* @package Minify
*/
$root = "//";
return array(
/*-----
Css
Css
-----*/
'css' => array(
$root. 'fonts/Puritan/stylesheet.css',
$root. 'css/todo.css',
......@@ -19,18 +19,18 @@ return array(
$root. 'js/CLEditor/jquery.cleditor.css',
$root. 'css/jquery-ui.min.css'
),
/*-----
Javascript
Javascript
-----*/
'js' => array(
$root. 'js/CLEditor/jquery.cleditor.js',
$root. 'js/CLEditor/jquery.cleditor.xhtml.js',
$root. 'js/todo.js',
),
'js_mobile' => array(
$root. 'js/todo.js',
),
);
\ No newline at end of file
);
......@@ -9,7 +9,7 @@
*/
function check_session()
{
$CI =& get_instance();
$CI = get_instance();
if($CI->session->userdata('uid') == FALSE)
{
......
<?php
/**
* Add some convenience methods to form_validation library
*/
class MY_Form_validation extends CI_Form_validation {
/**
* Returns an array of errors for the current form
*
* @return array
*/
public function get_error_array()
{
return array_values($this->_error_array);
}
/**
* Clears out object data
*
* @return void
*/
public function reset()
{
foreach([
'_field_data',
'_error_array',
'_error_messages'
] as $var) {
$this->$var = array();
}
}
}
<?php
/**
* Add some convenience methods to form_validation library
*/
class MY_Form_validation extends CI_Form_validation {
/**
* Returns an array of errors for the current form
*
* @return array
*/
public function get_error_array()
{
return array_values($this->_error_array);
}
/**
* Clears out object data
*
* @return void
*/
public function reset()
{
foreach([
'_field_data',
'_error_array',
'_error_messages'
] as $var) {
$this->$var = array();
}
}
}
// End of libraries/MY_Form_validation.php
\ No newline at end of file
......@@ -605,12 +605,19 @@ class Task_model extends CI_Model {
*/
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');;
$desc = str_replace('<br>', '<br />', $this->input->post('desc'));
$category = $this->input->post('category');
$priority = $this->input->post('priority');
$status = $this->input->post('status');
$due = $this->input->post('due');
$due = $unix_due;
$uid = $this->user_id;
$task_id = $this->task_id;
......
......@@ -69,7 +69,7 @@ class CIU_Loader extends CI_Loader {
// return a new instance of the object
if ( ! is_null($object_name))
{
$CI =& get_instance();
$CI = get_instance();
if ( ! isset($CI->$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);
if (file_exists($subclass))
{
include_once($subclass);
}
include_once($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
if ( ! is_null($object_name))
{
$CI =& get_instance();
$CI = get_instance();
if ( ! isset($CI->$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
if ( ! is_null($object_name))
{
$CI =& get_instance();
$CI = get_instance();
if ( ! isset($CI->$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
$this->_ci_classes[$class] = $classvar;
// Instantiate the class
$CI =& get_instance();
$CI = get_instance();
if ($config !== NULL)
{
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));
$CI =& get_instance();
$CI = get_instance();
$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';
if (file_exists($ciu_helper))
{
include_once($ciu_helper);
}
$ext_helper = APPPATH.'helpers/'.config_item('subclass_prefix').$helper.'.php';
// Is this a helper extension request?
......
......@@ -9,7 +9,7 @@
/*
* CodeIgniter source modified for fooStack / CIUnit
*
*
* If you use MY_Output, change the paraent class.
*/
......@@ -64,7 +64,7 @@ class CIU_Output extends CI_Output {
function set_no_cache_headers()
{
//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('Cache-Control: no-cache');
log_message('debug', 'no cache headers set in output class');
......@@ -116,7 +116,7 @@ class CIU_Output extends CI_Output {
*/
function ob_flush_clean()
{
$CI =& get_instance();
$CI = get_instance();
if (ob_get_level() > $this->_ci_ob_level + 1)
{
ob_end_flush();
......@@ -152,7 +152,7 @@ class CIU_Output extends CI_Output {
// Grab the super object if we can.
if (class_exists('CI_Controller'))
{
$CI =& get_instance();
$CI = get_instance();
}
// --------------------------------------------------------------------
......
......@@ -113,8 +113,8 @@
* Start the timer... tick tock tick tock...
* ------------------------------------------------------
*/
$BM =& load_class('Benchmark', 'core');
$GLOBALS['BM'] =& $BM;
$BM = load_class('Benchmark', 'core');
$GLOBALS['BM'] = $BM;
$BM->mark('total_execution_time_start');
$BM->mark('loading_time:_base_classes_start');
......@@ -124,8 +124,8 @@
* Instantiate the hooks class
* ------------------------------------------------------
*/
$EXT =& load_class('Hooks', 'core');
$GLOBALS['EXT'] =& $EXT;
$EXT = load_class('Hooks', 'core');
$GLOBALS['EXT'] = $EXT;
/*
* ------------------------------------------------------
......@@ -139,8 +139,8 @@
* Instantiate the config class
* ------------------------------------------------------
*/
$CFG =& load_class('Config', 'core');
$GLOBALS['CFG'] =& $CFG;
$CFG = load_class('Config', 'core');
$GLOBALS['CFG'] = $CFG;
// Do we have any manually set config items in the index.php file?
if (isset($assign_to_config))
......@@ -160,24 +160,24 @@
*
*/
$UNI =& load_class('Utf8', 'core');
$GLOBALS['UNI'] =& $UNI;
$UNI = load_class('Utf8', 'core');
$GLOBALS['UNI'] = $UNI;
/*
* ------------------------------------------------------
* Instantiate the URI class
* ------------------------------------------------------
*/
$URI =& load_class('URI', 'core');
$GLOBALS['URI'] =& $URI;
$URI = load_class('URI', 'core');
$GLOBALS['URI'] = $URI;
/*
* ------------------------------------------------------
* Instantiate the routing class and set the routing
* ------------------------------------------------------
*/
$RTR =& load_class('Router', 'core');
$GLOBALS['RTR'] =& $RTR;
$RTR = load_class('Router', 'core');
$GLOBALS['RTR'] = $RTR;
//$RTR->_set_routing();
// Set any routing overrides that may exist in the main index file
......@@ -191,8 +191,8 @@
* Instantiate the output class
* ------------------------------------------------------
*/
$OUT =& load_class('Output', 'core');
$GLOBALS['OUT'] =& $OUT;
$OUT = load_class('Output', 'core');
$GLOBALS['OUT'] = $OUT;
/*
* ------------------------------------------------------
......@@ -215,23 +215,23 @@
* Load the security class for xss and csrf support
* -----------------------------------------------------
*/
$SEC =& load_class('Security', 'core');
$GLOBALS['SEC'] =& $SEC;
$SEC = load_class('Security', 'core');
$GLOBALS['SEC'] = $SEC;
/*
* ------------------------------------------------------
* Load the Input class and sanitize globals
* ------------------------------------------------------
*/
$IN =& load_class('Input', 'core');
$GLOBALS['IN'] =& $IN;
$IN = load_class('Input', 'core');
$GLOBALS['IN'] = $IN;
/*
* ------------------------------------------------------
* Load the Language class
* ------------------------------------------------------
*/
$LANG =& load_class('Lang', 'core');
$LANG = load_class('Lang', 'core');
/*
* ------------------------------------------------------
......
......@@ -41,7 +41,7 @@ class CIUnit {
public static $spyc;
public static $fixture;
/**
* 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.
......@@ -69,16 +69,16 @@ class CIUnit {
viewvars();
return self::$controller;
}
// the current controller must be archieved before littered
$loader =& load_class('Loader', 'core');
$loader = load_class('Loader', 'core');
// reset all loaded data
$loader->reset();
//echo 'Var Dump of self::$controllers -- ';
//var_dump(self::$controllers);
/*
=========================================================
I don't understand this section of code.
......@@ -94,7 +94,7 @@ class CIUnit {
//'components' => $loader->_ci_components,
//'classes' => $loader->_ci_classes
}
===================================================
I don't understand why this code is clearing out
all the loaded components such as autoloaded models
......@@ -108,14 +108,14 @@ class CIUnit {
//reset saved queries
self::$controller->db->queries = array();
*/
//clean output / viewvars as well;
if (isset(self::$controller->output))
{
output();
viewvars();
}
//the requested controller was loaded before?
if (isset(self::$controllers[$controller_name]))
{
......@@ -143,7 +143,7 @@ class CIUnit {
include_once(APPPATH . 'controllers/' . $controller . EXT);
}
}
self::$current = $controller_name;
self::$controllers[$controller_name] = array(
'address' => new $controller_name(),
......@@ -151,12 +151,12 @@ class CIUnit {
);
self::$controller =& self::$controllers[$controller_name]['address'];
}
// var_dump(self::$controllers); die();
// var_dump(self::$controller); die();
//CI_Base::$instance = &self::$controller; //so get_instance() provides the correct controller
return self::$controller;
}
......
......@@ -14,10 +14,10 @@
class CIUnit_TestCase extends PHPUnit_Framework_TestCase
{
// ------------------------------------------------------------------------
/**
* 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.
*
* For example:
......@@ -39,33 +39,33 @@ class CIUnit_TestCase extends PHPUnit_Framework_TestCase
* @var array
*/
protected $tables = array();
// ------------------------------------------------------------------------
/**
* The CodeIgniter Framework Instance
*
* @var object
*/
public $CI;
// ------------------------------------------------------------------------
/**
* Constructor
*
* @param string $name
* @param array $data
* @param string $dataName
* @param string $name
* @param array $data
* @param string $dataName
*/
public function __construct($name = NULL, array $data = array(), $dataName = '')
{
parent::__construct($name, $data, $dataName);
$this->CI =& get_instance();
$this->CI = get_instance();
log_message('debug', get_class($this).' CIUnit_TestCase initialized');
}
/**
* Set Up
*
......@@ -83,12 +83,12 @@ class CIUnit_TestCase extends PHPUnit_Framework_TestCase
$this->dbfixt($this->tables);
}
}
/**
* Tear Down
*
*
* This method will run after every test.
*
*
* @return void
*
* @author Eric Jones
......@@ -101,7 +101,7 @@ class CIUnit_TestCase extends PHPUnit_Framework_TestCase
$this->dbfixt_unload($this->tables);
}
}
/**
* loads a database fixture
* 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();
$this->load_fixt($table_fixtures);
}
/**
* 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
......@@ -134,7 +134,7 @@ class CIUnit_TestCase extends PHPUnit_Framework_TestCase
{
$fixt_name = $fixt . '_fixt';
$table = is_int($table) ? $fixt : $table;
if (!empty($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");
}
}
log_message('debug', 'Table fixtures "' . join('", "', $table_fixtures) . '" loaded');
}
/**
* DBFixt Unload
*
......@@ -180,7 +180,7 @@ class CIUnit_TestCase extends PHPUnit_Framework_TestCase
// of the database load. Right??
$table_fixtures = array_reverse($table_fixtures, true);
}
// Iterate over the array unloading the tables
foreach ($table_fixtures as $table => $fixture)
{
......@@ -206,7 +206,7 @@ class CIUnit_TestCase extends PHPUnit_Framework_TestCase
foreach ( $fixts as $fixt )
{
$fixt_name = $fixt . '_fixt';
if (file_exists(TESTSPATH . 'fixtures/' . $fixt . '_fixt.yml')) {
$this->$fixt_name = CIUnit::$spyc->loadFile(TESTSPATH . 'fixtures/' . $fixt . '_fixt.yml');
}
......
......@@ -4,25 +4,12 @@
<footer class="footer">
Generated in <?= $this->benchmark->elapsed_time();?> seconds, <?= $q_num ?> quer<?= ($q_num == 1) ? "y": "ies" ?>
</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);} ?>
<script src="/js/jquery.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>
</html>
\ No newline at end of file
<head>
<?= $meta ?>
<title><?= $title ?></title>
<link rel="icon" href="//todo.timshomepage.net/images/favicon.ico" type="image/x-icon" />
<?= $css ?>
<title><?= $title ?></title>
<link rel="stylesheet" href="/fonts/Puritan/stylesheet.css" />
<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>
<body <?= (!empty($body_id)) ? " id=\"" . $body_id . "\"" : ""; ?>>
......
......@@ -10,9 +10,9 @@
<?php if($user_perms > PERM_CHECKLIST_ACCESS): ?>
<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>
<?php } ?>
<?php endif ?>
<a id="editTaskIcon" href="<?= site_url('task/edit').'/'.$task ?>">Edit Task</a>
</p>
......
This diff is collapsed. Click to expand it.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment