added JCB initial API frontend to run backups of JCB components, setup automated backup system with cronjob
This commit is contained in:
parent
ddeb02de74
commit
e0730d3bf6
@ -108,13 +108,13 @@ Component Builder is mapped as a component in itself on my local development env
|
||||
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
|
||||
+ *Name*: [Component Builder](http://vdm.bz/component-builder)
|
||||
+ *First Build*: 30th April, 2015
|
||||
+ *Last Build*: 12th August, 2017
|
||||
+ *Last Build*: 19th August, 2017
|
||||
+ *Version*: 2.4.10
|
||||
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
|
||||
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
+ *Line count*: **106298**
|
||||
+ *File count*: **651**
|
||||
+ *Folder count*: **115**
|
||||
+ *Line count*: **111624**
|
||||
+ *File count*: **662**
|
||||
+ *Folder count*: **117**
|
||||
|
||||
> This **component** was build with a Joomla [Automated Component Builder](http://vdm.bz/component-builder).
|
||||
> Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io)
|
||||
|
@ -108,13 +108,13 @@ Component Builder is mapped as a component in itself on my local development env
|
||||
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
|
||||
+ *Name*: [Component Builder](http://vdm.bz/component-builder)
|
||||
+ *First Build*: 30th April, 2015
|
||||
+ *Last Build*: 12th August, 2017
|
||||
+ *Last Build*: 19th August, 2017
|
||||
+ *Version*: 2.4.10
|
||||
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
|
||||
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
+ *Line count*: **106298**
|
||||
+ *File count*: **651**
|
||||
+ *Folder count*: **115**
|
||||
+ *Line count*: **111624**
|
||||
+ *File count*: **662**
|
||||
+ *Folder count*: **117**
|
||||
|
||||
> This **component** was build with a Joomla [Automated Component Builder](http://vdm.bz/component-builder).
|
||||
> Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io)
|
||||
|
@ -101,6 +101,7 @@
|
||||
<action name="help_document.export" title="COM_COMPONENTBUILDER_HELP_DOCUMENTS_EXPORT" description="COM_COMPONENTBUILDER_HELP_DOCUMENTS_EXPORT_DESC" />
|
||||
<action name="help_document.import" title="COM_COMPONENTBUILDER_HELP_DOCUMENTS_IMPORT" description="COM_COMPONENTBUILDER_HELP_DOCUMENTS_IMPORT_DESC" />
|
||||
<action name="help_document.submenu" title="COM_COMPONENTBUILDER_HELP_DOCUMENTS_SUBMENU" description="COM_COMPONENTBUILDER_HELP_DOCUMENTS_SUBMENU_DESC" />
|
||||
<action name="joomla_component.backup" title="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BACKUP_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BACKUP_BUTTON_ACCESS_DESC" />
|
||||
<action name="joomla_component.export_components" title="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EXPORT_COMPONENTS_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EXPORT_COMPONENTS_BUTTON_ACCESS_DESC" />
|
||||
<action name="joomla_component.import_components" title="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_IMPORT_COMPONENTS_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_IMPORT_COMPONENTS_BUTTON_ACCESS_DESC" />
|
||||
<action name="joomla_component.access" title="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_ACCESS" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_ACCESS_DESC" />
|
||||
|
@ -10,7 +10,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.4.10
|
||||
@build 12th August, 2017
|
||||
@build 19th August, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage admin.css
|
||||
|
@ -10,7 +10,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.4.10
|
||||
@build 12th August, 2017
|
||||
@build 19th August, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage dashboard.css
|
||||
|
@ -9,8 +9,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version @update number 338 of this MVC
|
||||
@build 7th August, 2017
|
||||
@version @update number 355 of this MVC
|
||||
@build 19th August, 2017
|
||||
@created 6th May, 2015
|
||||
@package Component Builder
|
||||
@subpackage joomla_component.css
|
||||
|
@ -9,8 +9,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version @update number 338 of this MVC
|
||||
@build 7th August, 2017
|
||||
@version @update number 355 of this MVC
|
||||
@build 19th August, 2017
|
||||
@created 6th May, 2015
|
||||
@package Component Builder
|
||||
@subpackage joomla_components.css
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 23 KiB |
BIN
admin/assets/images/vdm-component.jpg
Normal file
BIN
admin/assets/images/vdm-component.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 52 KiB |
@ -157,7 +157,14 @@ abstract class ###Component###Helper
|
||||
$query = $db->getQuery(true);
|
||||
|
||||
$query->select($db->quoteName(array($what)));
|
||||
$query->from($db->quoteName('#_'.$main.'_'.$table));
|
||||
if (empty($table))
|
||||
{
|
||||
$query->from($db->quoteName('#__'.$main));
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->from($db->quoteName('#__'.$main.'_'.$table));
|
||||
}
|
||||
$query->where($db->quoteName($whereString) . ' '.$operator.' (' . implode(',',$where) . ')');
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
@ -440,12 +447,20 @@ abstract class ###Component###Helper
|
||||
**/
|
||||
public static function getModel($name, $path = JPATH_COMPONENT_ADMINISTRATOR, $component = '###component###')
|
||||
{
|
||||
// load some joomla helpers
|
||||
JLoader::import('joomla.application.component.model');
|
||||
// load the model file
|
||||
JLoader::import( $name, $path . '/models' );
|
||||
// return instance
|
||||
return JModelLegacy::getInstance( $name, $component.'Model' );
|
||||
JModelLegacy::addIncludePath( $path . '/models' );
|
||||
// get instance
|
||||
$model = JModelLegacy::getInstance( $name, $component.'Model' );
|
||||
// if model not found
|
||||
if ($model == false)
|
||||
{
|
||||
// build class name
|
||||
$class = $prefix.$name;
|
||||
// initilize the model
|
||||
new $class();
|
||||
$model = JModelLegacy::getInstance($name, $prefix);
|
||||
}
|
||||
return $model;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -652,10 +667,16 @@ abstract class ###Component###Helper
|
||||
return false;
|
||||
}
|
||||
|
||||
// typo sorry!
|
||||
public static function sorten($string, $length = 40, $addTip = true)
|
||||
{
|
||||
return self::shorten($string, $length, $addTip);
|
||||
}
|
||||
|
||||
public static function shorten($string, $length = 40, $addTip = true)
|
||||
{
|
||||
if (self::checkString($string))
|
||||
{
|
||||
{
|
||||
$initial = strlen($string);
|
||||
$words = preg_split('/([\s\n\r]+)/', $string, null, PREG_SPLIT_DELIM_CAPTURE);
|
||||
$words_count = count($words);
|
||||
@ -675,7 +696,7 @@ abstract class ###Component###Helper
|
||||
$final = strlen($newString);
|
||||
if ($initial != $final && $addTip)
|
||||
{
|
||||
$title = self::sorten($string, 400 , false);
|
||||
$title = self::shorten($string, 400 , false);
|
||||
return '<span class="hasTip" title="'.$title.'" style="cursor:help">'.trim($newString).'...</span>';
|
||||
}
|
||||
elseif ($initial != $final && !$addTip)
|
||||
@ -774,15 +795,15 @@ abstract class ###Component###Helper
|
||||
return '';
|
||||
}
|
||||
|
||||
public static function htmlEscape($var, $charset = 'UTF-8', $sorten = false, $length = 40)
|
||||
public static function htmlEscape($var, $charset = 'UTF-8', $shorten = false, $length = 40)
|
||||
{
|
||||
if (self::checkString($var))
|
||||
{
|
||||
$filter = new JFilterInput();
|
||||
$string = $filter->clean(html_entity_decode(htmlentities($var, ENT_COMPAT, $charset)), 'HTML');
|
||||
if ($sorten)
|
||||
if ($shorten)
|
||||
{
|
||||
return self::sorten($string,$length);
|
||||
return self::shorten($string,$length);
|
||||
}
|
||||
return $string;
|
||||
}
|
||||
|
@ -276,4 +276,70 @@ abstract class ###Component###Email
|
||||
|
||||
return $sendmail;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the HTML email body
|
||||
*
|
||||
* @return string on success
|
||||
*
|
||||
*/
|
||||
public static function setHtmlEmailBody($html, $subject)
|
||||
{
|
||||
$body = array();
|
||||
$body[] = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">";
|
||||
$body[] = "<html xmlns=\"http://www.w3.org/1999/xhtml\">";
|
||||
$body[] = "<head>";
|
||||
$body[] = "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />";
|
||||
$body[] = "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>";
|
||||
$body[] = "<title>".$subject."</title>";
|
||||
$body[] = "<style type=\"text/css\">";
|
||||
$body[] = "#outlook a {padding:0;}";
|
||||
$body[] = ".ExternalClass {width:100%;}";
|
||||
$body[] = ".ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {line-height: 100%;} ";
|
||||
$body[] = "p {margin: 0; padding: 0; font-size: 0px; line-height: 0px;} ";
|
||||
$body[] = "table td {border-collapse: collapse;}";
|
||||
$body[] = "table {border-collapse: collapse; mso-table-lspace:0pt; mso-table-rspace:0pt; }";
|
||||
$body[] = "img {display: block; outline: none; text-decoration: none; -ms-interpolation-mode: bicubic;}";
|
||||
$body[] = "a img {border: none;}";
|
||||
$body[] = "a {text-decoration: none; color: #000001;}";
|
||||
$body[] = "a.phone {text-decoration: none; color: #000001 !important; pointer-events: auto; cursor: default;}";
|
||||
$body[] = "span {font-size: 13px; line-height: 17px; font-family: monospace; color: #000001;}";
|
||||
$body[] = "</style>";
|
||||
$body[] = "<!--[if gte mso 9]>";
|
||||
$body[] = "<style>";
|
||||
$body[] = "/* Target Outlook 2007 and 2010 */";
|
||||
$body[] = "</style>";
|
||||
$body[] = "<![endif]-->";
|
||||
$body[] = "</head>";
|
||||
$body[] = "<body style=\"width:100%; margin:0; padding:0; -webkit-text-size-adjust:100%; -ms-text-size-adjust:100%;\">";
|
||||
$body[] = "\n<!-- body wrapper -->";
|
||||
$body[] = "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"margin:0; padding:0; width:100%; line-height: 100% !important;\">";
|
||||
$body[] = "<tr>";
|
||||
$body[] = "<td valign=\"top\">";
|
||||
$body[] = "<!-- edge wrapper -->";
|
||||
$body[] = "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\" width=\"800\" >";
|
||||
$body[] = "<tr>";
|
||||
$body[] = "<td valign=\"top\">";
|
||||
$body[] = "<!-- content wrapper -->";
|
||||
$body[] = "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\" width=\"780\">";
|
||||
$body[] = "<tr>";
|
||||
$body[] = "<td valign=\"top\" style=\"vertical-align: top;\">";
|
||||
$body[] = $html;
|
||||
$body[] = "</td>";
|
||||
$body[] = "</tr>";
|
||||
$body[] = "</table>";
|
||||
$body[] = "<!-- / content wrapper -->";
|
||||
$body[] = "</td>";
|
||||
$body[] = "</tr>";
|
||||
$body[] = "</table>";
|
||||
$body[] = "<!-- / edge wrapper -->";
|
||||
$body[] = "</td>";
|
||||
$body[] = "</tr>";
|
||||
$body[] = "</table>";
|
||||
$body[] = "<!-- / page wrapper -->";
|
||||
$body[] = "</body>";
|
||||
$body[] = "</html>";
|
||||
|
||||
return implode("\n", $body);
|
||||
}
|
||||
}
|
||||
|
@ -118,12 +118,23 @@ abstract class ###Component###Helper
|
||||
**/
|
||||
public static function getModel($name, $path = JPATH_COMPONENT_SITE, $component = '###component###')
|
||||
{
|
||||
// load some joomla helpers
|
||||
JLoader::import('joomla.application.component.model');
|
||||
// full path
|
||||
$fullPath = $path . '/models';
|
||||
// load the model file
|
||||
JLoader::import( $name, $path . '/models' );
|
||||
// return instance
|
||||
return JModelLegacy::getInstance( $name, $component.'Model' );
|
||||
JModelLegacy::addIncludePath($fullPath);
|
||||
// get instance
|
||||
$model = JModelLegacy::getInstance( $name, $component.'Model' );
|
||||
// if model not found
|
||||
if ($model == false)
|
||||
{
|
||||
require_once $fullPath.'/'.strtolower($name).'.php';
|
||||
// build class name
|
||||
$class = $prefix.$name;
|
||||
// initialize the model
|
||||
new $class();
|
||||
$model = JModelLegacy::getInstance($name, $prefix);
|
||||
}
|
||||
return $model;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -331,7 +342,14 @@ abstract class ###Component###Helper
|
||||
$query = $db->getQuery(true);
|
||||
|
||||
$query->select($db->quoteName(array($what)));
|
||||
$query->from($db->quoteName('#_'.$main.'_'.$table));
|
||||
if (empty($table))
|
||||
{
|
||||
$query->from($db->quoteName('#__'.$main));
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->from($db->quoteName('#__'.$main.'_'.$table));
|
||||
}
|
||||
$query->where($db->quoteName($whereString) . ' '.$operator.' (' . implode(',',$where) . ')');
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
@ -644,7 +662,13 @@ abstract class ###Component###Helper
|
||||
return false;
|
||||
}
|
||||
|
||||
// typo sorry!
|
||||
public static function sorten($string, $length = 40, $addTip = true)
|
||||
{
|
||||
return self::shorten($string, $length, $addTip);
|
||||
}
|
||||
|
||||
public static function shorten($string, $length = 40, $addTip = true)
|
||||
{
|
||||
if (self::checkString($string))
|
||||
{
|
||||
@ -667,7 +691,7 @@ abstract class ###Component###Helper
|
||||
$final = strlen($newString);
|
||||
if ($initial != $final && $addTip)
|
||||
{
|
||||
$title = self::sorten($string, 400 , false);
|
||||
$title = self::shorten($string, 400 , false);
|
||||
return '<span class="hasTip" title="'.$title.'" style="cursor:help">'.trim($newString).'...</span>';
|
||||
}
|
||||
elseif ($initial != $final && !$addTip)
|
||||
@ -766,15 +790,15 @@ abstract class ###Component###Helper
|
||||
return '';
|
||||
}
|
||||
|
||||
public static function htmlEscape($var, $charset = 'UTF-8', $sorten = false, $length = 40)
|
||||
public static function htmlEscape($var, $charset = 'UTF-8', $shorten = false, $length = 40)
|
||||
{
|
||||
if (self::checkString($var))
|
||||
{
|
||||
$filter = new JFilterInput();
|
||||
$string = $filter->clean(html_entity_decode(htmlentities($var, ENT_COMPAT, $charset)), 'HTML');
|
||||
if ($sorten)
|
||||
if ($shorten)
|
||||
{
|
||||
return self::sorten($string,$length);
|
||||
return self::shorten($string,$length);
|
||||
}
|
||||
return $string;
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ defined('_JEXEC') or die('Restricted access');
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
?>
|
||||
<img alt="<?php echo JText::_('COM_###COMPONENT###'); ?>" src="components/com_###component###/assets/images/component-300.###COMP_IMAGE_TYPE###">
|
||||
<img alt="<?php echo JText::_('COM_###COMPONENT###'); ?>" src="components/com_###component###/assets/images/vdm-component.###COMP_IMAGE_TYPE###">
|
||||
<ul class="list-striped">
|
||||
<li><b><?php echo JText::_('COM_###COMPONENT###_VERSION'); ?>:</b> <?php echo $this->manifest->version; ?> <span class="update-notice"></span></li>
|
||||
<li><b><?php echo JText::_('COM_###COMPONENT###_DATE'); ?>:</b> <?php echo $this->manifest->creationDate; ?></li>
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.4.10
|
||||
@build 12th August, 2017
|
||||
@build 19th August, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage componentbuilder.php
|
||||
@ -43,7 +43,8 @@ $document->addStyleSheet('components/com_componentbuilder/assets/css/admin.css')
|
||||
$document->addScript('components/com_componentbuilder/assets/js/admin.js');
|
||||
|
||||
// require helper files
|
||||
JLoader::register('ComponentbuilderHelper', dirname(__FILE__) . '/helpers/componentbuilder.php');
|
||||
JLoader::register('ComponentbuilderHelper', dirname(__FILE__) . '/helpers/componentbuilder.php');
|
||||
JLoader::register('ComponentbuilderEmail', JPATH_COMPONENT_ADMINISTRATOR . '/helpers/componentbuilderemail.php');
|
||||
JLoader::register('JHtmlBatch_', dirname(__FILE__) . '/helpers/html/batch_.php');
|
||||
|
||||
// Triger the Global Admin Event
|
||||
|
401
admin/config.xml
401
admin/config.xml
@ -75,7 +75,16 @@
|
||||
step="10"
|
||||
/>
|
||||
<!-- Spacer_hr_a Field. Type: Spacer. A None Database Field. (joomla) -->
|
||||
<field type="spacer" name="spacer_hr_a" hr="true" class="spacer_hr_a" />
|
||||
<field type="spacer" name="spacer_hr_a" hr="true" class="spacer_hr_a" />
|
||||
<!-- Api Field. Type: User. (joomla) -->
|
||||
<field
|
||||
type="user"
|
||||
name="api"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_API_LABEL"
|
||||
description="COM_COMPONENTBUILDER_CONFIG_API_DESCRIPTION"
|
||||
/>
|
||||
<!-- Spacer_hr_b Field. Type: Spacer. A None Database Field. (joomla) -->
|
||||
<field type="spacer" name="spacer_hr_b" hr="true" class="spacer_hr_b" />
|
||||
<field name="autorTitle"
|
||||
type="spacer"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_AUTHOR"
|
||||
@ -146,6 +155,340 @@
|
||||
COM_COMPONENTBUILDER_CONFIG_GRADIANT_LOAD</option>"
|
||||
</field>
|
||||
</fieldset>
|
||||
|
||||
<fieldset
|
||||
name="mail_configuration_custom_config"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_MAIL_CONFIGURATION">
|
||||
|
||||
<!-- Mailonline Field. Type: Radio. (joomla) -->
|
||||
<field
|
||||
type="radio"
|
||||
name="mailonline"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_MAILONLINE_LABEL"
|
||||
description="COM_COMPONENTBUILDER_CONFIG_MAILONLINE_DESCRIPTION"
|
||||
class="btn-group btn-group-yesno"
|
||||
default="1">
|
||||
<!-- Option Set. -->
|
||||
<option value="1">
|
||||
COM_COMPONENTBUILDER_CONFIG_ON</option>
|
||||
<option value="0">
|
||||
COM_COMPONENTBUILDER_CONFIG_OFF</option>
|
||||
</field>
|
||||
<!-- Mailer Field. Type: List. (joomla) -->
|
||||
<field
|
||||
type="list"
|
||||
name="mailer"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_MAILER_LABEL"
|
||||
description="COM_COMPONENTBUILDER_CONFIG_MAILER_DESCRIPTION"
|
||||
class="list_class"
|
||||
multiple="false"
|
||||
filter="WORD"
|
||||
required="true"
|
||||
default="global">
|
||||
<!-- Option Set. -->
|
||||
<option value="global">
|
||||
COM_COMPONENTBUILDER_CONFIG_GLOBAL</option>
|
||||
<option value="default">
|
||||
COM_COMPONENTBUILDER_CONFIG_PHP_MAIL</option>
|
||||
<option value="sendmail">
|
||||
COM_COMPONENTBUILDER_CONFIG_SENDMAIL</option>
|
||||
<option value="smtp">
|
||||
COM_COMPONENTBUILDER_CONFIG_SMTP</option>
|
||||
</field>
|
||||
<!-- Emailfrom Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="emailfrom"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_EMAILFROM_LABEL"
|
||||
size="60"
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_CONFIG_EMAILFROM_DESCRIPTION"
|
||||
class="text_area"
|
||||
filter="STRING"
|
||||
validate="email"
|
||||
message="Error! Please add email address here."
|
||||
hint="COM_COMPONENTBUILDER_CONFIG_EMAILFROM_HINT"
|
||||
showon="mailer:smtp,sendmail,default"
|
||||
/>
|
||||
<!-- Fromname Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="fromname"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_FROMNAME_LABEL"
|
||||
size="60"
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_CONFIG_FROMNAME_DESCRIPTION"
|
||||
class="text_area"
|
||||
filter="STRING"
|
||||
message="Error! Please add some name here."
|
||||
hint="COM_COMPONENTBUILDER_CONFIG_FROMNAME_HINT"
|
||||
showon="mailer:smtp,sendmail,default"
|
||||
/>
|
||||
<!-- Emailreply Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="emailreply"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_EMAILREPLY_LABEL"
|
||||
size="60"
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_CONFIG_EMAILREPLY_DESCRIPTION"
|
||||
class="text_area"
|
||||
filter="STRING"
|
||||
validate="email"
|
||||
message="Error! Please add email address here."
|
||||
hint="COM_COMPONENTBUILDER_CONFIG_EMAILREPLY_HINT"
|
||||
showon="mailer:smtp,sendmail,default"
|
||||
/>
|
||||
<!-- Replyname Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="replyname"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_REPLYNAME_LABEL"
|
||||
size="60"
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_CONFIG_REPLYNAME_DESCRIPTION"
|
||||
class="text_area"
|
||||
filter="STRING"
|
||||
message="Error! Please add some name here."
|
||||
hint="COM_COMPONENTBUILDER_CONFIG_REPLYNAME_HINT"
|
||||
showon="mailer:smtp,sendmail,default"
|
||||
/>
|
||||
<!-- Sendmail Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="sendmail"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_SENDMAIL_LABEL"
|
||||
size="60"
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_CONFIG_SENDMAIL_DESCRIPTION"
|
||||
class="text_area"
|
||||
required="false"
|
||||
filter="PATH"
|
||||
message="Error! Please add path to you local sendmail here."
|
||||
hint="COM_COMPONENTBUILDER_CONFIG_SENDMAIL_HINT"
|
||||
showon="mailer:sendmail"
|
||||
/>
|
||||
<!-- Smtpauth Field. Type: Radio. (joomla) -->
|
||||
<field
|
||||
type="radio"
|
||||
name="smtpauth"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_SMTPAUTH_LABEL"
|
||||
description="COM_COMPONENTBUILDER_CONFIG_SMTPAUTH_DESCRIPTION"
|
||||
class="btn-group btn-group-yesno"
|
||||
default="0"
|
||||
showon="mailer:smtp">
|
||||
<!-- Option Set. -->
|
||||
<option value="1">
|
||||
COM_COMPONENTBUILDER_CONFIG_YES</option>
|
||||
<option value="0">
|
||||
COM_COMPONENTBUILDER_CONFIG_NO</option>
|
||||
</field>
|
||||
<!-- Smtpsecure Field. Type: List. (joomla) -->
|
||||
<field
|
||||
type="list"
|
||||
name="smtpsecure"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_SMTPSECURE_LABEL"
|
||||
description="COM_COMPONENTBUILDER_CONFIG_SMTPSECURE_DESCRIPTION"
|
||||
class="list_class"
|
||||
multiple="false"
|
||||
filter="WORD"
|
||||
default="none"
|
||||
showon="mailer:smtp">
|
||||
<!-- Option Set. -->
|
||||
<option value="none">
|
||||
COM_COMPONENTBUILDER_CONFIG_NONE</option>
|
||||
<option value="ssl">
|
||||
COM_COMPONENTBUILDER_CONFIG_SSL</option>
|
||||
<option value="tls">
|
||||
COM_COMPONENTBUILDER_CONFIG_TLS</option>
|
||||
</field>
|
||||
<!-- Smtpport Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="smtpport"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_SMTPPORT_LABEL"
|
||||
size="60"
|
||||
maxlength="150"
|
||||
default="25"
|
||||
description="COM_COMPONENTBUILDER_CONFIG_SMTPPORT_DESCRIPTION"
|
||||
class="text_area"
|
||||
filter="INT"
|
||||
message="Error! Please add the port number of your SMTP server here."
|
||||
hint="COM_COMPONENTBUILDER_CONFIG_SMTPPORT_HINT"
|
||||
showon="mailer:smtp"
|
||||
/>
|
||||
<!-- Smtpuser Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="smtpuser"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_SMTPUSER_LABEL"
|
||||
size="60"
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_CONFIG_SMTPUSER_DESCRIPTION"
|
||||
class="text_area"
|
||||
filter="STRING"
|
||||
message="Error! Please add the username for SMTP server here."
|
||||
hint="COM_COMPONENTBUILDER_CONFIG_SMTPUSER_HINT"
|
||||
showon="mailer:smtp"
|
||||
/>
|
||||
<!-- Smtppass Field. Type: Password. (joomla) -->
|
||||
<field
|
||||
type="password"
|
||||
name="smtppass"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_SMTPPASS_LABEL"
|
||||
size="60"
|
||||
description="COM_COMPONENTBUILDER_CONFIG_SMTPPASS_DESCRIPTION"
|
||||
class="text_area"
|
||||
filter="raw"
|
||||
message="Error! Please add the password for SMTP server here."
|
||||
showon="mailer:smtp"
|
||||
/>
|
||||
<!-- Smtphost Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="smtphost"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_SMTPHOST_LABEL"
|
||||
size="60"
|
||||
maxlength="150"
|
||||
default="localhost"
|
||||
description="COM_COMPONENTBUILDER_CONFIG_SMTPHOST_DESCRIPTION"
|
||||
class="text_area"
|
||||
filter="STRING"
|
||||
message="Error! Please add the name of the SMTP host here."
|
||||
hint="COM_COMPONENTBUILDER_CONFIG_SMTPHOST_HINT"
|
||||
showon="mailer:smtp"
|
||||
/>
|
||||
</fieldset>
|
||||
<fieldset
|
||||
name="dkim_custom_config"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_DKIM">
|
||||
|
||||
<!-- Dkim Field. Type: Radio. (joomla) -->
|
||||
<field
|
||||
type="radio"
|
||||
name="dkim"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_DKIM_LABEL"
|
||||
description="COM_COMPONENTBUILDER_CONFIG_DKIM_DESCRIPTION"
|
||||
class="btn-group btn-group-yesno"
|
||||
default="0"
|
||||
required="true">
|
||||
<!-- Option Set. -->
|
||||
<option value="1">
|
||||
COM_COMPONENTBUILDER_CONFIG_YES</option>
|
||||
<option value="0">
|
||||
COM_COMPONENTBUILDER_CONFIG_NO</option>
|
||||
</field>
|
||||
<!-- Dkim_domain Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="dkim_domain"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_DKIM_DOMAIN_LABEL"
|
||||
size="60"
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_CONFIG_DKIM_DOMAIN_DESCRIPTION"
|
||||
class="text_area"
|
||||
filter="STRING"
|
||||
message="Error! Please add DKIM Domain here."
|
||||
hint="COM_COMPONENTBUILDER_CONFIG_DKIM_DOMAIN_HINT"
|
||||
showon="dkim:1"
|
||||
onchange="vdm_dkim();"
|
||||
/>
|
||||
<!-- Dkim_selector Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="dkim_selector"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_DKIM_SELECTOR_LABEL"
|
||||
size="60"
|
||||
maxlength="150"
|
||||
default="vdm"
|
||||
description="COM_COMPONENTBUILDER_CONFIG_DKIM_SELECTOR_DESCRIPTION"
|
||||
class="text_area"
|
||||
filter="STRING"
|
||||
message="Error! Please add DKIM/DNS selector here."
|
||||
hint="COM_COMPONENTBUILDER_CONFIG_DKIM_SELECTOR_HINT"
|
||||
showon="dkim:1"
|
||||
onchange="vdm_dkim();"
|
||||
/>
|
||||
<!-- Dkim_passphrase Field. Type: Password. (joomla) -->
|
||||
<field
|
||||
type="password"
|
||||
name="dkim_passphrase"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_DKIM_PASSPHRASE_LABEL"
|
||||
size="60"
|
||||
description="COM_COMPONENTBUILDER_CONFIG_DKIM_PASSPHRASE_DESCRIPTION"
|
||||
class="text_area"
|
||||
filter="raw"
|
||||
message="Error! Please add passphrase here."
|
||||
showon="dkim:1"
|
||||
/>
|
||||
<!-- Dkim_identity Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="dkim_identity"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_DKIM_IDENTITY_LABEL"
|
||||
size="60"
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_CONFIG_DKIM_IDENTITY_DESCRIPTION"
|
||||
class="text_area"
|
||||
filter="raw"
|
||||
message="Error! Please add DKIM Identity here."
|
||||
hint="COM_COMPONENTBUILDER_CONFIG_DKIM_IDENTITY_HINT"
|
||||
showon="dkim:1"
|
||||
/>
|
||||
<!-- Dkim_private_key Field. Type: Textarea. (joomla) -->
|
||||
<field
|
||||
type="textarea"
|
||||
name="dkim_private_key"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_DKIM_PRIVATE_KEY_LABEL"
|
||||
rows="15"
|
||||
cols="5"
|
||||
description="COM_COMPONENTBUILDER_CONFIG_DKIM_PRIVATE_KEY_DESCRIPTION"
|
||||
class="input-xxlarge span12"
|
||||
showon="dkim:1"
|
||||
/>
|
||||
<!-- Dkim_public_key Field. Type: Textarea. (joomla) -->
|
||||
<field
|
||||
type="textarea"
|
||||
name="dkim_public_key"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_DKIM_PUBLIC_KEY_LABEL"
|
||||
rows="5"
|
||||
cols="5"
|
||||
description="COM_COMPONENTBUILDER_CONFIG_DKIM_PUBLIC_KEY_DESCRIPTION"
|
||||
class="input-xxlarge span12"
|
||||
showon="dkim:1"
|
||||
onchange="vdm_dkim();"
|
||||
/>
|
||||
<!-- Note_dkim_use Field. Type: Note. A None Database Field. (joomla) -->
|
||||
<field type="note" name="note_dkim_use" label="COM_COMPONENTBUILDER_CONFIG_NOTE_DKIM_USE_LABEL" description="COM_COMPONENTBUILDER_CONFIG_NOTE_DKIM_USE_DESCRIPTION" heading="h4" class="note_dkim_use" showon="dkim:1" />
|
||||
<!-- Dkim_key Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="dkim_key"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_DKIM_KEY_LABEL"
|
||||
size="40"
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_CONFIG_DKIM_KEY_DESCRIPTION"
|
||||
class="text_area"
|
||||
filter="STRING"
|
||||
message="Error! Please add KEY here."
|
||||
hint="COM_COMPONENTBUILDER_CONFIG_DKIM_KEY_HINT"
|
||||
showon="dkim:1"
|
||||
/>
|
||||
<!-- Dkim_value Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="dkim_value"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_DKIM_VALUE_LABEL"
|
||||
size="80"
|
||||
maxlength="350"
|
||||
description="COM_COMPONENTBUILDER_CONFIG_DKIM_VALUE_DESCRIPTION"
|
||||
class="text_area"
|
||||
filter="STRING"
|
||||
message="Error! Please add TXT record here."
|
||||
hint="COM_COMPONENTBUILDER_CONFIG_DKIM_VALUE_HINT"
|
||||
showon="dkim:1"
|
||||
/>
|
||||
</fieldset>
|
||||
<fieldset
|
||||
name="encryption_config"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_ENCRYPTION_LABEL"
|
||||
@ -159,6 +502,62 @@
|
||||
default=""
|
||||
/>
|
||||
</fieldset>
|
||||
<fieldset
|
||||
name="cronjob_custom_config"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_CRONJOB">
|
||||
|
||||
<!-- Backupcronjob_note Field. Type: Note. A None Database Field. (joomla) -->
|
||||
<field type="note" name="backupcronjob_note" label="COM_COMPONENTBUILDER_CONFIG_BACKUPCRONJOB_NOTE_LABEL" description="COM_COMPONENTBUILDER_CONFIG_BACKUPCRONJOB_NOTE_DESCRIPTION" heading="h4" class="backupcronjob_note" />
|
||||
<!-- Cronjob_backup_folder_path Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="cronjob_backup_folder_path"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_CRONJOB_BACKUP_FOLDER_PATH_LABEL"
|
||||
size="70"
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_CONFIG_CRONJOB_BACKUP_FOLDER_PATH_DESCRIPTION"
|
||||
class="text_area"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
required="false"
|
||||
filter="PATH"
|
||||
message="Error! Please add some text here."
|
||||
hint="COM_COMPONENTBUILDER_CONFIG_CRONJOB_BACKUP_FOLDER_PATH_HINT"
|
||||
/>
|
||||
<!-- Backup_email Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="backup_email"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_BACKUP_EMAIL_LABEL"
|
||||
size="10"
|
||||
maxlength="50"
|
||||
description="COM_COMPONENTBUILDER_CONFIG_BACKUP_EMAIL_DESCRIPTION"
|
||||
class="text_area"
|
||||
filter="STRING"
|
||||
validate="email"
|
||||
message="Error! Please add email address here."
|
||||
hint="COM_COMPONENTBUILDER_CONFIG_BACKUP_EMAIL_HINT"
|
||||
/>
|
||||
<!-- Package_name_plaeholders Field. Type: Note. A None Database Field. (joomla) -->
|
||||
<field type="note" name="package_name_plaeholders" label="COM_COMPONENTBUILDER_CONFIG_PACKAGE_NAME_PLAEHOLDERS_LABEL" description="COM_COMPONENTBUILDER_CONFIG_PACKAGE_NAME_PLAEHOLDERS_DESCRIPTION" heading="h4" class="package_name_plaeholders" />
|
||||
<!-- Backup_package_name Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="backup_package_name"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_BACKUP_PACKAGE_NAME_LABEL"
|
||||
size="40"
|
||||
maxlength="150"
|
||||
default="JCB_Backup_[YEAR]_[MONTH]_[DAY]"
|
||||
description="COM_COMPONENTBUILDER_CONFIG_BACKUP_PACKAGE_NAME_DESCRIPTION"
|
||||
class="text_area"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
required="true"
|
||||
filter="STRING"
|
||||
message="Error! Please add name here."
|
||||
hint="COM_COMPONENTBUILDER_CONFIG_BACKUP_PACKAGE_NAME_HINT"
|
||||
/>
|
||||
</fieldset>
|
||||
<fieldset
|
||||
name="folder_paths_custom_config"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_FOLDER_PATHS">
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.4.10
|
||||
@build 12th August, 2017
|
||||
@build 19th August, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage controller.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.4.10
|
||||
@build 12th August, 2017
|
||||
@build 19th August, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage ajax.json.php
|
||||
@ -45,6 +45,7 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
|
||||
$this->registerTask('isNew', 'ajax');
|
||||
$this->registerTask('isRead', 'ajax');
|
||||
$this->registerTask('getComponentDetails', 'ajax');
|
||||
$this->registerTask('getCronPath', 'ajax');
|
||||
$this->registerTask('tableColumns', 'ajax');
|
||||
$this->registerTask('fieldSelectOptions', 'ajax');
|
||||
$this->registerTask('getImportScripts', 'ajax');
|
||||
@ -188,6 +189,44 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'getCronPath':
|
||||
try
|
||||
{
|
||||
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
|
||||
$getTypeValue = $jinput->get('getType', NULL, 'WORD');
|
||||
if($getTypeValue && $user->id != 0)
|
||||
{
|
||||
$result = $this->getModel('ajax')->getCronPath($getTypeValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = false;
|
||||
}
|
||||
if($callback = $jinput->get('callback', null, 'CMD'))
|
||||
{
|
||||
echo $callback . "(".json_encode($result).");";
|
||||
}
|
||||
elseif($returnRaw)
|
||||
{
|
||||
echo json_encode($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "(".json_encode($result).");";
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
if($callback = $jinput->get('callback', null, 'CMD'))
|
||||
{
|
||||
echo $callback."(".json_encode($e).");";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "(".json_encode($e).");";
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'tableColumns':
|
||||
try
|
||||
{
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.4.10
|
||||
@build 12th August, 2017
|
||||
@build 19th August, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage componentbuilder.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.4.10
|
||||
@build 12th August, 2017
|
||||
@build 19th August, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage help.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.4.10
|
||||
@build 12th August, 2017
|
||||
@build 19th August, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage import.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.4.10
|
||||
@build 12th August, 2017
|
||||
@build 19th August, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage import_joomla_components.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version @update number 338 of this MVC
|
||||
@build 7th August, 2017
|
||||
@version @update number 355 of this MVC
|
||||
@build 19th August, 2017
|
||||
@created 6th May, 2015
|
||||
@package Component Builder
|
||||
@subpackage joomla_component.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version @update number 338 of this MVC
|
||||
@build 7th August, 2017
|
||||
@version @update number 355 of this MVC
|
||||
@build 19th August, 2017
|
||||
@created 6th May, 2015
|
||||
@package Component Builder
|
||||
@subpackage joomla_components.php
|
||||
@ -114,8 +114,8 @@ class ComponentbuilderControllerJoomla_components extends JControllerAdmin
|
||||
// Check for request forgeries
|
||||
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
|
||||
// check if import is allowed for this user.
|
||||
$user = JFactory::getUser();
|
||||
if ($user->authorise('joomla_component.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder'))
|
||||
$model->user = JFactory::getUser();
|
||||
if ($model->user->authorise('joomla_component.import', 'com_componentbuilder') && $model->user->authorise('core.import', 'com_componentbuilder'))
|
||||
{
|
||||
$session = JFactory::getSession();
|
||||
$session->set('backto_VDM_IMPORT', 'joomla_components');
|
||||
@ -135,9 +135,11 @@ class ComponentbuilderControllerJoomla_components extends JControllerAdmin
|
||||
{
|
||||
// Check for request forgeries
|
||||
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
|
||||
// Get the model
|
||||
$model = $this->getModel('Joomla_components');
|
||||
// check if export is allowed for this user.
|
||||
$user = JFactory::getUser();
|
||||
if ($user->authorise('joomla_component.export', 'com_componentbuilder') && $user->authorise('core.export', 'com_componentbuilder'))
|
||||
$model->user = JFactory::getUser();
|
||||
if ($model->user->authorise('joomla_component.export', 'com_componentbuilder') && $model->user->authorise('core.export', 'com_componentbuilder'))
|
||||
{
|
||||
// Get the input
|
||||
$input = JFactory::getApplication()->input;
|
||||
@ -152,8 +154,6 @@ class ComponentbuilderControllerJoomla_components extends JControllerAdmin
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error');
|
||||
return;
|
||||
}
|
||||
// Get the model
|
||||
$model = $this->getModel('Joomla_components');
|
||||
// set auto loader
|
||||
ComponentbuilderHelper::autoLoader('smart');
|
||||
// get the data to export
|
||||
@ -239,4 +239,154 @@ class ComponentbuilderControllerJoomla_components extends JControllerAdmin
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
public function backup()
|
||||
{
|
||||
// get params
|
||||
if (!isset($this->params) || !ComponentbuilderHelper::checkObject($this->params))
|
||||
{
|
||||
$this->params = JComponentHelper::getParams('com_componentbuilder');
|
||||
}
|
||||
// get all component IDs to backup
|
||||
$pks = componentbuilderHelper::getComponentIDs();
|
||||
// Get the model
|
||||
$model = componentbuilderHelper::getModel('joomla_components', JPATH_ADMINISTRATOR . '/components/com_componentbuilder');
|
||||
// set user
|
||||
$model->user = $this->getApiUser();
|
||||
// make sure to set active type to backup
|
||||
$model->activeType = 'manualBackup';
|
||||
// set auto loader
|
||||
ComponentbuilderHelper::autoLoader('smart');
|
||||
// manual backup message
|
||||
$backupNotice = array();
|
||||
// get the data to export
|
||||
if (ComponentbuilderHelper::checkArray($pks) && $model->getSmartExport($pks))
|
||||
{
|
||||
$backupNotice[] = JText::_('COM_COMPONENTBUILDER_BACKUP_WAS_DONE_SUCCESSFULLY');
|
||||
$backupNoticeStatus = 'Success';
|
||||
// set the key string
|
||||
if (componentbuilderHelper::checkString($model->key) && strlen($model->key) == 32)
|
||||
{
|
||||
$textNotice = array();
|
||||
$keyNotice = '<h1>' . JText::sprintf('COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_CODESCODE', $model->key) . '</h1>';
|
||||
$textNotice[] = JText::sprintf('COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_S', $model->key);
|
||||
$keyNotice .= JText::_('COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_ONE_HUNDRED_AND_TWENTY_EIGHT_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEY_WITHOUT_THIS_KEY_IT_WILL_TAKE_THE_CURRENT_TECHNOLOGY_WITH_A_BRUTE_FORCE_ATTACK_METHOD_MORE_THEN_A_HREFHTTPRANDOMIZECOMHOWLONGTOHACKPASS_TARGET_BLANK_TITLEHOW_LONG_TO_HACK_PASSSEVEN_HUNDRED_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZEROA_YEARS_TO_CRACK_THEORETICALLY_UNLESS_THEY_HAVE_THIS_KEY_ABOVE_SO_DO_KEEP_IT_SAFE') . '<br />';
|
||||
// set the package owner info
|
||||
if ((isset($model->info['getKeyFrom']['company']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['company'])) || (isset($model->info['getKeyFrom']['owner']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['owner'])))
|
||||
{
|
||||
$ownerDetails = '<h2>' . JText::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS') . '</h2>';
|
||||
$textNotice[] = '# ' . JText::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS');
|
||||
$ownerDetails .= '<ul>';
|
||||
if (isset($model->info['getKeyFrom']['company']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['company']))
|
||||
{
|
||||
$ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMCOMPANYEM_BSB', $model->info['getKeyFrom']['company']) . '</li>';
|
||||
$textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_COMPANY_S', $model->info['getKeyFrom']['company']);
|
||||
}
|
||||
// add value only if set
|
||||
if (isset($model->info['getKeyFrom']['owner']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['owner']))
|
||||
{
|
||||
$ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMOWNEREM_BSB', $model->info['getKeyFrom']['owner']) . '</li>';
|
||||
$textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_OWNER_S', $model->info['getKeyFrom']['owner']);
|
||||
}
|
||||
// add value only if set
|
||||
if (isset($model->info['getKeyFrom']['website']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['website']))
|
||||
{
|
||||
$ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMWEBSITEEM_BSB', $model->info['getKeyFrom']['website']) . '</li>';
|
||||
$textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_WEBSITE_S', $model->info['getKeyFrom']['website']);
|
||||
}
|
||||
// add value only if set
|
||||
if (isset($model->info['getKeyFrom']['email']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['email']))
|
||||
{
|
||||
$ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMEMAILEM_BSB', $model->info['getKeyFrom']['email']) . '</li>';
|
||||
$textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_EMAIL_S', $model->info['getKeyFrom']['email']);
|
||||
}
|
||||
// add value only if set
|
||||
if (isset($model->info['getKeyFrom']['license']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['license']))
|
||||
{
|
||||
$ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMLICENSEEM_BSB', $model->info['getKeyFrom']['license']) . '</li>';
|
||||
$textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_LICENSE_S', $model->info['getKeyFrom']['license']);
|
||||
}
|
||||
// add value only if set
|
||||
if (isset($model->info['getKeyFrom']['copyright']) && componentbuilderHelper::checkString($model->info['getKeyFrom']['copyright']))
|
||||
{
|
||||
$ownerDetails .= '<li>' . JText::sprintf('COM_COMPONENTBUILDER_EMCOPYRIGHTEM_BSB', $model->info['getKeyFrom']['copyright']) . '</li>';
|
||||
$textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_COPYRIGHT_S', $model->info['getKeyFrom']['copyright']);
|
||||
}
|
||||
$ownerDetails .= '</ul>';
|
||||
$backupNotice[] = JText::_('COM_COMPONENTBUILDER_OWNER_DETAILS_WAS_SET');
|
||||
}
|
||||
else
|
||||
{
|
||||
$ownerDetails = '<h2>' . JText::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_NOT_SET') . '</h2>';
|
||||
$textNotice[] = '# ' . JText::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS');
|
||||
$ownerDetails .= JText::_('COM_COMPONENTBUILDER_TO_CHANGE_THE_PACKAGE_OWNER_DEFAULTS_OPEN_THE_BJCB_GLOBAL_OPTIONSB_GO_TO_THE_BCOMPANYB_TAB_AND_ADD_THE_CORRECT_COMPANY_DETAILS_THERE') . '<br />';
|
||||
$textNotice[] = JText::_('COM_COMPONENTBUILDER_TO_CHANGE_THE_PACKAGE_OWNER_DEFAULTS_OPEN_THE_JCB_GLOBAL_OPTIONS_GO_TO_THE_COMPANY_TAB_AND_ADD_THE_CORRECT_COMPANY_DETAILS_THERE');
|
||||
$ownerDetails .= '<h3>' . JText::_('COM_COMPONENTBUILDER_YOU_SHOULD_ADD_THE_CORRECT_OWNER_DETAILS') . '</h3>';
|
||||
$textNotice[] = '## ' . JText::_('COM_COMPONENTBUILDER_YOU_SHOULD_ADD_THE_CORRECT_OWNER_DETAILS');
|
||||
$ownerDetails .= JText::_('COM_COMPONENTBUILDER_SINCE_THE_OWNER_DETAILS_ARE_DISPLAYED_DURING_BIMPORT_PROCESSB_BEFORE_ADDING_THE_KEY_THIS_WAY_IF_THE_USERDEV_BDOES_NOTB_HAVE_THE_KEY_THEY_CAN_SEE_BWHERE_TO_GET_ITB') . '<br />';
|
||||
$textNotice[] = JText::_('COM_COMPONENTBUILDER_SINCE_THE_OWNER_DETAILS_ARE_DISPLAYED_DURING_IMPORT_PROCESS_BEFORE_ADDING_THE_KEY_THIS_WAY_IF_THE_USERDEV_DOES_NOT_HAVE_THE_KEY_THEY_CAN_SEE_WHERE_TO_GET_IT');
|
||||
$backupNotice[] = JText::_('COM_COMPONENTBUILDER_CHECK_YOUR_OWNER_DETAILS_IT_HAS_NOT_BEEN_SET_OPEN_THE_JCB_GLOBAL_OPTIONS_GO_TO_THE_COMPANY_TAB_AND_ADD_THE_CORRECT_COMPANY_DETAILS_THERE');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$keyNotice = '<h1>' . JText::_('COM_COMPONENTBUILDER_THIS_PACKAGE_HAS_NO_KEY') . '</h1>';
|
||||
$textNotice[] = '# ' . JText::_('COM_COMPONENTBUILDER_THIS_PACKAGE_HAS_NO_KEY');
|
||||
$ownerDetails = JText::_('COM_COMPONENTBUILDER_THAT_MEANS_ANYONE_WHO_HAS_THIS_PACKAGE_CAN_INSTALL_IT_INTO_JCB_TO_ADD_AN_EXPORT_KEY_SIMPLY_OPEN_THE_COMPONENT_GO_TO_THE_TAB_CALLED_BSETTINGSB_BOTTOM_RIGHT_THERE_IS_A_FIELD_CALLED_BEXPORT_KEYB') . '<br />';
|
||||
$textNotice[] = JText::_('COM_COMPONENTBUILDER_THAT_MEANS_ANYONE_WHO_HAS_THIS_PACKAGE_CAN_INSTALL_IT_INTO_JCB_TO_ADD_AN_EXPORT_KEY_SIMPLY_OPEN_THE_COMPONENT_GO_TO_THE_TAB_CALLED_SETTINGS_BOTTOM_RIGHT_THERE_IS_A_FIELD_CALLED_EXPORT_KEY');
|
||||
$backupNotice[] = JText::_('COM_COMPONENTBUILDER_NO_KEYS_WERE_FOUND_TO_ADD_AN_EXPORT_KEY_SIMPLY_OPEN_THE_COMPONENT_GO_TO_THE_TAB_CALLED_SETTINGS_BOTTOM_RIGHT_THERE_IS_A_FIELD_CALLED_EXPORT_KEY');
|
||||
}
|
||||
// get email
|
||||
if ($email = $this->params->get('backup_email', null))
|
||||
{
|
||||
// plain text
|
||||
$plainText = implode("\n", $textNotice);
|
||||
// set hash to track changes
|
||||
$hashTracker = md5($plainText);
|
||||
if (ComponentbuilderHelper::newHash($hashTracker))
|
||||
{
|
||||
// Build final massage.
|
||||
$message = $keyNotice . $ownerDetails . '<br /><small>HASH: ' . $hashTracker . '</small>';
|
||||
// set the subject
|
||||
$subject = JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDER_BACKUP_KEY');
|
||||
// email the message
|
||||
componentbuilderEmail::send($email, $subject, componentbuilderEmail::setHtmlEmailBody($message, $subject), $plainText, 1);
|
||||
$backupNotice[] = JText::_('COM_COMPONENTBUILDER_EMAIL_WITH_THE_NEW_KEY_WAS_SEND');
|
||||
}
|
||||
else
|
||||
{
|
||||
$backupNotice[] = JText::_('COM_COMPONENTBUILDER_KEY_HAS_NOT_CHANGED');
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$backupNotice[] = JText::_('COM_COMPONENTBUILDER_BACKUP_FAILED_PLEASE_TRY_AGAIN_IF_THE_ERROR_CONTINUE_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR');
|
||||
$backupNoticeStatus = 'Error';
|
||||
if (componentbuilderHelper::checkString($model->packagePath))
|
||||
{
|
||||
// clear all if not successful
|
||||
ComponentbuilderHelper::removeFolder($model->packagePath);
|
||||
}
|
||||
if (componentbuilderHelper::checkString($model->zipPath))
|
||||
{
|
||||
// clear all if not successful
|
||||
JFile::delete($model->zipPath);
|
||||
}
|
||||
}
|
||||
// quite only if auto backup (adding this script from custom code :)
|
||||
if ('backup' === 'manualBackup')
|
||||
{
|
||||
echo "# " . $backupNoticeStatus . "\n" .implode("\n", $backupNotice);
|
||||
jexit();
|
||||
}
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), implode("<br />", $backupNotice), $backupNoticeStatus);
|
||||
return;
|
||||
}
|
||||
|
||||
protected function getApiUser()
|
||||
{
|
||||
// admin area does not have API user, only front-end (so we fallback on login user)
|
||||
return JFactory::getUser();
|
||||
}
|
||||
}
|
||||
|
@ -92,6 +92,7 @@ class Interpretation extends Fields
|
||||
{
|
||||
// set email helper in place with component name
|
||||
$component = $this->fileContentStatic['###component###'];
|
||||
$Component = $this->fileContentStatic['###Component###'];
|
||||
$target = array('admin' => 'emailer');
|
||||
$done = $this->buildDynamique($target,'emailer',$component);
|
||||
if ($done)
|
||||
@ -99,7 +100,7 @@ class Interpretation extends Fields
|
||||
// the text for the file ###BAKING###
|
||||
$this->fileContentDynamic['emailer_'.$component]['###BAKING###'] = ''; // <<-- to insure it gets updated
|
||||
// return the code need to load the abstract class
|
||||
return PHP_EOL."JLoader::register('".$component."Email', JPATH_COMPONENT_ADMINISTRATOR . '/helpers/".$component."email.php'); ";
|
||||
return PHP_EOL."JLoader::register('".$Component."Email', JPATH_COMPONENT_ADMINISTRATOR . '/helpers/".$component."email.php'); ";
|
||||
}
|
||||
}
|
||||
return '';
|
||||
@ -3946,7 +3947,7 @@ class Interpretation extends Fields
|
||||
if (ComponentbuilderHelper::checkString($script))
|
||||
{
|
||||
$script .= PHP_EOL."\t\t\t".'echo \'<a target="_blank" href="'.$this->fileContentStatic['###AUTHORWEBSITE###'].'" title="'.$this->fileContentStatic['###Component_name###'].'">';
|
||||
$script .= PHP_EOL."\t\t\t\t".'<img src="components/com_'.$component.'/assets/images/component-300.'.$this->componentImageType.'"/>';
|
||||
$script .= PHP_EOL."\t\t\t\t".'<img src="components/com_'.$component.'/assets/images/vdm-component.'.$this->componentImageType.'"/>';
|
||||
$script .= PHP_EOL."\t\t\t\t".'</a>\';';
|
||||
|
||||
return $script;
|
||||
@ -3963,7 +3964,7 @@ class Interpretation extends Fields
|
||||
if (isset($this->componentData->admin_views) && ComponentbuilderHelper::checkArray($this->componentData->admin_views))
|
||||
{
|
||||
$script .= PHP_EOL."\t\t\t".'echo \'<a target="_blank" href="'.$this->fileContentStatic['###AUTHORWEBSITE###'].'" title="'.$this->fileContentStatic['###Component_name###'].'">';
|
||||
$script .= PHP_EOL."\t\t\t\t".'<img src="components/com_'.$this->fileContentStatic['###component###'].'/assets/images/component-300.'.$this->componentImageType.'"/>';
|
||||
$script .= PHP_EOL."\t\t\t\t".'<img src="components/com_'.$this->fileContentStatic['###component###'].'/assets/images/vdm-component.'.$this->componentImageType.'"/>';
|
||||
$script .= PHP_EOL."\t\t\t\t".'</a>';
|
||||
$script .= PHP_EOL."\t\t\t\t<h3>Upgrade to Version ".$this->fileContentStatic['###VERSION###']." Was Successful! Let us know if anything is not working as expected.</h3>';";
|
||||
}
|
||||
@ -11232,7 +11233,7 @@ class Interpretation extends Fields
|
||||
{
|
||||
$imagePath = $this->componentPath.'/admin/assets/images';
|
||||
// move the image to its place
|
||||
JFile::copy(JPATH_SITE.'/'.$path, $imagePath.'/component-300.'.$type,'',true);
|
||||
JFile::copy(JPATH_SITE.'/'.$path, $imagePath.'/vdm-component.'.$type,'',true);
|
||||
// now set the type to global for re-use
|
||||
$this->componentImageType = $type;
|
||||
// return image type
|
||||
|
@ -1061,6 +1061,11 @@ class Infusion extends Interpretation
|
||||
// setup the templates
|
||||
$this->setCustomViewTemplateBody($view);
|
||||
}
|
||||
// if no default site view was set, the redirect to root
|
||||
if (!isset($this->fileContentStatic['###SITE_DEFAULT_VIEW###']))
|
||||
{
|
||||
$this->fileContentStatic['###SITE_DEFAULT_VIEW###'] = '';
|
||||
}
|
||||
// set site custom script to helper class
|
||||
// ###SITE_CUSTOM_HELPER_SCRIPT###
|
||||
$this->fileContentStatic['###SITE_CUSTOM_HELPER_SCRIPT###']
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.4.10
|
||||
@build 12th August, 2017
|
||||
@build 19th August, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage componentbuilder.php
|
||||
@ -39,8 +39,29 @@ abstract class ComponentbuilderHelper
|
||||
{
|
||||
// the Session keeps track of all data related to the current session of this user
|
||||
self::loadSession();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* get all component IDs
|
||||
*/
|
||||
public static function getComponentIDs()
|
||||
{
|
||||
// Get a db connection.
|
||||
$db = JFactory::getDbo();
|
||||
// Create a new query object.
|
||||
$query = $db->getQuery(true);
|
||||
$query->select($db->quoteName(array('id')));
|
||||
$query->from($db->quoteName('#__componentbuilder_joomla_component'));
|
||||
$query->where($db->quoteName('published') . ' >= 1'); // do not backup trash
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
if ($db->getNumRows())
|
||||
{
|
||||
return $db->loadColumn();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* Autoloader
|
||||
*/
|
||||
@ -77,8 +98,43 @@ abstract class ComponentbuilderHelper
|
||||
// load this for all
|
||||
jimport('joomla.application');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Remove folders with files
|
||||
*
|
||||
* @param string $dir The path to folder to remove
|
||||
* @param boolean $git if there is a git folder in that must not be removed
|
||||
*
|
||||
* @return boolean True in all is removed
|
||||
*
|
||||
*/
|
||||
public static function removeFolder($dir, $git = false)
|
||||
{
|
||||
if (JFolder::exists($dir))
|
||||
{
|
||||
$it = new RecursiveDirectoryIterator($dir);
|
||||
$it = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::CHILD_FIRST);
|
||||
foreach ($it as $file)
|
||||
{
|
||||
if ('.' === $file->getBasename() || '..' === $file->getBasename()) continue;
|
||||
if ($file->isDir())
|
||||
{
|
||||
if ($git && strpos($file->getPathname(), $dir.'/.git') !== false) continue;
|
||||
JFolder::delete($file->getPathname());
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($git && strpos($file->getPathname(), $dir.'/.git') !== false) continue;
|
||||
JFile::delete($file->getPathname());
|
||||
}
|
||||
}
|
||||
if (!$git && JFolder::delete($dir))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
} /**
|
||||
* The dynamic builder of views, tables and fields
|
||||
**/
|
||||
public static function dynamicBuilder(&$data, $type)
|
||||