diff options
Diffstat (limited to 'phpBB/install/helper/iohandler')
-rw-r--r-- | phpBB/install/helper/iohandler/ajax_iohandler.php | 51 | ||||
-rw-r--r-- | phpBB/install/helper/iohandler/factory.php | 4 | ||||
-rw-r--r-- | phpBB/install/helper/iohandler/iohandler_interface.php | 19 |
3 files changed, 74 insertions, 0 deletions
diff --git a/phpBB/install/helper/iohandler/ajax_iohandler.php b/phpBB/install/helper/iohandler/ajax_iohandler.php index 960dd615b5..71571fecba 100644 --- a/phpBB/install/helper/iohandler/ajax_iohandler.php +++ b/phpBB/install/helper/iohandler/ajax_iohandler.php @@ -34,6 +34,16 @@ class ajax_iohandler extends iohandler_base protected $form; /** + * @var bool + */ + protected $request_client_refresh; + + /** + * @var array + */ + protected $nav_data; + + /** * Constructor * * @param \phpbb\request\request_interface $request HTTP request interface @@ -44,6 +54,7 @@ class ajax_iohandler extends iohandler_base $this->request = $request; $this->template = $template; $this->form = ''; + $this->nav_data = array(); parent::__construct(); } @@ -89,6 +100,8 @@ class ajax_iohandler extends iohandler_base // This code is pretty ugly... but works // + $this->template->assign_var('S_FORM_ELEM_COUNT', sizeof($form)); + $this->template->assign_block_vars('options', array( 'LEGEND' => $this->language->lang($title), 'S_LEGEND' => true, @@ -187,9 +200,21 @@ class ajax_iohandler extends iohandler_base ); } + if (!empty($this->nav_data)) + { + $json_array['nav'] = $this->nav_data; + } + $this->errors = array(); $this->warnings = array(); $this->logs = array(); + $this->nav_data = array(); + + if ($this->request_client_refresh) + { + $json_array['refresh'] = true; + $this->request_client_refresh = false; + } return $json_array; } @@ -204,6 +229,32 @@ class ajax_iohandler extends iohandler_base } /** + * {@inheritdoc} + */ + public function request_refresh() + { + $this->request_client_refresh = true; + } + + /** + * {@inheritdoc} + */ + public function set_active_stage_menu($menu_path) + { + $this->nav_data['active'] = $menu_path[sizeof($menu_path) - 1]; + $this->send_response(); + } + + /** + * {@inheritdoc} + */ + public function set_finished_stage_menu($menu_path) + { + $this->nav_data['finished'][] = $menu_path[sizeof($menu_path) - 1]; + $this->send_response(); + } + + /** * Callback function for language replacing * * @param array $matches diff --git a/phpBB/install/helper/iohandler/factory.php b/phpBB/install/helper/iohandler/factory.php index 0b59e5ec63..0af75b78ae 100644 --- a/phpBB/install/helper/iohandler/factory.php +++ b/phpBB/install/helper/iohandler/factory.php @@ -64,6 +64,10 @@ class factory case 'ajax': return $this->container->get('installer.helper.iohandler_ajax'); break; + case 'nojs': + // @todo replace this + return $this->container->get('installer.helper.iohandler_ajax'); + break; default: throw new iohandler_not_implemented_exception(); break; diff --git a/phpBB/install/helper/iohandler/iohandler_interface.php b/phpBB/install/helper/iohandler/iohandler_interface.php index 387a8617b9..c40fea24ce 100644 --- a/phpBB/install/helper/iohandler/iohandler_interface.php +++ b/phpBB/install/helper/iohandler/iohandler_interface.php @@ -123,4 +123,23 @@ interface iohandler_interface * @param int $task_number Position of the current task in the task queue */ public function set_progress($task_lang_key, $task_number); + + /** + * Sends refresh request to the client + */ + public function request_refresh(); + + /** + * Marks stage as active in the navigation bar + * + * @param array $menu_path Array to the navigation elem + */ + public function set_active_stage_menu($menu_path); + + /** + * Marks stage as completed in the navigation bar + * + * @param array $menu_path Array to the navigation elem + */ + public function set_finished_stage_menu($menu_path); } |