Enumerating over a category of links

Recycle the core

You could simply take the widgets code from core 1), rename the class and such and alter it to your needs. OR you could simply extend the core widget class and just alter what you need changed (overwrite the methods in your extending Widget class).

Than add a plugin comment on top and activate it.

/**
 * Plugin Name: Custom Link Widget
 * Description: Altered from WP Core.
 * Version:     0.1
 * Required:    3.3
 * Author:      Your Name <[email protected]>
 * Author URI:  http://example.com
 * License:     MIT
 * License URI: http://www.opensource.org/licenses/mit-license.php
 */

1) The core widget you can find here.