diff options
author | Bharat Mediratta <bharat@menalto.com> | 2008-11-25 01:39:20 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2008-11-25 01:39:20 +0000 |
commit | 8e6eff096bcacd6e3f51d1e04885d651bf916455 (patch) | |
tree | c57fbba09724361c5e715e27dea5bfbfa966877a | |
parent | 2c7893b48eee9191a9c6f10ecac9cf4718dc0443 (diff) |
Don't add in-place-edit CSS unless there's a logged-in user.
-rw-r--r-- | core/models/item.php | 8 |
1 files changed, 6 insertions, 2 deletions
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 "<span class=\"gInPlaceEdit gEditField-{$this->id}-{$real_column}\">" . - "{$this->$real_column}</span>"; + if (Session::instance()->get("user", false)) { + return "<span class=\"gInPlaceEdit gEditField-{$this->id}-{$real_column}\">" . + "{$this->$real_column}</span>"; + } 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. |