Example #1
0
 public function render()
 {
     $output = Html5::metaProperty('og:audio', $this->url);
     if (!empty($this->secureUrl)) {
         $output .= Html5::metaProperty('og:audio:secure_url', $this->secureUrl);
     }
     if (!empty($this->type)) {
         $output .= Html5::metaProperty('og:audio:type', $this->type);
     }
     return $output;
 }
Example #2
0
 public function register()
 {
     if (!$this->cacheEnable) {
         if ($this->gaEnable) {
             enqueue_theme_footer($this->gaAsync ? $this->gaScriptAsync() : $this->gaScript(), 'ga_script');
         }
         if ($this->mixPanelEnable) {
             enqueue_theme_footer($this->mixPanelScript(), 'mix_panel_script');
         }
     } else {
         enqueue_theme_footer(Html5::js(AssetHelper::jsUrl($this::EXTENSION_NAME)), $this::EXTENSION_NAME);
         if ($this->gaEnable && $this->gaAsync) {
             enqueue_theme_footer($this->gaJsAsync(), 'ga_js_async');
         }
     }
 }
Example #3
0
 public function render()
 {
     $output = PHP_EOL . Html5::metaProperty('og:image', $this->url);
     if (!empty($this->secureUrl)) {
         $output .= PHP_EOL . Html5::metaProperty('og:image:secure_url', $this->secureUrl);
     }
     if (!empty($this->type)) {
         $output .= PHP_EOL . Html5::metaProperty('og:image:type', $this->type);
     }
     if (!empty($this->width)) {
         $output .= PHP_EOL . Html5::metaProperty('og:image:width', $this->width);
     }
     if (!empty($this->height)) {
         $output .= PHP_EOL . Html5::metaProperty('og:image:height', $this->height);
     }
     return $output;
 }
Example #4
0
 public function render()
 {
     $output = Html5::metaProperty('og:video', $this->url);
     if (!empty($this->secureUrl)) {
         $output .= Html5::metaProperty('og:video:secure_url', $this->secureUrl);
     }
     if (!empty($this->type)) {
         $output .= Html5::metaProperty('og:video:type', $this->type);
     }
     if (!empty($this->width)) {
         $output .= Html5::metaProperty('og:video:width', $this->width);
     }
     if (!empty($this->height)) {
         $output .= Html5::metaProperty('og:video:height', $this->height);
     }
     return $output;
 }
Example #5
0
 public function flush($echo = true)
 {
     $this->output = [];
     foreach ($this->queue as $name => $item) {
         switch ($item['type']) {
             case self::TYPE_RAW:
                 $this->output[] = Html5::jsInline($item['content']);
                 break;
             case self::TYPE_VAR:
                 $content = [];
                 foreach ($item['content'] as $varName => $varValue) {
                     $content[] = 'var ' . $varName . ' = ' . $this->getVarValue($varValue) . ';';
                 }
                 $this->output[] = Html5::jsInline(implode(PHP_EOL, $content));
                 break;
             default:
                 $this->output[] = Html5::js($item['content']);
                 break;
         }
     }
     return parent::flush($echo);
 }
Example #6
0
 public function flush($echo = true)
 {
     $this->output = [];
     $this->output = [];
     foreach ($this->queue as $name => $item) {
         switch ($item['type']) {
             case self::TYPE_RAW:
                 $this->output[] = Html5::cssInline($item['content']);
                 break;
             case self::TYPE_VAR:
                 $content = [];
                 foreach ($item['content'] as $css) {
                     $content[] = $this->getNames($css['names']) . '{' . $this->getProperties($css['properties']) . '}';
                 }
                 $this->output[] = Html5::cssInline(implode(PHP_EOL, $content));
                 break;
             default:
                 $this->output[] = Html5::css($item['content']);
                 break;
         }
     }
     return parent::flush($echo);
 }
Example #7
0
 /**
  * @param string $property
  * @param array $contents
  * @return string
  */
 protected function parseContents($property, array $contents)
 {
     $output = '';
     foreach ($contents as $content) {
         $output .= PHP_EOL . Html5::metaProperty($property, $content);
     }
     return $output;
 }
Example #8
0
 public function register($is_auth = false)
 {
     enqueue_theme_header(Html5::metaName('generator', $this->generator), 'framework_version');
     $this->registerComposers($is_auth);
     $this->registerLibStyles($is_auth);
     $this->registerExtStyles($is_auth);
     $this->registerLibScripts($is_auth);
     $this->registerExtScripts($is_auth);
 }