Retrieves the complete TypoScript setup for the current page as a nested
array.

@return array the TypoScriptSetup for the current page, will be empty if
no page is selected or if the TS setup of the page is empty
429750
private function getCompleteTypoScriptSetup()
    {
        $pageUid = \Tx_Oelib_PageFinder::getInstance()->getPageUid();
        if ($pageUid === 0) {
            return [];
        }

        if ($this->existsFrontEnd()) {
            return $this->getFrontEndController()->tmpl->setup;
        }

        /** @var TemplateService $template */
        $template = GeneralUtility::makeInstance(TemplateService::class);
        $template->tt_track = 0;
        $template->init();

        /** @var PageRepository $page */
        $page = GeneralUtility::makeInstance(PageRepository::class);
        $rootline = $page->getRootLine($pageUid);
        $template->runThroughTemplates($rootline, 0);
        $template->generateConfig();

        return $template->setup;
    }
411514
function _getRequiredLanguages() {
		$languages = get_option( 'pressbooks_global_typography', [] );
		$book_lang = $this->_getBookLanguage();

		if ( ! empty( $book_lang ) ) {
			$languages[] = $book_lang;
		}

		if ( is_array( $this->getThemeSupportedLanguages() ) ) {
			$languages = array_unique(
				array_merge( $languages, $this->getThemeSupportedLanguages() )
			);
		}

		return $languages;
	}
1256223
public static function getValidClassPrefixes() {
		$validPrefixes = array('tx_', 'Tx_', 'user_', 'User_');
		if (
			isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['additionalAllowedClassPrefixes'])
			&& is_string($GLOBALS['TYPO3_CONF_VARS']['SYS']['additionalAllowedClassPrefixes'])
		) {
			$validPrefixes = array_merge(
				$validPrefixes,
				t3lib_div::trimExplode(',', $GLOBALS['TYPO3_CONF_VARS']['SYS']['additionalAllowedClassPrefixes'])
			);
		}
		return $validPrefixes;
	}
974469
public function get_scripts()
    {
        if (!$this->list) {

            if (!$this->sieve)
                return $this->_set_error(self::ERROR_INTERNAL);

            $list = $this->sieve->listScripts($active);

            if (is_a($list, 'PEAR_Error')) {
                return $this->_set_error(self::ERROR_OTHER);
            }

            $this->list   = $list;
            $this->active = $active;
        }

        return $this->list;
    }
861174
public function getCreateScript() {
        static::$includeScripts = true;

        $text = '<script>';
        $text .= 'editors = ( typeof editors != "undefined" && editors instanceof Array ) ? editors : [];';
        $text .= 'editors.push({';
        $text .= 'name: "' . $this->name . '",';
        $text .= 'stylesheets: ' . json_encode($this->stylesheets) . ',';

        foreach($this->options as $key => $value) {
            $text .= $key . ': "' . $value . '",';
        }

        $text .= '});</script>';

        return $text;
    }
1107270
public function getFormElements()
    {
        $sm = $this->getServiceLocator();
        $formElements = array();
        $placeholders = $this->getPlaceholderParameters();
        $replacePlaceholderWithValues = array();
        foreach ($this->formElements as $element) {
            // Remove form element if it is available in the remove list
            if (in_array($element['name'], $this->removeElements)) {
                continue;
            }
            $formElement = $this->formatFormElement($element);
            // Replace placeholder with default values
            $replacePlaceholderWithValues = $sm->get($this->moduleService)->defaultConfig('placeholder');
            // Replace placeholder with global form values
            if (!empty($placeholders) && is_array($placeholders)) {
                // Replace placeholder with global values
                if (array_key_exists('global', $placeholders) &&  !empty($placeholders['global']) &&  is_array($placeholders['global'])) {
                    $replacePlaceholderWithValues = array_merge($replacePlaceholderWithValues, $placeholders['global']);
                }
                // Replace placeholder with element form values
                if (array_key_exists('element', $placeholders) &&  !empty($placeholders['element']) &&  is_array($placeholders['element'])) {
                    if (array_key_exists($element['name'], $placeholders['element'])) {
                        $replacePlaceholderWithValues = array_merge($replacePlaceholderWithValues, $placeholders['element'][$element['name']]);
                    }
                }
            }
            $formElement = $this->searchAndReplacePlaceHolders($formElement, $replacePlaceholderWithValues);
            $formElements[] = $formElement;
        }
        return $formElements;
    }
351595
protected function compileTableFooter()
    {
        $footer = [];
        foreach ($this->collection->all() as $row) {
            if (is_array($row->footer)) {
                $footerAttr = $this->html->attributes(array_only($row->footer,
                    ['class', 'id', 'title', 'width', 'style', 'data-class', 'data-hide']));
                $title = isset($row->footer['title']) ? $row->footer['title'] : '';
                $footer[] = '<th ' . $footerAttr . '>' . $title . '</th>';
            } else {
                $footer[] = '<th>' . $row->footer . '</th>';
            }
        }

        return $footer;
    }
544172
protected function getInput()
	{
		// Initialize variables.
		$html = array();
		$groups = $this->getGroups();
		$excluded = $this->getExcluded();
		$link = 'index.php?option=com_members&amp;layout=modal&amp;tmpl=component&amp;field=' . $this->id
			. (isset($groups) ? ('&amp;groups=' . base64_encode(json_encode($groups))) : '')
			. (isset($excluded) ? ('&amp;excluded=' . base64_encode(json_encode($excluded))) : '');

		// Initialize some field attributes.
		$attr  = $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : '';
		$attr .= $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : '';

		// Initialize JavaScript field attributes.
		$onchange = (string) $this->element['onchange'];

		// Load the modal behavior script.
		Behavior::modal('a.modal_' . $this->id);

		// Build the script.
		$script = array();
		$script[] = '	function jSelectUser_' . $this->id . '(id, title) {';
		$script[] = '		var old_id = document.getElementById("' . $this->id . '_id").value;';
		$script[] = '		if (old_id != id) {';
		$script[] = '			document.getElementById("' . $this->id . '_id").value = id;';
		$script[] = '			document.getElementById("' . $this->id . '_name").value = title;';
		$script[] = '			' . $onchange;
		$script[] = '		}';
		$script[] = '		$.fancybox.close();';
		$script[] = '	}';

		// Add the script to the document head.
		App::get('document')->addScriptDeclaration(implode("\n", $script));

		// Load the current username if available.
		if ($this->value)
		{
			$model = UserModel::oneOrNew($this->value);
		}
		else
		{
			$model = UserModel::blank();
			$model->set('name', App::get('language')->txt('JLIB_FORM_SELECT_USER'));
		}

		// Create a dummy text field with the user name.
		//$html[] = '<div class="fltlft">';
		if ($this->element['readonly'] != 'true')
		{
			$html[] = '<div class="input-modal">';
			$html[] = '<span class="input-cell">';
		}
		$html[] = '	<input type="text" id="' . $this->id . '_name"' . ' value="' . htmlspecialchars($model->get('name'), ENT_COMPAT, 'UTF-8') . '" disabled="disabled"' . $attr . ' />';

		// Create the user select button.
		if ($this->element['readonly'] != 'true')
		{
			$html[] = '</span><span class="input-cell">';
			$html[] = '		<a class="button modal_' . $this->id . '" title="' . App::get('language')->txt('JLIB_FORM_CHANGE_USER') . '"' . ' href="' . $link . '" rel="{handler: \'iframe\', size: {x: 800, y: 500}}">';
			$html[] = '			' . App::get('language')->txt('JLIB_FORM_CHANGE_USER') . '</a>';
			$html[] = '</span></div>';
		}

		// Create the real field, hidden, that stored the user id.
		$html[] = '<input type="hidden" id="' . $this->id . '_id" name="' . $this->name . '" value="' . (int) $this->value . '" />';

		return implode("\n", $html);
	}
377281
public function getHtmlHeadEntrySet()
    {
        $set = parent::getHtmlHeadEntrySet();

        foreach ($this->action_items as $child_widget) {
            $set->addEntrySet($child_widget->getHtmlHeadEntrySet());
        }

        return $set;
    }
187767
protected function getPageButtonsArrayText()
    {
        if (empty($this->buttons)) {
            return Builder::getArray(array('' => 0), true);
        }
        $pageButtons = array();
        foreach ($this->buttons as $pageButton) {
            $pageButtons[$pageButton->getControl()
                                    ->getId()] = $pageButton->getPagingCount();
        }
        return Builder::getArray($pageButtons, true);
    }
472229
public static function get_page_templates() {
		static $wrappers = [];
		if ( $wrappers ) {
			return $wrappers;
		}

		$page_templates = new Model\Page_Templates();
		$wrappers = $page_templates->get();
		return $wrappers;
	}
1287226
public static function getThisUrl() {
		$p = parse_url(self::getIndpEnv('TYPO3_REQUEST_SCRIPT')); // Url of this script
		$dir = self::dirname($p['path']) . '/'; // Strip file
		$url = str_replace('//', '/', $p['host'] . ($p['port'] ? ':' . $p['port'] : '') . $dir);
		return $url;
	}
540770
public function toArray()
        {
            return array_merge(
                $this->getCustomProperties(),
                array(
                    'label'             => $this->getlabel(),
                    'fragment'          => $this->getFragment(),
                    'id'                => $this->getId(),
                    'class'             => $this->getClass(),
                    'title'             => $this->getTitle(),
                    'target'            => $this->getTarget(),
                    'accesskey'         => $this->getAccesskey(),
                    'rel'               => $this->getRel(),
                    'rev'               => $this->getRev(),
                    'customHtmlAttribs' => $this->getCustomHtmlAttribs(),
                    'order'             => $this->getOrder(),
                    'resource'          => $this->getResource(),
                    'privilege'         => $this->getPrivilege(),
                    'active'            => $this->isActive(),
                    'visible'           => $this->isVisible(),
                    'type'              => get_class($this),
                    'pages'             => parent::toArray()
                )
            );
        }
175422
public function getTemplateHtmlAndScript()
    {
        $html = '';
        $scripts = [];

        /* @var Field $field */
        foreach ($this->fields() as $field) {

            //when field render, will push $script to Merchant
            $html .= $field->render();

            /*
             * Get and remove the last script of Merchant::$script stack.
             */
            if ($field->getScript()) {
                $scripts[] = array_pop(Merchant::$script);
            }
        }

        return [$html, implode("\r\n", $scripts)];
    }
950671
public function getJavascripts()
    {
        $self = $this;
        $parse_javascripts = function ($params, $javascripts) use ($self) {
            foreach ($params as $js) {

                if (is_string($js)) {
                    $js = array(
                        'path'  => $js,
                    );
                } elseif (isset($js['route'])) {
                    $js = array(
                        'path'  => $self->getGenerator()
                                        ->getContainer()
                                        ->get('router')
                                        ->generate($js['route'], $js['routeparams'])
                    );
                }

                $javascripts[] = $js;
            }

            return $javascripts;
        };

        // From config.yml
        $javascripts = $parse_javascripts(
            $this->getGenerator()->getContainer()
                 ->getParameter('admingenerator.javascripts', array()), array()
        );

        // From generator.yml
        $javascripts = $parse_javascripts(
            $this->getVariable('javascripts', array()), $javascripts
        );

        return $javascripts;
    }
1079004
public function getGroupedHtml()
    {
        $name = $this->getNameInLayout();
        $htmlId = uniqid($name);

        $types = [];
        foreach ($this->_usedStorageTypes as $type) {
            $type = $this->getVarnishMessageModel()->getMessageTypeByStorage($type);
            if (!$type) {
                continue;
            }
            $types[] = $type;
        }

        return sprintf(
            $this->getMessageContainerFormat(),
            json_encode($htmlId),
            json_encode($this->getUrl('varnish/ajax/message', array(
                '_secure' => Mage::app()->getStore()->isCurrentlySecure()
            ))),
            json_encode($types),
            json_encode(EcomDev_Varnish_Model_Message::COOKIE_NAME),
            json_encode(array(
                'path' => Mage::getSingleton('core/cookie')->getPath(),
                'domain' => Mage::getSingleton('core/cookie')->getDomain()
            ))
        );
    }
494401
public function GetHtmlHeadIncludes()
    {
        $aIncludes = parent::GetHtmlHeadIncludes();
        if (!is_array($aIncludes)) {
            $aIncludes = array();
        }

        $this->LoadManufacturer();
        if (!is_null($this->oActiveManufacturer) && !empty($this->oActiveManufacturer->fieldCss)) {
            $aIncludes[] = '<link href="'.TGlobal::OutHTML($this->oActiveManufacturer->fieldCss).'" rel="stylesheet" type="text/css" />';
        }

        return $aIncludes;
    }