first commit
This commit is contained in:
22
components/com_convertforms/views/form/tmpl/default.php
Normal file
22
components/com_convertforms/views/form/tmpl/default.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?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;
|
||||
|
||||
?>
|
||||
|
||||
<?php if ($this->params->get('show_page_heading')) { ?>
|
||||
<h1>
|
||||
<?php echo $this->escape($this->params->get('page_heading', $this->params->get('page_title'))); ?>
|
||||
</h1>
|
||||
<?php } ?>
|
||||
|
||||
<?php echo $this->item; ?>
|
||||
18
components/com_convertforms/views/form/tmpl/default.xml
Normal file
18
components/com_convertforms/views/form/tmpl/default.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<metadata>
|
||||
<layout title="COM_CONVERTFORMS_FORM" option="JDEFAULT">
|
||||
<help key="COM_CONVERTFORMS_FORM_DESC"/>
|
||||
<message>
|
||||
<![CDATA[COM_CONVERTFORMS_FORM_DESC]]>
|
||||
</message>
|
||||
</layout>
|
||||
<fields name="params" addfieldpath="administrator/components/com_convertforms/models/forms/fields">
|
||||
<fieldset name="options" label="Options">
|
||||
<field name="form_id" type="convertforms"
|
||||
label="COM_CONVERTFORMS_SELECT_FORM"
|
||||
description="COM_CONVERTFORMS_SELECT_FORM_DESC2"
|
||||
required="true"
|
||||
/>
|
||||
</fieldset>
|
||||
</fields>
|
||||
</metadata>
|
||||
69
components/com_convertforms/views/form/view.html.php
Normal file
69
components/com_convertforms/views/form/view.html.php
Normal file
@@ -0,0 +1,69 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* Content categories view.
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
class ConvertFormsViewForm extends JViewLegacy
|
||||
{
|
||||
/**
|
||||
* Display the Hello World view
|
||||
*
|
||||
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function display($tpl = null)
|
||||
{
|
||||
$this->item = $this->get('Item');
|
||||
$this->params = JFactory::getApplication()->getParams();
|
||||
|
||||
$this->_prepareDocument();
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepares the document
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function _prepareDocument()
|
||||
{
|
||||
$doc = \JFactory::getDocument();
|
||||
$app = \JFactory::getApplication();
|
||||
$activeMenuItem = $app->getMenu()->getActive();
|
||||
$params = $activeMenuItem->getParams();
|
||||
|
||||
if ($robots_value = $params->get('robots'))
|
||||
{
|
||||
$robots = $doc->getMetaData('robots');
|
||||
$robots = empty($robots) ? $robots_value : $robots . ', ' . $robots_value;
|
||||
|
||||
$doc->setMetaData('robots', $robots);
|
||||
}
|
||||
|
||||
if ($params->get('menu-meta_keywords'))
|
||||
{
|
||||
$doc->setMetadata('keywords', $params->get('menu-meta_keywords'));
|
||||
}
|
||||
|
||||
if ($params->get('menu-meta_description'))
|
||||
{
|
||||
$doc->setDescription($params->get('menu-meta_description'));
|
||||
}
|
||||
}
|
||||
}
|
||||
107
components/com_convertforms/views/submission/tmpl/default.php
Normal file
107
components/com_convertforms/views/submission/tmpl/default.php
Normal file
@@ -0,0 +1,107 @@
|
||||
<?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;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Router\Route;
|
||||
|
||||
if ($this->params->get('load_css', true))
|
||||
{
|
||||
JHtml::stylesheet('com_convertforms/submissions.css', ['relative' => true, 'version' => 'auto']);
|
||||
}
|
||||
|
||||
$print_view = JFactory::getApplication()->input->get('print') == 1;
|
||||
|
||||
if ($print_view)
|
||||
{
|
||||
JFactory::getDocument()->addScriptDeclaration('
|
||||
window.print();
|
||||
');
|
||||
}
|
||||
|
||||
$print_link = Route::link('site', 'index.php?option=com_convertforms&view=submission&id=' . $this->submission->id . '&tmpl=component&print=1&Itemid=' . Factory::getApplication()->input->get('Itemid'));
|
||||
|
||||
?>
|
||||
<div class="convertforms-submissions item <?php echo $print_view ? 'print' : '' ?>">
|
||||
<h1><?php echo JText::_('COM_CONVERTFORMS_SUBMISSION') ?> #<?php echo $this->submission->id ?></h1>
|
||||
|
||||
<?php if (!$print_view) { ?>
|
||||
<p>
|
||||
<a target="_blank" href="<?php echo $print_link ?>">
|
||||
Print
|
||||
</a>
|
||||
<p>
|
||||
<?php } ?>
|
||||
<div class="submission_section submission_info">
|
||||
<h3><?php echo JText::_('COM_CONVERTFORMS_LEAD_INFO') ?></h3>
|
||||
<table>
|
||||
<tr class="cfs-id">
|
||||
<th><?php echo JText::_('COM_CONVERTFORMS_ID') ?></th>
|
||||
<td><?php echo $this->submission->id ?></td>
|
||||
</tr>
|
||||
<tr class="cfs-state">
|
||||
<th><?php echo JText::_('JSTATUS') ?></th>
|
||||
<td>
|
||||
<span class="badge <?php echo ($this->submission->state == '1' ? 'badge-success bg-success' : (defined('nrJ4') ? 'badge-danger bg-danger' : 'important')) ?>">
|
||||
<?php echo JText::_(($this->submission->state == '1' ? 'COM_CONVERTFORMS_SUBMISSION_CONFIRMED' : 'COM_CONVERTFORMS_SUBMISSION_UNCONFIRMED')) ?>
|
||||
</span>
|
||||
<?php
|
||||
if (isset($this->submission->params['sync_error'])) {
|
||||
echo $this->submission->params['sync_error'];
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="cfs-dated-created">
|
||||
<th><?php echo JText::_('COM_CONVERTFORMS_CREATED') ?></th>
|
||||
<td><?php echo $this->submission->created ?></td>
|
||||
</tr>
|
||||
<tr class="cfs-date-modified">
|
||||
<th><?php echo JText::_('COM_CONVERTFORMS_MODIFIED') ?></th>
|
||||
<td><?php echo $this->submission->modified ?></td>
|
||||
</tr>
|
||||
<tr class="cfs-form">
|
||||
<th><?php echo JText::_('COM_CONVERTFORMS_FORM_NAME') ?></th>
|
||||
<td><?php echo $this->submission->form->name ?></td>
|
||||
</tr>
|
||||
<tr class="cfs-user">
|
||||
<th>User</th>
|
||||
<td><?php echo isset($this->submission->user_name) ? $this->submission->user_name : $this->submission->user_id ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
JPluginHelper::importPlugin('convertformstools');
|
||||
JFactory::getApplication()->triggerEvent('onConvertFormsFrontSubmissionViewInfo', array($this->submission));
|
||||
?>
|
||||
</table>
|
||||
</div>
|
||||
<div class="submission_section submission_info">
|
||||
<h3><?php echo JText::_('COM_CONVERTFORMS_LEAD_USER_SUBMITTED_DATA') ?></h3>
|
||||
<?php if (count($this->submission->fields)) { ?>
|
||||
<table>
|
||||
<?php foreach ($this->submission->fields as $field) { ?>
|
||||
<tr class="cfs-<?php echo $field->options->get('name') ?>">
|
||||
<th><?php echo $field->class->getLabel() ?></th>
|
||||
<td><?php echo $field->value_html ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
<?php } else { ?>
|
||||
<p><?php echo JText::_('COM_CONVERTFORMS_NO_SUBMITTED_DATA') ?></p>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<?php if (!$print_view) { ?>
|
||||
<a href="<?php echo $this->submissions_link ?>">
|
||||
<?php echo JText::_('COM_CONVERTFORMS_SUBMISSIONS_LIST') ?>
|
||||
</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
92
components/com_convertforms/views/submission/view.html.php
Normal file
92
components/com_convertforms/views/submission/view.html.php
Normal file
@@ -0,0 +1,92 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* Content categories view.
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
class ConvertFormsViewSubmission extends JViewLegacy
|
||||
{
|
||||
/**
|
||||
* Display the Hello World view
|
||||
*
|
||||
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function display($tpl = null)
|
||||
{
|
||||
if (!$this->submission = $this->get('Item'))
|
||||
{
|
||||
JFactory::getApplication()->enqueueMessage(JText::_('COM_CONVERTFORMS_SUBMISSION_INVALID'), 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
$this->_prepareDocument();
|
||||
|
||||
$this->params = JFactory::getApplication()->getParams();
|
||||
|
||||
// Layout checks
|
||||
if ($this->params->get('layout_type', 'file') == 'custom')
|
||||
{
|
||||
$layout = $this->params->get('layout_details');
|
||||
$layout = \Joomla\CMS\HTML\HTMLHelper::_('content.prepare', $layout);
|
||||
|
||||
if (!empty($layout))
|
||||
{
|
||||
echo ConvertForms\Submission::replaceSmartTags($this->submission, $layout);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$this->menu = $this->get('Menu');
|
||||
$this->submissions_link = JRoute::_('index.php?option=com_convertforms&view=submissions&Itemid=' . $this->menu->id);
|
||||
|
||||
// Display the view
|
||||
$this->setLayout($this->params->get('submissions_layout'));
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepares the document
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function _prepareDocument()
|
||||
{
|
||||
$doc = \JFactory::getDocument();
|
||||
$app = \JFactory::getApplication();
|
||||
$activeMenuItem = $app->getMenu()->getActive();
|
||||
$params = $activeMenuItem->getParams();
|
||||
|
||||
if ($robots_value = $params->get('robots'))
|
||||
{
|
||||
$robots = $doc->getMetaData('robots');
|
||||
$robots = empty($robots) ? $robots_value : $robots . ', ' . $robots_value;
|
||||
|
||||
$doc->setMetaData('robots', $robots);
|
||||
}
|
||||
|
||||
if ($params->get('menu-meta_keywords'))
|
||||
{
|
||||
$doc->setMetadata('keywords', $params->get('menu-meta_keywords'));
|
||||
}
|
||||
|
||||
if ($params->get('menu-meta_description'))
|
||||
{
|
||||
$doc->setDescription($params->get('menu-meta_description'));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?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;
|
||||
|
||||
if ($this->params->get('load_css', true))
|
||||
{
|
||||
JHtml::stylesheet('com_convertforms/submissions.css', ['relative' => true, 'version' => 'auto']);
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="convertforms-submissions list">
|
||||
<?php if ($this->params->get('show_page_heading')) { ?>
|
||||
<h1><?php echo $this->params->get('page_heading', $this->params->get('page_title')) ?></h1>
|
||||
<?php } ?>
|
||||
<?php echo $this->loadTemplate(count($this->submissions) ? 'list' : 'noresults'); ?>
|
||||
</div>
|
||||
123
components/com_convertforms/views/submissions/tmpl/default.xml
Normal file
123
components/com_convertforms/views/submissions/tmpl/default.xml
Normal file
@@ -0,0 +1,123 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<metadata>
|
||||
<layout title="COM_CONVERTFORMS_SUBMISSIONS" option="JDEFAULT">
|
||||
<help key="COM_CONVERTFORMS_SUBMISSIONS_DESC"/>
|
||||
<message>
|
||||
<![CDATA[COM_CONVERTFORMS_SUBMISSIONS_DESC]]>
|
||||
</message>
|
||||
</layout>
|
||||
|
||||
<!-- Add fields to the request variables for the layout. -->
|
||||
<fields name="request">
|
||||
<fieldset name="request" addfieldpath="plugins/system/nrframework/fields">
|
||||
</fieldset>
|
||||
</fields>
|
||||
|
||||
<fields name="params" addfieldpath="administrator/components/com_convertforms/models/forms/fields">
|
||||
<fieldset name="options" label="Options">
|
||||
<field name="form_id" type="convertforms"
|
||||
label="COM_CONVERTFORMS_SELECT_FORM"
|
||||
description="COM_CONVERTFORMS_SELECT_FORM_DESC"
|
||||
required="true"
|
||||
/>
|
||||
<field name="filter_user" type="list"
|
||||
label="COM_CONVERTFORMS_FILTER_USER"
|
||||
description="COM_CONVERTFORMS_FILTER_USER_DESC"
|
||||
default="current">
|
||||
<option value="current">COM_CONVERTFORMS_FILTER_USER_LOGGED_IN</option>
|
||||
<option value="all">COM_CONVERTFORMS_FILTER_USER_ALL</option>
|
||||
<option value="specific">COM_CONVERTFORMS_FILTER_USER_SELECT</option>
|
||||
</field>
|
||||
<field name="user_ids" type="text"
|
||||
label="COM_CONVERTFORMS_SET_USERS"
|
||||
description="COM_CONVERTFORMS_SET_USERS_DESC"
|
||||
showon="filter_user:specific"
|
||||
hint="1,2,3"
|
||||
/>
|
||||
<field name="view_own_only" type="nrtoggle"
|
||||
label="COM_CONVERTFORMS_FRONT_SUBMISSIONS_VIEW_OWN_ONLY"
|
||||
description="COM_CONVERTFORMS_FRONT_SUBMISSIONS_VIEW_OWN_ONLY_DESC"
|
||||
checked="true"
|
||||
showon="filter_user:all,specific"
|
||||
/>
|
||||
<field name="confirmed_only" type="nrtoggle"
|
||||
label="COM_CONVERTFORMS_FRONT_SUBMISSIONS_CONFIRMED_ONLY"
|
||||
description="COM_CONVERTFORMS_FRONT_SUBMISSIONS_CONFIRMED_ONLY_DESC"
|
||||
/>
|
||||
<field name="list_limit" type="number"
|
||||
label="COM_CONVERTFORMS_LIST_LIMIT"
|
||||
description="COM_CONVERTFORMS_LIST_LIMIT_DESC"
|
||||
default="20"
|
||||
min="0"
|
||||
/>
|
||||
<field name="show_pagination" type="nrtoggle"
|
||||
label="COM_CONVERTFORMS_FRONT_SUBMISSIONS_PAGINATION"
|
||||
description="COM_CONVERTFORMS_FRONT_SUBMISSIONS_PAGINATION_DESC"
|
||||
checked="true"
|
||||
/>
|
||||
<field name="ordering" type="list"
|
||||
label="COM_CONVERTFORMS_ORDER"
|
||||
description="COM_CONVERTFORMS_ORDER_DESC"
|
||||
default="recent">
|
||||
<option value="recent">COM_CONVERTFORMS_ORDER_RECENT</option>
|
||||
<option value="oldest">COM_CONVERTFORMS_ORDER_OLDEST</option>
|
||||
<option value="random">COM_CONVERTFORMS_ORDER_RANDOM</option>
|
||||
</field>
|
||||
<field name="hide_empty_values" type="nrtoggle"
|
||||
label="COM_CONVERTFORMS_HIDE_EMPTY_VALUES"
|
||||
description="COM_CONVERTFORMS_HIDE_EMPTY_VALUES_DESC"
|
||||
/>
|
||||
<field name="load_css" type="nrtoggle"
|
||||
label="COM_CONVERTFORMS_LOAD_CSS"
|
||||
description="COM_CONVERTFORMS_LOAD_CSS_DESC"
|
||||
checked="true"
|
||||
/>
|
||||
</fieldset>
|
||||
<fieldset name="layouts" label="Layouts">
|
||||
<field name="layout_type" type="radio"
|
||||
label="COM_CONVERTFORMS_SUBMISSIONS_LAYOUT_TYPE"
|
||||
description="COM_CONVERTFORMS_SUBMISSIONS_LAYOUT_TYPE_DESC"
|
||||
default="template"
|
||||
class="btn-group btn-group-yesno">
|
||||
<option value="template">COM_CONVERTFORMS_SUBMISSIONS_TEMPLATE</option>
|
||||
<option value="custom">NR_CUSTOM</option>
|
||||
</field>
|
||||
<field name="submissions_layout" type="componentlayout"
|
||||
label="COM_CONVERTFORMS_SUBMISSIONS_SELECT_TEMPLATE"
|
||||
description="COM_CONVERTFORMS_SUBMISSIONS_SELECT_TEMPLATE_DESC"
|
||||
extension="com_convertforms"
|
||||
view="submissions"
|
||||
showon="layout_type:template"
|
||||
/>
|
||||
<field name="layout_container" type="editor"
|
||||
label="COM_CONVERTFORMS_SUBMISSIONS_CONTAINER_LAYOUT"
|
||||
description="COM_CONVERTFORMS_SUBMISSIONS_CONTAINER_LAYOUT_DESC"
|
||||
showon="layout_type:custom"
|
||||
editor="codemirror"
|
||||
filter="raw"
|
||||
default="<ul>{submissions}</ul><div class='pagination'>{pagination.links}</div>"
|
||||
/>
|
||||
<field name="layout_row" type="editor"
|
||||
label="COM_CONVERTFORMS_SUBMISSIONS_ROW_LAYOUT"
|
||||
description="COM_CONVERTFORMS_SUBMISSIONS_ROW_LAYOUT_DESC"
|
||||
showon="layout_type:custom"
|
||||
editor="codemirror"
|
||||
filter="raw"
|
||||
default="<li><a href='{link}'>{submission.id}</a> {submission.date}</li>"
|
||||
/>
|
||||
<field name="layout_details" type="editor"
|
||||
label="COM_CONVERTFORMS_SUBMISSIONS_DETAILS_LAYOUT"
|
||||
description="COM_CONVERTFORMS_SUBMISSIONS_DETAILS_LAYOUT_DESC"
|
||||
filter="raw"
|
||||
rows="10"
|
||||
editor="codemirror"
|
||||
showon="layout_type:custom"
|
||||
/>
|
||||
<field name="i" type="nr_freetext"
|
||||
path="/components/com_convertforms/views/submissions/tmpl/"
|
||||
file="smarttags"
|
||||
showon="layout_type:custom"
|
||||
/>
|
||||
</fieldset>
|
||||
</fields>
|
||||
</metadata>
|
||||
@@ -0,0 +1,54 @@
|
||||
<?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;
|
||||
?>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo JText::_('COM_CONVERTFORMS_ID') ?></th>
|
||||
<th><?php echo JText::_('COM_CONVERTFORMS_CREATED') ?></th>
|
||||
<th><?php echo JText::_('JSTATUS') ?></th>
|
||||
<th width="70px"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php foreach ($this->submissions as $submission) { ?>
|
||||
<tr>
|
||||
<td><a href="<?php echo $submission->link ?>"><?php echo $submission->id ?></a></td>
|
||||
<td><?php echo $submission->created ?></td>
|
||||
<td>
|
||||
<?php
|
||||
$badge = 'bg-' . ($submission->state == '1' ? 'success' : 'danger');
|
||||
|
||||
if (!defined('nrJ4'))
|
||||
{
|
||||
$badge = 'badge-' . ($submission->state == '1' ? 'success' : 'important');
|
||||
}
|
||||
?>
|
||||
|
||||
<span class="badge <?php echo $badge ?>">
|
||||
<?php echo JText::_(($submission->state == '1' ? 'COM_CONVERTFORMS_SUBMISSION_CONFIRMED' : 'COM_CONVERTFORMS_SUBMISSION_UNCONFIRMED')) ?>
|
||||
</span>
|
||||
</td>
|
||||
<td><a class="btn btn-secondary btn-small" href="<?php echo $submission->link ?>">View</a></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
|
||||
<?php if ($this->pagination && $pagination = $this->pagination->getPagesLinks()) { ?>
|
||||
<div class="pagination">
|
||||
<?php echo $pagination; ?>
|
||||
<div class="pagecounter">
|
||||
<?php echo $this->pagination->getPagesCounter(); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?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;
|
||||
?>
|
||||
|
||||
<p><?php echo JText::sprintf('COM_CONVERTFORMS_NO_RESULTS_FOUND', JText::_('COM_CONVERTFORMS_SUBMISSIONS')) ?></p>
|
||||
@@ -0,0 +1,82 @@
|
||||
<?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();
|
||||
|
||||
$groups = [
|
||||
'Container Layout' => [
|
||||
'{total}' => 'The total number of submissions',
|
||||
'{submissions}' => 'Contains the HTML of all submission rows.',
|
||||
'{pagination.links}' => 'Display the Pages Links.',
|
||||
'{pagination.results}' => 'Show the results currently being displayed. Eg: Results 1 - 5 of 7.',
|
||||
'{pagination.counter}' => 'Show the current page and total pages. Eg: Page 1 of 2.'
|
||||
],
|
||||
'Row & Details Layout' => [
|
||||
'{submission.id}' => 'The ID of the submission.',
|
||||
'{submission.date}' => 'The date when the submission created.',
|
||||
'{submission.modified}' => 'The date when the submission modified.',
|
||||
'{submission.form_id}' => 'The ID of the form assosiated with the submission.',
|
||||
'{submission.visitor_id}' => 'The unique ID of the user who submitted the form.',
|
||||
'{submission.user_id}' => 'The Joomla User ID of the user who submitted the form.',
|
||||
'{submission.status}' => 'The status of the submission.',
|
||||
'{link}' => 'The link that points to the submission details layout.',
|
||||
'{field.FIELD_KEY}' => 'Use this syntax to display a field value as plain text. Eg: {field.name} or {field.myfield}',
|
||||
'{field.FIELD_KEY.html}' => 'Use this syntax to display a field value as HTML (If applicable). Eg: {field.uploadfield.html}',
|
||||
]
|
||||
];
|
||||
|
||||
// Global Tags
|
||||
$st = new NRFramework\SmartTags;
|
||||
$global_tags = $st->get();
|
||||
|
||||
foreach ($global_tags as $tag => $tag_value)
|
||||
{
|
||||
if (strpos($tag, 'querystring') !== false)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$groups['Global'][$tag] = JText::_('NR_TAG_' . strtoupper(str_replace(array("{", "}", "."), "", $tag)));
|
||||
}
|
||||
|
||||
$groups['Global']['{querystring.PARAM}'] = 'Use this syntax to pull the value of a query string parameter. Eg: {querystring.id} or {querystring.name}';
|
||||
|
||||
JFactory::getDocument()->addStyleDeclaration('
|
||||
.CodeMirror {
|
||||
min-height: auto;
|
||||
height: 300px;
|
||||
max-width: 800px;
|
||||
width:100%;
|
||||
}
|
||||
.controls > p.label {
|
||||
display:none;
|
||||
}
|
||||
');
|
||||
|
||||
?>
|
||||
|
||||
<div class="smarttags">
|
||||
<h2>Smart Tags</h2>
|
||||
<table class="table">
|
||||
<?php foreach ($groups as $group_key => $tags) { ?>
|
||||
<tr>
|
||||
<th colspan="2"><?php echo $group_key ?></th>
|
||||
</tr>
|
||||
<?php foreach ($tags as $key => $value) { ?>
|
||||
<tr>
|
||||
<td width="200px"><?php echo $key ?></td>
|
||||
<td><?php echo $value ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</table>
|
||||
</div>
|
||||
103
components/com_convertforms/views/submissions/view.html.php
Normal file
103
components/com_convertforms/views/submissions/view.html.php
Normal file
@@ -0,0 +1,103 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* Content categories view.
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
class ConvertFormsViewSubmissions extends JViewLegacy
|
||||
{
|
||||
/**
|
||||
* Display the forms' submissions
|
||||
*
|
||||
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function display($tpl = null)
|
||||
{
|
||||
$this->params = JFactory::getApplication()->getParams();
|
||||
$this->submissions = $this->get('Items');
|
||||
$this->pagination = $this->params->get('show_pagination', true) ? $this->get('Pagination') : null;
|
||||
|
||||
$this->_prepareDocument();
|
||||
|
||||
// Layout checks
|
||||
if ($this->params->get('layout_type', 'file') == 'custom')
|
||||
{
|
||||
$layout_container = $this->params->get('layout_container');
|
||||
$layout_row = $this->params->get('layout_row');
|
||||
|
||||
if (!empty($layout_container) && !empty($layout_row))
|
||||
{
|
||||
$st = new \NRFramework\SmartTags();
|
||||
|
||||
// Register CF Front End Submission Smart Tags
|
||||
$st->register(
|
||||
'\ConvertForms\SmartTags',
|
||||
JPATH_SITE . '/administrator/components/com_convertforms/ConvertForms/SmartTags',
|
||||
[
|
||||
'front_end_submission' => [
|
||||
'submissions' => $this->submissions,
|
||||
'layout_row' => $layout_row,
|
||||
'total' => $this->get('Total'),
|
||||
'pagination' => $this->pagination
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$html = $st->replace($layout_container);
|
||||
$html = \Joomla\CMS\HTML\HTMLHelper::_('content.prepare', $html);
|
||||
echo $html;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Display the view
|
||||
$this->setLayout($this->params->get('submissions_layout'));
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepares the document
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function _prepareDocument()
|
||||
{
|
||||
$doc = \JFactory::getDocument();
|
||||
$app = \JFactory::getApplication();
|
||||
$activeMenuItem = $app->getMenu()->getActive();
|
||||
$params = $activeMenuItem->getParams();
|
||||
|
||||
if ($robots_value = $params->get('robots'))
|
||||
{
|
||||
$robots = $doc->getMetaData('robots');
|
||||
$robots = empty($robots) ? $robots_value : $robots . ', ' . $robots_value;
|
||||
|
||||
$doc->setMetaData('robots', $robots);
|
||||
}
|
||||
|
||||
if ($params->get('menu-meta_keywords'))
|
||||
{
|
||||
$doc->setMetadata('keywords', $params->get('menu-meta_keywords'));
|
||||
}
|
||||
|
||||
if ($params->get('menu-meta_description'))
|
||||
{
|
||||
$doc->setDescription($params->get('menu-meta_description'));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user