<commit_before><?php

namespace BoomCMS\Http\Controllers\CMS\Page\Settings;

use BoomCMS\Events\PageWasMadeVisible;
use Datetime;
use Illuminate\Support\Facades\Event;

class Save extends Settings
{
    public function admin()
    {
        parent::admin();

        $this->page->setInternalName($this->request->input('internal_name'));

        if ($this->auth->loggedIn('edit_disable_delete', $this->page)) {
            $this->page->setDisableDelete($this->request->input('disable_delete') == '1');
        }

        $this->provider->save($this->page);
    }

    public function children()
    {
        parent::children();

        $post = $this->request->input();

        $this->page->setChildTemplateId($this->request->input('children_template_id'));

        if ($this->allowAdvanced) {
            $this->page
                ->setChildrenUrlPrefix($this->request->input('children_url_prefix'))
                ->setChildrenVisibleInNav($this->request->input('children_visible_in_nav') == 1)
                ->setChildrenVisibleInNavCms($this->request->input('children_visible_in_nav_cms') == 1)
                ->setGrandchildTemplateId($this->request->input('grandchild_template_id'));
        }

        if (isset($post['children_ordering_policy']) && isset($post['children_ordering_direction'])) {
            $this->page->setChildOrderingPolicy($post['children_ordering_policy'], $post['children_ordering_direction']);
        }

        $this->provider->save($this->page);
    }

    public function feature()
    {
        parent::feature();

        $this->page->setFeatureImageId($this->request->input('feature_image_id'));
        $this->provider->save($this->page);
    }

    public function navigation()
    {
        parent::navigation();

        if ($this->allowAdvanced) {
            $this->page->setParentId($this->request->input('parent_id'));
        }

        $this->page
            ->setVisibleInNav($this->request->input('visible_in_nav'))
            ->setVisibleInCmsNav($this->request->input('visible_in_nav_cms'));

        $this->provider->save($this->page);
    }

    public function search()
    {
        parent::search();

        $this->page
            ->setDescription($this->request->input('description'))
            ->setKeywords($this->request->input('keywords'));

        if ($this->allowAdvanced) {
            $this->page
                ->setExternalIndexing($this->request->input('external_indexing'))
                ->setInternalIndexing($this->request->input('internal_indexing'));
        }

        $this->provider->save($this->page);
    }

    public function sort_children()
    {
        parent::children();

        $this->page->updateChildSequences($this->request->input('sequences'));
    }

    public function visibility()
    {
        parent::visibility();

        $wasVisible = $this->page->isVisible();

        $this->page->setVisibleAtAnyTime($this->request->input('visible') == 1);

        if ($this->page->isVisibleAtAnyTime()) {
            $visibleTo = ($this->request->input('toggle_visible_to') == 1) ? new DateTime($this->request->input('visible_to')) : null;

            $this->page
                ->setVisibleFrom(new DateTime($this->request->input('visible_from')))
                ->setVisibleTo($visibleTo);
        }

        $this->provider->save($this->page);

        if (!$wasVisible && $this->page->isVisible()) {
            Event::fire(new PageWasMadeVisible($this->page, $this->auth->getPerson()));
        }

        return (int) $this->page->isVisible();
    }
}
<commit_msg>Removed unused 'use' statement<commit_after><?php

namespace BoomCMS\Http\Controllers\CMS\Page\Settings;

use BoomCMS\Events\PageWasMadeVisible;
use Illuminate\Support\Facades\Event;

class Save extends Settings
{
    public function admin()
    {
        parent::admin();

        $this->page->setInternalName($this->request->input('internal_name'));

        if ($this->auth->loggedIn('edit_disable_delete', $this->page)) {
            $this->page->setDisableDelete($this->request->input('disable_delete') == '1');
        }

        $this->provider->save($this->page);
    }

    public function children()
    {
        parent::children();

        $post = $this->request->input();

        $this->page->setChildTemplateId($this->request->input('children_template_id'));

        if ($this->allowAdvanced) {
            $this->page
                ->setChildrenUrlPrefix($this->request->input('children_url_prefix'))
                ->setChildrenVisibleInNav($this->request->input('children_visible_in_nav') == 1)
                ->setChildrenVisibleInNavCms($this->request->input('children_visible_in_nav_cms') == 1)
                ->setGrandchildTemplateId($this->request->input('grandchild_template_id'));
        }

        if (isset($post['children_ordering_policy']) && isset($post['children_ordering_direction'])) {
            $this->page->setChildOrderingPolicy($post['children_ordering_policy'], $post['children_ordering_direction']);
        }

        $this->provider->save($this->page);
    }

    public function feature()
    {
        parent::feature();

        $this->page->setFeatureImageId($this->request->input('feature_image_id'));
        $this->provider->save($this->page);
    }

    public function navigation()
    {
        parent::navigation();

        if ($this->allowAdvanced) {
            $this->page->setParentId($this->request->input('parent_id'));
        }

        $this->page
            ->setVisibleInNav($this->request->input('visible_in_nav'))
            ->setVisibleInCmsNav($this->request->input('visible_in_nav_cms'));

        $this->provider->save($this->page);
    }

    public function search()
    {
        parent::search();

        $this->page
            ->setDescription($this->request->input('description'))
            ->setKeywords($this->request->input('keywords'));

        if ($this->allowAdvanced) {
            $this->page
                ->setExternalIndexing($this->request->input('external_indexing'))
                ->setInternalIndexing($this->request->input('internal_indexing'));
        }

        $this->provider->save($this->page);
    }

    public function sort_children()
    {
        parent::children();

        $this->page->updateChildSequences($this->request->input('sequences'));
    }

    public function visibility()
    {
        parent::visibility();

        $wasVisible = $this->page->isVisible();

        $this->page->setVisibleAtAnyTime($this->request->input('visible') == 1);

        if ($this->page->isVisibleAtAnyTime()) {
            $visibleTo = ($this->request->input('toggle_visible_to') == 1) ? new DateTime($this->request->input('visible_to')) : null;

            $this->page
                ->setVisibleFrom(new DateTime($this->request->input('visible_from')))
                ->setVisibleTo($visibleTo);
        }

        $this->provider->save($this->page);

        if (!$wasVisible && $this->page->isVisible()) {
            Event::fire(new PageWasMadeVisible($this->page, $this->auth->getPerson()));
        }

        return (int) $this->page->isVisible();
    }
}

{'fraction_non_alphanumeric': 0.1756662480814846, 'fraction_numerical': 0.0013952839402818474, 'mean_word_length': 2.741127348643006, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 223, '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': '1559928', 'n_tokens_mistral': 2056, 'n_tokens_neox': 1949, 'n_words': 223}