Airship\Cabin\Bridge\Landing\Blog::newSeries PHP Method

newSeries() public method

Create a new blog series
public newSeries ( )
    public function newSeries()
    {
        if (!$this->can('create')) {
            \Airship\redirect($this->airship_cabin_prefix . '/blog/series');
        }
        // Load Data
        if ($this->isSuperUser()) {
            $authors = $this->author->getAll();
        } else {
            $authors = $this->author->getForUser($this->getActiveUserId());
        }
        $post = $this->post(new NewSeriesFilter());
        if (!empty($post)) {
            $authorsAllowed = [];
            foreach ($authors as $a) {
                $authorsAllowed[] = (int) $a['authorid'];
            }
            if ($this->processNewSeries($post, $authorsAllowed)) {
                \Airship\redirect($this->airship_cabin_prefix . '/blog/series');
            }
        }
        $this->lens('blog/series_new', ['active_link' => 'bridge-link-blog-series', 'authors' => $authors]);
    }