<?php
/**
  * Ahead WebSoft Technologies Pvt Ltd.
  * @copyright  Copyright 2006-2026 Ahead WebSoft Technologies Pvt Ltd.
  * @license    https://www.socialengine.com/policies
*/
?>
<a href="javascript:void(0)" class="humburger_button">
  <span class="hamburger hamburger-1"></span>
  <span class="hamburger hamburger-2"></span>
  <span class="hamburger hamburger-3"></span>
</a>
<div class="sidebar_menu">
  <ul class="sidebar_main_menu navigation">
    <?php foreach( $this->navigation as $link ): ?>
      <?php 
        $explodedString = explode(' ', $link->class);
        $menuName = end($explodedString); 
        $moduleName = str_replace('core_main_', '', $menuName);
        if(strpos($moduleName, 'custom_') !== 0){
          $moduleName = $moduleName.'_main';
        }
      ?>
      <?php $subMenus = Engine_Api::_()->getApi('menus', 'core')->getNavigation($moduleName); 
        $menuSubArray = $subMenus->toArray();
      ?>
      <li class="<?php echo $link->get('active') ? 'active' : '' ?>">
        <a href='<?php echo $link->getHref() ?>' class="<?php echo $link->getClass() ? ' ' . $link->getClass() : ''  ?>"
          <?php if( $link->get('target') ): ?> target='<?php echo $link->get('target') ?>' <?php endif; ?> >
            <i class="<?php echo $link->get('icon') ? $link->get('icon') : 'fa fa-star' ?>"></i>
          <span><?php echo $this->translate($link->getlabel()) ?></span>
          <?php if(count($menuSubArray) > 0 && $this->submenu): ?>
            <i class="fa fa-angle-down"></i>
          <?php endif; ?>
        </a>
      </li>
    <?php endforeach; ?>
  </ul>
  <?php if(Engine_Api::_()->getApi('settings', 'core')->getSetting('twitterclone.footersidepanel',1)) { ?>
    <div class="sidebar_menu_footer">
      <div class="menu_footer_links">
        <ul>
          <?php foreach( $this->footerNavigation as $item ): ?>
            <li><a href="<?php echo $item->getHref(); ?>"><?php echo $this->translate($item->getLabel()); ?></a></li>
          <?php endforeach; ?>
        </ul>
      </div>
      <div class="menu_copy_lang">
        <p class="menu_copyright"><?php echo $this->translate('Copyright &copy; %s', date('Y')) ?></p>
        <?php if (is_countable($this->languageNameList) && 1 !== engine_count($this->languageNameList)): ?>
          <?php echo $this->partial('_languages.tpl', 'core', array('languageNameList' => $this->languageNameList)); ?>
        <?php endif; ?>
      </div>
    </div>
  <?php } ?>
</div>
<script type="text/javascript">
  // Main Menu Toggle
  en4.core.runonce.add(function(){ 
    AttachEventListerSE('click', '.humburger_button, .twitter_user_dashboard_more_btn', function () {
      if(scriptJquery("body").hasClass('body_header_open')){
        scriptJquery("body").removeClass('body_header_open')
      }else{
        scriptJquery("body").addClass('body_header_open');
      }
    });
  });    
  AttachEventListerSE('click', function(event) {
    if (!scriptJquery(event.target).closest(".sidebar_menu,.humburger_button,.twitter_user_dashboard_more_btn").length) {
        scriptJquery("html").find("body").removeClass("body_header_open");
    }
  });
</script>    
