added interface of the new decoupled libraries concept gh-92

This commit is contained in:
2017-11-26 02:29:08 +02:00
parent 9760ac86a3
commit 82df61aa4a
174 changed files with 11626 additions and 1094 deletions

View File

@@ -32,6 +32,11 @@ defined('_JEXEC') or die('Restricted access');
abstract class ComponentbuilderHelper
{
/**
* Locked Libraries (we can not have these change)
**/
public static $libraryNames = array(1 => 'No Library', 2 => 'Bootstrap v4', 3 => 'Uikit v3', 4 => 'Uikit v2', 5 => 'FooTable v2', 6 => 'FooTable v3');
/**
* The global params
**/
@@ -106,6 +111,104 @@ abstract class ComponentbuilderHelper
return array('contributor_company' => self::$localCompany['company'] ,'contributor_name' => self::$localCompany['owner'], 'contributor_email' => self::$localCompany['email'], 'contributor_website' => self::$localCompany['website'], 'origin' => 'global');
}
/**
* Get the library files
*
* @param int $id The library id to target
*
* @return array On success the contributor details
*
*/
public static function getLibraryFiles($id)
{
// get the library files, folders, and urls
$files = array();
// Get a db connection.
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
$query->select($db->quoteName(array('addurls','addfolders','addfiles')));
$query->from($db->quoteName('#__componentbuilder_library_files_folders_urls'));
$query->where($db->quoteName('library') . ' = ' . (int) $id);
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
{
// prepare the files
$result = $db->loadObject();
// first we load the URLs
if (self::checkJson($result->addurls))
{
// convert to array
$result->addurls = json_decode($result->addurls, true);
// set urls
if (self::checkArray($result->addurls))
{
foreach($result->addurls as $url)
{
if (isset($url['url']) && isset($url['type']))
{
switch ($url['type'])
{
case 1:
// link only
$files['1'.$url['url']] = '(' . JText::_('COM_COMPONENTBUILDER_URL') . ') ' . basename($url['url']) . ' - ' . JText::_('COM_COMPONENTBUILDER_LINK');
break;
case 2:
// local
$files['2'.$url['url']] = '(' . JText::_('COM_COMPONENTBUILDER_URL') . ') ' . basename($url['url']) . ' - ' . JText::_('COM_COMPONENTBUILDER_LOCAL');
break;
case 3:
// link and local
$files['1'.$url['url']] = '(' . JText::_('COM_COMPONENTBUILDER_URL') . ') ' . basename($url['url']) . ' - ' . JText::_('COM_COMPONENTBUILDER_LINK');
$files['2'.$url['url']] = '(' . JText::_('COM_COMPONENTBUILDER_URL') . ') ' . basename($url['url']) . ' - ' . JText::_('COM_COMPONENTBUILDER_LOCAL');
break;
}
}
}
}
}
// load the local files
if (self::checkJson($result->addfiles))
{
// convert to array
$result->addfiles = json_decode($result->addfiles, true);
// set files
if (self::checkArray($result->addfiles))
{
foreach($result->addfiles as $file)
{
if (isset($file['file']) && isset($file['path']))
{
$files['3'.$file['path'].$file['file']] = '(' . JText::_('COM_COMPONENTBUILDER_FILE') . ') ' . $file['file'];
}
}
}
}
// load the files in the folder
if (self::checkJson($result->addfolders))
{
// convert to array
$result->addfolders = json_decode($result->addfolders, true);
// set folder
if (self::checkArray($result->addfolders))
{
foreach($result->addfolders as $folder)
{
// not yet set
}
$files['4folders'] = '(' . JText::_('COM_COMPONENTBUILDER_FOLDERS') . ') not yet able to deal with folders';
}
}
// return files if found
if (self::checkArray($files))
{
return $files;
}
}
return false;
}
/**
* get all component IDs
*/

View File

@@ -17,9 +17,13 @@ COM_COMPONENTBUILDER_EMLICENSEEM_BSB="<em>License:</em> <b>%s</b>"
COM_COMPONENTBUILDER_EMOWNEREM_BSB="<em>Owner:</em> <b>%s</b>"
COM_COMPONENTBUILDER_EMWEBSITEEM_BSB="<em>Website:</em> <b>%s</b>"
COM_COMPONENTBUILDER_ERROR="Error!"
COM_COMPONENTBUILDER_FILE="File"
COM_COMPONENTBUILDER_FOLDERS="Folders"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDER_BACKUP_KEY="Joomla Component Builder - Backup Key"
COM_COMPONENTBUILDER_KEY_HAS_NOT_CHANGED="Key has not changed"
COM_COMPONENTBUILDER_LICENSE_S="License: %s"
COM_COMPONENTBUILDER_LINK="link"
COM_COMPONENTBUILDER_LOCAL="local"
COM_COMPONENTBUILDER_NEW="New"
COM_COMPONENTBUILDER_NO_ACCESS_GRANTED="No Access Granted!"
COM_COMPONENTBUILDER_NO_KEYS_WERE_FOUND_TO_ADD_AN_EXPORT_KEY_SIMPLY_OPEN_THE_COMPONENT_GO_TO_THE_TAB_CALLED_SETTINGS_BOTTOM_RIGHT_THERE_IS_A_FIELD_CALLED_EXPORT_KEY="No keys were found. To add an export key simply open the component, go to the tab called settings, bottom right there is a field called Export Key."
@@ -36,6 +40,7 @@ COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_S="The package key is: %s"
COM_COMPONENTBUILDER_THIS_PACKAGE_HAS_NO_KEY="This package has no key."
COM_COMPONENTBUILDER_TO_CHANGE_THE_PACKAGE_OWNER_DEFAULTS_OPEN_THE_BJCB_GLOBAL_OPTIONSB_GO_TO_THE_BCOMPANYB_TAB_AND_ADD_THE_CORRECT_COMPANY_DETAILS_THERE="To change the package owner defaults. Open the <b>JCB Global Options</b>, go to the <b>Company</b> tab and add the correct company details there."
COM_COMPONENTBUILDER_TO_CHANGE_THE_PACKAGE_OWNER_DEFAULTS_OPEN_THE_JCB_GLOBAL_OPTIONS_GO_TO_THE_COMPANY_TAB_AND_ADD_THE_CORRECT_COMPANY_DETAILS_THERE="To change the package owner defaults. Open the JCB Global Options, go to the Company tab and add the correct company details there."
COM_COMPONENTBUILDER_URL="Url"
COM_COMPONENTBUILDER_WEBSITE_S="Website: %s"
COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_ONE_HUNDRED_AND_TWENTY_EIGHT_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEY_WITHOUT_THIS_KEY_IT_WILL_TAKE_THE_CURRENT_TECHNOLOGY_WITH_A_BRUTE_FORCE_ATTACK_METHOD_MORE_THEN_A_HREFHTTPRANDOMIZECOMHOWLONGTOHACKPASS_TARGET_BLANK_TITLEHOW_LONG_TO_HACK_PASSSEVEN_HUNDRED_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZEROA_YEARS_TO_CRACK_THEORETICALLY_UNLESS_THEY_HAVE_THIS_KEY_ABOVE_SO_DO_KEEP_IT_SAFE="Your data is encrypted with a AES 128 bit encryption using the above 32 character key. Without this key it will take the current technology with a brute force attack method more then <a href="http://random-ize.com/how-long-to-hack-pass/" target="_blank" title="How long to hack pass">700 000 000 000 000 000 000 000 000 000 000</a> years to crack theoretically. Unless they have this key above, so do keep it safe."
COM_COMPONENTBUILDER_YOU_SHOULD_ADD_THE_CORRECT_OWNER_DETAILS="You should add the correct owner details."