<commit_before><?php
defined('C5_EXECUTE') or die("Access Denied.");
$form = Loader::helper('form');
$ctArray = PageType::getList(false, $sitetype);
$pageSelector = Core::make('helper/form/page_selector');
$types = array('' => t('** Choose a page type'));
foreach ($ctArray as $cta) {
    $types[$cta->getPageTypeID()] = $cta->getPageTypeDisplayName();
}
$ptID = 0;
$factors = array('' => t('Select Menu'), 'sitemap_in_page' => t('In-Page Sitemap'));

if (is_object($pagetype) && $pagetype->getPageTypePublishTargetTypeID() == $type->getPageTypePublishTargetTypeID()) {
    $configuredTarget = $pagetype->getPageTypePublishTargetObject();
    $ptID = $configuredTarget->getPageTypeID();
    $startingPointPageID = $configuredTarget->getStartingPointPageID();
    $selectorFormFactor = $configuredTarget->getSelectorFormFactor();
}
?>
<div class="form-group">
	<?=$form->label('ptID', t('Publish Beneath Pages of Type'))?>
	<?=$form->select('ptID', $types, $ptID)?>
</div>

<div class="form-group">
	<?=$form->label('selectorFormFactorPageType', t('Selector Form Factor'))?>
	<?=$form->select('selectorFormFactorPageType', $factors, $selectorFormFactor)?>
</div>

<div class="form-group" data-page-type-form-factor-display="sitemap_in_page">
	<?=$form->label('startingPointPageIDPageType', t('Display Pages Beneath Page'))?>
	<?=$pageSelector->selectPage('startingPointPageIDPageType', $startingPointPageID)?>
</div>

<script type="text/javascript">
	$(function() {<commit_msg>Avoid accessing undefined vars in page_types/target_types/page_type<commit_after><?php
defined('C5_EXECUTE') or die("Access Denied.");
$form = Loader::helper('form');
$ctArray = PageType::getList(false, $sitetype);
$pageSelector = Core::make('helper/form/page_selector');
$types = array('' => t('** Choose a page type'));
foreach ($ctArray as $cta) {
    $types[$cta->getPageTypeID()] = $cta->getPageTypeDisplayName();
}
$ptID = 0;
$factors = array('' => t('Select Menu'), 'sitemap_in_page' => t('In-Page Sitemap'));

if (isset($pagetype) && is_object($pagetype) && $pagetype->getPageTypePublishTargetTypeID() == $type->getPageTypePublishTargetTypeID()) {
    $configuredTarget = $pagetype->getPageTypePublishTargetObject();
    $ptID = $configuredTarget->getPageTypeID();
    $startingPointPageID = $configuredTarget->getStartingPointPageID();
    $selectorFormFactor = $configuredTarget->getSelectorFormFactor();
} else {
    if (!isset($startingPointPageID)) {
        $startingPointPageID = null;
    }
    if (!isset($selectorFormFactor)) {
        $selectorFormFactor = null;
    }
}
?>
<div class="form-group">
	<?=$form->label('ptID', t('Publish Beneath Pages of Type'))?>
	<?=$form->select('ptID', $types, $ptID)?>
</div>

<div class="form-group">
	<?=$form->label('selectorFormFactorPageType', t('Selector Form Factor'))?>
	<?=$form->select('selectorFormFactorPageType', $factors, $selectorFormFactor)?>
</div>

<div class="form-group" data-page-type-form-factor-display="sitemap_in_page">
	<?=$form->label('startingPointPageIDPageType', t('Display Pages Beneath Page'))?>
	<?=$pageSelector->selectPage('startingPointPageIDPageType', $startingPointPageID)?>
</div>

<script type="text/javascript">
	$(function() {
{'fraction_non_alphanumeric': 0.1997499218505783, 'fraction_numerical': 0.0012503907471084713, 'mean_word_length': 7.268733850129199, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 65, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2887798', 'n_tokens_mistral': 1081, 'n_tokens_neox': 1056, 'n_words': 179}