示例#1
0
 protected function _scripts()
 {
     static $outputted = false;
     if ($outputted) {
         return '';
     } else {
         $outputted = true;
     }
     $google_fonts = array();
     if (self::$google_fonts !== false) {
         foreach (self::$google_fonts as $font) {
             $google_fonts[] = $font['family'];
         }
     }
     $custom_fontface = Func::filesList(Theme::getInstance()->stylesheet_dir . '/' . self::$fonts_path, self::$fonts_exts, function (&$i, &$bn, $pi) {
         $i = $pi['filename'];
         $bn = ucwords(Func::stringID(preg_replace('/webfont$/', '', $pi['filename']), ' '));
     });
     return 'var web_safe = ' . json_encode(self::$web_safe) . '; ' . 'var google_fonts = ' . json_encode($google_fonts) . '; ' . 'var custom_fontface = ' . json_encode($custom_fontface) . ';';
 }