get('/configuration/', function(Application $app, Request $request) { $registry = $app['phraseanet.core']['Registry']; $sphinxConf = new \sphinx_configuration(); $selected_charsets = $registry->get('sphinx_charset_tables'); $selected_libstemmer = $registry->get('sphinx_user_stemmer'); $options = array( 'charset_tables' => ( ! is_array($selected_charsets) ? array() : $selected_charsets), 'libstemmer' => ( ! is_array($selected_libstemmer) ? array() : $selected_libstemmer) ); return new Response($app['twig']->render('admin/sphinx/configuration.html.twig', array( 'configuration' => $sphinxConf, 'options' => $options ))); }); $controllers->post('/configuration/', function(Application $app, Request $request) { $registry = $app['phraseanet.core']['Registry']; $registry->set( 'sphinx_charset_tables', $request->get('charset_tables', array()), \registry::TYPE_ARRAY ); $registry->set( 'sphinx_user_stemmer', $request->get('libstemmer', array()), \registry::TYPE_ARRAY ); return $app->redirect('/admin/sphinx/configuration/?update=ok'); }); return $controllers; } }