protected function Form_Create() { parent::Form_Create(); if (!QApplication::HasPermissionForThisLang('Can export project', $this->objProject->ProjectId)) { QApplication::Redirect(NarroLink::ProjectList()); } $pnlDummy = new QPanel($this->pnlMainTab); $arrHeaders[] = NarroLink::Project($this->objProject->ProjectId, t('Overview')); if ($this->objProject instanceof NarroProject && QApplication::HasPermissionForThisLang('Can edit project', $this->objProject->ProjectId)) { $pnlDummy = new QPanel($this->pnlMainTab); $arrHeaders[] = NarroLink::ProjectEdit($this->objProject->ProjectId, t('Edit')); } $pnlDummy = new QPanel($this->pnlMainTab); $arrHeaders[] = NarroLink::Translate($this->objProject->ProjectId, '', 0, '', 0, 0, 10, 0, 0, t('Translate')); $pnlDummy = new QPanel($this->pnlMainTab); $arrHeaders[] = NarroLink::Review($this->objProject->ProjectId, '', NarroReviewPanel::SHOW_NOT_APPROVED, '', 0, 0, 10, 0, 0, t('Review')); $pnlDummy = new QPanel($this->pnlMainTab); $arrHeaders[] = NarroLink::ProjectFileList($this->objProject->ProjectId, '', '', t('Files')); $pnlDummy = new QPanel($this->pnlMainTab); $arrHeaders[] = NarroLink::ProjectLanguages($this->objProject->ProjectId, t('Languages')); if (QApplication::HasPermissionForThisLang('Can import project', $this->objProject->ProjectId)) { $pnlDummy = new QPanel($this->pnlMainTab); $arrHeaders[] = NarroLink::ProjectImport($this->objProject->ProjectId, t('Import')); } if (QApplication::HasPermissionForThisLang('Can export project', $this->objProject->ProjectId)) { $this->pnlSelectedTab = new NarroProjectExportPanel($this->objProject, $this->pnlMainTab); $arrHeaders[] = t('Export'); $this->pnlMainTab->Selected = count($arrHeaders) - 1; } $this->pnlMainTab->Headers = $arrHeaders; }
protected function Form_Create() { parent::Form_Create(); if (QApplication::QueryString('p') == 0) { $this->pnlMainTab = new QTabs($this); $pnlDummy = new QPanel($this->pnlMainTab); $arrHeaders[] = NarroLink::ProjectList(t('Projects')); $pnlDummy = new QPanel($this->pnlMainTab); $arrHeaders[] = NarroLink::Translate(0, '', NarroTranslatePanel::SHOW_NOT_APPROVED, '', 0, 0, 10, 0, 0, t('Translate')); $this->pnlReview = new NarroTranslatePanel($this->pnlMainTab); $arrHeaders[] = t('Review'); $this->pnlMainTab->Selected = count($arrHeaders) - 1; if (NarroLanguage::CountAllActive() > 2 || QApplication::HasPermission('Administrator')) { $pnlDummy = new QPanel($this->pnlMainTab); $arrHeaders[] = NarroLink::LanguageList(t('Languages')); } $pnlDummy = new QPanel($this->pnlMainTab); $arrHeaders[] = NarroLink::UserList('', t('Users')); $pnlDummy = new QPanel($this->pnlMainTab); $arrHeaders[] = NarroLink::RoleList(0, '', t('Roles')); if (QApplication::HasPermissionForThisLang('Administrator')) { $pnlDummy = new QPanel($this->pnlMainTab); $arrHeaders[] = NarroLink::Log('', t('Application Log')); } $this->pnlMainTab->Headers = $arrHeaders; } else { $pnlDummy = new QPanel($this->pnlMainTab); $arrHeaders[] = NarroLink::Project($this->objProject->ProjectId, t('Overview')); if ($this->objProject instanceof NarroProject && QApplication::HasPermissionForThisLang('Can edit project', $this->objProject->ProjectId)) { $pnlDummy = new QPanel($this->pnlMainTab); $arrHeaders[] = NarroLink::ProjectEdit($this->objProject->ProjectId, t('Edit')); } $pnlDummy = new QPanel($this->pnlMainTab); $arrHeaders[] = NarroLink::Translate($this->objProject->ProjectId, '', NarroTranslatePanel::SHOW_NOT_TRANSLATED, '', 0, 0, 10, 0, 0, t('Translate')); $this->pnlReview = new NarroTranslatePanel($this->pnlMainTab); $arrHeaders[] = t('Review'); $this->pnlMainTab->Selected = count($arrHeaders) - 1; $pnlDummy = new QPanel($this->pnlMainTab); $arrHeaders[] = NarroLink::ProjectFileList($this->objProject->ProjectId, '', '', t('Files')); $pnlDummy = new QPanel($this->pnlMainTab); $arrHeaders[] = NarroLink::ProjectLanguages($this->objProject->ProjectId, t('Languages')); if (QApplication::HasPermissionForThisLang('Can import project', $this->objProject->ProjectId)) { $pnlDummy = new QPanel($this->pnlMainTab); $arrHeaders[] = NarroLink::ProjectImport($this->objProject->ProjectId, t('Import')); } if (QApplication::HasPermissionForThisLang('Can export project', $this->objProject->ProjectId)) { $pnlDummy = new QPanel($this->pnlMainTab); $arrHeaders[] = NarroLink::ProjectExport($this->objProject->ProjectId, t('Export')); } $this->pnlMainTab->Headers = $arrHeaders; } }