0
joomlaで最終的なプラグインを読み込むカスタムプラグインを設定するのは難しいですか?インストール時にカスタム注文でカスタムプラグインjoomlaを作成する
インストール時にオーダーを設定したいです。
xmlに設定するカスタムパラメータはorder="xxx"
ですか?
joomlaで最終的なプラグインを読み込むカスタムプラグインを設定するのは難しいですか?インストール時にカスタム注文でカスタムプラグインjoomlaを作成する
インストール時にオーダーを設定したいです。
xmlに設定するカスタムパラメータはorder="xxx"
ですか?
私は、xmlファイル
<scriptfile>script.php</scriptfile>
に追加することで、スクリプトファイル内で答えを見つけ
<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
/**
* Script file of yourplugin component.
*/
class plgSystemyourplginInstallerScript
{
/**
* method to run after an install/update/uninstall method.
*/
public function postflight($type, $parent)
{
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$fields = array(
$db->quoteName('ordering').' = '.(int) 999,
);
$conditions = array(
$db->quoteName('element').' = '.$db->quote('wraprotect'),
$db->quoteName('type').' = '.$db->quote('plugin'),
);
$query->update($db->quoteName('#__extensions'))->set($fields)->where($conditions);
$db->setQuery($query);
$db->execute();
// $parent is the class calling this method
// $type is the type of change (install, update or discover_install)
}
}
プラグイン名を編集することを忘れないでください とjoomlaの1.5編集中#__extensions
〜#__plugins
行を削除してください$db->quoteName('type').' = '.$db->quote('plugin')