External Code Inclution Option #228

Merged
Llewellyn merged 8 commits from staging into master 2018-02-08 12:42:02 +00:00
20 changed files with 401 additions and 1462 deletions

View File

@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo
Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.6.13) with **ALL** its features and **ALL** concepts totally open-source and free!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.6.14) with **ALL** its features and **ALL** concepts totally open-source and free!
> Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
@ -126,13 +126,13 @@ Component Builder is mapped as a component in itself on my local development env
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](http://joomlacomponentbuilder.com)
+ *First Build*: 30th April, 2015
+ *Last Build*: 24th January, 2018
+ *Version*: 2.6.13
+ *Last Build*: 6th February, 2018
+ *Version*: 2.6.14
+ *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*: **180832**
+ *Line count*: **180952**
+ *Field count*: **1577**
+ *File count*: **1161**
+ *File count*: **1159**
+ *Folder count*: **186**
> This **component** was build with a Joomla [Automated Component Builder](http://joomlacomponentbuilder.com).
@ -141,6 +141,6 @@ Component Builder is mapped as a component in itself on my local development env
## Donations
Come on buy VDM a coffee :)
* PayPal: [paypal.me/payvdm](https://www.paypal.me/payvdm)
* PayPal: [paypal.me/asseblief](https://www.paypal.me/asseblief)
* Bitcoin: 18vURxYpPFjvNk8BnUy1ovCAyQmY3MzkSf
* Ethereum: 0x9548144662b47327c954f3e214edb96662d51218

View File

@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo
Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.6.13) with **ALL** its features and **ALL** concepts totally open-source and free!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.6.14) with **ALL** its features and **ALL** concepts totally open-source and free!
> Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
@ -126,13 +126,13 @@ Component Builder is mapped as a component in itself on my local development env
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](http://joomlacomponentbuilder.com)
+ *First Build*: 30th April, 2015
+ *Last Build*: 24th January, 2018
+ *Version*: 2.6.13
+ *Last Build*: 6th February, 2018
+ *Version*: 2.6.14
+ *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*: **180832**
+ *Line count*: **180952**
+ *Field count*: **1577**
+ *File count*: **1161**
+ *File count*: **1159**
+ *Folder count*: **186**
> This **component** was build with a Joomla [Automated Component Builder](http://joomlacomponentbuilder.com).
@ -141,6 +141,6 @@ Component Builder is mapped as a component in itself on my local development env
## Donations
Come on buy VDM a coffee :)
* PayPal: [paypal.me/payvdm](https://www.paypal.me/payvdm)
* PayPal: [paypal.me/asseblief](https://www.paypal.me/asseblief)
* Bitcoin: 18vURxYpPFjvNk8BnUy1ovCAyQmY3MzkSf
* Ethereum: 0x9548144662b47327c954f3e214edb96662d51218

View File

@ -1,171 +0,0 @@
<?php
/**
*
*@version 2.0.0 - September 03, 2014
*@package Component Builder
*@author Llewellyn van de Merwe <http://www.vdm.io>
*@copyright Copyright (C) 2014. All Rights Reserved
*@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
*
**/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
?>
###BOM###
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controllerform library
jimport('joomla.application.component.controller');
/**
* ###Component### Download Controller
*/
class ###Component###ControllerDownload extends JControllerLegacy
{
public function __construct($config)
{
parent::__construct($config);
// load the tasks
$this->registerTask('file', 'download');
}
public function download()
{
$jinput = JFactory::getApplication()->input;
// Check Token!
$token = JSession::getFormToken();
$call_token = $jinput->get('token', 0, 'ALNUM');
if($token == $call_token)
{
$task = $this->getTask();
switch($task)
{
case 'file':
$keys = ###Component###Helper::base64_urldecode($jinput->get('key', NULL, 'STRING'));
$enUrl = ###Component###Helper::base64_urldecode($jinput->get('link', NULL, 'STRING'));
$filename = $jinput->get('filename', NULL, 'CMD');
if((base64_encode(base64_decode($enUrl, true)) === $enUrl) && (base64_encode(base64_decode($keys, true)) === $keys) && $filename)
{
// we must first count this download
if (###Component###Helper::countDownload($keys,$filename))
{
// get Site name
$config = JFactory::getConfig();
$vendor = $config->get('sitename');
$name = ###Component###Helper::safeString($filename, 'Ww');
// Get local key
$localkey = ###Component###Helper::getLocalKey();
$opener = new FOFEncryptAes($localkey, 128);
$link = rtrim($opener->decryptString($enUrl), "\0");
$info = $this->getContentInfo($link);
// set headers
$app = JFactory::getApplication();
$app->setHeader('Accept-ranges', 'bytes', true);
$app->setHeader('Connection', 'keep-alive', true);
$app->setHeader('Content-Encoding', 'none', true);
$app->setHeader('Content-disposition', 'attachment; filename="'.$filename.'";', true);
if (isset($info['type']) && $info['type'])
{
$app->setHeader('Content-Type', $info['type'], true);
}
elseif (strpos($filename, '.mp3') !== false)
{
$app->setHeader('Content-Type', 'audio/mpeg', true);
}
else
{
$app->setHeader('Content-Type', 'application/octet-stream', true);
}
// important to have the file size.
if (isset($info['filesize']) && $info['filesize'])
{
$app->setHeader('Content-Length', (int) $info['filesize'], true);
$app->setHeader('Content-Size', (int) $info['filesize'], true);
}
$app->setHeader('Content-security-policy', 'referrer no-referrer', true);
$app->setHeader('Content-Name', '"'.$name.'"', true);
$app->setHeader('Content-Version', '1.0', true);
$app->setHeader('Content-Vendor', '"'.$vendor.'"', true);
$app->setHeader('Content-URL', '"'.JUri::getInstance().'"', true);
$app->setHeader('etag', md5($enUrl), true);
$app->setHeader('Pragma', 'public', true);
$app->setHeader('cache-control', 'max-age=0', true);
$app->setHeader('x-robots-tag', 'noindex, nofollow, noimageindex', true);
$app->setHeader('x-content-security-policy', 'referrer no-referrer', true);
$app->setHeader('x-webkit-csp', 'referrer no-referrer', true);
$app->setHeader('x-content-security-policy', 'referrer no-referrer', true);
// get the file
readfile($link);
$app->sendHeaders();
$app->close();
jexit();
}
}
break;
}
}
die('Restricted access');
}
protected function getContentInfo($url)
{
// we first try the curl option
if ($this->_isCurl())
{
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_NOBODY, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$data = curl_exec($ch);
curl_close($ch);
}
else
{
// then we try getheaders (this is slower)
stream_context_set_default( array('http' => array('method' => 'HEAD')));
$headers = get_headers($url);
if (###Component###Helper::checkArray($headers))
{
$data = implode("\n", $headers);
}
}
// get the Content Length
if (preg_match('/Content-Length: (\d+)/', $data, $matches))
{
// Contains file size in bytes
$found['filesize'] = (int) $matches[1];
}
// get the Content Type
if (preg_match_all('/Content-Type: (.+)/', $data, $matches))
{
foreach ($matches[1] as $match)
{
// not the html
if (strpos( $match, 'text/html') === false)
{
$found['type'] = $match;
break;
}
}
}
// return found values
if (isset($found) && ###Component###Helper::checkArray($found))
{
return $found;
}
return false;
}
protected function _isCurl()
{
return function_exists('curl_version');
}
}

View File

@ -1,700 +0,0 @@
<?php
/*----------------------------------------------------------------------------------| www.vdm.io |----/
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.0.0 - 21st January, 2017
@package Dropbox API 2
@subpackage dropbox.php
@author Llewellyn van der Merwe <http://www.vdm.io>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
/------------------------------------------------------------------------------------------------------*/
// No direct access.
defined('_JEXEC') or die;
/**
* Dropbox class
*/
class Dropbox
{
/**
* final url
*/
protected $url;
/**
* The array for the post url
*/
protected $postUrl = array(
"protocol" => "https://",
"suddomain" => "api.",
"domain" => "dropboxapi.com",
"path" => "/2/"
);
/**
* the verious pathes we need
*/
protected $domainpath = array(
"list_shared_links" => "sharing/list_shared_links",
"list_folder" => "files/list_folder",
"list_folder_continue" => "files/list_folder/continue",
"create_shared_link_with_settings" => "sharing/create_shared_link_with_settings",
"get_shared_link_metadata" => "sharing/get_shared_link_metadata",
"revoke" => "auth/token/revoke"
);
/**
* the target pathe to get
*/
protected $targetPath = false;
protected $targetPathOriginal = false;
/**
* oauth token
*/
protected $oauthToken;
/**
* the verious pathes we need
*/
protected $permissionType;
/**
* The array of queries for creating shared links
*/
protected $createSharedLinks = array();
/**
* The array of queries for getting shared links
*/
protected $getSharedLinks = array();
/**
* the success switch
*/
protected $succes;
/**
* the type call
*/
protected $type;
/**
* the query for the call
*/
protected $query;
/**
* the query for the call
*/
protected $model;
/**
* the mediaData bucket
*/
public $mediaData = array();
/**
* the error messages
*/
public $error_summary = array();
/**
* force the update to reset
**/
public $forceReset = false;
/**
* Constructor
*/
public function __construct(JModelLegacy $model, $buildType)
{
// set the first call
$this->firstCall = 'get'; // TODO (we may what to make this dynamic)
// set the second call
$this->secondCall = 'create'; // TODO (we may what to make this dynamic)
// set the url at this point for now
$this->url = $this->postUrl["protocol"].$this->postUrl["suddomain"].$this->postUrl["domain"].$this->postUrl["path"];
// set the local model
$this->model = $model;
// set the build type
$this->build = (int) $buildType;
}
/**
* getFiles
*
* =============
* $details
* =============
* sourceID
* dropboxOption
* dropboxTarget
* addTypes
*
*/
public function getFiles($token, $permissiontype, $details = array())
{
// we need more then the normal time to run this script 5 minutes at least.
ini_set('max_execution_time', 500);
// set the oauth toke
$this->oauthToken = $token;
// set the permission type
$this->permissionType = $permissiontype;
// set the details
if ($this->checkArray($details))
{
foreach ($details as $detail => $value)
{
$this->$detail = $value;
}
}
// set the curent folder path
if (!$this->setFolderPath())
{
return false;
}
// start the main factory that calles for the folder data
$this->query = array("path" => $this->targetPath, "recursive" => true, "include_media_info" => true);
$this->type = 'list_folder';
if ($this->makeCall())
{
if ($this->_isCurl())
{
// run the share link builder
return $this->makeMultiExecCalls();
}
return true;
}
return false;
}
protected function makeMultiExecCalls()
{
// make the fist call
$this->multiSharedLinks($this->firstCall);
// make the second call
$this->multiSharedLinks($this->secondCall);
// make the fist call (again for safety)
$this->multiSharedLinks($this->firstCall);
// make the second call (again for safety)
$this->multiSharedLinks($this->secondCall);
}
protected function multiSharedLinks($type)
{
switch ($type)
{
case "create":
// great links if not made already
if (count($this->createSharedLinks) > 0)
{
$url = $this->url.$this->domainpath['create_shared_link_with_settings'];
$this->type = 'create_shared_link_with_settings';
// build return function
$storeSharedLink = function ($data, $target) {
// check if link already made
if (isset($data->error_summary) && strpos($data->error_summary, 'shared_link_already_exists') !== false)
{
$this->getSharedLinks[] = json_encode(array("path" => $target));
}
else
{
$this->curlCallResult($data);
}
};
// run call
return $this->multiCall($url, $type, $storeSharedLink);
}
break;
case "get":
// now get the already made links
if (count($this->getSharedLinks) > 0)
{
$url = $this->url.$this->domainpath['list_shared_links'];
$this->type = 'list_shared_links';
// build return function
$storeSharedLink = function ($data, $target) {
// check if link not made
if (isset($data->error_summary))
{
$this->createSharedLinks[] = json_encode(array("path" => $target, "settings" => array("requested_visibility" => "public")));
}
else
{
$this->curlCallResult($data);
}
};
// run call
return $this->multiCall($url, $type, $storeSharedLink);
}
break;
}
return false;
}
protected function multiCall(&$url, $type, &$storeSharedLink)
{
$timer = 1;
$options = array();
// set the options array and make the calls every 250
foreach ($this->{$type."SharedLinks"} as $query)
{
$options[] = array(CURLOPT_HTTPHEADER => array('Authorization: Bearer ' . $this->oauthToken, 'Content-Type: application/json'), CURLOPT_POST => 1, CURLOPT_POSTFIELDS => $query); $timer++;
// check timer
if ($timer >= 550)
{
// run multi curl
$this->curlMultiExec($url, $options, $storeSharedLink);
// reset
$timer = 1;
$options = array();
}
}
// make sure all was done
if ($timer > 1 && count($options))
{
// run multi curl
$this->curlMultiExec($url, $options, $storeSharedLink);
}
// reset the values
$this->{$type."SharedLinks"} = array();
// only if there is no errors
if (count($this->error_summary) > 0)
{
return false;
}
return true;
}
public function revokeToken($token = null)
{
if ($token)
{
// set the oauth toke
$this->oauthToken = $token;
}
// set the call to revoke the token
$this->query = 'null';
$this->type = 'revoke';
if ($this->makeCall())
{
return true;
}
return false;
}
protected function setFolderPath()
{
if ('full' == $this->permissionType && isset($this->dropboxOption) && isset($this->dropboxTarget) && $this->checkString($this->dropboxTarget))
{
if (2 == $this->dropboxOption)
{
// simply set the path
$this->targetPath = '/'.trim(strtolower($this->dropboxTarget), '/');
return true;
}
elseif (1 == $this->dropboxOption)
{
// make a call to get the path
$this->query = array("url" => $this->dropboxTarget);
$this->type = 'get_shared_link_metadata';
if ($this->makeCall())
{
return true;
}
}
}
elseif ('app' == $this->permissionType)
{
$this->targetPath = "";
return true;
}
return false;
}
protected function makeCall()
{
if ($this->_isCurl())
{
return $this->makeCurlCall();
}
else
{
return $this->makeGetCall();
}
}
protected function makeGetCall()
{
$options = array(
'http' => array(
'header' => "Content-Type: application/json\r\n".
"Authorization: Bearer ".$this->oauthToken,
'method' => "POST"
),
);
if ($this->checkArray($this->query))
{
$this->query = json_encode($this->query);
}
// add the query
if ($this->checkString($this->query))
{
$options['http']['content'] = $this->query;
}
$context = stream_context_create($options);
$response = file_get_contents($this->url.$this->domainpath[$this->type], false, $context);
// store the result
return $this->getCallResult($response);
}
protected function getCallResult($response)
{
if ($response === FALSE)
{
$this->error_summary[] = $this->type.'_error';
return false;
}
// store the result
return $this->setTheResult(json_decode($response));
}
protected function makeCurlCall()
{
// do not run creat shared link this way
$headers = array('Authorization: Bearer '. $this->oauthToken,
'Content-Type: application/json'
);
$ch = curl_init($this->url.$this->domainpath[$this->type]);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
// check if query is set
if ($this->checkArray($this->query))
{
$this->query = json_encode($this->query);
}
// add the query
if ($this->checkString($this->query))
{
curl_setopt($ch, CURLOPT_POSTFIELDS, $this->query);
}
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// curl_setopt($ch, CURLOPT_VERBOSE, 1); // debug
$response = curl_exec($ch);
curl_close($ch);
// store the result
return $this->curlCallResult($response);
}
public function curlCallResult($response)
{
if ($this->checkJson($response))
{
$response = json_decode($response);
}
// store the result
return $this->setTheResult($response);
}
protected function setTheResult($data)
{
// if there was an error stop!!!
if (isset($data->error_summary))
{
$this->error_summary[] = $data->error_summary;
$this->forceReset = true;
return false;
}
// deal with each type
switch ($this->type)
{
case "list_folder":
case "list_folder_continue":
if (isset($data->entries) && $this->checkArray($data->entries))
{
if ($this->storeFiles($data->entries))
{
// run the continue if needed
if (isset($data->has_more) && $data->has_more && isset($data->cursor))
{
// start the main factory that calles for the folder data
$this->query = array("cursor" => $data->cursor);
$this->type = 'list_folder_continue';
if ($this->makeCall())
{
return true;
}
}
return true;
}
}
$this->error_summary[] = $this->type.'_error';
break;
case "list_shared_links":
if (isset($data->links) && $this->checkArray($data->links))
{
foreach ($data->links as $link)
{
if (!$this->storeSharedLink($link))
{
// we could not stored the link
return false;
}
}
return true;
}
$this->error_summary[] = $this->type.'_error';
break;
case "create_shared_link_with_settings":
if ($this->storeSharedLink($data))
{
// we stored the link
return true;
}
$this->error_summary[] = $this->type.'_error';
break;
case "get_shared_link_metadata":
if (isset($data->path_lower))
{
$this->targetPath = $data->path_lower;
return true;
}
$this->error_summary[] = $this->type.'_error';
break;
case "revoke":
if (is_null($data))
{
return true;
}
$this->error_summary[] = $this->type.'_error';
break;
}
$this->forceReset = true;
return false;
}
protected function storeSharedLink($data)
{
// we need to store the url to DB
if (isset($data->url) && isset($data->name) && isset($data->size) && (isset($data->path) || isset($data->path_lower)))
{
$path = (isset($data->path)) ? $data->path : $data->path_lower;
$localListing = array();
$localListing['id'] = 0;
$localListing['name'] = $data->name;
$localListing['size'] = $data->size;
$localListing['key'] = $this->fixPath($path);
$localListing['url'] = str_replace('?dl=0','?dl=1',$data->url);
$localListing['build'] = $this->build;
$localListing['external_source'] = (int) $this->sourceID;
// check if item already set
if ($id = $this->model->searchForId($localListing['key']))
{
// update item
$localListing['id'] = $id;
}
return $this->model->save($localListing);
}
return false;
}
protected function storeFiles($entries)
{
foreach ($entries as $item)
{
if (isset($item->{'.tag'}) && 'file' == $item->{'.tag'} && isset($item->name))
{
$addLink = false;
// remove if not related to type
if (isset($this->addTypes) && $this->checkArray($this->addTypes))
{
foreach ($this->addTypes as $add)
{
if (strpos($item->name,$add) !== false)
{
$addLink = true;
}
}
}
if ($addLink && isset($item->path_lower))
{
// set based on first call
if ('get' === $this->firstCall)
{
// first check if shared link exist
$this->query = array("path" => $item->path_lower);
// set the type of call
$this->type = 'list_shared_links';
}
else
{
// first check if shared link exist
$this->query = array("path" => $item->path_lower, "settings" => array("requested_visibility" => "public"));
// set the type of call
$this->type = 'create_shared_link_with_settings';
}
// if we have curl the use multi curl execution
if ($this->_isCurl())
{
// set query to worker
$this->{$this->firstCall."SharedLinks"}[] = json_encode($this->query);
}
elseif (!$this->makeCall())
{
return false;
}
}
}
}
return true;
}
protected function fixPath($path)
{
if ($this->checkString($this->targetPath))
{
$path = str_replace($this->targetPath, 'VDM_pLeK_h0uEr', $path);
}
else
{
$path = 'VDM_pLeK_h0uEr'.$path;
}
return $path;
}
protected function checkObject($object)
{
if (isset($object) && is_object($object) && count($object) > 0)
{
return true;
}
return false;
}
protected function checkArray($array)
{
if (isset($array) && is_array($array) && count($array) > 0)
{
return true;
}
return false;
}
protected function checkJson($string)
{
if ($this->checkString($string))
{
json_decode($string);
return (json_last_error() === JSON_ERROR_NONE);
}
return false;
}
protected function checkString($string)
{
if (isset($string) && is_string($string) && strlen($string) > 0)
{
return true;
}
return false;
}
protected function _isCurl()
{
return function_exists('curl_version');
}
protected function curlMultiExec(&$url, &$_options, $callback = null)
{
if ($this->checkString($url))
{
// make sure the thread size isn't greater than the # of _options
$threadSize = 20;
$threadSize = (sizeof($_options) < $threadSize) ? sizeof($_options) : $threadSize;
// set the options
$options = array();
$options[CURLOPT_URL] = $url;
$options[CURLOPT_USERAGENT] = 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12';
$options[CURLOPT_RETURNTRANSFER] = TRUE;
$options[CURLOPT_SSL_VERIFYPEER] = FALSE;
// start multi threading :)
$handle = curl_multi_init();
// start the first batch of requests
for ($i = 0; $i < $threadSize; $i++)
{
if (isset($_options[$i]))
{
$ch = curl_init();
foreach ($_options[$i] as $curlopt => $string)
{
$options[$curlopt] = $string;
}
curl_setopt_array($ch, $options);
curl_multi_add_handle($handle, $ch);
}
}
// we wait for all the calls to finish (should not take long)
do {
while(($execrun = curl_multi_exec($handle, $working)) == CURLM_CALL_MULTI_PERFORM);
if($execrun != CURLM_OK)
break;
// a request was just completed -- find out which one
while($done = curl_multi_info_read($handle))
{
if (is_callable($callback))
{
// $info = curl_getinfo($done['handle']);
// request successful. process output using the callback function.
$output = curl_multi_getcontent($done['handle']);
$callback(json_decode($output), json_decode(end($_options[$i]))->path);
}
$key = $i + 1;
if(isset($_options[$key]))
{
// start a new request (it's important to do this before removing the old one)
$ch = curl_init(); $i++;
// add options
foreach ($_options[$key] as $curlopt => $string)
{
$options[$curlopt] = $string;
}
curl_setopt_array($ch, $options);
curl_multi_add_handle($handle, $ch);
// remove options again
foreach ($_options[$key] as $curlopt => $string)
{
unset($options[$curlopt]);
}
}
// remove the curl handle that just completed
curl_multi_remove_handle($handle, $done['handle']);
}
// stop wasting CPU cycles and rest for a couple ms
usleep(10000);
} while ($working);
// close the curl multi thread
curl_multi_close($handle);
// okay done
return true;
}
return false;
}
}

View File

@ -1,442 +0,0 @@
<?php
/**
*
*@version 2.0.0 - September 03, 2014
*@package Component Builder
*@author Llewellyn van de Merwe <http://www.vdm.io>
*@copyright Copyright (C) 2014. All Rights Reserved
*@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
*
**/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
?>
###BOM###
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
/**
* Dropbox updater component helper
*/
class Dropboxupdater
{
/**
* update flag (if false update will not happen)
**/
protected $okay = true;
/**
* update flag (if false update will not happen)
**/
protected $data = null;
/**
* the file Key
**/
protected $fileKey;
/**
* allow a forced update
**/
protected $forceUpdate;
/**
* Todays date-time
**/
protected $today;
/**
* Next updat date-time
**/
protected $next;
/**
* update method
**/
protected $updateMethod;
/**
* update targets
**/
protected $updateTarget;
/**
* info related to this update
**/
protected $updateInfo;
protected $infoFilePath;
/**
* Main dropbox class
**/
protected $dropbox;
/**
* component parameters
**/
protected $app_params;
/**
* the errors
**/
protected $errors = array();
/**
* everything we want done when initialized
**/
public function __construct()
{
// get params
$this->app_params = JComponentHelper::getParams('com_###component###');
}
/**
* get the logged errors array
**/
public function getErrors()
{
return $this->errors;
}
/**
* set the error to the log
**/
protected function setErrors($error)
{
if (###Component###Helper::checkString($error))
{
$this->errors[] = $error;
}
elseif (###Component###Helper::checkArray($error))
{
foreach($error as $log)
{
if (###Component###Helper::checkString($log))
{
$this->errors[] = $log;
}
}
}
}
/**
* update method
**/
public function update($id, $target, $type = false, $forceUpdate = false, $sleutel = null)
{
if ($type)
{
// start fresh
$this->okay = true;
$this->data = null;
// is this a forced run
$this->forceUpdate = $forceUpdate;
// the file key
$this->fileKey = ###Component###Helper::safeString($id.$target.$type);
// set the type of this listing
$this->type = $type;
// get the external source data being updated
$this->setExternalSourceData($id);
// load the token if manualy set
if ($sleutel)
{
$this->setExternalSourceData($id, array('oauthtoken' => $sleutel));
}
// what update method is set
$this->setUpdateMethod();
// set the update links
$this->setUpdateTarget($target);
// set needed dates
if ($this->okay)
{
$this->setDates();
}
// get info data or set if not found
if ($this->okay)
{
$this->setUpdateInfoData();
}
// check if update should run now
if ($this->okay)
{
$this->checkUpdateStatus();
}
// before update save update info incase class is called again
if($this->okay)
{
if ($this->updateInfo->updatenow)
{
// turn update to active
$this->updateInfo->updatenow = false;
$this->updateInfo->updateactive = true;
// now save the date
$this->okay = $this->saveUpdateInfo();
}
else
{
$this->okay = false;
}
}
// run the update if all is okay
if ($this->okay)
{
// set the config
$this->setDetailsConfig();
// load the file
JLoader::import('dropbox', JPATH_COMPONENT_SITE.'/helpers');
$build = 1;
if ('auto' == $this->type)
{
$build = 2;
}
// load the dropbox class
$this->dropbox = new Dropbox(###Component###Helper::getModel('local_listing', JPATH_COMPONENT_ADMINISTRATOR), $build);
// okay now update
$this->okay = $this->doUpdate();
}
// always reset if all okay
return $this->resetUpdate();
}
$this->setErrors('The update type is unknown.');
return false;
}
/**
* set the exsternal source data
*/
protected function setExternalSourceData($id, $data = array())
{
// get the data if not set
if (!$this->data || !###Component###Helper::checkObject($this->data))
{
// load model to get the data
$model = ###Component###Helper::getModel('external_source', JPATH_COMPONENT_ADMINISTRATOR);
$this->data = $model->getItem($id);
}
// if new data is set load it
if (###Component###Helper::checkArray($data))
{
foreach ($data as $key => $value)
{
$this->data->$key = $value;
}
}
}
/**
* set update mehtod
**/
protected function setUpdateMethod()
{
if ($this->forceUpdate)
{
// this is a manual method
$this->updateMethod = 'manual';
}
elseif (2 == $this->data->update_method)
{
// this it an auto mehtod
$this->updateMethod = 'auto';
}
else
{
$this->okay = false;
}
}
/**
* set update target
**/
protected function setUpdateTarget($nr)
{
// get target based on type and position
if ('full' == $this->data->permissiontype && $nr > 0)
{
$position = $nr - 1;
if (1 == $this->data->dropboxoptions && ###Component###Helper::checkJson($this->data->sharedurl))
{
$targets = json_decode($this->data->sharedurl)->tsharedurl;
}
elseif (2 == $this->data->dropboxoptions && ###Component###Helper::checkJson($this->data->folder))
{
$targets = json_decode($this->data->folder)->tfolder;
}
// check if we found any
if (!isset($targets[$position]) || !###Component###Helper::checkString($targets[$position]))
{
$this->setErrors('The target Shared-url or Folder is not set.');
$this->okay = false;
}
else
{
$this->updateTarget = $targets[$position];
}
}
else
{
$this->updateTarget = '';
}
}
/**
* set the configeration for exsternal source class
**/
protected function setDetailsConfig()
{
// reset config
$this->detailsConfig = array();
// the source ID
$this->detailsConfig['sourceID'] = $this->data->id;
// get the legal files set
$this->detailsConfig['addTypes'] = $this->data->filetypes;
// set other config settings
$this->detailsConfig['dropboxOption'] = $this->data->dropboxoptions;
// set dropbox target
$this->detailsConfig['dropboxTarget'] = $this->updateTarget;
}
/**
* set next update time
**/
protected function setDates()
{
// set todays date/time
$this->today = time();
// set the next update date/time
if ('manual' == $this->updateMethod)
{
// set the date to two days ago to ensure the update runs now
$this->next = strtotime("-2 days");
}
else
{
// based on the auto time we will set the next update date/time
$timer = $this->data->update_timer;
if ($timer != 0)
{
// Get Next Update Time
$this->next = strtotime('+'.$timer.' minutes', $this->today);
}
// if timer is 0 we should not update
else
{
$this->setErrors('The timer is not setup correctly.');
$this->okay = false;
}
}
}
/**
* set update info data
**/
protected function setUpdateInfoData()
{
// set the info file name
$fileName = md5($this->fileKey.'info');
// set file path
$this->infoFilePath = JPATH_COMPONENT_SITE.'/helpers/'.$fileName.'.json';
if (($json = @file_get_contents($this->infoFilePath)) !== FALSE)
{
$this->updateInfo = json_decode($json);
}
else
{
$this->updateInfo = new stdClass;
$this->updateInfo->nextupdate = 0;
$this->updateInfo->updateactive = false;
$this->updateInfo->updatenow = false;
}
}
/**
* check update status
**/
protected function checkUpdateStatus()
{
// check if there is already an update running
if ($this->updateInfo->updateactive)
{
$this->okay = false;
$this->setErrors('There is an update already running.');
}
// check if the time has come to do the next update
elseif (('auto' == $this->updateMethod) && ($this->updateInfo->nextupdate > $this->today))
{
$this->okay = false;
$this->setErrors('It is not yet time to run this update.');
}
else
{
$this->updateInfo->updatenow = true;
}
}
/**
* save the update info
**/
protected function saveUpdateInfo()
{
return $this->saveJson(json_encode($this->updateInfo),$this->infoFilePath);
}
/**
* update the local listing
**/
protected function doUpdate()
{
// we need more then the normal time to run this script 5 minutes at least.
ini_set('max_execution_time', $this->app_params->get('max_execution_time', 500));
// get data of all the shared links of all target items
if (!$this->dropbox->getFiles($this->data->oauthtoken, $this->data->permissiontype, $this->detailsConfig))
{
$this->setErrors($this->dropbox->error_summary);
return false;
}
// if this is a manual update, then revoke the token
if ($this->forceUpdate)
{
$this->dropbox->revokeToken();
}
return true;
}
public function resetUpdate()
{
if ($this->okay || (isset($this->dropbox->forceReset) && $this->dropbox->forceReset))
{
// make sure the update reset
$this->updateInfo->nextupdate = $this->next;
$this->updateInfo->updateactive = false;
$this->updateInfo->updatenow = false;
// store final update
$this->saveUpdateInfo();
}
return $this->okay;
}
protected function saveJson($data,$filename)
{
if (###Component###Helper::checkString($data))
{
$fp = fopen($filename, 'w');
fwrite($fp, $data);
fclose($fp);
return true;
}
return false;
}
}

View File

@ -175,6 +175,16 @@ class Compiler extends Infusion
$this->app->enqueueMessage('<hr />', 'Warning');
}
}
// check if we should add a EXTERNALCODE notice
if (ComponentbuilderHelper::checkArray($this->externalCodeString))
{
// number of external code strings
$externalCount = count($this->externalCodeString);
// the correct string
$externalCodeString = ($externalCount == 1) ? JText::_('code/string') : JText::_('code/strings');
// the notice
$this->app->enqueueMessage(JText::sprintf('There has been <b>%s - %s</b> added to this component as EXTERNALCODE. To avoid shipping your component with malicious %s always make sure that the correct <b>code/string values</b> were used.', $externalCount, $externalCodeString, $externalCodeString), 'Notice');
}
// end the timer here
$this->time_end = microtime(true);
$this->secondsCompiled = $this->time_end - $this->time_start;
@ -691,20 +701,20 @@ class Compiler extends Infusion
{
// Load escaped code since the target endhash has changed
$this->loadEscapedCode($file, $target, $lineBites);
$this->app->enqueueMessage(JText::sprintf('Custom code could not be added to <b>%s</b> please review the file at <b>line %s</b>. This could be due to a change to lines below the custom code.', $target['path'], $target['from_line']), 'warning');
$this->app->enqueueMessage(JText::sprintf('Custom code could not be added to <b>%s</b> please review the file at <b>line %s</b>. This could be due to a change to lines below the custom code.', $target['path'], $target['from_line']), 'Warning');
}
}
else
{
// Load escaped code since the target hash has changed
$this->loadEscapedCode($file, $target, $lineBites);
$this->app->enqueueMessage(JText::sprintf('Custom code could not be added to <b>%s</b> please review the file at <b>line %s</b>. This could be due to a change to lines above the custom code.', $target['path'], $target['from_line']), 'warning');
$this->app->enqueueMessage(JText::sprintf('Custom code could not be added to <b>%s</b> please review the file at <b>line %s</b>. This could be due to a change to lines above the custom code.', $target['path'], $target['from_line']), 'Warning');
}
}
else
{
// Give developer a notice that file is not found.
$this->app->enqueueMessage(JText::sprintf('File <b>%s</b> could not be found, so the custom code for this file could not be addded.', $target['path']), 'warning');
$this->app->enqueueMessage(JText::sprintf('File <b>%s</b> could not be found, so the custom code for this file could not be addded.', $target['path']), 'Warning');
}
}
}

View File

@ -144,7 +144,7 @@ class Get
public $customCodeMemory = array();
/**
* The custom code in local files that aready exist in system
* The custom code in local files that already exist in system
*
* @var array
*/
@ -164,6 +164,13 @@ class Get
*/
protected $codeAreadyDone = array();
/**
* The external code/string to be added
*
* @var array
*/
protected $externalCodeString = array();
/*
* The line numbers Switch
*
@ -240,10 +247,10 @@ class Get
* @var array
*/
public $langStringTargets = array(
'Joomla.JText._(',
'JText::script(',
'JText::_(',
'JText::sprintf('
'Joomla'.'.JText._(',
'JText:'.':script(',
'JText:'.':_(',
'JText:'.':sprintf('
);
/**
@ -3164,10 +3171,10 @@ class Get
// insure string is not broken
$content = str_replace('COM_###COMPONENT###', $this->langPrefix, $content);
// first get the Joomla.JText._()
if (in_array('Joomla.JText._(', $langStringTargets))
if (in_array('Joomla'.'.JText._(', $langStringTargets))
{
$jsTEXT[] = ComponentbuilderHelper::getAllBetween($content, "Joomla.JText._('", "'");
$jsTEXT[] = ComponentbuilderHelper::getAllBetween($content, 'Joomla.JText._("', '"');
$jsTEXT[] = ComponentbuilderHelper::getAllBetween($content, "Joomla".".JText._('", "'");
$jsTEXT[] = ComponentbuilderHelper::getAllBetween($content, 'Joomla.'.'JText._("', '"');
// combine into one array
$jsTEXT = ComponentbuilderHelper::mergeArrays($jsTEXT);
// we need to add a check to insure these JavaScript lang matchup
@ -3178,11 +3185,11 @@ class Get
$this->langMismatch = ComponentbuilderHelper::mergeArrays(array($jsTEXT, $this->langMismatch));
}
}
// now get the JText::script()
if (in_array('JText::script(', $langStringTargets))
// now get the JText: :script()
if (in_array('JText:'.':script(', $langStringTargets))
{
$scTEXT[] = ComponentbuilderHelper::getAllBetween($content, "JText::script('", "'");
$scTEXT[] = ComponentbuilderHelper::getAllBetween($content, 'JText::script("', '"');
$scTEXT[] = ComponentbuilderHelper::getAllBetween($content, "JText:".":script('", "'");
$scTEXT[] = ComponentbuilderHelper::getAllBetween($content, 'JText:'.':script("', '"');
// combine into one array
$scTEXT = ComponentbuilderHelper::mergeArrays($scTEXT);
// we need to add a check to insure these JavaScript lang matchup
@ -3197,7 +3204,7 @@ class Get
foreach ($langStringTargets as $langStringTarget)
{
// need some special treatment here
if ($langStringTarget === 'Joomla.JText._(' || $langStringTarget === 'JText::script(')
if ($langStringTarget === 'Joomla'.'.JText._(' || $langStringTarget === 'JText:'.':script(')
{
continue;
}
@ -3651,19 +3658,130 @@ class Get
{
if (ComponentbuilderHelper::checkString($string))
{
return $this->setLangStrings($this->setCustomCodeData($string));
return $this->setLangStrings($this->setCustomCodeData($this->setExternalCodeString($string)));
}
return $string;
}
/**
* Set the external code string & load it in to string
*
* @param string $string The content to check
*
* @return string
*
*/
public function setExternalCodeString($string)
{
// check if content has custom code place holder
if (strpos($string, '[EXTERNA'.'LCODE=') !== false)
{
// target content
$bucket = array();
$found = ComponentbuilderHelper::getAllBetween($string, '[EXTERNA'.'LCODE=', ']');
if (ComponentbuilderHelper::checkArray($found))
{
// build local bucket
foreach ($found as $target)
{
// check if the target is valid URL or path
if ((!filter_var($target, FILTER_VALIDATE_URL) === false && ComponentbuilderHelper::urlExists($target))
|| (JPath::clean($target) === $target && JFile::exists($target)))
{
$this->getExternalCodeString($target, $bucket);
}
// give notice that target is not a valid url/path
else
{
// set key
$key = '[EXTERNA'.'LCODE='.$target.']';
// set the notice
$this->app->enqueueMessage(JText::sprintf('The <b>%s</b> is not a valid url/path!', $key), 'Warning');
// remove the placeholder
$bucket[$key] = '';
}
}
// now update local string if bucket has values
if (ComponentbuilderHelper::checkArray($bucket))
{
$string = $this->setPlaceholders($string, $bucket);
}
}
}
return $string;
}
/**
* Get the External Code/String
*
* @param string $string The content to check
* @param array $bucket The Placeholders bucket
*
* @return void
*
*/
protected function getExternalCodeString($target, &$bucket)
{
// set key
$key = '[EXTERNA'.'LCODE=' . $target . ']';
// set URL key
$targetKey = trim($target);
// check if we already fetched this
if (!isset($this->externalCodeString[$targetKey]))
{
// get the data string (code)
$this->externalCodeString[$targetKey] = ComponentbuilderHelper::getFileContents($targetKey);
// did we get any value
if (ComponentbuilderHelper::checkString($this->externalCodeString[$targetKey]))
{
// check for changes
$liveHash = md5($this->externalCodeString[$targetKey]);
// check if it exist local
if ($hash = ComponentbuilderHelper::getVar('external_code', $targetKey, 'target', 'hash'))
{
if ($hash !== $liveHash)
{
// update the hash since it changed
$object = new stdClass();
$object->target = $targetKey;
$object->hash = $liveHash;
// update local hash
$this->db->updateObject('#__componentbuilder_external_code', $object, 'target');
// give notice of the change
$this->app->enqueueMessage(JText::sprintf('The code/string from <b>%s</b> has been <b>changed</b> since the last compilation, please investigate to insure the changes are safe!', $key), 'Warning');
}
}
else
{
// add the hash to track changes
$object = new stdClass();
$object->target = $targetKey;
$object->hash = $liveHash;
// insert local hash
$this->db->insertObject('#__componentbuilder_external_code', $object);
// give notice the first time this is added
$this->app->enqueueMessage(JText::sprintf('The code/string from <b>%s</b> has been added for the <b>first time</b>, please investigate to insure the correct code/string was used!', $key), 'Notice');
}
}
else
{
// set notice that we could not get a valid string from the target
$this->app->enqueueMessage(JText::sprintf('The <b>%s</b> returned an invalid string!', $key), 'Warning');
}
}
// add to local bucket
if (isset($this->externalCodeString[$targetKey]))
{
$bucket[$key] = $this->externalCodeString[$targetKey];
}
}
/**
* We start set the custom code data & can load it in to string
*
* @param string $string The content to check
* @param bool $insert Should we insert the code into the content
* @param bool $bool Should we return bool on success
*
* @return string|bool based on sig
* @return string
*
*/
public function setCustomCodeData($string)
@ -3690,11 +3808,11 @@ class Get
$getFuncName = trim($key);
if (!isset($this->functionNameMemory[$getFuncName]))
{
if (!$found = ComponentbuilderHelper::getVar('custom_code', $getFuncName, 'function_name', 'id'))
if (!$found_local = ComponentbuilderHelper::getVar('custom_code', $getFuncName, 'function_name', 'id'))
{
continue;
}
$this->functionNameMemory[$getFuncName] = $found;
$this->functionNameMemory[$getFuncName] = $found_local;
}
$id = (int) $this->functionNameMemory[$getFuncName];
}
@ -3711,11 +3829,11 @@ class Get
$getFuncName = trim($array[0]);
if (!isset($this->functionNameMemory[$getFuncName]))
{
if (!$found = ComponentbuilderHelper::getVar('custom_code', $getFuncName, 'function_name', 'id'))
if (!$found_local = ComponentbuilderHelper::getVar('custom_code', $getFuncName, 'function_name', 'id'))
{
continue;
}
$this->functionNameMemory[$getFuncName] = $found;
$this->functionNameMemory[$getFuncName] = $found_local;
}
$id = (int) $this->functionNameMemory[$getFuncName];
}
@ -4282,6 +4400,9 @@ class Get
foreach ($bucket as $nr => &$customCode)
{
$customCode['code'] = base64_decode($customCode['code']);
// always insure that the external code is loaded
$customCode['code'] = $this->setExternalCodeString($customCode['code']);
// set the lang only if needed
if ($setLang)
{
$customCode['code'] = $this->setLangStrings($customCode['code']);
@ -4618,6 +4739,7 @@ class Get
{
// reset found comment type
$commentType = 0;
$this->app->enqueueMessage(JText::sprintf('We found dynamic code <b>all in one line</b>, and ignored it! Please review (%s) for more details!', $path), 'Warning');
continue;
}
// do a quick check to insure we have an id

View File

@ -255,7 +255,7 @@ class Interpretation extends Fields
$this->fileContentStatic['###HELPER_SITE_LICENSE_LOCK###'] = $this->setHelperLicenseLock($_VDM, 'site');
$this->fileContentStatic['###HELPER_LICENSE_LOCK###'] = $this->setHelperLicenseLock($_VDM, 'admin');
$this->fileContentStatic['###LICENSE_LOCKED_INT###'] = $this->setInitLicenseLock($_VDM);
$this->fileContentStatic['###LICENSE_LOCKED_DEFINED###'] = PHP_EOL . PHP_EOL . 'defined(\'' . $_VDM . '\') or die(JText::_(\'NIE_REG_NIE\'));';
$this->fileContentStatic['###LICENSE_LOCKED_DEFINED###'] = PHP_EOL . PHP_EOL . 'defined(\'' . $_VDM . '\') or die(JText:'.':_(\'NIE_REG_NIE\'));';
}
}
else
@ -300,7 +300,7 @@ class Interpretation extends Fields
$statment[] = PHP_EOL . "\t\tif (!" . $thIIS . "->" . $boolMethod . "())";
$statment[] = "\t\t{";
$statment[] = "\t\t\t\$app = JFactory::getApplication();";
$statment[] = "\t\t\t\$app->enqueueMessage(JText::_('NIE_REG_NIE'), 'error');";
$statment[] = "\t\t\t\$app->enqueueMessage(JText:".":_('NIE_REG_NIE'), 'error');";
$statment[] = "\t\t\t\$app->redirect('index.php');";
$statment[] = "\t\t\treturn false;";
$statment[] = "\t\t}";
@ -2070,7 +2070,7 @@ class Interpretation extends Fields
{
$this->langContent['site'][$langKeyWord] = 'Not authorised to view ' . $view['settings']->code . '!';
}
$accessCheck[] = "\t\t\t\$app->enqueueMessage(JText::_('" . $langKeyWord . "'), 'error');";
$accessCheck[] = "\t\t\t\$app->enqueueMessage(JText:".":_('" . $langKeyWord . "'), 'error');";
$accessCheck[] = $redirectMessage;
$accessCheck[] = "\t\t\t\$app->redirect(" . $redirectString . ");";
$accessCheck[] = "\t\t\treturn false;";
@ -2124,7 +2124,7 @@ class Interpretation extends Fields
$this->langContent[$this->lang][$langKeyWoord] = 'Not found, or access denied.';
}
$getItem .= PHP_EOL . "\t" . $tab . "\t\t//" . $this->setLine(__LINE__) . " If no data is found redirect to default page and show warning.";
$getItem .= PHP_EOL . "\t" . $tab . "\t\t\$app->enqueueMessage(JText::_('" . $langKeyWoord . "'), 'warning');";
$getItem .= PHP_EOL . "\t" . $tab . "\t\t\$app->enqueueMessage(JText:".":_('" . $langKeyWoord . "'), 'warning');";
if ('site' === $this->target)
{
// check that the default and the redirect page is not the same
@ -4571,7 +4571,7 @@ class Interpretation extends Fields
$script .= PHP_EOL . "\t\t\t{";
$script .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " If succesfully remove " . $viewName . " add queued success message.";
// TODO lang is not translated
$script .= PHP_EOL . "\t\t\t\t\$app->enqueueMessage(JText::_('The (" . $typeAlias . ") type alias was removed from the <b>#__content_type</b> table'));";
$script .= PHP_EOL . "\t\t\t\t\$app->enqueueMessage(JText:".":_('The (" . $typeAlias . ") type alias was removed from the <b>#__content_type</b> table'));";
$script .= PHP_EOL . "\t\t\t}";
// Now remove the related items from contentitem tag map table
@ -4588,7 +4588,7 @@ class Interpretation extends Fields
$script .= PHP_EOL . "\t\t\t{";
$script .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " If succesfully remove " . $viewName . " add queued success message.";
// TODO lang is not translated
$script .= PHP_EOL . "\t\t\t\t\$app->enqueueMessage(JText::_('The (" . $typeAlias . ") type alias was removed from the <b>#__contentitem_tag_map</b> table'));";
$script .= PHP_EOL . "\t\t\t\t\$app->enqueueMessage(JText:".":_('The (" . $typeAlias . ") type alias was removed from the <b>#__contentitem_tag_map</b> table'));";
$script .= PHP_EOL . "\t\t\t}";
// Now remove the related items from ucm content table
@ -4605,7 +4605,7 @@ class Interpretation extends Fields
$script .= PHP_EOL . "\t\t\t{";
$script .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " If succesfully remove " . $viewName . " add queued success message.";
// TODO lang is not translated
$script .= PHP_EOL . "\t\t\t\t\$app->enqueueMessage(JText::_('The (" . $typeAlias . ") type alias was removed from the <b>#__ucm_content</b> table'));";
$script .= PHP_EOL . "\t\t\t\t\$app->enqueueMessage(JText:".":_('The (" . $typeAlias . ") type alias was removed from the <b>#__ucm_content</b> table'));";
$script .= PHP_EOL . "\t\t\t}";
// setup the foreach loop of ids
@ -4642,8 +4642,8 @@ class Interpretation extends Fields
$script .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " If All related items was removed queued success message.";
// TODO lang is not translated
$script .= PHP_EOL . "\t\t\$app->enqueueMessage(JText::_('All related items was removed from the <b>#__ucm_base</b> table'));";
$script .= PHP_EOL . "\t\t\$app->enqueueMessage(JText::_('All related items was removed from the <b>#__ucm_history</b> table'));";
$script .= PHP_EOL . "\t\t\$app->enqueueMessage(JText:".":_('All related items was removed from the <b>#__ucm_base</b> table'));";
$script .= PHP_EOL . "\t\t\$app->enqueueMessage(JText:".":_('All related items was removed from the <b>#__ucm_history</b> table'));";
// finaly remove the assets from the assets table
$script .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Remove " . $component . " assets from the assets table";
$script .= PHP_EOL . "\t\t\$" . $component . "_condition = array( \$db->quoteName('name') . ' LIKE ' . \$db->quote('com_" . $component . "%') );";
@ -4657,7 +4657,7 @@ class Interpretation extends Fields
$script .= PHP_EOL . "\t\t{";
$script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " If succesfully remove " . $component . " add queued success message.";
// TODO lang is not translated
$script .= PHP_EOL . "\t\t\t\$app->enqueueMessage(JText::_('All related items was removed from the <b>#__assets</b> table'));";
$script .= PHP_EOL . "\t\t\t\$app->enqueueMessage(JText:".":_('All related items was removed from the <b>#__assets</b> table'));";
$script .= PHP_EOL . "\t\t}";
// done
$script .= PHP_EOL;
@ -4995,7 +4995,7 @@ class Interpretation extends Fields
$batchmove[] = PHP_EOL . "\t\tif (!\$this->canDo->get('core.edit') && !\$this->canDo->get('core.batch'))";
}
$batchmove[] = "\t\t{";
$batchmove[] = "\t\t\t\$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));";
$batchmove[] = "\t\t\t\$this->setError(JText:".":_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));";
$batchmove[] = "\t\t\treturn false;";
$batchmove[] = "\t\t}" . $customScript;
@ -5045,7 +5045,7 @@ class Interpretation extends Fields
$batchmove[] = "\t\t\tif (!\$this->user->authorise('core.edit', \$contexts[\$pk]))";
}
$batchmove[] = "\t\t\t{";
$batchmove[] = "\t\t\t\t\$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));";
$batchmove[] = "\t\t\t\t\$this->setError(JText:".":_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));";
$batchmove[] = PHP_EOL . "\t\t\t\treturn false;";
$batchmove[] = "\t\t\t}";
@ -5063,7 +5063,7 @@ class Interpretation extends Fields
$batchmove[] = "\t\t\t\telse";
$batchmove[] = "\t\t\t\t{";
$batchmove[] = "\t\t\t\t\t//" . $this->setLine(__LINE__) . " Not fatal error";
$batchmove[] = "\t\t\t\t\t\$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', \$pk));";
$batchmove[] = "\t\t\t\t\t\$this->setError(JText:".":sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', \$pk));";
$batchmove[] = "\t\t\t\t\tcontinue;";
$batchmove[] = "\t\t\t\t}";
$batchmove[] = "\t\t\t}";
@ -5249,7 +5249,7 @@ class Interpretation extends Fields
}
$batchcopy[] = PHP_EOL . "\t\t\t{";
$batchcopy[] = PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " Not fatal error";
$batchcopy[] = PHP_EOL . "\t\t\t\t\$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', \$pk));";
$batchcopy[] = PHP_EOL . "\t\t\t\t\$this->setError(JText:".":sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', \$pk));";
$batchcopy[] = PHP_EOL . "\t\t\t\tcontinue;";
$batchcopy[] = PHP_EOL . "\t\t\t}";
@ -5266,7 +5266,7 @@ class Interpretation extends Fields
$batchcopy[] = "\t\t\t\telse";
$batchcopy[] = "\t\t\t\t{";
$batchcopy[] = "\t\t\t\t\t//" . $this->setLine(__LINE__) . " Not fatal error";
$batchcopy[] = "\t\t\t\t\t\$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', \$pk));";
$batchcopy[] = "\t\t\t\t\t\$this->setError(JText:".":sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', \$pk));";
$batchcopy[] = "\t\t\t\t\tcontinue;";
$batchcopy[] = "\t\t\t\t}";
$batchcopy[] = "\t\t\t}";
@ -5427,7 +5427,7 @@ class Interpretation extends Fields
{
$fixUniqe[] = PHP_EOL . "\t\t\t\tif (\$table->load(array('" . $alias . "' => \$data['" . $alias . "'], '" . $category . "' => \$data['" . $category . "'])) && (\$table->id != \$data['id'] || \$data['id'] == 0))";
$fixUniqe[] = "\t\t\t\t{";
$fixUniqe[] = "\t\t\t\t\t\$msg = JText::_('COM_" . $this->fileContentStatic['###COMPONENT###'] . "_" . $VIEW . "_SAVE_WARNING');";
$fixUniqe[] = "\t\t\t\t\t\$msg = JText:".":_('COM_" . $this->fileContentStatic['###COMPONENT###'] . "_" . $VIEW . "_SAVE_WARNING');";
$fixUniqe[] = "\t\t\t\t}";
$fixUniqe[] = PHP_EOL . "\t\t\t\tlist(\$" . $title . ", \$" . $alias . ") = \$this->generateNewTitle(\$data['" . $category . "'], \$data['" . $alias . "'], \$data['" . $title . "']);";
}
@ -5435,7 +5435,7 @@ class Interpretation extends Fields
{
$fixUniqe[] = PHP_EOL . "\t\t\t\tif (\$table->load(array('" . $alias . "' => \$data['" . $alias . "'])) && (\$table->id != \$data['id'] || \$data['id'] == 0))";
$fixUniqe[] = "\t\t\t\t{";
$fixUniqe[] = "\t\t\t\t\t\$msg = JText::_('COM_" . $this->fileContentStatic['###COMPONENT###'] . "_" . $VIEW . "_SAVE_WARNING');";
$fixUniqe[] = "\t\t\t\t\t\$msg = JText:".":_('COM_" . $this->fileContentStatic['###COMPONENT###'] . "_" . $VIEW . "_SAVE_WARNING');";
$fixUniqe[] = "\t\t\t\t}";
$fixUniqe[] = PHP_EOL . "\t\t\t\tlist(\$" . $title . ", \$" . $alias . ") = \$this->_generateNewTitle(\$data['" . $alias . "'], \$data['" . $title . "']);";
}
@ -6119,7 +6119,7 @@ class Interpretation extends Fields
// check if translated value is used
if (isset($this->selectionTranslationFixBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->selectionTranslationFixBuilder[$viewName_list]) && array_key_exists($item['code'], $this->selectionTranslationFixBuilder[$viewName_list]))
{
$itemCode = '<?php echo JText::_($item->' . $item['code'] . '); ?>';
$itemCode = '<?php echo JText:'.':_($item->' . $item['code'] . '); ?>';
}
elseif (isset($item['custom']) && ComponentbuilderHelper::checkArray($item['custom']) && $item['custom']['text'] === 'user')
{
@ -6221,9 +6221,9 @@ class Interpretation extends Fields
foreach ($this->customAdminViewListLink[$viewName_list] as $customLinkView)
{
$customAdminView .= PHP_EOL . "\t\t\t<?php if (\$canDo->get('" . $customLinkView['link'] . ".access')): ?>";
$customAdminView .= PHP_EOL . "\t\t\t\t" . '<a class="hasTooltip btn btn-mini" href="index.php?option=com_' . $this->fileContentStatic['###component###'] . '&view=' . $customLinkView['link'] . '&id=<?php echo $item->id; ?>" title="<?php echo JText::_(' . "'COM_" . $this->fileContentStatic['###COMPONENT###'] . '_' . $customLinkView['NAME'] . "'" . '); ?>" ><span class="icon-' . $customLinkView['icon'] . '"></span></a>';
$customAdminView .= PHP_EOL . "\t\t\t\t" . '<a class="hasTooltip btn btn-mini" href="index.php?option=com_' . $this->fileContentStatic['###component###'] . '&view=' . $customLinkView['link'] . '&id=<?php echo $item->id; ?>" title="<?php echo JText:'.':_(' . "'COM_" . $this->fileContentStatic['###COMPONENT###'] . '_' . $customLinkView['NAME'] . "'" . '); ?>" ><span class="icon-' . $customLinkView['icon'] . '"></span></a>';
$customAdminView .= PHP_EOL . "\t\t\t<?php else: ?>";
$customAdminView .= PHP_EOL . "\t\t\t\t" . '<a class="hasTooltip btn btn-mini disabled" href="#" title="<?php echo JText::_(' . "'COM_" . $this->fileContentStatic['###COMPONENT###'] . '_' . $customLinkView['NAME'] . "'" . '); ?>"><span class="icon-' . $customLinkView['icon'] . '"></span></a>';
$customAdminView .= PHP_EOL . "\t\t\t\t" . '<a class="hasTooltip btn btn-mini disabled" href="#" title="<?php echo JText:'.':_(' . "'COM_" . $this->fileContentStatic['###COMPONENT###'] . '_' . $customLinkView['NAME'] . "'" . '); ?>"><span class="icon-' . $customLinkView['icon'] . '"></span></a>';
$customAdminView .= PHP_EOL . "\t\t\t<?php endif; ?>";
}
$customAdminView .= PHP_EOL . "\t\t\t" . '</div>';
@ -6396,7 +6396,7 @@ class Interpretation extends Fields
{
$class = 'nowrap';
}
$title = "<?php echo JText::_('" . $item['lang'] . "'); ?>";
$title = "<?php echo JText:".":_('" . $item['lang'] . "'); ?>";
if ($item['sort'])
{
$title = "<?php echo JHtml::_('grid.sort', '" . $item['lang'] . "', '" . $item['code'] . "', \$this->listDirn, \$this->listOrder); ?>";
@ -6415,7 +6415,7 @@ class Interpretation extends Fields
$head .= PHP_EOL . "\t\t</th>";
$head .= PHP_EOL . "\t<?php else: ?>";
$head .= PHP_EOL . "\t\t" . '<th width="10" class="nowrap center" >';
$head .= PHP_EOL . "\t\t\t<?php echo JText::_('" . $statusLangName . "'); ?>";
$head .= PHP_EOL . "\t\t\t<?php echo JText:".":_('" . $statusLangName . "'); ?>";
$head .= PHP_EOL . "\t\t</th>";
$head .= PHP_EOL . "\t<?php endif; ?>";
}
@ -6741,7 +6741,7 @@ class Interpretation extends Fields
$body .= PHP_EOL;
}
// start tab
$body .= PHP_EOL . "\t<?php echo JHtml::_('bootstrap.addTab', '" . $viewName_single . "Tab', '" . $tabCodeName . "', JText::_('" . $tabLangName . "', true)); ?>";
$body .= PHP_EOL . "\t<?php echo JHtml::_('bootstrap.addTab', '" . $viewName_single . "Tab', '" . $tabCodeName . "', JText:".":_('" . $tabLangName . "', true)); ?>";
// add the main
$body .= PHP_EOL . "\t\t" . '<div class="row-fluid form-horizontal-desktop">';
$body .= $main;
@ -6924,7 +6924,7 @@ class Interpretation extends Fields
}
$body .= PHP_EOL . PHP_EOL . "\t<?php if (" . implode(' || ', $publishingPer) . ") : ?>";
// set the default publishing tab
$body .= PHP_EOL . "\t<?php echo JHtml::_('bootstrap.addTab', '" . $viewName_single . "Tab', '" . $tabCodeNameLeft . "', JText::_('" . $tabLangName . "', true)); ?>";
$body .= PHP_EOL . "\t<?php echo JHtml::_('bootstrap.addTab', '" . $viewName_single . "Tab', '" . $tabCodeNameLeft . "', JText:".":_('" . $tabLangName . "', true)); ?>";
$body .= PHP_EOL . "\t\t" . '<div class="row-fluid form-horizontal-desktop">';
if ($items_one)
{
@ -6956,7 +6956,7 @@ class Interpretation extends Fields
}
// set the permissions tab
$body .= PHP_EOL . PHP_EOL . "\t<?php if (\$this->canDo->get('core.admin')) : ?>";
$body .= PHP_EOL . "\t<?php echo JHtml::_('bootstrap.addTab', '" . $viewName_single . "Tab', '" . $tabCodeName . "', JText::_('" . $tabLangName . "', true)); ?>";
$body .= PHP_EOL . "\t<?php echo JHtml::_('bootstrap.addTab', '" . $viewName_single . "Tab', '" . $tabCodeName . "', JText:".":_('" . $tabLangName . "', true)); ?>";
$body .= PHP_EOL . "\t\t" . '<div class="row-fluid form-horizontal-desktop">';
$body .= PHP_EOL . "\t\t\t" . '<div class="span12">';
$body .= PHP_EOL . "\t\t\t\t" . '<fieldset class="adminform">';
@ -7278,7 +7278,7 @@ class Interpretation extends Fields
// check if translated vlaue is used
if (isset($this->selectionTranslationFixBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->selectionTranslationFixBuilder[$viewName_list]) && array_key_exists($item['code'], $this->selectionTranslationFixBuilder[$viewName_list]))
{
$itemCode = '<?php echo JText::_($item->' . $item['code'] . '); ?>';
$itemCode = '<?php echo JText:'.':_($item->' . $item['code'] . '); ?>';
}
elseif ($item['custom']['text'] === 'user')
{
@ -7393,9 +7393,9 @@ class Interpretation extends Fields
foreach ($this->customAdminViewListLink[$viewName_list] as $customLinkView)
{
$customAdminView .= PHP_EOL . "\t\t\t<?php if (\$canDo->get('" . $customLinkView['link'] . ".access')): ?>";
$customAdminView .= PHP_EOL . "\t\t\t\t" . '<a class="hasTooltip btn btn-mini" href="index.php?option=com_' . $this->fileContentStatic['###component###'] . '&view=' . $customLinkView['link'] . '&id=<?php echo $item->id; ?>&ref=' . $refview . '&refid=<?php echo $id; ?>" title="<?php echo JText::_(' . "'COM_" . $this->fileContentStatic['###COMPONENT###'] . '_' . $customLinkView['NAME'] . "'" . '); ?>" ><span class="icon-' . $customLinkView['icon'] . '"></span></a>';
$customAdminView .= PHP_EOL . "\t\t\t\t" . '<a class="hasTooltip btn btn-mini" href="index.php?option=com_' . $this->fileContentStatic['###component###'] . '&view=' . $customLinkView['link'] . '&id=<?php echo $item->id; ?>&ref=' . $refview . '&refid=<?php echo $id; ?>" title="<?php echo JText:'.':_(' . "'COM_" . $this->fileContentStatic['###COMPONENT###'] . '_' . $customLinkView['NAME'] . "'" . '); ?>" ><span class="icon-' . $customLinkView['icon'] . '"></span></a>';
$customAdminView .= PHP_EOL . "\t\t\t<?php else: ?>";
$customAdminView .= PHP_EOL . "\t\t\t\t" . '<a class="hasTooltip btn btn-mini disabled" href="#" title="<?php echo JText::_(' . "'COM_" . $this->fileContentStatic['###COMPONENT###'] . '_' . $customLinkView['NAME'] . "'" . '); ?>"><span class="icon-' . $customLinkView['icon'] . '"></span></a>';
$customAdminView .= PHP_EOL . "\t\t\t\t" . '<a class="hasTooltip btn btn-mini disabled" href="#" title="<?php echo JText:'.':_(' . "'COM_" . $this->fileContentStatic['###COMPONENT###'] . '_' . $customLinkView['NAME'] . "'" . '); ?>"><span class="icon-' . $customLinkView['icon'] . '"></span></a>';
$customAdminView .= PHP_EOL . "\t\t\t<?php endif; ?>";
}
$customAdminView .= PHP_EOL . "\t\t\t" . '</div>';
@ -7477,29 +7477,29 @@ class Interpretation extends Fields
// add the defaults
$body .= PHP_EOL . "\t\t<?php if (\$item->published == 1):?>";
$body .= PHP_EOL . "\t\t\t" . '<td class="center" ' . $data_value . '="1">';
$body .= PHP_EOL . "\t\t\t\t" . '<span class="status-metro status-published" title="<?php echo JText::_(' . "'" . $this->langPrefix . "_PUBLISHED'" . '); ?>">';
$body .= PHP_EOL . "\t\t\t\t\t" . '<?php echo JText::_(' . "'" . $this->langPrefix . "_PUBLISHED'" . '); ?>';
$body .= PHP_EOL . "\t\t\t\t" . '<span class="status-metro status-published" title="<?php echo JText:'.':_(' . "'" . $this->langPrefix . "_PUBLISHED'" . '); ?>">';
$body .= PHP_EOL . "\t\t\t\t\t" . '<?php echo JText:'.':_(' . "'" . $this->langPrefix . "_PUBLISHED'" . '); ?>';
$body .= PHP_EOL . "\t\t\t\t" . '</span>';
$body .= PHP_EOL . "\t\t\t" . '</td>';
$body .= PHP_EOL . "\t\t<?php elseif (\$item->published == 0):?>";
$body .= PHP_EOL . "\t\t\t" . '<td class="center" ' . $data_value . '="2">';
$body .= PHP_EOL . "\t\t\t\t" . '<span class="status-metro status-inactive" title="<?php echo JText::_(' . "'" . $this->langPrefix . "_INACTIVE'" . '); ?>">';
$body .= PHP_EOL . "\t\t\t\t\t" . '<?php echo JText::_(' . "'" . $this->langPrefix . "_INACTIVE'" . '); ?>';
$body .= PHP_EOL . "\t\t\t\t" . '<span class="status-metro status-inactive" title="<?php echo JText:'.':_(' . "'" . $this->langPrefix . "_INACTIVE'" . '); ?>">';
$body .= PHP_EOL . "\t\t\t\t\t" . '<?php echo JText:'.':_(' . "'" . $this->langPrefix . "_INACTIVE'" . '); ?>';
$body .= PHP_EOL . "\t\t\t\t" . '</span>';
$body .= PHP_EOL . "\t\t\t" . '</td>';
$body .= PHP_EOL . "\t\t<?php elseif (\$item->published == 2):?>";
$body .= PHP_EOL . "\t\t\t" . '<td class="center" ' . $data_value . '="3">';
$body .= PHP_EOL . "\t\t\t\t" . '<span class="status-metro status-archived" title="<?php echo JText::_(' . "'" . $this->langPrefix . "_ARCHIVED'" . '); ?>">';
$body .= PHP_EOL . "\t\t\t\t\t" . '<?php echo JText::_(' . "'" . $this->langPrefix . "_ARCHIVED'" . '); ?>';
$body .= PHP_EOL . "\t\t\t\t" . '<span class="status-metro status-archived" title="<?php echo JText:'.':_(' . "'" . $this->langPrefix . "_ARCHIVED'" . '); ?>">';
$body .= PHP_EOL . "\t\t\t\t\t" . '<?php echo JText:'.':_(' . "'" . $this->langPrefix . "_ARCHIVED'" . '); ?>';
$body .= PHP_EOL . "\t\t\t\t" . '</span>';
$body .= PHP_EOL . "\t\t\t" . '</td>';
$body .= PHP_EOL . "\t\t<?php elseif (\$item->published == -2):?>";
$body .= PHP_EOL . "\t\t\t" . '<td class="center" ' . $data_value . '="4">';
$body .= PHP_EOL . "\t\t\t\t" . '<span class="status-metro status-trashed" title="<?php echo JText::_(' . "'" . $this->langPrefix . "_TRASHED'" . '); ?>">';
$body .= PHP_EOL . "\t\t\t\t\t" . '<?php echo JText::_(' . "'" . $this->langPrefix . "_TRASHED'" . '); ?>';
$body .= PHP_EOL . "\t\t\t\t" . '<span class="status-metro status-trashed" title="<?php echo JText:'.':_(' . "'" . $this->langPrefix . "_TRASHED'" . '); ?>">';
$body .= PHP_EOL . "\t\t\t\t\t" . '<?php echo JText:'.':_(' . "'" . $this->langPrefix . "_TRASHED'" . '); ?>';
$body .= PHP_EOL . "\t\t\t\t" . '</span>';
$body .= PHP_EOL . "\t\t\t" . '</td>';
$body .= PHP_EOL . "\t\t" . '<?php endif; ?>';
@ -7523,7 +7523,7 @@ class Interpretation extends Fields
$body .= PHP_EOL . '</table>';
$body .= PHP_EOL . '<?php else: ?>';
$body .= PHP_EOL . "\t" . '<div class="alert alert-no-items">';
$body .= PHP_EOL . "\t\t" . '<?php echo JText::_(' . "'JGLOBAL_NO_MATCHING_RESULTS'" . '); ?>';
$body .= PHP_EOL . "\t\t" . '<?php echo JText:'.':_(' . "'JGLOBAL_NO_MATCHING_RESULTS'" . '); ?>';
$body .= PHP_EOL . "\t" . '</div>';
$body .= PHP_EOL . '<?php endif; ?>';
// return the build
@ -7572,12 +7572,12 @@ class Interpretation extends Fields
// add the new buttons
if ($addNewButon == 1 || $addNewButon == 2)
{
$head .= PHP_EOL . $tabB . "\t" . '<a class="btn btn-small btn-success" href="<?php echo $new; ?>"><span class="icon-new icon-white"></span> <?php echo JText::_(' . "'" . $this->langPrefix . "_NEW'" . '); ?></a>';
$head .= PHP_EOL . $tabB . "\t" . '<a class="btn btn-small btn-success" href="<?php echo $new; ?>"><span class="icon-new icon-white"></span> <?php echo JText:'.':_(' . "'" . $this->langPrefix . "_NEW'" . '); ?></a>';
}
// add the close and new button
if ($addNewButon == 2 || $addNewButon == 3)
{
$head .= PHP_EOL . $tabB . "\t" . '<a class="btn btn-small" onclick="Joomla.submitbutton(\'' . $refview . '.cancel\');" href="<?php echo $close_new; ?>"><span class="icon-new"></span> <?php echo JText::_(' . "'" . $this->langPrefix . "_CLOSE_NEW'" . '); ?></a>';
$head .= PHP_EOL . $tabB . "\t" . '<a class="btn btn-small" onclick="Joomla.submitbutton(\'' . $refview . '.cancel\');" href="<?php echo $close_new; ?>"><span class="icon-new"></span> <?php echo JText:'.':_(' . "'" . $this->langPrefix . "_CLOSE_NEW'" . '); ?></a>';
}
// close group button if needed
if ($addNewButon == 2)
@ -7642,7 +7642,7 @@ class Interpretation extends Fields
$firstLink = false;
}
$head .= PHP_EOL . "\t\t<th" . $setin . $htmlFix . ">";
$head .= PHP_EOL . "\t\t\t<?php echo JText::_('" . $item['lang'] . "'); ?>";
$head .= PHP_EOL . "\t\t\t<?php echo JText:".":_('" . $item['lang'] . "'); ?>";
$head .= PHP_EOL . "\t\t</th>";
$controller++;
}
@ -7651,10 +7651,10 @@ class Interpretation extends Fields
$data_type = (2 == $this->footableVersion) ? 'data-type="numeric"' : 'data-type="number"';
// set default
$head .= PHP_EOL . "\t\t" . '<th width="10" ' . $data_hide . '>';
$head .= PHP_EOL . "\t\t\t<?php echo JText::_('" . $statusLangName . "'); ?>";
$head .= PHP_EOL . "\t\t\t<?php echo JText:".":_('" . $statusLangName . "'); ?>";
$head .= PHP_EOL . "\t\t</th>";
$head .= PHP_EOL . "\t\t" . '<th width="5" ' . $data_type . ' ' . $data_hide . '>';
$head .= PHP_EOL . "\t\t\t<?php echo JText::_('" . $idLangName . "'); ?>";
$head .= PHP_EOL . "\t\t\t<?php echo JText:".":_('" . $idLangName . "'); ?>";
$head .= PHP_EOL . "\t\t</th>";
$head .= PHP_EOL . "\t</tr>";
$head .= PHP_EOL . "</thead>";
@ -8017,7 +8017,7 @@ class Interpretation extends Fields
$method[] = PHP_EOL . PHP_EOL . "\tpublic function redirectTo" . ComponentbuilderHelper::safeString($custom_button['link'], 'F') . "()";
$method[] = "\t{";
$method[] = "\t\t//" . $this->setLine(__LINE__) . " Check for request forgeries";
$method[] = "\t\tJSession::checkToken() or die(JText::_('JINVALID_TOKEN'));";
$method[] = "\t\tJSession::checkToken() or die(JText:".":_('JINVALID_TOKEN'));";
$method[] = "\t\t//" . $this->setLine(__LINE__) . " check if export is allowed for this user.";
$method[] = "\t\t\$user = JFactory::getUser();";
$method[] = "\t\tif (\$user->authorise('" . $custom_button['link'] . ".access', 'com_" . $this->fileContentStatic['###component###'] . "'))";
@ -8033,7 +8033,7 @@ class Interpretation extends Fields
$method[] = "\t\t\treturn;";
$method[] = "\t\t}";
$method[] = "\t\t//" . $this->setLine(__LINE__) . " Redirect to the list screen with error.";
$method[] = "\t\t\$message = JText::_('" . $this->langPrefix . "_ACCESS_TO_" . $custom_button['NAME'] . "_FAILED');";
$method[] = "\t\t\$message = JText:".":_('" . $this->langPrefix . "_ACCESS_TO_" . $custom_button['NAME'] . "_FAILED');";
$method[] = "\t\t\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->fileContentStatic['###component###'] . "&view=" . $viewName_list . "', false), \$message, 'error');";
$method[] = "\t\treturn;";
$method[] = "\t}";
@ -8133,7 +8133,7 @@ class Interpretation extends Fields
$method[] = PHP_EOL . PHP_EOL . "\tpublic function exportData()";
$method[] = "\t{";
$method[] = "\t\t//" . $this->setLine(__LINE__) . " Check for request forgeries";
$method[] = "\t\tJSession::checkToken() or die(JText::_('JINVALID_TOKEN'));";
$method[] = "\t\tJSession::checkToken() or die(JText:".":_('JINVALID_TOKEN'));";
$method[] = "\t\t//" . $this->setLine(__LINE__) . " check if export is allowed for this user.";
$method[] = "\t\t\$user = JFactory::getUser();";
$method[] = "\t\tif (\$user->authorise('" . $viewName_single . ".export', 'com_" . $this->fileContentStatic['###component###'] . "') && \$user->authorise('core.export', 'com_" . $this->fileContentStatic['###component###'] . "'))";
@ -8155,7 +8155,7 @@ class Interpretation extends Fields
$method[] = "\t\t\t}";
$method[] = "\t\t}";
$method[] = "\t\t//" . $this->setLine(__LINE__) . " Redirect to the list screen with error.";
$method[] = "\t\t\$message = JText::_('" . $this->langPrefix . "_EXPORT_FAILED');";
$method[] = "\t\t\$message = JText:".":_('" . $this->langPrefix . "_EXPORT_FAILED');";
$method[] = "\t\t\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->fileContentStatic['###component###'] . "&view=" . $viewName_list . "', false), \$message, 'error');";
$method[] = "\t\treturn;";
$method[] = "\t}";
@ -8164,7 +8164,7 @@ class Interpretation extends Fields
$method[] = PHP_EOL . PHP_EOL . "\tpublic function importData()";
$method[] = "\t{";
$method[] = "\t\t//" . $this->setLine(__LINE__) . " Check for request forgeries";
$method[] = "\t\tJSession::checkToken() or die(JText::_('JINVALID_TOKEN'));";
$method[] = "\t\tJSession::checkToken() or die(JText:".":_('JINVALID_TOKEN'));";
$method[] = "\t\t//" . $this->setLine(__LINE__) . " check if import is allowed for this user.";
$method[] = "\t\t\$user = JFactory::getUser();";
$method[] = "\t\tif (\$user->authorise('" . $viewName_single . ".import', 'com_" . $this->fileContentStatic['###component###'] . "') && \$user->authorise('core.import', 'com_" . $this->fileContentStatic['###component###'] . "'))";
@ -8188,7 +8188,7 @@ class Interpretation extends Fields
{
$this->langContent[$this->lang][$selectImportFileNote] = 'Select the file to import data to ' . $viewName_list . '.';
}
$method[] = "\t\t\t\t\$message = JText::_('" . $selectImportFileNote . "');";
$method[] = "\t\t\t\t\$message = JText:".":_('" . $selectImportFileNote . "');";
// if this view has custom script it must have as custom import (model, veiw, controller)
if (isset($this->importCustomScripts[$viewName_list]) && $this->importCustomScripts[$viewName_list])
{
@ -8202,7 +8202,7 @@ class Interpretation extends Fields
$method[] = "\t\t\t}";
$method[] = "\t\t}";
$method[] = "\t\t//" . $this->setLine(__LINE__) . " Redirect to the list screen with error.";
$method[] = "\t\t\$message = JText::_('" . $this->langPrefix . "_IMPORT_FAILED');";
$method[] = "\t\t\$message = JText:".":_('" . $this->langPrefix . "_IMPORT_FAILED');";
$method[] = "\t\t\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->fileContentStatic['###component###'] . "&view=" . $viewName_list . "', false), \$message, 'error');";
$method[] = "\t\treturn;";
$method[] = "\t}";
@ -8522,7 +8522,7 @@ class Interpretation extends Fields
$addButton[] = "\t\t\t\t\$buttonNamee = preg_replace('/\s+/', ' ', \$buttonNamee);";
$addButton[] = "\t\t\t\t\$buttonNamee = preg_replace(\"/[^A-Za-z ]/\", '', \$buttonNamee);";
$addButton[] = "\t\t\t\t\$buttonNamee = ucfirst(strtolower(\$buttonNamee));";
$addButton[] = "\t\t\t\t\$button[] = '<a id=\"'.\$buttonName.'Create\" class=\"btn btn-small btn-success hasTooltip\" title=\"'.JText::sprintf('" . $this->langPrefix . "_CREATE_NEW_S', \$buttonNamee).'\" style=\"border-radius: 0px 4px 4px 0px; padding: 4px 4px 4px 7px;\"";
$addButton[] = "\t\t\t\t\$button[] = '<a id=\"'.\$buttonName.'Create\" class=\"btn btn-small btn-success hasTooltip\" title=\"'.JText:".":sprintf('" . $this->langPrefix . "_CREATE_NEW_S', \$buttonNamee).'\" style=\"border-radius: 0px 4px 4px 0px; padding: 4px 4px 4px 7px;\"";
$addButton[] = "\t\t\t\t\thref=\"index.php?option=com_" . $this->fileContentStatic['###component###'] . "&amp;view=" . $targetView . "&amp;layout=edit'.\$ref.'\" >";
$addButton[] = "\t\t\t\t\t<span class=\"icon-new icon-white\"></span></a>';";
$addButton[] = "\t\t\t}";
@ -8543,7 +8543,7 @@ class Interpretation extends Fields
$addButton[] = "\t\t\t\t\$buttonNamee = preg_replace('/\s+/', ' ', \$buttonNamee);";
$addButton[] = "\t\t\t\t\$buttonNamee = preg_replace(\"/[^A-Za-z ]/\", '', \$buttonNamee);";
$addButton[] = "\t\t\t\t\$buttonNamee = ucfirst(strtolower(\$buttonNamee));";
$addButton[] = "\t\t\t\t\$button[] = '<a id=\"'.\$buttonName.'Edit\" class=\"btn btn-small hasTooltip\" title=\"'.JText::sprintf('" . $this->langPrefix . "_EDIT_S', \$buttonNamee).'\" style=\"display: none; padding: 4px 4px 4px 7px;\" href=\"#\" >";
$addButton[] = "\t\t\t\t\$button[] = '<a id=\"'.\$buttonName.'Edit\" class=\"btn btn-small hasTooltip\" title=\"'.JText:".":sprintf('" . $this->langPrefix . "_EDIT_S', \$buttonNamee).'\" style=\"display: none; padding: 4px 4px 4px 7px;\" href=\"#\" >";
$addButton[] = "\t\t\t\t\t<span class=\"icon-edit\"></span></a>';";
$addButton[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " build script";
$addButton[] = "\t\t\t\t\$script[] = \"";
@ -9895,7 +9895,7 @@ 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')
{
@ -9966,7 +9966,7 @@ class Interpretation extends Fields
$otherFilter[] = "\t\t{";
$otherFilter[] = "\t\t\t//" . $this->setLine(__LINE__) . " " . $CodeName . " Filter";
$otherFilter[] = "\t\t\tJHtmlSidebar::addFilter(";
$otherFilter[] = "\t\t\t\t'- Select '.JText::_('" . $filter['lang'] . "').' -',";
$otherFilter[] = "\t\t\t\t'- Select '.JText:".":_('" . $filter['lang'] . "').' -',";
$otherFilter[] = "\t\t\t\t'filter_" . $filter['code'] . "',";
$otherFilter[] = "\t\t\t\tJHtml::_('select.options', \$this->" . $codeName . "Options, 'value', 'text', \$this->state->get('filter." . $filter['code'] . "'))";
$otherFilter[] = "\t\t\t);";
@ -9975,7 +9975,7 @@ class Interpretation extends Fields
$otherFilter[] = "\t\t\t{";
$otherFilter[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " " . $CodeName . " Batch Selection";
$otherFilter[] = "\t\t\t\tJHtmlBatch_::addListSelection(";
$otherFilter[] = "\t\t\t\t\t'- Keep Original '.JText::_('" . $filter['lang'] . "').' -',";
$otherFilter[] = "\t\t\t\t\t'- Keep Original '.JText:".":_('" . $filter['lang'] . "').' -',";
$otherFilter[] = "\t\t\t\t\t'batch[" . $filter['code'] . "]',";
$otherFilter[] = "\t\t\t\t\tJHtml::_('select.options', \$this->" . $codeName . "Options, 'value', 'text')";
$otherFilter[] = "\t\t\t\t);";
@ -10000,7 +10000,7 @@ class Interpretation extends Fields
$otherFilter[] = "\t\t{";
$otherFilter[] = "\t\t\t//" . $this->setLine(__LINE__) . " " . $Codename . " Filter";
$otherFilter[] = "\t\t\tJHtmlSidebar::addFilter(";
$otherFilter[] = "\t\t\t\t'- Select '.JText::_('" . $filter['lang'] . "').' -',";
$otherFilter[] = "\t\t\t\t'- Select '.JText:".":_('" . $filter['lang'] . "').' -',";
$otherFilter[] = "\t\t\t\t'filter_" . $filter['code'] . "',";
$otherFilter[] = "\t\t\t\tJHtml::_('select.options', \$this->" . $filter['code'] . "Options, 'value', 'text', \$this->state->get('filter." . $filter['code'] . "'))";
$otherFilter[] = "\t\t\t);";
@ -10009,7 +10009,7 @@ class Interpretation extends Fields
$otherFilter[] = "\t\t\t{";
$otherFilter[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " " . $Codename . " Batch Selection";
$otherFilter[] = "\t\t\t\tJHtmlBatch_::addListSelection(";
$otherFilter[] = "\t\t\t\t\t'- Keep Original '.JText::_('" . $filter['lang'] . "').' -',";
$otherFilter[] = "\t\t\t\t\t'- Keep Original '.JText:".":_('" . $filter['lang'] . "').' -',";
$otherFilter[] = "\t\t\t\t\t'batch[" . $filter['code'] . "]',";
$otherFilter[] = "\t\t\t\t\tJHtml::_('select.options', \$this->" . $filter['code'] . "Options, 'value', 'text')";
$otherFilter[] = "\t\t\t\t);";
@ -10047,7 +10047,7 @@ class Interpretation extends Fields
$filter = array();
$filter[] = PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Category Filter.";
$filter[] = "\t\tJHtmlSidebar::addFilter(";
$filter[] = "\t\t\tJText::_('JOPTION_SELECT_CATEGORY'),";
$filter[] = "\t\t\tJText:".":_('JOPTION_SELECT_CATEGORY'),";
$filter[] = "\t\t\t'filter_category_id',";
$filter[] = "\t\t\tJHtml::_('select.options', JHtml::_('category.options', 'com_" . $component . "." . $otherViews . "'), 'value', 'text', \$this->state->get('filter.category_id'))";
$filter[] = "\t\t);";
@ -10057,7 +10057,7 @@ class Interpretation extends Fields
$filter[] = "\t\t{";
$filter[] = "\t\t\t//" . $this->setLine(__LINE__) . " Category Batch selection.";
$filter[] = "\t\t\tJHtmlBatch_::addListSelection(";
$filter[] = "\t\t\t\tJText::_('COM_" . $COMONENT . "_KEEP_ORIGINAL_CATEGORY'),";
$filter[] = "\t\t\t\tJText:".":_('COM_" . $COMONENT . "_KEEP_ORIGINAL_CATEGORY'),";
$filter[] = "\t\t\t\t'batch[category]',";
$filter[] = "\t\t\t\tJHtml::_('select.options', JHtml::_('category.options', 'com_" . $component . "." . $otherViews . "'), 'value', 'text')";
$filter[] = "\t\t\t);";
@ -11146,7 +11146,7 @@ class Interpretation extends Fields
// build toolbar
$toolBar = "JFactory::getApplication()->input->set('hidemainmenu', true);";
$toolBar .= PHP_EOL . "\t\tJToolBarHelper::title(JText::_('" . $viewNameLang_readonly . "'), '" . $viewName . "');";
$toolBar .= PHP_EOL . "\t\tJToolBarHelper::title(JText:".":_('" . $viewNameLang_readonly . "'), '" . $viewName . "');";
$toolBar .= PHP_EOL . "\t\tJToolBarHelper::cancel('" . $viewName . ".cancel', 'JTOOLBAR_CLOSE');";
}
else
@ -11162,7 +11162,7 @@ class Interpretation extends Fields
$toolBar .= PHP_EOL . "\t\t\$user = JFactory::getUser();";
$toolBar .= PHP_EOL . "\t\t\$userId = \$user->id;";
$toolBar .= PHP_EOL . "\t\t\$isNew = \$this->item->id == 0;";
$toolBar .= PHP_EOL . PHP_EOL . "\t\tJToolbarHelper::title( JText::_(\$isNew ? '" . $viewNameLang_new . "' : '" . $viewNameLang_edit . "'), 'pencil-2 article-add');";
$toolBar .= PHP_EOL . PHP_EOL . "\t\tJToolbarHelper::title( JText:".":_(\$isNew ? '" . $viewNameLang_new . "' : '" . $viewNameLang_edit . "'), 'pencil-2 article-add');";
$toolBar .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Built the actions for new and existing records.";
$toolBar .= PHP_EOL . "\t\tif (\$this->refid || \$this->ref)";
$toolBar .= PHP_EOL . "\t\t{";
@ -11418,8 +11418,8 @@ class Interpretation extends Fields
$donelist = array('sorting', 'published');
// set the default first
$fields = "return array(";
$fields .= PHP_EOL . "\t\t\t'a.sorting' => JText::_('JGRID_HEADING_ORDERING')";
$fields .= "," . PHP_EOL . "\t\t\t'a.published' => JText::_('JSTATUS')";
$fields .= PHP_EOL . "\t\t\t'a.sorting' => JText:".":_('JGRID_HEADING_ORDERING')";
$fields .= "," . PHP_EOL . "\t\t\t'a.published' => JText:".":_('JSTATUS')";
// add the rest of the set filters
if (isset($this->sortBuilder[$view]) && ComponentbuilderHelper::checkArray($this->sortBuilder[$view]))
@ -11430,20 +11430,20 @@ class Interpretation extends Fields
{
if ($filter['type'] === 'category')
{
$fields .= "," . PHP_EOL . "\t\t\t'c.category_title' => JText::_('" . $filter['lang'] . "')";
$fields .= "," . PHP_EOL . "\t\t\t'c.category_title' => JText:".":_('" . $filter['lang'] . "')";
}
elseif (ComponentbuilderHelper::checkArray($filter['custom']))
{
$fields .= "," . PHP_EOL . "\t\t\t'" . $filter['custom']['db'] . "." . $filter['custom']['text'] . "' => JText::_('" . $filter['lang'] . "')";
$fields .= "," . PHP_EOL . "\t\t\t'" . $filter['custom']['db'] . "." . $filter['custom']['text'] . "' => JText:".":_('" . $filter['lang'] . "')";
}
else
{
$fields .= "," . PHP_EOL . "\t\t\t'a." . $filter['code'] . "' => JText::_('" . $filter['lang'] . "')";
$fields .= "," . PHP_EOL . "\t\t\t'a." . $filter['code'] . "' => JText:".":_('" . $filter['lang'] . "')";
}
}
}
}
$fields .= "," . PHP_EOL . "\t\t\t'a.id' => JText::_('JGRID_HEADING_ID')";
$fields .= "," . PHP_EOL . "\t\t\t'a.id' => JText:".":_('JGRID_HEADING_ID')";
$fields .= PHP_EOL . "\t\t);";
// return fields
return $fields;
@ -11638,11 +11638,11 @@ class Interpretation extends Fields
$fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t{";
$fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\tif (\$counter == 0)";
$fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t{";
$fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t\t\$" . $item['name'] . "Names .= JText::_(\$this->selectionTranslation(\$" . $item['name'] . ", '" . $item['name'] . "'));";
$fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t\t\$" . $item['name'] . "Names .= JText:".":_(\$this->selectionTranslation(\$" . $item['name'] . ", '" . $item['name'] . "'));";
$fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t}";
$fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\telse";
$fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t{";
$fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t\t\$" . $item['name'] . "Names .= ', '.JText::_(\$this->selectionTranslation(\$" . $item['name'] . ", '" . $item['name'] . "'));";
$fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t\t\$" . $item['name'] . "Names .= ', '.JText:".":_(\$this->selectionTranslation(\$" . $item['name'] . ", '" . $item['name'] . "'));";
$fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t}";
$fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t\$counter++;";
$fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t}";
@ -12132,7 +12132,7 @@ class Interpretation extends Fields
$display[] = '<div id="j-main-container">';
$display[] = "\t" . '<div class="form-horizontal">';
$display[] = "\t<?php echo JHtml::_('bootstrap.startTabSet', 'cpanel_tab', array('active' => 'cpanel')); ?>";
$display[] = PHP_EOL . "\t\t<?php echo JHtml::_('bootstrap.addTab', 'cpanel_tab', 'cpanel', JText::_('cPanel', true)); ?>";
$display[] = PHP_EOL . "\t\t<?php echo JHtml::_('bootstrap.addTab', 'cpanel_tab', 'cpanel', JText:".":_('cPanel', true)); ?>";
$display[] = "\t\t" . '<div class="row-fluid">';
// set the tab to insure correct spacing
$tab = "\t\t\t";
@ -12168,7 +12168,7 @@ class Interpretation extends Fields
foreach ($builder as $tabname => $accordians)
{
$alias = ComponentbuilderHelper::safeString($tabname);
$display[] = PHP_EOL . "\t\t<?php echo JHtml::_('bootstrap.addTab', 'cpanel_tab', '" . $alias . "', JText::_('" . $tabname . "', true)); ?>";
$display[] = PHP_EOL . "\t\t<?php echo JHtml::_('bootstrap.addTab', 'cpanel_tab', '" . $alias . "', JText:".":_('" . $tabname . "', true)); ?>";
$display[] = "\t\t" . '<div class="row-fluid">';
$display[] = $tab . '<div class="span12">';
$display[] = $tab . "\t<?php echo JHtml::_('bootstrap.startAccordion', '" . $alias . "_accordian', array('active' => '" . $alias . "_one')); ?>";
@ -12356,7 +12356,7 @@ class Interpretation extends Fields
// set the code name
$codeName = ComponentbuilderHelper::safeString($this->componentData->name_code);
// set dashboard
$menus .= "JHtmlSidebar::addEntry(JText::_('" . $lang . "_DASHBOARD'), 'index.php?option=com_" . $codeName . "&view=" . $codeName . "', \$submenu === '" . $codeName . "');";
$menus .= "JHtmlSidebar::addEntry(JText:".":_('" . $lang . "_DASHBOARD'), 'index.php?option=com_" . $codeName . "&view=" . $codeName . "', \$submenu === '" . $codeName . "');";
$this->langContent[$this->lang][$lang . '_DASHBOARD'] = 'Dashboard';
$catArray = array();
foreach ($this->componentData->admin_views as $view)
@ -12384,7 +12384,7 @@ class Interpretation extends Fields
}
$nameList = ComponentbuilderHelper::safeString($view['settings']->name_list);
$nameUpper = ComponentbuilderHelper::safeString($view['settings']->name_list, 'U');
$menus .= PHP_EOL . "\t\t" . $tab . "JHtmlSidebar::addEntry(JText::_('" . $lang . "_" . $nameUpper . "'), 'index.php?option=com_" . $codeName . "&view=" . $nameList . "', \$submenu === '" . $nameList . "');";
$menus .= PHP_EOL . "\t\t" . $tab . "JHtmlSidebar::addEntry(JText:".":_('" . $lang . "_" . $nameUpper . "'), 'index.php?option=com_" . $codeName . "&view=" . $nameList . "', \$submenu === '" . $nameList . "');";
$this->langContent[$this->lang][$lang . "_" . $nameUpper] = $view['settings']->name_list;
// check if category has another name
if (isset($this->catOtherName[$nameList]) && ComponentbuilderHelper::checkArray($this->catOtherName[$nameList]))
@ -12397,7 +12397,7 @@ class Interpretation extends Fields
}
if (isset($this->categoryBuilder[$nameList]) && ComponentbuilderHelper::checkArray($this->categoryBuilder[$nameList]) && !in_array($otherViews, $catArray))
{
$menus .= PHP_EOL . "\t\t" . $tab . "JHtmlSidebar::addEntry(JText::_('" . $this->categoryBuilder[$nameList]['name'] . "'), 'index.php?option=com_categories&view=categories&extension=com_" . $codeName . "." . $otherViews . "', \$submenu === 'categories." . $otherViews . "');";
$menus .= PHP_EOL . "\t\t" . $tab . "JHtmlSidebar::addEntry(JText:".":_('" . $this->categoryBuilder[$nameList]['name'] . "'), 'index.php?option=com_categories&view=categories&extension=com_" . $codeName . "." . $otherViews . "', \$submenu === 'categories." . $otherViews . "');";
// make sure we add a category only once
$catArray[] = $otherViews;
}
@ -12503,13 +12503,13 @@ class Interpretation extends Fields
$this->langContent[$this->lang][$lang . '_' . $nameUpper] = $name;
// add custom menu
$custom .= PHP_EOL . "\t\t" . $tab . "JHtmlSidebar::addEntry(JText::_('" . $lang . "_" . $nameUpper . "'), '" . $menu['link'] . "', \$submenu === '" . $nameList . "');";
$custom .= PHP_EOL . "\t\t" . $tab . "JHtmlSidebar::addEntry(JText:".":_('" . $lang . "_" . $nameUpper . "'), '" . $menu['link'] . "', \$submenu === '" . $nameList . "');";
}
else
{
$this->langContent[$this->lang][$lang . '_' . $nameUpper] = $name;
// add custom menu
$custom .= PHP_EOL . "\t\t" . $tab . "JHtmlSidebar::addEntry(JText::_('" . $lang . "_" . $nameUpper . "'), 'index.php?option=com_" . $codeName . "&view=" . $nameList . "', \$submenu === '" . $nameList . "');";
$custom .= PHP_EOL . "\t\t" . $tab . "JHtmlSidebar::addEntry(JText:".":_('" . $lang . "_" . $nameUpper . "'), 'index.php?option=com_" . $codeName . "&view=" . $nameList . "', \$submenu === '" . $nameList . "');";
}
// check if the item has permissions.
$custom .= PHP_EOL . "\t\t}";
@ -12547,13 +12547,13 @@ class Interpretation extends Fields
{
$this->langContent[$this->lang][$lang . '_' . $nameUpper] = $name;
// add custom menu
$this->lastCustomSubMenu[$nr] .= PHP_EOL . "\t\t" . $tab . "JHtmlSidebar::addEntry(JText::_('" . $lang . "_" . $nameUpper . "'), '" . $menu['link'] . "', \$submenu === '" . $nameList . "');";
$this->lastCustomSubMenu[$nr] .= PHP_EOL . "\t\t" . $tab . "JHtmlSidebar::addEntry(JText:".":_('" . $lang . "_" . $nameUpper . "'), '" . $menu['link'] . "', \$submenu === '" . $nameList . "');";
}
else
{
$this->langContent[$this->lang][$lang . '_' . $nameUpper] = $name;
// add custom menu
$this->lastCustomSubMenu[$nr] .= PHP_EOL . "\t\t" . $tab . "JHtmlSidebar::addEntry(JText::_('" . $lang . "_" . $nameUpper . "'), 'index.php?option=com_" . $codeName . "&view=" . $nameList . "', \$submenu === '" . $nameList . "');";
$this->lastCustomSubMenu[$nr] .= PHP_EOL . "\t\t" . $tab . "JHtmlSidebar::addEntry(JText:".":_('" . $lang . "_" . $nameUpper . "'), 'index.php?option=com_" . $codeName . "&view=" . $nameList . "', \$submenu === '" . $nameList . "');";
}
// check if the item has permissions.
$this->lastCustomSubMenu[$nr] .= PHP_EOL . "\t\t}";

View File

@ -1736,6 +1736,49 @@ abstract class ComponentbuilderHelper
return false;
}
/**
* Check if the url exist
*
* @param string $url The url to check
*
* @return bool If exist true
*
*/
public static function urlExists($url)
{
$exists = false;
// check if we can use curl
if (function_exists('curl_version'))
{
// initiate curl
$ch = curl_init($url);
// CURLOPT_NOBODY (do not return body)
curl_setopt($ch, CURLOPT_NOBODY, true);
// make call
$result = curl_exec($ch);
// check return value
if ($result !== false)
{
// get the http CODE
$statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($statusCode !== 404)
{
$exists = true;
}
}
// close the connection
curl_close($ch);
}
elseif ($headers = @get_headers($url))
{
if(isset($headers[0]) && is_string($headers[0]) && strpos($headers[0],'404') === false)
{
$exists = true;
}
}
return $exists;
}
/**
* Get the file path or url
*

View File

@ -873,7 +873,7 @@ COM_COMPONENTBUILDER_ALIAS="Alias"
COM_COMPONENTBUILDER_ALIGNMENT="Alignment"
COM_COMPONENTBUILDER_ALL="All"
COM_COMPONENTBUILDER_ALL_IS_GOOD_PLEASE_CHECK_AGAIN_LATTER="All is good, please check again latter."
COM_COMPONENTBUILDER_ALL_IS_GOOD_THERE_IN_NO_NOTICE_AT_THIS_TIME="All is good, there in no notice at this time."
COM_COMPONENTBUILDER_ALL_IS_GOOD_THERE_IS_NO_NOTICE_AT_THIS_TIME="All is good, there is no notice at this time."
COM_COMPONENTBUILDER_ALL_UNSAVED_WORK_ON_THIS_PAGE_WILL_BE_LOST_ARE_YOU_SURE_YOU_WANT_TO_CONTINUE="All unsaved work on this page will be lost, are you sure you want to continue?"
COM_COMPONENTBUILDER_ALWAYS_ADD="Always Add"
COM_COMPONENTBUILDER_ALWAYS_INSURE_THAT_YOU_HAVE_YOUR_LOCAL_COMPONENTS_BACKED_UP_BY_MAKING_AN_EXPORT_OF_ALL_YOUR_LOCAL_COMPONENTS_BEFORE_IMPORTING_ANY_NEW_COMPONENTS_SMALLMAKE_BSUREB_TO_MOVE_THIS_ZIPPED_BACKUP_PACKAGE_OUT_OF_THE_TMP_FOLDER_BEFORE_DOING_AN_IMPORTSMALLBR_IF_YOU_ARE_IMPORTING_A_PACKAGE_OF_A_THREERD_PARTY_JCB_PACKAGE_DEVELOPER_BMAKE_SURE_IT_IS_A_REPUTABLE_JCB_PACKAGE_DEVELOPERSB="Always insure that you have your local components backed up, by making an export of all your local components before importing any new components. <small>(Make <b>SURE</b> to move this zipped backup package out of the tmp folder before doing an import)</small><br />If you are importing a package of a 3rd party JCB package developer, <b>make sure it is a reputable JCB package developers!</b>"
@ -2135,7 +2135,7 @@ COM_COMPONENTBUILDER_CONFIG_AUTHOR_EMAIL_LABEL="Author Email"
COM_COMPONENTBUILDER_CONFIG_AUTHOR_NAME_DESC="The name of the author of this component."
COM_COMPONENTBUILDER_CONFIG_AUTHOR_NAME_LABEL="Author Name"
COM_COMPONENTBUILDER_CONFIG_AUTO_LOAD="Auto"
COM_COMPONENTBUILDER_CONFIG_BACKUPCRONJOB_NOTE_DESCRIPTION="You can run a cronjob that will backup all your components as they are mapped in JCB.<br /><br /><b>USE THE FOLLOWING:</b> <span id='cronjob-backup'>loading...<span class='loading-dots' ></span></span><br /><br />Please not that if your Joomla website has a Firewall installed, it will not allow cronjob via direct URL (most of the time), you will then need to adapt the cornjob request to look like a browser. For more info please read https://stackoverflow.com/a/31597823/1429677
COM_COMPONENTBUILDER_CONFIG_BACKUPCRONJOB_NOTE_DESCRIPTION="You can run a cronjob that will backup all your components as they are mapped in JCB.<br /><br /><b>USE THE FOLLOWING:</b> <span id='cronjob-backup'>loading...<span class='loading-dots' ></span></span><br /><br />Please note that if your Joomla website has a Firewall installed, it will not allow cronjob via direct URL (most of the time), you will then need to adapt the cornjob request to look like a browser. For more info please read https://stackoverflow.com/a/31597823/1429677
<script type='text/javascript'>
jQuery(document).ready(function($) {
// get token from the form
@ -4411,7 +4411,7 @@ Project duration: **###projectWeekTime### weeks** or **###projectMonthTime### mo
## Donations<br />
<br />
If you want to support this project, please consider donating:<br />
* PayPal: [paypal.me/payvdm](https://www.paypal.me/payvdm)<br />
* PayPal: [paypal.me/asseblief](https://www.paypal.me/asseblief)<br />
* Bitcoin: 18vURxYpPFjvNk8BnUy1ovCAyQmY3MzkSf<br />
* Ethereum: 0x9548144662b47327c954f3e214edb96662d51218
</code></div>"

View File

@ -466,7 +466,7 @@ class ComponentbuilderModelComponentbuilder extends JModelList
getIS(1,board).done(function(result) {
if (result){
jQuery("#cpanel_tabTabs a").each(function() {
if (this.href.indexOf("#vast_development_method") >= 0) {
if (this.href.indexOf("#vast_development_method") >= 0 || this.href.indexOf("#notice_board") >= 0) {
var textVDM = jQuery(this).text();
jQuery(this).html("<span class=\"label label-important vdm-new-notice\">1</span> "+textVDM);
jQuery(this).attr("id","vdm-new-notice");

View File

@ -2265,10 +2265,16 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy
}
break;
case 'joomla_component':
if ($retry == 2)
if ($retry == 3)
{
// get by name only
$getter = array('name', 'name_code'); // risky will look at this again
}
elseif ($retry == 2)
{
// get by name ...
$getter = array('name', 'name_code', 'short_description', 'author', 'email', 'component_version', 'companyname', 'system_name', 'website', 'bom', 'copyright', 'license'); // risky will look at this again
$retryAgain = 3;
}
else
{

View File

@ -1634,6 +1634,12 @@ INSERT INTO `#__componentbuilder_library_files_folders_urls` (`id`, `addfiles`,
(2, '', '', '{\"addurls0\":{\"url\":\"https:\\/\\/maxcdn.bootstrapcdn.com\\/bootstrap\\/4.0.0-alpha.6\\/js\\/bootstrap.min.js\",\"type\":\"2\"},\"addurls1\":{\"url\":\"https:\\/\\/maxcdn.bootstrapcdn.com\\/bootstrap\\/4.0.0-alpha.6\\/css\\/bootstrap.min.css\",\"type\":\"2\"}}', 2, '', 1, '2017-11-25 16:17:36', '2017-12-25 12:40:16', 10, '', 2),
(3, '', '', '{\"addurls0\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/uikit\\/3.0.0-beta.35\\/js\\/uikit.min.js\",\"type\":\"2\"},\"addurls1\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/uikit\\/3.0.0-beta.35\\/js\\/uikit-icons.min.js\",\"type\":\"2\"},\"addurls2\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/uikit\\/3.0.0-beta.35\\/css\\/uikit.min.css\",\"type\":\"2\"}}', 3, '', 1, '2017-11-25 21:47:40', '2017-12-25 12:38:24', 8, '', 3);
CREATE TABLE IF NOT EXISTS `#__componentbuilder_external_code` (
`target` VARCHAR(255) NOT NULL DEFAULT '',
`hash` VARCHAR(64) NOT NULL DEFAULT '',
PRIMARY KEY (`target`)
) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;
--

View File

@ -0,0 +1,5 @@
CREATE TABLE IF NOT EXISTS `#__componentbuilder_external_code` (
`target` VARCHAR(255) NOT NULL DEFAULT '',
`hash` VARCHAR(64) NOT NULL DEFAULT '',
PRIMARY KEY (`target`)
) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;

View File

@ -152,7 +152,7 @@ jQuery(document).ready(function($) {
<script type="text/javascript">
// token
var token = '<?php echo JSession::getFormToken(); ?>';
var all_is_good = '<?php echo JText::_('COM_COMPONENTBUILDER_ALL_IS_GOOD_THERE_IN_NO_NOTICE_AT_THIS_TIME'); ?>';
var all_is_good = '<?php echo JText::_('COM_COMPONENTBUILDER_ALL_IS_GOOD_THERE_IS_NO_NOTICE_AT_THIS_TIME'); ?>';
jQuery('#compilerForm').on('change', '#component',function (e)
{
var component = jQuery('#component').val();

View File

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

View File

@ -390,4 +390,21 @@
<maintainerurl>http://joomlacomponentbuilder.com</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
<update>
<name>Component Builder</name>
<description>Builds Complex Joomla Components</description>
<element>com_componentbuilder</element>
<type>component</type>
<version>2.6.14</version>
<infourl title="Component Builder!">http://joomlacomponentbuilder.com</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.6.14/JCB_v2.6.14.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>http://joomlacomponentbuilder.com</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
</updates>

View File

@ -4739,7 +4739,7 @@ class com_componentbuilderInstallerScript
echo '<a target="_blank" href="http://joomlacomponentbuilder.com" title="Component Builder">
<img src="components/com_componentbuilder/assets/images/vdm-component.jpg"/>
</a>
<h3>Upgrade to Version 2.6.13 Was Successful! Let us know if anything is not working as expected.</h3>';
<h3>Upgrade to Version 2.6.14 Was Successful! Let us know if anything is not working as expected.</h3>';
}
}
}

View File

@ -802,6 +802,49 @@ abstract class ComponentbuilderHelper
return false;
}
/**
* Check if the url exist
*
* @param string $url The url to check
*
* @return bool If exist true
*
*/
public static function urlExists($url)
{
$exists = false;
// check if we can use curl
if (function_exists('curl_version'))
{
// initiate curl
$ch = curl_init($url);
// CURLOPT_NOBODY (do not return body)
curl_setopt($ch, CURLOPT_NOBODY, true);
// make call
$result = curl_exec($ch);
// check return value
if ($result !== false)
{
// get the http CODE
$statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($statusCode !== 404)
{
$exists = true;
}
}
// close the connection
curl_close($ch);
}
elseif ($headers = @get_headers($url))
{
if(isset($headers[0]) && is_string($headers[0]) && strpos($headers[0],'404') === false)
{
$exists = true;
}
}
return $exists;
}
/**
* Get the file path or url
*