function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? false : $instance['title']); $sources = new SourceAdmin(); echo $before_widget; if ($title) { echo $before_title, $title, $after_title; } ?> <ul id="myprofiles"> <?php foreach ($sources->legend_types() as $legend) { ?> <li><img src="<?php echo $legend->favicon; ?> " alt="<?php echo $legend->title; ?> " /><a href="<?php echo $legend->profile_url; ?> "><?php echo $legend->title; ?> </a></li> <?php } ?> </ul> <?php echo $after_widget; }
<!-- myprofiles --> <?php $sources = new SourceAdmin(); ?> <div class="widget"> <h3>My Profiles</h3> <ul id="myprofiles"> <?php foreach ($sources->legend_types() as $legend) { ?> <li><img src="<?php echo $legend->favicon; ?> " alt="<?php echo $legend->title; ?> " /><a href="<?php echo $legend->profile_url; ?> "><?php echo $legend->title; ?> </a></li> <?php } ?> </ul> </div> <!-- /myprofiles -->