[ticket/577] Use phpBB's extension version check instead of B3P version

B3P-577
This commit is contained in:
Marc Alexander
2015-06-06 23:38:17 +02:00
parent 55d7991829
commit a927aae498
15 changed files with 2 additions and 378 deletions

View File

@@ -18,7 +18,7 @@ class portal_module
protected $c_class; protected $c_class;
protected $db, $user, $cache, $template, $display_vars, $config, $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_container; 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 */ /** @var \board3\portal\portal\modules\manager */
protected $modules_manager; protected $modules_manager;
@@ -51,7 +51,6 @@ class portal_module
$this->phpbb_admin_path = $phpbb_admin_path; $this->phpbb_admin_path = $phpbb_admin_path;
$this->php_ext = $phpEx; $this->php_ext = $phpEx;
$this->phpbb_container = $phpbb_container; $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->portal_helper = $this->phpbb_container->get('board3.portal.helper');
$this->modules_helper = $this->phpbb_container->get('board3.portal.modules_helper'); $this->modules_helper = $this->phpbb_container->get('board3.portal.modules_helper');
$this->log = $phpbb_log; $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_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_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_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), 'board3_display_jumpbox' => array('lang' => 'PORTAL_DISPLAY_JUMPBOX', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'legend2' => 'ACP_PORTAL_COLUMN_WIDTH_SETTINGS', 'legend2' => 'ACP_PORTAL_COLUMN_WIDTH_SETTINGS',
@@ -168,11 +166,6 @@ class portal_module
$this->template->assign_var('SHOW_MODULE_OPTIONS', true); $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; $this->new_config = $this->config;
$cfg_array = ($this->request->is_set('config')) ? $this->request->variable('config', array('' => ''), true) : $this->new_config; $cfg_array = ($this->request->is_set('config')) ? $this->request->variable('config', array('' => ''), true) : $this->new_config;

View File

@@ -13,31 +13,6 @@
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->
<!-- BEGIN mods -->
<fieldset>
<legend>{L_VERSION_CHECK}</legend>
<p style="font-weight: bold; color: <!-- IF mods.S_UP_TO_DATE -->#228822<!-- ELSE -->#BC2A4D<!-- ENDIF -->;">{mods.UP_TO_DATE}</p>
<dl>
<dt><label>{L_CURRENT_VERSION}</label></dt>
<dd><strong>{mods.CURRENT_VERSION}</strong></dd>
</dl>
<dl>
<dt><label>{L_LATEST_VERSION}</label></dt>
<dd><strong>{mods.LATEST_VERSION}</strong></dd>
</dl>
<!-- IF not mods.S_UP_TO_DATE -->
<dl>
<dt><label>{L_DOWNLOAD_LATEST}</label></dt>
<dd><strong><a href="{mods.DOWNLOAD}">{L_DOWNLOAD} {mods.TITLE} {mods.LATEST_VERSION}</a></strong></dd>
</dl>
<dl>
<dt><label>{L_ANNOUNCEMENT_TOPIC}</label></dt>
<dd><strong><a href="{mods.ANNOUNCEMENT}">{L_RELEASE_ANNOUNCEMENT}</a></strong></dd>
</dl>
<!-- ENDIF -->
</fieldset>
<!-- END mods -->
<form id="acp_portal_config" method="post" action="{B3P_U_ACTION}"> <form id="acp_portal_config" method="post" action="{B3P_U_ACTION}">
<!-- IF SHOW_MODULE_OPTIONS --> <!-- IF SHOW_MODULE_OPTIONS -->
<fieldset> <fieldset>

View File

@@ -2,14 +2,6 @@ imports:
- { resource: modules.yml } - { resource: modules.yml }
parameters: 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.config.table: %core.table_prefix%portal_config
board3.portal.modules.table: %core.table_prefix%portal_modules board3.portal.modules.table: %core.table_prefix%portal_modules
@@ -41,16 +33,6 @@ services:
- %core.root_path% - %core.root_path%
- .%core.php_ext% - .%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: board3.portal.module_collection:
class: phpbb\di\service_collection class: phpbb\di\service_collection
arguments: arguments:

View File

@@ -1,134 +0,0 @@
<?php
/**
*
* @package Board3 Portal v2.1
* @copyright (c) 2013 Board3 Group ( www.board3.de )
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace board3\portal\includes;
class version_check
{
/**
* @var array version_data
*/
protected $version_data;
/**
* @var \phpbb\config\config
*/
protected $config;
/**
* @var \phpbb\version_helper $version_helper phpBB version helper
*/
protected $version_helper;
/**
* @var \phpbb\template\twig\twig
*/
protected $template;
/**
* @var \phpbb\user
*/
protected $user;
/**
* @var string Current version
*/
protected $current_version;
/** @var array Update data */
protected $update_data;
/** @var array Template data */
protected $template_data;
/**
* Construct a version_check object
*
* @param array $version_data Version data
* @param \phpbb\config\config $config phpBB config
* @param \phpbb\version_helper $version_helper phpBB version helper
* @param \phpbb\template\twig\twig $template phpBB template object
* @param \phpbb\user $user phpBB user object
*/
public function __construct($version_data, $config, $version_helper, $template, $user)
{
$this->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'],
));
}
}
}

View File

@@ -88,7 +88,6 @@ $lang = array_merge($lang, array(
'PORTAL_LEFT_COLUMN_EXP' => 'Die Linke Spalte auf dem Portal anzeigen', 'PORTAL_LEFT_COLUMN_EXP' => 'Die Linke Spalte auf dem Portal anzeigen',
'PORTAL_RIGHT_COLUMN' => 'Rechte Spalte aktivieren', 'PORTAL_RIGHT_COLUMN' => 'Rechte Spalte aktivieren',
'PORTAL_RIGHT_COLUMN_EXP' => 'Die Rechte Spalte auf dem Portal anzeigen', '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', 'ACP_PORTAL_COLUMN_WIDTH_SETTINGS' => 'Breiteneinstellung der rechten und linken Spalte',
'PORTAL_LEFT_COLUMN_WIDTH' => 'Breite der 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', '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 // Install
'PORTAL_BASIC_INSTALL' => 'Füge Basismodule hinzu', 'PORTAL_BASIC_INSTALL' => 'Füge Basismodule hinzu',
'PORTAL_BASIC_UNINSTALL' => 'Entferne Module von Datenbank', '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',
)); ));

View File

@@ -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_LEFT_COLUMN_EXP' => 'Switch to no if you wish to turn off the left column',
'PORTAL_RIGHT_COLUMN' => 'Enable right column', 'PORTAL_RIGHT_COLUMN' => 'Enable right column',
'PORTAL_RIGHT_COLUMN_EXP' => 'Switch to no if you wish to turn off the 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' => '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.', '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', 'ACP_PORTAL_COLUMN_WIDTH_SETTINGS' => 'Left and right column width settings',
@@ -107,17 +106,4 @@ $lang = array_merge($lang, array(
// Install // Install
'PORTAL_BASIC_INSTALL' => 'Adding basic set of modules', 'PORTAL_BASIC_INSTALL' => 'Adding basic set of modules',
'PORTAL_BASIC_UNINSTALL' => 'Removing modules from database', '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',
)); ));

View File

@@ -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_LEFT_COLUMN_EXP' => 'Cambie a No si desea deshabilitar la columna de la izquierda.',
'PORTAL_RIGHT_COLUMN' => 'Habilitar columna derecha', 'PORTAL_RIGHT_COLUMN' => 'Habilitar columna derecha',
'PORTAL_RIGHT_COLUMN_EXP' => 'Cambie a No si desea deshabilitar la columna de la 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' => '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.', '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', 'ACP_PORTAL_COLUMN_WIDTH_SETTINGS' => 'Configuración de ancho de columnas izquierda y derecha',
@@ -101,17 +100,4 @@ $lang = array_merge($lang, array(
// Install // Install
'PORTAL_BASIC_INSTALL' => 'Agregando un conjunto básico de módulos', 'PORTAL_BASIC_INSTALL' => 'Agregando un conjunto básico de módulos',
'PORTAL_BASIC_UNINSTALL' => 'Eliminando módulos de la base de datos', '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',
)); ));

View File

@@ -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_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' => 'Activer la colonne de droite',
'PORTAL_RIGHT_COLUMN_EXP' => 'Changer sur « Non » si vous souhaitez désactiver 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 laccès rapide aux forums', 'PORTAL_DISPLAY_JUMPBOX' => 'Afficher laccès rapide aux forums',
'PORTAL_DISPLAY_JUMPBOX_EXP' => 'Afficher laccès rapide aux forums sur le portail. Laccès rapide aux forums ne sera affiché que si il est également activé dans les fonctionnalités du forum.', 'PORTAL_DISPLAY_JUMPBOX_EXP' => 'Afficher laccès rapide aux forums sur le portail. Laccè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', '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 // Install
'PORTAL_BASIC_INSTALL' => 'Ajout dun ensemble de modules de base', 'PORTAL_BASIC_INSTALL' => 'Ajout dun ensemble de modules de base',
'PORTAL_BASIC_UNINSTALL' => 'Suppression des modules de la base de données', '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 na pu être contacté',
'NOT_UP_TO_DATE' => '%s nest pas à jour',
'RELEASE_ANNOUNCEMENT' => ' Date de publication de lannonce',
'UP_TO_DATE' => 'Lextension %s est à jour',
'VERSION_CHECK' => 'Vérification de la version du portail',
)); ));

View File

@@ -86,7 +86,6 @@ $lang = array_merge($lang, array(
'PORTAL_LEFT_COLUMN_EXP' => 'Impostare su "No" per nascondere la colonna sinistra', 'PORTAL_LEFT_COLUMN_EXP' => 'Impostare su "No" per nascondere la colonna sinistra',
'PORTAL_RIGHT_COLUMN' => 'Enable right column', 'PORTAL_RIGHT_COLUMN' => 'Enable right column',
'PORTAL_RIGHT_COLUMN_EXP' => 'Impostare su "No" per nascondere la colonna destra', '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' => 'Mostra jumpbox',
'PORTAL_DISPLAY_JUMPBOX_EXP' => 'Mostra la jumpbox nel portale. La jumpbox sarà mostrata se abilitata nelle impostazioni della board.', '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', 'ACP_PORTAL_COLUMN_WIDTH_SETTINGS' => 'Impostazioni larghezza colonna sinistra e destra',
@@ -101,17 +100,4 @@ $lang = array_merge($lang, array(
// Install // Install
'PORTAL_BASIC_INSTALL' => 'Aggiunta moduli di base', 'PORTAL_BASIC_INSTALL' => 'Aggiunta moduli di base',
'PORTAL_BASIC_UNINSTALL' => 'Rimozione dei moduli dal database', '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',
)); ));

View File

@@ -81,7 +81,6 @@ $lang = array_merge($lang, array(
'PORTAL_LEFT_COLUMN_EXP' => 'Verander naar nee als je de linkerkolom wilt uitschakelen', 'PORTAL_LEFT_COLUMN_EXP' => 'Verander naar nee als je de linkerkolom wilt uitschakelen',
'PORTAL_RIGHT_COLUMN' => 'Rechterkolom inschakelen', 'PORTAL_RIGHT_COLUMN' => 'Rechterkolom inschakelen',
'PORTAL_RIGHT_COLUMN_EXP' => 'Verander naar nee als je de rechterkolom wilt uitschakelen', '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' => 'Jumpbox weergeven',
'PORTAL_DISPLAY_JUMPBOX_EXP' => 'Jumpbox op de portaalpagina weergeven. De jumpbox wordt alleen zichtbaar als je hem hebt ingeschakeld bij de forumfuncties.', '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', 'ACP_PORTAL_COLUMN_WIDTH_SETTINGS' => 'Linker en rechterkolom breedte instellingen',
@@ -95,17 +94,4 @@ $lang = array_merge($lang, array(
// Install // Install
'PORTAL_BASIC_INSTALL' => 'Basisset van modules toevoegen', 'PORTAL_BASIC_INSTALL' => 'Basisset van modules toevoegen',
'PORTAL_BASIC_UNINSTALL' => 'Modules verwijderen uit de database', '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',
)); ));

View File

@@ -20,6 +20,7 @@ class v210 extends \phpbb\db\migration\migration
{ {
return array( return array(
array('config.update', array('board3_portal_version', '2.1.0')), 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, 'add_donation_setting'))),
array('custom', array(array($this, 'convert_serialize_to_json'))), array('custom', array(array($this, 'convert_serialize_to_json'))),
); );

View File

@@ -1,14 +1,6 @@
<!-- INCLUDE overall_header.html --> <!-- INCLUDE overall_header.html -->
<!-- INCLUDE portal/_block_config.html --> <!-- INCLUDE portal/_block_config.html -->
<!-- IF PORTAL_VERSION_CHECK and U_ACP -->
<div id="portal_version_check" class="rules">
<div class="inner"><span class="corners-top"><span></span></span>
<strong>{L_INFORMATION}{L_COLON}</strong> {PORTAL_VERSION_CHECK}
<span class="corners-bottom"><span></span></span></div>
</div>
<!-- ENDIF -->
<div id="portal-body" role="grid"> <div id="portal-body" role="grid">
<!-- IF S_TOP_COLUMN --> <!-- IF S_TOP_COLUMN -->
<div id="portal-top" role="gridcell"> <div id="portal-top" role="gridcell">

View File

@@ -1,20 +1,6 @@
<!-- INCLUDE overall_header.html --> <!-- INCLUDE overall_header.html -->
<!-- INCLUDE portal/_block_config.html --> <!-- INCLUDE portal/_block_config.html -->
<!--version $Id: portal_body.html 591 2009-12-11 23:48:49Z marc1706 $ //-->
<!-- IF PORTAL_VERSION_CHECK and U_ACP -->
<table class="tablebg" width="100%" cellspacing="1" cellpadding="0" style="margin-top: 5px;">
<tbody>
<tr>
<td class="row1">
<p class="breadcrumbs"><span style="color: red;">{PORTAL_VERSION_CHECK}</span></p>
</td>
</tr>
</tbody>
</table>
<br />
<!-- ENDIF -->
<table cellpadding="0" cellspacing="0" border="0" width="100%" align="center" role="grid"> <table cellpadding="0" cellspacing="0" border="0" width="100%" align="center" role="grid">
<!-- IF S_TOP_COLUMN --> <!-- IF S_TOP_COLUMN -->
<tr> <tr>

View File

@@ -38,11 +38,6 @@ class phpbb_acp_move_module_test extends \board3\portal\tests\testframework\data
$user = new \board3\portal\tests\mock\user(); $user = new \board3\portal\tests\mock\user();
$request = new \phpbb_mock_request; $request = new \phpbb_mock_request;
$phpbb_container = new \phpbb_mock_container_builder(); $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 // Mock module service collection
$config = new \phpbb\config\config(array()); $config = new \phpbb\config\config(array());
$auth = $this->getMock('\phpbb\auth\auth', array('acl_get')); $auth = $this->getMock('\phpbb\auth\auth', array('acl_get'));

View File

@@ -1,82 +0,0 @@
<?php
/**
*
* @package testing
* @copyright (c) Board3 Group ( www.board3.de )
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
require_once(dirname(__FILE__) . '/../../../../../../includes/utf/utf_tools.php');
class phpbb_functions_version_check_test extends \board3\portal\tests\testframework\test_case
{
protected $version_check;
protected $template;
protected $config;
public function setUp()
{
global $phpbb_root_path, $phpEx;
include_once($phpbb_root_path . 'includes/functions.' . $phpEx);
include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
$this->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');
}
}