<?php
if ($list) {
    $i = 0;
    foreach ($list as $key => $value) {
        ?>
        <ul class="user-menu" style="margin-left: 2<?php if ($i == 0) { ?>2<?php } ?>0px;float: left;font-size: 16px;font-weight: 200;margin-top: 16px;">
            <li class="dropdown pull-left">
                <a title="<?php echo $value->getShortTitle(); ?>" href="#" class="dropdown-toggle" data-toggle="dropdown"> <img class="small_img" src="<?php echo $view->escape('/uploads/categories/'); ?><?php echo $value->getSmallIcon(); ?>" style="display: inline; width: 20px; min-height: 20px; height: 20px; margin-top: -5px; margin-bottom: 0px;"> <?php echo $value->getTitle(); ?> <span class="caret"></span></a>
                <?php if ($arr[$value->getId()] != 0) { ?>
                    <ul class="dropdown-menu" role="menu">
                        <?php foreach ($arr[$value->getId()] as $key1 => $value1) { ?>
                            <li><a title="<?php echo $value1->getShortTitle(); ?>" href="<?php echo $view['router']->generate('view_categories', array('id' => $value1->getId(), 'title' => Market\ZodacoBundle\System::_reString($value1->getShortTitle())), true); ?>"><img src="<?php echo $view->escape('/uploads/categories/'); ?><?php echo $value1->getSmallIcon(); ?>" style="display: inline; width: 20px; min-height: 20px; height: 20px; margin-top: -5px; margin-bottom: 0px;"> <?php echo $value1->getTitle(); ?></a></li>
                        <?php } ?>
                    </ul>
                <?php }
                ?>		
            </li>
        </ul>
        <?php
        $i++;
    }
}
?>