<?php
/**
  * Ahead WebSoft Technologies Pvt Ltd.
  * @copyright  Copyright 2006-2026 Ahead WebSoft Technologies Pvt Ltd.
  * @license    https://www.socialengine.com/policies
*/
?>
<div class="twitter_user_dashboard_links">
  <?php foreach( $this->dashboardlinks as $item ): ?>
    <div class="twitter_dashboard_explore_links">
      <?php $footersubresults = Engine_Api::_()->getDbTable('dashboardlinks', 'twitterclone')->getInfo(array('sublink' => $item->dashboardlink_id, 'enabled' => 1)); ?>
      <?php if(engine_count($footersubresults) > 0) { ?>
        <ul>
          <?php foreach($footersubresults as $footersubresult) { ?>
            <li>
              <a href="<?php echo trim($footersubresult->url ? $footersubresult->url  :  $this->baseUrl());?>">
                <?php if(empty($footersubresult->icon_type) && !empty($footersubresult->photo)): ?>
                  <?php $icon = Engine_Api::_()->core()->getFileUrl($footersubresult->photo, true); ?>
                  <img src="<?php echo $icon['image']; ?>" alt="<?php echo $icon['alt_text'] ?? ''; ?>" />
                <?php elseif(empty($footersubresult->photo) && !empty($footersubresult->icon_type) && !empty($footersubresult->font_icon)): ?>
                  <i class="<?php echo $footersubresult->font_icon; ?>"></i>
                <?php endif;?>
                <span><?php echo $this->translate($footersubresult->name); ?></span>
              </a>
            </li>
          <?php } ?>
          <?php if(engine_in_array('mainMenu', $this->options)) { ?>
            <li>
              <a href="javascript:void(0)" class="twitter_user_dashboard_more_btn"> 
                <i class="twitter_user_dashboard_more_icon">
                  <svg width="26" height="26" viewBox="0 0 24 24" fill="none"><path d="M12 22C17.5 22 22 17.5 22 12C22 6.5 17.5 2 12 2C6.5 2 2 6.5 2 12C2 17.5 6.5 22 12 22Z" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M15.9965 12H16.0054" stroke="#292D32" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path><path d="M11.9955 12H12.0045" stroke="#292D32" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path><path d="M7.99451 12H8.00349" stroke="#292D32" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg>
                </i>
                <span><?php echo $this->translate('More'); ?></span>
              </a>
            </li>
          <?php } ?>
        </ul>
      <?php } ?>
    </div>
  <?php endforeach; ?>
  <?php if($this->viewer()->getIdentity() != 0){ ?>
  <div class="twitter_dashboard_feed_button">
    <button onclick="showfeedcomposer();">
      <i class="fi fi-rr-feather"></i>
      <span><?php echo $this->translate('Post');?></span>
    </button>
  </div>
<?php } ?>
  <div class="twitter_dashboard_profile">
    <div class="twitter_dashboard_profile_img">
      <?php if($this->viewer->photo_id) { ?>
        <img src="<?php echo $this->viewer->getPhotoUrl('thumb.icon'); ?>" />
      <?php } else { ?>
        <img src="application/modules/User/externals/images/nophoto_user_thumb_icon.png" />
      <?php } ?>
    </div>
    <div class="twitter_dashboard_profile_content">
      <a class="profile_link" href="<?php echo $this->viewer->getHref(); ?>">
        <span><?php echo $this->viewer->getTitle(); ?></span>
      </a>
        <a class="user_dashboard_dropdown_toggle" href="javascript:void(0);" role="button" id="dropdownMenuLink" data-bs-toggle="dropdown" aria-expanded="false">
          <i class="fa fa-ellipsis-h"></i>
        </a>
      <ul class="dropdown-menu edit_profile_dropdown dropdown-menu-end"  aria-labelledby="dropdownMenuLink">
        <?php foreach( $this->homelinksnavigation as $link ): ?>
          <li>
            <a href="<?php echo $link->getHref(); ?>"><?php echo $this->translate($link->getLabel()); ?></a>
          </li>
        <?php endforeach; ?>
      </ul>
    </div>
  </div>
</div>
<script>
  // Share Feed Button
  function showfeedcomposer(){
    if(scriptJquery('.tab_layout_activity_feed').length > 0)
      scriptJquery('.tab_layout_activity_feed').find('a').trigger('click');
    if(scriptJquery('.compose-content').length > 0 && !scriptJquery('.compose-content').hasClass('_active')) {
      scriptJquery('.compose-content')[0].focus();
      scriptJquery('.compose-content').addClass('_active');
    }
    if(scriptJquery('.tab_layout_sesadvancedactivity_feed').length > 0)
      scriptJquery('.tab_layout_sesadvancedactivity_feed').find('a').trigger('click');
    if(scriptJquery('#activity_body').length > 0)
      scriptJquery('#activity_body')[0].focus();
  }
</script>
