Skip to content

Commit

Permalink
Merge branch 'release/1.0.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
David McReynolds committed Mar 8, 2014
2 parents 3daf293 + a6543d2 commit 9a822ad
Show file tree
Hide file tree
Showing 24 changed files with 156 additions and 61 deletions.
2 changes: 1 addition & 1 deletion fuel/install/fuel_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ CREATE TABLE `fuel_users` (

INSERT INTO `fuel_users` (`id`, `user_name`, `password`, `email`, `first_name`, `last_name`, `language`, `reset_key`, `salt`, `super_admin`, `active`)
VALUES
(1, 'admin', 'f4c99eae874755b97610d650be565f1ac42019d1', '[email protected]', 'Admin', 'test', 'english', '', '429c6e14342dd7a63c510007a1858c26', 'yes', 'yes');
(1, 'admin', 'f4c99eae874755b97610d650be565f1ac42019d1', '', '', '', 'english', '', '429c6e14342dd7a63c510007a1858c26', 'yes', 'yes');



Expand Down
2 changes: 1 addition & 1 deletion fuel/modules/fuel/assets/css/fuel.css
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ div#tree_loader { position: absolute; top: 20px; left: 50%; margin-left: -25px;

/* #login */
div#login { padding: 15% 0 0 0; border: none; background-color: transparent; margin: 0 auto; }
div#login h3 { color: #fff; text-align: center; }
div#login h3, div#login p { color: #fff; text-align: center; }
div#login form { width: 270px; margin: 0 auto; }
div#login input { background-color: #1d1d1d; color: #fff; -webkit-border-radius: 10px; -moz-border-radius: 10px; border-radius: 10px; border: 2px solid #444; height: 40px; width: 270px; padding: 0 1em; }
.login_logo { background: transparent url(../images/fuel_logo.png) no-repeat; background-size: 100%; width: 233px; height: 46px; overflow: hidden; margin: 0 auto 1.5em auto; }
Expand Down
2 changes: 1 addition & 1 deletion fuel/modules/fuel/assets/css/fuel.min.css

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ fuel.controller.BaseFuelController = jqx.lib.BaseController.extend({
});

//$('#form input:first').select();
$('#form input:first').focus();
$('input,textarea', '#form').filter(':first').focus();

if (jqx.config.warnIfModified) $.checksave('#fuel_main_content');
},
Expand Down
4 changes: 2 additions & 2 deletions fuel/modules/fuel/assets/js/fuel/custom_fields.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//fuel = top.window.initFuelNamespace();
if (window.fuel == undefined){
if (typeof(window.fuel) == 'undefined'){
window.fuel = {};
}
fuel.fields = {};
Expand All @@ -15,7 +15,7 @@ fuel.fields.datetime_field = function(context){
showButtonPanel : false,
showOn: 'button',
buttonText: 'Click to show the calendar',
buttonImageOnly: true,
buttonImageOnly: true
}

// first look for jqx variable
Expand Down
35 changes: 18 additions & 17 deletions fuel/modules/fuel/assets/js/fuel/fuel.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions fuel/modules/fuel/assets/js/fuel/fuel_inline.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions fuel/modules/fuel/assets/js/fuel/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ function initFuelNamespace(){
}
//fuel = initFuelNamespace();
//console.log(fuel)
if (fuel == undefined){
var fuel = {};
if (typeof(window.fuel) == 'undefined'){
window.fuel = {};
}

fuel.lang = function(key){
Expand Down Expand Up @@ -94,7 +94,7 @@ fuel.modalWindow = function(html, cssClass, autoResize, onLoadCallback, onCloseC
if (autoResize){
setTimeout(function(){
docHeight = fuel.calcHeight(contentDoc);
$(iframe.contentWindow.parent.document).find('iframe').height(docHeight)
$(iframe.contentWindow.parent.document).find('#' + modalId + 'iframe').height(docHeight);
fuel.cascadeIframeWindowSize(docHeight);
$(iframe).height(docHeight);
}, 250);
Expand Down
22 changes: 15 additions & 7 deletions fuel/modules/fuel/assets/js/jquery/plugins/jquery.numeric.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,13 +243,21 @@ $.fn.removeNumeric = function()
// Based on code from http://javascript.nwbox.com/cursor_position/ (Diego Perini <[email protected]>)
$.fn.getSelectionStart = function(o)
{
if (o.createTextRange)
{
var r = document.selection.createRange().duplicate();
r.moveEnd('character', o.value.length);
if (r.text == '') return o.value.length;
return o.value.lastIndexOf(r.text);
} else return o.selectionStart;
// added try catch to ignore Chrome issue
try{
if (o.createTextRange)
{
var r = document.selection.createRange().duplicate();
r.moveEnd('character', o.value.length);
if (r.text == '') return o.value.length;
return o.value.lastIndexOf(r.text);
} else {
return o.selectionStart;
}

} catch(e){

}
}

// set the selection, o is the object (input), p is the position ([start, end] or just start)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ [email protected]
if (newId && newId.length){
newId = newId.replace(/\{index\}/g, i);
newId = newId.replace(/([-_a-zA-Z0-9]+_)\d+(_[-_a-zA-Z0-9]+)$/, '$1' + i + '$2');

$(elem).attr(attr, newId);
}
}
Expand All @@ -74,6 +75,9 @@ [email protected]
if (newName && newName.length){
newName = newName.replace(/([-_a-zA-Z0-9\[\]]+)\[\d+\]([-_a-zA-Z0-9\[\]]+)$/, '$1[' + i + ']$2');

// for file uploads
newName = newName.replace(/([-_a-zA-Z0-9]+)_\d+_([-_a-zA-Z0-9]+)$/, '$1_' + i + '_$2');

// required for jquery
newName = newName.replace('[', '\[');
newName = newName.replace(']', '\]');
Expand Down Expand Up @@ -114,6 +118,10 @@ [email protected]
var newName = $(this).attr('name')
if (newName && newName.length && parentIndex != null){
newName = newName.replace(/([-_a-zA-Z0-9]+\[)\d+(\]\[[-_a-zA-Z0-9]+\]\[[-_a-zA-Z0-9]+\])/g, '$1' + parentIndex + '$2');

// for file uploads
newName = newName.replace(/([-_a-zA-Z0-9]+)_\d+_([-_a-zA-Z0-9]+_[-_a-zA-Z0-9]+)/g, '$1_' + parentIndex + '_$2');

// newName = newName.replace(/([-_a-zA-Z0-9]+\[)\d+(\][-_a-zA-Z0-9\[\]]+)$/, '$1' + parentIndex + '$2');

// required for jquery
Expand Down
2 changes: 1 addition & 1 deletion fuel/modules/fuel/config/fuel_constants.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
// INSTALL_ROOT is defined in the index.php bootstrap file
define('FUEL_VERSION', '1.0.4');
define('FUEL_VERSION', '1.0.5');
define('MODULES_FOLDER', '../modules');
define('FUEL_FOLDER', 'fuel');
define('MODULES_PATH', APPPATH.MODULES_FOLDER.'/');
Expand Down
2 changes: 1 addition & 1 deletion fuel/modules/fuel/controllers/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ public function dev()
add_error(lang('error_invalid_login'));
}
}
$fields['password'] = array('type' => 'password', 'size' => 25);
$fields['password'] = array('type' => 'password', 'placeholder' => 'password', 'display_label' => FALSE, 'size' => 25);
$fields['forward'] = array('type' => 'hidden', 'value' => fuel_uri_segment(2));
$this->form_builder->show_required = FALSE;
$this->form_builder->submit_value = 'Login';
Expand Down
7 changes: 4 additions & 3 deletions fuel/modules/fuel/controllers/migrate.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require_once(FUEL_PATH.'/libraries/Fuel_base_controller.php');

class Migrate extends Fuel_base_controller {

protected $module = '';

public function __construct()
Expand Down Expand Up @@ -79,13 +79,14 @@ protected function _success($version)
{
if ($version === TRUE)
{
echo lang('migrate_nothing_todo', $version);
$msg = lang('migrate_nothing_todo', $version);
echo $msg;
}
else
{
echo lang('migrate_success', $version);
$msg = lang('database_migration_success', $version);
}
$msg = lang('database_migration_success', $version);
$this->fuel->logs->write($msg);
}

Expand Down
1 change: 1 addition & 0 deletions fuel/modules/fuel/controllers/users.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public function edit($id = NULL, $field = NULL, $redirect = TRUE)
public function login_as($id, $original_user_hash = '')
{
$this->load->library('session');
$this->load->module_model('fuel', 'fuel_users_model');
$change_logged_in_user = $this->fuel->auth->is_super_admin();
if ($original_user_hash AND ($this->session->userdata('original_user_hash') == $original_user_hash)) {
$change_logged_in_user = TRUE;
Expand Down
5 changes: 5 additions & 0 deletions fuel/modules/fuel/core/MY_Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -1209,6 +1209,11 @@ public function clean($values = array(), $run_hook = FALSE)
{
$values[$key] = ($this->auto_trim AND is_string($original_values[$key])) ? trim($original_values[$key]) : $original_values[$key];
}
// add the date fields if they don't exist to the values array
elseif(!array_key_exists($key, $original_values) AND (in_array($key, $this->auto_date_add) OR in_array($key, $this->auto_date_update)))
{
$values[$key] = NULL;
}
}

// process linked fields
Expand Down
7 changes: 6 additions & 1 deletion fuel/modules/fuel/helpers/validator_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ function required($var)
{
return !empty($var);
}
// automatically set integer values to TRUE
else if (is_int($var))
{
return TRUE;
}
return FALSE;

}
Expand Down Expand Up @@ -749,7 +754,7 @@ function display_errors($ERRORS = NULL, $class = 'error')
}
$str .= "</ul>\n";
}
$str .= "<script language=\"JavaScript\" type=\"text/javascript\">\n";
$str .= "<script type=\"text/javascript\">\n";
$str .= "// <![CDATA[\n";
$str .= "try { $(function(){ \$('.".$error_class." input:first').focus(); }); } catch(e){};\n";
$str .= "// ]]>\n";
Expand Down
61 changes: 51 additions & 10 deletions fuel/modules/fuel/libraries/Form_builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -1776,6 +1776,45 @@ public function create_checkbox($params)

// --------------------------------------------------------------------

/**
* Creates the radio input for the form
*
* @access public
* @param array fields parameters
* @return string
*/
public function create_radio($params)
{
$defaults = array(
'checked' => FALSE // for checkbox/radio
);
$params = $this->normalize_params($params, $defaults);

$str = '';
$attrs = array(
'id' => $params['id'],
'class' => $params['class'],
'readonly' => $params['readonly'],
'disabled' => $params['disabled'],
'data' => $params['data'],
'style' => $params['style'],
'tabindex' => $params['tabindex'],
'attributes' => $params['attributes'],
);
if ($params['checked'])
{
$attrs['checked'] = 'checked';
}
if (isset($params['value']) AND $params['value'] == '')
{
$params['value'] = 1;
}
$str .= $this->form->radio($params['name'], $params['value'], $attrs);
return $str;
}

// --------------------------------------------------------------------

/**
* Creates the textarea input for the form
*
Expand Down Expand Up @@ -2507,7 +2546,7 @@ public function create_number($params)
'disabled' => $params['disabled'],
'required' => (!empty($params['required']) ? TRUE : NULL),
'min' => (isset($params['min']) ? $params['min'] : '0'),
'max' => (isset($params['max']) ? $params['max'] : NULL),
'max' => (isset($params['max']) ? $params['max'] : '10'),
'step' => (isset($params['step']) ? $params['step'] : NULL),
'data' => $params['data'],
'style' => $params['style'],
Expand All @@ -2521,15 +2560,16 @@ public function create_number($params)
$decimal = (!empty($params['decimal'])) ? (int) $params['decimal'] : 0;
$negative = (!empty($params['negative'])) ? 1 : 0;

if (empty($params['size']))
{
$attrs['size'] = 10;
}
// invalid HTML
// if (empty($params['size']))
// {
// $attrs['size'] = 10;
// }

if (empty($params['maxlength']))
{
$attrs['maxlength'] = 10;
}
// if (empty($params['maxlength']))
// {
// $attrs['maxlength'] = 10;
// }

// set data values for jquery plugin to use
$attrs['data'] = array(
Expand Down Expand Up @@ -2638,9 +2678,10 @@ public function create_copy($params)
{
$params = $this->normalize_params($params);
$id = isset($params['id']) ? ' id="'.$params['id'].'"' : '';
$class = isset($params['class']) ? ' class="'.$params['class'].'"' : '';
$copy = $this->simple_field_value($params);
$tag = (empty($params['tag'])) ? $this->copy_tag : $params['tag'];
return '<'.$tag.$id.'>'.$copy.'</'.$tag.'>';
return '<'.$tag.$id.$class.'>'.$copy.'</'.$tag.'>';
}

// --------------------------------------------------------------------
Expand Down
20 changes: 17 additions & 3 deletions fuel/modules/fuel/libraries/Fuel_custom_fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public function file($params)
$file_params['class'] = 'multifile '.$params['class'];
}
$file_params['name'] = str_replace(array('[', ']', '__'), array('_', '', '_'), $params['name']);
$file_params['id'] = $params['name'].'_upload';
$file_params['id'] = $file_params['name'].'_upload';


$str = '';
Expand Down Expand Up @@ -222,7 +222,7 @@ public function file($params)
if (!empty($asset_path) AND !empty($params['value']))
{
$preview .= ' ';
$preview .= '<a href="'.$asset_path.'" target="_blank">';
$preview .= '<a href="'.$asset_path.'" target="_blank" class="noclone">';
if (isset($params['is_image']) OR (!isset($params['is_image']) AND is_image_file($asset_path)))
{
$preview .= '<br><img src="'.$asset_path.'" style="'.$params['img_styles'].'"/>';
Expand Down Expand Up @@ -445,6 +445,7 @@ public function asset($params)
{
if (isset($val["'.$process_key.'"]))
{
$z = "";
if (is_string($val["'.$process_key.'"]))
{
$z = $val["'.$process_key.'"];
Expand Down Expand Up @@ -890,7 +891,17 @@ public function template($params, $return_fields = FALSE)

if (empty($params['template']) AND !empty($params['view']))
{
$str = $this->CI->load->view($params['view'], $vars, TRUE);
$module = 'app';
if (is_array($params['view']))
{
$module = key($params['view']);
$view = current($params['view']);
}
else
{
$view = $params['view'];
}
$str = $this->CI->load->module_view($module, $view, $vars, TRUE, '__TEMPLATE_FIELD__');
}
else if (!empty($params['template']))
{
Expand Down Expand Up @@ -1082,6 +1093,7 @@ public function currency($params)
{
if (isset($val["'.$process_key.'"]))
{
$z = "";
if (is_string($val["'.$process_key.'"]))
{
$z = $val["'.$process_key.'"];
Expand Down Expand Up @@ -1293,6 +1305,7 @@ public function list_items($params)
{
if (isset($val["'.$process_key.'"]))
{
$z = "";
if (is_string($val["'.$process_key.'"]))
{
$z = $val["'.$process_key.'"];
Expand Down Expand Up @@ -1604,6 +1617,7 @@ public function keyval($params)
{
if (isset($val["'.$process_key.'"]))
{
$z = "";
if (is_string($val["'.$process_key.'"]))
{
$z = $val["'.$process_key.'"];
Expand Down
Loading

0 comments on commit 9a822ad

Please sign in to comment.