/** Handle object */ function onObject($name, $id) { if (substr($name, 0, 14) !== 'content/pages/') { return false; } $slug = gb_fnsplit(substr($name, 14)); $fnext = $slug[1]; $slug = $slug[0]; # comment or page? if ($fnext === 'comments') { $obj = $this->_onComment($name, $id, GBPage::mkCachename($slug)); } else { $obj = $this->_onObject(GBPage::find($slug), 'GBPage', $name, $id, $slug); } return true; }
function fnext() { $fnext = null; if ($this->mimeType) { if (strpos($this->mimeType, '/') !== false) { $fnext = GBMimeType::forType($this->mimeType); } else { $fnext = $this->mimeType; } } if (!$fnext) { $fnext = array_pop(gb_fnsplit($this->name)); } return $fnext; }