function getFiles($folder, $name)
    {
        $filesArray = array();
        $files = Folder::files($folder, null, false, true);

	    $path = JFusionFramework::getPluginPath($name);

        foreach ($files as $file) {
            $file = str_replace($path . '/', '', $file);
	        $file = str_replace($path . '\\', '', $file);
            $data = file_get_contents($file);
            $filesArray[] = array('name' => $file, 'data' => $data);
        }
        $folders = Folder::folders($folder, null, false, true);
        if (!empty($folders)) {
            foreach ($folders as $f) {
                $filesArray = array_merge($filesArray, $this->getFiles($f, $name));
            }
        }
        return $filesArray;
    }