Exemplo n.º 1
0
 /** 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;
 }
Exemplo n.º 2
0
 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;
 }