From ea03cd13b2742d1188bb65210b06d8c6390063c4 Mon Sep 17 00:00:00 2001 From: Andrey Kutejko Date: Wed, 3 Sep 2014 03:30:37 +0300 Subject: [PATCH] show booleans with unicode instead of images --- ipf/admin/legacymodel.php | 7 +++---- ipf/admin/static/admin/css/changelists.css | 4 ++++ ipf/auth/admin.php | 9 ++++++++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/ipf/admin/legacymodel.php b/ipf/admin/legacymodel.php index 40572fd..d8baa17 100644 --- a/ipf/admin/legacymodel.php +++ b/ipf/admin/legacymodel.php @@ -100,10 +100,9 @@ class IPF_Admin_Model extends IPF_Admin_Component $value = $object->$column; switch ($object->getTable()->getTypeOf($column)) { case 'boolean': - if ($value) - return 'True'; - else - return 'False'; + return $value + ? '' + : ''; case 'timestamp': return Text::escape(IPF_Utils::formatDate($value)); default: diff --git a/ipf/admin/static/admin/css/changelists.css b/ipf/admin/static/admin/css/changelists.css index eb0106c..542903e 100644 --- a/ipf/admin/static/admin/css/changelists.css +++ b/ipf/admin/static/admin/css/changelists.css @@ -48,3 +48,7 @@ .ItemsDragClass{background-color:#E3F3FE;} + +.positive { color: #44AD41; } +.negative { color: #DE2121; } + diff --git a/ipf/auth/admin.php b/ipf/auth/admin.php index dcf8b37..b80e984 100644 --- a/ipf/auth/admin.php +++ b/ipf/auth/admin.php @@ -156,7 +156,14 @@ class AdminUser extends IPF_Admin_Component public function renderCell($object, $column) { - return $object->$column; + if (substr($column, 0, 3) === 'is_') { + // boolean + return $object->$column + ? '' + : ''; + } else { + return Text::escape($object->$column); + } } public function getObjectByID($id) -- 2.49.0