Refactored the compiler list view body builder, in preparation of the relation fields. Added more options to the relation admin fields. gh-287
This commit is contained in:
@@ -1801,7 +1801,7 @@ abstract class ComponentbuilderHelper
|
||||
return $sufix === "" || ($sufix == substr(strrchr($file, "."), -strlen($sufix)));
|
||||
}
|
||||
|
||||
public static function imageInfo($path,$request = 'type')
|
||||
public static function imageInfo($path, $request = 'type')
|
||||
{
|
||||
// set image
|
||||
$image = JPATH_SITE.'/'.$path;
|
||||
@@ -1914,37 +1914,79 @@ abstract class ComponentbuilderHelper
|
||||
return array_unique($bucket);
|
||||
}
|
||||
|
||||
public static function typeField($type,$option = 'default')
|
||||
|
||||
/**
|
||||
* Field Grouping https://docs.joomla.org/Form_field
|
||||
**/
|
||||
protected static $fieldGroups = array(
|
||||
'default' => array(
|
||||
'accesslevel', 'cachehandler', 'calendar', 'captcha', 'category', 'checkbox',
|
||||
'checkboxes', 'color', 'combo', 'componentlayout', 'contentlanguage', 'editor',
|
||||
'chromestyle', 'contenttype', 'databaseconnection', 'editors', 'email', 'file',
|
||||
'filelist', 'folderlist', 'groupedlist', 'hidden', 'file', 'headertag', 'helpsite',
|
||||
'imagelist', 'integer', 'language', 'list', 'media', 'menu', 'note', 'number', 'password',
|
||||
'plugins', 'radio', 'repeatable', 'range', 'rules', 'subform', 'sessionhandler', 'spacer', 'sql', 'tag',
|
||||
'tel', 'menuitem', 'meter', 'modulelayout', 'moduleorder', 'moduleposition', 'moduletag',
|
||||
'templatestyle', 'text', 'textarea', 'timezone', 'url', 'user', 'usergroup'
|
||||
),
|
||||
'plain' => array(
|
||||
'accesslevel', 'checkbox', 'cachehandler', 'calendar', 'category', 'chromestyle', 'color',
|
||||
'contenttype', 'combo', 'componentlayout', 'databaseconnection', 'editor', 'editors',
|
||||
'email', 'file', 'filelist', 'folderlist', 'headertag', 'helpsite',
|
||||
'hidden', 'imagelist', 'integer', 'language', 'media', 'menu',
|
||||
'menuitem', 'meter', 'modulelayout', 'moduleorder', 'moduletag', 'number', 'password', 'range', 'rules',
|
||||
'sessionhandler', 'tag', 'tel', 'text', 'textarea',
|
||||
'timezone', 'url', 'user', 'usergroup'
|
||||
),
|
||||
'text' => array(
|
||||
'calendar','color','editor','email','password','tel','text','textarea','url','number','range'
|
||||
),
|
||||
'list' => array(
|
||||
'checkboxes','checkbox','list','radio'
|
||||
),
|
||||
'dynamic' => array(
|
||||
'category','headertag','tag','rules','user','file','filelist','folderlist','imagelist','integer','timezone','media','meter'
|
||||
),
|
||||
'spacer' => array(
|
||||
'note', 'spacer'
|
||||
),
|
||||
'option' => array(
|
||||
'plugins', 'checkboxes', 'contentlanguage', 'list', 'radio', 'sql'
|
||||
),
|
||||
'special' => array(
|
||||
'contentlanguage', 'groupedlist', 'moduleposition', 'plugin',
|
||||
'repeatable', 'templatestyle', 'subform'
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* Field Checker
|
||||
*
|
||||
* @param string $type The field type
|
||||
* @param boolean $option The field grouping
|
||||
*
|
||||
* @return boolean if the field was found
|
||||
*/
|
||||
public static function fieldCheck($type, $option = 'default')
|
||||
{
|
||||
// list of default fields
|
||||
// https://docs.joomla.org/Form_field
|
||||
$fields = array(
|
||||
'default' => array(
|
||||
'accesslevel','cachehandler','calendar','captcha','category','checkbox',
|
||||
'checkboxes','color','combo','componentlayout','contentlanguage','editor',
|
||||
'chromestyle','contenttype','databaseconnection','editors','email','file',
|
||||
'filelist','folderlist','groupedlist','hidden','file','headertag','helpsite',
|
||||
'imagelist','integer','language','list','media','menu','note','password',
|
||||
'plugins','range','radio','repeatable','rules','subform','sessionhandler','spacer','sql','tag',
|
||||
'tel','menuitem','modulelayout','meter','moduleorder','moduleposition','moduletag',
|
||||
'templatestyle','text','textarea','timezone','url','user','usergroup'
|
||||
),
|
||||
'text' => array(
|
||||
'calendar','color','editor','email','password','tel','text','textarea','url','number','range'
|
||||
),
|
||||
'list' => array(
|
||||
'checkboxes','checkbox','list','radio'
|
||||
),
|
||||
'dynamic' => array(
|
||||
'category','headertag','tag','rules','user','file','filelist','folderlist','imagelist','integer','timezone','media','meter'
|
||||
)
|
||||
);
|
||||
|
||||
if (in_array($type,$fields[$option]))
|
||||
// now check
|
||||
if (isset(self::$fieldGroups[$option]) && in_array($type, self::$fieldGroups[$option]))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the spacer IDs
|
||||
*
|
||||
* @return array ids of the spacer field types
|
||||
*/
|
||||
public static function getSpacerIds()
|
||||
{
|
||||
// get the database object to use quote
|
||||
$db = JFactory::getDbo();
|
||||
return self::getVars('fieldtype', (array) array_map(function($name) use($db) { return $db->quote(ucfirst($name)); }, self::$fieldGroups['spacer']), 'name', 'id');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -22,6 +22,9 @@ COM_COMPONENTBUILDER_DTLICENSEDTDDSDD="<dt>License</dt><dd>%s</dd>"
|
||||
COM_COMPONENTBUILDER_DTOWNERDTDDSDD="<dt>Owner</dt><dd>%s</dd>"
|
||||
COM_COMPONENTBUILDER_DTWEBSITEDTDDSDD="<dt>Website</dt><dd>%s</dd>"
|
||||
COM_COMPONENTBUILDER_EDIT_S="Edit %s"
|
||||
COM_COMPONENTBUILDER_EDIT_THE_ADMIN_FIELDS="Edit the admin fields"
|
||||
COM_COMPONENTBUILDER_EDIT_THE_ADMIN_FIELDS_CONDITIONS="Edit the admin fields conditions"
|
||||
COM_COMPONENTBUILDER_EDIT_THE_ADMIN_FIELDS_RELATIONS="Edit the admin fields relations"
|
||||
COM_COMPONENTBUILDER_EMAIL_S="Email: %s"
|
||||
COM_COMPONENTBUILDER_EMAIL_WITH_THE_NEW_KEY_WAS_SEND="Email with the new key was send"
|
||||
COM_COMPONENTBUILDER_EMCOMPANYEM_BSB="<em>Company:</em> <b>%s</b>"
|
||||
@@ -68,8 +71,19 @@ COM_COMPONENTBUILDER_THE_BPHPSECLIBNETSFTPB_LIBRARYCLASS_IS_NOT_AVAILABLE_THIS_L
|
||||
COM_COMPONENTBUILDER_THE_BSB_FILE_COULD_NOT_BE_MOVED_TO_BSB_PATH_ON_BSB_SERVER="The <b>%s</b> file could not be moved to <b>%s</b> path on <b>%s</b> server."
|
||||
COM_COMPONENTBUILDER_THE_BSB_FILE_COULD_NOT_BE_MOVED_TO_BSB_SERVER="The <b>%s</b> file could not be moved to <b>%s</b> server."
|
||||
COM_COMPONENTBUILDER_THE_BSB_LIBRARYCLASS_IS_NOT_AVAILABLE_THIS_LIBRARYCLASS_SHOULD_HAVE_BEEN_ADDED_TO_YOUR_BLIBRARIESVDM_IOVENDORB_FOLDER_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO="The <b>%s</b> library\class is not available! This library\class should have been added to your <b>libraries/vdm_io/vendor</b> folder. Please contact your system administrator for more info!"
|
||||
COM_COMPONENTBUILDER_THE_COMPONENT_ADMIN_VIEWS="The component admin views"
|
||||
COM_COMPONENTBUILDER_THE_COMPONENT_CONFIG="The component config"
|
||||
COM_COMPONENTBUILDER_THE_COMPONENT_CUSTOM_ADMIN_MENUS="The component custom admin menus"
|
||||
COM_COMPONENTBUILDER_THE_COMPONENT_CUSTOM_ADMIN_VIEWS="The component custom admin views"
|
||||
COM_COMPONENTBUILDER_THE_COMPONENT_DASHBOARD="The component dashboard"
|
||||
COM_COMPONENTBUILDER_THE_COMPONENT_FILES_FOLDERS="The component files & folders"
|
||||
COM_COMPONENTBUILDER_THE_COMPONENT_MYSQL_TWEAKS="The component mysql tweaks"
|
||||
COM_COMPONENTBUILDER_THE_COMPONENT_SITE_VIEWS="The component site views"
|
||||
COM_COMPONENTBUILDER_THE_COMPONENT_UPDATES="The component updates"
|
||||
COM_COMPONENTBUILDER_THE_FTP_CONNECTION_FOR_BSB_COULD_NOT_BE_MADE_PLEASE_CHECK_YOUR_SIGNATURE_DETAILS="The FTP connection for <b>%s</b> could not be made. Please check your signature details!"
|
||||
COM_COMPONENTBUILDER_THE_FTP_SIGNATURE_FOR_BSB_WAS_NOT_WELL_FORMED_PLEASE_CHECK_YOUR_SIGNATURE_DETAILS="The FTP signature for <b>%s</b> was not well formed, please check your signature details!"
|
||||
COM_COMPONENTBUILDER_THE_LIBRARY_CONFIG_FIELDS="The library config fields"
|
||||
COM_COMPONENTBUILDER_THE_LIBRARY_FILES_FOLDERS_URLS="The library files, folders & URLs"
|
||||
COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT="The login to <b>%s</b> has failed, please check that your details are correct!"
|
||||
COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_CODESCODE="The package key is: <code>%s</code>"
|
||||
COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_S="The package key is: %s"
|
||||
|
Reference in New Issue
Block a user