Skip to content

Commit dd68e3b

Browse files
committed
2.0.2
1 parent 55928ec commit dd68e3b

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

code/Module.class.php

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ class Module extends FormToolsModule
1515
protected $author = "Ben Keen";
1616
protected $authorEmail = "ben.keen@gmail.com";
1717
protected $authorLink = "https://formtools.org";
18-
protected $version = "2.0.1";
19-
protected $date = "2017-11-23";
18+
protected $version = "2.0.2";
19+
protected $date = "2018-01-30";
2020
protected $originLanguage = "en_us";
2121

2222
protected $jsFiles = array("scripts/text_override.js");
@@ -44,10 +44,7 @@ public function install($module_id)
4444
return array(false, "Failed Query: " . $e->getMessage());
4545
}
4646

47-
// This adds the POTENTIAL for the module to be called in those functions. The text_override_replace function
48-
// does the job of processing the user-defined list of parsing rules, as entered via the UI. If there are no
49-
// rules, nothing happens
50-
Hooks::registerHook("code", "text_override", "main", "FormTools\\Themes::displayPage", "replaceStrings");
47+
$this->resetHooks();
5148

5249
return array(true, "");
5350
}
@@ -63,6 +60,22 @@ public function uninstall($module_id)
6360
}
6461

6562

63+
public function upgrade($module_id, $old_module_version)
64+
{
65+
$this->clearHooks();
66+
$this->resetHooks();
67+
}
68+
69+
70+
public function resetHooks()
71+
{
72+
// This adds the POTENTIAL for the module to be called in those functions. The text_override_replace function
73+
// does the job of processing the user-defined list of parsing rules, as entered via the UI. If there are no
74+
// rules, nothing happens
75+
Hooks::registerHook("code", "text_override", "main", "FormTools\\Themes::displayPage", "replaceStrings");
76+
}
77+
78+
6679
/**
6780
* Our code hook function. This does the job of actually overriding the strings.
6881
*/

0 commit comments

Comments
 (0)