-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
59 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,8 +19,8 @@ class Module extends FormToolsModule | |
protected $author = "Ben Keen"; | ||
protected $authorEmail = "[email protected]"; | ||
protected $authorLink = "https://formtools.org"; | ||
protected $version = "2.0.1"; | ||
protected $date = "2017-11-07"; | ||
protected $version = "2.0.2"; | ||
protected $date = "2018-01-16"; | ||
protected $originLanguage = "en_us"; | ||
protected $jsFiles = array( | ||
"{MODULEROOT}/scripts/field_options.js" | ||
|
@@ -77,26 +77,7 @@ public function install($module_id) | |
$db->execute(); | ||
} | ||
|
||
// ADMIN template and code hooks | ||
Hooks::registerHook("template", "extended_client_fields", "admin_edit_client_main_top", "", "displayFields"); | ||
Hooks::registerHook("template", "extended_client_fields", "admin_edit_client_main_middle", "", "displayFields"); | ||
Hooks::registerHook("template", "extended_client_fields", "admin_edit_client_main_bottom", "", "displayFields"); | ||
Hooks::registerHook("template", "extended_client_fields", "admin_edit_client_settings_top", "", "displayFields"); | ||
Hooks::registerHook("template", "extended_client_fields", "admin_edit_client_settings_bottom", "", "displayFields"); | ||
Hooks::registerHook("template", "extended_client_fields", "admin_edit_view_client_map_filter_dropdown", "", "displayExtendedFieldOptions", 50, true); | ||
Hooks::registerHook("template", "extended_client_fields", "head_bottom", "", "insertHeadJs"); | ||
Hooks::registerHook("code", "extended_client_fields", "end", "FormTools\\Administrator::adminUpdateClient", "adminSaveExtendedClientFields"); | ||
|
||
// CLIENT template and code hooks | ||
Hooks::registerHook("template", "extended_client_fields", "edit_client_main_top", "", "displayFields"); | ||
Hooks::registerHook("template", "extended_client_fields", "edit_client_main_middle", "", "displayFields"); | ||
Hooks::registerHook("template", "extended_client_fields", "edit_client_main_bottom", "", "displayFields"); | ||
Hooks::registerHook("template", "extended_client_fields", "edit_client_settings_top", "", "displayFields"); | ||
Hooks::registerHook("template", "extended_client_fields", "edit_client_settings_bottom", "", "displayFields"); | ||
Hooks::registerHook("code", "extended_client_fields", "end", "FormTools\\Clients::updateClient", "clientSaveExtendedClientFields"); | ||
|
||
// general code hooks | ||
Hooks::registerHook("code", "extended_client_fields", "start", "FormTools\\Views::getViewFilterSql", "updateViewFilterSqlPlaceholders"); | ||
$this->resetHooks(); | ||
|
||
} catch (PDOException $e) { | ||
$success = false; | ||
|
@@ -107,6 +88,7 @@ public function install($module_id) | |
return array($success, $message); | ||
} | ||
|
||
|
||
public function uninstall($module_id) | ||
{ | ||
$db = Core::$db; | ||
|
@@ -134,6 +116,39 @@ public function uninstall($module_id) | |
} | ||
|
||
|
||
public function upgrade($module_id, $old_module_version) | ||
{ | ||
$this->resetHooks(); | ||
} | ||
|
||
|
||
public function resetHooks() | ||
{ | ||
Hooks::unregisterModuleHooks("extended_client_fields"); | ||
|
||
// ADMIN template and code hooks | ||
Hooks::registerHook("template", "extended_client_fields", "admin_edit_client_main_top", "", "displayFields"); | ||
Hooks::registerHook("template", "extended_client_fields", "admin_edit_client_main_middle", "", "displayFields"); | ||
Hooks::registerHook("template", "extended_client_fields", "admin_edit_client_main_bottom", "", "displayFields"); | ||
Hooks::registerHook("template", "extended_client_fields", "admin_edit_client_settings_top", "", "displayFields"); | ||
Hooks::registerHook("template", "extended_client_fields", "admin_edit_client_settings_bottom", "", "displayFields"); | ||
Hooks::registerHook("template", "extended_client_fields", "admin_edit_view_client_map_filter_dropdown", "", "displayExtendedFieldOptions", 50, true); | ||
Hooks::registerHook("template", "extended_client_fields", "head_bottom", "", "insertHeadJs"); | ||
Hooks::registerHook("code", "extended_client_fields", "end", "FormTools\\Administrator::adminUpdateClient", "adminSaveExtendedClientFields"); | ||
|
||
// CLIENT template and code hooks | ||
Hooks::registerHook("template", "extended_client_fields", "edit_client_main_top", "", "displayFields"); | ||
Hooks::registerHook("template", "extended_client_fields", "edit_client_main_middle", "", "displayFields"); | ||
Hooks::registerHook("template", "extended_client_fields", "edit_client_main_bottom", "", "displayFields"); | ||
Hooks::registerHook("template", "extended_client_fields", "edit_client_settings_top", "", "displayFields"); | ||
Hooks::registerHook("template", "extended_client_fields", "edit_client_settings_bottom", "", "displayFields"); | ||
Hooks::registerHook("code", "extended_client_fields", "end", "FormTools\\Clients::updateClient", "clientSaveExtendedClientFields"); | ||
|
||
// general code hooks | ||
Hooks::registerHook("code", "extended_client_fields", "start", "FormTools\\Views::getViewFilterSql", "updateViewFilterSqlPlaceholders"); | ||
} | ||
|
||
|
||
/** | ||
* Updates the section titles. | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters