Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
6b70aa45e6 | |||
951e0c1f5d | |||
57bf464111 | |||
6871bfd9a2 | |||
3bc71a935c | |||
1cad434a39 | |||
a2224e3ad9 | |||
4bdb503973 | |||
4424179425 | |||
306b6b9787 | |||
0c30fa7f68 | |||
86624770b1 | |||
21756c3e55 | |||
ef8578104c | |||
80670beada | |||
3efbb7b4af |
26
README.md
26
README.md
@ -1,4 +1,4 @@
|
||||
# Component Builder (2.1.1)
|
||||
# Component Builder (2.1.5)
|
||||
|
||||
This is a [Joomla 3.x] (http://www.joomla.org/) component.
|
||||
|
||||
@ -32,38 +32,38 @@ Would you require more help VDM.io has a number of support plans available [visi
|
||||
+ *Author*: [Llewellyn van der Merwe] (mailto:info@vdm.io)
|
||||
+ *Name*: [Component Builder] (https://www.vdm.io/joomla-component-builder)
|
||||
+ *First Build*: 30th April, 2015
|
||||
+ *Last Build*: 1st March, 2016
|
||||
+ *Version*: 2.1.1
|
||||
+ *Last Build*: 4th May, 2016
|
||||
+ *Version*: 2.1.5
|
||||
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
|
||||
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
## Build Time
|
||||
|
||||
**223 Hours** or **28 Eight Hour Days** (actual time the author saved -
|
||||
**227 Hours** or **28 Eight Hour Days** (actual time the author saved -
|
||||
due to [Automated Component Builder] (https://www.vdm.io/joomla-component-builder))
|
||||
|
||||
> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
|
||||
> never making one mistake or taking any coffee break.)
|
||||
|
||||
+ *Line count*: **80154**
|
||||
+ *File count*: **492**
|
||||
+ *Folder count*: **97**
|
||||
+ *Line count*: **81571**
|
||||
+ *File count*: **498**
|
||||
+ *Folder count*: **98**
|
||||
|
||||
**148 Hours** or **18 Eight Hour Days** (the actual time the author spent)
|
||||
**150 Hours** or **19 Eight Hour Days** (the actual time the author spent)
|
||||
|
||||
> (with the following break down:
|
||||
> **debugging @56hours** = codingtime / 4;
|
||||
> **debugging @57hours** = codingtime / 4;
|
||||
> **planning @32hours** = codingtime / 7;
|
||||
> **mapping @22hours** = codingtime / 10;
|
||||
> **office @37hours** = codingtime / 6;)
|
||||
> **mapping @23hours** = codingtime / 10;
|
||||
> **office @38hours** = codingtime / 6;)
|
||||
|
||||
**371 Hours** or **46 Eight Hour Days**
|
||||
**377 Hours** or **47 Eight Hour Days**
|
||||
(a total of the realistic time frame for this project)
|
||||
|
||||
> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
|
||||
> with the normal everyday realities at the office, that includes the component planning, mapping & debugging.)
|
||||
|
||||
Project duration: **9.2 weeks** or **1.9 months**
|
||||
Project duration: **9.4 weeks** or **2 months**
|
||||
|
||||
> This **component** was build with a Joomla [Automated Component Builder] (https://www.vdm.io/joomla-component-builder).
|
||||
> Developed by [Llewellyn van der Merwe] (mailto:joomla@vdm.io)
|
@ -9,8 +9,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage admin.css
|
||||
|
@ -9,8 +9,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage admin_view.css
|
||||
|
@ -9,8 +9,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage admin_views.css
|
||||
|
@ -9,8 +9,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage component.css
|
||||
|
@ -9,8 +9,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage components.css
|
||||
|
@ -9,8 +9,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage custom_admin_view.css
|
||||
|
@ -9,8 +9,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage custom_admin_views.css
|
||||
|
@ -9,8 +9,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage dashboard.css
|
||||
|
@ -9,8 +9,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage dynamic_get.css
|
||||
|
@ -9,8 +9,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage dynamic_gets.css
|
||||
|
@ -9,8 +9,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage field.css
|
||||
|
@ -9,8 +9,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage fields.css
|
||||
|
@ -9,8 +9,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage fieldtype.css
|
||||
|
@ -9,8 +9,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage fieldtypes.css
|
||||
|
@ -9,8 +9,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage help_document.css
|
||||
|
@ -9,8 +9,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage help_documents.css
|
||||
|
@ -9,8 +9,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage layout.css
|
||||
|
@ -9,8 +9,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage layouts.css
|
||||
|
@ -9,8 +9,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage site_view.css
|
||||
|
@ -9,8 +9,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage site_views.css
|
||||
|
@ -9,8 +9,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage snippet.css
|
||||
|
@ -9,8 +9,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage snippets.css
|
||||
|
@ -9,8 +9,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage template.css
|
||||
|
@ -9,8 +9,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage templates.css
|
||||
|
@ -201,7 +201,7 @@ abstract class ###Component###Helper
|
||||
$query = $db->getQuery(true);
|
||||
$query->select(array('a.published'));
|
||||
$query->from('#__###component###_'.$type.' AS a');
|
||||
$query->where('a.id = '.$id);
|
||||
$query->where('a.id = '. (int) $id);
|
||||
$query->where('a.published = 1');
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
@ -219,7 +219,7 @@ abstract class ###Component###Helper
|
||||
$query = $db->getQuery(true);
|
||||
$query->select(array('a.title'));
|
||||
$query->from('#__usergroups AS a');
|
||||
$query->where('a.id = '.$id);
|
||||
$query->where('a.id = '. (int) $id);
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
$found = $db->getNumRows();
|
||||
@ -572,6 +572,16 @@ abstract class ###Component###Helper
|
||||
return $button->input;
|
||||
|
||||
}
|
||||
|
||||
public static function checkJson($string)
|
||||
{
|
||||
if (self::checkString($string))
|
||||
{
|
||||
json_decode($string);
|
||||
return (json_last_error() === JSON_ERROR_NONE);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function checkObject($object)
|
||||
{
|
||||
@ -831,7 +841,7 @@ abstract class ###Component###Helper
|
||||
$w .= ' ';
|
||||
if($r < 100)
|
||||
{
|
||||
$word .= 'and ';
|
||||
$w .= 'and ';
|
||||
}
|
||||
$w .= self::numberToString($r);
|
||||
}
|
||||
|
261
admin/compiler/joomla_3/Helper_email.php
Normal file
261
admin/compiler/joomla_3/Helper_email.php
Normal file
@ -0,0 +1,261 @@
|
||||
<?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###
|
||||
|
||||
/**
|
||||
* ###Component### component email helper
|
||||
*/
|
||||
abstract class ###Component###Email
|
||||
{
|
||||
/**
|
||||
* Configuraiton object
|
||||
*
|
||||
* @var JConfig
|
||||
*/
|
||||
public static $config = null;
|
||||
|
||||
/**
|
||||
* Mailer object
|
||||
*
|
||||
* @var JMail
|
||||
*/
|
||||
public static $mailer = null;
|
||||
|
||||
/**
|
||||
* Get a configuration object
|
||||
*
|
||||
*/
|
||||
public static function getConfig()
|
||||
{
|
||||
if (!self::$config)
|
||||
{
|
||||
self::$config = JComponentHelper::getParams('com_###component###');
|
||||
}
|
||||
|
||||
return self::$config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a mailer object.
|
||||
*
|
||||
* Returns the global {@link JMail} object, only creating it if it doesn't already exist.
|
||||
*
|
||||
* @return JMail object
|
||||
*
|
||||
* @see JMail
|
||||
*/
|
||||
public static function getMailer()
|
||||
{
|
||||
if (!self::$mailer)
|
||||
{
|
||||
self::$mailer = self::createMailer();
|
||||
}
|
||||
|
||||
$copy = clone self::$mailer;
|
||||
|
||||
return $copy;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a mailer object
|
||||
*
|
||||
* @return JMail object
|
||||
*
|
||||
* @see JMail
|
||||
*/
|
||||
protected static function createMailer()
|
||||
{
|
||||
// set component params
|
||||
$conf = self::getConfig();
|
||||
|
||||
// now load the mailer
|
||||
$mailer = $conf->get('mailer', 'global');
|
||||
|
||||
// Create a JMail object
|
||||
$mail = JMail::getInstance();
|
||||
|
||||
// check if set to global
|
||||
if ('global' == $mailer)
|
||||
{
|
||||
// get the global details
|
||||
$globalConf = JFactory::getConfig();
|
||||
|
||||
$mailer = $globalConf->get('mailer');
|
||||
$smtpauth = ($globalConf->get('smtpauth') == 0) ? null : 1;
|
||||
$smtpuser = $globalConf->get('smtpuser');
|
||||
$smtppass = $globalConf->get('smtppass');
|
||||
$smtphost = $globalConf->get('smtphost');
|
||||
$smtpsecure = $globalConf->get('smtpsecure');
|
||||
$smtpport = $globalConf->get('smtpport');
|
||||
$sendmail = $globalConf->get('sendmail');
|
||||
$mailfrom = $globalConf->get('mailfrom');
|
||||
$fromname = $globalConf->get('fromname');
|
||||
}
|
||||
else
|
||||
{
|
||||
$smtpauth = ($conf->get('smtpauth') == 0) ? null : 1;
|
||||
$smtpuser = $conf->get('smtpuser');
|
||||
$smtppass = $conf->get('smtppass');
|
||||
$smtphost = $conf->get('smtphost');
|
||||
$smtpsecure = $conf->get('smtpsecure');
|
||||
$smtpport = $conf->get('smtpport');
|
||||
$sendmail = $conf->get('sendmail');
|
||||
$mailfrom = $conf->get('mailfrom');
|
||||
$fromname = $conf->get('fromname');
|
||||
$mailreply = $conf->get('mailreply');
|
||||
$replyname = $conf->get('replyname');
|
||||
|
||||
// set the global reply-to
|
||||
if ($mailreply && $fromname)
|
||||
{
|
||||
$mail->ClearReplyTos();
|
||||
$mail->addReplyTo( array( $mailreply, $replyname ) );
|
||||
}
|
||||
}
|
||||
|
||||
// Set global sender
|
||||
$mail->setSender(array($mailfrom, $fromname));
|
||||
|
||||
// Default mailer is to use PHP's mail function
|
||||
switch ($mailer)
|
||||
{
|
||||
case 'smtp':
|
||||
// set the SMTP option
|
||||
$mail->useSMTP($smtpauth, $smtphost, $smtpuser, $smtppass, $smtpsecure, $smtpport);
|
||||
break;
|
||||
|
||||
case 'sendmail':
|
||||
// set the sendmail option
|
||||
$mail->useSendmail($sendmail);
|
||||
$mail->IsSendmail();
|
||||
break;
|
||||
|
||||
default:
|
||||
$mail->IsMail();
|
||||
break;
|
||||
}
|
||||
|
||||
return $mail;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send an email
|
||||
*
|
||||
* @return bool on success
|
||||
*
|
||||
*/
|
||||
public static function send($recipient, $subject, $body, $textonly, $mode = 0, $bounce_email = null, $idsession = null, $mailreply = null, $replyname = null , $mailfrom = null, $fromname = null, $cc = null, $bcc = null, $attachment = null, $embeded = null , $embeds = null)
|
||||
{
|
||||
|
||||
// Get a JMail instance
|
||||
$mail = self::getMailer();
|
||||
|
||||
// set component params
|
||||
$conf = self::getConfig();
|
||||
|
||||
// do some house cleaning
|
||||
$mail->ClearReplyTos();
|
||||
|
||||
// set if we have override
|
||||
if ($mailfrom && $fromname)
|
||||
{
|
||||
$mail->setSender(array($mailfrom, $fromname));
|
||||
}
|
||||
|
||||
// load the bounce email as sender if set
|
||||
if (!is_null($bounce_email))
|
||||
{
|
||||
|
||||
$mail->Sender = $bounce_email;
|
||||
}
|
||||
|
||||
// Add tag to email to identify it
|
||||
if (!is_null($idsession))
|
||||
{
|
||||
$mail->addCustomHeader('X-VDMmethodID:'.$idsession);
|
||||
}
|
||||
|
||||
// set the subject & Body
|
||||
$mail->setSubject($subject);
|
||||
$mail->setBody($body);
|
||||
|
||||
// Are we sending the email as HTML?
|
||||
if ($mode)
|
||||
{
|
||||
$mail->IsHTML(true);
|
||||
$mail->AltBody = $textonly;
|
||||
}
|
||||
|
||||
//embed images
|
||||
if ($embeded)
|
||||
{
|
||||
if(###Component###Helper::checkArray($embeds))
|
||||
{
|
||||
foreach($embeds as $embed)
|
||||
{
|
||||
$mail->AddEmbeddedImage($embed->Path,$embed->FileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$mail->addRecipient($recipient);
|
||||
$mail->addCC($cc);
|
||||
$mail->addBCC($bcc);
|
||||
$mail->addAttachment($attachment);
|
||||
|
||||
// Take care of reply email addresses
|
||||
if (is_array($mailreply))
|
||||
{
|
||||
$mail->ClearReplyTos();
|
||||
$numReplyTo = count($mailreply);
|
||||
for ($i=0; $i < $numReplyTo; $i++)
|
||||
{
|
||||
$mail->addReplyTo( array($mailreply[$i], $replyname[$i]) );
|
||||
}
|
||||
}
|
||||
elseif (!empty($mailreply))
|
||||
{
|
||||
$mail->ClearReplyTos();
|
||||
$mail->addReplyTo( array( $mailreply, $replyname ) );
|
||||
}
|
||||
|
||||
// check if we can add the DKIM to email
|
||||
if ($conf->get('enable_dkim'))
|
||||
{
|
||||
if (!empty($conf->get('dkim_domain')) && !empty($conf->get('dkim_selector')) && !empty($conf->get('dkim_private')) && !empty($conf->get('dkim_public')))
|
||||
{
|
||||
$mail->DKIM_domain = $conf->get('dkim_domain');
|
||||
$mail->DKIM_selector = $conf->get('dkim_selector');
|
||||
$mail->DKIM_identity = $conf->get('dkim_identity');
|
||||
$mail->DKIM_passphrase = $conf->get('dkim_passphrase');
|
||||
|
||||
$tmp = tempnam(sys_get_temp_dir(), 'VDM');
|
||||
$h = fopen($tmp, 'w');
|
||||
fwrite($h, $conf->get('dkim_private'));
|
||||
fclose($h);
|
||||
$mail->DKIM_private = $tmp;
|
||||
}
|
||||
}
|
||||
|
||||
$sendmail = $mail->Send();
|
||||
|
||||
if ($conf->get('enable_dkim') && !empty($conf->get('dkim_domain')) && !empty($conf->get('dkim_selector')) && !empty($conf->get('dkim_private')) && !empty($conf->get('dkim_public')))
|
||||
{
|
||||
@unlink($tmp);
|
||||
}
|
||||
|
||||
return $sendmail;
|
||||
}
|
||||
}
|
@ -332,6 +332,45 @@ abstract class ###Component###Helper
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function isPublished($id,$type)
|
||||
{
|
||||
if ($type == 'raw')
|
||||
{
|
||||
$type = 'item';
|
||||
}
|
||||
$db = JFactory::getDbo();
|
||||
$query = $db->getQuery(true);
|
||||
$query->select(array('a.published'));
|
||||
$query->from('#__###component###_'.$type.' AS a');
|
||||
$query->where('a.id = '. (int) $id);
|
||||
$query->where('a.published = 1');
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
$found = $db->getNumRows();
|
||||
if($found)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function getGroupName($id)
|
||||
{
|
||||
$db = JFactory::getDBO();
|
||||
$query = $db->getQuery(true);
|
||||
$query->select(array('a.title'));
|
||||
$query->from('#__usergroups AS a');
|
||||
$query->where('a.id = '. (int) $id);
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
$found = $db->getNumRows();
|
||||
if($found)
|
||||
{
|
||||
return $db->loadResult();
|
||||
}
|
||||
return $id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actions permissions
|
||||
@ -524,6 +563,16 @@ abstract class ###Component###Helper
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
public static function checkJson($string)
|
||||
{
|
||||
if (self::checkString($string))
|
||||
{
|
||||
json_decode($string);
|
||||
return (json_last_error() === JSON_ERROR_NONE);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function checkObject($object)
|
||||
{
|
||||
@ -783,7 +832,7 @@ abstract class ###Component###Helper
|
||||
$w .= ' ';
|
||||
if($r < 100)
|
||||
{
|
||||
$word .= 'and ';
|
||||
$w .= 'and ';
|
||||
}
|
||||
$w .= self::numberToString($r);
|
||||
}
|
||||
|
@ -117,10 +117,10 @@ class ###Component###ControllerHelp extends JControllerLegacy
|
||||
$text[] = '<div class="uk-container uk-container-center uk-grid-collapse">';
|
||||
$text[] = '<div class="uk-panel uk-width-1-1 uk-panel-box uk-panel-box-primary">';
|
||||
// build the help text
|
||||
$text[] = '<h3 class="uk-panel-title">'.$document->title."</h3>";
|
||||
$text[] = '<h1 class="uk-panel-title">'.$document->title."</h1>";
|
||||
$text[] = str_replace(array_keys($images),array_values($images),$document->content);
|
||||
// end template
|
||||
$text[] = '</div>';
|
||||
$text[] = '</div><br /><br />';
|
||||
$text[] = '</div>';
|
||||
$text[] = "</body>";
|
||||
$text[] = "</html>";
|
||||
|
@ -118,10 +118,10 @@ class ###Component###ControllerHelp extends JControllerLegacy
|
||||
$text[] = '<div class="uk-container uk-container-center uk-grid-collapse">';
|
||||
$text[] = '<div class="uk-panel uk-width-1-1 uk-panel-box uk-panel-box-primary">';
|
||||
// build the help text
|
||||
$text[] = '<h3 class="uk-panel-title">'.$document->title."</h3>";
|
||||
$text[] = '<h1 class="uk-panel-title">'.$document->title."</h1>";
|
||||
$text[] = str_replace(array_keys($images),array_values($images),$document->content);
|
||||
// end template
|
||||
$text[] = '</div>';
|
||||
$text[] = '</div><br /><br />';
|
||||
$text[] = '</div>';
|
||||
$text[] = "</body>";
|
||||
$text[] = "</html>";
|
||||
|
70
admin/compiler/joomla_3/JControllerLegacy_import_custom.php
Normal file
70
admin/compiler/joomla_3/JControllerLegacy_import_custom.php
Normal file
@ -0,0 +1,70 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@package Component Builder
|
||||
@subpackage componentbuilder.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
|
||||
@my wife Roline 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
|
||||
|
||||
Builds Complex Joomla Components
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// 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');
|
||||
|
||||
/**
|
||||
* ###Component### ###View### Controller
|
||||
*/
|
||||
class ###Component###Controller###View### extends JControllerLegacy
|
||||
{
|
||||
/**
|
||||
* Import an spreadsheet.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function import()
|
||||
{
|
||||
// Check for request forgeries
|
||||
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
|
||||
|
||||
$model = $this->getModel('import');
|
||||
if ($model->import())
|
||||
{
|
||||
$cache = JFactory::getCache('mod_menu');
|
||||
$cache->clean();
|
||||
// TODO: Reset the users acl here as well to kill off any missing bits
|
||||
}
|
||||
|
||||
$app = JFactory::getApplication();
|
||||
$redirect_url = $app->getUserState('com_###component###.redirect_url');
|
||||
if (empty($redirect_url))
|
||||
{
|
||||
$redirect_url = JRoute::_('index.php?option=com_###component###&view=###view###', false);
|
||||
}
|
||||
else
|
||||
{
|
||||
// wipe out the user state when we're going to redirect
|
||||
$app->setUserState('com_###component###.redirect_url', '');
|
||||
$app->setUserState('com_###component###.message', '');
|
||||
$app->setUserState('com_###component###.extension_message', '');
|
||||
}
|
||||
$this->setRedirect($redirect_url);
|
||||
}
|
||||
}
|
@ -511,7 +511,6 @@ class ###Component###ModelImport extends JModelLegacy
|
||||
// reset all buckets
|
||||
$query = $db->getQuery(true);
|
||||
$fields = array();
|
||||
$version = false;
|
||||
// Fields to update.
|
||||
foreach($row as $key => $cell)
|
||||
{
|
||||
@ -534,7 +533,6 @@ class ###Component###ModelImport extends JModelLegacy
|
||||
if ('version' == $target[$key])
|
||||
{
|
||||
$cell = (int) $version + 1;
|
||||
$version = true;
|
||||
}
|
||||
// verify publish authority
|
||||
if ('published' == $target[$key] && !$canState)
|
||||
@ -559,10 +557,6 @@ class ###Component###ModelImport extends JModelLegacy
|
||||
// load the defaults
|
||||
$fields[] = $db->quoteName('modified_by') . ' = ' . $db->quote($user->id);
|
||||
$fields[] = $db->quoteName('modified') . ' = ' . $db->quote($todayDate);
|
||||
if (!$version)
|
||||
{
|
||||
$fields[] = $db->quoteName('version') . " = " . (int) $version + 1;
|
||||
}
|
||||
// Conditions for which records should be updated.
|
||||
$conditions = array(
|
||||
$db->quoteName('id') . ' = ' . $id
|
||||
|
498
admin/compiler/joomla_3/JModelLegacy_import_custom.php
Normal file
498
admin/compiler/joomla_3/JModelLegacy_import_custom.php
Normal file
@ -0,0 +1,498 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@package Component Builder
|
||||
@subpackage componentbuilder.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
|
||||
@my wife Roline 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
|
||||
|
||||
Builds Complex Joomla Components
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// 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');
|
||||
|
||||
/**
|
||||
* ###Component### ###View### Model
|
||||
*/
|
||||
class ###Component###Model###View### extends JModelLegacy
|
||||
{
|
||||
/**
|
||||
* @var object JTable object
|
||||
*/
|
||||
protected $_table = null;
|
||||
|
||||
/**
|
||||
* @var object JTable object
|
||||
*/
|
||||
protected $_url = null;
|
||||
|
||||
/**
|
||||
* Model context string.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_context = 'com_###component###.import';
|
||||
|
||||
/**
|
||||
* Import Settings
|
||||
*/
|
||||
protected $getType = NULL;
|
||||
protected $dataType = NULL;
|
||||
|
||||
/**
|
||||
* Method to auto-populate the model state.
|
||||
*
|
||||
* Note. Calling getState in this method will result in recursion.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
*/
|
||||
protected function populateState()
|
||||
{
|
||||
$app = JFactory::getApplication('administrator');
|
||||
|
||||
$this->setState('message', $app->getUserState('com_###component###.message'));
|
||||
$app->setUserState('com_###component###.message', '');
|
||||
|
||||
// Recall the 'Import from Directory' path.
|
||||
$path = $app->getUserStateFromRequest($this->_context . '.import_directory', 'import_directory', $app->get('tmp_path'));
|
||||
$this->setState('import.directory', $path);
|
||||
// set uploading values
|
||||
$this->use_streams = false;
|
||||
$this->allow_unsafe = false;
|
||||
$this->safeFileOptions = array();
|
||||
parent::populateState();
|
||||
}
|
||||
|
||||
/**
|
||||
* Import an spreadsheet from either folder, url or upload.
|
||||
*
|
||||
* @return boolean result of import
|
||||
*
|
||||
*/
|
||||
public function import()
|
||||
{
|
||||
$this->setState('action', 'import');
|
||||
$app = JFactory::getApplication();
|
||||
$session = JFactory::getSession();
|
||||
$package = null;
|
||||
$continue = false;
|
||||
// get import type
|
||||
$this->getType = $app->input->getString('gettype', NULL);
|
||||
// get import type
|
||||
$this->dataType = $session->get('dataType_VDM_IMPORTINTO', NULL);
|
||||
|
||||
if ($package === null)
|
||||
{
|
||||
switch ($this->getType)
|
||||
{
|
||||
case 'folder':
|
||||
// Remember the 'Import from Directory' path.
|
||||
$app->getUserStateFromRequest($this->_context . '.import_directory', 'import_directory');
|
||||
$package = $this->_getPackageFromFolder();
|
||||
break;
|
||||
|
||||
case 'upload':
|
||||
$package = $this->_getPackageFromUpload();
|
||||
break;
|
||||
|
||||
case 'url':
|
||||
$package = $this->_getPackageFromUrl();
|
||||
break;
|
||||
|
||||
case 'continue':
|
||||
$continue = true;
|
||||
$package = $session->get('package', null);
|
||||
$package = json_decode($package, true);
|
||||
// clear session
|
||||
$session->clear('package');
|
||||
$session->clear('dataType');
|
||||
$session->clear('hasPackage');
|
||||
break;
|
||||
|
||||
default:
|
||||
$app->setUserState('com_###component###.message', JText::_('COM_###COMPONENT###_IMPORT_NO_IMPORT_TYPE_FOUND'));
|
||||
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Was the package valid?
|
||||
if (!$package || !$package['type'])
|
||||
{
|
||||
if (in_array($this->getType, array('upload', 'url')))
|
||||
{
|
||||
$this->remove($package['packagename']);
|
||||
}
|
||||
|
||||
$app->setUserState('com_###component###.message', JText::_('COM_###COMPONENT###_IMPORT_UNABLE_TO_FIND_IMPORT_PACKAGE'));
|
||||
return false;
|
||||
}
|
||||
|
||||
// first link data to table headers
|
||||
if(!$continue){
|
||||
$package = json_encode($package);
|
||||
$session->set('package', $package);
|
||||
$session->set('dataType', $this->dataType);
|
||||
$session->set('hasPackage', true);
|
||||
return true;
|
||||
}
|
||||
|
||||
// set the data
|
||||
$headerList = json_decode($session->get($this->dataType.'_VDM_IMPORTHEADERS', false), true);
|
||||
if (!$this->setData($package,$this->dataType,$headerList))
|
||||
{
|
||||
// There was an error importing the package
|
||||
$msg = JText::_('COM_###COMPONENT###_IMPORT_ERROR');
|
||||
$back = $session->get('backto_VDM_IMPORT', NULL);
|
||||
if ($back)
|
||||
{
|
||||
$app->setUserState('com_###component###.redirect_url', 'index.php?option=com_###component###&view='.$back);
|
||||
$session->clear('backto_VDM_IMPORT');
|
||||
}
|
||||
$result = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Package imported sucessfully
|
||||
$msg = JText::sprintf('COM_###COMPONENT###_IMPORT_SUCCESS', $package['packagename']);
|
||||
$back = $session->get('backto_VDM_IMPORT', NULL);
|
||||
if ($back)
|
||||
{
|
||||
$app->setUserState('com_###component###.redirect_url', 'index.php?option=com_###component###&view='.$back);
|
||||
$session->clear('backto_VDM_IMPORT');
|
||||
}
|
||||
$result = true;
|
||||
}
|
||||
|
||||
// Set some model state values
|
||||
$app->enqueueMessage($msg);
|
||||
|
||||
// remove file after import
|
||||
$this->remove($package['packagename']);
|
||||
$session->clear($this->getType.'_VDM_IMPORTHEADERS');
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Works out an importation spreadsheet from a HTTP upload
|
||||
*
|
||||
* @return spreadsheet definition or false on failure
|
||||
*/
|
||||
protected function _getPackageFromUpload()
|
||||
{
|
||||
// Get the uploaded file information
|
||||
$input = JFactory::getApplication()->input;
|
||||
|
||||
// Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See JInputFiles::get.
|
||||
$userfile = $input->files->get('import_package', null, 'raw');
|
||||
|
||||
// Make sure that file uploads are enabled in php
|
||||
if (!(bool) ini_get('file_uploads'))
|
||||
{
|
||||
JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTFILE'));
|
||||
return false;
|
||||
}
|
||||
|
||||
// If there is no uploaded file, we have a problem...
|
||||
if (!is_array($userfile))
|
||||
{
|
||||
JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_NO_FILE_SELECTED'));
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check if there was a problem uploading the file.
|
||||
if ($userfile['error'] || $userfile['size'] < 1)
|
||||
{
|
||||
JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTUPLOADERROR'));
|
||||
return false;
|
||||
}
|
||||
|
||||
// Build the appropriate paths
|
||||
$config = JFactory::getConfig();
|
||||
$tmp_dest = $config->get('tmp_path') . '/' . $userfile['name'];
|
||||
$tmp_src = $userfile['tmp_name'];
|
||||
|
||||
// Move uploaded file
|
||||
jimport('joomla.filesystem.file');
|
||||
$p_file = JFile::upload($tmp_src, $tmp_dest, $this->use_streams, $this->allow_unsafe, $this->safeFileOptions);
|
||||
|
||||
// Was the package downloaded?
|
||||
if (!$p_file)
|
||||
{
|
||||
$session = JFactory::getSession();
|
||||
$session->clear('package');
|
||||
$session->clear('dataType');
|
||||
$session->clear('hasPackage');
|
||||
// was not uploaded
|
||||
return false;
|
||||
}
|
||||
|
||||
// check that this is a valid spreadsheet
|
||||
$package = $this->check($userfile['name']);
|
||||
|
||||
return $package;
|
||||
}
|
||||
|
||||
/**
|
||||
* Import an spreadsheet from a directory
|
||||
*
|
||||
* @return array Spreadsheet details or false on failure
|
||||
*
|
||||
*/
|
||||
protected function _getPackageFromFolder()
|
||||
{
|
||||
$input = JFactory::getApplication()->input;
|
||||
|
||||
// Get the path to the package to import
|
||||
$p_dir = $input->getString('import_directory');
|
||||
$p_dir = JPath::clean($p_dir);
|
||||
// Did you give us a valid path?
|
||||
if (!file_exists($p_dir))
|
||||
{
|
||||
JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY'));
|
||||
return false;
|
||||
}
|
||||
|
||||
// Detect the package type
|
||||
$type = $this->getType;
|
||||
|
||||
// Did you give us a valid package?
|
||||
if (!$type)
|
||||
{
|
||||
JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'));
|
||||
}
|
||||
|
||||
// check the extention
|
||||
switch(strtolower(pathinfo($p_dir, PATHINFO_EXTENSION))){
|
||||
case 'xls':
|
||||
case 'ods':
|
||||
case 'csv':
|
||||
break;
|
||||
|
||||
default:
|
||||
JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'));
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
|
||||
$package['packagename'] = null;
|
||||
$package['dir'] = $p_dir;
|
||||
$package['type'] = $type;
|
||||
|
||||
return $package;
|
||||
}
|
||||
|
||||
/**
|
||||
* Import an spreadsheet from a URL
|
||||
*
|
||||
* @return Package details or false on failure
|
||||
*
|
||||
*/
|
||||
protected function _getPackageFromUrl()
|
||||
{
|
||||
$input = JFactory::getApplication()->input;
|
||||
|
||||
// Get the URL of the package to import
|
||||
$url = $input->getString('import_url');
|
||||
|
||||
// Did you give us a URL?
|
||||
if (!$url)
|
||||
{
|
||||
JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_ENTER_A_URL'));
|
||||
return false;
|
||||
}
|
||||
|
||||
// Download the package at the URL given
|
||||
$p_file = JInstallerHelper::downloadPackage($url);
|
||||
|
||||
// Was the package downloaded?
|
||||
if (!$p_file)
|
||||
{
|
||||
JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_INVALID_URL'));
|
||||
return false;
|
||||
}
|
||||
|
||||
// check that this is a valid spreadsheet
|
||||
$package = $this->check($p_file);
|
||||
|
||||
return $package;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check a file and verifies it as a spreadsheet file
|
||||
* Supports .csv .xlsx .xls and .ods
|
||||
*
|
||||
* @param string $p_filename The uploaded package filename or import directory
|
||||
*
|
||||
* @return array of elements
|
||||
*
|
||||
*/
|
||||
protected function check($archivename)
|
||||
{
|
||||
// Clean the name
|
||||
$archivename = JPath::clean($archivename);
|
||||
|
||||
// check the extention
|
||||
switch(strtolower(pathinfo($archivename, PATHINFO_EXTENSION))){
|
||||
case 'xls':
|
||||
case 'ods':
|
||||
case 'csv':
|
||||
break;
|
||||
|
||||
default:
|
||||
// Cleanup the import files
|
||||
$this->remove($archivename);
|
||||
JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'));
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
|
||||
$config = JFactory::getConfig();
|
||||
// set Package Name
|
||||
$check['packagename'] = $archivename;
|
||||
|
||||
// set directory
|
||||
$check['dir'] = $config->get('tmp_path'). '/' .$archivename;
|
||||
|
||||
// set type
|
||||
$check['type'] = $this->getType;
|
||||
|
||||
return $check;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up temporary uploaded spreadsheet
|
||||
*
|
||||
* @param string $package Name of the uploaded spreadsheet file
|
||||
*
|
||||
* @return boolean True on success
|
||||
*
|
||||
*/
|
||||
protected function remove($package)
|
||||
{
|
||||
jimport('joomla.filesystem.file');
|
||||
|
||||
$config = JFactory::getConfig();
|
||||
$package = $config->get('tmp_path'). '/' .$package;
|
||||
|
||||
// Is the package file a valid file?
|
||||
if (is_file($package))
|
||||
{
|
||||
JFile::delete($package);
|
||||
}
|
||||
elseif (is_file(JPath::clean($package)))
|
||||
{
|
||||
// It might also be just a base filename
|
||||
JFile::delete(JPath::clean($package));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the data from the spreadsheet to the database
|
||||
*
|
||||
* @param string $package Paths to the uploaded package file
|
||||
*
|
||||
* @return boolean false on failure
|
||||
*
|
||||
**/
|
||||
protected function setData($package,$table,$target_headers)
|
||||
{###IMPORT_SETDATE_METOD_CUSTOM###
|
||||
}
|
||||
|
||||
/**
|
||||
* Save the data from the file to the database
|
||||
*
|
||||
* @param string $package Paths to the uploaded package file
|
||||
*
|
||||
* @return boolean false on failure
|
||||
*
|
||||
**/
|
||||
protected function save($data,$table)
|
||||
{###IMPORT_SAVE_METOD_CUSTOM###
|
||||
}
|
||||
|
||||
protected function getAlias($name,$type = false)
|
||||
{
|
||||
// sanitize the name to an alias
|
||||
if (JFactory::getConfig()->get('unicodeslugs') == 1)
|
||||
{
|
||||
$alias = JFilterOutput::stringURLUnicodeSlug($name);
|
||||
}
|
||||
else
|
||||
{
|
||||
$alias = JFilterOutput::stringURLSafe($name);
|
||||
}
|
||||
// must be a uniqe alias
|
||||
if ($type)
|
||||
{
|
||||
return $this->getUniqe($alias,'alias',$type);
|
||||
}
|
||||
return $alias;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to generate a uniqe value.
|
||||
*
|
||||
* @param string $field name.
|
||||
* @param string $value data.
|
||||
* @param string $type table.
|
||||
*
|
||||
* @return string New value.
|
||||
*/
|
||||
protected function getUniqe($value,$field,$type)
|
||||
{
|
||||
// insure the filed is always uniqe
|
||||
while (isset($this->uniqeValueArray[$type][$field][$value]))
|
||||
{
|
||||
$value = JString::increment($value, 'dash');
|
||||
}
|
||||
$this->uniqeValueArray[$type][$field][$value] = $value;
|
||||
return $value;
|
||||
}
|
||||
|
||||
protected function getAliasesUsed($table)
|
||||
{
|
||||
// Get a db connection.
|
||||
$db = JFactory::getDbo();
|
||||
// first we check if there is a alias column
|
||||
$columns = $db->getTableColumns('#__###component###_'.$table);
|
||||
if(isset($columns['alias'])){
|
||||
// Create a new query object.
|
||||
$query = $db->getQuery(true);
|
||||
$query->select($db->quoteName(array('alias')));
|
||||
$query->from($db->quoteName('#__###component###_'.$table));
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
if ($db->getNumRows())
|
||||
{
|
||||
$aliases = $db->loadColumn();
|
||||
foreach($aliases as $alias)
|
||||
{
|
||||
$this->uniqeValueArray[$table]['alias'][$alias] = $alias;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
@ -67,7 +67,7 @@ class ###Component###Model###SViews### extends JModelList
|
||||
$this->levels = $this->user->getAuthorisedViewLevels();
|
||||
$this->app = JFactory::getApplication();
|
||||
$this->input = $this->app->input;
|
||||
$this->initSet = true;###CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY### ###CUSTOM_ADMIN_GET_LIST_QUERY###
|
||||
$this->initSet = true; ###CUSTOM_ADMIN_GET_LIST_QUERY###
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -67,7 +67,7 @@ class ###Component###Model###SViews### extends JModelList
|
||||
$this->levels = $this->user->getAuthorisedViewLevels();
|
||||
$this->app = JFactory::getApplication();
|
||||
$this->input = $this->app->input;
|
||||
$this->initSet = true;###SITE_CUSTOM_BEFORE_LIST_QUERY### ###SITE_GET_LIST_QUERY###
|
||||
$this->initSet = true; ###SITE_GET_LIST_QUERY###
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -67,7 +67,7 @@ class ###Component###View###SView### extends JViewLegacy
|
||||
// hide the main menu
|
||||
$this->app->input->set('hidemainmenu', true);
|
||||
// set the title
|
||||
if ($this->item->name)
|
||||
if (isset($this->item->name) && $this->item->name)
|
||||
{
|
||||
$title = $this->item->name;
|
||||
}
|
||||
|
@ -122,7 +122,7 @@ class ###Component###View###View### extends JViewLegacy
|
||||
$document->setTitle(JText::_($isNew ? 'COM_###COMPONENT###_###VIEW###_NEW' : 'COM_###COMPONENT###_###VIEW###_EDIT'));
|
||||
$document->addStyleSheet(JURI::root() . "administrator/components/com_###component###/assets/css/###view###.css");###AJAXTOKE### ###LINKEDVIEWTABLESCRIPTS###
|
||||
$document->addScript(JURI::root() . $this->script);
|
||||
$document->addScript(JURI::root() . "administrator/components/com_###component###/views/###view###/submitbutton.js");
|
||||
$document->addScript(JURI::root() . "administrator/components/com_###component###/views/###view###/submitbutton.js"); ###DOCUMENT_CUSTOM_PHP###
|
||||
JText::script('view not acceptable. Error');
|
||||
}
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ class ###Component###View###View### extends JViewLegacy
|
||||
$document->addStyleSheet(JURI::root()."components/com_###component###/assets/css/###view###.css");###AJAXTOKE### ###LINKEDVIEWTABLESCRIPTS###
|
||||
// default javascript of this view
|
||||
$document->addScript(JURI::root().$this->script);
|
||||
$document->addScript(JURI::root(). "components/com_###component###/views/###view###/submitbutton.js");
|
||||
$document->addScript(JURI::root(). "components/com_###component###/views/###view###/submitbutton.js"); ###DOCUMENT_CUSTOM_PHP###
|
||||
JText::script('view not acceptable. Error');
|
||||
}
|
||||
}
|
||||
|
113
admin/compiler/joomla_3/JViewLegacy_import_custom.php
Normal file
113
admin/compiler/joomla_3/JViewLegacy_import_custom.php
Normal file
@ -0,0 +1,113 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@package Component Builder
|
||||
@subpackage componentbuilder.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
|
||||
@my wife Roline 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
|
||||
|
||||
Builds Complex Joomla Components
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// 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');###LICENSE_LOCKED_DEFINED###
|
||||
|
||||
// import Joomla view library
|
||||
jimport('joomla.application.component.view');
|
||||
|
||||
/**
|
||||
* ###Component### ###View### View
|
||||
*/
|
||||
class ###Component###View###View### extends JViewLegacy
|
||||
{
|
||||
protected $headerList;
|
||||
protected $hasPackage = false;
|
||||
protected $headers;
|
||||
protected $hasHeader = 0;
|
||||
protected $dataType;
|
||||
|
||||
public function display($tpl = null)
|
||||
{
|
||||
if ($this->getLayout() !== 'modal')
|
||||
{
|
||||
// Include helper submenu
|
||||
###Component###Helper::addSubmenu('import');
|
||||
}
|
||||
|
||||
// Check for errors.
|
||||
if (count($errors = $this->get('Errors'))){
|
||||
JError::raiseError(500, implode('<br />', $errors));
|
||||
return false;
|
||||
}
|
||||
|
||||
$paths = new stdClass;
|
||||
$paths->first = '';
|
||||
$state = $this->get('state');
|
||||
|
||||
$this->paths = &$paths;
|
||||
$this->state = &$state;
|
||||
// get global action permissions
|
||||
$this->canDo = ###Component###Helper::getActions('import');
|
||||
|
||||
// We don't need toolbar in the modal window.
|
||||
if ($this->getLayout() !== 'modal')
|
||||
{
|
||||
$this->addToolbar();
|
||||
$this->sidebar = JHtmlSidebar::render();
|
||||
}
|
||||
|
||||
// get the session object
|
||||
$session = JFactory::getSession();
|
||||
// check if it has package
|
||||
$this->hasPackage = $session->get('hasPackage', false);
|
||||
$this->dataType = $session->get('dataType', false);
|
||||
if($this->hasPackage && $this->dataType)
|
||||
{
|
||||
$this->headerList = json_decode($session->get($this->dataType.'_VDM_IMPORTHEADERS', false),true);
|
||||
$this->headers = ###Component###Helper::getFileHeaders($this->dataType);
|
||||
// clear the data type
|
||||
$session->clear('dataType');
|
||||
}
|
||||
|
||||
// Display the template
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setting the toolbar
|
||||
*/
|
||||
protected function addToolBar()
|
||||
{
|
||||
JToolBarHelper::title(JText::_('COM_###COMPONENT###_IMPORT_TITLE'), 'upload');
|
||||
JHtmlSidebar::setAction('index.php?option=com_###component###&view=###view###');
|
||||
|
||||
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
|
||||
{
|
||||
JToolBarHelper::preferences('com_###component###');
|
||||
}
|
||||
|
||||
// set help url for this view if found
|
||||
$help_url = ###Component###Helper::getHelpUrl('###view###');
|
||||
if (###Component###Helper::checkString($help_url))
|
||||
{
|
||||
JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url);
|
||||
}
|
||||
}
|
||||
}
|
@ -46,7 +46,7 @@ $document->addStyleSheet('components/com_###component###/assets/css/admin.css');
|
||||
$document->addScript('components/com_###component###/assets/js/admin.js');
|
||||
|
||||
// require helper files
|
||||
JLoader::register('###Component###Helper', dirname(__FILE__) . '/helpers/###component###.php');
|
||||
JLoader::register('###Component###Helper', dirname(__FILE__) . '/helpers/###component###.php'); ###HELPER_EMAIL###
|
||||
JLoader::register('JHtmlBatch_', dirname(__FILE__) . '/helpers/html/batch_.php');###LICENSE_LOCKED_INT### ###ADMIN_GLOBAL_EVENT###
|
||||
|
||||
// import joomla controller library
|
||||
|
@ -35,7 +35,7 @@ $document->addStyleSheet('components/com_###component###/assets/css/site.css');
|
||||
$document->addScript('components/com_###component###/assets/js/site.js');
|
||||
|
||||
// Require helper files
|
||||
JLoader::register('###Component###Helper', dirname(__FILE__) . '/helpers/###component###.php');
|
||||
JLoader::register('###Component###Helper', dirname(__FILE__) . '/helpers/###component###.php'); ###HELPER_EMAIL###
|
||||
JLoader::register('###Component###HelperRoute', dirname(__FILE__) . '/helpers/route.php');###LICENSE_LOCKED_INT### ###SITE_GLOBAL_EVENT###
|
||||
|
||||
// import joomla controller library
|
||||
|
35
admin/compiler/joomla_3/default_import_custom.php
Normal file
35
admin/compiler/joomla_3/default_import_custom.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||
__ __ _ _____ _ _ __ __ _ _ _
|
||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||
| |
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@package Component Builder
|
||||
@subpackage componentbuilder.php
|
||||
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
|
||||
@my wife Roline 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
|
||||
|
||||
Builds Complex Joomla Components
|
||||
|
||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
// 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');###LICENSE_LOCKED_DEFINED###
|
||||
|
||||
JHtml::_('jquery.framework');
|
||||
JHtml::_('bootstrap.tooltip');
|
||||
JHtml::_('script', 'system/core.js', false, true);
|
||||
?>###IMPORT_DEFAULT_VIEW_CUSTOM###
|
@ -225,6 +225,11 @@
|
||||
"rename": false,
|
||||
"type": "encrypt"
|
||||
},
|
||||
"Helper_email.php": {
|
||||
"path": "c0mp0n3nt/admin/helpers",
|
||||
"rename": "Helper_",
|
||||
"type": "emailer"
|
||||
},
|
||||
"DASHJControllerAdmin.php": {
|
||||
"path": "c0mp0n3nt/admin/controllers",
|
||||
"rename": "DASHJControllerAdmin",
|
||||
@ -460,6 +465,28 @@
|
||||
"rename": false,
|
||||
"type": "import"
|
||||
},
|
||||
"JControllerLegacy_import_custom.php": {
|
||||
"path": "c0mp0n3nt/admin/controllers",
|
||||
"rename": "JControllerLegacy_import_custom",
|
||||
"type": "customimport"
|
||||
},
|
||||
"JModelLegacy_import_custom.php": {
|
||||
"path": "c0mp0n3nt/admin/models",
|
||||
"rename": "JModelLegacy_import_custom",
|
||||
"type": "customimport"
|
||||
},
|
||||
"JViewLegacy_import_custom.php": {
|
||||
"path": "c0mp0n3nt/admin/views/VIEW",
|
||||
"rename": "new",
|
||||
"newName": "view.html.php",
|
||||
"type": "customimport"
|
||||
},
|
||||
"default_import_custom.php": {
|
||||
"path": "c0mp0n3nt/admin/views/VIEW/tmpl",
|
||||
"rename": "new",
|
||||
"newName": "default.php",
|
||||
"type": "customimport"
|
||||
},
|
||||
"JControllerLegacyHelp.php": {
|
||||
"path": "c0mp0n3nt/admin/controllers",
|
||||
"rename": "new",
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage componentbuilder.php
|
||||
@ -44,7 +44,7 @@ $document->addStyleSheet('components/com_componentbuilder/assets/css/admin.css')
|
||||
$document->addScript('components/com_componentbuilder/assets/js/admin.js');
|
||||
|
||||
// require helper files
|
||||
JLoader::register('ComponentbuilderHelper', dirname(__FILE__) . '/helpers/componentbuilder.php');
|
||||
JLoader::register('ComponentbuilderHelper', dirname(__FILE__) . '/helpers/componentbuilder.php');
|
||||
JLoader::register('JHtmlBatch_', dirname(__FILE__) . '/helpers/html/batch_.php');
|
||||
|
||||
// import joomla controller library
|
||||
|
@ -1,6 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<config>
|
||||
<fieldset
|
||||
addrulepath="/administrator/components/com_componentbuilder/models/rules"
|
||||
addfieldpath="/administrator/components/com_componentbuilder/models/fields"
|
||||
name="global_config"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_GLOBAL_LABEL"
|
||||
description="COM_COMPONENTBUILDER_CONFIG_GLOBAL_DESC">
|
||||
@ -28,7 +30,7 @@
|
||||
name="save_history"
|
||||
type="radio"
|
||||
class="btn-group btn-group-yesno"
|
||||
default="0"
|
||||
default="1"
|
||||
label="JGLOBAL_SAVE_HISTORY_OPTIONS_LABEL"
|
||||
description="JGLOBAL_SAVE_HISTORY_OPTIONS_DESC"
|
||||
>
|
||||
@ -466,6 +468,24 @@
|
||||
filter="PATH"
|
||||
message="Error! Please add folder path here."
|
||||
hint="COM_COMPONENTBUILDER_CONFIG_BACKUP_FOLDER_PATH_HINT"
|
||||
/>
|
||||
<!-- Note_git_folder_path Field. Type: Note. A None Database Field. (joomla) -->
|
||||
<field type="note" name="note_git_folder_path" label="COM_COMPONENTBUILDER_CONFIG_NOTE_GIT_FOLDER_PATH_LABEL" description="COM_COMPONENTBUILDER_CONFIG_NOTE_GIT_FOLDER_PATH_DESCRIPTION" heading="h4" class="alert alert-info note_git_folder_path" />
|
||||
<!-- Git_folder_path Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="git_folder_path"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_GIT_FOLDER_PATH_LABEL"
|
||||
size="70"
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_CONFIG_GIT_FOLDER_PATH_DESCRIPTION"
|
||||
class="text_area"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
required="false"
|
||||
filter="PATH"
|
||||
message="Error! Please add folder path here."
|
||||
hint="COM_COMPONENTBUILDER_CONFIG_GIT_FOLDER_PATH_HINT"
|
||||
/>
|
||||
</fieldset>
|
||||
<fieldset
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage controller.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage admin_view.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage admin_views.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage ajax.json.php
|
||||
@ -45,6 +45,7 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
|
||||
// load the tasks
|
||||
$this->registerTask('tableColumns', 'ajax');
|
||||
$this->registerTask('fieldSelectOptions', 'ajax');
|
||||
$this->registerTask('getImportScripts', 'ajax');
|
||||
$this->registerTask('layoutDetails', 'ajax');
|
||||
$this->registerTask('templateDetails', 'ajax');
|
||||
$this->registerTask('snippetDetails', 'ajax');
|
||||
@ -70,6 +71,7 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
|
||||
case 'tableColumns':
|
||||
try
|
||||
{
|
||||
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
|
||||
$tableValue = $jinput->get('table', NULL, 'WORD');
|
||||
if($tableValue && $user->id != 0)
|
||||
{
|
||||
@ -83,6 +85,10 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
|
||||
{
|
||||
echo $_GET['callback'] . "(".json_encode($result).");";
|
||||
}
|
||||
elseif($returnRaw)
|
||||
{
|
||||
echo json_encode($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "(".json_encode($result).");";
|
||||
@ -103,6 +109,7 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
|
||||
case 'fieldSelectOptions':
|
||||
try
|
||||
{
|
||||
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
|
||||
$idValue = $jinput->get('id', NULL, 'INT');
|
||||
if($idValue && $user->id != 0)
|
||||
{
|
||||
@ -116,6 +123,48 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
|
||||
{
|
||||
echo $_GET['callback'] . "(".json_encode($result).");";
|
||||
}
|
||||
elseif($returnRaw)
|
||||
{
|
||||
echo json_encode($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "(".json_encode($result).");";
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
if(array_key_exists('callback',$_GET))
|
||||
{
|
||||
echo $_GET['callback']."(".json_encode($e).");";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "(".json_encode($e).");";
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'getImportScripts':
|
||||
try
|
||||
{
|
||||
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
|
||||
$typeValue = $jinput->get('type', NULL, 'WORD');
|
||||
if($typeValue && $user->id != 0)
|
||||
{
|
||||
$result = $this->getModel('ajax')->getImportScripts($typeValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = false;
|
||||
}
|
||||
if(array_key_exists('callback',$_GET))
|
||||
{
|
||||
echo $_GET['callback'] . "(".json_encode($result).");";
|
||||
}
|
||||
elseif($returnRaw)
|
||||
{
|
||||
echo json_encode($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "(".json_encode($result).");";
|
||||
@ -136,6 +185,7 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
|
||||
case 'layoutDetails':
|
||||
try
|
||||
{
|
||||
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
|
||||
$idValue = $jinput->get('id', null, 'INT');
|
||||
if($idValue && $user->id != 0)
|
||||
{
|
||||
@ -149,6 +199,10 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
|
||||
{
|
||||
echo $_GET['callback'] . "(".json_encode($result).");";
|
||||
}
|
||||
elseif($returnRaw)
|
||||
{
|
||||
echo json_encode($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "(".json_encode($result).");";
|
||||
@ -169,6 +223,7 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
|
||||
case 'templateDetails':
|
||||
try
|
||||
{
|
||||
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
|
||||
$idValue = $jinput->get('id', null, 'INT');
|
||||
if($idValue && $user->id != 0)
|
||||
{
|
||||
@ -182,6 +237,10 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
|
||||
{
|
||||
echo $_GET['callback'] . "(".json_encode($result).");";
|
||||
}
|
||||
elseif($returnRaw)
|
||||
{
|
||||
echo json_encode($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "(".json_encode($result).");";
|
||||
@ -202,6 +261,7 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
|
||||
case 'snippetDetails':
|
||||
try
|
||||
{
|
||||
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
|
||||
$idValue = $jinput->get('id', NULL, 'INT');
|
||||
if($idValue && $user->id != 0)
|
||||
{
|
||||
@ -215,6 +275,10 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
|
||||
{
|
||||
echo $_GET['callback'] . "(".json_encode($result).");";
|
||||
}
|
||||
elseif($returnRaw)
|
||||
{
|
||||
echo json_encode($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "(".json_encode($result).");";
|
||||
@ -235,6 +299,7 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
|
||||
case 'dynamicValues':
|
||||
try
|
||||
{
|
||||
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
|
||||
$idValue = $jinput->get('id', NULL, 'INT');
|
||||
$viewValue = $jinput->get('view', NULL, 'WORD');
|
||||
if($idValue && $viewValue && $user->id != 0)
|
||||
@ -249,6 +314,10 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
|
||||
{
|
||||
echo $_GET['callback'] . "(".json_encode($result).");";
|
||||
}
|
||||
elseif($returnRaw)
|
||||
{
|
||||
echo json_encode($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "(".json_encode($result).");";
|
||||
@ -269,6 +338,7 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
|
||||
case 'dynamicFormDetails':
|
||||
try
|
||||
{
|
||||
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
|
||||
$idValue = $jinput->get('id', NULL, 'INT');
|
||||
if($idValue && $user->id != 0)
|
||||
{
|
||||
@ -282,6 +352,10 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
|
||||
{
|
||||
echo $_GET['callback'] . "(".json_encode($result).");";
|
||||
}
|
||||
elseif($returnRaw)
|
||||
{
|
||||
echo json_encode($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "(".json_encode($result).");";
|
||||
@ -302,6 +376,7 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
|
||||
case 'dbTableColumns':
|
||||
try
|
||||
{
|
||||
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
|
||||
$nameValue = $jinput->get('name', NULL, 'WORD');
|
||||
$asValue = $jinput->get('as', NULL, 'WORD');
|
||||
$typeValue = $jinput->get('type', NULL, 'INT');
|
||||
@ -317,6 +392,10 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
|
||||
{
|
||||
echo $_GET['callback'] . "(".json_encode($result).");";
|
||||
}
|
||||
elseif($returnRaw)
|
||||
{
|
||||
echo json_encode($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "(".json_encode($result).");";
|
||||
@ -337,6 +416,7 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
|
||||
case 'viewTableColumns':
|
||||
try
|
||||
{
|
||||
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
|
||||
$idValue = $jinput->get('id', NULL, 'INT');
|
||||
$asValue = $jinput->get('as', NULL, 'WORD');
|
||||
$typeValue = $jinput->get('type', NULL, 'INT');
|
||||
@ -352,6 +432,10 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
|
||||
{
|
||||
echo $_GET['callback'] . "(".json_encode($result).");";
|
||||
}
|
||||
elseif($returnRaw)
|
||||
{
|
||||
echo json_encode($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "(".json_encode($result).");";
|
||||
@ -372,6 +456,7 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
|
||||
case 'fieldOptions':
|
||||
try
|
||||
{
|
||||
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
|
||||
$idValue = $jinput->get('id', NULL, 'INT');
|
||||
if($idValue && $user->id != 0)
|
||||
{
|
||||
@ -385,6 +470,10 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
|
||||
{
|
||||
echo $_GET['callback'] . "(".json_encode($result).");";
|
||||
}
|
||||
elseif($returnRaw)
|
||||
{
|
||||
echo json_encode($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "(".json_encode($result).");";
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage compiler.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage component.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage componentbuilder.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage components.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage custom_admin_view.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage custom_admin_views.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage dynamic_get.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage dynamic_gets.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage field.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage fields.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage fieldtype.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage fieldtypes.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage help.php
|
||||
@ -115,10 +115,10 @@ class ComponentbuilderControllerHelp extends JControllerLegacy
|
||||
$text[] = '<div class="uk-container uk-container-center uk-grid-collapse">';
|
||||
$text[] = '<div class="uk-panel uk-width-1-1 uk-panel-box uk-panel-box-primary">';
|
||||
// build the help text
|
||||
$text[] = '<h3 class="uk-panel-title">'.$document->title."</h3>";
|
||||
$text[] = '<h1 class="uk-panel-title">'.$document->title."</h1>";
|
||||
$text[] = str_replace(array_keys($images),array_values($images),$document->content);
|
||||
// end template
|
||||
$text[] = '</div>';
|
||||
$text[] = '</div><br /><br />';
|
||||
$text[] = '</div>';
|
||||
$text[] = "</body>";
|
||||
$text[] = "</html>";
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage help_document.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage help_documents.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage import.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage layout.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage layouts.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage site_view.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage site_views.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage snippet.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage snippets.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage template.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.1
|
||||
@build 1st March, 2016
|
||||
@version 2.1.5
|
||||
@build 4th May, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage templates.php
|
||||
|
@ -7,8 +7,8 @@
|
||||
*
|
||||
**/
|
||||
|
||||
// No direct access.
|
||||
defined('_JEXEC') or die;
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
class Chartbuilder
|
||||
{
|
||||
|
4
admin/custom/footable2/LICENSE
Normal file
4
admin/custom/footable2/LICENSE
Normal file
@ -0,0 +1,4 @@
|
||||
Copyright 2012 Steven Usher & Brad Vincent
|
||||
|
||||
Released under the MIT license
|
||||
You are free to use FooTable in commercial projects as long as this copyright header is left intact.
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user