Add the directive header and options to the generated content.
323854
def add_directive_header(self, sig):
        """"""
        domain = getattr(self, 'domain', 'py')
        directive = getattr(self, 'directivetype', "module")
        name = self.format_name()
        self.add_line(u'.. %s:%s:: %s%s' % (domain, directive, name, sig),
                      '<autodoc>')
        if self.options.noindex:
            self.add_line(u'   :noindex:', '<autodoc>')
        if self.objpath:
            # Be explicit about the module, this is necessary since .. class::
            # etc. don't support a prepended module name
            self.add_line(u'   :module: %s' % self.modname, '<autodoc>')
343929
public function hookDisplayBackOfficeHeader()
    {
        if (!$this->onBoarding->isFinished()) {
            $this->context->controller->addCSS($this->_path.'public/module.css', 'all');
            $this->context->controller->addJS($this->_path.'public/module.js', 'all');
        }
    }
1167263
def addOutHeaderInfo(self, name, type, namespace, element_type=0,
                         mustUnderstand=0):
        """"""
        headerinfo = HeaderInfo(name, type, namespace, element_type)
        if mustUnderstand:
            headerinfo.mustUnderstand = 1
        self.outheaders.append(headerinfo)
        return headerinfo
367162
def add(self, name):
        '''
        
        '''
        if self.__current_section:
            self._flush_content()
        self.discard_current(name)
881335
public function addHeader()
    {
        if (ord($this->BUF[0]{10}) & 0x80) {
            $cmap = 3 * (2 << (ord($this->BUF[0]{10}) & 0x07));
            $this->GIF .= substr($this->BUF[0], 6, 7);
            $this->GIF .= substr($this->BUF[0], 13, $cmap);
            $this->GIF .= "!\377\13NETSCAPE2.0\3\1" . $this->word($this->LOP) . "\0";
        }
    }
220367
def add(self, header, data) :
		""""""
		if header[0] != '>' :
			self.data.append(('>'+header, data))
		else :
			self.data.append((header, data))
349285
def add_jsfile_head(self, src: str) -> None:
        """"""
        self.head.appendChild(Script(src=src))
1246698
def add_header(self, name, value):
        
        self._headers.setdefault(_hkey(name), []).append(_hval(value))
1060198
protected function addServiceConfigurationToHead()
    {
        // Add pz2urlrecipe.js to <head> if URL recipes are to be used.
        $scriptTag = new TagBuilder('script');
        $scriptTag->addAttribute('type', 'text/javascript');
        $scriptTag->addAttribute('src', $this->conf['pz2urlrecipeJSPath']);
        $scriptTag->forceClosingTag(true);
        $this->response->addAdditionalHeaderData($scriptTag->render());

        // Add Service Proxy configuration to <head> before pz2.js is included.
        $jsVariables = [
                'useServiceProxy' => 'true',
                'serviceProxyAuthPath' => json_encode($this->conf['serviceProxyAuthPath']),
                'pazpar2Path' => json_encode($this->conf['serviceProxyPath'])
        ];

        $jsCommand = "\n";
        foreach ($jsVariables as $name => $value) {
            $jsCommand .= $name . ' = ' . $value . ";\n";
        }

        $scriptTag = new TagBuilder('script');
        $scriptTag->addAttribute('type', 'text/javascript');
        $scriptTag->setContent($jsCommand);
        $this->response->addAdditionalHeaderData($scriptTag->render());
    }
78489
protected void addNavLinks(boolean header, Content htmlTree) {
        if (!configuration.nonavbar) {
            Content tree = (configuration.allowTag(HtmlTag.NAV))
                    ? HtmlTree.NAV()
                    : htmlTree;
            String allClassesId = "allclasses_";
            HtmlTree navDiv = new HtmlTree(HtmlTag.DIV);
            fixedNavDiv.addStyle(HtmlStyle.fixedNav);
            Content skipNavLinks = configuration.getContent("doclet.Skip_navigation_links");
            if (header) {
                fixedNavDiv.addContent(HtmlConstants.START_OF_TOP_NAVBAR);
                navDiv.addStyle(HtmlStyle.topNav);
                allClassesId += "navbar_top";
                Content a = getMarkerAnchor(SectionName.NAVBAR_TOP);
                //WCAG - Hyperlinks should contain text or an image with alt text - for AT tools
                navDiv.addContent(a);
                Content skipLinkContent = HtmlTree.DIV(HtmlStyle.skipNav, getHyperLink(
                    getDocLink(SectionName.SKIP_NAVBAR_TOP), skipNavLinks,
                    skipNavLinks.toString(), ""));
                navDiv.addContent(skipLinkContent);
            } else {
                tree.addContent(HtmlConstants.START_OF_BOTTOM_NAVBAR);
                navDiv.addStyle(HtmlStyle.bottomNav);
                allClassesId += "navbar_bottom";
                Content a = getMarkerAnchor(SectionName.NAVBAR_BOTTOM);
                navDiv.addContent(a);
                Content skipLinkContent = HtmlTree.DIV(HtmlStyle.skipNav, getHyperLink(
                    getDocLink(SectionName.SKIP_NAVBAR_BOTTOM), skipNavLinks,
                    skipNavLinks.toString(), ""));
                navDiv.addContent(skipLinkContent);
            }
            if (header) {
                navDiv.addContent(getMarkerAnchor(SectionName.NAVBAR_TOP_FIRSTROW));
            } else {
                navDiv.addContent(getMarkerAnchor(SectionName.NAVBAR_BOTTOM_FIRSTROW));
            }
            HtmlTree navList = new HtmlTree(HtmlTag.UL);
            navList.addStyle(HtmlStyle.navList);
            navList.addAttr(HtmlAttr.TITLE,
                            configuration.getText("doclet.Navigation"));
            if (configuration.createoverview) {
                navList.addContent(getNavLinkContents());
            }
            if (configuration.showModules) {
                if (configuration.modules.size() == 1) {
                    navList.addContent(getNavLinkModule(configuration.modules.first()));
                } else if (!configuration.modules.isEmpty()) {
                    navList.addContent(getNavLinkModule());
                }
            }
            if (configuration.packages.size() == 1) {
                navList.addContent(getNavLinkPackage(configuration.packages.first()));
            } else if (!configuration.packages.isEmpty()) {
                navList.addContent(getNavLinkPackage());
            }
            navList.addContent(getNavLinkClass());
            if(configuration.classuse) {
                navList.addContent(getNavLinkClassUse());
            }
            if(configuration.createtree) {
                navList.addContent(getNavLinkTree());
            }
            if(!(configuration.nodeprecated ||
                     configuration.nodeprecatedlist)) {
                navList.addContent(getNavLinkDeprecated());
            }
            if(configuration.createindex) {
                navList.addContent(getNavLinkIndex());
            }
            if (!configuration.nohelp) {
                navList.addContent(getNavLinkHelp());
            }
            navDiv.addContent(navList);
            Content aboutDiv = HtmlTree.DIV(HtmlStyle.aboutLanguage, getUserHeaderFooter(header));
            navDiv.addContent(aboutDiv);
            if (header) {
                fixedNavDiv.addContent(navDiv);
            } else {
                tree.addContent(navDiv);
            }
            Content ulNav = HtmlTree.UL(HtmlStyle.navList, getNavLinkPrevious(), getNavLinkNext());
            Content subDiv = HtmlTree.DIV(HtmlStyle.subNav, ulNav);
            if (configuration.frames) {
                Content ulFrames = HtmlTree.UL(HtmlStyle.navList,
                    getNavShowLists(), getNavHideLists(filename));
                subDiv.addContent(ulFrames);
            }
            HtmlTree ulAllClasses = HtmlTree.UL(HtmlStyle.navList, getNavLinkClassIndex());
            ulAllClasses.addAttr(HtmlAttr.ID, allClassesId);
            subDiv.addContent(ulAllClasses);
            if (header && configuration.createindex) {
                HtmlTree inputText = HtmlTree.INPUT("text", "search");
                HtmlTree inputReset = HtmlTree.INPUT("reset", "reset");
                Content searchTxt = new ContentBuilder();
                searchTxt.addContent(configuration.getContent("doclet.search"));
                searchTxt.addContent(Contents.SPACE);
                HtmlTree liInput = HtmlTree.LI(HtmlTree.SPAN(searchTxt));
                liInput.addContent(inputText);
                liInput.addContent(inputReset);
                HtmlTree ulSearch = HtmlTree.UL(HtmlStyle.navListSearch, liInput);
                subDiv.addContent(ulSearch);
            }
            subDiv.addContent(getAllClassesLinkScript(allClassesId));
            addSummaryDetailLinks(subDiv);
            if (header) {
                subDiv.addContent(getMarkerAnchor(SectionName.SKIP_NAVBAR_TOP));
                fixedNavDiv.addContent(subDiv);
                fixedNavDiv.addContent(HtmlConstants.END_OF_TOP_NAVBAR);
                tree.addContent(fixedNavDiv);
                HtmlTree paddingDiv = HtmlTree.DIV(HtmlStyle.navPadding, Contents.SPACE);
                tree.addContent(paddingDiv);
                HtmlTree scriptTree = HtmlTree.SCRIPT();
                String scriptCode = "<!--\n"
                        + "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
                        + "//-->\n";
                RawHtml scriptContent = new RawHtml(scriptCode.replace("\n", DocletConstants.NL));
                scriptTree.addContent(scriptContent);
                tree.addContent(scriptTree);
            } else {
                subDiv.addContent(getMarkerAnchor(SectionName.SKIP_NAVBAR_BOTTOM));
                tree.addContent(subDiv);
                tree.addContent(HtmlConstants.END_OF_BOTTOM_NAVBAR);
            }
            if (configuration.allowTag(HtmlTag.NAV)) {
                htmlTree.addContent(tree);
            }
        }
    }
205873
public function AddHeader($header_name, &$content, $subdir="includes")
    {
        if($subdir)
        {
            $subdir = trim($subdir, "\\/") . "/";
            
            if(!file_exists($this->output_path . $subdir))
                \Peg\Lib\Utilities\FileSystem::MakeDir(
                    $this->output_path . $subdir, 
                    0755, 
                    true
                );
        }
        
        $header = $this->output_path 
            . $subdir
            . $this->GetHeaderNamePHP($header_name)
        ;
        
        \Peg\Lib\Utilities\FileSystem::WriteFileIfDifferent($header, $content);
    }
213972
public function setup_on_after_setup_theme() {

		$this->_the_content_priority = absint( apply_filters( 'hogan/the_content_priority', 10 ) );

		// Append Flexible Content modules to the_content.
		add_filter( 'the_content', [ $this, 'append_modules_content' ], $this->_the_content_priority, 1 );

		// Index modules as post content in SearchWP.
		if ( true === apply_filters( 'hogan/searchwp/index_modules_as_post_content', true ) ) {
			add_filter( 'searchwp_pre_set_post', [ $this, 'populate_post_content_for_indexing' ] );
		}

		add_filter( 'acf/fields/wysiwyg/toolbars', [ $this, 'append_hogan_wysiwyg_toolbar' ] );
		add_filter( 'tiny_mce_before_init', [ $this, 'override_tinymce_settings' ] );

		if ( true === apply_filters( 'hogan/flexible_content_layouts_collapsed_by_default', false ) && is_admin() ) {
			add_action( 'acf/input/admin_footer', [ $this, 'append_footer_script_for_collapsed_flexible_content_layouts' ] );
		};

		add_filter( 'acf/fields/flexible_content/layout_title', [ $this, 'extend_layout_titles' ], 10, 3 );

	}
1025529
public ResponseBuilder addDirective(Directive directive) {
        if (directiveList == null) {
            directiveList = new ArrayList<>();
        }
        directiveList.add(directive);

        return this;
    }
263071
protected function addServiceConfigurationToHead()
    {
        $jsCommand = PHP_EOL . 'my_serviceID = ' . json_encode($this->conf['serviceID']) . ';' . PHP_EOL;
        if ($this->getPazpar2Path()) {
            $jsCommand .= 'pazpar2Path = ' . json_encode($this->getPazpar2Path()) . ';' . PHP_EOL;
        }

        /** @var TagBuilder $scriptTag */
        $scriptTag = new TagBuilder('script');
        $scriptTag->addAttribute('type', 'text/javascript');
        $scriptTag->setContent($jsCommand);
        $this->response->addAdditionalHeaderData($scriptTag->render());
    }
522934
private function directives() : void
  {
    Using::$engine      = config('view.engine');
    Using::$views       = config('app.dir') . config('view.views');

    Partial::$views     = config('app.dir') . config('view.views');
    Partial::$extension = config('view.extension');
  }
654317
protected function addResourcesToHead()
    {
        // Add pazpar2.css to <head>.

        /** @var TagBuilder $cssTag */
        $cssTag = new TagBuilder('link');
        $cssTag->addAttribute('rel', 'stylesheet');
        $cssTag->addAttribute('type', 'text/css');
        $cssTag->addAttribute('href', $this->conf['CSSPath']);
        $cssTag->addAttribute('media', 'all');
        $this->response->addAdditionalHeaderData($cssTag->render());

        $this->addServiceConfigurationToHead();

        // Add pz2.js to <head>.
        // This is Indexdata’s JavaScript that ships with the pazpar2 software.

        /** @var TagBuilder $scriptTag */
        $scriptTag = new TagBuilder('script');
        $scriptTag->addAttribute('type', 'text/javascript');
        $scriptTag->addAttribute('src', $this->conf['pz2JSPath']);
        $scriptTag->forceClosingTag(true);
        $this->response->addAdditionalHeaderData($scriptTag->render());

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

        // Create additional settings that are needed by pz-client.js.
        $jsVariables = [
                'useGoogleBooks' => (($this->conf['useGoogleBooks']) ? 'true' : 'false'),
                'useMaps' => (($this->conf['useMaps']) ? 'true' : 'false'),
                'useZDB' => (($this->conf['useZDB']) ? 'true' : 'false'),
                'ZDBUseClientIP' => ((!$this->conf['ZDBIP']) ? 'true' : 'false'),
                'useHistogramForYearFacets' => (($this->conf['useHistogramForYearFacets'] == '1') ? 'true' : 'false'),
                'provideCOinSExport' => (($this->conf['provideCOinSExport']) ? 'true' : 'false'),
                'showExportLinksForEachLocation' => (($this->conf['showExportLinksForEachLocation']) ? 'true' : 'false'),
                'showKVKLink' => (($this->conf['showKVKLink']) ? 'true' : 'false'),
                'useKeywords' => (($this->conf['useKeywords']) ? 'true' : 'false')
        ];
        if (array_key_exists('exportFormats', $this->conf)) {
            $exportFormats = [];
            foreach ($this->conf['exportFormats'] as $format => $value) {
                if ($value) {
                    $exportFormats[] = $format;
                }
            }
            $jsVariables['exportFormats'] = json_encode($exportFormats);
        }
        if ($this->conf['siteName']) {
            $jsVariables['siteName'] = json_encode($this->conf['siteName']);
        }
        if ($this->conf['sortOrder']) {
            $jsVariables['displaySort'] = json_encode(array_values(array_filter($this->conf['sortOrder'])));
        }
        if ($this->conf['termLists']) {
            $jsVariables['termLists'] = json_encode($this->conf['termLists']);
        }
        if ($this->conf['autocompleteURLs']) {
            $jsVariables['autocompleteURLs'] = json_encode($this->conf['autocompleteURLs']);
        }
        if ($this->conf['autocompleteSetupFunction']) {
            $jsVariables['autocompleteSetupFunction'] = $this->conf['autocompleteSetupFunction'];
        }

        $jsCommand = "\n";
        foreach ($jsVariables as $name => $value) {
            $jsCommand .= $name . ' = ' . $value . ";\n";
        }

        // Set up JavaScript function that is called by nkwgok if asked to do so.
        if ($this->conf['triggeredByNKWGOK']) {
            $jsCommand .= 'var nkwgokItemSelected = function (element) {
	var searchTerm = element.getAttribute("query");
	if (searchTerm) {
		triggerSearchForForm(undefined, ["(" +  searchTerm + ")"]);
	}
}
';
        }

        // Add the JavaScript setup commands to <head>.

        /** @var TagBuilder $scriptTag */
        $scriptTag = new TagBuilder('script');
        $scriptTag->addAttribute('type', 'text/javascript');
        $scriptTag->setContent($jsCommand);
        $this->response->addAdditionalHeaderData($scriptTag->render());

        // Load flot graphing library if needed.
        if ($this->conf['useHistogramForYearFacets']) {
            /** @var TagBuilder $scriptTag */
            $scriptTag = new TagBuilder('script');
            $scriptTag->addAttribute('type', 'text/javascript');
            $scriptTag->addAttribute('src', $this->conf['flotJSPath']);
            $scriptTag->forceClosingTag(true);
            $this->response->addAdditionalHeaderData($scriptTag->render());

            /** @var TagBuilder $scriptTag */
            $scriptTag = new TagBuilder('script');
            $scriptTag->addAttribute('type', 'text/javascript');
            $scriptTag->addAttribute('src', $this->conf['flotSelectionJSPath']);
            $scriptTag->forceClosingTag(true);
            $this->response->addAdditionalHeaderData($scriptTag->render());
        }

        // Make jQuery initialise pazpar2 when the DOM is ready.
        $jsCommand = "jQuery(document).ready(pz2ClientDomReady);\n";

        // Add Google Books support if asked to do so.
        if ($this->conf['useGoogleBooks'] || $this->conf['useMaps']) {
            // Structurally this might be better in a separate extension?
            /** @var TagBuilder $scriptTag */
            $scriptTag = new TagBuilder('script');
            $scriptTag->addAttribute('type', 'text/javascript');
            $scriptTag->addAttribute('src', 'https://www.google.com/jsapi');
            $scriptTag->forceClosingTag(true);
            $this->response->addAdditionalHeaderData($scriptTag->render());

            if ($this->conf['useGoogleBooks']) {
                $jsCommand .= "google.load('books', '0');\n";
            }
        }

        // Write custom localisations to pz2-client.js’ localisation array $localisationOverrides;
        if (VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) < 6000000) {
            // TYPO3 4: read from TSFE (ugly)
            $localisationOverrides = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_pazpar2.']['_LOCAL_LANG.'];
        } else {
            // TYPO3 6+: use configuration manager
            $configFramework = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK, 'pazpar2');
            $localisationOverrides = $configFramework['_LOCAL_LANG'];
        }
        if ($localisationOverrides) {
            foreach ($localisationOverrides as $languageCode => $dictionary) {
                // remove '.' from language codes (only appear when using TYPO3 4)
                $cleanLanguageCode = str_replace('.', '', $languageCode);

                foreach ($dictionary as $key => $localisedString) {
                    $jsCommand .= 'overrideLocalisation(' . json_encode($cleanLanguageCode) . ', '
                            . json_encode($key) . ', '
                            . json_encode($localisedString) . ");\n";
                }
            }
        }

        // Add further JavaScript initialisation commands to <head>.
        /** @var TagBuilder $scriptTag */
        $scriptTag = new TagBuilder('script');
        $scriptTag->addAttribute('type', 'text/javascript');
        $scriptTag->setContent($jsCommand);
        $this->response->addAdditionalHeaderData($scriptTag->render());
    }
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();
	}