From 72f55a4e5ede916841cc0f0423f9301400d7d3be Mon Sep 17 00:00:00 2001 From: Jagadedes Date: Fri, 21 Nov 2014 14:42:47 +0530 Subject: [PATCH 1/3] 31453 code cleanup --- templates/CRM/Wci/Page/Widget.tpl | 188 ------------------------------ 1 file changed, 188 deletions(-) delete mode 100644 templates/CRM/Wci/Page/Widget.tpl diff --git a/templates/CRM/Wci/Page/Widget.tpl b/templates/CRM/Wci/Page/Widget.tpl deleted file mode 100644 index a5ba67a..0000000 --- a/templates/CRM/Wci/Page/Widget.tpl +++ /dev/null @@ -1,188 +0,0 @@ -{literal} - - - -{/literal} - -
-
- {if $form.logo_image.value} - - {/if} - {$form.title} -
-
-
-
-
-
-
-
-
-
-
-
- {$form.description.value} -
-
-
- -
From f5a3493f9f79008a98013e7a685d64e9c2ac4454 Mon Sep 17 00:00:00 2001 From: Jagadedes Date: Fri, 21 Nov 2014 17:39:56 +0530 Subject: [PATCH 2/3] 31499 added tips for user --- templates/CRM/Wci/Form/CreateWidget.hlp | 30 ++++++++++ templates/CRM/Wci/Form/CreateWidget.tpl | 38 ++++++++++--- templates/CRM/Wci/Form/NewEmbedCode.tpl | 26 ++++++++- templates/CRM/Wci/Form/ProgressBar.tpl | 22 ++++++++ templates/CRM/Wci/Form/WCISettings.tpl | 22 ++++++++ templates/CRM/Wci/Page/ManageEmbedCode.tpl | 45 ++++++++------- templates/CRM/Wci/Page/ProgressBarList.tpl | 66 ++++++++-------------- templates/CRM/Wci/Page/WidgetList.tpl | 45 +++++++-------- templates/CRM/Wci/Page/wciwidget.tpl | 36 +++++++++--- 9 files changed, 225 insertions(+), 105 deletions(-) diff --git a/templates/CRM/Wci/Form/CreateWidget.hlp b/templates/CRM/Wci/Form/CreateWidget.hlp index bae916b..aaac13f 100644 --- a/templates/CRM/Wci/Form/CreateWidget.hlp +++ b/templates/CRM/Wci/Form/CreateWidget.hlp @@ -1,3 +1,25 @@ +{* + +--------------------------------------------------------------------+ + | CiviCRM Widget Creation Interface (WCI) Version 1.0 | + +--------------------------------------------------------------------+ + | Copyright Zyxware Technologies (c) 2014 | + +--------------------------------------------------------------------+ + | This file is a part of CiviCRM WCI. | + | | + | CiviCRM WCI is free software; you can copy, modify, and distribute | + | it under the terms of the GNU Affero General Public License | + | Version 3, 19 November 2007. | + | | + | CiviCRM WCI is distributed in the hope that it will be useful, | + | but WITHOUT ANY WARRANTY; without even the implied warranty of | + | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | + | See the GNU Affero General Public License for more details. | + | | + | You should have received a copy of the GNU Affero General Public | + | License along with this program; if not, contact Zyxware | + | Technologies at info[AT]zyxware[DOT]com. | + +--------------------------------------------------------------------+ +*} {htxt id="hide-border"} {ts}To get transparent background give none in the Background color field{/ts} {/htxt} @@ -17,3 +39,11 @@ {htxt id="image"} {ts}Select a smaller image than Size variant{/ts} {/htxt} + +{htxt id="preview"} +{ts}To embed widget on a page, create an embed code and associate it with the widget.{/ts} +{/htxt} + +{htxt id="add-new-pb"} +{ts}If no progressbars availavle, create one.{/ts} +{/htxt} diff --git a/templates/CRM/Wci/Form/CreateWidget.tpl b/templates/CRM/Wci/Form/CreateWidget.tpl index 1296eab..3cccadd 100644 --- a/templates/CRM/Wci/Form/CreateWidget.tpl +++ b/templates/CRM/Wci/Form/CreateWidget.tpl @@ -1,3 +1,25 @@ +{* + +--------------------------------------------------------------------+ + | CiviCRM Widget Creation Interface (WCI) Version 1.0 | + +--------------------------------------------------------------------+ + | Copyright Zyxware Technologies (c) 2014 | + +--------------------------------------------------------------------+ + | This file is a part of CiviCRM WCI. | + | | + | CiviCRM WCI is free software; you can copy, modify, and distribute | + | it under the terms of the GNU Affero General Public License | + | Version 3, 19 November 2007. | + | | + | CiviCRM WCI is distributed in the hope that it will be useful, | + | but WITHOUT ANY WARRANTY; without even the implied warranty of | + | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | + | See the GNU Affero General Public License for more details. | + | | + | You should have received a copy of the GNU Affero General Public | + | License along with this program; if not, contact Zyxware | + | Technologies at info[AT]zyxware[DOT]com. | + +--------------------------------------------------------------------+ +*} {* HEADER *}
@@ -5,7 +27,7 @@
{if $form.title.value != ""} - {php} + {php} if(isset($_REQUEST['id'])) { $widget_controller_path = getWciWidgetControllerPath(); $extension_root_path = getExtensionRootPath(); @@ -21,7 +43,7 @@ Click Save & Preview to save any changes to your settings, and preview the widget again on this page.
-
+
{help id="preview" file="CRM/Wci/Form/CreateWidget"}
@@ -32,12 +54,12 @@
{$form.title.label}
{$form.title.html}
- +
{$form.logo_image.label}
{$form.logo_image.html} {help id="logo_image" file="CRM/Wci/Form/CreateWidget"}
-
+
{$form.image.label}
{$form.image.html} {help id="image" file="CRM/Wci/Form/CreateWidget"}
@@ -55,7 +77,7 @@
{$form.progress_bar.label}
-
{$form.progress_bar.html}
+
{$form.progress_bar.html}{help id="add-new-pb" file="CRM/Wci/Form/CreateWidget"}
@@ -92,16 +114,16 @@ - + - + - +
{$form.hide_title.html}{$form.hide_title.label}{$form.hide_title.label}
{$form.hide_border.html} {$form.hide_border.label} {help id="hide-border" file="CRM/Wci/Form/CreateWidget"}
{$form.hide_pbcap.html} {$form.hide_pbcap.label}
diff --git a/templates/CRM/Wci/Form/NewEmbedCode.tpl b/templates/CRM/Wci/Form/NewEmbedCode.tpl index 1269a31..68172c7 100644 --- a/templates/CRM/Wci/Form/NewEmbedCode.tpl +++ b/templates/CRM/Wci/Form/NewEmbedCode.tpl @@ -1,3 +1,25 @@ +{* + +--------------------------------------------------------------------+ + | CiviCRM Widget Creation Interface (WCI) Version 1.0 | + +--------------------------------------------------------------------+ + | Copyright Zyxware Technologies (c) 2014 | + +--------------------------------------------------------------------+ + | This file is a part of CiviCRM WCI. | + | | + | CiviCRM WCI is free software; you can copy, modify, and distribute | + | it under the terms of the GNU Affero General Public License | + | Version 3, 19 November 2007. | + | | + | CiviCRM WCI is distributed in the hope that it will be useful, | + | but WITHOUT ANY WARRANTY; without even the implied warranty of | + | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | + | See the GNU Affero General Public License for more details. | + | | + | You should have received a copy of the GNU Affero General Public | + | License along with this program; if not, contact Zyxware | + | Technologies at info[AT]zyxware[DOT]com. | + +--------------------------------------------------------------------+ +*} {* HEADER *}
@@ -14,7 +36,7 @@
{/foreach} {if $form.title.value != ""} - {php} + {php} if(isset($_REQUEST['id'])) { $emb_id = $_REQUEST['id']; $wid_id = CRM_Wci_BAO_EmbedCode::getWidgetId($emb_id); @@ -39,7 +61,7 @@
Add this widget to any web page by copying and pasting the code below.
-
diff --git a/templates/CRM/Wci/Form/ProgressBar.tpl b/templates/CRM/Wci/Form/ProgressBar.tpl index ae6889d..e613158 100644 --- a/templates/CRM/Wci/Form/ProgressBar.tpl +++ b/templates/CRM/Wci/Form/ProgressBar.tpl @@ -1,3 +1,25 @@ +{* + +--------------------------------------------------------------------+ + | CiviCRM Widget Creation Interface (WCI) Version 1.0 | + +--------------------------------------------------------------------+ + | Copyright Zyxware Technologies (c) 2014 | + +--------------------------------------------------------------------+ + | This file is a part of CiviCRM WCI. | + | | + | CiviCRM WCI is free software; you can copy, modify, and distribute | + | it under the terms of the GNU Affero General Public License | + | Version 3, 19 November 2007. | + | | + | CiviCRM WCI is distributed in the hope that it will be useful, | + | but WITHOUT ANY WARRANTY; without even the implied warranty of | + | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | + | See the GNU Affero General Public License for more details. | + | | + | You should have received a copy of the GNU Affero General Public | + | License along with this program; if not, contact Zyxware | + | Technologies at info[AT]zyxware[DOT]com. | + +--------------------------------------------------------------------+ +*} {literal} {/literal} -{/if} +{/if} {if (1 == $wciform.hide_border)}
@@ -240,11 +262,11 @@ {/if}
{$wciform.description} -
+
{if $wciform.button_title && $cpageId} -
+ {if $wciform.email_signup_group_id} From 2712a1719e8bbfcf3a30d8f52790f6646bf96093 Mon Sep 17 00:00:00 2001 From: Vimal Joseph Date: Sun, 23 Nov 2014 20:09:10 +0530 Subject: [PATCH 3/3] Code clean up. Renamed wciwidget.tpl to WCIWidget.tpl to make it adhear with standard. Removed the license text from WCIWidget.tpl so that it looks clean in the Override default template input. --- CRM/Wci/Form/CreateWidget.php | 4 ++-- CRM/Wci/WidgetCode.php | 2 +- .../Wci/Page/{wciwidget.tpl => WCIWidget.tpl} | 22 ------------------- 3 files changed, 3 insertions(+), 25 deletions(-) rename templates/CRM/Wci/Page/{wciwidget.tpl => WCIWidget.tpl} (85%) diff --git a/CRM/Wci/Form/CreateWidget.php b/CRM/Wci/Form/CreateWidget.php index c2c3c84..47044be 100644 --- a/CRM/Wci/Form/CreateWidget.php +++ b/CRM/Wci/Form/CreateWidget.php @@ -247,7 +247,7 @@ function buildQuickForm() { $this->setDefaults(array( 'custom_template' => $cust_templ)); } else { - $output = file_get_contents('templates/CRM/Wci/Page/wciwidget.tpl',FILE_USE_INCLUDE_PATH); + $output = file_get_contents('templates/CRM/Wci/Page/WCIWidget.tpl', FILE_USE_INCLUDE_PATH); $elem = $this->getElement('custom_template'); $elem->setValue($output); } @@ -256,7 +256,7 @@ function buildQuickForm() { } else { CRM_Utils_System::setTitle(ts('Create Widget')); - $output = file_get_contents('templates/CRM/Wci/Page/wciwidget.tpl',FILE_USE_INCLUDE_PATH); + $output = file_get_contents('templates/CRM/Wci/Page/WCIWidget.tpl', FILE_USE_INCLUDE_PATH); $elem = $this->getElement('custom_template'); $elem->setValue($output); } diff --git a/CRM/Wci/WidgetCode.php b/CRM/Wci/WidgetCode.php index a5145ee..a1c7f36 100644 --- a/CRM/Wci/WidgetCode.php +++ b/CRM/Wci/WidgetCode.php @@ -37,7 +37,7 @@ static function generate_widget_code($widgetId, $preview = 0) { if ($data["override"] == '0') { $template->template_dir[] = getWciWidgetTemplatePath(); - $wcidata = $template->fetch('wciwidget.tpl'); + $wcidata = $template->fetch('WCIWidget.tpl'); } else { $wcidata = $template->fetch('string:' . html_entity_decode($data['custom_template'])); } diff --git a/templates/CRM/Wci/Page/wciwidget.tpl b/templates/CRM/Wci/Page/WCIWidget.tpl similarity index 85% rename from templates/CRM/Wci/Page/wciwidget.tpl rename to templates/CRM/Wci/Page/WCIWidget.tpl index 3bca680..cf089e2 100644 --- a/templates/CRM/Wci/Page/wciwidget.tpl +++ b/templates/CRM/Wci/Page/WCIWidget.tpl @@ -1,25 +1,3 @@ -{* - +--------------------------------------------------------------------+ - | CiviCRM Widget Creation Interface (WCI) Version 1.0 | - +--------------------------------------------------------------------+ - | Copyright Zyxware Technologies (c) 2014 | - +--------------------------------------------------------------------+ - | This file is a part of CiviCRM WCI. | - | | - | CiviCRM WCI is free software; you can copy, modify, and distribute | - | it under the terms of the GNU Affero General Public License | - | Version 3, 19 November 2007. | - | | - | CiviCRM WCI is distributed in the hope that it will be useful, | - | but WITHOUT ANY WARRANTY; without even the implied warranty of | - | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | - | See the GNU Affero General Public License for more details. | - | | - | You should have received a copy of the GNU Affero General Public | - | License along with this program; if not, contact Zyxware | - | Technologies at info[AT]zyxware[DOT]com. | - +--------------------------------------------------------------------+ -*} {literal}