Get Page theme layout

@param $pageThemeId

@return array
496741
public function getPageThemeLayout($pageThemeId)
    {
        /** @var $themeModel \PageBuilder\Model\PageTemplateModel */
        $themeModel = $this->getServiceLocator()->get('pagebuilder\model\pageTheme');

        $pageTheme = $themeModel->findObject($pageThemeId);

        return $this->getPageLayout($pageTheme->getPageId()->getId(), $pageTheme->getThemeId()->getId());
    }
1065548
public static function getByID($arLayoutID)
    {
        $db = Database::connection();
        $row = $db->GetRow('select arLayoutID, arLayoutIsPreset, arLayoutUsesThemeGridFramework from AreaLayouts where arLayoutID = ?', array($arLayoutID));
        if (is_array($row) && $row['arLayoutID']) {
            if ($row['arLayoutUsesThemeGridFramework']) {
                $al = new ThemeGridLayout();
            } elseif ($row['arLayoutIsPreset']) {
                $al = new PresetLayout();
            } else {
                $al = new CustomLayout();
            }
            $al->setPropertiesFromArray($row);
            $al->loadDetails();
            $al->loadColumnNumber();

            return $al;
        }
    }
722724
public function getTheme($themeId, $fields = ['name', 'slug', 'url'])
    {
        $apiUrl = $this->getEndpoint('themes');
        $apiUrl .= $themeId;

        $params = array(
            'fields' => implode(',', $fields)
        );

        $apiData = $this->apiGet($apiUrl, $params);

        return $this->decodeSingle($apiData);
    }
734519
protected function getConfigByTheme(array $config, $themeId = null)
    {
        if (null === $themeId) {
            $themeService = $this->getServiceLocator()->get(ThemeService::SERVICE_ID);
            $themeId = $themeService->getCurrentThemeId();
        }
        if (is_array(reset($config))) {
            if (array_key_exists($themeId, $config)) {
                $config = $config[$themeId];
            } else {
                $config = array_shift($config);
            }
        }
        return $config;
    }
890779
public function getThemeRegionConfig($theme)
    {
        $regions = variable_get('ucms_layout_regions_' . $theme, []);

        if (null === $regions) {
            $regions = array_keys(system_region_list($theme));
            $regions = array_fill_keys($regions, self::CONTEXT_PAGE);
        }

        return array_map('intval', $regions);
    }
1105543
private function get_current_post_layouts( \WP_Post $post ) : array {

		$key = 'post-' . $post->ID;

		if ( ! array_key_exists( $key, $this->_current_layouts ) || empty( $this->_current_layouts[ $key ] ) ) {

			// Initial creation if key is does not exists.
			$this->_current_layouts[ $key ] = [];

			foreach ( $this->_field_groups as $field_group ) {

				// Get post Hogan layouts/content for field group.
				$layouts = get_field( 'hogan_' . $field_group . '_modules_name', $post );

				if ( is_array( $layouts ) && ! empty( $layouts ) ) {
					// Merge layouts/content from field group.
					$this->_current_layouts[ $key ] = array_merge( $this->_current_layouts[ $key ], $layouts );
				}
			}
		}

		return $this->_current_layouts[ $key ];
	}
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);
    }
529022
public function strip($pageContent, $wrap)
    {
        $pattern = '/'.$wrap.'(.*?)'.$wrap.'/s';
        $match = preg_match($pattern, $pageContent, $matches);

        if ($match) {
            $page['config'] = $matches[1];
            $page['content'] = str_replace($matches[0], '', $pageContent);
            return $page;
        }

        return array('config' => '', 'content' => $pageContent);
    }
768067
public function getLayoutTemplate(string $context = ViewInterface::CONTEXT_DEFAULT): ?string
    {
        $layoutView = $this->buildLayoutView($context);
        if (!$layoutView instanceof LayoutViewInterface) {
            return $this->getPageLayoutTemplate();
        }

        return $layoutView->getTemplate();
    }
1320962
public function findTranslationOverlaysByPageId(int $pageId) : array
    {
        $queryBuilder = $this->getQueryBuilder();
        $queryBuilder->getRestrictions()->removeAll();
        $queryBuilder->getRestrictions()->add(GeneralUtility::makeInstance(DeletedRestriction::class));

        return $queryBuilder
            ->select('pid', 'l10n_parent', 'sys_language_uid')
            ->from('pages')
            ->add('where',
                $queryBuilder->expr()->eq('l10n_parent', $queryBuilder->createNamedParameter($pageId, \PDO::PARAM_INT))
                . BackendUtility::BEenableFields('pages')
            )->execute()->fetchAll();

    }
733012
public function getTheme()
    {
		if ($this->_theme === null)
		{
			$tname = str_replace( THEME_DIR.'/', '', $this->templateDir );
			if ($tname) {
				$theme = Theme::find($tname);
				if ($theme) $theme->loadConfig($this);				
				$this->_theme = $theme;
			} else {
				$this->_theme = false;
			}
		}
		return $this->_theme;
    }
300956
protected function getThemeAssistantStylesheet()
	{
		if (!$GLOBALS['objPage'] || !$GLOBALS['objPage']->getRelated('layout')) {
			return null;
		}
		if (!$stylesheets = $GLOBALS['objPage']->getRelated('layout')->external) {
			return null;
		}

		$stylesheets = \StringUtil::deserialize($stylesheets);
		foreach ($stylesheets as $stylesheet) {
			$file = \FilesModel::findByUuid($stylesheet);
			if ($file && $file->path && file_exists(TL_ROOT . '/' . $file->path . '.base')) {
				return $file->path . '.base';
			}
		}

		return null;
	}
701492
protected function _get_page_template_files() {
		$page_template_files = [];

		foreach ( WP_View_Controller\Helper\config( 'page-templates' ) as $page_template_dir ) {
			foreach ( glob( get_theme_file_path( $page_template_dir . '/*' ) ) as $page_template_path ) {
				$name = basename( $page_template_path, '.php' );
				if ( 'blank' === $name || 'blank-fluid' === $name ) {
					continue;
				}
				if ( isset( $page_template_files[ $name ] ) ) {
					continue;
				}
				$page_template_files[ $name ] = $page_template_path;
			}
		}

		return $page_template_files;
	}
640254
public function pageTheme()
	        {


		view()->composer("*", function ($view) {

			/* get the theme if set in config */
			$theme = config("pagekit.theme", null);

			/* if not theme is set in the config */

			/* check the theme folder if exist or use the theme in package*/
			if (!$theme):
			                    if (view()->exists("theme.page.index")):
			                        $theme = "theme.page.";
			else :
			                        $theme = "page::";
			endif;
			endif;

			view()->share('pageTheme', $theme);

		}
		);

	}
159210
public function getLayoutOptions()
    {
        if (!($theme = Theme::getEditTheme())) {
            throw new ApplicationException(Lang::get('cms::lang.theme.edit.not_found'));
        }

        $layouts = Layout::listInTheme($theme, true);
        $result = [];
        $result[null] = Lang::get('cms::lang.page.no_layout');

        foreach ($layouts as $layout) {
            $baseName = $layout->getBaseFileName();

            if (FileDefinitions::isPathIgnored($baseName)) {
                continue;
            }

            $result[$baseName] = strlen($layout->name) ? $layout->name : $baseName;
        }

        return $result;
    }
344501
protected function getWrappedTemplate()
	{
		$this->attributes['style']['width']    = '100%';
		$this->attributes['style']['height']   = '100%';
		$this->attributes['style']['position'] = 'absolute';
		$this->attributes['style']['left']     = '0';

		$outerStyle = 'display:inline-block;width:100%;max-width:' . $this->attributes['width'] . 'px';
		$innerStyle = 'display:block;overflow:hidden;position:relative;' . $this->getResponsivePadding();

		$template  = '<span>' . $this->generateAttributes(['style' => $outerStyle]);
		$template .= '<span>' . $this->generateAttributes(['style' => $innerStyle]);
		$template .= $this->getContentTemplate();
		$template .= '</span></span>';

		return $template;
	}
84215
public function getAdminThemeService()
    {
        if (null === $this->adminActionService) {
            $this->adminActionService = $this->getServiceLocator()->get('playgrounddesign_theme_service');
        }

        return $this->adminActionService;
    }