├── .gitignore ├── LICENSE ├── README.md ├── build.dist.properties ├── build.xml ├── composer.json ├── osmap.mwb └── src ├── admin ├── config.xml ├── controller.php ├── controllers │ ├── sitemap.php │ ├── sitemapitems.php │ ├── sitemaps.json.php │ └── sitemaps.php ├── form │ ├── fields │ │ ├── TraitOsmapField.php │ │ ├── layouts │ │ │ └── osmap │ │ │ │ ├── menus.php │ │ │ │ └── menus_j3.php │ │ ├── menus.php │ │ └── sitemaps.php │ ├── filter_sitemaps.xml │ └── sitemap.xml ├── helpers │ └── html │ │ └── osmap.php ├── include.php ├── language │ ├── en-GB │ │ ├── en-GB.com_osmap.ini │ │ └── en-GB.com_osmap.sys.ini │ ├── fr-FR │ │ ├── fr-FR.com_osmap.ini │ │ └── fr-FR.com_osmap.sys.ini │ └── tr-TR │ │ ├── tr-TR.com_osmap.ini │ │ └── tr-TR.com_osmap.sys.ini ├── library │ ├── Alledia │ │ └── OSMap │ │ │ ├── Button │ │ │ └── DefaultButton.php │ │ │ ├── Component │ │ │ └── Helper.php │ │ │ ├── Configuration.php │ │ │ ├── Container.php │ │ │ ├── Controller │ │ │ ├── Admin.php │ │ │ ├── Base.php │ │ │ ├── Form.php │ │ │ └── Json.php │ │ │ ├── Factory.php │ │ │ ├── Helper │ │ │ ├── General.php │ │ │ ├── Images.php │ │ │ └── Legacy.php │ │ │ ├── Plugin │ │ │ ├── Base.php │ │ │ └── ContentInterface.php │ │ │ ├── Router.php │ │ │ ├── Services │ │ │ └── Free.php │ │ │ ├── Sitemap │ │ │ ├── Collector.php │ │ │ ├── Images.php │ │ │ ├── Item.php │ │ │ ├── ItemAdapter │ │ │ │ ├── AdapterInterface.php │ │ │ │ └── Generic.php │ │ │ ├── News.php │ │ │ ├── SitemapInterface.php │ │ │ └── Standard.php │ │ │ └── View │ │ │ ├── Admin │ │ │ ├── AbstractForm.php │ │ │ └── AbstractList.php │ │ │ ├── Site │ │ │ └── AbstractList.php │ │ │ └── TraitOSMapView.php │ └── Installer │ │ └── OSMap │ │ ├── Free │ │ └── AbstractScript.php │ │ └── XmapConverter.php ├── models │ ├── sitemap.php │ ├── sitemapitems.php │ └── sitemaps.php ├── osmap.php ├── sql │ ├── install │ │ └── mysql │ │ │ └── install.sql │ ├── uninstall │ │ └── mysql │ │ │ └── uninstall.sql │ └── updates │ │ └── mysql │ │ └── 5.0.0.sql ├── tables │ ├── sitemap.php │ └── sitemapitems.php └── views │ ├── installer │ └── tmpl │ │ └── default_custom.php │ ├── sitemap │ ├── tmpl │ │ ├── edit.j3.php │ │ └── edit.php │ └── view.html.php │ ├── sitemapitems │ ├── tmpl │ │ ├── default.j3.php │ │ ├── default.php │ │ └── default_script.php │ └── view.html.php │ └── sitemaps │ ├── tmpl │ ├── default.j3.php │ ├── default.j3_previews.php │ ├── default.php │ ├── default_editlinks.php │ ├── default_previews.php │ ├── emptystate.php │ ├── modal.j3.php │ └── modal.php │ └── view.html.php ├── extensions ├── plg_osmap_demo │ ├── demo.php │ ├── demo.xml │ └── language │ │ ├── en-GB │ │ ├── en-GB.plg_osmap_demo.ini │ │ └── en-GB.plg_osmap_demo.sys.ini │ │ ├── fr-FR │ │ ├── fr-FR.plg_osmap_demo.ini │ │ └── fr-FR.plg_osmap_demo.sys.ini │ │ └── tr-TR │ │ ├── tr-TR.plg_osmap_demo.ini │ │ └── tr-TR.plg_osmap_demo.sys.ini └── plg_osmap_joomla │ ├── field │ ├── TraitShack.php │ └── radio.php │ ├── joomla.php │ ├── joomla.xml │ └── language │ ├── en-GB │ ├── en-GB.plg_osmap_joomla.ini │ └── en-GB.plg_osmap_joomla.sys.ini │ ├── fr-FR │ ├── fr-FR.plg_osmap_joomla.ini │ └── fr-FR.plg_osmap_joomla.sys.ini │ └── tr-TR │ ├── tr-TR.plg_osmap_joomla.ini │ └── tr-TR.plg_osmap_joomla.sys.ini ├── media ├── css │ ├── admin.css │ ├── admin.min.css │ ├── sitemap_html.css │ ├── sitemap_html.min.css │ ├── sitemap_html_debug.css │ └── sitemap_html_debug.min.css └── js │ ├── sitemapitems.js │ └── sitemapitems.min.js ├── osmap.xml ├── script.installer.php └── site ├── controller.php ├── helpers ├── osmap.php └── xmap.php ├── language ├── en-GB │ └── en-GB.com_osmap.ini ├── fr-FR │ └── fr-FR.com_osmap.ini └── tr-TR │ └── tr-TR.com_osmap.ini ├── osmap.php └── views ├── adminsitemapitems ├── tmpl │ ├── default.php │ └── default_items.php └── view.html.php ├── html ├── tmpl │ ├── default.php │ ├── default.xml │ └── default_items.php └── view.html.php ├── xml ├── tmpl │ ├── default.php │ ├── default.xml │ ├── default_images.php │ ├── default_news.php │ └── default_standard.php ├── view.html.php └── view.xml.php └── xsl ├── tmpl ├── images.php ├── news.php └── standard.php └── view.xsl.php /.gitignore: -------------------------------------------------------------------------------- 1 | # General exclusion of system files 2 | ################################### 3 | .* 4 | *~ 5 | *.bak 6 | build.properties 7 | vendor/ 8 | composer.lock 9 | 10 | !.gitignore 11 | !.gitkeep 12 | !.htaccess 13 | 14 | # Icon must ends with two \r. 15 | Icon 16 | 17 | 18 | # Windows Files # 19 | ################# 20 | # Windows image file caches 21 | Thumbs.db 22 | ehthumbs.db 23 | Desktop.ini 24 | $RECYCLE.BIN/ 25 | 26 | # Eclipse # 27 | ########### 28 | bin/** 29 | tmp/** 30 | tmp/**/* 31 | local.properties 32 | 33 | # JetBrains Apps # 34 | ## IntelliJ 35 | out/ 36 | 37 | # NetBeans IDE # 38 | ################ 39 | nbproject/private/ 40 | build/ 41 | nbbuild/ 42 | dist/ 43 | nbdist/ 44 | nbactions.xml 45 | nb-configuration.xml 46 | 47 | # Phing # 48 | ######### 49 | packages/* 50 | 51 | # misc other files # 52 | #################### 53 | _notes/ 54 | error_log 55 | config.codekit 56 | tests/_output/* 57 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Joomlashack](https://www.joomlashack.com/images/logo_circle_small.png)](https://www.joomlashack.com) 2 | 3 | OSMap 4 | ============ 5 | 6 | ## About 7 | 8 | OSMap - the easiest way to create a Joomla sitemap. 9 | 10 | ## How to migrate from Xmap 11 | 12 | 1. Make a full backup of your site 13 | 1. Do **not** uninstall Xmap 14 | 1. Install the latest version of OSMap. It will detect the XMap and migrate your data from it, including menus. Xmap will be disabled, if migrated successfully. 15 | * Any Xmap plugin will be preserved 16 | 1. Review the menu items, sitemaps and other relevant information 17 | * Was it migrated successfully? Let us, and the world, know :) 18 | * Did you had any issue? Restore the backup of your site and create an issue or support request with the details (do not send any private information for the public repository). 19 | 20 | ## How to contribute 21 | 22 | * Fork the repository and clone it locally. Pull the latest changes. 23 | * Create a new branch for your edits 24 | * Edit your files 25 | * Commit and Push to your new branch 26 | * Create a pull request for the **develop** branch 27 | 28 | ## Requirements 29 | 30 | * Joomla 3.7+ 31 | * php 5.6+ 32 | 33 | Last release compatible with J2.5: v3.3.0 34 | 35 | ## License 36 | 37 | [GNU General Public License v3](http://www.gnu.org/copyleft/gpl.html) 38 | -------------------------------------------------------------------------------- /build.dist.properties: -------------------------------------------------------------------------------- 1 | # Properties can be set in either a global.properties file in AllediaBuilder 2 | # or in the local build.properties file of the client repository. 3 | # All properties set in the client file override the global file. 4 | 5 | # This property is required! 6 | builder.path=/path/to/ShackBuilder 7 | 8 | # Set path properties here so the builder will know where 9 | # to find any extensions that need to be imported from 10 | # external folders. These are enumerated in the manifest using 11 | # 12 | # 13 | # 14 | # 15 | # 16 | # Required paths for OSMap Free 17 | project.ShackInstaller.path=/path/to/ShackInstaller 18 | project.ShackDefaultFiles.path=/path/to/ShackDefaultFiles 19 | project.ShackFramework.path=/path/to/ShackFramework 20 | project.ShackExtensionSupport.path=/path/to/ShackExtensionSupport 21 | 22 | # After the package has been built, it can be moved to another folder 23 | #project.movePackage=1 24 | #project.movePackageTo=packageFolder 25 | 26 | # After the package has been built, it can be moved to another folder 27 | #project.movePackage=1 28 | #project.movePackageTo=packageFolder 29 | 30 | # After the package is assembled, all php code can be validated. 31 | #builder.phplint=1 32 | -------------------------------------------------------------------------------- /build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | - 13 | Missing 'build.properties' file in the project root folder 14 | 15 | 16 | 17 | 18 | - 19 | Missing 'builder.path' property 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | - 30 | Missing '${builder.type}.xml' file in builder source path 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "joomlashack/osmap", 3 | "description" : "OSMap", 4 | "minimum-stability": "stable", 5 | "license" : "GPL-2.0-or-later", 6 | "type" : "joomla-component", 7 | "extra" : { 8 | "element" : "com_osmap", 9 | "element-short" : "osmap", 10 | "name" : "OSMap", 11 | "client" : "administrator", 12 | "package-license": "free", 13 | "target-platform": ".*", 14 | "infourl" : "/changelog/osmap/" 15 | }, 16 | "authors" : [ 17 | { 18 | "name" : "Guillermo Vargas", 19 | "email": "guille@vargas.co.cr" 20 | }, 21 | { 22 | "name" : "Joomlashack.com", 23 | "email": "help@joomlashack.com" 24 | } 25 | ], 26 | "require" : { 27 | "php" : ">=7.4", 28 | "ext-json" : "*", 29 | "ext-simplexml": "*" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /osmap.mwb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joomlashack/OSMap/1618d09989eeeae7075bdfa58736fb85a685114f/osmap.mwb -------------------------------------------------------------------------------- /src/admin/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
6 | 7 | 13 | 14 | 15 | 16 | 17 | 18 | 25 | 26 | 27 | 28 | 29 | 36 | 37 | 38 | 39 | 40 | 47 | 48 | 49 | 50 |
51 | 52 |
56 | 57 | 63 | 64 | 67 | 68 | 71 | 72 | 73 | 78 |
79 |
80 | -------------------------------------------------------------------------------- /src/admin/controller.php: -------------------------------------------------------------------------------- 1 | . 24 | */ 25 | 26 | use Alledia\OSMap; 27 | 28 | // phpcs:disable PSR1.Files.SideEffects 29 | defined('_JEXEC') or die(); 30 | // phpcs:enable PSR1.Files.SideEffects 31 | // phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace 32 | 33 | /** 34 | * Component Controller 35 | * 36 | * @package OSMap 37 | * @subpackage com_osmap 38 | */ 39 | class OSMapController extends OSMap\Controller\Base 40 | { 41 | protected $default_view = 'sitemaps'; 42 | } 43 | -------------------------------------------------------------------------------- /src/admin/controllers/sitemap.php: -------------------------------------------------------------------------------- 1 | . 24 | */ 25 | 26 | use Alledia\OSMap\Controller\Form; 27 | use Alledia\OSMap\Factory; 28 | use Joomla\CMS\Router\Route; 29 | 30 | // phpcs:disable PSR1.Files.SideEffects 31 | defined('_JEXEC') or die(); 32 | // phpcs:enable PSR1.Files.SideEffects 33 | // phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace 34 | 35 | class OSMapControllerSitemap extends Form 36 | { 37 | /** 38 | * @return void 39 | * @throws Exception 40 | */ 41 | public function setAsDefault() 42 | { 43 | $cid = Factory::getApplication()->input->get('cid', [], 'array'); 44 | 45 | if (isset($cid[0])) { 46 | // Cleanup the is_default field 47 | $db = Factory::getDbo(); 48 | 49 | $query = $db->getQuery(true) 50 | ->set('is_default = 0') 51 | ->update('#__osmap_sitemaps'); 52 | $db->setQuery($query)->execute(); 53 | 54 | // Set the sitemap as default 55 | $model = $this->getModel(); 56 | $row = $model->getTable(); 57 | 58 | $row->load($cid[0]); 59 | $row->save(['is_default' => true]); 60 | } 61 | 62 | $this->setRedirect(Route::_('index.php?option=com_osmap&view=sitemaps')); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/admin/controllers/sitemapitems.php: -------------------------------------------------------------------------------- 1 | . 24 | */ 25 | 26 | use Alledia\OSMap\Controller\Form; 27 | use Alledia\OSMap\Factory; 28 | 29 | // phpcs:disable PSR1.Files.SideEffects 30 | defined('_JEXEC') or die(); 31 | // phpcs:enable PSR1.Files.SideEffects 32 | // phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace 33 | 34 | class OSMapControllerSitemapItems extends Form 35 | { 36 | /** 37 | * @inheritDoc 38 | */ 39 | public function cancel($key = null) 40 | { 41 | $this->setRedirect('index.php?option=com_osmap&view=sitemaps'); 42 | } 43 | 44 | /** 45 | * @inheritDoc 46 | * @throws Exception 47 | */ 48 | public function save($key = null, $urlVar = null) 49 | { 50 | $this->checkToken(); 51 | 52 | $app = Factory::getApplication(); 53 | 54 | $sitemapId = $app->input->getInt('id'); 55 | $updateData = $app->input->get('update-data', null, 'raw'); 56 | $language = $app->input->getString('language'); 57 | 58 | $model = $this->getModel(); 59 | 60 | if ($updateData) { 61 | $updateData = json_decode($updateData, true); 62 | if ($updateData && is_array($updateData)) { 63 | foreach ($updateData as $data) { 64 | $row = $model->getTable(); 65 | $row->load([ 66 | 'sitemap_id' => $sitemapId, 67 | 'uid' => $data['uid'], 68 | 'settings_hash' => $data['settings_hash'], 69 | ]); 70 | 71 | $data['sitemap_id'] = $sitemapId; 72 | $data['format'] = '2'; 73 | 74 | $row->save($data) . ': ' . print_r($data, 1); 75 | } 76 | } 77 | } 78 | 79 | if ($this->getTask() === 'apply') { 80 | $query = [ 81 | 'option' => 'com_osmap', 82 | 'view' => 'sitemapitems', 83 | 'id' => $sitemapId, 84 | ]; 85 | 86 | if ($language) { 87 | $query['lang'] = $language; 88 | } 89 | 90 | $this->setRedirect('index.php?' . http_build_query($query)); 91 | 92 | } else { 93 | $this->setRedirect('index.php?option=com_osmap&view=sitemaps'); 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /src/admin/controllers/sitemaps.json.php: -------------------------------------------------------------------------------- 1 | . 24 | */ 25 | 26 | use Alledia\Installer\OSMap\XmapConverter; 27 | use Alledia\OSMap\Controller\Json; 28 | 29 | // phpcs:disable PSR1.Files.SideEffects 30 | defined('_JEXEC') or die(); 31 | // phpcs:enable PSR1.Files.SideEffects 32 | // phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace 33 | 34 | class OSMapControllerSitemaps extends Json 35 | { 36 | protected $text_prefix = 'COM_OSMAP_SITEMAP'; 37 | 38 | public function migrateXmapData() 39 | { 40 | $converter = new XmapConverter(); 41 | $converter->migrateData(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/admin/controllers/sitemaps.php: -------------------------------------------------------------------------------- 1 | . 24 | */ 25 | 26 | use Alledia\OSMap\Controller\Admin; 27 | 28 | // phpcs:disable PSR1.Files.SideEffects 29 | defined('_JEXEC') or die(); 30 | // phpcs:enable PSR1.Files.SideEffects 31 | // phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace 32 | 33 | class OSMapControllerSitemaps extends Admin 34 | { 35 | /** 36 | * @inheritdoc 37 | */ 38 | protected $text_prefix = 'COM_OSMAP_SITEMAP'; 39 | 40 | /** 41 | * @inheritDoc 42 | */ 43 | public function getModel($name = 'Sitemaps', $prefix = 'OSMapModel', $config = []) 44 | { 45 | return parent::getModel($name, $prefix, $config); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/admin/form/fields/TraitOsmapField.php: -------------------------------------------------------------------------------- 1 | . 23 | */ 24 | 25 | // phpcs:disable PSR1.Files.SideEffects 26 | defined('_JEXEC') or die(); 27 | // phpcs:enable PSR1.Files.SideEffects 28 | // phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace 29 | 30 | trait TraitOsmapField 31 | { 32 | /** 33 | * @inheritDoc 34 | */ 35 | public function setup(SimpleXMLElement $element, $value, $group = null) 36 | { 37 | if (is_callable([parent::class, 'setup']) && parent::setup($element, $value, $group)) { 38 | $include = JPATH_ADMINISTRATOR . '/components/com_osmap/include.php'; 39 | 40 | return is_file($include) && include $include; 41 | } 42 | 43 | return $this->enabled; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/admin/form/fields/menus.php: -------------------------------------------------------------------------------- 1 | . 24 | */ 25 | 26 | use Alledia\Framework\Joomla\Form\Field\TraitLayouts; 27 | use Alledia\OSMap\Factory; 28 | use Joomla\CMS\Form\FormField; 29 | use Joomla\Registry\Registry; 30 | 31 | // phpcs:disable PSR1.Files.SideEffects 32 | defined('_JEXEC') or die(); 33 | 34 | require_once 'TraitOsmapField.php'; 35 | // phpcs:enable PSR1.Files.SideEffects 36 | // phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace 37 | 38 | class OsmapFormFieldMenus extends FormField 39 | { 40 | use TraitOsmapField; 41 | use TraitLayouts; 42 | 43 | /** 44 | * @inheritdoc 45 | */ 46 | public $type = 'osmapmenus'; 47 | 48 | /** 49 | * @inheritdoc 50 | */ 51 | protected $layout = 'osmap.menus'; 52 | 53 | /** 54 | * @inheritDoc 55 | */ 56 | protected function getInput() 57 | { 58 | if (!is_array($this->value)) { 59 | // Ensure value is an array 60 | $registry = new Registry($this->value); 61 | $this->value = $registry->toArray(); 62 | } 63 | 64 | return parent::getInput(); 65 | } 66 | 67 | /** 68 | * @inheritDoc 69 | */ 70 | protected function getLayoutData() 71 | { 72 | return array_merge( 73 | parent::getLayoutData(), 74 | [ 75 | 'options' => $this->getOptions() 76 | ] 77 | ); 78 | } 79 | 80 | /** 81 | * @inheritDoc 82 | */ 83 | protected function getLabel() 84 | { 85 | return ''; 86 | } 87 | 88 | /** 89 | * @return object[] 90 | * @throws Exception 91 | */ 92 | protected function getOptions() 93 | { 94 | $db = Factory::getDbo(); 95 | 96 | // Get the list of menus from the database 97 | $query = $db->getQuery(true) 98 | ->select([ 99 | 'id AS value', 100 | 'title AS text' 101 | ]) 102 | ->from('#__menu_types AS menus') 103 | ->order('menus.title'); 104 | 105 | $options = $db->setQuery($query)->loadObjectList(); 106 | 107 | uasort($options, [$this, 'sortOptions']); 108 | 109 | return $options; 110 | } 111 | 112 | /** 113 | * @param object $a 114 | * @param object $b 115 | * 116 | * @return int 117 | */ 118 | public function sortOptions(object $a, object $b): int 119 | { 120 | $indexA = array_search($a->value, array_keys($this->value)); 121 | $indexB = array_search($b->value, array_keys($this->value)); 122 | 123 | if ($indexA === $indexB && $indexA !== false) { 124 | return 0; 125 | } 126 | 127 | if ($indexA === false && $indexA === $indexB) { 128 | return ($a->value < $b->value) ? -1 : 1; 129 | } 130 | 131 | if ($indexA === false) { 132 | return 1; 133 | } 134 | 135 | if ($indexB === false) { 136 | return -1; 137 | } 138 | 139 | return ($indexA < $indexB) ? -1 : 1; 140 | } 141 | } 142 | -------------------------------------------------------------------------------- /src/admin/form/fields/sitemaps.php: -------------------------------------------------------------------------------- 1 | . 24 | */ 25 | 26 | use Alledia\OSMap\Factory; 27 | use Joomla\CMS\Form\FormField; 28 | use Joomla\CMS\HTML\HTMLHelper; 29 | use Joomla\CMS\Language\Text; 30 | 31 | // phpcs:disable PSR1.Files.SideEffects 32 | defined('_JEXEC') or die(); 33 | 34 | require_once 'TraitOsmapField.php'; 35 | 36 | // phpcs:enable PSR1.Files.SideEffects 37 | // phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace 38 | 39 | class OsmapFormFieldSitemaps extends FormField 40 | { 41 | use TraitOsmapField; 42 | 43 | /** 44 | * @inheritdoc 45 | */ 46 | protected $type = 'Sitemaps'; 47 | 48 | /** 49 | * @var string 50 | */ 51 | protected static $scripts = []; 52 | 53 | /** 54 | * @inheritDoc 55 | */ 56 | protected function getInput() 57 | { 58 | if ($value = $this->value ?: '') { 59 | $db = Factory::getDbo(); 60 | $db->setQuery( 61 | $db->getQuery(true) 62 | ->select('name') 63 | ->from('#__osmap_sitemaps') 64 | ->where('id = ' . (int)$value) 65 | ); 66 | $selectedName = $db->loadResult(); 67 | } 68 | 69 | if (empty($selectedName)) { 70 | $selectedName = Text::_('COM_OSMAP_OPTION_SELECT_SITEMAP'); 71 | } 72 | 73 | $function = 'osmapSelectSitemap_' . $this->id; 74 | 75 | $linkQuery = [ 76 | 'option' => 'com_osmap', 77 | 'view' => 'sitemaps', 78 | 'layout' => 'modal', 79 | 'tmpl' => 'component', 80 | 'function' => $function 81 | ]; 82 | 83 | $link = 'index.php?' . htmlspecialchars(http_build_query($linkQuery)); 84 | 85 | return HTMLHelper::_( 86 | 'alledia.renderModal', 87 | [ 88 | 'id' => $this->id, 89 | 'name' => $this->name, 90 | 'link' => $link, 91 | 'function' => $function, 92 | 'itemType' => 'Sitemap', 93 | 'title' => Text::_('COM_OSMAP_OPTION_SELECT_SITEMAP'), 94 | 'hint' => $selectedName, 95 | 'value' => $value, 96 | 'required' => $this->required, 97 | ] 98 | ); 99 | } 100 | 101 | /** 102 | * @inheritDoc 103 | */ 104 | protected function getLabel() 105 | { 106 | return str_replace($this->id, $this->id . '_id', parent::getLabel()); 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /src/admin/form/filter_sitemaps.xml: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 6 | 7 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 46 | 47 |
48 | -------------------------------------------------------------------------------- /src/admin/form/sitemap.xml: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 | 10 |
11 | 12 |
13 | 18 | 19 | 21 | 22 | 24 | 25 | 27 |
28 | 29 |
30 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 48 | 49 | 50 | 51 |
52 |
53 | -------------------------------------------------------------------------------- /src/admin/helpers/html/osmap.php: -------------------------------------------------------------------------------- 1 | . 24 | */ 25 | 26 | use Joomla\CMS\HTML\HTMLHelper; 27 | use Joomla\CMS\Language\Text; 28 | use Joomla\CMS\Table\Table; 29 | 30 | // phpcs:disable PSR1.Files.SideEffects 31 | defined('_JEXEC') or die(); 32 | 33 | Table::addIncludePath(JPATH_COMPONENT . '/tables'); 34 | 35 | // phpcs:enable PSR1.Files.SideEffects 36 | // phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace 37 | 38 | abstract class JHtmlOSMap 39 | { 40 | /** 41 | * @param string $name 42 | * @param string $selected 43 | * @param int $j 44 | * 45 | * @return string 46 | */ 47 | public static function priorities($name, $selected = '0.5', $j = 0) 48 | { 49 | $options = []; 50 | foreach (static::priorityList() as $priority) { 51 | $options[] = HTMLHelper::_('select.option', $priority, $priority); 52 | } 53 | 54 | return HTMLHelper::_( 55 | 'select.genericlist', 56 | $options, 57 | $name, 58 | [ 59 | 'class' => 'form-select', 60 | 'style' => 'width: fit-content' 61 | ], 62 | 'value', 63 | 'text', 64 | $selected, 65 | $name . $j 66 | ); 67 | } 68 | 69 | /** 70 | * @param string $name 71 | * @param string $selected 72 | * @param int $j 73 | * 74 | * @return string 75 | */ 76 | public static function changefrequency($name, $selected = 'weekly', $j = 0) 77 | { 78 | $options = []; 79 | foreach (static::frequencyList() as $value => $text) { 80 | $options[] = HTMLHelper::_('select.option', $value, $text); 81 | } 82 | 83 | return HTMLHelper::_( 84 | 'select.genericlist', 85 | $options, 86 | $name, 87 | ['class' => 'form-select'], 88 | 'value', 89 | 'text', 90 | $selected, 91 | $name . $j 92 | ); 93 | } 94 | 95 | /** 96 | * @return float[] 97 | */ 98 | public static function priorityList() 99 | { 100 | $priorities = []; 101 | for ($i = 0.1; $i <= 1; $i += 0.1) { 102 | $priorities[] = number_format($i, 1); 103 | } 104 | 105 | return $priorities; 106 | } 107 | 108 | /** 109 | * @return string[] 110 | */ 111 | public static function frequencyList() 112 | { 113 | return [ 114 | 'always' => Text::_('COM_OSMAP_ALWAYS'), 115 | 'hourly' => Text::_('COM_OSMAP_HOURLY'), 116 | 'daily' => Text::_('COM_OSMAP_DAILY'), 117 | 'weekly' => Text::_('COM_OSMAP_WEEKLY'), 118 | 'monthly' => Text::_('COM_OSMAP_MONTHLY'), 119 | 'yearly' => Text::_('COM_OSMAP_YEARLY'), 120 | 'never' => Text::_('COM_OSMAP_NEVER') 121 | ]; 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /src/admin/include.php: -------------------------------------------------------------------------------- 1 | . 24 | */ 25 | 26 | use Alledia\Framework\AutoLoader; 27 | use Alledia\OSMap\Helper\General; 28 | use Joomla\CMS\Factory; 29 | use Joomla\CMS\Form\Form; 30 | use Joomla\CMS\HTML\HTMLHelper; 31 | use Joomla\CMS\Log\Log; 32 | use Joomla\CMS\Plugin\PluginHelper; 33 | use Joomla\CMS\Table\Table; 34 | 35 | // phpcs:disable PSR1.Files.SideEffects 36 | defined('_JEXEC') or die(); 37 | 38 | try { 39 | $frameworkPath = JPATH_SITE . '/libraries/allediaframework/include.php'; 40 | if ( 41 | is_file($frameworkPath) == false 42 | || (include $frameworkPath) == false 43 | ) { 44 | $app = Factory::getApplication(); 45 | 46 | if ($app->isClient('administrator')) { 47 | $app->enqueueMessage('[OSMap] Joomlashack framework not found', 'error'); 48 | } 49 | 50 | return false; 51 | } 52 | 53 | if (defined('ALLEDIA_FRAMEWORK_LOADED') && defined('OSMAP_LOADED') == false) { 54 | define('OSMAP_LOADED', 1); 55 | define('OSMAP_ADMIN_PATH', JPATH_ADMINISTRATOR . '/components/com_osmap'); 56 | define('OSMAP_SITE_PATH', JPATH_SITE . '/components/com_osmap'); 57 | define('OSMAP_LIBRARY_PATH', OSMAP_ADMIN_PATH . '/library'); 58 | 59 | define('OSMAP_LICENSE', is_file(OSMAP_LIBRARY_PATH . '/Alledia/OSMap/Services/Pro.php') ? 'pro' : 'free'); 60 | 61 | AutoLoader::register('Alledia', OSMAP_LIBRARY_PATH . '/Alledia'); 62 | AutoLoader::register('Pimple', OSMAP_LIBRARY_PATH . '/Pimple'); 63 | 64 | PluginHelper::importPlugin('osmap'); 65 | 66 | General::loadOptionLanguage(); 67 | 68 | Table::addIncludePath(OSMAP_ADMIN_PATH . '/tables'); 69 | Form::addFieldPath(OSMAP_ADMIN_PATH . '/fields'); 70 | Form::addFormPath(OSMAP_ADMIN_PATH . '/form'); 71 | HTMLHelper::addIncludePath(OSMAP_ADMIN_PATH . '/helpers/html'); 72 | 73 | if (Factory::getApplication()->getName() == 'administrator') { 74 | HTMLHelper::_('alledia.fontawesome'); 75 | } 76 | 77 | Log::addLogger(['text_file' => 'com_osmap.errors.php'], Log::ALL, ['com_osmap']); 78 | } 79 | 80 | } catch (Throwable $error) { 81 | Factory::getApplication()->enqueueMessage('[OSMap] Unable to initialize: ' . $error->getMessage(), 'error'); 82 | 83 | return false; 84 | } 85 | 86 | return defined('ALLEDIA_FRAMEWORK_LOADED') && defined('OSMAP_LOADED'); 87 | -------------------------------------------------------------------------------- /src/admin/language/en-GB/en-GB.com_osmap.sys.ini: -------------------------------------------------------------------------------- 1 | ; @package OSMap 2 | ; @package OSMap 3 | ; @contact www.joomlashack.com, help@joomlashack.com 4 | ; @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 5 | ; @copyright 2016-2025 Joomlashack.com. All rights reserved. 6 | ; @license https://www.gnu.org/licenses/gpl.html GNU/GPL 7 | ; 8 | ; This file is part of OSMap. 9 | ; 10 | ; OSMap is free software: you can redistribute it and/or modify 11 | ; it under the terms of the GNU General Public License as published by 12 | ; the Free Software Foundation, either version 2 of the License, or 13 | ; (at your option) any later version. 14 | ; 15 | ; OSMap is distributed in the hope that it will be useful, 16 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | ; GNU General Public License for more details. 19 | ; 20 | ; You should have received a copy of the GNU General Public License 21 | ; along with OSMap. If not, see . 22 | ; 23 | ; Note : All ini files need to be saved as UTF-8 - No BOM 24 | 25 | COM_OSMAP="OSMap Free" 26 | COM_OSMAP_DESCRIPTION="OSMap - the easiest way to create a Joomla sitemap." 27 | COM_OSMAP_CONFIGURATION="OSMap Options" 28 | 29 | COM_OSMAP_CHANGE_SITEMAP = "Select a sitemap from the list" 30 | COM_OSMAP_CHANGE_SITEMAP_BUTTON = "Change" 31 | 32 | COM_OSMAP_FIELDSET_SITEMAP_SETTINGS_LABEL = "Sitemap Settings" 33 | 34 | COM_OSMAP_INSTALLER_ERROR_MIGRATING_DATA = "Error found trying to upgrade your sitemaps: %s. Please, contact the support team." 35 | COM_OSMAP_INSTALLER_GOTOPLUGINS = "Go to %s page to enable or disable the OSMap plugins you need." 36 | COM_OSMAP_INSTALLER_IMPORT_XMAP_BUTTON = "Import Xmap data" 37 | COM_OSMAP_INSTALLER_IMPORT_XMAP_DESCRIPTION = "We have found Xmap and its data! Would you like to import the data into OSMap?" 38 | COM_OSMAP_INSTALLER_IMPORT_XMAP_ERROR = "Sorry, we weren't able to migrate Xmap data successfully. Any change were rolled back." 39 | COM_OSMAP_INSTALLER_IMPORT_XMAP_SUCCESS = "Congratulations! The Xmap data was migrated successfully. You can now safely uninstall the Xmap component, but keep the plugins." 40 | COM_OSMAP_INSTALLER_IMPORT_XMAP_TITLE = "Xmap data found!" 41 | COM_OSMAP_INSTALLER_IMPORT_XMAP_WIPE_WARNING = "Please note: this migration will import your data to OSMap, but also remove any data found in the Xmap." 42 | COM_OSMAP_INSTALLER_IMPORTING = "Importing..." 43 | COM_OSMAP_INSTALLER_PLUGINS_PAGE = "plugins page" 44 | COM_OSMAP_INSTALLER_WIPE_CONFIRMATION = "Are you really sure you want to wipe the current Xmap data? The data will be imported to OSMap." 45 | 46 | COM_OSMAP_NEWS_PUBLICATION_NAME_DESC = "If enabled, will set the publication name in the news sitemap" 47 | COM_OSMAP_NEWS_PUBLICATION_NAME_LABEL = "News Publication Name" 48 | 49 | COM_OSMAP_OPTION_ADD_STYLING_DESC = "If enabled, apply the styling to the XML making it more userfriednly when opened in a browser. Do not affect Google or other bots." 50 | COM_OSMAP_OPTION_ADD_STYLING_LABEL = "Add Styling" 51 | COM_OSMAP_OPTION_DEBUG_DESC = "If enabled, will display the sitemap as text, allowing to see the warnings or errors. Requires to set the global settings to display the errors." 52 | COM_OSMAP_OPTION_DEBUG_LABEL = "Debug" 53 | COM_OSMAP_OPTION_IGNORE_DUPLICATED_UIDS_DESC = "If enabled, will make the XML sitemap ignore duplicated items automatically." 54 | COM_OSMAP_OPTION_IGNORE_DUPLICATED_UIDS_LABEL = "Ignore Duplicated Items" 55 | COM_OSMAP_OPTION_IGNORE_HIDDEN_MENUS_DESC = "By default, menus marked as hidden are included. Set to 'Yes' to keep them off the sitemap" 56 | COM_OSMAP_OPTION_IGNORE_HIDDEN_MENUS_LABEL = "Ignore Hidden Menus" 57 | COM_OSMAP_OPTION_ONLY_HTML = "Only in the HTML Sitemap" 58 | COM_OSMAP_OPTION_SELECT_SITEMAP = "Choose a sitemap" 59 | COM_OSMAP_OPTION_SHOW_EXTERNAL_LINKS_DESC = "If enabled, shows the external links in the sitemap" 60 | COM_OSMAP_OPTION_SHOW_EXTERNAL_LINKS_LABEL = "Show External Links" 61 | COM_OSMAP_OPTION_SHOW_MENU_TITLES_DESC = "If enabled, displays the title for each menu in the sitemap" 62 | COM_OSMAP_OPTION_SHOW_MENU_TITLES_LABEL = "Show Menu Titles" 63 | COM_OSMAP_OPTION_USE_CSS_DESC = "If enabled will add the basic CSS to the view. This option is useful to fix the style for the hierarchy of the sitemap items, which is overriden by some templates." 64 | COM_OSMAP_OPTION_USE_CSS_LABEL = "Add basic CSS" 65 | 66 | COM_OSMAP_SHOW_SITEMAP_DESCRIPTION_DESC = "If enabled, shows the sitemap description before the items" 67 | COM_OSMAP_SHOW_SITEMAP_DESCRIPTION_LABEL = "Show sitemap description" 68 | 69 | COM_OSMAP_SITEMAP_DESCRIPTION_DESC = "The sitemap description." 70 | COM_OSMAP_SITEMAP_DESCRIPTION_LABEL = "Description" 71 | COM_OSMAP_SITEMAP_HTML_VIEW_DEFAULT_DESC = "Display a Site map in HTML format" 72 | COM_OSMAP_SITEMAP_HTML_VIEW_DEFAULT_TITLE = "Sitemap - HTML Format" 73 | COM_OSMAP_SITEMAP_XML_VIEW_DEFAULT_DESC = "Display a Site map in XML for: default XML, images and news" 74 | COM_OSMAP_SITEMAP_XML_VIEW_DEFAULT_TITLE = "Sitemap - XML Format (default XML, images and news)" 75 | 76 | COM_OSMAP_SUBMENU_EXTENSIONS = "Extensions" 77 | COM_OSMAP_SUBMENU_SITEMAPS = "Sitemaps" 78 | 79 | COM_OSMAP_TITLE = "OSMap Free" 80 | -------------------------------------------------------------------------------- /src/admin/library/Alledia/OSMap/Button/DefaultButton.php: -------------------------------------------------------------------------------- 1 | . 23 | */ 24 | 25 | namespace Alledia\OSMap\Button; 26 | 27 | use Joomla\CMS\Button\ActionButton; 28 | use Joomla\CMS\Language\Text; 29 | 30 | // phpcs:disable PSR1.Files.SideEffects 31 | defined('_JEXEC') or die(); 32 | // phpcs:enable PSR1.Files.SideEffects 33 | 34 | class DefaultButton extends ActionButton 35 | { 36 | protected function preprocess() 37 | { 38 | $this->addState( 39 | 0, 40 | 'sitemap.setAsDefault', 41 | 'icon-unfeatured', 42 | Text::_('COM_OSMAP_SITEMAP_IS_DEFAULT_LABEL'), 43 | ['tip_title' => Text::_('COM_OSMAP_SITEMAP_IS_DEFAULT_DESC')] 44 | ); 45 | $this->addState( 46 | 1, 47 | 'sitemap.setAsDefault', 48 | 'icon-color-featured icon-star', 49 | Text::_('COM_OSMAP_SITEMAP_IS_DEFAULT_LABEL') 50 | ); 51 | 52 | parent::preprocess(); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/admin/library/Alledia/OSMap/Component/Helper.php: -------------------------------------------------------------------------------- 1 | . 24 | */ 25 | 26 | namespace Alledia\OSMap\Component; 27 | 28 | use Joomla\CMS\Component\ComponentHelper; 29 | 30 | // phpcs:disable PSR1.Files.SideEffects 31 | defined('_JEXEC') or die(); 32 | // phpcs:enable PSR1.Files.SideEffects 33 | 34 | abstract class Helper extends ComponentHelper 35 | { 36 | /** 37 | * @inheritDoc 38 | */ 39 | public static function getParams($option = 'com_osmap', $strict = false) 40 | { 41 | return parent::getParams($option, $strict); 42 | } 43 | 44 | /** 45 | * @inheritDoc 46 | */ 47 | public static function getComponent($option = 'com_osmap', $strict = false) 48 | { 49 | return parent::getComponent($option, $strict); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/admin/library/Alledia/OSMap/Controller/Admin.php: -------------------------------------------------------------------------------- 1 | . 24 | */ 25 | 26 | namespace Alledia\OSMap\Controller; 27 | 28 | use Alledia\OSMap\Factory; 29 | use Exception; 30 | use Joomla\CMS\Language\Text; 31 | use Joomla\CMS\MVC\Controller\AdminController; 32 | use Joomla\CMS\Plugin\PluginHelper; 33 | use Joomla\CMS\Session\Session; 34 | 35 | // phpcs:disable PSR1.Files.SideEffects 36 | defined('_JEXEC') or die(); 37 | // phpcs:enable PSR1.Files.SideEffects 38 | 39 | abstract class Admin extends AdminController 40 | { 41 | /** 42 | * @inheritDoc 43 | */ 44 | public function execute($task) 45 | { 46 | $this->task = $task; 47 | 48 | $task = strtolower($task); 49 | 50 | PluginHelper::importPlugin('osmap'); 51 | 52 | $controllerName = strtolower(str_replace('OSMapController', '', get_class($this))); 53 | $eventParams = [$controllerName, $task]; 54 | $results = Factory::getApplication()->triggerEvent('osmapOnBeforeExecuteTask', $eventParams); 55 | 56 | // Check if any of the plugins returned the exit signal 57 | if (is_array($results) && in_array('exit', $results, true)) { 58 | Factory::getApplication()->enqueueMessage('COM_OSMAP_MSG_TASK_STOPPED_BY_PLUGIN', 'warning'); 59 | 60 | return null; 61 | } 62 | 63 | if (isset($this->taskMap[$task])) { 64 | $doTask = $this->taskMap[$task]; 65 | 66 | } elseif (isset($this->taskMap['__default'])) { 67 | $doTask = $this->taskMap['__default']; 68 | 69 | } else { 70 | throw new Exception(Text::sprintf('JLIB_APPLICATION_ERROR_TASK_NOT_FOUND', $task), 404); 71 | } 72 | 73 | // Record the actual task being fired 74 | $this->doTask = $doTask; 75 | 76 | $result = $this->$doTask(); 77 | 78 | // Runs the event after the task was executed 79 | $eventParams[] = &$result; 80 | Factory::getApplication()->triggerEvent('osmapOnAfterExecuteTask', $eventParams); 81 | 82 | return $result; 83 | } 84 | 85 | /** 86 | * @inheritDoc 87 | */ 88 | public function checkToken($method = 'post', $redirect = true) 89 | { 90 | if (is_callable([parent::class, 'checkToken'])) { 91 | return parent::checkToken($method, $redirect); 92 | } 93 | 94 | Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); 95 | 96 | return true; 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /src/admin/library/Alledia/OSMap/Controller/Base.php: -------------------------------------------------------------------------------- 1 | . 24 | */ 25 | 26 | namespace Alledia\OSMap\Controller; 27 | 28 | use Alledia\OSMap\Factory; 29 | use Joomla\CMS\Language\Text; 30 | use Joomla\CMS\MVC\Controller\BaseController; 31 | use Joomla\CMS\Session\Session; 32 | 33 | // phpcs:disable PSR1.Files.SideEffects 34 | defined('_JEXEC') or die(); 35 | // phpcs:enable PSR1.Files.SideEffects 36 | 37 | class Base extends BaseController 38 | { 39 | public function checkToken($method = 'post', $redirect = true) 40 | { 41 | $valid = Session::checkToken(); 42 | if (!$valid && $redirect) { 43 | $home = Factory::getApplication()->getMenu()->getDefault(); 44 | $container = Factory::getPimpleContainer(); 45 | 46 | $app = Factory::getApplication(); 47 | 48 | $app->enqueueMessage(Text::_('JINVALID_TOKEN'), 'error'); 49 | $app->redirect($container->router->routeURL('index.php?Itemid=' . $home->id)); 50 | } 51 | 52 | return $valid; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/admin/library/Alledia/OSMap/Controller/Form.php: -------------------------------------------------------------------------------- 1 | . 24 | */ 25 | 26 | namespace Alledia\OSMap\Controller; 27 | 28 | use Alledia\OSMap\Factory; 29 | use Joomla\CMS\Language\Text; 30 | use Joomla\CMS\MVC\Controller\FormController; 31 | use Joomla\CMS\Plugin\PluginHelper; 32 | 33 | // phpcs:disable PSR1.Files.SideEffects 34 | defined('_JEXEC') or die(); 35 | // phpcs:enable PSR1.Files.SideEffects 36 | 37 | abstract class Form extends FormController 38 | { 39 | /** 40 | * @inheritDoc 41 | */ 42 | public function execute($task) 43 | { 44 | $this->task = $task; 45 | 46 | $task = strtolower($task); 47 | 48 | PluginHelper::importPlugin('osmap'); 49 | 50 | $controllerName = strtolower(str_replace('OSMapController', '', get_class($this))); 51 | $eventParams = [ 52 | $controllerName, 53 | $task 54 | ]; 55 | $results = Factory::getApplication()->triggerEvent('osmapOnBeforeExecuteTask', $eventParams); 56 | 57 | // Check if any of the plugins returned the exit signal 58 | if (is_array($results) && in_array('exit', $results, true)) { 59 | Factory::getApplication()->enqueueMessage('COM_OSMAP_MSG_TASK_STOPPED_BY_PLUGIN', 'warning'); 60 | return null; 61 | } 62 | 63 | if (isset($this->taskMap[$task])) { 64 | $doTask = $this->taskMap[$task]; 65 | } elseif (isset($this->taskMap['__default'])) { 66 | $doTask = $this->taskMap['__default']; 67 | } else { 68 | throw new \Exception(Text::sprintf('JLIB_APPLICATION_ERROR_TASK_NOT_FOUND', $task), 404); 69 | } 70 | 71 | // Record the actual task being fired 72 | $this->doTask = $doTask; 73 | 74 | $result = $this->$doTask(); 75 | 76 | // Runs the event after the task was executed 77 | $eventParams[] = &$result; 78 | Factory::getApplication()->triggerEvent('osmapOnAfterExecuteTask', $eventParams); 79 | 80 | return $result; 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /src/admin/library/Alledia/OSMap/Controller/Json.php: -------------------------------------------------------------------------------- 1 | . 24 | */ 25 | 26 | namespace Alledia\OSMap\Controller; 27 | 28 | use Joomla\CMS\Language\Text; 29 | 30 | // phpcs:disable PSR1.Files.SideEffects 31 | defined('_JEXEC') or die(); 32 | // phpcs:enable PSR1.Files.SideEffects 33 | 34 | class Json extends \JControllerLegacy 35 | { 36 | /** 37 | * @param string $method 38 | * @param bool $redirect 39 | * 40 | * @return bool 41 | * @throws \Exception 42 | */ 43 | public function checkToken($method = 'post', $redirect = true) 44 | { 45 | if (!\JSession::checkToken()) { 46 | throw new \Exception(Text::_('JINVALID_TOKEN'), 403); 47 | } 48 | 49 | return true; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/admin/library/Alledia/OSMap/Factory.php: -------------------------------------------------------------------------------- 1 | . 24 | */ 25 | 26 | namespace Alledia\OSMap; 27 | 28 | use Alledia\OSMap\Sitemap\SitemapInterface; 29 | use Joomla\CMS\Application\AdministratorApplication; 30 | use Joomla\CMS\Application\CMSApplication; 31 | use Joomla\CMS\Application\SiteApplication; 32 | use Joomla\CMS\Language\Text; 33 | use Joomla\CMS\Table\Table; 34 | 35 | // phpcs:disable PSR1.Files.SideEffects 36 | defined('_JEXEC') or die(); 37 | // phpcs:enable PSR1.Files.SideEffects 38 | 39 | /** 40 | * OSMap Factory 41 | */ 42 | class Factory extends \Alledia\Framework\Factory 43 | { 44 | /** 45 | * @var Container 46 | */ 47 | protected static Container $pimpleContainer; 48 | 49 | /** 50 | * @var string[] 51 | */ 52 | protected static array $applications = [ 53 | 'site' => SiteApplication::class, 54 | 'administrator' => AdministratorApplication::class, 55 | ]; 56 | 57 | /** 58 | * @param string $client 59 | * 60 | * @return CMSApplication 61 | * 62 | * @throws \Exception 63 | */ 64 | public static function getJoomlaClient(string $client): CMSApplication 65 | { 66 | $appClass = self::$applications[$client] ?? null; 67 | 68 | if ($appClass) { 69 | if (is_callable([static::class, 'getContainer'])) { 70 | return parent::getContainer()->get($appClass); 71 | 72 | } else { 73 | return CMSApplication::getInstance($client); 74 | } 75 | } 76 | 77 | throw new \Exception(Text::sprintf('COM_OSMAP_ERROR_APPLICATION', $client)); 78 | } 79 | 80 | /** 81 | * Get a OSMap container class 82 | * 83 | * @return Container 84 | */ 85 | public static function getPimpleContainer(): Container 86 | { 87 | if (empty(static::$pimpleContainer)) { 88 | $config = []; 89 | 90 | $container = new Container(['configuration' => new Configuration($config)]); 91 | 92 | // Load the Service class according to the current license 93 | $serviceClass = '\\Alledia\\OSMap\\Services\\' . ucfirst(OSMAP_LICENSE); 94 | 95 | $container->register(new $serviceClass()); 96 | 97 | static::$pimpleContainer = $container; 98 | } 99 | 100 | return static::$pimpleContainer; 101 | } 102 | 103 | /** 104 | * Returns an instance of the Sitemap class according to the given id and 105 | * sitemap type. 106 | * 107 | * @param ?int $id 108 | * @param string $type 109 | * 110 | * @return SitemapInterface 111 | * @throws \Exception 112 | */ 113 | public static function getSitemap(?int $id, string $type = 'standard'): ?SitemapInterface 114 | { 115 | if ($id > 0) { 116 | switch ($type) { 117 | case 'standard': 118 | return new Sitemap\Standard($id); 119 | 120 | case 'images': 121 | return new Sitemap\Images($id); 122 | 123 | case 'news': 124 | return new Sitemap\News($id); 125 | } 126 | } 127 | 128 | return null; 129 | } 130 | 131 | /** 132 | * Returns an instance of a table. If no prefix is set, we use OSMap's table 133 | * prefix as default. 134 | * 135 | * @param string $tableName 136 | * @param ?string $prefix 137 | * 138 | * @return Table 139 | */ 140 | public static function getTable(string $tableName, ?string $prefix = 'OSMapTable'): ?Table 141 | { 142 | return Table::getInstance($tableName, $prefix); 143 | } 144 | } 145 | -------------------------------------------------------------------------------- /src/admin/library/Alledia/OSMap/Helper/Images.php: -------------------------------------------------------------------------------- 1 | . 24 | */ 25 | 26 | namespace Alledia\OSMap\Helper; 27 | 28 | use Alledia\OSMap\Factory; 29 | use Exception; 30 | 31 | // phpcs:disable PSR1.Files.SideEffects 32 | defined('_JEXEC') or die(); 33 | // phpcs:enable PSR1.Files.SideEffects 34 | // phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace 35 | 36 | 37 | class Images 38 | { 39 | /** 40 | * Extracts images from the given text. 41 | * 42 | * @param string $text 43 | * @param ?int $max 44 | * 45 | * @return array 46 | * @throws Exception 47 | */ 48 | public function getImagesFromText(string $text, int $max = 0): array 49 | { 50 | $container = Factory::getPimpleContainer(); 51 | $images = []; 52 | 53 | // Look for tags 54 | preg_match_all( 55 | '/](?=.*(?:src="(?P[^"]*)"))?(?=.*(title="(?P[^"]*)"))?(?=.*(alt="(?P<alt>[^"]*)"))?.[^>]*>/i', 56 | $text, 57 | $matches1, 58 | PREG_SET_ORDER 59 | ); 60 | 61 | // Look for <a> tags with href to images 62 | preg_match_all( 63 | '/<a[^>](?=.*(?:href="(?P<src>[^"]+\.(gif|png|jpg|jpeg))"))(?=.*(title="(?P<title>[^"]*)"))?.[^>]*>/i', 64 | $text, 65 | $matches2, 66 | PREG_SET_ORDER 67 | ); 68 | 69 | $matches = array_merge($matches1, $matches2); 70 | 71 | if (count($matches)) { 72 | if ($max > 0) { 73 | $matches = array_slice($matches, 0, $max); 74 | } 75 | 76 | foreach ($matches as $match) { 77 | if ( 78 | ($src = trim($match['src'] ?? '')) 79 | && $container->router->isInternalURL($src) 80 | ) { 81 | if ($container->router->isRelativeUri($src)) { 82 | $src = $container->router->convertRelativeUriToFullUri($src); 83 | } 84 | 85 | $title = trim($match['title'] ?? ''); 86 | $alt = trim($match['alt'] ?? ''); 87 | 88 | $images[] = (object)[ 89 | 'src' => $src, 90 | 'title' => $title ?: ($alt ?: '') 91 | ]; 92 | } 93 | } 94 | } 95 | 96 | return $images; 97 | } 98 | 99 | /** 100 | * Return an array of images from the content image params. 101 | * 102 | * @param object $item 103 | * 104 | * @return array 105 | * @throws Exception 106 | */ 107 | public function getImagesFromParams($item) 108 | { 109 | $container = Factory::getPimpleContainer(); 110 | $imagesParam = json_decode($item->images); 111 | $images = []; 112 | 113 | if (isset($imagesParam->image_intro) && !empty($imagesParam->image_intro)) { 114 | $ignoreAlt = $imagesParam->image_intro_alt_empty ?? false; 115 | 116 | $images[] = (object)[ 117 | 'src' => $container->router->convertRelativeUriToFullUri($imagesParam->image_intro), 118 | 'title' => $imagesParam->image_intro_caption 119 | ?: ($ignoreAlt ? null : $imagesParam->image_intro_alt) 120 | ]; 121 | } 122 | 123 | if (isset($imagesParam->image_fulltext) && !empty($imagesParam->image_fulltext)) { 124 | $ignoreAlt = $imagesParam->image_fulltext_alt_empty ?? true; 125 | $images[] = (object)[ 126 | 'src' => $container->router->convertRelativeUriToFullUri($imagesParam->image_fulltext), 127 | 'title' => $imagesParam->image_fulltext_caption 128 | ?: ($ignoreAlt ? null : $imagesParam->image_fulltext_all) 129 | ]; 130 | } 131 | 132 | return $images; 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /src/admin/library/Alledia/OSMap/Helper/Legacy.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 7 | * @copyright 2016-2025 Joomlashack.com. All rights reserved. 8 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 9 | * 10 | * This file is part of OSMap. 11 | * 12 | * OSMap is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * OSMap is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 24 | */ 25 | 26 | namespace Alledia\OSMap\Helper; 27 | 28 | use Alledia\OSMap\Factory; 29 | 30 | defined('_JEXEC') or die(); 31 | 32 | abstract class Legacy 33 | { 34 | /** 35 | * Method to return a list of language home page menu items. 36 | * Added here to keep compatibility with Joomla 3.4.x. 37 | * 38 | * @return array of menu objects. 39 | */ 40 | public static function getSiteHomePages() 41 | { 42 | // To avoid doing duplicate database queries. 43 | static $multilangSiteHomePages = null; 44 | 45 | if (!isset($multilangSiteHomePages)) { 46 | // Check for Home pages languages. 47 | $db = Factory::getDbo(); 48 | $query = $db->getQuery(true) 49 | ->select('language') 50 | ->select('id') 51 | ->from($db->quoteName('#__menu')) 52 | ->where('home = 1') 53 | ->where('published = 1') 54 | ->where('client_id = 0'); 55 | $db->setQuery($query); 56 | 57 | $multilangSiteHomePages = $db->loadObjectList('language'); 58 | } 59 | 60 | return $multilangSiteHomePages; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/admin/library/Alledia/OSMap/Plugin/Base.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 7 | * @copyright 2016-2025 Joomlashack.com. All rights reserved. 8 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 9 | * 10 | * This file is part of OSMap. 11 | * 12 | * OSMap is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * OSMap is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 24 | */ 25 | 26 | namespace Alledia\OSMap\Plugin; 27 | 28 | use Alledia\Framework\Exception; 29 | use Joomla\CMS\Language\Text; 30 | use Joomla\CMS\Plugin\CMSPlugin; 31 | 32 | defined('_JEXEC') or die(); 33 | 34 | abstract class Base extends CMSPlugin 35 | { 36 | /** 37 | * @var int 38 | */ 39 | protected static $memoryLimit = null; 40 | 41 | /** 42 | * Minimum memory in MB required to continue on sites with limited memory 43 | * 44 | * @var int 45 | */ 46 | protected static $memoryMinimum = 4; 47 | 48 | /** 49 | * @inheritDoc 50 | */ 51 | public function __construct(&$subject, $config = []) 52 | { 53 | require_once JPATH_ADMINISTRATOR . '/components/com_osmap/include.php'; 54 | 55 | parent::__construct($subject, $config); 56 | } 57 | 58 | /** 59 | * Set memory limit to unlimited. If unable to do so, 60 | * we'll want to check that we have enough memory left to continue, 61 | * so we can fail gracefully 62 | * 63 | * @return void 64 | */ 65 | protected static function fixMemoryLimit() 66 | { 67 | if (static::$memoryLimit === null) { 68 | $limit = @ini_set('memory_limit', -1); 69 | 70 | if (empty($limit)) { 71 | $mags = [ 72 | 'K' => 1024, 73 | 'M' => 1024 * 1024, 74 | 'G' => 1024 * 1024 * 1024 75 | ]; 76 | $limit = ini_get('memory_limit'); 77 | $regex = sprintf('/(\d*)([%s])/', join(array_keys($mags))); 78 | if (preg_match($regex, $limit, $match)) { 79 | $limit = $match[1] * $mags[$match[2]]; 80 | } 81 | 82 | static::$memoryLimit = $limit; 83 | static::$memoryMinimum *= $mags['M']; 84 | } 85 | } 86 | } 87 | 88 | /** 89 | * Check to see if we're about to run out of memory. If things get too tight 90 | * all we can do is throw an informative message or redirect somewhere else 91 | * that isn't an OSMap page 92 | * 93 | * @TODO: Decide whether to implement the redirect option 94 | * 95 | * @return void 96 | * @throws Exception 97 | */ 98 | protected static function checkMemory() 99 | { 100 | if (static::$memoryLimit === null) { 101 | static::fixMemoryLimit(); 102 | } 103 | 104 | if (static::$memoryLimit && (static::$memoryLimit - memory_get_usage(true) < static::$memoryMinimum)) { 105 | $message = Text::sprintf('COM_OSMAP_WARNING_OOM', get_called_class()); 106 | throw new Exception($message, 500); 107 | } 108 | } 109 | 110 | /** 111 | * @param string $url 112 | * 113 | * @return string 114 | */ 115 | protected static function getViewFromUrl(string $url): string 116 | { 117 | $linkUrl = parse_url($url); 118 | if (isset($linkUrl['query'])) { 119 | parse_str($linkUrl['query'], $linkQuery); 120 | 121 | if (isset($linkQuery['view'])) { 122 | return $linkQuery['view']; 123 | } 124 | } 125 | 126 | return ''; 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /src/admin/library/Alledia/OSMap/Plugin/ContentInterface.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 7 | * @copyright 2016-2025 Joomlashack.com. All rights reserved. 8 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 9 | * 10 | * This file is part of OSMap. 11 | * 12 | * OSMap is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * OSMap is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 24 | */ 25 | 26 | namespace Alledia\OSMap\Plugin; 27 | 28 | use Alledia\OSMap\Sitemap\Collector; 29 | use Alledia\OSMap\Sitemap\Item; 30 | use Joomla\Registry\Registry; 31 | 32 | defined('_JEXEC') or die(); 33 | 34 | 35 | interface ContentInterface 36 | { 37 | /** 38 | * Returns the unique instance of the plugin 39 | * 40 | * @return object 41 | */ 42 | public static function getInstance(); 43 | 44 | /** 45 | * Returns the element of the component which this plugin supports. 46 | * 47 | * @return string 48 | */ 49 | public function getComponentElement(); 50 | 51 | /** 52 | * This function is called before a menu item is used. We use it to set the 53 | * proper uniqueid for the item 54 | * 55 | * @param Item $node Menu item to be "prepared" 56 | * @param Registry $params The extension params 57 | * 58 | * @return void 59 | * @since 1.2 60 | */ 61 | public static function prepareMenuItem($node, $params); 62 | 63 | /** 64 | * Expands a com_content menu item 65 | * 66 | * @param Collector $collector 67 | * @param Item $parent 68 | * @param Registry $params 69 | * 70 | * @return void 71 | * @since 1.0 72 | */ 73 | public static function getTree($collector, $parent, $params); 74 | } 75 | -------------------------------------------------------------------------------- /src/admin/library/Alledia/OSMap/Services/Free.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 7 | * @copyright 2016-2025 Joomlashack.com. All rights reserved. 8 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 9 | * 10 | * This file is part of OSMap. 11 | * 12 | * OSMap is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * OSMap is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 24 | */ 25 | 26 | namespace Alledia\OSMap\Services; 27 | 28 | use Alledia\Framework\Profiler; 29 | use Alledia\OSMap\Factory; 30 | use Alledia\OSMap\Helper\Images; 31 | use Alledia\OSMap\Router; 32 | use Joomla\CMS\Uri\Uri; 33 | use Pimple\Container as Pimple; 34 | use Pimple\ServiceProviderInterface; 35 | 36 | defined('_JEXEC') or die(); 37 | 38 | /** 39 | * Class Services 40 | * 41 | * Pimple services for OSMap. The container must be instantiated with 42 | * at least the following values: 43 | * 44 | * new \OSMap\Container( 45 | * array( 46 | * 'configuration' => new Configuration($config) 47 | * ) 48 | * ) 49 | * 50 | * @package OSMap 51 | */ 52 | class Free implements ServiceProviderInterface 53 | { 54 | /** 55 | * Registers services on the given container. 56 | * 57 | * This method should only be used to configure services and parameters. 58 | * It should not get services. 59 | * 60 | * @param Pimple $pimple 61 | */ 62 | public function register(Pimple $pimple) 63 | { 64 | $pimple['app'] = function () { 65 | return Factory::getApplication(); 66 | }; 67 | 68 | $pimple['db'] = function () { 69 | return Factory::getDbo(); 70 | }; 71 | 72 | $pimple['input'] = function () { 73 | return Factory::getApplication()->input; 74 | }; 75 | 76 | $pimple['user'] = function () { 77 | return Factory::getUser(); 78 | }; 79 | 80 | $pimple['language'] = function () { 81 | return Factory::getLanguage(); 82 | }; 83 | 84 | $pimple['profiler'] = function () { 85 | return new Profiler(); 86 | }; 87 | 88 | $pimple['router'] = function () { 89 | return new Router(); 90 | }; 91 | 92 | $pimple['uri'] = function () { 93 | return new Uri(); 94 | }; 95 | 96 | $this->registerHelper($pimple); 97 | } 98 | 99 | /** 100 | * @param Pimple $pimple 101 | * 102 | * @return void 103 | */ 104 | protected function registerHelper(Pimple $pimple) 105 | { 106 | $pimple['imagesHelper'] = function () { 107 | return new Images(); 108 | }; 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /src/admin/library/Alledia/OSMap/Sitemap/Images.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 7 | * @copyright 2016-2025 Joomlashack.com. All rights reserved. 8 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 9 | * 10 | * This file is part of OSMap. 11 | * 12 | * OSMap is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * OSMap is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 24 | */ 25 | 26 | namespace Alledia\OSMap\Sitemap; 27 | 28 | use Alledia\OSMap; 29 | 30 | defined('_JEXEC') or die(); 31 | 32 | class Images extends Standard 33 | { 34 | /** 35 | * @var string 36 | */ 37 | protected $type = 'images'; 38 | } 39 | -------------------------------------------------------------------------------- /src/admin/library/Alledia/OSMap/Sitemap/ItemAdapter/AdapterInterface.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 7 | * @copyright 2016-2025 Joomlashack.com. All rights reserved. 8 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 9 | * 10 | * This file is part of OSMap. 11 | * 12 | * OSMap is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * OSMap is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 24 | */ 25 | 26 | namespace Alledia\OSMap\Sitemap\ItemAdapter; 27 | 28 | defined('_JEXEC') or die(); 29 | 30 | interface AdapterInterface 31 | { 32 | /** 33 | * Gets the visible state for robots. Each adapter will check specific params. Returns 34 | * true if the item is visible. 35 | * 36 | * @return bool 37 | */ 38 | public function checkVisibilityForRobots(); 39 | } 40 | -------------------------------------------------------------------------------- /src/admin/library/Alledia/OSMap/Sitemap/ItemAdapter/Generic.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 7 | * @copyright 2016-2025 Joomlashack.com. All rights reserved. 8 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 9 | * 10 | * This file is part of OSMap. 11 | * 12 | * OSMap is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * OSMap is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 24 | */ 25 | 26 | namespace Alledia\OSMap\Sitemap\ItemAdapter; 27 | 28 | use Alledia\OSMap\Sitemap\Item; 29 | 30 | defined('_JEXEC') or die(); 31 | 32 | class Generic implements AdapterInterface 33 | { 34 | /** 35 | * @var Item 36 | */ 37 | protected $item; 38 | 39 | /** 40 | * @param Item $item 41 | * 42 | * @return void 43 | */ 44 | public function __construct(Item $item) 45 | { 46 | $this->item = $item; 47 | } 48 | 49 | /** 50 | * @inheritDoc 51 | */ 52 | public function checkVisibilityForRobots() 53 | { 54 | // Always visible for the Free version 55 | return true; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/admin/library/Alledia/OSMap/Sitemap/News.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 7 | * @copyright 2016-2025 Joomlashack.com. All rights reserved. 8 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 9 | * 10 | * This file is part of OSMap. 11 | * 12 | * OSMap is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * OSMap is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 24 | */ 25 | 26 | namespace Alledia\OSMap\Sitemap; 27 | 28 | use Alledia\OSMap; 29 | 30 | defined('_JEXEC') or die(); 31 | 32 | class News extends Standard 33 | { 34 | /** 35 | * @var string 36 | */ 37 | protected $type = 'news'; 38 | } 39 | -------------------------------------------------------------------------------- /src/admin/library/Alledia/OSMap/Sitemap/SitemapInterface.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 7 | * @copyright 2016-2025 Joomlashack.com. All rights reserved. 8 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 9 | * 10 | * This file is part of OSMap. 11 | * 12 | * OSMap is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * OSMap is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 24 | */ 25 | 26 | namespace Alledia\OSMap\Sitemap; 27 | 28 | defined('_JEXEC') or die(); 29 | 30 | interface SitemapInterface 31 | { 32 | /** 33 | * Traverse the sitemap items recursively and call the given callback, 34 | * passing each node as parameter. 35 | * 36 | * @param callable $callback 37 | * @param bool $triggerEvents 38 | * @param bool $updateCount 39 | * 40 | * @return void 41 | * @throws \Exception 42 | */ 43 | public function traverse(callable $callback, bool $triggerEvents = true, bool $updateCount = false); 44 | } 45 | -------------------------------------------------------------------------------- /src/admin/library/Alledia/OSMap/View/Admin/AbstractForm.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2021-2025 Joomlashack.com. All rights reserved 7 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 | * 9 | * This file is part of OSMap. 10 | * 11 | * OSMap is free software: you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation, either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * OSMap is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 23 | */ 24 | 25 | namespace Alledia\OSMap\View\Admin; 26 | 27 | use Alledia\OSMap\Controller\Form; 28 | use Alledia\OSMap\View\TraitOSMapView; 29 | use Joomla\CMS\HTML\HTMLHelper; 30 | use Joomla\CMS\Language\Text; 31 | 32 | defined('_JEXEC') or die(); 33 | 34 | class AbstractForm extends \Alledia\Framework\Joomla\View\Admin\AbstractForm 35 | { 36 | use TraitOSMapView; 37 | 38 | /** 39 | * Render a form fieldset with the ability to compact two fields 40 | * into a single line 41 | * 42 | * @param string $fieldSet 43 | * @param array $sameLine 44 | * @param bool $tabbed 45 | * 46 | * @return string 47 | */ 48 | protected function renderFieldset(string $fieldSet, array $sameLine = [], ?bool $tabbed = false): string 49 | { 50 | $html = []; 51 | if ($this->form && $this->form instanceof Form) { 52 | $fieldSets = $this->form->getFieldsets(); 53 | 54 | if ($fieldSets[$fieldSet]) { 55 | $name = $fieldSets[$fieldSet]->name; 56 | $label = $fieldSets[$fieldSet]->label; 57 | 58 | $html = []; 59 | 60 | if ($tabbed) { 61 | $html[] = HTMLHelper::_('bootstrap.addTab', 'myTab', $name, Text::_($label)); 62 | } 63 | 64 | $html[] = '<div class="row-fluid">'; 65 | $html[] = '<fieldset class="adminform">'; 66 | 67 | foreach ($this->form->getFieldset($name) as $field) { 68 | if (in_array($field->fieldname, $sameLine)) { 69 | continue; 70 | } 71 | 72 | $fieldHtml = [ 73 | '<div class="control-group">', 74 | '<div class="control-label">', 75 | $field->label, 76 | '</div>', 77 | '<div class="controls">', 78 | $field->input 79 | ]; 80 | $html = array_merge($html, $fieldHtml); 81 | 82 | if (isset($sameLine[$field->fieldname])) { 83 | $html[] = ' ' . $this->form->getField($sameLine[$field->fieldname])->input; 84 | } 85 | 86 | $html[] = '</div>'; 87 | $html[] = '</div>'; 88 | } 89 | $html[] = '</fieldset>'; 90 | $html[] = '</div>'; 91 | if ($tabbed) { 92 | $html[] = HTMLHelper::_('bootstrap.endTab'); 93 | } 94 | } 95 | } 96 | 97 | return join('', $html); 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /src/admin/library/Alledia/OSMap/View/Admin/AbstractList.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 7 | * @copyright 2016-2025 Joomlashack.com. All rights reserved. 8 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 9 | * 10 | * This file is part of OSMap. 11 | * 12 | * OSMap is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * OSMap is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 24 | */ 25 | 26 | namespace Alledia\OSMap\View\Admin; 27 | 28 | use Alledia\OSMap\Controller\Form; 29 | use Alledia\OSMap\Factory; 30 | use Alledia\OSMap\View\TraitOSMapView; 31 | use Joomla\CMS\HTML\HTMLHelper; 32 | use Joomla\CMS\Language\Text; 33 | use Joomla\CMS\Plugin\PluginHelper; 34 | use Joomla\CMS\Toolbar\ToolbarHelper; 35 | 36 | defined('_JEXEC') or die(); 37 | 38 | class AbstractList extends \Alledia\Framework\Joomla\View\Admin\AbstractList 39 | { 40 | use TraitOSMapView; 41 | } 42 | -------------------------------------------------------------------------------- /src/admin/library/Alledia/OSMap/View/TraitOSMapView.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2021-2025 Joomlashack.com. All rights reserved 7 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 | * 9 | * This file is part of OSMap. 10 | * 11 | * OSMap is free software: you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation, either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * OSMap is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 23 | */ 24 | 25 | namespace Alledia\OSMap\View; 26 | 27 | use Alledia\OSMap\Factory; 28 | use Joomla\CMS\HTML\HTMLHelper; 29 | use Joomla\CMS\Language\Text; 30 | use Joomla\CMS\Plugin\PluginHelper; 31 | use Joomla\CMS\Toolbar\ToolbarHelper; 32 | 33 | defined('_JEXEC') or die(); 34 | 35 | trait TraitOSMapView 36 | { 37 | /** 38 | * Default admin screen title 39 | * 40 | * @param ?string $sub 41 | * @param string $icon 42 | * 43 | * @return void 44 | */ 45 | protected function setTitle(?string $sub = null, string $icon = 'osmap') 46 | { 47 | $title = Text::_('COM_OSMAP'); 48 | if ($sub) { 49 | $title .= ': ' . Text::_($sub); 50 | } 51 | 52 | ToolbarHelper::title($title, $icon); 53 | } 54 | 55 | /** 56 | * Render the admin screen toolbar buttons 57 | * 58 | * @return void 59 | * @throws \Exception 60 | */ 61 | protected function setToolBar() 62 | { 63 | $user = Factory::getUser(); 64 | if ($user->authorise('core.admin', 'com_osmap')) { 65 | ToolbarHelper::preferences('com_osmap'); 66 | } 67 | 68 | PluginHelper::importPlugin('osmap'); 69 | 70 | Factory::getApplication()->triggerEvent( 71 | 'osmapOnAfterSetToolBar', 72 | [ 73 | strtolower(str_replace('OSMapView', '', $this->getName())) 74 | ] 75 | ); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/admin/models/sitemap.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 7 | * @copyright 2016-2025 Joomlashack.com. All rights reserved. 8 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 9 | * 10 | * This file is part of OSMap. 11 | * 12 | * OSMap is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * OSMap is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 24 | */ 25 | 26 | use Alledia\OSMap\Factory; 27 | use Joomla\CMS\MVC\Model\AdminModel; 28 | use Joomla\CMS\Table\Table; 29 | 30 | defined('_JEXEC') or die(); 31 | 32 | 33 | class OSMapModelSitemap extends AdminModel 34 | { 35 | /** 36 | * @inheritDoc 37 | */ 38 | public function getTable($name = 'Sitemap', $prefix = 'OSMapTable', $options = []) 39 | { 40 | return Table::getInstance($name, $prefix, $options); 41 | } 42 | 43 | /** 44 | * @inheritDoc 45 | */ 46 | public function getForm($data = [], $loadData = true) 47 | { 48 | $form = $this->loadForm('com_osmap.sitemap', 'sitemap', ['control' => 'jform', 'load_data' => $loadData]); 49 | if (empty($form)) { 50 | return false; 51 | } 52 | 53 | return $form; 54 | } 55 | 56 | /** 57 | * @inheritDoc 58 | */ 59 | protected function loadFormData() 60 | { 61 | $data = Factory::getApplication()->getUserState('com_osmap.edit.sitemap.data', []); 62 | 63 | if (empty($data)) { 64 | $data = $this->getItem(); 65 | 66 | // Load some defaults for new sitemap 67 | $id = $data->get('id'); 68 | if (empty($id)) { 69 | $data->set('published', 1); 70 | $data->set('created', Factory::getDate()->toSql()); 71 | } 72 | 73 | // Load the menus 74 | if ($id) { 75 | $db = Factory::getDbo(); 76 | $query = $db->getQuery(true) 77 | ->select('*') 78 | ->from('#__osmap_sitemap_menus') 79 | ->where('sitemap_id = ' . $db->quote($id)) 80 | ->order('ordering'); 81 | $menus = $db->setQuery($query)->loadObjectList(); 82 | 83 | $data->menus = []; 84 | 85 | foreach ($menus as $menu) { 86 | $data->menus[$menu->menutype_id] = [ 87 | 'priority' => $menu->priority, 88 | 'changefreq' => $menu->changefreq 89 | ]; 90 | } 91 | } 92 | } 93 | 94 | return $data; 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /src/admin/models/sitemapitems.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 7 | * @copyright 2016-2025 Joomlashack.com. All rights reserved. 8 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 9 | * 10 | * This file is part of OSMap. 11 | * 12 | * OSMap is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * OSMap is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 24 | */ 25 | 26 | use Joomla\CMS\MVC\Model\BaseDatabaseModel; 27 | use Joomla\CMS\Table\Table; 28 | 29 | // phpcs:disable PSR1.Files.SideEffects 30 | defined('_JEXEC') or die(); 31 | // phpcs:enable PSR1.Files.SideEffects 32 | // phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace 33 | 34 | class OSMapModelSitemapItems extends BaseDatabaseModel 35 | { 36 | public function getTable($name = 'SitemapItems', $prefix = 'OSMapTable', $options = []) 37 | { 38 | return Table::getInstance($name, $prefix, $options); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/admin/osmap.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 7 | * @copyright 2016-2025 Joomlashack.com. All rights reserved. 8 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 9 | * 10 | * This file is part of OSMap. 11 | * 12 | * OSMap is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * OSMap is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 24 | */ 25 | 26 | use Alledia\OSMap\Controller\Base; 27 | use Alledia\OSMap\Factory; 28 | use Joomla\CMS\HTML\HTMLHelper; 29 | use Joomla\CMS\Language\Text; 30 | 31 | defined('_JEXEC') or die(); 32 | 33 | include JPATH_COMPONENT_ADMINISTRATOR . '/include.php'; 34 | 35 | // Access check 36 | if (Factory::getUser()->authorise('core.manage', 'com_osmap') == false) { 37 | throw new Exception(Text::_('JERROR_ALERTNOAUTHOR'), 404); 38 | } 39 | 40 | HTMLHelper::_('stylesheet', 'com_osmap/admin.min.css', ['relative' => true]); 41 | 42 | $input = Factory::getApplication()->input; 43 | 44 | $controller = Base::getInstance('OSMap'); 45 | $controller->execute($input->getCmd('task')); 46 | $controller->redirect(); 47 | -------------------------------------------------------------------------------- /src/admin/sql/install/mysql/install.sql: -------------------------------------------------------------------------------- 1 | -- MySQL Script generated by MySQL Workbench 2 | -- Wed Oct 6 07:52:47 2021 3 | -- Model: New Model Version: 1.0 4 | -- MySQL Workbench Forward Engineering 5 | 6 | SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; 7 | SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; 8 | SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=''; 9 | 10 | -- ----------------------------------------------------- 11 | -- Schema osmap 12 | -- ----------------------------------------------------- 13 | 14 | -- ----------------------------------------------------- 15 | -- Table `#__osmap_sitemaps` 16 | -- ----------------------------------------------------- 17 | CREATE TABLE IF NOT EXISTS `#__osmap_sitemaps` ( 18 | `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, 19 | `name` VARCHAR(100) NULL DEFAULT NULL, 20 | `params` TEXT NULL DEFAULT NULL, 21 | `is_default` TINYINT(1) NOT NULL DEFAULT '0', 22 | `published` TINYINT(1) NOT NULL DEFAULT '1', 23 | `created_on` DATETIME NULL DEFAULT NULL, 24 | `links_count` INT(11) NOT NULL DEFAULT '0', 25 | PRIMARY KEY (`id`), 26 | INDEX `idx_default` (`is_default` ASC, `id` ASC)) 27 | ENGINE = INNODB 28 | DEFAULT CHARACTER SET = utf8; 29 | 30 | 31 | -- ----------------------------------------------------- 32 | -- Table `#__osmap_sitemap_menus` 33 | -- ----------------------------------------------------- 34 | CREATE TABLE IF NOT EXISTS `#__osmap_sitemap_menus` ( 35 | `sitemap_id` INT(11) UNSIGNED NOT NULL, 36 | `menutype_id` INT(11) NOT NULL, 37 | `changefreq` ENUM('always', 'hourly', 'daily', 'weekly', 'monthly', 'yearly', 'never') NOT NULL DEFAULT 'weekly', 38 | `priority` FLOAT NOT NULL DEFAULT '0.5', 39 | `ordering` INT(11) NOT NULL DEFAULT '0', 40 | PRIMARY KEY (`sitemap_id`, `menutype_id`), 41 | INDEX `idx_menutype_id` (`menutype_id` ASC), 42 | INDEX `idx_sitemaps_id` (`sitemap_id` ASC)) 43 | ENGINE = INNODB 44 | DEFAULT CHARACTER SET = utf8; 45 | 46 | 47 | -- ----------------------------------------------------- 48 | -- Table `#__osmap_items_settings` 49 | -- ----------------------------------------------------- 50 | CREATE TABLE IF NOT EXISTS `#__osmap_items_settings` ( 51 | `sitemap_id` INT(11) UNSIGNED NOT NULL, 52 | `uid` VARCHAR(100) NOT NULL DEFAULT '', 53 | `settings_hash` CHAR(32) NOT NULL DEFAULT '', 54 | `published` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1', 55 | `changefreq` ENUM('always', 'hourly', 'daily', 'weekly', 'monthly', 'yearly', 'never') NOT NULL DEFAULT 'weekly', 56 | `priority` FLOAT NOT NULL DEFAULT '0.5', 57 | `format` TINYINT(1) UNSIGNED NULL DEFAULT '2' COMMENT 'Format of the setting: 1) Legacy Mode - UID Only; 2) Based on menu ID and UID', 58 | PRIMARY KEY (`sitemap_id`, `uid`, `settings_hash`), 59 | INDEX `idx_sitemap_id` (`sitemap_id` ASC)) 60 | ENGINE = INNODB 61 | DEFAULT CHARACTER SET = utf8; 62 | 63 | 64 | SET SQL_MODE=@OLD_SQL_MODE; 65 | SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; 66 | SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS; 67 | -------------------------------------------------------------------------------- /src/admin/sql/uninstall/mysql/uninstall.sql: -------------------------------------------------------------------------------- 1 | SET foreign_key_checks = 0; 2 | 3 | DROP TABLE IF EXISTS `#__osmap_sitemaps`; 4 | DROP TABLE IF EXISTS `#__osmap_sitemap_menus`; 5 | DROP TABLE IF EXISTS `#__osmap_items_settings`; 6 | 7 | SET foreign_key_checks = 1; 8 | -------------------------------------------------------------------------------- /src/admin/sql/updates/mysql/5.0.0.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joomlashack/OSMap/1618d09989eeeae7075bdfa58736fb85a685114f/src/admin/sql/updates/mysql/5.0.0.sql -------------------------------------------------------------------------------- /src/admin/tables/sitemapitems.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 7 | * @copyright 2016-2025 Joomlashack.com. All rights reserved. 8 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 9 | * 10 | * This file is part of OSMap. 11 | * 12 | * OSMap is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * OSMap is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 24 | */ 25 | 26 | defined('_JEXEC') or die(); 27 | 28 | /** 29 | * @package OSMap 30 | * @subpackage com_osmap 31 | */ 32 | class OSMapTableSitemapItems extends JTable 33 | { 34 | /** 35 | * @var int Primary key 36 | */ 37 | public $sitemap_id = null; 38 | 39 | /** 40 | * @var string 41 | */ 42 | public $uid = null; 43 | 44 | /** 45 | * @var int 46 | */ 47 | public $published = null; 48 | 49 | /** 50 | * @var string 51 | */ 52 | public $changefreq = 'weekly'; 53 | 54 | /** 55 | * @var int 56 | */ 57 | public $priority = 5; 58 | 59 | /** 60 | * @param JDatabaseDriver 61 | */ 62 | public function __construct($db) 63 | { 64 | parent::__construct('#__osmap_items_settings', ['sitemap_id', 'uid', 'settings_hash'], $db); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/admin/views/installer/tmpl/default_custom.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 7 | * @copyright 2016-2025 Joomlashack.com. All rights reserved. 8 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 9 | * 10 | * This file is part of OSMap. 11 | * 12 | * OSMap is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * OSMap is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 24 | */ 25 | 26 | // No direct access 27 | use Joomla\CMS\Language\Text; 28 | use Joomla\CMS\Router\Route; 29 | 30 | defined('_JEXEC') or die(); 31 | 32 | if ($this->isXmapDataFound) : 33 | $updateLink = Route::_('index.php?option=com_osmap&task=sitemaps.migrateXMapData&format=json'); 34 | ?> 35 | <div class="alledia-xmap-import"> 36 | <div id="alledia-installer-xmap-import-message"> 37 | <div id="alledia-installer-xmap-import-wipe-warning" class="alert alert-warning"> 38 | <h4 class="alert-heading"><?php echo Text::_('COM_OSMAP_INSTALLER_IMPORT_XMAP_TITLE'); ?></h4> 39 | <p><?php echo Text::_('COM_OSMAP_INSTALLER_IMPORT_XMAP_DESCRIPTION'); ?></p> 40 | <p> 41 | <strong><?php echo Text::_('COM_OSMAP_INSTALLER_IMPORT_XMAP_WIPE_WARNING'); ?></strong> 42 | </p> 43 | 44 | <a href="javascript:void(0);" id="alledia-installer-xmap-import-button" class="alledia-button"> 45 | <?php echo Text::_('COM_OSMAP_INSTALLER_IMPORT_XMAP_BUTTON'); ?> 46 | </a> 47 | </div> 48 | </div> 49 | 50 | <div id="alledia-installer-xmap-import-success" class="alert alert-success" style="display: none"> 51 | <p> 52 | <?php echo Text::_('COM_OSMAP_INSTALLER_IMPORT_XMAP_SUCCESS'); ?> 53 | </p> 54 | </div> 55 | 56 | <div id="alledia-installer-xmap-import-error" class="alert alert-error" style="display: none"> 57 | <p> 58 | <?php echo Text::_('COM_OSMAP_INSTALLER_IMPORT_XMAP_ERROR'); ?> 59 | </p> 60 | </div> 61 | </div> 62 | 63 | <script> 64 | (function($) { 65 | $(function() { 66 | let button = $('#alledia-installer-xmap-import-button'), 67 | message = $('#alledia-installer-xmap-import-message'), 68 | title = $('.alledia-xmap-import > h4.warning'); 69 | 70 | let showError = function() { 71 | $('#alledia-installer-xmap-import-error').show(); 72 | title.hide(); 73 | }; 74 | 75 | let showSuccess = function() { 76 | $('#alledia-installer-xmap-import-success').show(); 77 | title.hide(); 78 | }; 79 | 80 | button.on('click', function() { 81 | let goAhead = confirm('<?php echo Text::_('COM_OSMAP_INSTALLER_WIPE_CONFIRMATION'); ?>'); 82 | 83 | if (goAhead) { 84 | button.text('<?php echo Text::_('COM_OSMAP_INSTALLER_IMPORTING'); ?>') 85 | .off('click', this) 86 | .css('cursor', 'default'); 87 | 88 | {}, 89 | $.post('<?php echo $updateLink; ?>', 90 | function(data) { 91 | message.hide(); 92 | 93 | try { 94 | let result = JSON.parse(data); 95 | 96 | if (result.success) { 97 | showSuccess(); 98 | } else { 99 | showError(); 100 | } 101 | } catch (e) { 102 | showError(); 103 | } 104 | }, 105 | 'text' 106 | ).fail(function() { 107 | message.hide(); 108 | showError(); 109 | }); 110 | } 111 | }); 112 | }); 113 | 114 | })(jQuery); 115 | </script> 116 | <?php 117 | endif; 118 | -------------------------------------------------------------------------------- /src/admin/views/sitemap/tmpl/edit.j3.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 7 | * @copyright 2016-2025 Joomlashack.com. All rights reserved. 8 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 9 | * 10 | * This file is part of OSMap. 11 | * 12 | * OSMap is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * OSMap is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 24 | */ 25 | 26 | use Alledia\OSMap\Factory; 27 | use Joomla\CMS\HTML\HTMLHelper; 28 | use Joomla\CMS\Layout\LayoutHelper; 29 | use Joomla\CMS\Router\Route; 30 | 31 | defined('_JEXEC') or die(); 32 | 33 | HTMLHelper::_('behavior.formvalidator'); 34 | HTMLHelper::_('behavior.keepalive'); 35 | HTMLHelper::_('formbehavior.chosen', 'select'); 36 | 37 | $input = Factory::getApplication()->input; 38 | 39 | $actionQuery = [ 40 | 'option' => 'com_osmap', 41 | 'view' => 'sitemap', 42 | 'layout' => 'edit', 43 | 'id' => (int)$this->item->id 44 | ]; 45 | ?> 46 | <form action="<?php echo Route::_('index.php?' . http_build_query($actionQuery)); ?>" 47 | method="post" 48 | name="adminForm" 49 | id="adminForm" 50 | class="form-validate sitemap"> 51 | 52 | <?php echo LayoutHelper::render('joomla.edit.title_alias', $this); ?> 53 | 54 | <div class="form-horizontal"> 55 | <div class="row-fluid"> 56 | <div class="span9"> 57 | <?php echo $this->form->getField('menus')->renderField(['hiddenLabel' => true]); ?> 58 | </div> 59 | 60 | <div class="span3"> 61 | <?php echo $this->form->renderFieldset('params'); ?> 62 | </div> 63 | </div> 64 | </div> 65 | 66 | <input type="hidden" name="task" value=""/> 67 | <input type="hidden" name="return" value="<?php echo $input->getCmd('return'); ?>"/> 68 | <?php echo HTMLHelper::_('form.token'); ?> 69 | </form> 70 | 71 | -------------------------------------------------------------------------------- /src/admin/views/sitemap/tmpl/edit.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 7 | * @copyright 2016-2025 Joomlashack.com. All rights reserved. 8 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 9 | * 10 | * This file is part of OSMap. 11 | * 12 | * OSMap is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * OSMap is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 24 | */ 25 | 26 | use Alledia\OSMap\Factory; 27 | use Joomla\CMS\HTML\HTMLHelper; 28 | use Joomla\CMS\Layout\LayoutHelper; 29 | use Joomla\CMS\Router\Route; 30 | 31 | defined('_JEXEC') or die(); 32 | 33 | HTMLHelper::_('behavior.formvalidator'); 34 | HTMLHelper::_('behavior.keepalive'); 35 | 36 | $input = Factory::getApplication()->input; 37 | 38 | $actionQuery = [ 39 | 'option' => 'com_osmap', 40 | 'view' => 'sitemap', 41 | 'layout' => 'edit', 42 | 'id' => (int)$this->item->id 43 | ]; 44 | ?> 45 | <form action="<?php echo Route::_('index.php?' . http_build_query($actionQuery)); ?>" 46 | method="post" 47 | name="adminForm" 48 | id="adminForm" 49 | class="form-validate sitemap"> 50 | 51 | <?php echo LayoutHelper::render('joomla.edit.title_alias', $this); ?> 52 | 53 | <div> 54 | <div class="row"> 55 | <div class="col-lg-9"> 56 | <?php echo $this->form->getField('menus')->renderField(['hiddenLabel' => true]); ?> 57 | </div> 58 | 59 | <div class="col-lg-3"> 60 | <?php echo $this->form->renderFieldset('params'); ?> 61 | </div> 62 | </div> 63 | </div> 64 | 65 | <input type="hidden" name="task" value=""/> 66 | <?php echo HTMLHelper::_('form.token'); ?> 67 | </form> 68 | 69 | -------------------------------------------------------------------------------- /src/admin/views/sitemap/view.html.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 7 | * @copyright 2016-2025 Joomlashack.com. All rights reserved. 8 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 9 | * 10 | * This file is part of OSMap. 11 | * 12 | * OSMap is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * OSMap is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 24 | */ 25 | 26 | use Alledia\OSMap\Factory; 27 | use Alledia\OSMap\View\Admin\AbstractForm; 28 | use Joomla\CMS\Object\CMSObject; 29 | use Joomla\CMS\Toolbar\ToolbarHelper; 30 | 31 | defined('_JEXEC') or die(); 32 | 33 | 34 | class OSMapViewSitemap extends AbstractForm 35 | { 36 | /** 37 | * @var CMSObject 38 | */ 39 | protected $item = null; 40 | 41 | /** 42 | * @inheritDoc 43 | */ 44 | public function display($tpl = null) 45 | { 46 | $this->form = $this->get('Form'); 47 | $this->item = $this->get('Item'); 48 | 49 | $this->setToolBar(); 50 | 51 | parent::display($tpl); 52 | } 53 | 54 | /** 55 | * @param bool $addDivider 56 | * 57 | * @return void 58 | * @throws Exception 59 | */ 60 | protected function setToolBar() 61 | { 62 | $isNew = ($this->item->id == 0); 63 | Factory::getApplication()->input->set('hidemainmenu', true); 64 | 65 | $title = 'COM_OSMAP_PAGE_VIEW_SITEMAP_' . ($isNew ? 'ADD' : 'EDIT'); 66 | $this->setTitle($title); 67 | 68 | ToolbarHelper::apply('sitemap.apply'); 69 | ToolbarHelper::save('sitemap.save'); 70 | ToolbarHelper::save2new('sitemap.save2new'); 71 | 72 | if (!$isNew) { 73 | ToolbarHelper::save2copy('sitemap.save2copy'); 74 | } 75 | 76 | $alt = $isNew ? 'JTOOLBAR_CANCEL' : 'JTOOLBAR_CLOSE'; 77 | ToolbarHelper::cancel('sitemap.cancel', $alt); 78 | 79 | parent::setToolBar(); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /src/admin/views/sitemapitems/tmpl/default.j3.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 7 | * @copyright 2016-2025 Joomlashack.com. All rights reserved. 8 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 9 | * 10 | * This file is part of OSMap. 11 | * 12 | * OSMap is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * OSMap is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 24 | */ 25 | 26 | use Joomla\CMS\HTML\HTMLHelper; 27 | use Joomla\CMS\Language\Text; 28 | use Joomla\CMS\Router\Route; 29 | 30 | defined('_JEXEC') or die(); 31 | 32 | HTMLHelper::_('bootstrap.tooltip'); 33 | HTMLHelper::_('behavior.core'); 34 | HTMLHelper::_('behavior.keepalive'); 35 | HTMLHelper::_('formbehavior.chosen', 'select'); 36 | 37 | $sitemapId = (int)$this->sitemap->id; 38 | 39 | ?> 40 | <h1> 41 | <?php echo Text::sprintf('COM_OSMAP_SITEMAPITEMS_HEADING', $this->escape($this->sitemap->name)); ?> 42 | </h1> 43 | 44 | <form action="<?php echo Route::_('index.php?option=com_osmap&view=sitemapitems&id=' . $sitemapId); ?>" 45 | method="post" 46 | name="adminForm" 47 | id="adminForm" 48 | class="form-validate"> 49 | <div class="row-fluid"> 50 | <div class="span12"> 51 | <div id="osmap-items-container"> 52 | <div class="osmap-loading"> 53 | <span class="icon-loop spin"></span> 54 | <?php echo Text::_('COM_OSMAP_LOADING'); ?> 55 | </div> 56 | 57 | <div id="osmap-items-list"></div> 58 | </div> 59 | </div> 60 | </div> 61 | 62 | <input type="hidden" id="menus_ordering" name="jform[menus_ordering]" value=""/> 63 | <input type="hidden" name="task" value=""/> 64 | <input type="hidden" name="id" value="<?php echo $sitemapId; ?>"/> 65 | <input type="hidden" name="update-data" id="update-data" value=""/> 66 | <input type="hidden" name="language" value="<?php echo $this->language; ?>"/> 67 | <?php echo HTMLHelper::_('form.token'); ?> 68 | </form> 69 | <?php 70 | echo $this->loadTemplate('script'); 71 | -------------------------------------------------------------------------------- /src/admin/views/sitemapitems/tmpl/default.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 7 | * @copyright 2016-2025 Joomlashack.com. All rights reserved. 8 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 9 | * 10 | * This file is part of OSMap. 11 | * 12 | * OSMap is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * OSMap is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 24 | */ 25 | 26 | use Joomla\CMS\HTML\HTMLHelper; 27 | use Joomla\CMS\Language\Text; 28 | use Joomla\CMS\Router\Route; 29 | 30 | defined('_JEXEC') or die(); 31 | 32 | HTMLHelper::_('bootstrap.tooltip'); 33 | HTMLHelper::_('behavior.core'); 34 | HTMLHelper::_('behavior.keepalive'); 35 | 36 | $sitemapId = (int)$this->sitemap->id; 37 | 38 | ?> 39 | <h1> 40 | <?php echo Text::sprintf('COM_OSMAP_SITEMAPITEMS_HEADING', $this->escape($this->sitemap->name)); ?> 41 | </h1> 42 | 43 | <form action="<?php echo Route::_('index.php?option=com_osmap&view=sitemapitems&id=' . $sitemapId); ?>" 44 | method="post" 45 | name="adminForm" 46 | id="adminForm" 47 | class="form-validate"> 48 | <div class="row-fluid"> 49 | <div class="col-12"> 50 | <div id="osmap-items-container"> 51 | <div class="osmap-loading"> 52 | <span class="icon-loop spin"></span> 53 | <?php echo Text::_('COM_OSMAP_LOADING'); ?> 54 | </div> 55 | 56 | <div id="osmap-items-list"></div> 57 | </div> 58 | </div> 59 | </div> 60 | 61 | <input type="hidden" id="menus_ordering" name="jform[menus_ordering]" value=""/> 62 | <input type="hidden" name="task" value=""/> 63 | <input type="hidden" name="id" value="<?php echo $sitemapId; ?>"/> 64 | <input type="hidden" name="update-data" id="update-data" value=""/> 65 | <input type="hidden" name="language" value="<?php echo $this->language; ?>"/> 66 | <?php echo HTMLHelper::_('form.token'); ?> 67 | </form> 68 | <?php 69 | echo $this->loadTemplate('script'); 70 | -------------------------------------------------------------------------------- /src/admin/views/sitemapitems/tmpl/default_script.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2023-2025 Joomlashack.com. All rights reserved 7 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 | * 9 | * This file is part of OSMap. 10 | * 11 | * OSMap is free software: you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation, either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * OSMap is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 23 | */ 24 | 25 | use Alledia\OSMap\Factory; 26 | use Joomla\CMS\HTML\HTMLHelper; 27 | use Joomla\CMS\Language\Text; 28 | 29 | defined('_JEXEC') or die(); 30 | 31 | HTMLHelper::_('jquery.framework'); 32 | HTMLHelper::_('script', 'com_osmap/sitemapitems.min.js', ['relative' => true]); 33 | 34 | $jsOptions = json_encode([ 35 | 'baseUri' => Factory::getPimpleContainer()->uri::root(), 36 | 'sitemapId' => (int)$this->sitemap->id, 37 | 'container' => '#osmap-items-list', 38 | 'language' => $this->language, 39 | 'frequencies' => HTMLHelper::_('osmap.frequencyList'), 40 | 'priorities' => HTMLHelper::_('osmap.priorityList'), 41 | ]); 42 | 43 | $jTexts = [ 44 | 'COM_OSMAP_HOURLY', 45 | 'COM_OSMAP_DAILY', 46 | 'COM_OSMAP_WEEKLY', 47 | 'COM_OSMAP_MONTHLY', 48 | 'COM_OSMAP_YEARLY', 49 | 'COM_OSMAP_NEVER', 50 | 'COM_OSMAP_TOOLTIP_CLICK_TO_UNPUBLISH', 51 | 'COM_OSMAP_TOOLTIP_CLICK_TO_PUBLISH', 52 | ]; 53 | foreach ($jTexts as $jText) { 54 | Text::script($jText); 55 | } 56 | 57 | Factory::getApplication()->getDocument()->addScriptDeclaration( 58 | ";jQuery(document).ready(function($) { new $.osmap.sitemapItems({$jsOptions}); });" 59 | ); 60 | -------------------------------------------------------------------------------- /src/admin/views/sitemapitems/view.html.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 7 | * @copyright 2016-2025 Joomlashack.com. All rights reserved. 8 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 9 | * 10 | * This file is part of OSMap. 11 | * 12 | * OSMap is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * OSMap is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 24 | */ 25 | 26 | use Alledia\OSMap\Factory; 27 | use Alledia\OSMap\Sitemap\Standard; 28 | use Alledia\OSMap\View\Admin\AbstractList; 29 | use Joomla\CMS\Toolbar\ToolbarHelper; 30 | 31 | // phpcs:disable PSR1.Files.SideEffects 32 | defined('_JEXEC') or die(); 33 | // phpcs:enable PSR1.Files.SideEffects 34 | // phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace 35 | 36 | class OSMapViewSitemapItems extends AbstractList 37 | { 38 | /** 39 | * @var Standard 40 | */ 41 | protected $sitemap = null; 42 | 43 | /** 44 | * @var string 45 | */ 46 | protected $language = null; 47 | 48 | /** 49 | * @inheritDoc 50 | */ 51 | public function display($tpl = null) 52 | { 53 | $sitemapId = $this->app->input->getInt('id', 0); 54 | 55 | $this->sitemap = Factory::getSitemap($sitemapId); 56 | $this->language = $this->app->input->get('lang', ''); 57 | 58 | $this->setToolBar(); 59 | 60 | parent::display($tpl); 61 | } 62 | 63 | /** 64 | * @inheritDoc 65 | */ 66 | protected function setToolBar($addDivider = true) 67 | { 68 | $this->setTitle('COM_OSMAP_PAGE_VIEW_SITEMAP_ITEMS'); 69 | 70 | ToolbarHelper::apply('sitemapitems.apply'); 71 | ToolbarHelper::save('sitemapitems.save'); 72 | 73 | ToolbarHelper::cancel('sitemapitems.cancel'); 74 | 75 | parent::setToolBar(); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/admin/views/sitemaps/tmpl/default.j3_previews.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 7 | * @copyright 2016-2025 Joomlashack.com. All rights reserved. 8 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 9 | * 10 | * This file is part of OSMap. 11 | * 12 | * OSMap is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * OSMap is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 24 | */ 25 | 26 | use Joomla\CMS\HTML\HTMLHelper; 27 | use Joomla\CMS\Language\Text; 28 | 29 | defined('_JEXEC') or die(); 30 | 31 | $languages = $this->languages ?: ['']; 32 | foreach ($languages as $language) : 33 | $langCode = empty($language->sef) ? null : $language->sef; 34 | ?> 35 | <span class="osmap-link"> 36 | <?php 37 | echo HTMLHelper::_( 38 | 'link', 39 | $this->getLink($this->item, 'xml', $langCode), 40 | Text::_('COM_OSMAP_XML_LINK'), 41 | [ 42 | 'target' => '_blank', 43 | 'title' => Text::_('COM_OSMAP_XML_LINK_TOOLTIP', true), 44 | 'class' => 'hasTooltip' 45 | ] 46 | ); 47 | ?> 48 | <span class="icon-new-tab"></span> 49 | </span> 50 | 51 | <span class="osmap-link"> 52 | <?php 53 | echo HTMLHelper::_( 54 | 'link', 55 | $this->getLink($this->item, 'html', $langCode), 56 | Text::_('COM_OSMAP_HTML_LINK'), 57 | [ 58 | 'target' => '_blank', 59 | 'title' => Text::_('COM_OSMAP_HTML_LINK_TOOLTIP', true), 60 | 'class' => 'hasTooltip' 61 | ] 62 | ); 63 | ?> 64 | <span class="icon-new-tab"></span> 65 | </span> 66 | 67 | <span class="osmap-link"> 68 | <?php 69 | echo HTMLHelper::_( 70 | 'link', 71 | $this->getLink($this->item, 'news', $langCode), 72 | Text::_('COM_OSMAP_NEWS_LINK'), 73 | [ 74 | 'target' => '_blank', 75 | 'title' => Text::_('COM_OSMAP_NEWS_LINK_TOOLTIP', true), 76 | 'class' => 'hasTooltip' 77 | ] 78 | ); 79 | ?> 80 | <span class="icon-new-tab"></span> 81 | </span> 82 | 83 | <span class="osmap-link"> 84 | <?php 85 | echo HTMLHelper::_( 86 | 'link', 87 | $this->getLink($this->item, 'images', $langCode), 88 | Text::_('COM_OSMAP_IMAGES_LINK'), 89 | [ 90 | 'target' => '_blank', 91 | 'title' => Text::_('COM_OSMAP_IMAGES_LINK_TOOLTIP', true), 92 | 'class' => 'hasTooltip' 93 | ] 94 | ); 95 | ?> 96 | <span class="icon-new-tab"></span> 97 | </span> 98 | <br> 99 | <?php endforeach; 100 | -------------------------------------------------------------------------------- /src/admin/views/sitemaps/tmpl/default_editlinks.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 7 | * @copyright 2016-2025 Joomlashack.com. All rights reserved. 8 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 9 | * 10 | * This file is part of OSMap. 11 | * 12 | * OSMap is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * OSMap is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 24 | */ 25 | 26 | use Joomla\CMS\HTML\HTMLHelper; 27 | use Joomla\CMS\Router\Route; 28 | 29 | defined('_JEXEC') or die(); 30 | 31 | $languages = $this->languages ?: ['']; 32 | 33 | foreach ($languages as $language) : 34 | $linkQuery = [ 35 | 'option' => 'com_osmap', 36 | 'view' => 'sitemapitems', 37 | 'id' => $this->item->id 38 | ]; 39 | 40 | if ($language) { 41 | $linkQuery['lang'] = $language->sef; 42 | 43 | $flag = HTMLHelper::_( 44 | 'image', 45 | 'mod_languages/' . $language->image . '.gif', 46 | $language->title, 47 | null, 48 | true 49 | ); 50 | $flag .= ' ' . $language->title; 51 | } 52 | 53 | 54 | echo HTMLHelper::_( 55 | 'link', 56 | Route::_('index.php?' . http_build_query($linkQuery)), 57 | '<span class="icon-edit"></span>' . ($language ? $flag : '') 58 | ); 59 | ?> 60 | <br> 61 | <?php endforeach; 62 | -------------------------------------------------------------------------------- /src/admin/views/sitemaps/tmpl/default_previews.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 7 | * @copyright 2016-2025 Joomlashack.com. All rights reserved. 8 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 9 | * 10 | * This file is part of OSMap. 11 | * 12 | * OSMap is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * OSMap is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 24 | */ 25 | 26 | use Joomla\CMS\HTML\HTMLHelper; 27 | use Joomla\CMS\Language\Text; 28 | 29 | defined('_JEXEC') or die(); 30 | 31 | $languages = $this->languages ?: ['']; 32 | foreach ($languages as $idx => $language) : 33 | $langCode = empty($language->sef) ? null : $language->sef; 34 | ?> 35 | <span class="osmap-link"> 36 | <?php 37 | echo HTMLHelper::_( 38 | 'link', 39 | $this->getLink($this->item, 'xml', $langCode), 40 | Text::_('COM_OSMAP_XML_LINK'), 41 | [ 42 | 'target' => '_blank', 43 | 'aria-describedby' => 'tip-xml-' . $idx 44 | ] 45 | ); 46 | ?> 47 | <div role="tooltip" id="<?php echo 'tip-xml-' . $idx; ?>"> 48 | <?php echo Text::_('COM_OSMAP_XML_LINK_TOOLTIP'); ?> 49 | </div> 50 | </span> 51 | 52 | <span class="osmap-link"> 53 | <?php 54 | echo HTMLHelper::_( 55 | 'link', 56 | $this->getLink($this->item, 'html', $langCode), 57 | Text::_('COM_OSMAP_HTML_LINK'), 58 | [ 59 | 'target' => '_blank', 60 | 'aria-describedby' => 'tip-html-' . $idx 61 | ] 62 | ); 63 | ?> 64 | <div role="tooltip" id="<?php echo 'tip-html-' . $idx; ?>"> 65 | <?php echo Text::_('COM_OSMAP_HTML_LINK_TOOLTIP'); ?> 66 | </div> 67 | </span> 68 | 69 | <span class="osmap-link"> 70 | <?php 71 | echo HTMLHelper::_( 72 | 'link', 73 | $this->getLink($this->item, 'news', $langCode), 74 | Text::_('COM_OSMAP_NEWS_LINK'), 75 | [ 76 | 'target' => '_blank', 77 | 'aria-describedby' => 'tip-news-' . $idx 78 | ] 79 | ); 80 | ?> 81 | <div role="tooltip" id="<?php echo 'tip-news-' . $idx; ?>"> 82 | <?php echo Text::_('COM_OSMAP_NEWS_LINK_TOOLTIP'); ?> 83 | </div> 84 | </span> 85 | 86 | <span class="osmap-link"> 87 | <?php 88 | echo HTMLHelper::_( 89 | 'link', 90 | $this->getLink($this->item, 'images', $langCode), 91 | Text::_('COM_OSMAP_IMAGES_LINK'), 92 | [ 93 | 'target' => '_blank', 94 | 'aria-describedby'=>'tip-images-' . $idx 95 | ] 96 | ); 97 | ?> 98 | <div role="tooltip" id="<?php echo 'tip-images-' . $idx; ?>"> 99 | <?php echo Text::_('COM_OSMAP_IMAGES_LINK_TOOLTIP'); ?> 100 | </div> 101 | </span> 102 | <br> 103 | <?php 104 | endforeach; 105 | -------------------------------------------------------------------------------- /src/admin/views/sitemaps/tmpl/emptystate.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 7 | * @copyright 2016-2025 Joomlashack.com. All rights reserved. 8 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 9 | * 10 | * This file is part of OSMap. 11 | * 12 | * OSMap is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * OSMap is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 24 | */ 25 | 26 | use Alledia\OSMap\Factory; 27 | use Joomla\CMS\Layout\LayoutHelper; 28 | 29 | defined('_JEXEC') or die; 30 | 31 | $displayData = [ 32 | 'textPrefix' => 'COM_OSMAP', 33 | 'formURL' => 'index.php?option=com_osmap&view=sitemaps', 34 | 'helpURL' => 'https://www.joomlashack.com/docs/osmaps/start/', 35 | 'icon' => 'icon-osmap', 36 | ]; 37 | 38 | $user = Factory::getApplication()->getIdentity(); 39 | 40 | if ( 41 | $user->authorise('core.create', 'com_osmap') 42 | || count($user->getAuthorisedCategories('com_osmap', 'core.create')) > 0 43 | ) { 44 | $displayData['createURL'] = 'index.php?option=com_osmap&task=sitemap.add'; 45 | } 46 | 47 | echo LayoutHelper::render('joomla.content.emptystate', $displayData); 48 | -------------------------------------------------------------------------------- /src/extensions/plg_osmap_demo/demo.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap-Pro 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2015-2025 Joomlashack.com. All rights reserved 7 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 | * 9 | * This file is part of OSMap-Pro. 10 | * 11 | * OSMap-Pro is free software: you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation, either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * OSMap-Pro is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with OSMap-Pro. If not, see <https://www.gnu.org/licenses/>. 23 | */ 24 | 25 | use Alledia\OSMap\Plugin\Base; 26 | use Alledia\OSMap\Sitemap\Collector; 27 | use Alledia\OSMap\Sitemap\Item; 28 | use Joomla\Registry\Registry; 29 | 30 | defined('_JEXEC') or die(); 31 | 32 | class PlgOsmapDemo extends Base 33 | { 34 | public function getComponentElement() 35 | { 36 | return 'com_demo'; 37 | } 38 | 39 | /** 40 | * Collect all the nodes for the current menu item and print via the collector object 41 | * 42 | * @param Collector $collector 43 | * @param Item $parent 44 | * @param Registry $params 45 | * 46 | * @return void 47 | * @throws Exception 48 | */ 49 | public function getTree(Collector $collector, Item $parent, Registry $params) 50 | { 51 | $node = (object)[ 52 | 'id' => $parent->id, 53 | 'name' => null, // The view title 54 | 'uid' => null, // A universal unique ID for this node 55 | 'modified' => null, // Modification date for this page 56 | 'browserNav' => $parent->browserNav, 57 | 'priority' => $this->params['cat_priority'], 58 | 'changefreq' => $this->params['cat_changefreq'], 59 | 'link' => null // Link to the page 60 | ]; 61 | 62 | $collector->printNode($node); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/extensions/plg_osmap_demo/demo.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <extension type="plugin" group="osmap" method="upgrade"> 3 | <name>PLG_OSMAP_DEMO</name> 4 | <author>Joomlashack</author> 5 | <authorEmail>help@joomlashack.com</authorEmail> 6 | <authorUrl>https://www.joomlashack.com</authorUrl> 7 | <copyright>2016-2025 Joomlashack. All rights reserved.</copyright> 8 | <license>GNU GPL; see LICENSE file</license> 9 | <description>PLG_OSMAP_DEMO_DESCRIPTION</description> 10 | <version>4.3.1</version> 11 | <creationDate>February 22 2021</creationDate> 12 | 13 | <files> 14 | <folder>language</folder> 15 | <filename plugin="demo">demo.php</filename> 16 | </files> 17 | </extension> 18 | -------------------------------------------------------------------------------- /src/extensions/plg_osmap_demo/language/en-GB/en-GB.plg_osmap_demo.ini: -------------------------------------------------------------------------------- 1 | PLG_OSMAP_DEMO = "OSMap - Demo" 2 | PLG_OSMAP_DEMO_DESCRIPTION = "Demonstration plugin for minimal plugin structure" 3 | -------------------------------------------------------------------------------- /src/extensions/plg_osmap_demo/language/en-GB/en-GB.plg_osmap_demo.sys.ini: -------------------------------------------------------------------------------- 1 | PLG_OSMAP_DEMO = "OSMap - Demo" 2 | PLG_OSMAP_DEMO_DESCRIPTION = "Demonstration plugin for minimal plugin structure" 3 | -------------------------------------------------------------------------------- /src/extensions/plg_osmap_demo/language/fr-FR/fr-FR.plg_osmap_demo.ini: -------------------------------------------------------------------------------- 1 | PLG_OSMAP_DEMO = "OSMap - Demo" 2 | PLG_OSMAP_DEMO_DESCRIPTION = "Demonstration plugin for minimal plugin structure" 3 | -------------------------------------------------------------------------------- /src/extensions/plg_osmap_demo/language/fr-FR/fr-FR.plg_osmap_demo.sys.ini: -------------------------------------------------------------------------------- 1 | PLG_OSMAP_DEMO = "OSMap - Demo" 2 | PLG_OSMAP_DEMO_DESCRIPTION = "Demonstration plugin for minimal plugin structure" 3 | -------------------------------------------------------------------------------- /src/extensions/plg_osmap_demo/language/tr-TR/tr-TR.plg_osmap_demo.ini: -------------------------------------------------------------------------------- 1 | PLG_OSMAP_DEMO = "OSMap - Demo" 2 | PLG_OSMAP_DEMO_DESCRIPTION = "Demonstration plugin for minimal plugin structure" 3 | -------------------------------------------------------------------------------- /src/extensions/plg_osmap_demo/language/tr-TR/tr-TR.plg_osmap_demo.sys.ini: -------------------------------------------------------------------------------- 1 | PLG_OSMAP_DEMO = "OSMap - Demo" 2 | PLG_OSMAP_DEMO_DESCRIPTION = "Demonstration plugin for minimal plugin structure" 3 | -------------------------------------------------------------------------------- /src/extensions/plg_osmap_joomla/field/TraitShack.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2021-2025 Joomlashack.com. All rights reserved 7 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 | * 9 | * This file is part of OSMap. 10 | * 11 | * OSMap is free software: you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation, either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * OSMap is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 23 | */ 24 | 25 | use Alledia\Framework\Factory; 26 | 27 | defined('_JEXEC') or die(); 28 | 29 | trait TraitShack 30 | { 31 | protected static $frameworkLoaded = null; 32 | 33 | /** 34 | * @return bool 35 | */ 36 | protected function isPro() 37 | { 38 | if ($this->isFrameworkLoaded()) { 39 | $license = Factory::getExtension('osmap', 'component'); 40 | return $license->isPro(); 41 | } 42 | 43 | return false; 44 | } 45 | 46 | /** 47 | * @return null 48 | */ 49 | protected function isFrameworkLoaded() 50 | { 51 | if (static::$frameworkLoaded === null) { 52 | if (!defined('ALLEDIA_FRAMEWORK_LOADED')) { 53 | $path = JPATH_SITE . '/libraries/allediaframework/include.php'; 54 | if (is_file($path)) { 55 | require_once $path; 56 | } 57 | } 58 | 59 | static::$frameworkLoaded = defined('ALLEDIA_FRAMEWORK_LOADED'); 60 | } 61 | 62 | return static::$frameworkLoaded; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/extensions/plg_osmap_joomla/field/radio.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2021-2025 Joomlashack.com. All rights reserved 7 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 8 | * 9 | * This file is part of OSMap. 10 | * 11 | * OSMap is free software: you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation, either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * OSMap is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 23 | */ 24 | 25 | use Joomla\CMS\Form\FormHelper; 26 | 27 | defined('_JEXEC') or die(); 28 | 29 | require_once __DIR__ . '/TraitShack.php'; 30 | 31 | FormHelper::loadFieldClass('radio'); 32 | 33 | class ShackFormFieldRadio extends JFormFieldRadio 34 | { 35 | use TraitShack; 36 | 37 | public function setup(SimpleXMLElement $element, $value, $group = null) 38 | { 39 | return $this->isPro() && parent::setup($element, $value, $group); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/extensions/plg_osmap_joomla/language/en-GB/en-GB.plg_osmap_joomla.sys.ini: -------------------------------------------------------------------------------- 1 | ; @package OSMap 2 | ; @contact www.joomlashack.com, help@joomlashack.com 3 | ; @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 4 | ; @copyright 2016-2025 Joomlashack.com. All rights reserved. 5 | ; @license https://www.gnu.org/licenses/gpl.html GNU/GPL 6 | ; 7 | ; This file is part of OSMap. 8 | ; 9 | ; OSMap is free software: you can redistribute it and/or modify 10 | ; it under the terms of the GNU General Public License as published by 11 | ; the Free Software Foundation, either version 2 of the License, or 12 | ; (at your option) any later version. 13 | ; 14 | ; OSMap is distributed in the hope that it will be useful, 15 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | ; GNU General Public License for more details. 18 | ; 19 | ; You should have received a copy of the GNU General Public License 20 | ; along with OSMap. If not, see <https://www.gnu.org/licenses/>. 21 | ; 22 | ; Note : All ini files need to be saved as UTF-8 - No BOM 23 | 24 | PLG_OSMAP_JOOMLA = "OSMap - Joomla Content" 25 | 26 | PLG_OSMAP_JOOMLA_PLUGIN_DESCRIPTION = "Add support for articles and categories" 27 | -------------------------------------------------------------------------------- /src/extensions/plg_osmap_joomla/language/fr-FR/fr-FR.plg_osmap_joomla.sys.ini: -------------------------------------------------------------------------------- 1 | ; @package OSMap 2 | ; @contact www.joomlashack.com, help@joomlashack.com 3 | ; @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 4 | ; @copyright 2016-2025 Joomlashack.com. All rights reserved. 5 | ; @license https://www.gnu.org/licenses/gpl.html GNU/GPL 6 | ; 7 | ; This file is part of OSMap. 8 | ; 9 | ; OSMap is free software: you can redistribute it and/or modify 10 | ; it under the terms of the GNU General Public License as published by 11 | ; the Free Software Foundation, either version 2 of the License, or 12 | ; (at your option) any later version. 13 | ; 14 | ; OSMap is distributed in the hope that it will be useful, 15 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | ; GNU General Public License for more details. 18 | ; 19 | ; You should have received a copy of the GNU General Public License 20 | ; along with OSMap. If not, see <https://www.gnu.org/licenses/>. 21 | ; 22 | ; Note : All ini files need to be saved as UTF-8 - No BOM 23 | 24 | PLG_OSMAP_JOOMLA = "OSMap - Joomla Content" 25 | 26 | PLG_OSMAP_JOOMLA_PLUGIN_DESCRIPTION = "Add support for articles and categories" 27 | -------------------------------------------------------------------------------- /src/extensions/plg_osmap_joomla/language/tr-TR/tr-TR.plg_osmap_joomla.sys.ini: -------------------------------------------------------------------------------- 1 | ; @package OSMap 2 | ; @contact www.joomlashack.com, help@joomlashack.com 3 | ; @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 4 | ; @copyright 2016-2025 Joomlashack.com. All rights reserved. 5 | ; @license https://www.gnu.org/licenses/gpl.html GNU/GPL 6 | ; 7 | ; This file is part of OSMap. 8 | ; 9 | ; OSMap is free software: you can redistribute it and/or modify 10 | ; it under the terms of the GNU General Public License as published by 11 | ; the Free Software Foundation, either version 2 of the License, or 12 | ; (at your option) any later version. 13 | ; 14 | ; OSMap is distributed in the hope that it will be useful, 15 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | ; GNU General Public License for more details. 18 | ; 19 | ; You should have received a copy of the GNU General Public License 20 | ; along with OSMap. If not, see <https://www.gnu.org/licenses/>. 21 | ; 22 | ; Note : All ini files need to be saved as UTF-8 - No BOM 23 | 24 | PLG_OSMAP_JOOMLA="OSMap - Joomla İçerik" 25 | 26 | PLG_OSMAP_JOOMLA_PLUGIN_DESCRIPTION="Makaleler ve kategoriler için destek eklenir." 27 | -------------------------------------------------------------------------------- /src/media/css/sitemap_html.css: -------------------------------------------------------------------------------- 1 | .osmap-items ul { 2 | margin: 0 0 9px 25px; 3 | } 4 | -------------------------------------------------------------------------------- /src/media/css/sitemap_html.min.css: -------------------------------------------------------------------------------- 1 | .osmap-items ul{margin:0 0 9px 25px} -------------------------------------------------------------------------------- /src/media/css/sitemap_html_debug.css: -------------------------------------------------------------------------------- 1 | .osmap-debug .osmap-items { 2 | padding-right: 20px; 3 | } 4 | 5 | .osmap-debug ul { 6 | border-left: 1px solid #eaeaea; 7 | border-right: 1px solid #eaeaea; 8 | border-bottom: 1px solid #eaeaea; 9 | margin-top: 10px !important; 10 | margin-bottom: 10px !important; 11 | } 12 | 13 | .osmap-debug h2 { 14 | margin-left: 20px; 15 | } 16 | 17 | .osmap-debug h2 div { 18 | font-size: 12px; 19 | } 20 | 21 | .osmap-debug-item { 22 | padding: 10px 8px; 23 | margin-left: 0; 24 | list-style-position: inside; 25 | border-top: 1px solid #eaeaea; 26 | } 27 | 28 | .osmap-debug-item.even { 29 | background: #f3f3f3; 30 | } 31 | 32 | .osmap-debug-box { 33 | font-size: 12px; 34 | padding-left: 20px; 35 | } 36 | 37 | .osmap-debug-box * { 38 | color: #666; 39 | } 40 | 41 | .osmap-debug-box div > span { 42 | font-weight: bold; 43 | } 44 | 45 | .osmap-debug-sitemap, 46 | .osmap-debug-items-count { 47 | padding: 10px; 48 | background: #f1ffa4; 49 | border-top: 1px solid #eaeaea; 50 | } 51 | 52 | .osmap-debug-item a.osmap-link { 53 | font-weight: bold; 54 | } 55 | -------------------------------------------------------------------------------- /src/media/css/sitemap_html_debug.min.css: -------------------------------------------------------------------------------- 1 | .osmap-debug-box div>span,.osmap-debug-item a.osmap-link{font-weight:700}.osmap-debug .osmap-items{padding-right:20px}.osmap-debug ul{border-left:1px solid #eaeaea;border-right:1px solid #eaeaea;border-bottom:1px solid #eaeaea;margin-top:10px!important;margin-bottom:10px!important}.osmap-debug h2{margin-left:20px}.osmap-debug h2 div{font-size:12px}.osmap-debug-item{padding:10px 8px;margin-left:0;list-style-position:inside;border-top:1px solid #eaeaea}.osmap-debug-item.even{background:#f3f3f3}.osmap-debug-box{font-size:12px;padding-left:20px}.osmap-debug-box *{color:#666}.osmap-debug-items-count,.osmap-debug-sitemap{padding:10px;background:#f1ffa4;border-top:1px solid #eaeaea} -------------------------------------------------------------------------------- /src/media/js/sitemapitems.min.js: -------------------------------------------------------------------------------- 1 | ;(function($){$.osmap=$.extend({},$.osmap);$.osmap.sitemapItems=function(params){this.$container=$(params.container);this.params=params;this.url=params.baseUri.replace(/\/$/,'') 2 | +'/index.php?option=com_osmap&view=adminsitemapitems&tmpl=component&id='+params.sitemapId;if(params.language!==''){this.url+='&lang='+params.language;} 3 | this.$frequencyField=$('<select>');for(let value in params.frequencies){$('<option>').attr('value',value).text(params.frequencies[value]).appendTo(this.$frequencyField)} 4 | this.$priorityField=$('<select>');for(let value of params.priorities){$('<option>').attr('value',value).text(value).appendTo(this.$priorityField)} 5 | this.load();};$.osmap.sitemapItems.prototype.load=function(){let self=this;$.ajax({url:this.url,async:true,success:function(data){self.$container.html(data);self.configureForm();$('.osmap-loading').remove();}});};$.osmap.sitemapItems.prototype.configureForm=function(){let self=this,$itemRows=$('tr.sitemapitem',this.$container);$itemRows.on('mouseenter',function(){self.setDropdown($('.sitemapitem-priority',this),self.$priorityField);self.setDropdown($('.sitemapitem-changefreq',this),self.$frequencyField);$(this).addClass('selected');}).on('mouseleave',function(){self.clearDropdown($('.sitemapitem-priority',this));self.clearDropdown($('.sitemapitem-changefreq',this));$(this).removeClass('selected');});this.initPublishing();$('.hasTooltip').tooltip();};$.osmap.sitemapItems.prototype.setDropdown=function($cells,$template){$cells.each(function(){let $this=$(this),$input=$template.clone().val($this.data('value'));$(this).html('').append($input);$input.on('change',function(){let $this=$(this);$this.parent().data('value',$this.val());$this.parents('tr').addClass('updated');});});};$.osmap.sitemapItems.prototype.clearDropdown=function($cells){$cells.text($cells.data('value'));} 6 | $.osmap.sitemapItems.prototype.initPublishing=function(){$('.sitemapitem-published',this.$container).on('click',function(){let $this=$(this),newValue=$this.data('value')===1?0:1,spanClass=newValue===1?'publish':'unpublish',$span=$('span',this);$this.data('value',newValue);$this.parents('.sitemapitem').addClass('updated');$span.removeClass().addClass('hasTooltip icon-'+spanClass).attr('title',newValue===1?Joomla.JText._('COM_OSMAP_TOOLTIP_CLICK_TO_UNPUBLISH'):Joomla.JText._('COM_OSMAP_TOOLTIP_CLICK_TO_PUBLISH'));if(typeof $.fn.tooltip.Constructor.VERSION==='undefined'){$span.tooltip('fixTitle');} 7 | $span.attr('data-bs-original-title',$span.attr('title')).tooltip('show');});} 8 | Joomla.submitbutton=function(task){let form=document.getElementById('adminForm');if(task==='sitemapitems.save'||task==='sitemapitems.apply'){let $updateField=$('#update-data'),$updatedItems=$('.sitemapitem.updated'),updates=[];$updatedItems.each(function(){updates.push({'uid':this.dataset.uid||null,'settings_hash':this.dataset.settingsHash||null,'published':$('.sitemapitem-published',this).data('value'),'priority':$('.sitemapitem-priority',this).data('value'),'changefreq':$('.sitemapitem-changefreq',this).data('value')});});$updateField.val(JSON.stringify(updates));} 9 | Joomla.submitform(task,form);};})(jQuery); -------------------------------------------------------------------------------- /src/script.installer.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 7 | * @copyright 2016-2025 Joomlashack.com. All rights reserved. 8 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 9 | * 10 | * This file is part of OSMap. 11 | * 12 | * OSMap is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * OSMap is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 24 | */ 25 | 26 | use Alledia\Installer\OSMap\Free\AbstractScript; 27 | 28 | // phpcs:disable PSR1.Files.SideEffects 29 | defined('_JEXEC') or die(); 30 | // phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace 31 | 32 | $installPath = __DIR__ . (is_dir(__DIR__ . '/admin') ? '/admin' : ''); 33 | include $installPath . '/library/Installer/include.php'; 34 | 35 | // phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps 36 | class com_osmapInstallerScript extends AbstractScript 37 | { 38 | } 39 | -------------------------------------------------------------------------------- /src/site/controller.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 7 | * @copyright 2016-2025 Joomlashack.com. All rights reserved. 8 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 9 | * 10 | * This file is part of OSMap. 11 | * 12 | * OSMap is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * OSMap is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 24 | */ 25 | 26 | use Joomla\CMS\MVC\Controller\BaseController; 27 | 28 | defined('_JEXEC') or die(); 29 | 30 | /** 31 | * OSMap Component Controller 32 | * 33 | * @package OSMap 34 | * @subpackage com_osmap 35 | */ 36 | class OSMapController extends BaseController 37 | { 38 | protected $default_view = 'xml'; 39 | } 40 | -------------------------------------------------------------------------------- /src/site/helpers/osmap.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 7 | * @copyright 2016-2025 Joomlashack.com. All rights reserved. 8 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 9 | * 10 | * This file is part of OSMap. 11 | * 12 | * OSMap is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * OSMap is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 24 | */ 25 | 26 | defined('_JEXEC') or die(); 27 | 28 | use Alledia\OSMap; 29 | 30 | /** 31 | * OSMap Component Controller 32 | * 33 | * @package OSMap 34 | * @subpackage com_osmap 35 | */ 36 | if (!class_exists('OSMapHelper')) { 37 | class OSMapHelper extends OSMap\Helper\General 38 | { 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/site/helpers/xmap.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 7 | * @copyright 2016-2025 Joomlashack.com. All rights reserved. 8 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 9 | * 10 | * This file is part of OSMap. 11 | * 12 | * OSMap is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * OSMap is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 24 | */ 25 | 26 | defined('_JEXEC') or die(); 27 | 28 | use Alledia\OSMap; 29 | 30 | /** 31 | * OSMap Component Controller 32 | * 33 | * @package OSMap 34 | * @subpackage com_osmap 35 | */ 36 | if (!class_exists('XmapHelper')) { 37 | class XMapHelper extends OSMap\Helper\General 38 | { 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/site/language/en-GB/en-GB.com_osmap.ini: -------------------------------------------------------------------------------- 1 | ; @package OSMap 2 | ; @package OSMap 3 | ; @contact www.joomlashack.com, help@joomlashack.com 4 | ; @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 5 | ; @copyright 2016-2025 Joomlashack.com. All rights reserved. 6 | ; @license https://www.gnu.org/licenses/gpl.html GNU/GPL 7 | ; 8 | ; This file is part of OSMap. 9 | ; 10 | ; OSMap is free software: you can redistribute it and/or modify 11 | ; it under the terms of the GNU General Public License as published by 12 | ; the Free Software Foundation, either version 2 of the License, or 13 | ; (at your option) any later version. 14 | ; 15 | ; OSMap is distributed in the hope that it will be useful, 16 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | ; GNU General Public License for more details. 19 | ; 20 | ; You should have received a copy of the GNU General Public License 21 | ; along with OSMap. If not, see <https://www.gnu.org/licenses/>. 22 | ; 23 | ; Note : All ini files need to be saved as UTF-8 - No BOM 24 | 25 | COM_OSMAP_ADAPTER_CLASS = "Adapter Class" 26 | 27 | COM_OSMAP_ADMIN_NOTE_DUPLICATED = "- Duplicates another displayed item (compare the UID)." 28 | COM_OSMAP_ADMIN_NOTE_DUPLICATED_IGNORED = "- Duplicates another displayed item (compare the UID)." 29 | COM_OSMAP_ADMIN_NOTE_DUPLICATED_URL_IGNORED = "Duplicates another displayed item, based on the URL" 30 | COM_OSMAP_ADMIN_NOTE_IGNORED_EXTERNAL = "- External link. The sitemap will not display it." 31 | COM_OSMAP_ADMIN_NOTE_IGNORED_EXTERNAL_HTML = "- External link. If published, only the HTML sitemap will display it." 32 | COM_OSMAP_ADMIN_NOTE_INVISIBLE_FOR_ROBOTS = "Set as invisible for robots. Won't be displayed on the XML sitemap." 33 | COM_OSMAP_ADMIN_NOTE_PARENT_INVISIBLE_FOR_ROBOTS = "Parent is set as invisible for robots. Won't be displayed on the XML sitemap." 34 | COM_OSMAP_ADMIN_NOTE_PARENT_UNPUBLISHED = "- Unpublished because the parent is unpublished." 35 | COM_OSMAP_ADMIN_NOTE_VISIBLE_HTML_ONLY = "- Set as visible only for the HTML sitemap." 36 | COM_OSMAP_ADMIN_NOTE_VISIBLE_XML_ONLY = "- Set as visible only for the XML sitemap." 37 | COM_OSMAP_ADMIN_NOTES = "Notes" 38 | 39 | COM_OSMAP_ALWAYS = "Always" 40 | 41 | COM_OSMAP_CHANGE_FREQ = "Change Frequency" 42 | COM_OSMAP_DAILY = "Daily" 43 | 44 | COM_OSMAP_DEBUG_ALERT = "The debug mode is enabled for this menu. If you want to see the normal HTML sitemap again, disable debug in the menu params." 45 | COM_OSMAP_DEBUG_ALERT_TITLE = "Debug Mode" 46 | 47 | COM_OSMAP_DOCUMENTATION = "documentation" 48 | COM_OSMAP_DUPLICATE = "Duplicate Item" 49 | COM_OSMAP_FULL_LINK = "Full Link" 50 | 51 | COM_OSMAP_HEADING_CHANGE_FREQ = "Change Frequency" 52 | COM_OSMAP_HEADING_PRIORITY = "Priority" 53 | COM_OSMAP_HEADING_PUBLICATION_DATE = "Publication Date" 54 | COM_OSMAP_HEADING_STATUS = "Status" 55 | COM_OSMAP_HEADING_TITLE = "Title" 56 | COM_OSMAP_HEADING_URL = "URL" 57 | 58 | COM_OSMAP_HOURLY = "Hourly" 59 | COM_OSMAP_IMAGES = "images" 60 | COM_OSMAP_INSTRUCTIONS = "To edit your sitemap, use the administration interface. Check out the " 61 | 62 | COM_OSMAP_LEVEL = "Level" 63 | COM_OSMAP_LINK = "Link" 64 | 65 | COM_OSMAP_MENUTYPE = "Menu Type" 66 | COM_OSMAP_MODIFICATION_DATE = "Last Modification Date" 67 | COM_OSMAP_MODIFIED = "Modified" 68 | COM_OSMAP_MONTHLY = "Monthly" 69 | 70 | COM_OSMAP_MSG_SITEMAP_IS_UNPUBLISHED = "Sorry, this sitemap is not accessible." 71 | COM_OSMAP_MSG_TASK_STOPPED_BY_PLUGIN = "Execution canceled by an OSMap plugin" 72 | 73 | COM_OSMAP_NEVER = "Never" 74 | COM_OSMAP_NO_ITEMS = "No items found. Try selecting a different set of menus." 75 | COM_OSMAP_NUMBER_OF_ITEMS_FOUND = "%s items found" 76 | COM_OSMAP_NUMBER_OF_URLS = "Total of URLs" 77 | 78 | COM_OSMAP_PRIORITY_LABEL = "Priority" 79 | COM_OSMAP_RAW_LINK = "RAW Link" 80 | 81 | COM_OSMAP_SITEMAP = "Sitemap" 82 | COM_OSMAP_SITEMAP_ID = "Sitemap ID" 83 | COM_OSMAP_SITEMAP_ITEMS_COUNT = "Items Count" 84 | COM_OSMAP_SITEMAP_NOT_FOUND = "Sitemap not found" 85 | 86 | COM_OSMAP_TOOLTIP_CLICK_TO_PUBLISH = "Click to publish" 87 | COM_OSMAP_TOOLTIP_CLICK_TO_UNPUBLISH = "Click to unpublish" 88 | 89 | COM_OSMAP_UID = "UID" 90 | COM_OSMAP_URL = "URL" 91 | COM_OSMAP_VISIBLE_FOR_ROBOTS = "Visible For Robots" 92 | COM_OSMAP_WARNING_OOM = "OSMap (%s) ran out of memory. Please let the site administrator know that the server will need to be reconfigured." 93 | COM_OSMAP_WEEKLY = "Weekly" 94 | COM_OSMAP_YEARLY = "Yearly" 95 | -------------------------------------------------------------------------------- /src/site/language/fr-FR/fr-FR.com_osmap.ini: -------------------------------------------------------------------------------- 1 | ; @package OSMap 2 | ; @package OSMap 3 | ; @contact www.joomlashack.com, help@joomlashack.com 4 | ; @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 5 | ; @copyright 2016-2024 Joomlashack.com. All rights reserved. 6 | ; @license https://www.gnu.org/licenses/gpl.html GNU/GPL 7 | ; 8 | ; This file is part of OSMap. 9 | ; 10 | ; OSMap is free software: you can redistribute it and/or modify 11 | ; it under the terms of the GNU General Public License as published by 12 | ; the Free Software Foundation, either version 2 of the License, or 13 | ; (at your option) any later version. 14 | ; 15 | ; OSMap is distributed in the hope that it will be useful, 16 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | ; GNU General Public License for more details. 19 | ; 20 | ; You should have received a copy of the GNU General Public License 21 | ; along with OSMap. If not, see <https://www.gnu.org/licenses/>. 22 | ; 23 | ; Note : All ini files need to be saved as UTF-8 - No BOM 24 | 25 | COM_OSMAP_ADAPTER_CLASS = "Classe d'adaptation" 26 | 27 | COM_OSMAP_ADMIN_NOTE_DUPLICATED = "- duplique un autre item affiché (compare l'UID)." 28 | COM_OSMAP_ADMIN_NOTE_DUPLICATED_IGNORED = "- Duplique un autre item affiché (compare l'UID)." 29 | COM_OSMAP_ADMIN_NOTE_DUPLICATED_URL_IGNORED = "Duplique un autre item affiché, basé sur l'URL" 30 | COM_OSMAP_ADMIN_NOTE_IGNORED_EXTERNAL = "- Lien externe. Le plan du site ne l'affichera pas." 31 | COM_OSMAP_ADMIN_NOTE_IGNORED_EXTERNAL_HTML = "- Lien externe. Si publié seul le plan HTML l'affichera." 32 | COM_OSMAP_ADMIN_NOTE_INVISIBLE_FOR_ROBOTS = "Défini comme invisible pour les robots. Ne sera pas affiché sur le plan XML." 33 | COM_OSMAP_ADMIN_NOTE_PARENT_INVISIBLE_FOR_ROBOTS = "Le parent sera invisible pour les robots. Ne sera pas affiché sur le plan XML." 34 | COM_OSMAP_ADMIN_NOTE_PARENT_UNPUBLISHED = "- Non publié car le parent n'est pas publié." 35 | COM_OSMAP_ADMIN_NOTE_VISIBLE_HTML_ONLY = "- Défini comme visible seulement pour le plan HTML." 36 | COM_OSMAP_ADMIN_NOTE_VISIBLE_XML_ONLY = "- Défini comme visible seulement pour le plan XML." 37 | COM_OSMAP_ADMIN_NOTES = "Notes" 38 | 39 | COM_OSMAP_ALWAYS = "Toujours" 40 | 41 | COM_OSMAP_CHANGE_FREQ = "Modifier la fréquence" 42 | COM_OSMAP_DAILY = "Tous les jours" 43 | 44 | COM_OSMAP_DEBUG_ALERT = "Le mode debug est activé pour ce menu. Si vous souhaitez afficher le plan normal, désactivez le mode debug dans les paramètres." 45 | COM_OSMAP_DEBUG_ALERT_TITLE = "Mode debug" 46 | 47 | COM_OSMAP_DOCUMENTATION = "documentation" 48 | COM_OSMAP_DUPLICATE = "Dupliquer l'Item" 49 | COM_OSMAP_FULL_LINK = "Lien complet" 50 | 51 | COM_OSMAP_HEADING_CHANGE_FREQ = "Modifier la fréquence" 52 | COM_OSMAP_HEADING_PRIORITY = "Priorité" 53 | COM_OSMAP_HEADING_PUBLICATION_DATE = "Date de Publication" 54 | COM_OSMAP_HEADING_STATUS = "Status" 55 | COM_OSMAP_HEADING_TITLE = "Titre" 56 | COM_OSMAP_HEADING_URL = "URL" 57 | 58 | COM_OSMAP_HOURLY = "Toutes les heures" 59 | COM_OSMAP_IMAGES = "images" 60 | COM_OSMAP_INSTRUCTIONS = "Pour editer le plan du site, utilisez le portail administrateur" 61 | 62 | COM_OSMAP_LEVEL = "Niveau" 63 | COM_OSMAP_LINK = "Lien" 64 | 65 | COM_OSMAP_MENUTYPE = "Type de Menu" 66 | COM_OSMAP_MODIFICATION_DATE = "Dernère date de modification" 67 | COM_OSMAP_MODIFIED = "Modifié" 68 | COM_OSMAP_MONTHLY = "Tous les mois" 69 | 70 | COM_OSMAP_MSG_SITEMAP_IS_UNPUBLISHED = "Désolé le plan du site n'est pas accessible." 71 | COM_OSMAP_MSG_TASK_STOPPED_BY_PLUGIN = "Execution annulée par le plugin OSMap." 72 | 73 | COM_OSMAP_NEVER = "Jamais" 74 | COM_OSMAP_NO_ITEMS = "Aucun item trouvé(s). Essayez une autre liste de menus." 75 | COM_OSMAP_NUMBER_OF_ITEMS_FOUND = "%s items trouvé(s)" 76 | COM_OSMAP_NUMBER_OF_URLS = "Total des URLs" 77 | 78 | COM_OSMAP_PRIORITY_LABEL = "Priorit&" 79 | COM_OSMAP_RAW_LINK = "Lien RAW" 80 | 81 | COM_OSMAP_SITEMAP = "Plan du Site" 82 | COM_OSMAP_SITEMAP_ID = "ID du plan" 83 | COM_OSMAP_SITEMAP_ITEMS_COUNT = "Nombre d'items" 84 | COM_OSMAP_SITEMAP_NOT_FOUND = "Plan du site non trouvé" 85 | 86 | COM_OSMAP_TOOLTIP_CLICK_TO_PUBLISH = "Cliquer pour publier" 87 | COM_OSMAP_TOOLTIP_CLICK_TO_UNPUBLISH = "Cliquer pour dépublier" 88 | 89 | COM_OSMAP_UID = "UID" 90 | COM_OSMAP_URL = "URL" 91 | COM_OSMAP_VISIBLE_FOR_ROBOTS = "Visible pour les robots" 92 | COM_OSMAP_WARNING_OOM = "OSMap (%s) a dépassé les limites de mémoire. Indiquez à l'administrateur du site qu'il doit reconfigurer des paramètres." 93 | COM_OSMAP_WEEKLY = "Toutes les semaines" 94 | COM_OSMAP_YEARLY = "Tous les ans" 95 | -------------------------------------------------------------------------------- /src/site/language/tr-TR/tr-TR.com_osmap.ini: -------------------------------------------------------------------------------- 1 | ; @package OSMap 2 | ; @package OSMap 3 | ; @contact www.joomlashack.com, help@joomlashack.com 4 | ; @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 5 | ; @copyright 2016-2025 Joomlashack.com. All rights reserved. 6 | ; @license https://www.gnu.org/licenses/gpl.html GNU/GPL 7 | ; 8 | ; This file is part of OSMap. 9 | ; 10 | ; OSMap is free software: you can redistribute it and/or modify 11 | ; it under the terms of the GNU General Public License as published by 12 | ; the Free Software Foundation, either version 2 of the License, or 13 | ; (at your option) any later version. 14 | ; 15 | ; OSMap is distributed in the hope that it will be useful, 16 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | ; GNU General Public License for more details. 19 | ; 20 | ; You should have received a copy of the GNU General Public License 21 | ; along with OSMap. If not, see <https://www.gnu.org/licenses/>. 22 | ; 23 | ; Note : All ini files need to be saved as UTF-8 - No BOM 24 | 25 | COM_OSMAP_ADAPTER_CLASS = "Kaliteli Uyarlayıcı" 26 | 27 | COM_OSMAP_ADMIN_NOTE_DUPLICATED = "- Görüntülenen başka bir öğeyi yineler (UID'yi karşılaştırın)." 28 | COM_OSMAP_ADMIN_NOTE_DUPLICATED_IGNORED = "- Görüntülenen başka bir öğeyi yineler (UID'yi karşılaştırın)." 29 | COM_OSMAP_ADMIN_NOTE_DUPLICATED_URL_IGNORED = "URL'ye dayalı olarak görüntülenen başka bir öğeyi çoğaltır" 30 | COM_OSMAP_ADMIN_NOTE_IGNORED_EXTERNAL = "- Harici bağlantı. Site haritası görüntülemez." 31 | COM_OSMAP_ADMIN_NOTE_IGNORED_EXTERNAL_HTML = "- Harici bağlantı. Yayınlanırsa, yalnızca HTML site haritası görüntülenir." 32 | COM_OSMAP_ADMIN_NOTE_INVISIBLE_FOR_ROBOTS = "Robotlar için görünmez olarak ayarlayın. XML site haritasında görüntülenmez." 33 | COM_OSMAP_ADMIN_NOTE_PARENT_INVISIBLE_FOR_ROBOTS = "Üst öğeler, robotlar için görünmez olarak ayarlanmıştır. XML site haritasında görüntülenmez." 34 | COM_OSMAP_ADMIN_NOTE_PARENT_UNPUBLISHED = "- Yayınlanmadı çünkü üst öğe yayınlanmadı." 35 | COM_OSMAP_ADMIN_NOTE_VISIBLE_HTML_ONLY = "- Yalnızca HTML site haritası için görünür olarak ayarlayın." 36 | COM_OSMAP_ADMIN_NOTE_VISIBLE_XML_ONLY = "- Yalnızca XML site haritası için görünür olarak ayarlayın." 37 | COM_OSMAP_ADMIN_NOTES = "Notlar" 38 | 39 | COM_OSMAP_ALWAYS = "Her Zaman" 40 | 41 | COM_OSMAP_CHANGE_FREQ = "Değişiklik Sıklığı" 42 | COM_OSMAP_DAILY = "Günlük" 43 | 44 | COM_OSMAP_DEBUG_ALERT = "Hata ayıklama modu bu menü için etkinleştirilir. Normal HTML site haritasını tekrar görmek istiyorsanız, menü parametrelerinde hata ayıklamayı devre dışı bırakın." 45 | COM_OSMAP_DEBUG_ALERT_TITLE = "Hata Ayıklama Modu" 46 | 47 | COM_OSMAP_DOCUMENTATION = "Belgeler" 48 | COM_OSMAP_DUPLICATE = "Yinelenen Öğe" 49 | COM_OSMAP_FULL_LINK = "Tam Bağlantı" 50 | 51 | COM_OSMAP_HEADING_CHANGE_FREQ = "Değişiklik Sıklığı" 52 | COM_OSMAP_HEADING_PRIORITY = "Öncelik" 53 | COM_OSMAP_HEADING_PUBLICATION_DATE = "Yayın Tarihi" 54 | COM_OSMAP_HEADING_STATUS = "Durum" 55 | COM_OSMAP_HEADING_TITLE = "Başlık" 56 | COM_OSMAP_HEADING_URL = "URL" 57 | 58 | COM_OSMAP_HOURLY = "Saatte Bir" 59 | COM_OSMAP_IMAGES = "Görüntüler" 60 | COM_OSMAP_INSTRUCTIONS = "Site haritanızı düzenlemek için yönetim arayüzünü kullanın. Kontrol edin. " 61 | 62 | COM_OSMAP_LEVEL = "Düzey" 63 | COM_OSMAP_LINK = "Link" 64 | 65 | COM_OSMAP_MENUTYPE = "Menü Biçimi" 66 | COM_OSMAP_MODIFICATION_DATE = "Son Değişiklik Tarihi" 67 | COM_OSMAP_MODIFIED = "Değiştirilen" 68 | COM_OSMAP_MONTHLY = "Aylık" 69 | 70 | COM_OSMAP_MSG_SITEMAP_IS_UNPUBLISHED = "Maalesef, bu site haritasına erişilemiyor." 71 | COM_OSMAP_MSG_TASK_STOPPED_BY_PLUGIN = "Bir OSMap eklentisi tarafından yürütme iptal edildi." 72 | 73 | COM_OSMAP_NEVER = "Asla" 74 | COM_OSMAP_NO_ITEMS = "Hiç bir öğe bulunamadı. Farklı bir menü kümesi seçmeyi deneyin." 75 | COM_OSMAP_NUMBER_OF_ITEMS_FOUND = "%s öğe bulundu" 76 | COM_OSMAP_NUMBER_OF_URLS = "Toplam URL" 77 | 78 | COM_OSMAP_PRIORITY_LABEL = "Öncelik" 79 | COM_OSMAP_RAW_LINK = "RAW Link" 80 | 81 | COM_OSMAP_SITEMAP = "Site Haritası" 82 | COM_OSMAP_SITEMAP_ID = "Site Haritası ID" 83 | COM_OSMAP_SITEMAP_ITEMS_COUNT = "Öğe Sayısı" 84 | COM_OSMAP_SITEMAP_NOT_FOUND = "Site Haritası bulunamadı" 85 | 86 | COM_OSMAP_TOOLTIP_CLICK_TO_PUBLISH = "Yayınlamak için tıklayın" 87 | COM_OSMAP_TOOLTIP_CLICK_TO_UNPUBLISH = "Yayından kaldırmak için tıklayın" 88 | 89 | COM_OSMAP_UID = "UID" 90 | COM_OSMAP_URL = "URL" 91 | COM_OSMAP_VISIBLE_FOR_ROBOTS = "Robotlar İçin Görünürlük" 92 | COM_OSMAP_WARNING_OOM = "OSMap (%s) belleği yetersiz. Lütfen site yöneticisine sunucunun yeniden yapılandırılması gerektiğini bildirin." 93 | COM_OSMAP_WEEKLY = "Haftalık" 94 | COM_OSMAP_YEARLY = "Yıllık" 95 | -------------------------------------------------------------------------------- /src/site/osmap.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 7 | * @copyright 2016-2025 Joomlashack.com. All rights reserved. 8 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 9 | * 10 | * This file is part of OSMap. 11 | * 12 | * OSMap is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * OSMap is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 24 | */ 25 | 26 | use Alledia\OSMap\Factory; 27 | use Joomla\CMS\MVC\Controller\BaseController; 28 | 29 | defined('_JEXEC') or die(); 30 | 31 | require_once JPATH_ADMINISTRATOR . '/components/com_osmap/include.php'; 32 | 33 | $task = Factory::getApplication()->input->getCmd('task'); 34 | 35 | $controller = BaseController::getInstance('OSMap'); 36 | $controller->execute($task); 37 | $controller->redirect(); 38 | -------------------------------------------------------------------------------- /src/site/views/adminsitemapitems/tmpl/default.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 7 | * @copyright 2016-2025 Joomlashack.com. All rights reserved. 8 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 9 | * 10 | * This file is part of OSMap. 11 | * 12 | * OSMap is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * OSMap is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 24 | */ 25 | 26 | use Alledia\OSMap\Factory; 27 | 28 | defined('_JEXEC') or die(); 29 | 30 | Factory::getApplication()->input->set('tmpl', 'component'); 31 | 32 | if (empty($this->message)) : 33 | echo $this->loadTemplate('items'); 34 | 35 | else : ?> 36 | <div class="alert alert-warning"> 37 | <?php echo $this->message; ?> 38 | </div> 39 | <?php endif; 40 | 41 | jexit(); 42 | -------------------------------------------------------------------------------- /src/site/views/adminsitemapitems/view.html.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 7 | * @copyright 2016-2025 Joomlashack.com. All rights reserved. 8 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 9 | * 10 | * This file is part of OSMap. 11 | * 12 | * OSMap is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * OSMap is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 24 | */ 25 | 26 | use Alledia\OSMap\Component\Helper as ComponentHelper; 27 | use Alledia\OSMap\Factory; 28 | use Alledia\OSMap\Sitemap\SitemapInterface; 29 | use Joomla\CMS\Language\Text; 30 | use Joomla\CMS\MVC\View\HtmlView; 31 | use Joomla\Input\Input; 32 | use Joomla\Registry\Registry; 33 | 34 | defined('_JEXEC') or die(); 35 | 36 | class OSMapViewAdminSitemapItems extends HtmlView 37 | { 38 | /** 39 | * @var Registry 40 | */ 41 | protected $params = null; 42 | 43 | /** 44 | * @var SitemapInterface 45 | */ 46 | protected $sitemap = null; 47 | 48 | /** 49 | * @var Registry 50 | */ 51 | protected $osmapParams = null; 52 | 53 | /** 54 | * @var string 55 | */ 56 | protected $message = null; 57 | 58 | /** 59 | * @inheritDoc 60 | * @throws Exception 61 | */ 62 | public function display($tpl = null) 63 | { 64 | $this->checkAccess(); 65 | 66 | $container = Factory::getPimpleContainer(); 67 | 68 | try { 69 | $id = $container->input->getInt('id'); 70 | 71 | $this->params = Factory::getApplication()->getParams(); 72 | 73 | // Load the sitemap instance 74 | $this->sitemap = Factory::getSitemap($id); 75 | $this->osmapParams = ComponentHelper::getParams(); 76 | 77 | } catch (Exception $e) { 78 | $this->message = $e->getMessage(); 79 | } 80 | 81 | parent::display($tpl); 82 | } 83 | 84 | /** 85 | * This view should only be available from the backend 86 | * 87 | * @return void 88 | * @throws Exception 89 | */ 90 | protected function checkAccess() 91 | { 92 | $server = new Input(array_change_key_case($_SERVER, CASE_LOWER)); 93 | $referer = parse_url($server->getString('http_referer')); 94 | 95 | if (empty($referer['query']) == false) { 96 | parse_str($referer['query'], $query); 97 | 98 | $option = empty($query['option']) ? null : $query['option']; 99 | $view = empty($query['view']) ? null : $query['view']; 100 | 101 | if ($option == 'com_osmap' && $view == 'sitemapitems') { 102 | // Good enough 103 | return; 104 | } 105 | } 106 | 107 | throw new Exception(Text::_('JERROR_PAGE_NOT_FOUND'), 404); 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /src/site/views/html/tmpl/default.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 7 | * @copyright 2016-2025 Joomlashack.com. All rights reserved. 8 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 9 | * 10 | * This file is part of OSMap. 11 | * 12 | * OSMap is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * OSMap is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 24 | */ 25 | 26 | use Alledia\OSMap\Factory; 27 | use Joomla\CMS\HTML\HTMLHelper; 28 | 29 | defined('_JEXEC') or die(); 30 | 31 | if ($this->params->get('use_css', 1)) : 32 | HTMLHelper::_('stylesheet', 'com_osmap/sitemap_html.min.css', ['relative' => true]); 33 | endif; 34 | 35 | if ($this->debug) : 36 | Factory::getApplication()->input->set('tmpl', 'component'); 37 | HTMLHelper::_('stylesheet', 'com_osmap/sitemap_html_debug.min.css', ['relative' => true]); 38 | endif; 39 | 40 | if ($this->params->get('menu_text') !== null) : 41 | // We have a menu, so let's use its params to display the heading 42 | $pageHeading = $this->params->get('page_heading', $this->params->get('page_title')); 43 | else : 44 | // We don't have a menu, so lets use the sitemap name 45 | $pageHeading = $this->sitemap->name; 46 | endif; 47 | 48 | $class = join(' ', array_filter([ 49 | 'osmap-sitemap', 50 | $this->debug ? 'osmap-debug' : '', 51 | $this->params->get('pageclass_sfx', '') 52 | ])); 53 | ?> 54 | 55 | <div id="osmap" class="<?php echo $class; ?>"> 56 | <!-- Heading --> 57 | <?php if ($this->params->get('show_page_heading', 1)) : ?> 58 | <div class="page-header"> 59 | <h1><?php echo $this->escape($pageHeading); ?></h1> 60 | </div> 61 | <?php endif; ?> 62 | 63 | <!-- Description --> 64 | <?php if ($this->params->get('show_sitemap_description', 1)) : ?> 65 | <div class="osmap-sitemap-description"> 66 | <?php echo $this->params->get('sitemap_description', ''); ?> 67 | </div> 68 | <?php endif; ?> 69 | 70 | <!-- Items --> 71 | <?php echo $this->loadTemplate('items'); ?> 72 | </div> 73 | -------------------------------------------------------------------------------- /src/site/views/html/tmpl/default.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <metadata> 3 | <layout title="COM_OSMAP_SITEMAP_HTML_VIEW_DEFAULT_TITLE"> 4 | <message> 5 | <![CDATA[COM_OSMAP_SITEMAP_HTML_VIEW_DEFAULT_DESC]]> 6 | </message> 7 | </layout> 8 | 9 | <fields name="request"> 10 | <fieldset name="request" addfieldpath="/administrator/components/com_osmap/form/fields"> 11 | <field name="id" 12 | type="osmap.sitemaps" 13 | required="true" 14 | label="COM_OSMAP_SITEMAP"/> 15 | </fieldset> 16 | </fields> 17 | 18 | <fields name="params"> 19 | <fieldset name="basic" label="COM_OSMAP_FIELDSET_SITEMAP_SETTINGS_LABEL"> 20 | <field name="debug" 21 | type="radio" 22 | class="btn-group btn-group-yesno" 23 | layout="joomla.form.field.radio.switcher" 24 | label="COM_OSMAP_OPTION_DEBUG_LABEL" 25 | description="COM_OSMAP_OPTION_DEBUG_DESC" 26 | default="0"> 27 | <option value="0">JNO</option> 28 | <option value="1">JYES</option> 29 | </field> 30 | 31 | <field name="use_css" 32 | type="radio" 33 | class="btn-group btn-group-yesno" 34 | layout="joomla.form.field.radio.switcher" 35 | label="COM_OSMAP_OPTION_USE_CSS_LABEL" 36 | description="COM_OSMAP_OPTION_USE_CSS_DESC" 37 | default="1"> 38 | <option value="0">JNO</option> 39 | <option value="1">JYES</option> 40 | </field> 41 | 42 | <field name="show_menu_titles" 43 | type="radio" 44 | class="btn-group btn-group-yesno" 45 | layout="joomla.form.field.radio.switcher" 46 | label="COM_OSMAP_OPTION_SHOW_MENU_TITLES_LABEL" 47 | description="COM_OSMAP_OPTION_SHOW_MENU_TITLES_DESC" 48 | default="1"> 49 | <option value="0">JNO</option> 50 | <option value="1">JYES</option> 51 | </field> 52 | 53 | <field name="show_sitemap_description" 54 | type="radio" 55 | class="btn-group btn-group-yesno" 56 | layout="joomla.form.field.radio.switcher" 57 | label="COM_OSMAP_SHOW_SITEMAP_DESCRIPTION_LABEL" 58 | description="COM_OSMAP_SHOW_SITEMAP_DESCRIPTION_DESC" 59 | default="0"> 60 | <option value="0">JNO</option> 61 | <option value="1">JYES</option> 62 | </field> 63 | 64 | <field name="sitemap_description" 65 | type="editor" 66 | label="COM_OSMAP_SITEMAP_DESCRIPTION_LABEL" 67 | description="COM_OSMAP_SITEMAP_DESCRIPTION_DESC" 68 | buttons="true" 69 | hide="pagebreak,readmore" 70 | filter="safehtml" 71 | showon="show_sitemap_description:1"/> 72 | </fieldset> 73 | </fields> 74 | </metadata> 75 | -------------------------------------------------------------------------------- /src/site/views/html/tmpl/default_items.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 7 | * @copyright 2016-2025 Joomlashack.com. All rights reserved. 8 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 9 | * 10 | * This file is part of OSMap. 11 | * 12 | * OSMap is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * OSMap is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 24 | */ 25 | 26 | use Joomla\CMS\Language\Text; 27 | 28 | defined('_JEXEC') or die(); 29 | 30 | if ($this->debug) : ?> 31 | <div class="osmap-debug-sitemap"> 32 | <h1><?php echo Text::_('COM_OSMAP_DEBUG_ALERT_TITLE'); ?></h1> 33 | <p><?php echo Text::_('COM_OSMAP_DEBUG_ALERT'); ?></p> 34 | <?php echo Text::_('COM_OSMAP_SITEMAP_ID'); ?>: <?php echo $this->sitemap->id; ?> 35 | </div> 36 | <?php endif; ?> 37 | 38 | <div class="osmap-items"> 39 | <?php $this->sitemap->traverse([$this, 'registerNodeIntoList']); ?> 40 | <?php $this->renderSitemap(); ?> 41 | </div> 42 | 43 | <?php if ($this->debug) : ?> 44 | <div class="osmap-debug-items-count"> 45 | <?php echo Text::_('COM_OSMAP_SITEMAP_ITEMS_COUNT'); ?>: <?php echo $this->generalCounter; ?> 46 | </div> 47 | <?php endif; ?> 48 | -------------------------------------------------------------------------------- /src/site/views/html/view.html.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 7 | * @copyright 2016-2025 Joomlashack.com. All rights reserved. 8 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 9 | * 10 | * This file is part of OSMap. 11 | * 12 | * OSMap is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * OSMap is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 24 | */ 25 | 26 | use Alledia\OSMap\View\Site\AbstractList; 27 | 28 | // phpcs:disable PSR1.Files.SideEffects 29 | defined('_JEXEC') or die(); 30 | // phpcs:enable PSR1.Files.SideEffects 31 | // phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace 32 | 33 | class OSMapViewHtml extends AbstractList 34 | { 35 | } 36 | -------------------------------------------------------------------------------- /src/site/views/xml/tmpl/default.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 7 | * @copyright 2016-2025 Joomlashack.com. All rights reserved. 8 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 9 | * 10 | * This file is part of OSMap. 11 | * 12 | * OSMap is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * OSMap is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 24 | */ 25 | 26 | use Joomla\CMS\Language\Language; 27 | 28 | defined('_JEXEC') or die(); 29 | 30 | /** 31 | * @var OsmapViewXml $this 32 | * @var object $template 33 | * @var string $layout 34 | * @var string $layoutTemplate 35 | * @var Language $lang 36 | * @var string $filetofind 37 | */ 38 | 39 | echo sprintf('<?xml version="1.0" encoding="%s"?>' . "\n", $this->_charset); 40 | 41 | if (empty($this->message)) { 42 | echo $this->loadTemplate($this->type); 43 | 44 | } else { 45 | echo '<message>' . $this->message . '</message>'; 46 | } 47 | -------------------------------------------------------------------------------- /src/site/views/xml/tmpl/default.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <metadata> 3 | <layout title="COM_OSMAP_SITEMAP_XML_VIEW_DEFAULT_TITLE"> 4 | <message> 5 | <![CDATA[COM_OSMAP_SITEMAP_XML_VIEW_DEFAULT_DESC]]> 6 | </message> 7 | </layout> 8 | 9 | <fields name="request"> 10 | <fieldset name="request" 11 | addfieldpath="/administrator/components/com_osmap/form/fields"> 12 | 13 | <field name="id" 14 | type="osmap.sitemaps" 15 | required="true" 16 | label="COM_OSMAP_SITEMAP"/> 17 | 18 | <field name="format" 19 | type="hidden" 20 | default="xml"/> 21 | </fieldset> 22 | </fields> 23 | 24 | <fields name="params"> 25 | <fieldset name="basic" 26 | label="COM_OSMAP_FIELDSET_SITEMAP_SETTINGS_LABEL"> 27 | 28 | <field name="add_styling" 29 | type="radio" 30 | class="btn-group btn-group-yesno" 31 | layout="joomla.form.field.radio.switcher" 32 | label="COM_OSMAP_OPTION_ADD_STYLING_LABEL" 33 | description="COM_OSMAP_OPTION_ADD_STYLING_DESC" 34 | default="1"> 35 | <option value="0">JNO</option> 36 | <option value="1">JYES</option> 37 | </field> 38 | 39 | <field name="debug" 40 | type="radio" 41 | class="btn-group btn-group-yesno" 42 | layout="joomla.form.field.radio.switcher" 43 | label="COM_OSMAP_OPTION_DEBUG_LABEL" 44 | description="COM_OSMAP_OPTION_DEBUG_DESC" 45 | default="0"> 46 | <option value="0">JNO</option> 47 | <option value="1">JYES</option> 48 | </field> 49 | 50 | <field name="news_publication_name" 51 | type="text" 52 | label="COM_OSMAP_NEWS_PUBLICATION_NAME_LABEL" 53 | description="COM_OSMAP_NEWS_PUBLICATION_NAME_DESC"/> 54 | </fieldset> 55 | </fields> 56 | </metadata> 57 | -------------------------------------------------------------------------------- /src/site/views/xml/tmpl/default_images.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 7 | * @copyright 2016-2025 Joomlashack.com. All rights reserved. 8 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 9 | * 10 | * This file is part of OSMap. 11 | * 12 | * OSMap is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * OSMap is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 24 | */ 25 | 26 | use Alledia\OSMap\Sitemap\Item; 27 | use Joomla\CMS\Language\Language; 28 | use Joomla\Utilities\ArrayHelper; 29 | 30 | defined('_JEXEC') or die(); 31 | 32 | /** 33 | * @var OSMapViewXml $this 34 | * @var string $template 35 | * @var string $layout 36 | * @var string $layoutTemplate 37 | * @var Language $lang 38 | * @var string $filetofind 39 | */ 40 | 41 | $ignoreDuplicates = (int)$this->osmapParams->get('ignore_duplicated_uids', 1); 42 | 43 | $printNodeCallback = function (Item $node) use ($ignoreDuplicates) { 44 | $display = !$node->ignore 45 | && $node->published 46 | && (!$node->duplicate || !$ignoreDuplicates) 47 | && $node->visibleForRobots 48 | && $node->parentIsVisibleForRobots 49 | && $node->visibleForXML 50 | && $node->isInternal 51 | && trim($node->fullLink) != '' 52 | && $node->hasCompatibleLanguage(); 53 | 54 | if ($display && !empty($node->images)) { 55 | echo '<url>'; 56 | echo sprintf('<loc><![CDATA[%s]]></loc>', $node->fullLink); 57 | 58 | foreach ($node->images as $image) { 59 | if (!empty($image->src)) { 60 | echo '<image:image>'; 61 | echo '<image:loc><![CDATA[' . $image->src . ']]></image:loc>'; 62 | echo empty($image->title) 63 | ? '<image:title/>' 64 | : '<image:title><![CDATA[' . $image->title . ']]></image:title>'; 65 | 66 | if (!empty($image->license)) { 67 | echo '<image:license><![CDATA[' . $image->license . ']]></image:license>'; 68 | } 69 | 70 | echo '</image:image>'; 71 | } 72 | } 73 | 74 | echo '</url>'; 75 | } 76 | 77 | /* 78 | * Return true if there were no images 79 | * so any child nodes will get checked 80 | */ 81 | return $display || empty($node->images); 82 | }; 83 | 84 | echo $this->addStylesheet(); 85 | 86 | $attributes = [ 87 | 'xmlns' => 'http://www.sitemaps.org/schemas/sitemap/0.9', 88 | 'xmlns:image' => 'http://www.google.com/schemas/sitemap-image/1.1' 89 | ]; 90 | echo sprintf('<urlset %s>', ArrayHelper::toString($attributes)); 91 | 92 | $this->sitemap->traverse($printNodeCallback); 93 | 94 | echo '</urlset>'; 95 | -------------------------------------------------------------------------------- /src/site/views/xml/tmpl/default_news.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 7 | * @copyright 2016-2025 Joomlashack.com. All rights reserved. 8 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 9 | * 10 | * This file is part of OSMap. 11 | * 12 | * OSMap is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * OSMap is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 24 | */ 25 | 26 | use Alledia\OSMap\Sitemap\Item; 27 | use Joomla\CMS\Language\Language; 28 | use Joomla\Utilities\ArrayHelper; 29 | 30 | defined('_JEXEC') or die(); 31 | 32 | /** 33 | * @var OSMapViewXml $this 34 | * @var string $template 35 | * @var string $layout 36 | * @var string $layoutTemplate 37 | * @var Language $lang 38 | * @var string $filetofind 39 | */ 40 | 41 | $debug = $this->params->get('debug', 0) ? "\n" : ''; 42 | 43 | $printNodeCallback = function (Item $node) { 44 | $display = !$node->ignore 45 | && $node->published 46 | && (!$node->duplicate || !$this->osmapParams->get('ignore_duplicated_uids', 1)) 47 | && isset($node->newsItem) 48 | && !empty($node->newsItem) 49 | && $node->visibleForRobots 50 | && $node->parentIsVisibleForRobots 51 | && $node->visibleForXML 52 | && $node->isInternal 53 | && trim($node->fullLink) != '' 54 | && $node->hasCompatibleLanguage(); 55 | 56 | /** @var DateTime $publicationDate */ 57 | $publicationDate = $this->isNewsPublication($node); 58 | if ($display && $publicationDate) { 59 | echo '<url>'; 60 | echo sprintf('<loc><![CDATA[%s]]></loc>', $node->fullLink); 61 | echo '<news:news>'; 62 | 63 | echo '<news:publication>'; 64 | echo ($publicationName = $this->params->get('news_publication_name', '')) 65 | ? '<news:name><![CDATA[' . $publicationName . ']]></news:name>' 66 | : '<news:name/>'; 67 | 68 | if (empty($node->language) || $node->language == '*') { 69 | $node->language = $this->language; 70 | } 71 | echo '<news:language>' . $node->language . '</news:language>'; 72 | echo '</news:publication>'; 73 | 74 | echo '<news:publication_date>' . $publicationDate->format('Y-m-d\TH:i:s\Z') . '</news:publication_date>'; 75 | echo '<news:title><![CDATA[' . $node->name . ']]></news:title>'; 76 | 77 | if (!empty($node->keywords)) { 78 | echo '<news:keywords><![CDATA[' . $node->keywords . ']]></news:keywords>'; 79 | } 80 | 81 | echo '</news:news>'; 82 | echo '</url>'; 83 | } 84 | 85 | return $display; 86 | }; 87 | 88 | echo $this->addStylesheet(); 89 | 90 | $attribs = [ 91 | 'xmlns' => 'http://www.sitemaps.org/schemas/sitemap/0.9', 92 | 'xmlns:news' => 'http://www.google.com/schemas/sitemap-news/0.9' 93 | ]; 94 | 95 | echo sprintf($debug . '<urlset %s>' . $debug, ArrayHelper::toString($attribs)); 96 | 97 | $this->sitemap->traverse($printNodeCallback); 98 | 99 | echo '</urlset>'; 100 | -------------------------------------------------------------------------------- /src/site/views/xml/tmpl/default_standard.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 7 | * @copyright 2016-2025 Joomlashack.com. All rights reserved. 8 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 9 | * 10 | * This file is part of OSMap. 11 | * 12 | * OSMap is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * OSMap is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 24 | */ 25 | 26 | use Alledia\OSMap\Helper\General; 27 | use Alledia\OSMap\Sitemap\Item; 28 | use Joomla\CMS\Language\Language; 29 | 30 | defined('_JEXEC') or die(); 31 | 32 | /** 33 | * @var OSMapViewXml $this 34 | * @var string $template 35 | * @var string $layout 36 | * @var string $layoutTemplate 37 | * @var Language $lang 38 | * @var string $filetofind 39 | */ 40 | 41 | $showExternalLinks = (int)$this->osmapParams->get('show_external_links', 0); 42 | $ignoreDuplicates = (int)$this->osmapParams->get('ignore_duplicated_uids', 1); 43 | $debug = $this->params->get('debug', 0) ? "\n" : ''; 44 | 45 | $printNodeCallback = function (Item $node) use ($showExternalLinks, $ignoreDuplicates, $debug) { 46 | $display = !$node->ignore 47 | && $node->published 48 | && (!$node->duplicate || !$ignoreDuplicates) 49 | && $node->visibleForRobots 50 | && $node->parentIsVisibleForRobots 51 | && $node->visibleForXML 52 | && trim($node->fullLink) != ''; 53 | 54 | if ($display && !$node->isInternal) { 55 | // Show external links 56 | $display = $showExternalLinks === 1; 57 | } 58 | 59 | if (!$node->hasCompatibleLanguage()) { 60 | $display = false; 61 | } 62 | 63 | if (!$display) { 64 | return false; 65 | } 66 | 67 | echo $debug; 68 | 69 | echo '<url>'; 70 | echo '<loc><![CDATA[' . $node->fullLink . ']]></loc>'; 71 | 72 | if (!General::isEmptyDate($node->modified)) { 73 | echo '<lastmod>' . $node->modified . '</lastmod>'; 74 | } 75 | 76 | echo '<changefreq>' . $node->changefreq . '</changefreq>'; 77 | echo '<priority>' . $node->priority . '</priority>'; 78 | echo '</url>'; 79 | 80 | echo $debug; 81 | 82 | return true; 83 | }; 84 | 85 | echo $this->addStylesheet(); 86 | 87 | echo $debug . '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . $debug; 88 | 89 | $this->sitemap->traverse($printNodeCallback); 90 | 91 | echo '</urlset>'; 92 | -------------------------------------------------------------------------------- /src/site/views/xml/view.html.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 7 | * @copyright 2016-2025 Joomlashack.com. All rights reserved. 8 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 9 | * 10 | * This file is part of OSMap. 11 | * 12 | * OSMap is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * OSMap is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 24 | */ 25 | 26 | defined('_JEXEC') or die(); 27 | 28 | /* 29 | * Having a view.html.php file allows adding a .xml suffix to 30 | * the url, if the sitemap is attached to a menu entry 31 | */ 32 | require_once __DIR__ . '/view.xml.php'; 33 | -------------------------------------------------------------------------------- /src/site/views/xsl/tmpl/news.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * @package OSMap 5 | * @contact www.joomlashack.com, help@joomlashack.com 6 | * @copyright 2007-2014 XMap - Joomla! Vargas - Guillermo Vargas. All rights reserved. 7 | * @copyright 2016-2025 Joomlashack.com. All rights reserved. 8 | * @license https://www.gnu.org/licenses/gpl.html GNU/GPL 9 | * 10 | * This file is part of OSMap. 11 | * 12 | * OSMap is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * OSMap is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with OSMap. If not, see <https://www.gnu.org/licenses/>. 24 | */ 25 | 26 | use Joomla\CMS\Language\Language; 27 | use Joomla\CMS\Language\Text; 28 | 29 | defined('_JEXEC') or die(); 30 | 31 | /** 32 | * @var OSMapViewXsl $this 33 | * @var string $template 34 | * @var string $layout 35 | * @var string $layoutTemplate 36 | * @var Language $lang 37 | * @var string $filetofind 38 | */ 39 | 40 | ?> 41 | <xsl:stylesheet 42 | version="1.0" 43 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 44 | xmlns:xna="http://www.sitemaps.org/schemas/sitemap/0.9" 45 | xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" 46 | exclude-result-prefixes="xna"> 47 | 48 | <xsl:output indent="yes" method="html" omit-xml-declaration="yes"/> 49 | <xsl:template match="/"> 50 | <html lang="<?php echo $this->language; ?>"> 51 | <head> 52 | <title><?php echo $this->pageTitle; ?> 53 | 111 | 112 | 113 |
114 |
115 | pageHeading) : ?> 116 |

pageHeading); ?>

117 | 118 |
119 | : 120 | 121 |
122 |
123 |
124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 145 | 148 | 151 | 152 | 153 | 154 |
140 | 141 | 142 | 143 | 144 | 146 | 147 | 149 | 150 |
155 | 156 | 157 | 158 | 159 | -------------------------------------------------------------------------------- /src/site/views/xsl/view.xsl.php: -------------------------------------------------------------------------------- 1 | . 24 | */ 25 | 26 | use Alledia\OSMap\Factory; 27 | use Alledia\OSMap\Helper\General; 28 | use Joomla\CMS\Application\SiteApplication; 29 | use Joomla\CMS\Language\Text; 30 | use Joomla\CMS\MVC\View\HtmlView; 31 | 32 | // phpcs:disable PSR1.Files.SideEffects 33 | defined('_JEXEC') or die(); 34 | // phpcs:enable PSR1.Files.SideEffects 35 | // phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace 36 | 37 | class OsmapViewXsl extends HtmlView 38 | { 39 | /** 40 | * @var SiteApplication 41 | */ 42 | protected $app = null; 43 | 44 | /** 45 | * @var string 46 | */ 47 | protected $pageHeading = null; 48 | 49 | /** 50 | * @var string 51 | */ 52 | protected $pageTitle = null; 53 | 54 | /** 55 | * @var string 56 | */ 57 | protected $language = null; 58 | 59 | /** 60 | * @inheritDoc 61 | * @throws Exception 62 | */ 63 | public function __construct($config = []) 64 | { 65 | parent::__construct($config); 66 | 67 | $this->app = Factory::getApplication(); 68 | } 69 | 70 | /** 71 | * @inheritDoc 72 | */ 73 | public function display($tpl = null) 74 | { 75 | $document = $this->app->getDocument(); 76 | 77 | $this->language = $document->getLanguage(); 78 | 79 | $menu = $this->app->getMenu()->getActive(); 80 | $isOsmap = $menu && $menu->query['option'] == 'com_osmap'; 81 | $params = $this->app->getParams(); 82 | $type = General::getSitemapTypeFromInput(); 83 | $sitemap = Factory::getSitemap($this->app->input->getInt('id'), $type); 84 | 85 | $title = $params->get('page_title', ''); 86 | if ($isOsmap == false) { 87 | $title = $sitemap->name ?: $title; 88 | } 89 | 90 | if (empty($title)) { 91 | $title = $this->app->get('sitename'); 92 | 93 | } elseif ($this->app->get('sitename_pagetitles', 0) == 1) { 94 | $title = Text::sprintf('JPAGETITLE', $this->app->get('sitename'), $title); 95 | 96 | } elseif ($this->app->get('sitename_pagetitles', 0) == 2) { 97 | $title = Text::sprintf('JPAGETITLE', $title, $this->app->get('sitename')); 98 | } 99 | $this->pageTitle = $this->escape($title); 100 | if ($isOsmap && $params->get('show_page_heading')) { 101 | $this->pageHeading = $this->escape($params->get('page_heading') ?: $sitemap->name); 102 | } 103 | 104 | // We're going to cheat Joomla here because some referenced urls MUST remain http/insecure 105 | header(sprintf('Content-Type: text/xsl; charset="%s"', $this->_charset)); 106 | header('Content-Disposition: inline'); 107 | 108 | parent::display($tpl); 109 | 110 | jexit(); 111 | } 112 | } 113 | --------------------------------------------------------------------------------