primo commit

This commit is contained in:
2024-12-17 17:34:10 +01:00
commit e650f8df99
16435 changed files with 2451012 additions and 0 deletions

View File

@ -0,0 +1,55 @@
<?php
/**
* @package ShackDefaultFiles
* @contact www.joomlashack.com, help@joomlashack.com
* @copyright 2015-2021 Joomlashack.com. All rights reserved
* @license https://www.gnu.org/licenses/gpl.html GNU/GPL
*
* This file is part of ShackDefaultFiles.
*
* ShackDefaultFiles is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* ShackDefaultFiles is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ShackDefaultFiles. If not, see <https://www.gnu.org/licenses/>.
*/
use Joomla\CMS\HTML\HTMLHelper;
defined('_JEXEC') or die();
?>
<div class="row-fluid">
<div id="footer" class="span12">
<div>
<a href="https://www.joomlashack.com">
<?php
echo HTMLHelper::_(
'image',
$this->option . '/joomlashack-logo.png',
'Joomlashack',
['width' => '150'],
true
);
?>
</a>
</div>
<br/>
<div>
Powered by
<?php echo HTMLHelper::_(
'link',
'https://www.joomlashack.com',
'Joomlashack',
['target' => '_blank']
); ?>
</div>
</div>
</div>

View File

@ -0,0 +1,62 @@
<?php
/**
* @package ShackInstaller
* @contact www.joomlashack.com, help@joomlashack.com
* @copyright 2016-2023 Joomlashack.com. All rights reserved
* @license https://www.gnu.org/licenses/gpl.html GNU/GPL
*
* This file is part of ShackInstaller.
*
* ShackInstaller is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* ShackInstaller is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ShackInstaller. If not, see <https://www.gnu.org/licenses/>.
*/
use Alledia\Installer\AbstractScript;
use Alledia\Installer\Extension\Generic;
use Alledia\Installer\Extension\Licensed;
defined('_JEXEC') or die();
/**
* @var AbstractScript $this
* @var string $type
* @var Licensed $license
* @var string $name
* @var string $configPath
* @var string $customFooterPath
* @var string $extensionPath
* @var Generic $licensesManagerExtension
* @var string $string
* @var string $path
*/
?>
<div class="joomlashack-wrapper">
<div class="joomlashack-content">
<h2><?php echo $this->welcomeMessage; ?></h2>
<?php
if (is_file(__DIR__ . '/default_custom.php')) :
include __DIR__ . '/default_custom.php';
endif;
if ($license->isPro()) :
include __DIR__ . '/default_license.php';
endif;
include __DIR__ . "/default_info.php";
?>
<?php echo $this->footer; ?>
</div>
</div>

View File

@ -0,0 +1,116 @@
<?php
/**
* @package OSMap
* @contact www.joomlashack.com, help@joomlashack.com
* @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved.
* @copyright 2016-2024 Joomlashack.com. All rights reserved.
* @license https://www.gnu.org/licenses/gpl.html GNU/GPL
*
* This file is part of OSMap.
*
* OSMap is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* OSMap is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OSMap. If not, see <https://www.gnu.org/licenses/>.
*/
// No direct access
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
defined('_JEXEC') or die();
if ($this->isXmapDataFound) :
$updateLink = Route::_('index.php?option=com_osmap&task=sitemaps.migrateXMapData&format=json');
?>
<div class="alledia-xmap-import">
<div id="alledia-installer-xmap-import-message">
<div id="alledia-installer-xmap-import-wipe-warning" class="alert alert-warning">
<h4 class="alert-heading"><?php echo Text::_('COM_OSMAP_INSTALLER_IMPORT_XMAP_TITLE'); ?></h4>
<p><?php echo Text::_('COM_OSMAP_INSTALLER_IMPORT_XMAP_DESCRIPTION'); ?></p>
<p>
<strong><?php echo Text::_('COM_OSMAP_INSTALLER_IMPORT_XMAP_WIPE_WARNING'); ?></strong>
</p>
<a href="javascript:void(0);" id="alledia-installer-xmap-import-button" class="alledia-button">
<?php echo Text::_('COM_OSMAP_INSTALLER_IMPORT_XMAP_BUTTON'); ?>
</a>
</div>
</div>
<div id="alledia-installer-xmap-import-success" class="alert alert-success" style="display: none">
<p>
<?php echo Text::_('COM_OSMAP_INSTALLER_IMPORT_XMAP_SUCCESS'); ?>
</p>
</div>
<div id="alledia-installer-xmap-import-error" class="alert alert-error" style="display: none">
<p>
<?php echo Text::_('COM_OSMAP_INSTALLER_IMPORT_XMAP_ERROR'); ?>
</p>
</div>
</div>
<script>
(function($) {
$(function() {
let button = $('#alledia-installer-xmap-import-button'),
message = $('#alledia-installer-xmap-import-message'),
title = $('.alledia-xmap-import > h4.warning');
let showError = function() {
$('#alledia-installer-xmap-import-error').show();
title.hide();
};
let showSuccess = function() {
$('#alledia-installer-xmap-import-success').show();
title.hide();
};
button.on('click', function() {
let goAhead = confirm('<?php echo Text::_('COM_OSMAP_INSTALLER_WIPE_CONFIRMATION'); ?>');
if (goAhead) {
button.text('<?php echo Text::_('COM_OSMAP_INSTALLER_IMPORTING'); ?>')
.off('click', this)
.css('cursor', 'default');
{},
$.post('<?php echo $updateLink; ?>',
function(data) {
message.hide();
try {
let result = JSON.parse(data);
if (result.success) {
showSuccess();
} else {
showError();
}
} catch (e) {
showError();
}
},
'text'
).fail(function() {
message.hide();
showError();
});
}
});
});
})(jQuery);
</script>
<?php
endif;

View File

@ -0,0 +1,115 @@
<?php
/**
* @package ShackInstaller
* @contact www.joomlashack.com, help@joomlashack.com
* @copyright 2016-2023 Joomlashack.com. All rights reserved
* @license https://www.gnu.org/licenses/gpl.html GNU/GPL
*
* This file is part of ShackInstaller.
*
* ShackInstaller is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* ShackInstaller is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ShackInstaller. If not, see <https://www.gnu.org/licenses/>.
*/
use Alledia\Installer\AbstractScript;
use Alledia\Installer\Extension\Generic;
use Alledia\Installer\Extension\Licensed;
use Joomla\CMS\Language\Text;
defined('_JEXEC') or die();
/**
* @var AbstractScript $this
* @var string $type
* @var Licensed $license
* @var string $name
* @var string $configPath
* @var string $customFooterPath
* @var string $extensionPath
* @var Generic $licensesManagerExtension
* @var string $string
* @var string $path
*/
?>
<div class="joomlashack-details-container">
<a href="javascript:void(0);" id="joomlashack-installer-footer-toggler">
<?php echo Text::_('LIB_SHACKINSTALLER_SHOW_DETAILS'); ?>
</a>
<div id="joomlashack-installer-footer" style="display: none;">
<div class="joomlashack-license">
<?php echo Text::sprintf('LIB_SHACKINSTALLER_RELEASE_V', (string)$this->manifest->version); ?>
</div>
<br>
<?php if (!empty($this->manifest->alledia->relatedExtensions)) : ?>
<table class="joomlashack-related-table">
<thead>
<tr>
<th colspan="2"><?php echo Text::_('LIB_SHACKINSTALLER_RELATED_EXTENSIONS'); ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($this->relatedExtensionFeedback as $data) : ?>
<tr>
<td><?php echo Text::_($data['name']); ?></td>
<td>
<?php
$messages = [$data['message']];
if (isset($data['publish']) && $data['publish']) {
$messages[] = Text::_('LIB_SHACKINSTALLER_PUBLISHED');
}
if (isset($data['ordering'])) {
$messages[] = Text::sprintf('LIB_SHACKINSTALLER_SORTED', $data['ordering']);
}
$messages = implode(', ', $messages);
echo $messages;
?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
<div class="joomlashack-license">
<?php
echo Text::sprintf(
'LIB_SHACKINSTALLER_LICENSED_AS',
$this->getName(),
'<a href="https://www.gnu.org/licenses/gpl-3.0">GNU/GPL v3.0</a>'
);
?>.
</div>
</div>
</div>
<script>
(function() {
let footer = document.getElementById('joomlashack-installer-footer'),
toggle = document.getElementById('joomlashack-installer-footer-toggler');
if (footer && toggle) {
toggle.addEventListener('click', function(event) {
event.preventDefault();
footer.style.display = 'block';
this.style.display = 'none';
});
}
})();
</script>

View File

@ -0,0 +1,158 @@
<?php
/**
* @package ShackInstaller
* @contact www.joomlashack.com, help@joomlashack.com
* @copyright 2016-2023 Joomlashack.com. All rights reserved
* @license https://www.gnu.org/licenses/gpl.html GNU/GPL
*
* This file is part of ShackInstaller.
*
* ShackInstaller is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* ShackInstaller is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ShackInstaller. If not, see <https://www.gnu.org/licenses/>.
*/
use Alledia\Installer\AbstractScript;
use Alledia\Installer\Extension\Generic;
use Alledia\Installer\Extension\Licensed;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Uri\Uri;
defined('_JEXEC') or die();
/**
* @var AbstractScript $this
* @var string $type
* @var Licensed $license
* @var string $name
* @var string $configPath
* @var string $customFooterPath
* @var string $extensionPath
* @var Generic $licensesManagerExtension
* @var string $string
* @var string $path
*/
$licenseUpdate = Uri::root() . '/administrator/index.php?plugin=system_osmylicensesmanager&task=license.save';
if ($this->isLicensesManagerInstalled) :
?>
<div class="joomlashack-license-form">
<?php
if (!empty($this->licenseKey)) :
?>
<a href="" class="joomlashack-installer-change-license-button btn btn-success">
<?php echo Text::_('LIB_SHACKINSTALLER_CHANGE_LICENSE_KEY'); ?>
</a>
<?php endif; ?>
<div id="joomlashack-installer-license-panel">
<input type="text"
name="joomlashack-license-keys"
id="joomlashack-license-keys"
value="<?php echo $this->licenseKey; ?>"
class="form-control"
placeholder="<?php echo Text::_('LIB_SHACKINSTALLER_LICENSE_KEYS_PLACEHOLDER'); ?>"/>
<p class="joomlashack-empty-key-msg">
<?php echo Text::_('LIB_SHACKINSTALLER_MSG_LICENSE_KEYS_EMPTY'); ?>&nbsp;
<a href="https://www.joomlashack.com/account/key/" target="_blank">
<?php echo Text::_('LIB_SHACKINSTALLER_I_DONT_REMEMBER_MY_KEY'); ?>
</a>
</p>
<a id="joomlashack-license-save-button"
class="btn btn-success"
href="#">
<?php echo Text::_('LIB_SHACKINSTALLER_SAVE_LICENSE_KEY'); ?>
</a>
</div>
<div id="joomlashack-installer-license-success" style="display: none">
<p><?php echo Text::_('LIB_SHACKINSTALLER_LICENSE_KEY_SUCCESS'); ?></p>
</div>
<div id="joomlashack-installer-license-error" style="display: none">
<p><?php echo Text::_('LIB_SHACKINSTALLER_LICENSE_KEY_ERROR'); ?></p>
</div>
</div>
<script>
(function() {
let panel = document.getElementById('joomlashack-installer-license-panel'),
updateButtons = document.getElementsByClassName('joomlashack-installer-change-license-button'),
saveButton = document.getElementById('joomlashack-license-save-button');
if (panel) {
if (updateButtons.length > 0) {
panel.style.display = 'none';
Array.from(updateButtons).forEach(function(button) {
button.addEventListener('click', function(event) {
event.preventDefault();
panel.style.display = 'block';
this.style.display = 'none';
})
});
}
if (saveButton) {
saveButton.addEventListener('click', function(event) {
event.preventDefault();
let request = new XMLHttpRequest(),
data = new FormData(),
keyField = document.getElementById('joomlashack-license-keys')
data.append('license-keys', keyField.value)
request.onreadystatechange = function(data) {
if (this.readyState === XMLHttpRequest.DONE) {
try {
if (this.status === 200) {
let result = JSON.parse(this.response),
success = document.getElementById('joomlashack-installer-license-success'),
error = document.getElementById('joomlashack-installer-license-error');
panel.style.display = 'none';
if (result.success) {
success.style.display = 'block';
} else {
error.style.display = 'block';
}
} else {
error.style.display = 'block';
}
} catch (e) {
panel.style.display = 'none';
error.style.display = 'block';
}
}
};
request.open('POST', '<?php echo $licenseUpdate; ?>');
request.send(data);
});
}
}
})();
</script>
<?php else : ?>
<div class="error">
<?php echo Text::_('LIB_SHACKINSTALLER_LICENSE_KEYS_MANAGER_REQUIRED'); ?>
</div>
<?php endif;

View File

@ -0,0 +1,69 @@
<?php
/**
* @package OSMap
* @contact www.joomlashack.com, help@joomlashack.com
* @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved.
* @copyright 2016-2024 Joomlashack.com. All rights reserved.
* @license https://www.gnu.org/licenses/gpl.html GNU/GPL
*
* This file is part of OSMap.
*
* OSMap is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* OSMap is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OSMap. If not, see <https://www.gnu.org/licenses/>.
*/
use Alledia\OSMap\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
defined('_JEXEC') or die();
HTMLHelper::_('behavior.formvalidator');
HTMLHelper::_('behavior.keepalive');
HTMLHelper::_('formbehavior.chosen', 'select');
$input = Factory::getApplication()->input;
$actionQuery = [
'option' => 'com_osmap',
'view' => 'sitemap',
'layout' => 'edit',
'id' => (int)$this->item->id
];
?>
<form action="<?php echo Route::_('index.php?' . http_build_query($actionQuery)); ?>"
method="post"
name="adminForm"
id="adminForm"
class="form-validate sitemap">
<?php echo LayoutHelper::render('joomla.edit.title_alias', $this); ?>
<div class="form-horizontal">
<div class="row-fluid">
<div class="span9">
<?php echo $this->form->getField('menus')->renderField(['hiddenLabel' => true]); ?>
</div>
<div class="span3">
<?php echo $this->form->renderFieldset('params'); ?>
</div>
</div>
</div>
<input type="hidden" name="task" value=""/>
<input type="hidden" name="return" value="<?php echo $input->getCmd('return'); ?>"/>
<?php echo HTMLHelper::_('form.token'); ?>
</form>

View File

@ -0,0 +1,67 @@
<?php
/**
* @package OSMap
* @contact www.joomlashack.com, help@joomlashack.com
* @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved.
* @copyright 2016-2024 Joomlashack.com. All rights reserved.
* @license https://www.gnu.org/licenses/gpl.html GNU/GPL
*
* This file is part of OSMap.
*
* OSMap is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* OSMap is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OSMap. If not, see <https://www.gnu.org/licenses/>.
*/
use Alledia\OSMap\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
defined('_JEXEC') or die();
HTMLHelper::_('behavior.formvalidator');
HTMLHelper::_('behavior.keepalive');
$input = Factory::getApplication()->input;
$actionQuery = [
'option' => 'com_osmap',
'view' => 'sitemap',
'layout' => 'edit',
'id' => (int)$this->item->id
];
?>
<form action="<?php echo Route::_('index.php?' . http_build_query($actionQuery)); ?>"
method="post"
name="adminForm"
id="adminForm"
class="form-validate sitemap">
<?php echo LayoutHelper::render('joomla.edit.title_alias', $this); ?>
<div>
<div class="row">
<div class="col-lg-9">
<?php echo $this->form->getField('menus')->renderField(['hiddenLabel' => true]); ?>
</div>
<div class="col-lg-3">
<?php echo $this->form->renderFieldset('params'); ?>
</div>
</div>
</div>
<input type="hidden" name="task" value=""/>
<?php echo HTMLHelper::_('form.token'); ?>
</form>

View File

@ -0,0 +1,80 @@
<?php
/**
* @package OSMap
* @contact www.joomlashack.com, help@joomlashack.com
* @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved.
* @copyright 2016-2024 Joomlashack.com. All rights reserved.
* @license https://www.gnu.org/licenses/gpl.html GNU/GPL
*
* This file is part of OSMap.
*
* OSMap is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* OSMap is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OSMap. If not, see <https://www.gnu.org/licenses/>.
*/
use Alledia\OSMap\Factory;
use Alledia\OSMap\View\Admin\AbstractForm;
use Joomla\CMS\Object\CMSObject;
use Joomla\CMS\Toolbar\ToolbarHelper;
defined('_JEXEC') or die();
class OSMapViewSitemap extends AbstractForm
{
/**
* @var CMSObject
*/
protected $item = null;
/**
* @inheritDoc
*/
public function display($tpl = null)
{
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$this->setToolBar();
parent::display($tpl);
}
/**
* @param bool $addDivider
*
* @return void
* @throws Exception
*/
protected function setToolBar()
{
$isNew = ($this->item->id == 0);
Factory::getApplication()->input->set('hidemainmenu', true);
$title = 'COM_OSMAP_PAGE_VIEW_SITEMAP_' . ($isNew ? 'ADD' : 'EDIT');
$this->setTitle($title);
ToolbarHelper::apply('sitemap.apply');
ToolbarHelper::save('sitemap.save');
ToolbarHelper::save2new('sitemap.save2new');
if (!$isNew) {
ToolbarHelper::save2copy('sitemap.save2copy');
}
$alt = $isNew ? 'JTOOLBAR_CANCEL' : 'JTOOLBAR_CLOSE';
ToolbarHelper::cancel('sitemap.cancel', $alt);
parent::setToolBar();
}
}

View File

@ -0,0 +1,69 @@
<?php
/**
* @package OSMap
* @contact www.joomlashack.com, help@joomlashack.com
* @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved.
* @copyright 2016-2024 Joomlashack.com. All rights reserved.
* @license https://www.gnu.org/licenses/gpl.html GNU/GPL
*
* This file is part of OSMap.
*
* OSMap is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* OSMap is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OSMap. If not, see <https://www.gnu.org/licenses/>.
*/
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
defined('_JEXEC') or die();
HTMLHelper::_('bootstrap.tooltip');
HTMLHelper::_('behavior.core');
HTMLHelper::_('behavior.keepalive');
HTMLHelper::_('formbehavior.chosen', 'select');
$sitemapId = (int)$this->sitemap->id;
?>
<h1>
<?php echo Text::sprintf('COM_OSMAP_SITEMAPITEMS_HEADING', $this->escape($this->sitemap->name)); ?>
</h1>
<form action="<?php echo Route::_('index.php?option=com_osmap&view=sitemapitems&id=' . $sitemapId); ?>"
method="post"
name="adminForm"
id="adminForm"
class="form-validate">
<div class="row-fluid">
<div class="span12">
<div id="osmap-items-container">
<div class="osmap-loading">
<span class="icon-loop spin"></span>
<?php echo Text::_('COM_OSMAP_LOADING'); ?>
</div>
<div id="osmap-items-list"></div>
</div>
</div>
</div>
<input type="hidden" id="menus_ordering" name="jform[menus_ordering]" value=""/>
<input type="hidden" name="task" value=""/>
<input type="hidden" name="id" value="<?php echo $sitemapId; ?>"/>
<input type="hidden" name="update-data" id="update-data" value=""/>
<input type="hidden" name="language" value="<?php echo $this->language; ?>"/>
<?php echo HTMLHelper::_('form.token'); ?>
</form>
<?php
echo $this->loadTemplate('script');

View File

@ -0,0 +1,68 @@
<?php
/**
* @package OSMap
* @contact www.joomlashack.com, help@joomlashack.com
* @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved.
* @copyright 2016-2024 Joomlashack.com. All rights reserved.
* @license https://www.gnu.org/licenses/gpl.html GNU/GPL
*
* This file is part of OSMap.
*
* OSMap is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* OSMap is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OSMap. If not, see <https://www.gnu.org/licenses/>.
*/
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
defined('_JEXEC') or die();
HTMLHelper::_('bootstrap.tooltip');
HTMLHelper::_('behavior.core');
HTMLHelper::_('behavior.keepalive');
$sitemapId = (int)$this->sitemap->id;
?>
<h1>
<?php echo Text::sprintf('COM_OSMAP_SITEMAPITEMS_HEADING', $this->escape($this->sitemap->name)); ?>
</h1>
<form action="<?php echo Route::_('index.php?option=com_osmap&view=sitemapitems&id=' . $sitemapId); ?>"
method="post"
name="adminForm"
id="adminForm"
class="form-validate">
<div class="row-fluid">
<div class="col-12">
<div id="osmap-items-container">
<div class="osmap-loading">
<span class="icon-loop spin"></span>
<?php echo Text::_('COM_OSMAP_LOADING'); ?>
</div>
<div id="osmap-items-list"></div>
</div>
</div>
</div>
<input type="hidden" id="menus_ordering" name="jform[menus_ordering]" value=""/>
<input type="hidden" name="task" value=""/>
<input type="hidden" name="id" value="<?php echo $sitemapId; ?>"/>
<input type="hidden" name="update-data" id="update-data" value=""/>
<input type="hidden" name="language" value="<?php echo $this->language; ?>"/>
<?php echo HTMLHelper::_('form.token'); ?>
</form>
<?php
echo $this->loadTemplate('script');

View File

@ -0,0 +1,58 @@
<?php
/**
* @package OSMap
* @contact www.joomlashack.com, help@joomlashack.com
* @copyright 2023-2024 Joomlashack.com. All rights reserved
* @license https://www.gnu.org/licenses/gpl.html GNU/GPL
*
* This file is part of OSMap.
*
* OSMap is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* OSMap is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OSMap. If not, see <https://www.gnu.org/licenses/>.
*/
use Alledia\OSMap\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
defined('_JEXEC') or die();
HTMLHelper::_('jquery.framework');
HTMLHelper::_('script', 'com_osmap/sitemapitems.min.js', ['relative' => true]);
$jsOptions = json_encode([
'baseUri' => Factory::getPimpleContainer()->uri::root(),
'sitemapId' => (int)$this->sitemap->id,
'container' => '#osmap-items-list',
'language' => $this->language,
'frequencies' => HTMLHelper::_('osmap.frequencyList'),
'priorities' => HTMLHelper::_('osmap.priorityList'),
]);
$jTexts = [
'COM_OSMAP_HOURLY',
'COM_OSMAP_DAILY',
'COM_OSMAP_WEEKLY',
'COM_OSMAP_MONTHLY',
'COM_OSMAP_YEARLY',
'COM_OSMAP_NEVER',
'COM_OSMAP_TOOLTIP_CLICK_TO_UNPUBLISH',
'COM_OSMAP_TOOLTIP_CLICK_TO_PUBLISH',
];
foreach ($jTexts as $jText) {
Text::script($jText);
}
Factory::getApplication()->getDocument()->addScriptDeclaration(
";jQuery(document).ready(function($) { new $.osmap.sitemapItems({$jsOptions}); });"
);

View File

@ -0,0 +1,76 @@
<?php
/**
* @package OSMap
* @contact www.joomlashack.com, help@joomlashack.com
* @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved.
* @copyright 2016-2024 Joomlashack.com. All rights reserved.
* @license https://www.gnu.org/licenses/gpl.html GNU/GPL
*
* This file is part of OSMap.
*
* OSMap is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* OSMap is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OSMap. If not, see <https://www.gnu.org/licenses/>.
*/
use Alledia\OSMap\Factory;
use Alledia\OSMap\Sitemap\Standard;
use Alledia\OSMap\View\Admin\AbstractList;
use Joomla\CMS\Toolbar\ToolbarHelper;
// phpcs:disable PSR1.Files.SideEffects
defined('_JEXEC') or die();
// phpcs:enable PSR1.Files.SideEffects
// phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace
class OSMapViewSitemapItems extends AbstractList
{
/**
* @var Standard
*/
protected $sitemap = null;
/**
* @var string
*/
protected $language = null;
/**
* @inheritDoc
*/
public function display($tpl = null)
{
$sitemapId = $this->app->input->getInt('id', 0);
$this->sitemap = Factory::getSitemap($sitemapId);
$this->language = $this->app->input->get('lang', '');
$this->setToolBar();
parent::display($tpl);
}
/**
* @inheritDoc
*/
protected function setToolBar($addDivider = true)
{
$this->setTitle('COM_OSMAP_PAGE_VIEW_SITEMAP_ITEMS');
ToolbarHelper::apply('sitemapitems.apply');
ToolbarHelper::save('sitemapitems.save');
ToolbarHelper::cancel('sitemapitems.cancel');
parent::setToolBar();
}
}

View File

@ -0,0 +1,191 @@
<?php
/**
* @package OSMap
* @contact www.joomlashack.com, help@joomlashack.com
* @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved.
* @copyright 2016-2024 Joomlashack.com. All rights reserved.
* @license https://www.gnu.org/licenses/gpl.html GNU/GPL
*
* This file is part of OSMap.
*
* OSMap is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* OSMap is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OSMap. If not, see <https://www.gnu.org/licenses/>.
*/
use Alledia\OSMap\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Uri\Uri;
defined('_JEXEC') or die();
HTMLHelper::_('bootstrap.tooltip');
HTMLHelper::_('formbehavior.chosen', 'select');
$container = Factory::getPimpleContainer();
$baseUrl = $container->router->sanitizeURL(Uri::root());
$listOrder = $this->state->get('list.ordering');
$listDir = $this->state->get('list.direction');
?>
<form action="<?php echo Route::_('index.php?option=com_osmap&view=sitemaps'); ?>"
method="post"
name="adminForm"
id="adminForm">
<div id="j-sidebar-container" class="span2">
<?php echo $this->sidebar; ?>
</div>
<div id="j-main-container" class="span10">
<?php echo LayoutHelper::render('joomla.searchtools.default', ['view' => $this]); ?>
<?php if (empty($this->items)) : ?>
<div class="alert alert-no-items">
<?php echo Text::_('COM_OSMAP_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<table class="adminlist table table-striped" id="sitemapList">
<thead>
<tr>
<th style="width: 1%">
<?php echo HTMLHelper::_('grid.checkall'); ?>
</th>
<th style="width: 1%; min-width:55px" class="nowrap center">
<?php
echo HTMLHelper::_(
'searchtools.sort',
'COM_OSMAP_HEADING_STATUS',
'sitemap.published',
$listDir,
$listOrder
);
?>
</th>
<th class="title">
<?php
echo HTMLHelper::_(
'searchtools.sort',
'COM_OSMAP_HEADING_NAME',
'sitemap.name',
$listDir,
$listOrder
); ?>
</th>
<?php
$editLinksWidth = empty($this->languages) ? '63' : '130';
$editLinksClass = empty($this->languages) ? 'center' : '';
?>
<th style="width: 8%; min-width: <?php echo $editLinksWidth . 'px'; ?>"
class="<?php echo $editLinksClass; ?>">
<?php echo Text::_('COM_OSMAP_HEADING_SITEMAP_EDIT_LINKS'); ?>
</th>
<th style="width: 260px" class="center">
<?php echo Text::_('COM_OSMAP_HEADING_SITEMAP_LINKS'); ?>
</th>
<th style="width: 8%" class="nowrap center">
<?php echo Text::_('COM_OSMAP_HEADING_NUM_LINKS'); ?>
</th>
<th style="width: 1%" class="nowrap">
<?php
echo HTMLHelper::_(
'searchtools.sort',
'COM_OSMAP_HEADING_ID',
'sitemap.id',
$listDir,
$listOrder
); ?>
</th>
</tr>
</thead>
<tbody>
<?php
foreach ($this->items as $i => $this->item) :
$editLink = Route::_('index.php?option=com_osmap&view=sitemap&layout=edit&id=' . $this->item->id);
?>
<tr class="<?php echo 'row' . ($i % 2); ?>">
<td class="center">
<?php echo HTMLHelper::_('grid.id', $i, $this->item->id); ?>
</td>
<td class="center">
<div class="btn-group">
<?php
echo HTMLHelper::_(
'jgrid.published',
$this->item->published,
$i,
'sitemaps.'
);
$defaultAttribs = [
[
'onclick' => $this->item->is_default
? 'javascript:void(0);'
: "return listItemTask('cb{$i}','sitemap.setAsDefault')",
'class' => 'btn btn-micro hasTooltip',
'data-original-title' => Text::_('COM_OSMAP_SITEMAP_IS_DEFAULT_DESC')
]
];
echo HTMLHelper::_(
'link',
'#',
sprintf(
'<span class="icon-%s"></span>',
$this->item->is_default ? 'featured' : 'unfeatured'
),
$defaultAttribs
);
?>
</div>
</td>
<td class="nowrap">
<?php echo HTMLHelper::_('link', $editLink, $this->escape($this->item->name)); ?>
</td>
<td class="nowrap <?php echo $editLinksClass; ?>">
<?php echo $this->loadTemplate('editlinks'); ?>
</td>
<td class="nowrap center osmap-links">
<?php echo $this->loadTemplate('previews'); ?>
</td>
<td class="center">
<?php echo number_format($this->item->links_count); ?>
</td>
<td class="center">
<?php echo (int)$this->item->id; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
</div>
<input type="hidden" name="task" value=""/>
<input type="hidden" name="boxchecked" value="0"/>
<?php echo HTMLHelper::_('form.token'); ?>
</form>

View File

@ -0,0 +1,98 @@
<?php
/**
* @package OSMap
* @contact www.joomlashack.com, help@joomlashack.com
* @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved.
* @copyright 2016-2024 Joomlashack.com. All rights reserved.
* @license https://www.gnu.org/licenses/gpl.html GNU/GPL
*
* This file is part of OSMap.
*
* OSMap is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* OSMap is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OSMap. If not, see <https://www.gnu.org/licenses/>.
*/
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
defined('_JEXEC') or die();
$languages = $this->languages ?: [''];
foreach ($languages as $language) :
$langCode = empty($language->sef) ? null : $language->sef;
?>
<span class="osmap-link">
<?php
echo HTMLHelper::_(
'link',
$this->getLink($this->item, 'xml', $langCode),
Text::_('COM_OSMAP_XML_LINK'),
[
'target' => '_blank',
'title' => Text::_('COM_OSMAP_XML_LINK_TOOLTIP', true),
'class' => 'hasTooltip'
]
);
?>
<span class="icon-new-tab"></span>
</span>
<span class="osmap-link">
<?php
echo HTMLHelper::_(
'link',
$this->getLink($this->item, 'html', $langCode),
Text::_('COM_OSMAP_HTML_LINK'),
[
'target' => '_blank',
'title' => Text::_('COM_OSMAP_HTML_LINK_TOOLTIP', true),
'class' => 'hasTooltip'
]
);
?>
<span class="icon-new-tab"></span>
</span>
<span class="osmap-link">
<?php
echo HTMLHelper::_(
'link',
$this->getLink($this->item, 'news', $langCode),
Text::_('COM_OSMAP_NEWS_LINK'),
[
'target' => '_blank',
'title' => Text::_('COM_OSMAP_NEWS_LINK_TOOLTIP', true),
'class' => 'hasTooltip'
]
);
?>
<span class="icon-new-tab"></span>
</span>
<span class="osmap-link">
<?php
echo HTMLHelper::_(
'link',
$this->getLink($this->item, 'images', $langCode),
Text::_('COM_OSMAP_IMAGES_LINK'),
[
'target' => '_blank',
'title' => Text::_('COM_OSMAP_IMAGES_LINK_TOOLTIP', true),
'class' => 'hasTooltip'
]
);
?>
<span class="icon-new-tab"></span>
</span>
<br>
<?php endforeach;

View File

@ -0,0 +1,187 @@
<?php
/**
* @package OSMap
* @contact www.joomlashack.com, help@joomlashack.com
* @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved.
* @copyright 2016-2024 Joomlashack.com. All rights reserved.
* @license https://www.gnu.org/licenses/gpl.html GNU/GPL
*
* This file is part of OSMap.
*
* OSMap is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* OSMap is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OSMap. If not, see <https://www.gnu.org/licenses/>.
*/
use Alledia\OSMap\Button\DefaultButton;
use Joomla\CMS\Button\PublishedButton;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
HTMLHelper::_('bootstrap.tooltip');
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
?>
<form action="<?php echo Route::_('index.php?option=com_osmap&view=sitemaps'); ?>"
method="post"
name="adminForm"
id="adminForm">
<div class="row">
<div class="col-md-12">
<div id="j-main-container" class="j-main-container">
<?php
echo LayoutHelper::render('joomla.searchtools.default', ['view' => $this]);
if (empty($this->items)) : ?>
<div class="alert alert-info">
<span class="icon-info-circle" aria-hidden="true"></span><span
class="visually-hidden"><?php echo Text::_('INFO'); ?></span>
<?php echo Text::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<table class="table itemList">
<caption class="visually-hidden">
<?php echo Text::_('COM_OSMAP_SITEMAP_TABLE_CAPTION'); ?>,
<span id="orderedBy"><?php echo Text::_('JGLOBAL_SORTED_BY'); ?> </span>,
<span id="filteredBy"><?php echo Text::_('JGLOBAL_FILTERED_BY'); ?></span>
</caption>
<thead>
<tr>
<th class="w-1 text-center">
<?php echo HTMLHelper::_('grid.checkall'); ?>
</th>
<th scope="col" class="w-1 text-center">
<?php
echo HTMLHelper::_(
'searchtools.sort',
'JSTATUS',
'sitemap.published',
$listDirn,
$listOrder
);
?>
</th>
<th scope="col" class="w-1 text-center">
<?php echo Text::_('COM_OSMAP_HEADING_DEFAULT'); ?>
</th>
<th scope="col">
<?php
echo HTMLHelper::_(
'searchtools.sort',
'COM_OSMAP_HEADING_NAME',
'sitemap.name',
$listDirn,
$listOrder
); ?>
</th>
<?php
$editLinksWidth = empty($this->languages) ? '63' : '130';
$editLinksClass = empty($this->languages) ? 'text-center' : '';
?>
<th scope="col"
class="m-8 <?php echo $editLinksClass; ?>"
style="min-width: <?php echo $editLinksWidth . 'px'; ?>">
<?php echo Text::_('COM_OSMAP_HEADING_SITEMAP_EDIT_LINKS'); ?>
</th>
<th scope="col" class="m-260 text-center">
<?php echo Text::_('COM_OSMAP_HEADING_SITEMAP_LINKS'); ?>
</th>
<th scope="col" class="m-8 text-nowrap text-center">
<?php echo Text::_('COM_OSMAP_HEADING_NUM_LINKS'); ?>
</th>
<th scope="col" class="w-5 d-none d-md-table-cell">
<?php
echo HTMLHelper::_(
'searchtools.sort',
'COM_OSMAP_HEADING_ID',
'sitemap.id',
$listDirn,
$listOrder
);
?>
</th>
</tr>
</thead>
<tbody>
<?php
foreach ($this->items as $i => $this->item) :
$editLink = Route::_('index.php?option=com_osmap&view=sitemap&layout=edit&id=' . $this->item->id);
?>
<tr class="<?php echo 'row' . ($i % 2); ?>">
<td class="text-center">
<?php echo HTMLHelper::_('grid.id', $i, $this->item->id); ?>
</td>
<td class="text-center">
<?php
echo (new PublishedButton())->render(
(int)$this->item->published,
$i,
[
'task_prefix' => 'sitemaps.',
'id' => 'state-' . $this->item->id
]
);
?>
</td>
<td class="text-center">
<?php
echo (new DefaultButton())->render(
(int)$this->item->is_default,
$i,
[
'id' => 'state-' . $this->item->id
]
);
?>
</td>
<td class="text-nowrap">
<?php echo HTMLHelper::_('link', $editLink, $this->escape($this->item->name)); ?>
</td>
<td class="text-nowrap <?php echo $editLinksClass; ?>">
<?php echo $this->loadTemplate('editlinks'); ?>
</td>
<td class="text-nowrap text-center osmap-links">
<?php echo $this->loadTemplate('previews'); ?>
</td>
<td class="text-center">
<?php echo (int)$this->item->links_count; ?>
</td>
<td class="text-center">
<?php echo (int)$this->item->id; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
</div>
</div>
</div>
<input type="hidden" name="task" value=""/>
<input type="hidden" name="boxchecked" value="0"/>
<?php echo HTMLHelper::_('form.token'); ?>
</form>

View File

@ -0,0 +1,60 @@
<?php
/**
* @package OSMap
* @contact www.joomlashack.com, help@joomlashack.com
* @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved.
* @copyright 2016-2024 Joomlashack.com. All rights reserved.
* @license https://www.gnu.org/licenses/gpl.html GNU/GPL
*
* This file is part of OSMap.
*
* OSMap is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* OSMap is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OSMap. If not, see <https://www.gnu.org/licenses/>.
*/
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Router\Route;
defined('_JEXEC') or die();
$languages = $this->languages ?: [''];
foreach ($languages as $language) :
$linkQuery = [
'option' => 'com_osmap',
'view' => 'sitemapitems',
'id' => $this->item->id
];
if ($language) {
$linkQuery['lang'] = $language->sef;
$flag = HTMLHelper::_(
'image',
'mod_languages/' . $language->image . '.gif',
$language->title,
null,
true
);
$flag .= ' ' . $language->title;
}
echo HTMLHelper::_(
'link',
Route::_('index.php?' . http_build_query($linkQuery)),
'<span class="icon-edit"></span>' . ($language ? $flag : '')
);
?>
<br>
<?php endforeach;

View File

@ -0,0 +1,103 @@
<?php
/**
* @package OSMap
* @contact www.joomlashack.com, help@joomlashack.com
* @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved.
* @copyright 2016-2024 Joomlashack.com. All rights reserved.
* @license https://www.gnu.org/licenses/gpl.html GNU/GPL
*
* This file is part of OSMap.
*
* OSMap is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* OSMap is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OSMap. If not, see <https://www.gnu.org/licenses/>.
*/
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
defined('_JEXEC') or die();
$languages = $this->languages ?: [''];
foreach ($languages as $idx => $language) :
$langCode = empty($language->sef) ? null : $language->sef;
?>
<span class="osmap-link">
<?php
echo HTMLHelper::_(
'link',
$this->getLink($this->item, 'xml', $langCode),
Text::_('COM_OSMAP_XML_LINK'),
[
'target' => '_blank',
'aria-describedby' => 'tip-xml-' . $idx
]
);
?>
<div role="tooltip" id="<?php echo 'tip-xml-' . $idx; ?>">
<?php echo Text::_('COM_OSMAP_XML_LINK_TOOLTIP'); ?>
</div>
</span>
<span class="osmap-link">
<?php
echo HTMLHelper::_(
'link',
$this->getLink($this->item, 'html', $langCode),
Text::_('COM_OSMAP_HTML_LINK'),
[
'target' => '_blank',
'aria-describedby' => 'tip-html-' . $idx
]
);
?>
<div role="tooltip" id="<?php echo 'tip-html-' . $idx; ?>">
<?php echo Text::_('COM_OSMAP_HTML_LINK_TOOLTIP'); ?>
</div>
</span>
<span class="osmap-link">
<?php
echo HTMLHelper::_(
'link',
$this->getLink($this->item, 'news', $langCode),
Text::_('COM_OSMAP_NEWS_LINK'),
[
'target' => '_blank',
'aria-describedby' => 'tip-news-' . $idx
]
);
?>
<div role="tooltip" id="<?php echo 'tip-news-' . $idx; ?>">
<?php echo Text::_('COM_OSMAP_NEWS_LINK_TOOLTIP'); ?>
</div>
</span>
<span class="osmap-link">
<?php
echo HTMLHelper::_(
'link',
$this->getLink($this->item, 'images', $langCode),
Text::_('COM_OSMAP_IMAGES_LINK'),
[
'target' => '_blank',
'aria-describedby'=>'tip-images-' . $idx
]
);
?>
<div role="tooltip" id="<?php echo 'tip-images-' . $idx; ?>">
<?php echo Text::_('COM_OSMAP_IMAGES_LINK_TOOLTIP'); ?>
</div>
</span>
<br>
<?php
endforeach;

View File

@ -0,0 +1,46 @@
<?php
/**
* @package OSMap
* @contact www.joomlashack.com, help@joomlashack.com
* @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved.
* @copyright 2016-2024 Joomlashack.com. All rights reserved.
* @license https://www.gnu.org/licenses/gpl.html GNU/GPL
*
* This file is part of OSMap.
*
* OSMap is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* OSMap is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OSMap. If not, see <https://www.gnu.org/licenses/>.
*/
use Alledia\OSMap\Factory;
use Joomla\CMS\Layout\LayoutHelper;
defined('_JEXEC') or die;
$displayData = [
'textPrefix' => 'COM_OSMAPS',
'formURL' => 'index.php?option=com_osmaps&view=sitemaps',
'helpURL' => 'https://www.joomlashack.com/docs/osmaps/start/',
'icon' => 'icon-copy article',
];
$user = Factory::getApplication()->getIdentity();
if (
$user->authorise('core.create', 'com_osmaps')
|| count($user->getAuthorisedCategories('com_osmaps', 'core.create')) > 0
) {
$displayData['createURL'] = 'index.php?option=com_osmaps&task=sitemap.add';
}
echo LayoutHelper::render('joomla.content.emptystate', $displayData);

View File

@ -0,0 +1,157 @@
<?php
/**
* @package OSMap
* @contact www.joomlashack.com, help@joomlashack.com
* @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved.
* @copyright 2016-2024 Joomlashack.com. All rights reserved.
* @license https://www.gnu.org/licenses/gpl.html GNU/GPL
*
* This file is part of OSMap.
*
* OSMap is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* OSMap is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OSMap. If not, see <https://www.gnu.org/licenses/>.
*/
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Uri\Uri;
defined('_JEXEC') or die();
HTMLHelper::_('behavior.core');
HTMLHelper::_('bootstrap.tooltip', '.hasTooltip', ['placement' => 'bottom']);
HTMLHelper::_('bootstrap.popover', '.hasPopover', ['placement' => 'bottom']);
$function = Factory::getApplication()->input->getString('function', 'jSelectSitemap');
$baseUrl = Uri::root();
$ordering = $this->escape($this->state->get('list.ordering'));
$direction = $this->escape($this->state->get('list.direction'));
$formAction = [
'option' => 'com_osmap',
'view' => 'sitemaps',
'layout' => 'modal',
'tmpl' => 'component',
'function' => $function
];
?>
<form action="<?php echo Route::_('index.php?' . http_build_query($formAction)); ?>"
method="post"
name="adminForm"
id="adminForm">
<?php if (empty($this->items)) : ?>
<div class="alert alert-no-items">
<?php echo Text::_('COM_OSMAP_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<div id="j-main-container">
<table class="adminlist table table-striped" id="sitemapList">
<thead>
<tr>
<th class="title">
<?php
echo HTMLHelper::_(
'grid.sort',
'COM_OSMAP_HEADING_NAME',
'sitemap.name',
$direction,
$ordering
); ?>
</th>
<th style="width: 1%; min-width:55px" class="nowrap center">
<?php
echo HTMLHelper::_(
'grid.sort',
'COM_OSMAP_HEADING_STATUS',
'sitemap.published',
$direction,
$ordering
);
?>
</th>
<th style="width: 8%" class="nowrap center">
<?php echo Text::_('COM_OSMAP_HEADING_NUM_LINKS'); ?>
</th>
<th style="width: 1%" class="nowrap">
<?php
echo HTMLHelper::_(
'grid.sort',
'COM_OSMAP_HEADING_ID',
'sitemap.id',
$direction,
$ordering
); ?>
</th>
</tr>
</thead>
<tbody>
<?php foreach ($this->items as $i => $item) :
?>
<tr class="<?php echo 'row' . ($i % 2); ?>">
<td>
<?php
echo HTMLHelper::_(
'link',
'javascript:void(0);',
$this->escape($item->name),
[
'style' => 'cursor: pointer;',
'onclick' => sprintf(
"if (window.parent) window.parent.%s('%s', '%s');",
$function,
$item->id,
$this->escape($item->name)
)
]
);
?>
</td>
<td class="center">
<?php if ($item->published) : ?>
<span class="icon-publish"></span>
<?php else : ?>
<span class="icon-unpublish"></span>
<?php endif; ?>
<?php if ($item->is_default) : ?>
<span class="icon-featured"></span>
<?php endif; ?>
</td>
<td class="center">
<?php echo (int)$item->links_count; ?>
</td>
<td class="center">
<?php echo (int)$item->id; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php endif; ?>
<input type="hidden" name="task" value=""/>
<input type="hidden" name="filter_order" value="<?php echo $ordering; ?>"/>
<input type="hidden" name="filter_order_Dir" value="<?php echo $direction; ?>"/>
<?php echo HTMLHelper::_('form.token'); ?>
</form>

View File

@ -0,0 +1,165 @@
<?php
/**
* @package OSMap
* @contact www.joomlashack.com, help@joomlashack.com
* @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved.
* @copyright 2016-2024 Joomlashack.com. All rights reserved.
* @license https://www.gnu.org/licenses/gpl.html GNU/GPL
*
* This file is part of OSMap.
*
* OSMap is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* OSMap is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OSMap. If not, see <https://www.gnu.org/licenses/>.
*/
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Uri\Uri;
defined('_JEXEC') or die();
HTMLHelper::_('behavior.core');
HTMLHelper::_('bootstrap.tooltip', '.hasTooltip', ['placement' => 'bottom']);
HTMLHelper::_('bootstrap.popover', '.hasPopover', ['placement' => 'bottom']);
$function = Factory::getApplication()->input->getString('function', 'osmapSelectSitemap');
$baseUrl = Uri::root();
$ordering = $this->escape($this->state->get('list.ordering'));
$direction = $this->escape($this->state->get('list.direction'));
$formAction = [
'option' => 'com_osmap',
'view' => 'sitemaps',
'layout' => 'modal',
'tmpl' => 'component',
'function' => $function
];
?>
<form action="<?php echo Route::_('index.php?' . http_build_query($formAction)); ?>"
method="post"
name="adminForm"
id="adminForm">
<div class="row">
<div class="col-md-12">
<div id="j-main-container" class="j-main-container">
<?php echo LayoutHelper::render('joomla.searchtools.default', ['view' => $this]); ?>
<?php if (empty($this->items)) : ?>
<div class="alert alert-info">
<?php echo Text::_('COM_OSMAP_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<table class="adminlist table table-sm">
<thead>
<tr>
<th scope="col">
<?php
echo HTMLHelper::_(
'searchtools.sort',
'COM_OSMAP_HEADING_NAME',
'sitemap.name',
$direction,
$ordering
); ?>
</th>
<th scope="col" class="w-1 text-nowrap text-center">
<?php
echo HTMLHelper::_(
'searchtools.sort',
'COM_OSMAP_HEADING_STATUS',
'sitemap.published',
$direction,
$ordering
);
?>
</th>
<th style="width: 8%" class="w-8 text-center text-nowrap ">
<?php echo Text::_('COM_OSMAP_HEADING_NUM_LINKS'); ?>
</th>
<th class="w-1 text-nowrap">
<?php
echo HTMLHelper::_(
'searchtools.sort',
'COM_OSMAP_HEADING_ID',
'sitemap.id',
$direction,
$ordering
); ?>
</th>
</tr>
</thead>
<tbody>
<?php foreach ($this->items as $i => $item) :
?>
<tr class="<?php echo 'row' . ($i % 2); ?>">
<td>
<?php
echo HTMLHelper::_(
'link',
null,
$this->escape($item->name),
[
'style' => 'cursor: pointer;',
'onclick' => sprintf(
"if (window.parent) window.parent.%s('%s', '%s');",
$function,
$item->id,
$this->escape($item->name)
)
]
);
?>
</td>
<td class="text-center">
<div class="btn-group osmap-modal-status">
<?php if ($item->published) : ?>
<i class="icon-save"></i>
<?php else : ?>
<i class="icon-remove"></i>
<?php endif; ?>
<?php if ($item->is_default) : ?>
<i class="icon-star"></i>
<?php endif; ?>
</div>
</td>
<td class="text-center">
<?php echo (int)$item->links_count; ?>
</td>
<td class="text-center">
<?php echo (int)$item->id; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
</div>
</div>
</div>
<input type="hidden" name="task" value=""/>
<?php echo HTMLHelper::_('form.token'); ?>
</form>

View File

@ -0,0 +1,159 @@
<?php
/**
* @package OSMap
* @contact www.joomlashack.com, help@joomlashack.com
* @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved.
* @copyright 2016-2024 Joomlashack.com. All rights reserved.
* @license https://www.gnu.org/licenses/gpl.html GNU/GPL
*
* This file is part of OSMap.
*
* OSMap is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* OSMap is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OSMap. If not, see <https://www.gnu.org/licenses/>.
*/
use Alledia\OSMap\Factory;
use Alledia\OSMap\Helper\General;
use Alledia\OSMap\View\Admin\AbstractList;
use Joomla\CMS\Application\CMSApplication;
use Joomla\CMS\HTML\Helpers\Sidebar;
use Joomla\CMS\Language\LanguageHelper;
use Joomla\CMS\Language\Multilanguage;
use Joomla\CMS\Toolbar\ToolbarHelper;
// phpcs:disable PSR1.Files.SideEffects
defined('_JEXEC') or die();
// phpcs:enable PSR1.Files.SideEffects
// phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace
class OSMapViewSitemaps extends AbstractList
{
/**
* @var string[]
*/
protected $languages = null;
/**
* @var object
*/
protected $item = null;
/**
* @inheritDoc
* @throws Exception
*/
public function display($tpl = null)
{
$this->model = $this->getModel();
$this->items = $this->model->getItems();
$this->state = $this->model->getState();
$this->filterForm = $this->model->getFilterForm();
$this->activeFilters = $this->model->getActiveFilters();
// We don't need toolbar or submenus in the modal window
if (stripos($this->getLayout(), 'modal') !== 0) {
$this->setToolbar();
$this->sidebar = Sidebar::render();
}
// Get the active languages for multi-language sites
$this->languages = null;
if (Multilanguage::isEnabled()) {
$this->languages = LanguageHelper::getLanguages();
}
parent::display($tpl);
}
/**
* @inheritDoc
*/
protected function setToolbar()
{
$this->setTitle('COM_OSMAP_SUBMENU_SITEMAPS');
General::addSubmenu('sitemaps');
ToolbarHelper::addNew('sitemap.add');
ToolbarHelper::custom('sitemap.edit', 'edit.png', 'edit_f2.png', 'JTOOLBAR_EDIT', true);
ToolbarHelper::custom('sitemaps.publish', 'publish.png', 'publish_f2.png', 'JTOOLBAR_Publish', true);
ToolbarHelper::custom('sitemaps.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true);
ToolbarHelper::custom(
'sitemap.setAsDefault',
'featured.png',
'featured_f2.png',
'COM_OSMAP_TOOLBAR_SET_DEFAULT',
true
);
if ($this->state->get('filter.published') == -2) {
ToolbarHelper::deleteList('', 'sitemaps.delete');
} else {
ToolbarHelper::trash('sitemaps.trash');
}
parent::setToolBar();
}
/**
* @param object $item
* @param string $type
* @param ?string $lang
*
* @return string
* @throws Exception
*/
protected function getLink(object $item, string $type, ?string $lang = null): string
{
$view = in_array($type, ['news', 'images']) ? 'xml' : $type;
$menuId = $item->menuIdList[$view] ?? null;
$query = [
'option' => 'com_osmap',
];
if ($menuId) {
$query['Itemid'] = $menuId;
}
if (empty($query['Itemid'])) {
$query = array_merge(
$query,
[
'view' => $view,
'id' => $item->id
]
);
}
if ($type != $view) {
$query[$type] = 1;
}
if ($view == 'xml') {
$menu = CMSApplication::getInstance('site')->getMenu()->getItem($menuId);
$menuView = empty($menu->query['view']) ? null : $menu->query['view'];
if ($view != $menuView) {
$query['format'] = 'xml';
}
}
if ($lang) {
$query['lang'] = $lang;
}
return Factory::getPimpleContainer()
->router->routeURL('index.php?' . http_build_query($query));
}
}