src/articles/classes/Controller/Admin/Content.php
protected function actionAdd(Eresus_CMS_Request $request)
    {
        if ($request->getMethod() == 'POST')
        {
            $req = $request->request;
            $article = new Articles_Entity_Article();
            $article->section = $req->getInt('section');
            $article->active = true;
            $article->posted = new DateTime();
            $article->block = (boolean) $req->getInt('block');
            $article->caption = $req->get('caption');
            $article->text = $req->get('text');
            $article->preview = $req->get('preview');
            $article->image = 'image';
            $article->getTable()->persist($article);
            $response = new Eresus_HTTP_Redirect(arg('submitURL'));
            return $response;
        }

        /** @var Articles $plugin */
        $plugin = $this->getPlugin();
        $form = array(
            'name' => 'newArticles',
            'caption' => 'Добавить статью',
            'width' => '95%',
            'fields' => array (
                array ('type' => 'hidden', 'name' => 'action', 'value' => 'add'),
                array ('type' => 'hidden', 'name' => 'section', 'value' => arg('section')),
                array ('type' => 'edit', 'name' => 'caption', 'label' => 'Заголовок',
                    'width' => '100%', 'maxlength' => '255'),
                array ('type' => 'html', 'name' => 'text', 'label' => 'Полный текст',
                    'height' => '200px'),
                array ('type' => 'memo', 'name' => 'preview', 'label' => 'Краткое описание',
                    'height' => '10'),
                array ('type' =>
                    $plugin->settings['blockMode'] == 'manual' ? 'checkbox' : 'hidden',
                    'name' => 'block', 'label' => 'Показывать в блоке'),
                array ('type' => 'file', 'name' => 'image', 'label' => 'Картинка',
                    'width' => '100'),
            ),
            'buttons' => array('ok', 'cancel'),
        );

        $html = $this->getPage()->renderForm($form);
        return $html;
    }
protected function actionAdd(Eresus_CMS_Request $request)
    {
        if ($request->getMethod() == 'POST')
        {
            $req = $request->request;
            $article = new Articles_Entity_Article();
            $article->section = $req->getInt('section');
            $article->active = true;
            $article->posted = new DateTime();
            $article->block = (boolean) $req->getInt('block');
            $article->caption = $req->get('caption');
            $article->text = $req->get('text');
            $article->preview = $req->get('preview');
            $article->image = 'image';
            $article->getTable()->persist($article);
            $response = new Eresus_HTTP_Redirect(arg('submitURL'));
            return $response;
        }

        /** @var Articles $plugin */
        $plugin = $this->getPlugin();
        $form = array(
            'name' => 'newArticles',
            'caption' => 'Добавить статью',
            'width' => '95%',
            'fields' => array (
                array ('type' => 'hidden', 'name' => 'action', 'value' => 'add'),
                array ('type' => 'hidden', 'name' => 'section', 'value' => arg('section')),
                array ('type' => 'edit', 'name' => 'caption', 'label' => 'Заголовок',
                    'width' => '100%', 'maxlength' => '255'),
                array ('type' => 'html', 'name' => 'text', 'label' => 'Полный текст',
                    'height' => '200px'),
                array ('type' => 'memo', 'name' => 'preview', 'label' => 'Краткое описание',
                    'height' => '10'),
                array ('type' =>
                    $plugin->settings['blockMode'] == 'manual' ? 'checkbox' : 'hidden',
                    'name' => 'block', 'label' => 'Показывать в блоке'),
                array ('type' => 'file', 'name' => 'image', 'label' => 'Картинка',
                    'width' => '100'),
            ),
            'buttons' => array('ok', 'cancel'),
        );

        $html = $this->getPage()->renderForm($form);
        return $html;
    }
Диалог добавления статьи

@param Eresus_CMS_Request $request

@return Eresus_HTTP_Response|string  ответ или разметка области контента