<?php if (!defined('DEBUG_MODE')) { die; } handler_source('imap'); output_source('imap'); /* setup imap info for all pages for background unread checks */ add_module_to_all_pages('handler', 'load_imap_servers_from_config', true, 'imap', 'load_user_data', 'after'); add_module_to_all_pages('handler', 'imap_oauth2_token_check', true, 'imap', 'load_imap_servers_from_config', 'after'); add_module_to_all_pages('handler', 'load_imap_servers_for_message_list', true, 'imap', 'imap_oauth2_token_check', 'after'); add_module_to_all_pages('handler', 'add_imap_servers_to_page_data', true, 'imap', 'imap_oauth2_token_check', 'after'); /* add stuff to the info page */ add_output('info', 'display_imap_status', true, 'imap', 'server_status_start', 'after'); add_output('info', 'imap_server_ids', true, 'imap', 'page_js', 'before'); /* servers page data */ add_handler('servers', 'process_add_imap_server', true, 'imap', 'message_list_type', 'after'); add_handler('servers', 'save_imap_servers', true, 'imap', 'process_add_imap_server', 'after'); add_output('servers', 'add_imap_server_dialog', true, 'imap', 'server_content_start', 'after'); add_output('servers', 'display_configured_imap_servers', true, 'imap', 'add_imap_server_dialog', 'after'); add_output('servers', 'imap_server_ids', true, 'imap', 'page_js', 'before'); /* settings page data */ add_output('settings', 'imap_server_ids', true, 'imap', 'page_js', 'before'); /* compose page data */ add_output('compose', 'imap_server_ids', true, 'imap', 'page_js', 'before'); /* search page data */ add_handler('search', 'load_imap_servers_for_search', true, 'imap', 'message_list_type', 'after'); add_handler('search', 'imap_message_list_type', true, 'imap', 'message_list_type', 'after'); /* message list pages */ add_handler('message_list', 'imap_message_list_type', true, 'imap', 'message_list_type', 'after'); add_output('message_list', 'imap_custom_controls', true, 'imap', 'message_list_heading', 'before');
<?php if (!defined('DEBUG_MODE')) { die; } handler_source('smtp'); output_source('smtp'); add_module_to_all_pages('handler', 'smtp_default_server', true, 'smtp', 'load_user_data', 'after'); add_handler('compose', 'load_smtp_servers_from_config', true, 'smtp', 'load_user_data', 'after'); add_handler('compose', 'add_smtp_servers_to_page_data', true, 'smtp', 'load_smtp_servers_from_config', 'after'); add_handler('compose', 'process_compose_form_submit', true, 'smtp', 'load_smtp_servers_from_config', 'after'); add_output('compose', 'compose_form', true, 'smtp', 'content_section_start', 'after'); /* servers page */ add_handler('servers', 'load_smtp_servers_from_config', true, 'smtp', 'language', 'after'); add_handler('servers', 'process_add_smtp_server', true, 'smtp', 'load_smtp_servers_from_config', 'after'); add_handler('servers', 'add_smtp_servers_to_page_data', true, 'smtp', 'process_add_smtp_server', 'after'); add_handler('servers', 'save_smtp_servers', true, 'smtp', 'add_smtp_servers_to_page_data', 'after'); add_output('servers', 'add_smtp_server_dialog', true, 'smtp', 'server_content_start', 'after'); add_output('servers', 'display_configured_smtp_servers', true, 'smtp', 'add_smtp_server_dialog', 'after'); add_handler('settings', 'process_compose_type', true, 'smtp', 'save_user_settings', 'before'); add_output('settings', 'compose_type_setting', true, 'smtp', 'start_general_settings', 'after'); /* ajax server setup callback data */ add_handler('ajax_smtp_debug', 'login', false, 'core'); add_handler('ajax_smtp_debug', 'load_user_data', true, 'core'); add_handler('ajax_smtp_debug', 'load_smtp_servers_from_config', true); add_handler('ajax_smtp_debug', 'add_smtp_servers_to_page_data', true); add_handler('ajax_smtp_debug', 'smtp_connect', true); add_handler('ajax_smtp_debug', 'smtp_delete', true); add_handler('ajax_smtp_debug', 'smtp_forget', true); add_handler('ajax_smtp_debug', 'smtp_save', true); add_handler('ajax_smtp_debug', 'save_smtp_servers', true);
<?php if (!defined('DEBUG_MODE')) { die; } handler_source('swipe_2fa'); output_source('swipe_2fa'); add_module_to_all_pages('handler', 'swipe_2fa_check', true, 'swipe_2fa', 'save_user_data', 'after'); add_module_to_all_pages('output', 'swipe_2fa_dialog', true, 'swipe_2fa', 'header_start', 'before'); return array('allowed_post' => array('sms_number' => FILTER_SANITIZE_STRING, '2fa_sms_response' => FILTER_SANITIZE_STRING));
<?php if (!defined('DEBUG_MODE')) { die; } handler_source('idle_timer'); output_source('idle_timer'); /* settings page */ add_handler('settings', 'process_idle_time_setting', true, 'idle_timer', 'date', 'after'); add_output('settings', 'idle_time_setting', true, 'idle_timer', 'list_style_setting', 'after'); add_module_to_all_pages('handler', 'idle_time_check', true, 'idle_timer', 'load_user_data', 'after'); /* no-op poll */ add_handler('ajax_no_op', 'login', false, 'core'); add_handler('ajax_no_op', 'load_user_data', true, 'core'); add_handler('ajax_no_op', 'process_idle_time', true); add_handler('ajax_no_op', 'date', true, 'core'); add_handler('ajax_no_op', 'http_headers', true, 'core'); return array('allowed_pages' => array('ajax_no_op'), 'allowed_post' => array('idle_time' => FILTER_VALIDATE_INT));
<?php if (!defined('DEBUG_MODE')) { die; } handler_source('github'); output_source('github'); add_handler('ajax_hm_folders', 'github_folders_data', true, 'github', 'load_user_data', 'after'); add_output('ajax_hm_folders', 'github_folders', true, 'github', 'folder_list_content_start', 'before'); add_module_to_all_pages('handler', 'github_list_type', true, 'github', 'message_list_type', 'after'); add_handler('servers', 'setup_github_connect', true, 'github', 'load_user_data', 'after'); add_handler('servers', 'github_disconnect', true, 'github', 'setup_github_connect', 'after'); add_handler('servers', 'github_process_add_repo', true, 'github', 'github_disconnect', 'after'); add_handler('servers', 'github_process_remove_repo', true, 'github', 'github_process_add_repo', 'after'); add_output('servers', 'github_connect_section', true, 'github', 'server_content_end', 'before'); add_output('servers', 'github_add_repo', true, 'github', 'github_connect_section', 'after'); add_handler('home', 'process_github_authorization', true, 'github', 'load_user_data', 'after'); add_handler('ajax_message_action', 'github_message_action', true, 'github', 'load_user_data', 'after'); add_handler('ajax_github_data', 'login', false, 'core'); add_handler('ajax_github_data', 'load_user_data', true, 'core'); add_handler('ajax_github_data', 'language', true, 'core'); add_handler('ajax_github_data', 'github_list_data', true); add_handler('ajax_github_data', 'close_session_early', true, 'core'); add_handler('ajax_github_data', 'date', true, 'core'); add_handler('ajax_github_data', 'http_headers', true, 'core'); add_output('ajax_github_data', 'filter_github_data', true); add_handler('info', 'load_github_repos', true, 'github', 'language', 'after'); add_output('info', 'display_github_status', true, 'github', 'server_status_start', 'after'); add_handler('ajax_github_event_detail', 'login', false, 'core'); add_handler('ajax_github_event_detail', 'load_user_data', true, 'core'); add_handler('ajax_github_event_detail', 'language', true, 'core');
/** * @preserveGlobalState disabled * @runInSeparateProcess */ public function test_add_module_to_all_pages() { add_handler('test', 'test_mod', false); add_output('test', 'test_mod', false); add_module_to_all_pages('output', 'all_pages', false, 'test', false, false); add_module_to_all_pages('handler', 'all_pages', false, 'test', false, false); Hm_Output_Modules::process_all_page_queue(); Hm_Handler_Modules::process_all_page_queue(); $mods = Hm_Output_Modules::dump(); foreach ($mods as $name => $vals) { if (!preg_match("/^ajax_/", $name)) { $this->assertTrue(array_key_exists('all_pages', $vals)); } } $mods = Hm_Handler_Modules::dump(); foreach ($mods as $name => $vals) { if (!preg_match("/^ajax_/", $name)) { $this->assertTrue(array_key_exists('all_pages', $vals)); } } }
<?php if (!defined('DEBUG_MODE')) { die; } handler_source('themes'); output_source('themes'); add_module_to_all_pages('handler', 'load_theme', true, 'themes', 'load_user_data', 'after'); add_module_to_all_pages('output', 'theme_css', true, 'themes', 'header_css', 'after'); add_handler('ajax_hm_folders', 'load_theme', true, 'themes', 'load_user_data', 'after'); add_handler('ajax_imap_folder_expand', 'load_theme', true, 'themes', 'load_user_data', 'after'); add_handler('settings', 'process_theme_setting', true, 'themes', 'save_user_settings', 'before'); add_output('settings', 'theme_setting', true, 'feeds', 'language_setting', 'after'); return array('allowed_post' => array('theme_setting' => FILTER_SANITIZE_STRING));