diff --git a/acp/portal_module.php b/acp/portal_module.php index b1ab4060..91aa680a 100644 --- a/acp/portal_module.php +++ b/acp/portal_module.php @@ -18,7 +18,7 @@ class portal_module protected $c_class; protected $db, $user, $cache, $template, $display_vars, $config, $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_container; - protected $root_path, $version_check, $request, $php_ext, $portal_helper, $modules_helper, $log, $portal_columns; + protected $root_path, $request, $php_ext, $portal_helper, $modules_helper, $log, $portal_columns; /** @var \board3\portal\portal\modules\manager */ protected $modules_manager; @@ -51,7 +51,6 @@ class portal_module $this->phpbb_admin_path = $phpbb_admin_path; $this->php_ext = $phpEx; $this->phpbb_container = $phpbb_container; - $this->version_check = $this->phpbb_container->get('board3.portal.version.check'); $this->portal_helper = $this->phpbb_container->get('board3.portal.helper'); $this->modules_helper = $this->phpbb_container->get('board3.portal.modules_helper'); $this->log = $phpbb_log; @@ -99,7 +98,6 @@ class portal_module 'board3_enable' => array('lang' => 'PORTAL_ENABLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'board3_left_column' => array('lang' => 'PORTAL_LEFT_COLUMN', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'board3_right_column' => array('lang' => 'PORTAL_RIGHT_COLUMN', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), - 'board3_version_check' => array('lang' => 'PORTAL_VERSION_CHECK', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'board3_display_jumpbox' => array('lang' => 'PORTAL_DISPLAY_JUMPBOX', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'legend2' => 'ACP_PORTAL_COLUMN_WIDTH_SETTINGS', @@ -168,11 +166,6 @@ class portal_module $this->template->assign_var('SHOW_MODULE_OPTIONS', true); } } - else - { - // only show the mod version check if we are on the General Settings page - $this->version_check->check(); - } $this->new_config = $this->config; $cfg_array = ($this->request->is_set('config')) ? $this->request->variable('config', array('' => ''), true) : $this->new_config; diff --git a/adm/style/portal/acp_portal_config.html b/adm/style/portal/acp_portal_config.html index 33bcf81f..206ae8a3 100644 --- a/adm/style/portal/acp_portal_config.html +++ b/adm/style/portal/acp_portal_config.html @@ -13,31 +13,6 @@ - - -
- {L_VERSION_CHECK} -

{mods.UP_TO_DATE}

-
-
-
{mods.CURRENT_VERSION}
-
-
-
-
{mods.LATEST_VERSION}
-
- -
-
-
{L_DOWNLOAD} {mods.TITLE} {mods.LATEST_VERSION}
-
-
-
-
{L_RELEASE_ANNOUNCEMENT}
-
- -
-
diff --git a/config/services.yml b/config/services.yml index ceaacaa1..3099f104 100644 --- a/config/services.yml +++ b/config/services.yml @@ -2,14 +2,6 @@ imports: - { resource: modules.yml } parameters: - board3.version_data: - author: Marc - title: Board3 Portal - version: board3_portal_version - file: - - board3.de - - /updatecheck - - board3_portal.json board3.portal.config.table: %core.table_prefix%portal_config board3.portal.modules.table: %core.table_prefix%portal_modules @@ -41,16 +33,6 @@ services: - %core.root_path% - .%core.php_ext% - board3.portal.version.check: - class: board3\portal\includes\version_check - scope: prototype - arguments: - - %board3.version_data% - - @config - - @version_helper - - @template - - @user - board3.portal.module_collection: class: phpbb\di\service_collection arguments: diff --git a/includes/version_check.php b/includes/version_check.php deleted file mode 100644 index f85e5e41..00000000 --- a/includes/version_check.php +++ /dev/null @@ -1,134 +0,0 @@ -version_data = $version_data; - $this->config = $config; - $this->version_helper = $version_helper; - $this->template = $template; - $this->user = $user; - $this->current_version = $this->config[str_replace(' ', '', $this->version_data['version'])]; - } - - /** - * Check MOD version and assign template variables for version info if not - * returning current version - * - * @param bool $return_version Yes if current version should be returned - * @return string|bool Current version if $return_version is set to true, false if not - */ - public function check($return_version = false) - { - // Set file location - $this->version_helper->set_file_location($this->version_data['file'][0], $this->version_data['file'][1], $this->version_data['file'][2]); - // Set current version - $this->version_helper->set_current_version($this->current_version); - - $this->version_helper->force_stability(($this->config['extension_force_unstable'] || !$this->version_helper->is_stable($this->current_version)) ? 'unstable' : null); - - // Expect version_helper to throw RuntimeExceptions - try - { - $this->update_data = $this->version_helper->get_suggested_updates(true); - } - catch (\RuntimeException $e) - { - return false; - } - - // Return version if $return_version is set to true - if ($return_version) - { - return $this->current_version; - } - - $version_up_to_date = empty($this->update_data); - - $this->template_data = array( - 'AUTHOR' => $this->version_data['author'], - 'CURRENT_VERSION' => $this->current_version, - 'UP_TO_DATE' => sprintf((!$version_up_to_date) ? $this->user->lang['NOT_UP_TO_DATE'] : $this->user->lang['UP_TO_DATE'], $this->version_data['title']), - 'S_UP_TO_DATE' => $version_up_to_date, - 'U_AUTHOR' => 'http://www.phpbb.com/community/memberlist.php?mode=viewprofile&un=' . $this->version_data['author'], - 'TITLE' => (string) $this->version_data['title'], - 'LATEST_VERSION' => $this->current_version, - ); - - $this->display_update_information(); - $this->template->assign_block_vars('mods', $this->template_data); - - return false; - } - - /** - * Display update information if updates exist - */ - protected function display_update_information() - { - if (!empty($this->update_data)) - { - $update = array_shift($this->update_data); - $this->template_data = array_merge($this->template_data, array( - 'ANNOUNCEMENT' => (string) $update['announcement'], - 'DOWNLOAD' => (string) $update['download'], - 'LATEST_VERSION' => $update['current'], - )); - } - } -} diff --git a/language/de/portal_acp.php b/language/de/portal_acp.php index 81246387..716b26fd 100644 --- a/language/de/portal_acp.php +++ b/language/de/portal_acp.php @@ -88,7 +88,6 @@ $lang = array_merge($lang, array( 'PORTAL_LEFT_COLUMN_EXP' => 'Die Linke Spalte auf dem Portal anzeigen', 'PORTAL_RIGHT_COLUMN' => 'Rechte Spalte aktivieren', 'PORTAL_RIGHT_COLUMN_EXP' => 'Die Rechte Spalte auf dem Portal anzeigen', - 'PORTAL_VERSION_CHECK' => 'Versioncheck auf Portal', 'ACP_PORTAL_COLUMN_WIDTH_SETTINGS' => 'Breiteneinstellung der rechten und linken Spalte', 'PORTAL_LEFT_COLUMN_WIDTH' => 'Breite der linken Spalte', 'PORTAL_LEFT_COLUMN_WIDTH_EXP' => 'Ändere hier die Breite der linken Spalte in Pixel, empfohlener Wert 180', @@ -107,17 +106,4 @@ $lang = array_merge($lang, array( // Install 'PORTAL_BASIC_INSTALL' => 'Füge Basismodule hinzu', 'PORTAL_BASIC_UNINSTALL' => 'Entferne Module von Datenbank', - - /** - * A copy of Handyman` s MOD version check, to view it on the gallery overview - */ - 'ANNOUNCEMENT_TOPIC' => 'Release Ankündigung', - 'CURRENT_VERSION' => 'Derzeitige Version', - 'DOWNLOAD_LATEST' => 'Neueste Version herunterladen', - 'LATEST_VERSION' => 'Neueste Version', - 'NO_INFO' => 'Der Server konnte nicht erreicht werden', - 'NOT_UP_TO_DATE' => '%s ist nicht aktuell', - 'RELEASE_ANNOUNCEMENT' => 'Ankündigungsthema', - 'UP_TO_DATE' => '%s ist aktuell', - 'VERSION_CHECK' => 'Extension Version Check', )); diff --git a/language/en/portal_acp.php b/language/en/portal_acp.php index 35575c26..e4d43e64 100644 --- a/language/en/portal_acp.php +++ b/language/en/portal_acp.php @@ -88,7 +88,6 @@ $lang = array_merge($lang, array( 'PORTAL_LEFT_COLUMN_EXP' => 'Switch to no if you wish to turn off the left column', 'PORTAL_RIGHT_COLUMN' => 'Enable right column', 'PORTAL_RIGHT_COLUMN_EXP' => 'Switch to no if you wish to turn off the right column', - 'PORTAL_VERSION_CHECK' => 'Versioncheck on Portal', 'PORTAL_DISPLAY_JUMPBOX' => 'Display jumpbox', 'PORTAL_DISPLAY_JUMPBOX_EXP' => 'Display the jumpbox on the portal. The jumpbox will only be displayed if it is also enabled in the board features.', 'ACP_PORTAL_COLUMN_WIDTH_SETTINGS' => 'Left and right column width settings', @@ -107,17 +106,4 @@ $lang = array_merge($lang, array( // Install 'PORTAL_BASIC_INSTALL' => 'Adding basic set of modules', 'PORTAL_BASIC_UNINSTALL' => 'Removing modules from database', - - /** - * A copy of Handyman` s MOD version check, to view it on the portal overview - */ - 'ANNOUNCEMENT_TOPIC' => 'Release Announcement', - 'CURRENT_VERSION' => 'Current Version', - 'DOWNLOAD_LATEST' => 'Download Latest Version', - 'LATEST_VERSION' => 'Latest Version', - 'NO_INFO' => 'Version server could not be contacted', - 'NOT_UP_TO_DATE' => '%s is not up to date', - 'RELEASE_ANNOUNCEMENT' => 'Annoucement Topic', - 'UP_TO_DATE' => '%s is up to date', - 'VERSION_CHECK' => 'Extension Version Check', )); diff --git a/language/es/portal_acp.php b/language/es/portal_acp.php index 33cd3490..a5bc458a 100644 --- a/language/es/portal_acp.php +++ b/language/es/portal_acp.php @@ -86,7 +86,6 @@ $lang = array_merge($lang, array( 'PORTAL_LEFT_COLUMN_EXP' => 'Cambie a No si desea deshabilitar la columna de la izquierda.', 'PORTAL_RIGHT_COLUMN' => 'Habilitar columna derecha', 'PORTAL_RIGHT_COLUMN_EXP' => 'Cambie a No si desea deshabilitar la columna de la derecha.', - 'PORTAL_VERSION_CHECK' => 'Versioncheck en el Portal', 'PORTAL_DISPLAY_JUMPBOX' => 'Mostrar Ir a', 'PORTAL_DISPLAY_JUMPBOX_EXP' => 'Mostrar Ir a en el portal. El Ir a sólo se muestra si está activo también en las Características del sitio.', 'ACP_PORTAL_COLUMN_WIDTH_SETTINGS' => 'Configuración de ancho de columnas izquierda y derecha', @@ -101,17 +100,4 @@ $lang = array_merge($lang, array( // Install 'PORTAL_BASIC_INSTALL' => 'Agregando un conjunto básico de módulos', 'PORTAL_BASIC_UNINSTALL' => 'Eliminando módulos de la base de datos', - - /** - * A copy of Handyman` s MOD version check, to view it on the portal overview - */ - 'ANNOUNCEMENT_TOPIC' => 'Anuncio de lanzamiento', - 'CURRENT_VERSION' => 'Versión Actual', - 'DOWNLOAD_LATEST' => 'Descarga la última versión', - 'LATEST_VERSION' => 'Última versión', - 'NO_INFO' => 'Version server could not be contacted', - 'NOT_UP_TO_DATE' => '%s no está actualizado', - 'RELEASE_ANNOUNCEMENT' => 'Tema del Anuncio', - 'UP_TO_DATE' => '%s está actualizado', - 'VERSION_CHECK' => 'Comprobar versión de extensión', )); diff --git a/language/fr/portal_acp.php b/language/fr/portal_acp.php index 9fb7e8cb..8f923c13 100644 --- a/language/fr/portal_acp.php +++ b/language/fr/portal_acp.php @@ -89,7 +89,6 @@ $lang = array_merge($lang, array( 'PORTAL_LEFT_COLUMN_EXP' => 'Changer sur « Non » si vous souhaitez désactiver la colonne de gauche.', 'PORTAL_RIGHT_COLUMN' => 'Activer la colonne de droite', 'PORTAL_RIGHT_COLUMN_EXP' => 'Changer sur « Non » si vous souhaitez désactiver la colonne de droite.', - 'PORTAL_VERSION_CHECK' => 'Vérification de la version du portail', 'PORTAL_DISPLAY_JUMPBOX' => 'Afficher l’accès rapide aux forums', 'PORTAL_DISPLAY_JUMPBOX_EXP' => 'Afficher l’accès rapide aux forums sur le portail. L’accès rapide aux forums ne sera affiché que si il est également activé dans les fonctionnalités du forum.', 'ACP_PORTAL_COLUMN_WIDTH_SETTINGS' => 'Paramètres de largeur des colonnes de gauche et de droite', @@ -108,17 +107,4 @@ $lang = array_merge($lang, array( // Install 'PORTAL_BASIC_INSTALL' => 'Ajout d’un ensemble de modules de base', 'PORTAL_BASIC_UNINSTALL' => 'Suppression des modules de la base de données', - - /** - * A copy of Handyman` s MOD version check, to view it on the portal overview - */ - 'ANNOUNCEMENT_TOPIC' => 'Annonce', - 'CURRENT_VERSION' => 'Version actuelle', - 'DOWNLOAD_LATEST' => 'Télécharger la dernière version', - 'LATEST_VERSION' => 'Dernière version', - 'NO_INFO' => 'Le serveur n’a pu être contacté', - 'NOT_UP_TO_DATE' => '%s n’est pas à jour', - 'RELEASE_ANNOUNCEMENT' => ' Date de publication de l’annonce', - 'UP_TO_DATE' => 'L’extension %s est à jour', - 'VERSION_CHECK' => 'Vérification de la version du portail', )); diff --git a/language/it/portal_acp.php b/language/it/portal_acp.php index dfdc4563..96ecb5a8 100644 --- a/language/it/portal_acp.php +++ b/language/it/portal_acp.php @@ -86,7 +86,6 @@ $lang = array_merge($lang, array( 'PORTAL_LEFT_COLUMN_EXP' => 'Impostare su "No" per nascondere la colonna sinistra', 'PORTAL_RIGHT_COLUMN' => 'Enable right column', 'PORTAL_RIGHT_COLUMN_EXP' => 'Impostare su "No" per nascondere la colonna destra', - 'PORTAL_VERSION_CHECK' => 'Versioncheck on Portal', 'PORTAL_DISPLAY_JUMPBOX' => 'Mostra jumpbox', 'PORTAL_DISPLAY_JUMPBOX_EXP' => 'Mostra la jumpbox nel portale. La jumpbox sarà mostrata se abilitata nelle impostazioni della board.', 'ACP_PORTAL_COLUMN_WIDTH_SETTINGS' => 'Impostazioni larghezza colonna sinistra e destra', @@ -101,17 +100,4 @@ $lang = array_merge($lang, array( // Install 'PORTAL_BASIC_INSTALL' => 'Aggiunta moduli di base', 'PORTAL_BASIC_UNINSTALL' => 'Rimozione dei moduli dal database', - - /** - * A copy of Handyman` s MOD version check, to view it on the portal overview - */ - 'ANNOUNCEMENT_TOPIC' => 'Annuncio rilascio', - 'CURRENT_VERSION' => 'Versione corrente', - 'DOWNLOAD_LATEST' => 'Scarica ultima versione', - 'LATEST_VERSION' => 'Ultima versione', - 'NO_INFO' => 'Impossibile contattare il server per il controllo versione', - 'NOT_UP_TO_DATE' => '%s non è aggiornato', - 'RELEASE_ANNOUNCEMENT' => 'Topic annuncio', - 'UP_TO_DATE' => '%s è aggiornato', - 'VERSION_CHECK' => 'Estensione controllo versione', )); diff --git a/language/nl/portal_acp.php b/language/nl/portal_acp.php index 7e450749..e7956ee1 100644 --- a/language/nl/portal_acp.php +++ b/language/nl/portal_acp.php @@ -81,7 +81,6 @@ $lang = array_merge($lang, array( 'PORTAL_LEFT_COLUMN_EXP' => 'Verander naar nee als je de linkerkolom wilt uitschakelen', 'PORTAL_RIGHT_COLUMN' => 'Rechterkolom inschakelen', 'PORTAL_RIGHT_COLUMN_EXP' => 'Verander naar nee als je de rechterkolom wilt uitschakelen', - 'PORTAL_VERSION_CHECK' => 'Versiecontrole op portaalpagina', 'PORTAL_DISPLAY_JUMPBOX' => 'Jumpbox weergeven', 'PORTAL_DISPLAY_JUMPBOX_EXP' => 'Jumpbox op de portaalpagina weergeven. De jumpbox wordt alleen zichtbaar als je hem hebt ingeschakeld bij de forumfuncties.', 'ACP_PORTAL_COLUMN_WIDTH_SETTINGS' => 'Linker en rechterkolom breedte instellingen', @@ -95,17 +94,4 @@ $lang = array_merge($lang, array( // Install 'PORTAL_BASIC_INSTALL' => 'Basisset van modules toevoegen', 'PORTAL_BASIC_UNINSTALL' => 'Modules verwijderen uit de database', - - /** - * A copy of Handyman` s MOD version check, to view it on the portal overview - */ - 'ANNOUNCEMENT_TOPIC' => 'Release aankondiging', - 'CURRENT_VERSION' => 'Huidige versie', - 'DOWNLOAD_LATEST' => 'Download de laatste versie', - 'LATEST_VERSION' => 'Laatste versie', - 'NO_INFO' => 'De server voor de versie controle kan niet worden bereikt', - 'NOT_UP_TO_DATE' => '%s is niet up-to-date', - 'RELEASE_ANNOUNCEMENT' => 'Aankondigingsonderwerp', - 'UP_TO_DATE' => '%s is up-to-date', - 'VERSION_CHECK' => 'EXT Versie Controle', )); diff --git a/migrations/v210.php b/migrations/v210.php index f357afc6..082564f3 100644 --- a/migrations/v210.php +++ b/migrations/v210.php @@ -20,6 +20,7 @@ class v210 extends \phpbb\db\migration\migration { return array( array('config.update', array('board3_portal_version', '2.1.0')), + array('config.remove', array('board3_version_check')), array('custom', array(array($this, 'add_donation_setting'))), array('custom', array(array($this, 'convert_serialize_to_json'))), ); diff --git a/styles/prosilver/template/portal/portal_body.html b/styles/prosilver/template/portal/portal_body.html index 0a14b58e..91941f80 100644 --- a/styles/prosilver/template/portal/portal_body.html +++ b/styles/prosilver/template/portal/portal_body.html @@ -1,14 +1,6 @@ - -
-
- {L_INFORMATION}{L_COLON} {PORTAL_VERSION_CHECK} -
-
- -
diff --git a/styles/subsilver2/template/portal/portal_body.html b/styles/subsilver2/template/portal/portal_body.html index 6c1eba39..f0497227 100644 --- a/styles/subsilver2/template/portal/portal_body.html +++ b/styles/subsilver2/template/portal/portal_body.html @@ -1,20 +1,6 @@ - - - - - - - - -
- -
-
- - diff --git a/tests/unit/acp/move_module_test.php b/tests/unit/acp/move_module_test.php index f3589c48..125b1977 100644 --- a/tests/unit/acp/move_module_test.php +++ b/tests/unit/acp/move_module_test.php @@ -38,11 +38,6 @@ class phpbb_acp_move_module_test extends \board3\portal\tests\testframework\data $user = new \board3\portal\tests\mock\user(); $request = new \phpbb_mock_request; $phpbb_container = new \phpbb_mock_container_builder(); - // Mock version check - $phpbb_container->set('board3.portal.version.check', - $this->getMockBuilder('\board3\portal\includes\version_check') - ->disableOriginalConstructor() - ->getMock()); // Mock module service collection $config = new \phpbb\config\config(array()); $auth = $this->getMock('\phpbb\auth\auth', array('acl_get')); diff --git a/tests/unit/functions/version_check_test.php b/tests/unit/functions/version_check_test.php deleted file mode 100644 index a46864e2..00000000 --- a/tests/unit/functions/version_check_test.php +++ /dev/null @@ -1,82 +0,0 @@ -version_data = array( - 'author' => 'Marc', - 'version' => 'board3_portal_version', - 'title' => 'Board3 Portal', - 'file' => array('board3.de', '/updatecheck', 'board3_portal.json'), - ); - $this->config = new \phpbb\config\config(array()); - $this->user = new \board3\portal\tests\mock\user; - $this->user->set(array( - 'NO_INFO' => 'NO_INFO', - 'NOT_UP_TO_DATE' => 'NOT_UP_TO_DATE', - 'UP_TO_DATE' => 'UP_TO_DATE', - )); - $this->cache = $this->getMockBuilder('\phpbb\cache\service') - ->disableOriginalConstructor() - ->getMock(); - } - - protected function get_version_helper($version) - { - $this->config->set('board3_portal_version', $version); - - $this->template = new \board3\portal\tests\mock\template($this); - $version_helper = new \phpbb\version_helper($this->cache, $this->config, new \phpbb\file_downloader(), new \phpbb\user('\phpbb\datetime')); - $this->version_check = new \board3\portal\includes\version_check($this->version_data, $this->config, $version_helper, $this->template, $this->user); - } - - public function data_version_check() - { - return array( - array('2.1.0', array( - 'CURRENT_VERSION' => '2.1.0', - 'TITLE' => 'Board3 Portal', - 'UP_TO_DATE' => 'UP_TO_DATE', - 'S_UP_TO_DATE' => true, - 'LATEST_VERSION' => '2.1.0', - )), - array('2.1.0-a1', array( - 'CURRENT_VERSION' => '2.1.0-a1', - 'TITLE' => 'Board3 Portal', - 'UP_TO_DATE' => 'NOT_UP_TO_DATE', - 'S_UP_TO_DATE' => false, - 'LATEST_VERSION' => '2.1.0-rc2', - )), - ); - } - - /** - * @dataProvider data_version_check - */ - public function test_version_up_to_date($version, $template_data) - { - $this->get_version_helper($version); - $this->assertEquals($version, $this->version_check->check(true)); - $this->assertFalse($this->version_check->check()); - $this->template->assert_equals($template_data, 'mods'); - } -}