function render()
 {
     if ($this->showErrorPage) {
         $this->data['menu'] = $this->db ? parent::render() : '';
         $this->renderView('error');
     } else {
         echo json_encode(['error' => $this->data['error']]);
     }
 }
 function render()
 {
     $this->data['menu'] = parent::render();
     $this->renderView('main');
 }
 function render()
 {
     $this->data['menu'] = parent::render();
     $this->renderView('article');
 }
 function render()
 {
     if ($this->data['action'] == 'preview') {
         echo $this->data['parsed_text'] . '<div class="clearfix"></div>';
     } else {
         if ($this->data['action'] == 'addarticle') {
             $j = [];
             $j['article_path'] = $this->data['article_path'];
             echo json_encode($j);
         } else {
             if ($this->data['action'] == 'addsection') {
                 $j = ['pub_path' => '/admin/articles/add/?section=' . $this->data['section_id']];
                 echo json_encode($j);
             } else {
                 if (isset($this->data['subaction']) && $this->data['subaction'] == 'delete') {
                     echo json_encode([]);
                 } else {
                     if (isset($this->data['subaction']) && $this->data['subaction'] == 'image') {
                         if (isset($this->data['image'])) {
                             $this->data['image']->saveTo('png', NULL, 0);
                         }
                     } else {
                         $this->data['menu'] = parent::render();
                         $this->renderView('admin_' . $this->data['action']);
                     }
                 }
             }
         }
     }
 }
 function render()
 {
     if ($this->outputMode) {
         $this->data['menu'] = parent::render();
         $this->renderView('profile');
     } else {
         echo json_encode([]);
     }
 }