Easy Translation via excel #220

Merged
Llewellyn merged 5 commits from staging into master 2018-01-19 12:09:38 +00:00
48 changed files with 3188 additions and 2562 deletions

View File

@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo
Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.6.11) with **ALL** its features and **ALL** concepts totally open-source and free!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.6.12) with **ALL** its features and **ALL** concepts totally open-source and free!
> Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
@ -126,14 +126,14 @@ Component Builder is mapped as a component in itself on my local development env
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](http://joomlacomponentbuilder.com)
+ *First Build*: 30th April, 2015
+ *Last Build*: 16th January, 2018
+ *Version*: 2.6.11
+ *Last Build*: 19th January, 2018
+ *Version*: 2.6.12
+ *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*: **179847**
+ *Field count*: **1571**
+ *File count*: **1153**
+ *Folder count*: **184**
+ *Line count*: **180465**
+ *Field count*: **1573**
+ *File count*: **1160**
+ *Folder count*: **186**
> This **component** was build with a Joomla [Automated Component Builder](http://joomlacomponentbuilder.com).
> Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)

View File

@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo
Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.6.11) with **ALL** its features and **ALL** concepts totally open-source and free!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.6.12) with **ALL** its features and **ALL** concepts totally open-source and free!
> Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
@ -126,14 +126,14 @@ Component Builder is mapped as a component in itself on my local development env
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](http://joomlacomponentbuilder.com)
+ *First Build*: 30th April, 2015
+ *Last Build*: 16th January, 2018
+ *Version*: 2.6.11
+ *Last Build*: 19th January, 2018
+ *Version*: 2.6.12
+ *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*: **179847**
+ *Field count*: **1571**
+ *File count*: **1153**
+ *Folder count*: **184**
+ *Line count*: **180465**
+ *Field count*: **1573**
+ *File count*: **1160**
+ *Folder count*: **186**
> This **component** was build with a Joomla [Automated Component Builder](http://joomlacomponentbuilder.com).
> Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)

View File

@ -261,8 +261,6 @@
<action name="joomla_component.edit.own" title="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EDIT_OWN" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EDIT_OWN_DESC" />
<action name="joomla_component.edit.state" title="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EDIT_STATE" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EDIT_STATE_DESC" />
<action name="joomla_component.version" title="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EDIT_VERSION" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EDIT_VERSION_DESC" />
<action name="joomla_component.export" title="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EXPORT" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EXPORT_DESC" />
<action name="joomla_component.import" title="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_IMPORT" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_IMPORT_DESC" />
<action name="joomla_component.submenu" title="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_SUBMENU" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_SUBMENU_DESC" />
<action name="language_translation.access" title="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_ACCESS" description="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_ACCESS_DESC" />
<action name="language_translation.batch" title="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_BATCH_USE" description="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_BATCH_USE_DESC" />

View File

@ -0,0 +1,67 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.6.x
@created 30th April, 2015
@package Component Builder
@subpackage import_language_translations.php
@author Llewellyn van der Merwe <http://joomlacomponentbuilder.com>
@github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
/**
* Componentbuilder Import_language_translations Controller
*/
class ComponentbuilderControllerImport_language_translations extends JControllerLegacy
{
/**
* Import an spreadsheet.
*
* @return void
*/
public function import()
{
// Check for request forgeries
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
$model = $this->getModel('Import_language_translations');
if ($model->import())
{
$cache = JFactory::getCache('mod_menu');
$cache->clean();
// TODO: Reset the users acl here as well to kill off any missing bits
}
$app = JFactory::getApplication();
$redirect_url = $app->getUserState('com_componentbuilder.redirect_url');
if (empty($redirect_url))
{
$redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=import_language_translations', false);
}
else
{
// wipe out the user state when we're going to redirect
$app->setUserState('com_componentbuilder.redirect_url', '');
$app->setUserState('com_componentbuilder.message', '');
$app->setUserState('com_componentbuilder.extension_message', '');
}
$this->setRedirect($redirect_url);
}
}

View File

@ -99,7 +99,7 @@ class ComponentbuilderControllerLanguage_translations extends JControllerAdmin
$session->set('dataType_VDM_IMPORTINTO', 'language_translation');
// Redirect to import view.
$message = JText::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_LANGUAGE_TRANSLATIONS');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import', false), $message);
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import_language_translations', false), $message);
return;
}
}

View File

@ -65,7 +65,7 @@ class Compiler extends Infusion
{
// to check the compiler speed
$this->time_start = microtime(true);
// first we run the perent constructor
// first we run the perent constructors
if (parent::__construct($config))
{
// set temp directory

View File

@ -1534,7 +1534,7 @@ class Get
// set custom import scripts
if (isset($view->add_custom_import) && $view->add_custom_import == 1)
{
$addImportArray = array('php_import_ext', 'php_import_display', 'php_import', 'php_import_setdata', 'php_import_save', 'html_import_view');
$addImportArray = array('php_import_ext', 'php_import_display', 'php_import', 'php_import_setdata', 'php_import_save', 'php_import_headers', 'html_import_view');
foreach ($addImportArray as $importScripter)
{
if (isset($view->$importScripter) && strlen($view->$importScripter) > 0)

View File

@ -377,31 +377,17 @@ class Fields extends Structure
*
* @param array $view The view data
* @param string $component The component name
* @param string $viewName The single view name
* @param string $listViewName The list view name
*
* @return string The fields set in xml
*
*/
public function setFieldSet($view, $component)
public function setFieldSet($view, $component, $viewName, $listViewName)
{
// setup the fieldset of this view
if (isset($view['settings']->fields) && ComponentbuilderHelper::checkArray($view['settings']->fields))
{
// setup the list view and single view name
$listViewName = ComponentbuilderHelper::safeString($view['settings']->name_list);
$viewName = ComponentbuilderHelper::safeString($view['settings']->name_single);
// set some place holder for this view
$this->placeholders['###view###'] = $viewName;
$this->placeholders['###VIEW###'] = strtoupper($viewName);
$this->placeholders['###View###'] = ucfirst($viewName);
$this->placeholders['[[[view]]]'] = $this->placeholders['###view###'];
$this->placeholders['[[[VIEW]]]'] = $this->placeholders['###VIEW###'];
$this->placeholders['[[[View]]]'] = $this->placeholders['###View###'];
$this->placeholders['###views###'] = $listViewName;
$this->placeholders['###VIEWS###'] = strtoupper($listViewName);
$this->placeholders['###Views###'] = ucfirst($listViewName);
$this->placeholders['[[[views]]]'] = $this->placeholders['###views###'];
$this->placeholders['[[[VIEWS]]]'] = $this->placeholders['###VIEWS###'];
$this->placeholders['[[[Views]]]'] = $this->placeholders['###Views###'];
// add metadata to the view
if (isset($view['metadata']) && $view['metadata'])
{
@ -753,8 +739,6 @@ class Fields extends Structure
// count the static field created
$this->fieldCount++;
}
// just to be safe, lets clear the view placeholders
$this->clearFromPlaceHolders('view');
// return the set
return $this->xmlPrettyPrint($XML, 'fieldset');
}

View File

@ -3339,8 +3339,7 @@ class Interpretation extends Fields
$path = '/administrator/components/com_' . $this->fileContentStatic['###component###'] . '/assets/js/' . $view['settings']->code . '.js';
}
// add script to file
$this->fileContentDynamic[$view['settings']->code]['###' . $TARGET . '_JAVASCRIPT_FILE###']
= $this->setPlaceholders($view['settings']->javascript_file, $this->placeholders);
$this->fileContentDynamic[$view['settings']->code]['###' . $TARGET . '_JAVASCRIPT_FILE###'] = $this->setPlaceholders($view['settings']->javascript_file, $this->placeholders);
// add script to view
return PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Add View JavaScript File" . PHP_EOL . "\t\t" . $this->setIncludeLibScript($path);
}
@ -8104,32 +8103,10 @@ class Interpretation extends Fields
$query .= PHP_EOL . "\t\treturn false;";
$query .= PHP_EOL . "\t}";
$query .= PHP_EOL . PHP_EOL . "\t/**";
$query .= PHP_EOL . "\t* Method to get header.";
$query .= PHP_EOL . "\t*";
$query .= PHP_EOL . "\t* @return mixed An array of data items on success, false on failure.";
$query .= PHP_EOL . "\t*/";
$query .= PHP_EOL . "\tpublic function getExImPortHeaders()";
$query .= PHP_EOL . "\t{";
$query .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get a db connection.";
$query .= PHP_EOL . "\t\t\$db = JFactory::getDbo();";
$query .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " get the columns";
$query .= PHP_EOL . "\t\t\$columns = \$db->getTableColumns(" . '"#__' . $this->fileContentStatic['###component###'] . '_' . $viewName_single . '");';
$query .= PHP_EOL . "\t\tif (" . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$columns))";
$query .= PHP_EOL . "\t\t{";
$query .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " remove the headers you don't import/export.";
$query .= PHP_EOL . "\t\t\tunset(\$columns['asset_id']);";
$query .= PHP_EOL . "\t\t\tunset(\$columns['checked_out']);";
$query .= PHP_EOL . "\t\t\tunset(\$columns['checked_out_time']);";
$query .= PHP_EOL . "\t\t\t\$headers = new stdClass();";
$query .= PHP_EOL . "\t\t\tforeach (\$columns as \$column => \$type)";
$query .= PHP_EOL . "\t\t\t{";
$query .= PHP_EOL . "\t\t\t\t\$headers->{\$column} = \$column;";
$query .= PHP_EOL . "\t\t\t}";
$query .= PHP_EOL . "\t\t\treturn \$headers;";
$query .= PHP_EOL . "\t\t}";
$query .= PHP_EOL . "\t\treturn false;";
$query .= PHP_EOL . "\t}";
// add getExImPortHeaders
$query .= $this->getCustomScriptBuilder('php_import_headers', 'import_' . $viewName_list, PHP_EOL . PHP_EOL, null, true,
// set a default script for those with no custom script
PHP_EOL . PHP_EOL . $this->setPlaceholders(ComponentbuilderHelper::getImportScripts('headers'), $this->placeholders));
}
return $query;
}

View File

@ -236,14 +236,25 @@ class Infusion extends Interpretation
// start dynamic build
foreach ($this->componentData->admin_views as $view)
{
// just to be safe, lets clear the view placeholders
$this->clearFromPlaceHolders('view');
// set the target
$this->target = 'admin';
$this->lang = 'admin';
// set main keys
// set single view
if (isset($view['settings']->name_single))
{
$viewName_single = ComponentbuilderHelper::safeString($view['settings']->name_single);
}
// set list view
if (isset($view['settings']->name_list))
{
$viewName_list = ComponentbuilderHelper::safeString($view['settings']->name_list);
}
// set the view placeholders
$this->setViewPlaceholders($view['settings']);
// set site edit view array
if (isset($view['edit_create_site_view']) && $view['edit_create_site_view'])
{
@ -258,36 +269,14 @@ class Infusion extends Interpretation
// set view array
$viewarray[] = "\t\t\t\t'" . $viewName_single . "' => '" . $viewName_list . "'";
// set the view names
if ($view['settings']->name_single != 'null')
if (isset($view['settings']->name_single) && $view['settings']->name_single != 'null')
{
// ###VIEW### <<<DYNAMIC>>>
$viewName_u = ComponentbuilderHelper::safeString($view['settings']->name_single, 'U');
$this->fileContentDynamic[$viewName_single]['###VIEW###'] = $viewName_u;
$this->fileContentDynamic[$viewName_list]['###VIEW###'] = $viewName_u;
// ###View### <<<DYNAMIC>>>
$viewName_f = ComponentbuilderHelper::safeString($view['settings']->name_single, 'F');
$this->fileContentDynamic[$viewName_single]['###View###'] = $viewName_f;
$this->fileContentDynamic[$viewName_list]['###View###'] = $viewName_f;
// ###view### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_single]['###view###'] = $viewName_single;
$this->fileContentDynamic[$viewName_list]['###view###'] = $viewName_single;
// set some place holder for the views
$this->placeholders['###view###'] = $viewName_single;
$this->placeholders['###View###'] = $viewName_f;
$this->placeholders['###VIEW###'] = $viewName_u;
$this->placeholders['[[[view]]]'] = $viewName_single;
$this->placeholders['[[[View]]]'] = $viewName_f;
$this->placeholders['[[[VIEW]]]'] = $viewName_u;
// set license per view if needed
$this->setLockLicensePer($viewName_single, $this->target);
$this->setLockLicensePer($viewName_list, $this->target);
// ###FIELDSETS### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_single]['###FIELDSETS###'] = $this->setFieldSet($view, $this->fileContentStatic['###component###']);
$this->fileContentDynamic[$viewName_single]['###FIELDSETS###'] = $this->setFieldSet($view, $this->fileContentStatic['###component###'], $viewName_single, $viewName_list);
// ###ACCESSCONTROL### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_single]['###ACCESSCONTROL###'] = $this->setFieldSetAccessControl($viewName_single);
@ -391,35 +380,15 @@ class Infusion extends Interpretation
}
}
// set the views names
if ($view['settings']->name_list != 'null')
if (isset($view['settings']->name_list) && $view['settings']->name_list != 'null')
{
$this->lang = 'admin';
// ###VIEWS### <<<DYNAMIC>>>
$viewsName_u = ComponentbuilderHelper::safeString($view['settings']->name_list, 'U');
$this->fileContentDynamic[$viewName_list]['###VIEWS###'] = $viewsName_u;
$this->fileContentDynamic[$viewName_single]['###VIEWS###'] = $viewsName_u;
// ###Views### <<<DYNAMIC>>>
$viewsName_f = ComponentbuilderHelper::safeString($view['settings']->name_list, 'F');
$this->fileContentDynamic[$viewName_list]['###Views###'] = $viewsName_f;
$this->fileContentDynamic[$viewName_single]['###Views###'] = $viewsName_f;
// ###views### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_list]['###views###'] = $viewName_list;
$this->fileContentDynamic[$viewName_single]['###views###'] = $viewName_list;
// ###ICOMOON### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_list]['###ICOMOON###'] = $view['icomoon'];
// set some place holder for the views
$this->placeholders['###views###'] = $viewName_list;
$this->placeholders['###Views###'] = $viewsName_f;
$this->placeholders['###VIEWS###'] = $viewsName_u;
$this->placeholders['[[[views]]]'] = $viewName_list;
$this->placeholders['[[[Views]]]'] = $viewsName_f;
$this->placeholders['[[[VIEWS]]]'] = $viewsName_u;
// set the export/import option
if (isset($view['port']) && $view['port'])
if (isset($view['port']) && $view['port'] || 1 == $view['settings']->add_custom_import)
{
$this->eximportView[$viewName_list] = true;
if (1 == $view['settings']->add_custom_import)
@ -1083,6 +1052,82 @@ class Infusion extends Interpretation
return false;
}
/**
* Set the view place holders to global scope
*
* @param object $view The view settings
*
* @ return void
*/
protected function setViewPlaceholders(&$view)
{
// just to be safe, lets clear previous view placeholders
$this->clearFromPlaceHolders('view');
// ###VIEW### <<<DYNAMIC>>>
if (isset($view->name_single))
{
// set main keys
$viewName_single = ComponentbuilderHelper::safeString($view->name_single);
$viewName_u = ComponentbuilderHelper::safeString($view->name_single, 'U');
$viewName_f = ComponentbuilderHelper::safeString($view->name_single, 'F');
// set some place holder for the views
$this->placeholders['###view###'] = $viewName_single;
$this->placeholders['###View###'] = $viewName_f;
$this->placeholders['###VIEW###'] = $viewName_u;
$this->placeholders['[[[view]]]'] = $viewName_single;
$this->placeholders['[[[View]]]'] = $viewName_f;
$this->placeholders['[[[VIEW]]]'] = $viewName_u;
}
// ###VIEWS### <<<DYNAMIC>>>
if (isset($view->name_list))
{
$viewName_list = ComponentbuilderHelper::safeString($view->name_list);
$viewsName_u = ComponentbuilderHelper::safeString($view->name_list, 'U');
$viewsName_f = ComponentbuilderHelper::safeString($view->name_list, 'F');
// set some place holder for the views
$this->placeholders['###views###'] = $viewName_list;
$this->placeholders['###Views###'] = $viewsName_f;
$this->placeholders['###VIEWS###'] = $viewsName_u;
$this->placeholders['[[[views]]]'] = $viewName_list;
$this->placeholders['[[[Views]]]'] = $viewsName_f;
$this->placeholders['[[[VIEWS]]]'] = $viewsName_u;
}
// ###view### <<<DYNAMIC>>>
if (isset($viewName_single))
{
$this->fileContentDynamic[$viewName_single]['###view###'] = $viewName_single;
$this->fileContentDynamic[$viewName_single]['###VIEW###'] = $viewName_u;
$this->fileContentDynamic[$viewName_single]['###View###'] = $viewName_f;
if (isset($viewName_list))
{
$this->fileContentDynamic[$viewName_list]['###view###'] = $viewName_single;
$this->fileContentDynamic[$viewName_list]['###VIEW###'] = $viewName_u;
$this->fileContentDynamic[$viewName_list]['###View###'] = $viewName_f;
}
}
// ###views### <<<DYNAMIC>>>
if (isset($viewName_list))
{
$this->fileContentDynamic[$viewName_list]['###views###'] = $viewName_list;
$this->fileContentDynamic[$viewName_list]['###VIEWS###'] = $viewsName_u;
$this->fileContentDynamic[$viewName_list]['###Views###'] = $viewsName_f;
if (isset($viewName_single))
{
$this->fileContentDynamic[$viewName_single]['###views###'] = $viewName_list;
$this->fileContentDynamic[$viewName_single]['###VIEWS###'] = $viewsName_u;
$this->fileContentDynamic[$viewName_single]['###Views###'] = $viewsName_f;
}
}
}
/**
* Build the lang values and insert to fiel
*

File diff suppressed because it is too large Load Diff

View File

@ -703,6 +703,10 @@ COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_IMPORT_EXT="Php Import Ext"
COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_IMPORT_EXT_DESCRIPTION="Add your PHP here! [Do not add the php tags]"
COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_IMPORT_EXT_HINT="// PHP here for the checkExtension Method"
COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_IMPORT_EXT_LABEL="Check Extension Method PHP"
COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_IMPORT_HEADERS="Php Import Headers"
COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_IMPORT_HEADERS_DESCRIPTION="Add your PHP here! [Do not add the php tags]"
COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_IMPORT_HEADERS_HINT="// PHP here for the getExImPortHeaders Method"
COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_IMPORT_HEADERS_LABEL="get Export Import Headers PHP"
COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_IMPORT_HINT="// PHP Here that should run in the import Method."
COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_IMPORT_LABEL="Import Method PHP"
COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_IMPORT_SAVE="Php Import Save"
@ -4115,10 +4119,6 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EDIT_STATE="Joomla Components Edit State"
COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EDIT_STATE_DESC="Allows the users in this group to update the state of the joomla component"
COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EDIT_VERSION="Joomla Components Edit Version"
COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EDIT_VERSION_DESC="Allows users in this group to edit versions of version joomla components"
COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EXPORT="Joomla Components Export"
COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EXPORT_DESC="Allows the users in this group to export export joomla components"
COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_IMPORT="Joomla Components Import"
COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_IMPORT_DESC="Allows the users in this group to import import joomla components"
COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_N_ITEMS_ARCHIVED="%s Joomla Components archived."
COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_N_ITEMS_ARCHIVED_1="%s Joomla Component archived."
COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_N_ITEMS_CHECKED_IN_0="No Joomla Component successfully checked in."

View File

@ -506,10 +506,6 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EDIT_STATE="Joomla Components Edit State"
COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EDIT_STATE_DESC="Allows the users in this group to update the state of the joomla component"
COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EDIT_VERSION="Joomla Components Edit Version"
COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EDIT_VERSION_DESC="Allows users in this group to edit versions of version joomla components"
COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EXPORT="Joomla Components Export"
COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EXPORT_DESC="Allows the users in this group to export export joomla components"
COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_IMPORT="Joomla Components Import"
COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_IMPORT_DESC="Allows the users in this group to import import joomla components"
COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_SUBMENU="Joomla Components Submenu"
COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_SUBMENU_DESC="Allows the users in this group to update the submenu of the joomla component"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BACKUP_BUTTON_ACCESS="Joomla Component Backup Button Access"

View File

@ -36,6 +36,7 @@ $fields = $displayData->get('fields') ?: array(
'php_import_display',
'html_import_view',
'php_import',
'php_import_headers',
'php_import_setdata',
'php_import_save',
'php_import_ext'

View File

@ -28,7 +28,7 @@
defined('_JEXEC') or die('Restricted access');
// set the defaults
$items = $displayData->waafields;
$items = $displayData->wabfields;
$user = JFactory::getUser();
$id = $displayData->item->id;
$edit = "index.php?option=com_componentbuilder&view=fields&task=field.edit";

View File

@ -28,7 +28,7 @@
defined('_JEXEC') or die('Restricted access');
// set the defaults
$items = $displayData->wablinked_components;
$items = $displayData->waclinked_components;
$user = JFactory::getUser();
$id = $displayData->item->id;
$edit = "index.php?option=com_componentbuilder&view=joomla_components&task=joomla_component.edit";

View File

@ -100,6 +100,14 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->metadata = $registry->toArray();
}
if (!empty($item->addtables))
{
// Convert the addtables field to an array.
$addtables = new Registry;
$addtables->loadString($item->addtables);
$item->addtables = $addtables->toArray();
}
if (!empty($item->addpermissions))
{
// Convert the addpermissions field to an array.
@ -132,14 +140,6 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->custom_button = $custom_button->toArray();
}
if (!empty($item->addtables))
{
// Convert the addtables field to an array.
$addtables = new Registry;
$addtables->loadString($item->addtables);
$item->addtables = $addtables->toArray();
}
if (!empty($item->ajax_input))
{
// Convert the ajax_input field to an array.
@ -148,112 +148,16 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->ajax_input = $ajax_input->toArray();
}
if (!empty($item->php_after_delete))
if (!empty($item->php_import_headers))
{
// base64 Decode php_after_delete.
$item->php_after_delete = base64_decode($item->php_after_delete);
// base64 Decode php_import_headers.
$item->php_import_headers = base64_decode($item->php_import_headers);
}
if (!empty($item->php_save))
if (!empty($item->html_import_view))
{
// base64 Decode php_save.
$item->php_save = base64_decode($item->php_save);
}
if (!empty($item->php_batchmove))
{
// base64 Decode php_batchmove.
$item->php_batchmove = base64_decode($item->php_batchmove);
}
if (!empty($item->php_allowedit))
{
// base64 Decode php_allowedit.
$item->php_allowedit = base64_decode($item->php_allowedit);
}
if (!empty($item->php_after_publish))
{
// base64 Decode php_after_publish.
$item->php_after_publish = base64_decode($item->php_after_publish);
}
if (!empty($item->php_getitems))
{
// base64 Decode php_getitems.
$item->php_getitems = base64_decode($item->php_getitems);
}
if (!empty($item->php_import))
{
// base64 Decode php_import.
$item->php_import = base64_decode($item->php_import);
}
if (!empty($item->php_getlistquery))
{
// base64 Decode php_getlistquery.
$item->php_getlistquery = base64_decode($item->php_getlistquery);
}
if (!empty($item->php_getitem))
{
// base64 Decode php_getitem.
$item->php_getitem = base64_decode($item->php_getitem);
}
if (!empty($item->php_getitems_after_all))
{
// base64 Decode php_getitems_after_all.
$item->php_getitems_after_all = base64_decode($item->php_getitems_after_all);
}
if (!empty($item->php_before_save))
{
// base64 Decode php_before_save.
$item->php_before_save = base64_decode($item->php_before_save);
}
if (!empty($item->php_postsavehook))
{
// base64 Decode php_postsavehook.
$item->php_postsavehook = base64_decode($item->php_postsavehook);
}
if (!empty($item->php_batchcopy))
{
// base64 Decode php_batchcopy.
$item->php_batchcopy = base64_decode($item->php_batchcopy);
}
if (!empty($item->php_before_publish))
{
// base64 Decode php_before_publish.
$item->php_before_publish = base64_decode($item->php_before_publish);
}
if (!empty($item->php_before_delete))
{
// base64 Decode php_before_delete.
$item->php_before_delete = base64_decode($item->php_before_delete);
}
if (!empty($item->php_document))
{
// base64 Decode php_document.
$item->php_document = base64_decode($item->php_document);
}
if (!empty($item->sql))
{
// base64 Decode sql.
$item->sql = base64_decode($item->sql);
}
if (!empty($item->php_import_display))
{
// base64 Decode php_import_display.
$item->php_import_display = base64_decode($item->php_import_display);
// base64 Decode html_import_view.
$item->html_import_view = base64_decode($item->html_import_view);
}
if (!empty($item->php_import_save))
@ -262,48 +166,138 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->php_import_save = base64_decode($item->php_import_save);
}
if (!empty($item->php_getitem))
{
// base64 Decode php_getitem.
$item->php_getitem = base64_decode($item->php_getitem);
}
if (!empty($item->css_view))
{
// base64 Decode css_view.
$item->css_view = base64_decode($item->css_view);
}
if (!empty($item->php_getitems))
{
// base64 Decode php_getitems.
$item->php_getitems = base64_decode($item->php_getitems);
}
if (!empty($item->php_getitems_after_all))
{
// base64 Decode php_getitems_after_all.
$item->php_getitems_after_all = base64_decode($item->php_getitems_after_all);
}
if (!empty($item->css_views))
{
// base64 Decode css_views.
$item->css_views = base64_decode($item->css_views);
}
if (!empty($item->php_getlistquery))
{
// base64 Decode php_getlistquery.
$item->php_getlistquery = base64_decode($item->php_getlistquery);
}
if (!empty($item->php_before_save))
{
// base64 Decode php_before_save.
$item->php_before_save = base64_decode($item->php_before_save);
}
if (!empty($item->javascript_view_file))
{
// base64 Decode javascript_view_file.
$item->javascript_view_file = base64_decode($item->javascript_view_file);
}
if (!empty($item->php_save))
{
// base64 Decode php_save.
$item->php_save = base64_decode($item->php_save);
}
if (!empty($item->php_postsavehook))
{
// base64 Decode php_postsavehook.
$item->php_postsavehook = base64_decode($item->php_postsavehook);
}
if (!empty($item->javascript_view_footer))
{
// base64 Decode javascript_view_footer.
$item->javascript_view_footer = base64_decode($item->javascript_view_footer);
}
if (!empty($item->php_allowedit))
{
// base64 Decode php_allowedit.
$item->php_allowedit = base64_decode($item->php_allowedit);
}
if (!empty($item->php_batchcopy))
{
// base64 Decode php_batchcopy.
$item->php_batchcopy = base64_decode($item->php_batchcopy);
}
if (!empty($item->javascript_views_file))
{
// base64 Decode javascript_views_file.
$item->javascript_views_file = base64_decode($item->javascript_views_file);
}
if (!empty($item->php_batchmove))
{
// base64 Decode php_batchmove.
$item->php_batchmove = base64_decode($item->php_batchmove);
}
if (!empty($item->php_before_publish))
{
// base64 Decode php_before_publish.
$item->php_before_publish = base64_decode($item->php_before_publish);
}
if (!empty($item->javascript_views_footer))
{
// base64 Decode javascript_views_footer.
$item->javascript_views_footer = base64_decode($item->javascript_views_footer);
}
if (!empty($item->php_after_publish))
{
// base64 Decode php_after_publish.
$item->php_after_publish = base64_decode($item->php_after_publish);
}
if (!empty($item->php_before_delete))
{
// base64 Decode php_before_delete.
$item->php_before_delete = base64_decode($item->php_before_delete);
}
if (!empty($item->php_after_delete))
{
// base64 Decode php_after_delete.
$item->php_after_delete = base64_decode($item->php_after_delete);
}
if (!empty($item->php_controller))
{
// base64 Decode php_controller.
$item->php_controller = base64_decode($item->php_controller);
}
if (!empty($item->php_document))
{
// base64 Decode php_document.
$item->php_document = base64_decode($item->php_document);
}
if (!empty($item->php_model))
{
// base64 Decode php_model.
@ -316,22 +310,34 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->php_controller_list = base64_decode($item->php_controller_list);
}
if (!empty($item->sql))
{
// base64 Decode sql.
$item->sql = base64_decode($item->sql);
}
if (!empty($item->php_model_list))
{
// base64 Decode php_model_list.
$item->php_model_list = base64_decode($item->php_model_list);
}
if (!empty($item->php_import_display))
{
// base64 Decode php_import_display.
$item->php_import_display = base64_decode($item->php_import_display);
}
if (!empty($item->php_ajaxmethod))
{
// base64 Decode php_ajaxmethod.
$item->php_ajaxmethod = base64_decode($item->php_ajaxmethod);
}
if (!empty($item->html_import_view))
if (!empty($item->php_import))
{
// base64 Decode html_import_view.
$item->html_import_view = base64_decode($item->html_import_view);
// base64 Decode php_import.
$item->php_import = base64_decode($item->php_import);
}
if (!empty($item->php_import_setdata))
@ -1186,6 +1192,19 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$data['metadata'] = (string) $metadata;
}
// Set the addtables items to data.
if (isset($data['addtables']) && is_array($data['addtables']))
{
$addtables = new JRegistry;
$addtables->loadArray($data['addtables']);
$data['addtables'] = (string) $addtables;
}
elseif (!isset($data['addtables']))
{
// Set the empty addtables to data
$data['addtables'] = '';
}
// Set the addpermissions items to data.
if (isset($data['addpermissions']) && is_array($data['addpermissions']))
{
@ -1238,19 +1257,6 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$data['custom_button'] = '';
}
// Set the addtables items to data.
if (isset($data['addtables']) && is_array($data['addtables']))
{
$addtables = new JRegistry;
$addtables->loadArray($data['addtables']);
$data['addtables'] = (string) $addtables;
}
elseif (!isset($data['addtables']))
{
// Set the empty addtables to data
$data['addtables'] = '';
}
// Set the ajax_input items to data.
if (isset($data['ajax_input']) && is_array($data['ajax_input']))
{
@ -1264,112 +1270,16 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$data['ajax_input'] = '';
}
// Set the php_after_delete string to base64 string.
if (isset($data['php_after_delete']))
// Set the php_import_headers string to base64 string.
if (isset($data['php_import_headers']))
{
$data['php_after_delete'] = base64_encode($data['php_after_delete']);
$data['php_import_headers'] = base64_encode($data['php_import_headers']);
}
// Set the php_save string to base64 string.
if (isset($data['php_save']))
// Set the html_import_view string to base64 string.
if (isset($data['html_import_view']))
{
$data['php_save'] = base64_encode($data['php_save']);
}
// Set the php_batchmove string to base64 string.
if (isset($data['php_batchmove']))
{
$data['php_batchmove'] = base64_encode($data['php_batchmove']);
}
// Set the php_allowedit string to base64 string.
if (isset($data['php_allowedit']))
{
$data['php_allowedit'] = base64_encode($data['php_allowedit']);
}
// Set the php_after_publish string to base64 string.
if (isset($data['php_after_publish']))
{
$data['php_after_publish'] = base64_encode($data['php_after_publish']);
}
// Set the php_getitems string to base64 string.
if (isset($data['php_getitems']))
{
$data['php_getitems'] = base64_encode($data['php_getitems']);
}
// Set the php_import string to base64 string.
if (isset($data['php_import']))
{
$data['php_import'] = base64_encode($data['php_import']);
}
// Set the php_getlistquery string to base64 string.
if (isset($data['php_getlistquery']))
{
$data['php_getlistquery'] = base64_encode($data['php_getlistquery']);
}
// Set the php_getitem string to base64 string.
if (isset($data['php_getitem']))
{
$data['php_getitem'] = base64_encode($data['php_getitem']);
}
// Set the php_getitems_after_all string to base64 string.
if (isset($data['php_getitems_after_all']))
{
$data['php_getitems_after_all'] = base64_encode($data['php_getitems_after_all']);
}
// Set the php_before_save string to base64 string.
if (isset($data['php_before_save']))
{
$data['php_before_save'] = base64_encode($data['php_before_save']);
}
// Set the php_postsavehook string to base64 string.
if (isset($data['php_postsavehook']))
{
$data['php_postsavehook'] = base64_encode($data['php_postsavehook']);
}
// Set the php_batchcopy string to base64 string.
if (isset($data['php_batchcopy']))
{
$data['php_batchcopy'] = base64_encode($data['php_batchcopy']);
}
// Set the php_before_publish string to base64 string.
if (isset($data['php_before_publish']))
{
$data['php_before_publish'] = base64_encode($data['php_before_publish']);
}
// Set the php_before_delete string to base64 string.
if (isset($data['php_before_delete']))
{
$data['php_before_delete'] = base64_encode($data['php_before_delete']);
}
// Set the php_document string to base64 string.
if (isset($data['php_document']))
{
$data['php_document'] = base64_encode($data['php_document']);
}
// Set the sql string to base64 string.
if (isset($data['sql']))
{
$data['sql'] = base64_encode($data['sql']);
}
// Set the php_import_display string to base64 string.
if (isset($data['php_import_display']))
{
$data['php_import_display'] = base64_encode($data['php_import_display']);
$data['html_import_view'] = base64_encode($data['html_import_view']);
}
// Set the php_import_save string to base64 string.
@ -1378,48 +1288,138 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$data['php_import_save'] = base64_encode($data['php_import_save']);
}
// Set the php_getitem string to base64 string.
if (isset($data['php_getitem']))
{
$data['php_getitem'] = base64_encode($data['php_getitem']);
}
// Set the css_view string to base64 string.
if (isset($data['css_view']))
{
$data['css_view'] = base64_encode($data['css_view']);
}
// Set the php_getitems string to base64 string.
if (isset($data['php_getitems']))
{
$data['php_getitems'] = base64_encode($data['php_getitems']);
}
// Set the php_getitems_after_all string to base64 string.
if (isset($data['php_getitems_after_all']))
{
$data['php_getitems_after_all'] = base64_encode($data['php_getitems_after_all']);
}
// Set the css_views string to base64 string.
if (isset($data['css_views']))
{
$data['css_views'] = base64_encode($data['css_views']);
}
// Set the php_getlistquery string to base64 string.
if (isset($data['php_getlistquery']))
{
$data['php_getlistquery'] = base64_encode($data['php_getlistquery']);
}
// Set the php_before_save string to base64 string.
if (isset($data['php_before_save']))
{
$data['php_before_save'] = base64_encode($data['php_before_save']);
}
// Set the javascript_view_file string to base64 string.
if (isset($data['javascript_view_file']))
{
$data['javascript_view_file'] = base64_encode($data['javascript_view_file']);
}
// Set the php_save string to base64 string.
if (isset($data['php_save']))
{
$data['php_save'] = base64_encode($data['php_save']);
}
// Set the php_postsavehook string to base64 string.
if (isset($data['php_postsavehook']))
{
$data['php_postsavehook'] = base64_encode($data['php_postsavehook']);
}
// Set the javascript_view_footer string to base64 string.
if (isset($data['javascript_view_footer']))
{
$data['javascript_view_footer'] = base64_encode($data['javascript_view_footer']);
}
// Set the php_allowedit string to base64 string.
if (isset($data['php_allowedit']))
{
$data['php_allowedit'] = base64_encode($data['php_allowedit']);
}
// Set the php_batchcopy string to base64 string.
if (isset($data['php_batchcopy']))
{
$data['php_batchcopy'] = base64_encode($data['php_batchcopy']);
}
// Set the javascript_views_file string to base64 string.
if (isset($data['javascript_views_file']))
{
$data['javascript_views_file'] = base64_encode($data['javascript_views_file']);
}
// Set the php_batchmove string to base64 string.
if (isset($data['php_batchmove']))
{
$data['php_batchmove'] = base64_encode($data['php_batchmove']);
}
// Set the php_before_publish string to base64 string.
if (isset($data['php_before_publish']))
{
$data['php_before_publish'] = base64_encode($data['php_before_publish']);
}
// Set the javascript_views_footer string to base64 string.
if (isset($data['javascript_views_footer']))
{
$data['javascript_views_footer'] = base64_encode($data['javascript_views_footer']);
}
// Set the php_after_publish string to base64 string.
if (isset($data['php_after_publish']))
{
$data['php_after_publish'] = base64_encode($data['php_after_publish']);
}
// Set the php_before_delete string to base64 string.
if (isset($data['php_before_delete']))
{
$data['php_before_delete'] = base64_encode($data['php_before_delete']);
}
// Set the php_after_delete string to base64 string.
if (isset($data['php_after_delete']))
{
$data['php_after_delete'] = base64_encode($data['php_after_delete']);
}
// Set the php_controller string to base64 string.
if (isset($data['php_controller']))
{
$data['php_controller'] = base64_encode($data['php_controller']);
}
// Set the php_document string to base64 string.
if (isset($data['php_document']))
{
$data['php_document'] = base64_encode($data['php_document']);
}
// Set the php_model string to base64 string.
if (isset($data['php_model']))
{
@ -1432,22 +1432,34 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$data['php_controller_list'] = base64_encode($data['php_controller_list']);
}
// Set the sql string to base64 string.
if (isset($data['sql']))
{
$data['sql'] = base64_encode($data['sql']);
}
// Set the php_model_list string to base64 string.
if (isset($data['php_model_list']))
{
$data['php_model_list'] = base64_encode($data['php_model_list']);
}
// Set the php_import_display string to base64 string.
if (isset($data['php_import_display']))
{
$data['php_import_display'] = base64_encode($data['php_import_display']);
}
// Set the php_ajaxmethod string to base64 string.
if (isset($data['php_ajaxmethod']))
{
$data['php_ajaxmethod'] = base64_encode($data['php_ajaxmethod']);
}
// Set the html_import_view string to base64 string.
if (isset($data['html_import_view']))
// Set the php_import string to base64 string.
if (isset($data['php_import']))
{
$data['html_import_view'] = base64_encode($data['html_import_view']);
$data['php_import'] = base64_encode($data['php_import']);
}
// Set the php_import_setdata string to base64 string.

View File

@ -262,68 +262,70 @@ class ComponentbuilderModelAdmin_views extends JModelList
continue;
}
// decode php_after_delete
$item->php_after_delete = base64_decode($item->php_after_delete);
// decode php_save
$item->php_save = base64_decode($item->php_save);
// decode php_batchmove
$item->php_batchmove = base64_decode($item->php_batchmove);
// decode php_allowedit
$item->php_allowedit = base64_decode($item->php_allowedit);
// decode php_after_publish
$item->php_after_publish = base64_decode($item->php_after_publish);
// decode php_getitems
$item->php_getitems = base64_decode($item->php_getitems);
// decode php_import
$item->php_import = base64_decode($item->php_import);
// decode php_getlistquery
$item->php_getlistquery = base64_decode($item->php_getlistquery);
// decode php_getitem
$item->php_getitem = base64_decode($item->php_getitem);
// decode php_getitems_after_all
$item->php_getitems_after_all = base64_decode($item->php_getitems_after_all);
// decode php_before_save
$item->php_before_save = base64_decode($item->php_before_save);
// decode php_postsavehook
$item->php_postsavehook = base64_decode($item->php_postsavehook);
// decode php_batchcopy
$item->php_batchcopy = base64_decode($item->php_batchcopy);
// decode php_before_publish
$item->php_before_publish = base64_decode($item->php_before_publish);
// decode php_before_delete
$item->php_before_delete = base64_decode($item->php_before_delete);
// decode php_document
$item->php_document = base64_decode($item->php_document);
// decode sql
$item->sql = base64_decode($item->sql);
// decode php_import_display
$item->php_import_display = base64_decode($item->php_import_display);
// decode php_import_headers
$item->php_import_headers = base64_decode($item->php_import_headers);
// decode html_import_view
$item->html_import_view = base64_decode($item->html_import_view);
// decode php_import_save
$item->php_import_save = base64_decode($item->php_import_save);
// decode php_getitem
$item->php_getitem = base64_decode($item->php_getitem);
// decode css_view
$item->css_view = base64_decode($item->css_view);
// decode php_getitems
$item->php_getitems = base64_decode($item->php_getitems);
// decode php_getitems_after_all
$item->php_getitems_after_all = base64_decode($item->php_getitems_after_all);
// decode css_views
$item->css_views = base64_decode($item->css_views);
// decode php_getlistquery
$item->php_getlistquery = base64_decode($item->php_getlistquery);
// decode php_before_save
$item->php_before_save = base64_decode($item->php_before_save);
// decode javascript_view_file
$item->javascript_view_file = base64_decode($item->javascript_view_file);
// decode php_save
$item->php_save = base64_decode($item->php_save);
// decode php_postsavehook
$item->php_postsavehook = base64_decode($item->php_postsavehook);
// decode javascript_view_footer
$item->javascript_view_footer = base64_decode($item->javascript_view_footer);
// decode php_allowedit
$item->php_allowedit = base64_decode($item->php_allowedit);
// decode php_batchcopy
$item->php_batchcopy = base64_decode($item->php_batchcopy);
// decode javascript_views_file
$item->javascript_views_file = base64_decode($item->javascript_views_file);
// decode php_batchmove
$item->php_batchmove = base64_decode($item->php_batchmove);
// decode php_before_publish
$item->php_before_publish = base64_decode($item->php_before_publish);
// decode javascript_views_footer
$item->javascript_views_footer = base64_decode($item->javascript_views_footer);
// decode php_after_publish
$item->php_after_publish = base64_decode($item->php_after_publish);
// decode php_before_delete
$item->php_before_delete = base64_decode($item->php_before_delete);
// decode php_after_delete
$item->php_after_delete = base64_decode($item->php_after_delete);
// decode php_controller
$item->php_controller = base64_decode($item->php_controller);
// decode php_document
$item->php_document = base64_decode($item->php_document);
// decode php_model
$item->php_model = base64_decode($item->php_model);
// decode php_controller_list
$item->php_controller_list = base64_decode($item->php_controller_list);
// decode sql
$item->sql = base64_decode($item->sql);
// decode php_model_list
$item->php_model_list = base64_decode($item->php_model_list);
// decode php_import_display
$item->php_import_display = base64_decode($item->php_import_display);
// decode php_ajaxmethod
$item->php_ajaxmethod = base64_decode($item->php_ajaxmethod);
// decode html_import_view
$item->html_import_view = base64_decode($item->html_import_view);
// decode php_import
$item->php_import = base64_decode($item->php_import);
// decode php_import_setdata
$item->php_import_setdata = base64_decode($item->php_import_setdata);
// decode php_import_ext

View File

@ -139,7 +139,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
*
* @return mixed An array of data items on success, false on failure.
*/
public function getWaafields()
public function getWabfields()
{
// Get the user object.
$user = JFactory::getUser();
@ -223,13 +223,13 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
foreach ($items as $nr => &$item)
{
// convert datatype
$item->datatype = $this->selectionTranslationWaafields($item->datatype, 'datatype');
$item->datatype = $this->selectionTranslationWabfields($item->datatype, 'datatype');
// convert indexes
$item->indexes = $this->selectionTranslationWaafields($item->indexes, 'indexes');
$item->indexes = $this->selectionTranslationWabfields($item->indexes, 'indexes');
// convert null_switch
$item->null_switch = $this->selectionTranslationWaafields($item->null_switch, 'null_switch');
$item->null_switch = $this->selectionTranslationWabfields($item->null_switch, 'null_switch');
// convert store
$item->store = $this->selectionTranslationWaafields($item->store, 'store');
$item->store = $this->selectionTranslationWabfields($item->store, 'store');
}
}
@ -243,7 +243,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
*
* @return translatable string
*/
public function selectionTranslationWaafields($value,$name)
public function selectionTranslationWabfields($value,$name)
{
// Array of datatype language strings
if ($name === 'datatype')

View File

@ -53,10 +53,11 @@ jform_vvvvvxyvxo_required = false;
jform_vvvvvxyvxp_required = false;
jform_vvvvvxyvxq_required = false;
jform_vvvvvxyvxr_required = false;
jform_vvvvvyavxs_required = false;
jform_vvvvvxyvxs_required = false;
jform_vvvvvyavxt_required = false;
jform_vvvvvyavxu_required = false;
jform_vvvvvyavxv_required = false;
jform_vvvvvyavxw_required = false;
// Initial Script
jQuery(document).ready(function()
@ -945,34 +946,44 @@ function vvvvvxy(add_custom_import_vvvvvxy)
jform_vvvvvxyvxo_required = false;
}
jQuery('#jform_php_import').closest('.control-group').show();
jQuery('#jform_php_import_headers').closest('.control-group').show();
if (jform_vvvvvxyvxp_required)
{
updateFieldRequired('php_import_headers',0);
jQuery('#jform_php_import_headers').prop('required','required');
jQuery('#jform_php_import_headers').attr('aria-required',true);
jQuery('#jform_php_import_headers').addClass('required');
jform_vvvvvxyvxp_required = false;
}
jQuery('#jform_php_import').closest('.control-group').show();
if (jform_vvvvvxyvxq_required)
{
updateFieldRequired('php_import',0);
jQuery('#jform_php_import').prop('required','required');
jQuery('#jform_php_import').attr('aria-required',true);
jQuery('#jform_php_import').addClass('required');
jform_vvvvvxyvxp_required = false;
jform_vvvvvxyvxq_required = false;
}
jQuery('#jform_php_import_save').closest('.control-group').show();
if (jform_vvvvvxyvxq_required)
if (jform_vvvvvxyvxr_required)
{
updateFieldRequired('php_import_save',0);
jQuery('#jform_php_import_save').prop('required','required');
jQuery('#jform_php_import_save').attr('aria-required',true);
jQuery('#jform_php_import_save').addClass('required');
jform_vvvvvxyvxq_required = false;
jform_vvvvvxyvxr_required = false;
}
jQuery('#jform_php_import_setdata').closest('.control-group').show();
if (jform_vvvvvxyvxr_required)
if (jform_vvvvvxyvxs_required)
{
updateFieldRequired('php_import_setdata',0);
jQuery('#jform_php_import_setdata').prop('required','required');
jQuery('#jform_php_import_setdata').attr('aria-required',true);
jQuery('#jform_php_import_setdata').addClass('required');
jform_vvvvvxyvxr_required = false;
jform_vvvvvxyvxs_required = false;
}
}
@ -1006,32 +1017,41 @@ function vvvvvxy(add_custom_import_vvvvvxy)
jQuery('#jform_php_import_ext').removeClass('required');
jform_vvvvvxyvxo_required = true;
}
jQuery('#jform_php_import').closest('.control-group').hide();
jQuery('#jform_php_import_headers').closest('.control-group').hide();
if (!jform_vvvvvxyvxp_required)
{
updateFieldRequired('php_import_headers',1);
jQuery('#jform_php_import_headers').removeAttr('required');
jQuery('#jform_php_import_headers').removeAttr('aria-required');
jQuery('#jform_php_import_headers').removeClass('required');
jform_vvvvvxyvxp_required = true;
}
jQuery('#jform_php_import').closest('.control-group').hide();
if (!jform_vvvvvxyvxq_required)
{
updateFieldRequired('php_import',1);
jQuery('#jform_php_import').removeAttr('required');
jQuery('#jform_php_import').removeAttr('aria-required');
jQuery('#jform_php_import').removeClass('required');
jform_vvvvvxyvxp_required = true;
jform_vvvvvxyvxq_required = true;
}
jQuery('#jform_php_import_save').closest('.control-group').hide();
if (!jform_vvvvvxyvxq_required)
if (!jform_vvvvvxyvxr_required)
{
updateFieldRequired('php_import_save',1);
jQuery('#jform_php_import_save').removeAttr('required');
jQuery('#jform_php_import_save').removeAttr('aria-required');
jQuery('#jform_php_import_save').removeClass('required');
jform_vvvvvxyvxq_required = true;
jform_vvvvvxyvxr_required = true;
}
jQuery('#jform_php_import_setdata').closest('.control-group').hide();
if (!jform_vvvvvxyvxr_required)
if (!jform_vvvvvxyvxs_required)
{
updateFieldRequired('php_import_setdata',1);
jQuery('#jform_php_import_setdata').removeAttr('required');
jQuery('#jform_php_import_setdata').removeAttr('aria-required');
jQuery('#jform_php_import_setdata').removeClass('required');
jform_vvvvvxyvxr_required = true;
jform_vvvvvxyvxs_required = true;
}
}
}
@ -1058,43 +1078,43 @@ function vvvvvya(add_custom_button_vvvvvya)
{
jQuery('#jform_custom_button-lbl').closest('.control-group').show();
jQuery('#jform_php_controller').closest('.control-group').show();
if (jform_vvvvvyavxs_required)
if (jform_vvvvvyavxt_required)
{
updateFieldRequired('php_controller',0);
jQuery('#jform_php_controller').prop('required','required');
jQuery('#jform_php_controller').attr('aria-required',true);
jQuery('#jform_php_controller').addClass('required');
jform_vvvvvyavxs_required = false;
jform_vvvvvyavxt_required = false;
}
jQuery('#jform_php_controller_list').closest('.control-group').show();
if (jform_vvvvvyavxt_required)
if (jform_vvvvvyavxu_required)
{
updateFieldRequired('php_controller_list',0);
jQuery('#jform_php_controller_list').prop('required','required');
jQuery('#jform_php_controller_list').attr('aria-required',true);
jQuery('#jform_php_controller_list').addClass('required');
jform_vvvvvyavxt_required = false;
jform_vvvvvyavxu_required = false;
}
jQuery('#jform_php_model').closest('.control-group').show();
if (jform_vvvvvyavxu_required)
if (jform_vvvvvyavxv_required)
{
updateFieldRequired('php_model',0);
jQuery('#jform_php_model').prop('required','required');
jQuery('#jform_php_model').attr('aria-required',true);
jQuery('#jform_php_model').addClass('required');
jform_vvvvvyavxu_required = false;
jform_vvvvvyavxv_required = false;
}
jQuery('#jform_php_model_list').closest('.control-group').show();
if (jform_vvvvvyavxv_required)
if (jform_vvvvvyavxw_required)
{
updateFieldRequired('php_model_list',0);
jQuery('#jform_php_model_list').prop('required','required');
jQuery('#jform_php_model_list').attr('aria-required',true);
jQuery('#jform_php_model_list').addClass('required');
jform_vvvvvyavxv_required = false;
jform_vvvvvyavxw_required = false;
}
}
@ -1102,40 +1122,40 @@ function vvvvvya(add_custom_button_vvvvvya)
{
jQuery('#jform_custom_button-lbl').closest('.control-group').hide();
jQuery('#jform_php_controller').closest('.control-group').hide();
if (!jform_vvvvvyavxs_required)
if (!jform_vvvvvyavxt_required)
{
updateFieldRequired('php_controller',1);
jQuery('#jform_php_controller').removeAttr('required');
jQuery('#jform_php_controller').removeAttr('aria-required');
jQuery('#jform_php_controller').removeClass('required');
jform_vvvvvyavxs_required = true;
jform_vvvvvyavxt_required = true;
}
jQuery('#jform_php_controller_list').closest('.control-group').hide();
if (!jform_vvvvvyavxt_required)
if (!jform_vvvvvyavxu_required)
{
updateFieldRequired('php_controller_list',1);
jQuery('#jform_php_controller_list').removeAttr('required');
jQuery('#jform_php_controller_list').removeAttr('aria-required');
jQuery('#jform_php_controller_list').removeClass('required');
jform_vvvvvyavxt_required = true;
jform_vvvvvyavxu_required = true;
}
jQuery('#jform_php_model').closest('.control-group').hide();
if (!jform_vvvvvyavxu_required)
if (!jform_vvvvvyavxv_required)
{
updateFieldRequired('php_model',1);
jQuery('#jform_php_model').removeAttr('required');
jQuery('#jform_php_model').removeAttr('aria-required');
jQuery('#jform_php_model').removeClass('required');
jform_vvvvvyavxu_required = true;
jform_vvvvvyavxv_required = true;
}
jQuery('#jform_php_model_list').closest('.control-group').hide();
if (!jform_vvvvvyavxv_required)
if (!jform_vvvvvyavxw_required)
{
updateFieldRequired('php_model_list',1);
jQuery('#jform_php_model_list').removeAttr('required');
jQuery('#jform_php_model_list').removeAttr('aria-required');
jQuery('#jform_php_model_list').removeClass('required');
jform_vvvvvyavxv_required = true;
jform_vvvvvyavxw_required = true;
}
}
}
@ -1290,7 +1310,7 @@ function getLinked(){
}
function getTableColumns_server(tableName){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.tableColumns&format=json";
var getUrl = "index.php?option=com_componentbuilder&task=ajax.tableColumns&format=json&vdm="+vastDevMod;
if(token.length > 0 && tableName.length > 0){
var request = 'token='+token+'&table='+tableName;
}
@ -1321,7 +1341,7 @@ function getTableColumns(fieldKey, table_, nr_){
}
function getImportScripts_server(typpe){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getImportScripts&format=json";
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getImportScripts&format=json&vdm="+vastDevMod;
if(token.length > 0 && typpe.length > 0){
var request = 'token='+token+'&type='+typpe;
}
@ -1339,6 +1359,7 @@ function getImportScripts(id){
// get the current values
var current_import_display = jQuery('textarea#jform_php_import_display').val();
var current_import = jQuery('textarea#jform_php_import').val();
var current_headers = jQuery('textarea#jform_php_import_headers').val();
var current_setdata = jQuery('textarea#jform_php_import_setdata').val();
var current_save = jQuery('textarea#jform_php_import_save').val();
var current_view = jQuery('textarea#jform_html_import_view').val();
@ -1359,6 +1380,14 @@ function getImportScripts(id){
}
});
}
// set the headers method script
if(current_headers.length == 0){
getImportScripts_server('headers').done(function(result) {
if(result){
jQuery('textarea#jform_php_import_headers').val(result);
}
});
}
// set the setData method script
if(current_setdata.length == 0){
getImportScripts_server('setdata').done(function(result) {

File diff suppressed because it is too large Load Diff

View File

@ -23,17 +23,17 @@
/-----------------------------------------------------------------------------------------------------------------------------*/
// Some Global Values
jform_vvvvvybvxw_required = false;
jform_vvvvvycvxx_required = false;
jform_vvvvvydvxy_required = false;
jform_vvvvvyevxz_required = false;
jform_vvvvvyfvya_required = false;
jform_vvvvvygvyb_required = false;
jform_vvvvvyhvyc_required = false;
jform_vvvvvyivyd_required = false;
jform_vvvvvybvxx_required = false;
jform_vvvvvycvxy_required = false;
jform_vvvvvydvxz_required = false;
jform_vvvvvyevya_required = false;
jform_vvvvvyfvyb_required = false;
jform_vvvvvygvyc_required = false;
jform_vvvvvyhvyd_required = false;
jform_vvvvvyivye_required = false;
jform_vvvvvyjvyf_required = false;
jform_vvvvvykvyg_required = false;
jform_vvvvvyivyf_required = false;
jform_vvvvvyjvyg_required = false;
jform_vvvvvykvyh_required = false;
// Initial Script
jQuery(document).ready(function()
@ -76,26 +76,26 @@ function vvvvvyb(add_php_view_vvvvvyb)
if (add_php_view_vvvvvyb == 1)
{
jQuery('#jform_php_view').closest('.control-group').show();
if (jform_vvvvvybvxw_required)
if (jform_vvvvvybvxx_required)
{
updateFieldRequired('php_view',0);
jQuery('#jform_php_view').prop('required','required');
jQuery('#jform_php_view').attr('aria-required',true);
jQuery('#jform_php_view').addClass('required');
jform_vvvvvybvxw_required = false;
jform_vvvvvybvxx_required = false;
}
}
else
{
jQuery('#jform_php_view').closest('.control-group').hide();
if (!jform_vvvvvybvxw_required)
if (!jform_vvvvvybvxx_required)
{
updateFieldRequired('php_view',1);
jQuery('#jform_php_view').removeAttr('required');
jQuery('#jform_php_view').removeAttr('aria-required');
jQuery('#jform_php_view').removeClass('required');
jform_vvvvvybvxw_required = true;
jform_vvvvvybvxx_required = true;
}
}
}
@ -107,26 +107,26 @@ function vvvvvyc(add_php_jview_display_vvvvvyc)
if (add_php_jview_display_vvvvvyc == 1)
{
jQuery('#jform_php_jview_display').closest('.control-group').show();
if (jform_vvvvvycvxx_required)
if (jform_vvvvvycvxy_required)
{
updateFieldRequired('php_jview_display',0);
jQuery('#jform_php_jview_display').prop('required','required');
jQuery('#jform_php_jview_display').attr('aria-required',true);
jQuery('#jform_php_jview_display').addClass('required');
jform_vvvvvycvxx_required = false;
jform_vvvvvycvxy_required = false;
}
}
else
{
jQuery('#jform_php_jview_display').closest('.control-group').hide();
if (!jform_vvvvvycvxx_required)
if (!jform_vvvvvycvxy_required)
{
updateFieldRequired('php_jview_display',1);
jQuery('#jform_php_jview_display').removeAttr('required');
jQuery('#jform_php_jview_display').removeAttr('aria-required');
jQuery('#jform_php_jview_display').removeClass('required');
jform_vvvvvycvxx_required = true;
jform_vvvvvycvxy_required = true;
}
}
}
@ -138,26 +138,26 @@ function vvvvvyd(add_php_jview_vvvvvyd)
if (add_php_jview_vvvvvyd == 1)
{
jQuery('#jform_php_jview').closest('.control-group').show();
if (jform_vvvvvydvxy_required)
if (jform_vvvvvydvxz_required)
{
updateFieldRequired('php_jview',0);
jQuery('#jform_php_jview').prop('required','required');
jQuery('#jform_php_jview').attr('aria-required',true);
jQuery('#jform_php_jview').addClass('required');
jform_vvvvvydvxy_required = false;
jform_vvvvvydvxz_required = false;
}
}
else
{
jQuery('#jform_php_jview').closest('.control-group').hide();
if (!jform_vvvvvydvxy_required)
if (!jform_vvvvvydvxz_required)
{
updateFieldRequired('php_jview',1);
jQuery('#jform_php_jview').removeAttr('required');
jQuery('#jform_php_jview').removeAttr('aria-required');
jQuery('#jform_php_jview').removeClass('required');
jform_vvvvvydvxy_required = true;
jform_vvvvvydvxz_required = true;
}
}
}
@ -169,26 +169,26 @@ function vvvvvye(add_php_document_vvvvvye)
if (add_php_document_vvvvvye == 1)
{
jQuery('#jform_php_document').closest('.control-group').show();
if (jform_vvvvvyevxz_required)
if (jform_vvvvvyevya_required)
{
updateFieldRequired('php_document',0);
jQuery('#jform_php_document').prop('required','required');
jQuery('#jform_php_document').attr('aria-required',true);
jQuery('#jform_php_document').addClass('required');
jform_vvvvvyevxz_required = false;
jform_vvvvvyevya_required = false;
}
}
else
{
jQuery('#jform_php_document').closest('.control-group').hide();
if (!jform_vvvvvyevxz_required)
if (!jform_vvvvvyevya_required)
{
updateFieldRequired('php_document',1);
jQuery('#jform_php_document').removeAttr('required');
jQuery('#jform_php_document').removeAttr('aria-required');
jQuery('#jform_php_document').removeClass('required');
jform_vvvvvyevxz_required = true;
jform_vvvvvyevya_required = true;
}
}
}
@ -200,26 +200,26 @@ function vvvvvyf(add_css_document_vvvvvyf)
if (add_css_document_vvvvvyf == 1)
{
jQuery('#jform_css_document').closest('.control-group').show();
if (jform_vvvvvyfvya_required)
if (jform_vvvvvyfvyb_required)
{
updateFieldRequired('css_document',0);
jQuery('#jform_css_document').prop('required','required');
jQuery('#jform_css_document').attr('aria-required',true);
jQuery('#jform_css_document').addClass('required');
jform_vvvvvyfvya_required = false;
jform_vvvvvyfvyb_required = false;
}
}
else
{
jQuery('#jform_css_document').closest('.control-group').hide();
if (!jform_vvvvvyfvya_required)
if (!jform_vvvvvyfvyb_required)
{
updateFieldRequired('css_document',1);
jQuery('#jform_css_document').removeAttr('required');
jQuery('#jform_css_document').removeAttr('aria-required');
jQuery('#jform_css_document').removeClass('required');
jform_vvvvvyfvya_required = true;
jform_vvvvvyfvyb_required = true;
}
}
}
@ -231,26 +231,26 @@ function vvvvvyg(add_javascript_file_vvvvvyg)
if (add_javascript_file_vvvvvyg == 1)
{
jQuery('#jform_javascript_file').closest('.control-group').show();
if (jform_vvvvvygvyb_required)
if (jform_vvvvvygvyc_required)
{
updateFieldRequired('javascript_file',0);
jQuery('#jform_javascript_file').prop('required','required');
jQuery('#jform_javascript_file').attr('aria-required',true);
jQuery('#jform_javascript_file').addClass('required');
jform_vvvvvygvyb_required = false;
jform_vvvvvygvyc_required = false;
}
}
else
{
jQuery('#jform_javascript_file').closest('.control-group').hide();
if (!jform_vvvvvygvyb_required)
if (!jform_vvvvvygvyc_required)
{
updateFieldRequired('javascript_file',1);
jQuery('#jform_javascript_file').removeAttr('required');
jQuery('#jform_javascript_file').removeAttr('aria-required');
jQuery('#jform_javascript_file').removeClass('required');
jform_vvvvvygvyb_required = true;
jform_vvvvvygvyc_required = true;
}
}
}
@ -262,26 +262,26 @@ function vvvvvyh(add_js_document_vvvvvyh)
if (add_js_document_vvvvvyh == 1)
{
jQuery('#jform_js_document').closest('.control-group').show();
if (jform_vvvvvyhvyc_required)
if (jform_vvvvvyhvyd_required)
{
updateFieldRequired('js_document',0);
jQuery('#jform_js_document').prop('required','required');
jQuery('#jform_js_document').attr('aria-required',true);
jQuery('#jform_js_document').addClass('required');
jform_vvvvvyhvyc_required = false;
jform_vvvvvyhvyd_required = false;
}
}
else
{
jQuery('#jform_js_document').closest('.control-group').hide();
if (!jform_vvvvvyhvyc_required)
if (!jform_vvvvvyhvyd_required)
{
updateFieldRequired('js_document',1);
jQuery('#jform_js_document').removeAttr('required');
jQuery('#jform_js_document').removeAttr('aria-required');
jQuery('#jform_js_document').removeClass('required');
jform_vvvvvyhvyc_required = true;
jform_vvvvvyhvyd_required = true;
}
}
}
@ -294,23 +294,23 @@ function vvvvvyi(add_custom_button_vvvvvyi)
{
jQuery('#jform_custom_button-lbl').closest('.control-group').show();
jQuery('#jform_php_controller').closest('.control-group').show();
if (jform_vvvvvyivyd_required)
if (jform_vvvvvyivye_required)
{
updateFieldRequired('php_controller',0);
jQuery('#jform_php_controller').prop('required','required');
jQuery('#jform_php_controller').attr('aria-required',true);
jQuery('#jform_php_controller').addClass('required');
jform_vvvvvyivyd_required = false;
jform_vvvvvyivye_required = false;
}
jQuery('#jform_php_model').closest('.control-group').show();
if (jform_vvvvvyivye_required)
if (jform_vvvvvyivyf_required)
{
updateFieldRequired('php_model',0);
jQuery('#jform_php_model').prop('required','required');
jQuery('#jform_php_model').attr('aria-required',true);
jQuery('#jform_php_model').addClass('required');
jform_vvvvvyivye_required = false;
jform_vvvvvyivyf_required = false;
}
}
@ -318,22 +318,22 @@ function vvvvvyi(add_custom_button_vvvvvyi)
{
jQuery('#jform_custom_button-lbl').closest('.control-group').hide();
jQuery('#jform_php_controller').closest('.control-group').hide();
if (!jform_vvvvvyivyd_required)
if (!jform_vvvvvyivye_required)
{
updateFieldRequired('php_controller',1);
jQuery('#jform_php_controller').removeAttr('required');
jQuery('#jform_php_controller').removeAttr('aria-required');
jQuery('#jform_php_controller').removeClass('required');
jform_vvvvvyivyd_required = true;
jform_vvvvvyivye_required = true;
}
jQuery('#jform_php_model').closest('.control-group').hide();
if (!jform_vvvvvyivye_required)
if (!jform_vvvvvyivyf_required)
{
updateFieldRequired('php_model',1);
jQuery('#jform_php_model').removeAttr('required');
jQuery('#jform_php_model').removeAttr('aria-required');
jQuery('#jform_php_model').removeClass('required');
jform_vvvvvyivye_required = true;
jform_vvvvvyivyf_required = true;
}
}
}
@ -345,26 +345,26 @@ function vvvvvyj(add_css_vvvvvyj)
if (add_css_vvvvvyj == 1)
{
jQuery('#jform_css').closest('.control-group').show();
if (jform_vvvvvyjvyf_required)
if (jform_vvvvvyjvyg_required)
{
updateFieldRequired('css',0);
jQuery('#jform_css').prop('required','required');
jQuery('#jform_css').attr('aria-required',true);
jQuery('#jform_css').addClass('required');
jform_vvvvvyjvyf_required = false;
jform_vvvvvyjvyg_required = false;
}
}
else
{
jQuery('#jform_css').closest('.control-group').hide();
if (!jform_vvvvvyjvyf_required)
if (!jform_vvvvvyjvyg_required)
{
updateFieldRequired('css',1);
jQuery('#jform_css').removeAttr('required');
jQuery('#jform_css').removeAttr('aria-required');
jQuery('#jform_css').removeClass('required');
jform_vvvvvyjvyf_required = true;
jform_vvvvvyjvyg_required = true;
}
}
}
@ -377,13 +377,13 @@ function vvvvvyk(add_php_ajax_vvvvvyk)
{
jQuery('#jform_ajax_input-lbl').closest('.control-group').show();
jQuery('#jform_php_ajaxmethod').closest('.control-group').show();
if (jform_vvvvvykvyg_required)
if (jform_vvvvvykvyh_required)
{
updateFieldRequired('php_ajaxmethod',0);
jQuery('#jform_php_ajaxmethod').prop('required','required');
jQuery('#jform_php_ajaxmethod').attr('aria-required',true);
jQuery('#jform_php_ajaxmethod').addClass('required');
jform_vvvvvykvyg_required = false;
jform_vvvvvykvyh_required = false;
}
}
@ -391,13 +391,13 @@ function vvvvvyk(add_php_ajax_vvvvvyk)
{
jQuery('#jform_ajax_input-lbl').closest('.control-group').hide();
jQuery('#jform_php_ajaxmethod').closest('.control-group').hide();
if (!jform_vvvvvykvyg_required)
if (!jform_vvvvvykvyh_required)
{
updateFieldRequired('php_ajaxmethod',1);
jQuery('#jform_php_ajaxmethod').removeAttr('required');
jQuery('#jform_php_ajaxmethod').removeAttr('aria-required');
jQuery('#jform_php_ajaxmethod').removeClass('required');
jform_vvvvvykvyg_required = true;
jform_vvvvvykvyh_required = true;
}
}
}

View File

@ -23,10 +23,10 @@
/-----------------------------------------------------------------------------------------------------------------------------*/
// Some Global Values
jform_vvvvvzuvzm_required = false;
jform_vvvvvzvvzn_required = false;
jform_vvvvvzuvzn_required = false;
jform_vvvvvzvvzo_required = false;
jform_vvvvvzvvzp_required = false;
jform_vvvvvzvvzq_required = false;
// Initial Script
jQuery(document).ready(function()
@ -53,13 +53,13 @@ function vvvvvzu(target_vvvvvzu)
if (target_vvvvvzu == 2)
{
jQuery('#jform_function_name').closest('.control-group').show();
if (jform_vvvvvzuvzm_required)
if (jform_vvvvvzuvzn_required)
{
updateFieldRequired('function_name',0);
jQuery('#jform_function_name').prop('required','required');
jQuery('#jform_function_name').attr('aria-required',true);
jQuery('#jform_function_name').addClass('required');
jform_vvvvvzuvzm_required = false;
jform_vvvvvzuvzn_required = false;
}
jQuery('.note_jcb_placeholder').closest('.control-group').show();
@ -68,13 +68,13 @@ function vvvvvzu(target_vvvvvzu)
else
{
jQuery('#jform_function_name').closest('.control-group').hide();
if (!jform_vvvvvzuvzm_required)
if (!jform_vvvvvzuvzn_required)
{
updateFieldRequired('function_name',1);
jQuery('#jform_function_name').removeAttr('required');
jQuery('#jform_function_name').removeAttr('aria-required');
jQuery('#jform_function_name').removeClass('required');
jform_vvvvvzuvzm_required = true;
jform_vvvvvzuvzn_required = true;
}
jQuery('.note_jcb_placeholder').closest('.control-group').hide();
jQuery('#jform_system_name').closest('.control-group').hide();
@ -88,70 +88,70 @@ function vvvvvzv(target_vvvvvzv)
if (target_vvvvvzv == 1)
{
jQuery('#jform_component').closest('.control-group').show();
if (jform_vvvvvzvvzn_required)
if (jform_vvvvvzvvzo_required)
{
updateFieldRequired('component',0);
jQuery('#jform_component').prop('required','required');
jQuery('#jform_component').attr('aria-required',true);
jQuery('#jform_component').addClass('required');
jform_vvvvvzvvzn_required = false;
jform_vvvvvzvvzo_required = false;
}
jQuery('#jform_path').closest('.control-group').show();
if (jform_vvvvvzvvzo_required)
if (jform_vvvvvzvvzp_required)
{
updateFieldRequired('path',0);
jQuery('#jform_path').prop('required','required');
jQuery('#jform_path').attr('aria-required',true);
jQuery('#jform_path').addClass('required');
jform_vvvvvzvvzo_required = false;
jform_vvvvvzvvzp_required = false;
}
jQuery('#jform_from_line').closest('.control-group').show();
jQuery('#jform_hashtarget').closest('.control-group').show();
jQuery('#jform_to_line').closest('.control-group').show();
jQuery('#jform_type').closest('.control-group').show();
if (jform_vvvvvzvvzp_required)
if (jform_vvvvvzvvzq_required)
{
updateFieldRequired('type',0);
jQuery('#jform_type').prop('required','required');
jQuery('#jform_type').attr('aria-required',true);
jQuery('#jform_type').addClass('required');
jform_vvvvvzvvzp_required = false;
jform_vvvvvzvvzq_required = false;
}
}
else
{
jQuery('#jform_component').closest('.control-group').hide();
if (!jform_vvvvvzvvzn_required)
if (!jform_vvvvvzvvzo_required)
{
updateFieldRequired('component',1);
jQuery('#jform_component').removeAttr('required');
jQuery('#jform_component').removeAttr('aria-required');
jQuery('#jform_component').removeClass('required');
jform_vvvvvzvvzn_required = true;
jform_vvvvvzvvzo_required = true;
}
jQuery('#jform_path').closest('.control-group').hide();
if (!jform_vvvvvzvvzo_required)
if (!jform_vvvvvzvvzp_required)
{
updateFieldRequired('path',1);
jQuery('#jform_path').removeAttr('required');
jQuery('#jform_path').removeAttr('aria-required');
jQuery('#jform_path').removeClass('required');
jform_vvvvvzvvzo_required = true;
jform_vvvvvzvvzp_required = true;
}
jQuery('#jform_from_line').closest('.control-group').hide();
jQuery('#jform_hashtarget').closest('.control-group').hide();
jQuery('#jform_to_line').closest('.control-group').hide();
jQuery('#jform_type').closest('.control-group').hide();
if (!jform_vvvvvzvvzp_required)
if (!jform_vvvvvzvvzq_required)
{
updateFieldRequired('type',1);
jQuery('#jform_type').removeAttr('required');
jQuery('#jform_type').removeAttr('aria-required');
jQuery('#jform_type').removeClass('required');
jform_vvvvvzvvzp_required = true;
jform_vvvvvzvvzq_required = true;
}
}
}

View File

@ -23,24 +23,24 @@
/-----------------------------------------------------------------------------------------------------------------------------*/
// Some Global Values
jform_vvvvvyyvyu_required = false;
jform_vvvvvyzvyv_required = false;
jform_vvvvvzavyw_required = false;
jform_vvvvvzbvyx_required = false;
jform_vvvvvzcvyy_required = false;
jform_vvvvvzdvyz_required = false;
jform_vvvvvzivza_required = false;
jform_vvvvvzkvzb_required = false;
jform_vvvvvzlvzc_required = false;
jform_vvvvvznvzd_required = false;
jform_vvvvvyyvyv_required = false;
jform_vvvvvyzvyw_required = false;
jform_vvvvvzavyx_required = false;
jform_vvvvvzbvyy_required = false;
jform_vvvvvzcvyz_required = false;
jform_vvvvvzdvza_required = false;
jform_vvvvvzivzb_required = false;
jform_vvvvvzkvzc_required = false;
jform_vvvvvzlvzd_required = false;
jform_vvvvvznvze_required = false;
jform_vvvvvzovzf_required = false;
jform_vvvvvzpvzg_required = false;
jform_vvvvvzqvzh_required = false;
jform_vvvvvzsvzi_required = false;
jform_vvvvvznvzf_required = false;
jform_vvvvvzovzg_required = false;
jform_vvvvvzpvzh_required = false;
jform_vvvvvzqvzi_required = false;
jform_vvvvvzsvzj_required = false;
jform_vvvvvzsvzk_required = false;
jform_vvvvvztvzl_required = false;
jform_vvvvvzsvzl_required = false;
jform_vvvvvztvzm_required = false;
// Initial Script
jQuery(document).ready(function()
@ -127,26 +127,26 @@ function vvvvvyy(gettype_vvvvvyy)
if (gettype)
{
jQuery('#jform_getcustom').closest('.control-group').show();
if (jform_vvvvvyyvyu_required)
if (jform_vvvvvyyvyv_required)
{
updateFieldRequired('getcustom',0);
jQuery('#jform_getcustom').prop('required','required');
jQuery('#jform_getcustom').attr('aria-required',true);
jQuery('#jform_getcustom').addClass('required');
jform_vvvvvyyvyu_required = false;
jform_vvvvvyyvyv_required = false;
}
}
else
{
jQuery('#jform_getcustom').closest('.control-group').hide();
if (!jform_vvvvvyyvyu_required)
if (!jform_vvvvvyyvyv_required)
{
updateFieldRequired('getcustom',1);
jQuery('#jform_getcustom').removeAttr('required');
jQuery('#jform_getcustom').removeAttr('aria-required');
jQuery('#jform_getcustom').removeClass('required');
jform_vvvvvyyvyu_required = true;
jform_vvvvvyyvyv_required = true;
}
}
}
@ -182,26 +182,26 @@ function vvvvvyz(main_source_vvvvvyz)
if (main_source)
{
jQuery('#jform_view_table_main').closest('.control-group').show();
if (jform_vvvvvyzvyv_required)
if (jform_vvvvvyzvyw_required)
{
updateFieldRequired('view_table_main',0);
jQuery('#jform_view_table_main').prop('required','required');
jQuery('#jform_view_table_main').attr('aria-required',true);
jQuery('#jform_view_table_main').addClass('required');
jform_vvvvvyzvyv_required = false;
jform_vvvvvyzvyw_required = false;
}
}
else
{
jQuery('#jform_view_table_main').closest('.control-group').hide();
if (!jform_vvvvvyzvyv_required)
if (!jform_vvvvvyzvyw_required)
{
updateFieldRequired('view_table_main',1);
jQuery('#jform_view_table_main').removeAttr('required');
jQuery('#jform_view_table_main').removeAttr('aria-required');
jQuery('#jform_view_table_main').removeClass('required');
jform_vvvvvyzvyv_required = true;
jform_vvvvvyzvyw_required = true;
}
}
}
@ -237,26 +237,26 @@ function vvvvvza(main_source_vvvvvza)
if (main_source)
{
jQuery('#jform_view_selection').closest('.control-group').show();
if (jform_vvvvvzavyw_required)
if (jform_vvvvvzavyx_required)
{
updateFieldRequired('view_selection',0);
jQuery('#jform_view_selection').prop('required','required');
jQuery('#jform_view_selection').attr('aria-required',true);
jQuery('#jform_view_selection').addClass('required');
jform_vvvvvzavyw_required = false;
jform_vvvvvzavyx_required = false;
}
}
else
{
jQuery('#jform_view_selection').closest('.control-group').hide();
if (!jform_vvvvvzavyw_required)
if (!jform_vvvvvzavyx_required)
{
updateFieldRequired('view_selection',1);
jQuery('#jform_view_selection').removeAttr('required');
jQuery('#jform_view_selection').removeAttr('aria-required');
jQuery('#jform_view_selection').removeClass('required');
jform_vvvvvzavyw_required = true;
jform_vvvvvzavyx_required = true;
}
}
}
@ -292,26 +292,26 @@ function vvvvvzb(main_source_vvvvvzb)
if (main_source)
{
jQuery('#jform_db_table_main').closest('.control-group').show();
if (jform_vvvvvzbvyx_required)
if (jform_vvvvvzbvyy_required)
{
updateFieldRequired('db_table_main',0);
jQuery('#jform_db_table_main').prop('required','required');
jQuery('#jform_db_table_main').attr('aria-required',true);
jQuery('#jform_db_table_main').addClass('required');
jform_vvvvvzbvyx_required = false;
jform_vvvvvzbvyy_required = false;
}
}
else
{
jQuery('#jform_db_table_main').closest('.control-group').hide();
if (!jform_vvvvvzbvyx_required)
if (!jform_vvvvvzbvyy_required)
{
updateFieldRequired('db_table_main',1);
jQuery('#jform_db_table_main').removeAttr('required');
jQuery('#jform_db_table_main').removeAttr('aria-required');
jQuery('#jform_db_table_main').removeClass('required');
jform_vvvvvzbvyx_required = true;
jform_vvvvvzbvyy_required = true;
}
}
}
@ -347,26 +347,26 @@ function vvvvvzc(main_source_vvvvvzc)
if (main_source)
{
jQuery('#jform_db_selection').closest('.control-group').show();
if (jform_vvvvvzcvyy_required)
if (jform_vvvvvzcvyz_required)
{
updateFieldRequired('db_selection',0);
jQuery('#jform_db_selection').prop('required','required');
jQuery('#jform_db_selection').attr('aria-required',true);
jQuery('#jform_db_selection').addClass('required');
jform_vvvvvzcvyy_required = false;
jform_vvvvvzcvyz_required = false;
}
}
else
{
jQuery('#jform_db_selection').closest('.control-group').hide();
if (!jform_vvvvvzcvyy_required)
if (!jform_vvvvvzcvyz_required)
{
updateFieldRequired('db_selection',1);
jQuery('#jform_db_selection').removeAttr('required');
jQuery('#jform_db_selection').removeAttr('aria-required');
jQuery('#jform_db_selection').removeClass('required');
jform_vvvvvzcvyy_required = true;
jform_vvvvvzcvyz_required = true;
}
}
}
@ -389,26 +389,26 @@ function vvvvvzd(addcalculation_vvvvvzd)
if (addcalculation_vvvvvzd == 1)
{
jQuery('#jform_php_calculation').closest('.control-group').show();
if (jform_vvvvvzdvyz_required)
if (jform_vvvvvzdvza_required)
{
updateFieldRequired('php_calculation',0);
jQuery('#jform_php_calculation').prop('required','required');
jQuery('#jform_php_calculation').attr('aria-required',true);
jQuery('#jform_php_calculation').addClass('required');
jform_vvvvvzdvyz_required = false;
jform_vvvvvzdvza_required = false;
}
}
else
{
jQuery('#jform_php_calculation').closest('.control-group').hide();
if (!jform_vvvvvzdvyz_required)
if (!jform_vvvvvzdvza_required)
{
updateFieldRequired('php_calculation',1);
jQuery('#jform_php_calculation').removeAttr('required');
jQuery('#jform_php_calculation').removeAttr('aria-required');
jQuery('#jform_php_calculation').removeClass('required');
jform_vvvvvzdvyz_required = true;
jform_vvvvvzdvza_required = true;
}
}
}
@ -555,26 +555,26 @@ function vvvvvzi(main_source_vvvvvzi)
if (main_source)
{
jQuery('#jform_php_custom_get').closest('.control-group').show();
if (jform_vvvvvzivza_required)
if (jform_vvvvvzivzb_required)
{
updateFieldRequired('php_custom_get',0);
jQuery('#jform_php_custom_get').prop('required','required');
jQuery('#jform_php_custom_get').attr('aria-required',true);
jQuery('#jform_php_custom_get').addClass('required');
jform_vvvvvzivza_required = false;
jform_vvvvvzivzb_required = false;
}
}
else
{
jQuery('#jform_php_custom_get').closest('.control-group').hide();
if (!jform_vvvvvzivza_required)
if (!jform_vvvvvzivzb_required)
{
updateFieldRequired('php_custom_get',1);
jQuery('#jform_php_custom_get').removeAttr('required');
jQuery('#jform_php_custom_get').removeAttr('aria-required');
jQuery('#jform_php_custom_get').removeClass('required');
jform_vvvvvzivza_required = true;
jform_vvvvvzivzb_required = true;
}
}
}
@ -670,26 +670,26 @@ function vvvvvzk(add_php_before_getitem_vvvvvzk,gettype_vvvvvzk)
if (add_php_before_getitem && gettype)
{
jQuery('#jform_php_before_getitem').closest('.control-group').show();
if (jform_vvvvvzkvzb_required)
if (jform_vvvvvzkvzc_required)
{
updateFieldRequired('php_before_getitem',0);
jQuery('#jform_php_before_getitem').prop('required','required');
jQuery('#jform_php_before_getitem').attr('aria-required',true);
jQuery('#jform_php_before_getitem').addClass('required');
jform_vvvvvzkvzb_required = false;
jform_vvvvvzkvzc_required = false;
}
}
else
{
jQuery('#jform_php_before_getitem').closest('.control-group').hide();
if (!jform_vvvvvzkvzb_required)
if (!jform_vvvvvzkvzc_required)
{
updateFieldRequired('php_before_getitem',1);
jQuery('#jform_php_before_getitem').removeAttr('required');
jQuery('#jform_php_before_getitem').removeAttr('aria-required');
jQuery('#jform_php_before_getitem').removeClass('required');
jform_vvvvvzkvzb_required = true;
jform_vvvvvzkvzc_required = true;
}
}
}
@ -748,26 +748,26 @@ function vvvvvzl(add_php_after_getitem_vvvvvzl,gettype_vvvvvzl)
if (add_php_after_getitem && gettype)
{
jQuery('#jform_php_after_getitem').closest('.control-group').show();
if (jform_vvvvvzlvzc_required)
if (jform_vvvvvzlvzd_required)
{
updateFieldRequired('php_after_getitem',0);
jQuery('#jform_php_after_getitem').prop('required','required');
jQuery('#jform_php_after_getitem').attr('aria-required',true);
jQuery('#jform_php_after_getitem').addClass('required');
jform_vvvvvzlvzc_required = false;
jform_vvvvvzlvzd_required = false;
}
}
else
{
jQuery('#jform_php_after_getitem').closest('.control-group').hide();
if (!jform_vvvvvzlvzc_required)
if (!jform_vvvvvzlvzd_required)
{
updateFieldRequired('php_after_getitem',1);
jQuery('#jform_php_after_getitem').removeAttr('required');
jQuery('#jform_php_after_getitem').removeAttr('aria-required');
jQuery('#jform_php_after_getitem').removeClass('required');
jform_vvvvvzlvzc_required = true;
jform_vvvvvzlvzd_required = true;
}
}
}
@ -814,45 +814,45 @@ function vvvvvzn(gettype_vvvvvzn)
if (gettype)
{
jQuery('#jform_add_php_after_getitem').closest('.control-group').show();
if (jform_vvvvvznvzd_required)
if (jform_vvvvvznvze_required)
{
updateFieldRequired('add_php_after_getitem',0);
jQuery('#jform_add_php_after_getitem').prop('required','required');
jQuery('#jform_add_php_after_getitem').attr('aria-required',true);
jQuery('#jform_add_php_after_getitem').addClass('required');
jform_vvvvvznvzd_required = false;
jform_vvvvvznvze_required = false;
}
jQuery('#jform_add_php_before_getitem').closest('.control-group').show();
if (jform_vvvvvznvze_required)
if (jform_vvvvvznvzf_required)
{
updateFieldRequired('add_php_before_getitem',0);
jQuery('#jform_add_php_before_getitem').prop('required','required');
jQuery('#jform_add_php_before_getitem').attr('aria-required',true);
jQuery('#jform_add_php_before_getitem').addClass('required');
jform_vvvvvznvze_required = false;
jform_vvvvvznvzf_required = false;
}
}
else
{
jQuery('#jform_add_php_after_getitem').closest('.control-group').hide();
if (!jform_vvvvvznvzd_required)
if (!jform_vvvvvznvze_required)
{
updateFieldRequired('add_php_after_getitem',1);
jQuery('#jform_add_php_after_getitem').removeAttr('required');
jQuery('#jform_add_php_after_getitem').removeAttr('aria-required');
jQuery('#jform_add_php_after_getitem').removeClass('required');
jform_vvvvvznvzd_required = true;
jform_vvvvvznvze_required = true;
}
jQuery('#jform_add_php_before_getitem').closest('.control-group').hide();
if (!jform_vvvvvznvze_required)
if (!jform_vvvvvznvzf_required)
{
updateFieldRequired('add_php_before_getitem',1);
jQuery('#jform_add_php_before_getitem').removeAttr('required');
jQuery('#jform_add_php_before_getitem').removeAttr('aria-required');
jQuery('#jform_add_php_before_getitem').removeClass('required');
jform_vvvvvznvze_required = true;
jform_vvvvvznvzf_required = true;
}
}
}
@ -900,26 +900,26 @@ function vvvvvzo(add_php_getlistquery_vvvvvzo,gettype_vvvvvzo)
if (add_php_getlistquery && gettype)
{
jQuery('#jform_php_getlistquery').closest('.control-group').show();
if (jform_vvvvvzovzf_required)
if (jform_vvvvvzovzg_required)
{
updateFieldRequired('php_getlistquery',0);
jQuery('#jform_php_getlistquery').prop('required','required');
jQuery('#jform_php_getlistquery').attr('aria-required',true);
jQuery('#jform_php_getlistquery').addClass('required');
jform_vvvvvzovzf_required = false;
jform_vvvvvzovzg_required = false;
}
}
else
{
jQuery('#jform_php_getlistquery').closest('.control-group').hide();
if (!jform_vvvvvzovzf_required)
if (!jform_vvvvvzovzg_required)
{
updateFieldRequired('php_getlistquery',1);
jQuery('#jform_php_getlistquery').removeAttr('required');
jQuery('#jform_php_getlistquery').removeAttr('aria-required');
jQuery('#jform_php_getlistquery').removeClass('required');
jform_vvvvvzovzf_required = true;
jform_vvvvvzovzg_required = true;
}
}
}
@ -978,26 +978,26 @@ function vvvvvzp(add_php_before_getitems_vvvvvzp,gettype_vvvvvzp)
if (add_php_before_getitems && gettype)
{
jQuery('#jform_php_before_getitems').closest('.control-group').show();
if (jform_vvvvvzpvzg_required)
if (jform_vvvvvzpvzh_required)
{
updateFieldRequired('php_before_getitems',0);
jQuery('#jform_php_before_getitems').prop('required','required');
jQuery('#jform_php_before_getitems').attr('aria-required',true);
jQuery('#jform_php_before_getitems').addClass('required');
jform_vvvvvzpvzg_required = false;
jform_vvvvvzpvzh_required = false;
}
}
else
{
jQuery('#jform_php_before_getitems').closest('.control-group').hide();
if (!jform_vvvvvzpvzg_required)
if (!jform_vvvvvzpvzh_required)
{
updateFieldRequired('php_before_getitems',1);
jQuery('#jform_php_before_getitems').removeAttr('required');
jQuery('#jform_php_before_getitems').removeAttr('aria-required');
jQuery('#jform_php_before_getitems').removeClass('required');
jform_vvvvvzpvzg_required = true;
jform_vvvvvzpvzh_required = true;
}
}
}
@ -1056,26 +1056,26 @@ function vvvvvzq(add_php_after_getitems_vvvvvzq,gettype_vvvvvzq)
if (add_php_after_getitems && gettype)
{
jQuery('#jform_php_after_getitems').closest('.control-group').show();
if (jform_vvvvvzqvzh_required)
if (jform_vvvvvzqvzi_required)
{
updateFieldRequired('php_after_getitems',0);
jQuery('#jform_php_after_getitems').prop('required','required');
jQuery('#jform_php_after_getitems').attr('aria-required',true);
jQuery('#jform_php_after_getitems').addClass('required');
jform_vvvvvzqvzh_required = false;
jform_vvvvvzqvzi_required = false;
}
}
else
{
jQuery('#jform_php_after_getitems').closest('.control-group').hide();
if (!jform_vvvvvzqvzh_required)
if (!jform_vvvvvzqvzi_required)
{
updateFieldRequired('php_after_getitems',1);
jQuery('#jform_php_after_getitems').removeAttr('required');
jQuery('#jform_php_after_getitems').removeAttr('aria-required');
jQuery('#jform_php_after_getitems').removeClass('required');
jform_vvvvvzqvzh_required = true;
jform_vvvvvzqvzi_required = true;
}
}
}
@ -1122,64 +1122,64 @@ function vvvvvzs(gettype_vvvvvzs)
if (gettype)
{
jQuery('#jform_add_php_after_getitems').closest('.control-group').show();
if (jform_vvvvvzsvzi_required)
if (jform_vvvvvzsvzj_required)
{
updateFieldRequired('add_php_after_getitems',0);
jQuery('#jform_add_php_after_getitems').prop('required','required');
jQuery('#jform_add_php_after_getitems').attr('aria-required',true);
jQuery('#jform_add_php_after_getitems').addClass('required');
jform_vvvvvzsvzi_required = false;
jform_vvvvvzsvzj_required = false;
}
jQuery('#jform_add_php_before_getitems').closest('.control-group').show();
if (jform_vvvvvzsvzj_required)
if (jform_vvvvvzsvzk_required)
{
updateFieldRequired('add_php_before_getitems',0);
jQuery('#jform_add_php_before_getitems').prop('required','required');
jQuery('#jform_add_php_before_getitems').attr('aria-required',true);
jQuery('#jform_add_php_before_getitems').addClass('required');
jform_vvvvvzsvzj_required = false;
jform_vvvvvzsvzk_required = false;
}
jQuery('#jform_add_php_getlistquery').closest('.control-group').show();
if (jform_vvvvvzsvzk_required)
if (jform_vvvvvzsvzl_required)
{
updateFieldRequired('add_php_getlistquery',0);
jQuery('#jform_add_php_getlistquery').prop('required','required');
jQuery('#jform_add_php_getlistquery').attr('aria-required',true);
jQuery('#jform_add_php_getlistquery').addClass('required');
jform_vvvvvzsvzk_required = false;
jform_vvvvvzsvzl_required = false;
}
}
else
{
jQuery('#jform_add_php_after_getitems').closest('.control-group').hide();
if (!jform_vvvvvzsvzi_required)
if (!jform_vvvvvzsvzj_required)
{
updateFieldRequired('add_php_after_getitems',1);
jQuery('#jform_add_php_after_getitems').removeAttr('required');
jQuery('#jform_add_php_after_getitems').removeAttr('aria-required');
jQuery('#jform_add_php_after_getitems').removeClass('required');
jform_vvvvvzsvzi_required = true;
jform_vvvvvzsvzj_required = true;
}
jQuery('#jform_add_php_before_getitems').closest('.control-group').hide();
if (!jform_vvvvvzsvzj_required)
if (!jform_vvvvvzsvzk_required)
{
updateFieldRequired('add_php_before_getitems',1);
jQuery('#jform_add_php_before_getitems').removeAttr('required');
jQuery('#jform_add_php_before_getitems').removeAttr('aria-required');
jQuery('#jform_add_php_before_getitems').removeClass('required');
jform_vvvvvzsvzj_required = true;
jform_vvvvvzsvzk_required = true;
}
jQuery('#jform_add_php_getlistquery').closest('.control-group').hide();
if (!jform_vvvvvzsvzk_required)
if (!jform_vvvvvzsvzl_required)
{
updateFieldRequired('add_php_getlistquery',1);
jQuery('#jform_add_php_getlistquery').removeAttr('required');
jQuery('#jform_add_php_getlistquery').removeAttr('aria-required');
jQuery('#jform_add_php_getlistquery').removeClass('required');
jform_vvvvvzsvzk_required = true;
jform_vvvvvzsvzl_required = true;
}
}
}
@ -1215,26 +1215,26 @@ function vvvvvzt(gettype_vvvvvzt)
if (gettype)
{
jQuery('#jform_pagination').closest('.control-group').show();
if (jform_vvvvvztvzl_required)
if (jform_vvvvvztvzm_required)
{
updateFieldRequired('pagination',0);
jQuery('#jform_pagination').prop('required','required');
jQuery('#jform_pagination').attr('aria-required',true);
jQuery('#jform_pagination').addClass('required');
jform_vvvvvztvzl_required = false;
jform_vvvvvztvzm_required = false;
}
}
else
{
jQuery('#jform_pagination').closest('.control-group').hide();
if (!jform_vvvvvztvzl_required)
if (!jform_vvvvvztvzm_required)
{
updateFieldRequired('pagination',1);
jQuery('#jform_pagination').removeAttr('required');
jQuery('#jform_pagination').removeAttr('aria-required');
jQuery('#jform_pagination').removeClass('required');
jform_vvvvvztvzl_required = true;
jform_vvvvvztvzm_required = true;
}
}
}

View File

@ -23,14 +23,14 @@
/-----------------------------------------------------------------------------------------------------------------------------*/
// Some Global Values
jform_vvvvwagvzs_required = false;
jform_vvvvwahvzt_required = false;
jform_vvvvwaivzu_required = false;
jform_vvvvwajvzv_required = false;
jform_vvvvwamvzw_required = false;
jform_vvvvwanvzx_required = false;
jform_vvvvwaovzy_required = false;
jform_vvvvwapvzz_required = false;
jform_vvvvwagvzt_required = false;
jform_vvvvwahvzu_required = false;
jform_vvvvwaivzv_required = false;
jform_vvvvwajvzw_required = false;
jform_vvvvwamvzx_required = false;
jform_vvvvwanvzy_required = false;
jform_vvvvwaovzz_required = false;
jform_vvvvwapwaa_required = false;
// Initial Script
jQuery(document).ready(function()
@ -84,26 +84,26 @@ function vvvvwag(datalenght_vvvvwag)
if (datalenght)
{
jQuery('#jform_datalenght_other').closest('.control-group').show();
if (jform_vvvvwagvzs_required)
if (jform_vvvvwagvzt_required)
{
updateFieldRequired('datalenght_other',0);
jQuery('#jform_datalenght_other').prop('required','required');
jQuery('#jform_datalenght_other').attr('aria-required',true);
jQuery('#jform_datalenght_other').addClass('required');
jform_vvvvwagvzs_required = false;
jform_vvvvwagvzt_required = false;
}
}
else
{
jQuery('#jform_datalenght_other').closest('.control-group').hide();
if (!jform_vvvvwagvzs_required)
if (!jform_vvvvwagvzt_required)
{
updateFieldRequired('datalenght_other',1);
jQuery('#jform_datalenght_other').removeAttr('required');
jQuery('#jform_datalenght_other').removeAttr('aria-required');
jQuery('#jform_datalenght_other').removeClass('required');
jform_vvvvwagvzs_required = true;
jform_vvvvwagvzt_required = true;
}
}
}
@ -139,26 +139,26 @@ function vvvvwah(datadefault_vvvvwah)
if (datadefault)
{
jQuery('#jform_datadefault_other').closest('.control-group').show();
if (jform_vvvvwahvzt_required)
if (jform_vvvvwahvzu_required)
{
updateFieldRequired('datadefault_other',0);
jQuery('#jform_datadefault_other').prop('required','required');
jQuery('#jform_datadefault_other').attr('aria-required',true);
jQuery('#jform_datadefault_other').addClass('required');
jform_vvvvwahvzt_required = false;
jform_vvvvwahvzu_required = false;
}
}
else
{
jQuery('#jform_datadefault_other').closest('.control-group').hide();
if (!jform_vvvvwahvzt_required)
if (!jform_vvvvwahvzu_required)
{
updateFieldRequired('datadefault_other',1);
jQuery('#jform_datadefault_other').removeAttr('required');
jQuery('#jform_datadefault_other').removeAttr('aria-required');
jQuery('#jform_datadefault_other').removeClass('required');
jform_vvvvwahvzt_required = true;
jform_vvvvwahvzu_required = true;
}
}
}
@ -196,13 +196,13 @@ function vvvvwai(datatype_vvvvwai)
jQuery('#jform_datadefault').closest('.control-group').show();
jQuery('#jform_datalenght').closest('.control-group').show();
jQuery('#jform_indexes').closest('.control-group').show();
if (jform_vvvvwaivzu_required)
if (jform_vvvvwaivzv_required)
{
updateFieldRequired('indexes',0);
jQuery('#jform_indexes').prop('required','required');
jQuery('#jform_indexes').attr('aria-required',true);
jQuery('#jform_indexes').addClass('required');
jform_vvvvwaivzu_required = false;
jform_vvvvwaivzv_required = false;
}
}
@ -211,13 +211,13 @@ function vvvvwai(datatype_vvvvwai)
jQuery('#jform_datadefault').closest('.control-group').hide();
jQuery('#jform_datalenght').closest('.control-group').hide();
jQuery('#jform_indexes').closest('.control-group').hide();
if (!jform_vvvvwaivzu_required)
if (!jform_vvvvwaivzv_required)
{
updateFieldRequired('indexes',1);
jQuery('#jform_indexes').removeAttr('required');
jQuery('#jform_indexes').removeAttr('aria-required');
jQuery('#jform_indexes').removeClass('required');
jform_vvvvwaivzu_required = true;
jform_vvvvwaivzv_required = true;
}
}
}
@ -253,26 +253,26 @@ function vvvvwaj(datatype_vvvvwaj)
if (datatype)
{
jQuery('#jform_store').closest('.control-group').show();
if (jform_vvvvwajvzv_required)
if (jform_vvvvwajvzw_required)
{
updateFieldRequired('store',0);
jQuery('#jform_store').prop('required','required');
jQuery('#jform_store').attr('aria-required',true);
jQuery('#jform_store').addClass('required');
jform_vvvvwajvzv_required = false;
jform_vvvvwajvzw_required = false;
}
}
else
{
jQuery('#jform_store').closest('.control-group').hide();
if (!jform_vvvvwajvzv_required)
if (!jform_vvvvwajvzw_required)
{
updateFieldRequired('store',1);
jQuery('#jform_store').removeAttr('required');
jQuery('#jform_store').removeAttr('aria-required');
jQuery('#jform_store').removeClass('required');
jform_vvvvwajvzv_required = true;
jform_vvvvwajvzw_required = true;
}
}
}
@ -356,26 +356,26 @@ function vvvvwam(add_css_view_vvvvwam)
if (add_css_view_vvvvwam == 1)
{
jQuery('#jform_css_view').closest('.control-group').show();
if (jform_vvvvwamvzw_required)
if (jform_vvvvwamvzx_required)
{
updateFieldRequired('css_view',0);
jQuery('#jform_css_view').prop('required','required');
jQuery('#jform_css_view').attr('aria-required',true);
jQuery('#jform_css_view').addClass('required');
jform_vvvvwamvzw_required = false;
jform_vvvvwamvzx_required = false;
}
}
else
{
jQuery('#jform_css_view').closest('.control-group').hide();
if (!jform_vvvvwamvzw_required)
if (!jform_vvvvwamvzx_required)
{
updateFieldRequired('css_view',1);
jQuery('#jform_css_view').removeAttr('required');
jQuery('#jform_css_view').removeAttr('aria-required');
jQuery('#jform_css_view').removeClass('required');
jform_vvvvwamvzw_required = true;
jform_vvvvwamvzx_required = true;
}
}
}
@ -387,26 +387,26 @@ function vvvvwan(add_css_views_vvvvwan)
if (add_css_views_vvvvwan == 1)
{
jQuery('#jform_css_views').closest('.control-group').show();
if (jform_vvvvwanvzx_required)
if (jform_vvvvwanvzy_required)
{
updateFieldRequired('css_views',0);
jQuery('#jform_css_views').prop('required','required');
jQuery('#jform_css_views').attr('aria-required',true);
jQuery('#jform_css_views').addClass('required');
jform_vvvvwanvzx_required = false;
jform_vvvvwanvzy_required = false;
}
}
else
{
jQuery('#jform_css_views').closest('.control-group').hide();
if (!jform_vvvvwanvzx_required)
if (!jform_vvvvwanvzy_required)
{
updateFieldRequired('css_views',1);
jQuery('#jform_css_views').removeAttr('required');
jQuery('#jform_css_views').removeAttr('aria-required');
jQuery('#jform_css_views').removeClass('required');
jform_vvvvwanvzx_required = true;
jform_vvvvwanvzy_required = true;
}
}
}
@ -418,26 +418,26 @@ function vvvvwao(add_javascript_view_footer_vvvvwao)
if (add_javascript_view_footer_vvvvwao == 1)
{
jQuery('#jform_javascript_view_footer').closest('.control-group').show();
if (jform_vvvvwaovzy_required)
if (jform_vvvvwaovzz_required)
{
updateFieldRequired('javascript_view_footer',0);
jQuery('#jform_javascript_view_footer').prop('required','required');
jQuery('#jform_javascript_view_footer').attr('aria-required',true);
jQuery('#jform_javascript_view_footer').addClass('required');
jform_vvvvwaovzy_required = false;
jform_vvvvwaovzz_required = false;
}
}
else
{
jQuery('#jform_javascript_view_footer').closest('.control-group').hide();
if (!jform_vvvvwaovzy_required)
if (!jform_vvvvwaovzz_required)
{
updateFieldRequired('javascript_view_footer',1);
jQuery('#jform_javascript_view_footer').removeAttr('required');
jQuery('#jform_javascript_view_footer').removeAttr('aria-required');
jQuery('#jform_javascript_view_footer').removeClass('required');
jform_vvvvwaovzy_required = true;
jform_vvvvwaovzz_required = true;
}
}
}
@ -449,26 +449,26 @@ function vvvvwap(add_javascript_views_footer_vvvvwap)
if (add_javascript_views_footer_vvvvwap == 1)
{
jQuery('#jform_javascript_views_footer').closest('.control-group').show();
if (jform_vvvvwapvzz_required)
if (jform_vvvvwapwaa_required)
{
updateFieldRequired('javascript_views_footer',0);
jQuery('#jform_javascript_views_footer').prop('required','required');
jQuery('#jform_javascript_views_footer').attr('aria-required',true);
jQuery('#jform_javascript_views_footer').addClass('required');
jform_vvvvwapvzz_required = false;
jform_vvvvwapwaa_required = false;
}
}
else
{
jQuery('#jform_javascript_views_footer').closest('.control-group').hide();
if (!jform_vvvvwapvzz_required)
if (!jform_vvvvwapwaa_required)
{
updateFieldRequired('javascript_views_footer',1);
jQuery('#jform_javascript_views_footer').removeAttr('required');
jQuery('#jform_javascript_views_footer').removeAttr('aria-required');
jQuery('#jform_javascript_views_footer').removeClass('required');
jform_vvvvwapvzz_required = true;
jform_vvvvwapwaa_required = true;
}
}
}

View File

@ -23,12 +23,12 @@
/-----------------------------------------------------------------------------------------------------------------------------*/
// Some Global Values
jform_vvvvwaqwac_required = false;
jform_vvvvwarwad_required = false;
jform_vvvvwaswae_required = false;
jform_vvvvwatwaf_required = false;
jform_vvvvwauwag_required = false;
jform_vvvvwavwah_required = false;
jform_vvvvwaqwad_required = false;
jform_vvvvwarwae_required = false;
jform_vvvvwaswaf_required = false;
jform_vvvvwatwag_required = false;
jform_vvvvwauwah_required = false;
jform_vvvvwavwai_required = false;
// Initial Script
jQuery(document).ready(function()
@ -59,26 +59,26 @@ function vvvvwaq(location_vvvvwaq)
if (location_vvvvwaq == 1)
{
jQuery('#jform_admin_view').closest('.control-group').show();
if (jform_vvvvwaqwac_required)
if (jform_vvvvwaqwad_required)
{
updateFieldRequired('admin_view',0);
jQuery('#jform_admin_view').prop('required','required');
jQuery('#jform_admin_view').attr('aria-required',true);
jQuery('#jform_admin_view').addClass('required');
jform_vvvvwaqwac_required = false;
jform_vvvvwaqwad_required = false;
}
}
else
{
jQuery('#jform_admin_view').closest('.control-group').hide();
if (!jform_vvvvwaqwac_required)
if (!jform_vvvvwaqwad_required)
{
updateFieldRequired('admin_view',1);
jQuery('#jform_admin_view').removeAttr('required');
jQuery('#jform_admin_view').removeAttr('aria-required');
jQuery('#jform_admin_view').removeClass('required');
jform_vvvvwaqwac_required = true;
jform_vvvvwaqwad_required = true;
}
}
}
@ -90,26 +90,26 @@ function vvvvwar(location_vvvvwar)
if (location_vvvvwar == 2)
{
jQuery('#jform_site_view').closest('.control-group').show();
if (jform_vvvvwarwad_required)
if (jform_vvvvwarwae_required)
{
updateFieldRequired('site_view',0);
jQuery('#jform_site_view').prop('required','required');
jQuery('#jform_site_view').attr('aria-required',true);
jQuery('#jform_site_view').addClass('required');
jform_vvvvwarwad_required = false;
jform_vvvvwarwae_required = false;
}
}
else
{
jQuery('#jform_site_view').closest('.control-group').hide();
if (!jform_vvvvwarwad_required)
if (!jform_vvvvwarwae_required)
{
updateFieldRequired('site_view',1);
jQuery('#jform_site_view').removeAttr('required');
jQuery('#jform_site_view').removeAttr('aria-required');
jQuery('#jform_site_view').removeClass('required');
jform_vvvvwarwad_required = true;
jform_vvvvwarwae_required = true;
}
}
}
@ -134,26 +134,26 @@ function vvvvwas(type_vvvvwas)
if (type)
{
jQuery('#jform_url').closest('.control-group').show();
if (jform_vvvvwaswae_required)
if (jform_vvvvwaswaf_required)
{
updateFieldRequired('url',0);
jQuery('#jform_url').prop('required','required');
jQuery('#jform_url').attr('aria-required',true);
jQuery('#jform_url').addClass('required');
jform_vvvvwaswae_required = false;
jform_vvvvwaswaf_required = false;
}
}
else
{
jQuery('#jform_url').closest('.control-group').hide();
if (!jform_vvvvwaswae_required)
if (!jform_vvvvwaswaf_required)
{
updateFieldRequired('url',1);
jQuery('#jform_url').removeAttr('required');
jQuery('#jform_url').removeAttr('aria-required');
jQuery('#jform_url').removeClass('required');
jform_vvvvwaswae_required = true;
jform_vvvvwaswaf_required = true;
}
}
}
@ -189,26 +189,26 @@ function vvvvwat(type_vvvvwat)
if (type)
{
jQuery('#jform_article').closest('.control-group').show();
if (jform_vvvvwatwaf_required)
if (jform_vvvvwatwag_required)
{
updateFieldRequired('article',0);
jQuery('#jform_article').prop('required','required');
jQuery('#jform_article').attr('aria-required',true);
jQuery('#jform_article').addClass('required');
jform_vvvvwatwaf_required = false;
jform_vvvvwatwag_required = false;
}
}
else
{
jQuery('#jform_article').closest('.control-group').hide();
if (!jform_vvvvwatwaf_required)
if (!jform_vvvvwatwag_required)
{
updateFieldRequired('article',1);
jQuery('#jform_article').removeAttr('required');
jQuery('#jform_article').removeAttr('aria-required');
jQuery('#jform_article').removeClass('required');
jform_vvvvwatwaf_required = true;
jform_vvvvwatwag_required = true;
}
}
}
@ -244,26 +244,26 @@ function vvvvwau(type_vvvvwau)
if (type)
{
jQuery('#jform_content-lbl').closest('.control-group').show();
if (jform_vvvvwauwag_required)
if (jform_vvvvwauwah_required)
{
updateFieldRequired('content',0);
jQuery('#jform_content').prop('required','required');
jQuery('#jform_content').attr('aria-required',true);
jQuery('#jform_content').addClass('required');
jform_vvvvwauwag_required = false;
jform_vvvvwauwah_required = false;
}
}
else
{
jQuery('#jform_content-lbl').closest('.control-group').hide();
if (!jform_vvvvwauwag_required)
if (!jform_vvvvwauwah_required)
{
updateFieldRequired('content',1);
jQuery('#jform_content').removeAttr('required');
jQuery('#jform_content').removeAttr('aria-required');
jQuery('#jform_content').removeClass('required');
jform_vvvvwauwag_required = true;
jform_vvvvwauwah_required = true;
}
}
}
@ -286,26 +286,26 @@ function vvvvwav(target_vvvvwav)
if (target_vvvvwav == 1)
{
jQuery('#jform_groups').closest('.control-group').show();
if (jform_vvvvwavwah_required)
if (jform_vvvvwavwai_required)
{
updateFieldRequired('groups',0);
jQuery('#jform_groups').prop('required','required');
jQuery('#jform_groups').attr('aria-required',true);
jQuery('#jform_groups').addClass('required');
jform_vvvvwavwah_required = false;
jform_vvvvwavwai_required = false;
}
}
else
{
jQuery('#jform_groups').closest('.control-group').hide();
if (!jform_vvvvwavwah_required)
if (!jform_vvvvwavwai_required)
{
updateFieldRequired('groups',1);
jQuery('#jform_groups').removeAttr('required');
jQuery('#jform_groups').removeAttr('aria-required');
jQuery('#jform_groups').removeClass('required');
jform_vvvvwavwah_required = true;
jform_vvvvwavwai_required = true;
}
}
}

View File

@ -23,7 +23,7 @@
/-----------------------------------------------------------------------------------------------------------------------------*/
// Some Global Values
jform_vvvvvyxvyt_required = false;
jform_vvvvvyxvyu_required = false;
// Initial Script
jQuery(document).ready(function()
@ -39,26 +39,26 @@ function vvvvvyx(add_php_view_vvvvvyx)
if (add_php_view_vvvvvyx == 1)
{
jQuery('#jform_php_view').closest('.control-group').show();
if (jform_vvvvvyxvyt_required)
if (jform_vvvvvyxvyu_required)
{
updateFieldRequired('php_view',0);
jQuery('#jform_php_view').prop('required','required');
jQuery('#jform_php_view').attr('aria-required',true);
jQuery('#jform_php_view').addClass('required');
jform_vvvvvyxvyt_required = false;
jform_vvvvvyxvyu_required = false;
}
}
else
{
jQuery('#jform_php_view').closest('.control-group').hide();
if (!jform_vvvvvyxvyt_required)
if (!jform_vvvvvyxvyu_required)
{
updateFieldRequired('php_view',1);
jQuery('#jform_php_view').removeAttr('required');
jQuery('#jform_php_view').removeAttr('aria-required');
jQuery('#jform_php_view').removeClass('required');
jform_vvvvvyxvyt_required = true;
jform_vvvvvyxvyu_required = true;
}
}
}

View File

@ -23,8 +23,8 @@
/-----------------------------------------------------------------------------------------------------------------------------*/
// Some Global Values
jform_vvvvvzzvzq_required = false;
jform_vvvvwafvzr_required = false;
jform_vvvvvzzvzr_required = false;
jform_vvvvwafvzs_required = false;
// Initial Script
jQuery(document).ready(function()
@ -112,26 +112,26 @@ function vvvvvzz(how_vvvvvzz)
if (how)
{
jQuery('#jform_php_setdocument').closest('.control-group').show();
if (jform_vvvvvzzvzq_required)
if (jform_vvvvvzzvzr_required)
{
updateFieldRequired('php_setdocument',0);
jQuery('#jform_php_setdocument').prop('required','required');
jQuery('#jform_php_setdocument').attr('aria-required',true);
jQuery('#jform_php_setdocument').addClass('required');
jform_vvvvvzzvzq_required = false;
jform_vvvvvzzvzr_required = false;
}
}
else
{
jQuery('#jform_php_setdocument').closest('.control-group').hide();
if (!jform_vvvvvzzvzq_required)
if (!jform_vvvvvzzvzr_required)
{
updateFieldRequired('php_setdocument',1);
jQuery('#jform_php_setdocument').removeAttr('required');
jQuery('#jform_php_setdocument').removeAttr('aria-required');
jQuery('#jform_php_setdocument').removeClass('required');
jform_vvvvvzzvzq_required = true;
jform_vvvvvzzvzr_required = true;
}
}
}
@ -354,26 +354,26 @@ function vvvvwaf(type_vvvvwaf)
if (type_vvvvwaf == 2)
{
jQuery('#jform_libraries').closest('.control-group').show();
if (jform_vvvvwafvzr_required)
if (jform_vvvvwafvzs_required)
{
updateFieldRequired('libraries',0);
jQuery('#jform_libraries').prop('required','required');
jQuery('#jform_libraries').attr('aria-required',true);
jQuery('#jform_libraries').addClass('required');
jform_vvvvwafvzr_required = false;
jform_vvvvwafvzs_required = false;
}
}
else
{
jQuery('#jform_libraries').closest('.control-group').hide();
if (!jform_vvvvwafvzr_required)
if (!jform_vvvvwafvzs_required)
{
updateFieldRequired('libraries',1);
jQuery('#jform_libraries').removeAttr('required');
jQuery('#jform_libraries').removeAttr('aria-required');
jQuery('#jform_libraries').removeClass('required');
jform_vvvvwafvzr_required = true;
jform_vvvvwafvzs_required = true;
}
}
}

View File

@ -23,17 +23,17 @@
/-----------------------------------------------------------------------------------------------------------------------------*/
// Some Global Values
jform_vvvvvylvyh_required = false;
jform_vvvvvymvyi_required = false;
jform_vvvvvynvyj_required = false;
jform_vvvvvyovyk_required = false;
jform_vvvvvypvyl_required = false;
jform_vvvvvyqvym_required = false;
jform_vvvvvyrvyn_required = false;
jform_vvvvvysvyo_required = false;
jform_vvvvvytvyp_required = false;
jform_vvvvvyuvyq_required = false;
jform_vvvvvylvyi_required = false;
jform_vvvvvymvyj_required = false;
jform_vvvvvynvyk_required = false;
jform_vvvvvyovyl_required = false;
jform_vvvvvypvym_required = false;
jform_vvvvvyqvyn_required = false;
jform_vvvvvyrvyo_required = false;
jform_vvvvvysvyp_required = false;
jform_vvvvvytvyq_required = false;
jform_vvvvvyuvyr_required = false;
jform_vvvvvyuvys_required = false;
// Initial Script
jQuery(document).ready(function()
@ -79,26 +79,26 @@ function vvvvvyl(add_php_view_vvvvvyl)
if (add_php_view_vvvvvyl == 1)
{
jQuery('#jform_php_view').closest('.control-group').show();
if (jform_vvvvvylvyh_required)
if (jform_vvvvvylvyi_required)
{
updateFieldRequired('php_view',0);
jQuery('#jform_php_view').prop('required','required');
jQuery('#jform_php_view').attr('aria-required',true);
jQuery('#jform_php_view').addClass('required');
jform_vvvvvylvyh_required = false;
jform_vvvvvylvyi_required = false;
}
}
else
{
jQuery('#jform_php_view').closest('.control-group').hide();
if (!jform_vvvvvylvyh_required)
if (!jform_vvvvvylvyi_required)
{
updateFieldRequired('php_view',1);
jQuery('#jform_php_view').removeAttr('required');
jQuery('#jform_php_view').removeAttr('aria-required');
jQuery('#jform_php_view').removeClass('required');
jform_vvvvvylvyh_required = true;
jform_vvvvvylvyi_required = true;
}
}
}
@ -110,26 +110,26 @@ function vvvvvym(add_php_jview_display_vvvvvym)
if (add_php_jview_display_vvvvvym == 1)
{
jQuery('#jform_php_jview_display').closest('.control-group').show();
if (jform_vvvvvymvyi_required)
if (jform_vvvvvymvyj_required)
{
updateFieldRequired('php_jview_display',0);
jQuery('#jform_php_jview_display').prop('required','required');
jQuery('#jform_php_jview_display').attr('aria-required',true);
jQuery('#jform_php_jview_display').addClass('required');
jform_vvvvvymvyi_required = false;
jform_vvvvvymvyj_required = false;
}
}
else
{
jQuery('#jform_php_jview_display').closest('.control-group').hide();
if (!jform_vvvvvymvyi_required)
if (!jform_vvvvvymvyj_required)
{
updateFieldRequired('php_jview_display',1);
jQuery('#jform_php_jview_display').removeAttr('required');
jQuery('#jform_php_jview_display').removeAttr('aria-required');
jQuery('#jform_php_jview_display').removeClass('required');
jform_vvvvvymvyi_required = true;
jform_vvvvvymvyj_required = true;
}
}
}
@ -141,26 +141,26 @@ function vvvvvyn(add_php_jview_vvvvvyn)
if (add_php_jview_vvvvvyn == 1)
{
jQuery('#jform_php_jview').closest('.control-group').show();
if (jform_vvvvvynvyj_required)
if (jform_vvvvvynvyk_required)
{
updateFieldRequired('php_jview',0);
jQuery('#jform_php_jview').prop('required','required');
jQuery('#jform_php_jview').attr('aria-required',true);
jQuery('#jform_php_jview').addClass('required');
jform_vvvvvynvyj_required = false;
jform_vvvvvynvyk_required = false;
}
}
else
{
jQuery('#jform_php_jview').closest('.control-group').hide();
if (!jform_vvvvvynvyj_required)
if (!jform_vvvvvynvyk_required)
{
updateFieldRequired('php_jview',1);
jQuery('#jform_php_jview').removeAttr('required');
jQuery('#jform_php_jview').removeAttr('aria-required');
jQuery('#jform_php_jview').removeClass('required');
jform_vvvvvynvyj_required = true;
jform_vvvvvynvyk_required = true;
}
}
}
@ -172,26 +172,26 @@ function vvvvvyo(add_php_document_vvvvvyo)
if (add_php_document_vvvvvyo == 1)
{
jQuery('#jform_php_document').closest('.control-group').show();
if (jform_vvvvvyovyk_required)
if (jform_vvvvvyovyl_required)
{
updateFieldRequired('php_document',0);
jQuery('#jform_php_document').prop('required','required');
jQuery('#jform_php_document').attr('aria-required',true);
jQuery('#jform_php_document').addClass('required');
jform_vvvvvyovyk_required = false;
jform_vvvvvyovyl_required = false;
}
}
else
{
jQuery('#jform_php_document').closest('.control-group').hide();
if (!jform_vvvvvyovyk_required)
if (!jform_vvvvvyovyl_required)
{
updateFieldRequired('php_document',1);
jQuery('#jform_php_document').removeAttr('required');
jQuery('#jform_php_document').removeAttr('aria-required');
jQuery('#jform_php_document').removeClass('required');
jform_vvvvvyovyk_required = true;
jform_vvvvvyovyl_required = true;
}
}
}
@ -203,26 +203,26 @@ function vvvvvyp(add_css_document_vvvvvyp)
if (add_css_document_vvvvvyp == 1)
{
jQuery('#jform_css_document').closest('.control-group').show();
if (jform_vvvvvypvyl_required)
if (jform_vvvvvypvym_required)
{
updateFieldRequired('css_document',0);
jQuery('#jform_css_document').prop('required','required');
jQuery('#jform_css_document').attr('aria-required',true);
jQuery('#jform_css_document').addClass('required');
jform_vvvvvypvyl_required = false;
jform_vvvvvypvym_required = false;
}
}
else
{
jQuery('#jform_css_document').closest('.control-group').hide();
if (!jform_vvvvvypvyl_required)
if (!jform_vvvvvypvym_required)
{
updateFieldRequired('css_document',1);
jQuery('#jform_css_document').removeAttr('required');
jQuery('#jform_css_document').removeAttr('aria-required');
jQuery('#jform_css_document').removeClass('required');
jform_vvvvvypvyl_required = true;
jform_vvvvvypvym_required = true;
}
}
}
@ -234,26 +234,26 @@ function vvvvvyq(add_javascript_file_vvvvvyq)
if (add_javascript_file_vvvvvyq == 1)
{
jQuery('#jform_javascript_file').closest('.control-group').show();
if (jform_vvvvvyqvym_required)
if (jform_vvvvvyqvyn_required)
{
updateFieldRequired('javascript_file',0);
jQuery('#jform_javascript_file').prop('required','required');
jQuery('#jform_javascript_file').attr('aria-required',true);
jQuery('#jform_javascript_file').addClass('required');
jform_vvvvvyqvym_required = false;
jform_vvvvvyqvyn_required = false;
}
}
else
{
jQuery('#jform_javascript_file').closest('.control-group').hide();
if (!jform_vvvvvyqvym_required)
if (!jform_vvvvvyqvyn_required)
{
updateFieldRequired('javascript_file',1);
jQuery('#jform_javascript_file').removeAttr('required');
jQuery('#jform_javascript_file').removeAttr('aria-required');
jQuery('#jform_javascript_file').removeClass('required');
jform_vvvvvyqvym_required = true;
jform_vvvvvyqvyn_required = true;
}
}
}
@ -265,26 +265,26 @@ function vvvvvyr(add_js_document_vvvvvyr)
if (add_js_document_vvvvvyr == 1)
{
jQuery('#jform_js_document').closest('.control-group').show();
if (jform_vvvvvyrvyn_required)
if (jform_vvvvvyrvyo_required)
{
updateFieldRequired('js_document',0);
jQuery('#jform_js_document').prop('required','required');
jQuery('#jform_js_document').attr('aria-required',true);
jQuery('#jform_js_document').addClass('required');
jform_vvvvvyrvyn_required = false;
jform_vvvvvyrvyo_required = false;
}
}
else
{
jQuery('#jform_js_document').closest('.control-group').hide();
if (!jform_vvvvvyrvyn_required)
if (!jform_vvvvvyrvyo_required)
{
updateFieldRequired('js_document',1);
jQuery('#jform_js_document').removeAttr('required');
jQuery('#jform_js_document').removeAttr('aria-required');
jQuery('#jform_js_document').removeClass('required');
jform_vvvvvyrvyn_required = true;
jform_vvvvvyrvyo_required = true;
}
}
}
@ -296,26 +296,26 @@ function vvvvvys(add_css_vvvvvys)
if (add_css_vvvvvys == 1)
{
jQuery('#jform_css').closest('.control-group').show();
if (jform_vvvvvysvyo_required)
if (jform_vvvvvysvyp_required)
{
updateFieldRequired('css',0);
jQuery('#jform_css').prop('required','required');
jQuery('#jform_css').attr('aria-required',true);
jQuery('#jform_css').addClass('required');
jform_vvvvvysvyo_required = false;
jform_vvvvvysvyp_required = false;
}
}
else
{
jQuery('#jform_css').closest('.control-group').hide();
if (!jform_vvvvvysvyo_required)
if (!jform_vvvvvysvyp_required)
{
updateFieldRequired('css',1);
jQuery('#jform_css').removeAttr('required');
jQuery('#jform_css').removeAttr('aria-required');
jQuery('#jform_css').removeClass('required');
jform_vvvvvysvyo_required = true;
jform_vvvvvysvyp_required = true;
}
}
}
@ -328,13 +328,13 @@ function vvvvvyt(add_php_ajax_vvvvvyt)
{
jQuery('#jform_ajax_input-lbl').closest('.control-group').show();
jQuery('#jform_php_ajaxmethod').closest('.control-group').show();
if (jform_vvvvvytvyp_required)
if (jform_vvvvvytvyq_required)
{
updateFieldRequired('php_ajaxmethod',0);
jQuery('#jform_php_ajaxmethod').prop('required','required');
jQuery('#jform_php_ajaxmethod').attr('aria-required',true);
jQuery('#jform_php_ajaxmethod').addClass('required');
jform_vvvvvytvyp_required = false;
jform_vvvvvytvyq_required = false;
}
}
@ -342,13 +342,13 @@ function vvvvvyt(add_php_ajax_vvvvvyt)
{
jQuery('#jform_ajax_input-lbl').closest('.control-group').hide();
jQuery('#jform_php_ajaxmethod').closest('.control-group').hide();
if (!jform_vvvvvytvyp_required)
if (!jform_vvvvvytvyq_required)
{
updateFieldRequired('php_ajaxmethod',1);
jQuery('#jform_php_ajaxmethod').removeAttr('required');
jQuery('#jform_php_ajaxmethod').removeAttr('aria-required');
jQuery('#jform_php_ajaxmethod').removeClass('required');
jform_vvvvvytvyp_required = true;
jform_vvvvvytvyq_required = true;
}
}
}
@ -361,23 +361,23 @@ function vvvvvyu(add_custom_button_vvvvvyu)
{
jQuery('#jform_custom_button-lbl').closest('.control-group').show();
jQuery('#jform_php_controller').closest('.control-group').show();
if (jform_vvvvvyuvyq_required)
if (jform_vvvvvyuvyr_required)
{
updateFieldRequired('php_controller',0);
jQuery('#jform_php_controller').prop('required','required');
jQuery('#jform_php_controller').attr('aria-required',true);
jQuery('#jform_php_controller').addClass('required');
jform_vvvvvyuvyq_required = false;
jform_vvvvvyuvyr_required = false;
}
jQuery('#jform_php_model').closest('.control-group').show();
if (jform_vvvvvyuvyr_required)
if (jform_vvvvvyuvys_required)
{
updateFieldRequired('php_model',0);
jQuery('#jform_php_model').prop('required','required');
jQuery('#jform_php_model').attr('aria-required',true);
jQuery('#jform_php_model').addClass('required');
jform_vvvvvyuvyr_required = false;
jform_vvvvvyuvys_required = false;
}
}
@ -385,22 +385,22 @@ function vvvvvyu(add_custom_button_vvvvvyu)
{
jQuery('#jform_custom_button-lbl').closest('.control-group').hide();
jQuery('#jform_php_controller').closest('.control-group').hide();
if (!jform_vvvvvyuvyq_required)
if (!jform_vvvvvyuvyr_required)
{
updateFieldRequired('php_controller',1);
jQuery('#jform_php_controller').removeAttr('required');
jQuery('#jform_php_controller').removeAttr('aria-required');
jQuery('#jform_php_controller').removeClass('required');
jform_vvvvvyuvyq_required = true;
jform_vvvvvyuvyr_required = true;
}
jQuery('#jform_php_model').closest('.control-group').hide();
if (!jform_vvvvvyuvyr_required)
if (!jform_vvvvvyuvys_required)
{
updateFieldRequired('php_model',1);
jQuery('#jform_php_model').removeAttr('required');
jQuery('#jform_php_model').removeAttr('aria-required');
jQuery('#jform_php_model').removeClass('required');
jform_vvvvvyuvyr_required = true;
jform_vvvvvyuvys_required = true;
}
}
}

View File

@ -23,7 +23,7 @@
/-----------------------------------------------------------------------------------------------------------------------------*/
// Some Global Values
jform_vvvvvywvys_required = false;
jform_vvvvvywvyt_required = false;
// Initial Script
jQuery(document).ready(function()
@ -39,26 +39,26 @@ function vvvvvyw(add_php_view_vvvvvyw)
if (add_php_view_vvvvvyw == 1)
{
jQuery('#jform_php_view').closest('.control-group').show();
if (jform_vvvvvywvys_required)
if (jform_vvvvvywvyt_required)
{
updateFieldRequired('php_view',0);
jQuery('#jform_php_view').prop('required','required');
jQuery('#jform_php_view').attr('aria-required',true);
jQuery('#jform_php_view').addClass('required');
jform_vvvvvywvys_required = false;
jform_vvvvvywvyt_required = false;
}
}
else
{
jQuery('#jform_php_view').closest('.control-group').hide();
if (!jform_vvvvvywvys_required)
if (!jform_vvvvvywvyt_required)
{
updateFieldRequired('php_view',1);
jQuery('#jform_php_view').removeAttr('required');
jQuery('#jform_php_view').removeAttr('aria-required');
jQuery('#jform_php_view').removeClass('required');
jform_vvvvvywvys_required = true;
jform_vvvvvywvyt_required = true;
}
}
}

View File

@ -122,7 +122,7 @@ class ComponentbuilderModelFtp extends JModelAdmin
*
* @return mixed An array of data items on success, false on failure.
*/
public function getWablinked_components()
public function getWaclinked_components()
{
// Get the user object.
$user = JFactory::getUser();

View File

@ -0,0 +1,660 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.6.x
@created 30th April, 2015
@package Component Builder
@subpackage import_language_translations.php
@author Llewellyn van der Merwe <http://joomlacomponentbuilder.com>
@github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
/**
* Componentbuilder Import_language_translations Model
*/
class ComponentbuilderModelImport_language_translations extends JModelLegacy
{
// set uploading values
protected $use_streams = false;
protected $allow_unsafe = false;
protected $safeFileOptions = array();
/**
* @var object JTable object
*/
protected $_table = null;
/**
* @var object JTable object
*/
protected $_url = null;
/**
* Model context string.
*
* @var string
*/
protected $_context = 'com_componentbuilder.import_language_translations';
/**
* Import Settings
*/
protected $getType = NULL;
protected $dataType = NULL;
/**
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
*
* @return void
*
*/
protected function populateState()
{
$app = JFactory::getApplication('administrator');
$this->setState('message', $app->getUserState('com_componentbuilder.message'));
$app->setUserState('com_componentbuilder.message', '');
// Recall the 'Import from Directory' path.
$path = $app->getUserStateFromRequest($this->_context . '.import_directory', 'import_directory', $app->get('tmp_path'));
$this->setState('import.directory', $path);
parent::populateState();
}
/**
* Import an spreadsheet from either folder, url or upload.
*
* @return boolean result of import
*
*/
public function import()
{
$this->setState('action', 'import');
$app = JFactory::getApplication();
$session = JFactory::getSession();
$package = null;
$continue = false;
// get import type
$this->getType = $app->input->getString('gettype', NULL);
// get import type
$this->dataType = $session->get('dataType_VDM_IMPORTINTO', NULL);
if ($package === null)
{
switch ($this->getType)
{
case 'folder':
// Remember the 'Import from Directory' path.
$app->getUserStateFromRequest($this->_context . '.import_directory', 'import_directory');
$package = $this->_getPackageFromFolder();
break;
case 'upload':
$package = $this->_getPackageFromUpload();
break;
case 'url':
$package = $this->_getPackageFromUrl();
break;
case 'continue':
$continue = true;
$package = $session->get('package', null);
$package = json_decode($package, true);
// clear session
$session->clear('package');
$session->clear('dataType');
$session->clear('hasPackage');
break;
default:
$app->setUserState('com_componentbuilder.message', JText::_('COM_COMPONENTBUILDER_IMPORT_NO_IMPORT_TYPE_FOUND'));
return false;
break;
}
}
// Was the package valid?
if (!$package || !$package['type'])
{
if (in_array($this->getType, array('upload', 'url')))
{
$this->remove($package['packagename']);
}
$app->setUserState('com_componentbuilder.message', JText::_('COM_COMPONENTBUILDER_IMPORT_UNABLE_TO_FIND_IMPORT_PACKAGE'));
return false;
}
// first link data to table headers
if(!$continue){
$package = json_encode($package);
$session->set('package', $package);
$session->set('dataType', $this->dataType);
$session->set('hasPackage', true);
return true;
}
// set the data
$headerList = json_decode($session->get($this->dataType.'_VDM_IMPORTHEADERS', false), true);
if (!$this->setData($package,$this->dataType,$headerList))
{
// There was an error importing the package
$msg = JText::_('COM_COMPONENTBUILDER_IMPORT_ERROR');
$back = $session->get('backto_VDM_IMPORT', NULL);
if ($back)
{
$app->setUserState('com_componentbuilder.redirect_url', 'index.php?option=com_componentbuilder&view='.$back);
$session->clear('backto_VDM_IMPORT');
}
$result = false;
}
else
{
// Package imported sucessfully
$msg = JText::sprintf('COM_COMPONENTBUILDER_IMPORT_SUCCESS', $package['packagename']);
$back = $session->get('backto_VDM_IMPORT', NULL);
if ($back)
{
$app->setUserState('com_componentbuilder.redirect_url', 'index.php?option=com_componentbuilder&view='.$back);
$session->clear('backto_VDM_IMPORT');
}
$result = true;
}
// Set some model state values
$app->enqueueMessage($msg);
// remove file after import
$this->remove($package['packagename']);
$session->clear($this->getType.'_VDM_IMPORTHEADERS');
return $result;
}
/**
* Works out an importation spreadsheet from a HTTP upload
*
* @return spreadsheet definition or false on failure
*/
protected function _getPackageFromUpload()
{
// Get the uploaded file information
$app = JFactory::getApplication();
$input = $app->input;
// Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See JInputFiles::get.
$userfile = $input->files->get('import_package', null, 'raw');
// Make sure that file uploads are enabled in php
if (!(bool) ini_get('file_uploads'))
{
$app->enqueueMessage(JText::_('COM_COMPONENTBUILDER_IMPORT_MSG_WARNIMPORTFILE'), 'warning');
return false;
}
// If there is no uploaded file, we have a problem...
if (!is_array($userfile))
{
$app->enqueueMessage(JText::_('COM_COMPONENTBUILDER_IMPORT_MSG_NO_FILE_SELECTED'), 'warning');
return false;
}
// Check if there was a problem uploading the file.
if ($userfile['error'] || $userfile['size'] < 1)
{
$app->enqueueMessage(JText::_('COM_COMPONENTBUILDER_IMPORT_MSG_WARNIMPORTUPLOADERROR'), 'warning');
return false;
}
// Build the appropriate paths
$config = JFactory::getConfig();
$tmp_dest = $config->get('tmp_path') . '/' . $userfile['name'];
$tmp_src = $userfile['tmp_name'];
// Move uploaded file
jimport('joomla.filesystem.file');
$p_file = JFile::upload($tmp_src, $tmp_dest, $this->use_streams, $this->allow_unsafe, $this->safeFileOptions);
// Was the package downloaded?
if (!$p_file)
{
$session = JFactory::getSession();
$session->clear('package');
$session->clear('dataType');
$session->clear('hasPackage');
// was not uploaded
return false;
}
// check that this is a valid spreadsheet
$package = $this->check($userfile['name']);
return $package;
}
/**
* Import an spreadsheet from a directory
*
* @return array Spreadsheet details or false on failure
*
*/
protected function _getPackageFromFolder()
{
$app = JFactory::getApplication();
$input = $app->input;
// Get the path to the package to import
$p_dir = $input->getString('import_directory');
$p_dir = JPath::clean($p_dir);
// Did you give us a valid path?
if (!file_exists($p_dir))
{
$app->enqueueMessage(JText::_('COM_COMPONENTBUILDER_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY'), 'warning');
return false;
}
// Detect the package type
$type = $this->getType;
// Did you give us a valid package?
if (!$type)
{
$app->enqueueMessage(JText::_('COM_COMPONENTBUILDER_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'), 'warning');
}
// check the extention
if(!$this->checkExtension($p_dir))
{
// set error message
$app->enqueueMessage(JText::_('COM_COMPONENTBUILDER_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning');
return false;
}
$package['packagename'] = null;
$package['dir'] = $p_dir;
$package['type'] = $type;
return $package;
}
/**
* Import an spreadsheet from a URL
*
* @return Package details or false on failure
*
*/
protected function _getPackageFromUrl()
{
$app = JFactory::getApplication();
$input = $app->input;
// Get the URL of the package to import
$url = $input->getString('import_url');
// Did you give us a URL?
if (!$url)
{
$app->enqueueMessage(JText::_('COM_COMPONENTBUILDER_IMPORT_MSG_ENTER_A_URL'), 'warning');
return false;
}
// Download the package at the URL given
$p_file = JInstallerHelper::downloadPackage($url);
// Was the package downloaded?
if (!$p_file)
{
$app->enqueueMessage(JText::_('COM_COMPONENTBUILDER_IMPORT_MSG_INVALID_URL'), 'warning');
return false;
}
// check that this is a valid spreadsheet
$package = $this->check($p_file);
return $package;
}
/**
* Check a file and verifies it as a spreadsheet file
* Supports .csv .xlsx .xls and .ods
*
* @param string $p_filename The uploaded package filename or import directory
*
* @return array of elements
*
*/
protected function check($archivename)
{
$app = JFactory::getApplication();
// Clean the name
$archivename = JPath::clean($archivename);
// check the extention
if(!$this->checkExtension($archivename))
{
// Cleanup the import files
$this->remove($archivename);
$app->enqueueMessage(JText::_('COM_COMPONENTBUILDER_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning');
return false;
}
$config = JFactory::getConfig();
// set Package Name
$check['packagename'] = $archivename;
// set directory
$check['dir'] = $config->get('tmp_path'). '/' .$archivename;
// set type
$check['type'] = $this->getType;
return $check;
}
/**
* Check the extension
*
* @param string $file Name of the uploaded file
*
* @return boolean True on success
*
*/
protected function checkExtension($file)
{
// check the extention
switch(strtolower(pathinfo($file, PATHINFO_EXTENSION)))
{
case 'xls':
case 'ods':
case 'csv':
return true;
break;
}
return false;
}
/**
* Clean up temporary uploaded spreadsheet
*
* @param string $package Name of the uploaded spreadsheet file
*
* @return boolean True on success
*
*/
protected function remove($package)
{
jimport('joomla.filesystem.file');
$config = JFactory::getConfig();
$package = $config->get('tmp_path'). '/' .$package;
// Is the package file a valid file?
if (is_file($package))
{
JFile::delete($package);
}
elseif (is_file(JPath::clean($package)))
{
// It might also be just a base filename
JFile::delete(JPath::clean($package));
}
}
/**
* Set the data from the spreadsheet to the database
*
* @param string $package Paths to the uploaded package file
*
* @return boolean false on failure
*
**/
protected function setData($package,$table,$target_headers)
{
if (ComponentbuilderHelper::checkArray($target_headers))
{
// make sure the file is loaded
JLoader::import('PHPExcel', JPATH_COMPONENT_ADMINISTRATOR . '/helpers');
$jinput = JFactory::getApplication()->input;
foreach($target_headers as $header)
{
$data['target_headers'][$header] = $jinput->getString($header, null);
}
// set the data
if(isset($package['dir']))
{
$inputFileType = PHPExcel_IOFactory::identify($package['dir']);
$excelReader = PHPExcel_IOFactory::createReader($inputFileType);
$excelReader->setReadDataOnly(true);
$excelObj = $excelReader->load($package['dir']);
$data['array'] = $excelObj->getActiveSheet()->toArray(null, true,true,true);
$excelObj->disconnectWorksheets();
unset($excelObj);
return $this->save($data,$table);
}
}
return false;
}
/**
* Save the data from the file to the database
*
* @param string $package Paths to the uploaded package file
*
* @return boolean false on failure
*
**/
protected function save($data,$table)
{
// import the data if there is any
if(ComponentbuilderHelper::checkArray($data['array']))
{
// get user object
$user = JFactory::getUser();
// remove header if it has headers
$id_key = $data['target_headers']['id'];
$english_key = $data['target_headers']['English'];
// get the first array set
$firstSet = reset($data['array']);
// check if first array is a header array and remove if true
if($firstSet[$id_key] == 'id' || $firstSet[$english_key] == 'English')
{
array_shift($data['array']);
}
// make sure there is still values in array and that it was not only headers
if(ComponentbuilderHelper::checkArray($data['array']) && $user->authorise($table.'.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder'))
{
// set target.
$target = array_flip($data['target_headers']);
// Get a db connection.
$db = JFactory::getDbo();
// set some defaults
$todayDate = JFactory::getDate()->toSql();
// get global action permissions
$canDo = ComponentbuilderHelper::getActions($table);
$canEdit = $canDo->get('core.edit');
// proses the data
foreach($data['array'] as $row)
{
$found = false;
if (isset($row[$id_key]) && is_numeric($row[$id_key]) && $row[$id_key] > 0)
{
// raw items import & update!
$query = $db->getQuery(true);
$query
->select('version')
->from($db->quoteName('#__componentbuilder_'.$table))
->where($db->quoteName('id') . ' = '. $db->quote($row[$id_key]));
// Reset the query using our newly populated query object.
$db->setQuery($query);
$db->execute();
$found = $db->getNumRows();
}
if($found && $canEdit)
{
// update item
$id = $row[$id_key];
$version = $db->loadResult();
// get languages
$languages = ComponentbuilderHelper::getVars('language', 1, 'published', 'langtag');
// reset all buckets
$query = $db->getQuery(true);
$fields = array();
$translations = array();
$counter = 0;
// Fields to update.
foreach($row as $key => $cell)
{
// ignore column
if ('IGNORE' === $target[$key] || 'modified_by' === $target[$key] || 'modified' === $target[$key] || 'English' === $target[$key] )
{
continue;
}
// update version
if ('version' == $target[$key])
{
$cell = (int) $version + 1;
}
// verify publish authority
if ('published' == $target[$key] && !$canState)
{
continue;
}
// set to translations
if(in_array($target[$key], $languages))
{
// only add if it has a string
if (ComponentbuilderHelper::checkString($cell))
{
$translations['translation'.$counter] = array('language' => $target[$key], 'translation' => $cell);
$counter++;
}
}
// set to update array
elseif(in_array($key, $data['target_headers']) && is_numeric($cell))
{
$fields[] = $db->quoteName($target[$key]) . ' = ' . $cell;
}
elseif(in_array($key, $data['target_headers']) && is_string($cell))
{
$fields[] = $db->quoteName($target[$key]) . ' = ' . $db->quote($cell);
}
elseif(in_array($key, $data['target_headers']) && is_null($cell))
{
// if import data is null then set empty
$fields[] = $db->quoteName($target[$key]) . " = ''";
}
}
// set the translation
if (ComponentbuilderHelper::checkArray($translations))
{
$fields[] = $db->quoteName('translation') . ' = ' . $db->quote(json_encode($translations, JSON_FORCE_OBJECT));
}
// load the defaults
$fields[] = $db->quoteName('modified_by') . ' = ' . $db->quote($user->id);
$fields[] = $db->quoteName('modified') . ' = ' . $db->quote($todayDate);
// Conditions for which records should be updated.
$conditions = array(
$db->quoteName('id') . ' = ' . $id
);
$query->update($db->quoteName('#__componentbuilder_'.$table))->set($fields)->where($conditions);
$db->setQuery($query);
$db->execute();
}
else
{
return false;
}
}
return true;
}
}
return false;
}
protected function getAlias($name,$type = false)
{
// sanitize the name to an alias
if (JFactory::getConfig()->get('unicodeslugs') == 1)
{
$alias = JFilterOutput::stringURLUnicodeSlug($name);
}
else
{
$alias = JFilterOutput::stringURLSafe($name);
}
// must be a uniqe alias
if ($type)
{
return $this->getUniqe($alias,'alias',$type);
}
return $alias;
}
/**
* Method to generate a uniqe value.
*
* @param string $field name.
* @param string $value data.
* @param string $type table.
*
* @return string New value.
*/
protected function getUniqe($value,$field,$type)
{
// insure the filed is always uniqe
while (isset($this->uniqeValueArray[$type][$field][$value]))
{
$value = JString::increment($value, 'dash');
}
$this->uniqeValueArray[$type][$field][$value] = $value;
return $value;
}
protected function getAliasesUsed($table)
{
// Get a db connection.
$db = JFactory::getDbo();
// first we check if there is a alias column
$columns = $db->getTableColumns('#__componentbuilder_'.$table);
if(isset($columns['alias'])){
// Create a new query object.
$query = $db->getQuery(true);
$query->select($db->quoteName(array('alias')));
$query->from($db->quoteName('#__componentbuilder_'.$table));
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
{
$aliases = $db->loadColumn();
foreach($aliases as $alias)
{
$this->uniqeValueArray[$table]['alias'][$alias] = $alias;
}
}
return true;
}
return false;
}
}

View File

@ -415,6 +415,43 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
}
}
}
// prep the lang strings for export
if (isset($_export) && $_export && ComponentbuilderHelper::checkArray($items))
{
foreach ($items as $nr => &$item)
{
// remove some values completely
unset($item->components);
unset($item->params);
unset($item->published);
unset($item->created_by);
unset($item->modified_by);
unset($item->created);
unset($item->modified);
unset($item->version);
unset($item->hits);
unset($item->access);
unset($item->ordering);
// now adapt the entranslation
if (isset($item->translation) && ComponentbuilderHelper::checkJson($item->translation))
{
$translations = json_decode($item->translation, true);
if (ComponentbuilderHelper::checkArray($translations))
{
foreach ($translations as $language)
{
if (isset($language['translation']) && ComponentbuilderHelper::checkString($language['translation'])
&& isset($language['language']) && ComponentbuilderHelper::checkString($language['language']))
{
$item->{$language['language']} = $language['translation'];
}
}
}
}
// remove translation
unset($item->translation);
}
}
return $items;
}
return false;

View File

@ -161,6 +161,43 @@ class ComponentbuilderModelLanguage_translations extends JModelList
}
}
}
// prep the lang strings for export
if (isset($_export) && $_export && ComponentbuilderHelper::checkArray($items))
{
foreach ($items as $nr => &$item)
{
// remove some values completely
unset($item->components);
unset($item->params);
unset($item->published);
unset($item->created_by);
unset($item->modified_by);
unset($item->created);
unset($item->modified);
unset($item->version);
unset($item->hits);
unset($item->access);
unset($item->ordering);
// now adapt the entranslation
if (isset($item->translation) && ComponentbuilderHelper::checkJson($item->translation))
{
$translations = json_decode($item->translation, true);
if (ComponentbuilderHelper::checkArray($translations))
{
foreach ($translations as $language)
{
if (isset($language['translation']) && ComponentbuilderHelper::checkString($language['translation'])
&& isset($language['language']) && ComponentbuilderHelper::checkString($language['language']))
{
$item->{$language['language']} = $language['translation'];
}
}
}
}
// remove translation
unset($item->translation);
}
}
// return items
return $items;
@ -346,6 +383,43 @@ class ComponentbuilderModelLanguage_translations extends JModelList
$item->entranslation = '<small><em>(' . JText::_('COM_COMPONENTBUILDER_NOTRANSLATION') . ')</em></small> ' . ComponentbuilderHelper::htmlEscape($item->entranslation, 'UTF-8', true, 150) . $componentCounter;
}
}
}
// prep the lang strings for export
if (isset($_export) && $_export && ComponentbuilderHelper::checkArray($items))
{
foreach ($items as $nr => &$item)
{
// remove some values completely
unset($item->components);
unset($item->params);
unset($item->published);
unset($item->created_by);
unset($item->modified_by);
unset($item->created);
unset($item->modified);
unset($item->version);
unset($item->hits);
unset($item->access);
unset($item->ordering);
// now adapt the entranslation
if (isset($item->translation) && ComponentbuilderHelper::checkJson($item->translation))
{
$translations = json_decode($item->translation, true);
if (ComponentbuilderHelper::checkArray($translations))
{
foreach ($translations as $language)
{
if (isset($language['translation']) && ComponentbuilderHelper::checkString($language['translation'])
&& isset($language['language']) && ComponentbuilderHelper::checkString($language['language']))
{
$item->{$language['language']} = $language['translation'];
}
}
}
}
// remove translation
unset($item->translation);
}
}
return $items;
}
@ -360,25 +434,21 @@ class ComponentbuilderModelLanguage_translations extends JModelList
*/
public function getExImPortHeaders()
{
// Get a db connection.
$db = JFactory::getDbo();
// get the columns
$columns = $db->getTableColumns("#__componentbuilder_language_translation");
if (ComponentbuilderHelper::checkArray($columns))
{
// remove the headers you don't import/export.
unset($columns['asset_id']);
unset($columns['checked_out']);
unset($columns['checked_out_time']);
$languages = ComponentbuilderHelper::getVars('language', 1, 'published', 'langtag');
// start setup of headers
$headers = new stdClass();
foreach ($columns as $column => $type)
$headers->id = 'id';
$headers->English = 'English';
// add the languages
if (ComponentbuilderHelper::checkArray($languages))
{
$headers->{$column} = $column;
foreach ($languages as $language)
{
$headers->{$language} = $language;
}
}
return $headers;
}
return false;
}
/**
* Method to get a store id based on model configuration state.

View File

@ -193,6 +193,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_admin_view` (
`php_import` MEDIUMTEXT NOT NULL,
`php_import_display` MEDIUMTEXT NOT NULL,
`php_import_ext` MEDIUMTEXT NOT NULL,
`php_import_headers` MEDIUMTEXT NOT NULL,
`php_import_save` MEDIUMTEXT NOT NULL,
`php_import_setdata` MEDIUMTEXT NOT NULL,
`php_model` MEDIUMTEXT NOT NULL,
@ -224,33 +225,33 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_admin_view` (
KEY `idx_state` (`published`),
KEY `idx_name_single` (`name_single`),
KEY `idx_name_list` (`name_list`),
KEY `idx_type` (`type`),
KEY `idx_add_fadein` (`add_fadein`),
KEY `idx_source` (`source`),
KEY `idx_add_css_view` (`add_css_view`),
KEY `idx_add_php_getitems` (`add_php_getitems`),
KEY `idx_add_css_views` (`add_css_views`),
KEY `idx_add_php_getitems_after_all` (`add_php_getitems_after_all`),
KEY `idx_add_php_getlistquery` (`add_php_getlistquery`),
KEY `idx_add_javascript_view_file` (`add_javascript_view_file`),
KEY `idx_add_php_before_save` (`add_php_before_save`),
KEY `idx_add_php_save` (`add_php_save`),
KEY `idx_add_javascript_view_footer` (`add_javascript_view_footer`),
KEY `idx_add_php_postsavehook` (`add_php_postsavehook`),
KEY `idx_add_php_allowedit` (`add_php_allowedit`),
KEY `idx_add_javascript_views_file` (`add_javascript_views_file`),
KEY `idx_add_php_batchcopy` (`add_php_batchcopy`),
KEY `idx_add_php_batchmove` (`add_php_batchmove`),
KEY `idx_add_javascript_views_footer` (`add_javascript_views_footer`),
KEY `idx_add_php_before_publish` (`add_php_before_publish`),
KEY `idx_add_php_after_publish` (`add_php_after_publish`),
KEY `idx_add_custom_button` (`add_custom_button`),
KEY `idx_add_php_before_delete` (`add_php_before_delete`),
KEY `idx_add_php_after_delete` (`add_php_after_delete`),
KEY `idx_add_php_document` (`add_php_document`),
KEY `idx_add_sql` (`add_sql`),
KEY `idx_add_php_ajax` (`add_php_ajax`),
KEY `idx_add_php_postsavehook` (`add_php_postsavehook`),
KEY `idx_add_custom_import` (`add_custom_import`),
KEY `idx_add_php_before_publish` (`add_php_before_publish`),
KEY `idx_type` (`type`),
KEY `idx_add_php_batchcopy` (`add_php_batchcopy`),
KEY `idx_add_fadein` (`add_fadein`),
KEY `idx_add_php_before_delete` (`add_php_before_delete`),
KEY `idx_add_php_getitems_after_all` (`add_php_getitems_after_all`),
KEY `idx_add_php_before_save` (`add_php_before_save`),
KEY `idx_add_php_getitems` (`add_php_getitems`),
KEY `idx_add_php_getlistquery` (`add_php_getlistquery`),
KEY `idx_add_php_save` (`add_php_save`),
KEY `idx_add_php_allowedit` (`add_php_allowedit`),
KEY `idx_add_php_batchmove` (`add_php_batchmove`),
KEY `idx_add_php_after_publish` (`add_php_after_publish`),
KEY `idx_add_php_after_delete` (`add_php_after_delete`),
KEY `idx_add_sql` (`add_sql`),
KEY `idx_add_css_view` (`add_css_view`),
KEY `idx_add_css_views` (`add_css_views`),
KEY `idx_add_javascript_view_file` (`add_javascript_view_file`),
KEY `idx_add_javascript_view_footer` (`add_javascript_view_footer`),
KEY `idx_add_javascript_views_file` (`add_javascript_views_file`),
KEY `idx_add_javascript_views_footer` (`add_javascript_views_footer`),
KEY `idx_add_custom_button` (`add_custom_button`),
KEY `idx_source` (`source`),
KEY `idx_add_php_ajax` (`add_php_ajax`),
KEY `idx_add_php_getitem` (`add_php_getitem`)
) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;

View File

@ -0,0 +1 @@
ALTER TABLE `#__componentbuilder_admin_view` ADD `php_import_headers` MEDIUMTEXT NOT NULL AFTER `php_import_ext`;

View File

@ -91,12 +91,12 @@ JHtml::_('behavior.tooltip');
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo JHtml::_('bootstrap.addTab', 'cpanel_tab', 'vast_development_method', JText::_('Vast Development Method', true)); ?>
<?php echo JHtml::_('bootstrap.addTab', 'cpanel_tab', 'notice_board', JText::_('Notice Board', true)); ?>
<div class="row-fluid">
<div class="span12">
<?php echo JHtml::_('bootstrap.startAccordion', 'vast_development_method_accordian', array('active' => 'vast_development_method_one')); ?>
<?php echo JHtml::_('bootstrap.addSlide', 'vast_development_method_accordian', 'Notice Board', 'vast_development_method_one'); ?>
<?php echo $this->loadTemplate('vast_development_method_notice_board');?>
<?php echo JHtml::_('bootstrap.startAccordion', 'notice_board_accordian', array('active' => 'notice_board_one')); ?>
<?php echo JHtml::_('bootstrap.addSlide', 'notice_board_accordian', 'Vast Development Method', 'notice_board_one'); ?>
<?php echo $this->loadTemplate('notice_board_vast_development_method');?>
<?php echo JHtml::_('bootstrap.endSlide'); ?>
<?php echo JHtml::_('bootstrap.endAccordion'); ?>
</div>

View File

@ -13,7 +13,7 @@
@version 2.6.x
@created 30th April, 2015
@package Component Builder
@subpackage default_vast_development_method_notice_board.php
@subpackage default_notice_board_vast_development_method.php
@author Llewellyn van der Merwe <http://joomlacomponentbuilder.com>
@github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
@copyright Copyright (C) 2015. All Rights Reserved

View File

@ -64,7 +64,7 @@ class ComponentbuilderViewFieldtype extends JViewLegacy
}
// Get Linked view data
$this->waafields = $this->get('Waafields');
$this->wabfields = $this->get('Wabfields');
// Set the toolbar
$this->addToolBar();

View File

@ -64,7 +64,7 @@ class ComponentbuilderViewFtp extends JViewLegacy
}
// Get Linked view data
$this->wablinked_components = $this->get('Wablinked_components');
$this->waclinked_components = $this->get('Waclinked_components');
// Set the toolbar
$this->addToolBar();

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -0,0 +1,247 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.6.x
@created 30th April, 2015
@package Component Builder
@subpackage default.php
@author Llewellyn van der Merwe <http://joomlacomponentbuilder.com>
@github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::_('jquery.framework');
JHtml::_('bootstrap.tooltip');
JHtml::_('script', 'system/core.js', false, true);
JHtml::_('behavior.keepalive');
?>
<script type="text/javascript">
<?php if ($this->hasPackage && ComponentbuilderHelper::checkArray($this->headerList)) : ?>
Joomla.continueImport = function()
{
var form = document.getElementById('adminForm');
var error = false;
var therequired = [<?php $i = 0; foreach($this->headerList as $name => $title) { echo ($i != 0)? ', "vdm_'.$name.'"':'"vdm_'.$name.'"'; $i++; } ?>];
for(i = 0; i < therequired.length; i++)
{
if(jQuery('#'+therequired[i]).val() == "" )
{
error = true;
break;
}
}
// do field validation
if (error)
{
alert("<?php echo JText::_('COM_COMPONENTBUILDER_IMPORT_MSG_PLEASE_SELECT_ALL_COLUMNS', true); ?>");
}
else
{
jQuery('#loading').css('display', 'block');
form.gettype.value = 'continue';
form.submit();
}
};
<?php else: ?>
Joomla.submitbutton = function()
{
var form = document.getElementById('adminForm');
// do field validation
if (form.import_package.value == "")
{
alert("<?php echo JText::_('COM_COMPONENTBUILDER_IMPORT_MSG_PLEASE_SELECT_A_FILE', true); ?>");
}
else
{
jQuery('#loading').css('display', 'block');
form.gettype.value = 'upload';
form.submit();
}
};
Joomla.submitbutton3 = function()
{
var form = document.getElementById('adminForm');
// do field validation
if (form.import_directory.value == ""){
alert("<?php echo JText::_('COM_COMPONENTBUILDER_IMPORT_MSG_PLEASE_SELECT_A_DIRECTORY', true); ?>");
}
else
{
jQuery('#loading').css('display', 'block');
form.gettype.value = 'folder';
form.submit();
}
};
Joomla.submitbutton4 = function()
{
var form = document.getElementById('adminForm');
// do field validation
if (form.import_url.value == "" || form.import_url.value == "http://")
{
alert("<?php echo JText::_('COM_COMPONENTBUILDER_IMPORT_MSG_ENTER_A_URL', true); ?>");
}
else
{
jQuery('#loading').css('display', 'block');
form.gettype.value = 'url';
form.submit();
}
};
<?php endif; ?>
// Add spindle-wheel for importations:
jQuery(document).ready(function($) {
var outerDiv = $('body');
$('<div id="loading"></div>')
.css("background", "rgba(255, 255, 255, .8) url('components/com_componentbuilder/assets/images/import.gif') 50% 15% no-repeat")
.css("top", outerDiv.position().top - $(window).scrollTop())
.css("left", outerDiv.position().left - $(window).scrollLeft())
.css("width", outerDiv.width())
.css("height", outerDiv.height())
.css("position", "fixed")
.css("opacity", "0.80")
.css("-ms-filter", "progid:DXImageTransform.Microsoft.Alpha(Opacity = 80)")
.css("filter", "alpha(opacity = 80)")
.css("display", "none")
.appendTo(outerDiv);
});
</script>
<div id="installer-import" class="clearfix">
<form enctype="multipart/form-data" action="<?php echo JRoute::_('index.php?option=com_componentbuilder&view=import_language_translations');?>" method="post" name="adminForm" id="adminForm" class="form-horizontal form-validate">
<?php if (!empty( $this->sidebar)) : ?>
<div id="j-sidebar-container" class="span2">
<?php echo $this->sidebar; ?>
</div>
<div id="j-main-container" class="span10">
<?php else : ?>
<div id="j-main-container">
<?php endif;?>
<?php if ($this->hasPackage && ComponentbuilderHelper::checkArray($this->headerList) && ComponentbuilderHelper::checkArray($this->headers)) : ?>
<fieldset class="uploadform">
<legend><?php echo JText::_('COM_COMPONENTBUILDER_IMPORT_LINK_FILE_TO_TABLE_COLUMNS'); ?></legend>
<div class="control-group">
<label class="control-label" ><h4><?php echo JText::_('COM_COMPONENTBUILDER_IMPORT_TABLE_COLUMNS'); ?></h4></label>
<div class="controls">
<label class="control-label" ><h4><?php echo JText::_('COM_COMPONENTBUILDER_IMPORT_FILE_COLUMNS'); ?></h4></label>
</div>
</div>
<?php foreach($this->headerList as $name => $title): ?>
<div class="control-group">
<label for="<?php echo $name; ?>" class="control-label" ><?php echo $title; ?></label>
<div class="controls">
<select name="<?php echo $name; ?>" id="vdm_<?php echo $name; ?>" required class="required input_box" >
<option value=""><?php echo JText::_('COM_COMPONENTBUILDER_IMPORT_PLEASE_SELECT_COLUMN'); ?></option>
<option value="IGNORE"><?php echo JText::_('COM_COMPONENTBUILDER_IMPORT_IGNORE_COLUMN'); ?></option>
<?php foreach($this->headers as $value => $option): ?>
<?php $selected = (strtolower($option) == strtolower ($title) || strtolower($option) == strtolower($name))? 'selected="selected"':''; ?>
<option value="<?php echo ComponentbuilderHelper::htmlEscape($value); ?>" class="required" <?php echo $selected ?>><?php echo ComponentbuilderHelper::htmlEscape($option); ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
<?php endforeach; ?>
<div class="form-actions">
<input class="btn btn-primary" type="button" value="<?php echo JText::_('COM_COMPONENTBUILDER_IMPORT_CONTINUE'); ?>" onclick="Joomla.continueImport()" />
</div>
</fieldset>
<input type="hidden" name="gettype" value="continue" />
<?php else: ?>
<?php echo JHtml::_('bootstrap.startTabSet', 'myTab', array('active' => 'upload')); ?>
<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'upload', JText::_('COM_COMPONENTBUILDER_IMPORT_FROM_UPLOAD', true)); ?>
<fieldset class="uploadform">
<legend><?php echo JText::_('COM_COMPONENTBUILDER_IMPORT_UPDATE_DATA'); ?></legend>
<div class="control-group">
<label for="import_package" class="control-label"><?php echo JText::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE'); ?></label>
<div class="controls">
<input class="input_box" id="import_package" name="import_package" type="file" size="57" />
</div>
</div>
<div class="form-actions">
<input class="btn btn-primary" type="button" value="<?php echo JText::_('COM_COMPONENTBUILDER_IMPORT_UPLOAD_BOTTON'); ?>" onclick="Joomla.submitbutton()" />&nbsp;&nbsp;&nbsp;<small><?php echo JText::_('COM_COMPONENTBUILDER_IMPORT_FORMATS_ACCEPTED'); ?> (.csv .xls .ods)</small>
</div>
</fieldset>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'directory', JText::_('COM_COMPONENTBUILDER_IMPORT_FROM_DIRECTORY', true)); ?>
<fieldset class="uploadform">
<legend><?php echo JText::_('COM_COMPONENTBUILDER_IMPORT_UPDATE_DATA'); ?></legend>
<div class="control-group">
<label for="import_directory" class="control-label"><?php echo JText::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_DIRECTORY'); ?></label>
<div class="controls">
<input type="text" id="import_directory" name="import_directory" class="span5 input_box" size="70" value="<?php echo $this->state->get('import.directory'); ?>" />
</div>
</div>
<div class="form-actions">
<input type="button" class="btn btn-primary" value="<?php echo JText::_('COM_COMPONENTBUILDER_IMPORT_GET_BOTTON'); ?>" onclick="Joomla.submitbutton3()" />&nbsp;&nbsp;&nbsp;<small><?php echo JText::_('COM_COMPONENTBUILDER_IMPORT_FORMATS_ACCEPTED'); ?> (.csv .xls .ods)</small>
</div>
</fieldset>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'url', JText::_('COM_COMPONENTBUILDER_IMPORT_FROM_URL', true)); ?>
<fieldset class="uploadform">
<legend><?php echo JText::_('COM_COMPONENTBUILDER_IMPORT_UPDATE_DATA'); ?></legend>
<div class="control-group">
<label for="import_url" class="control-label"><?php echo JText::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_URL'); ?></label>
<div class="controls">
<input type="text" id="import_url" name="import_url" class="span5 input_box" size="70" value="http://" />
</div>
</div>
<div class="form-actions">
<input type="button" class="btn btn-primary" value="<?php echo JText::_('COM_COMPONENTBUILDER_IMPORT_GET_BOTTON'); ?>" onclick="Joomla.submitbutton4()" />&nbsp;&nbsp;&nbsp;<small><?php echo JText::_('COM_COMPONENTBUILDER_IMPORT_FORMATS_ACCEPTED'); ?> (.csv .xls .ods)</small>
</div>
</fieldset>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo JHtml::_('bootstrap.endTabSet'); ?>
<input type="hidden" name="gettype" value="upload" />
<?php endif; ?>
<input type="hidden" name="task" value="import_language_translations.import" />
<?php echo JHtml::_('form.token'); ?>
</form>
</div>

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -0,0 +1,109 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.6.x
@created 30th April, 2015
@package Component Builder
@subpackage view.html.php
@author Llewellyn van der Merwe <http://joomlacomponentbuilder.com>
@github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla view library
jimport('joomla.application.component.view');
/**
* Componentbuilder Import_language_translations View
*/
class ComponentbuilderViewImport_language_translations extends JViewLegacy
{
protected $headerList;
protected $hasPackage = false;
protected $headers;
protected $hasHeader = 0;
protected $dataType;
public function display($tpl = null)
{
if ($this->getLayout() !== 'modal')
{
// Include helper submenu
ComponentbuilderHelper::addSubmenu('import');
}
$paths = new stdClass;
$paths->first = '';
$state = $this->get('state');
$this->paths = &$paths;
$this->state = &$state;
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('import');
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')
{
$this->addToolbar();
$this->sidebar = JHtmlSidebar::render();
}
// get the session object
$session = JFactory::getSession();
// check if it has package
$this->hasPackage = $session->get('hasPackage', false);
$this->dataType = $session->get('dataType', false);
if($this->hasPackage && $this->dataType)
{
$this->headerList = json_decode($session->get($this->dataType.'_VDM_IMPORTHEADERS', false),true);
$this->headers = ComponentbuilderHelper::getFileHeaders($this->dataType);
// clear the data type
$session->clear('dataType');
}
// Check for errors.
if (count($errors = $this->get('Errors'))){
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
}
/**
* Setting the toolbar
*/
protected function addToolBar()
{
JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_IMPORT_TITLE'), 'upload');
JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=import_language_translations');
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
{
JToolBarHelper::preferences('com_componentbuilder');
}
// set help url for this view if found
$help_url = ComponentbuilderHelper::getHelpUrl('import_language_translations');
if (ComponentbuilderHelper::checkString($help_url))
{
JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
}
}
}

View File

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.2" method="upgrade">
<name>COM_COMPONENTBUILDER</name>
<creationDate>16th January, 2018</creationDate>
<creationDate>19th January, 2018</creationDate>
<author>Llewellyn van der Merwe</author>
<authorEmail>llewellyn@joomlacomponentbuilder.com</authorEmail>
<authorUrl>http://joomlacomponentbuilder.com</authorUrl>
<copyright>Copyright (C) 2015. All Rights Reserved</copyright>
<license>GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html</license>
<version>2.6.11</version>
<version>2.6.12</version>
<description><![CDATA[
<h1>Component Builder (v.2.6.11)</h1>
<h1>Component Builder (v.2.6.12)</h1>
<div style="clear: both;"></div>
<p>The Component Builder for [Joomla](https://extensions.joomla.org/extension/component-builder/) is highly advanced tool that is truly able to build extremely complex components in a fraction of the time.

View File

@ -356,4 +356,21 @@
<maintainerurl>http://joomlacomponentbuilder.com</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
<update>
<name>Component Builder</name>
<description>Builds Complex Joomla Components</description>
<element>com_componentbuilder</element>
<type>component</type>
<version>2.6.12</version>
<infourl title="Component Builder!">http://joomlacomponentbuilder.com</infourl>
<downloads>
<downloadurl type="full" format="zip">http://domain.com/demo.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>http://joomlacomponentbuilder.com</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
</updates>

View File

@ -3218,9 +3218,9 @@ class com_componentbuilderInstallerScript
$admin_view->type_title = 'Componentbuilder Admin_view';
$admin_view->type_alias = 'com_componentbuilder.admin_view';
$admin_view->table = '{"special": {"dbtable": "#__componentbuilder_admin_view","key": "id","type": "Admin_view","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
$admin_view->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "null","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","name_single":"name_single","name_list":"name_list","short_description":"short_description","icon":"icon","php_after_delete":"php_after_delete","icon_category":"icon_category","icon_add":"icon_add","php_save":"php_save","php_batchmove":"php_batchmove","type":"type","description":"description","php_allowedit":"php_allowedit","add_fadein":"add_fadein","php_after_publish":"php_after_publish","source":"source","php_getitems":"php_getitems","php_import":"php_import","php_getlistquery":"php_getlistquery","php_getitem":"php_getitem","not_required":"not_required","php_getitems_after_all":"php_getitems_after_all","php_before_save":"php_before_save","php_postsavehook":"php_postsavehook","php_batchcopy":"php_batchcopy","php_before_publish":"php_before_publish","php_before_delete":"php_before_delete","php_document":"php_document","sql":"sql","php_import_display":"php_import_display","php_import_save":"php_import_save","add_css_view":"add_css_view","css_view":"css_view","add_php_getitems":"add_php_getitems","add_css_views":"add_css_views","add_php_getitems_after_all":"add_php_getitems_after_all","css_views":"css_views","add_php_getlistquery":"add_php_getlistquery","add_javascript_view_file":"add_javascript_view_file","add_php_before_save":"add_php_before_save","javascript_view_file":"javascript_view_file","add_php_save":"add_php_save","add_javascript_view_footer":"add_javascript_view_footer","add_php_postsavehook":"add_php_postsavehook","javascript_view_footer":"javascript_view_footer","add_php_allowedit":"add_php_allowedit","add_javascript_views_file":"add_javascript_views_file","add_php_batchcopy":"add_php_batchcopy","javascript_views_file":"javascript_views_file","add_php_batchmove":"add_php_batchmove","add_javascript_views_footer":"add_javascript_views_footer","add_php_before_publish":"add_php_before_publish","javascript_views_footer":"javascript_views_footer","add_php_after_publish":"add_php_after_publish","add_custom_button":"add_custom_button","add_php_before_delete":"add_php_before_delete","add_php_after_delete":"add_php_after_delete","php_controller":"php_controller","add_php_document":"add_php_document","php_model":"php_model","add_sql":"add_sql","php_controller_list":"php_controller_list","php_model_list":"php_model_list","add_php_ajax":"add_php_ajax","add_custom_import":"add_custom_import","php_ajaxmethod":"php_ajaxmethod","html_import_view":"html_import_view","php_import_setdata":"php_import_setdata","add_php_getitem":"add_php_getitem","php_import_ext":"php_import_ext"}}';
$admin_view->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "null","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","name_single":"name_single","name_list":"name_list","short_description":"short_description","icon":"icon","add_php_document":"add_php_document","icon_category":"icon_category","icon_add":"icon_add","add_php_postsavehook":"add_php_postsavehook","add_custom_import":"add_custom_import","add_php_before_publish":"add_php_before_publish","type":"type","description":"description","add_php_batchcopy":"add_php_batchcopy","add_fadein":"add_fadein","add_php_before_delete":"add_php_before_delete","add_php_getitems_after_all":"add_php_getitems_after_all","php_import_headers":"php_import_headers","add_php_before_save":"add_php_before_save","add_php_getitems":"add_php_getitems","not_required":"not_required","add_php_getlistquery":"add_php_getlistquery","add_php_save":"add_php_save","add_php_allowedit":"add_php_allowedit","add_php_batchmove":"add_php_batchmove","add_php_after_publish":"add_php_after_publish","add_php_after_delete":"add_php_after_delete","add_sql":"add_sql","html_import_view":"html_import_view","php_import_save":"php_import_save","add_css_view":"add_css_view","php_getitem":"php_getitem","css_view":"css_view","php_getitems":"php_getitems","add_css_views":"add_css_views","php_getitems_after_all":"php_getitems_after_all","css_views":"css_views","php_getlistquery":"php_getlistquery","add_javascript_view_file":"add_javascript_view_file","php_before_save":"php_before_save","javascript_view_file":"javascript_view_file","php_save":"php_save","add_javascript_view_footer":"add_javascript_view_footer","php_postsavehook":"php_postsavehook","javascript_view_footer":"javascript_view_footer","php_allowedit":"php_allowedit","add_javascript_views_file":"add_javascript_views_file","php_batchcopy":"php_batchcopy","javascript_views_file":"javascript_views_file","php_batchmove":"php_batchmove","add_javascript_views_footer":"add_javascript_views_footer","php_before_publish":"php_before_publish","javascript_views_footer":"javascript_views_footer","php_after_publish":"php_after_publish","add_custom_button":"add_custom_button","php_before_delete":"php_before_delete","php_after_delete":"php_after_delete","php_controller":"php_controller","php_document":"php_document","php_model":"php_model","source":"source","php_controller_list":"php_controller_list","sql":"sql","php_model_list":"php_model_list","add_php_ajax":"add_php_ajax","php_import_display":"php_import_display","php_ajaxmethod":"php_ajaxmethod","php_import":"php_import","php_import_setdata":"php_import_setdata","add_php_getitem":"add_php_getitem","php_import_ext":"php_import_ext"}}';
$admin_view->router = 'ComponentbuilderHelperRoute::getAdmin_viewRoute';
$admin_view->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_view.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","type","add_fadein","source","not_required","add_css_view","add_php_getitems","add_css_views","add_php_getitems_after_all","add_php_getlistquery","add_javascript_view_file","add_php_before_save","add_php_save","add_javascript_view_footer","add_php_postsavehook","add_php_allowedit","add_javascript_views_file","add_php_batchcopy","add_php_batchmove","add_javascript_views_footer","add_php_before_publish","add_php_after_publish","add_custom_button","add_php_before_delete","add_php_after_delete","add_php_document","add_sql","add_php_ajax","add_custom_import","add_php_getitem"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}';
$admin_view->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_view.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","add_php_document","add_php_postsavehook","add_custom_import","add_php_before_publish","type","add_php_batchcopy","add_fadein","add_php_before_delete","add_php_getitems_after_all","add_php_before_save","add_php_getitems","not_required","add_php_getlistquery","add_php_save","add_php_allowedit","add_php_batchmove","add_php_after_publish","add_php_after_delete","add_sql","add_css_view","add_css_views","add_javascript_view_file","add_javascript_view_footer","add_javascript_views_file","add_javascript_views_footer","add_custom_button","source","add_php_ajax","add_php_getitem"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}';
// Set the object into the content types table.
$admin_view_Inserted = $db->insertObject('#__content_types', $admin_view);
@ -3645,9 +3645,9 @@ class com_componentbuilderInstallerScript
$admin_view->type_title = 'Componentbuilder Admin_view';
$admin_view->type_alias = 'com_componentbuilder.admin_view';
$admin_view->table = '{"special": {"dbtable": "#__componentbuilder_admin_view","key": "id","type": "Admin_view","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
$admin_view->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "null","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","name_single":"name_single","name_list":"name_list","short_description":"short_description","icon":"icon","php_after_delete":"php_after_delete","icon_category":"icon_category","icon_add":"icon_add","php_save":"php_save","php_batchmove":"php_batchmove","type":"type","description":"description","php_allowedit":"php_allowedit","add_fadein":"add_fadein","php_after_publish":"php_after_publish","source":"source","php_getitems":"php_getitems","php_import":"php_import","php_getlistquery":"php_getlistquery","php_getitem":"php_getitem","not_required":"not_required","php_getitems_after_all":"php_getitems_after_all","php_before_save":"php_before_save","php_postsavehook":"php_postsavehook","php_batchcopy":"php_batchcopy","php_before_publish":"php_before_publish","php_before_delete":"php_before_delete","php_document":"php_document","sql":"sql","php_import_display":"php_import_display","php_import_save":"php_import_save","add_css_view":"add_css_view","css_view":"css_view","add_php_getitems":"add_php_getitems","add_css_views":"add_css_views","add_php_getitems_after_all":"add_php_getitems_after_all","css_views":"css_views","add_php_getlistquery":"add_php_getlistquery","add_javascript_view_file":"add_javascript_view_file","add_php_before_save":"add_php_before_save","javascript_view_file":"javascript_view_file","add_php_save":"add_php_save","add_javascript_view_footer":"add_javascript_view_footer","add_php_postsavehook":"add_php_postsavehook","javascript_view_footer":"javascript_view_footer","add_php_allowedit":"add_php_allowedit","add_javascript_views_file":"add_javascript_views_file","add_php_batchcopy":"add_php_batchcopy","javascript_views_file":"javascript_views_file","add_php_batchmove":"add_php_batchmove","add_javascript_views_footer":"add_javascript_views_footer","add_php_before_publish":"add_php_before_publish","javascript_views_footer":"javascript_views_footer","add_php_after_publish":"add_php_after_publish","add_custom_button":"add_custom_button","add_php_before_delete":"add_php_before_delete","add_php_after_delete":"add_php_after_delete","php_controller":"php_controller","add_php_document":"add_php_document","php_model":"php_model","add_sql":"add_sql","php_controller_list":"php_controller_list","php_model_list":"php_model_list","add_php_ajax":"add_php_ajax","add_custom_import":"add_custom_import","php_ajaxmethod":"php_ajaxmethod","html_import_view":"html_import_view","php_import_setdata":"php_import_setdata","add_php_getitem":"add_php_getitem","php_import_ext":"php_import_ext"}}';
$admin_view->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "null","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","name_single":"name_single","name_list":"name_list","short_description":"short_description","icon":"icon","add_php_document":"add_php_document","icon_category":"icon_category","icon_add":"icon_add","add_php_postsavehook":"add_php_postsavehook","add_custom_import":"add_custom_import","add_php_before_publish":"add_php_before_publish","type":"type","description":"description","add_php_batchcopy":"add_php_batchcopy","add_fadein":"add_fadein","add_php_before_delete":"add_php_before_delete","add_php_getitems_after_all":"add_php_getitems_after_all","php_import_headers":"php_import_headers","add_php_before_save":"add_php_before_save","add_php_getitems":"add_php_getitems","not_required":"not_required","add_php_getlistquery":"add_php_getlistquery","add_php_save":"add_php_save","add_php_allowedit":"add_php_allowedit","add_php_batchmove":"add_php_batchmove","add_php_after_publish":"add_php_after_publish","add_php_after_delete":"add_php_after_delete","add_sql":"add_sql","html_import_view":"html_import_view","php_import_save":"php_import_save","add_css_view":"add_css_view","php_getitem":"php_getitem","css_view":"css_view","php_getitems":"php_getitems","add_css_views":"add_css_views","php_getitems_after_all":"php_getitems_after_all","css_views":"css_views","php_getlistquery":"php_getlistquery","add_javascript_view_file":"add_javascript_view_file","php_before_save":"php_before_save","javascript_view_file":"javascript_view_file","php_save":"php_save","add_javascript_view_footer":"add_javascript_view_footer","php_postsavehook":"php_postsavehook","javascript_view_footer":"javascript_view_footer","php_allowedit":"php_allowedit","add_javascript_views_file":"add_javascript_views_file","php_batchcopy":"php_batchcopy","javascript_views_file":"javascript_views_file","php_batchmove":"php_batchmove","add_javascript_views_footer":"add_javascript_views_footer","php_before_publish":"php_before_publish","javascript_views_footer":"javascript_views_footer","php_after_publish":"php_after_publish","add_custom_button":"add_custom_button","php_before_delete":"php_before_delete","php_after_delete":"php_after_delete","php_controller":"php_controller","php_document":"php_document","php_model":"php_model","source":"source","php_controller_list":"php_controller_list","sql":"sql","php_model_list":"php_model_list","add_php_ajax":"add_php_ajax","php_import_display":"php_import_display","php_ajaxmethod":"php_ajaxmethod","php_import":"php_import","php_import_setdata":"php_import_setdata","add_php_getitem":"add_php_getitem","php_import_ext":"php_import_ext"}}';
$admin_view->router = 'ComponentbuilderHelperRoute::getAdmin_viewRoute';
$admin_view->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_view.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","type","add_fadein","source","not_required","add_css_view","add_php_getitems","add_css_views","add_php_getitems_after_all","add_php_getlistquery","add_javascript_view_file","add_php_before_save","add_php_save","add_javascript_view_footer","add_php_postsavehook","add_php_allowedit","add_javascript_views_file","add_php_batchcopy","add_php_batchmove","add_javascript_views_footer","add_php_before_publish","add_php_after_publish","add_custom_button","add_php_before_delete","add_php_after_delete","add_php_document","add_sql","add_php_ajax","add_custom_import","add_php_getitem"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}';
$admin_view->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_view.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","add_php_document","add_php_postsavehook","add_custom_import","add_php_before_publish","type","add_php_batchcopy","add_fadein","add_php_before_delete","add_php_getitems_after_all","add_php_before_save","add_php_getitems","not_required","add_php_getlistquery","add_php_save","add_php_allowedit","add_php_batchmove","add_php_after_publish","add_php_after_delete","add_sql","add_css_view","add_css_views","add_javascript_view_file","add_javascript_view_footer","add_javascript_views_file","add_javascript_views_footer","add_custom_button","source","add_php_ajax","add_php_getitem"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}';
// Check if admin_view type is already in content_type DB.
$admin_view_id = null;
@ -4739,7 +4739,7 @@ class com_componentbuilderInstallerScript
echo '<a target="_blank" href="http://joomlacomponentbuilder.com" title="Component Builder">
<img src="components/com_componentbuilder/assets/images/vdm-component.jpg"/>
</a>
<h3>Upgrade to Version 2.6.11 Was Successful! Let us know if anything is not working as expected.</h3>';
<h3>Upgrade to Version 2.6.12 Was Successful! Let us know if anything is not working as expected.</h3>';
}
}
}

View File

@ -721,677 +721,6 @@ abstract class ComponentbuilderHelper
return false;
}
public static function getImportScripts($type, $fieldName = false)
{
// if field name is pased the convert to type
if ($fieldName)
{
$fieldNames = array(
'php_import_display' => 'display',
'php_import_setdata' => 'setdata',
'php_import_save' => 'save',
'html_import_view' => 'view',
'php_import' => 'import',
'php_import_ext' => 'ext'
);
// first check if the field name is found
if (isset($fieldNames[$type]))
{
$type = $fieldNames[$type];
}
else
{
return '';
}
}
$script = array();
if ('display' === $type)
{
// set the display script
$script['display'][] = "\tprotected \$headerList;";
$script['display'][] = "\tprotected \$hasPackage = false;";
$script['display'][] = "\tprotected \$headers;";
$script['display'][] = "\tprotected \$hasHeader = 0;";
$script['display'][] = "\tprotected \$dataType;";
$script['display'][] = "\n\tpublic function display(\$tpl = null)";
$script['display'][] = "\t{";
$script['display'][] = "\t\tif (\$this->getLayout() !== 'modal')";
$script['display'][] = "\t\t{";
$script['display'][] = "\t\t\t// Include helper submenu";
$script['display'][] = "\t\t\t###-#-#-Component###Helper::addSubmenu('import');";
$script['display'][] = "\t\t}";
$script['display'][] = "\n\t\t\$paths = new stdClass;";
$script['display'][] = "\t\t\$paths->first = '';";
$script['display'][] = "\t\t\$state = \$this->get('state');";
$script['display'][] = "\n\t\t\$this->paths = &\$paths;";
$script['display'][] = "\t\t\$this->state = &\$state;";
$script['display'][] = "\t\t// get global action permissions";
$script['display'][] = "\t\t\$this->canDo = ###-#-#-Component###Helper::getActions('import');";
$script['display'][] = "\n\t\t// We don't need toolbar in the modal window.";
$script['display'][] = "\t\tif (\$this->getLayout() !== 'modal')";
$script['display'][] = "\t\t{";
$script['display'][] = "\t\t\t\$this->addToolbar();";
$script['display'][] = "\t\t\t\$this->sidebar = JHtmlSidebar::render();";
$script['display'][] = "\t\t}";
$script['display'][] = "\n\t\t// get the session object";
$script['display'][] = "\t\t\$session = JFactory::getSession();";
$script['display'][] = "\t\t// check if it has package";
$script['display'][] = "\t\t\$this->hasPackage \t= \$session->get('hasPackage', false);";
$script['display'][] = "\t\t\$this->dataType \t= \$session->get('dataType', false);";
$script['display'][] = "\t\tif(\$this->hasPackage && \$this->dataType)";
$script['display'][] = "\t\t{";
$script['display'][] = "\t\t\t\$this->headerList \t= json_decode(\$session->get(\$this->dataType.'_VDM_IMPORTHEADERS', false),true);";
$script['display'][] = "\t\t\t\$this->headers \t\t= ###-#-#-Component###Helper::getFileHeaders(\$this->dataType);";
$script['display'][] = "\t\t\t// clear the data type";
$script['display'][] = "\t\t\t\$session->clear('dataType');";
$script['display'][] = "\t\t}";
$script['display'][] = "\n\t\t// Check for errors.";
$script['display'][] = "\t\tif (count(\$errors = \$this->get('Errors'))){";
$script['display'][] = "\t\t\tthrow new Exception(implode(".'"\n", $errors), 500);';
$script['display'][] = "\t\t}";
$script['display'][] = "\n\t\t// Display the template";
$script['display'][] = "\t\tparent::display(\$tpl);";
$script['display'][] = "\t}";
}
elseif ('setdata' === $type)
{
// set the setdata script
$script['setdata'] = array();
$script['setdata'][] = "\t/**";
$script['setdata'][] = "\t* Set the data from the spreadsheet to the database";
$script['setdata'][] = "\t*";
$script['setdata'][] = "\t* @param string \$package Paths to the uploaded package file";
$script['setdata'][] = "\t*";
$script['setdata'][] = "\t* @return boolean false on failure";
$script['setdata'][] = "\t*";
$script['setdata'][] = "\t**/";
$script['setdata'][] = "\tprotected function setData(\$package,\$table,\$target_headers)";
$script['setdata'][] = "\t{";
$script['setdata'][] = "\t\tif (###-#-#-Component###Helper::checkArray(\$target_headers))";
$script['setdata'][] = "\t\t{";
$script['setdata'][] = "\t\t\t// make sure the file is loaded\t\t";
$script['setdata'][] = "\t\t\tJLoader::import('PHPExcel', JPATH_COMPONENT_ADMINISTRATOR . '/helpers');";
$script['setdata'][] = "\t\t\t\$jinput = JFactory::getApplication()->input;";
$script['setdata'][] = "\t\t\tforeach(\$target_headers as \$header)";
$script['setdata'][] = "\t\t\t{";
$script['setdata'][] = "\t\t\t\t\$data['target_headers'][\$header] = \$jinput->getString(\$header, null);";
$script['setdata'][] = "\t\t\t}";
$script['setdata'][] = "\t\t\t// set the data";
$script['setdata'][] = "\t\t\tif(isset(\$package['dir']))";
$script['setdata'][] = "\t\t\t{";
$script['setdata'][] = "\t\t\t\t\$inputFileType = PHPExcel_IOFactory::identify(\$package['dir']);";
$script['setdata'][] = "\t\t\t\t\$excelReader = PHPExcel_IOFactory::createReader(\$inputFileType);";
$script['setdata'][] = "\t\t\t\t\$excelReader->setReadDataOnly(true);";
$script['setdata'][] = "\t\t\t\t\$excelObj = \$excelReader->load(\$package['dir']);";
$script['setdata'][] = "\t\t\t\t\$data['array'] = \$excelObj->getActiveSheet()->toArray(null, true,true,true);";
$script['setdata'][] = "\t\t\t\t\$excelObj->disconnectWorksheets();";
$script['setdata'][] = "\t\t\t\tunset(\$excelObj);";
$script['setdata'][] = "\t\t\t\treturn \$this->save(\$data,\$table);";
$script['setdata'][] = "\t\t\t}";
$script['setdata'][] = "\t\t}";
$script['setdata'][] = "\t\treturn false;";
$script['setdata'][] = "\t}";
}
elseif ('save' === $type)
{
$script['save'] = array();
$script['save'][] = "\t/**";
$script['save'][] = "\t* Save the data from the file to the database";
$script['save'][] = "\t*";
$script['save'][] = "\t* @param string \$package Paths to the uploaded package file";
$script['save'][] = "\t*";
$script['save'][] = "\t* @return boolean false on failure";
$script['save'][] = "\t*";
$script['save'][] = "\t**/";
$script['save'][] = "\tprotected function save(\$data,\$table)";
$script['save'][] = "\t{";
$script['save'][] = "\t\t// import the data if there is any";
$script['save'][] = "\t\tif(###-#-#-Component###Helper::checkArray(\$data['array']))";
$script['save'][] = "\t\t{";
$script['save'][] = "\t\t\t// get user object";
$script['save'][] = "\t\t\t\$user \t\t= JFactory::getUser();";
$script['save'][] = "\t\t\t// remove header if it has headers";
$script['save'][] = "\t\t\t\$id_key \t= \$data['target_headers']['id'];";
$script['save'][] = "\t\t\t\$published_key \t= \$data['target_headers']['published'];";
$script['save'][] = "\t\t\t\$ordering_key \t= \$data['target_headers']['ordering'];";
$script['save'][] = "\t\t\t// get the first array set";
$script['save'][] = "\t\t\t\$firstSet = reset(\$data['array']);";
$script['save'][] = "";
$script['save'][] = "\t\t\t// check if first array is a header array and remove if true";
$script['save'][] = "\t\t\tif(\$firstSet[\$id_key] == 'id' || \$firstSet[\$published_key] == 'published' || \$firstSet[\$ordering_key] == 'ordering')";
$script['save'][] = "\t\t\t{";
$script['save'][] = "\t\t\t\tarray_shift(\$data['array']);";
$script['save'][] = "\t\t\t}";
$script['save'][] = "\t\t\t";
$script['save'][] = "\t\t\t// make sure there is still values in array and that it was not only headers";
$script['save'][] = "\t\t\tif(###-#-#-Component###Helper::checkArray(\$data['array']) && \$user->authorise(\$table.'.import', 'com_###-#-#-component###') && \$user->authorise('core.import', 'com_###-#-#-component###'))";
$script['save'][] = "\t\t\t{";
$script['save'][] = "\t\t\t\t// set target.";
$script['save'][] = "\t\t\t\t\$target\t= array_flip(\$data['target_headers']);";
$script['save'][] = "\t\t\t\t// Get a db connection.";
$script['save'][] = "\t\t\t\t\$db = JFactory::getDbo();";
$script['save'][] = "\t\t\t\t// set some defaults";
$script['save'][] = "\t\t\t\t\$todayDate\t\t= JFactory::getDate()->toSql();";
$script['save'][] = "\t\t\t\t// get global action permissions";
$script['save'][] = "\t\t\t\t\$canDo\t\t\t= ###-#-#-Component###Helper::getActions(\$table);";
$script['save'][] = "\t\t\t\t\$canEdit\t\t= \$canDo->get('core.edit');";
$script['save'][] = "\t\t\t\t\$canState\t\t= \$canDo->get('core.edit.state');";
$script['save'][] = "\t\t\t\t\$canCreate\t\t= \$canDo->get('core.create');";
$script['save'][] = "\t\t\t\t\$hasAlias\t\t= \$this->getAliasesUsed(\$table);";
$script['save'][] = "\t\t\t\t// prosses the data";
$script['save'][] = "\t\t\t\tforeach(\$data['array'] as \$row)";
$script['save'][] = "\t\t\t\t{";
$script['save'][] = "\t\t\t\t\t\$found = false;";
$script['save'][] = "\t\t\t\t\tif (isset(\$row[\$id_key]) && is_numeric(\$row[\$id_key]) && \$row[\$id_key] > 0)";
$script['save'][] = "\t\t\t\t\t{";
$script['save'][] = "\t\t\t\t\t\t// raw items import & update!";
$script['save'][] = "\t\t\t\t\t\t\$query = \$db->getQuery(true);";
$script['save'][] = "\t\t\t\t\t\t\$query";
$script['save'][] = "\t\t\t\t\t\t\t->select('version')";
$script['save'][] = "\t\t\t\t\t\t\t->from(\$db->quoteName('#__###-#-#-component###_'.\$table))";
$script['save'][] = "\t\t\t\t\t\t\t->where(\$db->quoteName('id') . ' = '. \$db->quote(\$row[\$id_key]));";
$script['save'][] = "\t\t\t\t\t\t// Reset the query using our newly populated query object.";
$script['save'][] = "\t\t\t\t\t\t\$db->setQuery(\$query);";
$script['save'][] = "\t\t\t\t\t\t\$db->execute();";
$script['save'][] = "\t\t\t\t\t\t\$found = \$db->getNumRows();";
$script['save'][] = "\t\t\t\t\t}";
$script['save'][] = "\t\t\t\t\t";
$script['save'][] = "\t\t\t\t\tif(\$found && \$canEdit)";
$script['save'][] = "\t\t\t\t\t{";
$script['save'][] = "\t\t\t\t\t\t// update item";
$script['save'][] = "\t\t\t\t\t\t\$id \t\t= \$row[\$id_key];";
$script['save'][] = "\t\t\t\t\t\t\$version\t= \$db->loadResult();";
$script['save'][] = "\t\t\t\t\t\t// reset all buckets";
$script['save'][] = "\t\t\t\t\t\t\$query \t\t= \$db->getQuery(true);";
$script['save'][] = "\t\t\t\t\t\t\$fields \t= array();";
$script['save'][] = "\t\t\t\t\t\t// Fields to update.";
$script['save'][] = "\t\t\t\t\t\tforeach(\$row as \$key => \$cell)";
$script['save'][] = "\t\t\t\t\t\t{";
$script['save'][] = "\t\t\t\t\t\t\t// ignore column";
$script['save'][] = "\t\t\t\t\t\t\tif ('IGNORE' == \$target[\$key])";
$script['save'][] = "\t\t\t\t\t\t\t{";
$script['save'][] = "\t\t\t\t\t\t\t\tcontinue;";
$script['save'][] = "\t\t\t\t\t\t\t}";
$script['save'][] = "\t\t\t\t\t\t\t// update modified";
$script['save'][] = "\t\t\t\t\t\t\tif ('modified_by' == \$target[\$key])";
$script['save'][] = "\t\t\t\t\t\t\t{";
$script['save'][] = "\t\t\t\t\t\t\t\tcontinue;";
$script['save'][] = "\t\t\t\t\t\t\t}";
$script['save'][] = "\t\t\t\t\t\t\t// update modified";
$script['save'][] = "\t\t\t\t\t\t\tif ('modified' == \$target[\$key])";
$script['save'][] = "\t\t\t\t\t\t\t{";
$script['save'][] = "\t\t\t\t\t\t\t\tcontinue;";
$script['save'][] = "\t\t\t\t\t\t\t}";
$script['save'][] = "\t\t\t\t\t\t\t// update version";
$script['save'][] = "\t\t\t\t\t\t\tif ('version' == \$target[\$key])";
$script['save'][] = "\t\t\t\t\t\t\t{";
$script['save'][] = "\t\t\t\t\t\t\t\t\$cell = (int) \$version + 1;";
$script['save'][] = "\t\t\t\t\t\t\t}";
$script['save'][] = "\t\t\t\t\t\t\t// verify publish authority";
$script['save'][] = "\t\t\t\t\t\t\tif ('published' == \$target[\$key] && !\$canState)";
$script['save'][] = "\t\t\t\t\t\t\t{";
$script['save'][] = "\t\t\t\t\t\t\t\tcontinue;";
$script['save'][] = "\t\t\t\t\t\t\t}";
$script['save'][] = "\t\t\t\t\t\t\t// set to update array";
$script['save'][] = "\t\t\t\t\t\t\tif(in_array(\$key, \$data['target_headers']) && is_numeric(\$cell))";
$script['save'][] = "\t\t\t\t\t\t\t{";
$script['save'][] = "\t\t\t\t\t\t\t\t\$fields[] = \$db->quoteName(\$target[\$key]) . ' = ' . \$cell;";
$script['save'][] = "\t\t\t\t\t\t\t}";
$script['save'][] = "\t\t\t\t\t\t\telseif(in_array(\$key, \$data['target_headers']) && is_string(\$cell))";
$script['save'][] = "\t\t\t\t\t\t\t{";
$script['save'][] = "\t\t\t\t\t\t\t\t\$fields[] = \$db->quoteName(\$target[\$key]) . ' = ' . \$db->quote(\$cell);";
$script['save'][] = "\t\t\t\t\t\t\t}";
$script['save'][] = "\t\t\t\t\t\t\telseif(in_array(\$key, \$data['target_headers']) && is_null(\$cell))";
$script['save'][] = "\t\t\t\t\t\t\t{";
$script['save'][] = "\t\t\t\t\t\t\t\t// if import data is null then set empty";
$script['save'][] = "\t\t\t\t\t\t\t\t\$fields[] = \$db->quoteName(\$target[\$key]) . \" = ''\";";
$script['save'][] = "\t\t\t\t\t\t\t}";
$script['save'][] = "\t\t\t\t\t\t}";
$script['save'][] = "\t\t\t\t\t\t// load the defaults";
$script['save'][] = "\t\t\t\t\t\t\$fields[]\t= \$db->quoteName('modified_by') . ' = ' . \$db->quote(\$user->id);";
$script['save'][] = "\t\t\t\t\t\t\$fields[]\t= \$db->quoteName('modified') . ' = ' . \$db->quote(\$todayDate);";
$script['save'][] = "\t\t\t\t\t\t// Conditions for which records should be updated.";
$script['save'][] = "\t\t\t\t\t\t\$conditions = array(";
$script['save'][] = "\t\t\t\t\t\t\t\$db->quoteName('id') . ' = ' . \$id";
$script['save'][] = "\t\t\t\t\t\t);";
$script['save'][] = "\t\t\t\t\t\t";
$script['save'][] = "\t\t\t\t\t\t\$query->update(\$db->quoteName('#__###-#-#-component###_'.\$table))->set(\$fields)->where(\$conditions);";
$script['save'][] = "\t\t\t\t\t\t\$db->setQuery(\$query);";
$script['save'][] = "\t\t\t\t\t\t\$db->execute();";
$script['save'][] = "\t\t\t\t\t}";
$script['save'][] = "\t\t\t\t\telseif (\$canCreate)";
$script['save'][] = "\t\t\t\t\t{";
$script['save'][] = "\t\t\t\t\t\t// insert item";
$script['save'][] = "\t\t\t\t\t\t\$query = \$db->getQuery(true);";
$script['save'][] = "\t\t\t\t\t\t// reset all buckets";
$script['save'][] = "\t\t\t\t\t\t\$columns \t= array();";
$script['save'][] = "\t\t\t\t\t\t\$values \t= array();";
$script['save'][] = "\t\t\t\t\t\t\$version\t= false;";
$script['save'][] = "\t\t\t\t\t\t// Insert columns. Insert values.";
$script['save'][] = "\t\t\t\t\t\tforeach(\$row as \$key => \$cell)";
$script['save'][] = "\t\t\t\t\t\t{";
$script['save'][] = "\t\t\t\t\t\t\t// ignore column";
$script['save'][] = "\t\t\t\t\t\t\tif ('IGNORE' == \$target[\$key])";
$script['save'][] = "\t\t\t\t\t\t\t{";
$script['save'][] = "\t\t\t\t\t\t\t\tcontinue;";
$script['save'][] = "\t\t\t\t\t\t\t}";
$script['save'][] = "\t\t\t\t\t\t\t// remove id";
$script['save'][] = "\t\t\t\t\t\t\tif ('id' == \$target[\$key])";
$script['save'][] = "\t\t\t\t\t\t\t{";
$script['save'][] = "\t\t\t\t\t\t\t\tcontinue;";
$script['save'][] = "\t\t\t\t\t\t\t}";
$script['save'][] = "\t\t\t\t\t\t\t// update created";
$script['save'][] = "\t\t\t\t\t\t\tif ('created_by' == \$target[\$key])";
$script['save'][] = "\t\t\t\t\t\t\t{";
$script['save'][] = "\t\t\t\t\t\t\t\tcontinue;";
$script['save'][] = "\t\t\t\t\t\t\t}";
$script['save'][] = "\t\t\t\t\t\t\t// update created";
$script['save'][] = "\t\t\t\t\t\t\tif ('created' == \$target[\$key])";
$script['save'][] = "\t\t\t\t\t\t\t{";
$script['save'][] = "\t\t\t\t\t\t\t\tcontinue;";
$script['save'][] = "\t\t\t\t\t\t\t}";
$script['save'][] = "\t\t\t\t\t\t\t// Make sure the alias is incremented";
$script['save'][] = "\t\t\t\t\t\t\tif ('alias' == \$target[\$key])";
$script['save'][] = "\t\t\t\t\t\t\t{";
$script['save'][] = "\t\t\t\t\t\t\t\t\$cell = \$this->getAlias(\$cell,\$table);";
$script['save'][] = "\t\t\t\t\t\t\t}";
$script['save'][] = "\t\t\t\t\t\t\t// update version";
$script['save'][] = "\t\t\t\t\t\t\tif ('version' == \$target[\$key])";
$script['save'][] = "\t\t\t\t\t\t\t{";
$script['save'][] = "\t\t\t\t\t\t\t\t\$cell = 1;";
$script['save'][] = "\t\t\t\t\t\t\t\t\$version = true;";
$script['save'][] = "\t\t\t\t\t\t\t}";
$script['save'][] = "\t\t\t\t\t\t\t// set to insert array";
$script['save'][] = "\t\t\t\t\t\t\tif(in_array(\$key, \$data['target_headers']) && is_numeric(\$cell))";
$script['save'][] = "\t\t\t\t\t\t\t{";
$script['save'][] = "\t\t\t\t\t\t\t\t\$columns[] \t= \$target[\$key];";
$script['save'][] = "\t\t\t\t\t\t\t\t\$values[] \t= \$cell;";
$script['save'][] = "\t\t\t\t\t\t\t}";
$script['save'][] = "\t\t\t\t\t\t\telseif(in_array(\$key, \$data['target_headers']) && is_string(\$cell))";
$script['save'][] = "\t\t\t\t\t\t\t{";
$script['save'][] = "\t\t\t\t\t\t\t\t\$columns[] \t= \$target[\$key];";
$script['save'][] = "\t\t\t\t\t\t\t\t\$values[] \t= \$db->quote(\$cell);";
$script['save'][] = "\t\t\t\t\t\t\t}";
$script['save'][] = "\t\t\t\t\t\t\telseif(in_array(\$key, \$data['target_headers']) && is_null(\$cell))";
$script['save'][] = "\t\t\t\t\t\t\t{";
$script['save'][] = "\t\t\t\t\t\t\t\t// if import data is null then set empty";
$script['save'][] = "\t\t\t\t\t\t\t\t\$columns[] \t= \$target[\$key];";
$script['save'][] = "\t\t\t\t\t\t\t\t\$values[] \t= \"''\";";
$script['save'][] = "\t\t\t\t\t\t\t}";
$script['save'][] = "\t\t\t\t\t\t}";
$script['save'][] = "\t\t\t\t\t\t// load the defaults";
$script['save'][] = "\t\t\t\t\t\t\$columns[] \t= 'created_by';";
$script['save'][] = "\t\t\t\t\t\t\$values[] \t= \$db->quote(\$user->id);";
$script['save'][] = "\t\t\t\t\t\t\$columns[] \t= 'created';";
$script['save'][] = "\t\t\t\t\t\t\$values[] \t= \$db->quote(\$todayDate);";
$script['save'][] = "\t\t\t\t\t\tif (!\$version)";
$script['save'][] = "\t\t\t\t\t\t{";
$script['save'][] = "\t\t\t\t\t\t\t\$columns[] \t= 'version';";
$script['save'][] = "\t\t\t\t\t\t\t\$values[] \t= 1;";
$script['save'][] = "\t\t\t\t\t\t}";
$script['save'][] = "\t\t\t\t\t\t// Prepare the insert query.";
$script['save'][] = "\t\t\t\t\t\t\$query";
$script['save'][] = "\t\t\t\t\t\t\t->insert(\$db->quoteName('#__###-#-#-component###_'.\$table))";
$script['save'][] = "\t\t\t\t\t\t\t->columns(\$db->quoteName(\$columns))";
$script['save'][] = "\t\t\t\t\t\t\t->values(implode(',', \$values));";
$script['save'][] = "\t\t\t\t\t\t// Set the query using our newly populated query object and execute it.";
$script['save'][] = "\t\t\t\t\t\t\$db->setQuery(\$query);";
$script['save'][] = "\t\t\t\t\t\t\$done = \$db->execute();";
$script['save'][] = "\t\t\t\t\t\tif (\$done)";
$script['save'][] = "\t\t\t\t\t\t{";
$script['save'][] = "\t\t\t\t\t\t\t\$aId = \$db->insertid();";
$script['save'][] = "\t\t\t\t\t\t\t// make sure the access of asset is set";
$script['save'][] = "\t\t\t\t\t\t\t###-#-#-Component###Helper::setAsset(\$aId,\$table);";
$script['save'][] = "\t\t\t\t\t\t}";
$script['save'][] = "\t\t\t\t\t}";
$script['save'][] = "\t\t\t\t\telse";
$script['save'][] = "\t\t\t\t\t{";
$script['save'][] = "\t\t\t\t\t\treturn false;";
$script['save'][] = "\t\t\t\t\t}";
$script['save'][] = "\t\t\t\t}";
$script['save'][] = "\t\t\t\treturn true;";
$script['save'][] = "\t\t\t}";
$script['save'][] = "\t\t}";
$script['save'][] = "\t\treturn false;";
$script['save'][] = "\t}";
}
elseif ('view' === $type)
{
$script['view'] = array();
$script['view'][] = "<script type=\"text/javascript\">";
$script['view'][] = "<?php if (\$this->hasPackage && ###-#-#-Component###Helper::checkArray(\$this->headerList)) : ?>";
$script['view'][] = "\tJoomla.continueImport = function()";
$script['view'][] = "\t{";
$script['view'][] = "\t\tvar form = document.getElementById('adminForm');";
$script['view'][] = "\t\tvar error = false;";
$script['view'][] = "\t\tvar therequired = [<?php \$i = 0; foreach(\$this->headerList as \$name => \$title) { echo (\$i != 0)? ', \"vdm_'.\$name.'\"':'\"vdm_'.\$name.'\"'; \$i++; } ?>];";
$script['view'][] = "\t\tfor(i = 0; i < therequired.length; i++)";
$script['view'][] = "\t\t{";
$script['view'][] = "\t\t\tif(jQuery('#'+therequired[i]).val() == \"\" )";
$script['view'][] = "\t\t\t{";
$script['view'][] = "\t\t\t\terror = true;";
$script['view'][] = "\t\t\t\tbreak;";
$script['view'][] = "\t\t\t}";
$script['view'][] = "\t\t}";
$script['view'][] = "\t\t// do field validation";
$script['view'][] = "\t\tif (error)";
$script['view'][] = "\t\t{";
$script['view'][] = "\t\t\talert(\"<?php echo JTe-#-#-xt::_('COM_###-#-#-COMPONENT###_IMPORT_MSG_PLEASE_SELECT_ALL_COLUMNS', true); ?>\");";
$script['view'][] = "\t\t}";
$script['view'][] = "\t\telse";
$script['view'][] = "\t\t{";
$script['view'][] = "\t\t\tjQuery('#loading').css('display', 'block');";
$script['view'][] = "";
$script['view'][] = "\n\t\t\tform.gettype.value = 'continue';";
$script['view'][] = "\t\t\tform.submit();";
$script['view'][] = "\t\t}";
$script['view'][] = "\t};";
$script['view'][] = "<?php else: ?>";
$script['view'][] = "\tJoomla.submitbutton = function()";
$script['view'][] = "\t{";
$script['view'][] = "\t\tvar form = document.getElementById('adminForm');";
$script['view'][] = "";
$script['view'][] = "\n\t\t// do field validation";
$script['view'][] = "\t\tif (form.import_package.value == \"\")";
$script['view'][] = "\t\t{";
$script['view'][] = "\t\t\talert(\"<?php echo JTe-#-#-xt::_('COM_###-#-#-COMPONENT###_IMPORT_MSG_PLEASE_SELECT_A_FILE', true); ?>\");";
$script['view'][] = "\t\t}";
$script['view'][] = "\t\telse";
$script['view'][] = "\t\t{";
$script['view'][] = "\t\t\tjQuery('#loading').css('display', 'block');";
$script['view'][] = "";
$script['view'][] = "\n\t\t\tform.gettype.value = 'upload';";
$script['view'][] = "\t\t\tform.submit();";
$script['view'][] = "\t\t}";
$script['view'][] = "\t};";
$script['view'][] = "";
$script['view'][] = "\n\tJoomla.submitbutton3 = function()";
$script['view'][] = "\t{";
$script['view'][] = "\t\tvar form = document.getElementById('adminForm');";
$script['view'][] = "";
$script['view'][] = "\n\t\t// do field validation";
$script['view'][] = "\t\tif (form.import_directory.value == \"\"){";
$script['view'][] = "\t\t\talert(\"<?php echo JTe-#-#-xt::_('COM_###-#-#-COMPONENT###_IMPORT_MSG_PLEASE_SELECT_A_DIRECTORY', true); ?>\");";
$script['view'][] = "\t\t}";
$script['view'][] = "\t\telse";
$script['view'][] = "\t\t{";
$script['view'][] = "\t\t\tjQuery('#loading').css('display', 'block');";
$script['view'][] = "";
$script['view'][] = "\n\t\t\tform.gettype.value = 'folder';";
$script['view'][] = "\t\t\tform.submit();";
$script['view'][] = "\t\t}";
$script['view'][] = "\t};";
$script['view'][] = "";
$script['view'][] = "\n\tJoomla.submitbutton4 = function()";
$script['view'][] = "\t{";
$script['view'][] = "\t\tvar form = document.getElementById('adminForm');";
$script['view'][] = "";
$script['view'][] = "\n\t\t// do field validation";
$script['view'][] = "\t\tif (form.import_url.value == \"\" || form.import_url.value == \"http://\")";
$script['view'][] = "\t\t{";
$script['view'][] = "\t\t\talert(\"<?php echo JTe-#-#-xt::_('COM_###-#-#-COMPONENT###_IMPORT_MSG_ENTER_A_URL', true); ?>\");";
$script['view'][] = "\t\t}";
$script['view'][] = "\t\telse";
$script['view'][] = "\t\t{";
$script['view'][] = "\t\t\tjQuery('#loading').css('display', 'block');";
$script['view'][] = "";
$script['view'][] = "\n\t\t\tform.gettype.value = 'url';";
$script['view'][] = "\t\t\tform.submit();";
$script['view'][] = "\t\t}";
$script['view'][] = "\t};";
$script['view'][] = "<?php endif; ?>";
$script['view'][] = "";
$script['view'][] = "\n// Add spindle-wheel for importations:";
$script['view'][] = "jQuery(document).ready(function(\$) {";
$script['view'][] = "\tvar outerDiv = \$('body');";
$script['view'][] = "";
$script['view'][] = "\n\t\$('<div id=\"loading\"></div>')";
$script['view'][] = "\t\t.css(\"background\", \"rgba(255, 255, 255, .8) url('components/com_###-#-#-component###/assets/images/import.gif') 50% 15% no-repeat\")";
$script['view'][] = "\t\t.css(\"top\", outerDiv.position().top - \$(window).scrollTop())";
$script['view'][] = "\t\t.css(\"left\", outerDiv.position().left - \$(window).scrollLeft())";
$script['view'][] = "\t\t.css(\"width\", outerDiv.width())";
$script['view'][] = "\t\t.css(\"height\", outerDiv.height())";
$script['view'][] = "\t\t.css(\"position\", \"fixed\")";
$script['view'][] = "\t\t.css(\"opacity\", \"0.80\")";
$script['view'][] = "\t\t.css(\"-ms-filter\", \"progid:DXImageTransform.Microsoft.Alpha(Opacity = 80)\")";
$script['view'][] = "\t\t.css(\"filter\", \"alpha(opacity = 80)\")";
$script['view'][] = "\t\t.css(\"display\", \"none\")";
$script['view'][] = "\t\t.appendTo(outerDiv);";
$script['view'][] = "});";
$script['view'][] = "";
$script['view'][] = "\n</script>";
$script['view'][] = "";
$script['view'][] = "\n<div id=\"installer-import\" class=\"clearfix\">";
$script['view'][] = "<form enctype=\"multipart/form-data\" action=\"<?php echo JRoute::_('index.php?option=com_###-#-#-component###&view=import_###-#-#-views###');?>\" method=\"post\" name=\"adminForm\" id=\"adminForm\" class=\"form-horizontal form-validate\">";
$script['view'][] = "";
$script['view'][] = "\n\t<?php if (!empty( \$this->sidebar)) : ?>";
$script['view'][] = "\t\t<div id=\"j-sidebar-container\" class=\"span2\">";
$script['view'][] = "\t\t\t<?php echo \$this->sidebar; ?>";
$script['view'][] = "\t\t</div>";
$script['view'][] = "\t\t<div id=\"j-main-container\" class=\"span10\">";
$script['view'][] = "\t<?php else : ?>";
$script['view'][] = "\t\t<div id=\"j-main-container\">";
$script['view'][] = "\t<?php endif;?>";
$script['view'][] = "";
$script['view'][] = "\n\t<?php if (\$this->hasPackage && ###-#-#-Component###Helper::checkArray(\$this->headerList) && ###-#-#-Component###Helper::checkArray(\$this->headers)) : ?>";
$script['view'][] = "\t\t<fieldset class=\"uploadform\">";
$script['view'][] = "\t\t\t<legend><?php echo JTe-#-#-xt::_('COM_###-#-#-COMPONENT###_IMPORT_LINK_FILE_TO_TABLE_COLUMNS'); ?></legend>";
$script['view'][] = "\t\t\t<div class=\"control-group\">";
$script['view'][] = "\t\t\t\t<label class=\"control-label\" ><h4><?php echo JTe-#-#-xt::_('COM_###-#-#-COMPONENT###_IMPORT_TABLE_COLUMNS'); ?></h4></label>";
$script['view'][] = "\t\t\t\t<div class=\"controls\">";
$script['view'][] = "\t\t\t\t\t<label class=\"control-label\" ><h4><?php echo JTe-#-#-xt::_('COM_###-#-#-COMPONENT###_IMPORT_FILE_COLUMNS'); ?></h4></label>";
$script['view'][] = "\t\t\t\t</div>";
$script['view'][] = "\t\t\t</div>";
$script['view'][] = "\t\t\t<?php foreach(\$this->headerList as \$name => \$title): ?>";
$script['view'][] = "\t\t\t\t<div class=\"control-group\">";
$script['view'][] = "\t\t\t\t\t<label for=\"<?php echo \$name; ?>\" class=\"control-label\" ><?php echo \$title; ?></label>";
$script['view'][] = "\t\t\t\t\t<div class=\"controls\">";
$script['view'][] = "\t\t\t\t\t\t<select name=\"<?php echo \$name; ?>\" id=\"vdm_<?php echo \$name; ?>\" required class=\"required input_box\" >";
$script['view'][] = "\t\t\t\t\t\t\t<option value=\"\"><?php echo JTe-#-#-xt::_('COM_###-#-#-COMPONENT###_IMPORT_PLEASE_SELECT_COLUMN'); ?></option>";
$script['view'][] = "\t\t\t\t\t\t\t<option value=\"IGNORE\"><?php echo JTe-#-#-xt::_('COM_###-#-#-COMPONENT###_IMPORT_IGNORE_COLUMN'); ?></option>";
$script['view'][] = "\t\t\t\t\t\t\t<?php foreach(\$this->headers as \$value => \$option): ?>";
$script['view'][] = "\t\t\t\t\t\t\t\t<?php \$selected = (strtolower(\$option) == strtolower (\$title) || strtolower(\$option) == strtolower(\$name))? 'selected=\"selected\"':''; ?>";
$script['view'][] = "\t\t\t\t\t\t\t\t<option value=\"<?php echo ###-#-#-Component###Helper::htmlEscape(\$value); ?>\" class=\"required\" <?php echo \$selected ?>><?php echo ###-#-#-Component###Helper::htmlEscape(\$option); ?></option>";
$script['view'][] = "\t\t\t\t\t\t\t<?php endforeach; ?>";
$script['view'][] = "\t\t\t\t\t\t</select>";
$script['view'][] = "\t\t\t\t\t</div>";
$script['view'][] = "\t\t\t\t</div>";
$script['view'][] = "\t\t\t<?php endforeach; ?>";
$script['view'][] = "\t\t\t<div class=\"form-actions\">";
$script['view'][] = "\t\t\t\t<input class=\"btn btn-primary\" type=\"button\" value=\"<?php echo JTe-#-#-xt::_('COM_###-#-#-COMPONENT###_IMPORT_CONTINUE'); ?>\" onclick=\"Joomla.continueImport()\" />";
$script['view'][] = "\t\t\t</div>";
$script['view'][] = "\t\t</fieldset>";
$script['view'][] = "\t\t<input type=\"hidden\" name=\"gettype\" value=\"continue\" />";
$script['view'][] = "\t<?php else: ?>";
$script['view'][] = "\t\t<?php echo JHtml::_('bootstrap.startTabSet', 'myTab', array('active' => 'upload')); ?>";
$script['view'][] = "\t\t";
$script['view'][] = "\t\t<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'upload', JTe-#-#-xt::_('COM_###-#-#-COMPONENT###_IMPORT_FROM_UPLOAD', true)); ?>";
$script['view'][] = "\t\t\t<fieldset class=\"uploadform\">";
$script['view'][] = "\t\t\t\t<legend><?php echo JTe-#-#-xt::_('COM_###-#-#-COMPONENT###_IMPORT_UPDATE_DATA'); ?></legend>";
$script['view'][] = "\t\t\t\t<div class=\"control-group\">";
$script['view'][] = "\t\t\t\t\t<label for=\"import_package\" class=\"control-label\"><?php echo JTe-#-#-xt::_('COM_###-#-#-COMPONENT###_IMPORT_SELECT_FILE'); ?></label>";
$script['view'][] = "\t\t\t\t\t<div class=\"controls\">";
$script['view'][] = "\t\t\t\t\t\t<input class=\"input_box\" id=\"import_package\" name=\"import_package\" type=\"file\" size=\"57\" />";
$script['view'][] = "\t\t\t\t\t</div>";
$script['view'][] = "\t\t\t\t</div>";
$script['view'][] = "\t\t\t\t<div class=\"form-actions\">";
$script['view'][] = "\t\t\t\t\t<input class=\"btn btn-primary\" type=\"button\" value=\"<?php echo JTe-#-#-xt::_('COM_###-#-#-COMPONENT###_IMPORT_UPLOAD_BOTTON'); ?>\" onclick=\"Joomla.submitbutton()\" />&nbsp;&nbsp;&nbsp;<small><?php echo JTe-#-#-xt::_('COM_###-#-#-COMPONENT###_IMPORT_FORMATS_ACCEPTED'); ?> (.csv .xls .ods)</small>";
$script['view'][] = "\t\t\t\t</div>";
$script['view'][] = "\t\t\t</fieldset>";
$script['view'][] = "\t\t<?php echo JHtml::_('bootstrap.endTab'); ?>";
$script['view'][] = "\t\t";
$script['view'][] = "\t\t<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'directory', JTe-#-#-xt::_('COM_###-#-#-COMPONENT###_IMPORT_FROM_DIRECTORY', true)); ?>";
$script['view'][] = "\t\t\t<fieldset class=\"uploadform\">";
$script['view'][] = "\t\t\t\t<legend><?php echo JTe-#-#-xt::_('COM_###-#-#-COMPONENT###_IMPORT_UPDATE_DATA'); ?></legend>";
$script['view'][] = "\t\t\t\t<div class=\"control-group\">";
$script['view'][] = "\t\t\t\t\t<label for=\"import_directory\" class=\"control-label\"><?php echo JTe-#-#-xt::_('COM_###-#-#-COMPONENT###_IMPORT_SELECT_FILE_DIRECTORY'); ?></label>";
$script['view'][] = "\t\t\t\t\t<div class=\"controls\">";
$script['view'][] = "\t\t\t\t\t\t<input type=\"text\" id=\"import_directory\" name=\"import_directory\" class=\"span5 input_box\" size=\"70\" value=\"<?php echo \$this->state->get('import.directory'); ?>\" />";
$script['view'][] = "\t\t\t\t\t</div>";
$script['view'][] = "\t\t\t\t</div>";
$script['view'][] = "\t\t\t\t<div class=\"form-actions\">";
$script['view'][] = "\t\t\t\t\t<input type=\"button\" class=\"btn btn-primary\" value=\"<?php echo JTe-#-#-xt::_('COM_###-#-#-COMPONENT###_IMPORT_GET_BOTTON'); ?>\" onclick=\"Joomla.submitbutton3()\" />&nbsp;&nbsp;&nbsp;<small><?php echo JTe-#-#-xt::_('COM_###-#-#-COMPONENT###_IMPORT_FORMATS_ACCEPTED'); ?> (.csv .xls .ods)</small>";
$script['view'][] = "\t\t\t\t</div>";
$script['view'][] = "\t\t\t\t</fieldset>";
$script['view'][] = "\t\t<?php echo JHtml::_('bootstrap.endTab'); ?>";
$script['view'][] = "";
$script['view'][] = "\n\t\t<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'url', JTe-#-#-xt::_('COM_###-#-#-COMPONENT###_IMPORT_FROM_URL', true)); ?>";
$script['view'][] = "\t\t\t<fieldset class=\"uploadform\">";
$script['view'][] = "\t\t\t\t<legend><?php echo JTe-#-#-xt::_('COM_###-#-#-COMPONENT###_IMPORT_UPDATE_DATA'); ?></legend>";
$script['view'][] = "\t\t\t\t<div class=\"control-group\">";
$script['view'][] = "\t\t\t\t\t<label for=\"import_url\" class=\"control-label\"><?php echo JTe-#-#-xt::_('COM_###-#-#-COMPONENT###_IMPORT_SELECT_FILE_URL'); ?></label>";
$script['view'][] = "\t\t\t\t\t<div class=\"controls\">";
$script['view'][] = "\t\t\t\t\t\t<input type=\"text\" id=\"import_url\" name=\"import_url\" class=\"span5 input_box\" size=\"70\" value=\"http://\" />";
$script['view'][] = "\t\t\t\t\t</div>";
$script['view'][] = "\t\t\t\t</div>";
$script['view'][] = "\t\t\t\t<div class=\"form-actions\">";
$script['view'][] = "\t\t\t\t\t<input type=\"button\" class=\"btn btn-primary\" value=\"<?php echo JTe-#-#-xt::_('COM_###-#-#-COMPONENT###_IMPORT_GET_BOTTON'); ?>\" onclick=\"Joomla.submitbutton4()\" />&nbsp;&nbsp;&nbsp;<small><?php echo JTe-#-#-xt::_('COM_###-#-#-COMPONENT###_IMPORT_FORMATS_ACCEPTED'); ?> (.csv .xls .ods)</small>";
$script['view'][] = "\t\t\t\t</div>";
$script['view'][] = "\t\t\t</fieldset>";
$script['view'][] = "\t\t<?php echo JHtml::_('bootstrap.endTab'); ?>";
$script['view'][] = "\t\t<?php echo JHtml::_('bootstrap.endTabSet'); ?>";
$script['view'][] = "\t\t<input type=\"hidden\" name=\"gettype\" value=\"upload\" />";
$script['view'][] = "\t<?php endif; ?>";
$script['view'][] = "\t<input type=\"hidden\" name=\"task\" value=\"import_###-#-#-views###.import\" />";
$script['view'][] = "\t<?php echo JHtml::_('form.token'); ?>";
$script['view'][] = "</form>";
$script['view'][] = "</div>";
}
elseif ('import' === $type)
{
$script['import'] = array();
$script['import'][] = "\t/**";
$script['import'][] = "\t * Import an spreadsheet from either folder, url or upload.";
$script['import'][] = "\t *";
$script['import'][] = "\t * @return boolean result of import";
$script['import'][] = "\t *";
$script['import'][] = "\t */";
$script['import'][] = "\tpublic function import()";
$script['import'][] = "\t{";
$script['import'][] = "\t\t\$this->setState('action', 'import');";
$script['import'][] = "\t\t\$app \t\t= JFactory::getApplication();";
$script['import'][] = "\t\t\$session \t= JFactory::getSession();";
$script['import'][] = "\t\t\$package \t= null;";
$script['import'][] = "\t\t\$continue\t= false;";
$script['import'][] = "\t\t// get import type";
$script['import'][] = "\t\t\$this->getType = \$app->input->getString('gettype', NULL);";
$script['import'][] = "\t\t// get import type";
$script['import'][] = "\t\t\$this->dataType\t= \$session->get('dataType_VDM_IMPORTINTO', NULL);";
$script['import'][] = "\n\t\tif (\$package === null)";
$script['import'][] = "\t\t{";
$script['import'][] = "\t\t\tswitch (\$this->getType)";
$script['import'][] = "\t\t\t{";
$script['import'][] = "\t\t\t\tcase 'folder':";
$script['import'][] = "\t\t\t\t\t// Remember the 'Import from Directory' path.";
$script['import'][] = "\t\t\t\t\t\$app->getUserStateFromRequest(\$this->_context . '.import_directory', 'import_directory');";
$script['import'][] = "\t\t\t\t\t\$package = \$this->_getPackageFromFolder();";
$script['import'][] = "\t\t\t\t\tbreak;";
$script['import'][] = "\n\t\t\t\tcase 'upload':";
$script['import'][] = "\t\t\t\t\t\$package = \$this->_getPackageFromUpload();";
$script['import'][] = "\t\t\t\t\tbreak;";
$script['import'][] = "\n\t\t\t\tcase 'url':";
$script['import'][] = "\t\t\t\t\t\$package = \$this->_getPackageFromUrl();";
$script['import'][] = "\t\t\t\t\tbreak;";
$script['import'][] = "\n\t\t\t\tcase 'continue':";
$script['import'][] = "\t\t\t\t\t\$continue \t= true;";
$script['import'][] = "\t\t\t\t\t\$package\t= \$session->get('package', null);";
$script['import'][] = "\t\t\t\t\t\$package\t= json_decode(\$package, true);";
$script['import'][] = "\t\t\t\t\t// clear session";
$script['import'][] = "\t\t\t\t\t\$session->clear('package');";
$script['import'][] = "\t\t\t\t\t\$session->clear('dataType');";
$script['import'][] = "\t\t\t\t\t\$session->clear('hasPackage');";
$script['import'][] = "\t\t\t\t\tbreak;";
$script['import'][] = "\n\t\t\t\tdefault:";
$script['import'][] = "\t\t\t\t\t\$app->setUserState('com_###-#-#-component###.message', JTe-#-#-xt::_('COM_###-#-#-COMPONENT###_IMPORT_NO_IMPORT_TYPE_FOUND'));";
$script['import'][] = "\n\t\t\t\t\treturn false;";
$script['import'][] = "\t\t\t\t\tbreak;";
$script['import'][] = "\t\t\t}";
$script['import'][] = "\t\t}";
$script['import'][] = "\t\t// Was the package valid?";
$script['import'][] = "\t\tif (!\$package || !\$package['type'])";
$script['import'][] = "\t\t{";
$script['import'][] = "\t\t\tif (in_array(\$this->getType, array('upload', 'url')))";
$script['import'][] = "\t\t\t{";
$script['import'][] = "\t\t\t\t\$this->remove(\$package['packagename']);";
$script['import'][] = "\t\t\t}";
$script['import'][] = "\n\t\t\t\$app->setUserState('com_###-#-#-component###.message', JTe-#-#-xt::_('COM_###-#-#-COMPONENT###_IMPORT_UNABLE_TO_FIND_IMPORT_PACKAGE'));";
$script['import'][] = "\t\t\treturn false;";
$script['import'][] = "\t\t}";
$script['import'][] = "\t\t";
$script['import'][] = "\t\t// first link data to table headers";
$script['import'][] = "\t\tif(!\$continue){";
$script['import'][] = "\t\t\t\$package\t= json_encode(\$package);";
$script['import'][] = "\t\t\t\$session->set('package', \$package);";
$script['import'][] = "\t\t\t\$session->set('dataType', \$this->dataType);";
$script['import'][] = "\t\t\t\$session->set('hasPackage', true);";
$script['import'][] = "\t\t\treturn true;";
$script['import'][] = "\t\t}";
$script['import'][] = "\t\t// set the data";
$script['import'][] = "\t\t\$headerList = json_decode(\$session->get(\$this->dataType.'_VDM_IMPORTHEADERS', false), true);";
$script['import'][] = "\t\tif (!\$this->setData(\$package,\$this->dataType,\$headerList))";
$script['import'][] = "\t\t{";
$script['import'][] = "\t\t\t// There was an error importing the package";
$script['import'][] = "\t\t\t\$msg = JTe-#-#-xt::_('COM_###-#-#-COMPONENT###_IMPORT_ERROR');";
$script['import'][] = "\t\t\t\$back = \$session->get('backto_VDM_IMPORT', NULL);";
$script['import'][] = "\t\t\tif (\$back)";
$script['import'][] = "\t\t\t{";
$script['import'][] = "\t\t\t\t\$app->setUserState('com_###-#-#-component###.redirect_url', 'index.php?option=com_###-#-#-component###&view='.\$back);";
$script['import'][] = "\t\t\t\t\$session->clear('backto_VDM_IMPORT');";
$script['import'][] = "\t\t\t}";
$script['import'][] = "\t\t\t\$result = false;";
$script['import'][] = "\t\t}";
$script['import'][] = "\t\telse";
$script['import'][] = "\t\t{";
$script['import'][] = "\t\t\t// Package imported sucessfully";
$script['import'][] = "\t\t\t\$msg = JTe-#-#-xt::sprintf('COM_###-#-#-COMPONENT###_IMPORT_SUCCESS', \$package['packagename']);";
$script['import'][] = "\t\t\t\$back = \$session->get('backto_VDM_IMPORT', NULL);";
$script['import'][] = "\t\t\tif (\$back)";
$script['import'][] = "\t\t\t{";
$script['import'][] = "\t\t\t \$app->setUserState('com_###-#-#-component###.redirect_url', 'index.php?option=com_###-#-#-component###&view='.\$back);";
$script['import'][] = "\t\t\t \$session->clear('backto_VDM_IMPORT');";
$script['import'][] = "\t\t\t}";
$script['import'][] = "\t\t\t\$result = true;";
$script['import'][] = "\t\t}";
$script['import'][] = "\n\t\t// Set some model state values";
$script['import'][] = "\t\t\$app->enqueueMessage(\$msg);";
$script['import'][] = "\n\t\t// remove file after import";
$script['import'][] = "\t\t\$this->remove(\$package['packagename']);";
$script['import'][] = "\t\t\$session->clear(\$this->getType.'_VDM_IMPORTHEADERS');";
$script['import'][] = "\t\treturn \$result;";
$script['import'][] = "\t}";
}
elseif ('ext' === $type)
{
$script['ext'][] = "\t/**";
$script['ext'][] = "\t * Check the extension";
$script['ext'][] = "\t *";
$script['ext'][] = "\t * @param string \$file Name of the uploaded file";
$script['ext'][] = "\t *";
$script['ext'][] = "\t * @return boolean True on success";
$script['ext'][] = "\t *";
$script['ext'][] = "\t */";
$script['ext'][] = "\tprotected function checkExtension(\$file)";
$script['ext'][] = "\t{";
$script['ext'][] = "\t\t// check the extention";
$script['ext'][] = "\t\tswitch(strtolower(pathinfo(\$file, PATHINFO_EXTENSION)))";
$script['ext'][] = "\t\t{";
$script['ext'][] = "\t\t\tcase 'xls':";
$script['ext'][] = "\t\t\tcase 'ods':";
$script['ext'][] = "\t\t\tcase 'csv':";
$script['ext'][] = "\t\t\treturn true;";
$script['ext'][] = "\t\t\tbreak;";
$script['ext'][] = "\t\t}";
$script['ext'][] = "\t\treturn false;";
$script['ext'][] = "\t}";
}
// return the needed script
if (isset($script[$type]))
{
return str_replace('-#-#-', '', implode("\n",$script[$type]));
}
return false;
}
/**
* set the session defaults if not set
**/