Posted October 9, 20213 yr В таблицу core_sys_conf_settings добавил настройку с ключём points Трудность в том что данную настройку не показывает \IPS\Settings::i()->points Так полагаю дело в кэше, как обновить кэш? Во вторых будет ли данная конструкци работать. В ACP добавил данную настройку в своем блоку, следующим образом protected function _manageSettings() { \IPS\Dispatcher::i()->checkAcpPermission( 'points_programma_server' ); /* Build and show form */ $form = new \IPS\Helpers\Form; \IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js( 'admin_settings.js', 'core', 'admin' ) ); $form->add( new \IPS\Helpers\Form\Text( 'widget_points_ttl', \IPS\Settings::i()->points)); return $form; } При сохранении, она не обновляет значение в базе данных
October 9, 20213 yr Author Поправил protected function _manageSettings() { \IPS\Dispatcher::i()->checkAcpPermission( 'points_programma_server' ); /* Build and show form */ $form = new \IPS\Helpers\Form; \IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js( 'admin_settings.js', 'core', 'admin' ) ); $form->add( new \IPS\Helpers\Form\Text( 'widget_points_ttl', \IPS\Settings::i()->points)); if ( $values = $form->values() ) { $form->saveAsSettings( $values ); \IPS\Session::i()->log( 'acplogs__points_programma_server_edited' ); \IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=settings&controller=points_programma&tab=settings' ), 'saved' ); } return $form; } Пишет, что сохраняет, но в результате все остается на своих местах Edited October 9, 20213 yr by Zuldek
October 9, 20213 yr Author $form->add( new \IPS\Helpers\Form\Text( 'points', \IPS\Settings::i()->points, FALSE, NULL, NULL, NULL, NULL, 'points')); Таким образом работает,спс. Edited October 9, 20213 yr by Zuldek
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.