<commit_before><?php

namespace Concrete\Block\Autonav;

use Concrete\Core\Block\Block;
use Concrete\Core\Block\BlockController;
use Concrete\Core\Block\View\BlockView;
use Concrete\Core\Database\Connection\Connection;
use Concrete\Core\Entity\Block\BlockType\BlockType;
use Concrete\Core\Error\UserMessageException;
use Concrete\Core\Feature\Features;
use Concrete\Core\Feature\UsesFeatureInterface;
use Concrete\Core\Http\ResponseFactoryInterface;
use Concrete\Core\Page\Page;
use Concrete\Core\Permission\Checker;
use Doctrine\ORM\EntityManagerInterface;

defined('C5_EXECUTE') or die('Access Denied.');

/**
 * The controller for the Auto-Nav block.
 *
 * @package    Blocks
 * @subpackage Auto-Nav
 *
 * @author     <NAME> <<EMAIL>>
 * @author     <NAME>
 * @copyright  Copyright (c) 2003-2022 ConcreteCMS. (http://www.concretecms.org)
 * @license    http://www.concretecms.org/license/     MIT License
 */

class Controller extends BlockController implements UsesFeatureInterface
{
    /**
     * @var Page|null
     */
    public $collection;

    /**
     * @var NavItem[]
     */
    public $navArray = [];

    /**
     * @var int[]
     */
    public $cParentIDArray = [];

    /**
     * @var string
     */
    public $displayPages;

    /**
     * @var int|null
     */
    public $displayPagesCID;

    /**
     * @var int
     */
    public $displayPagesIncludeSelf;

    /**
     * @var string
     */
    public $displaySubPages;

    /**
     * @var string
     */
    public $displaySubPageLevels;

    /**
     * @var int
     */
    public $displaySubPageLevelsNum = 0;

    /**
     * @var string
     */
    public $orderBy;

    /**
     * @var int
     */
    public $displayUnavailablePages;

    /**
     * @var bool
     */
    public $haveRetrievedSelf = false;

    /**
     * @var bool
     */
    public $haveRetrievedSelfPlus1 = false;

    /**
     * @var bool
     */
    public $displayUnapproved = false;

    /**
     * @var bool
     */
    public $ignoreExcludeNav = false;

    /**
     * @var int|null
     */
    public $cParentID;

    /**
     * @var string[]
     */
    protected $helpers = ['form', 'validation/token', 'form/page_selector', 'concrete/ui'];

    /**
     * @var int|null
     */
    protected $homePageID;

    /**
     * @var string
     */
    protected $btTable = 'btNavigation';

    /**
     * @var int
     */
    protected $btInterfaceWidth = 700;

    /**
     * @var int
     */
    protected $btInterfaceHeight = 525;

    /**
     * @var bool
     */
    protected $btCacheBlockRecord = true;

    /**
     * @var bool
     */
    protected $btCacheBlockOutput = true;

    /**
     * @var bool
     */
    protected $btCacheBlockOutputOnPost = true;

    /**
     * @var bool
     */
    protected $btCacheBlockOutputForRegisteredUsers = false;

    /**
     * @var int
     */
    protected $btCacheBlockOutputLifetime = 300;

    /**
     * @var string
     */
    protected $btWrapperClass = 'ccm-ui';

    /**
     * @var string[]
     */
    protected $btExportPageColumns = ['displayPagesCID'];

    /**
     * @var bool
     */
    protected $includeParentItem;

    /**
     * @var int|null
     */
    protected $cID;

    /**
     * Instantiates the block controller.
     *
     * @param BlockType $obj |Block $obj
     */
    public function __construct($obj = null)
    {
        if (is_object($obj)) {
            if ($obj instanceof Block) {
                $this->bID = $obj->bID;
            } else {
                $this->bID = null;
            }
        }

        $c = Page::getCurrentPage();
        if (is_object($c)) {
            if ($c->getCollectionPointerOriginalID() > 0) {
                $this->cID = $c->getCollectionPointerOriginalID();
            } else {
                $this->cID = $c->getCollectionID();<commit_msg>Fix #10665<commit_after><?php

namespace Concrete\Block\Autonav;

use Concrete\Core\Block\Block;
use Concrete\Core\Block\BlockController;
use Concrete\Core\Block\View\BlockView;
use Concrete\Core\Database\Connection\Connection;
use Concrete\Core\Entity\Block\BlockType\BlockType;
use Concrete\Core\Error\UserMessageException;
use Concrete\Core\Feature\Features;
use Concrete\Core\Feature\UsesFeatureInterface;
use Concrete\Core\Http\ResponseFactoryInterface;
use Concrete\Core\Page\Page;
use Concrete\Core\Permission\Checker;
use Doctrine\ORM\EntityManagerInterface;

defined('C5_EXECUTE') or die('Access Denied.');

/**
 * The controller for the Auto-Nav block.
 *
 * @package    Blocks
 * @subpackage Auto-Nav
 *
 * @author     <NAME> <<EMAIL>>
 * @author     <NAME>
 * @copyright  Copyright (c) 2003-2022 ConcreteCMS. (http://www.concretecms.org)
 * @license    http://www.concretecms.org/license/     MIT License
 */

class Controller extends BlockController implements UsesFeatureInterface
{
    /**
     * @var Page|null
     */
    public $collection;

    /**
     * @var NavItem[]
     */
    public $navArray = [];

    /**
     * @var int[]
     */
    public $cParentIDArray = [];

    /**
     * @var string
     */
    public $displayPages;

    /**
     * @var int|null
     */
    public $displayPagesCID;

    /**
     * @var int
     */
    public $displayPagesIncludeSelf;

    /**
     * @var string
     */
    public $displaySubPages;

    /**
     * @var string
     */
    public $displaySubPageLevels;

    /**
     * @var int
     */
    public $displaySubPageLevelsNum = 0;

    /**
     * @var string
     */
    public $orderBy;

    /**
     * @var int
     */
    public $displayUnavailablePages;

    /**
     * @var bool
     */
    public $haveRetrievedSelf = false;

    /**
     * @var bool
     */
    public $haveRetrievedSelfPlus1 = false;

    /**
     * @var bool
     */
    public $displayUnapproved = false;

    /**
     * @var bool
     */
    public $ignoreExcludeNav = false;

    /**
     * @var int|null
     */
    public $cParentID;

    /**
     * @var string[]
     */
    protected $helpers = ['form', 'validation/token', 'form/page_selector', 'concrete/ui'];

    /**
     * @var int|null
     */
    protected $homePageID;

    /**
     * @var string
     */
    protected $btTable = 'btNavigation';

    /**
     * @var int
     */
    protected $btInterfaceWidth = 700;

    /**
     * @var int
     */
    protected $btInterfaceHeight = 525;

    /**
     * @var bool
     */
    protected $btCacheBlockRecord = true;

    /**
     * @var bool
     */
    protected $btCacheBlockOutput = true;

    /**
     * @var bool
     */
    protected $btCacheBlockOutputOnPost = true;

    /**
     * @var bool
     */
    protected $btCacheBlockOutputForRegisteredUsers = false;

    /**
     * @var int
     */
    protected $btCacheBlockOutputLifetime = 300;

    /**
     * @var string
     */
    protected $btWrapperClass = 'ccm-ui';

    /**
     * @var string[]
     */
    protected $btExportPageColumns = ['displayPagesCID'];

    /**
     * @var bool
     */
    protected $includeParentItem;

    /**
     * @var int|null
     */
    public $cID;

    /**
     * Instantiates the block controller.
     *
     * @param BlockType $obj |Block $obj
     */
    public function __construct($obj = null)
    {
        if (is_object($obj)) {
            if ($obj instanceof Block) {
                $this->bID = $obj->bID;
            } else {
                $this->bID = null;
            }
        }

        $c = Page::getCurrentPage();
        if (is_object($c)) {
            if ($c->getCollectionPointerOriginalID() > 0) {
                $this->cID = $c->getCollectionPointerOriginalID();
            } else {
                $this->cID = $c->getCollectionID();
{'fraction_non_alphanumeric': 0.14063724209976494, 'fraction_numerical': 0.006137372682162445, 'mean_word_length': 1.9255156608097785, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '3090141', 'n_tokens_mistral': 2485, 'n_tokens_neox': 2367, 'n_words': 474}