Beispiel #1
0
 public static function setMeta($data, $additional = '')
 {
     Funcs::$seo_title = $data['seo_title'];
     Funcs::$seo_description = $data['seo_description'];
     Funcs::$seo_keywords = $data['seo_keywords'];
     if (!empty(Funcs::$seo)) {
         Funcs::$seo_title = Funcs::$seo['title']['value'];
         Funcs::$seo_keywords = Funcs::$seo['keywords']['value'];
         Funcs::$seo_description = Funcs::$seo['description']['value'];
     } elseif (is_array($additional)) {
         Funcs::$seo_title = $data['seo_title'];
         $vendors = array();
         if (is_array($additional['vendors']['list'])) {
             foreach ($additional['vendors']['list'] as $item) {
                 $vendors[] = $item['name'];
             }
         }
         $catalog = array();
         if (is_array($additional['catalog']['list'])) {
             foreach ($additional['catalog']['list'] as $item) {
                 $catalog[] = $item['name'];
             }
         }
         Funcs::$seo_description = $data['seo_description'] . ' фирм ' . implode(', ', $vendors) . ': продажа, доставка, установка.';
         Funcs::$seo_keywords = $data['seo_keywords'] . ', ' . implode(', ', $catalog) . ', ' . implode(', ', $vendors);
     }
 }