Je suis en train de créer un nouveau plugiciel sur Mantis mais l'erreur suivante apparait : "APPLICATION ERROR #2500
Le plugiciel n'est pas enrégisté avec MantisBT." Je bloque completement, si vous pourriez m'aider svp
Voici mon code :
-Example.php
Code: Select all
<?php
class ExamplePlugin extends MantisPlugin {
function register() {
$this->name = 'Example'; # Proper name of plugin
$this->description = 'Il sagit dun test'; # Short description of the plugin
$this->page = ''; # Default plugin page
$this->version = '1.0'; # Plugin version string
$this->requires = array( # Plugin dependencies, array of basename => version pairs
'MantisCore' => '1.2.0, <= 1.2.0', # Should always depend on an appropriate version of MantisBT
);
$this->author = 'Cécile Favre'; # Author/team name
$this->contact = ''; # Author/team e-mail address
$this->url = ''; # Support webpage
}
function config() {
return array(
'foo_or_bar' => 'foo',
);
}
function events() {
return array(
'EVENT_EXAMPLE_FOO' => EVENT_TYPE_EXECUTE,
'EVENT_EXAMPLE_BAR' => EVENT_TYPE_CHAIN,
);
}
function hooks() {
return array(
'EVENT_EXAMPLE_FOO' => 'foo',
'EVENT_EXAMPLE_BAR' => 'bar',
);
}
function foo( $p_event ) {
return array( '<a href="' . plugin_page( 'foo' ) . '">' . plugin_lang_get( 'foo' ) . '</a>', );
}
function bar( $p_event, $p_chained_param ) {
return $p_chained_param;
}
}
Code: Select all
<?php
echo '<p>Here is a link to <a href="', plugin_page( 'foo' ), '">page foo</a>.</p>';
echo '<link rel="stylesheet" type="text/css" href="', plugin_file( 'foo.css' ), '"/>',
'<p class="foo">This is red text.</p>';
event_signal( 'EVENT_EXAMPLE_FOO' );
$t_string = 'A sentence with the word "foo" in it.';
$t_new_string = event_signal( 'EVENT_EXAMPLE_BAR', array( $t_string ) );
echo $t_new_string, '</p>';
Merci d'avance pour votre aide