Пример #1
0
 /**
  * render the view
  *
  * @since 3.0.0
  *
  * @param integer $userId identifier of the user
  *
  * @return string
  */
 public function render($userId = null)
 {
     $output = Hook::trigger('adminUserFormStart');
     $user = Db::forTablePrefix('users')->whereIdIs($userId)->findOne();
     /* html elements */
     $titleElement = new Html\Element();
     $titleElement->init('h2', ['class' => 'rs-admin-title-content']);
     $titleElement->text($user->name ? $user->name : $this->_language->get('user_new'));
     $linkElement = new Html\Element();
     $linkElement->init('a');
     $itemElement = new Html\Element();
     $itemElement->init('li');
     $listElement = new Html\Element();
     $listElement->init('ul', ['class' => 'rs-admin-js-list-tab rs-admin-list-tab']);
     $formElement = new AdminForm($this->_registry, $this->_language);
     $formElement->init(['form' => ['action' => $this->_registry->get('parameterRoute') . ($user->id ? 'admin/process/users/' . $user->id : 'admin/process/users'), 'class' => 'rs-admin-js-tab rs-admin-js-validate-form rs-admin-component-tab rs-admin-form-default rs-admin-fn-clearfix'], 'link' => ['cancel' => ['href' => $this->_registry->get('usersEdit') && $this->_registry->get('usersDelete') ? $this->_registry->get('parameterRoute') . 'admin/view/users' : $this->_registry->get('parameterRoute') . 'admin'], 'delete' => ['href' => $user->id ? $this->_registry->get('parameterRoute') . 'admin/delete/users/' . $user->id . '/' . $this->_registry->get('token') : null]]]);
     /* collect item output */
     $tabRoute = $this->_registry->get('parameterRoute') . $this->_registry->get('fullRoute');
     $outputItem = $itemElement->copy()->addClass('rs-admin-js-item-active rs-admin-item-active')->html($linkElement->copy()->attr('href', $tabRoute . '#tab-1')->text($this->_language->get('user')));
     $outputItem .= $itemElement->copy()->html($linkElement->copy()->attr('href', $tabRoute . '#tab-2')->text($this->_language->get('general')));
     if (!$user->id || $user->id > 1) {
         $outputItem .= $itemElement->copy()->html($linkElement->copy()->attr('href', $tabRoute . '#tab-3')->text($this->_language->get('customize')));
     }
     $listElement->append($outputItem);
     /* create the form */
     $formElement->append($listElement)->append('<div class="rs-admin-js-box-tab rs-admin-box-tab">')->append('<fieldset id="tab-1" class="rs-admin-js-set-tab rs-admin-js-set-active rs-admin-set-tab rs-admin-set-active"><ul><li>')->label($this->_language->get('name'), ['for' => 'name'])->text(['autofocus' => 'autofocus', 'id' => 'name', 'name' => 'name', 'required' => 'required', 'value' => $user->name])->append('</li>');
     if (!$user->id) {
         $formElement->append('<li>')->label($this->_language->get('user'), ['for' => 'user'])->text(['id' => 'user', 'name' => 'user', 'pattern' => '[a-zA-Z0-9]{1,30}', 'required' => 'required', 'value' => $user->user])->append('</li>');
     }
     $formElement->append('<li>')->label($this->_language->get('password'), ['for' => 'password'])->password(['id' => 'password', 'pattern' => '[a-zA-Z0-9]{1,30}', 'name' => 'password'])->append('</li><li>')->label($this->_language->get('password_confirm'), ['for' => 'password_confirm'])->password(['id' => 'password_confirm', 'pattern' => '[a-zA-Z0-9]{1,30}', 'name' => 'password_confirm'])->append('</li><li>')->label($this->_language->get('email'), ['for' => 'email'])->email(['id' => 'email', 'name' => 'email', 'required' => 'required', 'value' => $user->email])->append('</li><li>')->label($this->_language->get('description'), ['for' => 'description'])->textarea(['class' => 'rs-admin-js-auto-resize rs-admin-field-textarea rs-admin-field-small', 'id' => 'description', 'name' => 'description', 'rows' => 1, 'value' => $user->description])->append('</li></ul></fieldset>')->append('<fieldset id="tab-2" class="rs-admin-js-set-tab rs-admin-set-tab"><ul><li>')->label($this->_language->get('language'), ['for' => 'language'])->select(Helper\Option::getLanguageArray(), ['id' => 'language', 'name' => 'language', 'value' => $user->language])->append('</li></ul></fieldset>');
     /* last tab */
     if (!$user->id || $user->id > 1) {
         $formElement->append('<fieldset id="tab-3" class="rs-admin-js-set-tab rs-admin-set-tab"><ul><li>')->label($this->_language->get('status'), ['for' => 'status'])->select(Helper\Option::getToggleArray(), ['id' => 'status', 'name' => 'status', 'value' => $user->id ? intval($user->status) : 1])->append('</li>');
         if ($this->_registry->get('groupsEdit')) {
             $formElement->append('<li>')->label($this->_language->get('groups'), ['for' => 'groups'])->select(Helper\Option::getAccessArray('groups'), ['id' => 'groups', 'name' => 'groups[]', 'multiple' => 'multiple', 'size' => count(Helper\Option::getAccessArray('groups')), 'value' => $user->groups])->append('</li>');
         }
         $formElement->append('</ul></fieldset>');
     }
     $formElement->append('</div>')->token()->cancel();
     if ($user->id) {
         if (($this->_registry->get('usersDelete') || $this->_registry->get('myId') === $user->id) && $user->id > 1) {
             $formElement->delete();
         }
         if ($this->_registry->get('usersEdit') || $this->_registry->get('myId') === $user->id) {
             $formElement->save();
         }
     } else {
         if ($this->_registry->get('usersNew')) {
             $formElement->create();
         }
     }
     /* collect output */
     $output .= $titleElement . $formElement;
     $output .= Hook::trigger('adminUserFormEnd');
     return $output;
 }
Пример #2
0
 /**
  * render the view
  *
  * @since 3.0.0
  *
  * @param integer $groupId identifier of the group
  *
  * @return string
  */
 public function render($groupId = null)
 {
     $output = Hook::trigger('adminGroupFormStart');
     $group = Db::forTablePrefix('groups')->whereIdIs($groupId)->findOne();
     /* html elements */
     $titleElement = new Html\Element();
     $titleElement->init('h2', ['class' => 'rs-admin-title-content']);
     $titleElement->text($group->name ? $group->name : $this->_language->get('group_new'));
     $linkElement = new Html\Element();
     $linkElement->init('a');
     $itemElement = new Html\Element();
     $itemElement->init('li');
     $listElement = new Html\Element();
     $listElement->init('ul', ['class' => 'rs-admin-js-list-tab rs-admin-list-tab']);
     $formElement = new AdminForm($this->_registry, $this->_language);
     $formElement->init(['form' => ['action' => $this->_registry->get('parameterRoute') . ($group->id ? 'admin/process/groups/' . $group->id : 'admin/process/groups'), 'class' => 'rs-admin-js-tab rs-admin-js-validate-form rs-admin-component-tab rs-admin-form-default rs-admin-fn-clearfix'], 'link' => ['cancel' => ['href' => $this->_registry->get('groupsEdit') && $this->_registry->get('groupsDelete') ? $this->_registry->get('parameterRoute') . 'admin/view/groups' : $this->_registry->get('parameterRoute') . 'admin'], 'delete' => ['href' => $group->id ? $this->_registry->get('parameterRoute') . 'admin/delete/groups/' . $group->id . '/' . $this->_registry->get('token') : null]]]);
     /* collect item output */
     $tabRoute = $this->_registry->get('parameterRoute') . $this->_registry->get('fullRoute');
     $outputItem = $itemElement->copy()->addClass('rs-admin-js-item-active rs-admin-item-active')->html($linkElement->copy()->attr('href', $tabRoute . '#tab-1')->text($this->_language->get('group')));
     if (!$group->id || $group->id > 1) {
         $outputItem .= $itemElement->copy()->html($linkElement->copy()->attr('href', $tabRoute . '#tab-2')->text($this->_language->get('access')));
         $outputItem .= $itemElement->copy()->html($linkElement->copy()->attr('href', $tabRoute . '#tab-3')->text($this->_language->get('customize')));
     }
     $listElement->append($outputItem);
     /* create the form */
     $formElement->append($listElement)->append('<div class="rs-admin-js-box-tab rs-admin-box-tab rs-admin-box-tab">')->append('<fieldset id="tab-1" class="rs-admin-js-set-tab rs-admin-js-set-active rs-admin-set-tab rs-admin-set-active"><ul><li>')->label($this->_language->get('name'), ['for' => 'name'])->text(['autofocus' => 'autofocus', 'id' => 'name', 'name' => 'name', 'required' => 'required', 'value' => $group->name])->append('</li><li>')->label($this->_language->get('user'), ['for' => 'user'])->text(['id' => 'alias', 'name' => 'alias', 'pattern' => '[a-zA-Z0-9-]+', 'required' => 'required', 'value' => $group->alias])->append('</li><li>')->label($this->_language->get('description'), ['for' => 'description'])->textarea(['class' => 'rs-admin-js-auto-resize rs-admin-field-textarea rs-admin-field-small', 'id' => 'description', 'name' => 'description', 'rows' => 1, 'value' => $group->description])->append('</li></ul></fieldset>');
     /* second tab */
     if (!$group->id || $group->id > 1) {
         $formElement->append('<fieldset id="tab-2" class="rs-admin-js-set-tab rs-admin-set-tab"><ul><li>')->label($this->_language->get('categories'), ['for' => 'categories'])->select(Helper\Option::getPermissionArray(), ['id' => 'categories', 'name' => 'categories[]', 'multiple' => 'multiple', 'size' => count(Helper\Option::getPermissionArray()), 'value' => $group->categories])->append('</li><li>')->label($this->_language->get('articles'), ['for' => 'articles'])->select(Helper\Option::getPermissionArray(), ['id' => 'articles', 'name' => 'articles[]', 'multiple' => 'multiple', 'size' => count(Helper\Option::getPermissionArray()), 'value' => $group->articles])->append('</li><li>')->label($this->_language->get('extras'), ['for' => 'extras'])->select(Helper\Option::getPermissionArray(), ['id' => 'extras', 'name' => 'extras[]', 'multiple' => 'multiple', 'size' => count(Helper\Option::getPermissionArray()), 'value' => $group->extras])->append('</li><li>')->label($this->_language->get('comments'), ['for' => 'comments'])->select(Helper\Option::getPermissionArray(), ['id' => 'comments', 'name' => 'comments[]', 'multiple' => 'multiple', 'size' => count(Helper\Option::getPermissionArray()), 'value' => $group->comments])->append('</li><li>')->label($this->_language->get('groups'), ['for' => 'groups'])->select(Helper\Option::getPermissionArray(), ['id' => 'groups', 'name' => 'groups[]', 'multiple' => 'multiple', 'size' => count(Helper\Option::getPermissionArray()), 'value' => $group->groups])->append('</li><li>')->label($this->_language->get('users'), ['for' => 'users'])->select(Helper\Option::getPermissionArray(), ['id' => 'users', 'name' => 'users[]', 'multiple' => 'multiple', 'size' => count(Helper\Option::getPermissionArray()), 'value' => $group->users])->append('</li><li>')->label($this->_language->get('modules'), ['for' => 'modules'])->select(Helper\Option::getPermissionArray('modules'), ['id' => 'modules', 'name' => 'modules[]', 'multiple' => 'multiple', 'size' => count(Helper\Option::getPermissionArray('modules')), 'value' => $group->modules])->append('</li><li>')->label($this->_language->get('settings'), ['for' => 'settings'])->select(Helper\Option::getPermissionArray('settings'), ['id' => 'settings', 'name' => 'settings[]', 'multiple' => 'multiple', 'size' => count(Helper\Option::getPermissionArray('settings')), 'value' => intval($group->settings)])->append('</li></ul></fieldset>')->append('<fieldset id="tab-3" class="rs-admin-js-set-tab rs-admin-set-tab"><ul><li>')->label($this->_language->get('filter'), ['for' => 'filter'])->select(Helper\Option::getToggleArray(), ['id' => 'filter', 'name' => 'filter', 'value' => $group->id ? $group->filter : 1])->append('</li><li>')->label($this->_language->get('status'), ['for' => 'status'])->select(Helper\Option::getToggleArray(), ['id' => 'status', 'name' => 'status', 'value' => $group->id ? intval($group->status) : 1])->append('</li></ul></fieldset>');
     }
     $formElement->append('</div>')->token()->cancel();
     if ($group->id) {
         if ($this->_registry->get('groupsDelete') && $group->id > 1) {
             $formElement->delete();
         }
         if ($this->_registry->get('groupsEdit')) {
             $formElement->save();
         }
     } else {
         if ($this->_registry->get('groupsNew')) {
             $formElement->create();
         }
     }
     /* collect output */
     $output .= $titleElement . $formElement;
     $output .= Hook::trigger('adminGroupFormEnd');
     return $output;
 }
Пример #3
0
 /**
  * render the view
  *
  * @since 3.0.0
  *
  * @param integer $commentId identifier of the comment
  *
  * @return string
  */
 public function render($commentId = null)
 {
     $output = Hook::trigger('adminCommentFormStart');
     $comment = Db::forTablePrefix('comments')->whereIdIs($commentId)->findOne();
     /* html elements */
     $titleElement = new Html\Element();
     $titleElement->init('h2', ['class' => 'rs-admin-title-content']);
     $titleElement->text($comment->author ? $comment->author : $this->_language->get('comment_new'));
     $linkElement = new Html\Element();
     $linkElement->init('a');
     $itemElement = new Html\Element();
     $itemElement->init('li');
     $listElement = new Html\Element();
     $listElement->init('ul', ['class' => 'rs-admin-js-list-tab rs-admin-list-tab']);
     $formElement = new AdminForm($this->_registry, $this->_language);
     $formElement->init(['form' => ['action' => $this->_registry->get('parameterRoute') . ($comment->id ? 'admin/process/comments/' . $comment->id : 'admin/process/comments'), 'class' => 'rs-admin-js-tab rs-admin-js-validate-form rs-admin-component-tab rs-admin-form-default rs-admin-fn-clearfix'], 'link' => ['cancel' => ['href' => $this->_registry->get('commentsEdit') && $this->_registry->get('commentsDelete') ? $this->_registry->get('parameterRoute') . 'admin/view/comments' : $this->_registry->get('parameterRoute') . 'admin'], 'delete' => ['href' => $comment->id ? $this->_registry->get('parameterRoute') . 'admin/delete/comments/' . $comment->id . '/' . $this->_registry->get('token') : null]]]);
     /* collect item output */
     $tabRoute = $this->_registry->get('parameterRoute') . $this->_registry->get('fullRoute');
     $outputItem = $itemElement->copy()->addClass('rs-admin-js-item-active rs-admin-item-active')->html($linkElement->copy()->attr('href', $tabRoute . '#tab-1')->text($this->_language->get('comment')));
     $outputItem .= $itemElement->copy()->html($linkElement->copy()->attr('href', $tabRoute . '#tab-2')->text($this->_language->get('general')));
     $outputItem .= $itemElement->copy()->html($linkElement->copy()->attr('href', $tabRoute . '#tab-3')->text($this->_language->get('customize')));
     $listElement->append($outputItem);
     /* create the form */
     $formElement->append($listElement)->append('<div class="rs-admin-js-box-tab rs-admin-box-tab">')->append('<fieldset id="tab-1" class="rs-admin-js-set-tab rs-admin-js-set-active rs-admin-set-tab rs-admin-set-active"><ul><li>')->label('* ' . $this->_language->get('author'), ['for' => 'author'])->text(['id' => 'author', 'name' => 'author', 'readonly' => 'readonly', 'required' => 'required', 'value' => $comment->author ? $comment->author : $this->_registry->get('myName')])->append('</li><li>')->label('* ' . $this->_language->get('email'), ['for' => 'email'])->email(['id' => 'email', 'name' => 'email', 'readonly' => 'readonly', 'required' => 'required', 'value' => $comment->email ? $comment->email : $this->_registry->get('myEmail')])->append('</li><li>')->label($this->_language->get('url'), ['for' => 'url'])->url(['id' => 'url', 'name' => 'url', 'value' => $comment->url])->append('</li><li>')->label('* ' . $this->_language->get('text'), ['for' => 'text'])->textarea(['id' => 'text', 'name' => 'text', 'required' => 'required', 'value' => htmlspecialchars($comment->text)])->append('</li></ul></fieldset>')->append('<fieldset id="tab-2" class="rs-admin-js-set-tab rs-admin-set-tab"><ul><li>')->label($this->_language->get('language'), ['for' => 'language'])->select(Helper\Option::getLanguageArray(), ['id' => 'language', 'name' => 'language', 'value' => $comment->language])->append('</li><li>')->label($this->_language->get('article'), ['for' => 'article'])->select(Helper\Option::getContentArray('articles'), ['id' => 'article', 'name' => 'article', 'value' => intval($comment->article)])->append('</li></ul></fieldset>')->append('<fieldset id="tab-3" class="rs-admin-js-set-tab rs-admin-set-tab"><ul><li>')->label($this->_language->get('status'), ['for' => 'status'])->select(Helper\Option::getVisibleArray(), ['id' => 'status', 'name' => 'status', 'value' => $comment->id ? intval($comment->status) : 1])->append('</li><li>')->label($this->_language->get('rank'), ['for' => 'rank'])->number(['id' => 'rank', 'name' => 'rank', 'value' => $comment->id ? intval($comment->rank) : Db::forTablePrefix('comments')->max('rank') + 1])->append('</li>');
     if ($this->_registry->get('groupsEdit')) {
         $formElement->append('<li>')->label($this->_language->get('access'), ['for' => 'access'])->select(Helper\Option::getAccessArray('groups'), ['id' => 'access', 'name' => 'access[]', 'multiple' => 'multiple', 'size' => count(Helper\Option::getAccessArray('groups')), 'value' => $comment->access])->append('</li>');
     }
     $formElement->append('<li>')->label($this->_language->get('date'), ['for' => 'date'])->datetime(['id' => 'date', 'name' => 'date', 'value' => $comment->date ? $comment->date : null])->append('</li></ul></fieldset></div>')->token()->cancel();
     if ($comment->id) {
         if ($this->_registry->get('commentsDelete')) {
             $formElement->delete();
         }
         if ($this->_registry->get('commentsEdit')) {
             $formElement->save();
         }
     } else {
         if ($this->_registry->get('commentsNew')) {
             $formElement->create();
         }
     }
     /* collect output */
     $output .= $titleElement . $formElement;
     $output .= Hook::trigger('adminCommentFormEnd');
     return $output;
 }
Пример #4
0
 /**
  * render the view
  *
  * @since 3.0.0
  *
  * @param integer $articleId identifier of the article
  *
  * @return string
  */
 public function render($articleId = null)
 {
     $output = Hook::trigger('adminArticleFormStart');
     $article = Db::forTablePrefix('articles')->whereIdIs($articleId)->findOne();
     /* html elements */
     $titleElement = new Html\Element();
     $titleElement->init('h2', ['class' => 'rs-admin-title-content']);
     $titleElement->text($article->title ? $article->title : $this->_language->get('article_new'));
     $linkElement = new Html\Element();
     $linkElement->init('a');
     $itemElement = new Html\Element();
     $itemElement->init('li');
     $listElement = new Html\Element();
     $listElement->init('ul', ['class' => 'rs-admin-js-list-tab rs-admin-list-tab']);
     $formElement = new AdminForm($this->_registry, $this->_language);
     $formElement->init(['form' => ['action' => $this->_registry->get('parameterRoute') . ($article->id ? 'admin/process/articles/' . $article->id : 'admin/process/articles'), 'class' => 'rs-admin-js-tab rs-admin-js-validate-form rs-admin-component-tab rs-admin-form-default rs-admin-fn-clearfix'], 'link' => ['cancel' => ['href' => $this->_registry->get('articlesEdit') && $this->_registry->get('articlesDelete') ? $this->_registry->get('parameterRoute') . 'admin/view/articles' : $this->_registry->get('parameterRoute') . 'admin'], 'delete' => ['href' => $article->id ? $this->_registry->get('parameterRoute') . 'admin/delete/articles/' . $article->id . '/' . $this->_registry->get('token') : null]]]);
     /* collect item output */
     $tabRoute = $this->_registry->get('parameterRoute') . $this->_registry->get('fullRoute');
     $outputItem = $itemElement->copy()->addClass('rs-admin-js-item-active rs-admin-item-active')->html($linkElement->copy()->attr('href', $tabRoute . '#tab-1')->text($this->_language->get('article')));
     $outputItem .= $itemElement->copy()->html($linkElement->copy()->attr('href', $tabRoute . '#tab-2')->text($this->_language->get('general')));
     $outputItem .= $itemElement->copy()->html($linkElement->copy()->attr('href', $tabRoute . '#tab-3')->text($this->_language->get('customize')));
     $listElement->append($outputItem);
     /* create the form */
     $formElement->append($listElement)->append('<div class="rs-admin-js-box-tab rs-admin-box-tab">')->append('<fieldset id="tab-1" class="rs-admin-js-set-tab rs-admin-js-set-active rs-admin-set-tab rs-admin-set-active"><ul><li>')->label($this->_language->get('title'), ['for' => 'title'])->text(['autofocus' => 'autofocus', 'class' => 'rs-admin-js-generate-alias-input rs-admin-field-default rs-admin-field-text', 'id' => 'title', 'name' => 'title', 'required' => 'required', 'value' => $article->title])->append('</li><li>')->label($this->_language->get('alias'), ['for' => 'alias'])->text(['class' => 'rs-admin-js-generate-alias-output rs-admin-field-default rs-admin-field-text', 'id' => 'alias', 'name' => 'alias', 'pattern' => '[a-zA-Z0-9-]+', 'required' => 'required', 'value' => $article->alias])->append('</li><li>')->label($this->_language->get('description'), ['for' => 'description'])->textarea(['class' => 'rs-admin-js-auto-resize rs-admin-field-textarea rs-admin-field-small', 'id' => 'description', 'name' => 'description', 'rows' => 1, 'value' => $article->description])->append('</li><li>')->label($this->_language->get('keywords'), ['for' => 'keywords'])->textarea(['class' => 'rs-admin-js-auto-resize rs-admin-js-generate-keyword-output rs-admin-field-textarea rs-admin-field-small', 'id' => 'keywords', 'name' => 'keywords', 'rows' => 1, 'value' => $article->keywords])->append('</li><li>')->label($this->_language->get('robots'), ['for' => 'robots'])->select(Helper\Option::getRobotArray(), ['id' => 'robots', 'name' => 'robots', 'value' => $article->id ? filter_var($article->robots, FILTER_VALIDATE_INT) : null])->append('</li><li>')->label($this->_language->get('text'), ['for' => 'text'])->textarea(['class' => 'rs-admin-js-auto-resize rs-admin-js-generate-keyword-input rs-admin-js-editor-textarea rs-admin-field-textarea', 'id' => 'text', 'name' => 'text', 'required' => 'required', 'value' => htmlspecialchars($article->text)])->append('</li></ul></fieldset>')->append('<fieldset id="tab-2" class="rs-admin-js-set-tab rs-admin-set-tab"><ul><li>')->label($this->_language->get('language'), ['for' => 'language'])->select(Helper\Option::getLanguageArray(), ['id' => 'language', 'name' => 'language', 'value' => $article->language])->append('</li><li>')->label($this->_language->get('template'), ['for' => 'template'])->select(Helper\Option::getTemplateArray(), ['id' => 'template', 'name' => 'template', 'value' => $article->template])->append('</li><li>')->label($this->_language->get('article_sibling'), ['for' => 'sibling'])->select(Helper\Option::getContentArray('articles', [intval($article->id)]), ['id' => 'sibling', 'name' => 'sibling', 'value' => intval($article->sibling)])->append('</li><li>')->label($this->_language->get('category'), ['for' => 'category'])->select(Helper\Option::getContentArray('categories'), ['id' => 'category', 'name' => 'category', 'value' => intval($article->category)])->append('</li></ul></fieldset>')->append('<fieldset id="tab-3" class="rs-admin-js-set-tab rs-admin-set-tab"><ul><li>')->label($this->_language->get('headline'), ['for' => 'headline'])->select(Helper\Option::getToggleArray(), ['id' => 'headline', 'name' => 'headline', 'value' => $article->id ? intval($article->headline) : 1])->append('</li><li>')->label($this->_language->get('byline'), ['for' => 'byline'])->select(Helper\Option::getToggleArray(), ['id' => 'byline', 'name' => 'byline', 'value' => $article->id ? intval($article->byline) : 1])->append('</li><li>')->label($this->_language->get('comments'), ['for' => 'comments'])->select(Helper\Option::getToggleArray(), ['id' => 'comments', 'name' => 'comments', 'value' => intval($article->comments)])->append('</li><li>')->label($this->_language->get('status'), ['for' => 'status'])->select(Helper\Option::getVisibleArray(), ['id' => 'status', 'name' => 'status', 'value' => $article->id ? intval($article->status) : 1])->append('</li><li>')->label($this->_language->get('rank'), ['for' => 'rank'])->number(['id' => 'rank', 'name' => 'rank', 'value' => $article->id ? intval($article->rank) : Db::forTablePrefix('articles')->max('rank') + 1])->append('</li>');
     if ($this->_registry->get('groupsEdit')) {
         $formElement->append('<li>')->label($this->_language->get('access'), ['for' => 'access'])->select(Helper\Option::getAccessArray('groups'), ['id' => 'access', 'name' => 'access[]', 'multiple' => 'multiple', 'size' => count(Helper\Option::getAccessArray('groups')), 'value' => $article->access])->append('</li>');
     }
     $formElement->append('<li>')->label($this->_language->get('date'), ['for' => 'date'])->datetime(['id' => 'date', 'name' => 'date', 'value' => $article->date ? $article->date : null])->append('</li></ul></fieldset></div>')->token()->cancel();
     if ($article->id) {
         if ($this->_registry->get('articlesDelete')) {
             $formElement->delete();
         }
         if ($this->_registry->get('articlesEdit')) {
             $formElement->save();
         }
     } else {
         if ($this->_registry->get('articlesNew')) {
             $formElement->create();
         }
     }
     /* collect output */
     $output .= $titleElement . $formElement;
     $output .= Hook::trigger('adminArticleFormEnd');
     return $output;
 }