<?php

defined('_JEXEC') or die;
/**
*
* @package VehicleManager
* @copyright by Ordasoft
* @author Andrey Kvasnevskiy - OrdaSoft (akbet@mail.ru); Rob de Cleen (rob@decleen.com);
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* Homepage: https://ordasoft.com/
*
* */

abstract class VehiclemanagerHelperAssociation{


  public static function getAssociations($id = 0, $view = null){
      
      $input = JFactory::getApplication()->input;
      if($input->get('task', '') != ''){
            
          $task = $input->get('task', '');
          
          JLoader::import('helpers.route', JPATH_COMPONENT_SITE);

          if($task == 'showCategory' || $task == 'alone_category'  ){

              $catid = intval(mosGetParam($_REQUEST, 'catid', 0));

              if($catid){
                $rederectUrlArr = VehiclemanagerHelperRoute::getVmCategoryRoute( $catid );
                return $rederectUrlArr;
              }
          }

          if( $task == 'view' || $task == 'view_vehicle'  ){

              $id = intval(mosGetParam($_REQUEST, 'id', 0));
              
              
              if ($id){
                $rederectUrlArr = VehiclemanagerHelperRoute::getVmAssocRoute($id);
                return $rederectUrlArr;
              }
          }
      }

      return array();
  }
}
