Skip to content

Commit

Permalink
Merge pull request #107 from rainlab/next
Browse files Browse the repository at this point in the history
[2.x] Compatibility with October CMS v3.6
  • Loading branch information
daftspunk authored May 1, 2024
2 parents 7e12593 + 67e1c3d commit af22beb
Show file tree
Hide file tree
Showing 108 changed files with 2,716 additions and 2,968 deletions.
19 changes: 0 additions & 19 deletions LICENCE.md

This file was deleted.

5 changes: 5 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# License

This plugin is an official extension of the October CMS platform and is free to use if you have a platform license.

See End User License Agreement at https://octobercms.com/eula for more details.
79 changes: 47 additions & 32 deletions Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,84 +2,99 @@

use Backend;
use System\Classes\PluginBase;
use System\Classes\SettingsManager;

/**
* Location Plugin Information File
* Plugin Information File
*/
class Plugin extends PluginBase
{
/**
* Returns information about this plugin.
*
* @return array
* pluginDetails returns information about this plugin.
*/
public function pluginDetails()
{
return [
'name' => 'rainlab.location::lang.plugin.name',
'description' => 'rainlab.location::lang.plugin.description',
'author' => 'Alexey Bobkov, Samuel Georges',
'icon' => 'icon-globe',
'homepage' => 'https://github.com/rainlab/location-plugin'
'name' => "Location",
'description' => "Location based features, such as Country and State.",
'author' => 'Alexey Bobkov, Samuel Georges',
'icon' => 'icon-globe',
'homepage' => 'https://github.com/rainlab/location-plugin'
];
}

/**
* registerSettings
*/
public function registerSettings()
{
return [
'location' => [
'label' => 'rainlab.location::lang.locations.menu_label',
'description' => 'rainlab.location::lang.locations.menu_description',
'category' => 'rainlab.location::lang.plugin.name',
'icon' => 'icon-globe',
'url' => Backend::url('rainlab/location/locations'),
'order' => 500,
'label' => "Countries & States",
'description' => "Manage available user countries and states.",
'category' => SettingsManager::CATEGORY_USERS,
'icon' => 'icon-globe',
'url' => Backend::url('rainlab/location/locations'),
'order' => 700,
'permissions' => ['rainlab.location.access_settings'],
'keywords' => 'country, countries, state',
'keywords' => 'country, countries, state',
],
'settings' => [
'label' => 'rainlab.location::lang.settings.menu_label',
'description' => 'rainlab.location::lang.settings.menu_description',
'category' => 'rainlab.location::lang.plugin.name',
'icon' => 'icon-map-signs',
'class' => 'RainLab\Location\Models\Setting',
'order' => 600,
'label' => "Location Settings",
'description' => "Manage location based settings.",
'category' => SettingsManager::CATEGORY_USERS,
'icon' => 'icon-map-signs',
'class' => \RainLab\Location\Models\Setting::class,
'order' => 800,
'permissions' => ['rainlab.location.access_settings'],
]
];
}

/**
* registerPermissions
*/
public function registerPermissions()
{
return [
'rainlab.location.access_settings' => ['tab' => 'rainlab.location::lang.plugin.name', 'label' => 'rainlab.location::lang.permissions.settings'],
'rainlab.location.access_settings' => [
'tab' => "Location",
'label' => "Locations management"
],
];
}

/**
* Register new Twig variables
* @return array
* registerMarkupTags registers new Twig variables
*/
public function registerMarkupTags()
{
return [
'functions' => [
'form_select_country' => ['RainLab\Location\Models\Country', 'formSelect'],
'form_select_state' => ['RainLab\Location\Models\State', 'formSelect']
'form_select_country' => [\RainLab\Location\Models\Country::class, 'formSelect'],
'form_select_state' => [\RainLab\Location\Models\State::class, 'formSelect']
]
];
}


/**
* registerComponents
*/
public function registerComponents()
{
return [
\RainLab\Location\Components\Location::class => 'location',
];
}

/**
* Registers any form widgets implemented in this plugin.
* registerFormWidgets registers any form widgets implemented in this plugin.
*/
public function registerFormWidgets()
{
return [
'RainLab\Location\FormWidgets\AddressFinder' => [
'label' => 'Address Finder',
'code' => 'addressfinder'
]
\RainLab\Location\FormWidgets\AddressFinder::class => 'addressfinder'
];
}
}
Loading

0 comments on commit af22beb

Please sign in to comment.