Hi All,
As I posted before, I want to share with All, how to use HelpLink, on custom fields.
First, you must create a new text typed field, named:
helperstring in mantis_custom_field_table.
And you must change the following php with theese option:
custom_field_api.php
NEW FUNCTION:
function custom_field_helpstring_read( $p_field_id ) {
$c_field_id = db_prepare_int( $p_field_id );
$t_custom_field_table = config_get( &
#039;mantis_custom_field_table&
#039; );
$query = "SELECT helperstring
FROM $t_custom_field_table
WHERE id=&
#039;$c_field_id&
#039;";
$result = db_query( $query );
$row = db_result( $result );
if ( $row != null && $row > " ") {
plugins_helplink_print_link ( "<h3>".lang_get( &
#039;custom_field_help_display&
#039; )."</h3><br>".$row, 350, 250) ;
}
}
bug_report_page.php
After this string: <?php echo string_display( lang_get_defaulted( $t_def[&
#039;name&
#039;] ) ) ?>
Insert this:
<?php custom_field_helpstring_read ($t_id); ?>
mantis_custom_field_update.php
Define a new value!
$t_values[&
#039;helperstring&
#039;] = gpc_get_string( &
#039;helperstring&
#039; );
mantis_custom_field_edit_page.php
<tr <?php echo helper_alternate_class() ?>>
<td class="category">
<?php echo lang_get( &
#039;custom_field_helperstring&
#039; ) ?>
</td>
<td>
<textarea name="helperstring" cols="80" rows="10"><?php echo $t_definition[&
#039;helperstring&
#039;] ?></textarea>
</td>
</tr>
And last, you must define in your language file the new help string values:
strings_[language].txt
$s_custom_field_helperstring = &
#039;Help text&
#039;;
$s_custom_field_help_display = &
#039;What does it mean?&
#039;;
WELL, DONE!
Edited 1 time(s). Last edit at 06/12/2009 01:01PM by abdaizs.