<commit_before><?php
namespace Concrete\Controller\Dialog\Page;

use Concrete\Controller\Backend\UserInterface\Page as BackendInterfacePageController;
use Concrete\Core\Page\Command\DeletePageCommand;
use Concrete\Core\Workflow\Request\DeletePageRequest as DeletePagePageWorkflowRequest;
use Concrete\Core\Page\EditResponse as PageEditResponse;
use Concrete\Core\Workflow\Progress\Response as WorkflowProgressResponse;
use Concrete\Core\User\User;
use Page;

class Delete extends BackendInterfacePageController
{
    protected $viewPath = '/dialogs/page/delete';
    protected $controllerActionPath = '/ccm/system/dialogs/page/delete';

    protected function canAccess()
    {
        return $this->permissions->canDeletePage();
    }

    public function view()
    {
        $this->set('numChildren', $this->page->getNumChildren());
    }

    public function viewFromSitemap()
    {
        $this->set('numChildren', $this->page->getNumChildren());
        $this->set('sitemap', true);
    }

    public function submit()
    {
        if ($this->validateAction()) {
            $c = $this->page;
            $cp = $this->permissions;
            if ($cp->canDeletePage() && $c->getCollectionID() != Page::getHomePageID() && (!$c->isMasterCollection())) {
                $u = $this->app->make(User::class);
                $children = $c->getNumChildren();
                if ($children == 0 || $u->isSuperUser()) {
                    if ($c->isExternalLink()) {<commit_msg>Initializing $sitemap variable in the controller to fix warning/error "Undefined variable: sitemap" for PHP 7.3 and 7.4.<commit_after><?php
namespace Concrete\Controller\Dialog\Page;

use Concrete\Controller\Backend\UserInterface\Page as BackendInterfacePageController;
use Concrete\Core\Page\Command\DeletePageCommand;
use Concrete\Core\Workflow\Request\DeletePageRequest as DeletePagePageWorkflowRequest;
use Concrete\Core\Page\EditResponse as PageEditResponse;
use Concrete\Core\Workflow\Progress\Response as WorkflowProgressResponse;
use Concrete\Core\User\User;
use Page;

class Delete extends BackendInterfacePageController
{
    protected $viewPath = '/dialogs/page/delete';
    protected $controllerActionPath = '/ccm/system/dialogs/page/delete';

    protected function canAccess()
    {
        return $this->permissions->canDeletePage();
    }

    public function view()
    {
        $this->set('sitemap', false);
        $this->set('numChildren', $this->page->getNumChildren());
    }

    public function viewFromSitemap()
    {
        $this->set('numChildren', $this->page->getNumChildren());
        $this->set('sitemap', true);
    }

    public function submit()
    {
        if ($this->validateAction()) {
            $c = $this->page;
            $cp = $this->permissions;
            if ($cp->canDeletePage() && $c->getCollectionID() != Page::getHomePageID() && (!$c->isMasterCollection())) {
                $u = $this->app->make(User::class);
                $children = $c->getNumChildren();
                if ($children == 0 || $u->isSuperUser()) {
                    if ($c->isExternalLink()) {
{'fraction_non_alphanumeric': 0.1426731078904992, 'fraction_numerical': 0.001932367149758454, 'mean_word_length': 3.2086720867208673, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 44, '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': '4881518', 'n_tokens_mistral': 890, 'n_tokens_neox': 875, 'n_words': 170}