Return's the page layout for the passed page layout string.

@param string $pageLayout The page layout string to return the key for

@return integer The requested page layout
@throws \Exception Is thrown, if the requested page layout is not available
9034
public function getPageLayoutByValue($pageLayout)
    {

        // query whether or not, the requested display mode is available
        if (isset($this->availablePageLayouts[$pageLayout])) {
            return $this->availablePageLayouts[$pageLayout];
        }

        // throw an exception, if not
        throw new \Exception(printf('Found invalid page layout %s', $pageLayout));
    }
1241926
func (p *PageLayoutPaperSize) getPageLayout(ps *xlsxPageSetUp) {
	// Excel default: 1
	if ps == nil || ps.PaperSize == 0 {
		*p = 1
		return
	}
	*p = PageLayoutPaperSize(ps.PaperSize)
}
1105461
protected function getTitleForLayout()
    {
        if (!empty($this->titleForLayout)) {
            return $this->titleForLayout;
        }

        //Gets the main title setted by the configuration
        $title = getConfigOrFail('main.title');

        //For homepage, it returns only the main title
        if ($this->request->isUrl(['_name' => 'homepage'])) {
            return $title;
        }

        //If exists, it adds the title setted by the controller, as if it has
        //  been set via `$this->View->set()`
        if ($this->get('title')) {
            $title = sprintf('%s - %s', $this->get('title'), $title);
        //Else, if exists, it adds the title setted by the current view, as if
        //  it has been set via `$this->View->Blocks->set()`
        } elseif ($this->fetch('title')) {
            $title = sprintf('%s - %s', $this->fetch('title'), $title);
        }

        return $this->titleForLayout = $title;
    }
1092636
public function getById($layoutId)
    {
        $record = LayoutRecord::findOne(['id' => $layoutId]);

        if ($record) {
            return new LayoutModel($record->getAttributes());
        }

        return null;
    }
523160
public function exportFieldLayout($fieldLayout) {
        $fieldLayoutObj = [];
        $tabs = $fieldLayout->getTabs();
        usort($tabs, function($a, $b) {
            return $a->sortOrder > $b->sortOrder;
        });
        foreach ($tabs as $tab) {
            $fieldLayoutObj[$tab->name] = [];
            foreach ($tab->getFields() as $field) {
                array_push($fieldLayoutObj[$tab->name], $field->handle);
            }
        }
        return $fieldLayoutObj;
    }
833948
private function _writePageLayoutView(){
		$record	  = 0x088B;			   // Record identifier
		$length	  = 0x0010;			   // Bytes to follow

		$rt         = 0x088B; // 2
		$grbitFrt   = 0x0000; // 2
		$reserved   = 0x0000000000000000; // 8
		$wScalvePLV = $this->_phpSheet->getSheetView()->getZoomScale(); // 2

		// The options flags that comprise $grbit
		if($this->_phpSheet->getSheetView()->getView() == PHPExcel_Worksheet_SheetView::SHEETVIEW_PAGE_LAYOUT){
			$fPageLayoutView   = 1;
		} else {
			$fPageLayoutView   = 0;
		}
		$fRulerVisible     = 0;
		$fWhitespaceHidden = 0;

		$grbit      = $fPageLayoutView; // 2
		$grbit		|= $fRulerVisible	   << 1;
		$grbit		|= $fWhitespaceHidden  << 3;

		$header	  = pack("vv", $record, $length);
		$data	  = pack("vvVVvv", $rt, $grbitFrt, 0x00000000, 0x00000000, $wScalvePLV, $grbit);
		$this->_append($header . $data);
	}
859959
private function _readPageLayoutView(){
		$length = self::_GetInt2d($this->_data, $this->_pos + 2);
		$recordData = substr($this->_data, $this->_pos + 4, $length);

		// move stream pointer to next record
		$this->_pos += 4 + $length;

		//var_dump(unpack("vrt/vgrbitFrt/V2reserved/vwScalePLV/vgrbit", $recordData));

		// offset: 0; size: 2; rt
		//->ignore
		$rt = self::_GetInt2d($recordData, 0);
		// offset: 2; size: 2; grbitfr
		//->ignore
		$grbitFrt = self::_GetInt2d($recordData, 2);
		// offset: 4; size: 8; reserved
		//->ignore

		// offset: 12; size 2; zoom scale
		$wScalePLV = self::_GetInt2d($recordData, 12);
		// offset: 14; size 2; grbit
		$grbit = self::_GetInt2d($recordData, 14);

		// decomprise grbit
		$fPageLayoutView   = $grbit & 0x01;
		$fRulerVisible     = ($grbit >> 1) & 0x01; //no support
		$fWhitespaceHidden = ($grbit >> 3) & 0x01; //no support

		if ($fPageLayoutView === 1) {
			$this->_phpSheet->getSheetView()->setView(PHPExcel_Worksheet_SheetView::SHEETVIEW_PAGE_LAYOUT);
			$this->_phpSheet->getSheetView()->setZoomScale($wScalePLV); //set by Excel2007 only if SHEETVIEW_PAGE_LAYOUT
		}
		//otherwise, we cannot know whether SHEETVIEW_PAGE_LAYOUT or SHEETVIEW_PAGE_BREAK_PREVIEW.
	}
1175288
protected function GetOgonePaymentLayoutPage()
    {
        $sOgonePaymentLayoutSystemPage = trim($this->GetConfigParameter('layout_system_page'));
        $sOgonePaymentLayoutPageURL = false;
        if (!empty($sOgonePaymentLayoutSystemPage)) {
            $oShop = TdbShop::GetInstance();
            $sOgonePaymentLayoutPageURL = $oShop->GetLinkToSystemPage($sOgonePaymentLayoutSystemPage, null, true);
            $sOgonePaymentLayoutPageURL = str_replace('https://', '', $sOgonePaymentLayoutPageURL);
            $sOgonePaymentLayoutPageURL = str_replace('http://', '', $sOgonePaymentLayoutPageURL);
            $sOgonePaymentLayoutPageURL = 'https://'.$sOgonePaymentLayoutPageURL;
        }

        return $sOgonePaymentLayoutPageURL;
    }
744874
public function getPageLayout()
    {
        if ($page = $this->getCurrentPage(Page::class)) {
            return $page->getPageLayout();
        }
        
        return Page::create()->getPageLayout();
    }
1196355
protected function getLayout(string $layout = null): string
    {
        if ($layout === null) {
            $frontendBridgeComponentExists = isset($this->FrontendBridge);
            $layout = 'FrontendBridge.json_action';

            if ($frontendBridgeComponentExists) {
                $layout = $this->FrontendBridge->config('templatePaths.jsonAction');
            }

            if ($this->request->is('dialog')) {
                $layout = 'FrontendBridge.dialog_action';

                if ($frontendBridgeComponentExists) {
                    $layout = $this->FrontendBridge->config('templatePaths.dialogAction');
                }
            }
        }

        return $layout;
    }
1063623
func (f *File) GetPageLayout(sheet string, opts ...PageLayoutOptionPtr) error {
	s, err := f.workSheetReader(sheet)
	if err != nil {
		return err
	}
	ps := s.PageSetUp

	for _, opt := range opts {
		opt.getPageLayout(ps)
	}
	return err
}
889318
public static function getLayout()
	{
		if(self::$pageLayout === null)
		{
			global $objPage;

			if($objPage !== null)
			{
				self::$pageLayout = \LayoutModel::findByPk($objPage->layout);
			}
		}

		return self::$pageLayout;
	}
34453
public function getPageLayout($pageId, $pageThemeId = null)
    {
        $sections = $templateSections = [];
        $error    = '';
        $details  = [];

        /** @var $pageModel \PageBuilder\Model\PageModel */
        $pageModel = $this->getServiceLocator()->get('pagebuilder\model\page');

        /** @var $themeModel \PageBuilder\Model\BaseModel */
        $themeModel = $this->getServiceLocator()->get('pagebuilder\model\theme');

        /** @var $templateModel \PageBuilder\Model\BaseModel */
        $templateModel = $this->getServiceLocator()->get('pagebuilder\model\template');

        /** @var $page \PageBuilder\Entity\Page */
        if ($page = $pageModel->getRepository()->find($pageId)) {

            $details = [
                'id'          => $page->getId(),
                'title'       => $page->getTitle(),
                'description' => $page->getDescription(),
                'template'    => $page->getTemplate() ? $page->getTemplate()->getTitle() : '',
                'layout'      => '',
                'pageTheme'   => '',
                'themeId'     => '',
                'layoutType'  => 'Custom Layout',
                'parent'      => $page->getParent() ? $page->getParent()->getTitle() : '',

            ];
        }
        $themeId = $pageTheme = null;
        if ($pageThemeId) {
            /** @var $pageThemeModel \PageBuilder\Model\BaseModel */
            $pageThemeModel = $this->getServiceLocator()->get('pagebuilder\model\pageTheme');
            $pageTheme      = $pageThemeModel->findObject($pageThemeId);
            $themeId        = $pageTheme->getId();
        }

        if ($themeId and $pageTheme) {
            $details['themeId'] = $themeId;

            $details['layout']    = $pageTheme->getLayout();
            $details['pageTheme'] = $pageTheme->getId();

            /** @var $temp \PageBuilder\Entity\Template */
            if ($temp = $page->getTemplate()) {
                $sections = $temp->getTemplateSections()->toArray();
            } elseif ($temp = $page->getParent()->getTemplate()) {
                $sections = $temp->getTemplateSections()->toArray();
            }
        }
        /** @var $section \PageBuilder\Entity\Join\TemplateSection */
        foreach ($sections as $section) {
            $slug                    = $section->getSectionId()->getSlug();
            $templateSections[$slug] = [
                'title'  => $section->getSectionId()->getTitle(),
                'status' => $section->getIsActive() ? 1 : 0,
                'class'  => $section->getIsActive() ? '' : 'in-active',
            ];
        }

        if ($themeData = $themeModel->getRepository()->findAll()) {
            /** @var $theme \PageBuilder\Entity\Theme */
            foreach ($themeData as $theme) {
                $details['themes'][$theme->getId()] = $theme->toArray();
            }
        } else {
            $details['themes'] = [];
        }

        /** @var $templateModel \PageBuilder\Model\TemplateModel */
        $templates  = $templateModel->listTemplates();
        $components = $this->getServiceLocator()->get('pagebuilder\model\component')->listItemsByTitle();

        /** @var $widgetUtil \PageBuilder\Util\Widget */
        $widgetUtil = $this->getServiceLocator()->get('util\widget');

        $widgetList = $widgetUtil->getWidgetList();
        $urlHelper  = $this->getServiceLocator()->get('ViewHelperManager')->get('url');

        $return = [
            'error'     => $error,
            'page'      => $details,
            'editUrl'   => $pageThemeId
                ? $urlHelper('builder\theme', ['id' => $pageThemeId])
                : $urlHelper(
                    'builder', ['id' => $pageId]
                ),
            'sections'  => $templateSections,
            'title'     => 'Layout Manager - ' . ($page ? $page->getTitle() : ''),
            'widgets'   => [
                'title' => 'Widgets',
                'items' => $widgetUtil->getRegistry(),
                'total' => count($widgetUtil->getRegistry()),
                'list'  => $widgetList,
                'id'    => PageBuilder::LAYOUT_WIDGET,
            ],
            'assets'    => [
                PageBuilder::LAYOUT_USER_DEFINED => [
                    'title' => 'User Defined',
                    'items' => $components,
                ],
            ],
            'templates' => [
                'title' => 'Templates',
                'items' => $templates,
            ],
            'tags'      => $this->_getTaglist(),
        ];

        return $return;
    }
779853
public function createLayout(Layout $layout): Layout
    {
        $query = $this->connection->createQueryBuilder()
            ->insert('ngbm_layout')
            ->values(
                [
                    'id' => ':id',
                    'status' => ':status',
                    'type' => ':type',
                    'name' => ':name',
                    'description' => ':description',
                    'created' => ':created',
                    'modified' => ':modified',
                    'shared' => ':shared',
                    'main_locale' => ':main_locale',
                ]
            )
            ->setValue(
                'id',
                $layout->id !== null ?
                    (int) $layout->id :
                    $this->connectionHelper->getAutoIncrementValue('ngbm_layout')
            )
            ->setParameter('status', $layout->status, Type::INTEGER)
            ->setParameter('type', $layout->type, Type::STRING)
            ->setParameter('name', $layout->name, Type::STRING)
            ->setParameter('description', $layout->description, Type::STRING)
            ->setParameter('created', $layout->created, Type::INTEGER)
            ->setParameter('modified', $layout->modified, Type::INTEGER)
            ->setParameter('shared', $layout->shared, Type::BOOLEAN)
            ->setParameter('main_locale', $layout->mainLocale, Type::STRING);

        $query->execute();

        $layout->id = $layout->id ?? (int) $this->connectionHelper->lastInsertId('ngbm_layout');

        return $layout;
    }
786940
protected static function processSetLayout($html){
    $pattern = '~<p>LAYOUT:([\w_-]+):TUOYAL<\/p>~m';
    if( preg_match_all($pattern, $html, $matches, PREG_SET_ORDER) ){
      $layout = array_pop($matches);

      self::setLayout($layout[1]);

      $html = preg_replace($pattern, '', $html);
    }
    return $html;
  }
89221
public function setMiddleParagraphLayoutId( $layoutParagraphId = null )
    {
        $middleLayout = $this->middleLayoutModel
                             ->findMiddleParagraphLayoutById(
                                 $layoutParagraphId
                             );

        if ( ! empty( $middleLayout ) )
        {
            $controller = $this->getController();

            if ( ! method_exists( $controller, 'plugin' ) )
            {
                throw new Exception\LogicException(
                    'Controller used with paragraphLayout plugin must be pluggable'
                );
            }

            $controller->plugin( 'layout' )
                       ->setMiddleLayout( $middleLayout );
        }

        return $this;
    }
900268
static function LayoutTemplate(Layout $layout)
    {
        $folder = Path::Combine(PHINE_PATH, 'App/Phine/LayoutTemplates');
        $file = Path::Combine($folder, $layout->GetName());
        return Path::AddExtension($file, 'phtml');
    }