first commit
This commit is contained in:
@@ -0,0 +1,135 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Convert Forms
|
||||
* @version 3.2.12 Free
|
||||
*
|
||||
* @author Tassos Marinos <info@tassos.gr>
|
||||
* @link http://www.tassos.gr
|
||||
* @copyright Copyright © 2020 Tassos Marinos All Rights Reserved
|
||||
* @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> or later
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
|
||||
HTMLHelper::_('bootstrap.modal');
|
||||
|
||||
JHtml::_('bootstrap.popover');
|
||||
|
||||
?>
|
||||
|
||||
<div class="row-fluid">
|
||||
<?php if (!defined('nrJ4')) { ?>
|
||||
<div id="j-sidebar-container" class="span2">
|
||||
<?php echo $this->sidebar; ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div id="j-main-container">
|
||||
|
||||
<div class="cf-addons-container">
|
||||
<h2>
|
||||
<?php echo JText::_("COM_CONVERTFORMS") ?>
|
||||
<?php echo JText::_("COM_CONVERTFORMS_ADDONS") ?>
|
||||
</h2>
|
||||
<p><?php echo JText::_("COM_CONVERTFORMS_ADDONS_DESC") ?></p>
|
||||
<div class="cf-addons">
|
||||
<?php foreach ($this->availableAddons as $key => $item) { ?>
|
||||
<div class="cf-addon">
|
||||
<div class="cf-addon-wrap">
|
||||
<div class="cf-addon-img">
|
||||
<img alt="<?php echo $item["label"]; ?>" src="<?php echo $item["image"]; ?>"/>
|
||||
</div>
|
||||
<div class="cf-addon-text">
|
||||
<h3><?php echo $item["label"]; ?></h3>
|
||||
<?php echo $item["description"]; ?>
|
||||
</div>
|
||||
<div class="cf-addon-action text-center">
|
||||
|
||||
|
||||
<?php
|
||||
if (!$item['comingsoon'] && $item['proonly'] === true)
|
||||
{
|
||||
NRFramework\HTML::renderProButton(JText::_($item['label']));
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<?php if ($item['comingsoon']) { ?>
|
||||
<?php echo JText::_('NR_ROADMAP'); ?>
|
||||
<?php } ?>
|
||||
|
||||
<?php if (!$item['comingsoon'] && $item['extensionid']) { ?>
|
||||
|
||||
<?php
|
||||
$optionsURL = JURI::base(true) . '/index.php?option=com_plugins&view=plugin&tmpl=component&layout=modal&extension_id=' . $item['extensionid'];
|
||||
$modalName = 'cfPluginModal-' . $item['extensionid'];
|
||||
?>
|
||||
|
||||
<a class="btn btn-sm btn-secondary"
|
||||
data-toggle="modal"
|
||||
data-bs-toggle="modal"
|
||||
href="#<?php echo $modalName ?>"
|
||||
role="button"
|
||||
title="<?php echo JText::_("JOPTIONS") ?>">
|
||||
<span class="icon-options"></span>
|
||||
</a>
|
||||
|
||||
<?php
|
||||
$options = [
|
||||
'title' => JText::_('GSD_INTEGRATION_EDIT'),
|
||||
'url' => $optionsURL,
|
||||
'height' => '400px',
|
||||
'backdrop' => 'static',
|
||||
'bodyHeight' => '70',
|
||||
'modalWidth' => '70',
|
||||
'footer' => '<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" data-dismiss="modal" aria-hidden="true">'
|
||||
. JText::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</button>
|
||||
<button type="button" class="btn btn-primary" aria-hidden="true"
|
||||
onclick="jQuery(\'#' . $modalName . ' iframe\').contents().find(\'#saveBtn\').click();">'
|
||||
. JText::_('JSAVE') . '</button>
|
||||
<button type="button" class="btn btn-success" aria-hidden="true"
|
||||
onclick="jQuery(\'#' . $modalName . ' iframe\').contents().find(\'#applyBtn\').click();">'
|
||||
. JText::_('JAPPLY') . '</button>',
|
||||
];
|
||||
|
||||
echo JHtml::_('bootstrap.renderModal', $modalName, $options);
|
||||
?>
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
$docsURL = 'https://www.tassos.gr/joomla-extensions/convert-forms//docs/' . $item['docalias'];
|
||||
?>
|
||||
|
||||
<a class="btn btn-sm btn-secondary" href="<?php echo $docsURL; ?>" target="_blank" title="<?php echo JText::_("NR_DOCUMENTATION") ?>">
|
||||
<span class="icon-info"></span>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="cf-addon">
|
||||
<div class="cf-addon-wrap">
|
||||
<div class="cf-addon-img">
|
||||
<a target="_blank" target="_blank" href="https://www.tassos.gr/contact">
|
||||
<img alt="<?php echo $item["description"]; ?>" src="https://static.tassos.gr/images/integrations/addon.png"/>
|
||||
</a>
|
||||
</div>
|
||||
<div class="cf-addon-text">
|
||||
<h3><?php echo JText::_("COM_CONVERTFORMS_ADDONS_MISSING_ADDON") ?></h3>
|
||||
<?php echo JText::_("COM_CONVERTFORMS_ADDONS_MISSING_ADDON_DESC") ?>
|
||||
</div>
|
||||
<div class="cf-addon-action text-center">
|
||||
<a class="btn btn-sm btn-primary" target="_blank" href="https://www.tassos.gr/contact"><?php echo JText::_("NR_CONTACT_US")?></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include_once(JPATH_COMPONENT_ADMINISTRATOR."/layouts/footer.php"); ?>
|
||||
@@ -0,0 +1,135 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Convert Forms
|
||||
* @version 3.2.12 Free
|
||||
*
|
||||
* @author Tassos Marinos <info@tassos.gr>
|
||||
* @link http://www.tassos.gr
|
||||
* @copyright Copyright © 2020 Tassos Marinos All Rights Reserved
|
||||
* @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> or later
|
||||
*/
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla view library
|
||||
jimport('joomla.application.component.view');
|
||||
|
||||
/**
|
||||
* Addons View
|
||||
*/
|
||||
class ConvertFormsViewAddons extends JViewLegacy
|
||||
{
|
||||
/**
|
||||
* Items view display method
|
||||
*
|
||||
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
|
||||
*
|
||||
* @return mixed A string if successful, otherwise a JError object.
|
||||
*/
|
||||
function display($tpl = null)
|
||||
{
|
||||
// Access check.
|
||||
ConvertForms\Helper::authorise('convertforms.addons.manage', true);
|
||||
|
||||
$this->config = JComponentHelper::getParams('com_convertforms');
|
||||
|
||||
ConvertForms\Helper::addSubmenu('addons');
|
||||
$this->sidebar = JHtmlSidebar::render();
|
||||
$this->availableAddons = $this->getAddons();
|
||||
|
||||
// Check for errors.
|
||||
if (!is_null($this->get('Errors')) && count($errors = $this->get('Errors')))
|
||||
{
|
||||
JFactory::getApplication()->enqueueMessage(implode("\n", $errors), 'error');
|
||||
return false;
|
||||
}
|
||||
|
||||
// Set the toolbar
|
||||
$this->addToolBar();
|
||||
|
||||
// Display the template
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get list of all available addons
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function getAddons()
|
||||
{
|
||||
// Load XML file
|
||||
$xmlfile = JPATH_COMPONENT_ADMINISTRATOR . '/ConvertForms/xml/addons.xml';
|
||||
|
||||
if (!JFile::exists($xmlfile))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$xmlItems = simplexml_load_file($xmlfile))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$addons = [];
|
||||
|
||||
foreach ($xmlItems as $key => $item)
|
||||
{
|
||||
$item = (array) $item;
|
||||
$item = new JRegistry($item["@attributes"]);
|
||||
|
||||
$extensionType = $item->get("extension_type", "plugin");
|
||||
$extensionFolder = $item->get("extension_folder", "convertforms");
|
||||
$extensionName = $item->get("name");
|
||||
$extensionID = NRFramework\Extension::getID($extensionName, $extensionType, $extensionFolder);
|
||||
$backEndURL = "";
|
||||
|
||||
if ($extensionID)
|
||||
{
|
||||
if ($extensionType == "plugin")
|
||||
{
|
||||
$backEndURL = "index.php?option=com_plugins&task=plugin.edit&extension_id=" . $extensionID;
|
||||
}
|
||||
}
|
||||
|
||||
$url = $item->get("customurl") ?: NRFramework\Functions::getUTMURL($item->get("url", "https://www.tassos.gr/joomla-extensions/convert-forms/"));
|
||||
|
||||
$obj = array(
|
||||
"name" => $extensionName,
|
||||
"label" => $item->get("label"),
|
||||
"description" => $item->get("description"),
|
||||
"image" => $item->get("image"),
|
||||
"url" => $url,
|
||||
"customlabel" => $item->get("customlabel"),
|
||||
"docalias" => $item->get("docalias"),
|
||||
"extensionid" => $extensionID,
|
||||
"backendurl" => JURI::base() . $backEndURL,
|
||||
"proonly" => $item->get("proonly", true),
|
||||
"comingsoon" => $item->get("comingsoon", false)
|
||||
);
|
||||
|
||||
$addons[] = $obj;
|
||||
}
|
||||
|
||||
asort($addons);
|
||||
|
||||
return $addons;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add Toolbar to layout
|
||||
*/
|
||||
protected function addToolBar()
|
||||
{
|
||||
$canDo = ConvertForms\Helper::getActions();
|
||||
|
||||
JToolBarHelper::title(JText::_('COM_CONVERTFORMS') . ": " . JText::_('COM_CONVERTFORMS_ADDONS'), "puzzle");
|
||||
|
||||
if ($canDo->get('core.admin'))
|
||||
{
|
||||
JToolbarHelper::preferences('com_convertforms');
|
||||
}
|
||||
|
||||
JToolbarHelper::help("Help", false, "http://www.tassos.gr/joomla-extensions/convert-forms/docs");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user