Skip to content
This repository was archived by the owner on Nov 2, 2022. It is now read-only.

Commit 7f5c5ea

Browse files
committed
Versjon 1.3.2
1 parent 03c0215 commit 7f5c5ea

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

GFDibsHook.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ public static function setupDBTables() {
2727
$DAO->setupTables();
2828
}
2929

30+
public static function checkDBUpdate(){
31+
$version = (int) str_replace('.', null, _getConfig('version'));
32+
if ( $version >= 130 ){
33+
self::setupDBTables();
34+
}
35+
}
36+
3037

3138
public static function includeFrontendScripts(){
3239
wp_enqueue_script('jquery');

conf/conf.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
function _getConfig($index=null){
4+
$conf = array(
5+
'version' => '1.3.2'
6+
);
7+
8+
if ( $index){
9+
return $conf[$index];
10+
}
11+
else{
12+
return $conf;
13+
}
14+
15+
}
16+

gravityformsdibs.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,20 @@
33
Plugin Name: Gravity Forms DIBS
44
Plugin URI: http://nettbutikk.mediebruket.no
55
Description: DIBS add-on for Gravity Forms. Supports D2 and DX platform.
6-
Version: 1.3.1
6+
Version: 1.3.2
77
Author: Mediebruket
88
Author URI: http://mediebruket.no
99
*/
1010

11+
require_once 'conf/conf.php';
1112
require_once 'utils/utils.php';
1213
require_once 'GFDibsDao.php';
1314
require_once 'GFDibsAddOn.php';
1415
require_once 'GFDibsHook.php';
1516
require_once 'GFDibsUpdater.php';
1617

18+
$plugin_file;
19+
1720
$plugin_file = __FILE__;
1821

1922
if ( !function_exists('_debug') ){
@@ -25,6 +28,9 @@ function _debug($message = null){
2528
}
2629

2730
register_activation_hook( $plugin_file , array('GFDibsHook', 'setupDBTables') );
31+
add_action( 'init', array('GFDibsHook', 'checkDBUpdate'), 1 );
32+
33+
2834
$GFDibsUpdater = new GFDibsUpdater( __FILE__ );
2935

3036
if(!function_exists('_log')){

0 commit comments

Comments
 (0)