Merge branch 'master' of disposed.de:scattport

Conflicts:
	application/config/autoload.php
	application/views/header.php
This commit is contained in:
Karsten Heiken
2011-09-07 17:04:46 +02:00
38 changed files with 1524 additions and 674 deletions

4
.gitignore vendored
View File

@@ -2,9 +2,11 @@
.project
.settings/
.htaccess
*.xcf
application/config/config.php
application/config/database.php
application/logs/*
application/cache/*
assets/cache/*
uploads/*
*.xcf
*.mo

View File

@@ -0,0 +1,27 @@
<?php defined('BASEPATH') || exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Asset storage
|--------------------------------------------------------------------------
|
| The path to where the assets are stored, WITH trailing slash.
|
*/
$config['assets_folder'] = 'assets/';
$config['cache_folder'] = $config['assets_folder'] . 'cache/';
/*
|--------------------------------------------------------------------------
| Toggle CSSTidy/JSMin compression
|--------------------------------------------------------------------------
|
| Whether to run compression using CSSTidy or JSMin.
|
*/
$config['enable_csstidy'] = true;
$config['enable_jsmin'] = true;
/* End of file assets.php */
/* Location: ./application/config/assets.php */

View File

@@ -1,4 +1,4 @@
<?php defined('BASEPATH') || exit("No direct script access allowed");
<?php defined('BASEPATH') || exit('No direct script access allowed');
/**
* Default group, use name

View File

@@ -1,4 +1,4 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
<?php defined('BASEPATH') || exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| AUTO-LOADER
@@ -64,7 +64,7 @@ $autoload['libraries'] = array('session', 'lang_detect', 'database', 'access', '
| $autoload['helper'] = array('url', 'file');
*/
$autoload['helper'] = array('date', 'url', 'html', 'language', 'hash', 'text');
$autoload['helper'] = array('date', 'url', 'form', 'language', 'hash', 'asset', 'text');
/*

View File

@@ -1,4 +1,4 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
<?php defined('BASEPATH') || exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------

View File

@@ -1,4 +1,4 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
<?php defined('BASEPATH') || exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
@@ -26,7 +26,6 @@ define('DIR_WRITE_MODE', 0777);
| These modes are used when working with fopen()/popen()
|
*/
define('FOPEN_READ', 'rb');
define('FOPEN_READ_WRITE', 'r+b');
define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care

View File

@@ -1,4 +1,4 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
<?php defined('BASEPATH') || exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| DATABASE CONNECTIVITY SETTINGS
@@ -39,7 +39,7 @@
*/
$active_group = 'default';
$active_record = TRUE;
$active_record = true;
$db['default']['hostname'] = 'localhost';
$db['default']['username'] = '';
@@ -47,15 +47,15 @@ $db['default']['password'] = '';
$db['default']['database'] = '';
$db['default']['dbdriver'] = 'mysql';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['pconnect'] = true;
$db['default']['db_debug'] = true;
$db['default']['cache_on'] = false;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;
$db['default']['autoinit'] = true;
$db['default']['stricton'] = false;
/* End of file database.php */

View File

@@ -1,9 +1,9 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Data Mapper Configuration
*
* Global configuration settings that apply to all DataMapped models.
<?php defined('BASEPATH') || exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| DATAMAPPER CONFIGURATION
| -------------------------------------------------------------------
| Global configuration settings that apply to all DataMapped models.
*/
$config['prefix'] = '';
@@ -12,11 +12,11 @@ $config['error_prefix'] = '<p>';
$config['error_suffix'] = '</p>';
$config['created_field'] = 'created';
$config['updated_field'] = 'updated';
$config['local_time'] = FALSE;
$config['unix_timestamp'] = FALSE;
$config['auto_transaction'] = FALSE;
$config['auto_populate_has_many'] = FALSE;
$config['auto_populate_has_one'] = FALSE;
$config['local_time'] = false;
$config['unix_timestamp'] = false;
$config['auto_transaction'] = false;
$config['auto_populate_has_many'] = false;
$config['auto_populate_has_one'] = false;
/* End of file datamapper.php */
/* Location: ./application/config/datamapper.php */

View File

@@ -1,4 +1,4 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
<?php defined('BASEPATH') || exit('No direct script access allowed');
$_doctypes = array(
'xhtml11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">',

View File

@@ -1,4 +1,4 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
<?php defined('BASEPATH') || exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| Foreign Characters

View File

@@ -1,4 +1,4 @@
<?php defined('BASEPATH') || exit("No direct script access allowed");
<?php defined('BASEPATH') || exit('No direct script access allowed');
/**
* Rules for login page.
@@ -259,4 +259,3 @@ $config['trials/create'] = array(
/* End of file form_validation.php */
/* Location: ./application/config/form_validation.php */

View File

@@ -1,4 +1,4 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
<?php defined('BASEPATH') || exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| Hooks

View File

@@ -17,7 +17,7 @@
*/
$config['supported_languages'] = array(
'en' => array('name' => 'English', 'locale' => 'en_US'),
'de'=> array('name' => 'Deutsch', 'locale' => 'de_DE')
'de' => array('name' => 'Deutsch', 'locale' => 'de_DE'),
);
/*
@@ -30,3 +30,6 @@ $config['supported_languages'] = array(
|
*/
$config['default_language'] = 'en';
/* End of file autoload.php */
/* Location: ./application/config/language.php */

View File

@@ -1,4 +1,4 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
<?php defined('BASEPATH') || exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| MIME TYPES
@@ -8,7 +8,8 @@
|
*/
$mimes = array( 'hqx' => 'application/mac-binhex40',
$mimes = array(
'hqx' => 'application/mac-binhex40',
'cpt' => 'application/mac-compactpro',
'csv' => array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel'),
'bin' => 'application/macbinary',

View File

@@ -1,4 +1,4 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
<?php defined('BASEPATH') || exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| Profiler Sections

View File

@@ -1,4 +1,4 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
<?php defined('BASEPATH') || exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| URI ROUTING
@@ -41,9 +41,6 @@
$route['default_controller'] = "dashboard";
$route['404_override'] = '';
$route['(\w{2})/(.*)'] = '$2';
$route['(\w{2})'] = $route['default_controller'];
/* End of file routes.php */
/* Location: ./application/config/routes.php */

View File

@@ -1,4 +1,4 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
<?php defined('BASEPATH') || exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| SMILEYS
@@ -58,7 +58,7 @@ $smileys = array(
':vampire:' => array('vampire.gif', '19', '19', 'vampire'),
':snake:' => array('snake.gif', '19', '19', 'snake'),
':exclaim:' => array('exclaim.gif', '19', '19', 'excaim'),
':question:' => array('question.gif', '19', '19', 'question') // no comma after last item
':question:' => array('question.gif', '19', '19', 'question'),
);

View File

@@ -1,4 +1,4 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
<?php defined('BASEPATH') || exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| USER AGENT TYPES
@@ -44,7 +44,6 @@ $platforms = array (
'unix' => 'Unknown Unix OS'
);
// The order of this array should NOT be changed. Many browsers return
// multiple browser types so we want to identify the sub-type first.
$browsers = array(

View File

@@ -0,0 +1,44 @@
<?php
/*
* Copyright (c) 2011 Karsten Heiken <karsten@disposed.de>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Static about page
*
* @author Karsten Heiken <karsten@disposed.de>
*/
class About extends CI_Controller {
/**
* Constructor.
*/
public function __construct() {
parent::__construct();
}
public function index() {
$this->load->view('about');
}
}
/* End of file about.php */
/* Location: ./application/controllers/about.php */

View File

@@ -0,0 +1,44 @@
<?php
/*
* Copyright (c) 2011 Karsten Heiken <karsten@disposed.de>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Static license page
*
* @author Karsten Heiken <karsten@disposed.de>
*/
class License extends CI_Controller {
/**
* Constructor.
*/
public function __construct() {
parent::__construct();
}
public function index() {
$this->load->view('license');
}
}
/* End of file license.php */
/* Location: ./application/controllers/license.php */

View File

@@ -0,0 +1,51 @@
<?php
/*
* Copyright (c) 2011 Eike Foken <kontakt@eikefoken.de>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Extends CI's config class.
*
* @author Eike Foken <kontakt@eikefoken.de>
*/
class MY_Config extends CI_Config {
/**
* Calls the parent constructor.
*/
public function __construct() {
parent::__construct();
log_message('debug', "Config Class Extension Initialized");
}
/**
* Handles relative URLs.
*
* @see CI_Config::site_url()
*/
public function site_url($uri = '', $relative = true) {
$url = parent::site_url($uri);
return $relative ? parse_url($url, PHP_URL_PATH) : $url;
}
}
/* End of file MY_Config.php */
/* Location: ./application/core/MY_Config.php */

View File

@@ -14,28 +14,18 @@
* @return string
*/
if (!function_exists('lang_select')) {
function lang_select($img_folder = '', $index_page = false) {
function lang_select($img_folder = '') {
$CI =& get_instance();
$link = '<a';
if ($CI->config->item('language') == 'en_US') {
$link .= ' href="' . $CI->config->site_url('de') . '">';
if ($index_page === true) {
$link .= '<img src="' . $CI->config->site_url('assets/images/languages/en.png') . '" />';
} else {
$link .= ' href="?lang=de">';
$link .= '<img src="' . $CI->config->slash_item('base_url') . 'assets/images/languages/en.png" />';
}
$link .= ' English';
} else if ($CI->config->item('language') == 'de_DE') {
$link .= ' href="' . $CI->config->site_url('en') . '" >';
if ($index_page === true) {
$link .= '<img src="' . $CI->config->site_url('assets/images/languages/de.png') . '" />';
} else {
$link .= ' href="?lang=en">';
$link .= '<img src="' . $CI->config->slash_item('base_url') . 'assets/images/languages/de.png" />';
}
$link .= ' Deutsch';
}

View File

@@ -0,0 +1,72 @@
<?php defined('BASEPATH') || exit('No direct script access allowed');
/**
* Helper functions for including assets.
*
* @author Eike Foken <kontakt@eikefoken.de>
*/
/**
* Helps generating links to asset files of any sort.
*
* Note: The type should be the name of the folder the asset is stored in.
*
* @param string $type
* @param string $filename
* @return string
*/
function asset_url($type, $filename) {
$CI = &get_instance();
$CI->load->library('assets');
return $CI->assets->url($type, $filename);
}
/**
* Helps generating HTML for assets of any sort.
*
* @param string $type
* @param string $filename
* @param mixed $attributes
* @return string
*/
function asset($type, $filename, $attributes = '') {
$CI = &get_instance();
$CI->load->library('assets');
return $CI->assets->load($type, $filename, $attributes);
}
/**
* Inserts CSS assets.
*
* @param string $filename
* @param mixed $attributes
* @return string
*/
function css_asset($filename, $attributes = '') {
return asset('css', $filename, $attributes);
}
/**
* Inserts image assets.
*
* @param string $filename
* @param mixed $attributes
* @return string
*/
function image_asset($filename, $attributes = '') {
return asset('image', $filename, $attributes);
}
/**
* Inserts javascript assets.
*
* @param string $filename
* @return string
*/
function js_asset($filename) {
return asset('js', $filename);
}
/* End of file asset_helper.php */
/* Location: ./application/helpers/asset_helper.php */

View File

@@ -0,0 +1,146 @@
<?php defined('BASEPATH') || exit('No direct script access allowed');
/**
*
* @author Eike Foken <kontakt@eikefoken.de>
*/
class Assets {
private $assetsFolder;
private $cacheFolder;
private $css = array();
private $javascript = array();
private $CI;
/**
* Constructor.
*/
public function __construct($config = array()) {
log_message('debug', "Asset Class Initialized");
// set the super object to a local variable
$this->CI =& get_instance();
// set the asset path
$this->assetsPath = ($config['assets_folder'] != '') ? $config['assets_folder'] : 'assets';
if (!is_dir($this->assetsPath)) {
log_message('error', "Asset folder does not exist");
}
// set the cache path
$this->cachePath = ($config['cache_folder'] != '') ? $config['cache_folder'] : 'assets/cache';
if (!is_dir($this->cachePath) || !is_really_writable($this->cachePath)) {
$this->cacheEnable = false;
}
}
/**
* Loads an asset.
*
* @param string $type
* @param string $filename
* @param mixed $attributes
*/
public function load($type, $filename, $attributes = '') {
// validate type parameter
$type = strtolower($type);
if (!in_array($type, array('image', 'images', 'icon', 'icons', 'css', 'js'))) {
log_message('error', "Invalid asset type '" . $type . "' used.");
}
if (in_array($type, array('image', 'icon'))) {
$type .= 's';
}
// build the path strings
$filepath = $this->assetsPath . $type . '/' . $filename;
if (!file_exists($filepath)) {
log_message('error', "Unable to load requested asset: $filename");
return '';
}
switch ($type) {
case 'images':
case 'icons':
if (!isset($attributes['alt'])) {
$attributes['alt'] = '';
}
$output = '<img src="' . $this->CI->config->slash_item('base_url') . $filepath . '"' . $this->parseAttributes($attributes) . ' />';
break;
case 'css':
$output = '<link href="' . $this->CI->config->slash_item('base_url') . $filepath . '" rel="stylesheet" type="text/css"' . $this->parseAttributes($attributes) . " />\n";
break;
case 'js':
// $this->javascript[] = array('filepath' => $filepath, 'attributes' => $attributes);
// $code = file_get_contents(FCPATH . $this->assetsFolder . $type . '/' . $filename);
// if ($this->CI->config->item('enable_jsmin') == true) {
// $this->CI->load->library('jsmin');
// $code = $this->CI->jsmin->minify($code);
// }
// $httpHeaders = '<' . '?php header("Content-type: text/javascript; charset: UTF-8");?' . '>';
// if ($this->CI->config->item('compress_output') == true) {
// $httpHeaders .= '';
// }
// $code = $httpHeaders . "\n" . $code;
// file_put_contents(FCPATH . $this->cacheFolder . $type . '_' . md5($code) . EXT, $code);
$output = '<script src="' . $this->CI->config->slash_item('base_url') . $filepath . '" language="javascript" type="text/javascript"></script>';
$output .= "\n";
break;
default:
$output = '';
}
return $output;
}
/**
* Generates an URL of the given asset.
*
* @param string $type
* @param string $filename
* @return string
*/
public function url($type, $filename) {
$type = strtolower($type);
if (!in_array($type, array('image', 'images', 'icon', 'icons', 'css', 'js'))) {
log_message('error', "'" . $type . "' is not a valid asset type");
return;
}
if (in_array($type, array('image', 'icon'))) {
$type .= 's';
}
return $this->CI->config->slash_item('base_url') . $this->assetsPath . $type . '/' . $filename;
}
/**
* Parses out the attributes.
*
* @param mixed $attributes
* @return string
*/
private function parseAttributes($attributes) {
if (is_string($attributes)) {
return ($attributes != '') ? ' '.$attributes : '';
}
$output = '';
foreach ($attributes as $key => $value) {
$output .= ' ' . $key . '="' . $value . '"';
}
return $output;
}
}
/* End of file Assets.php */
/* Location: ./application/libraries/Assets.php */

View File

@@ -0,0 +1,277 @@
<?php
/**
* Jsmin.php - PHP implementation of Douglas Crockford's JSMin.
*
* This is pretty much a direct port of jsmin.c to PHP with just a few
* PHP-specific performance tweaks. Also, whereas jsmin.c reads from stdin and
* outputs to stdout, this library accepts a string as input and returns another
* string as output.
*
* PHP 5 or higher is required.
*
* Permission is hereby granted to use this version of the library under the
* same terms as jsmin.c, which has the following license:
*
* --
* Copyright (c) 2002 Douglas Crockford (www.crockford.com)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is furnished to do
* so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* The Software shall be used for Good, not Evil.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
* --
*
* @package CodeIgniter
* @author Ryan Grove <ryan@wonko.com>
* @copyright 2002 Douglas Crockford <douglas@crockford.com> (jsmin.c)
* @copyright 2008 Ryan Grove <ryan@wonko.com> (PHP port)
* @license http://opensource.org/licenses/mit-license.php MIT License
* @version 1.1.1 (2008-03-02)
* @link http://code.google.com/p/jsmin-php/
*/
class Jsmin {
const ORD_LF = 10;
const ORD_SPACE = 32;
protected $a = '';
protected $b = '';
protected $input = '';
protected $inputIndex = 0;
protected $inputLength = 0;
protected $lookAhead = null;
protected $output = '';
/**
* Constructor.
*/
public function __construct() {
log_message('debug', "Jsmin Class Initialized");
}
/**
* Minifies javascript code.
*
* @param string $input
* @return string The minified code
*/
public function minify($input) {
$this->input = str_replace("\r\n", "\n", $input);
$this->inputLength = strlen($this->input);
return $this->min();
}
private function action($d) {
switch ($d) {
case 1:
$this->output .= $this->a;
case 2:
$this->a = $this->b;
if ($this->a === "'" || $this->a === '"') {
for (;;) {
$this->output .= $this->a;
$this->a = $this->get();
if ($this->a === $this->b) {
break;
}
if (ord($this->a) <= self::ORD_LF) {
log_message('error', "Unterminated string literal");
return;
}
if ($this->a === '\\') {
$this->output .= $this->a;
$this->a = $this->get();
}
}
}
case 3:
$this->b = $this->next();
if ($this->b === '/' && ($this->a === '(' || $this->a === ',' || $this->a === '=' || $this->a === ':' || $this->a === '[' || $this->a === '!' || $this->a === '&' || $this->a === '|' || $this->a === '?')) {
$this->output .= $this->a . $this->b;
for (;;) {
$this->a = $this->get();
if ($this->a === '/') {
break;
} else if ($this->a === '\\') {
$this->output .= $this->a;
$this->a = $this->get();
} else if (ord($this->a) <= self::ORD_LF) {
log_message('error', "Unterminated regular expression literal");
return;
}
$this->output .= $this->a;
}
$this->b = $this->next();
}
}
}
private function get() {
$c = $this->lookAhead;
$this->lookAhead = null;
if ($c === null) {
if ($this->inputIndex < $this->inputLength) {
$c = $this->input[$this->inputIndex];
$this->inputIndex += 1;
} else {
$c = null;
}
}
if ($c === "\r") {
return "\n";
}
if ($c === null || $c === "\n" || ord($c) >= self::ORD_SPACE) {
return $c;
}
return ' ';
}
private function isAlphaNum($c) {
return ord($c) > 126 || $c === '\\' || preg_match('/^[\w\$]$/', $c) === 1;
}
private function min() {
$this->a = "\n";
$this->action(3);
while ($this->a !== null) {
switch ($this->a) {
case ' ':
if ($this->isAlphaNum($this->b)) {
$this->action(1);
} else {
$this->action(2);
}
break;
case "\n":
switch ($this->b) {
case '{':
case '[':
case '(':
case '+':
case '-':
$this->action(1);
break;
case ' ':
$this->action(3);
break;
default:
if ($this->isAlphaNum($this->b)) {
$this->action(1);
} else {
$this->action(2);
}
}
break;
default:
switch ($this->b) {
case ' ':
if ($this->isAlphaNum($this->a)) {
$this->action(1);
break;
}
$this->action(3);
break;
case "\n":
switch ($this->a) {
case '}':
case ']':
case ')':
case '+':
case '-':
case '"':
case "'":
$this->action(1);
break;
default:
if ($this->isAlphaNum($this->a)) {
$this->action(1);
} else {
$this->action(3);
}
}
break;
default:
$this->action(1);
break;
}
}
}
return $this->output;
}
private function next() {
$c = $this->get();
if ($c === '/') {
switch ($this->peek()) {
case '/':
for (;;) {
$c = $this->get();
if (ord($c) <= self::ORD_LF) {
return $c;
}
}
case '*':
$this->get();
for (;;) {
switch ($this->get()) {
case '*':
if ($this->peek() === '/') {
$this->get();
return ' ';
}
break;
case null:
throw new JSMinException('Unterminated comment.');
}
}
default:
return $c;
}
}
return $c;
}
private function peek() {
$this->lookAhead = $this->get();
return $this->lookAhead;
}
}
/* End of file Jsmin.php */
/* Location: ./application/libraries/Jsmin.php */

View File

@@ -39,13 +39,11 @@ class Lang_detect {
* @return string Language directory name, e.g. 'english'
*/
public function detectLanguage() {
for ($i = $this->CI->uri->total_segments(); $i > 0; $i--) {
$segment = $this->CI->uri->segment($i);
$segment = $this->CI->input->get('lang');
if (strlen($segment) == 2 && array_key_exists($segment, $this->supportedLanguages)) {
$lang = $segment;
$this->CI->session->set_userdata('language', $lang);
}
}
if ($this->CI->session->userdata('language')) {
$lang = $this->CI->session->userdata('language');

View File

@@ -0,0 +1,27 @@
<?php $this->load->view('header'); ?>
<div id="content">
<div class="title">
<h2><?=_('About');?></h2>
</div>
<div class="box">
<h3><?=_('Introduction');?></h3>
<p>
</p>
</div>
<div class="box">
<h3><?=_('Contributors');?></h3>
<p>
<h4>Programming</h4>
<ul>
<li>Karsten Heiken, 2011</li>
<li>Eike Foken, 2011</li>
</ul>
</p>
</div>
</div>
<?php $this->load->view('footer'); ?>

View File

@@ -6,12 +6,12 @@
<title>ScattPort | <?=_('Login');?></title>
<?= link_tag('assets/css/login.css'); ?>
<?= link_tag('assets/css/form.css'); ?>
<?=asset('css', 'login.css');?>
<?=asset('css', 'form.css');?>
<?= script_tag('assets/js/minmax.js'); ?>
<?= script_tag('https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js'); ?>
<?= script_tag('assets/js/scattport.js'); ?>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" language="javascript" type="text/javascript"></script>
<?=asset('js', 'assets/js/minmax.js');?>
<?=asset('js', 'assets/js/scattport.js');?>
<script type="text/javascript">
var SITE_URL = '<?=site_url()?>';
</script>

View File

@@ -2,7 +2,7 @@
<?
if ($this->access->isAdmin()):
?>
<span class="left"><strong><?=_('Administration')?> - </strong>
<span class="left"><strong><?=_('Administration')?></strong> -
<a href="<?=site_url('admin/settings')?>"><?=_('Global settings')?></a> |
<a href="<?=site_url('admin/servers')?>"><?=_('Manage calculation servers')?></a> |
<a href="<?=site_url('admin/users')?>"><?=_('Manage users')?></a> |
@@ -11,11 +11,19 @@
<?
endif;
?>
<span class="right">© 2011 Karsten Heiken.</span>
<span class="right">
<?=anchor('about', _('About'));?> |
<?=anchor('license', _('License'));?>
</span>
<span class="right">
<?=asset('image', 'iwt.gif', array('width' => 36));?>
<?=asset('image', 'dfg.gif', array('width' => 36));?>
<?=asset('image', 'uni.png', array('width' => 36));?>
</span>
</div>
</div>
</body>
</html>

View File

@@ -7,26 +7,28 @@
<title>ScattPort</title>
<?=link_tag('assets/css/style.css');?>
<?=link_tag('assets/css/table.css');?>
<?=link_tag('assets/css/form.css');?>
<?=css_asset('style.css');?>
<?=css_asset('table.css');?>
<?=css_asset('form.css');?>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" language="javascript" type="text/javascript"></script>
<?=js_asset('tablednd.jquery.js');?>
<?=js_asset('jsc3d.min.js');?>
<?=js_asset('scattport.js');?>
<?=js_asset('jtip.js');?>
<?=script_tag('assets/js/minmax.js');?>
<?=script_tag('assets/js/jsc3d.min.js');?>
<?=script_tag('https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js');?>
<?=script_tag('assets/js/scattport.js');?>
<?=script_tag('assets/js/tablednd.jquery.js');?>
<?=script_tag('assets/js/jtip.js');?>
<script type="text/javascript">
var SITE_URL = '<?=site_url()?>';
var BASE_URL = '<?=base_url()?>';
var SITE_URL = '<?=site_url("/");?>';
var BASE_URL = '<?=base_url("/");?>';
</script>
</head>
<body>
<div id="header">
<h1><?=anchor('', img('assets/images/logo.png'))?></h1>
<h1><?=anchor('', image_asset('logo.png'));?></h1>
<div class="status">
<select name="activeProject">
<?php
@@ -39,7 +41,7 @@
?>
</select>
</div>
<div class="menu"><?= _('Hello,') ?> <a href="<?=site_url('');?>"><?=$this->user->profile()->firstname;?> <?=$this->user->profile()->lastname;?></a>! | <?=lang_select('assets/images');?> | <a href="#"><?=_('Help')?></a> | <?=anchor('auth/settings', _('Settings'));?> | <?=anchor('auth/logout', _('Logout'));?></div>
<div class="menu"><?= _('Hello,') ?> <a href="<?=base_url();?>"><?=$this->user->profile()->firstname;?> <?=$this->user->profile()->lastname;?></a>! | <?=lang_select('assets/images');?> | <a href="#"><?=_('Help');?></a> | <?=anchor('auth/settings', _('Settings'));?> | <?=anchor('auth/logout', _('Logout'));?></div>
</div>
<div id="wrapper">
@@ -52,58 +54,65 @@
</div>
<div class="navigation">
<ul>
<?
<?php
if ($this->input->get('active_project')):
$active_project = $this->project->getById($this->input->get('active_project'));
?>
<li>
<a href="javascript:void(0);" onclick="$(this).parent().toggleClass('active').find('ul').slideToggle();"><?=_('Project');?> <?=$active_project['shortname'];?></a>
<a href="javascript:void(0);" onclick="$(this).parent().toggleClass('active').find('ul').toggle();"><?=_('Project');?> <?=$active_project['shortname'];?></a>
<ul>
<li><a href="<?=site_url('projects/detail/' . $active_project['id']);?>" title="<?=_('Show overview');?>"><?=_('Overview');?></a></li>
<li><a href="<?=site_url('trials/create/' . $active_project['id']);?>" title="<?=sprintf(_('Create a new trial for the project &quot;%s&quot;'), $active_project['name']);?>"><?=_('New trial');?></a></li>
<li><a href="<?=site_url('results/project/' . $active_project['id']);?>" title="<?=sprintf(_('Show results for the project &quot;%s&quot;'), $active_project['name']);?>"><?=_('Show results');?></a></li>
</ul>
</li>
<?
<?php
endif;
?>
<li>
<a href="javascript:void(0);" onclick="$(this).parent().toggleClass('active').find('ul').slideToggle();"><?=_('Projects');?></a>
<li class="togglable" id="nav_projects">
<a href="javascript:void(0);"><?=_('Projects');?></a>
<ul>
<li><a href="<?=site_url('projects/create');?>" title="<?=_('Create a new project');?>"><?=_('New project');?></a></li>
<li><a href="<?=site_url('projects');?>" title="<?=_('Shows a list of all projects');?>"><?=_('Show projects');?></a></li>
<li><a href="<?=site_url('projects/search');?>" title="<?=_('Search for a project');?>"><?=_('Search');?></a></li>
</ul>
</li>
<li class="togglable" id="nav_calculations">
<a href="javascript:void(0);"><?=_('Calculations');?></a>
<ul>
<li><a href="<?=site_url('jobs/results');?>" title="<?=_('Show the newest results');?>"><?=_('Newest results');?></a></li>
<li><a href="<?=site_url('jobs/running');?>" title="<?=_('Shows a list of running calculations');?>"><?=_('Running calculations');?></a></li>
</ul>
</li>
</ul>
</div>
<div class="title">
<h2><a href="<?=site_url('projects')?>" title="<?=_('Show all projects')?>"><?=_('Projects')?></a></h2>
<h2><a href="<?=site_url('projects');?>" title="<?=_('Show all projects');?>"><?=_('Projects');?></a></h2>
</div>
<div class="navigation">
<ul>
<li>
<a href="javascript:void(0);" onclick="$(this).parent().toggleClass('active').find('ul').slideToggle();"><?=_('My projects')?></a>
<li class="togglable" id="nav_own_projects">
<a href="javascript:void(0);"><?=_('My projects');?></a>
<ul>
<?
<?php
$projects = $this->project->getOwn();
foreach($projects as $project):
?>
<li><a href="<?=site_url('projects/detail/'.$project['id'])?>"><?=$project['name']?></a></li>
<?
<li><a href="<?=site_url('projects/detail/'.$project['id']);?>"><?=$project['name'];?></a></li>
<?php
endforeach;
?>
</ul>
</li>
<li>
<a href="javascript:void(0);" onclick="$(this).parent().toggleClass('active').find('ul').slideToggle();"><?=_('Projects shared with me')?></a>
<li class="togglable" id="nav_shared_projects">
<a href="javascript:void(0);"><?=_('Projects shared with me');?></a>
<ul>
<li><a href="#">Prisma</a></li>
</ul>
</li>
<li>
<a href="javascript:void(0);" onclick="$(this).parent().toggleClass('active').find('ul').slideToggle();"><?=_('Public projects')?></a>
<li class="togglable" id="nav_public_projects">
<a href="javascript:void(0);"><?=_('Public projects');?></a>
<ul>
<li><a href="#">Beispielprojekt</a></li>
</ul>
@@ -112,25 +121,25 @@
</div>
<div class="title">
<h2><?=_('Search')?></h2>
<h2><?=_('Search');?></h2>
</div>
<div class="box">
<form id="search-form" method="get" action="#">
<input type="text" name="search" id="search-input" class="search-input">
<input type="image" src="<?=site_url('assets/images/button-search.gif')?>" id="search-submit" class="search-submit">
<input type="text" name="search" id="search-input" class="search-input" />
<input type="image" src="<?=asset_url('images', 'button-search.gif');?>" id="search-submit" class="search-submit" />
</form>
</div>
<div class="title">
<h2><?=_('Recent events')?></h2>
<h2><?=_('Recent events');?></h2>
</div>
<div class="box">
<ul id="blog">
<li><h4><a href="#" title="<?=_('Calculation done')?>"><?=_('Calculation done')?></a> <abbr title="22.07.2011">22.07.2011</abbr></h4><p><?=sprintf(_('Calculation successfully finished for project &quot;%s&quot;'), 'Gerstenkorn')?></i></p></li>
<li><h4><a href="#" title="<?=_('Calculation done')?>"><?=_('Calculation done')?></a> <abbr title="22.07.2011">22.07.2011</abbr></h4><p><?=sprintf(_('Calculation successfully finished for project &quot;%s&quot;'), 'Gerstenkorn')?></i></p></li>
<li><h4><a href="#" title="<?=_('Calculation done')?>"><?=_('Calculation done')?></a> <abbr title="22.07.2011">22.07.2011</abbr></h4><p><?=sprintf(_('Calculation successfully finished for project &quot;%s&quot;'), 'Gerstenkorn')?></i></p></li>
<li><h4><a href="#" title="<?=_('Calculation done');?>"><?=_('Calculation done');?></a> <abbr title="22.07.2011">22.07.2011</abbr></h4><p><?=sprintf(_('Calculation successfully finished for project &quot;%s&quot;'), 'Gerstenkorn');?></i></p></li>
<li><h4><a href="#" title="<?=_('Calculation done');?>"><?=_('Calculation done');?></a> <abbr title="22.07.2011">22.07.2011</abbr></h4><p><?=sprintf(_('Calculation successfully finished for project &quot;%s&quot;'), 'Gerstenkorn');?></i></p></li>
<li><h4><a href="#" title="<?=_('Calculation done');?>"><?=_('Calculation done');?></a> <abbr title="22.07.2011">22.07.2011</abbr></h4><p><?=sprintf(_('Calculation successfully finished for project &quot;%s&quot;'), 'Gerstenkorn');?></i></p></li>
</ul>
</div>

View File

@@ -0,0 +1,40 @@
<?php $this->load->view('header'); ?>
<div id="content">
<div class="title">
<h2><?=_('License');?></h2>
</div>
<div class="box">
<h3>This application is licensed under the MIT License for Open Source Software</h3>
<p>Copyright (c) 2011 Karsten Heiken, Eike Foken</p>
<p>
Permission is hereby granted, free of charge, to any person obtaining<br />
a copy of this software and associated documentation files (the "Software"),<br />
to deal in the Software without restriction, including without limitation<br />
the rights to use, copy, modify, merge, publish, distribute, sublicense,<br />
and/or sell copies of the Software, and to permit persons to whom the Software<br />
is furnished to do so, subject to the following conditions:
</p>
<p>
The above copyright notice and this permission notice shall be included in all<br />
copies or substantial portions of the Software.
</p>
<p>
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,<br />
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES<br />
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND<br />
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT<br />
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,<br />
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING<br />
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR <br />
OTHER DEALINGS IN THE SOFTWARE.
</p>
</div>
</div>
<?php $this->load->view('footer'); ?>

10
assets/cache/index.html vendored Executable file
View File

@@ -0,0 +1,10 @@
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

View File

@@ -170,7 +170,7 @@ div.error {
margin: 0;
padding: 0 15px;
border-top: 1px solid #e8e8e8;
background: url(../images/navigation-off.gif) repeat-x;
background: url(../images/navigation-on.gif) repeat-x;
line-height: 24px;
height: 100%;
display: block;
@@ -178,18 +178,22 @@ div.error {
}
.navigation ul li a {
color: #666;
background: url(../images/icons/chevron-small-expand.png) -2px center no-repeat;
padding-left: 16px;
margin-left: -7px;
color: #fff;
height: 100%;
width: 100%;
display: block;
}
.navigation ul li.active {
background: url(../images/navigation-on.gif) repeat-x;
background: url(../images/navigation-off.gif) repeat-x;
}
.navigation ul li.active a {
color: #fff;
background: url(../images/icons/chevron-small.png) -2px center no-repeat;
color: #666;
}
.navigation ul li ul {
@@ -205,6 +209,9 @@ div.error {
}
.navigation ul li ul li a {
background: none;
padding: 0;
margin: 0;
color: #0088cc;
}
@@ -310,7 +317,8 @@ div.error {
background: #fff;
border: 1px solid #e8e8e8;
padding: 15px;
height: 12px;
height: 35px;
line-height: 36px;
clear: both;
}
@@ -320,6 +328,7 @@ div.error {
#footer .right {
float: right;
margin-left: 6px;
}
/* Buttons */
@@ -520,7 +529,7 @@ ul.tabs li {
margin-bottom: -1px; /* Pull the list item down 1px */
overflow: hidden;
position: relative;
background: #e0e0e0 url('../images/navigation-off.gif');
background: #e0e0e0 url('../images/tabs-back.gif');
}
ul.tabs li a {

BIN
assets/images/dfg.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
assets/images/iwt.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
assets/images/tabs-back.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 B

BIN
assets/images/uni.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

@@ -22,6 +22,81 @@ function deleteConfirm(url) {
}
}
/**
* Sets a cookie.
*
* @param name
* @param value
* @param days
*/
function setCookie(name, value, days) {
var today = new Date();
var expire = new Date();
if (days == null || days == 0) {
days = 1;
}
expire.setTime(today.getTime() + 3600000 * 24 * days);
document.cookie = name + "=" + escape(value) + ";path=/;expires=" + expire.toGMTString();
}
/**
* Gets a cookie.
*
* @param name
* @returns
*/
function getCookie(name) {
var cookie = ' ' + document.cookie;
var index = cookie.indexOf(" " + name + "=");
if (index == -1) {
index = cookie.indexOf(";" + name + "=");
}
if (index == -1 || name == '') {
return '';
}
var index2 = cookie.indexOf(";", index + 1);
if (index2 == -1) {
index2 = cookie.length;
}
return unescape(cookie.substring(index + name.length + 2, index2));
}
/**
*
* @param cookieName
* @returns
*/
var CookieList = function(cookieName) {
var cookie = getCookie(cookieName);
// load the items or a new array if null
var items = cookie ? cookie.split(/,/) : new Array();
return {
"add": function(val) {
// add to the items
items.push(val);
// save the items to a cookie
setCookie(cookieName, items.join(','));
}, "remove": function(val) {
// remove the value from items
items.splice(items.indexOf(val), 1);
// save the items to a cookie
setCookie(cookieName, items.join(','));
}, "clear": function() {
items = null;
// clear the cookie
setCookie(cookieName, null, null);
}, "items": function() {
// get all the items
return items;
}
};
};
/**
* Saves the changes done by in-place edit.
*
@@ -207,4 +282,27 @@ $(document).ready(function() {
window.location = url;
}
});
/*
* Toggleable navigation
*/
var toggleList = new CookieList("toggled");
var toggled = toggleList.items();
for (var i = 0; i < toggled.length; i++) {
$('#' + toggled[i]).toggleClass('active').find('ul').hide();
}
$('.togglable').find('a').not('ul li ul li a').click(function() {
var id = $(this).parent().attr('id');
// toggle
$(this).parent().toggleClass('active').find('ul').toggle();
if ($(this).next().css('display') == 'none') {
toggleList.add(id);
} else {
toggleList.remove(id);
}
});
});