FeedConfigsController::redirectEditTemplate PHP Метод

redirectEditTemplate() защищенный Метод

テンプレート編集画面にリダイレクトする
protected redirectEditTemplate ( string $template ) : void
$template string
Результат void
    protected function redirectEditTemplate($template)
    {
        $path = 'Feed' . DS . $template . $this->ext;
        $target = WWW_ROOT . 'theme' . DS . $this->siteConfigs['theme'] . DS . $path;
        $sorces = array(BASER_PLUGINS . 'Feed' . DS . 'View' . DS . $path);
        if ($this->siteConfigs['theme']) {
            if (!file_exists($target)) {
                foreach ($sorces as $source) {
                    if (file_exists($source)) {
                        $folder = new Folder();
                        $folder->create(dirname($target), 0777);
                        copy($source, $target);
                        chmod($target, 0666);
                        break;
                    }
                }
            }
            $this->redirect(array_merge(array('plugin' => null, 'mail' => false, 'prefix' => false, 'controller' => 'theme_files', 'action' => 'edit', $this->siteConfigs['theme'], 'etc'), explode('/', $path)));
        } else {
            $this->setMessage('現在、「テーマなし」の場合、管理画面でのテンプレート編集はサポートされていません。', true);
            $this->redirect(array('action' => 'index'));
        }
    }