first commit
This commit is contained in:
121
plugins/schemaorg/organization/forms/schemaorg.xml
Executable file
121
plugins/schemaorg/organization/forms/schemaorg.xml
Executable file
@ -0,0 +1,121 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form>
|
||||
<fields name="schema">
|
||||
<fieldset
|
||||
name="schema"
|
||||
label="PLG_SYSTEM_SCHEMA_FIELD_SCHEMA_LABEL"
|
||||
>
|
||||
<field
|
||||
name="Organization"
|
||||
type="subform"
|
||||
showon="schemaType:Organization"
|
||||
>
|
||||
<form>
|
||||
|
||||
<field
|
||||
name="@type"
|
||||
type="hidden"
|
||||
default="Organization"
|
||||
/>
|
||||
|
||||
<field
|
||||
name="noteBook"
|
||||
type="note"
|
||||
description="PLG_SCHEMAORG_ORGANIZATION_DESCRIPTION_LABEL"
|
||||
class="alert alert-info w-100"
|
||||
/>
|
||||
|
||||
<field
|
||||
name="name"
|
||||
type="text"
|
||||
filter="string"
|
||||
label="PLG_SCHEMAORG_ORGANIZATION_FIELD_NAME_LABEL"
|
||||
/>
|
||||
|
||||
<field
|
||||
name="image"
|
||||
type="media"
|
||||
label="PLG_SCHEMAORG_ORGANIZATION_FIELD_LOGO_LABEL"
|
||||
/>
|
||||
|
||||
<field
|
||||
name="url"
|
||||
type="url"
|
||||
label="PLG_SCHEMAORG_ORGANIZATION_FIELD_URL_LABEL"
|
||||
filter="url"
|
||||
validate="url"
|
||||
/>
|
||||
|
||||
<field
|
||||
name="email"
|
||||
type="email"
|
||||
label="PLG_SCHEMAORG_ORGANIZATION_FIELD_EMAIL_LABEL"
|
||||
validate="email"
|
||||
/>
|
||||
|
||||
<field
|
||||
name="address"
|
||||
type="subform"
|
||||
label="PLG_SCHEMAORG_ORGANIZATION_FIELD_ADDRESS_LABEL"
|
||||
>
|
||||
<form>
|
||||
|
||||
<field
|
||||
name="@type"
|
||||
type="hidden"
|
||||
default="PostalAddress"
|
||||
/>
|
||||
|
||||
<field
|
||||
name="addressLocality"
|
||||
type="text"
|
||||
label="PLG_SCHEMAORG_ORGANIZATION_FIELD_LOCALITY_LABEL"
|
||||
/>
|
||||
|
||||
<field
|
||||
name="postalCode"
|
||||
type="text"
|
||||
label="PLG_SCHEMAORG_ORGANIZATION_FIELD_POSTAL_CODE_LABEL"
|
||||
/>
|
||||
|
||||
<field
|
||||
name="streetAddress"
|
||||
type="text"
|
||||
label="PLG_SCHEMAORG_ORGANIZATION_FIELD_STREET_ADDRESS_LABEL"
|
||||
/>
|
||||
|
||||
</form>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="genericField"
|
||||
type="subform"
|
||||
label="PLG_SCHEMAORG_ORGANIZATION_FIELD_GENERIC_FIELD_LABEL"
|
||||
multiple="true"
|
||||
>
|
||||
<form>
|
||||
<field
|
||||
name="genericTitle"
|
||||
type="text"
|
||||
label="PLG_SCHEMAORG_ORGANIZATION_FIELD_GENERIC_TITLE_LABEL"
|
||||
filter="string"
|
||||
size="30"
|
||||
|
||||
/>
|
||||
<field
|
||||
name="genericValue"
|
||||
type="text"
|
||||
label="PLG_SCHEMAORG_ORGANIZATION_FIELD_GENERIC_VALUE_LABEL"
|
||||
filter="string"
|
||||
size="30"
|
||||
/>
|
||||
|
||||
</form>
|
||||
|
||||
</field>
|
||||
|
||||
</form>
|
||||
</field>
|
||||
</fieldset>
|
||||
</fields>
|
||||
</form>
|
||||
43
plugins/schemaorg/organization/organization.xml
Executable file
43
plugins/schemaorg/organization/organization.xml
Executable file
@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="schemaorg" method="upgrade">
|
||||
<name>plg_schemaorg_organization</name>
|
||||
<author>Joomla! Project</author>
|
||||
<creationDate>2023-07</creationDate>
|
||||
<copyright>(C) 2023 Open Source Matters, Inc.</copyright>
|
||||
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
|
||||
<authorEmail>admin@joomla.org</authorEmail>
|
||||
<authorUrl>www.joomla.org</authorUrl>
|
||||
<version>5.0.0</version>
|
||||
<description>PLG_SCHEMAORG_ORGANIZATION_XML_DESCRIPTION</description>
|
||||
<namespace path="src">Joomla\Plugin\Schemaorg\Organization</namespace>
|
||||
<files>
|
||||
<folder plugin="organization">services</folder>
|
||||
<folder>src</folder>
|
||||
</files>
|
||||
<languages>
|
||||
<language tag="en-GB">language/en-GB/plg_schemaorg_organization.ini</language>
|
||||
<language tag="en-GB">language/en-GB/plg_schemaorg_organization.sys.ini</language>
|
||||
</languages>
|
||||
<config>
|
||||
<fields name="params">
|
||||
<fieldset name="basic">
|
||||
<field
|
||||
name="allowedlist"
|
||||
type="SchemaorgComponentSections"
|
||||
label="JSCHEMAORG_EXTENSION_ALLOWED_LABEL"
|
||||
description="JSCHEMAORG_EXTENSION_ALLOWED_DESCRIPTION"
|
||||
multiple="multiple"
|
||||
layout="joomla.form.field.list-fancy-select"
|
||||
/>
|
||||
<field
|
||||
name="forbiddenlist"
|
||||
type="SchemaorgComponentSections"
|
||||
label="JSCHEMAORG_EXTENSION_FORBIDDEN_LABEL"
|
||||
description="JSCHEMAORG_EXTENSION_FORBIDDEN_DESCRIPTION"
|
||||
multiple="multiple"
|
||||
layout="joomla.form.field.list-fancy-select"
|
||||
/>
|
||||
</fieldset>
|
||||
</fields>
|
||||
</config>
|
||||
</extension>
|
||||
47
plugins/schemaorg/organization/services/provider.php
Normal file
47
plugins/schemaorg/organization/services/provider.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Plugin
|
||||
* @subpackage Schemaorg.organization
|
||||
*
|
||||
* @copyright (C) 2023 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
\defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Extension\PluginInterface;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Plugin\PluginHelper;
|
||||
use Joomla\DI\Container;
|
||||
use Joomla\DI\ServiceProviderInterface;
|
||||
use Joomla\Event\DispatcherInterface;
|
||||
use Joomla\Plugin\Schemaorg\Organization\Extension\Organization;
|
||||
|
||||
return new class () implements ServiceProviderInterface {
|
||||
/**
|
||||
* Registers the service provider with a DI container.
|
||||
*
|
||||
* @param Container $container The DI container.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 5.0.0
|
||||
*/
|
||||
public function register(Container $container)
|
||||
{
|
||||
$container->set(
|
||||
PluginInterface::class,
|
||||
function (Container $container) {
|
||||
$dispatcher = $container->get(DispatcherInterface::class);
|
||||
$plugin = new Organization(
|
||||
$dispatcher,
|
||||
(array) PluginHelper::getPlugin('schemaorg', 'organization')
|
||||
);
|
||||
$plugin->setApplication(Factory::getApplication());
|
||||
|
||||
return $plugin;
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
||||
45
plugins/schemaorg/organization/src/Extension/Organization.php
Executable file
45
plugins/schemaorg/organization/src/Extension/Organization.php
Executable file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Plugin
|
||||
* @subpackage Schemaorg.organization
|
||||
*
|
||||
* @copyright (C) 2023 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace Joomla\Plugin\Schemaorg\Organization\Extension;
|
||||
|
||||
use Joomla\CMS\Plugin\CMSPlugin;
|
||||
use Joomla\CMS\Schemaorg\SchemaorgPluginTrait;
|
||||
use Joomla\Event\SubscriberInterface;
|
||||
|
||||
// phpcs:disable PSR1.Files.SideEffects
|
||||
\defined('_JEXEC') or die;
|
||||
// phpcs:enable PSR1.Files.SideEffects
|
||||
|
||||
/**
|
||||
* Schemaorg Plugin
|
||||
*
|
||||
* @since 5.0.0
|
||||
*/
|
||||
final class Organization extends CMSPlugin implements SubscriberInterface
|
||||
{
|
||||
use SchemaorgPluginTrait;
|
||||
|
||||
/**
|
||||
* Load the language file on instantiation.
|
||||
*
|
||||
* @var boolean
|
||||
* @since 5.0.0
|
||||
*/
|
||||
protected $autoloadLanguage = true;
|
||||
|
||||
/**
|
||||
* The name of the schema form
|
||||
*
|
||||
* @var string
|
||||
* @since 5.0.0
|
||||
*/
|
||||
protected $pluginName = 'Organization';
|
||||
}
|
||||
Reference in New Issue
Block a user