From 8e6eff096bcacd6e3f51d1e04885d651bf916455 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 25 Nov 2008 01:39:20 +0000 Subject: Don't add in-place-edit CSS unless there's a logged-in user. --- core/models/item.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'core/models') diff --git a/core/models/item.php b/core/models/item.php index 4481a3a9..99a9c32a 100644 --- a/core/models/item.php +++ b/core/models/item.php @@ -184,8 +184,12 @@ class Item_Model extends ORM_MPTT { public function __get($column) { if (substr($column, -5) == "_edit") { $real_column = substr($column, 0, strlen($column) - 5); - return "id}-{$real_column}\">" . - "{$this->$real_column}"; + if (Session::instance()->get("user", false)) { + return "id}-{$real_column}\">" . + "{$this->$real_column}"; + } else { + return parent::__get($real_column); + } } else if ($column == "owner") { // This relationship depends on an outside module, which may not be present so handle // failures gracefully. -- cgit v1.2.3