See Release Notes
Long Term Support Release
1 <?php 2 // This file is part of Moodle - http://moodle.org/ 3 // 4 // Moodle is free software: you can redistribute it and/or modify 5 // it under the terms of the GNU General Public License as published by 6 // the Free Software Foundation, either version 3 of the License, or 7 // (at your option) any later version. 8 // 9 // Moodle is distributed in the hope that it will be useful, 10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 // GNU General Public License for more details. 13 // 14 // You should have received a copy of the GNU General Public License 15 // along with Moodle. If not, see <http://www.gnu.org/licenses/>. 16 17 /** 18 * @package backup-convert 19 * @subpackage cc-library 20 * @copyright 2011 Darko Miletic <dmiletic@moodlerooms.com> 21 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 22 */ 23 24 require_once 'cc_organization.php'; 25 26 27 /** 28 * Abstract Version Base class 29 * 30 */ 31 abstract class cc_version_base { 32 protected $_generator = null; 33 protected $ccnamespaces = array(); 34 protected $isrootmanifest = false; 35 protected $manifestID = null; 36 protected $organizationid = null; 37 public $resources = null; 38 public $resources_ind = null; 39 protected $metadata = null; 40 public $organizations = null; 41 protected $base = null; 42 public $ccversion = null; 43 public $camversion = null; 44 45 46 abstract protected function on_create(DOMDocument &$doc, $rootmanifestnode = null, $nmanifestID = null); 47 48 abstract protected function create_metadata_manifest(cc_i_metadata_manifest $met, DOMDocument &$doc, $xmlnode = null); 49 50 abstract protected function create_metadata_resource(cc_i_metadata_resource $met, DOMDocument &$doc, $xmlnode = null); 51 52 abstract protected function create_metadata_file(cc_i_metadata_file $met, DOMDocument &$doc, $xmlnode = null); 53 54 abstract protected function create_resource(cc_i_resource &$res, DOMDocument &$doc, $xmlnode=null); 55 56 abstract protected function create_organization(cc_i_organization &$org, DOMDocument &$doc, $xmlnode=null); 57 58 public function get_cc_namespaces() { 59 return $this->ccnamespaces; 60 } 61 62 public function create_manifest(DOMDocument &$doc, $rootmanifestnode = null) { 63 return $this->on_create($doc, $rootmanifestnode); 64 } 65 66 public function create_resource_node(cc_i_resource &$res, DOMDocument &$doc, $xmlnode = null) { 67 return $this->create_resource($res, $doc, $xmlnode); 68 } 69 70 71 public function create_metadata_node(&$met, DOMDocument &$doc, $xmlnode = null) { 72 return $this->create_metadata_manifest($met, $doc, $xmlnode); 73 } 74 75 public function create_metadata_resource_node(&$met, DOMDocument &$doc, $xmlnode = null) { 76 return $this->create_metadata_resource($met, $doc, $xmlnode); 77 } 78 79 public function create_metadata_file_node(&$met, DOMDocument &$doc, $xmlnode = null) { 80 return $this->create_metadata_file($met, $doc, $xmlnode); 81 } 82 83 public function create_organization_node(cc_i_organization &$org, DOMDocument &$doc, $xmlnode = null) { 84 return $this->create_organization($org, $doc, $xmlnode); 85 } 86 87 public function manifestID() { 88 return $this->manifestID; 89 } 90 91 public function set_manifestID($id) { 92 $this->manifestID = $id; 93 } 94 95 public function get_base() { 96 return $this->base; 97 } 98 99 public function set_base($baseval) { 100 $this->base = $baseval; 101 } 102 103 public function import_resources(DOMElement &$node, cc_i_manifest &$doc) { 104 if (is_null($this->resources)) { 105 $this->resources = array(); 106 } 107 $nlist = $node->getElementsByTagNameNS($this->ccnamespaces['imscc'], 'resource'); 108 if (is_object($nlist)) { 109 foreach ($nlist as $nd) { 110 $sc = new cc_resource($doc, $nd); 111 $this->resources[$sc->identifier] = $sc; 112 } 113 } 114 } 115 116 public function import_organization_items(DOMElement &$node, cc_i_manifest &$doc) { 117 if (is_null($this->organizations)) { 118 $this->organizations = array(); 119 } 120 $nlist = $node->getElementsByTagNameNS($this->ccnamespaces['imscc'], 'organization'); 121 if (is_object($nlist)) { 122 foreach ($nlist as $nd) { 123 $sc = new cc_organization($nd, $doc); 124 $this->organizations[$sc->identifier] = $sc; 125 } 126 } 127 } 128 129 public function set_generator($value) { 130 $this->_generator = $value; 131 } 132 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body