Beispiel #1
0
 public H5PCore(H5PFrameworkInterface H5PFramework, string path, string url, string language = "en", bool export = false)
 {
     //this.h5pF = H5PFramework;
     ////this.fs = (path instanceof \H5PFileStorage ? path: new \H5PDefaultStorage(path));
     //this.url = url;
     //this.exportEnabled = export;
     //this.development_mode = new H5PDevelopment(); //mode MODE_NONE
     //this.aggregateAssets = false; // Off by default.. for now
     //this.detectSiteType();
     ////this.fullPluginPath = preg_replace("/\/[^\/]+[\/]?/", "", dirname(__FILE__));
     //this.fullPluginPath = path;
     //// Standard regex for converting copied files paths
     //this.relativePathRegExp = new Regex(@"/^((\.\.\/){1,2})(.*content\/)?(\d+|editor)\/(.+)/");
 }
Beispiel #2
0
        public void __construct(H5PFrameworkInterface H5PFramework, string filesPath, string language, Dictionary <string, dynamic> libraries = null)
        {
            this.h5pF      = H5PFramework;
            this.language  = language;
            this.filesPath = filesPath;

            if (libraries != null)
            {
                ls["value"] = libraries["value"];
            }
            else
            {
                this.findLibraries(filesPath + "/development");
            }
        }
Beispiel #3
0
        public H5PFrameworkInterface h5pF()
        {
            H5PFrameworkInterface result = null;

            return(result);
        }
Beispiel #4
0
        public void findLibraries(string path)
        {
            Dictionary <string, dynamic> l  = new Dictionary <string, dynamic>();
            Dictionary <string, dynamic> ls = new Dictionary <string, dynamic>();

            string[] lib = null;
            ls.Add("value", lib); // method name: "array"

            if (File.Exists(path) == false)
            {
                return;
            }

            contents = File.ReadAllText(path);

            for (int i = 0, s = contents.Count(); i < s; i++)
            {
                //First
                if (contents[i].ToString() == ".")
                {
                    continue;
                }

                string libraryPath = path + contents[i];
                Dictionary <string, dynamic> libraryJSON = this.getFileContents(libraryPath + "library.json");
                if (libraryJSON == null)
                {
                    continue;
                }

                //l.value = Json.JsonParser.Deserialize(libraryJSON);
                //l["value"]= Json.JsonParser.Deserialize(libraryJSON); - to fix

                if (l["value"] == null)
                {
                    continue;
                }

                h5pF = new H5PFrameworkInterface(null)
                {
                    libraryId = getLibrary(l["machineName"].ToString(), l["majorVersion"].ToString(), l["minorVersion"].ToString())[0]
                };

                int index = int.Parse(h5pF.libraryId);
                l.Add("libraryId", this.h5pF.libraryId);

                this.h5pF.libraryId = saveLibraryData(l["value"].ToString(), String.IsNullOrEmpty(l["libraryId"].ToString()) ? true : false);

                l.Add("path", Convert.ToString(contents[i]));

                this.ls["value"] = lib;
            }

            this.h5pF = lockDependencyStorage();

            List <Dictionary <string, dynamic> > lstLib = new List <Dictionary <string, dynamic> >();

            lstLib.Add(ls);

            foreach (Dictionary <string, dynamic> s in lstLib)
            {
                deleteLibraryDependencies(l);
            }


            string[] types = { "preloaded", "dynamic", "editor" };


            foreach (string t in types)
            {
                if ((l["type"].ToString() + "Dependencies") == null)
                {
                    saveLibraryDependencies(l["libraryId"].ToString(), l["type"].ToString(), t);
                }
            }

            unlockDependencyStorage();
        }
Beispiel #5
0
        public H5PFrameworkInterface lockDependencyStorage()
        {
            H5PFrameworkInterface result = null;

            return(result);
        }
Beispiel #6
0
 public H5PStorage(H5PFrameworkInterface h5pF, H5P.H5PCore core)
 {
 }
Beispiel #7
0
 public H5peditorFile(H5PFrameworkInterface _interface)
 {
 }
Beispiel #8
0
 public H5PValidator(H5PFrameworkInterface h5pf, H5P.H5PCore core)
 {
 }