Skip to content

Commit

Permalink
1.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitrovv committed Dec 28, 2016
1 parent e320136 commit cdf2617
Show file tree
Hide file tree
Showing 10 changed files with 121 additions and 79 deletions.
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
*Put a short and clear description of the bug or issue here, if needed*

**This is for features**:

TODO:

* [ ] Some feature TODO
* [ ] Another feature TODO

**This is for bugs**

**Steps to Reproduce**

* Step 1
* Step 2
* Step 3, etc

**Expected Results**

**Actual Results**

**Browser/Operating System**

**Additional Comments**
18 changes: 18 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
* Description of changes 1
* Description of changes 2
* Description of changes 3, etc

Fixes eMerchantPay/\<project_name_here\>#number

-----------------

Before merging the PR make sure the following are checked:

* [ ] [Good commit messages][1] are used.
* [ ] Commit message starts with `{f|b}{year}{month}{day}{num}`, e.g. f2016071101
* [ ] Necessary specs are added.
* [ ] All specs are passing.
* [ ] All automated or manual PR comments are resolved or proper explanation is included for the given change
* [ ] The PR relates to **only** one subject with a clear title

[1]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

if (!defined('IS_ADMIN_FLAG')) die('Illegal Access');

if (emp_get_is_payment_module_index_action()) {
if (ecp_get_is_payment_module_index_action()) {
?>
<style type="text/css">
span.ecomprocessing-toggle {
Expand All @@ -37,12 +37,12 @@
<?php
}

if (emp_get_is_payment_module_edit_action()) {
if (ecp_get_is_payment_module_edit_action()) {
$jsPath = "includes/javascript/ecomprocessing/";
$cssPath = "includes/css/ecomprocessing/";
$zenVersion = emp_get_zencart_version();
$zenVersion = ecp_get_zencart_version();

echo emp_add_external_resources(
echo ecp_add_external_resources(
array(
"jquery-1.12.3.min.js",
"bootstrap.min.js",
Expand Down Expand Up @@ -116,11 +116,11 @@
* @param array $resourceNames
* @return string
*/
function emp_add_external_resources($resourceNames)
function ecp_add_external_resources($resourceNames)
{
$html = "";
foreach ($resourceNames as $key => $resourceName) {
$html .= emp_add_external_resource($resourceName);
$html .= ecp_add_external_resource($resourceName);
}
return $html;
}
Expand All @@ -130,20 +130,20 @@ function emp_add_external_resources($resourceNames)
* @param string $resourcePath
* @return string
*/
function emp_add_external_resource($resourcePath)
function ecp_add_external_resource($resourcePath)
{
$isResourceJavaScript = emp_get_string_ends_with($resourcePath, '.js');
$isResourceJavaScript = ecp_get_string_ends_with($resourcePath, '.js');

$includePath =
"includes/" .
($isResourceJavaScript ? "javascript/" : "css/") .
"ecomprocessing/";

if (emp_get_string_starts_with($resourcePath, 'jquery')) {
if (ecp_get_string_starts_with($resourcePath, 'jquery')) {
$includePath .= "jQueryExtensions/";
} elseif (emp_get_string_starts_with($resourcePath, 'bootstrap')) {
} elseif (ecp_get_string_starts_with($resourcePath, 'bootstrap')) {
$includePath .= "bootstrap/";
} elseif (emp_get_string_starts_with($resourcePath, 'font-awesome')) {
} elseif (ecp_get_string_starts_with($resourcePath, 'font-awesome')) {
$includePath .= "font-awesome/";
}

Expand All @@ -158,10 +158,10 @@ function emp_add_external_resource($resourcePath)
* Check if Current Page is Nodule Esit Page
* @return bool
*/
function emp_get_is_payment_module_edit_action()
function ecp_get_is_payment_module_edit_action()
{
return
emp_get_is_payment_module_index_action() &&
ecp_get_is_payment_module_index_action() &&
isset($_GET['action']) &&
(strtolower($_GET['action'] == 'edit'));
}
Expand All @@ -170,7 +170,7 @@ function emp_get_is_payment_module_edit_action()
* Check if Current Page is Module Preview Page
* @return bool
*/
function emp_get_is_payment_module_index_action()
function ecp_get_is_payment_module_index_action()
{
return
isset($_GET['set']) &&
Expand All @@ -187,7 +187,7 @@ function emp_get_is_payment_module_index_action()
* @param array $attributes
* @return string
*/
function emp_convert_attributes_array_to_html($attributes)
function ecp_convert_attributes_array_to_html($attributes)
{
if (is_array($attributes)) {
$html = '';
Expand All @@ -204,7 +204,7 @@ function emp_convert_attributes_array_to_html($attributes)
* Determines the version of zencart (Used to include Resources for old versions)
* @return string
*/
function emp_get_zencart_version()
function ecp_get_zencart_version()
{
global $db;

Expand All @@ -230,15 +230,15 @@ function emp_get_zencart_version()
* @param string $key
* @return null|string
*/
function emp_get_module_setting_placeholder($key)
function ecp_get_module_setting_placeholder($key)
{
if (emp_get_string_ends_with($key, "PAGE_TITLE")) {
if (ecp_get_string_ends_with($key, "PAGE_TITLE")) {
return "This name will be displayed on the checkout page";
} elseif (emp_get_string_ends_with($key, "USERNAME")) {
} elseif (ecp_get_string_ends_with($key, "USERNAME")) {
return "Enter your Genesis Username here";
} elseif (emp_get_string_ends_with($key, "PASSWORD")) {
} elseif (ecp_get_string_ends_with($key, "PASSWORD")) {
return "Enter your Genesis Password here";
} elseif (emp_get_string_ends_with($key, "TOKEN")) {
} elseif (ecp_get_string_ends_with($key, "TOKEN")) {
return "Enter your Genesis Token here";
}

Expand All @@ -251,7 +251,7 @@ function emp_get_module_setting_placeholder($key)
* @param string $needle
* @return bool
*/
function emp_get_string_starts_with($haystack, $needle)
function ecp_get_string_starts_with($haystack, $needle)
{
$length = strlen($needle);
return (substr($haystack, 0, $length) === $needle);
Expand All @@ -263,7 +263,7 @@ function emp_get_string_starts_with($haystack, $needle)
* @param string $needle
* @return bool
*/
function emp_get_string_ends_with($haystack, $needle)
function ecp_get_string_ends_with($haystack, $needle)
{
$length = strlen($needle);
if ($length == 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@
* @param string $key
* @return string
*/
function emp_zfg_select_drop_down_multiple($attributes, $select_array, $key_value, $key = '')
function ecp_zfg_select_drop_down_multiple($attributes, $select_array, $key_value, $key = '')
{
$name = (zen_not_null($key)
? 'configuration[' . $key . '][]'
: 'configuration_value'
);
return
emp_zfg_draw_pull_down_menu(
ecp_zfg_draw_pull_down_menu(
$name,
$select_array,
$key_value,
"class=\"form-control\" multiple=\"multiple\"" .
(is_array($attributes)
? emp_convert_attributes_array_to_html($attributes)
? ecp_convert_attributes_array_to_html($attributes)
: ""
),
(is_array($attributes) && in_array('required', $attributes))
Expand All @@ -53,7 +53,7 @@ function emp_zfg_select_drop_down_multiple($attributes, $select_array, $key_valu
* @param string $key
* @return string
*/
function emp_zfg_pull_down_order_statuses($order_status_id, $key = '')
function ecp_zfg_pull_down_order_statuses($order_status_id, $key = '')
{
global $db;

Expand All @@ -69,7 +69,7 @@ function emp_zfg_pull_down_order_statuses($order_status_id, $key = '')
$statuses->MoveNext();
}

return emp_zfg_select_drop_down_single($statuses_array, $order_status_id, $key);
return ecp_zfg_select_drop_down_single($statuses_array, $order_status_id, $key);
}

/**
Expand All @@ -79,10 +79,10 @@ function emp_zfg_pull_down_order_statuses($order_status_id, $key = '')
* @param string $key
* @return string
*/
function emp_zfg_select_drop_down_single($select_array, $key_value, $key = '')
function ecp_zfg_select_drop_down_single($select_array, $key_value, $key = '')
{
$name = ((zen_not_null($key)) ? 'configuration[' . $key . ']' : 'configuration_value');
return emp_zfg_draw_pull_down_menu($name, $select_array, $key_value, "class=\"form-control\"");
return ecp_zfg_draw_pull_down_menu($name, $select_array, $key_value, "class=\"form-control\"");
}

/**
Expand All @@ -94,7 +94,7 @@ function emp_zfg_select_drop_down_single($select_array, $key_value, $key = '')
* @param bool $required
* @return string
*/
function emp_zfg_draw_pull_down_menu($name, $values, $default = '', $parameters = '', $required = false)
function ecp_zfg_draw_pull_down_menu($name, $values, $default = '', $parameters = '', $required = false)
{
$field = '<div class="form-group"><select rel="dropdown" name="' . zen_output_string($name) . '"';

Expand Down Expand Up @@ -144,7 +144,7 @@ function emp_zfg_draw_pull_down_menu($name, $values, $default = '', $parameters
* @param string $key
* @return string
*/
function emp_zfg_draw_toggle($value, $key)
function ecp_zfg_draw_toggle($value, $key)
{
$name = ((zen_not_null($key)) ? 'configuration[' . $key . ']' : 'configuration_value');
ob_start();
Expand All @@ -170,15 +170,15 @@ function emp_zfg_draw_toggle($value, $key)
* @param string $key
* @return string
*/
function emp_zfg_draw_number_input($attributes, $value, $key)
function ecp_zfg_draw_number_input($attributes, $value, $key)
{
if (!is_array($attributes)) {
$attributes = array();
}

$attributes['class'] = "form-number-input" . (isset($attributes['class']) ? " " . $attributes['class'] : '');

return emp_zfg_draw_input(
return ecp_zfg_draw_input(
$attributes,
$value,
$key
Expand All @@ -192,7 +192,7 @@ function emp_zfg_draw_number_input($attributes, $value, $key)
* @param string $key
* @return string
*/
function emp_zfg_draw_input($attributes, $value, $key)
function ecp_zfg_draw_input($attributes, $value, $key)
{
$name = ((zen_not_null($key)) ? 'configuration[' . $key . ']' : 'configuration_value');
$class = "form-control";
Expand All @@ -205,7 +205,7 @@ function emp_zfg_draw_input($attributes, $value, $key)
);
}

$attributes_html = emp_convert_attributes_array_to_html($attributes);
$attributes_html = ecp_convert_attributes_array_to_html($attributes);

ob_start();
?>
Expand All @@ -214,7 +214,7 @@ function emp_zfg_draw_input($attributes, $value, $key)
type="text" <?php echo ($attributes_html ?: '');?>
name="<?php echo $name;?>"
value="<?php echo $value;?>"
placeholder="<?php echo emp_get_module_setting_placeholder($key);?>"
placeholder="<?php echo ecp_get_module_setting_placeholder($key);?>"
/>
<?php
if (is_array($attributes) && in_array('required', $attributes)) {
Expand All @@ -234,7 +234,7 @@ function emp_zfg_draw_input($attributes, $value, $key)
* @param string $value
* @return string
*/
function emp_zfg_get_toggle_value($value)
function ecp_zfg_get_toggle_value($value)
{
$value = (strtolower($value) == 'true');
ob_start();
Expand Down
Loading

0 comments on commit cdf2617

Please sign in to comment.