Compare commits

...

8 Commits

Author SHA1 Message Date
4d47f8292f added another fields to admin view to target list controller and model. Also improve compiler to add these new custom script to correct areas 2017-03-02 02:55:04 +02:00
a1ff74f157 Resolves #43 to insure that fields are sorted by tab once save, thanks to @Peeripapo 2017-02-24 16:57:40 +02:00
dc1217e6d1 Resolved #42 to insure the strpos always returns the correct data type. Improvements to some of the UI surrounding the custom code area. Added an edit button for the component being compiled on the complier page. 2017-02-23 02:29:37 +02:00
f2e4df6ecb Improved the custom code by adding the feature that shows where the manual custom code is used, including better placeholder information. Added component information to the compiler view. 2017-02-17 20:35:18 +02:00
a197f503a9 changed component table name to joomla-component to add history/version tracking back to components 2017-02-16 16:02:23 +02:00
79ab3164a6 few changes in comments, descriptions and fields. Included JS files to custom code engine 2017-02-14 02:33:24 +02:00
290a51dd5a Further improved #37 to ensure language strings are set and reversed, also add extra buttons to the compiler page. Major restructure of custom code implementation to make it more stable. Resolved #40 by updating the default field sql values. 2017-02-14 01:24:38 +02:00
de008d5907 Stable release of the automatic import of custom code, and the JCB manual placeholder implementation resolves #37 please view https://youtu.be/KiAtJawZ3oo 2017-02-11 04:24:26 +02:00
355 changed files with 8437 additions and 6505 deletions

View File

@ -1,4 +1,4 @@
# Component Builder (2.3.1)
# Component Builder (2.3.6)
This is a [Joomla 3.x](http://www.joomla.org/) component.
@ -8,7 +8,7 @@ The Component Builder for [Joomla](http://www.joomla.org/) that is highly advanc
Whether you're a seasoned [Joomla](http://www.joomla.org/) 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.3.1) 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.3.6) with **ALL** its features and **ALL** concepts totally open-source and free!
Once installed upgrades are quick and easy via the default Joomla upgrade area.
@ -104,12 +104,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*: 9th February, 2017
+ *Version*: 2.3.1
+ *Last Build*: 1st March, 2017
+ *Version*: 2.3.6
+ *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*: **91404**
+ *File count*: **591**
+ *Line count*: **92671**
+ *File count*: **596**
+ *Folder count*: **105**
> This **component** was build with a Joomla [Automated Component Builder](http://vdm.bz/component-builder).

View File

@ -1,4 +1,4 @@
# Component Builder (2.3.1)
# Component Builder (2.3.6)
This is a [Joomla 3.x](http://www.joomla.org/) component.
@ -8,7 +8,7 @@ The Component Builder for [Joomla](http://www.joomla.org/) that is highly advanc
Whether you're a seasoned [Joomla](http://www.joomla.org/) 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.3.1) 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.3.6) with **ALL** its features and **ALL** concepts totally open-source and free!
Once installed upgrades are quick and easy via the default Joomla upgrade area.
@ -104,12 +104,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*: 9th February, 2017
+ *Version*: 2.3.1
+ *Last Build*: 1st March, 2017
+ *Version*: 2.3.6
+ *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*: **91404**
+ *File count*: **591**
+ *Line count*: **92671**
+ *File count*: **596**
+ *Folder count*: **105**
> This **component** was build with a Joomla [Automated Component Builder](http://vdm.bz/component-builder).

View File

@ -101,6 +101,16 @@
<action name="help_document.export" title="COM_COMPONENTBUILDER_HELP_DOCUMENTS_EXPORT" description="COM_COMPONENTBUILDER_HELP_DOCUMENTS_EXPORT_DESC" />
<action name="help_document.import" title="COM_COMPONENTBUILDER_HELP_DOCUMENTS_IMPORT" description="COM_COMPONENTBUILDER_HELP_DOCUMENTS_IMPORT_DESC" />
<action name="help_document.submenu" title="COM_COMPONENTBUILDER_HELP_DOCUMENTS_SUBMENU" description="COM_COMPONENTBUILDER_HELP_DOCUMENTS_SUBMENU_DESC" />
<action name="joomla_component.access" title="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_ACCESS" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_ACCESS_DESC" />
<action name="joomla_component.batch" title="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_BATCH_USE" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_BATCH_USE_DESC" />
<action name="joomla_component.dashboard_add" title="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_DASHBOARD_ADD" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_DASHBOARD_ADD_DESC" />
<action name="joomla_component.dashboard_list" title="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_DASHBOARD_LIST" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_DASHBOARD_LIST_DESC" />
<action name="joomla_component.edit.add_license" title="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EDIT_ADD_LICENSE" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EDIT_ADD_LICENSE_DESC" />
<action name="joomla_component.edit.license_type" title="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EDIT_LICENSE_TYPE" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EDIT_LICENSE_TYPE_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="layout.access" title="COM_COMPONENTBUILDER_LAYOUTS_ACCESS" description="COM_COMPONENTBUILDER_LAYOUTS_ACCESS_DESC" />
<action name="layout.batch" title="COM_COMPONENTBUILDER_LAYOUTS_BATCH_USE" description="COM_COMPONENTBUILDER_LAYOUTS_BATCH_USE_DESC" />
<action name="layout.dashboard_add" title="COM_COMPONENTBUILDER_LAYOUTS_DASHBOARD_ADD" description="COM_COMPONENTBUILDER_LAYOUTS_DASHBOARD_ADD_DESC" />
@ -134,6 +144,11 @@
<action name="template.import" title="COM_COMPONENTBUILDER_TEMPLATES_IMPORT" description="COM_COMPONENTBUILDER_TEMPLATES_IMPORT_DESC" />
<action name="template.submenu" title="COM_COMPONENTBUILDER_TEMPLATES_SUBMENU" description="COM_COMPONENTBUILDER_TEMPLATES_SUBMENU_DESC" />
</section>
<section name="joomla_component">
<action name="joomla_component.edit.add_license" title="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EDIT_ADD_LICENSE" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EDIT_ADD_LICENSE_DESC" />
<action name="joomla_component.edit.license_type" title="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EDIT_LICENSE_TYPE" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EDIT_LICENSE_TYPE_DESC" />
<action name="joomla_component.version" title="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EDIT_VERSION" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EDIT_VERSION_DESC" />
</section>
<section name="admin_view">
<action name="core.edit" title="COM_COMPONENTBUILDER_ADMIN_VIEWS_EDIT" description="COM_COMPONENTBUILDER_ADMIN_VIEWS_EDIT_DESC" />
<action name="core.edit.state" title="COM_COMPONENTBUILDER_ADMIN_VIEWS_EDIT_STATE" description="COM_COMPONENTBUILDER_ADMIN_VIEWS_EDIT_STATE_DESC" />

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage admin.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 95 of this MVC
@build 3rd February, 2017
@version @update number 99 of this MVC
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage admin_view.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 95 of this MVC
@build 3rd February, 2017
@version @update number 99 of this MVC
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage admin_views.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 11 of this MVC
@build 2nd February, 2017
@version @update number 26 of this MVC
@build 28th February, 2017
@created 1st February, 2017
@package Component Builder
@subpackage compiler.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 22 of this MVC
@build 3rd February, 2017
@build 1st March, 2017
@created 13th August, 2015
@package Component Builder
@subpackage custom_admin_view.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 22 of this MVC
@build 3rd February, 2017
@build 1st March, 2017
@created 13th August, 2015
@package Component Builder
@subpackage custom_admin_views.css

View File

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

View File

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

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage dashboard.css

View File

@ -9,11 +9,11 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 81 of this MVC
@build 3rd February, 2017
@version @update number 96 of this MVC
@build 17th February, 2017
@created 6th May, 2015
@package Component Builder
@subpackage component.css
@subpackage joomla_component.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 81 of this MVC
@build 3rd February, 2017
@version @update number 96 of this MVC
@build 17th February, 2017
@created 6th May, 2015
@package Component Builder
@subpackage components.css
@subpackage joomla_components.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,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 66 of this MVC
@build 3rd February, 2017
@version @update number 67 of this MVC
@build 22nd February, 2017
@created 18th May, 2015
@package Component Builder
@subpackage layout.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 66 of this MVC
@build 3rd February, 2017
@version @update number 67 of this MVC
@build 22nd February, 2017
@created 18th May, 2015
@package Component Builder
@subpackage layouts.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 48 of this MVC
@build 3rd February, 2017
@build 1st March, 2017
@created 29th May, 2015
@package Component Builder
@subpackage site_view.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 48 of this MVC
@build 3rd February, 2017
@build 1st March, 2017
@created 29th May, 2015
@package Component Builder
@subpackage site_views.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 40 of this MVC
@build 3rd February, 2017
@build 22nd February, 2017
@created 26th May, 2015
@package Component Builder
@subpackage template.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 40 of this MVC
@build 3rd February, 2017
@build 22nd February, 2017
@created 26th May, 2015
@package Component Builder
@subpackage templates.css

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -681,57 +681,72 @@ abstract class ###Component###Helper
return $string;
}
public static function safeString($string, $type = 'L', $spacer = '_')
public static function safeString($string, $type = 'L', $spacer = '_', $replaceNumbers = true)
{
// remove all numbers and replace with english text version (works well only up to a thousand)
$string = self::replaceNumbers($string);
if ($replaceNumbers === true)
{
// remove all numbers and replace with english text version (works well only up to millions)
$string = self::replaceNumbers($string);
}
// 0nly continue if we have a string
if (self::checkString($string))
{
// remove all other characters
$string = trim($string);
$string = preg_replace('/'.$spacer.'+/', ' ', $string);
$string = preg_replace('/\s+/', ' ', $string);
$string = preg_replace("/[^A-Za-z ]/", '', $string);
// return a string with all first letter of each word uppercase(no undersocre)
if ($type == 'W')
{
return ucwords(strtolower($string));
}
elseif ($type == 'w')
{
return strtolower($string);
}
elseif ($type == 'Ww')
{
return ucfirst(strtolower($string));
}
elseif ($type == 'WW')
{
return strtoupper($string);
}
elseif ($type == 'U')
{
// replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string);
// return all upper
return strtoupper($string);
}
elseif ($type == 'F')
{
// replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string);
// return with first caracter to upper
return ucfirst(strtolower($string));
}
elseif ($type == 'L')
// remove all other characters
$string = trim($string);
$string = preg_replace('/'.$spacer.'+/', ' ', $string);
$string = preg_replace('/\s+/', ' ', $string);
$string = preg_replace("/[^A-Za-z ]/", '', $string);
// select final adaptations
if ($type === 'L' || $type === 'strtolower')
{
// replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string);
// default is to return lower
return strtolower($string);
}
elseif ($type === 'W')
{
// return a string with all first letter of each word uppercase(no undersocre)
return ucwords(strtolower($string));
}
elseif ($type === 'w' || $type === 'word')
{
// return a string with all lowercase(no undersocre)
return strtolower($string);
}
elseif ($type === 'Ww' || $type === 'Word')
{
// return a string with first letter of the first word uppercase and all the rest lowercase(no undersocre)
return ucfirst(strtolower($string));
}
elseif ($type === 'WW' || $type === 'WORD')
{
// return a string with all the uppercase(no undersocre)
return strtoupper($string);
}
elseif ($type === 'U' || $type === 'strtoupper')
{
// replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string);
// return all upper
return strtoupper($string);
}
elseif ($type === 'F' || $type === 'ucfirst')
{
// replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string);
// return with first caracter to upper
return ucfirst(strtolower($string));
}
elseif ($type === 'cA' || $type === 'cAmel' || $type === 'camelcase')
{
// convert all words to first letter uppercase
$string = ucwords(strtolower($string));
// remove white space
$string = preg_replace('/\s+/', '', $string);
// now return first letter lowercase
return lcfirst($string);
}
// return string
return $string;
}

View File

@ -673,62 +673,77 @@ abstract class ###Component###Helper
return $string;
}
public static function safeString($string, $type = 'L', $spacer = '_')
public static function safeString($string, $type = 'L', $spacer = '_', $replaceNumbers = true)
{
// remove all numbers and replace with english text version (works well only up to a thousand)
$string = self::replaceNumbers($string);
if (self::checkString($string))
if ($replaceNumbers === true)
{
// remove all numbers and replace with english text version (works well only up to millions)
$string = self::replaceNumbers($string);
}
// 0nly continue if we have a string
if (self::checkString($string))
{
// remove all other characters
$string = trim($string);
$string = preg_replace('/'.$spacer.'+/', ' ', $string);
$string = preg_replace('/\s+/', ' ', $string);
$string = preg_replace("/[^A-Za-z ]/", '', $string);
// return a string with all first letter of each word uppercase(no undersocre)
if ($type == 'W')
{
return ucwords(strtolower($string));
}
elseif ($type == 'w')
{
return strtolower($string);
}
elseif ($type == 'Ww')
{
return ucfirst(strtolower($string));
}
elseif ($type == 'WW')
{
return strtoupper($string);
}
elseif ($type == 'U')
// select final adaptations
if ($type === 'L' || $type === 'strtolower')
{
// replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string);
// default is to return lower
return strtolower($string);
}
elseif ($type === 'W')
{
// replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string);
// return all upper
return strtoupper($string);
// return a string with all first letter of each word uppercase(no undersocre)
return ucwords(strtolower($string));
}
elseif ($type == 'F')
elseif ($type === 'w' || $type === 'word')
{
// replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string);
// return with first caracter to upper
// return a string with all lowercase(no undersocre)
return strtolower($string);
}
elseif ($type === 'Ww' || $type === 'Word')
{
// return a string with first letter of the first word uppercase and all the rest lowercase(no undersocre)
return ucfirst(strtolower($string));
}
elseif ($type == 'L')
elseif ($type === 'WW' || $type === 'WORD')
{
// replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string);
// default is to return lower
return strtolower($string);
// return a string with all the uppercase(no undersocre)
return strtoupper($string);
}
// return string
return $string;
}
// not a string
return '';
elseif ($type === 'U' || $type === 'strtoupper')
{
// replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string);
// return all upper
return strtoupper($string);
}
elseif ($type === 'F' || $type === 'ucfirst')
{
// replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string);
// return with first caracter to upper
return ucfirst(strtolower($string));
}
elseif ($type === 'cA' || $type === 'cAmel' || $type === 'camelcase')
{
// convert all words to first letter uppercase
$string = ucwords(strtolower($string));
// remove white space
$string = preg_replace('/\s+/', '', $string);
// now return first letter lowercase
return lcfirst($string);
}
// return string
return $string;
}
// not a string
return '';
}
public static function htmlEscape($var, $charset = 'UTF-8', $sorten = false, $length = 40)

View File

@ -47,5 +47,5 @@ class ###Component###Controller###Views### extends JControllerAdmin
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
return $model;
}###CONTROLLEREXIMPORTMETHOD### ###CUSTOM_ADMIN_DYNAMIC_BUTTONS_CONTROLLER###
}###CONTROLLEREXIMPORTMETHOD### ###CUSTOM_ADMIN_DYNAMIC_BUTTONS_CONTROLLER### ###ADMIN_CUSTOM_BUTTONS_CONTROLLER_LIST###
}

View File

@ -47,7 +47,7 @@ class ###Component###Model###Views### extends JModelList
}
parent::__construct($config);
}
}###ADMIN_CUSTOM_BUTTONS_METHOD_LIST###
/**
* Method to auto-populate the model state.

View File

@ -52,7 +52,8 @@ class ###Component###ViewImport extends JViewLegacy
}
// Check for errors.
if (count($errors = $this->get('Errors'))){
if (count($errors = $this->get('Errors')))
{
JError::raiseError(500, implode('<br />', $errors));
return false;
}

View File

@ -132,7 +132,7 @@ class ###Component###View###Views### extends JViewLegacy
// add the button to the page
$dhtml = $layout->render(array('title' => $title));
$bar->appendButton('Custom', $dhtml, 'batch');
}###CUSTOM_ADMIN_DYNAMIC_BUTTONS###
}###CUSTOM_ADMIN_DYNAMIC_BUTTONS### ###ADMIN_CUSTOM_BUTTONS_LIST###
if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete))
{

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage componentbuilder.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage controller.php
@ -88,7 +88,7 @@ class ComponentbuilderController extends JControllerLegacy
if (ComponentbuilderHelper::checkString($view))
{
$views = array(
'component' => 'components',
'joomla_component' => 'joomla_components',
'admin_view' => 'admin_views',
'custom_admin_view' => 'custom_admin_views',
'site_view' => 'site_views',

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 95 of this MVC
@build 3rd February, 2017
@version @update number 99 of this MVC
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage admin_view.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 95 of this MVC
@build 3rd February, 2017
@version @update number 99 of this MVC
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage admin_views.php
@ -107,5 +107,5 @@ class ComponentbuilderControllerAdmin_views extends JControllerAdmin
$message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=admin_views', false), $message, 'error');
return;
}
}
}

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage ajax.json.php
@ -44,6 +44,7 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
// load the tasks
$this->registerTask('isNew', 'ajax');
$this->registerTask('isRead', 'ajax');
$this->registerTask('getComponentDetails', 'ajax');
$this->registerTask('tableColumns', 'ajax');
$this->registerTask('fieldSelectOptions', 'ajax');
$this->registerTask('getImportScripts', 'ajax');
@ -54,6 +55,8 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
$this->registerTask('dynamicFormDetails', 'ajax');
$this->registerTask('dbTableColumns', 'ajax');
$this->registerTask('viewTableColumns', 'ajax');
$this->registerTask('checkFunctionName', 'ajax');
$this->registerTask('usedin', 'ajax');
$this->registerTask('fieldOptions', 'ajax');
}
@ -145,6 +148,44 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
}
}
break;
case 'getComponentDetails':
try
{
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
$idValue = $jinput->get('id', NULL, 'INT');
if($idValue && $user->id != 0)
{
$result = $this->getModel('ajax')->getComponentDetails($idValue);
}
else
{
$result = false;
}
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $callback . "(".json_encode($result).");";
}
elseif($returnRaw)
{
echo json_encode($result);
}
else
{
echo "(".json_encode($result).");";
}
}
catch(Exception $e)
{
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $callback."(".json_encode($e).");";
}
else
{
echo "(".json_encode($e).");";
}
}
break;
case 'tableColumns':
try
{
@ -530,6 +571,85 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
}
}
break;
case 'checkFunctionName':
try
{
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
$functioNameValue = $jinput->get('functioName', NULL, 'STRING');
$idValue = $jinput->get('id', NULL, 'INT');
if($functioNameValue && $idValue && $user->id != 0)
{
$result = $this->getModel('ajax')->checkFunctionName($functioNameValue, $idValue);
}
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 'usedin':
try
{
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
$functioNameValue = $jinput->get('functioName', NULL, 'WORD');
$idValue = $jinput->get('id', NULL, 'INT');
$targetValue = $jinput->get('target', NULL, 'WORD');
if($functioNameValue && $idValue && $targetValue && $user->id != 0)
{
$result = $this->getModel('ajax')->usedin($functioNameValue, $idValue, $targetValue);
}
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 'fieldOptions':
try
{

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 11 of this MVC
@build 2nd February, 2017
@version @update number 26 of this MVC
@build 28th February, 2017
@created 1st February, 2017
@package Component Builder
@subpackage compiler.php
@ -66,15 +66,17 @@ class ComponentbuilderControllerCompiler extends JControllerAdmin
if($user->authorise('core.admin', 'com_componentbuilder'))
{
// get the post values
$jinput = JFactory::getApplication()->input;
$componentId = $jinput->post->get('component', 0, 'INT');
$version = $jinput->post->get('version', 0, 'INT');
$addBackup = $jinput->post->get('backup', 0, 'INT');
$addGit = $jinput->post->get('git', 0, 'INT');
$jinput = JFactory::getApplication()->input;
$componentId = $jinput->post->get('component', 0, 'INT');
$version = $jinput->post->get('version', 0, 'INT');
$addBackup = $jinput->post->get('backup', 0, 'INT');
$addGit = $jinput->post->get('git', 0, 'INT');
$addPlaceholders = $jinput->post->get('placeholders', 2, 'INT');
$debugLinenr = $jinput->post->get('debuglinenr', 2, 'INT');
// include component compiler
require_once JPATH_ADMINISTRATOR.'/components/com_componentbuilder/helpers/compiler.php';
$model = $this->getModel('compiler');
if ($model->builder($version,$componentId,$addBackup,$addGit))
if ($model->builder($version,$componentId,$addBackup,$addGit,$addPlaceholders,$debugLinenr))
{
$cache = JFactory::getCache('mod_menu');
$cache->clean();
@ -143,6 +145,7 @@ class ComponentbuilderControllerCompiler extends JControllerAdmin
$message .= '<b>URL:</b> <code>'.$url.'</code><br /><br />';
$message .= '<small>Hey! you can also download the file right now!</small><br /><a class="btn btn-success" href="'.$url.'" ><span class="icon-download icon-white"></span>Download</a></p>';
$message .= '<p><small><b>Remember!</b> This file is in your tmp folder and therefore publicly accessible untill you click [Clear tmp]!</small> </p>';
$message .= '<p><small>Compilation took <b>'.$counter['time'].'</b> seconds to complete.</small> </p>';
// set redirect
$this->setRedirect($redirect_url,$message,'message');
$app->setUserState('com_componentbuilder.extension_name', $counter['filename']);

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage componentbuilder.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 22 of this MVC
@build 3rd February, 2017
@build 1st March, 2017
@created 13th August, 2015
@package Component Builder
@subpackage custom_admin_view.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 22 of this MVC
@build 3rd February, 2017
@build 1st March, 2017
@created 13th August, 2015
@package Component Builder
@subpackage custom_admin_views.php
@ -107,5 +107,5 @@ class ComponentbuilderControllerCustom_admin_views extends JControllerAdmin
$message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=custom_admin_views', false), $message, 'error');
return;
}
}
}

View File

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

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 28 of this MVC
@build 9th February, 2017
@version @update number 81 of this MVC
@build 1st March, 2017
@created 11th October, 2016
@package Component Builder
@subpackage custom_codes.php
@ -107,5 +107,5 @@ class ComponentbuilderControllerCustom_codes extends JControllerAdmin
$message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=custom_codes', false), $message, 'error');
return;
}
}
}

View File

@ -107,5 +107,5 @@ class ComponentbuilderControllerDynamic_gets extends JControllerAdmin
$message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=dynamic_gets', false), $message, 'error');
return;
}
}
}

View File

@ -107,5 +107,5 @@ class ComponentbuilderControllerFields extends JControllerAdmin
$message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=fields', false), $message, 'error');
return;
}
}
}

View File

@ -107,5 +107,5 @@ class ComponentbuilderControllerFieldtypes extends JControllerAdmin
$message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=fieldtypes', false), $message, 'error');
return;
}
}
}

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage help.php

View File

@ -107,5 +107,5 @@ class ComponentbuilderControllerHelp_documents extends JControllerAdmin
$message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=help_documents', false), $message, 'error');
return;
}
}
}

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage import.php

View File

@ -10,11 +10,11 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 81 of this MVC
@build 3rd February, 2017
@version @update number 96 of this MVC
@build 17th February, 2017
@created 6th May, 2015
@package Component Builder
@subpackage component.php
@subpackage joomla_component.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');
/**
* Component Controller
* Joomla_component Controller
*/
class ComponentbuilderControllerComponent extends JControllerForm
class ComponentbuilderControllerJoomla_component extends JControllerForm
{
/**
* Current or most recently performed task.
@ -45,7 +45,7 @@ class ComponentbuilderControllerComponent extends JControllerForm
public function __construct($config = array())
{
$this->view_list = 'Components'; // safeguard for setting the return view listing to the main view.
$this->view_list = 'Joomla_components'; // safeguard for setting the return view listing to the main view.
parent::__construct($config);
}
@ -59,7 +59,14 @@ class ComponentbuilderControllerComponent extends JControllerForm
* @since 1.6
*/
protected function allowAdd($data = array())
{ // In the absense of better information, revert to the component permissions.
{
// Access check.
$access = JFactory::getUser()->authorise('joomla_component.access', 'com_componentbuilder');
if (!$access)
{
return false;
}
// In the absense of better information, revert to the component permissions.
return parent::allowAdd($data);
}
@ -84,10 +91,10 @@ class ComponentbuilderControllerComponent extends JControllerForm
if ($recordId)
{
// The record has been set. Check the record permissions.
$permission = $user->authorise('core.edit', 'com_componentbuilder.component.' . (int) $recordId);
$permission = $user->authorise('core.edit', 'com_componentbuilder.joomla_component.' . (int) $recordId);
if (!$permission)
{
if ($user->authorise('core.edit.own', 'com_componentbuilder.component.' . $recordId))
if ($user->authorise('core.edit.own', 'com_componentbuilder.joomla_component.' . $recordId))
{
// Now test the owner is the user.
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
@ -182,10 +189,10 @@ class ComponentbuilderControllerComponent extends JControllerForm
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Component', '', array());
$model = $this->getModel('Joomla_component', '', array());
// Preset the redirect
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=components' . $this->getRedirectToListAppend(), false));
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components' . $this->getRedirectToListAppend(), false));
return parent::batch($model);
}

View File

@ -10,11 +10,11 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 81 of this MVC
@build 3rd February, 2017
@version @update number 96 of this MVC
@build 17th February, 2017
@created 6th May, 2015
@package Component Builder
@subpackage components.php
@subpackage joomla_components.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');
/**
* Components Controller
* Joomla_components Controller
*/
class ComponentbuilderControllerComponents extends JControllerAdmin
class ComponentbuilderControllerJoomla_components extends JControllerAdmin
{
protected $text_prefix = 'COM_COMPONENTBUILDER_COMPONENTS';
protected $text_prefix = 'COM_COMPONENTBUILDER_JOOMLA_COMPONENTS';
/**
* Proxy for getModel.
* @since 2.5
*/
public function getModel($name = 'Component', $prefix = 'ComponentbuilderModel', $config = array())
public function getModel($name = 'Joomla_component', $prefix = 'ComponentbuilderModel', $config = array())
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
@ -52,7 +52,7 @@ class ComponentbuilderControllerComponents extends JControllerAdmin
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// check if export is allowed for this user.
$user = JFactory::getUser();
if ($user->authorise('component.export', 'com_componentbuilder') && $user->authorise('core.export', 'com_componentbuilder'))
if ($user->authorise('joomla_component.export', 'com_componentbuilder') && $user->authorise('core.export', 'com_componentbuilder'))
{
// Get the input
$input = JFactory::getApplication()->input;
@ -60,19 +60,19 @@ class ComponentbuilderControllerComponents extends JControllerAdmin
// Sanitize the input
JArrayHelper::toInteger($pks);
// Get the model
$model = $this->getModel('Components');
$model = $this->getModel('Joomla_components');
// 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,'Components_'.$date->format('jS_F_Y'),'Components exported ('.$date->format('jS F, Y').')','components');
ComponentbuilderHelper::xls($data,'Joomla_components_'.$date->format('jS_F_Y'),'Joomla components exported ('.$date->format('jS F, Y').')','joomla components');
}
}
// Redirect to the list screen with error.
$message = JText::_('COM_COMPONENTBUILDER_EXPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=components', false), $message, 'error');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error');
return;
}
@ -83,10 +83,10 @@ class ComponentbuilderControllerComponents extends JControllerAdmin
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// check if import is allowed for this user.
$user = JFactory::getUser();
if ($user->authorise('component.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder'))
if ($user->authorise('joomla_component.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder'))
{
// Get the import model
$model = $this->getModel('Components');
$model = $this->getModel('Joomla_components');
// get the headers to import
$headers = $model->getExImPortHeaders();
if (ComponentbuilderHelper::checkObject($headers))
@ -94,18 +94,18 @@ class ComponentbuilderControllerComponents extends JControllerAdmin
// Load headers to session.
$session = JFactory::getSession();
$headers = json_encode($headers);
$session->set('component_VDM_IMPORTHEADERS', $headers);
$session->set('backto_VDM_IMPORT', 'components');
$session->set('dataType_VDM_IMPORTINTO', 'component');
$session->set('joomla_component_VDM_IMPORTHEADERS', $headers);
$session->set('backto_VDM_IMPORT', 'joomla_components');
$session->set('dataType_VDM_IMPORTINTO', 'joomla_component');
// Redirect to import view.
$message = JText::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_COMPONENTS');
$message = JText::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_JOOMLA_COMPONENTS');
$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=components', false), $message, 'error');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error');
return;
}
}
}

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 66 of this MVC
@build 3rd February, 2017
@version @update number 67 of this MVC
@build 22nd February, 2017
@created 18th May, 2015
@package Component Builder
@subpackage layout.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 66 of this MVC
@build 3rd February, 2017
@version @update number 67 of this MVC
@build 22nd February, 2017
@created 18th May, 2015
@package Component Builder
@subpackage layouts.php
@ -107,5 +107,5 @@ class ComponentbuilderControllerLayouts extends JControllerAdmin
$message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=layouts', false), $message, 'error');
return;
}
}
}

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 48 of this MVC
@build 3rd February, 2017
@build 1st March, 2017
@created 29th May, 2015
@package Component Builder
@subpackage site_view.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 48 of this MVC
@build 3rd February, 2017
@build 1st March, 2017
@created 29th May, 2015
@package Component Builder
@subpackage site_views.php
@ -107,5 +107,5 @@ class ComponentbuilderControllerSite_views extends JControllerAdmin
$message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=site_views', false), $message, 'error');
return;
}
}
}

View File

@ -107,5 +107,5 @@ class ComponentbuilderControllerSnippets extends JControllerAdmin
$message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=snippets', false), $message, 'error');
return;
}
}
}

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 40 of this MVC
@build 3rd February, 2017
@build 22nd February, 2017
@created 26th May, 2015
@package Component Builder
@subpackage template.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 40 of this MVC
@build 3rd February, 2017
@build 22nd February, 2017
@created 26th May, 2015
@package Component Builder
@subpackage templates.php
@ -107,5 +107,5 @@ class ComponentbuilderControllerTemplates extends JControllerAdmin
$message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=templates', false), $message, 'error');
return;
}
}
}

View File

@ -41,6 +41,15 @@ class Compiler extends Infusion
*/
private $tempPath;
/*
* The timer
*
* @var string
*/
private $time_start;
private $time_end;
public $secondsCompiled;
public $filepath = '';
// fixed pathes
protected $dynamicIntegration = false;
@ -53,6 +62,8 @@ class Compiler extends Infusion
*/
public function __construct($config = array ())
{
// to check the compiler speed
$this->time_start = microtime(true);
// first we run the perent constructor
if (parent::__construct($config))
{
@ -87,43 +98,27 @@ class Compiler extends Infusion
{
return false;
}
// we can remove all undeeded data
$this->freeMemory();
// check if this component is install on the current website
if ($paths = $this->getLocalInstallPaths())
{
// start Automatic import of custom code
$userId = JFactory::getUser()->id;
$today = JFactory::getDate()->toSql();
// Get a db connection.
$db = JFactory::getDbo();
// get the custom code from installed files
$this->customCodeFactory($paths, $db, $userId, $today);
}
// check if we have custom code to add
$this->getCustomCode();
// now add the other custom code by placeholder
if (ComponentbuilderHelper::checkArray($this->addCustomCodeAt))
{
// load error messages incase code can not be added
$app = JFactory::getApplication();
$this->addCustomCodeViaPlaceholders($app);
}
// now insert into the new files
if (ComponentbuilderHelper::checkArray($this->customCode))
{
// load error messages incase code can not be added
$app = JFactory::getApplication();
$this->addCustomCode($app);
if ($this->getCustomCode())
{
$this->addCustomCode();
}
// set the lang data now
$this->setLangFileData();
// move the update server into place
$this->setUpdateServer();
// build read me
$this->buildReadMe();
// zip the component
if (!$this->zipComponent())
{
// done
// done with error
return false;
}
// end the timer here
$this->time_end = microtime(true);
$this->secondsCompiled = $this->time_end - $this->time_start;
// completed the compilation
return true;
}
return false;
@ -155,7 +150,9 @@ 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 = JFile::read($this->bomPath);
// first we do the static files
@ -163,6 +160,12 @@ 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'))
@ -173,17 +176,14 @@ class Compiler extends Infusion
if (strpos($string,'###BOM###') !== false)
{
list($wast,$code) = explode('###BOM###',$string);
$answer = str_replace(array_keys($this->fileContentStatic),array_values($this->fileContentStatic),$php.$bom.$code);
// add custom Code by placeholder if found
$this->getPlaceHolderKeys($static['path'], $answer);
$string = $php.$bom.$code;
$answer = $this->setPlaceholders($string, $this->fileContentStatic, 3);
// add to zip array
$this->writeFile($static['path'],$answer);
}
else
{
$answer = str_replace(array_keys($this->fileContentStatic),array_values($this->fileContentStatic),$string);
// add custom Code by placeholder if found
$this->getPlaceHolderKeys($static['path'], $answer);
$answer = $this->setPlaceholders($string, $this->fileContentStatic, 3);
// add to zip array
$this->writeFile($static['path'],$answer);
}
@ -213,19 +213,16 @@ class Compiler extends Infusion
if (strpos($string,'###BOM###') !== false)
{
list($bin,$code) = explode('###BOM###',$string);
$answer = str_replace(array_keys($this->fileContentStatic),array_values($this->fileContentStatic),$php.$bom.$code);
$answer = str_replace(array_keys($this->fileContentDynamic[$view]),array_values($this->fileContentDynamic[$view]),$answer);
// add custom Code by placeholder if found
$this->getPlaceHolderKeys($file['path'], $answer, $view);
$string = $php.$bom.$code;
$answer = $this->setPlaceholders($string, $this->fileContentStatic, 3);
$answer = $this->setPlaceholders($answer, $this->fileContentDynamic[$view], 3);
// add to zip array
$this->writeFile($file['path'],$answer);
}
else
{
$answer = str_replace(array_keys($this->fileContentStatic),array_values($this->fileContentStatic),$string);
$answer = str_replace(array_keys($this->fileContentDynamic[$view]),array_values($this->fileContentDynamic[$view]),$answer);
// add custom Code by placeholder if found
$this->getPlaceHolderKeys($file['path'], $answer, $view);
$answer = $this->setPlaceholders($string, $this->fileContentStatic, 3);
$answer = $this->setPlaceholders($answer, $this->fileContentDynamic[$view], 3);
// add to zip array
$this->writeFile($file['path'],$answer);
}
@ -239,119 +236,10 @@ class Compiler extends Infusion
}
// free up some memory
unset($this->newFiles['dynamic']);
// do a final run to update the readme file
$two = 0;
foreach ($this->newFiles['static'] as $static)
{
if (('README.md' === $static['name'] || 'README.txt' === $static['name']) && $this->componentData->addreadme && JFile::exists($static['path']))
{
$this->buildReadMe($static['path']);
$two++;
}
if ($two == 2)
{
break;
}
}
return true;
}
return false;
}
protected function getPlaceHolderKeys(&$file, &$content, &$view = '')
{
// check if line has custom code place holder
if (strpos($content, '[CUSTO'.'MCODE=') !== false)
{
if (!isset($this->addCustomCodeAt[$file]))
{
$this->addCustomCodeAt[$file] = array();
$this->addCustomCodeAt[$file]['ids'] = array();
$this->addCustomCodeAt[$file]['replace'] = array();
$this->addCustomCodeAt[$file]['view'] = $view;
}
$found = ComponentbuilderHelper::getAllBetween($content, '[CUSTO'.'MCODE=', ']');
if (ComponentbuilderHelper::checkArray($found))
{
foreach ($found as $id)
{
$this->addCustomCodeAt[$file]['ids'][$id] = $id;
}
}
}
}
protected function freeMemory()
{
// free up some memory
unset($this->newFiles['static']);
unset($this->customScriptBuilder);
unset($this->permissionCore);
unset($this->permissionDashboard);
unset($this->componentData->admin_views);
unset($this->componentData->site_views);
unset($this->componentData->custom_admin_views);
unset($this->componentData->config);
unset($this->joomlaVersionData);
unset($this->langContent);
unset($this->dbKeys);
unset($this->permissionBuilder);
unset($this->layoutBuilder);
unset($this->historyBuilder);
unset($this->aliasBuilder);
unset($this->titleBuilder);
unset($this->customBuilderList);
unset($this->hiddenFieldsBuilder);
unset($this->intFieldsBuilder);
unset($this->dynamicfieldsBuilder);
unset($this->maintextBuilder);
unset($this->customFieldLinksBuilder);
unset($this->setScriptUserSwitch);
unset($this->categoryBuilder);
unset($this->catCodeBuilder);
unset($this->checkboxBuilder);
unset($this->jsonItemBuilder);
unset($this->base64Builder);
unset($this->basicEncryptionBuilder);
unset($this->advancedEncryptionBuilder);
unset($this->getItemsMethodListStringFixBuilder);
unset($this->getItemsMethodEximportStringFixBuilder);
unset($this->selectionTranslationFixBuilder);
unset($this->listBuilder);
unset($this->customBuilder);
unset($this->editBodyViewScriptBuilder);
unset($this->queryBuilder);
unset($this->sortBuilder);
unset($this->searchBuilder);
unset($this->filterBuilder);
unset($this->fieldsNames);
unset($this->siteFields);
unset($this->siteFieldData);
unset($this->customFieldScript);
unset($this->configFieldSets);
unset($this->jsonStringBuilder);
unset($this->importCustomScripts);
unset($this->eximportView);
unset($this->uninstallBuilder);
unset($this->listColnrBuilder);
unset($this->customFieldBuilder);
unset($this->permissionFields);
unset($this->getAsLookup);
unset($this->secondRunAdmin);
unset($this->uninstallScriptBuilder);
unset($this->buildCategories);
unset($this->iconBuilder);
unset($this->validationFixBuilder);
unset($this->targetRelationControl);
unset($this->targetControlsScriptChecker);
unset($this->accessBuilder);
unset($this->tabCounter);
unset($this->linkedAdminViews);
unset($this->uniquekeys);
unset($this->uniquecodes);
$this->unsetNow('_adminViewData');
$this->unsetNow('_fieldData');
}
/**
* move the local update server xml file to a remote ftp server
@ -415,7 +303,26 @@ class Compiler extends Infusion
$this->fileContentStatic['###VERSION###'] = $this->fileContentStatic['###VERSION###GLOBAL'];
}
private function buildReadMe($path)
private function buildReadMe()
{
// do a final run to update the readme file
$two = 0;
foreach ($this->newFiles['static'] as $static)
{
if (('README.md' === $static['name'] || 'README.txt' === $static['name']) && $this->componentData->addreadme && JFile::exists($static['path']))
{
$this->setReadMe($static['path']);
$two++;
}
if ($two == 2)
{
break;
}
}
unset($this->newFiles['static']);
}
private function setReadMe($path)
{
// set readme data if not set already
if (!isset($this->fileContentStatic['###LINE_COUNT###']) || $this->fileContentStatic['###LINE_COUNT###'] != $this->lineCount)
@ -425,7 +332,7 @@ class Compiler extends Infusion
// get the file
$string = JFile::read($path);
// update the file
$answer = str_replace(array_keys($this->fileContentStatic),array_values($this->fileContentStatic),$string);
$answer = $this->setPlaceholders($string, $this->fileContentStatic);
// add to zip array
$this->writeFile($path,$answer);
}
@ -630,65 +537,13 @@ class Compiler extends Infusion
return false;
}
protected function addCustomCodeViaPlaceholders($app)
protected function addCustomCode()
{
// load error messages incase code can not be added
$app = JFactory::getApplication();
// reset all these
unset($this->placeholders['###view###']);
unset($this->placeholders['###VIEW###']);
unset($this->placeholders['###View###']);
unset($this->placeholders['[[[view]]]']);
unset($this->placeholders['[[[VIEW]]]']);
unset($this->placeholders['[[[View]]]']);
unset($this->placeholders['###views###']);
unset($this->placeholders['###VIEWS###']);
unset($this->placeholders['###Views###']);
unset($this->placeholders['[[[views]]]']);
unset($this->placeholders['[[[VIEWS]]]']);
unset($this->placeholders['[[[Views]]]']);
unset($this->placeholders['###SView###']);
unset($this->placeholders['###sview###']);
unset($this->placeholders['###SVIEW###']);
unset($this->placeholders['[[[SView]]]']);
unset($this->placeholders['[[[sview]]]']);
unset($this->placeholders['[[[SVIEW]]]']);
unset($this->placeholders['###SViews###']);
unset($this->placeholders['###sviews###']);
unset($this->placeholders['###SVIEWS###']);
unset($this->placeholders['[[[SViews]]]']);
unset($this->placeholders['[[[sviews]]]']);
unset($this->placeholders['[[[SVIEWS]]]']);
foreach ($this->addCustomCodeAt as $path => $item)
{
if (ComponentbuilderHelper::checkString($item['view']))
{
$this->placeholders['[[[view]]]'] = $item['view'];
}
elseif (isset($this->placeholders['[[[view]]]']))
{
unset($this->placeholders['[[[view]]]']);
}
if ($this->getCustomCode($item['ids']))
{
$code = array();
foreach($this->customCode as $item)
{
$placeholder = $this->getPlaceHolder(2, $item['id']);
$code['[CUSTOM'.'CODE='.$item['id'].']'] = $placeholder['start'] . PHP_EOL . str_replace(array_keys($this->placeholders),array_values($this->placeholders),$item['code']) . $placeholder['end'];
}
// now update the file
$string = JFile::read($path);
$answer = str_replace(array_keys($code),array_values($code),$string);
$this->writeFile($path,$answer);
}
else
{
$app->enqueueMessage(JText::sprintf('Custom code could not be added to <b>%s</b> <br />Since there where no publish code returned from the database.', $path), 'warning');
}
}
}
protected function addCustomCode($app)
{
$this->clearFromPlaceHolders('view');
$this->clearFromPlaceHolders('arg');
foreach($this->customCode as $nr => $target)
{
// reset each time per custom code
@ -718,7 +573,7 @@ class Compiler extends Infusion
$foundEnd = true;
}
$counter = 0;
// check if file is new structure
// check if file exist
if (JFile::exists($file))
{
foreach (new SplFileObject($file) as $lineNumber => $lineContent)
@ -782,8 +637,8 @@ class Compiler extends Infusion
}
if ($found)
{
$placeholder = $this->getPlaceHolder($target['type'], $target['id']);
$data = $placeholder['start'] . PHP_EOL . $target['code'] . $placeholder['end'];
$placeholder = $this->getPlaceHolder((int) $target['comment_type'].$target['type'], $target['id']);
$data = $placeholder['start'] . PHP_EOL . $this->setPlaceholders($target['code'], $this->placeholders). $placeholder['end'] . PHP_EOL;
if ($target['type'] == 2)
{
// found it now add code from the next line
@ -792,7 +647,7 @@ class Compiler extends Infusion
elseif ($target['type'] == 1 && $foundEnd)
{
// found it now add code from the next line
$this->addDataToFile($file, $data . PHP_EOL, $bites, (int) array_sum($replace));
$this->addDataToFile($file, $data, $bites, (int) array_sum($replace));
}
else
{
@ -823,7 +678,7 @@ class Compiler extends Infusion
$code = explode(PHP_EOL, $target['code']);
$code = PHP_EOL."// " .implode(PHP_EOL."// ",$code). PHP_EOL;
// get place holders
$placeholder = $this->getPlaceHolder($target['type'], $target['id']);
$placeholder = $this->getPlaceHolder((int) $target['comment_type'].$target['type'], $target['id']);
// build the data
$data = $placeholder['start'] . $code . $placeholder['end']. PHP_EOL;
// get the bites before insertion
@ -842,23 +697,31 @@ class Compiler extends Infusion
// Thanks to http://stackoverflow.com/a/16813550/1429677
protected function addDataToFile($file, $data, $position, $replace = null)
{
// start the process
$fpFile = fopen($file, "rw+");
$fpTemp = fopen('php://temp', "rw+");
$len = stream_copy_to_stream($fpFile, $fpTemp); // make a copy
fseek($fpFile, $position); // move to the position
// make a copy of the file
stream_copy_to_stream($fpFile, $fpTemp);
// move to the position where we should add the data
fseek($fpFile, $position);
// Add the data
fwrite($fpFile, $data);
// truncate file at the end of the data that was added
$remove = bcadd($position, mb_strlen($data, '8bit'));
ftruncate($fpFile, $remove);
// check if this was a replacement of data
if ($replace)
{
$position = bcadd($position, $replace);
}
fseek($fpTemp, $position); // move to the position
fwrite($fpFile, $data); // Add the data
// move to the position of the data that should remain below the new data
fseek($fpTemp, $position);
// copy that remaining data to the file
stream_copy_to_stream($fpTemp, $fpFile); // @Jack
fclose($fpFile); // close file
fclose($fpTemp); // close tmp
// done close both files
fclose($fpFile);
fclose($fpTemp);
// any help to improve this is welcome...
}
}

File diff suppressed because it is too large Load Diff

View File

@ -969,38 +969,4 @@ class Structure extends Get
}
return false;
}
/**
* get the local installed path of this component
*
* @return array of paths on success
*
*/
public function getLocalInstallPaths()
{
// set the local paths to search
$localPaths = array();
// the admin path
$localPaths['admin'] = JPATH_ADMINISTRATOR . '/components/com_'. $this->componentCodeName;
// only check for site path if the component has a site area!
if (!$this->removeSiteFolder)
{
$localPaths['site'] = JPATH_ROOT . '/components/com_'. $this->componentCodeName;
}
// TODO later to include the JS and CSS
// $localPaths['media'] = JPATH_ROOT . '/media/com_'. $this->fileContentStatic['###component###'];
// check if the local install is found
foreach ($localPaths as $key => $localPath)
{
if (!JFolder::exists($localPath))
{
unset($localPaths[$key]);
}
}
if (ComponentbuilderHelper::checkArray($localPaths))
{
return $localPaths;
}
return false;
}
}

View File

@ -1276,7 +1276,7 @@ class Fields extends Structure
{
$xmlValue = ComponentbuilderHelper::getBetween($field['settings']->xml, $property['name'] . '="', '"');
// replace the placeholders
$xmlValue = str_replace(array_keys($placeholders), array_values($placeholders), $xmlValue);
$xmlValue = $this->setPlaceholders($xmlValue, $placeholders);
}
elseif (strpos($property['name'], 'type_php_') !== false && $setCustom)
{
@ -1312,14 +1312,14 @@ class Fields extends Structure
// load the component name
$fieldAttributes['custom']['component'] = ComponentbuilderHelper::getBetween($field['settings']->xml, 'component="', '"');
// replace the placeholders
$fieldAttributes['custom']['component'] = str_replace(array_keys($placeholders), array_values($placeholders), $fieldAttributes['custom']['component']);
$fieldAttributes['custom']['component'] = $this->setPlaceholders($fieldAttributes['custom']['component'], $placeholders);
}
elseif ($property['name'] === 'table' && $setCustom)
{
// load the main table that is queried
$fieldAttributes['custom']['table'] = ComponentbuilderHelper::getBetween($field['settings']->xml, 'table="', '"');
// replace the placeholders
$fieldAttributes['custom']['table'] = str_replace(array_keys($placeholders), array_values($placeholders), $fieldAttributes['custom']['table']);
$fieldAttributes['custom']['table'] = $this->setPlaceholders($fieldAttributes['custom']['table'], $placeholders);
}
elseif ($property['name'] === 'value_field' && $setCustom)
{
@ -1382,7 +1382,7 @@ class Fields extends Structure
if (ComponentbuilderHelper::checkString($xmlValue) && $property['translatable'] == 1)
{
// replace placeholders
$xmlValue = str_replace(array_keys($placeholders), array_values($placeholders), $xmlValue);
$xmlValue = $this->setPlaceholders($xmlValue, $placeholders);
// insure custom lables dont get messed up
if ($setCustom)
{
@ -1818,16 +1818,16 @@ class Fields extends Structure
{
if ($line == 1)
{
$phpCode .= str_replace(array_keys($tabBreak),array_values($tabBreak),$code);
$phpCode .= $this->setPlaceholders($code, $tabBreak);
}
else
{
$phpCode .= PHP_EOL."\t\t".str_replace(array_keys($tabBreak),array_values($tabBreak),$code);
$phpCode .= PHP_EOL."\t\t".$this->setPlaceholders($code, $tabBreak);
}
}
}
// replace the placholders
$phpCode = str_replace(array_keys($replace),array_values($replace),$phpCode);
$phpCode = $this->setPlaceholders($phpCode, $replace);
}
else
{
@ -1851,16 +1851,16 @@ class Fields extends Structure
{
if ($line == 1)
{
$phpxCode .= str_replace(array_keys($tabBreak),array_values($tabBreak),$code);
$phpxCode .= $this->setPlaceholders($code, $tabBreak);
}
else
{
$phpxCode .= PHP_EOL."\t\t".str_replace(array_keys($tabBreak),array_values($tabBreak),$code);
$phpxCode .= PHP_EOL."\t\t".$this->setPlaceholders($code, $tabBreak);
}
}
}
// replace the placholders
$phpxCode = str_replace(array_keys($replace),array_values($replace),$phpxCode);
$phpxCode = $this->setPlaceholders($phpxCode, $replace);
}
else
{

View File

@ -31,15 +31,7 @@ defined('_JEXEC') or die('Restricted access');
*/
class Interpretation extends Fields
{
/*
* The line numbers Switch
*
* @var boolean
*/
public $loadLineNr = false;
public $theContributors = '';
public $placeholders = array();
public $uninstallBuilder = array();
public $listColnrBuilder = array();
public $permissionBuilder = array();
@ -65,8 +57,6 @@ class Interpretation extends Fields
// first we run the perent constructor
if (parent::__construct($config))
{
// set if line numbers should be added to comments
$this->loadLineNr = ($this->componentData->debug_linenr) ? true:false;
return true;
}
return false;
@ -2271,7 +2261,7 @@ class Interpretation extends Fields
{
foreach ($joinedChecker as $joinedString)
{
$joine .= str_replace(array_keys($placeholders),array_values($placeholders),$joinedString);
$joine .= $this->setPlaceholders($joinedString, $placeholders);
}
}
if (ComponentbuilderHelper::checkString($decoder) || ComponentbuilderHelper::checkString($uikit) || ComponentbuilderHelper::checkString($decoder_filter) || ComponentbuilderHelper::checkString($joine))
@ -2484,7 +2474,8 @@ class Interpretation extends Fields
$get->php_calculation = (array) explode(PHP_EOL,$get->php_calculation);
if (ComponentbuilderHelper::checkArray($get->php_calculation))
{
$getItem .= str_replace(array_keys($this->placeholders),array_values($this->placeholders),PHP_EOL."\t\t\t\t".implode(PHP_EOL."\t\t\t\t",$get->php_calculation));
$_tmp = PHP_EOL."\t\t\t\t".implode(PHP_EOL."\t\t\t\t",$get->php_calculation);
$getItem .= $this->setPlaceholders($_tmp, $this->placeholders);
}
}
$getItem .= PHP_EOL."\t\t\t}";
@ -2573,7 +2564,8 @@ class Interpretation extends Fields
$view['settings']->php_jview_display = (array) explode(PHP_EOL,$view['settings']->php_jview_display);
if (ComponentbuilderHelper::checkArray($view['settings']->php_jview_display))
{
$method .= str_replace(array_keys($this->placeholders),array_values($this->placeholders),PHP_EOL."\t\t".implode(PHP_EOL."\t\t",$view['settings']->php_jview_display));
$_tmp = PHP_EOL."\t\t".implode(PHP_EOL."\t\t",$view['settings']->php_jview_display);
$method .= $this->setPlaceholders($_tmp, $this->placeholders);
}
}
if ('site' === $this->target)
@ -2727,7 +2719,8 @@ class Interpretation extends Fields
$view['settings']->php_document = (array) explode(PHP_EOL,$view['settings']->php_document);
if (ComponentbuilderHelper::checkArray($view['settings']->php_document))
{
return str_replace(array_keys($this->placeholders),array_values($this->placeholders),PHP_EOL."\t\t".implode(PHP_EOL."\t\t",$view['settings']->php_document));
$_tmp = PHP_EOL."\t\t".implode(PHP_EOL."\t\t",$view['settings']->php_document);
return $this->setPlaceholders($_tmp, $this->placeholders);
}
}
return '';
@ -2735,20 +2728,33 @@ class Interpretation extends Fields
public function setCustomButtons(&$view, $type = 1, $tab = '')
{
if (1 == $type)
{
$viewName = $view['settings']->code;
}
if (2 == $type)
{
$viewName = ComponentbuilderHelper::safeString($view['settings']->name_single);
}
// ensure correct target is set
$TARGET = ComponentbuilderHelper::safeString($this->target,'U');
// set the custom buttons ###CUSTOM_BUTTONS_CONTROLLER###
$this->fileContentDynamic[$viewName]['###'.$TARGET.'_CUSTOM_BUTTONS_CONTROLLER###'] = '';
// set the custom buttons ###CUSTOM_BUTTONS_METHOD###
$this->fileContentDynamic[$viewName]['###'.$TARGET.'_CUSTOM_BUTTONS_METHOD###'] = '';
if (1 == $type || 2 == $type)
{
if (1 == $type)
{
$viewName = $view['settings']->code;
}
if (2 == $type)
{
$viewName = ComponentbuilderHelper::safeString($view['settings']->name_single);
}
// set the custom buttons ###CUSTOM_BUTTONS_CONTROLLER###
$this->fileContentDynamic[$viewName]['###'.$TARGET.'_CUSTOM_BUTTONS_CONTROLLER###'] = '';
// set the custom buttons ###CUSTOM_BUTTONS_METHOD###
$this->fileContentDynamic[$viewName]['###'.$TARGET.'_CUSTOM_BUTTONS_METHOD###'] = '';
}
elseif (3 == $type)
{
// set the names
$viewName = ComponentbuilderHelper::safeString($view['settings']->name_single);
$viewsName = ComponentbuilderHelper::safeString($view['settings']->name_list);
// set the custom buttons ###CUSTOM_BUTTONS_CONTROLLER_LIST###
$this->fileContentDynamic[$viewsName]['###'.$TARGET.'_CUSTOM_BUTTONS_CONTROLLER_LIST###'] = '';
// set the custom buttons ###CUSTOM_BUTTONS_METHOD_LIST###
$this->fileContentDynamic[$viewsName]['###'.$TARGET.'_CUSTOM_BUTTONS_METHOD_LIST###'] = '';
}
// if site add buttons to view
if ($this->target === 'site')
{
@ -2785,30 +2791,10 @@ class Interpretation extends Fields
// check if custom button should be added
if (isset($view['settings']->add_custom_button) && $view['settings']->add_custom_button == 1)
{
// insure the controller and model strings are added
if (ComponentbuilderHelper::checkString($view['settings']->php_controller) && $view['settings']->php_controller != '//')
{
// set the custom buttons ###CUSTOM_BUTTONS_CONTROLLER###
$this->fileContentDynamic[$viewName]['###'.$TARGET.'_CUSTOM_BUTTONS_CONTROLLER###'] =
PHP_EOL.PHP_EOL.str_replace(array_keys($this->placeholders),array_values($this->placeholders),$view['settings']->php_controller);
if ('site' === $this->target)
{
// add the controller for this view
// build the file
$target = array($this->target => $viewName);
$this->buildDynamique($target,'custom_form');
###GET_FORM_CUSTOM###
}
}
if (ComponentbuilderHelper::checkString($view['settings']->php_model) && $view['settings']->php_model != '//')
{
// set the custom buttons ###CUSTOM_BUTTONS_METHOD###
$this->fileContentDynamic[$viewName]['###'.$TARGET.'_CUSTOM_BUTTONS_METHOD###'] =
PHP_EOL.PHP_EOL.str_replace(array_keys($this->placeholders),array_values($this->placeholders),$view['settings']->php_model);
}
$buttons = array();
$functionNames = array();
if (isset($view['settings']->custom_buttons) && ComponentbuilderHelper::checkArray($view['settings']->custom_buttons))
{
$buttons = array();
foreach ($view['settings']->custom_buttons as $custom_button)
{
if ($custom_button['target'] != 2 || $this->target === 'site')
@ -2824,11 +2810,69 @@ class Interpretation extends Fields
$buttons[] = "\t".$tab."\t\tJToolBarHelper::custom('".$viewName.".".$custom_button['method']."', '".$custom_button['icomoon']."', '', '".$keyLang."', false);";
$buttons[] = "\t".$tab."\t}";
}
// load the list button
elseif (3 == $type && ($custom_button['target'] == 2 || $custom_button['target'] == 3))
{
// Load to lang
$keyLang = $this->langPrefix.'_'.ComponentbuilderHelper::safeString($custom_button['name'],'U');
$keyCode = ComponentbuilderHelper::safeString($custom_button['name']);
$this->langContent[$this->lang][$keyLang] = trim($custom_button['name']);
// add cpanel button TODO does not work well on site with permissions
$buttons[] = "\t".$tab."\tif (\$this->canDo->get('".$viewName.".".$keyCode."'))";
$buttons[] = "\t".$tab."\t{";
$buttons[] = "\t".$tab."\t\t//".$this->setLine(__LINE__)." add ".$custom_button['name']." button.";
$buttons[] = "\t".$tab."\t\tJToolBarHelper::custom('".$viewsName.".".$custom_button['method']."', '".$custom_button['icomoon']."', '', '".$keyLang."', false);";
$buttons[] = "\t".$tab."\t}";
}
}
if (ComponentbuilderHelper::checkArray($buttons))
}
// load the model and controller
if (3 == $type)
{
// insure the controller and model strings are added
if (isset($view['settings']->php_controller_list) && ComponentbuilderHelper::checkString($view['settings']->php_controller_list) && $view['settings']->php_controller_list != '//')
{
return PHP_EOL.implode(PHP_EOL,$buttons);
// set the custom buttons ###CUSTOM_BUTTONS_CONTROLLER###
$this->fileContentDynamic[$viewsName]['###'.$TARGET.'_CUSTOM_BUTTONS_CONTROLLER_LIST###'] =
PHP_EOL.PHP_EOL.$this->setPlaceholders($view['settings']->php_controller_list, $this->placeholders);
}
// load the model
if (isset($view['settings']->php_model_list) && ComponentbuilderHelper::checkString($view['settings']->php_model_list) && $view['settings']->php_model_list != '//')
{
// set the custom buttons ###CUSTOM_BUTTONS_METHOD###
$this->fileContentDynamic[$viewsName]['###'.$TARGET.'_CUSTOM_BUTTONS_METHOD_LIST###'] =
PHP_EOL.PHP_EOL.$this->setPlaceholders($view['settings']->php_model_list, $this->placeholders);
}
}
else
{
// insure the controller and model strings are added
if (ComponentbuilderHelper::checkString($view['settings']->php_controller) && $view['settings']->php_controller != '//')
{
// set the custom buttons ###CUSTOM_BUTTONS_CONTROLLER###
$this->fileContentDynamic[$viewName]['###'.$TARGET.'_CUSTOM_BUTTONS_CONTROLLER'.$list.'###'] =
PHP_EOL.PHP_EOL.$this->setPlaceholders($view['settings']->php_controller, $this->placeholders);
if ('site' === $this->target)
{
// add the controller for this view
// build the file
$target = array($this->target => $viewName);
$this->buildDynamique($target,'custom_form');
###GET_FORM_CUSTOM###
}
}
// load the model
if (ComponentbuilderHelper::checkString($view['settings']->php_model) && $view['settings']->php_model != '//')
{
// set the custom buttons ###CUSTOM_BUTTONS_METHOD###
$this->fileContentDynamic[$viewName]['###'.$TARGET.'_CUSTOM_BUTTONS_METHOD'.$list.'###'] =
PHP_EOL.PHP_EOL.$this->setPlaceholders($view['settings']->php_model, $this->placeholders);
}
}
// return buttons if they were build
if (ComponentbuilderHelper::checkArray($buttons))
{
return PHP_EOL.implode(PHP_EOL,$buttons);
}
}
return '';
@ -2840,7 +2884,7 @@ class Interpretation extends Fields
{
if (ComponentbuilderHelper::checkString($view['settings']->css))
{
return str_replace(array_keys($this->placeholders),array_values($this->placeholders),$view['settings']->css);
return $this->setPlaceholders($view['settings']->css, $this->placeholders);
}
}
return '';
@ -2854,8 +2898,8 @@ class Interpretation extends Fields
if (ComponentbuilderHelper::checkArray($view['settings']->css_document))
{
$script = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Set the Custom CSS script to view".PHP_EOL."\t\t".'$this->document->addStyleDeclaration("';
$cssDocument = str_replace('"', '\"', implode(PHP_EOL."\t\t\t",$view['settings']->css_document));
return $script.str_replace(array_keys($this->placeholders),array_values($this->placeholders),PHP_EOL."\t\t\t".$cssDocument).PHP_EOL."\t\t".'");';
$cssDocument = PHP_EOL."\t\t\t".str_replace('"', '\"', implode(PHP_EOL."\t\t\t",$view['settings']->css_document));
return $script.$this->setPlaceholders($cssDocument, $this->placeholders).PHP_EOL."\t\t".'");';
}
}
return '';
@ -2869,8 +2913,8 @@ class Interpretation extends Fields
if (ComponentbuilderHelper::checkArray($view['settings']->js_document))
{
$script = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Set the Custom JS script to view".PHP_EOL."\t\t".'$this->document->addScriptDeclaration("';
$jsDocument = str_replace('"', '\"', implode(PHP_EOL."\t\t\t",$view['settings']->js_document));
return $script.str_replace(array_keys($this->placeholders),array_values($this->placeholders),PHP_EOL."\t\t\t".$jsDocument).PHP_EOL."\t\t".'");';
$jsDocument = PHP_EOL."\t\t\t".str_replace('"', '\"', implode(PHP_EOL."\t\t\t",$view['settings']->js_document));
return $script.$this->setPlaceholders($jsDocument, $this->placeholders).PHP_EOL."\t\t".'");';
}
}
return '';
@ -3149,7 +3193,7 @@ class Interpretation extends Fields
{
if ($view['settings']->add_php_jview == 1)
{
return str_replace(array_keys($this->placeholders),array_values($this->placeholders),PHP_EOL.PHP_EOL.$view['settings']->php_jview);
return PHP_EOL.PHP_EOL.$this->setPlaceholders($view['settings']->php_jview, $this->placeholders);
}
return '';
}
@ -3167,7 +3211,7 @@ class Interpretation extends Fields
{
$this->placeholders['[[[LIMITBOX]]]'] = '<?php echo $this->pagination->getLimitBox(); ?>';
}
$body[] = str_replace(array_keys($this->placeholders),array_values($this->placeholders),$view['settings']->default);
$body[] = $this->setPlaceholders($view['settings']->default, $this->placeholders);
$body[] = PHP_EOL.'<?php if (isset($this->items) && '.$this->fileContentStatic['###component###'].'Helper::checkArray($this->items) && count($this->items) > 4): ?>';
$body[] = '<form name="adminForm" method="post">';
$body[] = "\t".'<div class="pagination">';
@ -3191,7 +3235,7 @@ class Interpretation extends Fields
}
else
{
return PHP_EOL. str_replace(array_keys($this->placeholders),array_values($this->placeholders),$view['settings']->default);
return PHP_EOL. $this->setPlaceholders($view['settings']->default, $this->placeholders);
}
}
@ -3233,7 +3277,8 @@ class Interpretation extends Fields
$view['settings']->php_view = (array) explode(PHP_EOL,$view['settings']->php_view);
if (ComponentbuilderHelper::checkArray($view['settings']->php_view))
{
return str_replace(array_keys($this->placeholders),array_values($this->placeholders),PHP_EOL.PHP_EOL.implode(PHP_EOL,$view['settings']->php_view));
$_tmp = PHP_EOL.PHP_EOL.implode(PHP_EOL,$view['settings']->php_view);
return $this->setPlaceholders($_tmp, $this->placeholders);
}
}
return '';
@ -3254,7 +3299,7 @@ class Interpretation extends Fields
// set the file data
$TARGET = ComponentbuilderHelper::safeString($this->target,'U');
// ###SITE_TEMPLATE_BODY### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code.'_'.$template]['###'.$TARGET.'_TEMPLATE_BODY###'] = PHP_EOL . str_replace(array_keys($this->placeholders),array_values($this->placeholders),$data['html']);
$this->fileContentDynamic[$view['settings']->code.'_'.$template]['###'.$TARGET.'_TEMPLATE_BODY###'] = PHP_EOL . $this->setPlaceholders($data['html'], $this->placeholders);
// ###SITE_TEMPLATE_CODE_BODY### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code.'_'.$template]['###'.$TARGET.'_TEMPLATE_CODE_BODY###'] = $this->setCustomViewTemplateCode($data['php_view']);
}
@ -3269,7 +3314,7 @@ class Interpretation extends Fields
if (ComponentbuilderHelper::checkArray($php_view))
{
$php_view = PHP_EOL.PHP_EOL.implode(PHP_EOL,$php_view);
return str_replace(array_keys($this->placeholders),array_values($this->placeholders),$php_view);
return $this->setPlaceholders($php_view, $this->placeholders);
}
}
return '';
@ -3291,14 +3336,14 @@ class Interpretation extends Fields
if (ComponentbuilderHelper::checkArray($php_view))
{
$php_view = PHP_EOL.PHP_EOL.implode(PHP_EOL,$php_view);
$this->fileContentDynamic[$layout]['###'.$TARGET.'_LAYOUT_CODE###'] = str_replace(array_keys($this->placeholders),array_values($this->placeholders),$php_view);
$this->fileContentDynamic[$layout]['###'.$TARGET.'_LAYOUT_CODE###'] = $this->setPlaceholders($php_view, $this->placeholders);
}
else
{
$this->fileContentDynamic[$layout]['###'.$TARGET.'_LAYOUT_CODE###'] = '';
}
// ###SITE_LAYOUT_BODY### <<<DYNAMIC>>>
$this->fileContentDynamic[$layout]['###'.$TARGET.'_LAYOUT_BODY###'] = PHP_EOL . str_replace(array_keys($this->placeholders),array_values($this->placeholders),$data['html']);
$this->fileContentDynamic[$layout]['###'.$TARGET.'_LAYOUT_BODY###'] = PHP_EOL . $this->setPlaceholders($data['html'], $this->placeholders);
}
}
@ -4776,7 +4821,7 @@ class Interpretation extends Fields
{
$db .= PHP_EOL."\t`id` INT(11) NOT NULL AUTO_INCREMENT,";
}
$db .= PHP_EOL."\t`asset_id` INT(255) UNSIGNED NOT NULL DEFAULT '0',";
$db .= PHP_EOL."\t`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.',";
ksort($fields);
foreach ($fields as $field => $data)
{
@ -4822,22 +4867,22 @@ class Interpretation extends Fields
// check if default field was over written
if (!isset($this->fieldsNames[$view]['params']))
{
$db .= PHP_EOL."\t`params` TEXT NOT NULL,";
$db .= PHP_EOL."\t`params` text NOT NULL DEFAULT '',";
}
// check if default field was over written
if (!isset($this->fieldsNames[$view]['published']))
{
$db .= PHP_EOL."\t`published` TINYINT(1) NOT NULL DEFAULT '1',";
$db .= PHP_EOL."\t`published` TINYINT(3) NOT NULL DEFAULT 1,";
}
// check if default field was over written
if (!isset($this->fieldsNames[$view]['created_by']))
{
$db .= PHP_EOL."\t`created_by` INT(11) NOT NULL DEFAULT '0',";
$db .= PHP_EOL."\t`created_by` INT(10) unsigned NOT NULL DEFAULT 0,";
}
// check if default field was over written
if (!isset($this->fieldsNames[$view]['modified_by']))
{
$db .= PHP_EOL."\t`modified_by` INT(11) NOT NULL DEFAULT '0',";
$db .= PHP_EOL."\t`modified_by` INT(10) unsigned NOT NULL DEFAULT 0,";
}
// check if default field was over written
if (!isset($this->fieldsNames[$view]['created']))
@ -4852,7 +4897,7 @@ class Interpretation extends Fields
// check if default field was over written
if (!isset($this->fieldsNames[$view]['checked_out']))
{
$db .= PHP_EOL."\t`checked_out` INT(11) NOT NULL,";
$db .= PHP_EOL."\t`checked_out` int(11) unsigned NOT NULL DEFAULT 0,";
}
// check if default field was over written
if (!isset($this->fieldsNames[$view]['checked_out_time']))
@ -4862,22 +4907,22 @@ class Interpretation extends Fields
// check if default field was over written
if (!isset($this->fieldsNames[$view]['version']))
{
$db .= PHP_EOL."\t`version` INT(11) NOT NULL DEFAULT '1',";
$db .= PHP_EOL."\t`version` INT(10) unsigned NOT NULL DEFAULT 1,";
}
// check if default field was over written
if (!isset($this->fieldsNames[$view]['hits']))
{
$db .= PHP_EOL."\t`hits` INT(11) NOT NULL DEFAULT '0',";
$db .= PHP_EOL."\t`hits` INT(10) unsigned NOT NULL DEFAULT 0,";
}
// check if view has access
if (isset($this->accessBuilder[$view]) && ComponentbuilderHelper::checkString($this->accessBuilder[$view]))
{
$db .= PHP_EOL."\t`access` INT(11) DEFAULT NULL,";
$db .= PHP_EOL."\t`access` INT(10) unsigned NOT NULL DEFAULT 0,";
}
// check if default field was over written
if (!isset($this->fieldsNames[$view]['ordering']))
{
$db .= PHP_EOL."\t`ordering` INT(11) NOT NULL DEFAULT '0',";
$db .= PHP_EOL."\t`ordering` INT(11) NOT NULL DEFAULT 0,";
}
// check if metadata is added to this view
if (isset($this->metadataBuilder[$view]) && ComponentbuilderHelper::checkString($this->metadataBuilder[$view]))
@ -4934,7 +4979,7 @@ class Interpretation extends Fields
foreach ($this->customScriptBuilder['sql'] as $for => $customSql)
{
$placeholders = array('[[[component]]]' => $component, '[[[view]]]' => $for);
$db .= PHP_EOL.PHP_EOL.str_replace(array_keys($placeholders),array_values($placeholders),$customSql);
$db .= PHP_EOL.PHP_EOL.$this->setPlaceholders($customSql, $placeholders);
}
}
@ -8019,12 +8064,12 @@ class Interpretation extends Fields
{
$fileScript = '';
}
$fileScript .= PHP_EOL.PHP_EOL.str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder['view_file'][$viewName]);
$fileScript .= PHP_EOL.PHP_EOL.$this->setPlaceholders($this->customScriptBuilder['view_file'][$viewName], $this->placeholders);
}
// add custom script to footer
if (isset($this->customScriptBuilder['view_footer'][$viewName]) && ComponentbuilderHelper::checkString($this->customScriptBuilder['view_footer'][$viewName]))
{
$customFooterScript = PHP_EOL.PHP_EOL.str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder['view_footer'][$viewName]);
$customFooterScript = PHP_EOL.PHP_EOL.$this->setPlaceholders($this->customScriptBuilder['view_footer'][$viewName], $this->placeholders);
if (strpos($customFooterScript,'<?php') === false)
{
// only add now if no php is added to the footer script
@ -8841,7 +8886,7 @@ class Interpretation extends Fields
foreach ($this->customScriptBuilder[$target]['ajax_model'] as $view => $method)
{
$methods .= PHP_EOL.PHP_EOL."\t//".$this->setLine(__LINE__)." Used in ".$view.PHP_EOL;
$methods .= str_replace(array_keys($this->placeholders),array_values($this->placeholders),$method);
$methods .= $this->setPlaceholders($method, $this->placeholders);
}
}
return $methods;
@ -8961,7 +9006,7 @@ class Interpretation extends Fields
$function[] = "\t\t\t\$model = \$this->getModel();";
}
$function[] = "\t\t\t\$results = array_unique(\$results);";
$function[] = "\t\t\t\$filter = array();";
$function[] = "\t\t\t\$_filter = array();";
$function[] = "\t\t\tforeach (\$results as \$".$filter['code'].")";
$function[] = "\t\t\t{";
@ -8971,20 +9016,20 @@ class Interpretation extends Fields
$function[] = "\t\t\t\t//".$this->setLine(__LINE__)." Translate the ".$filter['code']." selection";
$function[] = "\t\t\t\t\$text = \$model->selectionTranslation(\$".$filter['code'].",'".$filter['code']."');";
$function[] = "\t\t\t\t//".$this->setLine(__LINE__)." Now add the ".$filter['code']." and its text to the options array";
$function[] = "\t\t\t\t\$filter[] = JHtml::_('select.option', \$".$filter['code'].", JText::_(\$text));";
$function[] = "\t\t\t\t\$_filter[] = JHtml::_('select.option', \$".$filter['code'].", JText::_(\$text));";
}
elseif ($filter['type'] === 'user')
{
$function[] = "\t\t\t\t//".$this->setLine(__LINE__)." Now add the ".$filter['code']." and its text to the options array";
$function[] = "\t\t\t\t\$filter[] = JHtml::_('select.option', \$".$filter['code'].", JFactory::getUser(\$".$filter['code'].")->name);";
$function[] = "\t\t\t\t\$_filter[] = JHtml::_('select.option', \$".$filter['code'].", JFactory::getUser(\$".$filter['code'].")->name);";
}
else
{
$function[] = "\t\t\t\t//".$this->setLine(__LINE__)." Now add the ".$filter['code']." and its text to the options array";
$function[] = "\t\t\t\t\$filter[] = JHtml::_('select.option', \$".$filter['code'].", \$".$filter['code'].");";
$function[] = "\t\t\t\t\$_filter[] = JHtml::_('select.option', \$".$filter['code'].", \$".$filter['code'].");";
}
$function[] = "\t\t\t}";
$function[] = "\t\t\treturn \$filter;";
$function[] = "\t\t\treturn \$_filter;";
$function[] = "\t\t}";
$function[] = "\t\treturn false;";
$function[] = "\t}";
@ -11138,7 +11183,7 @@ class Interpretation extends Fields
$this->DashboardGetCustomData = ComponentbuilderHelper::getAllBetween($this->componentData->php_dashboard_methods,'public function get','()');
// return the methods
return PHP_EOL.PHP_EOL.str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->componentData->php_dashboard_methods);
return PHP_EOL.PHP_EOL.$this->setPlaceholders($this->componentData->php_dashboard_methods, $this->placeholders);
}
return '';
}
@ -11176,7 +11221,7 @@ class Interpretation extends Fields
// build the tabs and accordians
foreach ($this->componentData->dashboard_tab as $data)
{
$builder[$data['name']][$data['header']] = str_replace(array_keys($this->placeholders),array_values($this->placeholders),$data['html']);
$builder[$data['name']][$data['header']] = $this->setPlaceholders($data['html'], $this->placeholders);
}
// since we have custom tabs we must load the tab structure around the cpanel
$display[] = '<div id="j-main-container" class="span12">';

View File

@ -34,6 +34,7 @@ class Infusion extends Interpretation
public $eximportView = array();
public $importCustomScripts = array();
public $langFiles = array();
public $removeSiteFolder = false;
/**
@ -150,15 +151,15 @@ class Infusion extends Interpretation
$this->lang = $keepLang;
// ###ADMINCSS###
$this->fileContentStatic['###ADMINCSS###'] = str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder['component_css']);
$this->fileContentStatic['###ADMINCSS###'] = $this->setPlaceholders($this->customScriptBuilder['component_css'], $this->placeholders);
// ###SITECSS###
$this->fileContentStatic['###SITECSS###'] = str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder['component_css']);
$this->fileContentStatic['###SITECSS###'] = $this->setPlaceholders($this->customScriptBuilder['component_css'], $this->placeholders);
// ###CUSTOM_HELPER_SCRIPT###
$this->fileContentStatic['###CUSTOM_HELPER_SCRIPT###'] = str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder['component_php_helper_admin']);
$this->fileContentStatic['###CUSTOM_HELPER_SCRIPT###'] = $this->setPlaceholders($this->customScriptBuilder['component_php_helper_admin'], $this->placeholders);
// ###BOTH_CUSTOM_HELPER_SCRIPT###
$this->fileContentStatic['###BOTH_CUSTOM_HELPER_SCRIPT###'] = str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder['component_php_helper_both']);
$this->fileContentStatic['###BOTH_CUSTOM_HELPER_SCRIPT###'] = $this->setPlaceholders($this->customScriptBuilder['component_php_helper_both'], $this->placeholders);
// ###ADMIN_GLOBAL_EVENT_HELPER###
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] = '';
@ -181,7 +182,7 @@ class Infusion extends Interpretation
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'**/';
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'public static function globalEvent($document)';
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'{';
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL.str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder['component_php_admin_event']);
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL.$this->setPlaceholders($this->customScriptBuilder['component_php_admin_event'], $this->placeholders);
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'}';
}
@ -290,7 +291,7 @@ class Infusion extends Interpretation
{
// ###DOCUMENT_CUSTOM_PHP### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_single]['###DOCUMENT_CUSTOM_PHP###']
= PHP_EOL.str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder['php_document'][$viewName_single]);
= PHP_EOL.$this->setPlaceholders($this->customScriptBuilder['php_document'][$viewName_single], $this->placeholders);
// clear some memory
unset($this->customScriptBuilder['php_document'][$viewName_single]);
}
@ -351,7 +352,7 @@ class Infusion extends Interpretation
{
// ###VIEWCSS### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_single]['###VIEWCSS###']
= str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder['css_view'][$viewName_single]);
= $this->setPlaceholders($this->customScriptBuilder['css_view'][$viewName_single], $this->placeholders);
// clear some memory
unset($this->customScriptBuilder['css_view'][$viewName_single]);
}
@ -425,6 +426,8 @@ class Infusion extends Interpretation
// ###CHECKINCALL### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_list]['###CHECKINCALL###'] = '';
}
// ###ADMIN_CUSTOM_BUTTONS_LIST###
$this->fileContentDynamic[$viewName_list]['###ADMIN_CUSTOM_BUTTONS_LIST###'] = $this->setCustomButtons($view, 3, "\t");
// ###GET_ITEMS_METHOD_STRING_FIX### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_list]['###GET_ITEMS_METHOD_STRING_FIX###'] = $this->setGetItemsMethodStringFix($viewName_single,$this->fileContentStatic['###Component###']);
@ -497,7 +500,7 @@ class Infusion extends Interpretation
{
// ###VIEWCSS### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_list]['###VIEWSCSS###']
= str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder['css_views'][$viewName_list]);
= $this->setPlaceholders($this->customScriptBuilder['css_views'][$viewName_list], $this->placeholders);
// clear some memory
unset($this->customScriptBuilder['css_views'][$viewName_list]);
}
@ -629,7 +632,7 @@ class Infusion extends Interpretation
{
// ###CUSTOM_ADMIN_BEFORE_GET_ITEM### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_BEFORE_GET_ITEM###']
= str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder[$this->target.'_php_before_getitem'][$view['settings']->code]);
= $this->setPlaceholders($this->customScriptBuilder[$this->target.'_php_before_getitem'][$view['settings']->code], $this->placeholders);
// clear some memory
unset($this->customScriptBuilder[$this->target.'_php_before_getitem'][$view['settings']->code]);
}
@ -647,7 +650,7 @@ class Infusion extends Interpretation
{
// ###CUSTOM_ADMIN_AFTER_GET_ITEM### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_AFTER_GET_ITEM###']
= str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder[$this->target.'_php_after_getitem'][$view['settings']->code]);
= $this->setPlaceholders($this->customScriptBuilder[$this->target.'_php_after_getitem'][$view['settings']->code], $this->placeholders);
// clear some memory
unset($this->customScriptBuilder[$this->target.'_php_after_getitem'][$view['settings']->code]);
}
@ -667,7 +670,7 @@ class Infusion extends Interpretation
{
// ###CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY###']
= PHP_EOL.str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder[$this->target.'_php_getlistquery'][$view['settings']->code]);
= PHP_EOL.$this->setPlaceholders($this->customScriptBuilder[$this->target.'_php_getlistquery'][$view['settings']->code], $this->placeholders);
// clear some memory
unset($this->customScriptBuilder[$this->target.'_php_getlistquery'][$view['settings']->code]);
}
@ -682,7 +685,7 @@ class Infusion extends Interpretation
{
// ###CUSTOM_ADMIN_BEFORE_GET_ITEMS### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_BEFORE_GET_ITEMS###']
= PHP_EOL.str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder[$this->target.'_php_before_getitems'][$view['settings']->code]);
= PHP_EOL.$this->setPlaceholders($this->customScriptBuilder[$this->target.'_php_before_getitems'][$view['settings']->code], $this->placeholders);
// clear some memory
unset($this->customScriptBuilder[$this->target.'_php_before_getitems'][$view['settings']->code]);
}
@ -700,7 +703,7 @@ class Infusion extends Interpretation
{
// ###CUSTOM_ADMIN_AFTER_GET_ITEMS### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_AFTER_GET_ITEMS###']
= PHP_EOL.str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder[$this->target.'_php_after_getitems'][$view['settings']->code]);
= PHP_EOL.$this->setPlaceholders($this->customScriptBuilder[$this->target.'_php_after_getitems'][$view['settings']->code], $this->placeholders);
// clear some memory
unset($this->customScriptBuilder[$this->target.'_php_after_getitems'][$view['settings']->code]);
}
@ -896,7 +899,7 @@ class Infusion extends Interpretation
{
// ###SITE_BEFORE_GET_ITEM### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###SITE_BEFORE_GET_ITEM###']
= str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder[$this->target.'_php_before_getitem'][$view['settings']->code]);
= $this->setPlaceholders($this->customScriptBuilder[$this->target.'_php_before_getitem'][$view['settings']->code], $this->placeholders);
// clear some memory
unset($this->customScriptBuilder[$this->target.'_php_before_getitem'][$view['settings']->code]);
}
@ -914,7 +917,7 @@ class Infusion extends Interpretation
{
// ###SITE_AFTER_GET_ITEM### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###SITE_AFTER_GET_ITEM###']
= str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder[$this->target.'_php_after_getitem'][$view['settings']->code]);
= $this->setPlaceholders($this->customScriptBuilder[$this->target.'_php_after_getitem'][$view['settings']->code], $this->placeholders);
// clear some memory
unset($this->customScriptBuilder[$this->target.'_php_after_getitem'][$view['settings']->code]);
}
@ -936,7 +939,7 @@ class Infusion extends Interpretation
{
// ###SITE_BEFORE_GET_ITEMS### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###SITE_BEFORE_GET_ITEMS###']
= PHP_EOL.str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder[$this->target.'_php_before_getitems'][$view['settings']->code]);
= PHP_EOL.$this->setPlaceholders($this->customScriptBuilder[$this->target.'_php_before_getitems'][$view['settings']->code], $this->placeholders);
// clear some memory
unset($this->customScriptBuilder[$this->target.'_php_before_getitems'][$view['settings']->code]);
}
@ -954,7 +957,7 @@ class Infusion extends Interpretation
{
// ###SITE_AFTER_GET_ITEMS### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###SITE_AFTER_GET_ITEMS###']
= PHP_EOL.str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder[$this->target.'_php_after_getitems'][$view['settings']->code]);
= PHP_EOL.$this->setPlaceholders($this->customScriptBuilder[$this->target.'_php_after_getitems'][$view['settings']->code], $this->placeholders);
// clear some memory
unset($this->customScriptBuilder[$this->target.'_php_after_getitems'][$view['settings']->code]);
}
@ -992,7 +995,7 @@ class Infusion extends Interpretation
}
// set site custom script to helper class
// ###SITE_CUSTOM_HELPER_SCRIPT###
$this->fileContentStatic['###SITE_CUSTOM_HELPER_SCRIPT###'] = str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder['component_php_helper_site']);
$this->fileContentStatic['###SITE_CUSTOM_HELPER_SCRIPT###'] = $this->setPlaceholders($this->customScriptBuilder['component_php_helper_site'], $this->placeholders);
// ###SITE_GLOBAL_EVENT_HELPER###
$this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] = '';
// ###SITE_GLOBAL_EVENT###
@ -1008,7 +1011,7 @@ class Infusion extends Interpretation
$this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'**/';
$this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'public static function globalEvent($document)';
$this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'{';
$this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= PHP_EOL.str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder['component_php_site_event']);
$this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= PHP_EOL.$this->setPlaceholders($this->customScriptBuilder['component_php_site_event'], $this->placeholders);
$this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'}';
}
// setup the layouts
@ -1019,18 +1022,6 @@ class Infusion extends Interpretation
// clear all site folder since none is needed
$this->removeSiteFolder = true;
}
// ###LANG_ADMIN###
$this->fileContentStatic['###LANG_ADMIN###'] = $this->setLangAdmin();
// ###LANG_ADMIN_SYS###
$this->fileContentStatic['###LANG_ADMIN_SYS###'] = $this->setLangAdminSys();
// ###LANG_SITE###
$this->fileContentStatic['###LANG_SITE###'] = $this->setLangSite();
// ###LANG_SITE_SYS###
$this->fileContentStatic['###LANG_SITE_SYS###'] = $this->setLangSiteSys();
// ###PREINSTALLSCRIPT###
$this->fileContentStatic['###PREINSTALLSCRIPT###'] = $this->getCustomScriptBuilder('php_preflight', 'install', PHP_EOL, null, true);
@ -1072,5 +1063,41 @@ class Infusion extends Interpretation
}
return false;
}
/**
* Build the lang values and insert to fiel
*
*
* @return boolean on success
*
*/
public function setLangFileData()
{
// First we build the strings
$lang = array();
// ###LANG_ADMIN###
$lang['###LANG_ADMIN###'] = $this->setLangAdmin();
// ###LANG_ADMIN_SYS###
$lang['###LANG_ADMIN_SYS###'] = $this->setLangAdminSys();
// ###LANG_SITE###
$lang['###LANG_SITE###'] = $this->setLangSite();
// ###LANG_SITE_SYS###
$lang['###LANG_SITE_SYS###'] = $this->setLangSiteSys();
// now we insert the values into the files
if (ComponentbuilderHelper::checkArray($this->langFiles))
{
foreach ($this->langFiles as $file)
{
$string = JFile::read($file['path']);
// load the data
$answer = $this->setPlaceholders($string, $lang, 3);
// add to zip array
$this->writeFile($file['path'],$answer);
// set the line counter
$this->lineCount = $this->lineCount + substr_count($answer, PHP_EOL);
}
}
}
}

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage componentbuilder.php
@ -412,7 +412,10 @@ abstract class ComponentbuilderHelper
{
JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_COMPILER'), 'index.php?option=com_componentbuilder&view=compiler', $submenu === 'compiler');
}
JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_COMPONENTS'), 'index.php?option=com_componentbuilder&view=components', $submenu === 'components');
if ($user->authorise('joomla_component.access', 'com_componentbuilder') && $user->authorise('joomla_component.submenu', 'com_componentbuilder'))
{
JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_JOOMLA_COMPONENTS'), 'index.php?option=com_componentbuilder&view=joomla_components', $submenu === 'joomla_components');
}
if ($user->authorise('admin_view.access', 'com_componentbuilder') && $user->authorise('admin_view.submenu', 'com_componentbuilder'))
{
JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_ADMIN_VIEWS'), 'index.php?option=com_componentbuilder&view=admin_views', $submenu === 'admin_views');
@ -1330,57 +1333,72 @@ abstract class ComponentbuilderHelper
return $string;
}
public static function safeString($string, $type = 'L', $spacer = '_')
public static function safeString($string, $type = 'L', $spacer = '_', $replaceNumbers = true)
{
// remove all numbers and replace with english text version (works well only up to a thousand)
$string = self::replaceNumbers($string);
if ($replaceNumbers === true)
{
// remove all numbers and replace with english text version (works well only up to millions)
$string = self::replaceNumbers($string);
}
// 0nly continue if we have a string
if (self::checkString($string))
{
// remove all other characters
$string = trim($string);
$string = preg_replace('/'.$spacer.'+/', ' ', $string);
$string = preg_replace('/\s+/', ' ', $string);
$string = preg_replace("/[^A-Za-z ]/", '', $string);
// return a string with all first letter of each word uppercase(no undersocre)
if ($type == 'W')
{
return ucwords(strtolower($string));
}
elseif ($type == 'w')
{
return strtolower($string);
}
elseif ($type == 'Ww')
{
return ucfirst(strtolower($string));
}
elseif ($type == 'WW')
{
return strtoupper($string);
}
elseif ($type == 'U')
{
// replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string);
// return all upper
return strtoupper($string);
}
elseif ($type == 'F')
{
// replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string);
// return with first caracter to upper
return ucfirst(strtolower($string));
}
elseif ($type == 'L')
// remove all other characters
$string = trim($string);
$string = preg_replace('/'.$spacer.'+/', ' ', $string);
$string = preg_replace('/\s+/', ' ', $string);
$string = preg_replace("/[^A-Za-z ]/", '', $string);
// select final adaptations
if ($type === 'L' || $type === 'strtolower')
{
// replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string);
// default is to return lower
return strtolower($string);
}
elseif ($type === 'W')
{
// return a string with all first letter of each word uppercase(no undersocre)
return ucwords(strtolower($string));
}
elseif ($type === 'w' || $type === 'word')
{
// return a string with all lowercase(no undersocre)
return strtolower($string);
}
elseif ($type === 'Ww' || $type === 'Word')
{
// return a string with first letter of the first word uppercase and all the rest lowercase(no undersocre)
return ucfirst(strtolower($string));
}
elseif ($type === 'WW' || $type === 'WORD')
{
// return a string with all the uppercase(no undersocre)
return strtoupper($string);
}
elseif ($type === 'U' || $type === 'strtoupper')
{
// replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string);
// return all upper
return strtoupper($string);
}
elseif ($type === 'F' || $type === 'ucfirst')
{
// replace white space with underscore
$string = preg_replace('/\s+/', $spacer, $string);
// return with first caracter to upper
return ucfirst(strtolower($string));
}
elseif ($type === 'cA' || $type === 'cAmel' || $type === 'camelcase')
{
// convert all words to first letter uppercase
$string = ucwords(strtolower($string));
// remove white space
$string = preg_replace('/\s+/', '', $string);
// now return first letter lowercase
return lcfirst($string);
}
// return string
return $string;
}

View File

@ -69,12 +69,12 @@ class Mapping
* The datatypes and it linked field types (basic)
* (TODO) We may need to set this dynamicly
*/
protected $dataTypes = array( 'CHAR' => 'Text', 'VARCHAR' => 'Text',
'TEXT' => 'Textarea', 'MEDIUMTEXT' => 'Textarea',
'LONGTEXT' => 'Textarea', 'DATE' => 'Text', 'TIME' => 'Text',
'DATETIME' => 'Calendar', 'INT' => 'Text', 'TINYINT' => 'Text',
'BIGINT' => 'Text', 'FLOAT' => 'Text', 'DECIMAL' => 'Text',
'DOUBLE' => 'Text');
protected $dataTypes = array( 'VARCHAR' => 'Text', 'CHAR' => 'Text',
'MEDIUMTEXT' => 'Textarea', 'LONGTEXT' => 'Textarea',
'TEXT' => 'Textarea', 'DATETIME' => 'Calendar',
'DATE' => 'Text', 'TIME' => 'Text', 'TINYINT' => 'Text',
'BIGINT' => 'Text', 'INT' => 'Text', 'FLOAT' => 'Text',
'DECIMAL' => 'Text', 'DOUBLE' => 'Text');
/**
* The datasize identifiers

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage headercheck.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage batch_.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage indenter.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage js.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage minify.php

File diff suppressed because it is too large Load Diff

View File

@ -3,13 +3,13 @@ COM_COMPONENTBUILDER_CONFIGURATION="Component Builder Configuration"
COM_COMPONENTBUILDER_MENU="&#187; Component Builder"
COM_COMPONENTBUILDER_MENU_ADMIN_VIEWS="Admin Views"
COM_COMPONENTBUILDER_MENU_COMPILER="Compiler"
COM_COMPONENTBUILDER_MENU_COMPONENTS="Components"
COM_COMPONENTBUILDER_MENU_CUSTOM_ADMIN_VIEWS="Custom Admin Views"
COM_COMPONENTBUILDER_MENU_CUSTOM_CODES="Custom Codes"
COM_COMPONENTBUILDER_MENU_DYNAMIC_GETS="Dynamic Gets"
COM_COMPONENTBUILDER_MENU_FIELDS="Fields"
COM_COMPONENTBUILDER_MENU_FIELDTYPES="Fieldtypes"
COM_COMPONENTBUILDER_MENU_HELP_DOCUMENTS="Help Documents"
COM_COMPONENTBUILDER_MENU_JOOMLA_COMPONENTS="Joomla Components"
COM_COMPONENTBUILDER_MENU_LAYOUTS="Layouts"
COM_COMPONENTBUILDER_MENU_SITE_VIEWS="Site Views"
COM_COMPONENTBUILDER_MENU_SNIPPETS="Snippets"

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage css_fullwidth.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage custom_buttons_fullwidth.php
@ -31,7 +31,9 @@ $form = $displayData->getForm();
$fields = $displayData->get('fields') ?: array(
'php_controller',
'php_model'
'php_controller_list',
'php_model',
'php_model_list'
);
?>

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage custom_buttons_left.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage custom_import_fullwidth.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage fields_fullwidth.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage javascript_fullwidth.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage linked_components_fullwidth.php
@ -31,37 +31,37 @@ defined('_JEXEC') or die('Restricted access');
$items = $displayData->vxulinked_components;
$user = JFactory::getUser();
$id = $displayData->item->id;
$edit = "index.php?option=com_componentbuilder&view=components&task=component.edit";
$edit = "index.php?option=com_componentbuilder&view=joomla_components&task=joomla_component.edit";
?>
<div class="form-vertical">
<?php if (ComponentbuilderHelper::checkArray($items)): ?>
<table class="footable table data components" data-show-toggle="true" data-toggle-column="first" data-sorting="true" data-paging="true" data-paging-size="20" data-filtering="true">
<table class="footable table data joomla_components" data-show-toggle="true" data-toggle-column="first" data-sorting="true" data-paging="true" data-paging-size="20" data-filtering="true">
<thead>
<tr>
<th data-type="html" data-sort-use="text">
<?php echo JText::_('COM_COMPONENTBUILDER_COMPONENT_SYSTEM_NAME_LABEL'); ?>
<?php echo JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SYSTEM_NAME_LABEL'); ?>
</th>
<th data-breakpoints="xs sm" data-type="html" data-sort-use="text">
<?php echo JText::_('COM_COMPONENTBUILDER_COMPONENT_NAME_CODE_LABEL'); ?>
<?php echo JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NAME_CODE_LABEL'); ?>
</th>
<th data-breakpoints="xs sm" data-type="html" data-sort-use="text">
<?php echo JText::_('COM_COMPONENTBUILDER_COMPONENT_COMPONENT_VERSION_LABEL'); ?>
<?php echo JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COMPONENT_VERSION_LABEL'); ?>
</th>
<th data-breakpoints="xs sm md" data-type="html" data-sort-use="text">
<?php echo JText::_('COM_COMPONENTBUILDER_COMPONENT_SHORT_DESCRIPTION_LABEL'); ?>
<?php echo JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SHORT_DESCRIPTION_LABEL'); ?>
</th>
<th data-breakpoints="xs sm md" data-type="html" data-sort-use="text">
<?php echo JText::_('COM_COMPONENTBUILDER_COMPONENT_COMPANYNAME_LABEL'); ?>
<?php echo JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COMPANYNAME_LABEL'); ?>
</th>
<th data-breakpoints="xs sm md" data-type="html" data-sort-use="text">
<?php echo JText::_('COM_COMPONENTBUILDER_COMPONENT_AUTHOR_LABEL'); ?>
<?php echo JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_AUTHOR_LABEL'); ?>
</th>
<th width="10" data-breakpoints="xs sm md">
<?php echo JText::_('COM_COMPONENTBUILDER_COMPONENT_STATUS'); ?>
<?php echo JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_STATUS'); ?>
</th>
<th width="5" data-type="number" data-breakpoints="xs sm md">
<?php echo JText::_('COM_COMPONENTBUILDER_COMPONENT_ID'); ?>
<?php echo JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ID'); ?>
</th>
</tr>
</thead>
@ -70,14 +70,14 @@ $edit = "index.php?option=com_componentbuilder&view=components&task=component.ed
<?php
$canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $user->id || $item->checked_out == 0;
$userChkOut = JFactory::getUser($item->checked_out);
$canDo = ComponentbuilderHelper::getActions('component',$item,'components');
$canDo = ComponentbuilderHelper::getActions('joomla_component',$item,'joomla_components');
?>
<tr>
<td class="nowrap">
<?php if ($canDo->get('core.edit')): ?>
<a href="<?php echo $edit; ?>&id=<?php echo $item->id; ?>&ref=admin_view&refid=<?php echo $id; ?>"><?php echo $displayData->escape($item->system_name); ?></a>
<?php if ($item->checked_out): ?>
<?php echo JHtml::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'components.', $canCheckin); ?>
<?php echo JHtml::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'joomla_components.', $canCheckin); ?>
<?php endif; ?>
<?php else: ?>
<div class="name"><?php echo $displayData->escape($item->system_name); ?></div>

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage mysql_fullwidth.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage mysql_left.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage php_fullwidth.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage publishing.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage publlshing.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage settings_above.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage settings_left.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage settings_right.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage settings_under.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage batchselection.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage custom_buttons_fullwidth.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage custom_buttons_left.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage custom_script_fullwidth.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_above.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_fullwidth.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_left.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_right.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_rightside.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_under.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage linked_components_fullwidth.php
@ -31,37 +31,37 @@ defined('_JEXEC') or die('Restricted access');
$items = $displayData->vyelinked_components;
$user = JFactory::getUser();
$id = $displayData->item->id;
$edit = "index.php?option=com_componentbuilder&view=components&task=component.edit";
$edit = "index.php?option=com_componentbuilder&view=joomla_components&task=joomla_component.edit";
?>
<div class="form-vertical">
<?php if (ComponentbuilderHelper::checkArray($items)): ?>
<table class="footable table data components" data-show-toggle="true" data-toggle-column="first" data-sorting="true" data-paging="true" data-paging-size="20" data-filtering="true">
<table class="footable table data joomla_components" data-show-toggle="true" data-toggle-column="first" data-sorting="true" data-paging="true" data-paging-size="20" data-filtering="true">
<thead>
<tr>
<th data-type="html" data-sort-use="text">
<?php echo JText::_('COM_COMPONENTBUILDER_COMPONENT_SYSTEM_NAME_LABEL'); ?>
<?php echo JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SYSTEM_NAME_LABEL'); ?>
</th>
<th data-breakpoints="xs sm" data-type="html" data-sort-use="text">
<?php echo JText::_('COM_COMPONENTBUILDER_COMPONENT_NAME_CODE_LABEL'); ?>
<?php echo JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NAME_CODE_LABEL'); ?>
</th>
<th data-breakpoints="xs sm" data-type="html" data-sort-use="text">
<?php echo JText::_('COM_COMPONENTBUILDER_COMPONENT_COMPONENT_VERSION_LABEL'); ?>
<?php echo JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COMPONENT_VERSION_LABEL'); ?>
</th>
<th data-breakpoints="xs sm md" data-type="html" data-sort-use="text">
<?php echo JText::_('COM_COMPONENTBUILDER_COMPONENT_SHORT_DESCRIPTION_LABEL'); ?>
<?php echo JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SHORT_DESCRIPTION_LABEL'); ?>
</th>
<th data-breakpoints="xs sm md" data-type="html" data-sort-use="text">
<?php echo JText::_('COM_COMPONENTBUILDER_COMPONENT_COMPANYNAME_LABEL'); ?>
<?php echo JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COMPANYNAME_LABEL'); ?>
</th>
<th data-breakpoints="xs sm md" data-type="html" data-sort-use="text">
<?php echo JText::_('COM_COMPONENTBUILDER_COMPONENT_AUTHOR_LABEL'); ?>
<?php echo JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_AUTHOR_LABEL'); ?>
</th>
<th width="10" data-breakpoints="xs sm md">
<?php echo JText::_('COM_COMPONENTBUILDER_COMPONENT_STATUS'); ?>
<?php echo JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_STATUS'); ?>
</th>
<th width="5" data-type="number" data-breakpoints="xs sm md">
<?php echo JText::_('COM_COMPONENTBUILDER_COMPONENT_ID'); ?>
<?php echo JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ID'); ?>
</th>
</tr>
</thead>
@ -70,14 +70,14 @@ $edit = "index.php?option=com_componentbuilder&view=components&task=component.ed
<?php
$canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $user->id || $item->checked_out == 0;
$userChkOut = JFactory::getUser($item->checked_out);
$canDo = ComponentbuilderHelper::getActions('component',$item,'components');
$canDo = ComponentbuilderHelper::getActions('joomla_component',$item,'joomla_components');
?>
<tr>
<td class="nowrap">
<?php if ($canDo->get('core.edit')): ?>
<a href="<?php echo $edit; ?>&id=<?php echo $item->id; ?>&ref=custom_admin_view&refid=<?php echo $id; ?>"><?php echo $displayData->escape($item->system_name); ?></a>
<?php if ($item->checked_out): ?>
<?php echo JHtml::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'components.', $canCheckin); ?>
<?php echo JHtml::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'joomla_components.', $canCheckin); ?>
<?php endif; ?>
<?php else: ?>
<div class="name"><?php echo $displayData->escape($item->system_name); ?></div>

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage publishing.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage publlshing.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_above.php
@ -30,7 +30,9 @@ defined('_JEXEC') or die('Restricted access');
$form = $displayData->getForm();
$fields = array(
'target'
'target',
'system_name',
'function_name'
);
?>

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.6
@build 1st March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_fullwidth.php
@ -31,7 +31,9 @@ $form = $displayData->getForm();
$fields = $displayData->get('fields') ?: array(
'path',
'code'
'note_jcb_placeholder',
'code',
'note_placeholders_explained'
);
?>

Some files were not shown because too many files have changed in this diff Show More