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); }
/** * Метод валидирует содержимое db.ini для заданного контекста. * Если db.ini не существует для проекта - это не ошибка. */ public static function validateIni($scope) { return $scope == ENTITY_SCOPE_PROJ && !DbIni::existsIni($scope) ? array() : self::validateIniString($scope, DbIni::getIniContent($scope)); }