Exemplo n.º 1
0
 public static function getPath($file = '')
 {
     $controller = Context::getContext()->controller;
     if (!Module::isInstalled('agilemultipleseller')) {
         return parent::getPath($file);
     }
     if (!$controller->is_seller) {
         return parent::getPath($file);
     }
     $dir = (defined('_PS_HOST_MODE_') ? _PS_ROOT_DIR_ : _PS_ADMIN_DIR_) . DIRECTORY_SEPARATOR . 'import' . DIRECTORY_SEPARATOR . $controller->context->cookie->id_employee;
     if (!file_exists($dir)) {
         mkdir($dir);
     }
     return $dir . DIRECTORY_SEPARATOR . $file;
 }