forked from joomla/Component-Builder
Fixed the sql dump import issue that broke when import values not set correctly. Made more corrections to the whmcs implementation.
This commit is contained in:
parent
a62476d260
commit
21254738a8
@ -328,12 +328,12 @@ class Interpretation extends Fields
|
||||
$bool[] = $this->_t(2) . "}";
|
||||
$bool[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get the global params";
|
||||
$bool[] = $this->_t(2) . "\$params = JComponentHelper::getParams('com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "', true);";
|
||||
$bool[] = $this->_t(2) . "\$license_key = \$params->get('license_key', null);";
|
||||
$bool[] = $this->_t(2) . "if (\$license_key)";
|
||||
$bool[] = $this->_t(2) . "\$whmcs_key = \$params->get('whmcs_key', null);";
|
||||
$bool[] = $this->_t(2) . "if (\$whmcs_key)";
|
||||
$bool[] = $this->_t(2) . "{";
|
||||
$bool[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " load the file";
|
||||
$bool[] = $this->_t(3) . "JLoader::import( 'whmcs', JPATH_ADMINISTRATOR .'/components/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "');";
|
||||
$bool[] = $this->_t(3) . "\$the = new WHMCS(\$license_key);";
|
||||
$bool[] = $this->_t(3) . "\$the = new WHMCS(\$whmcs_key);";
|
||||
$bool[] = $this->_t(3) . "\$this->" . $globalbool . " = \$the->_is;";
|
||||
$bool[] = $this->_t(3) . "return \$this->" . $globalbool . ";";
|
||||
$bool[] = $this->_t(2) . "}";
|
||||
@ -360,12 +360,12 @@ class Interpretation extends Fields
|
||||
$helper[] = $this->_t(1) . "{";
|
||||
$helper[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get the global params";
|
||||
$helper[] = $this->_t(2) . "\$params = JComponentHelper::getParams('com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "', true);";
|
||||
$helper[] = $this->_t(2) . "\$license_key = \$params->get('license_key', null);";
|
||||
$helper[] = $this->_t(2) . "if (\$license_key)";
|
||||
$helper[] = $this->_t(2) . "\$whmcs_key = \$params->get('whmcs_key', null);";
|
||||
$helper[] = $this->_t(2) . "if (\$whmcs_key)";
|
||||
$helper[] = $this->_t(2) . "{";
|
||||
$helper[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " load the file";
|
||||
$helper[] = $this->_t(3) . "JLoader::import( 'whmcs', JPATH_ADMINISTRATOR .'/components/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "');";
|
||||
$helper[] = $this->_t(3) . "\$the = new WHMCS(\$license_key);";
|
||||
$helper[] = $this->_t(3) . "\$the = new WHMCS(\$whmcs_key);";
|
||||
$helper[] = $this->_t(3) . "return \$the->_is;";
|
||||
$helper[] = $this->_t(2) . "}";
|
||||
$helper[] = $this->_t(2) . "return false;";
|
||||
@ -671,7 +671,7 @@ class Interpretation extends Fields
|
||||
$function[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " WHMCS Encryption Type";
|
||||
$function[] = $this->_t(2) . "if ('whmcs' === \$type || 'advanced' === \$type)";
|
||||
$function[] = $this->_t(2) . "{";
|
||||
$function[] = $this->_t(3) . "\$key = \$params->get('advanced_key', \$default);";
|
||||
$function[] = $this->_t(3) . "\$key = \$params->get('whmcs_key', \$default);";
|
||||
$function[] = $this->_t(3) . "if (self::checkString(\$key))";
|
||||
$function[] = $this->_t(3) . "{";
|
||||
$function[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " load the file";
|
||||
@ -13154,7 +13154,7 @@ class Interpretation extends Fields
|
||||
// these are the coustom settings
|
||||
$this->setCustomControlConfigFieldsets($lang);
|
||||
}
|
||||
// we cad add more event (timers as we need)
|
||||
// we can add more event (timers as we need)
|
||||
}
|
||||
|
||||
public function setSiteControlConfigFieldsets($lang)
|
||||
@ -13365,40 +13365,6 @@ class Interpretation extends Fields
|
||||
$this->configFieldSets[] = $this->_t(2) . 'name="global_config"';
|
||||
$this->configFieldSets[] = $this->_t(2) . 'label="' . $lang . '_GLOBAL_LABEL"';
|
||||
$this->configFieldSets[] = $this->_t(2) . 'description="' . $lang . '_GLOBAL_DESC">';
|
||||
// set application update License Key
|
||||
if ($this->componentData->add_license && 1 != $this->componentData->license_type)
|
||||
{
|
||||
// set licence type switch
|
||||
switch ($this->componentData->license_type)
|
||||
{
|
||||
case 2:
|
||||
// for updates
|
||||
$this->langContent[$this->lang][$lang . '_LICENSE_KEY_NOTE_LABEL'] = "Your License Key";
|
||||
$this->langContent[$this->lang][$lang . '_LICENSE_KEY_NOTE_DESC'] = "To get updates you must add the license key here that you recieved from " . $this->componentData->companyname;
|
||||
// set the field
|
||||
$this->configFieldSets[] = $this->_t(2) . '<field type="note" name="license_key_note" class="alert alert-info" label="' . $lang . '_LICENSE_KEY_NOTE_LABEL" description="' . $lang . '_LICENSE_KEY_NOTE_DESC" />';
|
||||
break;
|
||||
case 3:
|
||||
// with vdm to lock down ownership
|
||||
$this->langContent[$this->lang][$lang . '_LICENSE_KEY_NOTE_LABEL'] = "Your License Key";
|
||||
$this->langContent[$this->lang][$lang . '_LICENSE_KEY_NOTE_DESC'] = "To use this component you must add the license key here that you recieved from " . $this->componentData->companyname;
|
||||
// set the field
|
||||
$this->configFieldSets[] = $this->_t(2) . '<field type="note" name="license_key_note" class="alert alert-info" label="' . $lang . '_LICENSE_KEY_NOTE_LABEL" description="' . $lang . '_LICENSE_KEY_NOTE_DESC" />';
|
||||
break;
|
||||
}
|
||||
// setup lang
|
||||
$this->langContent[$this->lang][$lang . '_LICENSE_KEY_LABEL'] = "License Key";
|
||||
$this->langContent[$this->lang][$lang . '_LICENSE_KEY_DESC'] = "Add your license key here.";
|
||||
// add the field
|
||||
$this->configFieldSets[] = $this->_t(2) . '<field name="license_key"';
|
||||
$this->configFieldSets[] = $this->_t(3) . 'type="text"';
|
||||
$this->configFieldSets[] = $this->_t(3) . 'label="' . $lang . '_LICENSE_KEY_LABEL"';
|
||||
$this->configFieldSets[] = $this->_t(3) . 'description="' . $lang . '_LICENSE_KEY_DESC"';
|
||||
$this->configFieldSets[] = $this->_t(3) . 'size="60"';
|
||||
$this->configFieldSets[] = $this->_t(3) . 'default=""';
|
||||
$this->configFieldSets[] = $this->_t(2) . "/>";
|
||||
$this->configFieldSets[] = $this->_t(2) . '<field type="spacer" name="spacerLicense" hr="true" />';
|
||||
}
|
||||
// setup lang
|
||||
$this->langContent[$this->lang][$lang . '_GLOBAL_LABEL'] = "Global";
|
||||
$this->langContent[$this->lang][$lang . '_GLOBAL_DESC'] = "The Global Parameters";
|
||||
@ -14694,44 +14660,51 @@ function vdm_dkim() {
|
||||
// set field lang label and description
|
||||
if ($this->componentData->add_license && $this->componentData->license_type == 3)
|
||||
{
|
||||
$this->langContent[$this->lang][$lang . '_WHMCS_KEY_LABEL'] = "License Key";
|
||||
$this->langContent[$this->lang][$lang . '_WHMCS_KEY_LABEL'] = $this->componentData->companyname . " License Key";
|
||||
$this->langContent[$this->lang][$lang . '_WHMCS_KEY_DESC'] = "Add the license key you recieved from " . $this->componentData->companyname . " here.";
|
||||
}
|
||||
elseif ($this->componentData->add_license && $this->componentData->license_type == 2)
|
||||
{
|
||||
$this->langContent[$this->lang][$lang . '_WHMCS_KEY_LABEL'] = "Update Key";
|
||||
$this->langContent[$this->lang][$lang . '_WHMCS_KEY_LABEL'] = $this->componentData->companyname . " Update Key";
|
||||
$this->langContent[$this->lang][$lang . '_WHMCS_KEY_DESC'] = "Add the update key you recieved from " . $this->componentData->companyname . " here.";
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->langContent[$this->lang][$lang . '_WHMCS_KEY_LABEL'] = "WHMCS Key";
|
||||
$this->langContent[$this->lang][$lang . '_WHMCS_KEY_LABEL'] = $this->componentData->companyname . " Key";
|
||||
$this->langContent[$this->lang][$lang . '_WHMCS_KEY_DESC'] = "Add the key you recieved from " . $this->componentData->companyname . " here.";
|
||||
}
|
||||
// ajust the notice based on license
|
||||
if (isset($this->whmcsEncryption) && $this->whmcsEncryption)
|
||||
{
|
||||
$this->langContent[$this->lang][$lang . '_WHMCS_KEY_NOTE_LABEL'] = "Field Encryption (whmcs)";
|
||||
$this->langContent[$this->lang][$lang . '_WHMCS_KEY_NOTE_DESC'] = "When using this (whmcs) encryption you need to get a key from <a href='".$this->componentData->whmcs_buy_link."' target='_blank'>" . $this->componentData->companyname . "</a>.<br />Never change this key once it is set! <b>DATA WILL GET CORRUPTED IF YOU DO!</b>";
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($this->componentData->license_type == 3)
|
||||
{
|
||||
$this->langContent[$this->lang][$lang . '_WHMCS_KEY_NOTE_LABEL'] = "Your License Key";
|
||||
$this->langContent[$this->lang][$lang . '_WHMCS_KEY_NOTE_LABEL'] = "Your " . $this->componentData->companyname . " License Key";
|
||||
}
|
||||
elseif ($this->componentData->license_type == 2)
|
||||
{
|
||||
$this->langContent[$this->lang][$lang . '_WHMCS_KEY_NOTE_LABEL'] = "Your Update Key";
|
||||
$this->langContent[$this->lang][$lang . '_WHMCS_KEY_NOTE_LABEL'] = "Your " . $this->componentData->companyname . " Update Key";
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->langContent[$this->lang][$lang . '_WHMCS_KEY_NOTE_LABEL'] = "Your Key (whmcs)";
|
||||
if (isset($this->whmcsEncryption) && $this->whmcsEncryption)
|
||||
{
|
||||
$this->langContent[$this->lang][$lang . '_WHMCS_KEY_NOTE_LABEL'] = "Your " . $this->componentData->companyname . " Field Encryption Key";
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->langContent[$this->lang][$lang . '_WHMCS_KEY_NOTE_LABEL'] = "Your " . $this->componentData->companyname . " Key";
|
||||
}
|
||||
}
|
||||
// add the description based on global settings
|
||||
if (isset($this->whmcsEncryption) && $this->whmcsEncryption)
|
||||
{
|
||||
$this->langContent[$this->lang][$lang . '_WHMCS_KEY_NOTE_DESC'] = "You need to get this key from <a href='".$this->componentData->whmcs_buy_link."' target='_blank'>" . $this->componentData->companyname . "</a>.<br />When using the " . $this->componentData->companyname . " field encryption you can never change this key once it is set! <b>DATA WILL GET CORRUPTED IF YOU DO!</b>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->langContent[$this->lang][$lang . '_WHMCS_KEY_NOTE_DESC'] = "You need to get this key from <a href='".$this->componentData->whmcs_buy_link."' target='_blank'>" . $this->componentData->companyname . "</a>.";
|
||||
}
|
||||
// set the fields
|
||||
$this->configFieldSets[] = $this->_t(2) . '<field type="note" name="whmcs_key_note" class="alert alert-info" label="' . $lang . '_WHMCS_KEY_NOTE_LABEL" description="' . $lang . '_WHMCS_KEY_NOTE_DESC" />';
|
||||
$this->configFieldSets[] = $this->_t(2) . '<field name="advanced_key"'; // We are going to change this field to whmcs_key (TODO)
|
||||
$this->configFieldSets[] = $this->_t(2) . '<field name="whmcs_key"'; // We had to change this from license_key & advanced_key to whmcs_key
|
||||
$this->configFieldSets[] = $this->_t(3) . 'type="text"';
|
||||
$this->configFieldSets[] = $this->_t(3) . 'label="' . $lang . '_WHMCS_KEY_LABEL"';
|
||||
$this->configFieldSets[] = $this->_t(3) . 'description="' . $lang . '_WHMCS_KEY_DESC"';
|
||||
|
@ -99,7 +99,13 @@ class Mapping
|
||||
*/
|
||||
public function __construct($data = false)
|
||||
{
|
||||
// set the app to insure messages can be set
|
||||
$this->app = JFactory::getApplication();
|
||||
// check that we have data
|
||||
if (ComponentbuilderHelper::checkArray($data))
|
||||
{
|
||||
// make sure we have an id
|
||||
if (isset($data['id']) && $data['id'] > 0)
|
||||
{
|
||||
if (isset($data['buildcomp']) && 1 == $data['buildcomp'] && isset($data['buildcompsql']))
|
||||
{
|
||||
@ -146,6 +152,12 @@ class Mapping
|
||||
}
|
||||
return false; // not set so just return without any error
|
||||
}
|
||||
$this->app->enqueueMessage(
|
||||
JText::_('Please try again, this error usualy happens if it is a new component, beacues we need a component ID to do this build with your sql dump.'),
|
||||
'Error'
|
||||
);
|
||||
return false;
|
||||
}
|
||||
$this->app->enqueueMessage(
|
||||
JText::_('Could not find the data needed to continue.'),
|
||||
'Error'
|
||||
|
@ -35,11 +35,6 @@ class Extrusion extends Builder
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct(&$data)
|
||||
{
|
||||
// set the app to insure messages can be set
|
||||
$this->app = JFactory::getApplication();
|
||||
// make sure we have an id
|
||||
if (isset($data['id']) && $data['id'] > 0)
|
||||
{
|
||||
// first we run the perent constructor
|
||||
if (parent::__construct($data))
|
||||
@ -56,12 +51,6 @@ class Extrusion extends Builder
|
||||
}
|
||||
return false;
|
||||
}
|
||||
$this->app->enqueueMessage(
|
||||
JText::_('Please try again, this error usualy happens if it is a new component, beacues we need a component ID to do this build with your sql dump.'),
|
||||
'Error'
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* link the build views to the component
|
||||
|
Loading…
Reference in New Issue
Block a user