/** * Registes all custom field types */ function register_custom_field_types() { // registering profile field types $profile_options = array("show_on_register" => true, "mandatory" => true, "user_editable" => true, "output_as_tags" => true, "admin_only" => true, "count_for_completeness" => true); $location_options = $profile_options; unset($location_options["output_as_tags"]); $pm_datepicker_options = $profile_options; unset($pm_datepicker_options["output_as_tags"]); $pulldown_options = $profile_options; $pulldown_options["blank_available"] = true; $radio_options = $profile_options; $radio_options["blank_available"] = true; $file_options = array("user_editable" => true, "admin_only" => true); $pm_rating_options = $profile_options; unset($pm_rating_options["output_as_tags"]); add_custom_field_type("custom_profile_field_types", 'text', elgg_echo('profile:field:text'), $profile_options); add_custom_field_type("custom_profile_field_types", 'longtext', elgg_echo('profile:field:longtext'), $profile_options); add_custom_field_type("custom_profile_field_types", 'tags', elgg_echo('profile:field:tags'), $profile_options); add_custom_field_type("custom_profile_field_types", 'location', elgg_echo('profile:field:location'), $location_options); add_custom_field_type("custom_profile_field_types", 'url', elgg_echo('profile:field:url'), $profile_options); add_custom_field_type("custom_profile_field_types", 'email', elgg_echo('profile:field:email'), $profile_options); add_custom_field_type("custom_profile_field_types", 'date', elgg_echo('profile:field:date'), $profile_options); add_custom_field_type("custom_profile_field_types", 'calendar', elgg_echo('calendar'), $profile_options); add_custom_field_type("custom_profile_field_types", 'pm_datepicker', elgg_echo('profile_manager:admin:options:pm_datepicker'), $pm_datepicker_options); add_custom_field_type("custom_profile_field_types", 'dropdown', elgg_echo('profile_manager:admin:options:pulldown'), $pulldown_options); add_custom_field_type("custom_profile_field_types", 'radio', elgg_echo('profile_manager:admin:options:radio'), $radio_options); add_custom_field_type("custom_profile_field_types", 'multiselect', elgg_echo('profile_manager:admin:options:multiselect'), $profile_options); add_custom_field_type("custom_profile_field_types", 'pm_rating', elgg_echo('profile_manager:admin:options:pm_rating'), $pm_rating_options); //add_custom_field_type("custom_profile_field_types", 'pm_file', elgg_echo('profile_manager:admin:options:file'), $file_options); if (elgg_view_exists("output/datepicker") && elgg_view_exists("input/datepicker")) { $datepicker_options = $profile_options; unset($datepicker_options["output_as_tags"]); add_custom_field_type("custom_profile_field_types", 'datepicker', elgg_echo('profile_manager:admin:options:datepicker'), $datepicker_options); } else { elgg_register_plugin_hook_handler('display', 'view', 'profile_manager_display_view_hook'); } // registering group field types $group_options = array("output_as_tags" => true, "admin_only" => true); $datepicker_options = $group_options; unset($datepicker_options["output_as_tags"]); $pulldown_options = $group_options; $pulldown_options["blank_available"] = true; $radio_options = $group_options; $radio_options["blank_available"] = true; add_custom_field_type("custom_group_field_types", 'text', elgg_echo('profile:field:text'), $group_options); add_custom_field_type("custom_group_field_types", 'longtext', elgg_echo('profile:field:longtext'), $group_options); add_custom_field_type("custom_group_field_types", 'tags', elgg_echo('profile:field:tags'), $group_options); add_custom_field_type("custom_group_field_types", 'url', elgg_echo('profile:field:url'), $group_options); add_custom_field_type("custom_group_field_types", 'email', elgg_echo('profile:field:email'), $group_options); add_custom_field_type("custom_group_field_types", 'date', elgg_echo('profile:field:date'), $group_options); add_custom_field_type("custom_group_field_types", 'calendar', elgg_echo('calendar'), $group_options); add_custom_field_type("custom_group_field_types", 'datepicker', elgg_echo('profile_manager:admin:options:datepicker'), $datepicker_options); add_custom_field_type("custom_group_field_types", 'dropdown', elgg_echo('profile_manager:admin:options:pulldown'), $pulldown_options); add_custom_field_type("custom_group_field_types", 'radio', elgg_echo('profile_manager:admin:options:radio'), $radio_options); add_custom_field_type("custom_group_field_types", 'multiselect', elgg_echo('profile_manager:admin:options:multiselect'), $group_options); }
function birthdays_init() { if (elgg_is_active_plugin("profile_manager")) { // add custom profile field type // only works with Profile Manager active $profile_options = array("show_on_register" => true, "mandatory" => true, "user_editable" => true, "output_as_tags" => false, "admin_only" => true, "count_for_completeness" => true); add_custom_field_type("custom_profile_field_types", "birthday", elgg_echo("birthdays:profile_field:type"), $profile_options); } elgg_register_widget_type("birthdays", elgg_echo("birthdays:widget:title"), elgg_echo("birthdays:widget:description"), "dashboard,index"); elgg_extend_view("user/status", "birthdays/user_status", 600); elgg_extend_view("js/elgg", "birthdays/js/site"); }
function pleio_beconnummer_init() { // register custom profile type $profile_options = array("show_on_register" => true, "mandatory" => true, "user_editable" => true, "output_as_tags" => true, "admin_only" => true, "count_for_completeness" => true); add_custom_field_type("custom_profile_field_types", "beconnummer", elgg_echo("pleio_beconnummer:profile_field:beconnummer"), $profile_options); // register plugin hooks elgg_register_plugin_hook_handler("action", "register", "pleio_beconnummer_action_handler", 400); elgg_register_plugin_hook_handler("action", "profile/edit", "pleio_beconnummer_action_handler", 400); elgg_register_plugin_hook_handler("action", "profile_manager/complete", "pleio_beconnummer_action_handler", 400); elgg_register_plugin_hook_handler("action", "subsites/join/request_approval", "pleio_beconnummer_action_handler", 400); elgg_register_plugin_hook_handler("action", "subsites/join/validate_domain", "pleio_beconnummer_action_handler", 400); elgg_register_plugin_hook_handler("action", "subsites/join/missing_fields", "pleio_beconnummer_action_handler", 400); // register actions elgg_register_action("pleio_beconnummer/settings/save", dirname(__FILE__) . "/actions/settings/save.php", "admin"); }
/** * Country Selector * * Main init file * * @package country_selector * @author ColdTrick IT Solutions * @copyright Coldtrick IT Solutions 2009 * @link http://www.coldtrick.com/ * @version 0.1 */ function country_selector_init() { if (is_plugin_enabled("profile_manager")) { // default profile options $profileoptions = array(); $profileoptions["show_on_register"] = true; $profileoptions["mandatory"] = true; $profileoptions["user_editable"] = true; $profileoptions["output_as_tags"] = false; $profileoptions["admin_only"] = true; $profileoptions["simple_search"] = true; $profileoptions["advanced_search"] = true; // default group options $groupoptions = array(); $groupoptions["output_as_tags"] = false; $groupoptions["admin_only"] = true; // Add profile fields add_custom_field_type("custom_profile_field_types", 'country', elgg_echo("country_selector:field_type:country"), $profileoptions); add_custom_field_type("custom_profile_field_types", 'ca_us_state', elgg_echo("country_selector:field_type:ca_us_state"), $profileoptions); // Add group fields add_custom_field_type("custom_group_field_types", 'country', elgg_echo("country_selector:field_type:country"), $groupoptions); add_custom_field_type("custom_group_field_types", 'ca_us_state', elgg_echo("country_selector:field_type:ca_us_state"), $groupoptions); } }
/** * Registes all custom field types */ function register_custom_field_types() { $profileoptions = array(); $profileoptions["show_on_register"] = true; $profileoptions["mandatory"] = true; $profileoptions["user_editable"] = true; $profileoptions["output_as_tags"] = true; $profileoptions["admin_only"] = true; $profileoptions["simple_search"] = true; $profileoptions["advanced_search"] = true; $groupoptions = array(); $groupoptions["output_as_tags"] = true; $groupoptions["admin_only"] = true; $calendaroptions = $profileoptions; unset($calendaroptions["simple_search"]); unset($calendaroptions["advanced_search"]); // registering profile field types add_custom_field_type("custom_profile_field_types", 'text', elgg_echo('text'), $profileoptions); add_custom_field_type("custom_profile_field_types", 'longtext', elgg_echo('longtext'), $profileoptions); add_custom_field_type("custom_profile_field_types", 'tags', elgg_echo('tags'), $profileoptions); add_custom_field_type("custom_profile_field_types", 'url', elgg_echo('url'), $profileoptions); add_custom_field_type("custom_profile_field_types", 'email', elgg_echo('email'), $profileoptions); add_custom_field_type("custom_profile_field_types", 'calendar', elgg_echo('calendar'), $calendaroptions); add_custom_field_type("custom_profile_field_types", 'datepicker', elgg_echo('profile_manager:admin:options:datepicker'), $profileoptions); add_custom_field_type("custom_profile_field_types", 'pulldown', elgg_echo('profile_manager:admin:options:pulldown'), $profileoptions); add_custom_field_type("custom_profile_field_types", 'radio', elgg_echo('profile_manager:admin:options:radio'), $profileoptions); add_custom_field_type("custom_profile_field_types", 'multiselect', elgg_echo('profile_manager:admin:options:multiselect'), $profileoptions); //add_custom_field_type("custom_profile_field_types", 'file', elgg_echo('profile_manager:admin:options:file')); // registering group field types add_custom_field_type("custom_group_field_types", 'text', elgg_echo('text'), $groupoptions); add_custom_field_type("custom_group_field_types", 'longtext', elgg_echo('longtext'), $groupoptions); add_custom_field_type("custom_group_field_types", 'tags', elgg_echo('tags'), $groupoptions); add_custom_field_type("custom_group_field_types", 'url', elgg_echo('url'), $groupoptions); add_custom_field_type("custom_group_field_types", 'email', elgg_echo('email'), $groupoptions); add_custom_field_type("custom_group_field_types", 'calendar', elgg_echo('calendar'), $groupoptions); add_custom_field_type("custom_group_field_types", 'datepicker', elgg_echo('profile_manager:admin:options:datepicker'), $groupoptions); add_custom_field_type("custom_group_field_types", 'pulldown', elgg_echo('profile_manager:admin:options:pulldown'), $groupoptions); add_custom_field_type("custom_group_field_types", 'radio', elgg_echo('profile_manager:admin:options:radio'), $groupoptions); add_custom_field_type("custom_group_field_types", 'multiselect', elgg_echo('profile_manager:admin:options:multiselect'), $groupoptions); }
<?php // Add custom field type to profile manager if (is_callable('add_custom_field_type')) { $profile_options = array("show_on_register" => true, "mandatory" => true, "user_editable" => true, "admin_only" => true, "blank_available" => true, "count_for_completeness" => true); add_custom_field_type("custom_profile_field_types", 'category', elgg_echo('profile_manager:admin:options:category'), $profile_options); }