summaryrefslogtreecommitdiffstats
path: root/system/libraries
diff options
context:
space:
mode:
Diffstat (limited to 'system/libraries')
-rw-r--r--system/libraries/Loader.php5
-rw-r--r--system/libraries/Model.php1
-rw-r--r--system/libraries/Table.php38
3 files changed, 38 insertions, 6 deletions
diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php
index 7c42123f5..f243a2879 100644
--- a/system/libraries/Loader.php
+++ b/system/libraries/Loader.php
@@ -837,6 +837,11 @@ class CI_Loader {
*/
function _ci_assign_to_models()
{
+ if (count($this->_ci_models) == 0)
+ {
+ return;
+ }
+
if ($this->_ci_is_instance())
{
$CI =& get_instance();
diff --git a/system/libraries/Model.php b/system/libraries/Model.php
index dfb48a5d0..2fe93dd00 100644
--- a/system/libraries/Model.php
+++ b/system/libraries/Model.php
@@ -37,6 +37,7 @@ class Model {
{
// If the magic __get() method is used in a Model references can't be used.
$this->_assign_libraries( (method_exists($this, '__get')) ? FALSE : TRUE );
+ //$this->_assign_libraries( (method_exists($this, '__get') OR method_exists('__set')) ? FALSE : TRUE );
// We don't want to assign the model object to itself when using the
// assign_libraries function below so we'll grab the name of the model parent
diff --git a/system/libraries/Table.php b/system/libraries/Table.php
index f3f9b32f6..da7bbbecf 100644
--- a/system/libraries/Table.php
+++ b/system/libraries/Table.php
@@ -28,10 +28,11 @@
*/
class CI_Table {
- var $rows = array();
- var $heading = array();
- var $template = NULL;
- var $newline = "\n";
+ var $rows = array();
+ var $heading = array();
+ var $template = NULL;
+ var $newline = "\n";
+ var $empty_cells = "";
function CI_Table()
@@ -78,6 +79,22 @@ class CI_Table {
// --------------------------------------------------------------------
/**
+ * Set "empty" cells
+ *
+ * Can be passed as an array or discreet params
+ *
+ * @access public
+ * @param mixed
+ * @return void
+ */
+ function set_empty($value)
+ {
+ $this->empty_cells = $value;
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
* Add a table row
*
* Can be passed as an array or discreet params
@@ -166,10 +183,19 @@ class CI_Table {
$out .= $this->template['row_'.$alt.'start'];
$out .= $this->newline;
- foreach($row as $cells)
+ foreach($row as $cell)
{
$out .= $this->template['cell_'.$alt.'start'];
- $out .= $cells;
+
+ if ($cell == "")
+ {
+ $out .= $this->empty_cells;
+ }
+ else
+ {
+ $out .= $cell;
+ }
+
$out .= $this->template['cell_'.$alt.'end'];
}