Add custom header support.

@action after_setup_theme
@since  1.0.0
@uses   $this->header_css()
495537
public function header() {

		/**
		 * Filter the custom header args.
		 *
		 * @since 1.0.0
		 *
		 * @var array
		 */
		$args = (array) apply_filters( 'rock_custom_header_args',
			array(
				'default-text-color' => $this->get_default_color( 'header_textcolor', 'default' ),
				'width'              => 2400,
				'height'             => 1300,
				'flex-height'        => true,
				'wp-head-callback'   => array( $this, 'header_css' ),
			)
		);

		add_theme_support( 'custom-header', $args );

		/**
		 * Filter the default hero images.
		 *
		 * @var array
		 */
		$defaults = (array) apply_filters( 'rock_default_hero_images',
			array(
				'default' => array(
					'url'           => 'assets/images/hero.jpg',
					'thumbnail_url' => 'assets/images/hero-thumbnail.jpg',
				),
			)
		);

		foreach ( $defaults as $name => &$args ) {

			$path = trailingslashit( get_stylesheet_directory() );
			$url  = trailingslashit( get_stylesheet_directory_uri() );

			if ( ! file_exists( $path . $args['url'] ) ) {

				unset( $defaults[ $name ] );

				continue;

			}

			$args['url']           = $url . $args['url'];
			$args['thumbnail_url'] = file_exists( $path . $args['thumbnail_url'] ) ? $url . $args['thumbnail_url'] : $args['url'];

		}

		if ( $defaults ) {

			register_default_headers( $defaults );

		}

	}
257226
public function apply()
    {
        if (!($this->config->hasKey(self::HEIGHT) && $this->config->hasKey(self::WIDTH))) {
            return;
        }

        add_theme_support('custom-logo', [
            'height'      => $this->config->getKey(self::HEIGHT),
            'width'       => $this->config->getKey(self::WIDTH),
            'flex-height' => $this->config->hasKey(self::FLEX_HEIGHT) ? $this->config->getKey(self::FLEX_HEIGHT) : true,
            'flex-width'  => $this->config->hasKey(self::FLEX_WIDTH) ? $this->config->getKey(self::FLEX_WIDTH) : true,
        ]);

        add_filter('genesis_seo_title', [$this, 'inlineLogoMarkup'], 10, 3);

        if (false === $this->config->getKey(self::SITE_DESCRIPTION)) {
            add_filter('genesis_attr_site-description', [$this, 'hideSiteDescription']);
        }
    }
356267
public function actionAdd() 
	{
		$setting = BannerSetting::model()->findByPk(1, array(
			'select' => 'banner_file_type',
		));
		$banner_file_type = unserialize($setting->banner_file_type);
		if(empty($banner_file_type))
			$banner_file_type = array();
		
		$model=new Banners;

		// Uncomment the following line if AJAX validation is needed
		$this->performAjaxValidation($model);

		if(isset($_POST['Banners'])) {
			$model->attributes=$_POST['Banners'];

			if($model->save()) {
				Yii::app()->user->setFlash('success', Yii::t('phrase', 'Banner success created.'));
				$this->redirect(array('manage'));
			}
		}

		$this->pageTitle = Yii::t('phrase', 'Create Banner');
		$this->pageDescription = '';
		$this->pageMeta = '';
		$this->render('admin_add', array(
			'model'=>$model,
			'banner_file_type'=>$banner_file_type,
		));
	}
1201285
public function addHeaderToRequest($header, $value)
    {
        $this->request = $this->request->withHeader($header, $value);
    }
553925
public function buildDefaultHeader(): void
    {
        $this->set(PoTokens::MESSAGE, "");
        $this->set(PoTokens::TRANSLATOR_COMMENTS, 'SOME DESCRIPTIVE TITLE');
        $this->add(PoTokens::TRANSLATOR_COMMENTS, 'Copyright (C) YEAR HOLDER');
        $this->add(PoTokens::TRANSLATOR_COMMENTS, 'LICENSE');
        $this->add(PoTokens::TRANSLATOR_COMMENTS, 'FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.');
        $this->add(PoTokens::TRANSLATOR_COMMENTS, '');
        $this->set(PoTokens::FLAG, 'fuzzy');
        $this->setHeader('Project-Id-Version', 'PACKAGE VERSION');
        $this->setHeader('Report-Msgid-Bugs-To', 'FULL NAME <EMAIL@ADDRESS>');
        $this->setCreateDate();
        $this->setHeader('PO-Revision-Date', 'YEAR-MO-DA HO:MI+ZONE');
        $this->setHeader('Last-Translator', 'FULL NAME <EMAIL@ADDRESS>');
        $this->setHeader('Language-Team', 'LANGUAGE <EMAIL@ADDRESS>');
        $this->setHeader('MIME-Version', '1.0');
        $this->setHeader('Content-Type', 'text/plain; charset=UTF-8');
        $this->setHeader('Content-Transfer-Encoding', '8bit');
        $this->setHeader('Plural-Forms', 'nplurals=INTEGER; plural=EXPRESSION;');
        $this->setHeader('X-Generator', 'geekwright/po');
    }
1275949
public function addCustomHeader($custom_header, $value = null) {
        if ($value === null and preg_match('/message-id:(.*)/i', $custom_header, $matches)) {
            $this->MessageID = trim($matches[1]);
            return true;
        } else if ($value !== null and strcasecmp($custom_header, 'message-id') === 0) {
            $this->MessageID = trim($value);
            return true;
        } else {
            return parent::addCustomHeader($custom_header, $value);
        }
    }
144822
public function _amp_post_template_css() {
		ob_start();
		$this->_print_front_styles();
		$css = ob_get_clean();
		$css = str_replace( '!important', '', $css );
		// @codingStandardsIgnoreStart
		echo $css;
		// @codingStandardsIgnoreEnd
	}
550133
public function init() {
		
		$this->addCssClass($this->htmlOptions, 'panel');
		
		if($this->isValidContext())
			self::addCssClass($this->htmlOptions, 'panel-'.$this->getContextClass());

		if ($this->padContent)
			self::addCssClass($this->contentHtmlOptions, 'panel-body');

		if (!isset($this->contentHtmlOptions['id'])) {
			$this->contentHtmlOptions['id'] = $this->getId();
		}

		if (isset($this->headerHtmlOptions['class'])) {
			$this->headerHtmlOptions['class'] = 'panel-heading ' . $this->headerHtmlOptions['class'];
		} else {
			$this->headerHtmlOptions['class'] = 'panel-heading';
		}

		echo CHtml::openTag('div', $this->htmlOptions);

		$this->renderHeader();
		$this->renderContentBegin();
	}
971181
protected function addTableHead()
	{
		$this->addTableRow('TH', $this->table['rows'][0]);
		$this->createHeadTags($this->table['rows'][0]['pos'], $this->pos);
	}
523044
protected function addResourcesToHead()
    {
        parent::addResourcesToHead();

        // Add pz2-neuerwerbungen.css to <head>.
        $cssTag = new TagBuilder('link');
        $cssTag->addAttribute('rel', 'stylesheet');
        $cssTag->addAttribute('type', 'text/css');
        $cssTag->addAttribute('href', $this->conf['pz2-neuerwerbungenCSSPath']);
        $cssTag->addAttribute('media', 'all');
        $this->response->addAdditionalHeaderData($cssTag->render());

        // Add pz2-neuerwerbungen.js to <head>.
        $scriptTag = new TagBuilder('script');
        $scriptTag->addAttribute('type', 'text/javascript');
        $scriptTag->addAttribute('src', $this->conf['pz2-neuerwerbungenJSPath']);
        $scriptTag->forceClosingTag(true);
        $this->response->addAdditionalHeaderData($scriptTag->render());

        // Make jQuery initialise pazpar2neuerwerbungen when the DOM is ready.
        $jsCommand = 'jQuery(document).ready(pz2neuerwerbungenDOMReady);';
        $scriptTag = new TagBuilder('script');
        $scriptTag->addAttribute('type', 'text/javascript');
        $scriptTag->setContent($jsCommand);
        $this->response->addAdditionalHeaderData($scriptTag->render());
    }
468588
public function init() {
		
		self::addCssClass($this->htmlOptions, 'form' . self::$typeClasses[$this->type]);
		
		if (!isset($this->errorMessageCssClass)) {
			$this->errorMessageCssClass = 'help-block error';
		}
		if(!isset($this->clientOptions['errorCssClass'])){
			$this->clientOptions['errorCssClass'] = 'has-error';
		}
		if(!isset($this->clientOptions['successCssClass'])){
			$this->clientOptions['successCssClass'] = 'has-success';
		}
		if(!isset($this->clientOptions['inputContainer'])){
			$this->clientOptions['inputContainer'] = 'div.form-group';
		}

		parent::init();
	}
954137
protected function fixHeaders()
    {
        parent::fixHeaders();
        if (count($this->getChildren())) {
            $this->setHeaderParameter('Content-Type', 'charset', null);
            $this->setHeaderParameter('Content-Type', 'format', null);
            $this->setHeaderParameter('Content-Type', 'delsp', null);
        } else {
            $this->setCharset($this->userCharset);
            $this->setFormat($this->userFormat);
            $this->setDelSp($this->userDelSp);
        }
    }
744962
public function customizerHeader()
    {
        if (get_field('header_layout', 'options') !== 'customizer') {
            return;
        }

        $customizerHeader = new \Municipio\Customizer\Source\CustomizerRepeaterInput('customizer__header_sections', 'options', 'id');
        $this->data['headerLayout']['classes'] = 's-site-header';
        $this->data['headerLayout']['template'] = 'customizer';

        if ($customizerHeader->hasItems) {
            foreach ($customizerHeader->repeater as $headerData) {
                $this->data['headerLayout']['headers'][] = new \Municipio\Customizer\Header($headerData);
            }
        }
    }
736427
function init() {
		$this->setTemplateDir(Yii::getAlias($this->themePath.$this->themeName.'/templates'))
			 ->addPluginsDir(Yii::getAlias($this->commonPluginsPath))
			 ->addPluginsDir(Yii::getAlias($this->themePath.$this->themeName.'/plugins'))
			 ->setConfigDir(Yii::getAlias($this->themePath.$this->themeName.'/configs'))
			 ->setCompileDir(Yii::getAlias($this->compilePath))
			 ->setCacheDir(Yii::getAlias($this->cachePath));
		foreach ($this->options as $key => $value) {
			$this->$key = $value;
		}
	}
511321
protected function applyHeaders()
    {
        if ($this->getConfig('Content-type') != "text/html") {
            header('Content-type: ' . $this->getConfig('Content-type'));
        }

        if (!is_null($this->getConfig('Content-disposition'))) {
            header('Content-disposition: ' . $this->getConfig('Content-disposition'));
        }
    }
1243811
protected function addCorsHeaders()
    {
        // set CORS headers if specified in config
        if (!isset($this->config['docs']['cors'])) {
            return false;
        }

        if (!count($this->config['docs']['cors'])) {
            return false;
        }

        foreach ($this->config['docs']['cors'] as $header => $value) {
            $this->response = $this->response->withHeader($header, $value);
        }
    }
1035780
protected function _setSectionCssClass()
    {
        $plugin = $this->request->params['plugin'];
        $prefix = ($plugin !== null) ? $plugin : 'app';
        $this->set(
            'sectionCssClass',
            strtolower(
                Text::slug($prefix) . '--' .
                preg_replace('/\\//', '--', $this->request->params['controller']) . '-' .
                $this->request->params['action']
            )
        );
    }