Exemplo n.º 1
0
 public function main()
 {
     $auth = CMSAuth::getInstance();
     $design = CMSDesign::getInstance();
     $strings = CMS_Strings::getInstance();
     $aData = $this->config->load($this->path);
     $aGenerated = $this->config->generate($aData);
     $aBegin = $this->aBegin;
     $szTitle = $this->szTitle;
     //
     $aTabSheet = $this->generateTabSheetContent($aData, $aGenerated);
     $aTabSheet[] = array('id' => 'tab_sitemap', 'title' => 'Свойства');
     $design->begin($aBegin, $szTitle);
     $design->documentBegin();
     $design->header($szTitle);
     if (!empty($this->aButton)) {
         $design->buttons($this->aButton);
     }
     $this->outputComment();
     $design->formBegin();
     $design->submit('submit', $strings->getMessage('APPLY'));
     $design->tabSheetBegin($aTabSheet);
     foreach ($aTabSheet as $key => $row) {
         // Если это не последняя вкладка, выводим из нее контент
         if ($key != sizeof($aTabSheet) - 1) {
             $design->tabContentBegin($aTabSheet[$key]['id']);
             $design->tableBegin();
             foreach ($row['item'] as $item) {
                 $design->row2cell($item['title'], $item['value']);
             }
             $design->tableEnd();
             $design->tabContentEnd();
         } else {
             SitemapCMSForms::outputSitemapTabSheet($this->aSitemap, $aTabSheet[$key]['id'], array('Путь к конфигу' => $this->path));
         }
     }
     $design->tabSheetEnd();
     $design->submit('submit', $strings->getMessage('APPLY'));
     $design->formEnd();
     $design->documentEnd();
     $design->End();
     $this->output();
 }
Exemplo n.º 2
0
 /**
  * Отображает форму редактирования
  */
 protected function outputEditingForm($sheets, $controls)
 {
     $sheetsEmpty = false;
     if (empty($sheets)) {
         $sheetsEmpty = true;
         $sheets = array(array('id' => 'mainTab', 'title' => 'Ошибка'));
     }
     if ($this->schema->getSitemapLink()) {
         $sitemapInfo = Sitemap_Sample::get($this->schema->getSitemapLink());
         array_push($sheets, array('id' => 'sitemapTab', 'title' => 'Свойства'));
     }
     //
     $design = CMSDesign::getInstance();
     $design->forms->begin();
     // Вывод вкладок
     $design->tabs->sheetsBegin($sheets);
     // По вкладкам вывод
     $i = 0;
     if (!empty($controls)) {
         foreach ($controls as $list) {
             $design->tabs->contentBegin($sheets[$i]['id']);
             $design->table->begin();
             foreach ($list as $control) {
                 $design->table->row2cell($control->getTitle(), $control->outputInForm());
             }
             $design->table->end();
             $design->tabs->contentEnd();
             $i++;
         }
     } else {
         $design->tabs->contentBegin($sheets[0]['id']);
         $design->decor->contentBegin();
         printf('У данной схемы пока нету вкладок для редактирования<br/>');
         $auth = CMSAuth::getInstance();
         if ($auth->isSuperAdmin(UsersLogin::getCurrentUser())) {
             printf('Перейти к <a href="%scconfig/manage.php?schema=%s&edit=1">управлению</a> конфигом', \Extasy\CMS::getDashboardWWWRoot(), $this->schema->getName());
         }
         $design->decor->contentEnd();
         $design->tabs->contentEnd();
     }
     if (!empty($sitemapInfo)) {
         $auth = CMSAuth::getInstance();
         if ($auth->isSuperAdmin(UsersLogin::getCurrentUser())) {
             $link = sprintf('<a href="%scconfig/manage.php?schema=%s" target="_blank">Управление конфигом</a>', \Extasy\CMS::getDashboardWWWRoot(), $this->schema->getName());
             $property = array('' => $link);
         } else {
             $property = array();
         }
         SitemapCMSForms::outputSitemapTabSheet($sitemapInfo, $sheets[sizeof($sheets) - 1]['id'], $property);
     }
     $design->tabs->sheetsEnd();
     $design->forms->hidden('schema', $this->schema->getName());
     // Вывод конца
     $design->forms->submit('submit', 'Сохранить');
     $design->forms->end();
     $this->outputFooter();
 }
Exemplo n.º 3
0
 /**
  * Отображает вкладку информаци в карте сайта
  */
 protected function outputSitemapTabSheet($aTabSheet)
 {
     SitemapCMSForms::outputSitemapTabSheet($this->sitemapInfo, $aTabSheet['id']);
 }