primo commit
This commit is contained in:
		| @ -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> | ||||
| @ -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; | ||||
| @ -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> | ||||
| @ -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'); ?>  | ||||
|                 <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; | ||||
		Reference in New Issue
	
	Block a user