public function buildContent() { $navigation = AdminPageNavigation::inst(); $PARAMS['mode'] = self::MODE_TABLES_LIST; /* * Просмотр содержимого таблицы */ $table = RequestArrayAdapter::inst()->str('table'); if ($table) { $PARAMS['mode'] = self::MODE_TABLE_VIEW; $table = PsTable::inst($table); $PARAMS['table'] = $table; $PARAMS['rows'] = $table->getRows(); $navigation->addPath(self::urlTables(), 'Настройки'); $navigation->setCurrent('Просмотр ' . $table->getName()); } /* * Просмотр и настройка всех таблиц */ if ($PARAMS['mode'] == self::MODE_TABLES_LIST) { $PARAMS['errors'] = PsDbIniHelper::validateAll(); foreach (ConfigIni::getAllowedScopes() as $scope) { $PARAMS['data'][$scope] = TableExporter::inst()->getTables($scope); $PARAMS['data']["{$scope}.ini"] = DbIni::getIniContent($scope); } $navigation->setCurrent('Настройки'); } echo $this->getFoldedEntity()->fetchTpl($PARAMS); }
public function buildContent() { $navigation = AdminPageNavigation::inst(); $PARAMS['mode'] = self::MODE_TABLES_LIST; foreach (ConfigIni::getAllowedScopes() as $scope) { $PARAMS['data']["{$scope}.ini"] = ConfigIni::getIniContent($scope); } $navigation->setCurrent('Настройки'); echo $this->getFoldedEntity()->fetchTpl($PARAMS); }
/** * Метод валидирует все доступные db.ini */ public static function validateAll() { PsProfiler::inst(__CLASS__)->start(__FUNCTION__); $errors = array(); foreach (ConfigIni::getAllowedScopes() as $scope) { $err = self::validateIni($scope); if ($err) { $errors[$scope] = $err; } } PsProfiler::inst(__CLASS__)->stop(); return $errors; }