Skip to content

Commit

Permalink
2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
benkeen committed Dec 15, 2017
1 parent 4ccf6dc commit ed98938
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 23 deletions.
3 changes: 1 addition & 2 deletions admin/tab_publish.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
if (isset($_GET["delete_published_form"])) {
$override = (isset($_GET["override"])) ? true : false;
$published_form_id = $_GET["delete_published_form"];
list($success, $message) = $module->deletePublishedForm($form_id, $published_form_id,
$_GET["delete_form_config"], $override);
list($success, $message) = $module->deletePublishedForm($form_id, $published_form_id, $_GET["delete_form_config"], $L, $override);
} else {
if (isset($_POST["update_order"])) {
list($success, $message) = Forms::updatePublishedFormOrder($form_id, $L, $_POST);
Expand Down
2 changes: 1 addition & 1 deletion code/Forms.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public static function deleteFormConfiguration($form_id, $published_form_id, $L)
* @param string $delete_form_config "yes" / "no"
* @param boolean $override
*/
public static function deletePublishedForm($form_id, $published_form_id, $delete_form_config, $override = false, $L)
public static function deletePublishedForm($form_id, $published_form_id, $delete_form_config, $L, $override = false)
{
$db = Core::$db;

Expand Down
13 changes: 8 additions & 5 deletions code/Module.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ class Module extends CoreModule
protected $author = "Ben Keen";
protected $authorEmail = "ben.keen@gmail.com";
protected $authorLink = "https://formtools.org";
protected $version = "2.0.0";
protected $date = "2017-12-02";
protected $version = "2.0.1";
protected $date = "2017-12-14";
protected $originLanguage = "en_us";

// important! This needs to be updated any time the default template set filename changes
Expand Down Expand Up @@ -502,17 +502,19 @@ public static function inlineDataOverride($vars)
public function deleteForm($info)
{
$form_id = $info["form_id"];
$L = $this->getLangStrings();

$published_forms = Forms::getPublishedForms($form_id);
foreach ($published_forms["results"] as $config)
{
$published_form_id = $config["published_form_id"];
list($success, $message) = Forms::deletePublishedForm($form_id, $published_form_id, "yes");
list($success, $message) = Forms::deletePublishedForm($form_id, $published_form_id, "yes", $L);

// if there was a problem with the last function call, there was probably just a problem deleting
// one of the files. Ignore this: just re-call the function with override "on". This ensures the configuration
// is at least deleted
if (!$success) {
Forms::deletePublishedForm($form_id, $published_form_id, "yes", true);
Forms::deletePublishedForm($form_id, $published_form_id, "yes", $L, true);
}
}
}
Expand All @@ -527,6 +529,7 @@ public function deleteForm($info)
public function fb_hook_delete_view($info)
{
$db = Core::$db;
$L = $this->getLangStrings();

if (!isset($info["view_id"]) || !is_numeric($info["view_id"])) {
return;
Expand All @@ -548,7 +551,7 @@ public function fb_hook_delete_view($info)
// always attempt to delete the published form as well as the config first. If that fails, just delete the configuration
list($success, $message) = Forms::deletePublishedForm($form_id, $published_form_id, "yes", $L);
if (!$success) {
Forms::deletePublishedForm($form_id, $published_form_id, "yes", true);
Forms::deletePublishedForm($form_id, $published_form_id, "yes", $L, true);
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions templates/help.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{include file='modules_header.tpl'}
{ft_include file='modules_header.tpl'}

<table cellpadding="0" cellspacing="0">
<tr>
Expand All @@ -12,9 +12,9 @@
</td>
</tr>
</table>

<p>
{$L.text_help}

<p>
{$L.text_help}
</p>

{include file='modules_footer.tpl'}
{ft_include file='modules_footer.tpl'}
6 changes: 3 additions & 3 deletions templates/index.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{include file='modules_header.tpl'}
{ft_include file='modules_header.tpl'}

<table cellpadding="0" cellspacing="0">
<tr>
Expand All @@ -12,7 +12,7 @@
</tr>
</table>

{include file='messages.tpl'}
{ft_include file='messages.tpl'}

<div class="margin_bottom_large">
{$L.text_template_set_intro}
Expand Down Expand Up @@ -124,4 +124,4 @@
</div>


{include file='modules_footer.tpl'}
{ft_include file='modules_footer.tpl'}
8 changes: 4 additions & 4 deletions templates/settings.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{include file='modules_header.tpl'}
{ft_include file='modules_header.tpl'}

<table cellpadding="0" cellspacing="0" class="margin_bottom_large">
<tr>
Expand All @@ -13,7 +13,7 @@
</tr>
</table>

{include file='tabset_open.tpl'}
{ft_include file='tabset_open.tpl'}

{if $page == "main"}
{include file='./tab_settings_main.tpl'}
Expand All @@ -25,6 +25,6 @@
{include file='./tab_settings_main.tpl'}
{/if}

{include file='tabset_close.tpl'}
{ft_include file='tabset_close.tpl'}

{include file='modules_footer.tpl'}
{ft_include file='modules_footer.tpl'}
2 changes: 1 addition & 1 deletion templates/tab_settings_form_offline.tpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="subtitle margin_top_large underline">{$L.phrase_form_offline_settings|upper}</div>

{include file="messages.tpl"}
{ft_include file="messages.tpl"}

<form method="post" action="{$same_page}">

Expand Down
2 changes: 1 addition & 1 deletion templates/tab_settings_main.tpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="subtitle margin_top_large underline">{$L.phrase_default_publish_folder|upper}</div>

{include file="messages.tpl"}
{ft_include file="messages.tpl"}

<form method="post" action="{$same_page}">
<table cellspacing="0" cellpadding="1" class="list_table margin_bottom_large">
Expand Down
2 changes: 1 addition & 1 deletion templates/tab_settings_thanks.tpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="subtitle margin_top_large underline">{$L.phrase_thankyou_page|upper}</div>

{include file="messages.tpl"}
{ft_include file="messages.tpl"}

<div class="margin_bottom_large">
{$L.text_default_thankyou_page_desc}
Expand Down

0 comments on commit ed98938

Please sign in to comment.