.......
// Audio Title
$_tmp = array(
'name' => 'audio_title',
'label' => 10,
'help' => 11,
'type' => 'text',
'validate' => 'printable',
'required' => true
);
jrCore_form_field_create($_tmp);
// Audio Genre
$_tmp = array(
'name' => 'audio_genre',
'label' => 12,
'help' => 13,
'type' => 'select_and_text',
'validate' => 'printable',
'required' => true
);
jrCore_form_field_create($_tmp);
// Audio Album
$_tmp = array(
'name' => 'audio_album',
'label' => 31,
'help' => 32,
'type' => 'select_and_text',
'validate' => 'printable',
'required' => false
);
jrCore_form_field_create($_tmp);
.........
'help' => 13
'help' => "If you have already entered genres in other audio files, you may select any previous genre, or enter a new genre in text field"
$lang[11] = 'Enter a title for the audio file - this will be shown your profile.';
$lang[12] = 'genre';
$lang[13] = 'If you have already entered genres in other audio files, you may select any previous genre, or enter a new genre in text field';
$lang[14] = 'audio file';
$lang[15] = 'select and upload the audio file.';
$lang[16] = 'cover image';
$lang[17] = 'if you would like to associate an image file with this audio file, upload it here. If you do not select a cover image and there is an embedded image in the MP3 file(s), it will be used.';
$lang[18] = 'An error was encountered creating the audio file - please try again.';
<?php
/**
* @copyright
*/
// make sure we are not being called directly
defined('APP_DIR') or exit();
/**
* meta
*/
function xxFoo_meta()
{
$_tmp = array(
'name' => 'Foo',
'url' => 'foo',
'version' => '1.0.0',
'developer' => 'Some guy, ©' . strftime('%Y'),
'description' => 'Used to add a form field to the profile settings module',
'category' => 'custom',
'license' => 'mpl'
);
return $_tmp;
}
/**
* init
*/
function xxFoo_init()
{
// extra profile settings option
jrCore_register_event_listener('jrCore', 'form_display', 'xxFoo_form_display_listener');
return true;
}
//----------------------
// EVENT LISTENERS
//----------------------
/**
* Save an extra field on the Profile Settings form
* @param $_data array Array of information from trigger
* @param $_user array Current user
* @param $_conf array Global Config
* @param $_args array additional parameters passed in by trigger caller
* @param $event string Triggered Event name
* @return array
*/
function xxFoo_form_display_listener($_data, $_user, $_conf, $_args, $event)
{
if (isset($_data['form_view']) && $_data['form_view'] == 'jrProfile/settings') {
// Profile Color
$_tmp = array(
'name' => 'profile_color',
'label' => "Profile Color",
'help' => "Add a hex code color to change the background of your profile",
'type' => 'text',
'required' => false,
'validate' => 'printable'
);
jrCore_form_field_create($_tmp);
}
return $_data;
}
return $_data;