gh-60 language translation component added, basic implementation

This commit is contained in:
dev 2017-04-05 14:21:10 +01:00
parent f3f91f492f
commit 34d14ed95d
No known key found for this signature in database
GPG Key ID: 62214715B438FFEE
262 changed files with 1876 additions and 928 deletions

View File

@ -105,12 +105,12 @@ Component Builder is mapped as a component in itself on my local development env
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
+ *Name*: [Component Builder](http://vdm.bz/component-builder)
+ *First Build*: 30th April, 2015
+ *Last Build*: 3rd April, 2017
+ *Last Build*: 5th April, 2017
+ *Version*: 2.4.2
+ *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*: **104692**
+ *File count*: **639**
+ *Line count*: **105345**
+ *File count*: **638**
+ *Folder count*: **115**
> This **component** was build with a Joomla [Automated Component Builder](http://vdm.bz/component-builder).

View File

@ -105,12 +105,12 @@ Component Builder is mapped as a component in itself on my local development env
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
+ *Name*: [Component Builder](http://vdm.bz/component-builder)
+ *First Build*: 30th April, 2015
+ *Last Build*: 3rd April, 2017
+ *Last Build*: 5th April, 2017
+ *Version*: 2.4.2
+ *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*: **104692**
+ *File count*: **639**
+ *Line count*: **105345**
+ *File count*: **638**
+ *Folder count*: **115**
> This **component** was build with a Joomla [Automated Component Builder](http://vdm.bz/component-builder).

View File

@ -113,20 +113,19 @@
<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_placeholder.update_placeholders" title="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDER_UPDATE_PLACEHOLDERS_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDER_UPDATE_PLACEHOLDERS_BUTTON_ACCESS_DESC" />
<action name="language_placeholder.access" title="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDERS_ACCESS" description="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDERS_ACCESS_DESC" />
<action name="language_placeholder.batch" title="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDERS_BATCH_USE" description="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDERS_BATCH_USE_DESC" />
<action name="language_placeholder.create" title="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDERS_CREATE" description="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDERS_CREATE_DESC" />
<action name="language_placeholder.dashboard_add" title="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDERS_DASHBOARD_ADD" description="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDERS_DASHBOARD_ADD_DESC" />
<action name="language_placeholder.dashboard_list" title="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDERS_DASHBOARD_LIST" description="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDERS_DASHBOARD_LIST_DESC" />
<action name="language_placeholder.delete" title="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDERS_DELETE" description="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDERS_DELETE_DESC" />
<action name="language_placeholder.edit" title="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDERS_EDIT" description="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDERS_EDIT_DESC" />
<action name="language_placeholder.edit.own" title="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDERS_EDIT_OWN" description="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDERS_EDIT_OWN_DESC" />
<action name="language_placeholder.edit.state" title="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDERS_EDIT_STATE" description="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDERS_EDIT_STATE_DESC" />
<action name="language_placeholder.version" title="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDERS_EDIT_VERSION" description="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDERS_EDIT_VERSION_DESC" />
<action name="language_placeholder.export" title="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDERS_EXPORT" description="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDERS_EXPORT_DESC" />
<action name="language_placeholder.import" title="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDERS_IMPORT" description="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDERS_IMPORT_DESC" />
<action name="language_placeholder.submenu" title="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDERS_SUBMENU" description="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDERS_SUBMENU_DESC" />
<action name="language_translation.update_placeholders" title="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_UPDATE_PLACEHOLDERS_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_UPDATE_PLACEHOLDERS_BUTTON_ACCESS_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" />
<action name="language_translation.create" title="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_CREATE" description="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_CREATE_DESC" />
<action name="language_translation.dashboard_list" title="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_DASHBOARD_LIST" description="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_DASHBOARD_LIST_DESC" />
<action name="language_translation.delete" title="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_DELETE" description="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_DELETE_DESC" />
<action name="language_translation.edit" title="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EDIT" description="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EDIT_DESC" />
<action name="language_translation.edit.own" title="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EDIT_OWN" description="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EDIT_OWN_DESC" />
<action name="language_translation.edit.state" title="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EDIT_STATE" description="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EDIT_STATE_DESC" />
<action name="language_translation.version" title="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EDIT_VERSION" description="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EDIT_VERSION_DESC" />
<action name="language_translation.export" title="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EXPORT" description="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EXPORT_DESC" />
<action name="language_translation.import" title="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_IMPORT" description="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_IMPORT_DESC" />
<action name="language_translation.submenu" title="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_SUBMENU" description="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_SUBMENU_DESC" />
<action name="language.access" title="COM_COMPONENTBUILDER_LANGUAGES_ACCESS" description="COM_COMPONENTBUILDER_LANGUAGES_ACCESS_DESC" />
<action name="language.batch" title="COM_COMPONENTBUILDER_LANGUAGES_BATCH_USE" description="COM_COMPONENTBUILDER_LANGUAGES_BATCH_USE_DESC" />
<action name="language.create" title="COM_COMPONENTBUILDER_LANGUAGES_CREATE" description="COM_COMPONENTBUILDER_LANGUAGES_CREATE_DESC" />
@ -268,14 +267,14 @@
<action name="fieldtype.access" title="COM_COMPONENTBUILDER_FIELDTYPES_ACCESS" description="COM_COMPONENTBUILDER_FIELDTYPES_ACCESS_DESC" />
<action name="fieldtype.version" title="COM_COMPONENTBUILDER_FIELDTYPES_EDIT_VERSION" description="COM_COMPONENTBUILDER_FIELDTYPES_EDIT_VERSION_DESC" />
</section>
<section name="language_placeholder">
<action name="language_placeholder.edit" title="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDERS_EDIT" description="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDERS_EDIT_DESC" />
<action name="language_placeholder.edit.own" title="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDERS_EDIT_OWN" description="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDERS_EDIT_OWN_DESC" />
<action name="language_placeholder.edit.state" title="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDERS_EDIT_STATE" description="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDERS_EDIT_STATE_DESC" />
<action name="language_placeholder.create" title="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDERS_CREATE" description="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDERS_CREATE_DESC" />
<action name="language_placeholder.delete" title="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDERS_DELETE" description="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDERS_DELETE_DESC" />
<action name="language_placeholder.access" title="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDERS_ACCESS" description="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDERS_ACCESS_DESC" />
<action name="language_placeholder.version" title="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDERS_EDIT_VERSION" description="COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDERS_EDIT_VERSION_DESC" />
<section name="language_translation">
<action name="language_translation.edit" title="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EDIT" description="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EDIT_DESC" />
<action name="language_translation.edit.own" title="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EDIT_OWN" description="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EDIT_OWN_DESC" />
<action name="language_translation.edit.state" title="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EDIT_STATE" description="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EDIT_STATE_DESC" />
<action name="language_translation.create" title="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_CREATE" description="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_CREATE_DESC" />
<action name="language_translation.delete" title="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_DELETE" description="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_DELETE_DESC" />
<action name="language_translation.access" title="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_ACCESS" description="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_ACCESS_DESC" />
<action name="language_translation.version" title="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EDIT_VERSION" description="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EDIT_VERSION_DESC" />
</section>
<section name="language">
<action name="language.edit" title="COM_COMPONENTBUILDER_LANGUAGES_EDIT" description="COM_COMPONENTBUILDER_LANGUAGES_EDIT_DESC" />

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.4.2
@build 3rd April, 2017
@build 5th April, 2017
@created 30th April, 2015
@package Component Builder
@subpackage admin.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 81 of this MVC
@build 1st March, 2017
@version @update number 82 of this MVC
@build 3rd April, 2017
@created 11th October, 2016
@package Component Builder
@subpackage custom_code.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 81 of this MVC
@build 1st March, 2017
@version @update number 82 of this MVC
@build 3rd April, 2017
@created 11th October, 2016
@package Component Builder
@subpackage custom_codes.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.4.2
@build 3rd April, 2017
@build 5th April, 2017
@created 30th April, 2015
@package Component Builder
@subpackage dashboard.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 311 of this MVC
@build 1st April, 2017
@version @update number 314 of this MVC
@build 5th April, 2017
@created 6th May, 2015
@package Component Builder
@subpackage joomla_component.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 311 of this MVC
@build 1st April, 2017
@version @update number 314 of this MVC
@build 5th April, 2017
@created 6th May, 2015
@package Component Builder
@subpackage joomla_components.css

View File

@ -9,11 +9,11 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 8 of this MVC
@build 3rd April, 2017
@version @update number 28 of this MVC
@build 5th April, 2017
@created 3rd April, 2017
@package Component Builder
@subpackage language_placeholder.css
@subpackage language_translation.css
@author Llewellyn van der Merwe <http://vdm.bz/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

View File

@ -9,11 +9,11 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 8 of this MVC
@build 3rd April, 2017
@version @update number 28 of this MVC
@build 5th April, 2017
@created 3rd April, 2017
@package Component Builder
@subpackage language_placeholders.css
@subpackage language_translations.css
@author Llewellyn van der Merwe <http://vdm.bz/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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

View File

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

View File

@ -60,8 +60,7 @@
</files>
<languages folder="site">
<language tag="en-GB">language/en-GB/en-GB.com_###component###.ini</language>
<language tag="en-GB">language/en-GB/en-GB.com_###component###.sys.ini</language>
###SITE_LANGUAGES###
</languages>
<administration>
@ -86,8 +85,7 @@
</files>
<languages folder="admin">
<language tag="en-GB">language/en-GB/en-GB.com_###component###.ini</language>
<language tag="en-GB">language/en-GB/en-GB.com_###component###.sys.ini</language>
###ADMIN_LANGUAGES###
</languages>
</administration>###UPDATESERVER###

View File

@ -170,18 +170,6 @@
"rename": false,
"type": "file"
},
"en-GB.com_admin.ini": {
"naam":"en-GB.com_admin.ini",
"path": "c0mp0n3nt/admin/language/en-GB",
"rename": "admin",
"type": "file"
},
"en-GB.com_admin.sys.ini": {
"naam":"en-GB.com_admin.sys.ini",
"path": "c0mp0n3nt/admin/language/en-GB",
"rename": "admin",
"type": "file"
},
"install.mysql.utf8.sql": {
"naam":"install.mysql.utf8.sql",
"path": "c0mp0n3nt/admin/sql",
@ -219,18 +207,6 @@
"rename": false,
"type": "file"
},
"en-GB.com_site.ini": {
"naam":"en-GB.com_site.ini",
"path": "c0mp0n3nt/site/language/en-GB",
"rename": "site",
"type": "file"
},
"en-GB.com_site.sys.ini": {
"naam":"en-GB.com_site.sys.ini",
"path": "c0mp0n3nt/site/language/en-GB",
"rename": "site",
"type": "file"
},
"headercheck.php": {
"naam":"headercheck.php",
"path": "c0mp0n3nt/site/helpers",

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.4.2
@build 3rd April, 2017
@build 5th April, 2017
@created 30th April, 2015
@package Component Builder
@subpackage componentbuilder.php
@ -44,7 +44,10 @@ $document->addScript('components/com_componentbuilder/assets/js/admin.js');
// require helper files
JLoader::register('ComponentbuilderHelper', dirname(__FILE__) . '/helpers/componentbuilder.php');
JLoader::register('JHtmlBatch_', dirname(__FILE__) . '/helpers/html/batch_.php');
JLoader::register('JHtmlBatch_', dirname(__FILE__) . '/helpers/html/batch_.php');
// Triger the Global Admin Event
ComponentbuilderHelper::globalEvent($document);
// import joomla controller library
jimport('joomla.application.component.controller');

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.4.2
@build 3rd April, 2017
@build 5th April, 2017
@created 30th April, 2015
@package Component Builder
@subpackage controller.php
@ -99,7 +99,7 @@ class ComponentbuilderController extends JControllerLegacy
'snippet' => 'snippets',
'field' => 'fields',
'fieldtype' => 'fieldtypes',
'language_placeholder' => 'language_placeholders',
'language_translation' => 'language_translations',
'language' => 'languages',
'help_document' => 'help_documents'
);

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.4.2
@build 3rd April, 2017
@build 5th April, 2017
@created 30th April, 2015
@package Component Builder
@subpackage ajax.json.php
@ -57,7 +57,9 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
$this->registerTask('viewTableColumns', 'ajax');
$this->registerTask('checkFunctionName', 'ajax');
$this->registerTask('usedin', 'ajax');
$this->registerTask('fieldOptions', 'ajax');
$this->registerTask('fieldOptions', 'ajax');
$this->registerTask('getBuildTable', 'ajax');
$this->registerTask('getButton', 'ajax');
}
public function ajax()
@ -687,6 +689,83 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
echo "(".json_encode($e).");";
}
}
break;
case 'getBuildTable':
try
{
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
$idNameValue = $jinput->get('idName', NULL, 'CMD');
$objectValue = $jinput->get('object', NULL, 'STRING');
if($idNameValue && $objectValue && $user->id != 0)
{
$result = $this->getModel('ajax')->getBuildTable($idNameValue, $objectValue);
}
else
{
$result = false;
}
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $callback . "(".json_encode($result).");";
}
elseif($returnRaw)
{
echo json_encode($result);
}
else
{
echo "(".json_encode($result).");";
}
}
catch(Exception $e)
{
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $callback."(".json_encode($e).");";
}
else
{
echo "(".json_encode($e).");";
}
}
break;
case 'getButton':
try
{
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
$typeValue = $jinput->get('type', NULL, 'WORD');
if($typeValue && $user->id != 0)
{
$result = $this->getModel('ajax')->getButton($typeValue);
}
else
{
$result = false;
}
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $callback . "(".json_encode($result).");";
}
elseif($returnRaw)
{
echo json_encode($result);
}
else
{
echo "(".json_encode($result).");";
}
}
catch(Exception $e)
{
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $callback."(".json_encode($e).");";
}
else
{
echo "(".json_encode($e).");";
}
}
break;
}
}

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.4.2
@build 3rd April, 2017
@build 5th April, 2017
@created 30th April, 2015
@package Component Builder
@subpackage componentbuilder.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 81 of this MVC
@build 1st March, 2017
@version @update number 82 of this MVC
@build 3rd April, 2017
@created 11th October, 2016
@package Component Builder
@subpackage custom_code.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 81 of this MVC
@build 1st March, 2017
@version @update number 82 of this MVC
@build 3rd April, 2017
@created 11th October, 2016
@package Component Builder
@subpackage custom_codes.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.4.2
@build 3rd April, 2017
@build 5th April, 2017
@created 30th April, 2015
@package Component Builder
@subpackage help.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.4.2
@build 3rd April, 2017
@build 5th April, 2017
@created 30th April, 2015
@package Component Builder
@subpackage import.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.4.2
@build 3rd April, 2017
@build 5th April, 2017
@created 30th April, 2015
@package Component Builder
@subpackage import_joomla_components.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 311 of this MVC
@build 1st April, 2017
@version @update number 314 of this MVC
@build 5th April, 2017
@created 6th May, 2015
@package Component Builder
@subpackage joomla_component.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 311 of this MVC
@build 1st April, 2017
@version @update number 314 of this MVC
@build 5th April, 2017
@created 6th May, 2015
@package Component Builder
@subpackage joomla_components.php

View File

@ -10,11 +10,11 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 8 of this MVC
@build 3rd April, 2017
@version @update number 28 of this MVC
@build 5th April, 2017
@created 3rd April, 2017
@package Component Builder
@subpackage language_placeholder.php
@subpackage language_translation.php
@author Llewellyn van der Merwe <http://vdm.bz/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
@ -30,9 +30,9 @@ defined('_JEXEC') or die('Restricted access');
jimport('joomla.application.component.controllerform');
/**
* Language_placeholder Controller
* Language_translation Controller
*/
class ComponentbuilderControllerLanguage_placeholder extends JControllerForm
class ComponentbuilderControllerLanguage_translation extends JControllerForm
{
/**
* Current or most recently performed task.
@ -45,7 +45,7 @@ class ComponentbuilderControllerLanguage_placeholder extends JControllerForm
public function __construct($config = array())
{
$this->view_list = 'Language_placeholders'; // safeguard for setting the return view listing to the main view.
$this->view_list = 'Language_translations'; // safeguard for setting the return view listing to the main view.
parent::__construct($config);
}
@ -61,13 +61,13 @@ class ComponentbuilderControllerLanguage_placeholder extends JControllerForm
protected function allowAdd($data = array())
{
// Access check.
$access = JFactory::getUser()->authorise('language_placeholder.access', 'com_componentbuilder');
$access = JFactory::getUser()->authorise('language_translation.access', 'com_componentbuilder');
if (!$access)
{
return false;
}
// In the absense of better information, revert to the component permissions.
return JFactory::getUser()->authorise('language_placeholder.create', $this->option);
return JFactory::getUser()->authorise('language_translation.create', $this->option);
}
/**
@ -89,7 +89,7 @@ class ComponentbuilderControllerLanguage_placeholder extends JControllerForm
// Access check.
$access = ($user->authorise('language_placeholder.access', 'com_componentbuilder.language_placeholder.' . (int) $recordId) && $user->authorise('language_placeholder.access', 'com_componentbuilder'));
$access = ($user->authorise('language_translation.access', 'com_componentbuilder.language_translation.' . (int) $recordId) && $user->authorise('language_translation.access', 'com_componentbuilder'));
if (!$access)
{
return false;
@ -98,10 +98,10 @@ class ComponentbuilderControllerLanguage_placeholder extends JControllerForm
if ($recordId)
{
// The record has been set. Check the record permissions.
$permission = $user->authorise('language_placeholder.edit', 'com_componentbuilder.language_placeholder.' . (int) $recordId);
$permission = $user->authorise('language_translation.edit', 'com_componentbuilder.language_translation.' . (int) $recordId);
if (!$permission)
{
if ($user->authorise('language_placeholder.edit.own', 'com_componentbuilder.language_placeholder.' . $recordId))
if ($user->authorise('language_translation.edit.own', 'com_componentbuilder.language_translation.' . $recordId))
{
// Now test the owner is the user.
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
@ -120,7 +120,7 @@ class ComponentbuilderControllerLanguage_placeholder extends JControllerForm
// If the owner matches 'me' then allow.
if ($ownerId == $user->id)
{
if ($user->authorise('language_placeholder.edit.own', 'com_componentbuilder'))
if ($user->authorise('language_translation.edit.own', 'com_componentbuilder'))
{
return true;
}
@ -130,7 +130,7 @@ class ComponentbuilderControllerLanguage_placeholder extends JControllerForm
}
}
// Since there is no permission, revert to the component permissions.
return $user->authorise('language_placeholder.edit', $this->option);
return $user->authorise('language_translation.edit', $this->option);
}
/**
@ -196,10 +196,10 @@ class ComponentbuilderControllerLanguage_placeholder extends JControllerForm
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Language_placeholder', '', array());
$model = $this->getModel('Language_translation', '', array());
// Preset the redirect
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=language_placeholders' . $this->getRedirectToListAppend(), false));
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=language_translations' . $this->getRedirectToListAppend(), false));
return parent::batch($model);
}

View File

@ -10,11 +10,11 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 8 of this MVC
@build 3rd April, 2017
@version @update number 28 of this MVC
@build 5th April, 2017
@created 3rd April, 2017
@package Component Builder
@subpackage language_placeholders.php
@subpackage language_translations.php
@author Llewellyn van der Merwe <http://vdm.bz/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
@ -30,16 +30,16 @@ defined('_JEXEC') or die('Restricted access');
jimport('joomla.application.component.controlleradmin');
/**
* Language_placeholders Controller
* Language_translations Controller
*/
class ComponentbuilderControllerLanguage_placeholders extends JControllerAdmin
class ComponentbuilderControllerLanguage_translations extends JControllerAdmin
{
protected $text_prefix = 'COM_COMPONENTBUILDER_LANGUAGE_PLACEHOLDERS';
protected $text_prefix = 'COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS';
/**
* Proxy for getModel.
* @since 2.5
*/
public function getModel($name = 'Language_placeholder', $prefix = 'ComponentbuilderModel', $config = array())
public function getModel($name = 'Language_translation', $prefix = 'ComponentbuilderModel', $config = array())
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
@ -52,7 +52,7 @@ class ComponentbuilderControllerLanguage_placeholders extends JControllerAdmin
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// check if export is allowed for this user.
$user = JFactory::getUser();
if ($user->authorise('language_placeholder.export', 'com_componentbuilder') && $user->authorise('core.export', 'com_componentbuilder'))
if ($user->authorise('language_translation.export', 'com_componentbuilder') && $user->authorise('core.export', 'com_componentbuilder'))
{
// Get the input
$input = JFactory::getApplication()->input;
@ -60,19 +60,19 @@ class ComponentbuilderControllerLanguage_placeholders extends JControllerAdmin
// Sanitize the input
JArrayHelper::toInteger($pks);
// Get the model
$model = $this->getModel('Language_placeholders');
$model = $this->getModel('Language_translations');
// get the data to export
$data = $model->getExportData($pks);
if (ComponentbuilderHelper::checkArray($data))
{
// now set the data to the spreadsheet
$date = JFactory::getDate();
ComponentbuilderHelper::xls($data,'Language_placeholders_'.$date->format('jS_F_Y'),'Language placeholders exported ('.$date->format('jS F, Y').')','language placeholders');
ComponentbuilderHelper::xls($data,'Language_translations_'.$date->format('jS_F_Y'),'Language translations exported ('.$date->format('jS F, Y').')','language translations');
}
}
// Redirect to the list screen with error.
$message = JText::_('COM_COMPONENTBUILDER_EXPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=language_placeholders', false), $message, 'error');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=language_translations', false), $message, 'error');
return;
}
@ -83,10 +83,10 @@ class ComponentbuilderControllerLanguage_placeholders extends JControllerAdmin
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// check if import is allowed for this user.
$user = JFactory::getUser();
if ($user->authorise('language_placeholder.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder'))
if ($user->authorise('language_translation.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder'))
{
// Get the import model
$model = $this->getModel('Language_placeholders');
$model = $this->getModel('Language_translations');
// get the headers to import
$headers = $model->getExImPortHeaders();
if (ComponentbuilderHelper::checkObject($headers))
@ -94,18 +94,18 @@ class ComponentbuilderControllerLanguage_placeholders extends JControllerAdmin
// Load headers to session.
$session = JFactory::getSession();
$headers = json_encode($headers);
$session->set('language_placeholder_VDM_IMPORTHEADERS', $headers);
$session->set('backto_VDM_IMPORT', 'language_placeholders');
$session->set('dataType_VDM_IMPORTINTO', 'language_placeholder');
$session->set('language_translation_VDM_IMPORTHEADERS', $headers);
$session->set('backto_VDM_IMPORT', 'language_translations');
$session->set('dataType_VDM_IMPORTINTO', 'language_translation');
// Redirect to import view.
$message = JText::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_LANGUAGE_PLACEHOLDERS');
$message = JText::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_LANGUAGE_TRANSLATIONS');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import', false), $message);
return;
}
}
// Redirect to the list screen with error.
$message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=language_placeholders', false), $message, 'error');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=language_translations', false), $message, 'error');
return;
}

View File

@ -152,9 +152,7 @@ class Compiler extends Infusion
protected function updateFiles()
{
if (isset($this->newFiles['static']) && ComponentbuilderHelper::checkArray($this->newFiles['static']) && isset($this->newFiles['dynamic']) && ComponentbuilderHelper::checkArray($this->newFiles['dynamic']))
{
// we don't update lang now since we will still posible add custom code
$langCheck = 'en-GB.com_'.$this->fileContentStatic['###component###'].'.';
{
// get the bom file
$bom = file_get_contents($this->bomPath);
// first we do the static files
@ -162,12 +160,6 @@ class Compiler extends Infusion
{
if (JFile::exists($static['path']))
{
// skip lang files and store for later
if (strpos($static['path'], $langCheck))
{
$this->langFiles[] = $static;
continue;
}
$this->fileContentStatic['###FILENAME###'] = $static['name'];
$php = '';
if (ComponentbuilderHelper::checkFileType($static['name'],'php'))

View File

@ -163,11 +163,11 @@ class Get
public $loadLineNr = false;
/**
* The Language prefix
* The Placholder Language prefix
*
* @var string
*/
public $langPrefix = 'COM_';
public $langPrefix;
/**
* The Language content
@ -176,6 +176,34 @@ class Get
*/
public $langContent = array();
/**
* The Languages bucket
*
* @var array
*/
public $languages = array('en-GB' => array());
/**
* The Multi Languages bucket
*
* @var array
*/
public $multiLangString = array();
/**
* The new lang to add
*
* @var array
*/
protected $newLangStrings = array();
/**
* The existing lang to update
*
* @var array
*/
protected $existingLangStrings = array();
/**
* The Component Code Name
*
@ -460,7 +488,7 @@ class Get
if ($name_code = ComponentbuilderHelper::getVar('joomla_component', $this->componentID, 'id', 'name_code'))
{
// set lang prefix
$this->langPrefix .= ComponentbuilderHelper::safeString($name_code,'U');
$this->langPrefix = 'COM_'.ComponentbuilderHelper::safeString($name_code,'U');
// set component code name
$this->componentCodeName = ComponentbuilderHelper::safeString($name_code);
// set if placeholders should be added to customcode
@ -2979,6 +3007,230 @@ class Get
unset($this->$remove);
}
/**
* Get the other languages
*
* @param array $values The lang strings to get
*
*
* @return void
*
*/
public function getMultiLangStrings($values)
{
// Create a new query object.
$query = $this->db->getQuery(true);
$query->from($this->db->quoteName('#__componentbuilder_language_translation','a'));
if (ComponentbuilderHelper::checkArray($values))
{
$query->select($this->db->quoteName(array('a.id','a.translation','a.entranslation','a.components')));
$query->where($this->db->quoteName('a.entranslation') . ' IN (' . implode(',',array_map(function($a){ return $this->db->quote($a); }, $values)) . ')');
$query->where($this->db->quoteName('a.published') . ' >= 1');
$this->db->setQuery($query);
$this->db->execute();
if ($this->db->getNumRows())
{
return $this->db->loadAssocList('entranslation');
}
}
return false;
}
/**
* Set the Current language values to DB
*
*
* @return void
*
*/
public function setLangPlaceholders(&$strings)
{
$counterInsert = 0;
$counterUpdate = 0;
$today = JFactory::getDate()->toSql();
foreach ($this->languages['en-GB'] as $area => $placeholders)
{
foreach ($placeholders as $placeholder => $string)
{
// to keep or remove
$remove = false;
// build the tranlations
if (isset($this->multiLangString[$string]))
{
// make sure we have converted the string to array
if (isset($this->multiLangString[$string]['translation']) && ComponentbuilderHelper::checkJson($this->multiLangString[$string]['translation']))
{
$this->multiLangString[$string]['translation'] = json_decode($this->multiLangString[$string]['translation'], true);
}
// if we have an array continue
if (isset($this->multiLangString[$string]['translation'])
&& ComponentbuilderHelper::checkArray($this->multiLangString[$string]['translation'])
&& isset($this->multiLangString[$string]['translation']['translation'])
&& isset($this->multiLangString[$string]['translation']['language'])
&& ComponentbuilderHelper::checkArray($this->multiLangString[$string]['translation']['language'])
&& ComponentbuilderHelper::checkArray($this->multiLangString[$string]['translation']['translation']))
{
// great lets build the multi languages strings
foreach ($this->multiLangString[$string]['translation']['translation'] as $at => $lang)
{
$_tag = $this->multiLangString[$string]['translation']['language'][$at];
// build arrays
if (!isset($this->languages[$_tag]))
{
$this->languages[$_tag] = array();
}
if (!isset($this->languages[$_tag][$area]))
{
$this->languages[$_tag][$area] = array();
}
$this->languages[$_tag][$area][$placeholder] = $lang;
}
}
else
{
// remove this string not to be checked again
$remove = true;
}
}
// do the database managment
if(($key = array_search($string, $strings)) !== false)
{
if (isset($this->multiLangString[$string]))
{
// update the existing placeholder in db
$id = $this->multiLangString[$string]['id'];
if (ComponentbuilderHelper::checkJson($this->multiLangString[$string]['components']))
{
$components = (array) json_decode($this->multiLangString[$string]['components'], true);
if (in_array($this->componentID, $components))
{
continue;
}
else
{
$components[] = $this->componentID;
}
}
else
{
$components = array($this->componentID);
}
// start the bucket for this lang
$this->existingLangStrings[$counterUpdate] = array();
$this->existingLangStrings[$counterUpdate]['id'] = (int) $id;
$this->existingLangStrings[$counterUpdate]['conditions'] = array();
$this->existingLangStrings[$counterUpdate]['conditions'][] = $this->db->quoteName('id') . ' = ' . $this->db->quote($id);
$this->existingLangStrings[$counterUpdate]['fields'] = array();
$this->existingLangStrings[$counterUpdate]['fields'][] = $this->db->quoteName('components') . ' = ' . $this->db->quote(json_encode($components));
$counterUpdate++;
// load to db
$this->setExistingLangStrings(50);
// remove string if needed
if ($remove)
{
unset($this->multiLangString[$string]);
}
}
else
{
// add the new lang placeholder to the db
$this->newLangStrings[$counterInsert] = array();
$this->newLangStrings[$counterInsert][] = $this->db->quote(json_encode(array($this->componentID))); // 'components'
$this->newLangStrings[$counterInsert][] = $this->db->quote($string); // 'entranslation'
$this->newLangStrings[$counterInsert][] = $this->db->quote(1); // 'published'
$this->newLangStrings[$counterInsert][] = $this->db->quote($today); // 'created'
$this->newLangStrings[$counterInsert][] = $this->db->quote((int) $this->user->id); // 'created_by'
$this->newLangStrings[$counterInsert][] = $this->db->quote(1); // 'version'
$this->newLangStrings[$counterInsert][] = $this->db->quote(1); // 'access'
$counterInsert++;
// load to db
$this->setNewLangStrings(100);
}
// only set the string once
unset($strings[$key]);
}
}
}
// just to make sure all is done
$this->setExistingLangStrings();
$this->setNewLangStrings();
}
/**
* store the language placeholders
*
* @param int $when To set when to update
*
* @return void
*
*/
protected function setNewLangStrings($when = 1)
{
if (count($this->newLangStrings) >= $when)
{
// Create a new query object.
$query = $this->db->getQuery(true);
$continue = false;
// Insert columns.
$columns = array('components','entranslation','published','created','created_by','version','access');
// Prepare the insert query.
$query->insert($this->db->quoteName('#__componentbuilder_language_translation'));
$query->columns($this->db->quoteName($columns));
foreach($this->newLangStrings as $values)
{
if (count($values) == 7)
{
$query->values(implode(',', $values));
$continue = true;
}
else
{
// TODO line mismatch... should not happen
}
}
// clear the values array
$this->newLangStrings = array();
if (!$continue)
{
return false; // insure we dont continue if no values were loaded
}
// Set the query using our newly populated query object and execute it.
$this->db->setQuery($query);
$this->db->execute();
}
}
/**
* update the language placeholders
*
* @param int $when To set when to update
*
* @return void
*
*/
protected function setExistingLangStrings($when = 1)
{
if (count($this->existingLangStrings) >= $when)
{
foreach($this->existingLangStrings as $values)
{
// Create a new query object.
$query = $this->db->getQuery(true);
// Prepare the update query.
$query->update($this->db->quoteName('#__componentbuilder_language_translation'))->set($values['fields'])->where($values['conditions']);
// Set the query using our newly populated query object and execute it.
$this->db->setQuery($query);
$this->db->execute();
}
// clear the values array
$this->existingLangStrings = array();
}
}
/**
* get the custom code from the system
*

View File

@ -1790,7 +1790,7 @@ class Fields extends Structure
// set the custom builder
if (ComponentbuilderHelper::checkArray($custom) && $typeName != 'category' && $typeName != 'repeatable')
{
$this->customBuilder[$listViewName][] = array('type' => $typeName, 'code' => $name, 'lang' => $listLangName, 'custom' => $custom);
$this->customBuilder[$listViewName][] = array('type' => $typeName, 'code' => $name, 'lang' => $listLangName, 'custom' => $custom, 'method' => $field['settings']->store);
// set the custom fields needed in content type data
if (!isset($this->customFieldLinksBuilder[$viewName]))
{

View File

@ -5092,20 +5092,14 @@ class Interpretation extends Fields
if (isset($this->langContent['admin']) && ComponentbuilderHelper::checkArray($this->langContent['admin']))
{
ksort($this->langContent['admin']);
foreach ($this->langContent['admin'] as $key => $value)
{
if (strlen($key) > 0)
{
if (!isset($lang))
{
$lang = '';
}
$lang .= $key.'="'.$value.'"'.PHP_EOL;
}
}
return $lang;
// load to global languages
$this->languages['en-GB']['admin'] = $this->langContent['admin'];
// remove tmp array
unset($this->langContent['admin']);
return true;
}
return '';
return false;
}
public function setLangSite()
@ -5141,20 +5135,14 @@ class Interpretation extends Fields
if (isset($this->langContent['site']) && ComponentbuilderHelper::checkArray($this->langContent['site']))
{
ksort($this->langContent['site']);
foreach ($this->langContent['site'] as $key => $value)
{
if (strlen($key) > 0)
{
if (!isset($lang))
{
$lang = '';
}
$lang .= $key.'="'.$value.'"'.PHP_EOL;
}
}
return $lang;
// load to global languages
$this->languages['en-GB']['site'] = $this->langContent['site'];
// remove tmp array
unset($this->langContent['site']);
return true;
}
return '';
return false;
}
public function setLangSiteSys()
@ -5165,20 +5153,14 @@ class Interpretation extends Fields
if (isset($this->langContent['sitesys']) && ComponentbuilderHelper::checkArray($this->langContent['sitesys']))
{
ksort($this->langContent['sitesys']);
foreach ($this->langContent['sitesys'] as $key => $value)
{
if (strlen($key) > 0)
{
if (!isset($lang))
{
$lang = '';
}
$lang .= $key.'="'.$value.'"'.PHP_EOL;
}
}
return $lang;
// load to global languages
$this->languages['en-GB']['sitesys'] = $this->langContent['sitesys'];
// remove tmp array
unset($this->langContent['sitesys']);
return true;
}
return '';
return false;
}
public function setLangAdminSys()
@ -5186,20 +5168,14 @@ class Interpretation extends Fields
if (isset($this->langContent['adminsys']) && ComponentbuilderHelper::checkArray($this->langContent['adminsys']))
{
ksort($this->langContent['adminsys']);
foreach ($this->langContent['adminsys'] as $key => $value)
{
if (strlen($key) > 0)
{
if (!isset($lang))
{
$lang = '';
}
$lang .= $key.'="'.$value.'"'.PHP_EOL;
}
}
return $lang;
// load to global languages
$this->languages['en-GB']['adminsys'] = $this->langContent['adminsys'];
// remove tmp array
unset($this->langContent['adminsys']);
return true;
}
return '';
return false;
}
public function setCustomAdminViewListLink($view,$viewName_list)
@ -7206,7 +7182,7 @@ class Interpretation extends Fields
$query .= PHP_EOL."\t\t\tif (\$db->getNumRows())";
$query .= PHP_EOL."\t\t\t{";
$query .= PHP_EOL."\t\t\t\t\$items = \$db->loadObjectList();";
$query .= $this->setGetItemsMethodStringFix($viewName_single,$this->fileContentStatic['###Component###'],"\t\t",true);
$query .= $this->setGetItemsMethodStringFix($viewName_single, $this->fileContentStatic['###Component###'], "\t\t", true);