So my intention was to modify the User Block Plugin. I followed all the instructions in http://pkp.sfu.ca/wiki/index.php/Writing_a_Block_Plugin.
- Created a copy of the 'user' directory named 'userMod'
- Renamed 'UserBlockPlugin.inc.php' to 'UserModBlockPlugin.inc.php'
- Changed the comments at the top of the file to this:
- Code: Select all
/**
* @file UserModBlockPlugin.inc.php
*
* Copyright (c) 2003-2012 John Willinsky
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* @class UserModBlockPlugin
* @ingroup plugins_blocks_user_mod
*
* @brief Class for user block plugin modified
*/
- Changed class name to UserModBlockPlugin
- Changed the return value of getDisplayName to 'plugins.block.usermod.displayName'
- Changed the return value of getDescription to 'plugins.block.usermod.description'
- In index.php changed the code to this:
- Code: Select all
<?php
/**
* @defgroup plugins_blocks_user_mod
*/
/**
* @file plugins/blocks/userMod/index.php
*
* Copyright (c) 2003-2012 John Willinsky
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* @ingroup plugins_blocks_user_mod
* @brief Wrapper for userMod block plugin.
*
*/
// $Id$
require_once('UserModBlockPlugin.inc.php');
return new UserModBlockPlugin();
?>
- Changed the locale keys to plugins.block.usermod.x
- In block.tpl changed the translation keys to plugins.block.usermod.x
- versionxml is al follows:
- Code: Select all
<version>
<application>userMod</application>
<type>plugins.blocks</type>
<release>1.0.0.0</release>
<date>2012-06-29</date>
<lazy-load>1</lazy-load>
<class>UserModBlockPlugin</class>
</version>
Then I did the upgrade, and set the plugin to appear on the left sidebar. This is what can be found in the database:
In plugin_settings table:
- Code: Select all
usermodblockplugin 0 enabled 1 bool
usermodblockplugin 0 seq 2 int
usermodblockplugin 0 context 2 int
usermodblockplugin 1 enabled 1 bool
usermodblockplugin 1 context 1 int
usermodblockplugin 1 seq 1 int
In versions table:
- Code: Select all
1 0 0 0 2012-06-30 13:53:18 1 plugins.blocks usermod UserModBlockPlugin 1 0
I don't think I have missed anything. All settings are equal to those of the original user plugin. I checked for file permissions, but those are also the same. ¿Anyone knows how to solve this?
Thanks in advance!
