Проверено для Joomla 3.2.2. Модуль написан в целях изучения Joomla! 3.x.
Возможности подключаемого модуля MyMeta Generator:
<meta name="generator" content="Joomla! - Open Source Content Management" />
Разработка модуля MyMeta Generator:
<?xml version="1.0" encoding="utf-8"?> <extension version="3.1" type="plugin" group="system"> <name>Plugin MyMeta Generator</name> <author>Darkfire</author> <creationDate>February 2014</creationDate> <copyright>Copyright (C) 2014</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>Yakovenko.Dmitriy@gmail.com</authorEmail> <authorUrl>dieg.info</authorUrl> <version>1.0.0</version> <description>This is plugin to change and remove meta 'generator'.</description> <files> <filename plugin="mymeta">mymeta.php</filename> <filename>index.html</filename> </files> <config> <fields name="params"> <fieldset name="basic"> <field name="revised" type="text" description="Meta revised text" label="Meta revised content" default="This is my meta." size="50" /> <field name="mygen" type="text" description="Meta generator text" label="Meta generator content" default="" size="50" /> </fieldset> </fields> </config> </extension>
<?php /** * @package Joomla.Plugin * @subpackage System.mymeta * * @copyright Copyright (C) 2014 All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; /** * Joomla! MyMeta Header Plugin. * * @package Joomla.Plugin * @subpackage System.mymeta * @since 3.2 */ class PlgSystemMyMeta extends JPlugin { public function onBeforeCompileHead() { // Get the header. $header = $this->params->get('revised'); $header = trim($header); $mygen = $this->params->get('mygen'); $mygen = trim($mygen); $document = JFactory::getDocument(); if (!empty($header)) { $HeadData = $document->getHeadData(); $HeadData['metaTags']['standard']['revised'] = $this->params->get('revised'); $document->setHeadData($HeadData); } if (empty($mygen)) { $document->setGenerator(''); } else { $document->setGenerator($mygen); } } }