This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function add_lang_string() | |
{ | |
die(); | |
$final = "\n".' | |
/* Added in version 1.2.2 */ | |
$lang[\'form_save_and_go_back\'] = \'Save and go back to list\'; | |
$lang[\'form_update_and_go_back\']= \'Update and go back to list\';'; | |
$this->load->helper('file'); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* load the MX_Loader class */ | |
require APPPATH."third_party/MX/Loader.php"; | |
/** | |
* PHP Codeigniter Simplicity | |
* | |
* Copyright (C) 2013 John Skoumbourdis. | |
* | |
* GROCERY CRUD LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
class Base_Controller extends CI_Controller { | |
function __construct() | |
{ | |
parent::__construct(); | |
$this->output->set_template('default'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<?php | |
foreach($css_files as $file): ?> | |
<link type="text/css" rel="stylesheet" href="<?php echo $file; ?>" /> | |
<?php endforeach; ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param GroceryCrud $crud | |
*/ | |
function crud_apply_texteditor($crud) { | |
$ci = &get_instance(); | |
$db = $ci->db; | |
$texteditors = []; | |
$fields = $db->field_data($crud->getDbTableName()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroceryCrud\Core\Model; | |
class CodeigniterSimpleModel extends Model { | |
protected $ci; | |
protected $db; | |
function __construct($databaseConfig) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
src/GroceryCrud/Core/State/EditFormState.php | 3 ++- | |
src/GroceryCrud/Core/State/ReadFormState.php | 2 +- | |
2 files changed, 3 insertions(+), 2 deletions(-) | |
diff --git a/src/GroceryCrud/Core/State/EditFormState.php b/src/GroceryCrud/Core/State/EditFormState.php | |
index 1524f49..33b02e3 100644 | |
--- a/src/GroceryCrud/Core/State/EditFormState.php | |
+++ b/src/GroceryCrud/Core/State/EditFormState.php | |
@@ -46,8 +46,9 @@ class EditFormState extends StateAbstract { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/src/GroceryCrud/Core/State/StateAbstract.php | |
+++ b/src/GroceryCrud/Core/State/StateAbstract.php | |
@@ -224,7 +224,9 @@ class StateAbstract | |
$columnValue = $callbackColumns[$columnName]($columnValue, $result); | |
} else { | |
$columnValue = strip_tags($columnValue); | |
- $columnValue = $char_limiter > 0 && (strlen($columnValue) > $char_limiter) ? substr($columnValue, 0 , $char_limiter - 1) . '...' : $columnValue; | |
+ if ($char_limiter > 0 && (mb_strlen($columnValue, 'UTF-8') > $char_limiter)) { | |
+ $columnValue = mb_substr($columnValue, 0 , $char_limiter - 1, 'UTF-8') . '...'; | |
+ } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Real code that it's still working on production environment by the way :) | |
function faq_management($value1 = "",$value2 = "",$value3 = 0) | |
{ | |
$this->load->library('TableControlPackage'); | |
$object_name = records_management; | |
$this->records_management = new TableControlPackage(__FUNCTION__); | |
$this->records_management->insert_table_name('faq'); | |
$this->records_management->insert_subject_name('Faqs'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Benchmarking code for: https://jsperf.com/objectsearch/1 | |
Benchmark.prototype.setup = function() { | |
arc = ['dog','cat','eagle','human','mouse','flea','wasp','bee','chicken','tortoise','hare','coyote','hummingbird','ostrich','eagle','human']; | |
obs = { | |
"dog": true, | |
"cat": true, | |
"eagle": true, | |
"human": true, | |
"mouse": true, |
OlderNewer