Esempio n. 1
0
 /**
  * Gets meta keys and met description from the given object
  *  and adds to the site header
  * @param SPDBObject $obj
  * @return SPHeader
  */
 public function &objMeta($obj)
 {
     if ($obj->get('metaDesc')) {
         $this->addDescription($obj->get('metaDesc'));
     }
     if ($obj->get('metaKeys')) {
         $this->addKeyword($obj->get('metaKeys'));
     }
     if ($obj->get('metaAuthor')) {
         $this->addAuthor($obj->get('metaAuthor'));
     }
     if ($obj->get('metaRobots')) {
         $this->addRobots($obj->get('metaRobots'));
     }
     if ($obj->get('oType') != 'section' && Sobi::Cfg('meta.always_add_section')) {
         $this->objMeta(SPFactory::currentSection());
     }
     if ($obj->get('oType') == 'entry') {
         $fields = $obj->getFields();
         if (count($fields)) {
             foreach ($fields as $field) {
                 $this->addDescription($field->metaDesc());
                 $this->addKeyword($field->metaKeys());
             }
         }
     }
     return $this;
 }