diff --git a/backup/cc/schemas/cclibxml2validator.xsd b/backup/cc/schemas/cclibxml2validator.xsd index a64d71b9d00..f2d5595d093 100755 --- a/backup/cc/schemas/cclibxml2validator.xsd +++ b/backup/cc/schemas/cclibxml2validator.xsd @@ -1,20 +1,20 @@ - - - - - - - - - + + + + + + + + + diff --git a/backup/cc/schemas/config.xml b/backup/cc/schemas/config.xml index e20fef39948..0aef837f911 100755 --- a/backup/cc/schemas/config.xml +++ b/backup/cc/schemas/config.xml @@ -1,63 +1,63 @@ - - - - http://www.imsglobal.org/xsd/imscc/imscp_v1p1 - imscp_v1p2_localised.xsd - - - http://www.imsglobal.org/xsd/imscp_v1p1 - imscp_v1p2.xsd - - - http://www.imsglobal.org/xsd/imsccauth_v1p0 - domainProfile_0/imsccauth_v1p0_localised.xsd - - - http://ltsc.ieee.org/xsd/imscc/LOM - domainProfile_1/lomLoose_localised.xsd - - - http://ltsc.ieee.org/xsd/imscc/LOM/unique - domainProfile_1/loose.xsd - - - http://ltsc.ieee.org/xsd/imscc/LOM/vocab - domainProfile_1/vocab/loose.xsd - - - http://ltsc.ieee.org/xsd/imscc/LOM/extend - domainProfile_1/extend/custom.xsd - - - http://ltsc.ieee.org/xsd/LOM - domainProfile_2/lomLoose_localised.xsd - - - http://ltsc.ieee.org/xsd/LOM/unique - domainProfile_2/loose.xsd - - - http://ltsc.ieee.org/xsd/LOM/vocab - domainProfile_2/vocab/loose.xsd - - - http://ltsc.ieee.org/xsd/LOM/extend - domainProfile_2/extend/custom.xsd - - - http://www.imsglobal.org/xsd/imscp_extensionv1p2 - domainProfile_3/imscp_extensionv1p2_localised.xsd - - - http://www.imsglobal.org/xsd/ims_qtiasiv1p2 - domainProfile_4/ims_qtiasiv1p2_localised.xsd - - - http://www.imsglobal.org/xsd/imswl_v1p0 - domainProfile_5/imswl_v1p0_localised.xsd - - - http://www.imsglobal.org/xsd/imsdt_v1p0 - domainProfile_6/imsdt_v1p0_localised.xsd - + + + + http://www.imsglobal.org/xsd/imscc/imscp_v1p1 + imscp_v1p2_localised.xsd + + + http://www.imsglobal.org/xsd/imscp_v1p1 + imscp_v1p2.xsd + + + http://www.imsglobal.org/xsd/imsccauth_v1p0 + domainProfile_0/imsccauth_v1p0_localised.xsd + + + http://ltsc.ieee.org/xsd/imscc/LOM + domainProfile_1/lomLoose_localised.xsd + + + http://ltsc.ieee.org/xsd/imscc/LOM/unique + domainProfile_1/loose.xsd + + + http://ltsc.ieee.org/xsd/imscc/LOM/vocab + domainProfile_1/vocab/loose.xsd + + + http://ltsc.ieee.org/xsd/imscc/LOM/extend + domainProfile_1/extend/custom.xsd + + + http://ltsc.ieee.org/xsd/LOM + domainProfile_2/lomLoose_localised.xsd + + + http://ltsc.ieee.org/xsd/LOM/unique + domainProfile_2/loose.xsd + + + http://ltsc.ieee.org/xsd/LOM/vocab + domainProfile_2/vocab/loose.xsd + + + http://ltsc.ieee.org/xsd/LOM/extend + domainProfile_2/extend/custom.xsd + + + http://www.imsglobal.org/xsd/imscp_extensionv1p2 + domainProfile_3/imscp_extensionv1p2_localised.xsd + + + http://www.imsglobal.org/xsd/ims_qtiasiv1p2 + domainProfile_4/ims_qtiasiv1p2_localised.xsd + + + http://www.imsglobal.org/xsd/imswl_v1p0 + domainProfile_5/imswl_v1p0_localised.xsd + + + http://www.imsglobal.org/xsd/imsdt_v1p0 + domainProfile_6/imsdt_v1p0_localised.xsd + \ No newline at end of file diff --git a/backup/cc/schemas/domainProfile_0/imsccauth_v1p0.xsd b/backup/cc/schemas/domainProfile_0/imsccauth_v1p0.xsd index 070217bbe03..61e2df16060 100755 --- a/backup/cc/schemas/domainProfile_0/imsccauth_v1p0.xsd +++ b/backup/cc/schemas/domainProfile_0/imsccauth_v1p0.xsd @@ -1,76 +1,76 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This group is defined exactly as in IMS Content Packaging v 1.2. - Any namespaced element from any namespace may be included within an "any" element. - The namespace for the imported element must be defined in the instance, and the schema must be imported. - The extension has a definition of "strict" i.e. they must have their own namespace. - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This group is defined exactly as in IMS Content Packaging v 1.2. + Any namespaced element from any namespace may be included within an "any" element. + The namespace for the imported element must be defined in the instance, and the schema must be imported. + The extension has a definition of "strict" i.e. they must have their own namespace. + + + + + + + + + + + diff --git a/backup/cc/schemas/domainProfile_0/imsccauth_v1p0_constraintsDocument.scmt b/backup/cc/schemas/domainProfile_0/imsccauth_v1p0_constraintsDocument.scmt index d91614364da..0401d214904 100755 --- a/backup/cc/schemas/domainProfile_0/imsccauth_v1p0_constraintsDocument.scmt +++ b/backup/cc/schemas/domainProfile_0/imsccauth_v1p0_constraintsDocument.scmt @@ -1,68 +1,68 @@ - - - - - - - - - - - - - - - - - Assertion failed for pattern_1. An Item object which represents a folder is indicated by the absence of an IdentifierRef characteristic object. Folder Items support unlimited nesting of other folder Items and learning object link Items. Learning Application Resource Item objects may be nested by folder Item object but may not nest other folder or Learning Application resource Item objects.(#S04) - - - - - Assertion failed for pattern_2. A Resource object which is a Learning Object Web Content may contain Dependency objects which reference Resource objects with Type 'webcontent'.(#S03) - - - - - Assertion failed for pattern_3. If an item is invisible, its descendants must be invisible too.(#S02) - - - - - Assertion failed for pattern_4. A Resource object which is a Discussion Topic associated resource may contain Dependency objects which reference Resource objects with Type 'webcontent' or 'associatedcontent/imscc_xmlv1p0/learning-application-resource'.(#S12) - - - - - Assertion failed for pattern_5. - The test was: . - The context was: ims:resources/ims:resource/ims:dependency | ims:manifest/ims:resources/ims:resource/ims:dependency - - - - - Assertion failed for pattern_6. A Resource object which is an assessment may contain Dependency objects which reference Resource objects with Type 'webcontent' or 'associatedcontent/imscc_xmlv1p0/learning-application-resource'.(#S14) - - - - - Assertion failed for pattern_7. If a cartridge web content or associated content resource is linked from a Learning Application Object link Item object it must have an Href characteristic object which represents the launchable resource.(#S05) - - - - - Assertion failed for pattern_8. For Discussion Topic Resources the Resource object must contain a single File object which references the Discussion Topic descriptor XML file which conforms to the http://www.imsglobal.org/xsd/imsdt_v1p0 schema. It must not have any href attribute.(#S06) - - - - - Assertion failed for pattern_9. For Web Link Resources the Resource object must contain a single File object which references the Web Link descriptor XML file which conforms to the http://www.imsglobal.org/xsd/imswl_v1p0 schema. It must contain neither Dependency objects nor an href attribute.(#S07) - - - - - Assertion failed for pattern_10. For Assessment or Question Bank Resources the Resource object must contain a single File object which references the QTI XML file. This file must conform to the IMS CC profile of QTI 1.2.1. The profile is contained in the package of this profile as imscc_q*.xdm. The derived schema of this QTI profile is in the package of this profile with the name ims_qtiasiv1p2_localised.xsd. The resource must not have an href attribute(#S11) - - - - + + + + + + + + + + + + + + + + + Assertion failed for pattern_1. An Item object which represents a folder is indicated by the absence of an IdentifierRef characteristic object. Folder Items support unlimited nesting of other folder Items and learning object link Items. Learning Application Resource Item objects may be nested by folder Item object but may not nest other folder or Learning Application resource Item objects.(#S04) + + + + + Assertion failed for pattern_2. A Resource object which is a Learning Object Web Content may contain Dependency objects which reference Resource objects with Type 'webcontent'.(#S03) + + + + + Assertion failed for pattern_3. If an item is invisible, its descendants must be invisible too.(#S02) + + + + + Assertion failed for pattern_4. A Resource object which is a Discussion Topic associated resource may contain Dependency objects which reference Resource objects with Type 'webcontent' or 'associatedcontent/imscc_xmlv1p0/learning-application-resource'.(#S12) + + + + + Assertion failed for pattern_5. + The test was: . + The context was: ims:resources/ims:resource/ims:dependency | ims:manifest/ims:resources/ims:resource/ims:dependency + + + + + Assertion failed for pattern_6. A Resource object which is an assessment may contain Dependency objects which reference Resource objects with Type 'webcontent' or 'associatedcontent/imscc_xmlv1p0/learning-application-resource'.(#S14) + + + + + Assertion failed for pattern_7. If a cartridge web content or associated content resource is linked from a Learning Application Object link Item object it must have an Href characteristic object which represents the launchable resource.(#S05) + + + + + Assertion failed for pattern_8. For Discussion Topic Resources the Resource object must contain a single File object which references the Discussion Topic descriptor XML file which conforms to the http://www.imsglobal.org/xsd/imsdt_v1p0 schema. It must not have any href attribute.(#S06) + + + + + Assertion failed for pattern_9. For Web Link Resources the Resource object must contain a single File object which references the Web Link descriptor XML file which conforms to the http://www.imsglobal.org/xsd/imswl_v1p0 schema. It must contain neither Dependency objects nor an href attribute.(#S07) + + + + + Assertion failed for pattern_10. For Assessment or Question Bank Resources the Resource object must contain a single File object which references the QTI XML file. This file must conform to the IMS CC profile of QTI 1.2.1. The profile is contained in the package of this profile as imscc_q*.xdm. The derived schema of this QTI profile is in the package of this profile with the name ims_qtiasiv1p2_localised.xsd. The resource must not have an href attribute(#S11) + + + + diff --git a/backup/cc/schemas/domainProfile_0/imsccauth_v1p0_localised.xsd b/backup/cc/schemas/domainProfile_0/imsccauth_v1p0_localised.xsd index e03b30490f6..f2fa6d77cc6 100755 --- a/backup/cc/schemas/domainProfile_0/imsccauth_v1p0_localised.xsd +++ b/backup/cc/schemas/domainProfile_0/imsccauth_v1p0_localised.xsd @@ -1,86 +1,86 @@ - - - - - - - - - - - - - general: This specification defines the authorizations for Common Cartridges and the roles to be used for selective display of resources to Learner or Instructor. - - - - - - - - - - - - - - - - - - - - - - - - - - - - This group is defined exactly as in IMS Content Packaging v 1.2. - Any namespaced element from any namespace may be included within an "any" element. - The namespace for the imported element must be defined in the instance, and the schema must be imported. - The extension has a definition of "strict" i.e. they must have their own namespace. - - - - - - - - - - - - + + + + + + + + + + + + + general: This specification defines the authorizations for Common Cartridges and the roles to be used for selective display of resources to Learner or Instructor. + + + + + + + + + + + + + + + + + + + + + + + + + + + + This group is defined exactly as in IMS Content Packaging v 1.2. + Any namespaced element from any namespace may be included within an "any" element. + The namespace for the imported element must be defined in the instance, and the schema must be imported. + The extension has a definition of "strict" i.e. they must have their own namespace. + + + + + + + + + + + + diff --git a/backup/cc/schemas/domainProfile_1/anyElement.xsd b/backup/cc/schemas/domainProfile_1/anyElement.xsd index 5b2ba1d2493..3f3de1b6bca 100755 --- a/backup/cc/schemas/domainProfile_1/anyElement.xsd +++ b/backup/cc/schemas/domainProfile_1/anyElement.xsd @@ -1,36 +1,36 @@ - - - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - - This component schema definition provides the element group declaration and the - attribute group declaration used for extension XML elements and attributes. - - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - - - - - - - - - + + + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + + This component schema definition provides the element group declaration and the + attribute group declaration used for extension XML elements and attributes. + + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + + + + + + + + + diff --git a/backup/cc/schemas/domainProfile_1/anyElement_localised.xsd b/backup/cc/schemas/domainProfile_1/anyElement_localised.xsd index 0dfe131acd1..9e255c37fef 100755 --- a/backup/cc/schemas/domainProfile_1/anyElement_localised.xsd +++ b/backup/cc/schemas/domainProfile_1/anyElement_localised.xsd @@ -1,44 +1,44 @@ - - - - - - - - - - - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - - This component schema definition provides the element group declaration and the - attribute group declaration used for extension XML elements and attributes. - - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - - - - - - - - - + + + + + + + + + + + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + + This component schema definition provides the element group declaration and the + attribute group declaration used for extension XML elements and attributes. + + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + + + + + + + + + diff --git a/backup/cc/schemas/domainProfile_1/common/anyElement.xsd b/backup/cc/schemas/domainProfile_1/common/anyElement.xsd index 34d6c6a63e1..19e3251499b 100755 --- a/backup/cc/schemas/domainProfile_1/common/anyElement.xsd +++ b/backup/cc/schemas/domainProfile_1/common/anyElement.xsd @@ -1,39 +1,39 @@ - - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - - This component schema definition provides the element group declaration and the - attribute group declaration used for extension XML elements and attributes. - - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - - - - - - - - + + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + + This component schema definition provides the element group declaration and the + attribute group declaration used for extension XML elements and attributes. + + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + + + + + + + + \ No newline at end of file diff --git a/backup/cc/schemas/domainProfile_1/common/dataTypes.xsd b/backup/cc/schemas/domainProfile_1/common/dataTypes.xsd index eebfb932da5..25921a4c4b0 100755 --- a/backup/cc/schemas/domainProfile_1/common/dataTypes.xsd +++ b/backup/cc/schemas/domainProfile_1/common/dataTypes.xsd @@ -1,118 +1,118 @@ - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - This component schema defintion defines global schema data type declarations - for data types defined in the LOMv1.0 base schema. - - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + This component schema defintion defines global schema data type declarations + for data types defined in the LOMv1.0 base schema. + + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/backup/cc/schemas/domainProfile_1/common/elementNames.xsd b/backup/cc/schemas/domainProfile_1/common/elementNames.xsd index 019dd2e3999..d4242ebff86 100755 --- a/backup/cc/schemas/domainProfile_1/common/elementNames.xsd +++ b/backup/cc/schemas/domainProfile_1/common/elementNames.xsd @@ -1,783 +1,783 @@ - - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - - This component schema defintion defines global element declarations for - each of the data elements defined in the LOMv1.0 base schema. This component - schema definition is used to check for the uniqueness of elements declared - to be unique within their parent elements by the presence of the - "uniqueElementName" attribute. The XML Schema constraint "unique" is used - to enforce uniqueness constraints. - - Duplicate declarations are included as comments for completeness. These - declarations should remain commented out or they can be removed completely. - - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + + This component schema defintion defines global element declarations for + each of the data elements defined in the LOMv1.0 base schema. This component + schema definition is used to check for the uniqueness of elements declared + to be unique within their parent elements by the presence of the + "uniqueElementName" attribute. The XML Schema constraint "unique" is used + to enforce uniqueness constraints. + + Duplicate declarations are included as comments for completeness. These + declarations should remain commented out or they can be removed completely. + + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/backup/cc/schemas/domainProfile_1/common/elementTypes.xsd b/backup/cc/schemas/domainProfile_1/common/elementTypes.xsd index 9d45a711485..5cf4697143e 100755 --- a/backup/cc/schemas/domainProfile_1/common/elementTypes.xsd +++ b/backup/cc/schemas/domainProfile_1/common/elementTypes.xsd @@ -1,779 +1,779 @@ - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - This component schema defintion defines global schema data type declarations - for data elements defined in the LOMv1.0 base schema. This component XSD - defines the aggregation relationship among the LOM data elements. These aggregation - relationships enforce the LOMv1.0 base schema requirement that elements can only - be present in a LOM XML instance as elements of the aggregate element to which they - belong. - - Duplicate declarations are included as comments for completeness. These declarations - should remain commented out or they can be removed completely. - - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + This component schema defintion defines global schema data type declarations + for data elements defined in the LOMv1.0 base schema. This component XSD + defines the aggregation relationship among the LOM data elements. These aggregation + relationships enforce the LOMv1.0 base schema requirement that elements can only + be present in a LOM XML instance as elements of the aggregate element to which they + belong. + + Duplicate declarations are included as comments for completeness. These declarations + should remain commented out or they can be removed completely. + + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/backup/cc/schemas/domainProfile_1/common/rootElement.xsd b/backup/cc/schemas/domainProfile_1/common/rootElement.xsd index 936f045d8f3..4d6da39e9cc 100755 --- a/backup/cc/schemas/domainProfile_1/common/rootElement.xsd +++ b/backup/cc/schemas/domainProfile_1/common/rootElement.xsd @@ -1,43 +1,43 @@ - - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - - This component schema defintion provides the element name declaration for the - root element for all LOM XML instances. - - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - - - - - - - - - - - - + + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + + This component schema defintion provides the element name declaration for the + root element for all LOM XML instances. + + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + + + + + + + + + + + + \ No newline at end of file diff --git a/backup/cc/schemas/domainProfile_1/common/vocabTypes.xsd b/backup/cc/schemas/domainProfile_1/common/vocabTypes.xsd index 128de9e2ed4..ed56a9f6a68 100755 --- a/backup/cc/schemas/domainProfile_1/common/vocabTypes.xsd +++ b/backup/cc/schemas/domainProfile_1/common/vocabTypes.xsd @@ -1,355 +1,355 @@ - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - This component schema defintion provides global type declarations for those - LOM data elements whose values are taken from a Vocabulary data type. - - - - This component XSD requires schema components from other - schemas that are defined in other namespaces. These statements import the - appropriate components. The xsi:schemaLocation attribute is used to specify - the location of the file that contains the schema that defines the namespace. - The xsi:schemaLocation attribute is optional and is ommitted. By definition of - the composite schemas the appropriate namespaces and related files where those - namespaces are defined are brought into scope. Some XML parsers may require - these import statements to contain the optional xsi:schemaLocation attribute. - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + This component schema defintion provides global type declarations for those + LOM data elements whose values are taken from a Vocabulary data type. + + + + This component XSD requires schema components from other + schemas that are defined in other namespaces. These statements import the + appropriate components. The xsi:schemaLocation attribute is used to specify + the location of the file that contains the schema that defines the namespace. + The xsi:schemaLocation attribute is optional and is ommitted. By definition of + the composite schemas the appropriate namespaces and related files where those + namespaces are defined are brought into scope. Some XML parsers may require + these import statements to contain the optional xsi:schemaLocation attribute. + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/backup/cc/schemas/domainProfile_1/common/vocabValues.xsd b/backup/cc/schemas/domainProfile_1/common/vocabValues.xsd index 8d26b6e2336..dba175cc728 100755 --- a/backup/cc/schemas/domainProfile_1/common/vocabValues.xsd +++ b/backup/cc/schemas/domainProfile_1/common/vocabValues.xsd @@ -1,266 +1,266 @@ - - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - - This component schema definition provides global type declarations for the standard - LOMv1.0 vocabulary tokens for those LOM data elements whose values are taken from - a Vocabulary data type. - - This component schema defintion defines the stanard vocabulary value - declarations as defined in the LOMv1.0 base schema. These vocabulary - value declarations are used in conjunction with both vocab/custom.xsd and - vocab/loose.xsd. - - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + + This component schema definition provides global type declarations for the standard + LOMv1.0 vocabulary tokens for those LOM data elements whose values are taken from + a Vocabulary data type. + + This component schema defintion defines the stanard vocabulary value + declarations as defined in the LOMv1.0 base schema. These vocabulary + value declarations are used in conjunction with both vocab/custom.xsd and + vocab/loose.xsd. + + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/backup/cc/schemas/domainProfile_1/dataTypes_localised.xsd b/backup/cc/schemas/domainProfile_1/dataTypes_localised.xsd index a3747096a9a..75ce21e18b7 100755 --- a/backup/cc/schemas/domainProfile_1/dataTypes_localised.xsd +++ b/backup/cc/schemas/domainProfile_1/dataTypes_localised.xsd @@ -1,130 +1,130 @@ - - - - - - - - - - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - This component schema defintion defines global schema data type declarations - for data types defined in the LOMv1.0 base schema. - - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - explanation: No custom elements are allowed. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + This component schema defintion defines global schema data type declarations + for data types defined in the LOMv1.0 base schema. + + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + explanation: No custom elements are allowed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backup/cc/schemas/domainProfile_1/elementNames_localised.xsd b/backup/cc/schemas/domainProfile_1/elementNames_localised.xsd index 9ab993e5b77..1ecca4eb589 100755 --- a/backup/cc/schemas/domainProfile_1/elementNames_localised.xsd +++ b/backup/cc/schemas/domainProfile_1/elementNames_localised.xsd @@ -1,787 +1,787 @@ - - - - - - - - - - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - - This component schema defintion defines global element declarations for - each of the data elements defined in the LOMv1.0 base schema. This component - schema definition is used to check for the uniqueness of elements declared - to be unique within their parent elements by the presence of the - "uniqueElementName" attribute. The XML Schema constraint "unique" is used - to enforce uniqueness constraints. - - Duplicate declarations are included as comments for completeness. These - declarations should remain commented out or they can be removed completely. - - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + + This component schema defintion defines global element declarations for + each of the data elements defined in the LOMv1.0 base schema. This component + schema definition is used to check for the uniqueness of elements declared + to be unique within their parent elements by the presence of the + "uniqueElementName" attribute. The XML Schema constraint "unique" is used + to enforce uniqueness constraints. + + Duplicate declarations are included as comments for completeness. These + declarations should remain commented out or they can be removed completely. + + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backup/cc/schemas/domainProfile_1/elementTypes_localised.xsd b/backup/cc/schemas/domainProfile_1/elementTypes_localised.xsd index 406435b4ff9..9a40a6a5b03 100755 --- a/backup/cc/schemas/domainProfile_1/elementTypes_localised.xsd +++ b/backup/cc/schemas/domainProfile_1/elementTypes_localised.xsd @@ -1,905 +1,905 @@ - - - - - - - - - - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - This component schema defintion defines global schema data type declarations - for data elements defined in the LOMv1.0 base schema. This component XSD - defines the aggregation relationship among the LOM data elements. These aggregation - relationships enforce the LOMv1.0 base schema requirement that elements can only - be present in a LOM XML instance as elements of the aggregate element to which they - belong. - - Duplicate declarations are included as comments for completeness. These declarations - should remain commented out or they can be removed completely. - - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - - - - - - - - - - - explanation: metaMetadata is unused. - - - - - - - - explanation: lom.annotation is unused. - - - - - explanation: No custom elements are allowed. - - - - - - - - - - - - - - - - - explanation: General.structure is unused. - - - - explanation: General.aggregationLevel is unused. - - - - explanation: No custom elements are allowed. - - - - - - - - - - - - - explanation: No custom elements are allowed. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - explanation: liveCycle.version is unused. - - - - explanation: lifeCycle.status is unused. - - - - - explanation: No custom elements are allowed. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - explanation: No custom elements are allowed. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - explanation: technical.size is unused. - - - - explanation: technical.location is unused. - - - - explanation: technical.requirement is unused. - - - - explanation: technical.installationRemarks is unused. - - - - explanation: technical.otherPlatformRequirements is unused. - - - - explanation: technical.duration is unused. - - - - explanation: No custom elements are allowed. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - explanation: interactivityType is unused. - - - - - explanation: interactivityLevel is unused. - - - - explanation: semanticDensity is unused. - - - - explanation: intendedEndUserRole is unused. - - - - explanation: Context is unused. - - - - explanation: typicalAgeRange is unused. - - - - explanation: difficulty is unused. - - - - explanation: typicalLearningTime is unused. - - - - explanation: description is unused in educational context. - - - - explanation: language unused in technical context, only in general context. - - - - explanation: No custom elements are allowed. - - - - - - - - - - - - - - - - - - - - - explanation: No custom elements are allowed. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - explanation: No custom elements are allowed. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - explanation: No custom elements are allowed. - - - - - - - - - - - - - - - - - - - - - explanation: No custom elements are allowed. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - explanation: No custom elements are allowed. - - - - - - - - - - - - - - - - - - - - - explanation: No custom elements are allowed. - - - - - - - - - - - - - - - - - - - - - - explanation: No custom elements are allowed. - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + This component schema defintion defines global schema data type declarations + for data elements defined in the LOMv1.0 base schema. This component XSD + defines the aggregation relationship among the LOM data elements. These aggregation + relationships enforce the LOMv1.0 base schema requirement that elements can only + be present in a LOM XML instance as elements of the aggregate element to which they + belong. + + Duplicate declarations are included as comments for completeness. These declarations + should remain commented out or they can be removed completely. + + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + + + + + + + + + + + explanation: metaMetadata is unused. + + + + + + + + explanation: lom.annotation is unused. + + + + + explanation: No custom elements are allowed. + + + + + + + + + + + + + + + + + explanation: General.structure is unused. + + + + explanation: General.aggregationLevel is unused. + + + + explanation: No custom elements are allowed. + + + + + + + + + + + + + explanation: No custom elements are allowed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + explanation: liveCycle.version is unused. + + + + explanation: lifeCycle.status is unused. + + + + + explanation: No custom elements are allowed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + explanation: No custom elements are allowed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + explanation: technical.size is unused. + + + + explanation: technical.location is unused. + + + + explanation: technical.requirement is unused. + + + + explanation: technical.installationRemarks is unused. + + + + explanation: technical.otherPlatformRequirements is unused. + + + + explanation: technical.duration is unused. + + + + explanation: No custom elements are allowed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + explanation: interactivityType is unused. + + + + + explanation: interactivityLevel is unused. + + + + explanation: semanticDensity is unused. + + + + explanation: intendedEndUserRole is unused. + + + + explanation: Context is unused. + + + + explanation: typicalAgeRange is unused. + + + + explanation: difficulty is unused. + + + + explanation: typicalLearningTime is unused. + + + + explanation: description is unused in educational context. + + + + explanation: language unused in technical context, only in general context. + + + + explanation: No custom elements are allowed. + + + + + + + + + + + + + + + + + + + + + explanation: No custom elements are allowed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + explanation: No custom elements are allowed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + explanation: No custom elements are allowed. + + + + + + + + + + + + + + + + + + + + + explanation: No custom elements are allowed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + explanation: No custom elements are allowed. + + + + + + + + + + + + + + + + + + + + + explanation: No custom elements are allowed. + + + + + + + + + + + + + + + + + + + + + + explanation: No custom elements are allowed. + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backup/cc/schemas/domainProfile_1/extend/custom.xsd b/backup/cc/schemas/domainProfile_1/extend/custom.xsd index bba5a3f56af..3c4b43a9b1e 100755 --- a/backup/cc/schemas/domainProfile_1/extend/custom.xsd +++ b/backup/cc/schemas/domainProfile_1/extend/custom.xsd @@ -1,52 +1,52 @@ - - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - - This component schema defines the XML Schema content model groups customElements - and customAttributes to support validation of extension XML elements and attributes. - - This component XSD should be used if extensions are to be supported in LOM - XML instances. - - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - - - - - - - - - - - - - - - - - + + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + + This component schema defines the XML Schema content model groups customElements + and customAttributes to support validation of extension XML elements and attributes. + + This component XSD should be used if extensions are to be supported in LOM + XML instances. + + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/backup/cc/schemas/domainProfile_1/imscc_m_definition.xsd b/backup/cc/schemas/domainProfile_1/imscc_m_definition.xsd index 7c67154d5ea..a052c37efc1 100755 --- a/backup/cc/schemas/domainProfile_1/imscc_m_definition.xsd +++ b/backup/cc/schemas/domainProfile_1/imscc_m_definition.xsd @@ -1,14 +1,14 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/backup/cc/schemas/domainProfile_1/lomLoose.xsd b/backup/cc/schemas/domainProfile_1/lomLoose.xsd index ecb82c767b5..9cace7e3d57 100755 --- a/backup/cc/schemas/domainProfile_1/lomLoose.xsd +++ b/backup/cc/schemas/domainProfile_1/lomLoose.xsd @@ -1,71 +1,71 @@ - - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - This file represents a composite schema for validating - LOM XML Instances. This file is built by default to represent a - composite schema for validation of the following: - - 1) The use of LOMv1.0 base schema (i.e., 1484.12.1-2002) vocabulary - source/value pairs only - 2) Uniqueness constraints defined by LOMv1.0 base schema - 3) No existenace of any defined extensions: - LOMv1.0 base schema XML element extension, - LOMv1.0 base schema XML attribute extension and - LOMv1.0 base schema vocabulary data type extension - - Alternative composite schemas can be assembled by selecting - from the various alternative component schema listed below. - - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + This file represents a composite schema for validating + LOM XML Instances. This file is built by default to represent a + composite schema for validation of the following: + + 1) The use of LOMv1.0 base schema (i.e., 1484.12.1-2002) vocabulary + source/value pairs only + 2) Uniqueness constraints defined by LOMv1.0 base schema + 3) No existenace of any defined extensions: + LOMv1.0 base schema XML element extension, + LOMv1.0 base schema XML attribute extension and + LOMv1.0 base schema vocabulary data type extension + + Alternative composite schemas can be assembled by selecting + from the various alternative component schema listed below. + + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backup/cc/schemas/domainProfile_1/lomLoose_constraintsDocument.scmt b/backup/cc/schemas/domainProfile_1/lomLoose_constraintsDocument.scmt index d91614364da..0401d214904 100755 --- a/backup/cc/schemas/domainProfile_1/lomLoose_constraintsDocument.scmt +++ b/backup/cc/schemas/domainProfile_1/lomLoose_constraintsDocument.scmt @@ -1,68 +1,68 @@ - - - - - - - - - - - - - - - - - Assertion failed for pattern_1. An Item object which represents a folder is indicated by the absence of an IdentifierRef characteristic object. Folder Items support unlimited nesting of other folder Items and learning object link Items. Learning Application Resource Item objects may be nested by folder Item object but may not nest other folder or Learning Application resource Item objects.(#S04) - - - - - Assertion failed for pattern_2. A Resource object which is a Learning Object Web Content may contain Dependency objects which reference Resource objects with Type 'webcontent'.(#S03) - - - - - Assertion failed for pattern_3. If an item is invisible, its descendants must be invisible too.(#S02) - - - - - Assertion failed for pattern_4. A Resource object which is a Discussion Topic associated resource may contain Dependency objects which reference Resource objects with Type 'webcontent' or 'associatedcontent/imscc_xmlv1p0/learning-application-resource'.(#S12) - - - - - Assertion failed for pattern_5. - The test was: . - The context was: ims:resources/ims:resource/ims:dependency | ims:manifest/ims:resources/ims:resource/ims:dependency - - - - - Assertion failed for pattern_6. A Resource object which is an assessment may contain Dependency objects which reference Resource objects with Type 'webcontent' or 'associatedcontent/imscc_xmlv1p0/learning-application-resource'.(#S14) - - - - - Assertion failed for pattern_7. If a cartridge web content or associated content resource is linked from a Learning Application Object link Item object it must have an Href characteristic object which represents the launchable resource.(#S05) - - - - - Assertion failed for pattern_8. For Discussion Topic Resources the Resource object must contain a single File object which references the Discussion Topic descriptor XML file which conforms to the http://www.imsglobal.org/xsd/imsdt_v1p0 schema. It must not have any href attribute.(#S06) - - - - - Assertion failed for pattern_9. For Web Link Resources the Resource object must contain a single File object which references the Web Link descriptor XML file which conforms to the http://www.imsglobal.org/xsd/imswl_v1p0 schema. It must contain neither Dependency objects nor an href attribute.(#S07) - - - - - Assertion failed for pattern_10. For Assessment or Question Bank Resources the Resource object must contain a single File object which references the QTI XML file. This file must conform to the IMS CC profile of QTI 1.2.1. The profile is contained in the package of this profile as imscc_q*.xdm. The derived schema of this QTI profile is in the package of this profile with the name ims_qtiasiv1p2_localised.xsd. The resource must not have an href attribute(#S11) - - - - + + + + + + + + + + + + + + + + + Assertion failed for pattern_1. An Item object which represents a folder is indicated by the absence of an IdentifierRef characteristic object. Folder Items support unlimited nesting of other folder Items and learning object link Items. Learning Application Resource Item objects may be nested by folder Item object but may not nest other folder or Learning Application resource Item objects.(#S04) + + + + + Assertion failed for pattern_2. A Resource object which is a Learning Object Web Content may contain Dependency objects which reference Resource objects with Type 'webcontent'.(#S03) + + + + + Assertion failed for pattern_3. If an item is invisible, its descendants must be invisible too.(#S02) + + + + + Assertion failed for pattern_4. A Resource object which is a Discussion Topic associated resource may contain Dependency objects which reference Resource objects with Type 'webcontent' or 'associatedcontent/imscc_xmlv1p0/learning-application-resource'.(#S12) + + + + + Assertion failed for pattern_5. + The test was: . + The context was: ims:resources/ims:resource/ims:dependency | ims:manifest/ims:resources/ims:resource/ims:dependency + + + + + Assertion failed for pattern_6. A Resource object which is an assessment may contain Dependency objects which reference Resource objects with Type 'webcontent' or 'associatedcontent/imscc_xmlv1p0/learning-application-resource'.(#S14) + + + + + Assertion failed for pattern_7. If a cartridge web content or associated content resource is linked from a Learning Application Object link Item object it must have an Href characteristic object which represents the launchable resource.(#S05) + + + + + Assertion failed for pattern_8. For Discussion Topic Resources the Resource object must contain a single File object which references the Discussion Topic descriptor XML file which conforms to the http://www.imsglobal.org/xsd/imsdt_v1p0 schema. It must not have any href attribute.(#S06) + + + + + Assertion failed for pattern_9. For Web Link Resources the Resource object must contain a single File object which references the Web Link descriptor XML file which conforms to the http://www.imsglobal.org/xsd/imswl_v1p0 schema. It must contain neither Dependency objects nor an href attribute.(#S07) + + + + + Assertion failed for pattern_10. For Assessment or Question Bank Resources the Resource object must contain a single File object which references the QTI XML file. This file must conform to the IMS CC profile of QTI 1.2.1. The profile is contained in the package of this profile as imscc_q*.xdm. The derived schema of this QTI profile is in the package of this profile with the name ims_qtiasiv1p2_localised.xsd. The resource must not have an href attribute(#S11) + + + + diff --git a/backup/cc/schemas/domainProfile_1/lomLoose_localised.xsd b/backup/cc/schemas/domainProfile_1/lomLoose_localised.xsd index db2aece2f57..7435f4262ee 100755 --- a/backup/cc/schemas/domainProfile_1/lomLoose_localised.xsd +++ b/backup/cc/schemas/domainProfile_1/lomLoose_localised.xsd @@ -1,96 +1,96 @@ - - - - - - - - - - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - This file represents a composite schema for validating - LOM XML Instances. This file is built by default to represent a - composite schema for validation of the following: - - 1) The use of LOMv1.0 base schema (i.e., 1484.12.1-2002) vocabulary - source/value pairs only - 2) Uniqueness constraints defined by LOMv1.0 base schema - 3) No existenace of any defined extensions: - LOMv1.0 base schema XML element extension, - LOMv1.0 base schema XML attribute extension and - LOMv1.0 base schema vocabulary data type extension - - Alternative composite schemas can be assembled by selecting - from the various alternative component schema listed below. - - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - conformance: This profile restricts 'IEEE LOM 1.0 loose' to the elements needed to cover unqualified Dublin Core. -dc:contributor, dc:creator, dc:publisher map to lifeCycle.contribute.entity with appropriate value of lifeCycle.contribute.role, -dc:coverage maps to general.coverage, -dc:date maps to lifeCycle.contribute.date, -dc:description maps to general.description, -dc:format maps to technical.format, -dc:identifier maps to general.identifier, -dc:language maps to general.language, -dc:relation maps to Relation, -dc:rights maps to Rights, -dc:source is not mapped, -dc:subject maps to general.keyword (see also classification.keyword), -dc:title maps to general.title -dc:type maps to Educational.learningResourceType - - scope: This profile is used within the Common Cartridge specification. - name: IMS Common Cartridge profile of IEEE LOM V1.0 loose for unqualified Dublin Core - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + This file represents a composite schema for validating + LOM XML Instances. This file is built by default to represent a + composite schema for validation of the following: + + 1) The use of LOMv1.0 base schema (i.e., 1484.12.1-2002) vocabulary + source/value pairs only + 2) Uniqueness constraints defined by LOMv1.0 base schema + 3) No existenace of any defined extensions: + LOMv1.0 base schema XML element extension, + LOMv1.0 base schema XML attribute extension and + LOMv1.0 base schema vocabulary data type extension + + Alternative composite schemas can be assembled by selecting + from the various alternative component schema listed below. + + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + conformance: This profile restricts 'IEEE LOM 1.0 loose' to the elements needed to cover unqualified Dublin Core. +dc:contributor, dc:creator, dc:publisher map to lifeCycle.contribute.entity with appropriate value of lifeCycle.contribute.role, +dc:coverage maps to general.coverage, +dc:date maps to lifeCycle.contribute.date, +dc:description maps to general.description, +dc:format maps to technical.format, +dc:identifier maps to general.identifier, +dc:language maps to general.language, +dc:relation maps to Relation, +dc:rights maps to Rights, +dc:source is not mapped, +dc:subject maps to general.keyword (see also classification.keyword), +dc:title maps to general.title +dc:type maps to Educational.learningResourceType + + scope: This profile is used within the Common Cartridge specification. + name: IMS Common Cartridge profile of IEEE LOM V1.0 loose for unqualified Dublin Core + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backup/cc/schemas/domainProfile_1/loose.xsd b/backup/cc/schemas/domainProfile_1/loose.xsd index bc6a0474e5e..6bbabf38cbf 100755 --- a/backup/cc/schemas/domainProfile_1/loose.xsd +++ b/backup/cc/schemas/domainProfile_1/loose.xsd @@ -1,292 +1,292 @@ - - - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - - This component schema definition provides attribute group declarations for - LOM data elements to support schema-based validation of uniqueness constraints - within a LOM XML instance where the exact set of attributes associated with each - element has to be as specified by the LOM XML Schema binding (i.e., where extra - attributes to enforce uniqueness have to be avoided). - - Duplicate declarations are included as comments for completeness. These - declarations should remain commented out or they can be removed completely. - - NOTE: The absence of the enforcement of the uniqueness constraints does not - relieve a particular LOM XML instance from satisfying the uniqueness constraints - described in the LOMv1.0 base schema. Applications that require the use of - the unique/loose.xsd component XSD have to enforce those uniqueness constraints - by other means. - - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + + This component schema definition provides attribute group declarations for + LOM data elements to support schema-based validation of uniqueness constraints + within a LOM XML instance where the exact set of attributes associated with each + element has to be as specified by the LOM XML Schema binding (i.e., where extra + attributes to enforce uniqueness have to be avoided). + + Duplicate declarations are included as comments for completeness. These + declarations should remain commented out or they can be removed completely. + + NOTE: The absence of the enforcement of the uniqueness constraints does not + relieve a particular LOM XML instance from satisfying the uniqueness constraints + described in the LOMv1.0 base schema. Applications that require the use of + the unique/loose.xsd component XSD have to enforce those uniqueness constraints + by other means. + + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backup/cc/schemas/domainProfile_1/rootElement_localised.xsd b/backup/cc/schemas/domainProfile_1/rootElement_localised.xsd index dfddcb23492..7e6973b6de3 100755 --- a/backup/cc/schemas/domainProfile_1/rootElement_localised.xsd +++ b/backup/cc/schemas/domainProfile_1/rootElement_localised.xsd @@ -1,47 +1,47 @@ - - - - - - - - - - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - - This component schema defintion provides the element name declaration for the - root element for all LOM XML instances. - - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - - - - - - - - - - - - - + + + + + + + + + + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + + This component schema defintion provides the element name declaration for the + root element for all LOM XML instances. + + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + + + + + + + + + + + + + diff --git a/backup/cc/schemas/domainProfile_1/unique/loose.xsd b/backup/cc/schemas/domainProfile_1/unique/loose.xsd index 8047676bdcf..cd0d72c339e 100755 --- a/backup/cc/schemas/domainProfile_1/unique/loose.xsd +++ b/backup/cc/schemas/domainProfile_1/unique/loose.xsd @@ -1,295 +1,295 @@ - - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - - This component schema definition provides attribute group declarations for - LOM data elements to support schema-based validation of uniqueness constraints - within a LOM XML instance where the exact set of attributes associated with each - element has to be as specified by the LOM XML Schema binding (i.e., where extra - attributes to enforce uniqueness have to be avoided). - - Duplicate declarations are included as comments for completeness. These - declarations should remain commented out or they can be removed completely. - - NOTE: The absence of the enforcement of the uniqueness constraints does not - relieve a particular LOM XML instance from satisfying the uniqueness constraints - described in the LOMv1.0 base schema. Applications that require the use of - the unique/loose.xsd component XSD have to enforce those uniqueness constraints - by other means. - - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + + This component schema definition provides attribute group declarations for + LOM data elements to support schema-based validation of uniqueness constraints + within a LOM XML instance where the exact set of attributes associated with each + element has to be as specified by the LOM XML Schema binding (i.e., where extra + attributes to enforce uniqueness have to be avoided). + + Duplicate declarations are included as comments for completeness. These + declarations should remain commented out or they can be removed completely. + + NOTE: The absence of the enforcement of the uniqueness constraints does not + relieve a particular LOM XML instance from satisfying the uniqueness constraints + described in the LOMv1.0 base schema. Applications that require the use of + the unique/loose.xsd component XSD have to enforce those uniqueness constraints + by other means. + + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/backup/cc/schemas/domainProfile_1/vocab/loose.xsd b/backup/cc/schemas/domainProfile_1/vocab/loose.xsd index c25d38fabc8..34e851d51ee 100755 --- a/backup/cc/schemas/domainProfile_1/vocab/loose.xsd +++ b/backup/cc/schemas/domainProfile_1/vocab/loose.xsd @@ -1,147 +1,147 @@ - - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - - This component schema definition provides simple type declarations for LOM - data elements that are defined as Vocabulary data types. - - This component schema definition enforces that vocabulary sources and values - are character strings, which simplifies the schema validation process for those - applications that perform vocabulary source/value validation using - post-schema-validation. - - This component schema definition relaxes the validation constraints by - allowing both sources and values to be arbitrary character strings. - - NOTE: The absence of the enforcement of vocabulary values does not relieve a - particular LOM XML instance from satisfying vocabulary requirements defined - in the LOMv1.0 base schema. Applications that require the use of vocab/loose.xsd - component XSD should enforce those vocabulary requirements by other means. - - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + + This component schema definition provides simple type declarations for LOM + data elements that are defined as Vocabulary data types. + + This component schema definition enforces that vocabulary sources and values + are character strings, which simplifies the schema validation process for those + applications that perform vocabulary source/value validation using + post-schema-validation. + + This component schema definition relaxes the validation constraints by + allowing both sources and values to be arbitrary character strings. + + NOTE: The absence of the enforcement of vocabulary values does not relieve a + particular LOM XML instance from satisfying vocabulary requirements defined + in the LOMv1.0 base schema. Applications that require the use of vocab/loose.xsd + component XSD should enforce those vocabulary requirements by other means. + + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/backup/cc/schemas/domainProfile_1/vocabTypes_localised.xsd b/backup/cc/schemas/domainProfile_1/vocabTypes_localised.xsd index 57ad0a1cf0e..6e81eafd34d 100755 --- a/backup/cc/schemas/domainProfile_1/vocabTypes_localised.xsd +++ b/backup/cc/schemas/domainProfile_1/vocabTypes_localised.xsd @@ -1,379 +1,379 @@ - - - - - - - - - - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - This component schema defintion provides global type declarations for those - LOM data elements whose values are taken from a Vocabulary data type. - - - - This component XSD requires schema components from other - schemas that are defined in other namespaces. These statements import the - appropriate components. The xsi:schemaLocation attribute is used to specify - the location of the file that contains the schema that defines the namespace. - The xsi:schemaLocation attribute is optional and is ommitted. By definition of - the composite schemas the appropriate namespaces and related files where those - namespaces are defined are brought into scope. Some XML parsers may require - these import statements to contain the optional xsi:schemaLocation attribute. - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - explanation: learningResourceType must be 'IMS Common Cartridge' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - explanation: No custom elements are allowed. - - - - - - - - - - - - - - - - - - - - explanation: No custom elements are allowed. - - - - - - - - - - - - - - - - - - - - explanation: No custom elements are allowed. - - - - - - - - - - - - - - - - - - - - explanation: No custom elements are allowed. - - - - - - - - - - - - - - + + + + + + + + + + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + This component schema defintion provides global type declarations for those + LOM data elements whose values are taken from a Vocabulary data type. + + + + This component XSD requires schema components from other + schemas that are defined in other namespaces. These statements import the + appropriate components. The xsi:schemaLocation attribute is used to specify + the location of the file that contains the schema that defines the namespace. + The xsi:schemaLocation attribute is optional and is ommitted. By definition of + the composite schemas the appropriate namespaces and related files where those + namespaces are defined are brought into scope. Some XML parsers may require + these import statements to contain the optional xsi:schemaLocation attribute. + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + explanation: learningResourceType must be 'IMS Common Cartridge' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + explanation: No custom elements are allowed. + + + + + + + + + + + + + + + + + + + + explanation: No custom elements are allowed. + + + + + + + + + + + + + + + + + + + + explanation: No custom elements are allowed. + + + + + + + + + + + + + + + + + + + + explanation: No custom elements are allowed. + + + + + + + + + + + + + + diff --git a/backup/cc/schemas/domainProfile_1/vocabValues_localised.xsd b/backup/cc/schemas/domainProfile_1/vocabValues_localised.xsd index 81429041b11..7163412509a 100755 --- a/backup/cc/schemas/domainProfile_1/vocabValues_localised.xsd +++ b/backup/cc/schemas/domainProfile_1/vocabValues_localised.xsd @@ -1,270 +1,270 @@ - - - - - - - - - - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - - This component schema definition provides global type declarations for the standard - LOMv1.0 vocabulary tokens for those LOM data elements whose values are taken from - a Vocabulary data type. - - This component schema defintion defines the stanard vocabulary value - declarations as defined in the LOMv1.0 base schema. These vocabulary - value declarations are used in conjunction with both vocab/custom.xsd and - vocab/loose.xsd. - - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + + This component schema definition provides global type declarations for the standard + LOMv1.0 vocabulary tokens for those LOM data elements whose values are taken from + a Vocabulary data type. + + This component schema defintion defines the stanard vocabulary value + declarations as defined in the LOMv1.0 base schema. These vocabulary + value declarations are used in conjunction with both vocab/custom.xsd and + vocab/loose.xsd. + + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backup/cc/schemas/domainProfile_2/anyElement.xsd b/backup/cc/schemas/domainProfile_2/anyElement.xsd index de01fb98b46..e6cbe62d798 100755 --- a/backup/cc/schemas/domainProfile_2/anyElement.xsd +++ b/backup/cc/schemas/domainProfile_2/anyElement.xsd @@ -1,36 +1,36 @@ - - - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - - This component schema definition provides the element group declaration and the - attribute group declaration used for extension XML elements and attributes. - - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - - - - - - - - - + + + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + + This component schema definition provides the element group declaration and the + attribute group declaration used for extension XML elements and attributes. + + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + + + + + + + + + diff --git a/backup/cc/schemas/domainProfile_2/anyElement_localised.xsd b/backup/cc/schemas/domainProfile_2/anyElement_localised.xsd index df66c7f3697..02db24d71d2 100755 --- a/backup/cc/schemas/domainProfile_2/anyElement_localised.xsd +++ b/backup/cc/schemas/domainProfile_2/anyElement_localised.xsd @@ -1,44 +1,44 @@ - - - - - - - - - - - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - - This component schema definition provides the element group declaration and the - attribute group declaration used for extension XML elements and attributes. - - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - - - - - - - - - + + + + + + + + + + + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + + This component schema definition provides the element group declaration and the + attribute group declaration used for extension XML elements and attributes. + + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + + + + + + + + + diff --git a/backup/cc/schemas/domainProfile_2/common/anyElement.xsd b/backup/cc/schemas/domainProfile_2/common/anyElement.xsd index 936f372cdf9..5fb41353e15 100755 --- a/backup/cc/schemas/domainProfile_2/common/anyElement.xsd +++ b/backup/cc/schemas/domainProfile_2/common/anyElement.xsd @@ -1,39 +1,39 @@ - - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - - This component schema definition provides the element group declaration and the - attribute group declaration used for extension XML elements and attributes. - - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - - - - - - - - + + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + + This component schema definition provides the element group declaration and the + attribute group declaration used for extension XML elements and attributes. + + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + + + + + + + + \ No newline at end of file diff --git a/backup/cc/schemas/domainProfile_2/common/dataTypes.xsd b/backup/cc/schemas/domainProfile_2/common/dataTypes.xsd index fbd3e102e60..801ac7b31c5 100755 --- a/backup/cc/schemas/domainProfile_2/common/dataTypes.xsd +++ b/backup/cc/schemas/domainProfile_2/common/dataTypes.xsd @@ -1,118 +1,118 @@ - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - This component schema defintion defines global schema data type declarations - for data types defined in the LOMv1.0 base schema. - - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + This component schema defintion defines global schema data type declarations + for data types defined in the LOMv1.0 base schema. + + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/backup/cc/schemas/domainProfile_2/common/elementNames.xsd b/backup/cc/schemas/domainProfile_2/common/elementNames.xsd index bc20ce06016..a9ef502f9d4 100755 --- a/backup/cc/schemas/domainProfile_2/common/elementNames.xsd +++ b/backup/cc/schemas/domainProfile_2/common/elementNames.xsd @@ -1,783 +1,783 @@ - - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - - This component schema defintion defines global element declarations for - each of the data elements defined in the LOMv1.0 base schema. This component - schema definition is used to check for the uniqueness of elements declared - to be unique within their parent elements by the presence of the - "uniqueElementName" attribute. The XML Schema constraint "unique" is used - to enforce uniqueness constraints. - - Duplicate declarations are included as comments for completeness. These - declarations should remain commented out or they can be removed completely. - - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + + This component schema defintion defines global element declarations for + each of the data elements defined in the LOMv1.0 base schema. This component + schema definition is used to check for the uniqueness of elements declared + to be unique within their parent elements by the presence of the + "uniqueElementName" attribute. The XML Schema constraint "unique" is used + to enforce uniqueness constraints. + + Duplicate declarations are included as comments for completeness. These + declarations should remain commented out or they can be removed completely. + + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/backup/cc/schemas/domainProfile_2/common/elementTypes.xsd b/backup/cc/schemas/domainProfile_2/common/elementTypes.xsd index b7731c157e3..d43326be361 100755 --- a/backup/cc/schemas/domainProfile_2/common/elementTypes.xsd +++ b/backup/cc/schemas/domainProfile_2/common/elementTypes.xsd @@ -1,779 +1,779 @@ - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - This component schema defintion defines global schema data type declarations - for data elements defined in the LOMv1.0 base schema. This component XSD - defines the aggregation relationship among the LOM data elements. These aggregation - relationships enforce the LOMv1.0 base schema requirement that elements can only - be present in a LOM XML instance as elements of the aggregate element to which they - belong. - - Duplicate declarations are included as comments for completeness. These declarations - should remain commented out or they can be removed completely. - - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + This component schema defintion defines global schema data type declarations + for data elements defined in the LOMv1.0 base schema. This component XSD + defines the aggregation relationship among the LOM data elements. These aggregation + relationships enforce the LOMv1.0 base schema requirement that elements can only + be present in a LOM XML instance as elements of the aggregate element to which they + belong. + + Duplicate declarations are included as comments for completeness. These declarations + should remain commented out or they can be removed completely. + + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/backup/cc/schemas/domainProfile_2/common/rootElement.xsd b/backup/cc/schemas/domainProfile_2/common/rootElement.xsd index 70bd42a3e23..eb241b4c77a 100755 --- a/backup/cc/schemas/domainProfile_2/common/rootElement.xsd +++ b/backup/cc/schemas/domainProfile_2/common/rootElement.xsd @@ -1,43 +1,43 @@ - - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - - This component schema defintion provides the element name declaration for the - root element for all LOM XML instances. - - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - - - - - - - - - - - - + + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + + This component schema defintion provides the element name declaration for the + root element for all LOM XML instances. + + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + + + + + + + + + + + + \ No newline at end of file diff --git a/backup/cc/schemas/domainProfile_2/common/vocabTypes.xsd b/backup/cc/schemas/domainProfile_2/common/vocabTypes.xsd index 55d428760d5..cf1f8513ede 100755 --- a/backup/cc/schemas/domainProfile_2/common/vocabTypes.xsd +++ b/backup/cc/schemas/domainProfile_2/common/vocabTypes.xsd @@ -1,355 +1,355 @@ - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - This component schema defintion provides global type declarations for those - LOM data elements whose values are taken from a Vocabulary data type. - - - - This component XSD requires schema components from other - schemas that are defined in other namespaces. These statements import the - appropriate components. The xsi:schemaLocation attribute is used to specify - the location of the file that contains the schema that defines the namespace. - The xsi:schemaLocation attribute is optional and is ommitted. By definition of - the composite schemas the appropriate namespaces and related files where those - namespaces are defined are brought into scope. Some XML parsers may require - these import statements to contain the optional xsi:schemaLocation attribute. - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + This component schema defintion provides global type declarations for those + LOM data elements whose values are taken from a Vocabulary data type. + + + + This component XSD requires schema components from other + schemas that are defined in other namespaces. These statements import the + appropriate components. The xsi:schemaLocation attribute is used to specify + the location of the file that contains the schema that defines the namespace. + The xsi:schemaLocation attribute is optional and is ommitted. By definition of + the composite schemas the appropriate namespaces and related files where those + namespaces are defined are brought into scope. Some XML parsers may require + these import statements to contain the optional xsi:schemaLocation attribute. + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/backup/cc/schemas/domainProfile_2/common/vocabValues.xsd b/backup/cc/schemas/domainProfile_2/common/vocabValues.xsd index f31f18ec5de..25e1e45fe6c 100755 --- a/backup/cc/schemas/domainProfile_2/common/vocabValues.xsd +++ b/backup/cc/schemas/domainProfile_2/common/vocabValues.xsd @@ -1,266 +1,266 @@ - - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - - This component schema definition provides global type declarations for the standard - LOMv1.0 vocabulary tokens for those LOM data elements whose values are taken from - a Vocabulary data type. - - This component schema defintion defines the stanard vocabulary value - declarations as defined in the LOMv1.0 base schema. These vocabulary - value declarations are used in conjunction with both vocab/custom.xsd and - vocab/loose.xsd. - - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + + This component schema definition provides global type declarations for the standard + LOMv1.0 vocabulary tokens for those LOM data elements whose values are taken from + a Vocabulary data type. + + This component schema defintion defines the stanard vocabulary value + declarations as defined in the LOMv1.0 base schema. These vocabulary + value declarations are used in conjunction with both vocab/custom.xsd and + vocab/loose.xsd. + + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/backup/cc/schemas/domainProfile_2/dataTypes_localised.xsd b/backup/cc/schemas/domainProfile_2/dataTypes_localised.xsd index 35ea0338882..c70734a54de 100755 --- a/backup/cc/schemas/domainProfile_2/dataTypes_localised.xsd +++ b/backup/cc/schemas/domainProfile_2/dataTypes_localised.xsd @@ -1,127 +1,127 @@ - - - - - - - - - - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - This component schema defintion defines global schema data type declarations - for data types defined in the LOMv1.0 base schema. - - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + This component schema defintion defines global schema data type declarations + for data types defined in the LOMv1.0 base schema. + + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backup/cc/schemas/domainProfile_2/elementNames_localised.xsd b/backup/cc/schemas/domainProfile_2/elementNames_localised.xsd index dd1b9ee7d08..42bf318a0dc 100755 --- a/backup/cc/schemas/domainProfile_2/elementNames_localised.xsd +++ b/backup/cc/schemas/domainProfile_2/elementNames_localised.xsd @@ -1,787 +1,787 @@ - - - - - - - - - - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - - This component schema defintion defines global element declarations for - each of the data elements defined in the LOMv1.0 base schema. This component - schema definition is used to check for the uniqueness of elements declared - to be unique within their parent elements by the presence of the - "uniqueElementName" attribute. The XML Schema constraint "unique" is used - to enforce uniqueness constraints. - - Duplicate declarations are included as comments for completeness. These - declarations should remain commented out or they can be removed completely. - - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + + This component schema defintion defines global element declarations for + each of the data elements defined in the LOMv1.0 base schema. This component + schema definition is used to check for the uniqueness of elements declared + to be unique within their parent elements by the presence of the + "uniqueElementName" attribute. The XML Schema constraint "unique" is used + to enforce uniqueness constraints. + + Duplicate declarations are included as comments for completeness. These + declarations should remain commented out or they can be removed completely. + + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backup/cc/schemas/domainProfile_2/elementTypes_localised.xsd b/backup/cc/schemas/domainProfile_2/elementTypes_localised.xsd index 9b9f77b6283..4a4b6b7217a 100755 --- a/backup/cc/schemas/domainProfile_2/elementTypes_localised.xsd +++ b/backup/cc/schemas/domainProfile_2/elementTypes_localised.xsd @@ -1,806 +1,806 @@ - - - - - - - - - - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - This component schema defintion defines global schema data type declarations - for data elements defined in the LOMv1.0 base schema. This component XSD - defines the aggregation relationship among the LOM data elements. These aggregation - relationships enforce the LOMv1.0 base schema requirement that elements can only - be present in a LOM XML instance as elements of the aggregate element to which they - belong. - - Duplicate declarations are included as comments for completeness. These declarations - should remain commented out or they can be removed completely. - - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + This component schema defintion defines global schema data type declarations + for data elements defined in the LOMv1.0 base schema. This component XSD + defines the aggregation relationship among the LOM data elements. These aggregation + relationships enforce the LOMv1.0 base schema requirement that elements can only + be present in a LOM XML instance as elements of the aggregate element to which they + belong. + + Duplicate declarations are included as comments for completeness. These declarations + should remain commented out or they can be removed completely. + + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backup/cc/schemas/domainProfile_2/extend/custom.xsd b/backup/cc/schemas/domainProfile_2/extend/custom.xsd index 611012e8eb4..18f1e68978a 100755 --- a/backup/cc/schemas/domainProfile_2/extend/custom.xsd +++ b/backup/cc/schemas/domainProfile_2/extend/custom.xsd @@ -1,52 +1,52 @@ - - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - - This component schema defines the XML Schema content model groups customElements - and customAttributes to support validation of extension XML elements and attributes. - - This component XSD should be used if extensions are to be supported in LOM - XML instances. - - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - - - - - - - - - - - - - - - - - + + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + + This component schema defines the XML Schema content model groups customElements + and customAttributes to support validation of extension XML elements and attributes. + + This component XSD should be used if extensions are to be supported in LOM + XML instances. + + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/backup/cc/schemas/domainProfile_2/imscc_mR_definition.xsd b/backup/cc/schemas/domainProfile_2/imscc_mR_definition.xsd index 9b82a7b5dca..627d41b868a 100755 --- a/backup/cc/schemas/domainProfile_2/imscc_mR_definition.xsd +++ b/backup/cc/schemas/domainProfile_2/imscc_mR_definition.xsd @@ -1,34 +1,34 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backup/cc/schemas/domainProfile_2/lomLoose.xsd b/backup/cc/schemas/domainProfile_2/lomLoose.xsd index 791eb7cf64a..18bcb19750f 100755 --- a/backup/cc/schemas/domainProfile_2/lomLoose.xsd +++ b/backup/cc/schemas/domainProfile_2/lomLoose.xsd @@ -1,71 +1,71 @@ - - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - This file represents a composite schema for validating - LOM XML Instances. This file is built by default to represent a - composite schema for validation of the following: - - 1) The use of LOMv1.0 base schema (i.e., 1484.12.1-2002) vocabulary - source/value pairs only - 2) Uniqueness constraints defined by LOMv1.0 base schema - 3) No existenace of any defined extensions: - LOMv1.0 base schema XML element extension, - LOMv1.0 base schema XML attribute extension and - LOMv1.0 base schema vocabulary data type extension - - Alternative composite schemas can be assembled by selecting - from the various alternative component schema listed below. - - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - - - - - - + + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + This file represents a composite schema for validating + LOM XML Instances. This file is built by default to represent a + composite schema for validation of the following: + + 1) The use of LOMv1.0 base schema (i.e., 1484.12.1-2002) vocabulary + source/value pairs only + 2) Uniqueness constraints defined by LOMv1.0 base schema + 3) No existenace of any defined extensions: + LOMv1.0 base schema XML element extension, + LOMv1.0 base schema XML attribute extension and + LOMv1.0 base schema vocabulary data type extension + + Alternative composite schemas can be assembled by selecting + from the various alternative component schema listed below. + + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + + + + + + - - - - - - + schemaLocation="unique/loose.xsd"/> --> + + + + + + - - + schemaLocation="vocab/loose.xsd"/> --> + + - - - - - + schemaLocation="vocab/custom.xsd"/> --> + + + + + - - - - - - - + schemaLocation="extend/custom.xsd"/> --> + + + + + + + diff --git a/backup/cc/schemas/domainProfile_2/lomLoose_constraintsDocument.scmt b/backup/cc/schemas/domainProfile_2/lomLoose_constraintsDocument.scmt index d91614364da..0401d214904 100755 --- a/backup/cc/schemas/domainProfile_2/lomLoose_constraintsDocument.scmt +++ b/backup/cc/schemas/domainProfile_2/lomLoose_constraintsDocument.scmt @@ -1,68 +1,68 @@ - - - - - - - - - - - - - - - - - Assertion failed for pattern_1. An Item object which represents a folder is indicated by the absence of an IdentifierRef characteristic object. Folder Items support unlimited nesting of other folder Items and learning object link Items. Learning Application Resource Item objects may be nested by folder Item object but may not nest other folder or Learning Application resource Item objects.(#S04) - - - - - Assertion failed for pattern_2. A Resource object which is a Learning Object Web Content may contain Dependency objects which reference Resource objects with Type 'webcontent'.(#S03) - - - - - Assertion failed for pattern_3. If an item is invisible, its descendants must be invisible too.(#S02) - - - - - Assertion failed for pattern_4. A Resource object which is a Discussion Topic associated resource may contain Dependency objects which reference Resource objects with Type 'webcontent' or 'associatedcontent/imscc_xmlv1p0/learning-application-resource'.(#S12) - - - - - Assertion failed for pattern_5. - The test was: . - The context was: ims:resources/ims:resource/ims:dependency | ims:manifest/ims:resources/ims:resource/ims:dependency - - - - - Assertion failed for pattern_6. A Resource object which is an assessment may contain Dependency objects which reference Resource objects with Type 'webcontent' or 'associatedcontent/imscc_xmlv1p0/learning-application-resource'.(#S14) - - - - - Assertion failed for pattern_7. If a cartridge web content or associated content resource is linked from a Learning Application Object link Item object it must have an Href characteristic object which represents the launchable resource.(#S05) - - - - - Assertion failed for pattern_8. For Discussion Topic Resources the Resource object must contain a single File object which references the Discussion Topic descriptor XML file which conforms to the http://www.imsglobal.org/xsd/imsdt_v1p0 schema. It must not have any href attribute.(#S06) - - - - - Assertion failed for pattern_9. For Web Link Resources the Resource object must contain a single File object which references the Web Link descriptor XML file which conforms to the http://www.imsglobal.org/xsd/imswl_v1p0 schema. It must contain neither Dependency objects nor an href attribute.(#S07) - - - - - Assertion failed for pattern_10. For Assessment or Question Bank Resources the Resource object must contain a single File object which references the QTI XML file. This file must conform to the IMS CC profile of QTI 1.2.1. The profile is contained in the package of this profile as imscc_q*.xdm. The derived schema of this QTI profile is in the package of this profile with the name ims_qtiasiv1p2_localised.xsd. The resource must not have an href attribute(#S11) - - - - + + + + + + + + + + + + + + + + + Assertion failed for pattern_1. An Item object which represents a folder is indicated by the absence of an IdentifierRef characteristic object. Folder Items support unlimited nesting of other folder Items and learning object link Items. Learning Application Resource Item objects may be nested by folder Item object but may not nest other folder or Learning Application resource Item objects.(#S04) + + + + + Assertion failed for pattern_2. A Resource object which is a Learning Object Web Content may contain Dependency objects which reference Resource objects with Type 'webcontent'.(#S03) + + + + + Assertion failed for pattern_3. If an item is invisible, its descendants must be invisible too.(#S02) + + + + + Assertion failed for pattern_4. A Resource object which is a Discussion Topic associated resource may contain Dependency objects which reference Resource objects with Type 'webcontent' or 'associatedcontent/imscc_xmlv1p0/learning-application-resource'.(#S12) + + + + + Assertion failed for pattern_5. + The test was: . + The context was: ims:resources/ims:resource/ims:dependency | ims:manifest/ims:resources/ims:resource/ims:dependency + + + + + Assertion failed for pattern_6. A Resource object which is an assessment may contain Dependency objects which reference Resource objects with Type 'webcontent' or 'associatedcontent/imscc_xmlv1p0/learning-application-resource'.(#S14) + + + + + Assertion failed for pattern_7. If a cartridge web content or associated content resource is linked from a Learning Application Object link Item object it must have an Href characteristic object which represents the launchable resource.(#S05) + + + + + Assertion failed for pattern_8. For Discussion Topic Resources the Resource object must contain a single File object which references the Discussion Topic descriptor XML file which conforms to the http://www.imsglobal.org/xsd/imsdt_v1p0 schema. It must not have any href attribute.(#S06) + + + + + Assertion failed for pattern_9. For Web Link Resources the Resource object must contain a single File object which references the Web Link descriptor XML file which conforms to the http://www.imsglobal.org/xsd/imswl_v1p0 schema. It must contain neither Dependency objects nor an href attribute.(#S07) + + + + + Assertion failed for pattern_10. For Assessment or Question Bank Resources the Resource object must contain a single File object which references the QTI XML file. This file must conform to the IMS CC profile of QTI 1.2.1. The profile is contained in the package of this profile as imscc_q*.xdm. The derived schema of this QTI profile is in the package of this profile with the name ims_qtiasiv1p2_localised.xsd. The resource must not have an href attribute(#S11) + + + + diff --git a/backup/cc/schemas/domainProfile_2/lomLoose_localised.xsd b/backup/cc/schemas/domainProfile_2/lomLoose_localised.xsd index 81ea05a9e89..cf37cc6b9f8 100755 --- a/backup/cc/schemas/domainProfile_2/lomLoose_localised.xsd +++ b/backup/cc/schemas/domainProfile_2/lomLoose_localised.xsd @@ -1,79 +1,79 @@ - - - - - - - - - - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - This file represents a composite schema for validating - LOM XML Instances. This file is built by default to represent a - composite schema for validation of the following: - - 1) The use of LOMv1.0 base schema (i.e., 1484.12.1-2002) vocabulary - source/value pairs only - 2) Uniqueness constraints defined by LOMv1.0 base schema - 3) No existenace of any defined extensions: - LOMv1.0 base schema XML element extension, - LOMv1.0 base schema XML attribute extension and - LOMv1.0 base schema vocabulary data type extension - - Alternative composite schemas can be assembled by selecting - from the various alternative component schema listed below. - - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + This file represents a composite schema for validating + LOM XML Instances. This file is built by default to represent a + composite schema for validation of the following: + + 1) The use of LOMv1.0 base schema (i.e., 1484.12.1-2002) vocabulary + source/value pairs only + 2) Uniqueness constraints defined by LOMv1.0 base schema + 3) No existenace of any defined extensions: + LOMv1.0 base schema XML element extension, + LOMv1.0 base schema XML attribute extension and + LOMv1.0 base schema vocabulary data type extension + + Alternative composite schemas can be assembled by selecting + from the various alternative component schema listed below. + + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backup/cc/schemas/domainProfile_2/loose.xsd b/backup/cc/schemas/domainProfile_2/loose.xsd index a41244a978b..151487082e7 100755 --- a/backup/cc/schemas/domainProfile_2/loose.xsd +++ b/backup/cc/schemas/domainProfile_2/loose.xsd @@ -1,292 +1,292 @@ - - - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - - This component schema definition provides attribute group declarations for - LOM data elements to support schema-based validation of uniqueness constraints - within a LOM XML instance where the exact set of attributes associated with each - element has to be as specified by the LOM XML Schema binding (i.e., where extra - attributes to enforce uniqueness have to be avoided). - - Duplicate declarations are included as comments for completeness. These - declarations should remain commented out or they can be removed completely. - - NOTE: The absence of the enforcement of the uniqueness constraints does not - relieve a particular LOM XML instance from satisfying the uniqueness constraints - described in the LOMv1.0 base schema. Applications that require the use of - the unique/loose.xsd component XSD have to enforce those uniqueness constraints - by other means. - - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + + This component schema definition provides attribute group declarations for + LOM data elements to support schema-based validation of uniqueness constraints + within a LOM XML instance where the exact set of attributes associated with each + element has to be as specified by the LOM XML Schema binding (i.e., where extra + attributes to enforce uniqueness have to be avoided). + + Duplicate declarations are included as comments for completeness. These + declarations should remain commented out or they can be removed completely. + + NOTE: The absence of the enforcement of the uniqueness constraints does not + relieve a particular LOM XML instance from satisfying the uniqueness constraints + described in the LOMv1.0 base schema. Applications that require the use of + the unique/loose.xsd component XSD have to enforce those uniqueness constraints + by other means. + + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + --> + - + --> + - + --> + - + --> + - + --> + - + --> + - - - - + --> + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + --> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + --> + - - - - - - - - - - + --> + + + + + + + + + + - - - - - - - - - - + --> + + + + + + + + + + - + --> + - + --> + - + --> + - - - - + --> + + + + - + --> + - + --> + - - - - - - - - - - + --> + + + + + + + + + + - - - - - - - + --> + + + + + + + - + --> + - + --> + - - + --> + + diff --git a/backup/cc/schemas/domainProfile_2/rootElement_localised.xsd b/backup/cc/schemas/domainProfile_2/rootElement_localised.xsd index 8101ec3e2bf..1ed102d45b9 100755 --- a/backup/cc/schemas/domainProfile_2/rootElement_localised.xsd +++ b/backup/cc/schemas/domainProfile_2/rootElement_localised.xsd @@ -1,47 +1,47 @@ - - - - - - - - - - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - - This component schema defintion provides the element name declaration for the - root element for all LOM XML instances. - - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - - - - - - - - - - - - - + + + + + + + + + + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + + This component schema defintion provides the element name declaration for the + root element for all LOM XML instances. + + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + + + + + + + + + + + + + diff --git a/backup/cc/schemas/domainProfile_2/unique/loose.xsd b/backup/cc/schemas/domainProfile_2/unique/loose.xsd index 0defa03986a..abcdf30186d 100755 --- a/backup/cc/schemas/domainProfile_2/unique/loose.xsd +++ b/backup/cc/schemas/domainProfile_2/unique/loose.xsd @@ -1,295 +1,295 @@ - - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - - This component schema definition provides attribute group declarations for - LOM data elements to support schema-based validation of uniqueness constraints - within a LOM XML instance where the exact set of attributes associated with each - element has to be as specified by the LOM XML Schema binding (i.e., where extra - attributes to enforce uniqueness have to be avoided). - - Duplicate declarations are included as comments for completeness. These - declarations should remain commented out or they can be removed completely. - - NOTE: The absence of the enforcement of the uniqueness constraints does not - relieve a particular LOM XML instance from satisfying the uniqueness constraints - described in the LOMv1.0 base schema. Applications that require the use of - the unique/loose.xsd component XSD have to enforce those uniqueness constraints - by other means. - - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + + This component schema definition provides attribute group declarations for + LOM data elements to support schema-based validation of uniqueness constraints + within a LOM XML instance where the exact set of attributes associated with each + element has to be as specified by the LOM XML Schema binding (i.e., where extra + attributes to enforce uniqueness have to be avoided). + + Duplicate declarations are included as comments for completeness. These + declarations should remain commented out or they can be removed completely. + + NOTE: The absence of the enforcement of the uniqueness constraints does not + relieve a particular LOM XML instance from satisfying the uniqueness constraints + described in the LOMv1.0 base schema. Applications that require the use of + the unique/loose.xsd component XSD have to enforce those uniqueness constraints + by other means. + + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/backup/cc/schemas/domainProfile_2/vocab/loose.xsd b/backup/cc/schemas/domainProfile_2/vocab/loose.xsd index b216d835c42..31eafe175e5 100755 --- a/backup/cc/schemas/domainProfile_2/vocab/loose.xsd +++ b/backup/cc/schemas/domainProfile_2/vocab/loose.xsd @@ -1,147 +1,147 @@ - - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - - This component schema definition provides simple type declarations for LOM - data elements that are defined as Vocabulary data types. - - This component schema definition enforces that vocabulary sources and values - are character strings, which simplifies the schema validation process for those - applications that perform vocabulary source/value validation using - post-schema-validation. - - This component schema definition relaxes the validation constraints by - allowing both sources and values to be arbitrary character strings. - - NOTE: The absence of the enforcement of vocabulary values does not relieve a - particular LOM XML instance from satisfying vocabulary requirements defined - in the LOMv1.0 base schema. Applications that require the use of vocab/loose.xsd - component XSD should enforce those vocabulary requirements by other means. - - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + + This component schema definition provides simple type declarations for LOM + data elements that are defined as Vocabulary data types. + + This component schema definition enforces that vocabulary sources and values + are character strings, which simplifies the schema validation process for those + applications that perform vocabulary source/value validation using + post-schema-validation. + + This component schema definition relaxes the validation constraints by + allowing both sources and values to be arbitrary character strings. + + NOTE: The absence of the enforcement of vocabulary values does not relieve a + particular LOM XML instance from satisfying vocabulary requirements defined + in the LOMv1.0 base schema. Applications that require the use of vocab/loose.xsd + component XSD should enforce those vocabulary requirements by other means. + + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/backup/cc/schemas/domainProfile_2/vocabTypes_localised.xsd b/backup/cc/schemas/domainProfile_2/vocabTypes_localised.xsd index c44208cc5eb..35da2e69aed 100755 --- a/backup/cc/schemas/domainProfile_2/vocabTypes_localised.xsd +++ b/backup/cc/schemas/domainProfile_2/vocabTypes_localised.xsd @@ -1,408 +1,408 @@ - - - - - - - - - - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - This component schema defintion provides global type declarations for those - LOM data elements whose values are taken from a Vocabulary data type. - - - - This component XSD requires schema components from other - schemas that are defined in other namespaces. These statements import the - appropriate components. The xsi:schemaLocation attribute is used to specify - the location of the file that contains the schema that defines the namespace. - The xsi:schemaLocation attribute is optional and is ommitted. By definition of - the composite schemas the appropriate namespaces and related files where those - namespaces are defined are brought into scope. Some XML parsers may require - these import statements to contain the optional xsi:schemaLocation attribute. - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - - - - - - - - - - - - - - - - - - explanation: The vocabulary for intendedEndUserRole is 'IMSGLC_CC_Rolesv1p0'. - - - - - - - - - - - explanation: The source for a context object is fixed to 'LOMv1.0' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - explanation: Possible intendedEndUserRoles are only 'Learner' and 'Instructor'. - - - - - - - - - - - - - - - - - - - - - - - - - - - - explanation: The value of context is fixed to 'higher education'. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + This component schema defintion provides global type declarations for those + LOM data elements whose values are taken from a Vocabulary data type. + + + + This component XSD requires schema components from other + schemas that are defined in other namespaces. These statements import the + appropriate components. The xsi:schemaLocation attribute is used to specify + the location of the file that contains the schema that defines the namespace. + The xsi:schemaLocation attribute is optional and is ommitted. By definition of + the composite schemas the appropriate namespaces and related files where those + namespaces are defined are brought into scope. Some XML parsers may require + these import statements to contain the optional xsi:schemaLocation attribute. + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + + + + + + + + + + + + + + + + + + explanation: The vocabulary for intendedEndUserRole is 'IMSGLC_CC_Rolesv1p0'. + + + + + + + + + + + explanation: The source for a context object is fixed to 'LOMv1.0' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + explanation: Possible intendedEndUserRoles are only 'Learner' and 'Instructor'. + + + + + + + + + + + + + + + + + + + + + + + + + + + + explanation: The value of context is fixed to 'higher education'. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backup/cc/schemas/domainProfile_2/vocabValues_localised.xsd b/backup/cc/schemas/domainProfile_2/vocabValues_localised.xsd index 42128ac0845..013eec6fef8 100755 --- a/backup/cc/schemas/domainProfile_2/vocabValues_localised.xsd +++ b/backup/cc/schemas/domainProfile_2/vocabValues_localised.xsd @@ -1,270 +1,270 @@ - - - - - - - - - - - - - This work is licensed under the Creative Commons Attribution-ShareAlike - License. To view a copy of this license, see the file license.txt, - visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to - Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - - - - This component schema definition provides global type declarations for the standard - LOMv1.0 vocabulary tokens for those LOM data elements whose values are taken from - a Vocabulary data type. - - This component schema defintion defines the stanard vocabulary value - declarations as defined in the LOMv1.0 base schema. These vocabulary - value declarations are used in conjunction with both vocab/custom.xsd and - vocab/loose.xsd. - - - This file has been modified by the Knowledge Media Institute of the - University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the - following changes: - 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported - because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) - 2) In all component XSDs the schemaLocation attribute was amended to the - xs:import and xs:include statements. This enables the usage of the schemas - with tools which don't deal well with missing schemaLocation informations. - - This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + This work is licensed under the Creative Commons Attribution-ShareAlike + License. To view a copy of this license, see the file license.txt, + visit http://creativecommons.org/licenses/by-sa/2.0 or send a letter to + Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + + + + This component schema definition provides global type declarations for the standard + LOMv1.0 vocabulary tokens for those LOM data elements whose values are taken from + a Vocabulary data type. + + This component schema defintion defines the stanard vocabulary value + declarations as defined in the LOMv1.0 base schema. These vocabulary + value declarations are used in conjunction with both vocab/custom.xsd and + vocab/loose.xsd. + + + This file has been modified by the Knowledge Media Institute of the + University Koblenz-Landau (http://iwm.uni-koblenz.de). It contains the + following changes: + 1) Instead of "unique/strict.xsd" the schema "unique/loose.xsd" is imported + because this reflects what is said in 1484.12.3-2005, page 35 (section C.1.3) + 2) In all component XSDs the schemaLocation attribute was amended to the + xs:import and xs:include statements. This enables the usage of the schemas + with tools which don't deal well with missing schemaLocation informations. + + This file is available at "http://iwm.uni-koblenz.de/xsd/IEEE-LOM/loose" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backup/cc/schemas/domainProfile_3/imscp_extensionv1p2.xsd b/backup/cc/schemas/domainProfile_3/imscp_extensionv1p2.xsd index 4720ca83f0f..9c8409e265c 100755 --- a/backup/cc/schemas/domainProfile_3/imscp_extensionv1p2.xsd +++ b/backup/cc/schemas/domainProfile_3/imscp_extensionv1p2.xsd @@ -1,226 +1,226 @@ - - - - - - - XSD Data File Information - ------------------------- - Author: Colin Smythe (IMS, UK) - Date: 31st October, 2006 - Version: 2.0 - Status: Public Draft - Description: This is a normative representation of the IMS Packaging Extension 1.0 Information Model for binding - purposes. Read the corresponding IMS Content Packaging Information Model for the Platform - Independent Model representation. - - History: Version 2 includes the modified definition of LingualTitle. - Version 1 of the IMS Packaging Utility v1.2 XSD for public draft release. - It has a target namespace of http://www.imsglobal.org/xsd/imscp_extensionv1p2. - This Utility uses this general approach to modeling: - (1) All of the elements and attributes are defined as local to their host object; - (2) There are multiple host objects; - (3) Comments have been added to the complexType definitions. - - Copyright: 2006 (c) IMS Global Learning Consortium Inc. All Rights Reserved. - IMS Global Learning Consortium, Inc. (IMS/GLC) is publishing the information - contained in this binding ("Specification") for purposes of scientific - experimental and scholarly collaboration only. IMS/GLC makes no warranty or - representation regarding the accuracy or completeness of the Specification. - This material is provided on an "As Is" and "As Available basis". - The Specification is at all times subject to change and revision without - notice. It is your sole responsibility to evaluate the usefulness, accuracy - and completeness of the Specification as it relates to you. IMS/GLC would - appreciate receiving your comments and suggestions. Please contact IMS/GLC - through our website at: http://www.imsglobal.org. - - Source XSLT File Information - ---------------------------- - XSL Generator: UMLtoXSDTransformv0p7.xsl - XSLT Processor: Xalan - Release: 1.0 Beta 1 - Date: 30th November, 2005 - - Auto-generation Tool - -------------------- - This WSDL/XSD was auto-generated using the IMS WSDL/XSD auto-generation tool. While every attempt - has been made to ensure that this tool auto-generates the XSDs correctly, users should be aware - that this is an experimental tool. Permission is given to make use of this tool. IMS makes no - claim on the materials created by third party users of this tool. Details on how to use this tool - are contained in the IMS document: "IMS General Web Services: WSDL/XSD Binding Auto-generation" - available at the IMS web-site. - Tool Copyright: 2006 (c) IMS Global Learning Consortium Inc. All Rights Reserved. - - - - - - - - - - - - - Any namespaced element from any namespace may be included within an "any" element. - The namespace for the imported element must be defined in the instance, and the schema must be imported. - The extension has a definition of "strict" i.e. they must have their own namespace. - - - - - - - - - - - - - - - - - - - - - - - - - - - A bound instance of an IPointer object allows a packager to associate - a specific XML node set in the same IMS Manifest Document that contains - it or an XML node set in a different IMS Manifest Document instance with - the parent object containing an IMS Pointer instance. - - A referenced node set must be a valid child of the referencing parent element, - both as to kind and multiplicity in a referencing parent's context. - -

Represents a binding of the kinds of objects defined as children of ims-cp-imManifest : Manifest.[ ManifestMetadata, Organizations, Resources, Manifest, Extension ].

-
-
- - - - - - - -
- - - - - An instance of the metadata element contains data structures that declare descriptive - information about a metadata element's parent only. - - One or more different metadata models may be declared as child extensions of a - metadata element. - -

Represents a binding of the kinds of child objects defined for ims-cp-imMetadata: Metadata.[ Extension ].

-
-
- - - -
- - - - - A variant element is closely analogous to a resource element in the - IMS Content Packaging Information Model. Variant is a container for a - an alternative resource. A resource may contain references - to assets that are all of the same type or different types (i.e., file formats). - - The Variant class points to the alternatibe resource. Metadata is used to - describe the nature of a collection of alternative assets and their intended - use. Examples include, but are not limited to, use as lingual variants, - visual or auditory variants, remediation variants, or platform delivery variants. - - The scope of referenced assets is specific to a Variant object. Their use is in the - context of the parent object containing a variant instance, typically a bound instance - of a Resource object from the IMS CP namespace. - -

Represents a binding of the kinds of child objects defined for ims-cp-imResource: Resource.[ Metadata, File, Dependency, Extension ].

-
-
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - -
+ + + + + + + XSD Data File Information + ------------------------- + Author: Colin Smythe (IMS, UK) + Date: 31st October, 2006 + Version: 2.0 + Status: Public Draft + Description: This is a normative representation of the IMS Packaging Extension 1.0 Information Model for binding + purposes. Read the corresponding IMS Content Packaging Information Model for the Platform + Independent Model representation. + + History: Version 2 includes the modified definition of LingualTitle. + Version 1 of the IMS Packaging Utility v1.2 XSD for public draft release. + It has a target namespace of http://www.imsglobal.org/xsd/imscp_extensionv1p2. + This Utility uses this general approach to modeling: + (1) All of the elements and attributes are defined as local to their host object; + (2) There are multiple host objects; + (3) Comments have been added to the complexType definitions. + + Copyright: 2006 (c) IMS Global Learning Consortium Inc. All Rights Reserved. + IMS Global Learning Consortium, Inc. (IMS/GLC) is publishing the information + contained in this binding ("Specification") for purposes of scientific + experimental and scholarly collaboration only. IMS/GLC makes no warranty or + representation regarding the accuracy or completeness of the Specification. + This material is provided on an "As Is" and "As Available basis". + The Specification is at all times subject to change and revision without + notice. It is your sole responsibility to evaluate the usefulness, accuracy + and completeness of the Specification as it relates to you. IMS/GLC would + appreciate receiving your comments and suggestions. Please contact IMS/GLC + through our website at: http://www.imsglobal.org. + + Source XSLT File Information + ---------------------------- + XSL Generator: UMLtoXSDTransformv0p7.xsl + XSLT Processor: Xalan + Release: 1.0 Beta 1 + Date: 30th November, 2005 + + Auto-generation Tool + -------------------- + This WSDL/XSD was auto-generated using the IMS WSDL/XSD auto-generation tool. While every attempt + has been made to ensure that this tool auto-generates the XSDs correctly, users should be aware + that this is an experimental tool. Permission is given to make use of this tool. IMS makes no + claim on the materials created by third party users of this tool. Details on how to use this tool + are contained in the IMS document: "IMS General Web Services: WSDL/XSD Binding Auto-generation" + available at the IMS web-site. + Tool Copyright: 2006 (c) IMS Global Learning Consortium Inc. All Rights Reserved. + + + + + + + + + + + + + Any namespaced element from any namespace may be included within an "any" element. + The namespace for the imported element must be defined in the instance, and the schema must be imported. + The extension has a definition of "strict" i.e. they must have their own namespace. + + + + + + + + + + + + + + + + + + + + + + + + + + + A bound instance of an IPointer object allows a packager to associate + a specific XML node set in the same IMS Manifest Document that contains + it or an XML node set in a different IMS Manifest Document instance with + the parent object containing an IMS Pointer instance. + + A referenced node set must be a valid child of the referencing parent element, + both as to kind and multiplicity in a referencing parent's context. + +

Represents a binding of the kinds of objects defined as children of ims-cp-imManifest : Manifest.[ ManifestMetadata, Organizations, Resources, Manifest, Extension ].

+
+
+ + + + + + + +
+ + + + + An instance of the metadata element contains data structures that declare descriptive + information about a metadata element's parent only. + + One or more different metadata models may be declared as child extensions of a + metadata element. + +

Represents a binding of the kinds of child objects defined for ims-cp-imMetadata: Metadata.[ Extension ].

+
+
+ + + +
+ + + + + A variant element is closely analogous to a resource element in the + IMS Content Packaging Information Model. Variant is a container for a + an alternative resource. A resource may contain references + to assets that are all of the same type or different types (i.e., file formats). + + The Variant class points to the alternatibe resource. Metadata is used to + describe the nature of a collection of alternative assets and their intended + use. Examples include, but are not limited to, use as lingual variants, + visual or auditory variants, remediation variants, or platform delivery variants. + + The scope of referenced assets is specific to a Variant object. Their use is in the + context of the parent object containing a variant instance, typically a bound instance + of a Resource object from the IMS CP namespace. + +

Represents a binding of the kinds of child objects defined for ims-cp-imResource: Resource.[ Metadata, File, Dependency, Extension ].

+
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/backup/cc/schemas/domainProfile_3/imscp_extensionv1p2_constraintsDocument.scmt b/backup/cc/schemas/domainProfile_3/imscp_extensionv1p2_constraintsDocument.scmt index d91614364da..0401d214904 100755 --- a/backup/cc/schemas/domainProfile_3/imscp_extensionv1p2_constraintsDocument.scmt +++ b/backup/cc/schemas/domainProfile_3/imscp_extensionv1p2_constraintsDocument.scmt @@ -1,68 +1,68 @@ - - - - - - - - - - - - - - - - - Assertion failed for pattern_1. An Item object which represents a folder is indicated by the absence of an IdentifierRef characteristic object. Folder Items support unlimited nesting of other folder Items and learning object link Items. Learning Application Resource Item objects may be nested by folder Item object but may not nest other folder or Learning Application resource Item objects.(#S04) - - - - - Assertion failed for pattern_2. A Resource object which is a Learning Object Web Content may contain Dependency objects which reference Resource objects with Type 'webcontent'.(#S03) - - - - - Assertion failed for pattern_3. If an item is invisible, its descendants must be invisible too.(#S02) - - - - - Assertion failed for pattern_4. A Resource object which is a Discussion Topic associated resource may contain Dependency objects which reference Resource objects with Type 'webcontent' or 'associatedcontent/imscc_xmlv1p0/learning-application-resource'.(#S12) - - - - - Assertion failed for pattern_5. - The test was: . - The context was: ims:resources/ims:resource/ims:dependency | ims:manifest/ims:resources/ims:resource/ims:dependency - - - - - Assertion failed for pattern_6. A Resource object which is an assessment may contain Dependency objects which reference Resource objects with Type 'webcontent' or 'associatedcontent/imscc_xmlv1p0/learning-application-resource'.(#S14) - - - - - Assertion failed for pattern_7. If a cartridge web content or associated content resource is linked from a Learning Application Object link Item object it must have an Href characteristic object which represents the launchable resource.(#S05) - - - - - Assertion failed for pattern_8. For Discussion Topic Resources the Resource object must contain a single File object which references the Discussion Topic descriptor XML file which conforms to the http://www.imsglobal.org/xsd/imsdt_v1p0 schema. It must not have any href attribute.(#S06) - - - - - Assertion failed for pattern_9. For Web Link Resources the Resource object must contain a single File object which references the Web Link descriptor XML file which conforms to the http://www.imsglobal.org/xsd/imswl_v1p0 schema. It must contain neither Dependency objects nor an href attribute.(#S07) - - - - - Assertion failed for pattern_10. For Assessment or Question Bank Resources the Resource object must contain a single File object which references the QTI XML file. This file must conform to the IMS CC profile of QTI 1.2.1. The profile is contained in the package of this profile as imscc_q*.xdm. The derived schema of this QTI profile is in the package of this profile with the name ims_qtiasiv1p2_localised.xsd. The resource must not have an href attribute(#S11) - - - - + + + + + + + + + + + + + + + + + Assertion failed for pattern_1. An Item object which represents a folder is indicated by the absence of an IdentifierRef characteristic object. Folder Items support unlimited nesting of other folder Items and learning object link Items. Learning Application Resource Item objects may be nested by folder Item object but may not nest other folder or Learning Application resource Item objects.(#S04) + + + + + Assertion failed for pattern_2. A Resource object which is a Learning Object Web Content may contain Dependency objects which reference Resource objects with Type 'webcontent'.(#S03) + + + + + Assertion failed for pattern_3. If an item is invisible, its descendants must be invisible too.(#S02) + + + + + Assertion failed for pattern_4. A Resource object which is a Discussion Topic associated resource may contain Dependency objects which reference Resource objects with Type 'webcontent' or 'associatedcontent/imscc_xmlv1p0/learning-application-resource'.(#S12) + + + + + Assertion failed for pattern_5. + The test was: . + The context was: ims:resources/ims:resource/ims:dependency | ims:manifest/ims:resources/ims:resource/ims:dependency + + + + + Assertion failed for pattern_6. A Resource object which is an assessment may contain Dependency objects which reference Resource objects with Type 'webcontent' or 'associatedcontent/imscc_xmlv1p0/learning-application-resource'.(#S14) + + + + + Assertion failed for pattern_7. If a cartridge web content or associated content resource is linked from a Learning Application Object link Item object it must have an Href characteristic object which represents the launchable resource.(#S05) + + + + + Assertion failed for pattern_8. For Discussion Topic Resources the Resource object must contain a single File object which references the Discussion Topic descriptor XML file which conforms to the http://www.imsglobal.org/xsd/imsdt_v1p0 schema. It must not have any href attribute.(#S06) + + + + + Assertion failed for pattern_9. For Web Link Resources the Resource object must contain a single File object which references the Web Link descriptor XML file which conforms to the http://www.imsglobal.org/xsd/imswl_v1p0 schema. It must contain neither Dependency objects nor an href attribute.(#S07) + + + + + Assertion failed for pattern_10. For Assessment or Question Bank Resources the Resource object must contain a single File object which references the QTI XML file. This file must conform to the IMS CC profile of QTI 1.2.1. The profile is contained in the package of this profile as imscc_q*.xdm. The derived schema of this QTI profile is in the package of this profile with the name ims_qtiasiv1p2_localised.xsd. The resource must not have an href attribute(#S11) + + + + diff --git a/backup/cc/schemas/domainProfile_3/imscp_extensionv1p2_localised.xsd b/backup/cc/schemas/domainProfile_3/imscp_extensionv1p2_localised.xsd index 4cc935bab08..76a660fb473 100755 --- a/backup/cc/schemas/domainProfile_3/imscp_extensionv1p2_localised.xsd +++ b/backup/cc/schemas/domainProfile_3/imscp_extensionv1p2_localised.xsd @@ -1,234 +1,234 @@ - - - - - - - - - - - - - - XSD Data File Information - ------------------------- - Author: Colin Smythe (IMS, UK) - Date: 31st October, 2006 - Version: 2.0 - Status: Public Draft - Description: This is a normative representation of the IMS Packaging Extension 1.0 Information Model for binding - purposes. Read the corresponding IMS Content Packaging Information Model for the Platform - Independent Model representation. - - History: Version 2 includes the modified definition of LingualTitle. - Version 1 of the IMS Packaging Utility v1.2 XSD for public draft release. - It has a target namespace of http://www.imsglobal.org/xsd/imscp_extensionv1p2. - This Utility uses this general approach to modeling: - (1) All of the elements and attributes are defined as local to their host object; - (2) There are multiple host objects; - (3) Comments have been added to the complexType definitions. - - Copyright: 2006 (c) IMS Global Learning Consortium Inc. All Rights Reserved. - IMS Global Learning Consortium, Inc. (IMS/GLC) is publishing the information - contained in this binding ("Specification") for purposes of scientific - experimental and scholarly collaboration only. IMS/GLC makes no warranty or - representation regarding the accuracy or completeness of the Specification. - This material is provided on an "As Is" and "As Available basis". - The Specification is at all times subject to change and revision without - notice. It is your sole responsibility to evaluate the usefulness, accuracy - and completeness of the Specification as it relates to you. IMS/GLC would - appreciate receiving your comments and suggestions. Please contact IMS/GLC - through our website at: http://www.imsglobal.org. - - Source XSLT File Information - ---------------------------- - XSL Generator: UMLtoXSDTransformv0p7.xsl - XSLT Processor: Xalan - Release: 1.0 Beta 1 - Date: 30th November, 2005 - - Auto-generation Tool - -------------------- - This WSDL/XSD was auto-generated using the IMS WSDL/XSD auto-generation tool. While every attempt - has been made to ensure that this tool auto-generates the XSDs correctly, users should be aware - that this is an experimental tool. Permission is given to make use of this tool. IMS makes no - claim on the materials created by third party users of this tool. Details on how to use this tool - are contained in the IMS document: "IMS General Web Services: WSDL/XSD Binding Auto-generation" - available at the IMS web-site. - Tool Copyright: 2006 (c) IMS Global Learning Consortium Inc. All Rights Reserved. - - general: This profile of the extension schema of IMS CP 1.2 restricts extensions to use the variant element only. - - - - - - - - - - - - Any namespaced element from any namespace may be included within an "any" element. - The namespace for the imported element must be defined in the instance, and the schema must be imported. - The extension has a definition of "strict" i.e. they must have their own namespace. - - - - - - - - - - - - - - - - - - - - - - - - - - - A bound instance of an IPointer object allows a packager to associate - a specific XML node set in the same IMS Manifest Document that contains - it or an XML node set in a different IMS Manifest Document instance with - the parent object containing an IMS Pointer instance. - - A referenced node set must be a valid child of the referencing parent element, - both as to kind and multiplicity in a referencing parent's context. - -

Represents a binding of the kinds of objects defined as children of ims-cp-imManifest : Manifest.[ ManifestMetadata, Organizations, Resources, Manifest, Extension ].

-
-
- - - - - - - -
- - - - - An instance of the metadata element contains data structures that declare descriptive - information about a metadata element's parent only. - - One or more different metadata models may be declared as child extensions of a - metadata element. - -

Represents a binding of the kinds of child objects defined for ims-cp-imMetadata: Metadata.[ Extension ].

-
-
- - - -
- - - - - A variant element is closely analogous to a resource element in the - IMS Content Packaging Information Model. Variant is a container for a - an alternative resource. A resource may contain references - to assets that are all of the same type or different types (i.e., file formats). - - The Variant class points to the alternatibe resource. Metadata is used to - describe the nature of a collection of alternative assets and their intended - use. Examples include, but are not limited to, use as lingual variants, - visual or auditory variants, remediation variants, or platform delivery variants. - - The scope of referenced assets is specific to a Variant object. Their use is in the - context of the parent object containing a variant instance, typically a bound instance - of a Resource object from the IMS CP namespace. - -

Represents a binding of the kinds of child objects defined for ims-cp-imResource: Resource.[ Metadata, File, Dependency, Extension ].

-
-
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - -
+ + + + + + + + + + + + + + XSD Data File Information + ------------------------- + Author: Colin Smythe (IMS, UK) + Date: 31st October, 2006 + Version: 2.0 + Status: Public Draft + Description: This is a normative representation of the IMS Packaging Extension 1.0 Information Model for binding + purposes. Read the corresponding IMS Content Packaging Information Model for the Platform + Independent Model representation. + + History: Version 2 includes the modified definition of LingualTitle. + Version 1 of the IMS Packaging Utility v1.2 XSD for public draft release. + It has a target namespace of http://www.imsglobal.org/xsd/imscp_extensionv1p2. + This Utility uses this general approach to modeling: + (1) All of the elements and attributes are defined as local to their host object; + (2) There are multiple host objects; + (3) Comments have been added to the complexType definitions. + + Copyright: 2006 (c) IMS Global Learning Consortium Inc. All Rights Reserved. + IMS Global Learning Consortium, Inc. (IMS/GLC) is publishing the information + contained in this binding ("Specification") for purposes of scientific + experimental and scholarly collaboration only. IMS/GLC makes no warranty or + representation regarding the accuracy or completeness of the Specification. + This material is provided on an "As Is" and "As Available basis". + The Specification is at all times subject to change and revision without + notice. It is your sole responsibility to evaluate the usefulness, accuracy + and completeness of the Specification as it relates to you. IMS/GLC would + appreciate receiving your comments and suggestions. Please contact IMS/GLC + through our website at: http://www.imsglobal.org. + + Source XSLT File Information + ---------------------------- + XSL Generator: UMLtoXSDTransformv0p7.xsl + XSLT Processor: Xalan + Release: 1.0 Beta 1 + Date: 30th November, 2005 + + Auto-generation Tool + -------------------- + This WSDL/XSD was auto-generated using the IMS WSDL/XSD auto-generation tool. While every attempt + has been made to ensure that this tool auto-generates the XSDs correctly, users should be aware + that this is an experimental tool. Permission is given to make use of this tool. IMS makes no + claim on the materials created by third party users of this tool. Details on how to use this tool + are contained in the IMS document: "IMS General Web Services: WSDL/XSD Binding Auto-generation" + available at the IMS web-site. + Tool Copyright: 2006 (c) IMS Global Learning Consortium Inc. All Rights Reserved. + + general: This profile of the extension schema of IMS CP 1.2 restricts extensions to use the variant element only. + + + + + + + + + + + + Any namespaced element from any namespace may be included within an "any" element. + The namespace for the imported element must be defined in the instance, and the schema must be imported. + The extension has a definition of "strict" i.e. they must have their own namespace. + + + + + + + + + + + + + + + + + + + + + + + + + + + A bound instance of an IPointer object allows a packager to associate + a specific XML node set in the same IMS Manifest Document that contains + it or an XML node set in a different IMS Manifest Document instance with + the parent object containing an IMS Pointer instance. + + A referenced node set must be a valid child of the referencing parent element, + both as to kind and multiplicity in a referencing parent's context. + +

Represents a binding of the kinds of objects defined as children of ims-cp-imManifest : Manifest.[ ManifestMetadata, Organizations, Resources, Manifest, Extension ].

+
+
+ + + + + + + +
+ + + + + An instance of the metadata element contains data structures that declare descriptive + information about a metadata element's parent only. + + One or more different metadata models may be declared as child extensions of a + metadata element. + +

Represents a binding of the kinds of child objects defined for ims-cp-imMetadata: Metadata.[ Extension ].

+
+
+ + + +
+ + + + + A variant element is closely analogous to a resource element in the + IMS Content Packaging Information Model. Variant is a container for a + an alternative resource. A resource may contain references + to assets that are all of the same type or different types (i.e., file formats). + + The Variant class points to the alternatibe resource. Metadata is used to + describe the nature of a collection of alternative assets and their intended + use. Examples include, but are not limited to, use as lingual variants, + visual or auditory variants, remediation variants, or platform delivery variants. + + The scope of referenced assets is specific to a Variant object. Their use is in the + context of the parent object containing a variant instance, typically a bound instance + of a Resource object from the IMS CP namespace. + +

Represents a binding of the kinds of child objects defined for ims-cp-imResource: Resource.[ Metadata, File, Dependency, Extension ].

+
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/backup/cc/schemas/domainProfile_4/ims_qtiasiv1p2.xsd b/backup/cc/schemas/domainProfile_4/ims_qtiasiv1p2.xsd index 3a2463f8a19..bf8d2872b15 100755 --- a/backup/cc/schemas/domainProfile_4/ims_qtiasiv1p2.xsd +++ b/backup/cc/schemas/domainProfile_4/ims_qtiasiv1p2.xsd @@ -1,2234 +1,2234 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backup/cc/schemas/domainProfile_4/ims_qtiasiv1p2_def_copy.xsd b/backup/cc/schemas/domainProfile_4/ims_qtiasiv1p2_def_copy.xsd index 063a43d10e0..806870948ca 100755 --- a/backup/cc/schemas/domainProfile_4/ims_qtiasiv1p2_def_copy.xsd +++ b/backup/cc/schemas/domainProfile_4/ims_qtiasiv1p2_def_copy.xsd @@ -1,2249 +1,2249 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backup/cc/schemas/domainProfile_4/ims_qtiasiv1p2_localised.xsd b/backup/cc/schemas/domainProfile_4/ims_qtiasiv1p2_localised.xsd index fe87324531b..1cbf78aae0b 100755 --- a/backup/cc/schemas/domainProfile_4/ims_qtiasiv1p2_localised.xsd +++ b/backup/cc/schemas/domainProfile_4/ims_qtiasiv1p2_localised.xsd @@ -1,2179 +1,2179 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backup/cc/schemas/domainProfile_4/imscc_q_definition.xsd b/backup/cc/schemas/domainProfile_4/imscc_q_definition.xsd index 30e0aa047d5..86e18d96c68 100755 --- a/backup/cc/schemas/domainProfile_4/imscc_q_definition.xsd +++ b/backup/cc/schemas/domainProfile_4/imscc_q_definition.xsd @@ -1,181 +1,181 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backup/cc/schemas/domainProfile_4/xml.xsd b/backup/cc/schemas/domainProfile_4/xml.xsd index aec62fc9bf8..8e0c9d45fd6 100755 --- a/backup/cc/schemas/domainProfile_4/xml.xsd +++ b/backup/cc/schemas/domainProfile_4/xml.xsd @@ -1,145 +1,145 @@ - - - - - - See http://www.w3.org/XML/1998/namespace.html and - http://www.w3.org/TR/REC-xml for information about this namespace. - - This schema document describes the XML namespace, in a form - suitable for import by other schema documents. - - Note that local names in this namespace are intended to be defined - only by the World Wide Web Consortium or its subgroups. The - following names are currently defined in this namespace and should - not be used with conflicting semantics by any Working Group, - specification, or document instance: - - base (as an attribute name): denotes an attribute whose value - provides a URI to be used as the base for interpreting any - relative URIs in the scope of the element on which it - appears; its value is inherited. This name is reserved - by virtue of its definition in the XML Base specification. - - id (as an attribute name): denotes an attribute whose value - should be interpreted as if declared to be of type ID. - This name is reserved by virtue of its definition in the - xml:id specification. - - lang (as an attribute name): denotes an attribute whose value - is a language code for the natural language of the content of - any element; its value is inherited. This name is reserved - by virtue of its definition in the XML specification. - - space (as an attribute name): denotes an attribute whose - value is a keyword indicating what whitespace processing - discipline is intended for the content of the element; its - value is inherited. This name is reserved by virtue of its - definition in the XML specification. - - Father (in any context at all): denotes Jon Bosak, the chair of - the original XML Working Group. This name is reserved by - the following decision of the W3C XML Plenary and - XML Coordination groups: - - In appreciation for his vision, leadership and dedication - the W3C XML Plenary on this 10th day of February, 2000 - reserves for Jon Bosak in perpetuity the XML name - xml:Father - - - - - This schema defines attributes and an attribute group - suitable for use by - schemas wishing to allow xml:base, xml:lang, xml:space or xml:id - attributes on elements they define. - - To enable this, such a schema must import this schema - for the XML namespace, e.g. as follows: - <schema . . .> - . . . - <import namespace="http://www.w3.org/XML/1998/namespace" - schemaLocation="http://www.w3.org/2001/xml.xsd"/> - - Subsequently, qualified reference to any of the attributes - or the group defined below will have the desired effect, e.g. - - <type . . .> - . . . - <attributeGroup ref="xml:specialAttrs"/> - - will define a type which will schema-validate an instance - element with any of those attributes - - - - In keeping with the XML Schema WG's standard versioning - policy, this schema document will persist at - http://www.w3.org/2007/08/xml.xsd. - At the date of issue it can also be found at - http://www.w3.org/2001/xml.xsd. - The schema document at that URI may however change in the future, - in order to remain compatible with the latest version of XML Schema - itself, or with the XML namespace itself. In other words, if the XML - Schema or XML namespaces change, the version of this document at - http://www.w3.org/2001/xml.xsd will change - accordingly; the version at - http://www.w3.org/2007/08/xml.xsd will not change. - - - - - - Attempting to install the relevant ISO 2- and 3-letter - codes as the enumerated possible values is probably never - going to be a realistic possibility. See - RFC 3066 at http://www.ietf.org/rfc/rfc3066.txt and the IANA registry - at http://www.iana.org/assignments/lang-tag-apps.htm for - further information. - - The union allows for the 'un-declaration' of xml:lang with - the empty string. - - - - - - - - - - - - - - - - - - - - - - - - See http://www.w3.org/TR/xmlbase/ for - information about this attribute. - - - - - - See http://www.w3.org/TR/xml-id/ for - information about this attribute. - - - - - - - - - - - + + + + + + See http://www.w3.org/XML/1998/namespace.html and + http://www.w3.org/TR/REC-xml for information about this namespace. + + This schema document describes the XML namespace, in a form + suitable for import by other schema documents. + + Note that local names in this namespace are intended to be defined + only by the World Wide Web Consortium or its subgroups. The + following names are currently defined in this namespace and should + not be used with conflicting semantics by any Working Group, + specification, or document instance: + + base (as an attribute name): denotes an attribute whose value + provides a URI to be used as the base for interpreting any + relative URIs in the scope of the element on which it + appears; its value is inherited. This name is reserved + by virtue of its definition in the XML Base specification. + + id (as an attribute name): denotes an attribute whose value + should be interpreted as if declared to be of type ID. + This name is reserved by virtue of its definition in the + xml:id specification. + + lang (as an attribute name): denotes an attribute whose value + is a language code for the natural language of the content of + any element; its value is inherited. This name is reserved + by virtue of its definition in the XML specification. + + space (as an attribute name): denotes an attribute whose + value is a keyword indicating what whitespace processing + discipline is intended for the content of the element; its + value is inherited. This name is reserved by virtue of its + definition in the XML specification. + + Father (in any context at all): denotes Jon Bosak, the chair of + the original XML Working Group. This name is reserved by + the following decision of the W3C XML Plenary and + XML Coordination groups: + + In appreciation for his vision, leadership and dedication + the W3C XML Plenary on this 10th day of February, 2000 + reserves for Jon Bosak in perpetuity the XML name + xml:Father + + + + + This schema defines attributes and an attribute group + suitable for use by + schemas wishing to allow xml:base, xml:lang, xml:space or xml:id + attributes on elements they define. + + To enable this, such a schema must import this schema + for the XML namespace, e.g. as follows: + <schema . . .> + . . . + <import namespace="http://www.w3.org/XML/1998/namespace" + schemaLocation="http://www.w3.org/2001/xml.xsd"/> + + Subsequently, qualified reference to any of the attributes + or the group defined below will have the desired effect, e.g. + + <type . . .> + . . . + <attributeGroup ref="xml:specialAttrs"/> + + will define a type which will schema-validate an instance + element with any of those attributes + + + + In keeping with the XML Schema WG's standard versioning + policy, this schema document will persist at + http://www.w3.org/2007/08/xml.xsd. + At the date of issue it can also be found at + http://www.w3.org/2001/xml.xsd. + The schema document at that URI may however change in the future, + in order to remain compatible with the latest version of XML Schema + itself, or with the XML namespace itself. In other words, if the XML + Schema or XML namespaces change, the version of this document at + http://www.w3.org/2001/xml.xsd will change + accordingly; the version at + http://www.w3.org/2007/08/xml.xsd will not change. + + + + + + Attempting to install the relevant ISO 2- and 3-letter + codes as the enumerated possible values is probably never + going to be a realistic possibility. See + RFC 3066 at http://www.ietf.org/rfc/rfc3066.txt and the IANA registry + at http://www.iana.org/assignments/lang-tag-apps.htm for + further information. + + The union allows for the 'un-declaration' of xml:lang with + the empty string. + + + + + + + + + + + + + + + + + + + + + + + + See http://www.w3.org/TR/xmlbase/ for + information about this attribute. + + + + + + See http://www.w3.org/TR/xml-id/ for + information about this attribute. + + + + + + + + + + + diff --git a/backup/cc/schemas/domainProfile_5/imswl_v1p0.xsd b/backup/cc/schemas/domainProfile_5/imswl_v1p0.xsd index 31d287b3722..50a4fa2390c 100755 --- a/backup/cc/schemas/domainProfile_5/imswl_v1p0.xsd +++ b/backup/cc/schemas/domainProfile_5/imswl_v1p0.xsd @@ -1,47 +1,47 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/backup/cc/schemas/domainProfile_5/imswl_v1p0_localised.xsd b/backup/cc/schemas/domainProfile_5/imswl_v1p0_localised.xsd index 426689d326e..0e1f6ce3ddf 100755 --- a/backup/cc/schemas/domainProfile_5/imswl_v1p0_localised.xsd +++ b/backup/cc/schemas/domainProfile_5/imswl_v1p0_localised.xsd @@ -1,61 +1,61 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backup/cc/schemas/domainProfile_6/imsdt_v1p0.xsd b/backup/cc/schemas/domainProfile_6/imsdt_v1p0.xsd index 1831d54c6f1..0c13d1babfd 100755 --- a/backup/cc/schemas/domainProfile_6/imsdt_v1p0.xsd +++ b/backup/cc/schemas/domainProfile_6/imsdt_v1p0.xsd @@ -1,67 +1,67 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backup/cc/schemas/domainProfile_6/imsdt_v1p0_localised.xsd b/backup/cc/schemas/domainProfile_6/imsdt_v1p0_localised.xsd index 4fd9bfdc723..faf5f47cdb4 100755 --- a/backup/cc/schemas/domainProfile_6/imsdt_v1p0_localised.xsd +++ b/backup/cc/schemas/domainProfile_6/imsdt_v1p0_localised.xsd @@ -1,74 +1,74 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backup/cc/schemas/imscc_c1p2maeV0p15_definition.xsd b/backup/cc/schemas/imscc_c1p2maeV0p15_definition.xsd index 4f38ca9adbb..6af5c16d2de 100755 --- a/backup/cc/schemas/imscc_c1p2maeV0p15_definition.xsd +++ b/backup/cc/schemas/imscc_c1p2maeV0p15_definition.xsd @@ -1,80 +1,80 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backup/cc/schemas/imscp_v1p2.xsd b/backup/cc/schemas/imscp_v1p2.xsd index 4013ea94540..a8092c975f5 100755 --- a/backup/cc/schemas/imscp_v1p2.xsd +++ b/backup/cc/schemas/imscp_v1p2.xsd @@ -1,383 +1,383 @@ - - - - - - - XSD Data File Information - ------------------------- - Author: CP1.2 Project Team - Date: 31st October, 2006 - Version: 2.0 - Status: CM/DN Release - Description: This is a normative representation of the IMS CP 1.2 Information Model for binding - purposes. Read the corresponding IMS CP Information Model for the Platform - Independent Model representation. - - History: This is version 1 of the IMS CP v1.2 XSD. It directly supercedes IMS CP v1.1.4 XSD. - Note that the target namespace has NOT been changed. - Apart from the functional additions, the main structural changes are: - (1) All of the elements and attributes are defined as local to their host object; - (2) Comments have been added to the complexType definitions. - - Copyright: 2006 (c) IMS Global Learning Consortium Inc. All Rights Reserved. - IMS Global Learning Consortium, Inc. (IMS/GLC) is publishing the information - contained in this binding ("Specification") for purposes of scientific - experimental and scholarly collaboration only. IMS/GLC makes no warranty or - representation regarding the accuracy or completeness of the Specification. - This material is provided on an "As Is" and "As Available basis". - The Specification is at all times subject to change and revision without - notice. It is your sole responsibility to evaluate the usefulness, accuracy - and completeness of the Specification as it relates to you. IMS/GLC would - appreciate receiving your comments and suggestions. Please contact IMS/GLC - through our website at: http://www.imsglobal.org. - - Source XSLT File Information - ---------------------------- - XSL Generator: UMLtoXSDTransformv0p7.xsl - XSLT Processor: Xalan - Release: 1.0 Beta 1 - Date: 30th November, 2005 - - Auto-generation Tool - -------------------- - This WSDL/XSD was auto-generated using the IMS WSDL/XSD auto-generation tool. While every attempt - has been made to ensure that this tool auto-generates the XSDs correctly, users should be aware - that this is an experimental tool. Permission is given to make use of this tool. IMS makes no - claim on the materials created by third party users of this tool. Details on how to use this tool - are contained in the IMS document: "IMS General Web Services: WSDL/XSD Binding Auto-generation" - available at the IMS web-site. - Tool Copyright: 2005 (c) IMS Global Learning Consortium Inc. All Rights Reserved. - - - - - - - - - - - - - Any namespaced element from any namespace may be included within an "any" element. - The namespace for the imported element must be defined in the instance, and the schema must be imported. - The extension has a definition of "strict" i.e. they must have their own namespace. - - - - - - - - - - - - - - - - - - - - - - - - - - - A manifest element is a container for data structures whose contents describe a - semantically complete instance of the IMS Content Packaging Information Model. - - A manifest element may contain and reference child manifest elements - in the same IMS Manifest document. The root manifest element defines an - entire IMS Package. A child manifest element defines a semantically complete - subset of that Package. - -

Represents a binding of the kinds of objects defined as children of ims-cp-imManifest : Manifest.[ ManifestMetadata, Organizations, Resources, Manifest, Extension ].

-
-
- - - - - - - - - - - -
- - - - - An instance of the metadata element contains data structures - that declare descriptive information about a metadata element's - parent only. - - One or more different metadata models may be declared as - child extensions of a metadata element. - -

Represents a binding of the kinds of child objects defined for ims-cp-imMetadata: Metadata.[ Extension ].

-
-
- - - - - -
- - - - - The organizations element is a container for all data structures - that describe the way or ways that information encapsulated by - its parent manifest element is structured. - -

Represents of binding of the child objects of ims-cp-imOrganizations: Organizations.[ Organization, Extension ].

-
-
- - - - - - -
- - - - - The Resources element is a container for data structures containing - references to one or more assets. Asset references may be grouped - within a containing resources element in whatever manner seems best. - - The scope of referenced assets is specific to a resources element's parent - manifest element only. - -

Represents a binding of the kinds of child objects defined for ims-cp-imResources: Resources.[ Resource, Extension ].

-
-
- - - - - - -
- - - - - An organization element is a container for all data structures relating - to a particular way or view that information encapsulated by a - grandparent manifest object is structured. - - Multiple organization elements within the same parent organizations - element are equivalent in purpose: Each shows a different way for - structuring the same information declared within a grandparent - manifest object. - -

Represents a binding of the kinds of child objects defined for ims-cp-Organization: Organization[ Title, Item, Metadata, Extension ].

-
-
- - - - - - - - - -
- - - - - A resource element is a container for a particular asset - or collection of assets. A resource may contain references - to assets that are all of the same type or different types (i.e., file formats). - - The scope or boundary of an IMS Package is defined by the asset - references collected into all resources containers associated with the - root manifest element, whether as a child, direcdt descendant, or externally - linked descendant. - -

Represents a binding of the kinds of child objects defined for ims-cp-imResource: Resource.[ Metadata, File, Dependency, Extension ].

-
-
- - - - - - - - - - - -
- - - - - An item element represents a structural node in a particular organization. - An item element may be a parent or sibling of other Item elements, - each one representing a unique structural node. - - An organization has no meaning unless it has at least one Item element. - -

Represents a binding of the kinds of child objects of ims-cp-imItem: Item.[ Title, Item, Metadata, Extension ].

-
-
- - - - - - - - - - - -
- - - - - A file element declares a reference to a single asset. The reference may - be relative to the Package containing the file element or absolute - (external to the Package). - - A file element may contain child extensions declaring alternative references - to the same asset as that referenced by the file element's href attribute. - -

Represents a binding of the kinds of child objects defined for ims-cp-imFile: File.[ Metadata, Extension ].

-
-
- - - - - - -
- - - - - A dependency element provides a way to associate another collection of - asset references within the scope of the dependency element's parent - resource element. - - This element allows the parsimonious declaration of asset references. - Shared asset references can be declared once and associated many - times through a Dependency element. - -

Represents a binding of the kinds of child objects defined for ims-cp-imDependency: Dependency.[ Extension ].

-
-
- - - - - -
- - - - - This metadata element contains data structures that declare - descriptive information about an entire Package. - - One or more different metadata models may be declared as - child extensions of a metadata element. - - The schema and schemaversion children define the kind or collection - of metadata models being used. - -

Represents a binding of the kinds of child objects defined for ims-cp-imManifestMetadata: ManifestMetadata.[ Schema, SchemaVersion, MetadataModel ]..

-
-
- - - - - -
- - - - - - - - - - - - - -
+ + + + + + + XSD Data File Information + ------------------------- + Author: CP1.2 Project Team + Date: 31st October, 2006 + Version: 2.0 + Status: CM/DN Release + Description: This is a normative representation of the IMS CP 1.2 Information Model for binding + purposes. Read the corresponding IMS CP Information Model for the Platform + Independent Model representation. + + History: This is version 1 of the IMS CP v1.2 XSD. It directly supercedes IMS CP v1.1.4 XSD. + Note that the target namespace has NOT been changed. + Apart from the functional additions, the main structural changes are: + (1) All of the elements and attributes are defined as local to their host object; + (2) Comments have been added to the complexType definitions. + + Copyright: 2006 (c) IMS Global Learning Consortium Inc. All Rights Reserved. + IMS Global Learning Consortium, Inc. (IMS/GLC) is publishing the information + contained in this binding ("Specification") for purposes of scientific + experimental and scholarly collaboration only. IMS/GLC makes no warranty or + representation regarding the accuracy or completeness of the Specification. + This material is provided on an "As Is" and "As Available basis". + The Specification is at all times subject to change and revision without + notice. It is your sole responsibility to evaluate the usefulness, accuracy + and completeness of the Specification as it relates to you. IMS/GLC would + appreciate receiving your comments and suggestions. Please contact IMS/GLC + through our website at: http://www.imsglobal.org. + + Source XSLT File Information + ---------------------------- + XSL Generator: UMLtoXSDTransformv0p7.xsl + XSLT Processor: Xalan + Release: 1.0 Beta 1 + Date: 30th November, 2005 + + Auto-generation Tool + -------------------- + This WSDL/XSD was auto-generated using the IMS WSDL/XSD auto-generation tool. While every attempt + has been made to ensure that this tool auto-generates the XSDs correctly, users should be aware + that this is an experimental tool. Permission is given to make use of this tool. IMS makes no + claim on the materials created by third party users of this tool. Details on how to use this tool + are contained in the IMS document: "IMS General Web Services: WSDL/XSD Binding Auto-generation" + available at the IMS web-site. + Tool Copyright: 2005 (c) IMS Global Learning Consortium Inc. All Rights Reserved. + + + + + + + + + + + + + Any namespaced element from any namespace may be included within an "any" element. + The namespace for the imported element must be defined in the instance, and the schema must be imported. + The extension has a definition of "strict" i.e. they must have their own namespace. + + + + + + + + + + + + + + + + + + + + + + + + + + + A manifest element is a container for data structures whose contents describe a + semantically complete instance of the IMS Content Packaging Information Model. + + A manifest element may contain and reference child manifest elements + in the same IMS Manifest document. The root manifest element defines an + entire IMS Package. A child manifest element defines a semantically complete + subset of that Package. + +

Represents a binding of the kinds of objects defined as children of ims-cp-imManifest : Manifest.[ ManifestMetadata, Organizations, Resources, Manifest, Extension ].

+
+
+ + + + + + + + + + + +
+ + + + + An instance of the metadata element contains data structures + that declare descriptive information about a metadata element's + parent only. + + One or more different metadata models may be declared as + child extensions of a metadata element. + +

Represents a binding of the kinds of child objects defined for ims-cp-imMetadata: Metadata.[ Extension ].

+
+
+ + + + + +
+ + + + + The organizations element is a container for all data structures + that describe the way or ways that information encapsulated by + its parent manifest element is structured. + +

Represents of binding of the child objects of ims-cp-imOrganizations: Organizations.[ Organization, Extension ].

+
+
+ + + + + + +
+ + + + + The Resources element is a container for data structures containing + references to one or more assets. Asset references may be grouped + within a containing resources element in whatever manner seems best. + + The scope of referenced assets is specific to a resources element's parent + manifest element only. + +

Represents a binding of the kinds of child objects defined for ims-cp-imResources: Resources.[ Resource, Extension ].

+
+
+ + + + + + +
+ + + + + An organization element is a container for all data structures relating + to a particular way or view that information encapsulated by a + grandparent manifest object is structured. + + Multiple organization elements within the same parent organizations + element are equivalent in purpose: Each shows a different way for + structuring the same information declared within a grandparent + manifest object. + +

Represents a binding of the kinds of child objects defined for ims-cp-Organization: Organization[ Title, Item, Metadata, Extension ].

+
+
+ + + + + + + + + +
+ + + + + A resource element is a container for a particular asset + or collection of assets. A resource may contain references + to assets that are all of the same type or different types (i.e., file formats). + + The scope or boundary of an IMS Package is defined by the asset + references collected into all resources containers associated with the + root manifest element, whether as a child, direcdt descendant, or externally + linked descendant. + +

Represents a binding of the kinds of child objects defined for ims-cp-imResource: Resource.[ Metadata, File, Dependency, Extension ].

+
+
+ + + + + + + + + + + +
+ + + + + An item element represents a structural node in a particular organization. + An item element may be a parent or sibling of other Item elements, + each one representing a unique structural node. + + An organization has no meaning unless it has at least one Item element. + +

Represents a binding of the kinds of child objects of ims-cp-imItem: Item.[ Title, Item, Metadata, Extension ].

+
+
+ + + + + + + + + + + +
+ + + + + A file element declares a reference to a single asset. The reference may + be relative to the Package containing the file element or absolute + (external to the Package). + + A file element may contain child extensions declaring alternative references + to the same asset as that referenced by the file element's href attribute. + +

Represents a binding of the kinds of child objects defined for ims-cp-imFile: File.[ Metadata, Extension ].

+
+
+ + + + + + +
+ + + + + A dependency element provides a way to associate another collection of + asset references within the scope of the dependency element's parent + resource element. + + This element allows the parsimonious declaration of asset references. + Shared asset references can be declared once and associated many + times through a Dependency element. + +

Represents a binding of the kinds of child objects defined for ims-cp-imDependency: Dependency.[ Extension ].

+
+
+ + + + + +
+ + + + + This metadata element contains data structures that declare + descriptive information about an entire Package. + + One or more different metadata models may be declared as + child extensions of a metadata element. + + The schema and schemaversion children define the kind or collection + of metadata models being used. + +

Represents a binding of the kinds of child objects defined for ims-cp-imManifestMetadata: ManifestMetadata.[ Schema, SchemaVersion, MetadataModel ]..

+
+
+ + + + + +
+ + + + + + + + + + + + + +
diff --git a/backup/cc/schemas/imscp_v1p2_constraintsDocument.scmt b/backup/cc/schemas/imscp_v1p2_constraintsDocument.scmt index 0ee9287b0d0..33061b89bf3 100755 --- a/backup/cc/schemas/imscp_v1p2_constraintsDocument.scmt +++ b/backup/cc/schemas/imscp_v1p2_constraintsDocument.scmt @@ -1,138 +1,138 @@ - - - - - - - - - - - - - - - - - - - Assertion failed for pattern_2. If an item is invisible, its descendants must be invisible too.(#S02) - - - - - - Assertion failed for pattern_3. A Resource object which is a Learning Object associated resource may contain Dependency objects which reference Resource objects with Type 'webcontent'.(#S03) - - - - - - Assertion failed for pattern_4. An Item object which represents a folder is indicated by the absence of an IdentifierRef characteristic object. Folder Items support unlimited nesting of other folder Items and learning object link Items. Learning Application Resource Item objects may be nested by folder Item object but may not nest other folder or Learning Application resource Item objects.(#S04) - - - - - - Error: Assertion failed for pattern_5: If a cartridge web content or associated content resource is linked from a Learning Application Object link Item object it must have an Href characteristic object which represents the launchable resource.(#S05) - - - - - - Error: Assertion failed for pattern_5: For Discussion Topic Resources the Resource object must contain a single File object which references the Discussion Topic descriptor XML file which conforms to the http://www.imsglobal.org/xsd/imsdt_v1p0 schema. Discussion Topic resources must not contain href (#S06) - - - - - - Error: Assertion validation failed for pattern_7: For Web Link Resources the Resource object must contain a single File object which references the Web Link descriptor XML file which conforms to the http://www.imsglobal.org/xsd/imswl_v1p0 schema.It must contain neither Dependency objects nor an href attribute.(#S07) - - - - - - - - - Error: Assertion validation failed for pattern_11a: For Assessment resources the Resource object must contain a single File object which references the QTI XML file. This file must conform to the IMS CC profile of QTI 1.2.1. The profile is contained in the package of this profile as imscc_q*.zip. The derived schema of this QTI profile is in the package of this profile with the name ims_qtiasiv1p2_localised.xsd. The resource must not have an href attribute(#S11a) - - - - - - Error: Assertion validation failed for pattern_11b1: For Question Bank resources the Resource object must contain a single File object which references the QTI XML file. (#S11b1) - - - - - - Error: Assertion validation failed for pattern_11b2: A Question Bank Resource must not have an href attribute. (#S11b2) - - - - - - Error: Assertion validation failed for pattern_11b3: A Question Bank Resource must not be referenced from an item. (#S11b3) - - - - - - Error: Assertion validation failed for pattern_11b4: There can be only one Questionbank Resource in a cartridge.(#S11b4) - - - - - - Assertion failed for pattern_12. A Resource object which is a Discussion Topic associated resource may contain Dependency objects which reference Resource objects with Type 'webcontent' or 'associatedcontent/imscc_xmlv1p0/learning-application-resource'.(#S12) - - - - - - - - Assertion failed for pattern_14. A Resource object which is an assessment may contain Dependency objects which reference Resource objects with Type 'webcontent' or 'associatedcontent/imscc_xmlv1p0/learning-application-resource'.(#S14) - - - - - - Assertion failed for pattern_15. A Resource object which is a Question Bank may contain Dependency objects which reference Resource objects with Type 'webcontent' or 'associatedcontent/imscc_xmlv1p0/learning-application-resource'.(#S15) - - - + + + + + + + + + + + + + + + + + + + Assertion failed for pattern_2. If an item is invisible, its descendants must be invisible too.(#S02) + + + + + + Assertion failed for pattern_3. A Resource object which is a Learning Object associated resource may contain Dependency objects which reference Resource objects with Type 'webcontent'.(#S03) + + + + + + Assertion failed for pattern_4. An Item object which represents a folder is indicated by the absence of an IdentifierRef characteristic object. Folder Items support unlimited nesting of other folder Items and learning object link Items. Learning Application Resource Item objects may be nested by folder Item object but may not nest other folder or Learning Application resource Item objects.(#S04) + + + + + + Error: Assertion failed for pattern_5: If a cartridge web content or associated content resource is linked from a Learning Application Object link Item object it must have an Href characteristic object which represents the launchable resource.(#S05) + + + + + + Error: Assertion failed for pattern_5: For Discussion Topic Resources the Resource object must contain a single File object which references the Discussion Topic descriptor XML file which conforms to the http://www.imsglobal.org/xsd/imsdt_v1p0 schema. Discussion Topic resources must not contain href (#S06) + + + + + + Error: Assertion validation failed for pattern_7: For Web Link Resources the Resource object must contain a single File object which references the Web Link descriptor XML file which conforms to the http://www.imsglobal.org/xsd/imswl_v1p0 schema.It must contain neither Dependency objects nor an href attribute.(#S07) + + + + + + + + + Error: Assertion validation failed for pattern_11a: For Assessment resources the Resource object must contain a single File object which references the QTI XML file. This file must conform to the IMS CC profile of QTI 1.2.1. The profile is contained in the package of this profile as imscc_q*.zip. The derived schema of this QTI profile is in the package of this profile with the name ims_qtiasiv1p2_localised.xsd. The resource must not have an href attribute(#S11a) + + + + + + Error: Assertion validation failed for pattern_11b1: For Question Bank resources the Resource object must contain a single File object which references the QTI XML file. (#S11b1) + + + + + + Error: Assertion validation failed for pattern_11b2: A Question Bank Resource must not have an href attribute. (#S11b2) + + + + + + Error: Assertion validation failed for pattern_11b3: A Question Bank Resource must not be referenced from an item. (#S11b3) + + + + + + Error: Assertion validation failed for pattern_11b4: There can be only one Questionbank Resource in a cartridge.(#S11b4) + + + + + + Assertion failed for pattern_12. A Resource object which is a Discussion Topic associated resource may contain Dependency objects which reference Resource objects with Type 'webcontent' or 'associatedcontent/imscc_xmlv1p0/learning-application-resource'.(#S12) + + + + + + + + Assertion failed for pattern_14. A Resource object which is an assessment may contain Dependency objects which reference Resource objects with Type 'webcontent' or 'associatedcontent/imscc_xmlv1p0/learning-application-resource'.(#S14) + + + + + + Assertion failed for pattern_15. A Resource object which is a Question Bank may contain Dependency objects which reference Resource objects with Type 'webcontent' or 'associatedcontent/imscc_xmlv1p0/learning-application-resource'.(#S15) + + + \ No newline at end of file diff --git a/backup/cc/schemas/imscp_v1p2_localised.xsd b/backup/cc/schemas/imscp_v1p2_localised.xsd index e1375e07682..8098895e2fb 100755 --- a/backup/cc/schemas/imscp_v1p2_localised.xsd +++ b/backup/cc/schemas/imscp_v1p2_localised.xsd @@ -1,455 +1,455 @@ - - - - - - - - - - - - - - - XSD Data File Information - ------------------------- - Author: CP1.2 Project Team - Date: 31st October, 2006 - Version: 2.0 - Status: CM/DN Release - Description: This is a normative representation of the IMS CP 1.2 Information Model for binding - purposes. Read the corresponding IMS CP Information Model for the Platform - Independent Model representation. - - History: This is version 1 of the IMS CP v1.2 XSD. It directly supercedes IMS CP v1.1.4 XSD. - Note that the target namespace has NOT been changed. - Apart from the functional additions, the main structural changes are: - (1) All of the elements and attributes are defined as local to their host object; - (2) Comments have been added to the complexType definitions. - - Copyright: 2006 (c) IMS Global Learning Consortium Inc. All Rights Reserved. - IMS Global Learning Consortium, Inc. (IMS/GLC) is publishing the information - contained in this binding ("Specification") for purposes of scientific - experimental and scholarly collaboration only. IMS/GLC makes no warranty or - representation regarding the accuracy or completeness of the Specification. - This material is provided on an "As Is" and "As Available basis". - The Specification is at all times subject to change and revision without - notice. It is your sole responsibility to evaluate the usefulness, accuracy - and completeness of the Specification as it relates to you. IMS/GLC would - appreciate receiving your comments and suggestions. Please contact IMS/GLC - through our website at: http://www.imsglobal.org. - - Source XSLT File Information - ---------------------------- - XSL Generator: UMLtoXSDTransformv0p7.xsl - XSLT Processor: Xalan - Release: 1.0 Beta 1 - Date: 30th November, 2005 - - Auto-generation Tool - -------------------- - This WSDL/XSD was auto-generated using the IMS WSDL/XSD auto-generation tool. While every attempt - has been made to ensure that this tool auto-generates the XSDs correctly, users should be aware - that this is an experimental tool. Permission is given to make use of this tool. IMS makes no - claim on the materials created by third party users of this tool. Details on how to use this tool - are contained in the IMS document: "IMS General Web Services: WSDL/XSD Binding Auto-generation" - available at the IMS web-site. - Tool Copyright: 2005 (c) IMS Global Learning Consortium Inc. All Rights Reserved. - - - - - - - - - - - - - Any namespaced element from any namespace may be included within an "any" element. - The namespace for the imported element must be defined in the instance, and the schema must be imported. - The extension has a definition of "strict" i.e. they must have their own namespace. - - - - - - - - - - Any namespaced element from any namespace may be included within an "any" element. - The namespace for the imported element must be defined in the instance, and the schema must be imported. - The extension has a definition of "strict" i.e. they must have their own namespace. - - - - - - - - - - Any namespaced element from any namespace may be included within an "any" element. - The namespace for the imported element must be defined in the instance, and the schema must be imported. - The extension has a definition of "strict" i.e. they must have their own namespace. - - - - - - - - - - Any namespaced element from any namespace may be included within an "any" element. - The namespace for the imported element must be defined in the instance, and the schema must be imported. - The extension has a definition of "strict" i.e. they must have their own namespace. - - - - - - - - - - - - - - - - - - - - - - - - - - - A manifest element is a container for data structures whose contents describe a - semantically complete instance of the IMS Content Packaging Information Model. - - A manifest element may contain and reference child manifest elements - in the same IMS Manifest document. The root manifest element defines an - entire IMS Package. A child manifest element defines a semantically complete - subset of that Package. - -

Represents a binding of the kinds of objects defined as children of ims-cp-imManifest : Manifest.[ ManifestMetadata, Organizations, Resources, Manifest, Extension ].

-
-
- - - - - - - - - - - -
- - - - - An instance of the metadata element contains data structures - that declare descriptive information about a metadata element's - parent only. - - One or more different metadata models may be declared as - child extensions of a metadata element. - -

Represents a binding of the kinds of child objects defined for ims-cp-imMetadata: Metadata.[ Extension ].

-
-
- - - - - -
- - - - - The organizations element is a container for all data structures - that describe the way or ways that information encapsulated by - its parent manifest element is structured. - -

Represents of binding of the child objects of ims-cp-imOrganizations: Organizations.[ Organization, Extension ].

-
-
- - - - - - -
- - - - - The Resources element is a container for data structures containing - references to one or more assets. Asset references may be grouped - within a containing resources element in whatever manner seems best. - - The scope of referenced assets is specific to a resources element's parent - manifest element only. - -

Represents a binding of the kinds of child objects defined for ims-cp-imResources: Resources.[ Resource, Extension ].

-
-
- - - - - - -
- - - - - An organization element is a container for all data structures relating - to a particular way or view that information encapsulated by a - grandparent manifest object is structured. - - Multiple organization elements within the same parent organizations - element are equivalent in purpose: Each shows a different way for - structuring the same information declared within a grandparent - manifest object. - -

Represents a binding of the kinds of child objects defined for ims-cp-Organization: Organization[ Title, Item, Metadata, Extension ].

-
-
- - - - - - - - - -
- - - - - - A resource element is a container for a particular asset - or collection of assets. A resource may contain references - to assets that are all of the same type or different types (i.e., file formats). - - The scope or boundary of an IMS Package is defined by the asset - references collected into all resources containers associated with the - root manifest element, whether as a child, direcdt descendant, or externally - linked descendant. - -

Represents a binding of the kinds of child objects defined for ims-cp-imResource: Resource.[ Metadata, File, Dependency, Extension ].

-
-
- - - - - - - - - - - - -
- - - - - - An item element represents a structural node in a particular organization. - An item element may be a parent or sibling of other Item elements, - each one representing a unique structural node. - - An organization has no meaning unless it has at least one Item element. - -

Represents a binding of the kinds of child objects of ims-cp-imItem: Item.[ Title, Item, Metadata, Extension ].

-
-
- - - - - - - - - - - -
- - - - An item element represents a structural node in a particular organization. - An item element may be a parent or sibling of other Item elements, - each one representing a unique structural node. - - An organization has no meaning unless it has at least one Item element. - -

Represents a binding of the kinds of child objects of ims-cp-imItem: Item.[ Title, Item, Metadata, Extension ].

-
-
- - - - - - - - - - - -
- - - - - A file element declares a reference to a single asset. The reference may - be relative to the Package containing the file element or absolute - (external to the Package). - - A file element may contain child extensions declaring alternative references - to the same asset as that referenced by the file element's href attribute. - -

Represents a binding of the kinds of child objects defined for ims-cp-imFile: File.[ Metadata, Extension ].

-
-
- - - - - - -
- - - - - A dependency element provides a way to associate another collection of - asset references within the scope of the dependency element's parent - resource element. - - This element allows the parsimonious declaration of asset references. - Shared asset references can be declared once and associated many - times through a Dependency element. - -

Represents a binding of the kinds of child objects defined for ims-cp-imDependency: Dependency.[ Extension ].

-
-
- - - - - - -
- - - - - This metadata element contains data structures that declare - descriptive information about an entire Package. - - One or more different metadata models may be declared as - child extensions of a metadata element. - - The schema and schemaversion children define the kind or collection - of metadata models being used. - -

Represents a binding of the kinds of child objects defined for ims-cp-imManifestMetadata: ManifestMetadata.[ Schema, SchemaVersion, MetadataModel ]..

-
-
- - - - - -
- - - - - - - - - - - - - -
+ + + + + + + + + + + + + + + XSD Data File Information + ------------------------- + Author: CP1.2 Project Team + Date: 31st October, 2006 + Version: 2.0 + Status: CM/DN Release + Description: This is a normative representation of the IMS CP 1.2 Information Model for binding + purposes. Read the corresponding IMS CP Information Model for the Platform + Independent Model representation. + + History: This is version 1 of the IMS CP v1.2 XSD. It directly supercedes IMS CP v1.1.4 XSD. + Note that the target namespace has NOT been changed. + Apart from the functional additions, the main structural changes are: + (1) All of the elements and attributes are defined as local to their host object; + (2) Comments have been added to the complexType definitions. + + Copyright: 2006 (c) IMS Global Learning Consortium Inc. All Rights Reserved. + IMS Global Learning Consortium, Inc. (IMS/GLC) is publishing the information + contained in this binding ("Specification") for purposes of scientific + experimental and scholarly collaboration only. IMS/GLC makes no warranty or + representation regarding the accuracy or completeness of the Specification. + This material is provided on an "As Is" and "As Available basis". + The Specification is at all times subject to change and revision without + notice. It is your sole responsibility to evaluate the usefulness, accuracy + and completeness of the Specification as it relates to you. IMS/GLC would + appreciate receiving your comments and suggestions. Please contact IMS/GLC + through our website at: http://www.imsglobal.org. + + Source XSLT File Information + ---------------------------- + XSL Generator: UMLtoXSDTransformv0p7.xsl + XSLT Processor: Xalan + Release: 1.0 Beta 1 + Date: 30th November, 2005 + + Auto-generation Tool + -------------------- + This WSDL/XSD was auto-generated using the IMS WSDL/XSD auto-generation tool. While every attempt + has been made to ensure that this tool auto-generates the XSDs correctly, users should be aware + that this is an experimental tool. Permission is given to make use of this tool. IMS makes no + claim on the materials created by third party users of this tool. Details on how to use this tool + are contained in the IMS document: "IMS General Web Services: WSDL/XSD Binding Auto-generation" + available at the IMS web-site. + Tool Copyright: 2005 (c) IMS Global Learning Consortium Inc. All Rights Reserved. + + + + + + + + + + + + + Any namespaced element from any namespace may be included within an "any" element. + The namespace for the imported element must be defined in the instance, and the schema must be imported. + The extension has a definition of "strict" i.e. they must have their own namespace. + + + + + + + + + + Any namespaced element from any namespace may be included within an "any" element. + The namespace for the imported element must be defined in the instance, and the schema must be imported. + The extension has a definition of "strict" i.e. they must have their own namespace. + + + + + + + + + + Any namespaced element from any namespace may be included within an "any" element. + The namespace for the imported element must be defined in the instance, and the schema must be imported. + The extension has a definition of "strict" i.e. they must have their own namespace. + + + + + + + + + + Any namespaced element from any namespace may be included within an "any" element. + The namespace for the imported element must be defined in the instance, and the schema must be imported. + The extension has a definition of "strict" i.e. they must have their own namespace. + + + + + + + + + + + + + + + + + + + + + + + + + + + A manifest element is a container for data structures whose contents describe a + semantically complete instance of the IMS Content Packaging Information Model. + + A manifest element may contain and reference child manifest elements + in the same IMS Manifest document. The root manifest element defines an + entire IMS Package. A child manifest element defines a semantically complete + subset of that Package. + +

Represents a binding of the kinds of objects defined as children of ims-cp-imManifest : Manifest.[ ManifestMetadata, Organizations, Resources, Manifest, Extension ].

+
+
+ + + + + + + + + + + +
+ + + + + An instance of the metadata element contains data structures + that declare descriptive information about a metadata element's + parent only. + + One or more different metadata models may be declared as + child extensions of a metadata element. + +

Represents a binding of the kinds of child objects defined for ims-cp-imMetadata: Metadata.[ Extension ].

+
+
+ + + + + +
+ + + + + The organizations element is a container for all data structures + that describe the way or ways that information encapsulated by + its parent manifest element is structured. + +

Represents of binding of the child objects of ims-cp-imOrganizations: Organizations.[ Organization, Extension ].

+
+
+ + + + + + +
+ + + + + The Resources element is a container for data structures containing + references to one or more assets. Asset references may be grouped + within a containing resources element in whatever manner seems best. + + The scope of referenced assets is specific to a resources element's parent + manifest element only. + +

Represents a binding of the kinds of child objects defined for ims-cp-imResources: Resources.[ Resource, Extension ].

+
+
+ + + + + + +
+ + + + + An organization element is a container for all data structures relating + to a particular way or view that information encapsulated by a + grandparent manifest object is structured. + + Multiple organization elements within the same parent organizations + element are equivalent in purpose: Each shows a different way for + structuring the same information declared within a grandparent + manifest object. + +

Represents a binding of the kinds of child objects defined for ims-cp-Organization: Organization[ Title, Item, Metadata, Extension ].

+
+
+ + + + + + + + + +
+ + + + + + A resource element is a container for a particular asset + or collection of assets. A resource may contain references + to assets that are all of the same type or different types (i.e., file formats). + + The scope or boundary of an IMS Package is defined by the asset + references collected into all resources containers associated with the + root manifest element, whether as a child, direcdt descendant, or externally + linked descendant. + +

Represents a binding of the kinds of child objects defined for ims-cp-imResource: Resource.[ Metadata, File, Dependency, Extension ].

+
+
+ + + + + + + + + + + + +
+ + + + + + An item element represents a structural node in a particular organization. + An item element may be a parent or sibling of other Item elements, + each one representing a unique structural node. + + An organization has no meaning unless it has at least one Item element. + +

Represents a binding of the kinds of child objects of ims-cp-imItem: Item.[ Title, Item, Metadata, Extension ].

+
+
+ + + + + + + + + + + +
+ + + + An item element represents a structural node in a particular organization. + An item element may be a parent or sibling of other Item elements, + each one representing a unique structural node. + + An organization has no meaning unless it has at least one Item element. + +

Represents a binding of the kinds of child objects of ims-cp-imItem: Item.[ Title, Item, Metadata, Extension ].

+
+
+ + + + + + + + + + + +
+ + + + + A file element declares a reference to a single asset. The reference may + be relative to the Package containing the file element or absolute + (external to the Package). + + A file element may contain child extensions declaring alternative references + to the same asset as that referenced by the file element's href attribute. + +

Represents a binding of the kinds of child objects defined for ims-cp-imFile: File.[ Metadata, Extension ].

+
+
+ + + + + + +
+ + + + + A dependency element provides a way to associate another collection of + asset references within the scope of the dependency element's parent + resource element. + + This element allows the parsimonious declaration of asset references. + Shared asset references can be declared once and associated many + times through a Dependency element. + +

Represents a binding of the kinds of child objects defined for ims-cp-imDependency: Dependency.[ Extension ].

+
+
+ + + + + + +
+ + + + + This metadata element contains data structures that declare + descriptive information about an entire Package. + + One or more different metadata models may be declared as + child extensions of a metadata element. + + The schema and schemaversion children define the kind or collection + of metadata models being used. + +

Represents a binding of the kinds of child objects defined for ims-cp-imManifestMetadata: ManifestMetadata.[ Schema, SchemaVersion, MetadataModel ]..

+
+
+ + + + + +
+ + + + + + + + + + + + + +
diff --git a/lang/en/help/notes/status.html b/lang/en/help/notes/status.html index 1034e93614b..4044cf3949a 100755 --- a/lang/en/help/notes/status.html +++ b/lang/en/help/notes/status.html @@ -1,8 +1,8 @@ -

Status

- -

There are 3 possible settings here

-
    -
  • Personal - The note will be visible only to you
  • -
  • Course - The note will be visible to teachers in this course
  • -
  • Site - The note will be visible to teachers in all courses
  • +

    Status

    + +

    There are 3 possible settings here

    +
      +
    • Personal - The note will be visible only to you
    • +
    • Course - The note will be visible to teachers in this course
    • +
    • Site - The note will be visible to teachers in all courses
    \ No newline at end of file diff --git a/lib/adodb/lang/adodb-cn.inc.php b/lib/adodb/lang/adodb-cn.inc.php index eb8c7de55c2..b10860469c0 100644 --- a/lib/adodb/lang/adodb-cn.inc.php +++ b/lib/adodb/lang/adodb-cn.inc.php @@ -1,35 +1,35 @@ - 'cn', - DB_ERROR => 'δ֪', - DB_ERROR_ALREADY_EXISTS => 'Ѿ', - DB_ERROR_CANNOT_CREATE => 'ܴ', - DB_ERROR_CANNOT_DELETE => 'ɾ', - DB_ERROR_CANNOT_DROP => 'ܶ', - DB_ERROR_CONSTRAINT => 'Լ', - DB_ERROR_DIVZERO => '0', - DB_ERROR_INVALID => 'Ч', - DB_ERROR_INVALID_DATE => 'Чڻʱ', - DB_ERROR_INVALID_NUMBER => 'Ч', - DB_ERROR_MISMATCH => 'ƥ', - DB_ERROR_NODBSELECTED => 'ûݿⱻѡ', - DB_ERROR_NOSUCHFIELD => 'ûӦֶ', - DB_ERROR_NOSUCHTABLE => 'ûӦı', - DB_ERROR_NOT_CAPABLE => 'ݿ̨', - DB_ERROR_NOT_FOUND => 'ûз', - DB_ERROR_NOT_LOCKED => 'ûб', - DB_ERROR_SYNTAX => '﷨', - DB_ERROR_UNSUPPORTED => '֧', - DB_ERROR_VALUE_COUNT_ON_ROW => 'ۼֵ', - DB_ERROR_INVALID_DSN => 'ЧԴ (DSN)', - DB_ERROR_CONNECT_FAILED => 'ʧ', - 0 => 'ûд', // DB_OK - DB_ERROR_NEED_MORE_DATA => 'ṩݲܷҪ', - DB_ERROR_EXTENSION_NOT_FOUND=> 'չûб', - DB_ERROR_NOSUCHDB => 'ûӦݿ', - DB_ERROR_ACCESS_VIOLATION => 'ûкʵȨ' -); + 'cn', + DB_ERROR => 'δ֪����', + DB_ERROR_ALREADY_EXISTS => '�Ѿ�����', + DB_ERROR_CANNOT_CREATE => '���ܴ���', + DB_ERROR_CANNOT_DELETE => '����ɾ��', + DB_ERROR_CANNOT_DROP => '���ܶ���', + DB_ERROR_CONSTRAINT => 'Լ������', + DB_ERROR_DIVZERO => '��0��', + DB_ERROR_INVALID => '��Ч', + DB_ERROR_INVALID_DATE => '��Ч�����ڻ���ʱ��', + DB_ERROR_INVALID_NUMBER => '��Ч������', + DB_ERROR_MISMATCH => '��ƥ��', + DB_ERROR_NODBSELECTED => 'û����ݿⱻѡ��', + DB_ERROR_NOSUCHFIELD => 'û����Ӧ���ֶ�', + DB_ERROR_NOSUCHTABLE => 'û����Ӧ�ı�', + DB_ERROR_NOT_CAPABLE => '��ݿ��̨������', + DB_ERROR_NOT_FOUND => 'û�з���', + DB_ERROR_NOT_LOCKED => 'û�б���', + DB_ERROR_SYNTAX => '�﷨����', + DB_ERROR_UNSUPPORTED => '��֧��', + DB_ERROR_VALUE_COUNT_ON_ROW => '�������ۼ�ֵ', + DB_ERROR_INVALID_DSN => '��Ч�����Դ (DSN)', + DB_ERROR_CONNECT_FAILED => '����ʧ��', + 0 => 'û�д���', // DB_OK + DB_ERROR_NEED_MORE_DATA => '�ṩ����ݲ��ܷ��Ҫ��', + DB_ERROR_EXTENSION_NOT_FOUND=> '��չû�б�����', + DB_ERROR_NOSUCHDB => 'û����Ӧ����ݿ�', + DB_ERROR_ACCESS_VIOLATION => 'û�к��ʵ�Ȩ��' +); ?> \ No newline at end of file diff --git a/lib/adodb/lang/adodb-cz.inc.php b/lib/adodb/lang/adodb-cz.inc.php index 2424c2446b8..e16a22d5a74 100644 --- a/lib/adodb/lang/adodb-cz.inc.php +++ b/lib/adodb/lang/adodb-cz.inc.php @@ -1,40 +1,40 @@ - - -$ADODB_LANG_ARRAY = array ( - 'LANG' => 'cz', - DB_ERROR => 'neznm chyba', - DB_ERROR_ALREADY_EXISTS => 'ji? existuje', - DB_ERROR_CANNOT_CREATE => 'nelze vytvo?it', - DB_ERROR_CANNOT_DELETE => 'nelze smazat', - DB_ERROR_CANNOT_DROP => 'nelze odstranit', - DB_ERROR_CONSTRAINT => 'poru?en omezujc podmnky', - DB_ERROR_DIVZERO => 'd?len nulou', - DB_ERROR_INVALID => 'neplatn', - DB_ERROR_INVALID_DATE => 'neplatn datum nebo ?as', - DB_ERROR_INVALID_NUMBER => 'neplatn ?slo', - DB_ERROR_MISMATCH => 'nesouhlas', - DB_ERROR_NODBSELECTED => '?dn databze nen vybrna', - DB_ERROR_NOSUCHFIELD => 'pole nenalezeno', - DB_ERROR_NOSUCHTABLE => 'tabulka nenalezena', - DB_ERROR_NOT_CAPABLE => 'nepodporovno', - DB_ERROR_NOT_FOUND => 'nenalezeno', - DB_ERROR_NOT_LOCKED => 'nezam?eno', - DB_ERROR_SYNTAX => 'syntaktick chyba', - DB_ERROR_UNSUPPORTED => 'nepodporovno', - DB_ERROR_VALUE_COUNT_ON_ROW => '', - DB_ERROR_INVALID_DSN => 'neplatn DSN', - DB_ERROR_CONNECT_FAILED => 'p?ipojen selhalo', - 0 => 'bez chyb', // DB_OK - DB_ERROR_NEED_MORE_DATA => 'mlo zdrojovch dat', - DB_ERROR_EXTENSION_NOT_FOUND=> 'roz??en nenalezeno', - DB_ERROR_NOSUCHDB => 'databze neexistuje', - DB_ERROR_ACCESS_VIOLATION => 'nedostate?n prva' -); + + +$ADODB_LANG_ARRAY = array ( + 'LANG' => 'cz', + DB_ERROR => 'nezn�m� chyba', + DB_ERROR_ALREADY_EXISTS => 'ji? existuje', + DB_ERROR_CANNOT_CREATE => 'nelze vytvo?it', + DB_ERROR_CANNOT_DELETE => 'nelze smazat', + DB_ERROR_CANNOT_DROP => 'nelze odstranit', + DB_ERROR_CONSTRAINT => 'poru?en� omezuj�c� podm�nky', + DB_ERROR_DIVZERO => 'd?len� nulou', + DB_ERROR_INVALID => 'neplatn�', + DB_ERROR_INVALID_DATE => 'neplatn� datum nebo ?as', + DB_ERROR_INVALID_NUMBER => 'neplatn� ?�slo', + DB_ERROR_MISMATCH => 'nesouhlas�', + DB_ERROR_NODBSELECTED => '?�dn� datab�ze nen� vybr�na', + DB_ERROR_NOSUCHFIELD => 'pole nenalezeno', + DB_ERROR_NOSUCHTABLE => 'tabulka nenalezena', + DB_ERROR_NOT_CAPABLE => 'nepodporov�no', + DB_ERROR_NOT_FOUND => 'nenalezeno', + DB_ERROR_NOT_LOCKED => 'nezam?eno', + DB_ERROR_SYNTAX => 'syntaktick� chyba', + DB_ERROR_UNSUPPORTED => 'nepodporov�no', + DB_ERROR_VALUE_COUNT_ON_ROW => '', + DB_ERROR_INVALID_DSN => 'neplatn� DSN', + DB_ERROR_CONNECT_FAILED => 'p?ipojen� selhalo', + 0 => 'bez chyb', // DB_OK + DB_ERROR_NEED_MORE_DATA => 'm�lo zdrojov�ch dat', + DB_ERROR_EXTENSION_NOT_FOUND=> 'roz?�?en� nenalezeno', + DB_ERROR_NOSUCHDB => 'datab�ze neexistuje', + DB_ERROR_ACCESS_VIOLATION => 'nedostate?n� pr�va' +); ?> \ No newline at end of file diff --git a/lib/adodb/lang/adodb-de.inc.php b/lib/adodb/lang/adodb-de.inc.php index 244cb2f66ae..44c57e9ff3e 100644 --- a/lib/adodb/lang/adodb-de.inc.php +++ b/lib/adodb/lang/adodb-de.inc.php @@ -1,33 +1,33 @@ - -$ADODB_LANG_ARRAY = array ( - 'LANG' => 'de', - DB_ERROR => 'Unbekannter Fehler', - DB_ERROR_ALREADY_EXISTS => 'existiert bereits', - DB_ERROR_CANNOT_CREATE => 'kann nicht erstellen', - DB_ERROR_CANNOT_DELETE => 'kann nicht löschen', - DB_ERROR_CANNOT_DROP => 'Tabelle oder Index konnte nicht gelöscht werden', - DB_ERROR_CONSTRAINT => 'Constraint Verletzung', - DB_ERROR_DIVZERO => 'Division durch Null', - DB_ERROR_INVALID => 'ung¨ltig', - DB_ERROR_INVALID_DATE => 'ung¨ltiges Datum oder Zeit', - DB_ERROR_INVALID_NUMBER => 'ung¨ltige Zahl', - DB_ERROR_MISMATCH => 'Unverträglichkeit', - DB_ERROR_NODBSELECTED => 'keine Dantebank ausgewählt', - DB_ERROR_NOSUCHFIELD => 'Feld nicht vorhanden', - DB_ERROR_NOSUCHTABLE => 'Tabelle nicht vorhanden', - DB_ERROR_NOT_CAPABLE => 'Funktion nicht installiert', - DB_ERROR_NOT_FOUND => 'nicht gefunden', - DB_ERROR_NOT_LOCKED => 'nicht gesperrt', - DB_ERROR_SYNTAX => 'Syntaxfehler', - DB_ERROR_UNSUPPORTED => 'nicht Unterst¨tzt', - DB_ERROR_VALUE_COUNT_ON_ROW => 'Anzahl der zur¨ckgelieferten Felder entspricht nicht der Anzahl der Felder in der Abfrage', - DB_ERROR_INVALID_DSN => 'ung¨ltiger DSN', - DB_ERROR_CONNECT_FAILED => 'Verbindung konnte nicht hergestellt werden', - 0 => 'kein Fehler', // DB_OK - DB_ERROR_NEED_MORE_DATA => 'Nicht gen¨gend Daten geliefert', - DB_ERROR_EXTENSION_NOT_FOUND=> 'erweiterung nicht gefunden', - DB_ERROR_NOSUCHDB => 'keine Datenbank', - DB_ERROR_ACCESS_VIOLATION => 'ungen¨gende Rechte' -); + +$ADODB_LANG_ARRAY = array ( + 'LANG' => 'de', + DB_ERROR => 'Unbekannter Fehler', + DB_ERROR_ALREADY_EXISTS => 'existiert bereits', + DB_ERROR_CANNOT_CREATE => 'kann nicht erstellen', + DB_ERROR_CANNOT_DELETE => 'kann nicht löschen', + DB_ERROR_CANNOT_DROP => 'Tabelle oder Index konnte nicht gelöscht werden', + DB_ERROR_CONSTRAINT => 'Constraint Verletzung', + DB_ERROR_DIVZERO => 'Division durch Null', + DB_ERROR_INVALID => 'ung¨ltig', + DB_ERROR_INVALID_DATE => 'ung¨ltiges Datum oder Zeit', + DB_ERROR_INVALID_NUMBER => 'ung¨ltige Zahl', + DB_ERROR_MISMATCH => 'Unverträglichkeit', + DB_ERROR_NODBSELECTED => 'keine Dantebank ausgewählt', + DB_ERROR_NOSUCHFIELD => 'Feld nicht vorhanden', + DB_ERROR_NOSUCHTABLE => 'Tabelle nicht vorhanden', + DB_ERROR_NOT_CAPABLE => 'Funktion nicht installiert', + DB_ERROR_NOT_FOUND => 'nicht gefunden', + DB_ERROR_NOT_LOCKED => 'nicht gesperrt', + DB_ERROR_SYNTAX => 'Syntaxfehler', + DB_ERROR_UNSUPPORTED => 'nicht Unterst¨tzt', + DB_ERROR_VALUE_COUNT_ON_ROW => 'Anzahl der zur¨ckgelieferten Felder entspricht nicht der Anzahl der Felder in der Abfrage', + DB_ERROR_INVALID_DSN => 'ung¨ltiger DSN', + DB_ERROR_CONNECT_FAILED => 'Verbindung konnte nicht hergestellt werden', + 0 => 'kein Fehler', // DB_OK + DB_ERROR_NEED_MORE_DATA => 'Nicht gen¨gend Daten geliefert', + DB_ERROR_EXTENSION_NOT_FOUND=> 'erweiterung nicht gefunden', + DB_ERROR_NOSUCHDB => 'keine Datenbank', + DB_ERROR_ACCESS_VIOLATION => 'ungen¨gende Rechte' +); ?> \ No newline at end of file diff --git a/lib/adodb/lang/adodb-fa.inc.php b/lib/adodb/lang/adodb-fa.inc.php index 5594313575e..a58a21cc6ce 100644 --- a/lib/adodb/lang/adodb-fa.inc.php +++ b/lib/adodb/lang/adodb-fa.inc.php @@ -1,35 +1,35 @@ - */ - -$ADODB_LANG_ARRAY = array ( - 'LANG' => 'fa', - DB_ERROR => 'خطای ناشناخته', - DB_ERROR_ALREADY_EXISTS => 'وجود دارد', - DB_ERROR_CANNOT_CREATE => 'امکان create وجود ندارد', - DB_ERROR_CANNOT_DELETE => 'امکان حذف وجود ندارد', - DB_ERROR_CANNOT_DROP => 'امکان drop وجود ندارد', - DB_ERROR_CONSTRAINT => 'نقض شرط', - DB_ERROR_DIVZERO => 'تقسیم بر صفر', - DB_ERROR_INVALID => 'نامعتبر', - DB_ERROR_INVALID_DATE => 'زمان یا تاریخ نامعتبر', - DB_ERROR_INVALID_NUMBER => 'عدد نامعتبر', - DB_ERROR_MISMATCH => 'عدم مطابقت', - DB_ERROR_NODBSELECTED => 'بانک اطلاعاتی انتخاب نشده است', - DB_ERROR_NOSUCHFIELD => 'چنین ستونی وجود ندارد', - DB_ERROR_NOSUCHTABLE => 'چنین جدولی وجود ندارد', - DB_ERROR_NOT_CAPABLE => 'backend بانک اطلاعاتی قادر نیست', - DB_ERROR_NOT_FOUND => 'پیدا نشد', - DB_ERROR_NOT_LOCKED => 'قفل نشده', - DB_ERROR_SYNTAX => 'خطای دستوری', - DB_ERROR_UNSUPPORTED => 'پشتیبانی نمی شود', - DB_ERROR_VALUE_COUNT_ON_ROW => 'شمارش مقادیر روی ردیف', - DB_ERROR_INVALID_DSN => 'DSN نامعتبر', - DB_ERROR_CONNECT_FAILED => 'ارتباط برقرار نشد', - 0 => 'بدون خطا', // DB_OK - DB_ERROR_NEED_MORE_DATA => 'داده ناکافی است', - DB_ERROR_EXTENSION_NOT_FOUND=> 'extension پیدا نشد', - DB_ERROR_NOSUCHDB => 'چنین بانک اطلاعاتی وجود ندارد', - DB_ERROR_ACCESS_VIOLATION => 'حق دسترسی ناکافی' -); + */ + +$ADODB_LANG_ARRAY = array ( + 'LANG' => 'fa', + DB_ERROR => 'خطای ناشناخته', + DB_ERROR_ALREADY_EXISTS => 'وجود دارد', + DB_ERROR_CANNOT_CREATE => 'امکان create وجود ندارد', + DB_ERROR_CANNOT_DELETE => 'امکان حذف وجود ندارد', + DB_ERROR_CANNOT_DROP => 'امکان drop وجود ندارد', + DB_ERROR_CONSTRAINT => 'نقض شرط', + DB_ERROR_DIVZERO => 'تقسیم بر صفر', + DB_ERROR_INVALID => 'نامعتبر', + DB_ERROR_INVALID_DATE => 'زمان یا تاریخ نامعتبر', + DB_ERROR_INVALID_NUMBER => 'عدد نامعتبر', + DB_ERROR_MISMATCH => 'عدم مطابقت', + DB_ERROR_NODBSELECTED => 'بانک اطلاعاتی انتخاب نشده است', + DB_ERROR_NOSUCHFIELD => 'چنین ستونی وجود ندارد', + DB_ERROR_NOSUCHTABLE => 'چنین جدولی وجود ندارد', + DB_ERROR_NOT_CAPABLE => 'backend بانک اطلاعاتی قادر نیست', + DB_ERROR_NOT_FOUND => 'پیدا نشد', + DB_ERROR_NOT_LOCKED => 'قفل نشده', + DB_ERROR_SYNTAX => 'خطای دستوری', + DB_ERROR_UNSUPPORTED => 'پشتیبانی نمی شود', + DB_ERROR_VALUE_COUNT_ON_ROW => 'شمارش مقادیر روی ردیف', + DB_ERROR_INVALID_DSN => 'DSN نامعتبر', + DB_ERROR_CONNECT_FAILED => 'ارتباط برقرار نشد', + 0 => 'بدون خطا', // DB_OK + DB_ERROR_NEED_MORE_DATA => 'داده ناکافی است', + DB_ERROR_EXTENSION_NOT_FOUND=> 'extension پیدا نشد', + DB_ERROR_NOSUCHDB => 'چنین بانک اطلاعاتی وجود ندارد', + DB_ERROR_ACCESS_VIOLATION => 'حق دسترسی ناکافی' +); ?> \ No newline at end of file diff --git a/lib/adodb/lang/adodb-fr.inc.php b/lib/adodb/lang/adodb-fr.inc.php index 066a2a5e5b7..11127cd60b6 100644 --- a/lib/adodb/lang/adodb-fr.inc.php +++ b/lib/adodb/lang/adodb-fr.inc.php @@ -1,33 +1,33 @@ - 'fr', - DB_ERROR => 'erreur inconnue', - DB_ERROR_ALREADY_EXISTS => 'existe déjà', - DB_ERROR_CANNOT_CREATE => 'crétion impossible', - DB_ERROR_CANNOT_DELETE => 'effacement impossible', - DB_ERROR_CANNOT_DROP => 'suppression impossible', - DB_ERROR_CONSTRAINT => 'violation de contrainte', - DB_ERROR_DIVZERO => 'division par zéro', - DB_ERROR_INVALID => 'invalide', - DB_ERROR_INVALID_DATE => 'date ou heure invalide', - DB_ERROR_INVALID_NUMBER => 'nombre invalide', - DB_ERROR_MISMATCH => 'erreur de concordance', - DB_ERROR_NODBSELECTED => 'pas de base de donnéessélectionnée', - DB_ERROR_NOSUCHFIELD => 'nom de colonne invalide', - DB_ERROR_NOSUCHTABLE => 'table ou vue inexistante', - DB_ERROR_NOT_CAPABLE => 'fonction optionnelle non installée', - DB_ERROR_NOT_FOUND => 'pas trouvé', - DB_ERROR_NOT_LOCKED => 'non verrouillé', - DB_ERROR_SYNTAX => 'erreur de syntaxe', - DB_ERROR_UNSUPPORTED => 'non supporté', - DB_ERROR_VALUE_COUNT_ON_ROW => 'valeur insérée trop grande pour colonne', - DB_ERROR_INVALID_DSN => 'DSN invalide', - DB_ERROR_CONNECT_FAILED => 'échec à la connexion', - 0 => "pas d'erreur", // DB_OK - DB_ERROR_NEED_MORE_DATA => 'données fournies insuffisantes', - DB_ERROR_EXTENSION_NOT_FOUND=> 'extension non trouvée', - DB_ERROR_NOSUCHDB => 'base de données inconnue', - DB_ERROR_ACCESS_VIOLATION => 'droits insuffisants' -); + 'fr', + DB_ERROR => 'erreur inconnue', + DB_ERROR_ALREADY_EXISTS => 'existe déjà', + DB_ERROR_CANNOT_CREATE => 'crétion impossible', + DB_ERROR_CANNOT_DELETE => 'effacement impossible', + DB_ERROR_CANNOT_DROP => 'suppression impossible', + DB_ERROR_CONSTRAINT => 'violation de contrainte', + DB_ERROR_DIVZERO => 'division par zéro', + DB_ERROR_INVALID => 'invalide', + DB_ERROR_INVALID_DATE => 'date ou heure invalide', + DB_ERROR_INVALID_NUMBER => 'nombre invalide', + DB_ERROR_MISMATCH => 'erreur de concordance', + DB_ERROR_NODBSELECTED => 'pas de base de donnéessélectionnée', + DB_ERROR_NOSUCHFIELD => 'nom de colonne invalide', + DB_ERROR_NOSUCHTABLE => 'table ou vue inexistante', + DB_ERROR_NOT_CAPABLE => 'fonction optionnelle non installée', + DB_ERROR_NOT_FOUND => 'pas trouvé', + DB_ERROR_NOT_LOCKED => 'non verrouillé', + DB_ERROR_SYNTAX => 'erreur de syntaxe', + DB_ERROR_UNSUPPORTED => 'non supporté', + DB_ERROR_VALUE_COUNT_ON_ROW => 'valeur insérée trop grande pour colonne', + DB_ERROR_INVALID_DSN => 'DSN invalide', + DB_ERROR_CONNECT_FAILED => 'échec à la connexion', + 0 => "pas d'erreur", // DB_OK + DB_ERROR_NEED_MORE_DATA => 'données fournies insuffisantes', + DB_ERROR_EXTENSION_NOT_FOUND=> 'extension non trouvée', + DB_ERROR_NOSUCHDB => 'base de données inconnue', + DB_ERROR_ACCESS_VIOLATION => 'droits insuffisants' +); ?> \ No newline at end of file diff --git a/lib/adodb/lang/adodb-it.inc.php b/lib/adodb/lang/adodb-it.inc.php index 20c5b93b630..ac5cc5a7d96 100644 --- a/lib/adodb/lang/adodb-it.inc.php +++ b/lib/adodb/lang/adodb-it.inc.php @@ -1,34 +1,34 @@ - 'it', - DB_ERROR => 'errore sconosciuto', - DB_ERROR_ALREADY_EXISTS => 'esiste già', - DB_ERROR_CANNOT_CREATE => 'non posso creare', - DB_ERROR_CANNOT_DELETE => 'non posso cancellare', - DB_ERROR_CANNOT_DROP => 'non posso eliminare', - DB_ERROR_CONSTRAINT => 'violazione constraint', - DB_ERROR_DIVZERO => 'divisione per zero', - DB_ERROR_INVALID => 'non valido', - DB_ERROR_INVALID_DATE => 'data od ora non valida', - DB_ERROR_INVALID_NUMBER => 'numero non valido', - DB_ERROR_MISMATCH => 'diversi', - DB_ERROR_NODBSELECTED => 'nessun database selezionato', - DB_ERROR_NOSUCHFIELD => 'nessun campo trovato', - DB_ERROR_NOSUCHTABLE => 'nessuna tabella trovata', - DB_ERROR_NOT_CAPABLE => 'DB backend non abilitato', - DB_ERROR_NOT_FOUND => 'non trovato', - DB_ERROR_NOT_LOCKED => 'non bloccato', - DB_ERROR_SYNTAX => 'errore di sintassi', - DB_ERROR_UNSUPPORTED => 'non supportato', - DB_ERROR_VALUE_COUNT_ON_ROW => 'valore inserito troppo grande per una colonna', - DB_ERROR_INVALID_DSN => 'DSN non valido', - DB_ERROR_CONNECT_FAILED => 'connessione fallita', - 0 => 'nessun errore', // DB_OK - DB_ERROR_NEED_MORE_DATA => 'dati inseriti insufficienti', - DB_ERROR_EXTENSION_NOT_FOUND=> 'estensione non trovata', - DB_ERROR_NOSUCHDB => 'database non trovato', - DB_ERROR_ACCESS_VIOLATION => 'permessi insufficienti' -); + 'it', + DB_ERROR => 'errore sconosciuto', + DB_ERROR_ALREADY_EXISTS => 'esiste già', + DB_ERROR_CANNOT_CREATE => 'non posso creare', + DB_ERROR_CANNOT_DELETE => 'non posso cancellare', + DB_ERROR_CANNOT_DROP => 'non posso eliminare', + DB_ERROR_CONSTRAINT => 'violazione constraint', + DB_ERROR_DIVZERO => 'divisione per zero', + DB_ERROR_INVALID => 'non valido', + DB_ERROR_INVALID_DATE => 'data od ora non valida', + DB_ERROR_INVALID_NUMBER => 'numero non valido', + DB_ERROR_MISMATCH => 'diversi', + DB_ERROR_NODBSELECTED => 'nessun database selezionato', + DB_ERROR_NOSUCHFIELD => 'nessun campo trovato', + DB_ERROR_NOSUCHTABLE => 'nessuna tabella trovata', + DB_ERROR_NOT_CAPABLE => 'DB backend non abilitato', + DB_ERROR_NOT_FOUND => 'non trovato', + DB_ERROR_NOT_LOCKED => 'non bloccato', + DB_ERROR_SYNTAX => 'errore di sintassi', + DB_ERROR_UNSUPPORTED => 'non supportato', + DB_ERROR_VALUE_COUNT_ON_ROW => 'valore inserito troppo grande per una colonna', + DB_ERROR_INVALID_DSN => 'DSN non valido', + DB_ERROR_CONNECT_FAILED => 'connessione fallita', + 0 => 'nessun errore', // DB_OK + DB_ERROR_NEED_MORE_DATA => 'dati inseriti insufficienti', + DB_ERROR_EXTENSION_NOT_FOUND=> 'estensione non trovata', + DB_ERROR_NOSUCHDB => 'database non trovato', + DB_ERROR_ACCESS_VIOLATION => 'permessi insufficienti' +); ?> \ No newline at end of file diff --git a/lib/adodb/lang/adodb-ru1251.inc.php b/lib/adodb/lang/adodb-ru1251.inc.php index 3a20538a020..1ccdde89f4c 100644 --- a/lib/adodb/lang/adodb-ru1251.inc.php +++ b/lib/adodb/lang/adodb-ru1251.inc.php @@ -1,35 +1,35 @@ - 'ru1251', - DB_ERROR => ' ', - DB_ERROR_ALREADY_EXISTS => ' ', - DB_ERROR_CANNOT_CREATE => ' ', - DB_ERROR_CANNOT_DELETE => ' ', - DB_ERROR_CANNOT_DROP => ' (drop)', - DB_ERROR_CONSTRAINT => ' ', - DB_ERROR_DIVZERO => ' 0', - DB_ERROR_INVALID => '', - DB_ERROR_INVALID_DATE => ' ', - DB_ERROR_INVALID_NUMBER => ' ', - DB_ERROR_MISMATCH => '', - DB_ERROR_NODBSELECTED => ' ', - DB_ERROR_NOSUCHFIELD => ' ', - DB_ERROR_NOSUCHTABLE => ' ', - DB_ERROR_NOT_CAPABLE => ' ', - DB_ERROR_NOT_FOUND => ' ', - DB_ERROR_NOT_LOCKED => ' ', - DB_ERROR_SYNTAX => ' ', - DB_ERROR_UNSUPPORTED => ' ', - DB_ERROR_VALUE_COUNT_ON_ROW => ' ', - DB_ERROR_INVALID_DSN => ' DSN', - DB_ERROR_CONNECT_FAILED => ' ', - 0 => ' ', // DB_OK - DB_ERROR_NEED_MORE_DATA => ' ', - DB_ERROR_EXTENSION_NOT_FOUND=> ' ', - DB_ERROR_NOSUCHDB => ' ', - DB_ERROR_ACCESS_VIOLATION => ' ' -); + 'ru1251', + DB_ERROR => '����������� ������', + DB_ERROR_ALREADY_EXISTS => '��� ����������', + DB_ERROR_CANNOT_CREATE => '���������� �������', + DB_ERROR_CANNOT_DELETE => '���������� �������', + DB_ERROR_CANNOT_DROP => '���������� ������� (drop)', + DB_ERROR_CONSTRAINT => '��������� ������� ��������', + DB_ERROR_DIVZERO => '������� �� 0', + DB_ERROR_INVALID => '�����������', + DB_ERROR_INVALID_DATE => '������������ ���� ��� �����', + DB_ERROR_INVALID_NUMBER => '������������ �����', + DB_ERROR_MISMATCH => '������', + DB_ERROR_NODBSELECTED => '�� �� �������', + DB_ERROR_NOSUCHFIELD => '�� ���������� ����', + DB_ERROR_NOSUCHTABLE => '�� ���������� �������', + DB_ERROR_NOT_CAPABLE => '���� �� � ���������', + DB_ERROR_NOT_FOUND => '�� �������', + DB_ERROR_NOT_LOCKED => '�� �������������', + DB_ERROR_SYNTAX => '�������������� ������', + DB_ERROR_UNSUPPORTED => '�� ��������������', + DB_ERROR_VALUE_COUNT_ON_ROW => '������� �������� � ������', + DB_ERROR_INVALID_DSN => '������������ DSN', + DB_ERROR_CONNECT_FAILED => '���������� ���������', + 0 => '��� ������', // DB_OK + DB_ERROR_NEED_MORE_DATA => '������������� ������������ ������', + DB_ERROR_EXTENSION_NOT_FOUND=> '���������� �� �������', + DB_ERROR_NOSUCHDB => '�� ���������� ��', + DB_ERROR_ACCESS_VIOLATION => '������������ ���� �������' +); ?> \ No newline at end of file diff --git a/lib/adodb/lang/adodb-sv.inc.php b/lib/adodb/lang/adodb-sv.inc.php index a9fd69816c4..268644afe6d 100644 --- a/lib/adodb/lang/adodb-sv.inc.php +++ b/lib/adodb/lang/adodb-sv.inc.php @@ -1,33 +1,33 @@ - 'en', - DB_ERROR => 'Oknt fel', - DB_ERROR_ALREADY_EXISTS => 'finns redan', - DB_ERROR_CANNOT_CREATE => 'kan inte skapa', - DB_ERROR_CANNOT_DELETE => 'kan inte ta bort', - DB_ERROR_CANNOT_DROP => 'kan inte slppa', - DB_ERROR_CONSTRAINT => 'begrnsning krnkt', - DB_ERROR_DIVZERO => 'division med noll', - DB_ERROR_INVALID => 'ogiltig', - DB_ERROR_INVALID_DATE => 'ogiltigt datum eller tid', - DB_ERROR_INVALID_NUMBER => 'ogiltigt tal', - DB_ERROR_MISMATCH => 'felaktig matchning', - DB_ERROR_NODBSELECTED => 'ingen databas vald', - DB_ERROR_NOSUCHFIELD => 'inget sdant flt', - DB_ERROR_NOSUCHTABLE => 'ingen sdan tabell', - DB_ERROR_NOT_CAPABLE => 'DB backend klarar det inte', - DB_ERROR_NOT_FOUND => 'finns inte', - DB_ERROR_NOT_LOCKED => 'inte lst', - DB_ERROR_SYNTAX => 'syntaxfel', - DB_ERROR_UNSUPPORTED => 'stds ej', - DB_ERROR_VALUE_COUNT_ON_ROW => 'vrde rknat p rad', - DB_ERROR_INVALID_DSN => 'ogiltig DSN', - DB_ERROR_CONNECT_FAILED => 'anslutning misslyckades', - 0 => 'inget fel', // DB_OK - DB_ERROR_NEED_MORE_DATA => 'otillrckligt med data angivet', - DB_ERROR_EXTENSION_NOT_FOUND=> 'utkning hittades ej', - DB_ERROR_NOSUCHDB => 'ingen sdan databas', - DB_ERROR_ACCESS_VIOLATION => 'otillrckliga rttigheter' -); + 'en', + DB_ERROR => 'Ok�nt fel', + DB_ERROR_ALREADY_EXISTS => 'finns redan', + DB_ERROR_CANNOT_CREATE => 'kan inte skapa', + DB_ERROR_CANNOT_DELETE => 'kan inte ta bort', + DB_ERROR_CANNOT_DROP => 'kan inte sl�ppa', + DB_ERROR_CONSTRAINT => 'begr�nsning kr�nkt', + DB_ERROR_DIVZERO => 'division med noll', + DB_ERROR_INVALID => 'ogiltig', + DB_ERROR_INVALID_DATE => 'ogiltigt datum eller tid', + DB_ERROR_INVALID_NUMBER => 'ogiltigt tal', + DB_ERROR_MISMATCH => 'felaktig matchning', + DB_ERROR_NODBSELECTED => 'ingen databas vald', + DB_ERROR_NOSUCHFIELD => 'inget s�dant f�lt', + DB_ERROR_NOSUCHTABLE => 'ingen s�dan tabell', + DB_ERROR_NOT_CAPABLE => 'DB backend klarar det inte', + DB_ERROR_NOT_FOUND => 'finns inte', + DB_ERROR_NOT_LOCKED => 'inte l�st', + DB_ERROR_SYNTAX => 'syntaxfel', + DB_ERROR_UNSUPPORTED => 'st�ds ej', + DB_ERROR_VALUE_COUNT_ON_ROW => 'v�rde r�knat p� rad', + DB_ERROR_INVALID_DSN => 'ogiltig DSN', + DB_ERROR_CONNECT_FAILED => 'anslutning misslyckades', + 0 => 'inget fel', // DB_OK + DB_ERROR_NEED_MORE_DATA => 'otillr�ckligt med data angivet', + DB_ERROR_EXTENSION_NOT_FOUND=> 'ut�kning hittades ej', + DB_ERROR_NOSUCHDB => 'ingen s�dan databas', + DB_ERROR_ACCESS_VIOLATION => 'otillr�ckliga r�ttigheter' +); ?> \ No newline at end of file diff --git a/lib/adodb/license.txt b/lib/adodb/license.txt index 2353871c041..9821fcb7642 100644 --- a/lib/adodb/license.txt +++ b/lib/adodb/license.txt @@ -1,182 +1,182 @@ -ADOdb is dual licensed using BSD and LGPL. - -In plain English, you do not need to distribute your application in source code form, nor do you need to distribute ADOdb source code, provided you follow the rest of terms of the BSD license. - -For more info about ADOdb, visit http://adodb.sourceforge.net/ - -BSD Style-License -================= - -Copyright (c) 2000, 2001, 2002, 2003, 2004 John Lim -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -Redistributions of source code must retain the above copyright notice, this list -of conditions and the following disclaimer. - -Redistributions in binary form must reproduce the above copyright notice, this list -of conditions and the following disclaimer in the documentation and/or other materials -provided with the distribution. - -Neither the name of the John Lim nor the names of its contributors may be used to -endorse or promote products derived from this software without specific prior written -permission. - -DISCLAIMER: -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -JOHN LIM OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -========================================================== -GNU LESSER GENERAL PUBLIC LICENSE -Version 2.1, February 1999 - -Copyright (C) 1991, 1999 Free Software Foundation, Inc. -59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -Everyone is permitted to copy and distribute verbatim copies -of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - -Preamble -The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. - -This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. - -When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. - -To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. - -For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. - -We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. - -To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. - -Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. - -Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. - -When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. - -We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. - -For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. - -In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. - -Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. - -The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. - - -TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION -0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". - -A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. - -The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) - -"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. - -Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. - -1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. - -You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. - -2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: - - -a) The modified work must itself be a software library. -b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. -c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. -d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. -(For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. - -3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. - -Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. - -This option is useful when you wish to copy part of the code of the Library into a program that is not a library. - -4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. - -If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. - -5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. - -However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. - -When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. - -If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) - -Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. - -6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. - -You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: - - -a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) -b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. -c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. -d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. -e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. -For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. - -It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. - -7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: - - -a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. -b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. -8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. - -9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. - -10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. - -11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. - -This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. - -12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. - -13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. - -14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. - -NO WARRANTY - -15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - -16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - - +ADOdb is dual licensed using BSD and LGPL. + +In plain English, you do not need to distribute your application in source code form, nor do you need to distribute ADOdb source code, provided you follow the rest of terms of the BSD license. + +For more info about ADOdb, visit http://adodb.sourceforge.net/ + +BSD Style-License +================= + +Copyright (c) 2000, 2001, 2002, 2003, 2004 John Lim +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list +of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright notice, this list +of conditions and the following disclaimer in the documentation and/or other materials +provided with the distribution. + +Neither the name of the John Lim nor the names of its contributors may be used to +endorse or promote products derived from this software without specific prior written +permission. + +DISCLAIMER: +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +JOHN LIM OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +========================================================== +GNU LESSER GENERAL PUBLIC LICENSE +Version 2.1, February 1999 + +Copyright (C) 1991, 1999 Free Software Foundation, Inc. +59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + +Preamble +The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. + +This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. + +When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. + +To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. + +For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. + +We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. + +To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. + +Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. + +Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. + +When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. + +We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. + +For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. + +In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. + +Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. + +The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. + + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". + +A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. + +The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) + +"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. + +Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. + +1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. + +You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: + + +a) The modified work must itself be a software library. +b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. +c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. +d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. +(For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. + +3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. + +Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. + +This option is useful when you wish to copy part of the code of the Library into a program that is not a library. + +4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. + +If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. + +5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. + +However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. + +When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. + +If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) + +Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. + +6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. + +You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: + + +a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) +b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. +c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. +d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. +e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. +For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. + +It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. + +7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: + + +a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. +b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. +8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. + +9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. + +10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. + +11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. + +This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. + +12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. + +13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. + +14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. + +NO WARRANTY + +15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/lib/adodb/readme.txt b/lib/adodb/readme.txt index 97bdd9eab41..009b94c5117 100644 --- a/lib/adodb/readme.txt +++ b/lib/adodb/readme.txt @@ -1,62 +1,62 @@ ->> ADODB Library for PHP4 - -(c) 2000-2004 John Lim (jlim@natsoft.com.my) - -Released under both BSD and GNU Lesser GPL library license. -This means you can use it in proprietary products. - - ->> Introduction - -PHP's database access functions are not standardised. This creates a -need for a database class library to hide the differences between the -different databases (encapsulate the differences) so we can easily -switch databases. - -We currently support MySQL, Interbase, Sybase, PostgreSQL, Oracle, -Microsoft SQL server, Foxpro ODBC, Access ODBC, Informix, DB2, -Sybase SQL Anywhere, generic ODBC and Microsoft's ADO. - -We hope more people will contribute drivers to support other databases. - - ->> Documentation and Examples - -Refer to the adodb/docs directory for full documentation and examples. -There is also a tutorial tute.htm that contrasts ADODB code with -mysql code. - - ->>> Files -Adodb.inc.php is the main file. You need to include only this file. - -Adodb-*.inc.php are the database specific driver code. - -Test.php contains a list of test commands to exercise the class library. - -Adodb-session.php is the PHP4 session handling code. - -Testdatabases.inc.php contains the list of databases to apply the tests on. - -Benchmark.php is a simple benchmark to test the throughput of a simple SELECT -statement for databases described in testdatabases.inc.php. The benchmark -tables are created in test.php. - -readme.htm is the main documentation. - -tute.htm is the tutorial. - - ->> More Info - -For more information, including installation see readme.htm -or visit - http://adodb.sourceforge.net/ - - ->> Feature Requests and Bug Reports - -Email to jlim@natsoft.com.my - - +>> ADODB Library for PHP4 + +(c) 2000-2004 John Lim (jlim@natsoft.com.my) + +Released under both BSD and GNU Lesser GPL library license. +This means you can use it in proprietary products. + + +>> Introduction + +PHP's database access functions are not standardised. This creates a +need for a database class library to hide the differences between the +different databases (encapsulate the differences) so we can easily +switch databases. + +We currently support MySQL, Interbase, Sybase, PostgreSQL, Oracle, +Microsoft SQL server, Foxpro ODBC, Access ODBC, Informix, DB2, +Sybase SQL Anywhere, generic ODBC and Microsoft's ADO. + +We hope more people will contribute drivers to support other databases. + + +>> Documentation and Examples + +Refer to the adodb/docs directory for full documentation and examples. +There is also a tutorial tute.htm that contrasts ADODB code with +mysql code. + + +>>> Files +Adodb.inc.php is the main file. You need to include only this file. + +Adodb-*.inc.php are the database specific driver code. + +Test.php contains a list of test commands to exercise the class library. + +Adodb-session.php is the PHP4 session handling code. + +Testdatabases.inc.php contains the list of databases to apply the tests on. + +Benchmark.php is a simple benchmark to test the throughput of a simple SELECT +statement for databases described in testdatabases.inc.php. The benchmark +tables are created in test.php. + +readme.htm is the main documentation. + +tute.htm is the tutorial. + + +>> More Info + +For more information, including installation see readme.htm +or visit + http://adodb.sourceforge.net/ + + +>> Feature Requests and Bug Reports + +Email to jlim@natsoft.com.my + + \ No newline at end of file diff --git a/lib/adodb/xmlschema03.dtd b/lib/adodb/xmlschema03.dtd index a7c8864ffb9..97850bc7f68 100644 --- a/lib/adodb/xmlschema03.dtd +++ b/lib/adodb/xmlschema03.dtd @@ -1,43 +1,43 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]> \ No newline at end of file diff --git a/lib/alfresco/Service/Association.php b/lib/alfresco/Service/Association.php index 9892d9f723e..74c96f5eab9 100755 --- a/lib/alfresco/Service/Association.php +++ b/lib/alfresco/Service/Association.php @@ -1,57 +1,57 @@ -_from = $from; - $this->_to = $to; - $this->_type = $type; - } - - public function getFrom() - { - return $this->_from; - } - - public function getTo() - { - return $this->_to; - } - - public function getType() - { - return $this->_type; - } -} - -?> +_from = $from; + $this->_to = $to; + $this->_type = $type; + } + + public function getFrom() + { + return $this->_from; + } + + public function getTo() + { + return $this->_to; + } + + public function getType() + { + return $this->_type; + } +} + +?> diff --git a/lib/alfresco/Service/BaseObject.php b/lib/alfresco/Service/BaseObject.php index 355021573c8..db0d71e6ef2 100755 --- a/lib/alfresco/Service/BaseObject.php +++ b/lib/alfresco/Service/BaseObject.php @@ -1,147 +1,147 @@ -$methodName(); - } - } - - public function __set($name, $value) - { - $methodName = $name; - $methodName[0] = strtoupper($methodName[0]); - $methodName = 'set' . $methodName; - - if (method_exists($this, $methodName) == true) - { - return $this->$methodName($value); - } - } - - protected function resultSetToNodes($session, $store, $resultSet) - { - $return = array(); - if (isset($resultSet->rows) == true) - { - if (is_array($resultSet->rows) == true) - { - foreach($resultSet->rows as $row) - { - $id = $row->node->id; - $return[] = $session->getNode($store, $id); - } - } - else - { - $id = $resultSet->rows->node->id; - $return[] = $session->getNode($store, $id); - } - } - - return $return; - } - - protected function resultSetToMap($resultSet) - { - $return = array(); - if (isset($resultSet->rows) == true) - { - if (is_array($resultSet->rows) == true) - { - foreach($resultSet->rows as $row) - { - $return[] = $this->columnsToMap($row->columns); - } - } - else - { - $return[] = $this->columnsToMap($resultSet->rows->columns); - } - - } - - return $return; - } - - private function columnsToMap($columns) - { - $return = array(); - - foreach ($columns as $column) - { - $return[$column->name] = $column->value; - } - - return $return; - } - - protected function remove_array_value($value, &$array) - { - if ($array != null) - { - if (in_array($value, $array) == true) - { - foreach ($array as $index=>$value2) - { - if ($value == $value2) - { - unset($array[$index]); - } - } - } - } - } - - protected function isContentData($value) - { - $index = strpos($value, "contentUrl="); - if ($index === false) - { - return false; - } - else - { - if ($index == 0) - { - return true; - } - else - { - return false; - } - } - } -} +$methodName(); + } + } + + public function __set($name, $value) + { + $methodName = $name; + $methodName[0] = strtoupper($methodName[0]); + $methodName = 'set' . $methodName; + + if (method_exists($this, $methodName) == true) + { + return $this->$methodName($value); + } + } + + protected function resultSetToNodes($session, $store, $resultSet) + { + $return = array(); + if (isset($resultSet->rows) == true) + { + if (is_array($resultSet->rows) == true) + { + foreach($resultSet->rows as $row) + { + $id = $row->node->id; + $return[] = $session->getNode($store, $id); + } + } + else + { + $id = $resultSet->rows->node->id; + $return[] = $session->getNode($store, $id); + } + } + + return $return; + } + + protected function resultSetToMap($resultSet) + { + $return = array(); + if (isset($resultSet->rows) == true) + { + if (is_array($resultSet->rows) == true) + { + foreach($resultSet->rows as $row) + { + $return[] = $this->columnsToMap($row->columns); + } + } + else + { + $return[] = $this->columnsToMap($resultSet->rows->columns); + } + + } + + return $return; + } + + private function columnsToMap($columns) + { + $return = array(); + + foreach ($columns as $column) + { + $return[$column->name] = $column->value; + } + + return $return; + } + + protected function remove_array_value($value, &$array) + { + if ($array != null) + { + if (in_array($value, $array) == true) + { + foreach ($array as $index=>$value2) + { + if ($value == $value2) + { + unset($array[$index]); + } + } + } + } + } + + protected function isContentData($value) + { + $index = strpos($value, "contentUrl="); + if ($index === false) + { + return false; + } + else + { + if ($index == 0) + { + return true; + } + else + { + return false; + } + } + } +} ?> \ No newline at end of file diff --git a/lib/alfresco/Service/ChildAssociation.php b/lib/alfresco/Service/ChildAssociation.php index d856ddd4649..b9f4adc3af8 100755 --- a/lib/alfresco/Service/ChildAssociation.php +++ b/lib/alfresco/Service/ChildAssociation.php @@ -1,76 +1,76 @@ -_parent = $parent; - $this->_child = $child; - $this->_type = $type; - $this->_name = $name; - $this->_isPrimary = $isPrimary; - $this->_nthSibling = $nthSibling; - } - - public function getParent() - { - return $this->_parent; - } - - public function getChild() - { - return $this->_child; - } - - public function getType() - { - return $this->_type; - } - - public function getName() - { - return $this->_name; - } - - public function getIsPrimary() - { - return $this->_isPrimary; - } - - public function getNthSibling() - { - return $this->_nthSibling; - } -} -?> +_parent = $parent; + $this->_child = $child; + $this->_type = $type; + $this->_name = $name; + $this->_isPrimary = $isPrimary; + $this->_nthSibling = $nthSibling; + } + + public function getParent() + { + return $this->_parent; + } + + public function getChild() + { + return $this->_child; + } + + public function getType() + { + return $this->_type; + } + + public function getName() + { + return $this->_name; + } + + public function getIsPrimary() + { + return $this->_isPrimary; + } + + public function getNthSibling() + { + return $this->_nthSibling; + } +} +?> diff --git a/lib/alfresco/Service/NamespaceMap.php b/lib/alfresco/Service/NamespaceMap.php index 9ca8a583d6c..c08ce590b7b 100755 --- a/lib/alfresco/Service/NamespaceMap.php +++ b/lib/alfresco/Service/NamespaceMap.php @@ -1,121 +1,121 @@ - "http://www.alfresco.org/model/dictionary/1.0", - "sys" => "http://www.alfresco.org/model/system/1.0", - "cm" => "http://www.alfresco.org/model/content/1.0", - "app" => "http://www.alfresco.org/model/application/1.0", - "bpm" => "http://www.alfresco.org/model/bpm/1.0", - "wf" => "http://www.alfresco.org/model/workflow/1.0", - "fm" => "http://www.alfresco.org/model/forum/1.0", - "view" => "http://www.alfresco.org/view/repository/1.0", - "security" => "http://www.alfresco.org/model/security/1.0", - "wcm" => "http://www.alfresco.org/model/wcmmodel/1.0", - "wca" => "http://www.alfresco.org/model/wcmappmodel/1.0"); - - public function isShortName($shortName) - { - return ($shortName != $this->getFullName($shortName)); - } - - public function getFullName($shortName) - { - $result = $shortName; - - $index = strpos($shortName, NamespaceMap::DELIMITER); - if ($index !== false) - { - $prefix = substr($shortName, 0, $index); - - if (isset($this->namespaceMap[$prefix]) == true) - { - $url = $this->namespaceMap[$prefix]; - $name = substr($shortName, $index+1); - $name = str_replace("_", "-", $name); - if ($name != null && strlen($name) != 0) - { - $result = "{".$url."}".$name; - } - } - } - - return $result; - } - - public function getFullNames($fullNames) - { - $result = array(); - - foreach ($fullNames as $fullName) - { - $result[] = $this->getFullName($fullName); - } - return $result; - } - - public function getShortName($fullName) - { - $result = $fullName; - - $index = strpos($fullName, "}"); - if ($index !== false) - { - $url = substr($fullName, 1, $index-1); - $prefix = $this->lookupPrefix($url); - if ($prefix != null) - { - $name = substr($fullName, $index+1); - if ($name != null && strlen($name) != 0) - { - $name = str_replace("-", "_", $name); - $result = $prefix.NamespaceMap::DELIMITER.$name; - } - } - } - - return $result; - } - - private function lookupPrefix($value) - { - $result = null; - foreach($this->namespaceMap as $prefix => $url) - { - if ($url == $value) - { - $result = $prefix; - } - } - return $result; - } -} - -?> + "http://www.alfresco.org/model/dictionary/1.0", + "sys" => "http://www.alfresco.org/model/system/1.0", + "cm" => "http://www.alfresco.org/model/content/1.0", + "app" => "http://www.alfresco.org/model/application/1.0", + "bpm" => "http://www.alfresco.org/model/bpm/1.0", + "wf" => "http://www.alfresco.org/model/workflow/1.0", + "fm" => "http://www.alfresco.org/model/forum/1.0", + "view" => "http://www.alfresco.org/view/repository/1.0", + "security" => "http://www.alfresco.org/model/security/1.0", + "wcm" => "http://www.alfresco.org/model/wcmmodel/1.0", + "wca" => "http://www.alfresco.org/model/wcmappmodel/1.0"); + + public function isShortName($shortName) + { + return ($shortName != $this->getFullName($shortName)); + } + + public function getFullName($shortName) + { + $result = $shortName; + + $index = strpos($shortName, NamespaceMap::DELIMITER); + if ($index !== false) + { + $prefix = substr($shortName, 0, $index); + + if (isset($this->namespaceMap[$prefix]) == true) + { + $url = $this->namespaceMap[$prefix]; + $name = substr($shortName, $index+1); + $name = str_replace("_", "-", $name); + if ($name != null && strlen($name) != 0) + { + $result = "{".$url."}".$name; + } + } + } + + return $result; + } + + public function getFullNames($fullNames) + { + $result = array(); + + foreach ($fullNames as $fullName) + { + $result[] = $this->getFullName($fullName); + } + return $result; + } + + public function getShortName($fullName) + { + $result = $fullName; + + $index = strpos($fullName, "}"); + if ($index !== false) + { + $url = substr($fullName, 1, $index-1); + $prefix = $this->lookupPrefix($url); + if ($prefix != null) + { + $name = substr($fullName, $index+1); + if ($name != null && strlen($name) != 0) + { + $name = str_replace("-", "_", $name); + $result = $prefix.NamespaceMap::DELIMITER.$name; + } + } + } + + return $result; + } + + private function lookupPrefix($value) + { + $result = null; + foreach($this->namespaceMap as $prefix => $url) + { + if ($url == $value) + { + $result = $prefix; + } + } + return $result; + } +} + +?> diff --git a/lib/alfresco/Service/Node.php b/lib/alfresco/Service/Node.php index 4508fe6ea28..9fa0fa58b1b 100755 --- a/lib/alfresco/Service/Node.php +++ b/lib/alfresco/Service/Node.php @@ -1,815 +1,815 @@ -_session = $session; - $this->_store = $store; - $this->_id = $id; - $this->_isNewNode = false; - $this->addedChildren = array(); - $this->addedParents = array(); - $this->addedAssociations = array(); - } - - /** - * Util method to create a node from a web service node structure. - */ - public static function createFromWebServiceData($session, $webServiceNode) - { - $scheme = $webServiceNode->reference->store->scheme; - $address = $webServiceNode->reference->store->address; - $id = $webServiceNode->reference->uuid; - - $store = $session->getStore($address, $scheme); - $node = $session->getNode($store, $id); - $node->populateFromWebServiceNode($webServiceNode); - - return $node; - } - - public function setPropertyValues($properties) - { - // Check that the properties of the node have been populated - $this->populateProperties(); - - // Set the property values - foreach ($properties as $name=>$value) - { - $name = $this->_session->namespaceMap->getFullName($name); - $this->_properties[$name] = $value; - } - } - - public function updateContent($property, $mimetype, $encoding="UTF-8", $content=null) - { - list($property) = $this->_session->namespaceMap->getFullNames(array($property)); - $contentData = new ContentData($this, $property, $mimetype, $encoding); - if ($content != null) - { - $contentData->content = $content; - } - $this->_properties[$property] = $contentData; - - return $contentData; - } - - public function hasAspect($aspect) - { - list($aspect) = $this->_session->namespaceMap->getFullNames(array($aspect)); - $this->populateProperties(); - return in_array($aspect, $this->_aspects); - } - - public function addAspect($aspect, $properties = null) - { - list($aspect) = $this->_session->namespaceMap->getFullNames(array($aspect)); - $this->populateProperties(); - - if (in_array($aspect, $this->_aspects) == false) - { - $this->_aspects[] = $aspect; - if ($properties != null) - { - foreach ($properties as $name=>$value) - { - $name = $this->_session->namespaceMap->getFullName($name); - $this->_properties[$name] = $value; - } - } - - $this->remove_array_value($aspect, $this->removedAspects); - $this->addedAspects[] = $aspect; - } - } - - public function removeAspect($aspect) - { - list($aspect) = $this->_session->namespaceMap->getFullNames(array($aspect)); - $this->populateProperties(); - - if (in_array($aspect, $this->_aspects) == true) - { - $this->remove_array_value($aspect, $this->_aspects); - $this->remove_array_value($aspect, $this->addedAspects); - $this->removedAspects[] = $aspect; - } - } - - public function createChild($type, $associationType, $associationName) - { - list($type, $associationType, $associationName) = $this->_session->namespaceMap->getFullNames(array($type, $associationType, $associationName)); - - $id = $this->_session->nextSessionId(); - $newNode = new Node($this->_session, $this->_store, $id); - $childAssociation = new ChildAssociation($this, $newNode, $associationType, $associationName, true); - - $newNode->_isNewNode = true; - - $newNode->_properties = array(); - $newNode->_aspects = array(); - $newNode->_properties = array(); - $newNode->_children = array(); - $newNode->origionalProperties = array(); - $newNode->addedAspects = array(); - $newNode->removedAspects = array(); - - $newNode->_type = $type; - $newNode->_parents = array(); - $newNode->addedParents = array($this->__toString() => $childAssociation); - $newNode->_primaryParent = $this; - - $this->addedChildren[$newNode->__toString()] = $childAssociation; - - $this->_session->addNode($newNode); - - return $newNode; - } - - public function addChild($node, $associationType, $associationName) - { - list($associationType, $associationName) = $this->_session->namespaceMap->getFullNames(array($associationType, $associationName)); - - $childAssociation = new ChildAssociation($this, $node, $associationType, $associationName, false); - $this->addedChildren[$node->__toString()] = $childAssociation; - $node->addedParents[$this->__toString()] = $childAssociation; - } - - public function removeChild($childAssociation) - { - - } - - public function addAssociation($to, $associationType) - { - list($associationType) = $this->_session->namespaceMap->getFullNames(array($associationType)); - - $association = new Association($this, $to, $associationType); - $this->addedAssociations[$to->__toString()] = $association; - } - - public function removeAssociation($association) - { - - } - - public function createVersion($description=null, $major=false) - { - // We can only create a version if there are no outstanding changes for this node - if ($this->isDirty() == true) - { - throw new Exception("You must save any outstanding modifications before a new version can be created."); - } - - // TODO implement major flag ... - - $client = WebServiceFactory::getAuthoringService($this->_session->repository->connectionUrl, $this->_session->ticket); - $result = $client->createVersion( - array("items" => array("nodes" => $this->__toArray()), - "comments" => array("name" => "description", "value" => $description), - "versionChildren" => false)); - - // Clear the properties and aspects - $this->_properties = null; - $this->_aspects = null; - - // Get the version details - // TODO get some of the other details too ... - $versionId = $result->createVersionReturn->versions->id->uuid; - $versionStoreScheme = $result->createVersionReturn->versions->id->store->scheme; - $versionStoreAddress = $result->createVersionReturn->versions->id->store->address; - - // Create the version object to return - return new Version($this->_session, new Store($this->_session, $versionStoreAddress, $versionStoreScheme), $versionId); - } - - private function isDirty() - { - $result = true; - if ($this->_isNewNode == false && - count($this->getModifiedProperties()) == 0 && - ($this->addedAspects == null || count($this->addedAspects) == 0) && - ($this->removedAssociations == null || count($this->removedAssociations) == 0) && - ($this->addedChildren == null || count($this->addedChildren) == 0) && - ($this->addedAssociations == null || count($this->addedAssociations) == 0)) - { - $result = false; - } - return $result; - } - - public function __get($name) - { - $fullName = $this->_session->namespaceMap->getFullName($name); - if ($fullName != $name) - { - $this->populateProperties(); - if (array_key_exists($fullName, $this->_properties) == true) - { - return $this->_properties[$fullName]; - } - else - { - return null; - } - } - else - { - return parent::__get($name); - } - } - - public function __set($name, $value) - { - $fullName = $this->_session->namespaceMap->getFullName($name); - if ($fullName != $name) - { - $this->populateProperties(); - $this->_properties[$fullName] = $value; - - // Ensure that the node and property details are stored on the contentData object - if ($value instanceof ContentData) - { - $value->setPropertyDetails($this, $fullName); - } - } - else - { - parent::__set($name, $value); - } - } - - /** - * toString method. Returns node as a node reference style string. - */ - public function __toString() - { - return Node::__toNodeRef($this->_store, $this->id); - } - - public static function __toNodeRef($store, $id) - { - return $store->scheme . "://" . $store->address . "/" . $id; - } - - public function __toArray() - { - return array("store" => $this->_store->__toArray(), - "uuid" => $this->_id); - } - - public function getSession() - { - return $this->_session; - } - - public function getStore() - { - return $this->_store; - } - - public function getId() - { - return $this->_id; - } - - public function getIsNewNode() - { - return $this->_isNewNode; - } - - public function getType() - { - $this->populateProperties(); - return $this->_type; - } - - public function getAspects() - { - $this->populateProperties(); - return $this->_aspects; - } - - public function getProperties() - { - $this->populateProperties(); - return $this->_properties; - } - - public function setProperties($properties) - { - $this->populateProperties(); - $this->_properties = $properties; - } - - /** - * Accessor for the versionHistory property. - * - * @return VersionHistory the versionHistory for the node, null is none - */ - public function getVersionHistory() - { - if ($this->_versionHistory == null) - { - $this->_versionHistory = new VersionHistory($this); - } - return $this->_versionHistory; - } - - public function getChildren() - { - if ($this->_children == null) - { - $this->populateChildren(); - } - return $this->_children + $this->addedChildren; - } - - public function getParents() - { - if ($this->_parents == null) - { - $this->populateParents(); - } - return $this->_parents + $this->addedParents; - } - - public function getPrimaryParent() - { - if ($this->_primaryParent == null) - { - $this->populateParents(); - } - return $this->_primaryParent; - } - - public function getAssociations() - { - if ($this->_associations == null) - { - $this->populateAssociations(); - } - return $this->_associations + $this->addedAssociations; - } - - /** Methods used to populate node details from repository */ - - private function populateProperties() - { - if ($this->_isNewNode == false && $this->_properties == null) - { - $result = $this->_session->repositoryService->get(array ( - "where" => array ( - "nodes" => array( - "store" => $this->_store->__toArray(), - "uuid" => $this->_id)))); - - $this->populateFromWebServiceNode($result->getReturn); - } - } - - private function populateFromWebServiceNode($webServiceNode) - { - $this->_type = $webServiceNode->type; - - // Get the aspects - $this->_aspects = array(); - $aspects = $webServiceNode->aspects; - if (is_array($aspects) == true) - { - foreach ($aspects as $aspect) - { - $this->_aspects[] = $aspect; - } - } - else - { - $this->_aspects[] = $aspects; - } - - // Set the property values - // NOTE: do we need to be concerned with identifying whether this is an array or not when there is - // only one property on a node - $this->_properties = array(); - foreach ($webServiceNode->properties as $propertyDetails) - { - $name = $propertyDetails->name; - $isMultiValue = $propertyDetails->isMultiValue; - $value = null; - if ($isMultiValue == false) - { - $value = $propertyDetails->value; - if ($this->isContentData($value) == true) - { - $value = new ContentData($this, $name); - } - } - else - { - $value = $propertyDetails->values; - } - $this->_properties[$name] = $value; - - } - - $this->origionalProperties = $this->_properties; - $this->addedAspects = array(); - $this->removedAspects = array(); - - } - - private function populateChildren() - { - // TODO should do some sort of limited pull here - $result = $this->_session->repositoryService->queryChildren(array("node" => $this->__toArray())); - $resultSet = $result->queryReturn->resultSet; - - $children = array(); - $map = $this->resultSetToMap($resultSet); - foreach($map as $value) - { - $id = $value["{http://www.alfresco.org/model/system/1.0}node-uuid"]; - $store_scheme = $value["{http://www.alfresco.org/model/system/1.0}store-protocol"]; - $store_address = $value["{http://www.alfresco.org/model/system/1.0}store-identifier"]; - $assoc_type = $value["associationType"]; - $assoc_name = $value["associationName"]; - $isPrimary = $value["isPrimary"]; - $nthSibling = $value["nthSibling"]; - - $child = $this->_session->getNode(new Store($this->_session, $store_address, $store_scheme), $id); - $children[$child->__toString()] = new ChildAssociation($this, $child, $assoc_type, $assoc_name, $isPrimary, $nthSibling); - } - - $this->_children = $children; - } - - private function populateAssociations() - { - // TODO should do some sort of limited pull here - $result = $this->_session->repositoryService->queryAssociated(array("node" => $this->__toArray(), - "association" => array("associationType" => null, - "direction" => null))); - $resultSet = $result->queryReturn->resultSet; - - $associations = array(); - $map = $this->resultSetToMap($resultSet); - foreach($map as $value) - { - $id = $value["{http://www.alfresco.org/model/system/1.0}node-uuid"]; - $store_scheme = $value["{http://www.alfresco.org/model/system/1.0}store-protocol"]; - $store_address = $value["{http://www.alfresco.org/model/system/1.0}store-identifier"]; - $assoc_type = $value["associationType"]; - - $to = $this->_session->getNode(new Store($this->_session, $store_address, $store_scheme), $id); - $associations[$to->__toString()] = new Association($this, $to, $assoc_type); - } - - $this->_associations = $associations; - } - - private function populateParents() - { - // TODO should do some sort of limited pull here - $result = $this->_session->repositoryService->queryParents(array("node" => $this->__toArray())); - $resultSet = $result->queryReturn->resultSet; - - $parents = array(); - $map = $this->resultSetToMap($resultSet); - foreach($map as $value) - { - $id = $value["{http://www.alfresco.org/model/system/1.0}node-uuid"]; - $store_scheme = $value["{http://www.alfresco.org/model/system/1.0}store-protocol"]; - $store_address = $value["{http://www.alfresco.org/model/system/1.0}store-identifier"]; - $assoc_type = $value["associationType"]; - $assoc_name = $value["associationName"]; - $isPrimary = $value["isPrimary"]; - $nthSibling = $value["nthSibling"]; - - $parent = $this->_session->getNode(new Store($this->_session, $store_address, $store_scheme), $id); - if ($isPrimary == "true" or $isPrimary == true) - { - $this->_primaryParent = $parent; - } - $parents[$parent->__toString()] = new ChildAssociation($parent, $this, $assoc_type, $assoc_name, $isPrimary, $nthSibling); - } - - $this->_parents = $parents; - } - - public function onBeforeSave(&$statements) - { - if ($this->_isNewNode == true) - { - $childAssociation = $this->addedParents[$this->_primaryParent->__toString()]; - - $parentArray = array(); - $parent = $this->_primaryParent; - if ($parent->_isNewNode == true) - { - $parentArray["parent_id"] = $parent->id; - $parentArray["associationType"] = $childAssociation->type; - $parentArray["childName"] = $childAssociation->name; - } - else - { - $parentArray["parent"] = array( - "store" => $this->_store->__toArray(), - "uuid" => $this->_primaryParent->_id, - "associationType" => $childAssociation->type, - "childName" => $childAssociation->name); - } - - $this->addStatement($statements, "create", - array("id" => $this->_id) + - $parentArray + - array( - "type" => $this->_type, - "property" => $this->getPropertyArray($this->_properties))); - } - else - { - // Add the update statement for the modified properties - $modifiedProperties = $this->getModifiedProperties(); - if (count($modifiedProperties) != 0) - { - $this->addStatement($statements, "update", array("property" => $this->getPropertyArray($modifiedProperties)) + $this->getWhereArray()); - } - - // TODO deal with any deleted properties - } - - // Update any modified content properties - if ($this->_properties != null) - { - foreach($this->_properties as $name=>$value) - { - if (($value instanceof ContentData) && $value->isDirty == true) - { - $value->onBeforeSave($statements, $this->getWhereArray()); - } - } - } - - // Add the addAspect statements - if ($this->addedAspects != null) - { - foreach($this->addedAspects as $aspect) - { - $this->addStatement($statements, "addAspect", array("aspect" => $aspect) + $this->getWhereArray()); - } - } - - // Add the removeAspect - if ($this->removedAspects != null) - { - foreach($this->removedAspects as $aspect) - { - $this->addStatement($statements, "removeAspect", array("aspect" => $aspect) + $this->getWhereArray()); - } - } - - // Add non primary children - foreach($this->addedChildren as $childAssociation) - { - if ($childAssociation->isPrimary == false) - { - - $assocDetails = array("associationType" => $childAssociation->type, "childName" => $childAssociation->name); - - $temp = array(); - if ($childAssociation->child->_isNewNode == true) - { - $temp["to_id"] = $childAssociation->child->_id; - $temp = $temp + $assocDetails; - } - else - { - $temp["to"] = array( - "store" => $this->_store->__toArray(), - "uuid" => $childAssociation->child->_id) + - $assocDetails; - } - $temp = $temp + $this->getWhereArray(); - $this->addStatement($statements, "addChild", $temp); - } - } - - // Add associations - foreach($this->addedAssociations as $association) - { - $temp = array("association" => $association->type); - $temp = $temp + $this->getPredicateArray("from", $this) + $this->getPredicateArray("to", $association->to); - $this->addStatement($statements, "createAssociation", $temp); - } - } - - private function addStatement(&$statements, $statement, $body) - { - $result = array(); - if (array_key_exists($statement, $statements) == true) - { - $result = $statements[$statement]; - } - $result[] = $body; - $statements[$statement] = $result; - } - - private function getWhereArray() - { - return $this->getPredicateArray("where", $this); - } - - private function getPredicateArray($label, $node) - { - if ($node->_isNewNode == true) - { - return array($label."_id" => $node->_id); - } - else - { - return array( - $label => array( - "nodes" => $node->__toArray() - )); - } - } - - private function getPropertyArray($properties) - { - $result = array(); - foreach ($properties as $name=>$value) - { - // Ignore content properties - if (($value instanceof ContentData) == false) - { - // TODO need to support multi values - $result[] = array( - "name" => $name, - "isMultiValue" => false, - "value" => $value); - } - } - return $result; - } - - private function getModifiedProperties() - { - $modified = $this->_properties; - $origional = $this->origionalProperties; - $result = array(); - if ($modified != null) - { - foreach ($modified as $key=>$value) - { - // Ignore content properties - if (($value instanceof ContentData) == false) - { - if (array_key_exists($key, $origional) == true) - { - // Check to see if the value have been modified - if ($value != $origional[$key]) - { - $result[$key] = $value; - } - } - else - { - $result[$key] = $value; - } - } - } - } - return $result; - } - - public function onAfterSave($idMap) - { - if (array_key_exists($this->_id, $idMap ) == true) - { - $uuid = $idMap[$this->_id]; - if ($uuid != null) - { - $this->_id = $uuid; - } - } - - if ($this->_isNewNode == true) - { - $this->_isNewNode = false; - - // Clear the properties and aspect - $this->_properties = null; - $this->_aspects = null; - } - - // Update any modified content properties - if ($this->_properties != null) - { - foreach($this->_properties as $name=>$value) - { - if (($value instanceof ContentData) && $value->isDirty == true) - { - $value->onAfterSave(); - } - } - } - - $this->origionalProperties = $this->_properties; - - if ($this->_aspects != null) - { - // Calculate the updated aspect list - if ($this->addedAspects != null) - { - $this->_aspects = $this->_aspects + $this->addedAspects; - } - if ($this->removedAspects != null) - { - foreach ($this->_aspects as $aspect) - { - if (in_array($aspect, $this->removedAspects) == true) - { - $this->remove_array_value($aspect, $this->_aspects); - } - } - } - } - $this->addedAspects = array(); - $this->removedAspects = array(); - - if ($this->_parents != null) - { - $this->_parents = $this->_parents + $this->addedParents; - } - $this->addedParents = array(); - - if ($this->_children != null) - { - $this->_children = $this->_children + $this->addedChildren; - } - $this->addedChildren = array(); - - if ($this->_associations != null) - { - $this->_associations = $this->_associations + $this->addedAssociations; - } - $this->addedAssociations = array(); - } -} +_session = $session; + $this->_store = $store; + $this->_id = $id; + $this->_isNewNode = false; + $this->addedChildren = array(); + $this->addedParents = array(); + $this->addedAssociations = array(); + } + + /** + * Util method to create a node from a web service node structure. + */ + public static function createFromWebServiceData($session, $webServiceNode) + { + $scheme = $webServiceNode->reference->store->scheme; + $address = $webServiceNode->reference->store->address; + $id = $webServiceNode->reference->uuid; + + $store = $session->getStore($address, $scheme); + $node = $session->getNode($store, $id); + $node->populateFromWebServiceNode($webServiceNode); + + return $node; + } + + public function setPropertyValues($properties) + { + // Check that the properties of the node have been populated + $this->populateProperties(); + + // Set the property values + foreach ($properties as $name=>$value) + { + $name = $this->_session->namespaceMap->getFullName($name); + $this->_properties[$name] = $value; + } + } + + public function updateContent($property, $mimetype, $encoding="UTF-8", $content=null) + { + list($property) = $this->_session->namespaceMap->getFullNames(array($property)); + $contentData = new ContentData($this, $property, $mimetype, $encoding); + if ($content != null) + { + $contentData->content = $content; + } + $this->_properties[$property] = $contentData; + + return $contentData; + } + + public function hasAspect($aspect) + { + list($aspect) = $this->_session->namespaceMap->getFullNames(array($aspect)); + $this->populateProperties(); + return in_array($aspect, $this->_aspects); + } + + public function addAspect($aspect, $properties = null) + { + list($aspect) = $this->_session->namespaceMap->getFullNames(array($aspect)); + $this->populateProperties(); + + if (in_array($aspect, $this->_aspects) == false) + { + $this->_aspects[] = $aspect; + if ($properties != null) + { + foreach ($properties as $name=>$value) + { + $name = $this->_session->namespaceMap->getFullName($name); + $this->_properties[$name] = $value; + } + } + + $this->remove_array_value($aspect, $this->removedAspects); + $this->addedAspects[] = $aspect; + } + } + + public function removeAspect($aspect) + { + list($aspect) = $this->_session->namespaceMap->getFullNames(array($aspect)); + $this->populateProperties(); + + if (in_array($aspect, $this->_aspects) == true) + { + $this->remove_array_value($aspect, $this->_aspects); + $this->remove_array_value($aspect, $this->addedAspects); + $this->removedAspects[] = $aspect; + } + } + + public function createChild($type, $associationType, $associationName) + { + list($type, $associationType, $associationName) = $this->_session->namespaceMap->getFullNames(array($type, $associationType, $associationName)); + + $id = $this->_session->nextSessionId(); + $newNode = new Node($this->_session, $this->_store, $id); + $childAssociation = new ChildAssociation($this, $newNode, $associationType, $associationName, true); + + $newNode->_isNewNode = true; + + $newNode->_properties = array(); + $newNode->_aspects = array(); + $newNode->_properties = array(); + $newNode->_children = array(); + $newNode->origionalProperties = array(); + $newNode->addedAspects = array(); + $newNode->removedAspects = array(); + + $newNode->_type = $type; + $newNode->_parents = array(); + $newNode->addedParents = array($this->__toString() => $childAssociation); + $newNode->_primaryParent = $this; + + $this->addedChildren[$newNode->__toString()] = $childAssociation; + + $this->_session->addNode($newNode); + + return $newNode; + } + + public function addChild($node, $associationType, $associationName) + { + list($associationType, $associationName) = $this->_session->namespaceMap->getFullNames(array($associationType, $associationName)); + + $childAssociation = new ChildAssociation($this, $node, $associationType, $associationName, false); + $this->addedChildren[$node->__toString()] = $childAssociation; + $node->addedParents[$this->__toString()] = $childAssociation; + } + + public function removeChild($childAssociation) + { + + } + + public function addAssociation($to, $associationType) + { + list($associationType) = $this->_session->namespaceMap->getFullNames(array($associationType)); + + $association = new Association($this, $to, $associationType); + $this->addedAssociations[$to->__toString()] = $association; + } + + public function removeAssociation($association) + { + + } + + public function createVersion($description=null, $major=false) + { + // We can only create a version if there are no outstanding changes for this node + if ($this->isDirty() == true) + { + throw new Exception("You must save any outstanding modifications before a new version can be created."); + } + + // TODO implement major flag ... + + $client = WebServiceFactory::getAuthoringService($this->_session->repository->connectionUrl, $this->_session->ticket); + $result = $client->createVersion( + array("items" => array("nodes" => $this->__toArray()), + "comments" => array("name" => "description", "value" => $description), + "versionChildren" => false)); + + // Clear the properties and aspects + $this->_properties = null; + $this->_aspects = null; + + // Get the version details + // TODO get some of the other details too ... + $versionId = $result->createVersionReturn->versions->id->uuid; + $versionStoreScheme = $result->createVersionReturn->versions->id->store->scheme; + $versionStoreAddress = $result->createVersionReturn->versions->id->store->address; + + // Create the version object to return + return new Version($this->_session, new Store($this->_session, $versionStoreAddress, $versionStoreScheme), $versionId); + } + + private function isDirty() + { + $result = true; + if ($this->_isNewNode == false && + count($this->getModifiedProperties()) == 0 && + ($this->addedAspects == null || count($this->addedAspects) == 0) && + ($this->removedAssociations == null || count($this->removedAssociations) == 0) && + ($this->addedChildren == null || count($this->addedChildren) == 0) && + ($this->addedAssociations == null || count($this->addedAssociations) == 0)) + { + $result = false; + } + return $result; + } + + public function __get($name) + { + $fullName = $this->_session->namespaceMap->getFullName($name); + if ($fullName != $name) + { + $this->populateProperties(); + if (array_key_exists($fullName, $this->_properties) == true) + { + return $this->_properties[$fullName]; + } + else + { + return null; + } + } + else + { + return parent::__get($name); + } + } + + public function __set($name, $value) + { + $fullName = $this->_session->namespaceMap->getFullName($name); + if ($fullName != $name) + { + $this->populateProperties(); + $this->_properties[$fullName] = $value; + + // Ensure that the node and property details are stored on the contentData object + if ($value instanceof ContentData) + { + $value->setPropertyDetails($this, $fullName); + } + } + else + { + parent::__set($name, $value); + } + } + + /** + * toString method. Returns node as a node reference style string. + */ + public function __toString() + { + return Node::__toNodeRef($this->_store, $this->id); + } + + public static function __toNodeRef($store, $id) + { + return $store->scheme . "://" . $store->address . "/" . $id; + } + + public function __toArray() + { + return array("store" => $this->_store->__toArray(), + "uuid" => $this->_id); + } + + public function getSession() + { + return $this->_session; + } + + public function getStore() + { + return $this->_store; + } + + public function getId() + { + return $this->_id; + } + + public function getIsNewNode() + { + return $this->_isNewNode; + } + + public function getType() + { + $this->populateProperties(); + return $this->_type; + } + + public function getAspects() + { + $this->populateProperties(); + return $this->_aspects; + } + + public function getProperties() + { + $this->populateProperties(); + return $this->_properties; + } + + public function setProperties($properties) + { + $this->populateProperties(); + $this->_properties = $properties; + } + + /** + * Accessor for the versionHistory property. + * + * @return VersionHistory the versionHistory for the node, null is none + */ + public function getVersionHistory() + { + if ($this->_versionHistory == null) + { + $this->_versionHistory = new VersionHistory($this); + } + return $this->_versionHistory; + } + + public function getChildren() + { + if ($this->_children == null) + { + $this->populateChildren(); + } + return $this->_children + $this->addedChildren; + } + + public function getParents() + { + if ($this->_parents == null) + { + $this->populateParents(); + } + return $this->_parents + $this->addedParents; + } + + public function getPrimaryParent() + { + if ($this->_primaryParent == null) + { + $this->populateParents(); + } + return $this->_primaryParent; + } + + public function getAssociations() + { + if ($this->_associations == null) + { + $this->populateAssociations(); + } + return $this->_associations + $this->addedAssociations; + } + + /** Methods used to populate node details from repository */ + + private function populateProperties() + { + if ($this->_isNewNode == false && $this->_properties == null) + { + $result = $this->_session->repositoryService->get(array ( + "where" => array ( + "nodes" => array( + "store" => $this->_store->__toArray(), + "uuid" => $this->_id)))); + + $this->populateFromWebServiceNode($result->getReturn); + } + } + + private function populateFromWebServiceNode($webServiceNode) + { + $this->_type = $webServiceNode->type; + + // Get the aspects + $this->_aspects = array(); + $aspects = $webServiceNode->aspects; + if (is_array($aspects) == true) + { + foreach ($aspects as $aspect) + { + $this->_aspects[] = $aspect; + } + } + else + { + $this->_aspects[] = $aspects; + } + + // Set the property values + // NOTE: do we need to be concerned with identifying whether this is an array or not when there is + // only one property on a node + $this->_properties = array(); + foreach ($webServiceNode->properties as $propertyDetails) + { + $name = $propertyDetails->name; + $isMultiValue = $propertyDetails->isMultiValue; + $value = null; + if ($isMultiValue == false) + { + $value = $propertyDetails->value; + if ($this->isContentData($value) == true) + { + $value = new ContentData($this, $name); + } + } + else + { + $value = $propertyDetails->values; + } + $this->_properties[$name] = $value; + + } + + $this->origionalProperties = $this->_properties; + $this->addedAspects = array(); + $this->removedAspects = array(); + + } + + private function populateChildren() + { + // TODO should do some sort of limited pull here + $result = $this->_session->repositoryService->queryChildren(array("node" => $this->__toArray())); + $resultSet = $result->queryReturn->resultSet; + + $children = array(); + $map = $this->resultSetToMap($resultSet); + foreach($map as $value) + { + $id = $value["{http://www.alfresco.org/model/system/1.0}node-uuid"]; + $store_scheme = $value["{http://www.alfresco.org/model/system/1.0}store-protocol"]; + $store_address = $value["{http://www.alfresco.org/model/system/1.0}store-identifier"]; + $assoc_type = $value["associationType"]; + $assoc_name = $value["associationName"]; + $isPrimary = $value["isPrimary"]; + $nthSibling = $value["nthSibling"]; + + $child = $this->_session->getNode(new Store($this->_session, $store_address, $store_scheme), $id); + $children[$child->__toString()] = new ChildAssociation($this, $child, $assoc_type, $assoc_name, $isPrimary, $nthSibling); + } + + $this->_children = $children; + } + + private function populateAssociations() + { + // TODO should do some sort of limited pull here + $result = $this->_session->repositoryService->queryAssociated(array("node" => $this->__toArray(), + "association" => array("associationType" => null, + "direction" => null))); + $resultSet = $result->queryReturn->resultSet; + + $associations = array(); + $map = $this->resultSetToMap($resultSet); + foreach($map as $value) + { + $id = $value["{http://www.alfresco.org/model/system/1.0}node-uuid"]; + $store_scheme = $value["{http://www.alfresco.org/model/system/1.0}store-protocol"]; + $store_address = $value["{http://www.alfresco.org/model/system/1.0}store-identifier"]; + $assoc_type = $value["associationType"]; + + $to = $this->_session->getNode(new Store($this->_session, $store_address, $store_scheme), $id); + $associations[$to->__toString()] = new Association($this, $to, $assoc_type); + } + + $this->_associations = $associations; + } + + private function populateParents() + { + // TODO should do some sort of limited pull here + $result = $this->_session->repositoryService->queryParents(array("node" => $this->__toArray())); + $resultSet = $result->queryReturn->resultSet; + + $parents = array(); + $map = $this->resultSetToMap($resultSet); + foreach($map as $value) + { + $id = $value["{http://www.alfresco.org/model/system/1.0}node-uuid"]; + $store_scheme = $value["{http://www.alfresco.org/model/system/1.0}store-protocol"]; + $store_address = $value["{http://www.alfresco.org/model/system/1.0}store-identifier"]; + $assoc_type = $value["associationType"]; + $assoc_name = $value["associationName"]; + $isPrimary = $value["isPrimary"]; + $nthSibling = $value["nthSibling"]; + + $parent = $this->_session->getNode(new Store($this->_session, $store_address, $store_scheme), $id); + if ($isPrimary == "true" or $isPrimary == true) + { + $this->_primaryParent = $parent; + } + $parents[$parent->__toString()] = new ChildAssociation($parent, $this, $assoc_type, $assoc_name, $isPrimary, $nthSibling); + } + + $this->_parents = $parents; + } + + public function onBeforeSave(&$statements) + { + if ($this->_isNewNode == true) + { + $childAssociation = $this->addedParents[$this->_primaryParent->__toString()]; + + $parentArray = array(); + $parent = $this->_primaryParent; + if ($parent->_isNewNode == true) + { + $parentArray["parent_id"] = $parent->id; + $parentArray["associationType"] = $childAssociation->type; + $parentArray["childName"] = $childAssociation->name; + } + else + { + $parentArray["parent"] = array( + "store" => $this->_store->__toArray(), + "uuid" => $this->_primaryParent->_id, + "associationType" => $childAssociation->type, + "childName" => $childAssociation->name); + } + + $this->addStatement($statements, "create", + array("id" => $this->_id) + + $parentArray + + array( + "type" => $this->_type, + "property" => $this->getPropertyArray($this->_properties))); + } + else + { + // Add the update statement for the modified properties + $modifiedProperties = $this->getModifiedProperties(); + if (count($modifiedProperties) != 0) + { + $this->addStatement($statements, "update", array("property" => $this->getPropertyArray($modifiedProperties)) + $this->getWhereArray()); + } + + // TODO deal with any deleted properties + } + + // Update any modified content properties + if ($this->_properties != null) + { + foreach($this->_properties as $name=>$value) + { + if (($value instanceof ContentData) && $value->isDirty == true) + { + $value->onBeforeSave($statements, $this->getWhereArray()); + } + } + } + + // Add the addAspect statements + if ($this->addedAspects != null) + { + foreach($this->addedAspects as $aspect) + { + $this->addStatement($statements, "addAspect", array("aspect" => $aspect) + $this->getWhereArray()); + } + } + + // Add the removeAspect + if ($this->removedAspects != null) + { + foreach($this->removedAspects as $aspect) + { + $this->addStatement($statements, "removeAspect", array("aspect" => $aspect) + $this->getWhereArray()); + } + } + + // Add non primary children + foreach($this->addedChildren as $childAssociation) + { + if ($childAssociation->isPrimary == false) + { + + $assocDetails = array("associationType" => $childAssociation->type, "childName" => $childAssociation->name); + + $temp = array(); + if ($childAssociation->child->_isNewNode == true) + { + $temp["to_id"] = $childAssociation->child->_id; + $temp = $temp + $assocDetails; + } + else + { + $temp["to"] = array( + "store" => $this->_store->__toArray(), + "uuid" => $childAssociation->child->_id) + + $assocDetails; + } + $temp = $temp + $this->getWhereArray(); + $this->addStatement($statements, "addChild", $temp); + } + } + + // Add associations + foreach($this->addedAssociations as $association) + { + $temp = array("association" => $association->type); + $temp = $temp + $this->getPredicateArray("from", $this) + $this->getPredicateArray("to", $association->to); + $this->addStatement($statements, "createAssociation", $temp); + } + } + + private function addStatement(&$statements, $statement, $body) + { + $result = array(); + if (array_key_exists($statement, $statements) == true) + { + $result = $statements[$statement]; + } + $result[] = $body; + $statements[$statement] = $result; + } + + private function getWhereArray() + { + return $this->getPredicateArray("where", $this); + } + + private function getPredicateArray($label, $node) + { + if ($node->_isNewNode == true) + { + return array($label."_id" => $node->_id); + } + else + { + return array( + $label => array( + "nodes" => $node->__toArray() + )); + } + } + + private function getPropertyArray($properties) + { + $result = array(); + foreach ($properties as $name=>$value) + { + // Ignore content properties + if (($value instanceof ContentData) == false) + { + // TODO need to support multi values + $result[] = array( + "name" => $name, + "isMultiValue" => false, + "value" => $value); + } + } + return $result; + } + + private function getModifiedProperties() + { + $modified = $this->_properties; + $origional = $this->origionalProperties; + $result = array(); + if ($modified != null) + { + foreach ($modified as $key=>$value) + { + // Ignore content properties + if (($value instanceof ContentData) == false) + { + if (array_key_exists($key, $origional) == true) + { + // Check to see if the value have been modified + if ($value != $origional[$key]) + { + $result[$key] = $value; + } + } + else + { + $result[$key] = $value; + } + } + } + } + return $result; + } + + public function onAfterSave($idMap) + { + if (array_key_exists($this->_id, $idMap ) == true) + { + $uuid = $idMap[$this->_id]; + if ($uuid != null) + { + $this->_id = $uuid; + } + } + + if ($this->_isNewNode == true) + { + $this->_isNewNode = false; + + // Clear the properties and aspect + $this->_properties = null; + $this->_aspects = null; + } + + // Update any modified content properties + if ($this->_properties != null) + { + foreach($this->_properties as $name=>$value) + { + if (($value instanceof ContentData) && $value->isDirty == true) + { + $value->onAfterSave(); + } + } + } + + $this->origionalProperties = $this->_properties; + + if ($this->_aspects != null) + { + // Calculate the updated aspect list + if ($this->addedAspects != null) + { + $this->_aspects = $this->_aspects + $this->addedAspects; + } + if ($this->removedAspects != null) + { + foreach ($this->_aspects as $aspect) + { + if (in_array($aspect, $this->removedAspects) == true) + { + $this->remove_array_value($aspect, $this->_aspects); + } + } + } + } + $this->addedAspects = array(); + $this->removedAspects = array(); + + if ($this->_parents != null) + { + $this->_parents = $this->_parents + $this->addedParents; + } + $this->addedParents = array(); + + if ($this->_children != null) + { + $this->_children = $this->_children + $this->addedChildren; + } + $this->addedChildren = array(); + + if ($this->_associations != null) + { + $this->_associations = $this->_associations + $this->addedAssociations; + } + $this->addedAssociations = array(); + } +} ?> \ No newline at end of file diff --git a/lib/alfresco/Service/Session.php b/lib/alfresco/Service/Session.php index 175a3d3e18a..b18bf583ac3 100755 --- a/lib/alfresco/Service/Session.php +++ b/lib/alfresco/Service/Session.php @@ -1,277 +1,277 @@ -nodeCache = array(); - - $this->_repository = $repository; - $this->_ticket = $ticket; - - $this->repositoryService = WebServiceFactory::getRepositoryService($this->_repository->connectionUrl, $this->_ticket); - $this->contentService = WebServiceFactory::getContentService($this->_repository->connectionUrl, $this->_ticket); - } - - /** - * Creates a new store in the current respository - * - * @param $address the address of the new store - * @param $scheme the scheme of the new store, default value of 'workspace' - * @return Store the new store - */ - public function createStore($address, $scheme="workspace") - { - // Create the store - $result = $this->repositoryService->createStore(array( - "scheme" => $scheme, - "address" => $address)); - $store = new Store($this, $result->createStoreReturn->address, $result->createStoreReturn->scheme); - - // Add to the cached list if its been populated - if (isset($this->_stores) == true) - { - $this->_stores[] = $store; - } - - // Return the newly created store - return $store; - } - - /** - * Get the store - * - * @param $address the address of the store - * @param $scheme the scheme of the store. The default it 'workspace' - * @return Store the store - */ - public function getStore($address, $scheme="workspace") - { - return new Store($this, $address, $scheme); - } - - /** - * Get the store from it string representation (eg: workspace://SpacesStore) - * - * @param $value the stores string representation - * @return Store the store - */ - public function getStoreFromString($value) - { - list($scheme, $address) = split("://", $value); - return new Store($this, $address, $scheme); - } - - public function getNode($store, $id) - { - $node = $this->getNodeImpl($store, $id); - if ($node == null) - { - $node = new Node($this, $store, $id); - $this->addNode($node); - } - return $node; - } - - public function getNodeFromString($value) - { - // TODO - throw new Exception("getNode($value) not yet implemented"); - } - - /** - * Adds a new node to the session. - */ - public function addNode($node) - { - $this->nodeCache[$node->__toString()] = $node; - } - - private function getNodeImpl($store, $id) - { - $result = null; - $nodeRef = $store->scheme . "://" . $store->address . "/" . $id; - if (array_key_exists($nodeRef, $this->nodeCache) == true) - { - $result = $this->nodeCache[$nodeRef]; - } - return $result; - } - - /** - * Commits all unsaved changes to the repository - */ - public function save($debug=false) - { - // Build the update statements from the node cache - $statements = array(); - foreach ($this->nodeCache as $node) - { - $node->onBeforeSave($statements); - } - - if ($debug == true) - { - var_dump($statements); - echo ("

    "); - } - - if (count($statements) > 0) - { - // Make the web service call - $result = $this->repositoryService->update(array("statements" => $statements)); - //var_dump($result); - - // Update the state of the updated nodes - foreach ($this->nodeCache as $node) - { - $node->onAfterSave($this->getIdMap($result)); - } - } - } - - /** - * Clears the current session by emptying the node cache. - * - * WARNING: all unsaved changes will be lost when clearing the session. - */ - public function clear() - { - // Clear the node cache - $this->nodeCache = array(); - } - - private function getIdMap($result) - { - $return = array(); - $statements = $result->updateReturn; - if (is_array($statements) == true) - { - foreach ($statements as $statement) - { - if ($statement->statement == "create") - { - $id = $statement->sourceId; - $uuid = $statement->destination->uuid; - $return[$id] = $uuid; - } - } - } - else - { - if ($statements->statement == "create") - { - $id = $statements->sourceId; - $uuid = $statements->destination->uuid; - $return[$id] = $uuid; - } - } - return $return; - } - - public function query($store, $query, $language='lucene') - { - // TODO need to support paged queries - $result = $this->repositoryService->query(array( - "store" => $store->__toArray(), - "query" => array( - "language" => $language, - "statement" => $query), - "includeMetaData" => false)); - - // TODO for now do nothing with the score and the returned data - $resultSet = $result->queryReturn->resultSet; - return $this->resultSetToNodes($this, $store, $resultSet); - } - - public function getTicket() - { - return $this->_ticket; - } - - public function getRepository() - { - return $this->_repository; - } - - public function getNamespaceMap() - { - if ($this->_namespaceMap == null) - { - $this->_namespaceMap = new NamespaceMap(); - } - return $this->_namespaceMap; - } - - public function getStores() - { - if (isset ($this->_stores) == false) - { - $this->_stores = array (); - $results = $this->repositoryService->getStores(); - - foreach ($results->getStoresReturn as $result) - { - $this->_stores[] = new Store($this, $result->address, $result->scheme); - } - } - - return $this->_stores; - } - - /** Want these methods to be package scope some how! **/ - - public function nextSessionId() - { - $sessionId = "session".$this->_ticket.$this->idCount; - $this->idCount ++; - return $sessionId; - } -} -?> +nodeCache = array(); + + $this->_repository = $repository; + $this->_ticket = $ticket; + + $this->repositoryService = WebServiceFactory::getRepositoryService($this->_repository->connectionUrl, $this->_ticket); + $this->contentService = WebServiceFactory::getContentService($this->_repository->connectionUrl, $this->_ticket); + } + + /** + * Creates a new store in the current respository + * + * @param $address the address of the new store + * @param $scheme the scheme of the new store, default value of 'workspace' + * @return Store the new store + */ + public function createStore($address, $scheme="workspace") + { + // Create the store + $result = $this->repositoryService->createStore(array( + "scheme" => $scheme, + "address" => $address)); + $store = new Store($this, $result->createStoreReturn->address, $result->createStoreReturn->scheme); + + // Add to the cached list if its been populated + if (isset($this->_stores) == true) + { + $this->_stores[] = $store; + } + + // Return the newly created store + return $store; + } + + /** + * Get the store + * + * @param $address the address of the store + * @param $scheme the scheme of the store. The default it 'workspace' + * @return Store the store + */ + public function getStore($address, $scheme="workspace") + { + return new Store($this, $address, $scheme); + } + + /** + * Get the store from it string representation (eg: workspace://SpacesStore) + * + * @param $value the stores string representation + * @return Store the store + */ + public function getStoreFromString($value) + { + list($scheme, $address) = split("://", $value); + return new Store($this, $address, $scheme); + } + + public function getNode($store, $id) + { + $node = $this->getNodeImpl($store, $id); + if ($node == null) + { + $node = new Node($this, $store, $id); + $this->addNode($node); + } + return $node; + } + + public function getNodeFromString($value) + { + // TODO + throw new Exception("getNode($value) not yet implemented"); + } + + /** + * Adds a new node to the session. + */ + public function addNode($node) + { + $this->nodeCache[$node->__toString()] = $node; + } + + private function getNodeImpl($store, $id) + { + $result = null; + $nodeRef = $store->scheme . "://" . $store->address . "/" . $id; + if (array_key_exists($nodeRef, $this->nodeCache) == true) + { + $result = $this->nodeCache[$nodeRef]; + } + return $result; + } + + /** + * Commits all unsaved changes to the repository + */ + public function save($debug=false) + { + // Build the update statements from the node cache + $statements = array(); + foreach ($this->nodeCache as $node) + { + $node->onBeforeSave($statements); + } + + if ($debug == true) + { + var_dump($statements); + echo ("

    "); + } + + if (count($statements) > 0) + { + // Make the web service call + $result = $this->repositoryService->update(array("statements" => $statements)); + //var_dump($result); + + // Update the state of the updated nodes + foreach ($this->nodeCache as $node) + { + $node->onAfterSave($this->getIdMap($result)); + } + } + } + + /** + * Clears the current session by emptying the node cache. + * + * WARNING: all unsaved changes will be lost when clearing the session. + */ + public function clear() + { + // Clear the node cache + $this->nodeCache = array(); + } + + private function getIdMap($result) + { + $return = array(); + $statements = $result->updateReturn; + if (is_array($statements) == true) + { + foreach ($statements as $statement) + { + if ($statement->statement == "create") + { + $id = $statement->sourceId; + $uuid = $statement->destination->uuid; + $return[$id] = $uuid; + } + } + } + else + { + if ($statements->statement == "create") + { + $id = $statements->sourceId; + $uuid = $statements->destination->uuid; + $return[$id] = $uuid; + } + } + return $return; + } + + public function query($store, $query, $language='lucene') + { + // TODO need to support paged queries + $result = $this->repositoryService->query(array( + "store" => $store->__toArray(), + "query" => array( + "language" => $language, + "statement" => $query), + "includeMetaData" => false)); + + // TODO for now do nothing with the score and the returned data + $resultSet = $result->queryReturn->resultSet; + return $this->resultSetToNodes($this, $store, $resultSet); + } + + public function getTicket() + { + return $this->_ticket; + } + + public function getRepository() + { + return $this->_repository; + } + + public function getNamespaceMap() + { + if ($this->_namespaceMap == null) + { + $this->_namespaceMap = new NamespaceMap(); + } + return $this->_namespaceMap; + } + + public function getStores() + { + if (isset ($this->_stores) == false) + { + $this->_stores = array (); + $results = $this->repositoryService->getStores(); + + foreach ($results->getStoresReturn as $result) + { + $this->_stores[] = new Store($this, $result->address, $result->scheme); + } + } + + return $this->_stores; + } + + /** Want these methods to be package scope some how! **/ + + public function nextSessionId() + { + $sessionId = "session".$this->_ticket.$this->idCount; + $this->idCount ++; + return $sessionId; + } +} +?> diff --git a/lib/alfresco/Service/SpacesStore.php b/lib/alfresco/Service/SpacesStore.php index 5764f46a1d2..91082c44765 100755 --- a/lib/alfresco/Service/SpacesStore.php +++ b/lib/alfresco/Service/SpacesStore.php @@ -1,54 +1,54 @@ -scheme . "://" . $this->address; - } - - public function getCompanyHome() - { - if ($this->_companyHome == null) - { - $nodes = $this->_session->query($this, 'PATH:"app:company_home"'); - $this->_companyHome = $nodes[0]; - } - return $this->_companyHome; - } -} +scheme . "://" . $this->address; + } + + public function getCompanyHome() + { + if ($this->_companyHome == null) + { + $nodes = $this->_session->query($this, 'PATH:"app:company_home"'); + $this->_companyHome = $nodes[0]; + } + return $this->_companyHome; + } +} ?> \ No newline at end of file diff --git a/lib/alfresco/Service/Store.php b/lib/alfresco/Service/Store.php index fa72978c4b0..723ca9ccc05 100755 --- a/lib/alfresco/Service/Store.php +++ b/lib/alfresco/Service/Store.php @@ -1,81 +1,81 @@ -_session = $session; - $this->_address = $address; - $this->_scheme = $scheme; - } - - public function __toString() - { - return $this->scheme . "://" . $this->address; - } - - public function __toArray() - { - return array( - "scheme" => $this->_scheme, - "address" => $this->_address); - } - - public function getAddress() - { - return $this->_address; - } - - public function getScheme() - { - return $this->_scheme; - } - - public function getRootNode() - { - if (isset ($this->_rootNode) == false) - { - $result = $this->_session->repositoryService->get( - array( - "where" => array( - "store" => $this->__toArray()))); - - $this->_rootNode = Node::createFromWebServiceData($this->_session, $result->getReturn); - } - - return $this->_rootNode; - } -} +_session = $session; + $this->_address = $address; + $this->_scheme = $scheme; + } + + public function __toString() + { + return $this->scheme . "://" . $this->address; + } + + public function __toArray() + { + return array( + "scheme" => $this->_scheme, + "address" => $this->_address); + } + + public function getAddress() + { + return $this->_address; + } + + public function getScheme() + { + return $this->_scheme; + } + + public function getRootNode() + { + if (isset ($this->_rootNode) == false) + { + $result = $this->_session->repositoryService->get( + array( + "where" => array( + "store" => $this->__toArray()))); + + $this->_rootNode = Node::createFromWebServiceData($this->_session, $result->getReturn); + } + + return $this->_rootNode; + } +} ?> \ No newline at end of file diff --git a/lib/alfresco/Service/Version.php b/lib/alfresco/Service/Version.php index cd1fd85b6ea..6087b665595 100755 --- a/lib/alfresco/Service/Version.php +++ b/lib/alfresco/Service/Version.php @@ -1,200 +1,200 @@ -_session = $session; - $this->_store = $store; - $this->_id = $id; - $this->_description = $description; - $this->_major = $major; - $this->_properties = null; - $this->_aspects = null; - $this->_type = null; - } - - /** - * __get override. - * - * If called with a valid property short name, the frozen value of that property is returned. - * - * @return String the appropriate property value, null if none found - */ - public function __get($name) - { - $fullName = $this->_session->namespaceMap->getFullName($name); - if ($fullName != $name) - { - $this->populateProperties(); - if (array_key_exists($fullName, $this->_properties) == true) - { - return $this->_properties[$fullName]; - } - else - { - return null; - } - } - else - { - return parent::__get($name); - } - } - - /** - * Gets session - * - * @return Session the session - */ - public function getSession() - { - return $this->_session; - } - - /** - * Get the frozen nodes store - * - * @return Store the store - */ - public function getStore() - { - return $this->_store; - } - - public function getId() - { - return $this->_id; - } - - public function getDescription() - { - return $this->_description; - } - - public function getMajor() - { - return $this->_major; - } - - public function getType() - { - return $this->_type; - } - - public function getProperties() - { - return $this->_properties; - } - - public function getAspects() - { - return $this->_aspects; - } - - private function populateProperties() - { - if ($this->_properties == null) - { - $result = $this->_session->repositoryService->get(array ( - "where" => array ( - "nodes" => array( - "store" => $this->_store->__toArray(), - "uuid" => $this->_id)))); - - $this->populateFromWebServiceNode($result->getReturn); - } - } - - private function populateFromWebServiceNode($webServiceNode) - { - $this->_type = $webServiceNode->type; - - // Get the aspects - $this->_aspects = array(); - $aspects = $webServiceNode->aspects; - if (is_array($aspects) == true) - { - foreach ($aspects as $aspect) - { - $this->_aspects[] = $aspect; - } - } - else - { - $this->_aspects[] = $aspects; - } - - // Set the property values - $this->_properties = array(); - foreach ($webServiceNode->properties as $propertyDetails) - { - $name = $propertyDetails->name; - $isMultiValue = $propertyDetails->isMultiValue; - $value = null; - if ($isMultiValue == false) - { - $value = $propertyDetails->value; - if ($this->isContentData($value) == true) - { - $value = new ContentData($this, $name); - } - } - else - { - $value = $propertyDetails->values; - } - - $this->_properties[$name] = $value; - } - } - } -?> +_session = $session; + $this->_store = $store; + $this->_id = $id; + $this->_description = $description; + $this->_major = $major; + $this->_properties = null; + $this->_aspects = null; + $this->_type = null; + } + + /** + * __get override. + * + * If called with a valid property short name, the frozen value of that property is returned. + * + * @return String the appropriate property value, null if none found + */ + public function __get($name) + { + $fullName = $this->_session->namespaceMap->getFullName($name); + if ($fullName != $name) + { + $this->populateProperties(); + if (array_key_exists($fullName, $this->_properties) == true) + { + return $this->_properties[$fullName]; + } + else + { + return null; + } + } + else + { + return parent::__get($name); + } + } + + /** + * Gets session + * + * @return Session the session + */ + public function getSession() + { + return $this->_session; + } + + /** + * Get the frozen nodes store + * + * @return Store the store + */ + public function getStore() + { + return $this->_store; + } + + public function getId() + { + return $this->_id; + } + + public function getDescription() + { + return $this->_description; + } + + public function getMajor() + { + return $this->_major; + } + + public function getType() + { + return $this->_type; + } + + public function getProperties() + { + return $this->_properties; + } + + public function getAspects() + { + return $this->_aspects; + } + + private function populateProperties() + { + if ($this->_properties == null) + { + $result = $this->_session->repositoryService->get(array ( + "where" => array ( + "nodes" => array( + "store" => $this->_store->__toArray(), + "uuid" => $this->_id)))); + + $this->populateFromWebServiceNode($result->getReturn); + } + } + + private function populateFromWebServiceNode($webServiceNode) + { + $this->_type = $webServiceNode->type; + + // Get the aspects + $this->_aspects = array(); + $aspects = $webServiceNode->aspects; + if (is_array($aspects) == true) + { + foreach ($aspects as $aspect) + { + $this->_aspects[] = $aspect; + } + } + else + { + $this->_aspects[] = $aspects; + } + + // Set the property values + $this->_properties = array(); + foreach ($webServiceNode->properties as $propertyDetails) + { + $name = $propertyDetails->name; + $isMultiValue = $propertyDetails->isMultiValue; + $value = null; + if ($isMultiValue == false) + { + $value = $propertyDetails->value; + if ($this->isContentData($value) == true) + { + $value = new ContentData($this, $name); + } + } + else + { + $value = $propertyDetails->values; + } + + $this->_properties[$name] = $value; + } + } + } +?> diff --git a/lib/alfresco/Service/VersionHistory.php b/lib/alfresco/Service/VersionHistory.php index c590611345f..57c2ea7f8e7 100755 --- a/lib/alfresco/Service/VersionHistory.php +++ b/lib/alfresco/Service/VersionHistory.php @@ -1,80 +1,80 @@ -_node = $node; - $this->populateVersionHistory(); - } - - /** - * Get the node that this version history relates to - */ - public function getNode() - { - return $this->_node; - } - - /** - * Get a list of the versions in the version history - */ - public function getVersions() - { - return $this->_versions; - } - - /** - * Populate the version history - */ - private function populateVersionHistory() - { - // Use the web service API to get the version history for this node - $client = WebServiceFactory::getAuthoringService($this->_node->session->repository->connectionUrl, $this->_node->session->ticket); - $result = $client->getVersionHistory(array("node" => $this->_node->__toArray())); - //var_dump($result); - - // TODO populate the version history from the result of the web service call - } - } -?> +_node = $node; + $this->populateVersionHistory(); + } + + /** + * Get the node that this version history relates to + */ + public function getNode() + { + return $this->_node; + } + + /** + * Get a list of the versions in the version history + */ + public function getVersions() + { + return $this->_versions; + } + + /** + * Populate the version history + */ + private function populateVersionHistory() + { + // Use the web service API to get the version history for this node + $client = WebServiceFactory::getAuthoringService($this->_node->session->repository->connectionUrl, $this->_node->session->ticket); + $result = $client->getVersionHistory(array("node" => $this->_node->__toArray())); + //var_dump($result); + + // TODO populate the version history from the result of the web service call + } + } +?> diff --git a/lib/base32.php b/lib/base32.php index 48c3dece0f3..37316185e34 100644 --- a/lib/base32.php +++ b/lib/base32.php @@ -1,196 +1,196 @@ - | -// | Arjan Wekking | -// | Martin Langhoff | -// +----------------------------------------------------------------------+ -// - -/** - * @package moodlecore - * @copyright (c) 2001 The PHP Group - * @license GNU GPL v2.0 http://www.php.net/license/2_02.txt - */ - -/** - * Base32 encode a binary string - * - * @param $inString Binary string to base32 encode - * - * @return $outString Base32 encoded $inString - * - * @access private - * - */ - -function base32_encode ($inString) -{ - $outString = ""; - $compBits = ""; - $BASE32_TABLE = array( - '00000' => 0x61, - '00001' => 0x62, - '00010' => 0x63, - '00011' => 0x64, - '00100' => 0x65, - '00101' => 0x66, - '00110' => 0x67, - '00111' => 0x68, - '01000' => 0x69, - '01001' => 0x6a, - '01010' => 0x6b, - '01011' => 0x6c, - '01100' => 0x6d, - '01101' => 0x6e, - '01110' => 0x6f, - '01111' => 0x70, - '10000' => 0x71, - '10001' => 0x72, - '10010' => 0x73, - '10011' => 0x74, - '10100' => 0x75, - '10101' => 0x76, - '10110' => 0x77, - '10111' => 0x78, - '11000' => 0x79, - '11001' => 0x7a, - '11010' => 0x32, - '11011' => 0x33, - '11100' => 0x34, - '11101' => 0x35, - '11110' => 0x36, - '11111' => 0x37, - ); - - /* Turn the compressed string into a string that represents the bits as 0 and 1. */ - for ($i = 0; $i < strlen($inString); $i++) { - $compBits .= str_pad(decbin(ord(substr($inString,$i,1))), 8, '0', STR_PAD_LEFT); - } - - /* Pad the value with enough 0's to make it a multiple of 5 */ - if((strlen($compBits) % 5) != 0) { - $compBits = str_pad($compBits, strlen($compBits)+(5-(strlen($compBits)%5)), '0', STR_PAD_RIGHT); - } - - /* Create an array by chunking it every 5 chars */ - $fiveBitsArray = split("\n",rtrim(chunk_split($compBits, 5, "\n"))); - - /* Look-up each chunk and add it to $outstring */ - foreach($fiveBitsArray as $fiveBitsString) { - $outString .= chr($BASE32_TABLE[$fiveBitsString]); - } - - return $outString; -} - - - -/** - * Base32 decode to a binary string - * - * @param $inString String to base32 decode - * - * @return $outString Base32 decoded $inString - * - * @access private - * - */ - -function Base32_decode($inString) { - /* declaration */ - $inputCheck = null; - $deCompBits = null; - - $BASE32_TABLE = array( - 0x61 => '00000', - 0x62 => '00001', - 0x63 => '00010', - 0x64 => '00011', - 0x65 => '00100', - 0x66 => '00101', - 0x67 => '00110', - 0x68 => '00111', - 0x69 => '01000', - 0x6a => '01001', - 0x6b => '01010', - 0x6c => '01011', - 0x6d => '01100', - 0x6e => '01101', - 0x6f => '01110', - 0x70 => '01111', - 0x71 => '10000', - 0x72 => '10001', - 0x73 => '10010', - 0x74 => '10011', - 0x75 => '10100', - 0x76 => '10101', - 0x77 => '10110', - 0x78 => '10111', - 0x79 => '11000', - 0x7a => '11001', - 0x32 => '11010', - 0x33 => '11011', - 0x34 => '11100', - 0x35 => '11101', - 0x36 => '11110', - 0x37 => '11111', - ); - - /* Step 1 */ - $inputCheck = strlen($inString) % 8; - if(($inputCheck == 1)||($inputCheck == 3)||($inputCheck == 6)) { - trigger_error('input to Base32Decode was a bad mod length: '.$inputCheck); - return false; - //return $this->raiseError('input to Base32Decode was a bad mod length: '.$inputCheck, null, - // PEAR_ERROR_DIE, null, null, 'Net_RACE_Error', false ); - } - - /* $deCompBits is a string that represents the bits as 0 and 1.*/ - for ($i = 0; $i < strlen($inString); $i++) { - $inChar = ord(substr($inString,$i,1)); - if(isset($BASE32_TABLE[$inChar])) { - $deCompBits .= $BASE32_TABLE[$inChar]; - } else { - trigger_error('input to Base32Decode had a bad character: '.$inChar); - return false; - //return $this->raiseError('input to Base32Decode had a bad character: '.$inChar, null, - // PEAR_ERROR_DIE, null, null, 'Net_RACE_Error', false ); - } - } - - /* Step 5 */ - $padding = strlen($deCompBits) % 8; - $paddingContent = substr($deCompBits, (strlen($deCompBits) - $padding)); - if(substr_count($paddingContent, '1')>0) { - trigger_error('found non-zero padding in Base32Decode'); - return false; - //return $this->raiseError('found non-zero padding in Base32Decode', null, - // PEAR_ERROR_DIE, null, null, 'Net_RACE_Error', false ); - } - - /* Break the decompressed string into octets for returning */ - $deArr = array(); - for($i = 0; $i < (int)(strlen($deCompBits) / 8); $i++) { - $deArr[$i] = chr(bindec(substr($deCompBits, $i*8, 8))); - } - - $outString = join('',$deArr); - - return $outString; -} + | +// | Arjan Wekking | +// | Martin Langhoff | +// +----------------------------------------------------------------------+ +// + +/** + * @package moodlecore + * @copyright (c) 2001 The PHP Group + * @license GNU GPL v2.0 http://www.php.net/license/2_02.txt + */ + +/** + * Base32 encode a binary string + * + * @param $inString Binary string to base32 encode + * + * @return $outString Base32 encoded $inString + * + * @access private + * + */ + +function base32_encode ($inString) +{ + $outString = ""; + $compBits = ""; + $BASE32_TABLE = array( + '00000' => 0x61, + '00001' => 0x62, + '00010' => 0x63, + '00011' => 0x64, + '00100' => 0x65, + '00101' => 0x66, + '00110' => 0x67, + '00111' => 0x68, + '01000' => 0x69, + '01001' => 0x6a, + '01010' => 0x6b, + '01011' => 0x6c, + '01100' => 0x6d, + '01101' => 0x6e, + '01110' => 0x6f, + '01111' => 0x70, + '10000' => 0x71, + '10001' => 0x72, + '10010' => 0x73, + '10011' => 0x74, + '10100' => 0x75, + '10101' => 0x76, + '10110' => 0x77, + '10111' => 0x78, + '11000' => 0x79, + '11001' => 0x7a, + '11010' => 0x32, + '11011' => 0x33, + '11100' => 0x34, + '11101' => 0x35, + '11110' => 0x36, + '11111' => 0x37, + ); + + /* Turn the compressed string into a string that represents the bits as 0 and 1. */ + for ($i = 0; $i < strlen($inString); $i++) { + $compBits .= str_pad(decbin(ord(substr($inString,$i,1))), 8, '0', STR_PAD_LEFT); + } + + /* Pad the value with enough 0's to make it a multiple of 5 */ + if((strlen($compBits) % 5) != 0) { + $compBits = str_pad($compBits, strlen($compBits)+(5-(strlen($compBits)%5)), '0', STR_PAD_RIGHT); + } + + /* Create an array by chunking it every 5 chars */ + $fiveBitsArray = split("\n",rtrim(chunk_split($compBits, 5, "\n"))); + + /* Look-up each chunk and add it to $outstring */ + foreach($fiveBitsArray as $fiveBitsString) { + $outString .= chr($BASE32_TABLE[$fiveBitsString]); + } + + return $outString; +} + + + +/** + * Base32 decode to a binary string + * + * @param $inString String to base32 decode + * + * @return $outString Base32 decoded $inString + * + * @access private + * + */ + +function Base32_decode($inString) { + /* declaration */ + $inputCheck = null; + $deCompBits = null; + + $BASE32_TABLE = array( + 0x61 => '00000', + 0x62 => '00001', + 0x63 => '00010', + 0x64 => '00011', + 0x65 => '00100', + 0x66 => '00101', + 0x67 => '00110', + 0x68 => '00111', + 0x69 => '01000', + 0x6a => '01001', + 0x6b => '01010', + 0x6c => '01011', + 0x6d => '01100', + 0x6e => '01101', + 0x6f => '01110', + 0x70 => '01111', + 0x71 => '10000', + 0x72 => '10001', + 0x73 => '10010', + 0x74 => '10011', + 0x75 => '10100', + 0x76 => '10101', + 0x77 => '10110', + 0x78 => '10111', + 0x79 => '11000', + 0x7a => '11001', + 0x32 => '11010', + 0x33 => '11011', + 0x34 => '11100', + 0x35 => '11101', + 0x36 => '11110', + 0x37 => '11111', + ); + + /* Step 1 */ + $inputCheck = strlen($inString) % 8; + if(($inputCheck == 1)||($inputCheck == 3)||($inputCheck == 6)) { + trigger_error('input to Base32Decode was a bad mod length: '.$inputCheck); + return false; + //return $this->raiseError('input to Base32Decode was a bad mod length: '.$inputCheck, null, + // PEAR_ERROR_DIE, null, null, 'Net_RACE_Error', false ); + } + + /* $deCompBits is a string that represents the bits as 0 and 1.*/ + for ($i = 0; $i < strlen($inString); $i++) { + $inChar = ord(substr($inString,$i,1)); + if(isset($BASE32_TABLE[$inChar])) { + $deCompBits .= $BASE32_TABLE[$inChar]; + } else { + trigger_error('input to Base32Decode had a bad character: '.$inChar); + return false; + //return $this->raiseError('input to Base32Decode had a bad character: '.$inChar, null, + // PEAR_ERROR_DIE, null, null, 'Net_RACE_Error', false ); + } + } + + /* Step 5 */ + $padding = strlen($deCompBits) % 8; + $paddingContent = substr($deCompBits, (strlen($deCompBits) - $padding)); + if(substr_count($paddingContent, '1')>0) { + trigger_error('found non-zero padding in Base32Decode'); + return false; + //return $this->raiseError('found non-zero padding in Base32Decode', null, + // PEAR_ERROR_DIE, null, null, 'Net_RACE_Error', false ); + } + + /* Break the decompressed string into octets for returning */ + $deArr = array(); + for($i = 0; $i < (int)(strlen($deCompBits) / 8); $i++) { + $deArr[$i] = chr(bindec(substr($deCompBits, $i*8, 8))); + } + + $outString = join('',$deArr); + + return $outString; +} diff --git a/lib/dragmath/applet/lang/en.xml b/lib/dragmath/applet/lang/en.xml index 7f4dc77e05c..acffa90d59a 100644 Binary files a/lib/dragmath/applet/lang/en.xml and b/lib/dragmath/applet/lang/en.xml differ diff --git a/lib/dragmath/doc/simple.html b/lib/dragmath/doc/simple.html index ec5086fbcaa..b9c6ce1c0e6 100644 Binary files a/lib/dragmath/doc/simple.html and b/lib/dragmath/doc/simple.html differ diff --git a/lib/editor/tinymce/Popup.js b/lib/editor/tinymce/Popup.js index 3c78622d7ed..15d4df0d771 100644 --- a/lib/editor/tinymce/Popup.js +++ b/lib/editor/tinymce/Popup.js @@ -1,413 +1,413 @@ -/** - * $Id$ - * - * @author Moxiecode - * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved. - */ - -// Some global instances -var tinymce = null, tinyMCEPopup, tinyMCE; - -/**#@+ - * @class TinyMCE popup/dialog helper class. This gives you easy access to the - * parent editor instance and a bunch of other things. It's higly recommended - * that you load this script into your dialogs. - * - * @static - * @member tinyMCEPopup - */ -tinyMCEPopup = { - /**#@+ - * @method - */ - - /** - * Initializes the popup this will be called automatically. - */ - init : function() { - var t = this, w, ti; - - // Find window & API - w = t.getWin(); - tinymce = w.tinymce; - tinyMCE = w.tinyMCE; - t.editor = tinymce.EditorManager.activeEditor; - t.params = t.editor.windowManager.params; - t.features = t.editor.windowManager.features; - - // Setup local DOM - t.dom = t.editor.windowManager.createInstance('tinymce.dom.DOMUtils', document); - - // Enables you to skip loading the default css - if (t.features.popup_css !== false) - t.dom.loadCSS(t.features.popup_css || t.editor.settings.popup_css); - - // Setup on init listeners - t.listeners = []; - t.onInit = { - add : function(f, s) { - t.listeners.push({func : f, scope : s}); - } - }; - - t.isWindow = !t.getWindowArg('mce_inline'); - t.id = t.getWindowArg('mce_window_id'); - t.editor.windowManager.onOpen.dispatch(t.editor.windowManager, window); - }, - - /** - * Returns the reference to the parent window that opened the dialog. - * - * @return {Window} Reference to the parent window that opened the dialog. - */ - getWin : function() { - return window.dialogArguments || opener || parent || top; - }, - - /** - * Returns a window argument/parameter by name. - * - * @param {String} n Name of the window argument to retrive. - * @param {String} dv Optional default value to return. - * @return {String} Argument value or default value if it wasn't found. - */ - getWindowArg : function(n, dv) { - var v = this.params[n]; - - return tinymce.is(v) ? v : dv; - }, - - /** - * Returns a editor parameter/config option value. - * - * @param {String} n Name of the editor config option to retrive. - * @param {String} dv Optional default value to return. - * @return {String} Parameter value or default value if it wasn't found. - */ - getParam : function(n, dv) { - return this.editor.getParam(n, dv); - }, - - /** - * Returns a language item by key. - * - * @param {String} n Language item like mydialog.something. - * @param {String} dv Optional default value to return. - * @return {String} Language value for the item like "my string" or the default value if it wasn't found. - */ - getLang : function(n, dv) { - return this.editor.getLang(n, dv); - }, - - /** - * Executed a command on editor that opened the dialog/popup. - * - * @param {String} cmd Command to execute. - * @param {bool} ui Optional boolean value if the UI for the command should be presented or not. - * @param {Object} val Optional value to pass with the comman like an URL. - * @param {Object} a Optional arguments object. - */ - execCommand : function(cmd, ui, val, a) { - a = a || {}; - a.skip_focus = 1; - - this.restoreSelection(); - return this.editor.execCommand(cmd, ui, val, a); - }, - - /** - * Resizes the dialog to the inner size of the window. This is needed since various browsers - * have different border sizes on windows. - */ - resizeToInnerSize : function() { - var t = this, n, b = document.body, vp = t.dom.getViewPort(window), dw, dh; - - dw = t.getWindowArg('mce_width') - vp.w; - dh = t.getWindowArg('mce_height') - vp.h; - - if (t.isWindow) - window.resizeBy(dw, dh); - else - t.editor.windowManager.resizeBy(dw, dh, t.id); - }, - - /** - * Will executed the specified string when the page has been loaded. This function - * was added for compatibility with the 2.x branch. - * - * @param {String} s String to evalutate on init. - */ - executeOnLoad : function(s) { - this.onInit.add(function() { - eval(s); - }); - }, - - /** - * Stores the current editor selection for later restoration. This can be useful since some browsers - * looses it's selection if a control element is selected/focused inside the dialogs. - */ - storeSelection : function() { - this.editor.windowManager.bookmark = tinyMCEPopup.editor.selection.getBookmark(1); - }, - - /** - * Restores any stored selection. This can be useful since some browsers - * looses it's selection if a control element is selected/focused inside the dialogs. - */ - restoreSelection : function() { - var t = tinyMCEPopup; - - if (!t.isWindow && tinymce.isIE) - t.editor.selection.moveToBookmark(t.editor.windowManager.bookmark); - }, - - /** - * Loads a specific dialog language pack. If you pass in plugin_url as a arugment - * when you open the window it will load the /langs/_dlg.js lang pack file. - */ - requireLangPack : function() { - return; // not needed in Moodle - we load all lang packs in one request - var t = this, u = t.getWindowArg('plugin_url') || t.getWindowArg('theme_url'); - - if (u && t.editor.settings.language && t.features.translate_i18n !== false) { - u += '/langs/' + t.editor.settings.language + '_dlg.js'; - - if (!tinymce.ScriptLoader.isDone(u)) { - document.write(''); - tinymce.ScriptLoader.markDone(u); - } - } - }, - - /** - * Executes a color picker on the specified element id. When the user - * then selects a color it will be set as the value of the specified element. - * - * @param {DOMEvent} e DOM event object. - * @param {string} element_id Element id to be filled with the color value from the picker. - */ - pickColor : function(e, element_id) { - this.execCommand('mceColorPicker', true, { - color : document.getElementById(element_id).value, - func : function(c) { - document.getElementById(element_id).value = c; - - try { - document.getElementById(element_id).onchange(); - } catch (ex) { - // Try fire event, ignore errors - } - } - }); - }, - - /** - * Opens a filebrowser/imagebrowser this will set the output value from - * the browser as a value on the specified element. - * - * @param {string} element_id Id of the element to set value in. - * @param {string} type Type of browser to open image/file/flash. - * @param {string} option Option name to get the file_broswer_callback function name from. - */ - openBrowser : function(element_id, type, option) { - tinyMCEPopup.restoreSelection(); - this.editor.execCallback('file_browser_callback', element_id, document.getElementById(element_id).value, type, window); - }, - - /** - * Creates a confirm dialog. Please don't use the blocking behavior of this - * native version use the callback method instead then it can be extended. - * - * @param {String} t Title for the new confirm dialog. - * @param {function} cb Callback function to be executed after the user has selected ok or cancel. - * @param {Object} s Optional scope to execute the callback in. - */ - confirm : function(t, cb, s) { - this.editor.windowManager.confirm(t, cb, s, window); - }, - - /** - * Creates a alert dialog. Please don't use the blocking behavior of this - * native version use the callback method instead then it can be extended. - * - * @param {String} t Title for the new alert dialog. - * @param {function} cb Callback function to be executed after the user has selected ok. - * @param {Object} s Optional scope to execute the callback in. - */ - alert : function(tx, cb, s) { - this.editor.windowManager.alert(tx, cb, s, window); - }, - - /** - * Closes the current window. - */ - close : function() { - var t = this; - - // To avoid domain relaxing issue in Opera - function close() { - t.editor.windowManager.close(window); - tinymce = tinyMCE = t.editor = t.params = t.dom = t.dom.doc = null; // Cleanup - }; - - if (tinymce.isOpera) - t.getWin().setTimeout(close, 0); - else - close(); - }, - - // Internal functions - - _restoreSelection : function() { - var e = window.event.srcElement; - - if (e.nodeName == 'INPUT' && (e.type == 'submit' || e.type == 'button')) - tinyMCEPopup.restoreSelection(); - }, - -/* _restoreSelection : function() { - var e = window.event.srcElement; - - // If user focus a non text input or textarea - if ((e.nodeName != 'INPUT' && e.nodeName != 'TEXTAREA') || e.type != 'text') - tinyMCEPopup.restoreSelection(); - },*/ - - _onDOMLoaded : function() { - var t = tinyMCEPopup, ti = document.title, bm, h, nv; - - if (t.domLoaded) - return; - - t.domLoaded = 1; - - // Translate page - if (t.features.translate_i18n !== false) { - h = document.body.innerHTML; - - // Replace a=x with a="x" in IE - if (tinymce.isIE) - h = h.replace(/ (value|title|alt)=([^"][^\s>]+)/gi, ' $1="$2"') - - document.dir = t.editor.getParam('directionality',''); - - if ((nv = t.editor.translate(h)) && nv != h) - document.body.innerHTML = nv; - - if ((nv = t.editor.translate(ti)) && nv != ti) - document.title = ti = nv; - } - - document.body.style.display = ''; - - // Restore selection in IE when focus is placed on a non textarea or input element of the type text - if (tinymce.isIE) { - document.attachEvent('onmouseup', tinyMCEPopup._restoreSelection); - - // Add base target element for it since it would fail with modal dialogs - t.dom.add(t.dom.select('head')[0], 'base', {target : '_self'}); - } - - t.restoreSelection(); - t.resizeToInnerSize(); - - // Set inline title - if (!t.isWindow) - t.editor.windowManager.setTitle(window, ti); - else - window.focus(); - - if (!tinymce.isIE && !t.isWindow) { - tinymce.dom.Event._add(document, 'focus', function() { - t.editor.windowManager.focus(t.id) - }); - } - - // Patch for accessibility - tinymce.each(t.dom.select('select'), function(e) { - e.onkeydown = tinyMCEPopup._accessHandler; - }); - - // Call onInit - // Init must be called before focus so the selection won't get lost by the focus call - tinymce.each(t.listeners, function(o) { - o.func.call(o.scope, t.editor); - }); - - // Move focus to window - if (t.getWindowArg('mce_auto_focus', true)) { - window.focus(); - - // Focus element with mceFocus class - tinymce.each(document.forms, function(f) { - tinymce.each(f.elements, function(e) { - if (t.dom.hasClass(e, 'mceFocus') && !e.disabled) { - e.focus(); - return false; // Break loop - } - }); - }); - } - - document.onkeyup = tinyMCEPopup._closeWinKeyHandler; - }, - - _accessHandler : function(e) { - e = e || window.event; - - if (e.keyCode == 13 || e.keyCode == 32) { - e = e.target || e.srcElement; - - if (e.onchange) - e.onchange(); - - return tinymce.dom.Event.cancel(e); - } - }, - - _closeWinKeyHandler : function(e) { - e = e || window.event; - - if (e.keyCode == 27) - tinyMCEPopup.close(); - }, - - _wait : function() { - // Use IE method - if (document.attachEvent) { - document.attachEvent("onreadystatechange", function() { - if (document.readyState === "complete") { - document.detachEvent("onreadystatechange", arguments.callee); - tinyMCEPopup._onDOMLoaded(); - } - }); - - if (document.documentElement.doScroll && window == window.top) { - (function() { - if (tinyMCEPopup.domLoaded) - return; - - try { - // If IE is used, use the trick by Diego Perini - // http://javascript.nwbox.com/IEContentLoaded/ - document.documentElement.doScroll("left"); - } catch (ex) { - setTimeout(arguments.callee, 0); - return; - } - - tinyMCEPopup._onDOMLoaded(); - })(); - } - - document.attachEvent('onload', tinyMCEPopup._onDOMLoaded); - } else if (document.addEventListener) { - window.addEventListener('DOMContentLoaded', tinyMCEPopup._onDOMLoaded, false); - window.addEventListener('load', tinyMCEPopup._onDOMLoaded, false); - } - } -}; - -tinyMCEPopup.init(); -tinyMCEPopup._wait(); // Wait for DOM Content Loaded +/** + * $Id$ + * + * @author Moxiecode + * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +// Some global instances +var tinymce = null, tinyMCEPopup, tinyMCE; + +/**#@+ + * @class TinyMCE popup/dialog helper class. This gives you easy access to the + * parent editor instance and a bunch of other things. It's higly recommended + * that you load this script into your dialogs. + * + * @static + * @member tinyMCEPopup + */ +tinyMCEPopup = { + /**#@+ + * @method + */ + + /** + * Initializes the popup this will be called automatically. + */ + init : function() { + var t = this, w, ti; + + // Find window & API + w = t.getWin(); + tinymce = w.tinymce; + tinyMCE = w.tinyMCE; + t.editor = tinymce.EditorManager.activeEditor; + t.params = t.editor.windowManager.params; + t.features = t.editor.windowManager.features; + + // Setup local DOM + t.dom = t.editor.windowManager.createInstance('tinymce.dom.DOMUtils', document); + + // Enables you to skip loading the default css + if (t.features.popup_css !== false) + t.dom.loadCSS(t.features.popup_css || t.editor.settings.popup_css); + + // Setup on init listeners + t.listeners = []; + t.onInit = { + add : function(f, s) { + t.listeners.push({func : f, scope : s}); + } + }; + + t.isWindow = !t.getWindowArg('mce_inline'); + t.id = t.getWindowArg('mce_window_id'); + t.editor.windowManager.onOpen.dispatch(t.editor.windowManager, window); + }, + + /** + * Returns the reference to the parent window that opened the dialog. + * + * @return {Window} Reference to the parent window that opened the dialog. + */ + getWin : function() { + return window.dialogArguments || opener || parent || top; + }, + + /** + * Returns a window argument/parameter by name. + * + * @param {String} n Name of the window argument to retrive. + * @param {String} dv Optional default value to return. + * @return {String} Argument value or default value if it wasn't found. + */ + getWindowArg : function(n, dv) { + var v = this.params[n]; + + return tinymce.is(v) ? v : dv; + }, + + /** + * Returns a editor parameter/config option value. + * + * @param {String} n Name of the editor config option to retrive. + * @param {String} dv Optional default value to return. + * @return {String} Parameter value or default value if it wasn't found. + */ + getParam : function(n, dv) { + return this.editor.getParam(n, dv); + }, + + /** + * Returns a language item by key. + * + * @param {String} n Language item like mydialog.something. + * @param {String} dv Optional default value to return. + * @return {String} Language value for the item like "my string" or the default value if it wasn't found. + */ + getLang : function(n, dv) { + return this.editor.getLang(n, dv); + }, + + /** + * Executed a command on editor that opened the dialog/popup. + * + * @param {String} cmd Command to execute. + * @param {bool} ui Optional boolean value if the UI for the command should be presented or not. + * @param {Object} val Optional value to pass with the comman like an URL. + * @param {Object} a Optional arguments object. + */ + execCommand : function(cmd, ui, val, a) { + a = a || {}; + a.skip_focus = 1; + + this.restoreSelection(); + return this.editor.execCommand(cmd, ui, val, a); + }, + + /** + * Resizes the dialog to the inner size of the window. This is needed since various browsers + * have different border sizes on windows. + */ + resizeToInnerSize : function() { + var t = this, n, b = document.body, vp = t.dom.getViewPort(window), dw, dh; + + dw = t.getWindowArg('mce_width') - vp.w; + dh = t.getWindowArg('mce_height') - vp.h; + + if (t.isWindow) + window.resizeBy(dw, dh); + else + t.editor.windowManager.resizeBy(dw, dh, t.id); + }, + + /** + * Will executed the specified string when the page has been loaded. This function + * was added for compatibility with the 2.x branch. + * + * @param {String} s String to evalutate on init. + */ + executeOnLoad : function(s) { + this.onInit.add(function() { + eval(s); + }); + }, + + /** + * Stores the current editor selection for later restoration. This can be useful since some browsers + * looses it's selection if a control element is selected/focused inside the dialogs. + */ + storeSelection : function() { + this.editor.windowManager.bookmark = tinyMCEPopup.editor.selection.getBookmark(1); + }, + + /** + * Restores any stored selection. This can be useful since some browsers + * looses it's selection if a control element is selected/focused inside the dialogs. + */ + restoreSelection : function() { + var t = tinyMCEPopup; + + if (!t.isWindow && tinymce.isIE) + t.editor.selection.moveToBookmark(t.editor.windowManager.bookmark); + }, + + /** + * Loads a specific dialog language pack. If you pass in plugin_url as a arugment + * when you open the window it will load the /langs/_dlg.js lang pack file. + */ + requireLangPack : function() { + return; // not needed in Moodle - we load all lang packs in one request + var t = this, u = t.getWindowArg('plugin_url') || t.getWindowArg('theme_url'); + + if (u && t.editor.settings.language && t.features.translate_i18n !== false) { + u += '/langs/' + t.editor.settings.language + '_dlg.js'; + + if (!tinymce.ScriptLoader.isDone(u)) { + document.write(''); + tinymce.ScriptLoader.markDone(u); + } + } + }, + + /** + * Executes a color picker on the specified element id. When the user + * then selects a color it will be set as the value of the specified element. + * + * @param {DOMEvent} e DOM event object. + * @param {string} element_id Element id to be filled with the color value from the picker. + */ + pickColor : function(e, element_id) { + this.execCommand('mceColorPicker', true, { + color : document.getElementById(element_id).value, + func : function(c) { + document.getElementById(element_id).value = c; + + try { + document.getElementById(element_id).onchange(); + } catch (ex) { + // Try fire event, ignore errors + } + } + }); + }, + + /** + * Opens a filebrowser/imagebrowser this will set the output value from + * the browser as a value on the specified element. + * + * @param {string} element_id Id of the element to set value in. + * @param {string} type Type of browser to open image/file/flash. + * @param {string} option Option name to get the file_broswer_callback function name from. + */ + openBrowser : function(element_id, type, option) { + tinyMCEPopup.restoreSelection(); + this.editor.execCallback('file_browser_callback', element_id, document.getElementById(element_id).value, type, window); + }, + + /** + * Creates a confirm dialog. Please don't use the blocking behavior of this + * native version use the callback method instead then it can be extended. + * + * @param {String} t Title for the new confirm dialog. + * @param {function} cb Callback function to be executed after the user has selected ok or cancel. + * @param {Object} s Optional scope to execute the callback in. + */ + confirm : function(t, cb, s) { + this.editor.windowManager.confirm(t, cb, s, window); + }, + + /** + * Creates a alert dialog. Please don't use the blocking behavior of this + * native version use the callback method instead then it can be extended. + * + * @param {String} t Title for the new alert dialog. + * @param {function} cb Callback function to be executed after the user has selected ok. + * @param {Object} s Optional scope to execute the callback in. + */ + alert : function(tx, cb, s) { + this.editor.windowManager.alert(tx, cb, s, window); + }, + + /** + * Closes the current window. + */ + close : function() { + var t = this; + + // To avoid domain relaxing issue in Opera + function close() { + t.editor.windowManager.close(window); + tinymce = tinyMCE = t.editor = t.params = t.dom = t.dom.doc = null; // Cleanup + }; + + if (tinymce.isOpera) + t.getWin().setTimeout(close, 0); + else + close(); + }, + + // Internal functions + + _restoreSelection : function() { + var e = window.event.srcElement; + + if (e.nodeName == 'INPUT' && (e.type == 'submit' || e.type == 'button')) + tinyMCEPopup.restoreSelection(); + }, + +/* _restoreSelection : function() { + var e = window.event.srcElement; + + // If user focus a non text input or textarea + if ((e.nodeName != 'INPUT' && e.nodeName != 'TEXTAREA') || e.type != 'text') + tinyMCEPopup.restoreSelection(); + },*/ + + _onDOMLoaded : function() { + var t = tinyMCEPopup, ti = document.title, bm, h, nv; + + if (t.domLoaded) + return; + + t.domLoaded = 1; + + // Translate page + if (t.features.translate_i18n !== false) { + h = document.body.innerHTML; + + // Replace a=x with a="x" in IE + if (tinymce.isIE) + h = h.replace(/ (value|title|alt)=([^"][^\s>]+)/gi, ' $1="$2"') + + document.dir = t.editor.getParam('directionality',''); + + if ((nv = t.editor.translate(h)) && nv != h) + document.body.innerHTML = nv; + + if ((nv = t.editor.translate(ti)) && nv != ti) + document.title = ti = nv; + } + + document.body.style.display = ''; + + // Restore selection in IE when focus is placed on a non textarea or input element of the type text + if (tinymce.isIE) { + document.attachEvent('onmouseup', tinyMCEPopup._restoreSelection); + + // Add base target element for it since it would fail with modal dialogs + t.dom.add(t.dom.select('head')[0], 'base', {target : '_self'}); + } + + t.restoreSelection(); + t.resizeToInnerSize(); + + // Set inline title + if (!t.isWindow) + t.editor.windowManager.setTitle(window, ti); + else + window.focus(); + + if (!tinymce.isIE && !t.isWindow) { + tinymce.dom.Event._add(document, 'focus', function() { + t.editor.windowManager.focus(t.id) + }); + } + + // Patch for accessibility + tinymce.each(t.dom.select('select'), function(e) { + e.onkeydown = tinyMCEPopup._accessHandler; + }); + + // Call onInit + // Init must be called before focus so the selection won't get lost by the focus call + tinymce.each(t.listeners, function(o) { + o.func.call(o.scope, t.editor); + }); + + // Move focus to window + if (t.getWindowArg('mce_auto_focus', true)) { + window.focus(); + + // Focus element with mceFocus class + tinymce.each(document.forms, function(f) { + tinymce.each(f.elements, function(e) { + if (t.dom.hasClass(e, 'mceFocus') && !e.disabled) { + e.focus(); + return false; // Break loop + } + }); + }); + } + + document.onkeyup = tinyMCEPopup._closeWinKeyHandler; + }, + + _accessHandler : function(e) { + e = e || window.event; + + if (e.keyCode == 13 || e.keyCode == 32) { + e = e.target || e.srcElement; + + if (e.onchange) + e.onchange(); + + return tinymce.dom.Event.cancel(e); + } + }, + + _closeWinKeyHandler : function(e) { + e = e || window.event; + + if (e.keyCode == 27) + tinyMCEPopup.close(); + }, + + _wait : function() { + // Use IE method + if (document.attachEvent) { + document.attachEvent("onreadystatechange", function() { + if (document.readyState === "complete") { + document.detachEvent("onreadystatechange", arguments.callee); + tinyMCEPopup._onDOMLoaded(); + } + }); + + if (document.documentElement.doScroll && window == window.top) { + (function() { + if (tinyMCEPopup.domLoaded) + return; + + try { + // If IE is used, use the trick by Diego Perini + // http://javascript.nwbox.com/IEContentLoaded/ + document.documentElement.doScroll("left"); + } catch (ex) { + setTimeout(arguments.callee, 0); + return; + } + + tinyMCEPopup._onDOMLoaded(); + })(); + } + + document.attachEvent('onload', tinyMCEPopup._onDOMLoaded); + } else if (document.addEventListener) { + window.addEventListener('DOMContentLoaded', tinyMCEPopup._onDOMLoaded, false); + window.addEventListener('load', tinyMCEPopup._onDOMLoaded, false); + } + } +}; + +tinyMCEPopup.init(); +tinyMCEPopup._wait(); // Wait for DOM Content Loaded diff --git a/lib/editor/tinymce/extra/patches/tinymce_form_utils.patch b/lib/editor/tinymce/extra/patches/tinymce_form_utils.patch index 305add92ac5..89b10d07d0b 100644 --- a/lib/editor/tinymce/extra/patches/tinymce_form_utils.patch +++ b/lib/editor/tinymce/extra/patches/tinymce_form_utils.patch @@ -6,36 +6,36 @@ diff -u -r1.1 form_utils.js --- lib/editor/tinymce/utils/form_utils.js 16 May 2009 20:54:46 -0000 1.1 +++ lib/editor/tinymce/utils/form_utils.js 10 Nov 2009 08:06:02 -0000 @@ -48,9 +48,21 @@ - if (!cb) - return ""; - -- html = ""; -- html += ''; -- html += ' '; -+ html = ""; -+ if (id=='filebrowser') { -+ // for moodlemedia plugin -+ html += ''; -+ html += tinyMCEPopup.getLang('browsemedia'); -+ html += ''; -+ } else if (id=='srcbrowser') { -+ // for advimage plugin -+ html += ''; -+ html += tinyMCEPopup.getLang('browseimage'); -+ html += ''; -+ } else { -+ html += ''; -+ html += ' '; -+ } - - return html; - } + if (!cb) + return ""; + +- html = ""; +- html += ''; +- html += ' '; ++ html = ""; ++ if (id=='filebrowser') { ++ // for moodlemedia plugin ++ html += ''; ++ html += tinyMCEPopup.getLang('browsemedia'); ++ html += ''; ++ } else if (id=='srcbrowser') { ++ // for advimage plugin ++ html += ''; ++ html += tinyMCEPopup.getLang('browseimage'); ++ html += ''; ++ } else { ++ html += ''; ++ html += ' '; ++ } + + return html; + } @@ -58,7 +70,7 @@ - function openBrowser(img_id, target_form_element, type, option) { - var img = document.getElementById(img_id); - -- if (img.className != "mceButtonDisabled") -+ if (!img || img.className != "mceButtonDisabled") - tinyMCEPopup.openBrowser(target_form_element, type, option); - } - + function openBrowser(img_id, target_form_element, type, option) { + var img = document.getElementById(img_id); + +- if (img.className != "mceButtonDisabled") ++ if (!img || img.className != "mceButtonDisabled") + tinyMCEPopup.openBrowser(target_form_element, type, option); + } + diff --git a/lib/editor/tinymce/extra/patches/tinymce_plugin_advimage.patch b/lib/editor/tinymce/extra/patches/tinymce_plugin_advimage.patch index 0c6bb6cc5ea..2ae9fcb342b 100644 --- a/lib/editor/tinymce/extra/patches/tinymce_plugin_advimage.patch +++ b/lib/editor/tinymce/extra/patches/tinymce_plugin_advimage.patch @@ -6,56 +6,56 @@ diff -u -r1.1 image.htm --- lib/editor/tinymce/plugins/advimage/image.htm 16 May 2009 20:53:41 -0000 1.1 +++ lib/editor/tinymce/plugins/advimage/image.htm 11 Nov 2009 05:18:39 -0000 @@ -26,14 +26,15 @@ - {#advimage_dlg.general} - - -+ -+ -+ -+ - - -- -+ - - - + {#advimage_dlg.general} + +
      
    -- -- -- -- --
     
    -+ -+
    ++ ++ ++ ++ + + +- ++ + + + @@ -41,12 +42,8 @@ - - - -- -+ - -- -- -- -- -
      
    +- +- +- +- +-
     
    ++ ++
    - - + + + +- ++ + +- +- +- +- + + + @@ -180,10 +177,13 @@ - - - -+ -+ -+ -+ - - - -- - - -
    + + + ++ ++ ++ ++ + + + +- + + +
    Index: lib/editor/tinymce/plugins/advimage/css/advimage.css =================================================================== RCS file: /cvsroot/moodle/moodle/lib/editor/tinymce/plugins/advimage/css/advimage.css,v @@ -64,20 +64,20 @@ diff -u -r1.1 advimage.css --- lib/editor/tinymce/plugins/advimage/css/advimage.css 16 May 2009 20:54:52 -0000 1.1 +++ lib/editor/tinymce/plugins/advimage/css/advimage.css 11 Nov 2009 05:18:39 -0000 @@ -1,13 +1,15 @@ - #src_list, #over_list, #out_list {width:280px;} - .mceActionPanel {margin-top:7px;} -+.moodlebutton {font-size: 1.5em;font-weight:bold;padding: 3px;border:1px solid #ccc;text-decoration:none} -+.moodlebutton:hover {background: #ccc} - .alignPreview {border:1px solid #000; width:140px; height:140px; overflow:hidden; padding:5px;} - .checkbox {border:0;} - .panel_wrapper div.current {height:305px;} --#prev {margin:0; border:1px solid #000; width:428px; height:150px; overflow:auto;} -+#prev {margin:0; border:1px solid #000; width:428px; height:180px; overflow:auto;} - #align, #classlist {width:150px;} - #width, #height {vertical-align:middle; width:50px; text-align:center;} - #vspace, #hspace, #border {vertical-align:middle; width:30px; text-align:center;} - #class_list {width:180px;} - input {width: 280px;} - #constrain, #onmousemovecheck {width:auto;} --#id, #dir, #lang, #usemap, #longdesc {width:200px;} -+#id, #title, #dir, #lang, #usemap, #longdesc {width:200px;} + #src_list, #over_list, #out_list {width:280px;} + .mceActionPanel {margin-top:7px;} ++.moodlebutton {font-size: 1.5em;font-weight:bold;padding: 3px;border:1px solid #ccc;text-decoration:none} ++.moodlebutton:hover {background: #ccc} + .alignPreview {border:1px solid #000; width:140px; height:140px; overflow:hidden; padding:5px;} + .checkbox {border:0;} + .panel_wrapper div.current {height:305px;} +-#prev {margin:0; border:1px solid #000; width:428px; height:150px; overflow:auto;} ++#prev {margin:0; border:1px solid #000; width:428px; height:180px; overflow:auto;} + #align, #classlist {width:150px;} + #width, #height {vertical-align:middle; width:50px; text-align:center;} + #vspace, #hspace, #border {vertical-align:middle; width:30px; text-align:center;} + #class_list {width:180px;} + input {width: 280px;} + #constrain, #onmousemovecheck {width:auto;} +-#id, #dir, #lang, #usemap, #longdesc {width:200px;} ++#id, #title, #dir, #lang, #usemap, #longdesc {width:200px;} diff --git a/lib/editor/tinymce/extra/tools/compress.cmd b/lib/editor/tinymce/extra/tools/compress.cmd index e843e842816..0b107d2acd2 100644 --- a/lib/editor/tinymce/extra/tools/compress.cmd +++ b/lib/editor/tinymce/extra/tools/compress.cmd @@ -1,2 +1,2 @@ -java -jar yuicompressor.jar --line-break 1000 ..\..\tiny_mce_src.js -o ..\..\tiny_mce.js +java -jar yuicompressor.jar --line-break 1000 ..\..\tiny_mce_src.js -o ..\..\tiny_mce.js java -jar yuicompressor.jar --line-break 1000 ..\..\Popup.js -o ..\..\tiny_mce_popup.js \ No newline at end of file diff --git a/lib/editor/tinymce/extra/tools/compress_dragmath.cmd b/lib/editor/tinymce/extra/tools/compress_dragmath.cmd index 6d5dc5ac26a..360686b53d8 100644 --- a/lib/editor/tinymce/extra/tools/compress_dragmath.cmd +++ b/lib/editor/tinymce/extra/tools/compress_dragmath.cmd @@ -1 +1 @@ -java -jar yuicompressor.jar --line-break 1000 ..\..\plugins\dragmath\editor_plugin_src.js -o ..\..\plugins\dragmath\editor_plugin.js +java -jar yuicompressor.jar --line-break 1000 ..\..\plugins\dragmath\editor_plugin_src.js -o ..\..\plugins\dragmath\editor_plugin.js diff --git a/lib/editor/tinymce/langs/en.js b/lib/editor/tinymce/langs/en.js index 8519b4de75e..ef3e18afef2 100644 --- a/lib/editor/tinymce/langs/en.js +++ b/lib/editor/tinymce/langs/en.js @@ -1,154 +1,154 @@ -tinyMCE.addI18n({en:{ -common:{ -edit_confirm:"Do you want to use the WYSIWYG mode for this textarea?", -apply:"Apply", -insert:"Insert", -update:"Update", -cancel:"Cancel", -close:"Close", -browse:"Browse", -class_name:"Class", -not_set:"-- Not set --", -clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?", -clipboard_no_support:"Currently not supported by your browser, use keyboard shortcuts instead.", -popup_blocked:"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.", -invalid_data:"Error: Invalid values entered, these are marked in red.", -more_colors:"More colors" -}, -contextmenu:{ -align:"Alignment", -left:"Left", -center:"Center", -right:"Right", -full:"Full" -}, -insertdatetime:{ -date_fmt:"%Y-%m-%d", -time_fmt:"%H:%M:%S", -insertdate_desc:"Insert date", -inserttime_desc:"Insert time", -months_long:"January,February,March,April,May,June,July,August,September,October,November,December", -months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec", -day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday", -day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun" -}, -print:{ -print_desc:"Print" -}, -preview:{ -preview_desc:"Preview" -}, -directionality:{ -ltr_desc:"Direction left to right", -rtl_desc:"Direction right to left" -}, -layer:{ -insertlayer_desc:"Insert new layer", -forward_desc:"Move forward", -backward_desc:"Move backward", -absolute_desc:"Toggle absolute positioning", -content:"New layer..." -}, -save:{ -save_desc:"Save", -cancel_desc:"Cancel all changes" -}, -nonbreaking:{ -nonbreaking_desc:"Insert non-breaking space character" -}, -iespell:{ -iespell_desc:"Run spell checking", -download:"ieSpell not detected. Do you want to install it now?" -}, -advhr:{ -advhr_desc:"Horizontal rule" -}, -emotions:{ -emotions_desc:"Emotions" -}, -searchreplace:{ -search_desc:"Find", -replace_desc:"Find/Replace" -}, -advimage:{ -image_desc:"Insert/edit image" -}, -advlink:{ -link_desc:"Insert/edit link" -}, -xhtmlxtras:{ -cite_desc:"Citation", -abbr_desc:"Abbreviation", -acronym_desc:"Acronym", -del_desc:"Deletion", -ins_desc:"Insertion", -attribs_desc:"Insert/Edit Attributes" -}, -style:{ -desc:"Edit CSS Style" -}, -paste:{ -paste_text_desc:"Paste as Plain Text", -paste_word_desc:"Paste from Word", -selectall_desc:"Select All" -}, -paste_dlg:{ -text_title:"Use CTRL+V on your keyboard to paste the text into the window.", -text_linebreaks:"Keep linebreaks", -word_title:"Use CTRL+V on your keyboard to paste the text into the window." -}, -table:{ -desc:"Inserts a new table", -row_before_desc:"Insert row before", -row_after_desc:"Insert row after", -delete_row_desc:"Delete row", -col_before_desc:"Insert column before", -col_after_desc:"Insert column after", -delete_col_desc:"Remove column", -split_cells_desc:"Split merged table cells", -merge_cells_desc:"Merge table cells", -row_desc:"Table row properties", -cell_desc:"Table cell properties", -props_desc:"Table properties", -paste_row_before_desc:"Paste table row before", -paste_row_after_desc:"Paste table row after", -cut_row_desc:"Cut table row", -copy_row_desc:"Copy table row", -del:"Delete table", -row:"Row", -col:"Column", -cell:"Cell" -}, -autosave:{ -unload_msg:"The changes you made will be lost if you navigate away from this page." -}, -fullscreen:{ -desc:"Toggle fullscreen mode" -}, -media:{ -desc:"Insert / edit embedded media", -edit:"Edit embedded media" -}, -fullpage:{ -desc:"Document properties" -}, -template:{ -desc:"Insert predefined template content" -}, -visualchars:{ -desc:"Visual control characters on/off." -}, -spellchecker:{ -desc:"Toggle spellchecker", -menu:"Spellchecker settings", -ignore_word:"Ignore word", -ignore_words:"Ignore all", -langs:"Languages", -wait:"Please wait...", -sug:"Suggestions", -no_sug:"No suggestions", -no_mpell:"No misspellings found." -}, -pagebreak:{ -desc:"Insert page break." +tinyMCE.addI18n({en:{ +common:{ +edit_confirm:"Do you want to use the WYSIWYG mode for this textarea?", +apply:"Apply", +insert:"Insert", +update:"Update", +cancel:"Cancel", +close:"Close", +browse:"Browse", +class_name:"Class", +not_set:"-- Not set --", +clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?", +clipboard_no_support:"Currently not supported by your browser, use keyboard shortcuts instead.", +popup_blocked:"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.", +invalid_data:"Error: Invalid values entered, these are marked in red.", +more_colors:"More colors" +}, +contextmenu:{ +align:"Alignment", +left:"Left", +center:"Center", +right:"Right", +full:"Full" +}, +insertdatetime:{ +date_fmt:"%Y-%m-%d", +time_fmt:"%H:%M:%S", +insertdate_desc:"Insert date", +inserttime_desc:"Insert time", +months_long:"January,February,March,April,May,June,July,August,September,October,November,December", +months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec", +day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday", +day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun" +}, +print:{ +print_desc:"Print" +}, +preview:{ +preview_desc:"Preview" +}, +directionality:{ +ltr_desc:"Direction left to right", +rtl_desc:"Direction right to left" +}, +layer:{ +insertlayer_desc:"Insert new layer", +forward_desc:"Move forward", +backward_desc:"Move backward", +absolute_desc:"Toggle absolute positioning", +content:"New layer..." +}, +save:{ +save_desc:"Save", +cancel_desc:"Cancel all changes" +}, +nonbreaking:{ +nonbreaking_desc:"Insert non-breaking space character" +}, +iespell:{ +iespell_desc:"Run spell checking", +download:"ieSpell not detected. Do you want to install it now?" +}, +advhr:{ +advhr_desc:"Horizontal rule" +}, +emotions:{ +emotions_desc:"Emotions" +}, +searchreplace:{ +search_desc:"Find", +replace_desc:"Find/Replace" +}, +advimage:{ +image_desc:"Insert/edit image" +}, +advlink:{ +link_desc:"Insert/edit link" +}, +xhtmlxtras:{ +cite_desc:"Citation", +abbr_desc:"Abbreviation", +acronym_desc:"Acronym", +del_desc:"Deletion", +ins_desc:"Insertion", +attribs_desc:"Insert/Edit Attributes" +}, +style:{ +desc:"Edit CSS Style" +}, +paste:{ +paste_text_desc:"Paste as Plain Text", +paste_word_desc:"Paste from Word", +selectall_desc:"Select All" +}, +paste_dlg:{ +text_title:"Use CTRL+V on your keyboard to paste the text into the window.", +text_linebreaks:"Keep linebreaks", +word_title:"Use CTRL+V on your keyboard to paste the text into the window." +}, +table:{ +desc:"Inserts a new table", +row_before_desc:"Insert row before", +row_after_desc:"Insert row after", +delete_row_desc:"Delete row", +col_before_desc:"Insert column before", +col_after_desc:"Insert column after", +delete_col_desc:"Remove column", +split_cells_desc:"Split merged table cells", +merge_cells_desc:"Merge table cells", +row_desc:"Table row properties", +cell_desc:"Table cell properties", +props_desc:"Table properties", +paste_row_before_desc:"Paste table row before", +paste_row_after_desc:"Paste table row after", +cut_row_desc:"Cut table row", +copy_row_desc:"Copy table row", +del:"Delete table", +row:"Row", +col:"Column", +cell:"Cell" +}, +autosave:{ +unload_msg:"The changes you made will be lost if you navigate away from this page." +}, +fullscreen:{ +desc:"Toggle fullscreen mode" +}, +media:{ +desc:"Insert / edit embedded media", +edit:"Edit embedded media" +}, +fullpage:{ +desc:"Document properties" +}, +template:{ +desc:"Insert predefined template content" +}, +visualchars:{ +desc:"Visual control characters on/off." +}, +spellchecker:{ +desc:"Toggle spellchecker", +menu:"Spellchecker settings", +ignore_word:"Ignore word", +ignore_words:"Ignore all", +langs:"Languages", +wait:"Please wait...", +sug:"Suggestions", +no_sug:"No suggestions", +no_mpell:"No misspellings found." +}, +pagebreak:{ +desc:"Insert page break." }}}); \ No newline at end of file diff --git a/lib/editor/tinymce/license.txt b/lib/editor/tinymce/license.txt index 60d6d4c8f51..1837b0acbe1 100644 --- a/lib/editor/tinymce/license.txt +++ b/lib/editor/tinymce/license.txt @@ -1,504 +1,504 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/lib/editor/tinymce/plugins/advhr/css/advhr.css b/lib/editor/tinymce/plugins/advhr/css/advhr.css index 0e22834985e..3fe369cb0d0 100644 --- a/lib/editor/tinymce/plugins/advhr/css/advhr.css +++ b/lib/editor/tinymce/plugins/advhr/css/advhr.css @@ -1,5 +1,5 @@ -input.radio {border:1px none #000; background:transparent; vertical-align:middle;} -.panel_wrapper div.current {height:80px;} -#width {width:50px; vertical-align:middle;} -#width2 {width:50px; vertical-align:middle;} -#size {width:100px;} +input.radio {border:1px none #000; background:transparent; vertical-align:middle;} +.panel_wrapper div.current {height:80px;} +#width {width:50px; vertical-align:middle;} +#width2 {width:50px; vertical-align:middle;} +#size {width:100px;} diff --git a/lib/editor/tinymce/plugins/advhr/js/rule.js b/lib/editor/tinymce/plugins/advhr/js/rule.js index b6cbd66c759..a60c35fc3ce 100644 --- a/lib/editor/tinymce/plugins/advhr/js/rule.js +++ b/lib/editor/tinymce/plugins/advhr/js/rule.js @@ -1,43 +1,43 @@ -var AdvHRDialog = { - init : function(ed) { - var dom = ed.dom, f = document.forms[0], n = ed.selection.getNode(), w; - - w = dom.getAttrib(n, 'width'); - f.width.value = w ? parseInt(w) : (dom.getStyle('width') || ''); - f.size.value = dom.getAttrib(n, 'size') || parseInt(dom.getStyle('height')) || ''; - f.noshade.checked = !!dom.getAttrib(n, 'noshade') || !!dom.getStyle('border-width'); - selectByValue(f, 'width2', w.indexOf('%') != -1 ? '%' : 'px'); - }, - - update : function() { - var ed = tinyMCEPopup.editor, h, f = document.forms[0], st = ''; - - h = ' - - - {#advhr.advhr_desc} - - - - - - - -
    - - -
    -
    - - - - - - - - - - - - - -
    - - -
    -
    -
    - -
    -
    - -
    - -
    - -
    -
    -
    - - + + + + {#advhr.advhr_desc} + + + + + + + +
    + + +
    +
    + + + + + + + + + + + + + +
    + + +
    +
    +
    + +
    +
    + +
    + +
    + +
    +
    +
    + + diff --git a/lib/editor/tinymce/plugins/advimage/css/advimage.css b/lib/editor/tinymce/plugins/advimage/css/advimage.css index 89b58cb4a97..6a7cab9761b 100644 --- a/lib/editor/tinymce/plugins/advimage/css/advimage.css +++ b/lib/editor/tinymce/plugins/advimage/css/advimage.css @@ -1,15 +1,15 @@ -#src_list, #over_list, #out_list {width:280px;} -.mceActionPanel {margin-top:7px;} -.moodlebutton {font-size: 1.5em;font-weight:bold;padding: 3px;border:1px solid #ccc;text-decoration:none} -.moodlebutton:hover {background: #ccc} -.alignPreview {border:1px solid #000; width:140px; height:140px; overflow:hidden; padding:5px;} -.checkbox {border:0;} -.panel_wrapper div.current {height:305px;} -#prev {margin:0; border:1px solid #000; width:428px; height:180px; overflow:auto;} -#align, #classlist {width:150px;} -#width, #height {vertical-align:middle; width:50px; text-align:center;} -#vspace, #hspace, #border {vertical-align:middle; width:30px; text-align:center;} -#class_list {width:180px;} -input {width: 280px;} -#constrain, #onmousemovecheck {width:auto;} -#id, #title, #dir, #lang, #usemap, #longdesc {width:200px;} +#src_list, #over_list, #out_list {width:280px;} +.mceActionPanel {margin-top:7px;} +.moodlebutton {font-size: 1.5em;font-weight:bold;padding: 3px;border:1px solid #ccc;text-decoration:none} +.moodlebutton:hover {background: #ccc} +.alignPreview {border:1px solid #000; width:140px; height:140px; overflow:hidden; padding:5px;} +.checkbox {border:0;} +.panel_wrapper div.current {height:305px;} +#prev {margin:0; border:1px solid #000; width:428px; height:180px; overflow:auto;} +#align, #classlist {width:150px;} +#width, #height {vertical-align:middle; width:50px; text-align:center;} +#vspace, #hspace, #border {vertical-align:middle; width:30px; text-align:center;} +#class_list {width:180px;} +input {width: 280px;} +#constrain, #onmousemovecheck {width:auto;} +#id, #title, #dir, #lang, #usemap, #longdesc {width:200px;} diff --git a/lib/editor/tinymce/plugins/advimage/image.htm b/lib/editor/tinymce/plugins/advimage/image.htm index 08b3b790ad7..4ec22dd7fe0 100644 --- a/lib/editor/tinymce/plugins/advimage/image.htm +++ b/lib/editor/tinymce/plugins/advimage/image.htm @@ -1,237 +1,237 @@ - - - - {#advimage_dlg.dialog_title} - - - - - - - - - -
    - - -
    -
    -
    - {#advimage_dlg.general} - - - - - - - - - - - - - - - - - - -
      
    - -
    -
    - -
    - {#advimage_dlg.preview} - -
    -
    - -
    -
    - {#advimage_dlg.tab_appearance} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    - {#advimage_dlg.example_img} - Lorem ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing elit, sed diam - nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Loreum ipsum - edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam - erat volutpat. -
    -
    - x - px -
      - - - - -
    -
    -
    -
    - -
    -
    - {#advimage_dlg.swap_image} - - - - - - - - - - - - - - - - - - - - - -
    - - - - -
     
    - - - - -
     
    -
    - -
    - {#advimage_dlg.misc} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    - -
    - -
    - - - - -
     
    -
    -
    -
    - -
    -
    - -
    - -
    - -
    -
    -
    - - + + + + {#advimage_dlg.dialog_title} + + + + + + + + + +
    + + +
    +
    +
    + {#advimage_dlg.general} + + + + + + + + + + + + + + + + + + +
      
    + +
    +
    + +
    + {#advimage_dlg.preview} + +
    +
    + +
    +
    + {#advimage_dlg.tab_appearance} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + {#advimage_dlg.example_img} + Lorem ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing elit, sed diam + nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Loreum ipsum + edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam + erat volutpat. +
    +
    + x + px +
      + + + + +
    +
    +
    +
    + +
    +
    + {#advimage_dlg.swap_image} + + + + + + + + + + + + + + + + + + + + + +
    + + + + +
     
    + + + + +
     
    +
    + +
    + {#advimage_dlg.misc} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +
    + +
    + + + + +
     
    +
    +
    +
    + +
    +
    + +
    + +
    + +
    +
    +
    + + diff --git a/lib/editor/tinymce/plugins/advimage/js/image.js b/lib/editor/tinymce/plugins/advimage/js/image.js index 347722661b9..955e9cfb4da 100644 --- a/lib/editor/tinymce/plugins/advimage/js/image.js +++ b/lib/editor/tinymce/plugins/advimage/js/image.js @@ -1,443 +1,443 @@ -var ImageDialog = { - preInit : function() { - var url; - - tinyMCEPopup.requireLangPack(); - - if (url = tinyMCEPopup.getParam("external_image_list_url")) - document.write(''); - }, - - init : function(ed) { - var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode(); - - tinyMCEPopup.resizeToInnerSize(); - this.fillClassList('class_list'); - this.fillFileList('src_list', 'tinyMCEImageList'); - this.fillFileList('over_list', 'tinyMCEImageList'); - this.fillFileList('out_list', 'tinyMCEImageList'); - TinyMCE_EditableSelects.init(); - - if (n.nodeName == 'IMG') { - nl.src.value = dom.getAttrib(n, 'src'); - nl.width.value = dom.getAttrib(n, 'width'); - nl.height.value = dom.getAttrib(n, 'height'); - nl.alt.value = dom.getAttrib(n, 'alt'); - nl.title.value = dom.getAttrib(n, 'title'); - nl.vspace.value = this.getAttrib(n, 'vspace'); - nl.hspace.value = this.getAttrib(n, 'hspace'); - nl.border.value = this.getAttrib(n, 'border'); - selectByValue(f, 'align', this.getAttrib(n, 'align')); - selectByValue(f, 'class_list', dom.getAttrib(n, 'class'), true, true); - nl.style.value = dom.getAttrib(n, 'style'); - nl.id.value = dom.getAttrib(n, 'id'); - nl.dir.value = dom.getAttrib(n, 'dir'); - nl.lang.value = dom.getAttrib(n, 'lang'); - nl.usemap.value = dom.getAttrib(n, 'usemap'); - nl.longdesc.value = dom.getAttrib(n, 'longdesc'); - nl.insert.value = ed.getLang('update'); - - if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseover'))) - nl.onmouseoversrc.value = dom.getAttrib(n, 'onmouseover').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1'); - - if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseout'))) - nl.onmouseoutsrc.value = dom.getAttrib(n, 'onmouseout').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1'); - - if (ed.settings.inline_styles) { - // Move attribs to styles - if (dom.getAttrib(n, 'align')) - this.updateStyle('align'); - - if (dom.getAttrib(n, 'hspace')) - this.updateStyle('hspace'); - - if (dom.getAttrib(n, 'border')) - this.updateStyle('border'); - - if (dom.getAttrib(n, 'vspace')) - this.updateStyle('vspace'); - } - } - - // Setup browse button - document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image'); - if (isVisible('srcbrowser')) - document.getElementById('src').style.width = '260px'; - - // Setup browse button - document.getElementById('onmouseoversrccontainer').innerHTML = getBrowserHTML('overbrowser','onmouseoversrc','image','theme_advanced_image'); - if (isVisible('overbrowser')) - document.getElementById('onmouseoversrc').style.width = '260px'; - - // Setup browse button - document.getElementById('onmouseoutsrccontainer').innerHTML = getBrowserHTML('outbrowser','onmouseoutsrc','image','theme_advanced_image'); - if (isVisible('outbrowser')) - document.getElementById('onmouseoutsrc').style.width = '260px'; - - // If option enabled default contrain proportions to checked - if (ed.getParam("advimage_constrain_proportions", true)) - f.constrain.checked = true; - - // Check swap image if valid data - if (nl.onmouseoversrc.value || nl.onmouseoutsrc.value) - this.setSwapImage(true); - else - this.setSwapImage(false); - - this.changeAppearance(); - this.showPreviewImage(nl.src.value, 1); - }, - - insert : function(file, title) { - var ed = tinyMCEPopup.editor, t = this, f = document.forms[0]; - - if (f.src.value === '') { - if (ed.selection.getNode().nodeName == 'IMG') { - ed.dom.remove(ed.selection.getNode()); - ed.execCommand('mceRepaint'); - } - - tinyMCEPopup.close(); - return; - } - - if (tinyMCEPopup.getParam("accessibility_warnings", 1)) { - if (!f.alt.value) { - tinyMCEPopup.confirm(tinyMCEPopup.getLang('advimage_dlg.missing_alt'), function(s) { - if (s) - t.insertAndClose(); - }); - - return; - } - } - - t.insertAndClose(); - }, - - insertAndClose : function() { - var ed = tinyMCEPopup.editor, f = document.forms[0], nl = f.elements, v, args = {}, el; - - tinyMCEPopup.restoreSelection(); - - // Fixes crash in Safari - if (tinymce.isWebKit) - ed.getWin().focus(); - - if (!ed.settings.inline_styles) { - args = { - vspace : nl.vspace.value, - hspace : nl.hspace.value, - border : nl.border.value, - align : getSelectValue(f, 'align') - }; - } else { - // Remove deprecated values - args = { - vspace : '', - hspace : '', - border : '', - align : '' - }; - } - - tinymce.extend(args, { - src : nl.src.value, - width : nl.width.value, - height : nl.height.value, - alt : nl.alt.value, - title : nl.title.value, - 'class' : getSelectValue(f, 'class_list'), - style : nl.style.value, - id : nl.id.value, - dir : nl.dir.value, - lang : nl.lang.value, - usemap : nl.usemap.value, - longdesc : nl.longdesc.value - }); - - args.onmouseover = args.onmouseout = ''; - - if (f.onmousemovecheck.checked) { - if (nl.onmouseoversrc.value) - args.onmouseover = "this.src='" + nl.onmouseoversrc.value + "';"; - - if (nl.onmouseoutsrc.value) - args.onmouseout = "this.src='" + nl.onmouseoutsrc.value + "';"; - } - - el = ed.selection.getNode(); - - if (el && el.nodeName == 'IMG') { - ed.dom.setAttribs(el, args); - } else { - ed.execCommand('mceInsertContent', false, '', {skip_undo : 1}); - ed.dom.setAttribs('__mce_tmp', args); - ed.dom.setAttrib('__mce_tmp', 'id', ''); - ed.undoManager.add(); - } - - tinyMCEPopup.close(); - }, - - getAttrib : function(e, at) { - var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2; - - if (ed.settings.inline_styles) { - switch (at) { - case 'align': - if (v = dom.getStyle(e, 'float')) - return v; - - if (v = dom.getStyle(e, 'vertical-align')) - return v; - - break; - - case 'hspace': - v = dom.getStyle(e, 'margin-left') - v2 = dom.getStyle(e, 'margin-right'); - - if (v && v == v2) - return parseInt(v.replace(/[^0-9]/g, '')); - - break; - - case 'vspace': - v = dom.getStyle(e, 'margin-top') - v2 = dom.getStyle(e, 'margin-bottom'); - if (v && v == v2) - return parseInt(v.replace(/[^0-9]/g, '')); - - break; - - case 'border': - v = 0; - - tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) { - sv = dom.getStyle(e, 'border-' + sv + '-width'); - - // False or not the same as prev - if (!sv || (sv != v && v !== 0)) { - v = 0; - return false; - } - - if (sv) - v = sv; - }); - - if (v) - return parseInt(v.replace(/[^0-9]/g, '')); - - break; - } - } - - if (v = dom.getAttrib(e, at)) - return v; - - return ''; - }, - - setSwapImage : function(st) { - var f = document.forms[0]; - - f.onmousemovecheck.checked = st; - setBrowserDisabled('overbrowser', !st); - setBrowserDisabled('outbrowser', !st); - - if (f.over_list) - f.over_list.disabled = !st; - - if (f.out_list) - f.out_list.disabled = !st; - - f.onmouseoversrc.disabled = !st; - f.onmouseoutsrc.disabled = !st; - }, - - fillClassList : function(id) { - var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; - - if (v = tinyMCEPopup.getParam('theme_advanced_styles')) { - cl = []; - - tinymce.each(v.split(';'), function(v) { - var p = v.split('='); - - cl.push({'title' : p[0], 'class' : p[1]}); - }); - } else - cl = tinyMCEPopup.editor.dom.getClasses(); - - if (cl.length > 0) { - lst.options.length = 0; - lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); - - tinymce.each(cl, function(o) { - lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']); - }); - } else - dom.remove(dom.getParent(id, 'tr')); - }, - - fillFileList : function(id, l) { - var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; - - l = window[l]; - lst.options.length = 0; - - if (l && l.length > 0) { - lst.options[lst.options.length] = new Option('', ''); - - tinymce.each(l, function(o) { - lst.options[lst.options.length] = new Option(o[0], o[1]); - }); - } else - dom.remove(dom.getParent(id, 'tr')); - }, - - resetImageData : function() { - var f = document.forms[0]; - - f.elements.width.value = f.elements.height.value = ''; - }, - - updateImageData : function(img, st) { - var f = document.forms[0]; - - if (!st) { - f.elements.width.value = img.width; - f.elements.height.value = img.height; - } - - this.preloadImg = img; - }, - - changeAppearance : function() { - var ed = tinyMCEPopup.editor, f = document.forms[0], img = document.getElementById('alignSampleImg'); - - if (img) { - if (ed.getParam('inline_styles')) { - ed.dom.setAttrib(img, 'style', f.style.value); - } else { - img.align = f.align.value; - img.border = f.border.value; - img.hspace = f.hspace.value; - img.vspace = f.vspace.value; - } - } - }, - - changeHeight : function() { - var f = document.forms[0], tp, t = this; - - if (!f.constrain.checked || !t.preloadImg) { - return; - } - - if (f.width.value == "" || f.height.value == "") - return; - - tp = (parseInt(f.width.value) / parseInt(t.preloadImg.width)) * t.preloadImg.height; - f.height.value = tp.toFixed(0); - }, - - changeWidth : function() { - var f = document.forms[0], tp, t = this; - - if (!f.constrain.checked || !t.preloadImg) { - return; - } - - if (f.width.value == "" || f.height.value == "") - return; - - tp = (parseInt(f.height.value) / parseInt(t.preloadImg.height)) * t.preloadImg.width; - f.width.value = tp.toFixed(0); - }, - - updateStyle : function(ty) { - var dom = tinyMCEPopup.dom, st, v, f = document.forms[0], img = dom.create('img', {style : dom.get('style').value}); - - if (tinyMCEPopup.editor.settings.inline_styles) { - // Handle align - if (ty == 'align') { - dom.setStyle(img, 'float', ''); - dom.setStyle(img, 'vertical-align', ''); - - v = getSelectValue(f, 'align'); - if (v) { - if (v == 'left' || v == 'right') - dom.setStyle(img, 'float', v); - else - img.style.verticalAlign = v; - } - } - - // Handle border - if (ty == 'border') { - dom.setStyle(img, 'border', ''); - - v = f.border.value; - if (v || v == '0') { - if (v == '0') - img.style.border = '0'; - else - img.style.border = v + 'px solid black'; - } - } - - // Handle hspace - if (ty == 'hspace') { - dom.setStyle(img, 'marginLeft', ''); - dom.setStyle(img, 'marginRight', ''); - - v = f.hspace.value; - if (v) { - img.style.marginLeft = v + 'px'; - img.style.marginRight = v + 'px'; - } - } - - // Handle vspace - if (ty == 'vspace') { - dom.setStyle(img, 'marginTop', ''); - dom.setStyle(img, 'marginBottom', ''); - - v = f.vspace.value; - if (v) { - img.style.marginTop = v + 'px'; - img.style.marginBottom = v + 'px'; - } - } - - // Merge - dom.get('style').value = dom.serializeStyle(dom.parseStyle(img.style.cssText)); - } - }, - - changeMouseMove : function() { - }, - - showPreviewImage : function(u, st) { - if (!u) { - tinyMCEPopup.dom.setHTML('prev', ''); - return; - } - - if (!st && tinyMCEPopup.getParam("advimage_update_dimensions_onchange", true)) - this.resetImageData(); - - u = tinyMCEPopup.editor.documentBaseURI.toAbsolute(u); - - if (!st) - tinyMCEPopup.dom.setHTML('prev', ''); - else - tinyMCEPopup.dom.setHTML('prev', ''); - } -}; - -ImageDialog.preInit(); -tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog); +var ImageDialog = { + preInit : function() { + var url; + + tinyMCEPopup.requireLangPack(); + + if (url = tinyMCEPopup.getParam("external_image_list_url")) + document.write(''); + }, + + init : function(ed) { + var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode(); + + tinyMCEPopup.resizeToInnerSize(); + this.fillClassList('class_list'); + this.fillFileList('src_list', 'tinyMCEImageList'); + this.fillFileList('over_list', 'tinyMCEImageList'); + this.fillFileList('out_list', 'tinyMCEImageList'); + TinyMCE_EditableSelects.init(); + + if (n.nodeName == 'IMG') { + nl.src.value = dom.getAttrib(n, 'src'); + nl.width.value = dom.getAttrib(n, 'width'); + nl.height.value = dom.getAttrib(n, 'height'); + nl.alt.value = dom.getAttrib(n, 'alt'); + nl.title.value = dom.getAttrib(n, 'title'); + nl.vspace.value = this.getAttrib(n, 'vspace'); + nl.hspace.value = this.getAttrib(n, 'hspace'); + nl.border.value = this.getAttrib(n, 'border'); + selectByValue(f, 'align', this.getAttrib(n, 'align')); + selectByValue(f, 'class_list', dom.getAttrib(n, 'class'), true, true); + nl.style.value = dom.getAttrib(n, 'style'); + nl.id.value = dom.getAttrib(n, 'id'); + nl.dir.value = dom.getAttrib(n, 'dir'); + nl.lang.value = dom.getAttrib(n, 'lang'); + nl.usemap.value = dom.getAttrib(n, 'usemap'); + nl.longdesc.value = dom.getAttrib(n, 'longdesc'); + nl.insert.value = ed.getLang('update'); + + if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseover'))) + nl.onmouseoversrc.value = dom.getAttrib(n, 'onmouseover').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1'); + + if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseout'))) + nl.onmouseoutsrc.value = dom.getAttrib(n, 'onmouseout').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1'); + + if (ed.settings.inline_styles) { + // Move attribs to styles + if (dom.getAttrib(n, 'align')) + this.updateStyle('align'); + + if (dom.getAttrib(n, 'hspace')) + this.updateStyle('hspace'); + + if (dom.getAttrib(n, 'border')) + this.updateStyle('border'); + + if (dom.getAttrib(n, 'vspace')) + this.updateStyle('vspace'); + } + } + + // Setup browse button + document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image'); + if (isVisible('srcbrowser')) + document.getElementById('src').style.width = '260px'; + + // Setup browse button + document.getElementById('onmouseoversrccontainer').innerHTML = getBrowserHTML('overbrowser','onmouseoversrc','image','theme_advanced_image'); + if (isVisible('overbrowser')) + document.getElementById('onmouseoversrc').style.width = '260px'; + + // Setup browse button + document.getElementById('onmouseoutsrccontainer').innerHTML = getBrowserHTML('outbrowser','onmouseoutsrc','image','theme_advanced_image'); + if (isVisible('outbrowser')) + document.getElementById('onmouseoutsrc').style.width = '260px'; + + // If option enabled default contrain proportions to checked + if (ed.getParam("advimage_constrain_proportions", true)) + f.constrain.checked = true; + + // Check swap image if valid data + if (nl.onmouseoversrc.value || nl.onmouseoutsrc.value) + this.setSwapImage(true); + else + this.setSwapImage(false); + + this.changeAppearance(); + this.showPreviewImage(nl.src.value, 1); + }, + + insert : function(file, title) { + var ed = tinyMCEPopup.editor, t = this, f = document.forms[0]; + + if (f.src.value === '') { + if (ed.selection.getNode().nodeName == 'IMG') { + ed.dom.remove(ed.selection.getNode()); + ed.execCommand('mceRepaint'); + } + + tinyMCEPopup.close(); + return; + } + + if (tinyMCEPopup.getParam("accessibility_warnings", 1)) { + if (!f.alt.value) { + tinyMCEPopup.confirm(tinyMCEPopup.getLang('advimage_dlg.missing_alt'), function(s) { + if (s) + t.insertAndClose(); + }); + + return; + } + } + + t.insertAndClose(); + }, + + insertAndClose : function() { + var ed = tinyMCEPopup.editor, f = document.forms[0], nl = f.elements, v, args = {}, el; + + tinyMCEPopup.restoreSelection(); + + // Fixes crash in Safari + if (tinymce.isWebKit) + ed.getWin().focus(); + + if (!ed.settings.inline_styles) { + args = { + vspace : nl.vspace.value, + hspace : nl.hspace.value, + border : nl.border.value, + align : getSelectValue(f, 'align') + }; + } else { + // Remove deprecated values + args = { + vspace : '', + hspace : '', + border : '', + align : '' + }; + } + + tinymce.extend(args, { + src : nl.src.value, + width : nl.width.value, + height : nl.height.value, + alt : nl.alt.value, + title : nl.title.value, + 'class' : getSelectValue(f, 'class_list'), + style : nl.style.value, + id : nl.id.value, + dir : nl.dir.value, + lang : nl.lang.value, + usemap : nl.usemap.value, + longdesc : nl.longdesc.value + }); + + args.onmouseover = args.onmouseout = ''; + + if (f.onmousemovecheck.checked) { + if (nl.onmouseoversrc.value) + args.onmouseover = "this.src='" + nl.onmouseoversrc.value + "';"; + + if (nl.onmouseoutsrc.value) + args.onmouseout = "this.src='" + nl.onmouseoutsrc.value + "';"; + } + + el = ed.selection.getNode(); + + if (el && el.nodeName == 'IMG') { + ed.dom.setAttribs(el, args); + } else { + ed.execCommand('mceInsertContent', false, '', {skip_undo : 1}); + ed.dom.setAttribs('__mce_tmp', args); + ed.dom.setAttrib('__mce_tmp', 'id', ''); + ed.undoManager.add(); + } + + tinyMCEPopup.close(); + }, + + getAttrib : function(e, at) { + var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2; + + if (ed.settings.inline_styles) { + switch (at) { + case 'align': + if (v = dom.getStyle(e, 'float')) + return v; + + if (v = dom.getStyle(e, 'vertical-align')) + return v; + + break; + + case 'hspace': + v = dom.getStyle(e, 'margin-left') + v2 = dom.getStyle(e, 'margin-right'); + + if (v && v == v2) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + + case 'vspace': + v = dom.getStyle(e, 'margin-top') + v2 = dom.getStyle(e, 'margin-bottom'); + if (v && v == v2) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + + case 'border': + v = 0; + + tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) { + sv = dom.getStyle(e, 'border-' + sv + '-width'); + + // False or not the same as prev + if (!sv || (sv != v && v !== 0)) { + v = 0; + return false; + } + + if (sv) + v = sv; + }); + + if (v) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + } + } + + if (v = dom.getAttrib(e, at)) + return v; + + return ''; + }, + + setSwapImage : function(st) { + var f = document.forms[0]; + + f.onmousemovecheck.checked = st; + setBrowserDisabled('overbrowser', !st); + setBrowserDisabled('outbrowser', !st); + + if (f.over_list) + f.over_list.disabled = !st; + + if (f.out_list) + f.out_list.disabled = !st; + + f.onmouseoversrc.disabled = !st; + f.onmouseoutsrc.disabled = !st; + }, + + fillClassList : function(id) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + if (v = tinyMCEPopup.getParam('theme_advanced_styles')) { + cl = []; + + tinymce.each(v.split(';'), function(v) { + var p = v.split('='); + + cl.push({'title' : p[0], 'class' : p[1]}); + }); + } else + cl = tinyMCEPopup.editor.dom.getClasses(); + + if (cl.length > 0) { + lst.options.length = 0; + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); + + tinymce.each(cl, function(o) { + lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + fillFileList : function(id, l) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + l = window[l]; + lst.options.length = 0; + + if (l && l.length > 0) { + lst.options[lst.options.length] = new Option('', ''); + + tinymce.each(l, function(o) { + lst.options[lst.options.length] = new Option(o[0], o[1]); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + resetImageData : function() { + var f = document.forms[0]; + + f.elements.width.value = f.elements.height.value = ''; + }, + + updateImageData : function(img, st) { + var f = document.forms[0]; + + if (!st) { + f.elements.width.value = img.width; + f.elements.height.value = img.height; + } + + this.preloadImg = img; + }, + + changeAppearance : function() { + var ed = tinyMCEPopup.editor, f = document.forms[0], img = document.getElementById('alignSampleImg'); + + if (img) { + if (ed.getParam('inline_styles')) { + ed.dom.setAttrib(img, 'style', f.style.value); + } else { + img.align = f.align.value; + img.border = f.border.value; + img.hspace = f.hspace.value; + img.vspace = f.vspace.value; + } + } + }, + + changeHeight : function() { + var f = document.forms[0], tp, t = this; + + if (!f.constrain.checked || !t.preloadImg) { + return; + } + + if (f.width.value == "" || f.height.value == "") + return; + + tp = (parseInt(f.width.value) / parseInt(t.preloadImg.width)) * t.preloadImg.height; + f.height.value = tp.toFixed(0); + }, + + changeWidth : function() { + var f = document.forms[0], tp, t = this; + + if (!f.constrain.checked || !t.preloadImg) { + return; + } + + if (f.width.value == "" || f.height.value == "") + return; + + tp = (parseInt(f.height.value) / parseInt(t.preloadImg.height)) * t.preloadImg.width; + f.width.value = tp.toFixed(0); + }, + + updateStyle : function(ty) { + var dom = tinyMCEPopup.dom, st, v, f = document.forms[0], img = dom.create('img', {style : dom.get('style').value}); + + if (tinyMCEPopup.editor.settings.inline_styles) { + // Handle align + if (ty == 'align') { + dom.setStyle(img, 'float', ''); + dom.setStyle(img, 'vertical-align', ''); + + v = getSelectValue(f, 'align'); + if (v) { + if (v == 'left' || v == 'right') + dom.setStyle(img, 'float', v); + else + img.style.verticalAlign = v; + } + } + + // Handle border + if (ty == 'border') { + dom.setStyle(img, 'border', ''); + + v = f.border.value; + if (v || v == '0') { + if (v == '0') + img.style.border = '0'; + else + img.style.border = v + 'px solid black'; + } + } + + // Handle hspace + if (ty == 'hspace') { + dom.setStyle(img, 'marginLeft', ''); + dom.setStyle(img, 'marginRight', ''); + + v = f.hspace.value; + if (v) { + img.style.marginLeft = v + 'px'; + img.style.marginRight = v + 'px'; + } + } + + // Handle vspace + if (ty == 'vspace') { + dom.setStyle(img, 'marginTop', ''); + dom.setStyle(img, 'marginBottom', ''); + + v = f.vspace.value; + if (v) { + img.style.marginTop = v + 'px'; + img.style.marginBottom = v + 'px'; + } + } + + // Merge + dom.get('style').value = dom.serializeStyle(dom.parseStyle(img.style.cssText)); + } + }, + + changeMouseMove : function() { + }, + + showPreviewImage : function(u, st) { + if (!u) { + tinyMCEPopup.dom.setHTML('prev', ''); + return; + } + + if (!st && tinyMCEPopup.getParam("advimage_update_dimensions_onchange", true)) + this.resetImageData(); + + u = tinyMCEPopup.editor.documentBaseURI.toAbsolute(u); + + if (!st) + tinyMCEPopup.dom.setHTML('prev', ''); + else + tinyMCEPopup.dom.setHTML('prev', ''); + } +}; + +ImageDialog.preInit(); +tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog); diff --git a/lib/editor/tinymce/plugins/advimage/langs/en_dlg.js b/lib/editor/tinymce/plugins/advimage/langs/en_dlg.js index f493d196fae..ef81f78b4be 100644 --- a/lib/editor/tinymce/plugins/advimage/langs/en_dlg.js +++ b/lib/editor/tinymce/plugins/advimage/langs/en_dlg.js @@ -1,43 +1,43 @@ -tinyMCE.addI18n('en.advimage_dlg',{ -tab_general:"General", -tab_appearance:"Appearance", -tab_advanced:"Advanced", -general:"General", -title:"Title", -preview:"Preview", -constrain_proportions:"Constrain proportions", -langdir:"Language direction", -langcode:"Language code", -long_desc:"Long description link", -style:"Style", -classes:"Classes", -ltr:"Left to right", -rtl:"Right to left", -id:"Id", -map:"Image map", -swap_image:"Swap image", -alt_image:"Alternative image", -mouseover:"for mouse over", -mouseout:"for mouse out", -misc:"Miscellaneous", -example_img:"Appearance preview image", -missing_alt:"Are you sure you want to continue without including an Image Description? Without it the image may not be accessible to some users with disabilities, or to those using a text browser, or browsing the Web with images turned off.", -dialog_title:"Insert/edit image", -src:"Image URL", -alt:"Image description", -list:"Image list", -border:"Border", -dimensions:"Dimensions", -vspace:"Vertical space", -hspace:"Horizontal space", -align:"Alignment", -align_baseline:"Baseline", -align_top:"Top", -align_middle:"Middle", -align_bottom:"Bottom", -align_texttop:"Text top", -align_textbottom:"Text bottom", -align_left:"Left", -align_right:"Right", -image_list:"Image list" +tinyMCE.addI18n('en.advimage_dlg',{ +tab_general:"General", +tab_appearance:"Appearance", +tab_advanced:"Advanced", +general:"General", +title:"Title", +preview:"Preview", +constrain_proportions:"Constrain proportions", +langdir:"Language direction", +langcode:"Language code", +long_desc:"Long description link", +style:"Style", +classes:"Classes", +ltr:"Left to right", +rtl:"Right to left", +id:"Id", +map:"Image map", +swap_image:"Swap image", +alt_image:"Alternative image", +mouseover:"for mouse over", +mouseout:"for mouse out", +misc:"Miscellaneous", +example_img:"Appearance preview image", +missing_alt:"Are you sure you want to continue without including an Image Description? Without it the image may not be accessible to some users with disabilities, or to those using a text browser, or browsing the Web with images turned off.", +dialog_title:"Insert/edit image", +src:"Image URL", +alt:"Image description", +list:"Image list", +border:"Border", +dimensions:"Dimensions", +vspace:"Vertical space", +hspace:"Horizontal space", +align:"Alignment", +align_baseline:"Baseline", +align_top:"Top", +align_middle:"Middle", +align_bottom:"Bottom", +align_texttop:"Text top", +align_textbottom:"Text bottom", +align_left:"Left", +align_right:"Right", +image_list:"Image list" }); \ No newline at end of file diff --git a/lib/editor/tinymce/plugins/advlink/css/advlink.css b/lib/editor/tinymce/plugins/advlink/css/advlink.css index 14364316a19..66c65493541 100644 --- a/lib/editor/tinymce/plugins/advlink/css/advlink.css +++ b/lib/editor/tinymce/plugins/advlink/css/advlink.css @@ -1,8 +1,8 @@ -.mceLinkList, .mceAnchorList, #targetlist {width:280px;} -.mceActionPanel {margin-top:7px;} -.panel_wrapper div.current {height:320px;} -#classlist, #title, #href {width:280px;} -#popupurl, #popupname {width:200px;} -#popupwidth, #popupheight, #popupleft, #popuptop {width:30px;vertical-align:middle;text-align:center;} -#id, #style, #classes, #target, #dir, #hreflang, #lang, #charset, #type, #rel, #rev, #tabindex, #accesskey {width:200px;} -#events_panel input {width:200px;} +.mceLinkList, .mceAnchorList, #targetlist {width:280px;} +.mceActionPanel {margin-top:7px;} +.panel_wrapper div.current {height:320px;} +#classlist, #title, #href {width:280px;} +#popupurl, #popupname {width:200px;} +#popupwidth, #popupheight, #popupleft, #popuptop {width:30px;vertical-align:middle;text-align:center;} +#id, #style, #classes, #target, #dir, #hreflang, #lang, #charset, #type, #rel, #rev, #tabindex, #accesskey {width:200px;} +#events_panel input {width:200px;} diff --git a/lib/editor/tinymce/plugins/advlink/js/advlink.js b/lib/editor/tinymce/plugins/advlink/js/advlink.js index bb7922a6e1e..03fddc58441 100644 --- a/lib/editor/tinymce/plugins/advlink/js/advlink.js +++ b/lib/editor/tinymce/plugins/advlink/js/advlink.js @@ -1,528 +1,528 @@ -/* Functions for the advlink plugin popup */ - -tinyMCEPopup.requireLangPack(); - -var templates = { - "window.open" : "window.open('${url}','${target}','${options}')" -}; - -function preinit() { - var url; - - if (url = tinyMCEPopup.getParam("external_link_list_url")) - document.write(''); -} - -function changeClass() { - var f = document.forms[0]; - - f.classes.value = getSelectValue(f, 'classlist'); -} - -function init() { - tinyMCEPopup.resizeToInnerSize(); - - var formObj = document.forms[0]; - var inst = tinyMCEPopup.editor; - var elm = inst.selection.getNode(); - var action = "insert"; - var html; - - document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','advlink'); - document.getElementById('popupurlbrowsercontainer').innerHTML = getBrowserHTML('popupurlbrowser','popupurl','file','advlink'); - document.getElementById('linklisthrefcontainer').innerHTML = getLinkListHTML('linklisthref','href'); - document.getElementById('anchorlistcontainer').innerHTML = getAnchorListHTML('anchorlist','href'); - document.getElementById('targetlistcontainer').innerHTML = getTargetListHTML('targetlist','target'); - - // Link list - html = getLinkListHTML('linklisthref','href'); - if (html == "") - document.getElementById("linklisthrefrow").style.display = 'none'; - else - document.getElementById("linklisthrefcontainer").innerHTML = html; - - // Resize some elements - if (isVisible('hrefbrowser')) - document.getElementById('href').style.width = '260px'; - - if (isVisible('popupurlbrowser')) - document.getElementById('popupurl').style.width = '180px'; - - elm = inst.dom.getParent(elm, "A"); - if (elm != null && elm.nodeName == "A") - action = "update"; - - formObj.insert.value = tinyMCEPopup.getLang(action, 'Insert', true); - - setPopupControlsDisabled(true); - - if (action == "update") { - var href = inst.dom.getAttrib(elm, 'href'); - var onclick = inst.dom.getAttrib(elm, 'onclick'); - - // Setup form data - setFormValue('href', href); - setFormValue('title', inst.dom.getAttrib(elm, 'title')); - setFormValue('id', inst.dom.getAttrib(elm, 'id')); - setFormValue('style', inst.dom.getAttrib(elm, "style")); - setFormValue('rel', inst.dom.getAttrib(elm, 'rel')); - setFormValue('rev', inst.dom.getAttrib(elm, 'rev')); - setFormValue('charset', inst.dom.getAttrib(elm, 'charset')); - setFormValue('hreflang', inst.dom.getAttrib(elm, 'hreflang')); - setFormValue('dir', inst.dom.getAttrib(elm, 'dir')); - setFormValue('lang', inst.dom.getAttrib(elm, 'lang')); - setFormValue('tabindex', inst.dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : "")); - setFormValue('accesskey', inst.dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : "")); - setFormValue('type', inst.dom.getAttrib(elm, 'type')); - setFormValue('onfocus', inst.dom.getAttrib(elm, 'onfocus')); - setFormValue('onblur', inst.dom.getAttrib(elm, 'onblur')); - setFormValue('onclick', onclick); - setFormValue('ondblclick', inst.dom.getAttrib(elm, 'ondblclick')); - setFormValue('onmousedown', inst.dom.getAttrib(elm, 'onmousedown')); - setFormValue('onmouseup', inst.dom.getAttrib(elm, 'onmouseup')); - setFormValue('onmouseover', inst.dom.getAttrib(elm, 'onmouseover')); - setFormValue('onmousemove', inst.dom.getAttrib(elm, 'onmousemove')); - setFormValue('onmouseout', inst.dom.getAttrib(elm, 'onmouseout')); - setFormValue('onkeypress', inst.dom.getAttrib(elm, 'onkeypress')); - setFormValue('onkeydown', inst.dom.getAttrib(elm, 'onkeydown')); - setFormValue('onkeyup', inst.dom.getAttrib(elm, 'onkeyup')); - setFormValue('target', inst.dom.getAttrib(elm, 'target')); - setFormValue('classes', inst.dom.getAttrib(elm, 'class')); - - // Parse onclick data - if (onclick != null && onclick.indexOf('window.open') != -1) - parseWindowOpen(onclick); - else - parseFunction(onclick); - - // Select by the values - selectByValue(formObj, 'dir', inst.dom.getAttrib(elm, 'dir')); - selectByValue(formObj, 'rel', inst.dom.getAttrib(elm, 'rel')); - selectByValue(formObj, 'rev', inst.dom.getAttrib(elm, 'rev')); - selectByValue(formObj, 'linklisthref', href); - - if (href.charAt(0) == '#') - selectByValue(formObj, 'anchorlist', href); - - addClassesToList('classlist', 'advlink_styles'); - - selectByValue(formObj, 'classlist', inst.dom.getAttrib(elm, 'class'), true); - selectByValue(formObj, 'targetlist', inst.dom.getAttrib(elm, 'target'), true); - } else - addClassesToList('classlist', 'advlink_styles'); -} - -function checkPrefix(n) { - if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_email'))) - n.value = 'mailto:' + n.value; - - if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_external'))) - n.value = 'http://' + n.value; -} - -function setFormValue(name, value) { - document.forms[0].elements[name].value = value; -} - -function parseWindowOpen(onclick) { - var formObj = document.forms[0]; - - // Preprocess center code - if (onclick.indexOf('return false;') != -1) { - formObj.popupreturn.checked = true; - onclick = onclick.replace('return false;', ''); - } else - formObj.popupreturn.checked = false; - - var onClickData = parseLink(onclick); - - if (onClickData != null) { - formObj.ispopup.checked = true; - setPopupControlsDisabled(false); - - var onClickWindowOptions = parseOptions(onClickData['options']); - var url = onClickData['url']; - - formObj.popupname.value = onClickData['target']; - formObj.popupurl.value = url; - formObj.popupwidth.value = getOption(onClickWindowOptions, 'width'); - formObj.popupheight.value = getOption(onClickWindowOptions, 'height'); - - formObj.popupleft.value = getOption(onClickWindowOptions, 'left'); - formObj.popuptop.value = getOption(onClickWindowOptions, 'top'); - - if (formObj.popupleft.value.indexOf('screen') != -1) - formObj.popupleft.value = "c"; - - if (formObj.popuptop.value.indexOf('screen') != -1) - formObj.popuptop.value = "c"; - - formObj.popuplocation.checked = getOption(onClickWindowOptions, 'location') == "yes"; - formObj.popupscrollbars.checked = getOption(onClickWindowOptions, 'scrollbars') == "yes"; - formObj.popupmenubar.checked = getOption(onClickWindowOptions, 'menubar') == "yes"; - formObj.popupresizable.checked = getOption(onClickWindowOptions, 'resizable') == "yes"; - formObj.popuptoolbar.checked = getOption(onClickWindowOptions, 'toolbar') == "yes"; - formObj.popupstatus.checked = getOption(onClickWindowOptions, 'status') == "yes"; - formObj.popupdependent.checked = getOption(onClickWindowOptions, 'dependent') == "yes"; - - buildOnClick(); - } -} - -function parseFunction(onclick) { - var formObj = document.forms[0]; - var onClickData = parseLink(onclick); - - // TODO: Add stuff here -} - -function getOption(opts, name) { - return typeof(opts[name]) == "undefined" ? "" : opts[name]; -} - -function setPopupControlsDisabled(state) { - var formObj = document.forms[0]; - - formObj.popupname.disabled = state; - formObj.popupurl.disabled = state; - formObj.popupwidth.disabled = state; - formObj.popupheight.disabled = state; - formObj.popupleft.disabled = state; - formObj.popuptop.disabled = state; - formObj.popuplocation.disabled = state; - formObj.popupscrollbars.disabled = state; - formObj.popupmenubar.disabled = state; - formObj.popupresizable.disabled = state; - formObj.popuptoolbar.disabled = state; - formObj.popupstatus.disabled = state; - formObj.popupreturn.disabled = state; - formObj.popupdependent.disabled = state; - - setBrowserDisabled('popupurlbrowser', state); -} - -function parseLink(link) { - link = link.replace(new RegExp(''', 'g'), "'"); - - var fnName = link.replace(new RegExp("\\s*([A-Za-z0-9\.]*)\\s*\\(.*", "gi"), "$1"); - - // Is function name a template function - var template = templates[fnName]; - if (template) { - // Build regexp - var variableNames = template.match(new RegExp("'?\\$\\{[A-Za-z0-9\.]*\\}'?", "gi")); - var regExp = "\\s*[A-Za-z0-9\.]*\\s*\\("; - var replaceStr = ""; - for (var i=0; i'); - for (var i=0; i'; - html += ''; - - for (i=0; i' + name + ''; - } - - html += ''; - - return html; -} - -function insertAction() { - var inst = tinyMCEPopup.editor; - var elm, elementArray, i; - - elm = inst.selection.getNode(); - checkPrefix(document.forms[0].href); - - elm = inst.dom.getParent(elm, "A"); - - // Remove element if there is no href - if (!document.forms[0].href.value) { - tinyMCEPopup.execCommand("mceBeginUndoLevel"); - i = inst.selection.getBookmark(); - inst.dom.remove(elm, 1); - inst.selection.moveToBookmark(i); - tinyMCEPopup.execCommand("mceEndUndoLevel"); - tinyMCEPopup.close(); - return; - } - - tinyMCEPopup.execCommand("mceBeginUndoLevel"); - - // Create new anchor elements - if (elm == null) { - inst.getDoc().execCommand("unlink", false, null); - tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1}); - - elementArray = tinymce.grep(inst.dom.select("a"), function(n) {return inst.dom.getAttrib(n, 'href') == '#mce_temp_url#';}); - for (i=0; i' + tinyMCELinkList[i][0] + ''; - - html += ''; - - return html; - - // tinyMCE.debug('-- image list start --', html, '-- image list end --'); -} - -function getTargetListHTML(elm_id, target_form_element) { - var targets = tinyMCEPopup.getParam('theme_advanced_link_targets', '').split(';'); - var html = ''; - - html += ''; - - return html; -} - -// While loading -preinit(); -tinyMCEPopup.onInit.add(init); +/* Functions for the advlink plugin popup */ + +tinyMCEPopup.requireLangPack(); + +var templates = { + "window.open" : "window.open('${url}','${target}','${options}')" +}; + +function preinit() { + var url; + + if (url = tinyMCEPopup.getParam("external_link_list_url")) + document.write(''); +} + +function changeClass() { + var f = document.forms[0]; + + f.classes.value = getSelectValue(f, 'classlist'); +} + +function init() { + tinyMCEPopup.resizeToInnerSize(); + + var formObj = document.forms[0]; + var inst = tinyMCEPopup.editor; + var elm = inst.selection.getNode(); + var action = "insert"; + var html; + + document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','advlink'); + document.getElementById('popupurlbrowsercontainer').innerHTML = getBrowserHTML('popupurlbrowser','popupurl','file','advlink'); + document.getElementById('linklisthrefcontainer').innerHTML = getLinkListHTML('linklisthref','href'); + document.getElementById('anchorlistcontainer').innerHTML = getAnchorListHTML('anchorlist','href'); + document.getElementById('targetlistcontainer').innerHTML = getTargetListHTML('targetlist','target'); + + // Link list + html = getLinkListHTML('linklisthref','href'); + if (html == "") + document.getElementById("linklisthrefrow").style.display = 'none'; + else + document.getElementById("linklisthrefcontainer").innerHTML = html; + + // Resize some elements + if (isVisible('hrefbrowser')) + document.getElementById('href').style.width = '260px'; + + if (isVisible('popupurlbrowser')) + document.getElementById('popupurl').style.width = '180px'; + + elm = inst.dom.getParent(elm, "A"); + if (elm != null && elm.nodeName == "A") + action = "update"; + + formObj.insert.value = tinyMCEPopup.getLang(action, 'Insert', true); + + setPopupControlsDisabled(true); + + if (action == "update") { + var href = inst.dom.getAttrib(elm, 'href'); + var onclick = inst.dom.getAttrib(elm, 'onclick'); + + // Setup form data + setFormValue('href', href); + setFormValue('title', inst.dom.getAttrib(elm, 'title')); + setFormValue('id', inst.dom.getAttrib(elm, 'id')); + setFormValue('style', inst.dom.getAttrib(elm, "style")); + setFormValue('rel', inst.dom.getAttrib(elm, 'rel')); + setFormValue('rev', inst.dom.getAttrib(elm, 'rev')); + setFormValue('charset', inst.dom.getAttrib(elm, 'charset')); + setFormValue('hreflang', inst.dom.getAttrib(elm, 'hreflang')); + setFormValue('dir', inst.dom.getAttrib(elm, 'dir')); + setFormValue('lang', inst.dom.getAttrib(elm, 'lang')); + setFormValue('tabindex', inst.dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : "")); + setFormValue('accesskey', inst.dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : "")); + setFormValue('type', inst.dom.getAttrib(elm, 'type')); + setFormValue('onfocus', inst.dom.getAttrib(elm, 'onfocus')); + setFormValue('onblur', inst.dom.getAttrib(elm, 'onblur')); + setFormValue('onclick', onclick); + setFormValue('ondblclick', inst.dom.getAttrib(elm, 'ondblclick')); + setFormValue('onmousedown', inst.dom.getAttrib(elm, 'onmousedown')); + setFormValue('onmouseup', inst.dom.getAttrib(elm, 'onmouseup')); + setFormValue('onmouseover', inst.dom.getAttrib(elm, 'onmouseover')); + setFormValue('onmousemove', inst.dom.getAttrib(elm, 'onmousemove')); + setFormValue('onmouseout', inst.dom.getAttrib(elm, 'onmouseout')); + setFormValue('onkeypress', inst.dom.getAttrib(elm, 'onkeypress')); + setFormValue('onkeydown', inst.dom.getAttrib(elm, 'onkeydown')); + setFormValue('onkeyup', inst.dom.getAttrib(elm, 'onkeyup')); + setFormValue('target', inst.dom.getAttrib(elm, 'target')); + setFormValue('classes', inst.dom.getAttrib(elm, 'class')); + + // Parse onclick data + if (onclick != null && onclick.indexOf('window.open') != -1) + parseWindowOpen(onclick); + else + parseFunction(onclick); + + // Select by the values + selectByValue(formObj, 'dir', inst.dom.getAttrib(elm, 'dir')); + selectByValue(formObj, 'rel', inst.dom.getAttrib(elm, 'rel')); + selectByValue(formObj, 'rev', inst.dom.getAttrib(elm, 'rev')); + selectByValue(formObj, 'linklisthref', href); + + if (href.charAt(0) == '#') + selectByValue(formObj, 'anchorlist', href); + + addClassesToList('classlist', 'advlink_styles'); + + selectByValue(formObj, 'classlist', inst.dom.getAttrib(elm, 'class'), true); + selectByValue(formObj, 'targetlist', inst.dom.getAttrib(elm, 'target'), true); + } else + addClassesToList('classlist', 'advlink_styles'); +} + +function checkPrefix(n) { + if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_email'))) + n.value = 'mailto:' + n.value; + + if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_external'))) + n.value = 'http://' + n.value; +} + +function setFormValue(name, value) { + document.forms[0].elements[name].value = value; +} + +function parseWindowOpen(onclick) { + var formObj = document.forms[0]; + + // Preprocess center code + if (onclick.indexOf('return false;') != -1) { + formObj.popupreturn.checked = true; + onclick = onclick.replace('return false;', ''); + } else + formObj.popupreturn.checked = false; + + var onClickData = parseLink(onclick); + + if (onClickData != null) { + formObj.ispopup.checked = true; + setPopupControlsDisabled(false); + + var onClickWindowOptions = parseOptions(onClickData['options']); + var url = onClickData['url']; + + formObj.popupname.value = onClickData['target']; + formObj.popupurl.value = url; + formObj.popupwidth.value = getOption(onClickWindowOptions, 'width'); + formObj.popupheight.value = getOption(onClickWindowOptions, 'height'); + + formObj.popupleft.value = getOption(onClickWindowOptions, 'left'); + formObj.popuptop.value = getOption(onClickWindowOptions, 'top'); + + if (formObj.popupleft.value.indexOf('screen') != -1) + formObj.popupleft.value = "c"; + + if (formObj.popuptop.value.indexOf('screen') != -1) + formObj.popuptop.value = "c"; + + formObj.popuplocation.checked = getOption(onClickWindowOptions, 'location') == "yes"; + formObj.popupscrollbars.checked = getOption(onClickWindowOptions, 'scrollbars') == "yes"; + formObj.popupmenubar.checked = getOption(onClickWindowOptions, 'menubar') == "yes"; + formObj.popupresizable.checked = getOption(onClickWindowOptions, 'resizable') == "yes"; + formObj.popuptoolbar.checked = getOption(onClickWindowOptions, 'toolbar') == "yes"; + formObj.popupstatus.checked = getOption(onClickWindowOptions, 'status') == "yes"; + formObj.popupdependent.checked = getOption(onClickWindowOptions, 'dependent') == "yes"; + + buildOnClick(); + } +} + +function parseFunction(onclick) { + var formObj = document.forms[0]; + var onClickData = parseLink(onclick); + + // TODO: Add stuff here +} + +function getOption(opts, name) { + return typeof(opts[name]) == "undefined" ? "" : opts[name]; +} + +function setPopupControlsDisabled(state) { + var formObj = document.forms[0]; + + formObj.popupname.disabled = state; + formObj.popupurl.disabled = state; + formObj.popupwidth.disabled = state; + formObj.popupheight.disabled = state; + formObj.popupleft.disabled = state; + formObj.popuptop.disabled = state; + formObj.popuplocation.disabled = state; + formObj.popupscrollbars.disabled = state; + formObj.popupmenubar.disabled = state; + formObj.popupresizable.disabled = state; + formObj.popuptoolbar.disabled = state; + formObj.popupstatus.disabled = state; + formObj.popupreturn.disabled = state; + formObj.popupdependent.disabled = state; + + setBrowserDisabled('popupurlbrowser', state); +} + +function parseLink(link) { + link = link.replace(new RegExp(''', 'g'), "'"); + + var fnName = link.replace(new RegExp("\\s*([A-Za-z0-9\.]*)\\s*\\(.*", "gi"), "$1"); + + // Is function name a template function + var template = templates[fnName]; + if (template) { + // Build regexp + var variableNames = template.match(new RegExp("'?\\$\\{[A-Za-z0-9\.]*\\}'?", "gi")); + var regExp = "\\s*[A-Za-z0-9\.]*\\s*\\("; + var replaceStr = ""; + for (var i=0; i'); + for (var i=0; i'; + html += ''; + + for (i=0; i' + name + ''; + } + + html += ''; + + return html; +} + +function insertAction() { + var inst = tinyMCEPopup.editor; + var elm, elementArray, i; + + elm = inst.selection.getNode(); + checkPrefix(document.forms[0].href); + + elm = inst.dom.getParent(elm, "A"); + + // Remove element if there is no href + if (!document.forms[0].href.value) { + tinyMCEPopup.execCommand("mceBeginUndoLevel"); + i = inst.selection.getBookmark(); + inst.dom.remove(elm, 1); + inst.selection.moveToBookmark(i); + tinyMCEPopup.execCommand("mceEndUndoLevel"); + tinyMCEPopup.close(); + return; + } + + tinyMCEPopup.execCommand("mceBeginUndoLevel"); + + // Create new anchor elements + if (elm == null) { + inst.getDoc().execCommand("unlink", false, null); + tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1}); + + elementArray = tinymce.grep(inst.dom.select("a"), function(n) {return inst.dom.getAttrib(n, 'href') == '#mce_temp_url#';}); + for (i=0; i' + tinyMCELinkList[i][0] + ''; + + html += ''; + + return html; + + // tinyMCE.debug('-- image list start --', html, '-- image list end --'); +} + +function getTargetListHTML(elm_id, target_form_element) { + var targets = tinyMCEPopup.getParam('theme_advanced_link_targets', '').split(';'); + var html = ''; + + html += ''; + + return html; +} + +// While loading +preinit(); +tinyMCEPopup.onInit.add(init); diff --git a/lib/editor/tinymce/plugins/advlink/langs/en_dlg.js b/lib/editor/tinymce/plugins/advlink/langs/en_dlg.js index c71ffbd0f16..8ef9c792b42 100644 --- a/lib/editor/tinymce/plugins/advlink/langs/en_dlg.js +++ b/lib/editor/tinymce/plugins/advlink/langs/en_dlg.js @@ -1,52 +1,52 @@ -tinyMCE.addI18n('en.advlink_dlg',{ -title:"Insert/edit link", -url:"Link URL", -target:"Target", -titlefield:"Title", -is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?", -is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?", -list:"Link list", -general_tab:"General", -popup_tab:"Popup", -events_tab:"Events", -advanced_tab:"Advanced", -general_props:"General properties", -popup_props:"Popup properties", -event_props:"Events", -advanced_props:"Advanced properties", -popup_opts:"Options", -anchor_names:"Anchors", -target_same:"Open in this window / frame", -target_parent:"Open in parent window / frame", -target_top:"Open in top frame (replaces all frames)", -target_blank:"Open in new window", -popup:"Javascript popup", -popup_url:"Popup URL", -popup_name:"Window name", -popup_return:"Insert 'return false'", -popup_scrollbars:"Show scrollbars", -popup_statusbar:"Show status bar", -popup_toolbar:"Show toolbars", -popup_menubar:"Show menu bar", -popup_location:"Show location bar", -popup_resizable:"Make window resizable", -popup_dependent:"Dependent (Mozilla/Firefox only)", -popup_size:"Size", -popup_position:"Position (X/Y)", -id:"Id", -style:"Style", -classes:"Classes", -target_name:"Target name", -langdir:"Language direction", -target_langcode:"Target language", -langcode:"Language code", -encoding:"Target character encoding", -mime:"Target MIME type", -rel:"Relationship page to target", -rev:"Relationship target to page", -tabindex:"Tabindex", -accesskey:"Accesskey", -ltr:"Left to right", -rtl:"Right to left", -link_list:"Link list" +tinyMCE.addI18n('en.advlink_dlg',{ +title:"Insert/edit link", +url:"Link URL", +target:"Target", +titlefield:"Title", +is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?", +is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?", +list:"Link list", +general_tab:"General", +popup_tab:"Popup", +events_tab:"Events", +advanced_tab:"Advanced", +general_props:"General properties", +popup_props:"Popup properties", +event_props:"Events", +advanced_props:"Advanced properties", +popup_opts:"Options", +anchor_names:"Anchors", +target_same:"Open in this window / frame", +target_parent:"Open in parent window / frame", +target_top:"Open in top frame (replaces all frames)", +target_blank:"Open in new window", +popup:"Javascript popup", +popup_url:"Popup URL", +popup_name:"Window name", +popup_return:"Insert 'return false'", +popup_scrollbars:"Show scrollbars", +popup_statusbar:"Show status bar", +popup_toolbar:"Show toolbars", +popup_menubar:"Show menu bar", +popup_location:"Show location bar", +popup_resizable:"Make window resizable", +popup_dependent:"Dependent (Mozilla/Firefox only)", +popup_size:"Size", +popup_position:"Position (X/Y)", +id:"Id", +style:"Style", +classes:"Classes", +target_name:"Target name", +langdir:"Language direction", +target_langcode:"Target language", +langcode:"Language code", +encoding:"Target character encoding", +mime:"Target MIME type", +rel:"Relationship page to target", +rev:"Relationship target to page", +tabindex:"Tabindex", +accesskey:"Accesskey", +ltr:"Left to right", +rtl:"Right to left", +link_list:"Link list" }); \ No newline at end of file diff --git a/lib/editor/tinymce/plugins/advlink/link.htm b/lib/editor/tinymce/plugins/advlink/link.htm index cc8b0b87c16..b21a944849d 100644 --- a/lib/editor/tinymce/plugins/advlink/link.htm +++ b/lib/editor/tinymce/plugins/advlink/link.htm @@ -1,338 +1,338 @@ - - - - {#advlink_dlg.title} - - - - - - - - -
    - - -
    -
    -
    - {#advlink_dlg.general_props} - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - -
     
    - -
    -
    -
    - - - -
    -
    - {#advlink_dlg.advanced_props} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    - -
    -
    -
    -
    -
    - -
    -
    - {#advlink_dlg.event_props} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -
    -
    - -
    - -
    - -
    -
    -
    - - + + + + {#advlink_dlg.title} + + + + + + + + +
    + + +
    +
    +
    + {#advlink_dlg.general_props} + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + +
     
    + +
    +
    +
    + + + +
    +
    + {#advlink_dlg.advanced_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +
    +
    +
    +
    +
    + +
    +
    + {#advlink_dlg.event_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + +
    + +
    + +
    +
    +
    + + diff --git a/lib/editor/tinymce/plugins/dragmath/langs/en_dlg.js b/lib/editor/tinymce/plugins/dragmath/langs/en_dlg.js index 4018ec1d1a3..adc04df1ae7 100644 --- a/lib/editor/tinymce/plugins/dragmath/langs/en_dlg.js +++ b/lib/editor/tinymce/plugins/dragmath/langs/en_dlg.js @@ -1,3 +1,3 @@ -tinyMCE.addI18n('en.dragmath_dlg',{ -title:"Insert Equation" +tinyMCE.addI18n('en.dragmath_dlg',{ +title:"Insert Equation" }); \ No newline at end of file diff --git a/lib/editor/tinymce/plugins/emotions/emotions.htm b/lib/editor/tinymce/plugins/emotions/emotions.htm index 55a1d72fa7f..5927b6039bc 100644 --- a/lib/editor/tinymce/plugins/emotions/emotions.htm +++ b/lib/editor/tinymce/plugins/emotions/emotions.htm @@ -1,40 +1,40 @@ - - - - {#emotions_dlg.title} - - - - -
    -
    {#emotions_dlg.title}:

    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    {#emotions_dlg.cool}{#emotions_dlg.cry}{#emotions_dlg.embarassed}{#emotions_dlg.foot_in_mouth}
    {#emotions_dlg.frown}{#emotions_dlg.innocent}{#emotions_dlg.kiss}{#emotions_dlg.laughing}
    {#emotions_dlg.money_mouth}{#emotions_dlg.sealed}{#emotions_dlg.smile}{#emotions_dlg.surprised}
    {#emotions_dlg.tongue-out}{#emotions_dlg.undecided}{#emotions_dlg.wink}{#emotions_dlg.yell}
    -
    - - + + + + {#emotions_dlg.title} + + + + +
    +
    {#emotions_dlg.title}:

    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    {#emotions_dlg.cool}{#emotions_dlg.cry}{#emotions_dlg.embarassed}{#emotions_dlg.foot_in_mouth}
    {#emotions_dlg.frown}{#emotions_dlg.innocent}{#emotions_dlg.kiss}{#emotions_dlg.laughing}
    {#emotions_dlg.money_mouth}{#emotions_dlg.sealed}{#emotions_dlg.smile}{#emotions_dlg.surprised}
    {#emotions_dlg.tongue-out}{#emotions_dlg.undecided}{#emotions_dlg.wink}{#emotions_dlg.yell}
    +
    + + diff --git a/lib/editor/tinymce/plugins/emotions/js/emotions.js b/lib/editor/tinymce/plugins/emotions/js/emotions.js index c549367096f..e5c950fc44f 100644 --- a/lib/editor/tinymce/plugins/emotions/js/emotions.js +++ b/lib/editor/tinymce/plugins/emotions/js/emotions.js @@ -1,22 +1,22 @@ -tinyMCEPopup.requireLangPack(); - -var EmotionsDialog = { - init : function(ed) { - tinyMCEPopup.resizeToInnerSize(); - }, - - insert : function(file, title) { - var ed = tinyMCEPopup.editor, dom = ed.dom; - - tinyMCEPopup.execCommand('mceInsertContent', false, dom.createHTML('img', { - src : tinyMCEPopup.getWindowArg('plugin_url') + '/img/' + file, - alt : ed.getLang(title), - title : ed.getLang(title), - border : 0 - })); - - tinyMCEPopup.close(); - } -}; - -tinyMCEPopup.onInit.add(EmotionsDialog.init, EmotionsDialog); +tinyMCEPopup.requireLangPack(); + +var EmotionsDialog = { + init : function(ed) { + tinyMCEPopup.resizeToInnerSize(); + }, + + insert : function(file, title) { + var ed = tinyMCEPopup.editor, dom = ed.dom; + + tinyMCEPopup.execCommand('mceInsertContent', false, dom.createHTML('img', { + src : tinyMCEPopup.getWindowArg('plugin_url') + '/img/' + file, + alt : ed.getLang(title), + title : ed.getLang(title), + border : 0 + })); + + tinyMCEPopup.close(); + } +}; + +tinyMCEPopup.onInit.add(EmotionsDialog.init, EmotionsDialog); diff --git a/lib/editor/tinymce/plugins/emotions/langs/en_dlg.js b/lib/editor/tinymce/plugins/emotions/langs/en_dlg.js index 3b57ad9e3ca..f6d5f4ba895 100644 --- a/lib/editor/tinymce/plugins/emotions/langs/en_dlg.js +++ b/lib/editor/tinymce/plugins/emotions/langs/en_dlg.js @@ -1,20 +1,20 @@ -tinyMCE.addI18n('en.emotions_dlg',{ -title:"Insert emotion", -desc:"Emotions", -cool:"Cool", -cry:"Cry", -embarassed:"Embarassed", -foot_in_mouth:"Foot in mouth", -frown:"Frown", -innocent:"Innocent", -kiss:"Kiss", -laughing:"Laughing", -money_mouth:"Money mouth", -sealed:"Sealed", -smile:"Smile", -surprised:"Surprised", -tongue_out:"Tongue out", -undecided:"Undecided", -wink:"Wink", -yell:"Yell" +tinyMCE.addI18n('en.emotions_dlg',{ +title:"Insert emotion", +desc:"Emotions", +cool:"Cool", +cry:"Cry", +embarassed:"Embarassed", +foot_in_mouth:"Foot in mouth", +frown:"Frown", +innocent:"Innocent", +kiss:"Kiss", +laughing:"Laughing", +money_mouth:"Money mouth", +sealed:"Sealed", +smile:"Smile", +surprised:"Surprised", +tongue_out:"Tongue out", +undecided:"Undecided", +wink:"Wink", +yell:"Yell" }); \ No newline at end of file diff --git a/lib/editor/tinymce/plugins/example/dialog.htm b/lib/editor/tinymce/plugins/example/dialog.htm index b4c62840ea6..58edf9a5036 100644 --- a/lib/editor/tinymce/plugins/example/dialog.htm +++ b/lib/editor/tinymce/plugins/example/dialog.htm @@ -1,27 +1,27 @@ - - - - {#example_dlg.title} - - - - - -
    -

    Here is a example dialog.

    -

    Selected text:

    -

    Custom arg:

    - -
    -
    - -
    - -
    - -
    -
    -
    - - - + + + + {#example_dlg.title} + + + + + +
    +

    Here is a example dialog.

    +

    Selected text:

    +

    Custom arg:

    + +
    +
    + +
    + +
    + +
    +
    +
    + + + diff --git a/lib/editor/tinymce/plugins/example/js/dialog.js b/lib/editor/tinymce/plugins/example/js/dialog.js index fa8341132fa..a7ee507e066 100644 --- a/lib/editor/tinymce/plugins/example/js/dialog.js +++ b/lib/editor/tinymce/plugins/example/js/dialog.js @@ -1,19 +1,19 @@ -tinyMCEPopup.requireLangPack(); - -var ExampleDialog = { - init : function() { - var f = document.forms[0]; - - // Get the selected contents as text and place it in the input - f.someval.value = tinyMCEPopup.editor.selection.getContent({format : 'text'}); - f.somearg.value = tinyMCEPopup.getWindowArg('some_custom_arg'); - }, - - insert : function() { - // Insert the contents from the input into the document - tinyMCEPopup.editor.execCommand('mceInsertContent', false, document.forms[0].someval.value); - tinyMCEPopup.close(); - } -}; - -tinyMCEPopup.onInit.add(ExampleDialog.init, ExampleDialog); +tinyMCEPopup.requireLangPack(); + +var ExampleDialog = { + init : function() { + var f = document.forms[0]; + + // Get the selected contents as text and place it in the input + f.someval.value = tinyMCEPopup.editor.selection.getContent({format : 'text'}); + f.somearg.value = tinyMCEPopup.getWindowArg('some_custom_arg'); + }, + + insert : function() { + // Insert the contents from the input into the document + tinyMCEPopup.editor.execCommand('mceInsertContent', false, document.forms[0].someval.value); + tinyMCEPopup.close(); + } +}; + +tinyMCEPopup.onInit.add(ExampleDialog.init, ExampleDialog); diff --git a/lib/editor/tinymce/plugins/example/langs/en.js b/lib/editor/tinymce/plugins/example/langs/en.js index e0784f80f4b..f3721d3a316 100644 --- a/lib/editor/tinymce/plugins/example/langs/en.js +++ b/lib/editor/tinymce/plugins/example/langs/en.js @@ -1,3 +1,3 @@ -tinyMCE.addI18n('en.example',{ - desc : 'This is just a template button' -}); +tinyMCE.addI18n('en.example',{ + desc : 'This is just a template button' +}); diff --git a/lib/editor/tinymce/plugins/example/langs/en_dlg.js b/lib/editor/tinymce/plugins/example/langs/en_dlg.js index ebcf948dac3..a9cd65f8c05 100644 --- a/lib/editor/tinymce/plugins/example/langs/en_dlg.js +++ b/lib/editor/tinymce/plugins/example/langs/en_dlg.js @@ -1,3 +1,3 @@ -tinyMCE.addI18n('en.example_dlg',{ - title : 'This is just a example title' -}); +tinyMCE.addI18n('en.example_dlg',{ + title : 'This is just a example title' +}); diff --git a/lib/editor/tinymce/plugins/fullpage/css/fullpage.css b/lib/editor/tinymce/plugins/fullpage/css/fullpage.css index 7a3334f08d0..1854eca942f 100644 --- a/lib/editor/tinymce/plugins/fullpage/css/fullpage.css +++ b/lib/editor/tinymce/plugins/fullpage/css/fullpage.css @@ -1,182 +1,182 @@ -/* Hide the advanced tab */ -#advanced_tab { - display: none; -} - -#metatitle, #metakeywords, #metadescription, #metaauthor, #metacopyright { - width: 280px; -} - -#doctype, #docencoding { - width: 200px; -} - -#langcode { - width: 30px; -} - -#bgimage { - width: 220px; -} - -#fontface { - width: 240px; -} - -#leftmargin, #rightmargin, #topmargin, #bottommargin { - width: 50px; -} - -.panel_wrapper div.current { - height: 400px; -} - -#stylesheet, #style { - width: 240px; -} - -/* Head list classes */ - -.headlistwrapper { - width: 100%; -} - -.addbutton, .removebutton, .moveupbutton, .movedownbutton { - border-top: 1px solid; - border-left: 1px solid; - border-bottom: 1px solid; - border-right: 1px solid; - border-color: #F0F0EE; - cursor: default; - display: block; - width: 20px; - height: 20px; -} - -#doctypes { - width: 200px; -} - -.addbutton:hover, .removebutton:hover, .moveupbutton:hover, .movedownbutton:hover { - border: 1px solid #0A246A; - background-color: #B6BDD2; -} - -.addbutton { - background-image: url('../images/add.gif'); - float: left; - margin-right: 3px; -} - -.removebutton { - background-image: url('../images/remove.gif'); - float: left; -} - -.moveupbutton { - background-image: url('../images/move_up.gif'); - float: left; - margin-right: 3px; -} - -.movedownbutton { - background-image: url('../images/move_down.gif'); - float: left; -} - -.selected { - border: 1px solid #0A246A; - background-color: #B6BDD2; -} - -.toolbar { - width: 100%; -} - -#headlist { - width: 100%; - margin-top: 3px; - font-size: 11px; -} - -#info, #title_element, #meta_element, #script_element, #style_element, #base_element, #link_element, #comment_element, #unknown_element { - display: none; -} - -#addmenu { - position: absolute; - border: 1px solid gray; - display: none; - z-index: 100; - background-color: white; -} - -#addmenu a { - display: block; - width: 100%; - line-height: 20px; - text-decoration: none; - background-color: white; -} - -#addmenu a:hover { - background-color: #B6BDD2; - color: black; -} - -#addmenu span { - padding-left: 10px; - padding-right: 10px; -} - -#updateElementPanel { - display: none; -} - -#script_element .panel_wrapper div.current { - height: 108px; -} - -#style_element .panel_wrapper div.current { - height: 108px; -} - -#link_element .panel_wrapper div.current { - height: 140px; -} - -#element_script_value { - width: 100%; - height: 100px; -} - -#element_comment_value { - width: 100%; - height: 120px; -} - -#element_style_value { - width: 100%; - height: 100px; -} - -#element_title, #element_script_src, #element_meta_name, #element_meta_content, #element_base_href, #element_link_href, #element_link_title { - width: 250px; -} - -.updateElementButton { - margin-top: 3px; -} - -/* MSIE specific styles */ - -* html .addbutton, * html .removebutton, * html .moveupbutton, * html .movedownbutton { - width: 22px; - height: 22px; -} - -textarea { - height: 55px; -} - +/* Hide the advanced tab */ +#advanced_tab { + display: none; +} + +#metatitle, #metakeywords, #metadescription, #metaauthor, #metacopyright { + width: 280px; +} + +#doctype, #docencoding { + width: 200px; +} + +#langcode { + width: 30px; +} + +#bgimage { + width: 220px; +} + +#fontface { + width: 240px; +} + +#leftmargin, #rightmargin, #topmargin, #bottommargin { + width: 50px; +} + +.panel_wrapper div.current { + height: 400px; +} + +#stylesheet, #style { + width: 240px; +} + +/* Head list classes */ + +.headlistwrapper { + width: 100%; +} + +.addbutton, .removebutton, .moveupbutton, .movedownbutton { + border-top: 1px solid; + border-left: 1px solid; + border-bottom: 1px solid; + border-right: 1px solid; + border-color: #F0F0EE; + cursor: default; + display: block; + width: 20px; + height: 20px; +} + +#doctypes { + width: 200px; +} + +.addbutton:hover, .removebutton:hover, .moveupbutton:hover, .movedownbutton:hover { + border: 1px solid #0A246A; + background-color: #B6BDD2; +} + +.addbutton { + background-image: url('../images/add.gif'); + float: left; + margin-right: 3px; +} + +.removebutton { + background-image: url('../images/remove.gif'); + float: left; +} + +.moveupbutton { + background-image: url('../images/move_up.gif'); + float: left; + margin-right: 3px; +} + +.movedownbutton { + background-image: url('../images/move_down.gif'); + float: left; +} + +.selected { + border: 1px solid #0A246A; + background-color: #B6BDD2; +} + +.toolbar { + width: 100%; +} + +#headlist { + width: 100%; + margin-top: 3px; + font-size: 11px; +} + +#info, #title_element, #meta_element, #script_element, #style_element, #base_element, #link_element, #comment_element, #unknown_element { + display: none; +} + +#addmenu { + position: absolute; + border: 1px solid gray; + display: none; + z-index: 100; + background-color: white; +} + +#addmenu a { + display: block; + width: 100%; + line-height: 20px; + text-decoration: none; + background-color: white; +} + +#addmenu a:hover { + background-color: #B6BDD2; + color: black; +} + +#addmenu span { + padding-left: 10px; + padding-right: 10px; +} + +#updateElementPanel { + display: none; +} + +#script_element .panel_wrapper div.current { + height: 108px; +} + +#style_element .panel_wrapper div.current { + height: 108px; +} + +#link_element .panel_wrapper div.current { + height: 140px; +} + +#element_script_value { + width: 100%; + height: 100px; +} + +#element_comment_value { + width: 100%; + height: 120px; +} + +#element_style_value { + width: 100%; + height: 100px; +} + +#element_title, #element_script_src, #element_meta_name, #element_meta_content, #element_base_href, #element_link_href, #element_link_title { + width: 250px; +} + +.updateElementButton { + margin-top: 3px; +} + +/* MSIE specific styles */ + +* html .addbutton, * html .removebutton, * html .moveupbutton, * html .movedownbutton { + width: 22px; + height: 22px; +} + +textarea { + height: 55px; +} + .panel_wrapper div.current {height:420px;} \ No newline at end of file diff --git a/lib/editor/tinymce/plugins/fullpage/fullpage.htm b/lib/editor/tinymce/plugins/fullpage/fullpage.htm index 3ea40810ab7..95531cd6993 100644 --- a/lib/editor/tinymce/plugins/fullpage/fullpage.htm +++ b/lib/editor/tinymce/plugins/fullpage/fullpage.htm @@ -1,576 +1,576 @@ - - - - {#fullpage_dlg.title} - - - - - - - -
    - - -
    -
    -
    - {#fullpage_dlg.meta_props} - - - - - - - - - - - - - - - - - - - - - - - - - - -
     
     
     
     
     
      - -
    -
    - -
    - {#fullpage_dlg.langprops} - - - - - - - - - - - - - - - - - - - - - - -
    - -
      - -
     
    - -
     
    -
    -
    - -
    -
    - {#fullpage_dlg.appearance_textprops} - - - - - - - - - - - - - - - - -
    - -
    - -
    - - - - - -
     
    -
    -
    - -
    - {#fullpage_dlg.appearance_bgprops} - - - - - - - - - - -
    - - - - - -
     
    -
    - - - - - -
     
    -
    -
    - -
    - {#fullpage_dlg.appearance_marginprops} - - - - - - - - - - - - - - -
    -
    - -
    - {#fullpage_dlg.appearance_linkprops} - - - - - - - - - - - - - - - - - - - -
    - - - - - -
    -
    - - - - - -
     
    -
    - - - - - -
     
    -
      
    -
    - -
    - {#fullpage_dlg.appearance_style} - - - - - - - - - - -
    - - - - -
     
    -
    -
    - -
    - - -
    - {#fullpage_dlg.head_elements} - -
    -
    -
    - - -
    -
    - - -
    -
    -
    - -
    -
    - -
    - {#fullpage_dlg.meta_element} - - - - - - - - - - - - - - -
    - - -
    - -
    - {#fullpage_dlg.title_element} - - - - - - -
    - - -
    - -
    - {#fullpage_dlg.script_element} - - - -
    - -
    -
    - - - - - - - - - - - - - - - - - -
    - - - - -
     
    -
    - -
    - -
    -
    - - -
    - -
    - {#fullpage_dlg.style_element} - - - -
    - -
    -
    - - - - - - - - - -
    -
    - -
    - -
    -
    - - -
    - -
    - {#fullpage_dlg.base_element} - - - - - - - - - - -
    - - -
    - - - -
    - {#fullpage_dlg.comment_element} - - - - -
    -
    -
    - -
    -
    - -
    - -
    - -
    -
    -
    - - + + + + {#fullpage_dlg.title} + + + + + + + +
    + + +
    +
    +
    + {#fullpage_dlg.meta_props} + + + + + + + + + + + + + + + + + + + + + + + + + + +
     
     
     
     
     
      + +
    +
    + +
    + {#fullpage_dlg.langprops} + + + + + + + + + + + + + + + + + + + + + + +
    + +
      + +
     
    + +
     
    +
    +
    + +
    +
    + {#fullpage_dlg.appearance_textprops} + + + + + + + + + + + + + + + + +
    + +
    + +
    + + + + + +
     
    +
    +
    + +
    + {#fullpage_dlg.appearance_bgprops} + + + + + + + + + + +
    + + + + + +
     
    +
    + + + + + +
     
    +
    +
    + +
    + {#fullpage_dlg.appearance_marginprops} + + + + + + + + + + + + + + +
    +
    + +
    + {#fullpage_dlg.appearance_linkprops} + + + + + + + + + + + + + + + + + + + +
    + + + + + +
    +
    + + + + + +
     
    +
    + + + + + +
     
    +
      
    +
    + +
    + {#fullpage_dlg.appearance_style} + + + + + + + + + + +
    + + + + +
     
    +
    +
    + +
    + + +
    + {#fullpage_dlg.head_elements} + +
    +
    +
    + + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + {#fullpage_dlg.meta_element} + + + + + + + + + + + + + + +
    + + +
    + +
    + {#fullpage_dlg.title_element} + + + + + + +
    + + +
    + +
    + {#fullpage_dlg.script_element} + + + +
    + +
    +
    + + + + + + + + + + + + + + + + + +
    + + + + +
     
    +
    + +
    + +
    +
    + + +
    + +
    + {#fullpage_dlg.style_element} + + + +
    + +
    +
    + + + + + + + + + +
    +
    + +
    + +
    +
    + + +
    + +
    + {#fullpage_dlg.base_element} + + + + + + + + + + +
    + + +
    + + + +
    + {#fullpage_dlg.comment_element} + + + + +
    +
    +
    + +
    +
    + +
    + +
    + +
    +
    +
    + + diff --git a/lib/editor/tinymce/plugins/fullpage/js/fullpage.js b/lib/editor/tinymce/plugins/fullpage/js/fullpage.js index 89059ef6670..6c994e9ca78 100644 --- a/lib/editor/tinymce/plugins/fullpage/js/fullpage.js +++ b/lib/editor/tinymce/plugins/fullpage/js/fullpage.js @@ -1,461 +1,461 @@ -tinyMCEPopup.requireLangPack(); - -var doc; - -var defaultDocTypes = - 'XHTML 1.0 Transitional=,' + - 'XHTML 1.0 Frameset=,' + - 'XHTML 1.0 Strict=,' + - 'XHTML 1.1=,' + - 'HTML 4.01 Transitional=,' + - 'HTML 4.01 Strict=,' + - 'HTML 4.01 Frameset='; - -var defaultEncodings = - 'Western european (iso-8859-1)=iso-8859-1,' + - 'Central European (iso-8859-2)=iso-8859-2,' + - 'Unicode (UTF-8)=utf-8,' + - 'Chinese traditional (Big5)=big5,' + - 'Cyrillic (iso-8859-5)=iso-8859-5,' + - 'Japanese (iso-2022-jp)=iso-2022-jp,' + - 'Greek (iso-8859-7)=iso-8859-7,' + - 'Korean (iso-2022-kr)=iso-2022-kr,' + - 'ASCII (us-ascii)=us-ascii'; - -var defaultMediaTypes = - 'all=all,' + - 'screen=screen,' + - 'print=print,' + - 'tty=tty,' + - 'tv=tv,' + - 'projection=projection,' + - 'handheld=handheld,' + - 'braille=braille,' + - 'aural=aural'; - -var defaultFontNames = 'Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings'; -var defaultFontSizes = '10px,11px,12px,13px,14px,15px,16px'; - -function init() { - var f = document.forms['fullpage'], el = f.elements, e, i, p, doctypes, encodings, mediaTypes, fonts, ed = tinyMCEPopup.editor, dom = tinyMCEPopup.dom, style; - - // Setup doctype select box - doctypes = ed.getParam("fullpage_doctypes", defaultDocTypes).split(','); - for (i=0; i 1) - addSelectValue(f, 'doctypes', p[0], p[1]); - } - - // Setup fonts select box - fonts = ed.getParam("fullpage_fonts", defaultFontNames).split(';'); - for (i=0; i 1) - addSelectValue(f, 'fontface', p[0], p[1]); - } - - // Setup fontsize select box - fonts = ed.getParam("fullpage_fontsizes", defaultFontSizes).split(','); - for (i=0; i 1) { - addSelectValue(f, 'element_style_media', p[0], p[1]); - addSelectValue(f, 'element_link_media', p[0], p[1]); - } - } - - // Setup encodings select box - encodings = ed.getParam("fullpage_encodings", defaultEncodings).split(','); - for (i=0; i 1) { - addSelectValue(f, 'docencoding', p[0], p[1]); - addSelectValue(f, 'element_script_charset', p[0], p[1]); - addSelectValue(f, 'element_link_charset', p[0], p[1]); - } - } - - document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); - document.getElementById('link_color_pickcontainer').innerHTML = getColorPickerHTML('link_color_pick','link_color'); - //document.getElementById('hover_color_pickcontainer').innerHTML = getColorPickerHTML('hover_color_pick','hover_color'); - document.getElementById('visited_color_pickcontainer').innerHTML = getColorPickerHTML('visited_color_pick','visited_color'); - document.getElementById('active_color_pickcontainer').innerHTML = getColorPickerHTML('active_color_pick','active_color'); - document.getElementById('textcolor_pickcontainer').innerHTML = getColorPickerHTML('textcolor_pick','textcolor'); - document.getElementById('stylesheet_browsercontainer').innerHTML = getBrowserHTML('stylesheetbrowser','stylesheet','file','fullpage'); - document.getElementById('link_href_pickcontainer').innerHTML = getBrowserHTML('link_href_browser','element_link_href','file','fullpage'); - document.getElementById('script_src_pickcontainer').innerHTML = getBrowserHTML('script_src_browser','element_script_src','file','fullpage'); - document.getElementById('bgimage_pickcontainer').innerHTML = getBrowserHTML('bgimage_browser','bgimage','image','fullpage'); - - // Resize some elements - if (isVisible('stylesheetbrowser')) - document.getElementById('stylesheet').style.width = '220px'; - - if (isVisible('link_href_browser')) - document.getElementById('element_link_href').style.width = '230px'; - - if (isVisible('bgimage_browser')) - document.getElementById('bgimage').style.width = '210px'; - - // Add iframe - dom.add(document.body, 'iframe', {id : 'documentIframe', src : 'javascript:""', style : {display : 'none'}}); - doc = dom.get('documentIframe').contentWindow.document; - h = tinyMCEPopup.getWindowArg('head_html'); - - // Preprocess the HTML disable scripts and urls - h = h.replace(/ - - - -
    - -
    - - - - - + + + + + + + + + +
    + +
    + + + + + diff --git a/lib/editor/tinymce/plugins/inlinepopups/template.htm b/lib/editor/tinymce/plugins/inlinepopups/template.htm index f9ec64219d2..c98fe41a67d 100644 --- a/lib/editor/tinymce/plugins/inlinepopups/template.htm +++ b/lib/editor/tinymce/plugins/inlinepopups/template.htm @@ -1,387 +1,387 @@ - - - -Template for dialogs - - - - -
    -
    -
    -
    -
    -
    -
    - Blured -
    - -
    -
    - Content -
    -
    - -
    -
    -
    -
    - Statusbar text. -
    - - - - - - - - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - Focused -
    - -
    -
    - Content -
    -
    - -
    -
    -
    -
    - Statusbar text. -
    - - - - - - - - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - Statusbar -
    - -
    -
    - Content -
    -
    - -
    -
    -
    -
    - Statusbar text. -
    - - - - - - - - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - Statusbar, Resizable -
    - -
    -
    - Content -
    -
    - -
    -
    -
    -
    - Statusbar text. -
    - - - - - - - - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - Resizable, Maximizable -
    - -
    -
    - Content -
    -
    - -
    -
    -
    -
    - Statusbar text. -
    - - - - - - - - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - Blurred, Maximizable, Statusbar, Resizable -
    - -
    -
    - Content -
    -
    - -
    -
    -
    -
    - Statusbar text. -
    - - - - - - - - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - Maximized, Maximizable, Minimizable -
    - -
    -
    - Content -
    -
    - -
    -
    -
    -
    - Statusbar text. -
    - - - - - - - - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - Blured -
    - -
    -
    - Content -
    -
    - -
    -
    -
    -
    - Statusbar text. -
    - - - - - - - - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    - Alert -
    - -
    -
    - - This is a very long error message. This is a very long error message. - This is a very long error message. This is a very long error message. - This is a very long error message. This is a very long error message. - This is a very long error message. This is a very long error message. - This is a very long error message. This is a very long error message. - This is a very long error message. This is a very long error message. - -
    -
    -
    - -
    -
    -
    -
    -
    - - - Ok - -
    -
    - -
    -
    -
    -
    -
    -
    - Confirm -
    - -
    -
    - - This is a very long error message. This is a very long error message. - This is a very long error message. This is a very long error message. - This is a very long error message. This is a very long error message. - This is a very long error message. This is a very long error message. - This is a very long error message. This is a very long error message. - This is a very long error message. This is a very long error message. - -
    -
    -
    - -
    -
    -
    -
    -
    - - - Ok - Cancel - -
    -
    -
    - - - + + + +Template for dialogs + + + + +
    +
    +
    +
    +
    +
    +
    + Blured +
    + +
    +
    + Content +
    +
    + +
    +
    +
    +
    + Statusbar text. +
    + + + + + + + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + Focused +
    + +
    +
    + Content +
    +
    + +
    +
    +
    +
    + Statusbar text. +
    + + + + + + + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + Statusbar +
    + +
    +
    + Content +
    +
    + +
    +
    +
    +
    + Statusbar text. +
    + + + + + + + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + Statusbar, Resizable +
    + +
    +
    + Content +
    +
    + +
    +
    +
    +
    + Statusbar text. +
    + + + + + + + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + Resizable, Maximizable +
    + +
    +
    + Content +
    +
    + +
    +
    +
    +
    + Statusbar text. +
    + + + + + + + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + Blurred, Maximizable, Statusbar, Resizable +
    + +
    +
    + Content +
    +
    + +
    +
    +
    +
    + Statusbar text. +
    + + + + + + + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + Maximized, Maximizable, Minimizable +
    + +
    +
    + Content +
    +
    + +
    +
    +
    +
    + Statusbar text. +
    + + + + + + + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + Blured +
    + +
    +
    + Content +
    +
    + +
    +
    +
    +
    + Statusbar text. +
    + + + + + + + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + Alert +
    + +
    +
    + + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + +
    +
    +
    + +
    +
    +
    +
    +
    + + + Ok + +
    +
    + +
    +
    +
    +
    +
    +
    + Confirm +
    + +
    +
    + + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + This is a very long error message. This is a very long error message. + +
    +
    +
    + +
    +
    +
    +
    +
    + + + Ok + Cancel + +
    +
    +
    + + + diff --git a/lib/editor/tinymce/plugins/media/css/content.css b/lib/editor/tinymce/plugins/media/css/content.css index 1bf6a758696..7739381da5a 100644 --- a/lib/editor/tinymce/plugins/media/css/content.css +++ b/lib/editor/tinymce/plugins/media/css/content.css @@ -1,6 +1,6 @@ -.mceItemFlash, .mceItemShockWave, .mceItemQuickTime, .mceItemWindowsMedia, .mceItemRealMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc;} -.mceItemShockWave {background-image: url(../img/shockwave.gif);} -.mceItemFlash {background-image:url(../img/flash.gif);} -.mceItemQuickTime {background-image:url(../img/quicktime.gif);} -.mceItemWindowsMedia {background-image:url(../img/windowsmedia.gif);} -.mceItemRealMedia {background-image:url(../img/realmedia.gif);} +.mceItemFlash, .mceItemShockWave, .mceItemQuickTime, .mceItemWindowsMedia, .mceItemRealMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc;} +.mceItemShockWave {background-image: url(../img/shockwave.gif);} +.mceItemFlash {background-image:url(../img/flash.gif);} +.mceItemQuickTime {background-image:url(../img/quicktime.gif);} +.mceItemWindowsMedia {background-image:url(../img/windowsmedia.gif);} +.mceItemRealMedia {background-image:url(../img/realmedia.gif);} diff --git a/lib/editor/tinymce/plugins/media/css/media.css b/lib/editor/tinymce/plugins/media/css/media.css index 2d087944dec..7b2253ba3da 100644 --- a/lib/editor/tinymce/plugins/media/css/media.css +++ b/lib/editor/tinymce/plugins/media/css/media.css @@ -1,16 +1,16 @@ -#id, #name, #hspace, #vspace, #class_name, #align { width: 100px } -#hspace, #vspace { width: 50px } -#flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode { width: 100px } -#flash_base, #flash_flashvars { width: 240px } -#width, #height { width: 40px } -#src, #media_type { width: 250px } -#class { width: 120px } -#prev { margin: 0; border: 1px solid black; width: 380px; height: 230px; overflow: auto } -.panel_wrapper div.current { height: 390px; overflow: auto } -#flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options { display: none } -.mceAddSelectValue { background-color: #DDDDDD } -#qt_starttime, #qt_endtime, #qt_fov, #qt_href, #qt_moveid, #qt_moviename, #qt_node, #qt_pan, #qt_qtsrc, #qt_qtsrcchokespeed, #qt_target, #qt_tilt, #qt_urlsubstituten, #qt_volume { width: 70px } -#wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume { width: 70px } -#rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks { width: 70px } -#shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle { width: 90px } -#qt_qtsrc { width: 200px } +#id, #name, #hspace, #vspace, #class_name, #align { width: 100px } +#hspace, #vspace { width: 50px } +#flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode { width: 100px } +#flash_base, #flash_flashvars { width: 240px } +#width, #height { width: 40px } +#src, #media_type { width: 250px } +#class { width: 120px } +#prev { margin: 0; border: 1px solid black; width: 380px; height: 230px; overflow: auto } +.panel_wrapper div.current { height: 390px; overflow: auto } +#flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options { display: none } +.mceAddSelectValue { background-color: #DDDDDD } +#qt_starttime, #qt_endtime, #qt_fov, #qt_href, #qt_moveid, #qt_moviename, #qt_node, #qt_pan, #qt_qtsrc, #qt_qtsrcchokespeed, #qt_target, #qt_tilt, #qt_urlsubstituten, #qt_volume { width: 70px } +#wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume { width: 70px } +#rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks { width: 70px } +#shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle { width: 90px } +#qt_qtsrc { width: 200px } diff --git a/lib/editor/tinymce/plugins/media/js/embed.js b/lib/editor/tinymce/plugins/media/js/embed.js index f8dc810527b..6fe25de090f 100644 --- a/lib/editor/tinymce/plugins/media/js/embed.js +++ b/lib/editor/tinymce/plugins/media/js/embed.js @@ -1,73 +1,73 @@ -/** - * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose. - */ - -function writeFlash(p) { - writeEmbed( - 'D27CDB6E-AE6D-11cf-96B8-444553540000', - 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', - 'application/x-shockwave-flash', - p - ); -} - -function writeShockWave(p) { - writeEmbed( - '166B1BCA-3F9C-11CF-8075-444553540000', - 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0', - 'application/x-director', - p - ); -} - -function writeQuickTime(p) { - writeEmbed( - '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B', - 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0', - 'video/quicktime', - p - ); -} - -function writeRealMedia(p) { - writeEmbed( - 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA', - 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', - 'audio/x-pn-realaudio-plugin', - p - ); -} - -function writeWindowsMedia(p) { - p.url = p.src; - writeEmbed( - '6BF52A52-394A-11D3-B153-00C04F79FAA6', - 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701', - 'application/x-mplayer2', - p - ); -} - -function writeEmbed(cls, cb, mt, p) { - var h = '', n; - - h += ''; - - h += ''; + + h += ''); - -function init() { - var pl = "", f, val; - var type = "flash", fe, i; - - ed = tinyMCEPopup.editor; - - tinyMCEPopup.resizeToInnerSize(); - f = document.forms[0] - - fe = ed.selection.getNode(); - if (/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(ed.dom.getAttrib(fe, 'class'))) { - pl = fe.title; - - switch (ed.dom.getAttrib(fe, 'class')) { - case 'mceItemFlash': - type = 'flash'; - break; - - case 'mceItemFlashVideo': - type = 'flv'; - break; - - case 'mceItemShockWave': - type = 'shockwave'; - break; - - case 'mceItemWindowsMedia': - type = 'wmp'; - break; - - case 'mceItemQuickTime': - type = 'qt'; - break; - - case 'mceItemRealMedia': - type = 'rmp'; - break; - } - - document.forms[0].insert.value = ed.getLang('update', 'Insert', true); - } - - document.getElementById('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media'); - document.getElementById('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','qt_qtsrc','media','media'); - document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); - - var html = getMediaListHTML('medialist','src','media','media'); - if (html == "") - document.getElementById("linklistrow").style.display = 'none'; - else - document.getElementById("linklistcontainer").innerHTML = html; - - // Resize some elements - if (isVisible('filebrowser')) - document.getElementById('src').style.width = '230px'; - - // Setup form - if (pl != "") { - pl = tinyMCEPopup.editor.plugins.media._parse(pl); - - switch (type) { - case "flash": - setBool(pl, 'flash', 'play'); - setBool(pl, 'flash', 'loop'); - setBool(pl, 'flash', 'menu'); - setBool(pl, 'flash', 'swliveconnect'); - setStr(pl, 'flash', 'quality'); - setStr(pl, 'flash', 'scale'); - setStr(pl, 'flash', 'salign'); - setStr(pl, 'flash', 'wmode'); - setStr(pl, 'flash', 'base'); - setStr(pl, 'flash', 'flashvars'); - break; - - case "qt": - setBool(pl, 'qt', 'loop'); - setBool(pl, 'qt', 'autoplay'); - setBool(pl, 'qt', 'cache'); - setBool(pl, 'qt', 'controller'); - setBool(pl, 'qt', 'correction'); - setBool(pl, 'qt', 'enablejavascript'); - setBool(pl, 'qt', 'kioskmode'); - setBool(pl, 'qt', 'autohref'); - setBool(pl, 'qt', 'playeveryframe'); - setBool(pl, 'qt', 'tarsetcache'); - setStr(pl, 'qt', 'scale'); - setStr(pl, 'qt', 'starttime'); - setStr(pl, 'qt', 'endtime'); - setStr(pl, 'qt', 'tarset'); - setStr(pl, 'qt', 'qtsrcchokespeed'); - setStr(pl, 'qt', 'volume'); - setStr(pl, 'qt', 'qtsrc'); - break; - - case "shockwave": - setBool(pl, 'shockwave', 'sound'); - setBool(pl, 'shockwave', 'progress'); - setBool(pl, 'shockwave', 'autostart'); - setBool(pl, 'shockwave', 'swliveconnect'); - setStr(pl, 'shockwave', 'swvolume'); - setStr(pl, 'shockwave', 'swstretchstyle'); - setStr(pl, 'shockwave', 'swstretchhalign'); - setStr(pl, 'shockwave', 'swstretchvalign'); - break; - - case "wmp": - setBool(pl, 'wmp', 'autostart'); - setBool(pl, 'wmp', 'enabled'); - setBool(pl, 'wmp', 'enablecontextmenu'); - setBool(pl, 'wmp', 'fullscreen'); - setBool(pl, 'wmp', 'invokeurls'); - setBool(pl, 'wmp', 'mute'); - setBool(pl, 'wmp', 'stretchtofit'); - setBool(pl, 'wmp', 'windowlessvideo'); - setStr(pl, 'wmp', 'balance'); - setStr(pl, 'wmp', 'baseurl'); - setStr(pl, 'wmp', 'captioningid'); - setStr(pl, 'wmp', 'currentmarker'); - setStr(pl, 'wmp', 'currentposition'); - setStr(pl, 'wmp', 'defaultframe'); - setStr(pl, 'wmp', 'playcount'); - setStr(pl, 'wmp', 'rate'); - setStr(pl, 'wmp', 'uimode'); - setStr(pl, 'wmp', 'volume'); - break; - - case "rmp": - setBool(pl, 'rmp', 'autostart'); - setBool(pl, 'rmp', 'loop'); - setBool(pl, 'rmp', 'autogotourl'); - setBool(pl, 'rmp', 'center'); - setBool(pl, 'rmp', 'imagestatus'); - setBool(pl, 'rmp', 'maintainaspect'); - setBool(pl, 'rmp', 'nojava'); - setBool(pl, 'rmp', 'prefetch'); - setBool(pl, 'rmp', 'shuffle'); - setStr(pl, 'rmp', 'console'); - setStr(pl, 'rmp', 'controls'); - setStr(pl, 'rmp', 'numloop'); - setStr(pl, 'rmp', 'scriptcallbacks'); - break; - } - - setStr(pl, null, 'src'); - setStr(pl, null, 'id'); - setStr(pl, null, 'name'); - setStr(pl, null, 'vspace'); - setStr(pl, null, 'hspace'); - setStr(pl, null, 'bgcolor'); - setStr(pl, null, 'align'); - setStr(pl, null, 'width'); - setStr(pl, null, 'height'); - - if ((val = ed.dom.getAttrib(fe, "width")) != "") - pl.width = f.width.value = val; - - if ((val = ed.dom.getAttrib(fe, "height")) != "") - pl.height = f.height.value = val; - - oldWidth = pl.width ? parseInt(pl.width) : 0; - oldHeight = pl.height ? parseInt(pl.height) : 0; - } else - oldWidth = oldHeight = 0; - - selectByValue(f, 'media_type', type); - changedType(type); - updateColor('bgcolor_pick', 'bgcolor'); - - TinyMCE_EditableSelects.init(); - generatePreview(); -} - -function insertMedia() { - var fe, f = document.forms[0], h; - - tinyMCEPopup.restoreSelection(); - - if (!AutoValidator.validate(f)) { - tinyMCEPopup.alert(ed.getLang('invalid_data')); - return false; - } - - f.width.value = f.width.value == "" ? 100 : f.width.value; - f.height.value = f.height.value == "" ? 100 : f.height.value; - - fe = ed.selection.getNode(); - if (fe != null && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(ed.dom.getAttrib(fe, 'class'))) { - switch (f.media_type.options[f.media_type.selectedIndex].value) { - case "flash": - fe.className = "mceItemFlash"; - break; - - case "flv": - fe.className = "mceItemFlashVideo"; - break; - - case "shockwave": - fe.className = "mceItemShockWave"; - break; - - case "qt": - fe.className = "mceItemQuickTime"; - break; - - case "wmp": - fe.className = "mceItemWindowsMedia"; - break; - - case "rmp": - fe.className = "mceItemRealMedia"; - break; - } - - if (fe.width != f.width.value || fe.height != f.height.value) - ed.execCommand('mceRepaint'); - - fe.title = serializeParameters(); - fe.width = f.width.value; - fe.height = f.height.value; - fe.style.width = f.width.value + (f.width.value.indexOf('%') == -1 ? 'px' : ''); - fe.style.height = f.height.value + (f.height.value.indexOf('%') == -1 ? 'px' : ''); - fe.align = f.align.options[f.align.selectedIndex].value; - } else { - h = ' 0) { - var html = ""; - - html += ''; - - return html; - } - - return ""; -} - -function getType(v) { - var fo, i, c, el, x, f = document.forms[0]; - - fo = ed.getParam("media_types", "flash=swf;flv=flv;shockwave=dcr;qt=mov,qt,mpg,mp3,mp4,mpeg;shockwave=dcr;wmp=avi,wmv,wm,asf,asx,wmx,wvx;rmp=rm,ra,ram").split(';'); - - // YouTube - if (v.match(/watch\?v=(.+)(.*)/)) { - f.width.value = '425'; - f.height.value = '350'; - f.src.value = 'http://www.youtube.com/v/' + v.match(/v=(.*)(.*)/)[0].split('=')[1]; - return 'flash'; - } - - // Google video - if (v.indexOf('http://video.google.com/videoplay?docid=') == 0) { - f.width.value = '425'; - f.height.value = '326'; - f.src.value = 'http://video.google.com/googleplayer.swf?docId=' + v.substring('http://video.google.com/videoplay?docid='.length) + '&hl=en'; - return 'flash'; - } - - for (i=0; i 0 ? s.substring(0, s.length - 1) : s; - - return s; -} - -function setBool(pl, p, n) { - if (typeof(pl[n]) == "undefined") - return; - - document.forms[0].elements[p + "_" + n].checked = pl[n] != 'false'; -} - -function setStr(pl, p, n) { - var f = document.forms[0], e = f.elements[(p != null ? p + "_" : '') + n]; - - if (typeof(pl[n]) == "undefined") - return; - - if (e.type == "text") - e.value = pl[n]; - else - selectByValue(f, (p != null ? p + "_" : '') + n, pl[n]); -} - -function getBool(p, n, d, tv, fv) { - var v = document.forms[0].elements[p + "_" + n].checked; - - tv = typeof(tv) == 'undefined' ? 'true' : "'" + jsEncode(tv) + "'"; - fv = typeof(fv) == 'undefined' ? 'false' : "'" + jsEncode(fv) + "'"; - - return (v == d) ? '' : n + (v ? ':' + tv + ',' : ":\'" + fv + "\',"); -} - -function getStr(p, n, d) { - var e = document.forms[0].elements[(p != null ? p + "_" : "") + n]; - var v = e.type == "text" ? e.value : e.options[e.selectedIndex].value; - - if (n == 'src') - v = tinyMCEPopup.editor.convertURL(v, 'src', null); - - return ((n == d || v == '') ? '' : n + ":'" + jsEncode(v) + "',"); -} - -function getInt(p, n, d) { - var e = document.forms[0].elements[(p != null ? p + "_" : "") + n]; - var v = e.type == "text" ? e.value : e.options[e.selectedIndex].value; - - return ((n == d || v == '') ? '' : n + ":" + v.replace(/[^0-9]+/g, '') + ","); -} - -function jsEncode(s) { - s = s.replace(new RegExp('\\\\', 'g'), '\\\\'); - s = s.replace(new RegExp('"', 'g'), '\\"'); - s = s.replace(new RegExp("'", 'g'), "\\'"); - - return s; -} - -function generatePreview(c) { - var f = document.forms[0], p = document.getElementById('prev'), h = '', cls, pl, n, type, codebase, wp, hp, nw, nh; - - p.innerHTML = ''; - - nw = parseInt(f.width.value); - nh = parseInt(f.height.value); - - if (f.width.value != "" && f.height.value != "") { - if (f.constrain.checked) { - if (c == 'width' && oldWidth != 0) { - wp = nw / oldWidth; - nh = Math.round(wp * nh); - f.height.value = nh; - } else if (c == 'height' && oldHeight != 0) { - hp = nh / oldHeight; - nw = Math.round(hp * nw); - f.width.value = nw; - } - } - } - - if (f.width.value != "") - oldWidth = nw; - - if (f.height.value != "") - oldHeight = nh; - - // After constrain - pl = serializeParameters(); - - switch (f.media_type.options[f.media_type.selectedIndex].value) { - case "flash": - cls = 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'; - codebase = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0'; - type = 'application/x-shockwave-flash'; - break; - - case "shockwave": - cls = 'clsid:166B1BCA-3F9C-11CF-8075-444553540000'; - codebase = 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0'; - type = 'application/x-director'; - break; - - case "qt": - cls = 'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B'; - codebase = 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0'; - type = 'video/quicktime'; - break; - - case "wmp": - cls = ed.getParam('media_wmp6_compatible') ? 'clsid:05589FA1-C356-11CE-BF01-00AA0055595A' : 'clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6'; - codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'; - type = 'application/x-mplayer2'; - break; - - case "rmp": - cls = 'clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA'; - codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'; - type = 'audio/x-pn-realaudio-plugin'; - break; - } - - if (pl == '') { - p.innerHTML = ''; - return; - } - - pl = tinyMCEPopup.editor.plugins.media._parse(pl); - - if (!pl.src) { - p.innerHTML = ''; - return; - } - - pl.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(pl.src); - pl.width = !pl.width ? 100 : pl.width; - pl.height = !pl.height ? 100 : pl.height; - pl.id = !pl.id ? 'obj' : pl.id; - pl.name = !pl.name ? 'eobj' : pl.name; - pl.align = !pl.align ? '' : pl.align; - - // Avoid annoying warning about insecure items - if (!tinymce.isIE || document.location.protocol != 'https:') { - h += ''; - - for (n in pl) { - h += ''; - - // Add extra url parameter if it's an absolute URL - if (n == 'src' && pl[n].indexOf('://') != -1) - h += ''; - } - } - - h += ''); + +function init() { + var pl = "", f, val; + var type = "flash", fe, i; + + ed = tinyMCEPopup.editor; + + tinyMCEPopup.resizeToInnerSize(); + f = document.forms[0] + + fe = ed.selection.getNode(); + if (/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(ed.dom.getAttrib(fe, 'class'))) { + pl = fe.title; + + switch (ed.dom.getAttrib(fe, 'class')) { + case 'mceItemFlash': + type = 'flash'; + break; + + case 'mceItemFlashVideo': + type = 'flv'; + break; + + case 'mceItemShockWave': + type = 'shockwave'; + break; + + case 'mceItemWindowsMedia': + type = 'wmp'; + break; + + case 'mceItemQuickTime': + type = 'qt'; + break; + + case 'mceItemRealMedia': + type = 'rmp'; + break; + } + + document.forms[0].insert.value = ed.getLang('update', 'Insert', true); + } + + document.getElementById('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media'); + document.getElementById('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','qt_qtsrc','media','media'); + document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); + + var html = getMediaListHTML('medialist','src','media','media'); + if (html == "") + document.getElementById("linklistrow").style.display = 'none'; + else + document.getElementById("linklistcontainer").innerHTML = html; + + // Resize some elements + if (isVisible('filebrowser')) + document.getElementById('src').style.width = '230px'; + + // Setup form + if (pl != "") { + pl = tinyMCEPopup.editor.plugins.media._parse(pl); + + switch (type) { + case "flash": + setBool(pl, 'flash', 'play'); + setBool(pl, 'flash', 'loop'); + setBool(pl, 'flash', 'menu'); + setBool(pl, 'flash', 'swliveconnect'); + setStr(pl, 'flash', 'quality'); + setStr(pl, 'flash', 'scale'); + setStr(pl, 'flash', 'salign'); + setStr(pl, 'flash', 'wmode'); + setStr(pl, 'flash', 'base'); + setStr(pl, 'flash', 'flashvars'); + break; + + case "qt": + setBool(pl, 'qt', 'loop'); + setBool(pl, 'qt', 'autoplay'); + setBool(pl, 'qt', 'cache'); + setBool(pl, 'qt', 'controller'); + setBool(pl, 'qt', 'correction'); + setBool(pl, 'qt', 'enablejavascript'); + setBool(pl, 'qt', 'kioskmode'); + setBool(pl, 'qt', 'autohref'); + setBool(pl, 'qt', 'playeveryframe'); + setBool(pl, 'qt', 'tarsetcache'); + setStr(pl, 'qt', 'scale'); + setStr(pl, 'qt', 'starttime'); + setStr(pl, 'qt', 'endtime'); + setStr(pl, 'qt', 'tarset'); + setStr(pl, 'qt', 'qtsrcchokespeed'); + setStr(pl, 'qt', 'volume'); + setStr(pl, 'qt', 'qtsrc'); + break; + + case "shockwave": + setBool(pl, 'shockwave', 'sound'); + setBool(pl, 'shockwave', 'progress'); + setBool(pl, 'shockwave', 'autostart'); + setBool(pl, 'shockwave', 'swliveconnect'); + setStr(pl, 'shockwave', 'swvolume'); + setStr(pl, 'shockwave', 'swstretchstyle'); + setStr(pl, 'shockwave', 'swstretchhalign'); + setStr(pl, 'shockwave', 'swstretchvalign'); + break; + + case "wmp": + setBool(pl, 'wmp', 'autostart'); + setBool(pl, 'wmp', 'enabled'); + setBool(pl, 'wmp', 'enablecontextmenu'); + setBool(pl, 'wmp', 'fullscreen'); + setBool(pl, 'wmp', 'invokeurls'); + setBool(pl, 'wmp', 'mute'); + setBool(pl, 'wmp', 'stretchtofit'); + setBool(pl, 'wmp', 'windowlessvideo'); + setStr(pl, 'wmp', 'balance'); + setStr(pl, 'wmp', 'baseurl'); + setStr(pl, 'wmp', 'captioningid'); + setStr(pl, 'wmp', 'currentmarker'); + setStr(pl, 'wmp', 'currentposition'); + setStr(pl, 'wmp', 'defaultframe'); + setStr(pl, 'wmp', 'playcount'); + setStr(pl, 'wmp', 'rate'); + setStr(pl, 'wmp', 'uimode'); + setStr(pl, 'wmp', 'volume'); + break; + + case "rmp": + setBool(pl, 'rmp', 'autostart'); + setBool(pl, 'rmp', 'loop'); + setBool(pl, 'rmp', 'autogotourl'); + setBool(pl, 'rmp', 'center'); + setBool(pl, 'rmp', 'imagestatus'); + setBool(pl, 'rmp', 'maintainaspect'); + setBool(pl, 'rmp', 'nojava'); + setBool(pl, 'rmp', 'prefetch'); + setBool(pl, 'rmp', 'shuffle'); + setStr(pl, 'rmp', 'console'); + setStr(pl, 'rmp', 'controls'); + setStr(pl, 'rmp', 'numloop'); + setStr(pl, 'rmp', 'scriptcallbacks'); + break; + } + + setStr(pl, null, 'src'); + setStr(pl, null, 'id'); + setStr(pl, null, 'name'); + setStr(pl, null, 'vspace'); + setStr(pl, null, 'hspace'); + setStr(pl, null, 'bgcolor'); + setStr(pl, null, 'align'); + setStr(pl, null, 'width'); + setStr(pl, null, 'height'); + + if ((val = ed.dom.getAttrib(fe, "width")) != "") + pl.width = f.width.value = val; + + if ((val = ed.dom.getAttrib(fe, "height")) != "") + pl.height = f.height.value = val; + + oldWidth = pl.width ? parseInt(pl.width) : 0; + oldHeight = pl.height ? parseInt(pl.height) : 0; + } else + oldWidth = oldHeight = 0; + + selectByValue(f, 'media_type', type); + changedType(type); + updateColor('bgcolor_pick', 'bgcolor'); + + TinyMCE_EditableSelects.init(); + generatePreview(); +} + +function insertMedia() { + var fe, f = document.forms[0], h; + + tinyMCEPopup.restoreSelection(); + + if (!AutoValidator.validate(f)) { + tinyMCEPopup.alert(ed.getLang('invalid_data')); + return false; + } + + f.width.value = f.width.value == "" ? 100 : f.width.value; + f.height.value = f.height.value == "" ? 100 : f.height.value; + + fe = ed.selection.getNode(); + if (fe != null && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(ed.dom.getAttrib(fe, 'class'))) { + switch (f.media_type.options[f.media_type.selectedIndex].value) { + case "flash": + fe.className = "mceItemFlash"; + break; + + case "flv": + fe.className = "mceItemFlashVideo"; + break; + + case "shockwave": + fe.className = "mceItemShockWave"; + break; + + case "qt": + fe.className = "mceItemQuickTime"; + break; + + case "wmp": + fe.className = "mceItemWindowsMedia"; + break; + + case "rmp": + fe.className = "mceItemRealMedia"; + break; + } + + if (fe.width != f.width.value || fe.height != f.height.value) + ed.execCommand('mceRepaint'); + + fe.title = serializeParameters(); + fe.width = f.width.value; + fe.height = f.height.value; + fe.style.width = f.width.value + (f.width.value.indexOf('%') == -1 ? 'px' : ''); + fe.style.height = f.height.value + (f.height.value.indexOf('%') == -1 ? 'px' : ''); + fe.align = f.align.options[f.align.selectedIndex].value; + } else { + h = ' 0) { + var html = ""; + + html += ''; + + return html; + } + + return ""; +} + +function getType(v) { + var fo, i, c, el, x, f = document.forms[0]; + + fo = ed.getParam("media_types", "flash=swf;flv=flv;shockwave=dcr;qt=mov,qt,mpg,mp3,mp4,mpeg;shockwave=dcr;wmp=avi,wmv,wm,asf,asx,wmx,wvx;rmp=rm,ra,ram").split(';'); + + // YouTube + if (v.match(/watch\?v=(.+)(.*)/)) { + f.width.value = '425'; + f.height.value = '350'; + f.src.value = 'http://www.youtube.com/v/' + v.match(/v=(.*)(.*)/)[0].split('=')[1]; + return 'flash'; + } + + // Google video + if (v.indexOf('http://video.google.com/videoplay?docid=') == 0) { + f.width.value = '425'; + f.height.value = '326'; + f.src.value = 'http://video.google.com/googleplayer.swf?docId=' + v.substring('http://video.google.com/videoplay?docid='.length) + '&hl=en'; + return 'flash'; + } + + for (i=0; i 0 ? s.substring(0, s.length - 1) : s; + + return s; +} + +function setBool(pl, p, n) { + if (typeof(pl[n]) == "undefined") + return; + + document.forms[0].elements[p + "_" + n].checked = pl[n] != 'false'; +} + +function setStr(pl, p, n) { + var f = document.forms[0], e = f.elements[(p != null ? p + "_" : '') + n]; + + if (typeof(pl[n]) == "undefined") + return; + + if (e.type == "text") + e.value = pl[n]; + else + selectByValue(f, (p != null ? p + "_" : '') + n, pl[n]); +} + +function getBool(p, n, d, tv, fv) { + var v = document.forms[0].elements[p + "_" + n].checked; + + tv = typeof(tv) == 'undefined' ? 'true' : "'" + jsEncode(tv) + "'"; + fv = typeof(fv) == 'undefined' ? 'false' : "'" + jsEncode(fv) + "'"; + + return (v == d) ? '' : n + (v ? ':' + tv + ',' : ":\'" + fv + "\',"); +} + +function getStr(p, n, d) { + var e = document.forms[0].elements[(p != null ? p + "_" : "") + n]; + var v = e.type == "text" ? e.value : e.options[e.selectedIndex].value; + + if (n == 'src') + v = tinyMCEPopup.editor.convertURL(v, 'src', null); + + return ((n == d || v == '') ? '' : n + ":'" + jsEncode(v) + "',"); +} + +function getInt(p, n, d) { + var e = document.forms[0].elements[(p != null ? p + "_" : "") + n]; + var v = e.type == "text" ? e.value : e.options[e.selectedIndex].value; + + return ((n == d || v == '') ? '' : n + ":" + v.replace(/[^0-9]+/g, '') + ","); +} + +function jsEncode(s) { + s = s.replace(new RegExp('\\\\', 'g'), '\\\\'); + s = s.replace(new RegExp('"', 'g'), '\\"'); + s = s.replace(new RegExp("'", 'g'), "\\'"); + + return s; +} + +function generatePreview(c) { + var f = document.forms[0], p = document.getElementById('prev'), h = '', cls, pl, n, type, codebase, wp, hp, nw, nh; + + p.innerHTML = ''; + + nw = parseInt(f.width.value); + nh = parseInt(f.height.value); + + if (f.width.value != "" && f.height.value != "") { + if (f.constrain.checked) { + if (c == 'width' && oldWidth != 0) { + wp = nw / oldWidth; + nh = Math.round(wp * nh); + f.height.value = nh; + } else if (c == 'height' && oldHeight != 0) { + hp = nh / oldHeight; + nw = Math.round(hp * nw); + f.width.value = nw; + } + } + } + + if (f.width.value != "") + oldWidth = nw; + + if (f.height.value != "") + oldHeight = nh; + + // After constrain + pl = serializeParameters(); + + switch (f.media_type.options[f.media_type.selectedIndex].value) { + case "flash": + cls = 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'; + codebase = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0'; + type = 'application/x-shockwave-flash'; + break; + + case "shockwave": + cls = 'clsid:166B1BCA-3F9C-11CF-8075-444553540000'; + codebase = 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0'; + type = 'application/x-director'; + break; + + case "qt": + cls = 'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B'; + codebase = 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0'; + type = 'video/quicktime'; + break; + + case "wmp": + cls = ed.getParam('media_wmp6_compatible') ? 'clsid:05589FA1-C356-11CE-BF01-00AA0055595A' : 'clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6'; + codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'; + type = 'application/x-mplayer2'; + break; + + case "rmp": + cls = 'clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA'; + codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'; + type = 'audio/x-pn-realaudio-plugin'; + break; + } + + if (pl == '') { + p.innerHTML = ''; + return; + } + + pl = tinyMCEPopup.editor.plugins.media._parse(pl); + + if (!pl.src) { + p.innerHTML = ''; + return; + } + + pl.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(pl.src); + pl.width = !pl.width ? 100 : pl.width; + pl.height = !pl.height ? 100 : pl.height; + pl.id = !pl.id ? 'obj' : pl.id; + pl.name = !pl.name ? 'eobj' : pl.name; + pl.align = !pl.align ? '' : pl.align; + + // Avoid annoying warning about insecure items + if (!tinymce.isIE || document.location.protocol != 'https:') { + h += ''; + + for (n in pl) { + h += ''; + + // Add extra url parameter if it's an absolute URL + if (n == 'src' && pl[n].indexOf('://') != -1) + h += ''; + } + } + + h += ' - - - {#media_dlg.title} - - - - - - - - - -
    - - -
    -
    -
    - {#media_dlg.general} - - - - - - - - - - - - - - - - - - -
    - -
    - - - - - -
     
    -
    - - - - - - -
    x   
    -
    -
    - -
    - {#media_dlg.preview} - -
    -
    - -
    -
    - {#media_dlg.advanced} - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - -
     
    -
    -
    - -
    - {#media_dlg.flash_options} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - -
    - - - -
    - - - - - -
    -
    - - - - - -
    -
    - - - - - -
    -
    - - - - - -
    -
    - - - - - - - - - - - -
    -
    - -
    - {#media_dlg.flv_options} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    - - - - - -
    -
    - - - - - -
    -
    - - - - - -
    -
    - - - - - -
    -
    - - - - - -
    -
    - - - - - -
    -
    -
    - -
    - {#media_dlg.qt_options} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -
    -
    - - - - - -
    -
    - - - - - -
    -
    - - - - - -
    -
    - - - - - -
    -
    - - - - - -
    -
    - - - - - -
    -
    - - - - - -
    -
    - - - - - -
    -
    - - - - - -
    -
    -  
    - - - - - -
     
    -
    -
    - -
    - {#media_dlg.wmp_options} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -
    -
    - - - - - -
    -
    - - - - - -
    -
    - - - - - -
    -
    - - - - - -
    -
    - - - - - -
    -
    - - - - - -
    -
    - - - - - -
    -
    -
    - -
    - {#media_dlg.rmp_options} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -
    -
    - - - - - -
    -
    - - - - - -
    -
    - - - - - -
    -
    - - - - - -
    -
    - - - - - -
    -
    - - - - - -
    -
    - - - - - -
    -
    - - - - - -
    -
    -   -
    -
    - -
    - {#media_dlg.shockwave_options} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - - - -
    -
    - - - - - -
    -
    - - - - - -
    -
    - - - - - -
    -
    -
    -
    -
    - -
    -
    - -
    - -
    - -
    -
    -
    - - + + + + {#media_dlg.title} + + + + + + + + + +
    + + +
    +
    +
    + {#media_dlg.general} + + + + + + + + + + + + + + + + + + +
    + +
    + + + + + +
     
    +
    + + + + + + +
    x   
    +
    +
    + +
    + {#media_dlg.preview} + +
    +
    + +
    +
    + {#media_dlg.advanced} + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + +
     
    +
    +
    + +
    + {#media_dlg.flash_options} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + + + + + + + +
    +
    + +
    + {#media_dlg.flv_options} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    +
    + +
    + {#media_dlg.qt_options} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    +  
    + + + + + +
     
    +
    +
    + +
    + {#media_dlg.wmp_options} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    +
    + +
    + {#media_dlg.rmp_options} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    +   +
    +
    + +
    + {#media_dlg.shockwave_options} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    + + + + + +
    +
    +
    +
    +
    + +
    +
    + +
    + +
    + +
    +
    +
    + + diff --git a/lib/editor/tinymce/plugins/moodlemedia/css/media.css b/lib/editor/tinymce/plugins/moodlemedia/css/media.css index ed33efd6873..ea653473b5e 100755 --- a/lib/editor/tinymce/plugins/moodlemedia/css/media.css +++ b/lib/editor/tinymce/plugins/moodlemedia/css/media.css @@ -1,18 +1,18 @@ -#id, #name, #hspace, #vspace, #class_name, #align { width: 100px } -.moodlebutton {font-size: 1.5em;font-weight:bold;padding: 3px;border:1px solid #ccc;text-decoration:none} -.moodlebutton:hover {background: #ccc} -#hspace, #vspace { width: 50px } -#flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode { width: 100px } -#flash_base, #flash_flashvars { width: 240px } -#width, #height { width: 40px } -#src, #media_type { width: 250px } -#class { width: 120px } -#prev {margin: 0; border: 1px solid black; width: 380px; height: 230px; overflow: hidden } -.panel_wrapper div.current { height: 390px; overflow: auto } -#flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options { display: none } -.mceAddSelectValue { background-color: #DDDDDD } -#qt_starttime, #qt_endtime, #qt_fov, #qt_href, #qt_moveid, #qt_moviename, #qt_node, #qt_pan, #qt_qtsrc, #qt_qtsrcchokespeed, #qt_target, #qt_tilt, #qt_urlsubstituten, #qt_volume { width: 70px } -#wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume { width: 70px } -#rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks { width: 70px } -#shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle { width: 90px } -#qt_qtsrc { width: 200px } +#id, #name, #hspace, #vspace, #class_name, #align { width: 100px } +.moodlebutton {font-size: 1.5em;font-weight:bold;padding: 3px;border:1px solid #ccc;text-decoration:none} +.moodlebutton:hover {background: #ccc} +#hspace, #vspace { width: 50px } +#flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode { width: 100px } +#flash_base, #flash_flashvars { width: 240px } +#width, #height { width: 40px } +#src, #media_type { width: 250px } +#class { width: 120px } +#prev {margin: 0; border: 1px solid black; width: 380px; height: 230px; overflow: hidden } +.panel_wrapper div.current { height: 390px; overflow: auto } +#flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options { display: none } +.mceAddSelectValue { background-color: #DDDDDD } +#qt_starttime, #qt_endtime, #qt_fov, #qt_href, #qt_moveid, #qt_moviename, #qt_node, #qt_pan, #qt_qtsrc, #qt_qtsrcchokespeed, #qt_target, #qt_tilt, #qt_urlsubstituten, #qt_volume { width: 70px } +#wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume { width: 70px } +#rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks { width: 70px } +#shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle { width: 90px } +#qt_qtsrc { width: 200px } diff --git a/lib/editor/tinymce/plugins/moodlenolink/editor_plugin_src.js b/lib/editor/tinymce/plugins/moodlenolink/editor_plugin_src.js index 902b4edc3e1..57546111c15 100644 --- a/lib/editor/tinymce/plugins/moodlenolink/editor_plugin_src.js +++ b/lib/editor/tinymce/plugins/moodlenolink/editor_plugin_src.js @@ -1,78 +1,78 @@ -/** - * $Id$ - */ - -(function() { - // Load plugin specific language pack - tinymce.PluginManager.requireLangPack('moodlenolink'); - - tinymce.create('tinymce.plugins.moodlenolinkPlugin', { - /** - * Initializes the plugin, this will be executed after the plugin has been created. - * This call is done before the editor instance has finished it's initialization so use the onInit event - * of the editor instance to intercept that event. - * - * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. - * @param {string} url Absolute URL to where the plugin is located. - */ - init : function(ed, url) { - // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mcemoodlenolink'); - ed.addCommand('mcemoodlenolink', function() { - var n, p; - - n = ed.selection.getNode(); - p = ed.dom.getParent(n, function(t) { - return ed.dom.getAttrib(t, 'class') == 'nolink'; - }); - - if (p) { - ed.dom.remove(p, true); - } else { - ed.selection.setContent('' + ed.selection.getContent() + ''); - } - - }); - - // Register moodlenolink button - ed.addButton('moodlenolink', { - title : 'moodlenolink.desc', - cmd : 'mcemoodlenolink', - image : url + '/img/ed_nolink.gif' - }); - - // Add a node change handler, selects the button in the UI when a image is selected - ed.onNodeChange.add(function(ed, cm, n) { - var p, c; - c = cm.get('moodlenolink'); - p = ed.dom.getParent(n, 'SPAN'); - - c.setActive(p && ed.dom.hasClass(p, 'nolink')); - - if (p && ed.dom.hasClass(p, 'nolink') || ed.selection.getContent()) { - c.setDisabled(false); - } else { - c.setDisabled(true); - } - }); - }, - - /** - * Returns information about the plugin as a name/value array. - * The current keys are longname, author, authorurl, infourl and version. - * - * @return {Object} Name/value array containing information about the plugin. - */ - getInfo : function() { - return { - longname : 'moodlenolink plugin', - author : 'Mathieu Petit-Clair', - authorurl : 'http://moodle.com/hq', - infourl : 'http://docs.moodle.org/en/TinyMCE', - version : "1.0" - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('moodlenolink', tinymce.plugins.moodlenolinkPlugin); -})(); +/** + * $Id$ + */ + +(function() { + // Load plugin specific language pack + tinymce.PluginManager.requireLangPack('moodlenolink'); + + tinymce.create('tinymce.plugins.moodlenolinkPlugin', { + /** + * Initializes the plugin, this will be executed after the plugin has been created. + * This call is done before the editor instance has finished it's initialization so use the onInit event + * of the editor instance to intercept that event. + * + * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. + * @param {string} url Absolute URL to where the plugin is located. + */ + init : function(ed, url) { + // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mcemoodlenolink'); + ed.addCommand('mcemoodlenolink', function() { + var n, p; + + n = ed.selection.getNode(); + p = ed.dom.getParent(n, function(t) { + return ed.dom.getAttrib(t, 'class') == 'nolink'; + }); + + if (p) { + ed.dom.remove(p, true); + } else { + ed.selection.setContent('' + ed.selection.getContent() + ''); + } + + }); + + // Register moodlenolink button + ed.addButton('moodlenolink', { + title : 'moodlenolink.desc', + cmd : 'mcemoodlenolink', + image : url + '/img/ed_nolink.gif' + }); + + // Add a node change handler, selects the button in the UI when a image is selected + ed.onNodeChange.add(function(ed, cm, n) { + var p, c; + c = cm.get('moodlenolink'); + p = ed.dom.getParent(n, 'SPAN'); + + c.setActive(p && ed.dom.hasClass(p, 'nolink')); + + if (p && ed.dom.hasClass(p, 'nolink') || ed.selection.getContent()) { + c.setDisabled(false); + } else { + c.setDisabled(true); + } + }); + }, + + /** + * Returns information about the plugin as a name/value array. + * The current keys are longname, author, authorurl, infourl and version. + * + * @return {Object} Name/value array containing information about the plugin. + */ + getInfo : function() { + return { + longname : 'moodlenolink plugin', + author : 'Mathieu Petit-Clair', + authorurl : 'http://moodle.com/hq', + infourl : 'http://docs.moodle.org/en/TinyMCE', + version : "1.0" + }; + } + }); + + // Register plugin + tinymce.PluginManager.add('moodlenolink', tinymce.plugins.moodlenolinkPlugin); +})(); diff --git a/lib/editor/tinymce/plugins/moodlenolink/langs/en.js b/lib/editor/tinymce/plugins/moodlenolink/langs/en.js index dd2167e71a7..33a0218cfed 100644 --- a/lib/editor/tinymce/plugins/moodlenolink/langs/en.js +++ b/lib/editor/tinymce/plugins/moodlenolink/langs/en.js @@ -1,3 +1,3 @@ -tinyMCE.addI18n('en.moodlenolink',{ - desc : 'Prevent automatic linking' -}); +tinyMCE.addI18n('en.moodlenolink',{ + desc : 'Prevent automatic linking' +}); diff --git a/lib/editor/tinymce/plugins/paste/js/pastetext.js b/lib/editor/tinymce/plugins/paste/js/pastetext.js index c524f9eb033..81b1d6a01e1 100644 --- a/lib/editor/tinymce/plugins/paste/js/pastetext.js +++ b/lib/editor/tinymce/plugins/paste/js/pastetext.js @@ -1,36 +1,36 @@ -tinyMCEPopup.requireLangPack(); - -var PasteTextDialog = { - init : function() { - this.resize(); - }, - - insert : function() { - var h = tinyMCEPopup.dom.encode(document.getElementById('content').value), lines; - - // Convert linebreaks into paragraphs - if (document.getElementById('linebreaks').checked) { - lines = h.split(/\r?\n/); - if (lines.length > 1) { - h = ''; - tinymce.each(lines, function(row) { - h += '

    ' + row + '

    '; - }); - } - } - - tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h}); - tinyMCEPopup.close(); - }, - - resize : function() { - var vp = tinyMCEPopup.dom.getViewPort(window), el; - - el = document.getElementById('content'); - - el.style.width = (vp.w - 20) + 'px'; - el.style.height = (vp.h - 90) + 'px'; - } -}; - -tinyMCEPopup.onInit.add(PasteTextDialog.init, PasteTextDialog); +tinyMCEPopup.requireLangPack(); + +var PasteTextDialog = { + init : function() { + this.resize(); + }, + + insert : function() { + var h = tinyMCEPopup.dom.encode(document.getElementById('content').value), lines; + + // Convert linebreaks into paragraphs + if (document.getElementById('linebreaks').checked) { + lines = h.split(/\r?\n/); + if (lines.length > 1) { + h = ''; + tinymce.each(lines, function(row) { + h += '

    ' + row + '

    '; + }); + } + } + + tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h}); + tinyMCEPopup.close(); + }, + + resize : function() { + var vp = tinyMCEPopup.dom.getViewPort(window), el; + + el = document.getElementById('content'); + + el.style.width = (vp.w - 20) + 'px'; + el.style.height = (vp.h - 90) + 'px'; + } +}; + +tinyMCEPopup.onInit.add(PasteTextDialog.init, PasteTextDialog); diff --git a/lib/editor/tinymce/plugins/paste/js/pasteword.js b/lib/editor/tinymce/plugins/paste/js/pasteword.js index a52731c368e..959bf3992d2 100644 --- a/lib/editor/tinymce/plugins/paste/js/pasteword.js +++ b/lib/editor/tinymce/plugins/paste/js/pasteword.js @@ -1,51 +1,51 @@ -tinyMCEPopup.requireLangPack(); - -var PasteWordDialog = { - init : function() { - var ed = tinyMCEPopup.editor, el = document.getElementById('iframecontainer'), ifr, doc, css, cssHTML = ''; - - // Create iframe - el.innerHTML = ''; - ifr = document.getElementById('iframe'); - doc = ifr.contentWindow.document; - - // Force absolute CSS urls - css = [ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css")]; - css = css.concat(tinymce.explode(ed.settings.content_css) || []); - tinymce.each(css, function(u) { - cssHTML += ''; - }); - - // Write content into iframe - doc.open(); - doc.write('' + cssHTML + ''); - doc.close(); - - doc.designMode = 'on'; - this.resize(); - - window.setTimeout(function() { - ifr.contentWindow.focus(); - }, 10); - }, - - insert : function() { - var h = document.getElementById('iframe').contentWindow.document.body.innerHTML; - - tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h, wordContent : true}); - tinyMCEPopup.close(); - }, - - resize : function() { - var vp = tinyMCEPopup.dom.getViewPort(window), el; - - el = document.getElementById('iframe'); - - if (el) { - el.style.width = (vp.w - 20) + 'px'; - el.style.height = (vp.h - 90) + 'px'; - } - } -}; - -tinyMCEPopup.onInit.add(PasteWordDialog.init, PasteWordDialog); +tinyMCEPopup.requireLangPack(); + +var PasteWordDialog = { + init : function() { + var ed = tinyMCEPopup.editor, el = document.getElementById('iframecontainer'), ifr, doc, css, cssHTML = ''; + + // Create iframe + el.innerHTML = ''; + ifr = document.getElementById('iframe'); + doc = ifr.contentWindow.document; + + // Force absolute CSS urls + css = [ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css")]; + css = css.concat(tinymce.explode(ed.settings.content_css) || []); + tinymce.each(css, function(u) { + cssHTML += ''; + }); + + // Write content into iframe + doc.open(); + doc.write('' + cssHTML + ''); + doc.close(); + + doc.designMode = 'on'; + this.resize(); + + window.setTimeout(function() { + ifr.contentWindow.focus(); + }, 10); + }, + + insert : function() { + var h = document.getElementById('iframe').contentWindow.document.body.innerHTML; + + tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h, wordContent : true}); + tinyMCEPopup.close(); + }, + + resize : function() { + var vp = tinyMCEPopup.dom.getViewPort(window), el; + + el = document.getElementById('iframe'); + + if (el) { + el.style.width = (vp.w - 20) + 'px'; + el.style.height = (vp.h - 90) + 'px'; + } + } +}; + +tinyMCEPopup.onInit.add(PasteWordDialog.init, PasteWordDialog); diff --git a/lib/editor/tinymce/plugins/paste/langs/en_dlg.js b/lib/editor/tinymce/plugins/paste/langs/en_dlg.js index eeac778960a..823eb16a754 100644 --- a/lib/editor/tinymce/plugins/paste/langs/en_dlg.js +++ b/lib/editor/tinymce/plugins/paste/langs/en_dlg.js @@ -1,5 +1,5 @@ -tinyMCE.addI18n('en.paste_dlg',{ -text_title:"Use CTRL+V on your keyboard to paste the text into the window.", -text_linebreaks:"Keep linebreaks", -word_title:"Use CTRL+V on your keyboard to paste the text into the window." +tinyMCE.addI18n('en.paste_dlg',{ +text_title:"Use CTRL+V on your keyboard to paste the text into the window.", +text_linebreaks:"Keep linebreaks", +word_title:"Use CTRL+V on your keyboard to paste the text into the window." }); \ No newline at end of file diff --git a/lib/editor/tinymce/plugins/paste/pastetext.htm b/lib/editor/tinymce/plugins/paste/pastetext.htm index 42c3d9c849f..0622e057c97 100644 --- a/lib/editor/tinymce/plugins/paste/pastetext.htm +++ b/lib/editor/tinymce/plugins/paste/pastetext.htm @@ -1,33 +1,33 @@ - - - {#paste.paste_text_desc} - - - - - -
    -
    {#paste.paste_text_desc}
    - -
    - -
    - -
    - -
    {#paste_dlg.text_title}
    - - - -
    -
    - -
    - -
    - -
    -
    -
    - + + + {#paste.paste_text_desc} + + + + + +
    +
    {#paste.paste_text_desc}
    + +
    + +
    + +
    + +
    {#paste_dlg.text_title}
    + + + +
    +
    + +
    + +
    + +
    +
    +
    + \ No newline at end of file diff --git a/lib/editor/tinymce/plugins/paste/pasteword.htm b/lib/editor/tinymce/plugins/paste/pasteword.htm index f4a9b3db3fa..e1871039dfb 100644 --- a/lib/editor/tinymce/plugins/paste/pasteword.htm +++ b/lib/editor/tinymce/plugins/paste/pasteword.htm @@ -1,27 +1,27 @@ - - - - {#paste.paste_word_desc} - - - - -
    -
    {#paste.paste_word_desc}
    - -
    {#paste_dlg.word_title}
    - -
    - -
    -
    - -
    - -
    - -
    -
    -
    - - + + + + {#paste.paste_word_desc} + + + + +
    +
    {#paste.paste_word_desc}
    + +
    {#paste_dlg.word_title}
    + +
    + +
    +
    + +
    + +
    + +
    +
    +
    + + diff --git a/lib/editor/tinymce/plugins/preview/example.html b/lib/editor/tinymce/plugins/preview/example.html index b2c3d90ce08..48202224dd4 100644 --- a/lib/editor/tinymce/plugins/preview/example.html +++ b/lib/editor/tinymce/plugins/preview/example.html @@ -1,28 +1,28 @@ - - - - - -Example of a custom preview page - - - -Editor contents:
    -
    - -
    - - - + + + + + +Example of a custom preview page + + + +Editor contents:
    +
    + +
    + + + diff --git a/lib/editor/tinymce/plugins/preview/jscripts/embed.js b/lib/editor/tinymce/plugins/preview/jscripts/embed.js index f8dc810527b..6fe25de090f 100644 --- a/lib/editor/tinymce/plugins/preview/jscripts/embed.js +++ b/lib/editor/tinymce/plugins/preview/jscripts/embed.js @@ -1,73 +1,73 @@ -/** - * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose. - */ - -function writeFlash(p) { - writeEmbed( - 'D27CDB6E-AE6D-11cf-96B8-444553540000', - 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', - 'application/x-shockwave-flash', - p - ); -} - -function writeShockWave(p) { - writeEmbed( - '166B1BCA-3F9C-11CF-8075-444553540000', - 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0', - 'application/x-director', - p - ); -} - -function writeQuickTime(p) { - writeEmbed( - '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B', - 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0', - 'video/quicktime', - p - ); -} - -function writeRealMedia(p) { - writeEmbed( - 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA', - 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', - 'audio/x-pn-realaudio-plugin', - p - ); -} - -function writeWindowsMedia(p) { - p.url = p.src; - writeEmbed( - '6BF52A52-394A-11D3-B153-00C04F79FAA6', - 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701', - 'application/x-mplayer2', - p - ); -} - -function writeEmbed(cls, cb, mt, p) { - var h = '', n; - - h += ''; - - h += ''; + + h += ' - - - - - -{#preview.preview_desc} - - - - - + + + + + + +{#preview.preview_desc} + + + + + diff --git a/lib/editor/tinymce/plugins/searchreplace/css/searchreplace.css b/lib/editor/tinymce/plugins/searchreplace/css/searchreplace.css index ecdf58c7b50..3e2eaf34b3e 100644 --- a/lib/editor/tinymce/plugins/searchreplace/css/searchreplace.css +++ b/lib/editor/tinymce/plugins/searchreplace/css/searchreplace.css @@ -1,6 +1,6 @@ -.panel_wrapper {height:85px;} -.panel_wrapper div.current {height:85px;} - -/* IE */ -* html .panel_wrapper {height:100px;} -* html .panel_wrapper div.current {height:100px;} +.panel_wrapper {height:85px;} +.panel_wrapper div.current {height:85px;} + +/* IE */ +* html .panel_wrapper {height:100px;} +* html .panel_wrapper div.current {height:100px;} diff --git a/lib/editor/tinymce/plugins/searchreplace/js/searchreplace.js b/lib/editor/tinymce/plugins/searchreplace/js/searchreplace.js index a8585cccce9..e555a3fc81f 100644 --- a/lib/editor/tinymce/plugins/searchreplace/js/searchreplace.js +++ b/lib/editor/tinymce/plugins/searchreplace/js/searchreplace.js @@ -1,126 +1,126 @@ -tinyMCEPopup.requireLangPack(); - -var SearchReplaceDialog = { - init : function(ed) { - var f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode"); - - this.switchMode(m); - - f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string"); - - // Focus input field - f[m + '_panel_searchstring'].focus(); - }, - - switchMode : function(m) { - var f, lm = this.lastMode; - - if (lm != m) { - f = document.forms[0]; - - if (lm) { - f[m + '_panel_searchstring'].value = f[lm + '_panel_searchstring'].value; - f[m + '_panel_backwardsu'].checked = f[lm + '_panel_backwardsu'].checked; - f[m + '_panel_backwardsd'].checked = f[lm + '_panel_backwardsd'].checked; - f[m + '_panel_casesensitivebox'].checked = f[lm + '_panel_casesensitivebox'].checked; - } - - mcTabs.displayTab(m + '_tab', m + '_panel'); - document.getElementById("replaceBtn").style.display = (m == "replace") ? "inline" : "none"; - document.getElementById("replaceAllBtn").style.display = (m == "replace") ? "inline" : "none"; - this.lastMode = m; - } - }, - - searchNext : function(a) { - var ed = tinyMCEPopup.editor, se = ed.selection, r = se.getRng(), f, m = this.lastMode, s, b, fl = 0, w = ed.getWin(), wm = ed.windowManager, fo = 0; - - // Get input - f = document.forms[0]; - s = f[m + '_panel_searchstring'].value; - b = f[m + '_panel_backwardsu'].checked; - ca = f[m + '_panel_casesensitivebox'].checked; - rs = f['replace_panel_replacestring'].value; - - if (s == '') - return; - - function fix() { - // Correct Firefox graphics glitches - r = se.getRng().cloneRange(); - ed.getDoc().execCommand('SelectAll', false, null); - se.setRng(r); - }; - - function replace() { - if (tinymce.isIE) - ed.selection.getRng().duplicate().pasteHTML(rs); // Needs to be duplicated due to selection bug in IE - else - ed.getDoc().execCommand('InsertHTML', false, rs); - }; - - // IE flags - if (ca) - fl = fl | 4; - - switch (a) { - case 'all': - // Move caret to beginning of text - ed.execCommand('SelectAll'); - ed.selection.collapse(true); - - if (tinymce.isIE) { - while (r.findText(s, b ? -1 : 1, fl)) { - r.scrollIntoView(); - r.select(); - replace(); - fo = 1; - } - - tinyMCEPopup.storeSelection(); - } else { - while (w.find(s, ca, b, false, false, false, false)) { - replace(); - fo = 1; - } - } - - if (fo) - tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.allreplaced')); - else - tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); - - return; - - case 'current': - if (!ed.selection.isCollapsed()) - replace(); - - break; - } - - se.collapse(b); - r = se.getRng(); - - // Whats the point - if (!s) - return; - - if (tinymce.isIE) { - if (r.findText(s, b ? -1 : 1, fl)) { - r.scrollIntoView(); - r.select(); - } else - tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); - - tinyMCEPopup.storeSelection(); - } else { - if (!w.find(s, ca, b, false, false, false, false)) - tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); - else - fix(); - } - } -}; - -tinyMCEPopup.onInit.add(SearchReplaceDialog.init, SearchReplaceDialog); +tinyMCEPopup.requireLangPack(); + +var SearchReplaceDialog = { + init : function(ed) { + var f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode"); + + this.switchMode(m); + + f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string"); + + // Focus input field + f[m + '_panel_searchstring'].focus(); + }, + + switchMode : function(m) { + var f, lm = this.lastMode; + + if (lm != m) { + f = document.forms[0]; + + if (lm) { + f[m + '_panel_searchstring'].value = f[lm + '_panel_searchstring'].value; + f[m + '_panel_backwardsu'].checked = f[lm + '_panel_backwardsu'].checked; + f[m + '_panel_backwardsd'].checked = f[lm + '_panel_backwardsd'].checked; + f[m + '_panel_casesensitivebox'].checked = f[lm + '_panel_casesensitivebox'].checked; + } + + mcTabs.displayTab(m + '_tab', m + '_panel'); + document.getElementById("replaceBtn").style.display = (m == "replace") ? "inline" : "none"; + document.getElementById("replaceAllBtn").style.display = (m == "replace") ? "inline" : "none"; + this.lastMode = m; + } + }, + + searchNext : function(a) { + var ed = tinyMCEPopup.editor, se = ed.selection, r = se.getRng(), f, m = this.lastMode, s, b, fl = 0, w = ed.getWin(), wm = ed.windowManager, fo = 0; + + // Get input + f = document.forms[0]; + s = f[m + '_panel_searchstring'].value; + b = f[m + '_panel_backwardsu'].checked; + ca = f[m + '_panel_casesensitivebox'].checked; + rs = f['replace_panel_replacestring'].value; + + if (s == '') + return; + + function fix() { + // Correct Firefox graphics glitches + r = se.getRng().cloneRange(); + ed.getDoc().execCommand('SelectAll', false, null); + se.setRng(r); + }; + + function replace() { + if (tinymce.isIE) + ed.selection.getRng().duplicate().pasteHTML(rs); // Needs to be duplicated due to selection bug in IE + else + ed.getDoc().execCommand('InsertHTML', false, rs); + }; + + // IE flags + if (ca) + fl = fl | 4; + + switch (a) { + case 'all': + // Move caret to beginning of text + ed.execCommand('SelectAll'); + ed.selection.collapse(true); + + if (tinymce.isIE) { + while (r.findText(s, b ? -1 : 1, fl)) { + r.scrollIntoView(); + r.select(); + replace(); + fo = 1; + } + + tinyMCEPopup.storeSelection(); + } else { + while (w.find(s, ca, b, false, false, false, false)) { + replace(); + fo = 1; + } + } + + if (fo) + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.allreplaced')); + else + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); + + return; + + case 'current': + if (!ed.selection.isCollapsed()) + replace(); + + break; + } + + se.collapse(b); + r = se.getRng(); + + // Whats the point + if (!s) + return; + + if (tinymce.isIE) { + if (r.findText(s, b ? -1 : 1, fl)) { + r.scrollIntoView(); + r.select(); + } else + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); + + tinyMCEPopup.storeSelection(); + } else { + if (!w.find(s, ca, b, false, false, false, false)) + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); + else + fix(); + } + } +}; + +tinyMCEPopup.onInit.add(SearchReplaceDialog.init, SearchReplaceDialog); diff --git a/lib/editor/tinymce/plugins/searchreplace/langs/en_dlg.js b/lib/editor/tinymce/plugins/searchreplace/langs/en_dlg.js index 370959afa3c..3dd3453dc99 100644 --- a/lib/editor/tinymce/plugins/searchreplace/langs/en_dlg.js +++ b/lib/editor/tinymce/plugins/searchreplace/langs/en_dlg.js @@ -1,16 +1,16 @@ -tinyMCE.addI18n('en.searchreplace_dlg',{ -searchnext_desc:"Find again", -notfound:"The search has been completed. The search string could not be found.", -search_title:"Find", -replace_title:"Find/Replace", -allreplaced:"All occurrences of the search string were replaced.", -findwhat:"Find what", -replacewith:"Replace with", -direction:"Direction", -up:"Up", -down:"Down", -mcase:"Match case", -findnext:"Find next", -replace:"Replace", -replaceall:"Replace all" +tinyMCE.addI18n('en.searchreplace_dlg',{ +searchnext_desc:"Find again", +notfound:"The search has been completed. The search string could not be found.", +search_title:"Find", +replace_title:"Find/Replace", +allreplaced:"All occurrences of the search string were replaced.", +findwhat:"Find what", +replacewith:"Replace with", +direction:"Direction", +up:"Up", +down:"Down", +mcase:"Match case", +findnext:"Find next", +replace:"Replace", +replaceall:"Replace all" }); \ No newline at end of file diff --git a/lib/editor/tinymce/plugins/searchreplace/searchreplace.htm b/lib/editor/tinymce/plugins/searchreplace/searchreplace.htm index 0b42486b6fc..1bd1aa64245 100644 --- a/lib/editor/tinymce/plugins/searchreplace/searchreplace.htm +++ b/lib/editor/tinymce/plugins/searchreplace/searchreplace.htm @@ -1,104 +1,104 @@ - - - - {#searchreplace_dlg.replace_title} - - - - - - - -
    - - -
    -
    - - - - - - - - - - - -
    - - - - - - - - -
    -
    - - - - - -
    -
    -
    - -
    - - - - - - - - - - - - - - - -
    - - - - - - - - -
    -
    - - - - - -
    -
    -
    - -
    - -
    -
    - - - -
    - -
    - -
    -
    -
    - - + + + + {#searchreplace_dlg.replace_title} + + + + + + + +
    + + +
    +
    + + + + + + + + + + + +
    + + + + + + + + +
    +
    + + + + + +
    +
    +
    + +
    + + + + + + + + + + + + + + + +
    + + + + + + + + +
    +
    + + + + + +
    +
    +
    + +
    + +
    +
    + + + +
    + +
    + +
    +
    +
    + + diff --git a/lib/editor/tinymce/plugins/spellchecker/changelog b/lib/editor/tinymce/plugins/spellchecker/changelog index c21f2f4a253..514a3f19921 100644 --- a/lib/editor/tinymce/plugins/spellchecker/changelog +++ b/lib/editor/tinymce/plugins/spellchecker/changelog @@ -1,20 +1,20 @@ -Version 2.0.2 (2008-04-30) - Added new EnchantSpell engine class contributed by Michel Weimerskirch. - Added new general.remote_rpc_url option, enables you to proxy requests to another server. - Fixed security hole in PSpellShell.php file if PSpellShell engine was used. -Version 2.0.1 (2008-03-07) - Fixed bug where spellchecker was auto focusing the editor in IE. -Version 2.0 (2008-01-30) - Fixed bug where the suggestions menu was placed at an incorrect location. -Version 2.0rc1 (2008-01-14) - Moved package from beta to release candidate. -Version 2.0b3 (2007-12-xx) - Fixed bug where the suggestions menu could appear at the wrong location. -Version 2.0b2 (2007-11-29) - Fixed bug where the spellchecker was removing the word when it was ignored. -Version 2.0b1 (2007-11-21) - Moved spellchecker from alpha to beta status. -Version 2.0a2 (2007-11-13) - Updated plugin so it works correctly with the TinyMCE 3.0a3 version. -Version 2.0a1 (2007-11-01) - Rewritten version for TinyMCE 3.0 this new version uses JSON RPC. +Version 2.0.2 (2008-04-30) + Added new EnchantSpell engine class contributed by Michel Weimerskirch. + Added new general.remote_rpc_url option, enables you to proxy requests to another server. + Fixed security hole in PSpellShell.php file if PSpellShell engine was used. +Version 2.0.1 (2008-03-07) + Fixed bug where spellchecker was auto focusing the editor in IE. +Version 2.0 (2008-01-30) + Fixed bug where the suggestions menu was placed at an incorrect location. +Version 2.0rc1 (2008-01-14) + Moved package from beta to release candidate. +Version 2.0b3 (2007-12-xx) + Fixed bug where the suggestions menu could appear at the wrong location. +Version 2.0b2 (2007-11-29) + Fixed bug where the spellchecker was removing the word when it was ignored. +Version 2.0b1 (2007-11-21) + Moved spellchecker from alpha to beta status. +Version 2.0a2 (2007-11-13) + Updated plugin so it works correctly with the TinyMCE 3.0a3 version. +Version 2.0a1 (2007-11-01) + Rewritten version for TinyMCE 3.0 this new version uses JSON RPC. diff --git a/lib/editor/tinymce/plugins/spellchecker/classes/EnchantSpell.php b/lib/editor/tinymce/plugins/spellchecker/classes/EnchantSpell.php index d37a030246a..f022e540842 100644 --- a/lib/editor/tinymce/plugins/spellchecker/classes/EnchantSpell.php +++ b/lib/editor/tinymce/plugins/spellchecker/classes/EnchantSpell.php @@ -1,66 +1,66 @@ -= 1.4.1 - * @param Array $words Array of words to check. - * @return Array of misspelled words. - */ - function &checkWords($lang, $words) { - $r = enchant_broker_init(); - - if (enchant_broker_dict_exists($r,$lang)) { - $d = enchant_broker_request_dict($r, $lang); - - $returnData = array(); - foreach($words as $key => $value) { - $correct = enchant_dict_check($d, $value); - if(!$correct) { - $returnData[] = trim($value); - } - } - - return $returnData; - enchant_broker_free_dict($d); - } else { - - } - enchant_broker_free($r); - } - - /** - * Returns suggestions for a specific word. - * - * @param String $lang Selected language code (like en_US or de_DE). Shortcodes like "en" and "de" work with enchant >= 1.4.1 - * @param String $word Specific word to get suggestions for. - * @return Array of suggestions for the specified word. - */ - function &getSuggestions($lang, $word) { - $r = enchant_broker_init(); - $suggs = array(); - - if (enchant_broker_dict_exists($r,$lang)) { - $d = enchant_broker_request_dict($r, $lang); - $suggs = enchant_dict_suggest($d, $word); - - enchant_broker_free_dict($d); - } else { - - } - enchant_broker_free($r); - - return $suggs; - } -} - -?> += 1.4.1 + * @param Array $words Array of words to check. + * @return Array of misspelled words. + */ + function &checkWords($lang, $words) { + $r = enchant_broker_init(); + + if (enchant_broker_dict_exists($r,$lang)) { + $d = enchant_broker_request_dict($r, $lang); + + $returnData = array(); + foreach($words as $key => $value) { + $correct = enchant_dict_check($d, $value); + if(!$correct) { + $returnData[] = trim($value); + } + } + + return $returnData; + enchant_broker_free_dict($d); + } else { + + } + enchant_broker_free($r); + } + + /** + * Returns suggestions for a specific word. + * + * @param String $lang Selected language code (like en_US or de_DE). Shortcodes like "en" and "de" work with enchant >= 1.4.1 + * @param String $word Specific word to get suggestions for. + * @return Array of suggestions for the specified word. + */ + function &getSuggestions($lang, $word) { + $r = enchant_broker_init(); + $suggs = array(); + + if (enchant_broker_dict_exists($r,$lang)) { + $d = enchant_broker_request_dict($r, $lang); + $suggs = enchant_dict_suggest($d, $word); + + enchant_broker_free_dict($d); + } else { + + } + enchant_broker_free($r); + + return $suggs; + } +} + +?> diff --git a/lib/editor/tinymce/plugins/spellchecker/classes/GoogleSpell.php b/lib/editor/tinymce/plugins/spellchecker/classes/GoogleSpell.php index 72ad776960b..a3931dd4ae6 100644 --- a/lib/editor/tinymce/plugins/spellchecker/classes/GoogleSpell.php +++ b/lib/editor/tinymce/plugins/spellchecker/classes/GoogleSpell.php @@ -1,158 +1,158 @@ -_getMatches($lang, $wordstr); - $words = array(); - - for ($i=0; $i_unhtmlentities(mb_substr($wordstr, $matches[$i][1], $matches[$i][2], "UTF-8")); - - return $words; - } - - /** - * Returns suggestions of for a specific word. - * - * @param {String} $lang Language code like sv or en. - * @param {String} $word Specific word to get suggestions for. - * @return {Array} Array of suggestions for the specified word. - */ - function &getSuggestions($lang, $word) { - $sug = array(); - $osug = array(); - $matches = $this->_getMatches($lang, $word); - - if (count($matches) > 0) - $sug = explode("\t", utf8_encode($this->_unhtmlentities($matches[0][4]))); - - // Remove empty - foreach ($sug as $item) { - if ($item) - $osug[] = $item; - } - - return $osug; - } - - function &_getMatches($lang, $str) { - $server = "www.google.com"; - $port = 443; - $path = "/tbproxy/spell?lang=" . $lang . "&hl=en"; - $host = "www.google.com"; - $url = "https://" . $server; - - // Setup XML request - $xml = '' . $str . ''; - - $header = "POST ".$path." HTTP/1.0 \r\n"; - $header .= "MIME-Version: 1.0 \r\n"; - $header .= "Content-type: application/PTI26 \r\n"; - $header .= "Content-length: ".strlen($xml)." \r\n"; - $header .= "Content-transfer-encoding: text \r\n"; - $header .= "Request-number: 1 \r\n"; - $header .= "Document-type: Request \r\n"; - $header .= "Interface-Version: Test 1.4 \r\n"; - $header .= "Connection: close \r\n\r\n"; - $header .= $xml; - - // Use curl if it exists - if (function_exists('curl_init')) { - // Use curl - $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL,$url); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $header); - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); - $xml = curl_exec($ch); - curl_close($ch); - } else { - // Use raw sockets - $fp = fsockopen("ssl://" . $server, $port, $errno, $errstr, 30); - if ($fp) { - // Send request - fwrite($fp, $header); - - // Read response - $xml = ""; - while (!feof($fp)) - $xml .= fgets($fp, 128); - - fclose($fp); - } else - echo "Could not open SSL connection to google."; - } - - // Grab and parse content - $matches = array(); - preg_match_all('/([^<]*)<\/c>/', $xml, $matches, PREG_SET_ORDER); - - return $matches; - } - - function _unhtmlentities($string) { - $string = preg_replace('~&#x([0-9a-f]+);~ei', 'chr(hexdec("\\1"))', $string); - $string = preg_replace('~&#([0-9]+);~e', 'chr(\\1)', $string); - - $trans_tbl = get_html_translation_table(HTML_ENTITIES); - $trans_tbl = array_flip($trans_tbl); - - return strtr($string, $trans_tbl); - } -} - -// Patch in multibyte support -if (!function_exists('mb_substr')) { - function mb_substr($str, $start, $len = '', $encoding="UTF-8"){ - $limit = strlen($str); - - for ($s = 0; $start > 0;--$start) {// found the real start - if ($s >= $limit) - break; - - if ($str[$s] <= "\x7F") - ++$s; - else { - ++$s; // skip length - - while ($str[$s] >= "\x80" && $str[$s] <= "\xBF") - ++$s; - } - } - - if ($len == '') - return substr($str, $s); - else - for ($e = $s; $len > 0; --$len) {//found the real end - if ($e >= $limit) - break; - - if ($str[$e] <= "\x7F") - ++$e; - else { - ++$e;//skip length - - while ($str[$e] >= "\x80" && $str[$e] <= "\xBF" && $e < $limit) - ++$e; - } - } - - return substr($str, $s, $e - $s); - } -} - -?> +_getMatches($lang, $wordstr); + $words = array(); + + for ($i=0; $i_unhtmlentities(mb_substr($wordstr, $matches[$i][1], $matches[$i][2], "UTF-8")); + + return $words; + } + + /** + * Returns suggestions of for a specific word. + * + * @param {String} $lang Language code like sv or en. + * @param {String} $word Specific word to get suggestions for. + * @return {Array} Array of suggestions for the specified word. + */ + function &getSuggestions($lang, $word) { + $sug = array(); + $osug = array(); + $matches = $this->_getMatches($lang, $word); + + if (count($matches) > 0) + $sug = explode("\t", utf8_encode($this->_unhtmlentities($matches[0][4]))); + + // Remove empty + foreach ($sug as $item) { + if ($item) + $osug[] = $item; + } + + return $osug; + } + + function &_getMatches($lang, $str) { + $server = "www.google.com"; + $port = 443; + $path = "/tbproxy/spell?lang=" . $lang . "&hl=en"; + $host = "www.google.com"; + $url = "https://" . $server; + + // Setup XML request + $xml = '' . $str . ''; + + $header = "POST ".$path." HTTP/1.0 \r\n"; + $header .= "MIME-Version: 1.0 \r\n"; + $header .= "Content-type: application/PTI26 \r\n"; + $header .= "Content-length: ".strlen($xml)." \r\n"; + $header .= "Content-transfer-encoding: text \r\n"; + $header .= "Request-number: 1 \r\n"; + $header .= "Document-type: Request \r\n"; + $header .= "Interface-Version: Test 1.4 \r\n"; + $header .= "Connection: close \r\n\r\n"; + $header .= $xml; + + // Use curl if it exists + if (function_exists('curl_init')) { + // Use curl + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL,$url); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $header); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); + $xml = curl_exec($ch); + curl_close($ch); + } else { + // Use raw sockets + $fp = fsockopen("ssl://" . $server, $port, $errno, $errstr, 30); + if ($fp) { + // Send request + fwrite($fp, $header); + + // Read response + $xml = ""; + while (!feof($fp)) + $xml .= fgets($fp, 128); + + fclose($fp); + } else + echo "Could not open SSL connection to google."; + } + + // Grab and parse content + $matches = array(); + preg_match_all('/([^<]*)<\/c>/', $xml, $matches, PREG_SET_ORDER); + + return $matches; + } + + function _unhtmlentities($string) { + $string = preg_replace('~&#x([0-9a-f]+);~ei', 'chr(hexdec("\\1"))', $string); + $string = preg_replace('~&#([0-9]+);~e', 'chr(\\1)', $string); + + $trans_tbl = get_html_translation_table(HTML_ENTITIES); + $trans_tbl = array_flip($trans_tbl); + + return strtr($string, $trans_tbl); + } +} + +// Patch in multibyte support +if (!function_exists('mb_substr')) { + function mb_substr($str, $start, $len = '', $encoding="UTF-8"){ + $limit = strlen($str); + + for ($s = 0; $start > 0;--$start) {// found the real start + if ($s >= $limit) + break; + + if ($str[$s] <= "\x7F") + ++$s; + else { + ++$s; // skip length + + while ($str[$s] >= "\x80" && $str[$s] <= "\xBF") + ++$s; + } + } + + if ($len == '') + return substr($str, $s); + else + for ($e = $s; $len > 0; --$len) {//found the real end + if ($e >= $limit) + break; + + if ($str[$e] <= "\x7F") + ++$e; + else { + ++$e;//skip length + + while ($str[$e] >= "\x80" && $str[$e] <= "\xBF" && $e < $limit) + ++$e; + } + } + + return substr($str, $s, $e - $s); + } +} + +?> diff --git a/lib/editor/tinymce/plugins/spellchecker/classes/PSpell.php b/lib/editor/tinymce/plugins/spellchecker/classes/PSpell.php index 25123785b29..5081be10d3f 100644 --- a/lib/editor/tinymce/plugins/spellchecker/classes/PSpell.php +++ b/lib/editor/tinymce/plugins/spellchecker/classes/PSpell.php @@ -1,81 +1,81 @@ -_getPLink($lang); - - $outWords = array(); - foreach ($words as $word) { - if (!pspell_check($plink, trim($word))) - $outWords[] = utf8_encode($word); - } - - return $outWords; - } - - /** - * Returns suggestions of for a specific word. - * - * @param {String} $lang Language code like sv or en. - * @param {String} $word Specific word to get suggestions for. - * @return {Array} Array of suggestions for the specified word. - */ - function &getSuggestions($lang, $word) { - $words = pspell_suggest($this->_getPLink($lang), $word); - - for ($i=0; $ithrowError("PSpell support not found in PHP installation."); - - // Setup PSpell link - $plink = pspell_new( - $lang, - $this->_config['PSpell.spelling'], - $this->_config['PSpell.jargon'], - $this->_config['PSpell.encoding'], - $this->_config['PSpell.mode'] - ); - - // Setup PSpell link -/* if (!$plink) { - $pspellConfig = pspell_config_create( - $lang, - $this->_config['PSpell.spelling'], - $this->_config['PSpell.jargon'], - $this->_config['PSpell.encoding'] - ); - - $plink = pspell_new_config($pspell_config); - }*/ - - if (!$plink) - $this->throwError("No PSpell link found opened."); - - return $plink; - } -} - -?> +_getPLink($lang); + + $outWords = array(); + foreach ($words as $word) { + if (!pspell_check($plink, trim($word))) + $outWords[] = utf8_encode($word); + } + + return $outWords; + } + + /** + * Returns suggestions of for a specific word. + * + * @param {String} $lang Language code like sv or en. + * @param {String} $word Specific word to get suggestions for. + * @return {Array} Array of suggestions for the specified word. + */ + function &getSuggestions($lang, $word) { + $words = pspell_suggest($this->_getPLink($lang), $word); + + for ($i=0; $ithrowError("PSpell support not found in PHP installation."); + + // Setup PSpell link + $plink = pspell_new( + $lang, + $this->_config['PSpell.spelling'], + $this->_config['PSpell.jargon'], + $this->_config['PSpell.encoding'], + $this->_config['PSpell.mode'] + ); + + // Setup PSpell link +/* if (!$plink) { + $pspellConfig = pspell_config_create( + $lang, + $this->_config['PSpell.spelling'], + $this->_config['PSpell.jargon'], + $this->_config['PSpell.encoding'] + ); + + $plink = pspell_new_config($pspell_config); + }*/ + + if (!$plink) + $this->throwError("No PSpell link found opened."); + + return $plink; + } +} + +?> diff --git a/lib/editor/tinymce/plugins/spellchecker/classes/PSpellShell.php b/lib/editor/tinymce/plugins/spellchecker/classes/PSpellShell.php index 1b1569b4655..349ab29e84f 100644 --- a/lib/editor/tinymce/plugins/spellchecker/classes/PSpellShell.php +++ b/lib/editor/tinymce/plugins/spellchecker/classes/PSpellShell.php @@ -1,112 +1,112 @@ -_getCMD($lang); - - if ($fh = fopen($this->_tmpfile, "w")) { - fwrite($fh, "!\n"); - - foreach($words as $key => $value) - fwrite($fh, "^" . $value . "\n"); - - fclose($fh); - } else - $this->throwError("PSpell support was not found."); - - $data = shell_exec($cmd); - @unlink($this->_tmpfile); - - $returnData = array(); - $dataArr = preg_split("/[\r\n]/", $data, -1, PREG_SPLIT_NO_EMPTY); - - foreach ($dataArr as $dstr) { - $matches = array(); - - // Skip this line. - if (strpos($dstr, "@") === 0) - continue; - - preg_match("/\& ([^ ]+) .*/i", $dstr, $matches); - - if (!empty($matches[1])) - $returnData[] = utf8_encode(trim($matches[1])); - } - - return $returnData; - } - - /** - * Returns suggestions of for a specific word. - * - * @param {String} $lang Language code like sv or en. - * @param {String} $word Specific word to get suggestions for. - * @return {Array} Array of suggestions for the specified word. - */ - function &getSuggestions($lang, $word) { - $cmd = $this->_getCMD($lang); - - if (function_exists("mb_convert_encoding")) - $word = mb_convert_encoding($word, "ISO-8859-1", mb_detect_encoding($word, "UTF-8")); - else - $word = utf8_encode($word); - - if ($fh = fopen($this->_tmpfile, "w")) { - fwrite($fh, "!\n"); - fwrite($fh, "^$word\n"); - fclose($fh); - } else - $this->throwError("Error opening tmp file."); - - $data = shell_exec($cmd); - @unlink($this->_tmpfile); - - $returnData = array(); - $dataArr = preg_split("/\n/", $data, -1, PREG_SPLIT_NO_EMPTY); - - foreach($dataArr as $dstr) { - $matches = array(); - - // Skip this line. - if (strpos($dstr, "@") === 0) - continue; - - preg_match("/\&[^:]+:(.*)/i", $dstr, $matches); - - if (!empty($matches[1])) { - $words = array_slice(explode(',', $matches[1]), 0, 10); - - for ($i=0; $i_tmpfile = tempnam($this->_config['PSpellShell.tmp'], "tinyspell"); - - if(preg_match("#win#i", php_uname())) - return $this->_config['PSpellShell.aspell'] . " -a --lang=". escapeshellarg($lang) . " --encoding=utf-8 -H < " . $this->_tmpfile . " 2>&1"; - - return "cat ". $this->_tmpfile ." | " . $this->_config['PSpellShell.aspell'] . " -a --encoding=utf-8 -H --lang=". escapeshellarg($lang); - } -} - -?> +_getCMD($lang); + + if ($fh = fopen($this->_tmpfile, "w")) { + fwrite($fh, "!\n"); + + foreach($words as $key => $value) + fwrite($fh, "^" . $value . "\n"); + + fclose($fh); + } else + $this->throwError("PSpell support was not found."); + + $data = shell_exec($cmd); + @unlink($this->_tmpfile); + + $returnData = array(); + $dataArr = preg_split("/[\r\n]/", $data, -1, PREG_SPLIT_NO_EMPTY); + + foreach ($dataArr as $dstr) { + $matches = array(); + + // Skip this line. + if (strpos($dstr, "@") === 0) + continue; + + preg_match("/\& ([^ ]+) .*/i", $dstr, $matches); + + if (!empty($matches[1])) + $returnData[] = utf8_encode(trim($matches[1])); + } + + return $returnData; + } + + /** + * Returns suggestions of for a specific word. + * + * @param {String} $lang Language code like sv or en. + * @param {String} $word Specific word to get suggestions for. + * @return {Array} Array of suggestions for the specified word. + */ + function &getSuggestions($lang, $word) { + $cmd = $this->_getCMD($lang); + + if (function_exists("mb_convert_encoding")) + $word = mb_convert_encoding($word, "ISO-8859-1", mb_detect_encoding($word, "UTF-8")); + else + $word = utf8_encode($word); + + if ($fh = fopen($this->_tmpfile, "w")) { + fwrite($fh, "!\n"); + fwrite($fh, "^$word\n"); + fclose($fh); + } else + $this->throwError("Error opening tmp file."); + + $data = shell_exec($cmd); + @unlink($this->_tmpfile); + + $returnData = array(); + $dataArr = preg_split("/\n/", $data, -1, PREG_SPLIT_NO_EMPTY); + + foreach($dataArr as $dstr) { + $matches = array(); + + // Skip this line. + if (strpos($dstr, "@") === 0) + continue; + + preg_match("/\&[^:]+:(.*)/i", $dstr, $matches); + + if (!empty($matches[1])) { + $words = array_slice(explode(',', $matches[1]), 0, 10); + + for ($i=0; $i_tmpfile = tempnam($this->_config['PSpellShell.tmp'], "tinyspell"); + + if(preg_match("#win#i", php_uname())) + return $this->_config['PSpellShell.aspell'] . " -a --lang=". escapeshellarg($lang) . " --encoding=utf-8 -H < " . $this->_tmpfile . " 2>&1"; + + return "cat ". $this->_tmpfile ." | " . $this->_config['PSpellShell.aspell'] . " -a --encoding=utf-8 -H --lang=". escapeshellarg($lang); + } +} + +?> diff --git a/lib/editor/tinymce/plugins/spellchecker/classes/SpellChecker.php b/lib/editor/tinymce/plugins/spellchecker/classes/SpellChecker.php index e4cf9cb9e9b..bba6e29ad60 100644 --- a/lib/editor/tinymce/plugins/spellchecker/classes/SpellChecker.php +++ b/lib/editor/tinymce/plugins/spellchecker/classes/SpellChecker.php @@ -1,61 +1,61 @@ -_config = $config; - } - - /** - * Simple loopback function everything that gets in will be send back. - * - * @param $args.. Arguments. - * @return {Array} Array of all input arguments. - */ - function &loopback(/* args.. */) { - return func_get_args(); - } - - /** - * Spellchecks an array of words. - * - * @param {String} $lang Language code like sv or en. - * @param {Array} $words Array of words to spellcheck. - * @return {Array} Array of misspelled words. - */ - function &checkWords($lang, $words) { - return $words; - } - - /** - * Returns suggestions of for a specific word. - * - * @param {String} $lang Language code like sv or en. - * @param {String} $word Specific word to get suggestions for. - * @return {Array} Array of suggestions for the specified word. - */ - function &getSuggestions($lang, $word) { - return array(); - } - - /** - * Throws an error message back to the user. This will stop all execution. - * - * @param {String} $str Message to send back to user. - */ - function throwError($str) { - die('{"result":null,"id":null,"error":{"errstr":"' . addslashes($str) . '","errfile":"","errline":null,"errcontext":"","level":"FATAL"}}'); - } -} - -?> +_config = $config; + } + + /** + * Simple loopback function everything that gets in will be send back. + * + * @param $args.. Arguments. + * @return {Array} Array of all input arguments. + */ + function &loopback(/* args.. */) { + return func_get_args(); + } + + /** + * Spellchecks an array of words. + * + * @param {String} $lang Language code like sv or en. + * @param {Array} $words Array of words to spellcheck. + * @return {Array} Array of misspelled words. + */ + function &checkWords($lang, $words) { + return $words; + } + + /** + * Returns suggestions of for a specific word. + * + * @param {String} $lang Language code like sv or en. + * @param {String} $word Specific word to get suggestions for. + * @return {Array} Array of suggestions for the specified word. + */ + function &getSuggestions($lang, $word) { + return array(); + } + + /** + * Throws an error message back to the user. This will stop all execution. + * + * @param {String} $str Message to send back to user. + */ + function throwError($str) { + die('{"result":null,"id":null,"error":{"errstr":"' . addslashes($str) . '","errfile":"","errline":null,"errcontext":"","level":"FATAL"}}'); + } +} + +?> diff --git a/lib/editor/tinymce/plugins/spellchecker/classes/utils/Logger.php b/lib/editor/tinymce/plugins/spellchecker/classes/utils/Logger.php index 46a1c155901..6448e4e1516 100644 --- a/lib/editor/tinymce/plugins/spellchecker/classes/utils/Logger.php +++ b/lib/editor/tinymce/plugins/spellchecker/classes/utils/Logger.php @@ -1,268 +1,268 @@ -_path = ""; - $this->_filename = "{level}.log"; - $this->setMaxSize("100k"); - $this->_maxFiles = 10; - $this->_level = MC_LOGGER_DEBUG; - $this->_format = "[{time}] [{level}] {message}"; - } - - /** - * Sets the current log level, use the MC_LOGGER constants. - * - * @param int $level Log level instance for example MC_LOGGER_DEBUG. - */ - function setLevel($level) { - if (is_string($level)) { - switch (strtolower($level)) { - case "debug": - $level = MC_LOGGER_DEBUG; - break; - - case "info": - $level = MC_LOGGER_INFO; - break; - - case "warn": - case "warning": - $level = MC_LOGGER_WARN; - break; - - case "error": - $level = MC_LOGGER_ERROR; - break; - - case "fatal": - $level = MC_LOGGER_FATAL; - break; - - default: - $level = MC_LOGGER_FATAL; - } - } - - $this->_level = $level; - } - - /** - * Returns the current log level for example MC_LOGGER_DEBUG. - * - * @return int Current log level for example MC_LOGGER_DEBUG. - */ - function getLevel() { - return $this->_level; - } - - function setPath($path) { - $this->_path = $path; - } - - function getPath() { - return $this->_path; - } - - function setFileName($file_name) { - $this->_filename = $file_name; - } - - function getFileName() { - return $this->_filename; - } - - function setFormat($format) { - $this->_format = $format; - } - - function getFormat() { - return $this->_format; - } - - function setMaxSize($size) { - // Fix log max size - $logMaxSizeBytes = intval(preg_replace("/[^0-9]/", "", $size)); - - // Is KB - if (strpos((strtolower($size)), "k") > 0) - $logMaxSizeBytes *= 1024; - - // Is MB - if (strpos((strtolower($size)), "m") > 0) - $logMaxSizeBytes *= (1024 * 1024); - - $this->_maxSizeBytes = $logMaxSizeBytes; - $this->_maxSize = $size; - } - - function getMaxSize() { - return $this->_maxSize; - } - - function setMaxFiles($max_files) { - $this->_maxFiles = $max_files; - } - - function getMaxFiles() { - return $this->_maxFiles; - } - - function debug($msg) { - $args = func_get_args(); - $this->_logMsg(MC_LOGGER_DEBUG, implode(', ', $args)); - } - - function info($msg) { - $args = func_get_args(); - $this->_logMsg(MC_LOGGER_INFO, implode(', ', $args)); - } - - function warn($msg) { - $args = func_get_args(); - $this->_logMsg(MC_LOGGER_WARN, implode(', ', $args)); - } - - function error($msg) { - $args = func_get_args(); - $this->_logMsg(MC_LOGGER_ERROR, implode(', ', $args)); - } - - function fatal($msg) { - $args = func_get_args(); - $this->_logMsg(MC_LOGGER_FATAL, implode(', ', $args)); - } - - function isDebugEnabled() { - return $this->_level >= MC_LOGGER_DEBUG; - } - - function isInfoEnabled() { - return $this->_level >= MC_LOGGER_INFO; - } - - function isWarnEnabled() { - return $this->_level >= MC_LOGGER_WARN; - } - - function isErrorEnabled() { - return $this->_level >= MC_LOGGER_ERROR; - } - - function isFatalEnabled() { - return $this->_level >= MC_LOGGER_FATAL; - } - - function _logMsg($level, $message) { - $roll = false; - - if ($level < $this->_level) - return; - - $logFile = $this->toOSPath($this->_path . "/" . $this->_filename); - - switch ($level) { - case MC_LOGGER_DEBUG: - $levelName = "DEBUG"; - break; - - case MC_LOGGER_INFO: - $levelName = "INFO"; - break; - - case MC_LOGGER_WARN: - $levelName = "WARN"; - break; - - case MC_LOGGER_ERROR: - $levelName = "ERROR"; - break; - - case MC_LOGGER_FATAL: - $levelName = "FATAL"; - break; - } - - $logFile = str_replace('{level}', strtolower($levelName), $logFile); - - $text = $this->_format; - $text = str_replace('{time}', date("Y-m-d H:i:s"), $text); - $text = str_replace('{level}', strtolower($levelName), $text); - $text = str_replace('{message}', $message, $text); - $message = $text . "\r\n"; - - // Check filesize - if (file_exists($logFile)) { - $size = @filesize($logFile); - - if ($size + strlen($message) > $this->_maxSizeBytes) - $roll = true; - } - - // Roll if the size is right - if ($roll) { - for ($i=$this->_maxFiles-1; $i>=1; $i--) { - $rfile = $this->toOSPath($logFile . "." . $i); - $nfile = $this->toOSPath($logFile . "." . ($i+1)); - - if (@file_exists($rfile)) - @rename($rfile, $nfile); - } - - @rename($logFile, $this->toOSPath($logFile . ".1")); - - // Delete last logfile - $delfile = $this->toOSPath($logFile . "." . ($this->_maxFiles + 1)); - if (@file_exists($delfile)) - @unlink($delfile); - } - - // Append log line - if (($fp = @fopen($logFile, "a")) != null) { - @fputs($fp, $message); - @fflush($fp); - @fclose($fp); - } - } - - /** - * Converts a Unix path to OS specific path. - * - * @param String $path Unix path to convert. - */ - function toOSPath($path) { - return str_replace("/", DIRECTORY_SEPARATOR, $path); - } -} - +_path = ""; + $this->_filename = "{level}.log"; + $this->setMaxSize("100k"); + $this->_maxFiles = 10; + $this->_level = MC_LOGGER_DEBUG; + $this->_format = "[{time}] [{level}] {message}"; + } + + /** + * Sets the current log level, use the MC_LOGGER constants. + * + * @param int $level Log level instance for example MC_LOGGER_DEBUG. + */ + function setLevel($level) { + if (is_string($level)) { + switch (strtolower($level)) { + case "debug": + $level = MC_LOGGER_DEBUG; + break; + + case "info": + $level = MC_LOGGER_INFO; + break; + + case "warn": + case "warning": + $level = MC_LOGGER_WARN; + break; + + case "error": + $level = MC_LOGGER_ERROR; + break; + + case "fatal": + $level = MC_LOGGER_FATAL; + break; + + default: + $level = MC_LOGGER_FATAL; + } + } + + $this->_level = $level; + } + + /** + * Returns the current log level for example MC_LOGGER_DEBUG. + * + * @return int Current log level for example MC_LOGGER_DEBUG. + */ + function getLevel() { + return $this->_level; + } + + function setPath($path) { + $this->_path = $path; + } + + function getPath() { + return $this->_path; + } + + function setFileName($file_name) { + $this->_filename = $file_name; + } + + function getFileName() { + return $this->_filename; + } + + function setFormat($format) { + $this->_format = $format; + } + + function getFormat() { + return $this->_format; + } + + function setMaxSize($size) { + // Fix log max size + $logMaxSizeBytes = intval(preg_replace("/[^0-9]/", "", $size)); + + // Is KB + if (strpos((strtolower($size)), "k") > 0) + $logMaxSizeBytes *= 1024; + + // Is MB + if (strpos((strtolower($size)), "m") > 0) + $logMaxSizeBytes *= (1024 * 1024); + + $this->_maxSizeBytes = $logMaxSizeBytes; + $this->_maxSize = $size; + } + + function getMaxSize() { + return $this->_maxSize; + } + + function setMaxFiles($max_files) { + $this->_maxFiles = $max_files; + } + + function getMaxFiles() { + return $this->_maxFiles; + } + + function debug($msg) { + $args = func_get_args(); + $this->_logMsg(MC_LOGGER_DEBUG, implode(', ', $args)); + } + + function info($msg) { + $args = func_get_args(); + $this->_logMsg(MC_LOGGER_INFO, implode(', ', $args)); + } + + function warn($msg) { + $args = func_get_args(); + $this->_logMsg(MC_LOGGER_WARN, implode(', ', $args)); + } + + function error($msg) { + $args = func_get_args(); + $this->_logMsg(MC_LOGGER_ERROR, implode(', ', $args)); + } + + function fatal($msg) { + $args = func_get_args(); + $this->_logMsg(MC_LOGGER_FATAL, implode(', ', $args)); + } + + function isDebugEnabled() { + return $this->_level >= MC_LOGGER_DEBUG; + } + + function isInfoEnabled() { + return $this->_level >= MC_LOGGER_INFO; + } + + function isWarnEnabled() { + return $this->_level >= MC_LOGGER_WARN; + } + + function isErrorEnabled() { + return $this->_level >= MC_LOGGER_ERROR; + } + + function isFatalEnabled() { + return $this->_level >= MC_LOGGER_FATAL; + } + + function _logMsg($level, $message) { + $roll = false; + + if ($level < $this->_level) + return; + + $logFile = $this->toOSPath($this->_path . "/" . $this->_filename); + + switch ($level) { + case MC_LOGGER_DEBUG: + $levelName = "DEBUG"; + break; + + case MC_LOGGER_INFO: + $levelName = "INFO"; + break; + + case MC_LOGGER_WARN: + $levelName = "WARN"; + break; + + case MC_LOGGER_ERROR: + $levelName = "ERROR"; + break; + + case MC_LOGGER_FATAL: + $levelName = "FATAL"; + break; + } + + $logFile = str_replace('{level}', strtolower($levelName), $logFile); + + $text = $this->_format; + $text = str_replace('{time}', date("Y-m-d H:i:s"), $text); + $text = str_replace('{level}', strtolower($levelName), $text); + $text = str_replace('{message}', $message, $text); + $message = $text . "\r\n"; + + // Check filesize + if (file_exists($logFile)) { + $size = @filesize($logFile); + + if ($size + strlen($message) > $this->_maxSizeBytes) + $roll = true; + } + + // Roll if the size is right + if ($roll) { + for ($i=$this->_maxFiles-1; $i>=1; $i--) { + $rfile = $this->toOSPath($logFile . "." . $i); + $nfile = $this->toOSPath($logFile . "." . ($i+1)); + + if (@file_exists($rfile)) + @rename($rfile, $nfile); + } + + @rename($logFile, $this->toOSPath($logFile . ".1")); + + // Delete last logfile + $delfile = $this->toOSPath($logFile . "." . ($this->_maxFiles + 1)); + if (@file_exists($delfile)) + @unlink($delfile); + } + + // Append log line + if (($fp = @fopen($logFile, "a")) != null) { + @fputs($fp, $message); + @fflush($fp); + @fclose($fp); + } + } + + /** + * Converts a Unix path to OS specific path. + * + * @param String $path Unix path to convert. + */ + function toOSPath($path) { + return str_replace("/", DIRECTORY_SEPARATOR, $path); + } +} + ?> \ No newline at end of file diff --git a/lib/editor/tinymce/plugins/spellchecker/config.php b/lib/editor/tinymce/plugins/spellchecker/config.php index 7ad678f774e..dcae9d6d47c 100644 --- a/lib/editor/tinymce/plugins/spellchecker/config.php +++ b/lib/editor/tinymce/plugins/spellchecker/config.php @@ -1,22 +1,22 @@ -aspellpath; -$config['PSpellShell.tmp'] = '/tmp'; - -// Windows PSpellShell settings -$config['PSpellShell.aspell'] = $CFG->aspellpath; -//$config['PSpellShell.tmp'] = 'c:/temp'; -?> +aspellpath; +$config['PSpellShell.tmp'] = '/tmp'; + +// Windows PSpellShell settings +$config['PSpellShell.aspell'] = $CFG->aspellpath; +//$config['PSpellShell.tmp'] = 'c:/temp'; +?> diff --git a/lib/editor/tinymce/plugins/spellchecker/css/content.css b/lib/editor/tinymce/plugins/spellchecker/css/content.css index 24efa02170c..656ce1eee60 100644 --- a/lib/editor/tinymce/plugins/spellchecker/css/content.css +++ b/lib/editor/tinymce/plugins/spellchecker/css/content.css @@ -1 +1 @@ -.mceItemHiddenSpellWord {background:url(../img/wline.gif) repeat-x bottom left; cursor:default;} +.mceItemHiddenSpellWord {background:url(../img/wline.gif) repeat-x bottom left; cursor:default;} diff --git a/lib/editor/tinymce/plugins/spellchecker/editor_plugin_src.js b/lib/editor/tinymce/plugins/spellchecker/editor_plugin_src.js index 24db2fdeb8d..42b12a03a0f 100644 --- a/lib/editor/tinymce/plugins/spellchecker/editor_plugin_src.js +++ b/lib/editor/tinymce/plugins/spellchecker/editor_plugin_src.js @@ -1,338 +1,338 @@ -/** - * $Id$ - * - * @author Moxiecode - * @copyright Copyright 2004-2008, Moxiecode Systems AB, All rights reserved. - */ - -(function() { - var JSONRequest = tinymce.util.JSONRequest, each = tinymce.each, DOM = tinymce.DOM; - - tinymce.create('tinymce.plugins.SpellcheckerPlugin', { - getInfo : function() { - return { - longname : 'Spellchecker', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker', - version : "2.0.2" - }; - }, - - init : function(ed, url) { - var t = this, cm; - - t.url = url; - t.editor = ed; - - // Register commands - ed.addCommand('mceSpellCheck', function() { - if (!t.active) { - ed.setProgressState(1); - t._sendRPC('checkWords', [t.selectedLang, t._getWords()], function(r) { - if (r.length > 0) { - t.active = 1; - t._markWords(r); - ed.setProgressState(0); - ed.nodeChanged(); - } else { - ed.setProgressState(0); - ed.windowManager.alert('spellchecker.no_mpell'); - } - }); - } else - t._done(); - }); - - ed.onInit.add(function() { - if (ed.settings.content_css !== false) - ed.dom.loadCSS(url + '/css/content.css'); - }); - - ed.onClick.add(t._showMenu, t); - ed.onContextMenu.add(t._showMenu, t); - ed.onBeforeGetContent.add(function() { - if (t.active) - t._removeWords(); - }); - - ed.onNodeChange.add(function(ed, cm) { - cm.setActive('spellchecker', t.active); - }); - - ed.onSetContent.add(function() { - t._done(); - }); - - ed.onBeforeGetContent.add(function() { - t._done(); - }); - - ed.onBeforeExecCommand.add(function(ed, cmd) { - if (cmd == 'mceFullScreen') - t._done(); - }); - - // Find selected language - t.languages = {}; - each(ed.getParam('spellchecker_languages', '+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv', 'hash'), function(v, k) { - if (k.indexOf('+') === 0) { - k = k.substring(1); - t.selectedLang = v; - } - - t.languages[k] = v; - }); - }, - - createControl : function(n, cm) { - var t = this, c, ed = t.editor; - - if (n == 'spellchecker') { - c = cm.createSplitButton(n, {title : 'spellchecker.desc', cmd : 'mceSpellCheck', scope : t}); - - c.onRenderMenu.add(function(c, m) { - m.add({title : 'spellchecker.langs', 'class' : 'mceMenuItemTitle'}).setDisabled(1); - each(t.languages, function(v, k) { - var o = {icon : 1}, mi; - - o.onclick = function() { - mi.setSelected(1); - t.selectedItem.setSelected(0); - t.selectedItem = mi; - t.selectedLang = v; - }; - - o.title = k; - mi = m.add(o); - mi.setSelected(v == t.selectedLang); - - if (v == t.selectedLang) - t.selectedItem = mi; - }) - }); - - return c; - } - }, - - // Internal functions - - _walk : function(n, f) { - var d = this.editor.getDoc(), w; - - if (d.createTreeWalker) { - w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false); - - while ((n = w.nextNode()) != null) - f.call(this, n); - } else - tinymce.walk(n, f, 'childNodes'); - }, - - _getSeparators : function() { - var re = '', i, str = this.editor.getParam('spellchecker_word_separator_chars', '\\s!"#$%&()*+,-./:;<=>?@[\]^_{|}\u201d\u201c'); - - // Build word separator regexp - for (i=0; i$1$2'); - v = v.replace(r3, '$1$2'); - - dom.replace(dom.create('span', {'class' : 'mceItemHidden'}, v), n); - } - } - }); - - se.moveToBookmark(b); - }, - - _showMenu : function(ed, e) { - var t = this, ed = t.editor, m = t._menu, p1, dom = ed.dom, vp = dom.getViewPort(ed.getWin()); - - if (!m) { - p1 = DOM.getPos(ed.getContentAreaContainer()); - //p2 = DOM.getPos(ed.getContainer()); - - m = ed.controlManager.createDropMenu('spellcheckermenu', { - offset_x : p1.x, - offset_y : p1.y, - 'class' : 'mceNoIcons' - }); - - t._menu = m; - } - - if (dom.hasClass(e.target, 'mceItemHiddenSpellWord')) { - m.removeAll(); - m.add({title : 'spellchecker.wait', 'class' : 'mceMenuItemTitle'}).setDisabled(1); - - t._sendRPC('getSuggestions', [t.selectedLang, dom.decode(e.target.innerHTML)], function(r) { - m.removeAll(); - - if (r.length > 0) { - m.add({title : 'spellchecker.sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1); - each(r, function(v) { - m.add({title : v, onclick : function() { - dom.replace(ed.getDoc().createTextNode(v), e.target); - t._checkDone(); - }}); - }); - - m.addSeparator(); - } else - m.add({title : 'spellchecker.no_sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1); - - m.add({ - title : 'spellchecker.ignore_word', - onclick : function() { - dom.remove(e.target, 1); - t._checkDone(); - } - }); - - m.add({ - title : 'spellchecker.ignore_words', - onclick : function() { - t._removeWords(dom.decode(e.target.innerHTML)); - t._checkDone(); - } - }); - - m.update(); - }); - - ed.selection.select(e.target); - p1 = dom.getPos(e.target); - m.showMenu(p1.x, p1.y + e.target.offsetHeight - vp.y); - - return tinymce.dom.Event.cancel(e); - } else - m.hideMenu(); - }, - - _checkDone : function() { - var t = this, ed = t.editor, dom = ed.dom, o; - - each(dom.select('span'), function(n) { - if (n && dom.hasClass(n, 'mceItemHiddenSpellWord')) { - o = true; - return false; - } - }); - - if (!o) - t._done(); - }, - - _done : function() { - var t = this, la = t.active; - - if (t.active) { - t.active = 0; - t._removeWords(); - - if (t._menu) - t._menu.hideMenu(); - - if (la) - t.editor.nodeChanged(); - } - }, - - _sendRPC : function(m, p, cb) { - var t = this, url = t.editor.getParam("spellchecker_rpc_url", this.url+'/rpc.php'); - - if (url == '{backend}') { - t.editor.setProgressState(0); - alert('Please specify: spellchecker_rpc_url'); - return; - } - - JSONRequest.sendRPC({ - url : url, - method : m, - params : p, - success : cb, - error : function(e, x) { - t.editor.setProgressState(0); - t.editor.windowManager.alert(e.errstr || ('Error response: ' + x.responseText)); - } - }); - } - }); - - // Register plugin - tinymce.PluginManager.add('spellchecker', tinymce.plugins.SpellcheckerPlugin); +/** + * $Id$ + * + * @author Moxiecode + * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(function() { + var JSONRequest = tinymce.util.JSONRequest, each = tinymce.each, DOM = tinymce.DOM; + + tinymce.create('tinymce.plugins.SpellcheckerPlugin', { + getInfo : function() { + return { + longname : 'Spellchecker', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker', + version : "2.0.2" + }; + }, + + init : function(ed, url) { + var t = this, cm; + + t.url = url; + t.editor = ed; + + // Register commands + ed.addCommand('mceSpellCheck', function() { + if (!t.active) { + ed.setProgressState(1); + t._sendRPC('checkWords', [t.selectedLang, t._getWords()], function(r) { + if (r.length > 0) { + t.active = 1; + t._markWords(r); + ed.setProgressState(0); + ed.nodeChanged(); + } else { + ed.setProgressState(0); + ed.windowManager.alert('spellchecker.no_mpell'); + } + }); + } else + t._done(); + }); + + ed.onInit.add(function() { + if (ed.settings.content_css !== false) + ed.dom.loadCSS(url + '/css/content.css'); + }); + + ed.onClick.add(t._showMenu, t); + ed.onContextMenu.add(t._showMenu, t); + ed.onBeforeGetContent.add(function() { + if (t.active) + t._removeWords(); + }); + + ed.onNodeChange.add(function(ed, cm) { + cm.setActive('spellchecker', t.active); + }); + + ed.onSetContent.add(function() { + t._done(); + }); + + ed.onBeforeGetContent.add(function() { + t._done(); + }); + + ed.onBeforeExecCommand.add(function(ed, cmd) { + if (cmd == 'mceFullScreen') + t._done(); + }); + + // Find selected language + t.languages = {}; + each(ed.getParam('spellchecker_languages', '+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv', 'hash'), function(v, k) { + if (k.indexOf('+') === 0) { + k = k.substring(1); + t.selectedLang = v; + } + + t.languages[k] = v; + }); + }, + + createControl : function(n, cm) { + var t = this, c, ed = t.editor; + + if (n == 'spellchecker') { + c = cm.createSplitButton(n, {title : 'spellchecker.desc', cmd : 'mceSpellCheck', scope : t}); + + c.onRenderMenu.add(function(c, m) { + m.add({title : 'spellchecker.langs', 'class' : 'mceMenuItemTitle'}).setDisabled(1); + each(t.languages, function(v, k) { + var o = {icon : 1}, mi; + + o.onclick = function() { + mi.setSelected(1); + t.selectedItem.setSelected(0); + t.selectedItem = mi; + t.selectedLang = v; + }; + + o.title = k; + mi = m.add(o); + mi.setSelected(v == t.selectedLang); + + if (v == t.selectedLang) + t.selectedItem = mi; + }) + }); + + return c; + } + }, + + // Internal functions + + _walk : function(n, f) { + var d = this.editor.getDoc(), w; + + if (d.createTreeWalker) { + w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false); + + while ((n = w.nextNode()) != null) + f.call(this, n); + } else + tinymce.walk(n, f, 'childNodes'); + }, + + _getSeparators : function() { + var re = '', i, str = this.editor.getParam('spellchecker_word_separator_chars', '\\s!"#$%&()*+,-./:;<=>?@[\]^_{|}����������������\u201d\u201c'); + + // Build word separator regexp + for (i=0; i$1$2'); + v = v.replace(r3, '$1$2'); + + dom.replace(dom.create('span', {'class' : 'mceItemHidden'}, v), n); + } + } + }); + + se.moveToBookmark(b); + }, + + _showMenu : function(ed, e) { + var t = this, ed = t.editor, m = t._menu, p1, dom = ed.dom, vp = dom.getViewPort(ed.getWin()); + + if (!m) { + p1 = DOM.getPos(ed.getContentAreaContainer()); + //p2 = DOM.getPos(ed.getContainer()); + + m = ed.controlManager.createDropMenu('spellcheckermenu', { + offset_x : p1.x, + offset_y : p1.y, + 'class' : 'mceNoIcons' + }); + + t._menu = m; + } + + if (dom.hasClass(e.target, 'mceItemHiddenSpellWord')) { + m.removeAll(); + m.add({title : 'spellchecker.wait', 'class' : 'mceMenuItemTitle'}).setDisabled(1); + + t._sendRPC('getSuggestions', [t.selectedLang, dom.decode(e.target.innerHTML)], function(r) { + m.removeAll(); + + if (r.length > 0) { + m.add({title : 'spellchecker.sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1); + each(r, function(v) { + m.add({title : v, onclick : function() { + dom.replace(ed.getDoc().createTextNode(v), e.target); + t._checkDone(); + }}); + }); + + m.addSeparator(); + } else + m.add({title : 'spellchecker.no_sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1); + + m.add({ + title : 'spellchecker.ignore_word', + onclick : function() { + dom.remove(e.target, 1); + t._checkDone(); + } + }); + + m.add({ + title : 'spellchecker.ignore_words', + onclick : function() { + t._removeWords(dom.decode(e.target.innerHTML)); + t._checkDone(); + } + }); + + m.update(); + }); + + ed.selection.select(e.target); + p1 = dom.getPos(e.target); + m.showMenu(p1.x, p1.y + e.target.offsetHeight - vp.y); + + return tinymce.dom.Event.cancel(e); + } else + m.hideMenu(); + }, + + _checkDone : function() { + var t = this, ed = t.editor, dom = ed.dom, o; + + each(dom.select('span'), function(n) { + if (n && dom.hasClass(n, 'mceItemHiddenSpellWord')) { + o = true; + return false; + } + }); + + if (!o) + t._done(); + }, + + _done : function() { + var t = this, la = t.active; + + if (t.active) { + t.active = 0; + t._removeWords(); + + if (t._menu) + t._menu.hideMenu(); + + if (la) + t.editor.nodeChanged(); + } + }, + + _sendRPC : function(m, p, cb) { + var t = this, url = t.editor.getParam("spellchecker_rpc_url", this.url+'/rpc.php'); + + if (url == '{backend}') { + t.editor.setProgressState(0); + alert('Please specify: spellchecker_rpc_url'); + return; + } + + JSONRequest.sendRPC({ + url : url, + method : m, + params : p, + success : cb, + error : function(e, x) { + t.editor.setProgressState(0); + t.editor.windowManager.alert(e.errstr || ('Error response: ' + x.responseText)); + } + }); + } + }); + + // Register plugin + tinymce.PluginManager.add('spellchecker', tinymce.plugins.SpellcheckerPlugin); })(); \ No newline at end of file diff --git a/lib/editor/tinymce/plugins/spellchecker/rpc.php b/lib/editor/tinymce/plugins/spellchecker/rpc.php index 397fb54c411..ddf463bef8e 100644 --- a/lib/editor/tinymce/plugins/spellchecker/rpc.php +++ b/lib/editor/tinymce/plugins/spellchecker/rpc.php @@ -1,113 +1,113 @@ -decode($raw); - -// Execute RPC -if (isset($config['general.engine'])) { - $spellchecker = new $config['general.engine']($config); - $result = call_user_func_array(array($spellchecker, $input['method']), $input['params']); -} else - die('{"result":null,"id":null,"error":{"errstr":"You must choose an spellchecker engine in the config.php file.","errfile":"","errline":null,"errcontext":"","level":"FATAL"}}'); - -// Request and response id should always be the same -$output = array( - "id" => $input->id, - "result" => $result, - "error" => null -); - -// Return JSON encoded string -echo $json->encode($output); - -?> +decode($raw); + +// Execute RPC +if (isset($config['general.engine'])) { + $spellchecker = new $config['general.engine']($config); + $result = call_user_func_array(array($spellchecker, $input['method']), $input['params']); +} else + die('{"result":null,"id":null,"error":{"errstr":"You must choose an spellchecker engine in the config.php file.","errfile":"","errline":null,"errcontext":"","level":"FATAL"}}'); + +// Request and response id should always be the same +$output = array( + "id" => $input->id, + "result" => $result, + "error" => null +); + +// Return JSON encoded string +echo $json->encode($output); + +?> diff --git a/lib/editor/tinymce/plugins/style/css/props.css b/lib/editor/tinymce/plugins/style/css/props.css index eb1f2649605..5550b093c69 100644 --- a/lib/editor/tinymce/plugins/style/css/props.css +++ b/lib/editor/tinymce/plugins/style/css/props.css @@ -1,13 +1,13 @@ -#text_font {width:250px;} -#text_size {width:70px;} -.mceAddSelectValue {background:#DDD;} -select, #block_text_indent, #box_width, #box_height, #box_padding_top, #box_padding_right, #box_padding_bottom, #box_padding_left {width:70px;} -#box_margin_top, #box_margin_right, #box_margin_bottom, #box_margin_left, #positioning_width, #positioning_height, #positioning_zindex {width:70px;} -#positioning_placement_top, #positioning_placement_right, #positioning_placement_bottom, #positioning_placement_left {width:70px;} -#positioning_clip_top, #positioning_clip_right, #positioning_clip_bottom, #positioning_clip_left {width:70px;} -.panel_wrapper div.current {padding-top:10px;height:230px;} -.delim {border-left:1px solid gray;} -.tdelim {border-bottom:1px solid gray;} -#block_display {width:145px;} -#list_type {width:115px;} -.disabled {background:#EEE;} +#text_font {width:250px;} +#text_size {width:70px;} +.mceAddSelectValue {background:#DDD;} +select, #block_text_indent, #box_width, #box_height, #box_padding_top, #box_padding_right, #box_padding_bottom, #box_padding_left {width:70px;} +#box_margin_top, #box_margin_right, #box_margin_bottom, #box_margin_left, #positioning_width, #positioning_height, #positioning_zindex {width:70px;} +#positioning_placement_top, #positioning_placement_right, #positioning_placement_bottom, #positioning_placement_left {width:70px;} +#positioning_clip_top, #positioning_clip_right, #positioning_clip_bottom, #positioning_clip_left {width:70px;} +.panel_wrapper div.current {padding-top:10px;height:230px;} +.delim {border-left:1px solid gray;} +.tdelim {border-bottom:1px solid gray;} +#block_display {width:145px;} +#list_type {width:115px;} +.disabled {background:#EEE;} diff --git a/lib/editor/tinymce/plugins/style/js/props.js b/lib/editor/tinymce/plugins/style/js/props.js index a8dd93dec59..1e73806d665 100644 --- a/lib/editor/tinymce/plugins/style/js/props.js +++ b/lib/editor/tinymce/plugins/style/js/props.js @@ -1,641 +1,641 @@ -tinyMCEPopup.requireLangPack(); - -var defaultFonts = "" + - "Arial, Helvetica, sans-serif=Arial, Helvetica, sans-serif;" + - "Times New Roman, Times, serif=Times New Roman, Times, serif;" + - "Courier New, Courier, mono=Courier New, Courier, mono;" + - "Times New Roman, Times, serif=Times New Roman, Times, serif;" + - "Georgia, Times New Roman, Times, serif=Georgia, Times New Roman, Times, serif;" + - "Verdana, Arial, Helvetica, sans-serif=Verdana, Arial, Helvetica, sans-serif;" + - "Geneva, Arial, Helvetica, sans-serif=Geneva, Arial, Helvetica, sans-serif"; - -var defaultSizes = "9;10;12;14;16;18;24;xx-small;x-small;small;medium;large;x-large;xx-large;smaller;larger"; -var defaultMeasurement = "+pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%"; -var defaultSpacingMeasurement = "pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;+ems=em;exs=ex;%"; -var defaultIndentMeasurement = "pixels=px;+points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%"; -var defaultWeight = "normal;bold;bolder;lighter;100;200;300;400;500;600;700;800;900"; -var defaultTextStyle = "normal;italic;oblique"; -var defaultVariant = "normal;small-caps"; -var defaultLineHeight = "normal"; -var defaultAttachment = "fixed;scroll"; -var defaultRepeat = "no-repeat;repeat;repeat-x;repeat-y"; -var defaultPosH = "left;center;right"; -var defaultPosV = "top;center;bottom"; -var defaultVAlign = "baseline;sub;super;top;text-top;middle;bottom;text-bottom"; -var defaultDisplay = "inline;block;list-item;run-in;compact;marker;table;inline-table;table-row-group;table-header-group;table-footer-group;table-row;table-column-group;table-column;table-cell;table-caption;none"; -var defaultBorderStyle = "none;solid;dashed;dotted;double;groove;ridge;inset;outset"; -var defaultBorderWidth = "thin;medium;thick"; -var defaultListType = "disc;circle;square;decimal;lower-roman;upper-roman;lower-alpha;upper-alpha;none"; - -function init() { - var ce = document.getElementById('container'), h; - - ce.style.cssText = tinyMCEPopup.getWindowArg('style_text'); - - h = getBrowserHTML('background_image_browser','background_image','image','advimage'); - document.getElementById("background_image_browser").innerHTML = h; - - document.getElementById('text_color_pickcontainer').innerHTML = getColorPickerHTML('text_color_pick','text_color'); - document.getElementById('background_color_pickcontainer').innerHTML = getColorPickerHTML('background_color_pick','background_color'); - document.getElementById('border_color_top_pickcontainer').innerHTML = getColorPickerHTML('border_color_top_pick','border_color_top'); - document.getElementById('border_color_right_pickcontainer').innerHTML = getColorPickerHTML('border_color_right_pick','border_color_right'); - document.getElementById('border_color_bottom_pickcontainer').innerHTML = getColorPickerHTML('border_color_bottom_pick','border_color_bottom'); - document.getElementById('border_color_left_pickcontainer').innerHTML = getColorPickerHTML('border_color_left_pick','border_color_left'); - - fillSelect(0, 'text_font', 'style_font', defaultFonts, ';', true); - fillSelect(0, 'text_size', 'style_font_size', defaultSizes, ';', true); - fillSelect(0, 'text_size_measurement', 'style_font_size_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'text_case', 'style_text_case', "capitalize;uppercase;lowercase", ';', true); - fillSelect(0, 'text_weight', 'style_font_weight', defaultWeight, ';', true); - fillSelect(0, 'text_style', 'style_font_style', defaultTextStyle, ';', true); - fillSelect(0, 'text_variant', 'style_font_variant', defaultVariant, ';', true); - fillSelect(0, 'text_lineheight', 'style_font_line_height', defaultLineHeight, ';', true); - fillSelect(0, 'text_lineheight_measurement', 'style_font_line_height_measurement', defaultMeasurement, ';', true); - - fillSelect(0, 'background_attachment', 'style_background_attachment', defaultAttachment, ';', true); - fillSelect(0, 'background_repeat', 'style_background_repeat', defaultRepeat, ';', true); - - fillSelect(0, 'background_hpos_measurement', 'style_background_hpos_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'background_vpos_measurement', 'style_background_vpos_measurement', defaultMeasurement, ';', true); - - fillSelect(0, 'background_hpos', 'style_background_hpos', defaultPosH, ';', true); - fillSelect(0, 'background_vpos', 'style_background_vpos', defaultPosV, ';', true); - - fillSelect(0, 'block_wordspacing', 'style_wordspacing', 'normal', ';', true); - fillSelect(0, 'block_wordspacing_measurement', 'style_wordspacing_measurement', defaultSpacingMeasurement, ';', true); - fillSelect(0, 'block_letterspacing', 'style_letterspacing', 'normal', ';', true); - fillSelect(0, 'block_letterspacing_measurement', 'style_letterspacing_measurement', defaultSpacingMeasurement, ';', true); - fillSelect(0, 'block_vertical_alignment', 'style_vertical_alignment', defaultVAlign, ';', true); - fillSelect(0, 'block_text_align', 'style_text_align', "left;right;center;justify", ';', true); - fillSelect(0, 'block_whitespace', 'style_whitespace', "normal;pre;nowrap", ';', true); - fillSelect(0, 'block_display', 'style_display', defaultDisplay, ';', true); - fillSelect(0, 'block_text_indent_measurement', 'style_text_indent_measurement', defaultIndentMeasurement, ';', true); - - fillSelect(0, 'box_width_measurement', 'style_box_width_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_height_measurement', 'style_box_height_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_float', 'style_float', 'left;right;none', ';', true); - fillSelect(0, 'box_clear', 'style_clear', 'left;right;both;none', ';', true); - fillSelect(0, 'box_padding_left_measurement', 'style_padding_left_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_padding_top_measurement', 'style_padding_top_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_padding_bottom_measurement', 'style_padding_bottom_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_padding_right_measurement', 'style_padding_right_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_margin_left_measurement', 'style_margin_left_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_margin_top_measurement', 'style_margin_top_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_margin_bottom_measurement', 'style_margin_bottom_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_margin_right_measurement', 'style_margin_right_measurement', defaultMeasurement, ';', true); - - fillSelect(0, 'border_style_top', 'style_border_style_top', defaultBorderStyle, ';', true); - fillSelect(0, 'border_style_right', 'style_border_style_right', defaultBorderStyle, ';', true); - fillSelect(0, 'border_style_bottom', 'style_border_style_bottom', defaultBorderStyle, ';', true); - fillSelect(0, 'border_style_left', 'style_border_style_left', defaultBorderStyle, ';', true); - - fillSelect(0, 'border_width_top', 'style_border_width_top', defaultBorderWidth, ';', true); - fillSelect(0, 'border_width_right', 'style_border_width_right', defaultBorderWidth, ';', true); - fillSelect(0, 'border_width_bottom', 'style_border_width_bottom', defaultBorderWidth, ';', true); - fillSelect(0, 'border_width_left', 'style_border_width_left', defaultBorderWidth, ';', true); - - fillSelect(0, 'border_width_top_measurement', 'style_border_width_top_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'border_width_right_measurement', 'style_border_width_right_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'border_width_bottom_measurement', 'style_border_width_bottom_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'border_width_left_measurement', 'style_border_width_left_measurement', defaultMeasurement, ';', true); - - fillSelect(0, 'list_type', 'style_list_type', defaultListType, ';', true); - fillSelect(0, 'list_position', 'style_list_position', "inside;outside", ';', true); - - fillSelect(0, 'positioning_type', 'style_positioning_type', "absolute;relative;static", ';', true); - fillSelect(0, 'positioning_visibility', 'style_positioning_visibility', "inherit;visible;hidden", ';', true); - - fillSelect(0, 'positioning_width_measurement', 'style_positioning_width_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'positioning_height_measurement', 'style_positioning_height_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'positioning_overflow', 'style_positioning_overflow', "visible;hidden;scroll;auto", ';', true); - - fillSelect(0, 'positioning_placement_top_measurement', 'style_positioning_placement_top_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'positioning_placement_right_measurement', 'style_positioning_placement_right_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'positioning_placement_bottom_measurement', 'style_positioning_placement_bottom_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'positioning_placement_left_measurement', 'style_positioning_placement_left_measurement', defaultMeasurement, ';', true); - - fillSelect(0, 'positioning_clip_top_measurement', 'style_positioning_clip_top_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'positioning_clip_right_measurement', 'style_positioning_clip_right_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'positioning_clip_bottom_measurement', 'style_positioning_clip_bottom_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'positioning_clip_left_measurement', 'style_positioning_clip_left_measurement', defaultMeasurement, ';', true); - - TinyMCE_EditableSelects.init(); - setupFormData(); - showDisabledControls(); -} - -function setupFormData() { - var ce = document.getElementById('container'), f = document.forms[0], s, b, i; - - // Setup text fields - - selectByValue(f, 'text_font', ce.style.fontFamily, true, true); - selectByValue(f, 'text_size', getNum(ce.style.fontSize), true, true); - selectByValue(f, 'text_size_measurement', getMeasurement(ce.style.fontSize)); - selectByValue(f, 'text_weight', ce.style.fontWeight, true, true); - selectByValue(f, 'text_style', ce.style.fontStyle, true, true); - selectByValue(f, 'text_lineheight', getNum(ce.style.lineHeight), true, true); - selectByValue(f, 'text_lineheight_measurement', getMeasurement(ce.style.lineHeight)); - selectByValue(f, 'text_case', ce.style.textTransform, true, true); - selectByValue(f, 'text_variant', ce.style.fontVariant, true, true); - f.text_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.color); - updateColor('text_color_pick', 'text_color'); - f.text_underline.checked = inStr(ce.style.textDecoration, 'underline'); - f.text_overline.checked = inStr(ce.style.textDecoration, 'overline'); - f.text_linethrough.checked = inStr(ce.style.textDecoration, 'line-through'); - f.text_blink.checked = inStr(ce.style.textDecoration, 'blink'); - - // Setup background fields - - f.background_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.backgroundColor); - updateColor('background_color_pick', 'background_color'); - f.background_image.value = ce.style.backgroundImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); - selectByValue(f, 'background_repeat', ce.style.backgroundRepeat, true, true); - selectByValue(f, 'background_attachment', ce.style.backgroundAttachment, true, true); - selectByValue(f, 'background_hpos', getNum(getVal(ce.style.backgroundPosition, 0)), true, true); - selectByValue(f, 'background_hpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 0))); - selectByValue(f, 'background_vpos', getNum(getVal(ce.style.backgroundPosition, 1)), true, true); - selectByValue(f, 'background_vpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 1))); - - // Setup block fields - - selectByValue(f, 'block_wordspacing', getNum(ce.style.wordSpacing), true, true); - selectByValue(f, 'block_wordspacing_measurement', getMeasurement(ce.style.wordSpacing)); - selectByValue(f, 'block_letterspacing', getNum(ce.style.letterSpacing), true, true); - selectByValue(f, 'block_letterspacing_measurement', getMeasurement(ce.style.letterSpacing)); - selectByValue(f, 'block_vertical_alignment', ce.style.verticalAlign, true, true); - selectByValue(f, 'block_text_align', ce.style.textAlign, true, true); - f.block_text_indent.value = getNum(ce.style.textIndent); - selectByValue(f, 'block_text_indent_measurement', getMeasurement(ce.style.textIndent)); - selectByValue(f, 'block_whitespace', ce.style.whiteSpace, true, true); - selectByValue(f, 'block_display', ce.style.display, true, true); - - // Setup box fields - - f.box_width.value = getNum(ce.style.width); - selectByValue(f, 'box_width_measurement', getMeasurement(ce.style.width)); - - f.box_height.value = getNum(ce.style.height); - selectByValue(f, 'box_height_measurement', getMeasurement(ce.style.height)); - - if (tinymce.isGecko) - selectByValue(f, 'box_float', ce.style.cssFloat, true, true); - else - selectByValue(f, 'box_float', ce.style.styleFloat, true, true); - - selectByValue(f, 'box_clear', ce.style.clear, true, true); - - setupBox(f, ce, 'box_padding', 'padding', ''); - setupBox(f, ce, 'box_margin', 'margin', ''); - - // Setup border fields - - setupBox(f, ce, 'border_style', 'border', 'Style'); - setupBox(f, ce, 'border_width', 'border', 'Width'); - setupBox(f, ce, 'border_color', 'border', 'Color'); - - updateColor('border_color_top_pick', 'border_color_top'); - updateColor('border_color_right_pick', 'border_color_right'); - updateColor('border_color_bottom_pick', 'border_color_bottom'); - updateColor('border_color_left_pick', 'border_color_left'); - - f.elements.border_color_top.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_top.value); - f.elements.border_color_right.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_right.value); - f.elements.border_color_bottom.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_bottom.value); - f.elements.border_color_left.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_left.value); - - // Setup list fields - - selectByValue(f, 'list_type', ce.style.listStyleType, true, true); - selectByValue(f, 'list_position', ce.style.listStylePosition, true, true); - f.list_bullet_image.value = ce.style.listStyleImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); - - // Setup box fields - - selectByValue(f, 'positioning_type', ce.style.position, true, true); - selectByValue(f, 'positioning_visibility', ce.style.visibility, true, true); - selectByValue(f, 'positioning_overflow', ce.style.overflow, true, true); - f.positioning_zindex.value = ce.style.zIndex ? ce.style.zIndex : ""; - - f.positioning_width.value = getNum(ce.style.width); - selectByValue(f, 'positioning_width_measurement', getMeasurement(ce.style.width)); - - f.positioning_height.value = getNum(ce.style.height); - selectByValue(f, 'positioning_height_measurement', getMeasurement(ce.style.height)); - - setupBox(f, ce, 'positioning_placement', '', '', ['top', 'right', 'bottom', 'left']); - - s = ce.style.clip.replace(new RegExp("rect\\('?([^']*)'?\\)", 'gi'), "$1"); - s = s.replace(/,/g, ' '); - - if (!hasEqualValues([getVal(s, 0), getVal(s, 1), getVal(s, 2), getVal(s, 3)])) { - f.positioning_clip_top.value = getNum(getVal(s, 0)); - selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0))); - f.positioning_clip_right.value = getNum(getVal(s, 1)); - selectByValue(f, 'positioning_clip_right_measurement', getMeasurement(getVal(s, 1))); - f.positioning_clip_bottom.value = getNum(getVal(s, 2)); - selectByValue(f, 'positioning_clip_bottom_measurement', getMeasurement(getVal(s, 2))); - f.positioning_clip_left.value = getNum(getVal(s, 3)); - selectByValue(f, 'positioning_clip_left_measurement', getMeasurement(getVal(s, 3))); - } else { - f.positioning_clip_top.value = getNum(getVal(s, 0)); - selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0))); - f.positioning_clip_right.value = f.positioning_clip_bottom.value = f.positioning_clip_left.value; - } - -// setupBox(f, ce, '', 'border', 'Color'); -} - -function getMeasurement(s) { - return s.replace(/^([0-9.]+)(.*)$/, "$2"); -} - -function getNum(s) { - if (new RegExp('^(?:[0-9.]+)(?:[a-z%]+)$', 'gi').test(s)) - return s.replace(/[^0-9.]/g, ''); - - return s; -} - -function inStr(s, n) { - return new RegExp(n, 'gi').test(s); -} - -function getVal(s, i) { - var a = s.split(' '); - - if (a.length > 1) - return a[i]; - - return ""; -} - -function setValue(f, n, v) { - if (f.elements[n].type == "text") - f.elements[n].value = v; - else - selectByValue(f, n, v, true, true); -} - -function setupBox(f, ce, fp, pr, sf, b) { - if (typeof(b) == "undefined") - b = ['Top', 'Right', 'Bottom', 'Left']; - - if (isSame(ce, pr, sf, b)) { - f.elements[fp + "_same"].checked = true; - - setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf])); - f.elements[fp + "_top"].disabled = false; - - f.elements[fp + "_right"].value = ""; - f.elements[fp + "_right"].disabled = true; - f.elements[fp + "_bottom"].value = ""; - f.elements[fp + "_bottom"].disabled = true; - f.elements[fp + "_left"].value = ""; - f.elements[fp + "_left"].disabled = true; - - if (f.elements[fp + "_top_measurement"]) { - selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf])); - f.elements[fp + "_left_measurement"].disabled = true; - f.elements[fp + "_bottom_measurement"].disabled = true; - f.elements[fp + "_right_measurement"].disabled = true; - } - } else { - f.elements[fp + "_same"].checked = false; - - setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf])); - f.elements[fp + "_top"].disabled = false; - - setValue(f, fp + "_right", getNum(ce.style[pr + b[1] + sf])); - f.elements[fp + "_right"].disabled = false; - - setValue(f, fp + "_bottom", getNum(ce.style[pr + b[2] + sf])); - f.elements[fp + "_bottom"].disabled = false; - - setValue(f, fp + "_left", getNum(ce.style[pr + b[3] + sf])); - f.elements[fp + "_left"].disabled = false; - - if (f.elements[fp + "_top_measurement"]) { - selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf])); - selectByValue(f, fp + '_right_measurement', getMeasurement(ce.style[pr + b[1] + sf])); - selectByValue(f, fp + '_bottom_measurement', getMeasurement(ce.style[pr + b[2] + sf])); - selectByValue(f, fp + '_left_measurement', getMeasurement(ce.style[pr + b[3] + sf])); - f.elements[fp + "_left_measurement"].disabled = false; - f.elements[fp + "_bottom_measurement"].disabled = false; - f.elements[fp + "_right_measurement"].disabled = false; - } - } -} - -function isSame(e, pr, sf, b) { - var a = [], i, x; - - if (typeof(b) == "undefined") - b = ['Top', 'Right', 'Bottom', 'Left']; - - if (typeof(sf) == "undefined" || sf == null) - sf = ""; - - a[0] = e.style[pr + b[0] + sf]; - a[1] = e.style[pr + b[1] + sf]; - a[2] = e.style[pr + b[2] + sf]; - a[3] = e.style[pr + b[3] + sf]; - - for (i=0; i 0 ? s.substring(1) : s; - - if (f.text_none.checked) - s = "none"; - - ce.style.textDecoration = s; - - // Build background styles - - ce.style.backgroundColor = f.background_color.value; - ce.style.backgroundImage = f.background_image.value != "" ? "url(" + f.background_image.value + ")" : ""; - ce.style.backgroundRepeat = f.background_repeat.value; - ce.style.backgroundAttachment = f.background_attachment.value; - - if (f.background_hpos.value != "") { - s = ""; - s += f.background_hpos.value + (isNum(f.background_hpos.value) ? f.background_hpos_measurement.value : "") + " "; - s += f.background_vpos.value + (isNum(f.background_vpos.value) ? f.background_vpos_measurement.value : ""); - ce.style.backgroundPosition = s; - } - - // Build block styles - - ce.style.wordSpacing = f.block_wordspacing.value + (isNum(f.block_wordspacing.value) ? f.block_wordspacing_measurement.value : ""); - ce.style.letterSpacing = f.block_letterspacing.value + (isNum(f.block_letterspacing.value) ? f.block_letterspacing_measurement.value : ""); - ce.style.verticalAlign = f.block_vertical_alignment.value; - ce.style.textAlign = f.block_text_align.value; - ce.style.textIndent = f.block_text_indent.value + (isNum(f.block_text_indent.value) ? f.block_text_indent_measurement.value : ""); - ce.style.whiteSpace = f.block_whitespace.value; - ce.style.display = f.block_display.value; - - // Build box styles - - ce.style.width = f.box_width.value + (isNum(f.box_width.value) ? f.box_width_measurement.value : ""); - ce.style.height = f.box_height.value + (isNum(f.box_height.value) ? f.box_height_measurement.value : ""); - ce.style.styleFloat = f.box_float.value; - - if (tinymce.isGecko) - ce.style.cssFloat = f.box_float.value; - - ce.style.clear = f.box_clear.value; - - if (!f.box_padding_same.checked) { - ce.style.paddingTop = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : ""); - ce.style.paddingRight = f.box_padding_right.value + (isNum(f.box_padding_right.value) ? f.box_padding_right_measurement.value : ""); - ce.style.paddingBottom = f.box_padding_bottom.value + (isNum(f.box_padding_bottom.value) ? f.box_padding_bottom_measurement.value : ""); - ce.style.paddingLeft = f.box_padding_left.value + (isNum(f.box_padding_left.value) ? f.box_padding_left_measurement.value : ""); - } else - ce.style.padding = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : ""); - - if (!f.box_margin_same.checked) { - ce.style.marginTop = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : ""); - ce.style.marginRight = f.box_margin_right.value + (isNum(f.box_margin_right.value) ? f.box_margin_right_measurement.value : ""); - ce.style.marginBottom = f.box_margin_bottom.value + (isNum(f.box_margin_bottom.value) ? f.box_margin_bottom_measurement.value : ""); - ce.style.marginLeft = f.box_margin_left.value + (isNum(f.box_margin_left.value) ? f.box_margin_left_measurement.value : ""); - } else - ce.style.margin = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : ""); - - // Build border styles - - if (!f.border_style_same.checked) { - ce.style.borderTopStyle = f.border_style_top.value; - ce.style.borderRightStyle = f.border_style_right.value; - ce.style.borderBottomStyle = f.border_style_bottom.value; - ce.style.borderLeftStyle = f.border_style_left.value; - } else - ce.style.borderStyle = f.border_style_top.value; - - if (!f.border_width_same.checked) { - ce.style.borderTopWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : ""); - ce.style.borderRightWidth = f.border_width_right.value + (isNum(f.border_width_right.value) ? f.border_width_right_measurement.value : ""); - ce.style.borderBottomWidth = f.border_width_bottom.value + (isNum(f.border_width_bottom.value) ? f.border_width_bottom_measurement.value : ""); - ce.style.borderLeftWidth = f.border_width_left.value + (isNum(f.border_width_left.value) ? f.border_width_left_measurement.value : ""); - } else - ce.style.borderWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : ""); - - if (!f.border_color_same.checked) { - ce.style.borderTopColor = f.border_color_top.value; - ce.style.borderRightColor = f.border_color_right.value; - ce.style.borderBottomColor = f.border_color_bottom.value; - ce.style.borderLeftColor = f.border_color_left.value; - } else - ce.style.borderColor = f.border_color_top.value; - - // Build list styles - - ce.style.listStyleType = f.list_type.value; - ce.style.listStylePosition = f.list_position.value; - ce.style.listStyleImage = f.list_bullet_image.value != "" ? "url(" + f.list_bullet_image.value + ")" : ""; - - // Build positioning styles - - ce.style.position = f.positioning_type.value; - ce.style.visibility = f.positioning_visibility.value; - - if (ce.style.width == "") - ce.style.width = f.positioning_width.value + (isNum(f.positioning_width.value) ? f.positioning_width_measurement.value : ""); - - if (ce.style.height == "") - ce.style.height = f.positioning_height.value + (isNum(f.positioning_height.value) ? f.positioning_height_measurement.value : ""); - - ce.style.zIndex = f.positioning_zindex.value; - ce.style.overflow = f.positioning_overflow.value; - - if (!f.positioning_placement_same.checked) { - ce.style.top = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : ""); - ce.style.right = f.positioning_placement_right.value + (isNum(f.positioning_placement_right.value) ? f.positioning_placement_right_measurement.value : ""); - ce.style.bottom = f.positioning_placement_bottom.value + (isNum(f.positioning_placement_bottom.value) ? f.positioning_placement_bottom_measurement.value : ""); - ce.style.left = f.positioning_placement_left.value + (isNum(f.positioning_placement_left.value) ? f.positioning_placement_left_measurement.value : ""); - } else { - s = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : ""); - ce.style.top = s; - ce.style.right = s; - ce.style.bottom = s; - ce.style.left = s; - } - - if (!f.positioning_clip_same.checked) { - s = "rect("; - s += (isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto") + " "; - s += (isNum(f.positioning_clip_right.value) ? f.positioning_clip_right.value + f.positioning_clip_right_measurement.value : "auto") + " "; - s += (isNum(f.positioning_clip_bottom.value) ? f.positioning_clip_bottom.value + f.positioning_clip_bottom_measurement.value : "auto") + " "; - s += (isNum(f.positioning_clip_left.value) ? f.positioning_clip_left.value + f.positioning_clip_left_measurement.value : "auto"); - s += ")"; - - if (s != "rect(auto auto auto auto)") - ce.style.clip = s; - } else { - s = "rect("; - t = isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto"; - s += t + " "; - s += t + " "; - s += t + " "; - s += t + ")"; - - if (s != "rect(auto auto auto auto)") - ce.style.clip = s; - } - - ce.style.cssText = ce.style.cssText; -} - -function isNum(s) { - return new RegExp('[0-9]+', 'g').test(s); -} - -function showDisabledControls() { - var f = document.forms, i, a; - - for (i=0; i 1) { - addSelectValue(f, s, p[0], p[1]); - - if (se) - selectByValue(f, s, p[1]); - } else { - addSelectValue(f, s, p[0], p[0]); - - if (se) - selectByValue(f, s, p[0]); - } - } -} - -function toggleSame(ce, pre) { - var el = document.forms[0].elements, i; - - if (ce.checked) { - el[pre + "_top"].disabled = false; - el[pre + "_right"].disabled = true; - el[pre + "_bottom"].disabled = true; - el[pre + "_left"].disabled = true; - - if (el[pre + "_top_measurement"]) { - el[pre + "_top_measurement"].disabled = false; - el[pre + "_right_measurement"].disabled = true; - el[pre + "_bottom_measurement"].disabled = true; - el[pre + "_left_measurement"].disabled = true; - } - } else { - el[pre + "_top"].disabled = false; - el[pre + "_right"].disabled = false; - el[pre + "_bottom"].disabled = false; - el[pre + "_left"].disabled = false; - - if (el[pre + "_top_measurement"]) { - el[pre + "_top_measurement"].disabled = false; - el[pre + "_right_measurement"].disabled = false; - el[pre + "_bottom_measurement"].disabled = false; - el[pre + "_left_measurement"].disabled = false; - } - } - - showDisabledControls(); -} - -function synch(fr, to) { - var f = document.forms[0]; - - f.elements[to].value = f.elements[fr].value; - - if (f.elements[fr + "_measurement"]) - selectByValue(f, to + "_measurement", f.elements[fr + "_measurement"].value); -} - -tinyMCEPopup.onInit.add(init); +tinyMCEPopup.requireLangPack(); + +var defaultFonts = "" + + "Arial, Helvetica, sans-serif=Arial, Helvetica, sans-serif;" + + "Times New Roman, Times, serif=Times New Roman, Times, serif;" + + "Courier New, Courier, mono=Courier New, Courier, mono;" + + "Times New Roman, Times, serif=Times New Roman, Times, serif;" + + "Georgia, Times New Roman, Times, serif=Georgia, Times New Roman, Times, serif;" + + "Verdana, Arial, Helvetica, sans-serif=Verdana, Arial, Helvetica, sans-serif;" + + "Geneva, Arial, Helvetica, sans-serif=Geneva, Arial, Helvetica, sans-serif"; + +var defaultSizes = "9;10;12;14;16;18;24;xx-small;x-small;small;medium;large;x-large;xx-large;smaller;larger"; +var defaultMeasurement = "+pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%"; +var defaultSpacingMeasurement = "pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;+ems=em;exs=ex;%"; +var defaultIndentMeasurement = "pixels=px;+points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%"; +var defaultWeight = "normal;bold;bolder;lighter;100;200;300;400;500;600;700;800;900"; +var defaultTextStyle = "normal;italic;oblique"; +var defaultVariant = "normal;small-caps"; +var defaultLineHeight = "normal"; +var defaultAttachment = "fixed;scroll"; +var defaultRepeat = "no-repeat;repeat;repeat-x;repeat-y"; +var defaultPosH = "left;center;right"; +var defaultPosV = "top;center;bottom"; +var defaultVAlign = "baseline;sub;super;top;text-top;middle;bottom;text-bottom"; +var defaultDisplay = "inline;block;list-item;run-in;compact;marker;table;inline-table;table-row-group;table-header-group;table-footer-group;table-row;table-column-group;table-column;table-cell;table-caption;none"; +var defaultBorderStyle = "none;solid;dashed;dotted;double;groove;ridge;inset;outset"; +var defaultBorderWidth = "thin;medium;thick"; +var defaultListType = "disc;circle;square;decimal;lower-roman;upper-roman;lower-alpha;upper-alpha;none"; + +function init() { + var ce = document.getElementById('container'), h; + + ce.style.cssText = tinyMCEPopup.getWindowArg('style_text'); + + h = getBrowserHTML('background_image_browser','background_image','image','advimage'); + document.getElementById("background_image_browser").innerHTML = h; + + document.getElementById('text_color_pickcontainer').innerHTML = getColorPickerHTML('text_color_pick','text_color'); + document.getElementById('background_color_pickcontainer').innerHTML = getColorPickerHTML('background_color_pick','background_color'); + document.getElementById('border_color_top_pickcontainer').innerHTML = getColorPickerHTML('border_color_top_pick','border_color_top'); + document.getElementById('border_color_right_pickcontainer').innerHTML = getColorPickerHTML('border_color_right_pick','border_color_right'); + document.getElementById('border_color_bottom_pickcontainer').innerHTML = getColorPickerHTML('border_color_bottom_pick','border_color_bottom'); + document.getElementById('border_color_left_pickcontainer').innerHTML = getColorPickerHTML('border_color_left_pick','border_color_left'); + + fillSelect(0, 'text_font', 'style_font', defaultFonts, ';', true); + fillSelect(0, 'text_size', 'style_font_size', defaultSizes, ';', true); + fillSelect(0, 'text_size_measurement', 'style_font_size_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'text_case', 'style_text_case', "capitalize;uppercase;lowercase", ';', true); + fillSelect(0, 'text_weight', 'style_font_weight', defaultWeight, ';', true); + fillSelect(0, 'text_style', 'style_font_style', defaultTextStyle, ';', true); + fillSelect(0, 'text_variant', 'style_font_variant', defaultVariant, ';', true); + fillSelect(0, 'text_lineheight', 'style_font_line_height', defaultLineHeight, ';', true); + fillSelect(0, 'text_lineheight_measurement', 'style_font_line_height_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'background_attachment', 'style_background_attachment', defaultAttachment, ';', true); + fillSelect(0, 'background_repeat', 'style_background_repeat', defaultRepeat, ';', true); + + fillSelect(0, 'background_hpos_measurement', 'style_background_hpos_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'background_vpos_measurement', 'style_background_vpos_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'background_hpos', 'style_background_hpos', defaultPosH, ';', true); + fillSelect(0, 'background_vpos', 'style_background_vpos', defaultPosV, ';', true); + + fillSelect(0, 'block_wordspacing', 'style_wordspacing', 'normal', ';', true); + fillSelect(0, 'block_wordspacing_measurement', 'style_wordspacing_measurement', defaultSpacingMeasurement, ';', true); + fillSelect(0, 'block_letterspacing', 'style_letterspacing', 'normal', ';', true); + fillSelect(0, 'block_letterspacing_measurement', 'style_letterspacing_measurement', defaultSpacingMeasurement, ';', true); + fillSelect(0, 'block_vertical_alignment', 'style_vertical_alignment', defaultVAlign, ';', true); + fillSelect(0, 'block_text_align', 'style_text_align', "left;right;center;justify", ';', true); + fillSelect(0, 'block_whitespace', 'style_whitespace', "normal;pre;nowrap", ';', true); + fillSelect(0, 'block_display', 'style_display', defaultDisplay, ';', true); + fillSelect(0, 'block_text_indent_measurement', 'style_text_indent_measurement', defaultIndentMeasurement, ';', true); + + fillSelect(0, 'box_width_measurement', 'style_box_width_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_height_measurement', 'style_box_height_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_float', 'style_float', 'left;right;none', ';', true); + fillSelect(0, 'box_clear', 'style_clear', 'left;right;both;none', ';', true); + fillSelect(0, 'box_padding_left_measurement', 'style_padding_left_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_padding_top_measurement', 'style_padding_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_padding_bottom_measurement', 'style_padding_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_padding_right_measurement', 'style_padding_right_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_margin_left_measurement', 'style_margin_left_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_margin_top_measurement', 'style_margin_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_margin_bottom_measurement', 'style_margin_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_margin_right_measurement', 'style_margin_right_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'border_style_top', 'style_border_style_top', defaultBorderStyle, ';', true); + fillSelect(0, 'border_style_right', 'style_border_style_right', defaultBorderStyle, ';', true); + fillSelect(0, 'border_style_bottom', 'style_border_style_bottom', defaultBorderStyle, ';', true); + fillSelect(0, 'border_style_left', 'style_border_style_left', defaultBorderStyle, ';', true); + + fillSelect(0, 'border_width_top', 'style_border_width_top', defaultBorderWidth, ';', true); + fillSelect(0, 'border_width_right', 'style_border_width_right', defaultBorderWidth, ';', true); + fillSelect(0, 'border_width_bottom', 'style_border_width_bottom', defaultBorderWidth, ';', true); + fillSelect(0, 'border_width_left', 'style_border_width_left', defaultBorderWidth, ';', true); + + fillSelect(0, 'border_width_top_measurement', 'style_border_width_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'border_width_right_measurement', 'style_border_width_right_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'border_width_bottom_measurement', 'style_border_width_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'border_width_left_measurement', 'style_border_width_left_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'list_type', 'style_list_type', defaultListType, ';', true); + fillSelect(0, 'list_position', 'style_list_position', "inside;outside", ';', true); + + fillSelect(0, 'positioning_type', 'style_positioning_type', "absolute;relative;static", ';', true); + fillSelect(0, 'positioning_visibility', 'style_positioning_visibility', "inherit;visible;hidden", ';', true); + + fillSelect(0, 'positioning_width_measurement', 'style_positioning_width_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_height_measurement', 'style_positioning_height_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_overflow', 'style_positioning_overflow', "visible;hidden;scroll;auto", ';', true); + + fillSelect(0, 'positioning_placement_top_measurement', 'style_positioning_placement_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_placement_right_measurement', 'style_positioning_placement_right_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_placement_bottom_measurement', 'style_positioning_placement_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_placement_left_measurement', 'style_positioning_placement_left_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'positioning_clip_top_measurement', 'style_positioning_clip_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_clip_right_measurement', 'style_positioning_clip_right_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_clip_bottom_measurement', 'style_positioning_clip_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_clip_left_measurement', 'style_positioning_clip_left_measurement', defaultMeasurement, ';', true); + + TinyMCE_EditableSelects.init(); + setupFormData(); + showDisabledControls(); +} + +function setupFormData() { + var ce = document.getElementById('container'), f = document.forms[0], s, b, i; + + // Setup text fields + + selectByValue(f, 'text_font', ce.style.fontFamily, true, true); + selectByValue(f, 'text_size', getNum(ce.style.fontSize), true, true); + selectByValue(f, 'text_size_measurement', getMeasurement(ce.style.fontSize)); + selectByValue(f, 'text_weight', ce.style.fontWeight, true, true); + selectByValue(f, 'text_style', ce.style.fontStyle, true, true); + selectByValue(f, 'text_lineheight', getNum(ce.style.lineHeight), true, true); + selectByValue(f, 'text_lineheight_measurement', getMeasurement(ce.style.lineHeight)); + selectByValue(f, 'text_case', ce.style.textTransform, true, true); + selectByValue(f, 'text_variant', ce.style.fontVariant, true, true); + f.text_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.color); + updateColor('text_color_pick', 'text_color'); + f.text_underline.checked = inStr(ce.style.textDecoration, 'underline'); + f.text_overline.checked = inStr(ce.style.textDecoration, 'overline'); + f.text_linethrough.checked = inStr(ce.style.textDecoration, 'line-through'); + f.text_blink.checked = inStr(ce.style.textDecoration, 'blink'); + + // Setup background fields + + f.background_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.backgroundColor); + updateColor('background_color_pick', 'background_color'); + f.background_image.value = ce.style.backgroundImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); + selectByValue(f, 'background_repeat', ce.style.backgroundRepeat, true, true); + selectByValue(f, 'background_attachment', ce.style.backgroundAttachment, true, true); + selectByValue(f, 'background_hpos', getNum(getVal(ce.style.backgroundPosition, 0)), true, true); + selectByValue(f, 'background_hpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 0))); + selectByValue(f, 'background_vpos', getNum(getVal(ce.style.backgroundPosition, 1)), true, true); + selectByValue(f, 'background_vpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 1))); + + // Setup block fields + + selectByValue(f, 'block_wordspacing', getNum(ce.style.wordSpacing), true, true); + selectByValue(f, 'block_wordspacing_measurement', getMeasurement(ce.style.wordSpacing)); + selectByValue(f, 'block_letterspacing', getNum(ce.style.letterSpacing), true, true); + selectByValue(f, 'block_letterspacing_measurement', getMeasurement(ce.style.letterSpacing)); + selectByValue(f, 'block_vertical_alignment', ce.style.verticalAlign, true, true); + selectByValue(f, 'block_text_align', ce.style.textAlign, true, true); + f.block_text_indent.value = getNum(ce.style.textIndent); + selectByValue(f, 'block_text_indent_measurement', getMeasurement(ce.style.textIndent)); + selectByValue(f, 'block_whitespace', ce.style.whiteSpace, true, true); + selectByValue(f, 'block_display', ce.style.display, true, true); + + // Setup box fields + + f.box_width.value = getNum(ce.style.width); + selectByValue(f, 'box_width_measurement', getMeasurement(ce.style.width)); + + f.box_height.value = getNum(ce.style.height); + selectByValue(f, 'box_height_measurement', getMeasurement(ce.style.height)); + + if (tinymce.isGecko) + selectByValue(f, 'box_float', ce.style.cssFloat, true, true); + else + selectByValue(f, 'box_float', ce.style.styleFloat, true, true); + + selectByValue(f, 'box_clear', ce.style.clear, true, true); + + setupBox(f, ce, 'box_padding', 'padding', ''); + setupBox(f, ce, 'box_margin', 'margin', ''); + + // Setup border fields + + setupBox(f, ce, 'border_style', 'border', 'Style'); + setupBox(f, ce, 'border_width', 'border', 'Width'); + setupBox(f, ce, 'border_color', 'border', 'Color'); + + updateColor('border_color_top_pick', 'border_color_top'); + updateColor('border_color_right_pick', 'border_color_right'); + updateColor('border_color_bottom_pick', 'border_color_bottom'); + updateColor('border_color_left_pick', 'border_color_left'); + + f.elements.border_color_top.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_top.value); + f.elements.border_color_right.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_right.value); + f.elements.border_color_bottom.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_bottom.value); + f.elements.border_color_left.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_left.value); + + // Setup list fields + + selectByValue(f, 'list_type', ce.style.listStyleType, true, true); + selectByValue(f, 'list_position', ce.style.listStylePosition, true, true); + f.list_bullet_image.value = ce.style.listStyleImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); + + // Setup box fields + + selectByValue(f, 'positioning_type', ce.style.position, true, true); + selectByValue(f, 'positioning_visibility', ce.style.visibility, true, true); + selectByValue(f, 'positioning_overflow', ce.style.overflow, true, true); + f.positioning_zindex.value = ce.style.zIndex ? ce.style.zIndex : ""; + + f.positioning_width.value = getNum(ce.style.width); + selectByValue(f, 'positioning_width_measurement', getMeasurement(ce.style.width)); + + f.positioning_height.value = getNum(ce.style.height); + selectByValue(f, 'positioning_height_measurement', getMeasurement(ce.style.height)); + + setupBox(f, ce, 'positioning_placement', '', '', ['top', 'right', 'bottom', 'left']); + + s = ce.style.clip.replace(new RegExp("rect\\('?([^']*)'?\\)", 'gi'), "$1"); + s = s.replace(/,/g, ' '); + + if (!hasEqualValues([getVal(s, 0), getVal(s, 1), getVal(s, 2), getVal(s, 3)])) { + f.positioning_clip_top.value = getNum(getVal(s, 0)); + selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0))); + f.positioning_clip_right.value = getNum(getVal(s, 1)); + selectByValue(f, 'positioning_clip_right_measurement', getMeasurement(getVal(s, 1))); + f.positioning_clip_bottom.value = getNum(getVal(s, 2)); + selectByValue(f, 'positioning_clip_bottom_measurement', getMeasurement(getVal(s, 2))); + f.positioning_clip_left.value = getNum(getVal(s, 3)); + selectByValue(f, 'positioning_clip_left_measurement', getMeasurement(getVal(s, 3))); + } else { + f.positioning_clip_top.value = getNum(getVal(s, 0)); + selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0))); + f.positioning_clip_right.value = f.positioning_clip_bottom.value = f.positioning_clip_left.value; + } + +// setupBox(f, ce, '', 'border', 'Color'); +} + +function getMeasurement(s) { + return s.replace(/^([0-9.]+)(.*)$/, "$2"); +} + +function getNum(s) { + if (new RegExp('^(?:[0-9.]+)(?:[a-z%]+)$', 'gi').test(s)) + return s.replace(/[^0-9.]/g, ''); + + return s; +} + +function inStr(s, n) { + return new RegExp(n, 'gi').test(s); +} + +function getVal(s, i) { + var a = s.split(' '); + + if (a.length > 1) + return a[i]; + + return ""; +} + +function setValue(f, n, v) { + if (f.elements[n].type == "text") + f.elements[n].value = v; + else + selectByValue(f, n, v, true, true); +} + +function setupBox(f, ce, fp, pr, sf, b) { + if (typeof(b) == "undefined") + b = ['Top', 'Right', 'Bottom', 'Left']; + + if (isSame(ce, pr, sf, b)) { + f.elements[fp + "_same"].checked = true; + + setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf])); + f.elements[fp + "_top"].disabled = false; + + f.elements[fp + "_right"].value = ""; + f.elements[fp + "_right"].disabled = true; + f.elements[fp + "_bottom"].value = ""; + f.elements[fp + "_bottom"].disabled = true; + f.elements[fp + "_left"].value = ""; + f.elements[fp + "_left"].disabled = true; + + if (f.elements[fp + "_top_measurement"]) { + selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf])); + f.elements[fp + "_left_measurement"].disabled = true; + f.elements[fp + "_bottom_measurement"].disabled = true; + f.elements[fp + "_right_measurement"].disabled = true; + } + } else { + f.elements[fp + "_same"].checked = false; + + setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf])); + f.elements[fp + "_top"].disabled = false; + + setValue(f, fp + "_right", getNum(ce.style[pr + b[1] + sf])); + f.elements[fp + "_right"].disabled = false; + + setValue(f, fp + "_bottom", getNum(ce.style[pr + b[2] + sf])); + f.elements[fp + "_bottom"].disabled = false; + + setValue(f, fp + "_left", getNum(ce.style[pr + b[3] + sf])); + f.elements[fp + "_left"].disabled = false; + + if (f.elements[fp + "_top_measurement"]) { + selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf])); + selectByValue(f, fp + '_right_measurement', getMeasurement(ce.style[pr + b[1] + sf])); + selectByValue(f, fp + '_bottom_measurement', getMeasurement(ce.style[pr + b[2] + sf])); + selectByValue(f, fp + '_left_measurement', getMeasurement(ce.style[pr + b[3] + sf])); + f.elements[fp + "_left_measurement"].disabled = false; + f.elements[fp + "_bottom_measurement"].disabled = false; + f.elements[fp + "_right_measurement"].disabled = false; + } + } +} + +function isSame(e, pr, sf, b) { + var a = [], i, x; + + if (typeof(b) == "undefined") + b = ['Top', 'Right', 'Bottom', 'Left']; + + if (typeof(sf) == "undefined" || sf == null) + sf = ""; + + a[0] = e.style[pr + b[0] + sf]; + a[1] = e.style[pr + b[1] + sf]; + a[2] = e.style[pr + b[2] + sf]; + a[3] = e.style[pr + b[3] + sf]; + + for (i=0; i 0 ? s.substring(1) : s; + + if (f.text_none.checked) + s = "none"; + + ce.style.textDecoration = s; + + // Build background styles + + ce.style.backgroundColor = f.background_color.value; + ce.style.backgroundImage = f.background_image.value != "" ? "url(" + f.background_image.value + ")" : ""; + ce.style.backgroundRepeat = f.background_repeat.value; + ce.style.backgroundAttachment = f.background_attachment.value; + + if (f.background_hpos.value != "") { + s = ""; + s += f.background_hpos.value + (isNum(f.background_hpos.value) ? f.background_hpos_measurement.value : "") + " "; + s += f.background_vpos.value + (isNum(f.background_vpos.value) ? f.background_vpos_measurement.value : ""); + ce.style.backgroundPosition = s; + } + + // Build block styles + + ce.style.wordSpacing = f.block_wordspacing.value + (isNum(f.block_wordspacing.value) ? f.block_wordspacing_measurement.value : ""); + ce.style.letterSpacing = f.block_letterspacing.value + (isNum(f.block_letterspacing.value) ? f.block_letterspacing_measurement.value : ""); + ce.style.verticalAlign = f.block_vertical_alignment.value; + ce.style.textAlign = f.block_text_align.value; + ce.style.textIndent = f.block_text_indent.value + (isNum(f.block_text_indent.value) ? f.block_text_indent_measurement.value : ""); + ce.style.whiteSpace = f.block_whitespace.value; + ce.style.display = f.block_display.value; + + // Build box styles + + ce.style.width = f.box_width.value + (isNum(f.box_width.value) ? f.box_width_measurement.value : ""); + ce.style.height = f.box_height.value + (isNum(f.box_height.value) ? f.box_height_measurement.value : ""); + ce.style.styleFloat = f.box_float.value; + + if (tinymce.isGecko) + ce.style.cssFloat = f.box_float.value; + + ce.style.clear = f.box_clear.value; + + if (!f.box_padding_same.checked) { + ce.style.paddingTop = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : ""); + ce.style.paddingRight = f.box_padding_right.value + (isNum(f.box_padding_right.value) ? f.box_padding_right_measurement.value : ""); + ce.style.paddingBottom = f.box_padding_bottom.value + (isNum(f.box_padding_bottom.value) ? f.box_padding_bottom_measurement.value : ""); + ce.style.paddingLeft = f.box_padding_left.value + (isNum(f.box_padding_left.value) ? f.box_padding_left_measurement.value : ""); + } else + ce.style.padding = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : ""); + + if (!f.box_margin_same.checked) { + ce.style.marginTop = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : ""); + ce.style.marginRight = f.box_margin_right.value + (isNum(f.box_margin_right.value) ? f.box_margin_right_measurement.value : ""); + ce.style.marginBottom = f.box_margin_bottom.value + (isNum(f.box_margin_bottom.value) ? f.box_margin_bottom_measurement.value : ""); + ce.style.marginLeft = f.box_margin_left.value + (isNum(f.box_margin_left.value) ? f.box_margin_left_measurement.value : ""); + } else + ce.style.margin = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : ""); + + // Build border styles + + if (!f.border_style_same.checked) { + ce.style.borderTopStyle = f.border_style_top.value; + ce.style.borderRightStyle = f.border_style_right.value; + ce.style.borderBottomStyle = f.border_style_bottom.value; + ce.style.borderLeftStyle = f.border_style_left.value; + } else + ce.style.borderStyle = f.border_style_top.value; + + if (!f.border_width_same.checked) { + ce.style.borderTopWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : ""); + ce.style.borderRightWidth = f.border_width_right.value + (isNum(f.border_width_right.value) ? f.border_width_right_measurement.value : ""); + ce.style.borderBottomWidth = f.border_width_bottom.value + (isNum(f.border_width_bottom.value) ? f.border_width_bottom_measurement.value : ""); + ce.style.borderLeftWidth = f.border_width_left.value + (isNum(f.border_width_left.value) ? f.border_width_left_measurement.value : ""); + } else + ce.style.borderWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : ""); + + if (!f.border_color_same.checked) { + ce.style.borderTopColor = f.border_color_top.value; + ce.style.borderRightColor = f.border_color_right.value; + ce.style.borderBottomColor = f.border_color_bottom.value; + ce.style.borderLeftColor = f.border_color_left.value; + } else + ce.style.borderColor = f.border_color_top.value; + + // Build list styles + + ce.style.listStyleType = f.list_type.value; + ce.style.listStylePosition = f.list_position.value; + ce.style.listStyleImage = f.list_bullet_image.value != "" ? "url(" + f.list_bullet_image.value + ")" : ""; + + // Build positioning styles + + ce.style.position = f.positioning_type.value; + ce.style.visibility = f.positioning_visibility.value; + + if (ce.style.width == "") + ce.style.width = f.positioning_width.value + (isNum(f.positioning_width.value) ? f.positioning_width_measurement.value : ""); + + if (ce.style.height == "") + ce.style.height = f.positioning_height.value + (isNum(f.positioning_height.value) ? f.positioning_height_measurement.value : ""); + + ce.style.zIndex = f.positioning_zindex.value; + ce.style.overflow = f.positioning_overflow.value; + + if (!f.positioning_placement_same.checked) { + ce.style.top = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : ""); + ce.style.right = f.positioning_placement_right.value + (isNum(f.positioning_placement_right.value) ? f.positioning_placement_right_measurement.value : ""); + ce.style.bottom = f.positioning_placement_bottom.value + (isNum(f.positioning_placement_bottom.value) ? f.positioning_placement_bottom_measurement.value : ""); + ce.style.left = f.positioning_placement_left.value + (isNum(f.positioning_placement_left.value) ? f.positioning_placement_left_measurement.value : ""); + } else { + s = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : ""); + ce.style.top = s; + ce.style.right = s; + ce.style.bottom = s; + ce.style.left = s; + } + + if (!f.positioning_clip_same.checked) { + s = "rect("; + s += (isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto") + " "; + s += (isNum(f.positioning_clip_right.value) ? f.positioning_clip_right.value + f.positioning_clip_right_measurement.value : "auto") + " "; + s += (isNum(f.positioning_clip_bottom.value) ? f.positioning_clip_bottom.value + f.positioning_clip_bottom_measurement.value : "auto") + " "; + s += (isNum(f.positioning_clip_left.value) ? f.positioning_clip_left.value + f.positioning_clip_left_measurement.value : "auto"); + s += ")"; + + if (s != "rect(auto auto auto auto)") + ce.style.clip = s; + } else { + s = "rect("; + t = isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto"; + s += t + " "; + s += t + " "; + s += t + " "; + s += t + ")"; + + if (s != "rect(auto auto auto auto)") + ce.style.clip = s; + } + + ce.style.cssText = ce.style.cssText; +} + +function isNum(s) { + return new RegExp('[0-9]+', 'g').test(s); +} + +function showDisabledControls() { + var f = document.forms, i, a; + + for (i=0; i 1) { + addSelectValue(f, s, p[0], p[1]); + + if (se) + selectByValue(f, s, p[1]); + } else { + addSelectValue(f, s, p[0], p[0]); + + if (se) + selectByValue(f, s, p[0]); + } + } +} + +function toggleSame(ce, pre) { + var el = document.forms[0].elements, i; + + if (ce.checked) { + el[pre + "_top"].disabled = false; + el[pre + "_right"].disabled = true; + el[pre + "_bottom"].disabled = true; + el[pre + "_left"].disabled = true; + + if (el[pre + "_top_measurement"]) { + el[pre + "_top_measurement"].disabled = false; + el[pre + "_right_measurement"].disabled = true; + el[pre + "_bottom_measurement"].disabled = true; + el[pre + "_left_measurement"].disabled = true; + } + } else { + el[pre + "_top"].disabled = false; + el[pre + "_right"].disabled = false; + el[pre + "_bottom"].disabled = false; + el[pre + "_left"].disabled = false; + + if (el[pre + "_top_measurement"]) { + el[pre + "_top_measurement"].disabled = false; + el[pre + "_right_measurement"].disabled = false; + el[pre + "_bottom_measurement"].disabled = false; + el[pre + "_left_measurement"].disabled = false; + } + } + + showDisabledControls(); +} + +function synch(fr, to) { + var f = document.forms[0]; + + f.elements[to].value = f.elements[fr].value; + + if (f.elements[fr + "_measurement"]) + selectByValue(f, to + "_measurement", f.elements[fr + "_measurement"].value); +} + +tinyMCEPopup.onInit.add(init); diff --git a/lib/editor/tinymce/plugins/style/langs/en_dlg.js b/lib/editor/tinymce/plugins/style/langs/en_dlg.js index 5026313e2e0..d9d77627b76 100644 --- a/lib/editor/tinymce/plugins/style/langs/en_dlg.js +++ b/lib/editor/tinymce/plugins/style/langs/en_dlg.js @@ -1,63 +1,63 @@ -tinyMCE.addI18n('en.style_dlg',{ -title:"Edit CSS Style", -apply:"Apply", -text_tab:"Text", -background_tab:"Background", -block_tab:"Block", -box_tab:"Box", -border_tab:"Border", -list_tab:"List", -positioning_tab:"Positioning", -text_props:"Text", -text_font:"Font", -text_size:"Size", -text_weight:"Weight", -text_style:"Style", -text_variant:"Variant", -text_lineheight:"Line height", -text_case:"Case", -text_color:"Color", -text_decoration:"Decoration", -text_overline:"overline", -text_underline:"underline", -text_striketrough:"strikethrough", -text_blink:"blink", -text_none:"none", -background_color:"Background color", -background_image:"Background image", -background_repeat:"Repeat", -background_attachment:"Attachment", -background_hpos:"Horizontal position", -background_vpos:"Vertical position", -block_wordspacing:"Word spacing", -block_letterspacing:"Letter spacing", -block_vertical_alignment:"Vertical alignment", -block_text_align:"Text align", -block_text_indent:"Text indent", -block_whitespace:"Whitespace", -block_display:"Display", -box_width:"Width", -box_height:"Height", -box_float:"Float", -box_clear:"Clear", -padding:"Padding", -same:"Same for all", -top:"Top", -right:"Right", -bottom:"Bottom", -left:"Left", -margin:"Margin", -style:"Style", -width:"Width", -height:"Height", -color:"Color", -list_type:"Type", -bullet_image:"Bullet image", -position:"Position", -positioning_type:"Type", -visibility:"Visibility", -zindex:"Z-index", -overflow:"Overflow", -placement:"Placement", -clip:"Clip" +tinyMCE.addI18n('en.style_dlg',{ +title:"Edit CSS Style", +apply:"Apply", +text_tab:"Text", +background_tab:"Background", +block_tab:"Block", +box_tab:"Box", +border_tab:"Border", +list_tab:"List", +positioning_tab:"Positioning", +text_props:"Text", +text_font:"Font", +text_size:"Size", +text_weight:"Weight", +text_style:"Style", +text_variant:"Variant", +text_lineheight:"Line height", +text_case:"Case", +text_color:"Color", +text_decoration:"Decoration", +text_overline:"overline", +text_underline:"underline", +text_striketrough:"strikethrough", +text_blink:"blink", +text_none:"none", +background_color:"Background color", +background_image:"Background image", +background_repeat:"Repeat", +background_attachment:"Attachment", +background_hpos:"Horizontal position", +background_vpos:"Vertical position", +block_wordspacing:"Word spacing", +block_letterspacing:"Letter spacing", +block_vertical_alignment:"Vertical alignment", +block_text_align:"Text align", +block_text_indent:"Text indent", +block_whitespace:"Whitespace", +block_display:"Display", +box_width:"Width", +box_height:"Height", +box_float:"Float", +box_clear:"Clear", +padding:"Padding", +same:"Same for all", +top:"Top", +right:"Right", +bottom:"Bottom", +left:"Left", +margin:"Margin", +style:"Style", +width:"Width", +height:"Height", +color:"Color", +list_type:"Type", +bullet_image:"Bullet image", +position:"Position", +positioning_type:"Type", +visibility:"Visibility", +zindex:"Z-index", +overflow:"Overflow", +placement:"Placement", +clip:"Clip" }); \ No newline at end of file diff --git a/lib/editor/tinymce/plugins/table/cell.htm b/lib/editor/tinymce/plugins/table/cell.htm index 1fabc8dc211..0b708bb7515 100644 --- a/lib/editor/tinymce/plugins/table/cell.htm +++ b/lib/editor/tinymce/plugins/table/cell.htm @@ -1,183 +1,183 @@ - - - - {#table_dlg.cell_title} - - - - - - - - -
    - - -
    -
    -
    - {#table_dlg.general_props} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - -
    - - - -
    - -
    -
    -
    - -
    -
    - {#table_dlg.advanced_props} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    - -
    - - - - - -
     
    -
    - - - - - -
     
    -
    - - - - - -
     
    -
    -
    -
    -
    - -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - - + + + + {#table_dlg.cell_title} + + + + + + + + +
    + + +
    +
    +
    + {#table_dlg.general_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + +
    + +
    +
    +
    + +
    +
    + {#table_dlg.advanced_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +
    + + + + + +
     
    +
    + + + + + +
     
    +
    + + + + + +
     
    +
    +
    +
    +
    + +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + + diff --git a/lib/editor/tinymce/plugins/table/css/cell.css b/lib/editor/tinymce/plugins/table/css/cell.css index a067ecdfedb..a47cc1a1efe 100644 --- a/lib/editor/tinymce/plugins/table/css/cell.css +++ b/lib/editor/tinymce/plugins/table/css/cell.css @@ -1,17 +1,17 @@ -/* CSS file for cell dialog in the table plugin */ - -.panel_wrapper div.current { - height: 200px; -} - -.advfield { - width: 200px; -} - -#action { - margin-bottom: 3px; -} - -#class { - width: 150px; +/* CSS file for cell dialog in the table plugin */ + +.panel_wrapper div.current { + height: 200px; +} + +.advfield { + width: 200px; +} + +#action { + margin-bottom: 3px; +} + +#class { + width: 150px; } \ No newline at end of file diff --git a/lib/editor/tinymce/plugins/table/css/row.css b/lib/editor/tinymce/plugins/table/css/row.css index 1f7755dafa8..0e397db3e25 100644 --- a/lib/editor/tinymce/plugins/table/css/row.css +++ b/lib/editor/tinymce/plugins/table/css/row.css @@ -1,25 +1,25 @@ -/* CSS file for row dialog in the table plugin */ - -.panel_wrapper div.current { - height: 200px; -} - -.advfield { - width: 200px; -} - -#action { - margin-bottom: 3px; -} - -#rowtype,#align,#valign,#class,#height { - width: 150px; -} - -#height { - width: 50px; -} - -.col2 { - padding-left: 20px; -} +/* CSS file for row dialog in the table plugin */ + +.panel_wrapper div.current { + height: 200px; +} + +.advfield { + width: 200px; +} + +#action { + margin-bottom: 3px; +} + +#rowtype,#align,#valign,#class,#height { + width: 150px; +} + +#height { + width: 50px; +} + +.col2 { + padding-left: 20px; +} diff --git a/lib/editor/tinymce/plugins/table/css/table.css b/lib/editor/tinymce/plugins/table/css/table.css index d11c3f69cba..8f107831efa 100644 --- a/lib/editor/tinymce/plugins/table/css/table.css +++ b/lib/editor/tinymce/plugins/table/css/table.css @@ -1,13 +1,13 @@ -/* CSS file for table dialog in the table plugin */ - -.panel_wrapper div.current { - height: 245px; -} - -.advfield { - width: 200px; -} - -#class { - width: 150px; -} +/* CSS file for table dialog in the table plugin */ + +.panel_wrapper div.current { + height: 245px; +} + +.advfield { + width: 200px; +} + +#class { + width: 150px; +} diff --git a/lib/editor/tinymce/plugins/table/js/cell.js b/lib/editor/tinymce/plugins/table/js/cell.js index f23b06751d1..07320ac2ac7 100644 --- a/lib/editor/tinymce/plugins/table/js/cell.js +++ b/lib/editor/tinymce/plugins/table/js/cell.js @@ -1,269 +1,269 @@ -tinyMCEPopup.requireLangPack(); - -var ed; - -function init() { - ed = tinyMCEPopup.editor; - tinyMCEPopup.resizeToInnerSize(); - - document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); - document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor'); - document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor') - - var inst = ed; - var tdElm = ed.dom.getParent(ed.selection.getNode(), "td,th"); - var formObj = document.forms[0]; - var st = ed.dom.parseStyle(ed.dom.getAttrib(tdElm, "style")); - - // Get table cell data - var celltype = tdElm.nodeName.toLowerCase(); - var align = ed.dom.getAttrib(tdElm, 'align'); - var valign = ed.dom.getAttrib(tdElm, 'valign'); - var width = trimSize(getStyle(tdElm, 'width', 'width')); - var height = trimSize(getStyle(tdElm, 'height', 'height')); - var bordercolor = convertRGBToHex(getStyle(tdElm, 'bordercolor', 'borderLeftColor')); - var bgcolor = convertRGBToHex(getStyle(tdElm, 'bgcolor', 'backgroundColor')); - var className = ed.dom.getAttrib(tdElm, 'class'); - var backgroundimage = getStyle(tdElm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");; - var id = ed.dom.getAttrib(tdElm, 'id'); - var lang = ed.dom.getAttrib(tdElm, 'lang'); - var dir = ed.dom.getAttrib(tdElm, 'dir'); - var scope = ed.dom.getAttrib(tdElm, 'scope'); - - // Setup form - addClassesToList('class', 'table_cell_styles'); - TinyMCE_EditableSelects.init(); - - formObj.bordercolor.value = bordercolor; - formObj.bgcolor.value = bgcolor; - formObj.backgroundimage.value = backgroundimage; - formObj.width.value = width; - formObj.height.value = height; - formObj.id.value = id; - formObj.lang.value = lang; - formObj.style.value = ed.dom.serializeStyle(st); - selectByValue(formObj, 'align', align); - selectByValue(formObj, 'valign', valign); - selectByValue(formObj, 'class', className, true, true); - selectByValue(formObj, 'celltype', celltype); - selectByValue(formObj, 'dir', dir); - selectByValue(formObj, 'scope', scope); - - // Resize some elements - if (isVisible('backgroundimagebrowser')) - document.getElementById('backgroundimage').style.width = '180px'; - - updateColor('bordercolor_pick', 'bordercolor'); - updateColor('bgcolor_pick', 'bgcolor'); -} - -function updateAction() { - var el, inst = ed, tdElm, trElm, tableElm, formObj = document.forms[0]; - - tinyMCEPopup.restoreSelection(); - el = ed.selection.getNode(); - tdElm = ed.dom.getParent(el, "td,th"); - trElm = ed.dom.getParent(el, "tr"); - tableElm = ed.dom.getParent(el, "table"); - - ed.execCommand('mceBeginUndoLevel'); - - switch (getSelectValue(formObj, 'action')) { - case "cell": - var celltype = getSelectValue(formObj, 'celltype'); - var scope = getSelectValue(formObj, 'scope'); - - function doUpdate(s) { - if (s) { - updateCell(tdElm); - - ed.addVisual(); - ed.nodeChanged(); - inst.execCommand('mceEndUndoLevel'); - tinyMCEPopup.close(); - } - }; - - if (ed.getParam("accessibility_warnings", 1)) { - if (celltype == "th" && scope == "") - tinyMCEPopup.confirm(ed.getLang('table_dlg.missing_scope', '', true), doUpdate); - else - doUpdate(1); - - return; - } - - updateCell(tdElm); - break; - - case "row": - var cell = trElm.firstChild; - - if (cell.nodeName != "TD" && cell.nodeName != "TH") - cell = nextCell(cell); - - do { - cell = updateCell(cell, true); - } while ((cell = nextCell(cell)) != null); - - break; - - case "all": - var rows = tableElm.getElementsByTagName("tr"); - - for (var i=0; i colLimit) { - tinyMCEPopup.alert(inst.getLang('table_dlg.col_limit').replace(/\{\$cols\}/g, colLimit)); - return false; - } else if (rowLimit && rows > rowLimit) { - tinyMCEPopup.alert(inst.getLang('table_dlg.row_limit').replace(/\{\$rows\}/g, rowLimit)); - return false; - } else if (cellLimit && cols * rows > cellLimit) { - tinyMCEPopup.alert(inst.getLang('table_dlg.cell_limit').replace(/\{\$cells\}/g, cellLimit)); - return false; - } - - // Update table - if (action == "update") { - inst.execCommand('mceBeginUndoLevel'); - - dom.setAttrib(elm, 'cellPadding', cellpadding, true); - dom.setAttrib(elm, 'cellSpacing', cellspacing, true); - dom.setAttrib(elm, 'border', border); - dom.setAttrib(elm, 'align', align); - dom.setAttrib(elm, 'frame', frame); - dom.setAttrib(elm, 'rules', rules); - dom.setAttrib(elm, 'class', className); - dom.setAttrib(elm, 'style', style); - dom.setAttrib(elm, 'id', id); - dom.setAttrib(elm, 'summary', summary); - dom.setAttrib(elm, 'dir', dir); - dom.setAttrib(elm, 'lang', lang); - - capEl = inst.dom.select('caption', elm)[0]; - - if (capEl && !caption) - capEl.parentNode.removeChild(capEl); - - if (!capEl && caption) { - capEl = elm.ownerDocument.createElement('caption'); - - if (!tinymce.isIE) - capEl.innerHTML = '
    '; - - elm.insertBefore(capEl, elm.firstChild); - } - - if (width && inst.settings.inline_styles) { - dom.setStyle(elm, 'width', width); - dom.setAttrib(elm, 'width', ''); - } else { - dom.setAttrib(elm, 'width', width, true); - dom.setStyle(elm, 'width', ''); - } - - // Remove these since they are not valid XHTML - dom.setAttrib(elm, 'borderColor', ''); - dom.setAttrib(elm, 'bgColor', ''); - dom.setAttrib(elm, 'background', ''); - - if (height && inst.settings.inline_styles) { - dom.setStyle(elm, 'height', height); - dom.setAttrib(elm, 'height', ''); - } else { - dom.setAttrib(elm, 'height', height, true); - dom.setStyle(elm, 'height', ''); - } - - if (background != '') - elm.style.backgroundImage = "url('" + background + "')"; - else - elm.style.backgroundImage = ''; - -/* if (tinyMCEPopup.getParam("inline_styles")) { - if (width != '') - elm.style.width = getCSSSize(width); - }*/ - - if (bordercolor != "") { - elm.style.borderColor = bordercolor; - elm.style.borderStyle = elm.style.borderStyle == "" ? "solid" : elm.style.borderStyle; - elm.style.borderWidth = border == "" ? "1px" : border; - } else - elm.style.borderColor = ''; - - elm.style.backgroundColor = bgcolor; - elm.style.height = getCSSSize(height); - - inst.addVisual(); - - // Fix for stange MSIE align bug - //elm.outerHTML = elm.outerHTML; - - inst.nodeChanged(); - inst.execCommand('mceEndUndoLevel'); - - // Repaint if dimensions changed - if (formObj.width.value != orgTableWidth || formObj.height.value != orgTableHeight) - inst.execCommand('mceRepaint'); - - tinyMCEPopup.close(); - return true; - } - - // Create new table - html += ''); - - tinymce.each('h1,h2,h3,h4,h5,h6,p'.split(','), function(n) { - if (patt) - patt += ','; - - patt += n + ' ._mce_marker'; - }); - - tinymce.each(inst.dom.select(patt), function(n) { - inst.dom.split(inst.dom.getParent(n, 'h1,h2,h3,h4,h5,h6,p'), n); - }); - - dom.setOuterHTML(dom.select('._mce_marker')[0], html); - - inst.selection.moveToBookmark(bm); - } else - inst.execCommand('mceInsertContent', false, html); - - inst.addVisual(); - inst.execCommand('mceEndUndoLevel'); - - tinyMCEPopup.close(); -} - -function makeAttrib(attrib, value) { - var formObj = document.forms[0]; - var valueElm = formObj.elements[attrib]; - - if (typeof(value) == "undefined" || value == null) { - value = ""; - - if (valueElm) - value = valueElm.value; - } - - if (value == "") - return ""; - - // XML encode it - value = value.replace(/&/g, '&'); - value = value.replace(/\"/g, '"'); - value = value.replace(//g, '>'); - - return ' ' + attrib + '="' + value + '"'; -} - -function init() { - tinyMCEPopup.resizeToInnerSize(); - - document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); - document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); - document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor'); - document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); - - var cols = 2, rows = 2, border = tinyMCEPopup.getParam('table_default_border', '0'), cellpadding = tinyMCEPopup.getParam('table_default_cellpadding', ''), cellspacing = tinyMCEPopup.getParam('table_default_cellspacing', ''); - var align = "", width = "", height = "", bordercolor = "", bgcolor = "", className = ""; - var id = "", summary = "", style = "", dir = "", lang = "", background = "", bgcolor = "", bordercolor = "", rules, frame; - var inst = tinyMCEPopup.editor, dom = inst.dom; - var formObj = document.forms[0]; - var elm = dom.getParent(inst.selection.getNode(), "table"); - - action = tinyMCEPopup.getWindowArg('action'); - - if (!action) - action = elm ? "update" : "insert"; - - if (elm && action != "insert") { - var rowsAr = elm.rows; - var cols = 0; - for (var i=0; i cols) - cols = rowsAr[i].cells.length; - - cols = cols; - rows = rowsAr.length; - - st = dom.parseStyle(dom.getAttrib(elm, "style")); - border = trimSize(getStyle(elm, 'border', 'borderWidth')); - cellpadding = dom.getAttrib(elm, 'cellpadding', ""); - cellspacing = dom.getAttrib(elm, 'cellspacing', ""); - width = trimSize(getStyle(elm, 'width', 'width')); - height = trimSize(getStyle(elm, 'height', 'height')); - bordercolor = convertRGBToHex(getStyle(elm, 'bordercolor', 'borderLeftColor')); - bgcolor = convertRGBToHex(getStyle(elm, 'bgcolor', 'backgroundColor')); - align = dom.getAttrib(elm, 'align', align); - frame = dom.getAttrib(elm, 'frame'); - rules = dom.getAttrib(elm, 'rules'); - className = tinymce.trim(dom.getAttrib(elm, 'class').replace(/mceItem.+/g, '')); - id = dom.getAttrib(elm, 'id'); - summary = dom.getAttrib(elm, 'summary'); - style = dom.serializeStyle(st); - dir = dom.getAttrib(elm, 'dir'); - lang = dom.getAttrib(elm, 'lang'); - background = getStyle(elm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); - formObj.caption.checked = elm.getElementsByTagName('caption').length > 0; - - orgTableWidth = width; - orgTableHeight = height; - - action = "update"; - formObj.insert.value = inst.getLang('update'); - } - - addClassesToList('class', "table_styles"); - TinyMCE_EditableSelects.init(); - - // Update form - selectByValue(formObj, 'align', align); - selectByValue(formObj, 'tframe', frame); - selectByValue(formObj, 'rules', rules); - selectByValue(formObj, 'class', className, true, true); - formObj.cols.value = cols; - formObj.rows.value = rows; - formObj.border.value = border; - formObj.cellpadding.value = cellpadding; - formObj.cellspacing.value = cellspacing; - formObj.width.value = width; - formObj.height.value = height; - formObj.bordercolor.value = bordercolor; - formObj.bgcolor.value = bgcolor; - formObj.id.value = id; - formObj.summary.value = summary; - formObj.style.value = style; - formObj.dir.value = dir; - formObj.lang.value = lang; - formObj.backgroundimage.value = background; - - updateColor('bordercolor_pick', 'bordercolor'); - updateColor('bgcolor_pick', 'bgcolor'); - - // Resize some elements - if (isVisible('backgroundimagebrowser')) - document.getElementById('backgroundimage').style.width = '180px'; - - // Disable some fields in update mode - if (action == "update") { - formObj.cols.disabled = true; - formObj.rows.disabled = true; - } -} - -function changedSize() { - var formObj = document.forms[0]; - var st = dom.parseStyle(formObj.style.value); - -/* var width = formObj.width.value; - if (width != "") - st['width'] = tinyMCEPopup.getParam("inline_styles") ? getCSSSize(width) : ""; - else - st['width'] = "";*/ - - var height = formObj.height.value; - if (height != "") - st['height'] = getCSSSize(height); - else - st['height'] = ""; - - formObj.style.value = dom.serializeStyle(st); -} - -function changedBackgroundImage() { - var formObj = document.forms[0]; - var st = dom.parseStyle(formObj.style.value); - - st['background-image'] = "url('" + formObj.backgroundimage.value + "')"; - - formObj.style.value = dom.serializeStyle(st); -} - -function changedBorder() { - var formObj = document.forms[0]; - var st = dom.parseStyle(formObj.style.value); - - // Update border width if the element has a color - if (formObj.border.value != "" && formObj.bordercolor.value != "") - st['border-width'] = formObj.border.value + "px"; - - formObj.style.value = dom.serializeStyle(st); -} - -function changedColor() { - var formObj = document.forms[0]; - var st = dom.parseStyle(formObj.style.value); - - st['background-color'] = formObj.bgcolor.value; - - if (formObj.bordercolor.value != "") { - st['border-color'] = formObj.bordercolor.value; - - // Add border-width if it's missing - if (!st['border-width']) - st['border-width'] = formObj.border.value == "" ? "1px" : formObj.border.value + "px"; - } - - formObj.style.value = dom.serializeStyle(st); -} - -function changedStyle() { - var formObj = document.forms[0]; - var st = dom.parseStyle(formObj.style.value); - - if (st['background-image']) - formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); - else - formObj.backgroundimage.value = ''; - - if (st['width']) - formObj.width.value = trimSize(st['width']); - - if (st['height']) - formObj.height.value = trimSize(st['height']); - - if (st['background-color']) { - formObj.bgcolor.value = st['background-color']; - updateColor('bgcolor_pick','bgcolor'); - } - - if (st['border-color']) { - formObj.bordercolor.value = st['border-color']; - updateColor('bordercolor_pick','bordercolor'); - } -} - -tinyMCEPopup.onInit.add(init); +tinyMCEPopup.requireLangPack(); + +var action, orgTableWidth, orgTableHeight, dom = tinyMCEPopup.editor.dom; + +function insertTable() { + var formObj = document.forms[0]; + var inst = tinyMCEPopup.editor, dom = inst.dom; + var cols = 2, rows = 2, border = 0, cellpadding = -1, cellspacing = -1, align, width, height, className, caption, frame, rules; + var html = '', capEl, elm; + var cellLimit, rowLimit, colLimit; + + tinyMCEPopup.restoreSelection(); + + if (!AutoValidator.validate(formObj)) { + tinyMCEPopup.alert(inst.getLang('invalid_data')); + return false; + } + + elm = dom.getParent(inst.selection.getNode(), 'table'); + + // Get form data + cols = formObj.elements['cols'].value; + rows = formObj.elements['rows'].value; + border = formObj.elements['border'].value != "" ? formObj.elements['border'].value : 0; + cellpadding = formObj.elements['cellpadding'].value != "" ? formObj.elements['cellpadding'].value : ""; + cellspacing = formObj.elements['cellspacing'].value != "" ? formObj.elements['cellspacing'].value : ""; + align = formObj.elements['align'].options[formObj.elements['align'].selectedIndex].value; + frame = formObj.elements['tframe'].options[formObj.elements['tframe'].selectedIndex].value; + rules = formObj.elements['rules'].options[formObj.elements['rules'].selectedIndex].value; + width = formObj.elements['width'].value; + height = formObj.elements['height'].value; + bordercolor = formObj.elements['bordercolor'].value; + bgcolor = formObj.elements['bgcolor'].value; + className = formObj.elements['class'].options[formObj.elements['class'].selectedIndex].value; + id = formObj.elements['id'].value; + summary = formObj.elements['summary'].value; + style = formObj.elements['style'].value; + dir = formObj.elements['dir'].value; + lang = formObj.elements['lang'].value; + background = formObj.elements['backgroundimage'].value; + caption = formObj.elements['caption'].checked; + + cellLimit = tinyMCEPopup.getParam('table_cell_limit', false); + rowLimit = tinyMCEPopup.getParam('table_row_limit', false); + colLimit = tinyMCEPopup.getParam('table_col_limit', false); + + // Validate table size + if (colLimit && cols > colLimit) { + tinyMCEPopup.alert(inst.getLang('table_dlg.col_limit').replace(/\{\$cols\}/g, colLimit)); + return false; + } else if (rowLimit && rows > rowLimit) { + tinyMCEPopup.alert(inst.getLang('table_dlg.row_limit').replace(/\{\$rows\}/g, rowLimit)); + return false; + } else if (cellLimit && cols * rows > cellLimit) { + tinyMCEPopup.alert(inst.getLang('table_dlg.cell_limit').replace(/\{\$cells\}/g, cellLimit)); + return false; + } + + // Update table + if (action == "update") { + inst.execCommand('mceBeginUndoLevel'); + + dom.setAttrib(elm, 'cellPadding', cellpadding, true); + dom.setAttrib(elm, 'cellSpacing', cellspacing, true); + dom.setAttrib(elm, 'border', border); + dom.setAttrib(elm, 'align', align); + dom.setAttrib(elm, 'frame', frame); + dom.setAttrib(elm, 'rules', rules); + dom.setAttrib(elm, 'class', className); + dom.setAttrib(elm, 'style', style); + dom.setAttrib(elm, 'id', id); + dom.setAttrib(elm, 'summary', summary); + dom.setAttrib(elm, 'dir', dir); + dom.setAttrib(elm, 'lang', lang); + + capEl = inst.dom.select('caption', elm)[0]; + + if (capEl && !caption) + capEl.parentNode.removeChild(capEl); + + if (!capEl && caption) { + capEl = elm.ownerDocument.createElement('caption'); + + if (!tinymce.isIE) + capEl.innerHTML = '
    '; + + elm.insertBefore(capEl, elm.firstChild); + } + + if (width && inst.settings.inline_styles) { + dom.setStyle(elm, 'width', width); + dom.setAttrib(elm, 'width', ''); + } else { + dom.setAttrib(elm, 'width', width, true); + dom.setStyle(elm, 'width', ''); + } + + // Remove these since they are not valid XHTML + dom.setAttrib(elm, 'borderColor', ''); + dom.setAttrib(elm, 'bgColor', ''); + dom.setAttrib(elm, 'background', ''); + + if (height && inst.settings.inline_styles) { + dom.setStyle(elm, 'height', height); + dom.setAttrib(elm, 'height', ''); + } else { + dom.setAttrib(elm, 'height', height, true); + dom.setStyle(elm, 'height', ''); + } + + if (background != '') + elm.style.backgroundImage = "url('" + background + "')"; + else + elm.style.backgroundImage = ''; + +/* if (tinyMCEPopup.getParam("inline_styles")) { + if (width != '') + elm.style.width = getCSSSize(width); + }*/ + + if (bordercolor != "") { + elm.style.borderColor = bordercolor; + elm.style.borderStyle = elm.style.borderStyle == "" ? "solid" : elm.style.borderStyle; + elm.style.borderWidth = border == "" ? "1px" : border; + } else + elm.style.borderColor = ''; + + elm.style.backgroundColor = bgcolor; + elm.style.height = getCSSSize(height); + + inst.addVisual(); + + // Fix for stange MSIE align bug + //elm.outerHTML = elm.outerHTML; + + inst.nodeChanged(); + inst.execCommand('mceEndUndoLevel'); + + // Repaint if dimensions changed + if (formObj.width.value != orgTableWidth || formObj.height.value != orgTableHeight) + inst.execCommand('mceRepaint'); + + tinyMCEPopup.close(); + return true; + } + + // Create new table + html += ''); + + tinymce.each('h1,h2,h3,h4,h5,h6,p'.split(','), function(n) { + if (patt) + patt += ','; + + patt += n + ' ._mce_marker'; + }); + + tinymce.each(inst.dom.select(patt), function(n) { + inst.dom.split(inst.dom.getParent(n, 'h1,h2,h3,h4,h5,h6,p'), n); + }); + + dom.setOuterHTML(dom.select('._mce_marker')[0], html); + + inst.selection.moveToBookmark(bm); + } else + inst.execCommand('mceInsertContent', false, html); + + inst.addVisual(); + inst.execCommand('mceEndUndoLevel'); + + tinyMCEPopup.close(); +} + +function makeAttrib(attrib, value) { + var formObj = document.forms[0]; + var valueElm = formObj.elements[attrib]; + + if (typeof(value) == "undefined" || value == null) { + value = ""; + + if (valueElm) + value = valueElm.value; + } + + if (value == "") + return ""; + + // XML encode it + value = value.replace(/&/g, '&'); + value = value.replace(/\"/g, '"'); + value = value.replace(//g, '>'); + + return ' ' + attrib + '="' + value + '"'; +} + +function init() { + tinyMCEPopup.resizeToInnerSize(); + + document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); + document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); + document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor'); + document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); + + var cols = 2, rows = 2, border = tinyMCEPopup.getParam('table_default_border', '0'), cellpadding = tinyMCEPopup.getParam('table_default_cellpadding', ''), cellspacing = tinyMCEPopup.getParam('table_default_cellspacing', ''); + var align = "", width = "", height = "", bordercolor = "", bgcolor = "", className = ""; + var id = "", summary = "", style = "", dir = "", lang = "", background = "", bgcolor = "", bordercolor = "", rules, frame; + var inst = tinyMCEPopup.editor, dom = inst.dom; + var formObj = document.forms[0]; + var elm = dom.getParent(inst.selection.getNode(), "table"); + + action = tinyMCEPopup.getWindowArg('action'); + + if (!action) + action = elm ? "update" : "insert"; + + if (elm && action != "insert") { + var rowsAr = elm.rows; + var cols = 0; + for (var i=0; i cols) + cols = rowsAr[i].cells.length; + + cols = cols; + rows = rowsAr.length; + + st = dom.parseStyle(dom.getAttrib(elm, "style")); + border = trimSize(getStyle(elm, 'border', 'borderWidth')); + cellpadding = dom.getAttrib(elm, 'cellpadding', ""); + cellspacing = dom.getAttrib(elm, 'cellspacing', ""); + width = trimSize(getStyle(elm, 'width', 'width')); + height = trimSize(getStyle(elm, 'height', 'height')); + bordercolor = convertRGBToHex(getStyle(elm, 'bordercolor', 'borderLeftColor')); + bgcolor = convertRGBToHex(getStyle(elm, 'bgcolor', 'backgroundColor')); + align = dom.getAttrib(elm, 'align', align); + frame = dom.getAttrib(elm, 'frame'); + rules = dom.getAttrib(elm, 'rules'); + className = tinymce.trim(dom.getAttrib(elm, 'class').replace(/mceItem.+/g, '')); + id = dom.getAttrib(elm, 'id'); + summary = dom.getAttrib(elm, 'summary'); + style = dom.serializeStyle(st); + dir = dom.getAttrib(elm, 'dir'); + lang = dom.getAttrib(elm, 'lang'); + background = getStyle(elm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); + formObj.caption.checked = elm.getElementsByTagName('caption').length > 0; + + orgTableWidth = width; + orgTableHeight = height; + + action = "update"; + formObj.insert.value = inst.getLang('update'); + } + + addClassesToList('class', "table_styles"); + TinyMCE_EditableSelects.init(); + + // Update form + selectByValue(formObj, 'align', align); + selectByValue(formObj, 'tframe', frame); + selectByValue(formObj, 'rules', rules); + selectByValue(formObj, 'class', className, true, true); + formObj.cols.value = cols; + formObj.rows.value = rows; + formObj.border.value = border; + formObj.cellpadding.value = cellpadding; + formObj.cellspacing.value = cellspacing; + formObj.width.value = width; + formObj.height.value = height; + formObj.bordercolor.value = bordercolor; + formObj.bgcolor.value = bgcolor; + formObj.id.value = id; + formObj.summary.value = summary; + formObj.style.value = style; + formObj.dir.value = dir; + formObj.lang.value = lang; + formObj.backgroundimage.value = background; + + updateColor('bordercolor_pick', 'bordercolor'); + updateColor('bgcolor_pick', 'bgcolor'); + + // Resize some elements + if (isVisible('backgroundimagebrowser')) + document.getElementById('backgroundimage').style.width = '180px'; + + // Disable some fields in update mode + if (action == "update") { + formObj.cols.disabled = true; + formObj.rows.disabled = true; + } +} + +function changedSize() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + +/* var width = formObj.width.value; + if (width != "") + st['width'] = tinyMCEPopup.getParam("inline_styles") ? getCSSSize(width) : ""; + else + st['width'] = "";*/ + + var height = formObj.height.value; + if (height != "") + st['height'] = getCSSSize(height); + else + st['height'] = ""; + + formObj.style.value = dom.serializeStyle(st); +} + +function changedBackgroundImage() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + + st['background-image'] = "url('" + formObj.backgroundimage.value + "')"; + + formObj.style.value = dom.serializeStyle(st); +} + +function changedBorder() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + + // Update border width if the element has a color + if (formObj.border.value != "" && formObj.bordercolor.value != "") + st['border-width'] = formObj.border.value + "px"; + + formObj.style.value = dom.serializeStyle(st); +} + +function changedColor() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + + st['background-color'] = formObj.bgcolor.value; + + if (formObj.bordercolor.value != "") { + st['border-color'] = formObj.bordercolor.value; + + // Add border-width if it's missing + if (!st['border-width']) + st['border-width'] = formObj.border.value == "" ? "1px" : formObj.border.value + "px"; + } + + formObj.style.value = dom.serializeStyle(st); +} + +function changedStyle() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + + if (st['background-image']) + formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); + else + formObj.backgroundimage.value = ''; + + if (st['width']) + formObj.width.value = trimSize(st['width']); + + if (st['height']) + formObj.height.value = trimSize(st['height']); + + if (st['background-color']) { + formObj.bgcolor.value = st['background-color']; + updateColor('bgcolor_pick','bgcolor'); + } + + if (st['border-color']) { + formObj.bordercolor.value = st['border-color']; + updateColor('bordercolor_pick','bordercolor'); + } +} + +tinyMCEPopup.onInit.add(init); diff --git a/lib/editor/tinymce/plugins/table/langs/en_dlg.js b/lib/editor/tinymce/plugins/table/langs/en_dlg.js index 000332a35da..a33c987c02c 100644 --- a/lib/editor/tinymce/plugins/table/langs/en_dlg.js +++ b/lib/editor/tinymce/plugins/table/langs/en_dlg.js @@ -1,74 +1,74 @@ -tinyMCE.addI18n('en.table_dlg',{ -general_tab:"General", -advanced_tab:"Advanced", -general_props:"General properties", -advanced_props:"Advanced properties", -rowtype:"Row in table part", -title:"Insert/Modify table", -width:"Width", -height:"Height", -cols:"Cols", -rows:"Rows", -cellspacing:"Cellspacing", -cellpadding:"Cellpadding", -border:"Border", -align:"Alignment", -align_default:"Default", -align_left:"Left", -align_right:"Right", -align_middle:"Center", -row_title:"Table row properties", -cell_title:"Table cell properties", -cell_type:"Cell type", -valign:"Vertical alignment", -align_top:"Top", -align_bottom:"Bottom", -bordercolor:"Border color", -bgcolor:"Background color", -merge_cells_title:"Merge table cells", -id:"Id", -style:"Style", -langdir:"Language direction", -langcode:"Language code", -mime:"Target MIME type", -ltr:"Left to right", -rtl:"Right to left", -bgimage:"Background image", -summary:"Summary", -td:"Data", -th:"Header", -cell_cell:"Update current cell", -cell_row:"Update all cells in row", -cell_all:"Update all cells in table", -row_row:"Update current row", -row_odd:"Update odd rows in table", -row_even:"Update even rows in table", -row_all:"Update all rows in table", -thead:"Table Head", -tbody:"Table Body", -tfoot:"Table Foot", -scope:"Scope", -rowgroup:"Row Group", -colgroup:"Col Group", -col_limit:"You've exceeded the maximum number of columns of {$cols}.", -row_limit:"You've exceeded the maximum number of rows of {$rows}.", -cell_limit:"You've exceeded the maximum number of cells of {$cells}.", -missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.", -caption:"Table caption", -frame:"Frame", -frame_none:"none", -frame_groups:"groups", -frame_rows:"rows", -frame_cols:"cols", -frame_all:"all", -rules:"Rules", -rules_void:"void", -rules_above:"above", -rules_below:"below", -rules_hsides:"hsides", -rules_lhs:"lhs", -rules_rhs:"rhs", -rules_vsides:"vsides", -rules_box:"box", -rules_border:"border" +tinyMCE.addI18n('en.table_dlg',{ +general_tab:"General", +advanced_tab:"Advanced", +general_props:"General properties", +advanced_props:"Advanced properties", +rowtype:"Row in table part", +title:"Insert/Modify table", +width:"Width", +height:"Height", +cols:"Cols", +rows:"Rows", +cellspacing:"Cellspacing", +cellpadding:"Cellpadding", +border:"Border", +align:"Alignment", +align_default:"Default", +align_left:"Left", +align_right:"Right", +align_middle:"Center", +row_title:"Table row properties", +cell_title:"Table cell properties", +cell_type:"Cell type", +valign:"Vertical alignment", +align_top:"Top", +align_bottom:"Bottom", +bordercolor:"Border color", +bgcolor:"Background color", +merge_cells_title:"Merge table cells", +id:"Id", +style:"Style", +langdir:"Language direction", +langcode:"Language code", +mime:"Target MIME type", +ltr:"Left to right", +rtl:"Right to left", +bgimage:"Background image", +summary:"Summary", +td:"Data", +th:"Header", +cell_cell:"Update current cell", +cell_row:"Update all cells in row", +cell_all:"Update all cells in table", +row_row:"Update current row", +row_odd:"Update odd rows in table", +row_even:"Update even rows in table", +row_all:"Update all rows in table", +thead:"Table Head", +tbody:"Table Body", +tfoot:"Table Foot", +scope:"Scope", +rowgroup:"Row Group", +colgroup:"Col Group", +col_limit:"You've exceeded the maximum number of columns of {$cols}.", +row_limit:"You've exceeded the maximum number of rows of {$rows}.", +cell_limit:"You've exceeded the maximum number of cells of {$cells}.", +missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.", +caption:"Table caption", +frame:"Frame", +frame_none:"none", +frame_groups:"groups", +frame_rows:"rows", +frame_cols:"cols", +frame_all:"all", +rules:"Rules", +rules_void:"void", +rules_above:"above", +rules_below:"below", +rules_hsides:"hsides", +rules_lhs:"lhs", +rules_rhs:"rhs", +rules_vsides:"vsides", +rules_box:"box", +rules_border:"border" }); \ No newline at end of file diff --git a/lib/editor/tinymce/plugins/table/merge_cells.htm b/lib/editor/tinymce/plugins/table/merge_cells.htm index 25d42eb6574..4ba5767c7d1 100644 --- a/lib/editor/tinymce/plugins/table/merge_cells.htm +++ b/lib/editor/tinymce/plugins/table/merge_cells.htm @@ -1,37 +1,37 @@ - - - - {#table_dlg.merge_cells_title} - - - - - - -
    -
    - {#table_dlg.merge_cells_title} - - - - - - - - - -
    {#table_dlg.cols}:
    {#table_dlg.rows}:
    -
    - -
    -
    - -
    - -
    - -
    -
    -
    - - + + + + {#table_dlg.merge_cells_title} + + + + + + +
    +
    + {#table_dlg.merge_cells_title} + + + + + + + + + +
    {#table_dlg.cols}:
    {#table_dlg.rows}:
    +
    + +
    +
    + +
    + +
    + +
    +
    +
    + + diff --git a/lib/editor/tinymce/plugins/table/row.htm b/lib/editor/tinymce/plugins/table/row.htm index 07ca13c9832..697bff9beea 100644 --- a/lib/editor/tinymce/plugins/table/row.htm +++ b/lib/editor/tinymce/plugins/table/row.htm @@ -1,160 +1,160 @@ - - - - {#table_dlg.row_title} - - - - - - - - -
    - - -
    -
    -
    - {#table_dlg.general_props} - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    - -
    - -
    - -
    -
    -
    - -
    -
    - {#table_dlg.advanced_props} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    - -
    - - - - - -
     
    -
    - - - - - -
     
    -
    -
    -
    -
    - -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - - + + + + {#table_dlg.row_title} + + + + + + + + +
    + + +
    +
    +
    + {#table_dlg.general_props} + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +
    + +
    + +
    +
    +
    + +
    +
    + {#table_dlg.advanced_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +
    + + + + + +
     
    +
    + + + + + +
     
    +
    +
    +
    +
    + +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + + diff --git a/lib/editor/tinymce/plugins/table/table.htm b/lib/editor/tinymce/plugins/table/table.htm index 37e61597065..0b0fb237e36 100644 --- a/lib/editor/tinymce/plugins/table/table.htm +++ b/lib/editor/tinymce/plugins/table/table.htm @@ -1,192 +1,192 @@ - - - - {#table_dlg.title} - - - - - - - - - -
    - - -
    -
    -
    - {#table_dlg.general_props} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    - -
    -
    - {#table_dlg.advanced_props} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    - - - - - -
     
    -
    - -
    - -
    - -
    - - - - - -
     
    -
    - - - - - -
     
    -
    -
    -
    -
    - -
    -
    - -
    - -
    - -
    -
    -
    - - + + + + {#table_dlg.title} + + + + + + + + + +
    + + +
    +
    +
    + {#table_dlg.general_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + {#table_dlg.advanced_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + + +
     
    +
    + +
    + +
    + +
    + + + + + +
     
    +
    + + + + + +
     
    +
    +
    +
    +
    + +
    +
    + +
    + +
    + +
    +
    +
    + + diff --git a/lib/editor/tinymce/plugins/template/blank.htm b/lib/editor/tinymce/plugins/template/blank.htm index ecde53fae7f..538a3b12c95 100644 --- a/lib/editor/tinymce/plugins/template/blank.htm +++ b/lib/editor/tinymce/plugins/template/blank.htm @@ -1,12 +1,12 @@ - - - blank_page - - - - - - - + + + blank_page + + + + + + + diff --git a/lib/editor/tinymce/plugins/template/css/template.css b/lib/editor/tinymce/plugins/template/css/template.css index 2d23a4938c2..0a03f2e5c0e 100644 --- a/lib/editor/tinymce/plugins/template/css/template.css +++ b/lib/editor/tinymce/plugins/template/css/template.css @@ -1,23 +1,23 @@ -#frmbody { - padding: 10px; - background-color: #FFF; - border: 1px solid #CCC; -} - -.frmRow { - margin-bottom: 10px; -} - -#templatesrc { - border: none; - width: 320px; - height: 240px; -} - -.title { - padding-bottom: 5px; -} - -.mceActionPanel { - padding-top: 5px; -} +#frmbody { + padding: 10px; + background-color: #FFF; + border: 1px solid #CCC; +} + +.frmRow { + margin-bottom: 10px; +} + +#templatesrc { + border: none; + width: 320px; + height: 240px; +} + +.title { + padding-bottom: 5px; +} + +.mceActionPanel { + padding-top: 5px; +} diff --git a/lib/editor/tinymce/plugins/template/js/template.js b/lib/editor/tinymce/plugins/template/js/template.js index 24045d7311a..7eab2ebbd01 100644 --- a/lib/editor/tinymce/plugins/template/js/template.js +++ b/lib/editor/tinymce/plugins/template/js/template.js @@ -1,106 +1,106 @@ -tinyMCEPopup.requireLangPack(); - -var TemplateDialog = { - preInit : function() { - var url = tinyMCEPopup.getParam("template_external_list_url"); - - if (url != null) - document.write(''); - }, - - init : function() { - var ed = tinyMCEPopup.editor, tsrc, sel, x, u; - - tsrc = ed.getParam("template_templates", false); - sel = document.getElementById('tpath'); - - // Setup external template list - if (!tsrc && typeof(tinyMCETemplateList) != 'undefined') { - for (x=0, tsrc = []; x'); - }); - }, - - selectTemplate : function(u, ti) { - var d = window.frames['templatesrc'].document, x, tsrc = this.tsrc; - - if (!u) - return; - - d.body.innerHTML = this.templateHTML = this.getFileContents(u); - - for (x=0; x'); + }, + + init : function() { + var ed = tinyMCEPopup.editor, tsrc, sel, x, u; + + tsrc = ed.getParam("template_templates", false); + sel = document.getElementById('tpath'); + + // Setup external template list + if (!tsrc && typeof(tinyMCETemplateList) != 'undefined') { + for (x=0, tsrc = []; x'); + }); + }, + + selectTemplate : function(u, ti) { + var d = window.frames['templatesrc'].document, x, tsrc = this.tsrc; + + if (!u) + return; + + d.body.innerHTML = this.templateHTML = this.getFileContents(u); + + for (x=0; x - - {#template_dlg.title} - - - - - -
    -
    -
    {#template_dlg.desc}
    -
    - -
    -
    -
    -
    - {#template_dlg.preview} - -
    -
    - -
    -
    - -
    - -
    - -
    - -
    -
    -
    - - + + + {#template_dlg.title} + + + + + +
    +
    +
    {#template_dlg.desc}
    +
    + +
    +
    +
    +
    + {#template_dlg.preview} + +
    +
    + +
    +
    + +
    + +
    + +
    + +
    +
    +
    + + diff --git a/lib/editor/tinymce/plugins/xhtmlxtras/abbr.htm b/lib/editor/tinymce/plugins/xhtmlxtras/abbr.htm index 3928a17e14b..27a9a1413e7 100644 --- a/lib/editor/tinymce/plugins/xhtmlxtras/abbr.htm +++ b/lib/editor/tinymce/plugins/xhtmlxtras/abbr.htm @@ -1,148 +1,148 @@ - - - - {#xhtmlxtras_dlg.title_abbr_element} - - - - - - - - - -
    - - -
    -
    -
    - {#xhtmlxtras_dlg.fieldset_attrib_tab} - - - - - - - - - - - - - - - - - - - - - - - - - -
    :
    :
    : - -
    :
    : - -
    : - -
    -
    -
    -
    -
    - {#xhtmlxtras_dlg.fieldset_events_tab} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    - - + + + + {#xhtmlxtras_dlg.title_abbr_element} + + + + + + + + + +
    + + +
    +
    +
    + {#xhtmlxtras_dlg.fieldset_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + +
    :
    :
    : + +
    :
    : + +
    : + +
    +
    +
    +
    +
    + {#xhtmlxtras_dlg.fieldset_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    + + diff --git a/lib/editor/tinymce/plugins/xhtmlxtras/acronym.htm b/lib/editor/tinymce/plugins/xhtmlxtras/acronym.htm index 4d4ebaac0ae..9a0f8f31b02 100644 --- a/lib/editor/tinymce/plugins/xhtmlxtras/acronym.htm +++ b/lib/editor/tinymce/plugins/xhtmlxtras/acronym.htm @@ -1,148 +1,148 @@ - - - - {#xhtmlxtras_dlg.title_acronym_element} - - - - - - - - - -
    - - -
    -
    -
    - {#xhtmlxtras_dlg.fieldset_attrib_tab} - - - - - - - - - - - - - - - - - - - - - - - - - -
    :
    :
    : - -
    :
    : - -
    : - -
    -
    -
    -
    -
    - {#xhtmlxtras_dlg.fieldset_events_tab} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    - - + + + + {#xhtmlxtras_dlg.title_acronym_element} + + + + + + + + + +
    + + +
    +
    +
    + {#xhtmlxtras_dlg.fieldset_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + +
    :
    :
    : + +
    :
    : + +
    : + +
    +
    +
    +
    +
    + {#xhtmlxtras_dlg.fieldset_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    + + diff --git a/lib/editor/tinymce/plugins/xhtmlxtras/attributes.htm b/lib/editor/tinymce/plugins/xhtmlxtras/attributes.htm index 322b468e38b..88bd1dee5bd 100644 --- a/lib/editor/tinymce/plugins/xhtmlxtras/attributes.htm +++ b/lib/editor/tinymce/plugins/xhtmlxtras/attributes.htm @@ -1,153 +1,153 @@ - - - - {#xhtmlxtras_dlg.attribs_title} - - - - - - - - -
    - - -
    -
    -
    - {#xhtmlxtras_dlg.attribute_attrib_tab} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    :
    :
    - -
    :
    : - -
    : - -
    -
    -
    -
    -
    - {#xhtmlxtras_dlg.attribute_events_tab} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    - - + + + + {#xhtmlxtras_dlg.attribs_title} + + + + + + + + +
    + + +
    +
    +
    + {#xhtmlxtras_dlg.attribute_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    :
    :
    + +
    :
    : + +
    : + +
    +
    +
    +
    +
    + {#xhtmlxtras_dlg.attribute_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    + + diff --git a/lib/editor/tinymce/plugins/xhtmlxtras/cite.htm b/lib/editor/tinymce/plugins/xhtmlxtras/cite.htm index cdfaf4e8546..988bf38c45a 100644 --- a/lib/editor/tinymce/plugins/xhtmlxtras/cite.htm +++ b/lib/editor/tinymce/plugins/xhtmlxtras/cite.htm @@ -1,148 +1,148 @@ - - - - {#xhtmlxtras_dlg.title_cite_element} - - - - - - - - - -
    - - -
    -
    -
    - {#xhtmlxtras_dlg.fieldset_attrib_tab} - - - - - - - - - - - - - - - - - - - - - - - - - -
    :
    :
    : - -
    :
    : - -
    : - -
    -
    -
    -
    -
    - {#xhtmlxtras_dlg.fieldset_events_tab} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    - - + + + + {#xhtmlxtras_dlg.title_cite_element} + + + + + + + + + +
    + + +
    +
    +
    + {#xhtmlxtras_dlg.fieldset_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + +
    :
    :
    : + +
    :
    : + +
    : + +
    +
    +
    +
    +
    + {#xhtmlxtras_dlg.fieldset_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    + + diff --git a/lib/editor/tinymce/plugins/xhtmlxtras/css/attributes.css b/lib/editor/tinymce/plugins/xhtmlxtras/css/attributes.css index 9a6a235c35f..85b1b376deb 100644 --- a/lib/editor/tinymce/plugins/xhtmlxtras/css/attributes.css +++ b/lib/editor/tinymce/plugins/xhtmlxtras/css/attributes.css @@ -1,11 +1,11 @@ -.panel_wrapper div.current { - height: 290px; -} - -#id, #style, #title, #dir, #hreflang, #lang, #classlist, #tabindex, #accesskey { - width: 200px; -} - -#events_panel input { - width: 200px; -} +.panel_wrapper div.current { + height: 290px; +} + +#id, #style, #title, #dir, #hreflang, #lang, #classlist, #tabindex, #accesskey { + width: 200px; +} + +#events_panel input { + width: 200px; +} diff --git a/lib/editor/tinymce/plugins/xhtmlxtras/css/popup.css b/lib/editor/tinymce/plugins/xhtmlxtras/css/popup.css index e67114dbaaf..034b985272c 100644 --- a/lib/editor/tinymce/plugins/xhtmlxtras/css/popup.css +++ b/lib/editor/tinymce/plugins/xhtmlxtras/css/popup.css @@ -1,9 +1,9 @@ -input.field, select.field {width:200px;} -input.picker {width:179px; margin-left: 5px;} -input.disabled {border-color:#F2F2F2;} -img.picker {vertical-align:text-bottom; cursor:pointer;} -h1 {padding: 0 0 5px 0;} -.panel_wrapper div.current {height:160px;} -#xhtmlxtrasdel .panel_wrapper div.current, #xhtmlxtrasins .panel_wrapper div.current {height: 230px;} -a.browse span {display:block; width:20px; height:20px; background:url('../../../themes/advanced/img/icons.gif') -140px -20px;} -#datetime {width:180px;} +input.field, select.field {width:200px;} +input.picker {width:179px; margin-left: 5px;} +input.disabled {border-color:#F2F2F2;} +img.picker {vertical-align:text-bottom; cursor:pointer;} +h1 {padding: 0 0 5px 0;} +.panel_wrapper div.current {height:160px;} +#xhtmlxtrasdel .panel_wrapper div.current, #xhtmlxtrasins .panel_wrapper div.current {height: 230px;} +a.browse span {display:block; width:20px; height:20px; background:url('../../../themes/advanced/img/icons.gif') -140px -20px;} +#datetime {width:180px;} diff --git a/lib/editor/tinymce/plugins/xhtmlxtras/del.htm b/lib/editor/tinymce/plugins/xhtmlxtras/del.htm index f45676e3d47..f849fc5f96a 100644 --- a/lib/editor/tinymce/plugins/xhtmlxtras/del.htm +++ b/lib/editor/tinymce/plugins/xhtmlxtras/del.htm @@ -1,169 +1,169 @@ - - - - {#xhtmlxtras_dlg.title_del_element} - - - - - - - - - -
    - - -
    -
    -
    - {#xhtmlxtras_dlg.fieldset_general_tab} - - - - - - - - - -
    : - - - - - -
    -
    :
    -
    -
    - {#xhtmlxtras_dlg.fieldset_attrib_tab} - - - - - - - - - - - - - - - - - - - - - - - - - -
    :
    :
    : - -
    :
    : - -
    : - -
    -
    -
    -
    -
    - {#xhtmlxtras_dlg.fieldset_events_tab} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    - - - + + + + {#xhtmlxtras_dlg.title_del_element} + + + + + + + + + +
    + + +
    +
    +
    + {#xhtmlxtras_dlg.fieldset_general_tab} + + + + + + + + + +
    : + + + + + +
    +
    :
    +
    +
    + {#xhtmlxtras_dlg.fieldset_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + +
    :
    :
    : + +
    :
    : + +
    : + +
    +
    +
    +
    +
    + {#xhtmlxtras_dlg.fieldset_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    + + + diff --git a/lib/editor/tinymce/plugins/xhtmlxtras/ins.htm b/lib/editor/tinymce/plugins/xhtmlxtras/ins.htm index 9fa21c43386..c9c9d4446da 100644 --- a/lib/editor/tinymce/plugins/xhtmlxtras/ins.htm +++ b/lib/editor/tinymce/plugins/xhtmlxtras/ins.htm @@ -1,169 +1,169 @@ - - - - {#xhtmlxtras_dlg.title_ins_element} - - - - - - - - - -
    - - -
    -
    -
    - {#xhtmlxtras_dlg.fieldset_general_tab} - - - - - - - - - -
    : - - - - - -
    -
    :
    -
    -
    - {#xhtmlxtras_dlg.fieldset_attrib_tab} - - - - - - - - - - - - - - - - - - - - - - - - - -
    :
    :
    : - -
    :
    : - -
    : - -
    -
    -
    -
    -
    - {#xhtmlxtras_dlg.fieldset_events_tab} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    - - - + + + + {#xhtmlxtras_dlg.title_ins_element} + + + + + + + + + +
    + + +
    +
    +
    + {#xhtmlxtras_dlg.fieldset_general_tab} + + + + + + + + + +
    : + + + + + +
    +
    :
    +
    +
    + {#xhtmlxtras_dlg.fieldset_attrib_tab} + + + + + + + + + + + + + + + + + + + + + + + + + +
    :
    :
    : + +
    :
    : + +
    : + +
    +
    +
    +
    +
    + {#xhtmlxtras_dlg.fieldset_events_tab} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    + + + diff --git a/lib/editor/tinymce/plugins/xhtmlxtras/js/abbr.js b/lib/editor/tinymce/plugins/xhtmlxtras/js/abbr.js index 29311c2e8bc..9ad3166c770 100644 --- a/lib/editor/tinymce/plugins/xhtmlxtras/js/abbr.js +++ b/lib/editor/tinymce/plugins/xhtmlxtras/js/abbr.js @@ -1,25 +1,25 @@ - /** - * $Id$ - * - * @author Moxiecode - based on work by Andrew Tetlaw - * @copyright Copyright 2004-2008, Moxiecode Systems AB, All rights reserved. - */ - -function init() { - SXE.initElementDialog('abbr'); - if (SXE.currentAction == "update") { - SXE.showRemoveButton(); - } -} - -function insertAbbr() { - SXE.insertElement(tinymce.isIE ? 'html:abbr' : 'abbr'); - tinyMCEPopup.close(); -} - -function removeAbbr() { - SXE.removeElement('abbr'); - tinyMCEPopup.close(); -} - -tinyMCEPopup.onInit.add(init); + /** + * $Id$ + * + * @author Moxiecode - based on work by Andrew Tetlaw + * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +function init() { + SXE.initElementDialog('abbr'); + if (SXE.currentAction == "update") { + SXE.showRemoveButton(); + } +} + +function insertAbbr() { + SXE.insertElement(tinymce.isIE ? 'html:abbr' : 'abbr'); + tinyMCEPopup.close(); +} + +function removeAbbr() { + SXE.removeElement('abbr'); + tinyMCEPopup.close(); +} + +tinyMCEPopup.onInit.add(init); diff --git a/lib/editor/tinymce/plugins/xhtmlxtras/js/acronym.js b/lib/editor/tinymce/plugins/xhtmlxtras/js/acronym.js index 386ee311f07..e215b815d7f 100644 --- a/lib/editor/tinymce/plugins/xhtmlxtras/js/acronym.js +++ b/lib/editor/tinymce/plugins/xhtmlxtras/js/acronym.js @@ -1,25 +1,25 @@ - /** - * $Id$ - * - * @author Moxiecode - based on work by Andrew Tetlaw - * @copyright Copyright 2004-2008, Moxiecode Systems AB, All rights reserved. - */ - -function init() { - SXE.initElementDialog('acronym'); - if (SXE.currentAction == "update") { - SXE.showRemoveButton(); - } -} - -function insertAcronym() { - SXE.insertElement('acronym'); - tinyMCEPopup.close(); -} - -function removeAcronym() { - SXE.removeElement('acronym'); - tinyMCEPopup.close(); -} - -tinyMCEPopup.onInit.add(init); + /** + * $Id$ + * + * @author Moxiecode - based on work by Andrew Tetlaw + * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +function init() { + SXE.initElementDialog('acronym'); + if (SXE.currentAction == "update") { + SXE.showRemoveButton(); + } +} + +function insertAcronym() { + SXE.insertElement('acronym'); + tinyMCEPopup.close(); +} + +function removeAcronym() { + SXE.removeElement('acronym'); + tinyMCEPopup.close(); +} + +tinyMCEPopup.onInit.add(init); diff --git a/lib/editor/tinymce/plugins/xhtmlxtras/js/attributes.js b/lib/editor/tinymce/plugins/xhtmlxtras/js/attributes.js index b2c31554347..6442e4a5bc4 100644 --- a/lib/editor/tinymce/plugins/xhtmlxtras/js/attributes.js +++ b/lib/editor/tinymce/plugins/xhtmlxtras/js/attributes.js @@ -1,123 +1,123 @@ - /** - * $Id$ - * - * @author Moxiecode - based on work by Andrew Tetlaw - * @copyright Copyright 2004-2006, Moxiecode Systems AB, All rights reserved. - */ - -function init() { - tinyMCEPopup.resizeToInnerSize(); - var inst = tinyMCEPopup.editor; - var dom = inst.dom; - var elm = inst.selection.getNode(); - var f = document.forms[0]; - var onclick = dom.getAttrib(elm, 'onclick'); - - setFormValue('title', dom.getAttrib(elm, 'title')); - setFormValue('id', dom.getAttrib(elm, 'id')); - setFormValue('style', dom.getAttrib(elm, "style")); - setFormValue('dir', dom.getAttrib(elm, 'dir')); - setFormValue('lang', dom.getAttrib(elm, 'lang')); - setFormValue('tabindex', dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : "")); - setFormValue('accesskey', dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : "")); - setFormValue('onfocus', dom.getAttrib(elm, 'onfocus')); - setFormValue('onblur', dom.getAttrib(elm, 'onblur')); - setFormValue('onclick', onclick); - setFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick')); - setFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown')); - setFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup')); - setFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover')); - setFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove')); - setFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout')); - setFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress')); - setFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown')); - setFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup')); - className = dom.getAttrib(elm, 'class'); - - addClassesToList('classlist', 'advlink_styles'); - selectByValue(f, 'classlist', className, true); - - TinyMCE_EditableSelects.init(); -} - -function setFormValue(name, value) { - if(value && document.forms[0].elements[name]){ - document.forms[0].elements[name].value = value; - } -} - -function insertAction() { - var inst = tinyMCEPopup.editor; - var elm = inst.selection.getNode(); - - tinyMCEPopup.execCommand("mceBeginUndoLevel"); - setAllAttribs(elm); - tinyMCEPopup.execCommand("mceEndUndoLevel"); - tinyMCEPopup.close(); -} - -function setAttrib(elm, attrib, value) { - var formObj = document.forms[0]; - var valueElm = formObj.elements[attrib.toLowerCase()]; - var inst = tinyMCEPopup.editor; - var dom = inst.dom; - - if (typeof(value) == "undefined" || value == null) { - value = ""; - - if (valueElm) - value = valueElm.value; - } - - if (value != "") { - dom.setAttrib(elm, attrib.toLowerCase(), value); - - if (attrib == "style") - attrib = "style.cssText"; - - if (attrib.substring(0, 2) == 'on') - value = 'return true;' + value; - - if (attrib == "class") - attrib = "className"; - - elm[attrib]=value; - } else - elm.removeAttribute(attrib); -} - -function setAllAttribs(elm) { - var f = document.forms[0]; - - setAttrib(elm, 'title'); - setAttrib(elm, 'id'); - setAttrib(elm, 'style'); - setAttrib(elm, 'class', getSelectValue(f, 'classlist')); - setAttrib(elm, 'dir'); - setAttrib(elm, 'lang'); - setAttrib(elm, 'tabindex'); - setAttrib(elm, 'accesskey'); - setAttrib(elm, 'onfocus'); - setAttrib(elm, 'onblur'); - setAttrib(elm, 'onclick'); - setAttrib(elm, 'ondblclick'); - setAttrib(elm, 'onmousedown'); - setAttrib(elm, 'onmouseup'); - setAttrib(elm, 'onmouseover'); - setAttrib(elm, 'onmousemove'); - setAttrib(elm, 'onmouseout'); - setAttrib(elm, 'onkeypress'); - setAttrib(elm, 'onkeydown'); - setAttrib(elm, 'onkeyup'); - - // Refresh in old MSIE -// if (tinyMCE.isMSIE5) -// elm.outerHTML = elm.outerHTML; -} - -function insertAttribute() { - tinyMCEPopup.close(); -} - -tinyMCEPopup.onInit.add(init); -tinyMCEPopup.requireLangPack(); + /** + * $Id$ + * + * @author Moxiecode - based on work by Andrew Tetlaw + * @copyright Copyright � 2004-2006, Moxiecode Systems AB, All rights reserved. + */ + +function init() { + tinyMCEPopup.resizeToInnerSize(); + var inst = tinyMCEPopup.editor; + var dom = inst.dom; + var elm = inst.selection.getNode(); + var f = document.forms[0]; + var onclick = dom.getAttrib(elm, 'onclick'); + + setFormValue('title', dom.getAttrib(elm, 'title')); + setFormValue('id', dom.getAttrib(elm, 'id')); + setFormValue('style', dom.getAttrib(elm, "style")); + setFormValue('dir', dom.getAttrib(elm, 'dir')); + setFormValue('lang', dom.getAttrib(elm, 'lang')); + setFormValue('tabindex', dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : "")); + setFormValue('accesskey', dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : "")); + setFormValue('onfocus', dom.getAttrib(elm, 'onfocus')); + setFormValue('onblur', dom.getAttrib(elm, 'onblur')); + setFormValue('onclick', onclick); + setFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick')); + setFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown')); + setFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup')); + setFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover')); + setFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove')); + setFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout')); + setFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress')); + setFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown')); + setFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup')); + className = dom.getAttrib(elm, 'class'); + + addClassesToList('classlist', 'advlink_styles'); + selectByValue(f, 'classlist', className, true); + + TinyMCE_EditableSelects.init(); +} + +function setFormValue(name, value) { + if(value && document.forms[0].elements[name]){ + document.forms[0].elements[name].value = value; + } +} + +function insertAction() { + var inst = tinyMCEPopup.editor; + var elm = inst.selection.getNode(); + + tinyMCEPopup.execCommand("mceBeginUndoLevel"); + setAllAttribs(elm); + tinyMCEPopup.execCommand("mceEndUndoLevel"); + tinyMCEPopup.close(); +} + +function setAttrib(elm, attrib, value) { + var formObj = document.forms[0]; + var valueElm = formObj.elements[attrib.toLowerCase()]; + var inst = tinyMCEPopup.editor; + var dom = inst.dom; + + if (typeof(value) == "undefined" || value == null) { + value = ""; + + if (valueElm) + value = valueElm.value; + } + + if (value != "") { + dom.setAttrib(elm, attrib.toLowerCase(), value); + + if (attrib == "style") + attrib = "style.cssText"; + + if (attrib.substring(0, 2) == 'on') + value = 'return true;' + value; + + if (attrib == "class") + attrib = "className"; + + elm[attrib]=value; + } else + elm.removeAttribute(attrib); +} + +function setAllAttribs(elm) { + var f = document.forms[0]; + + setAttrib(elm, 'title'); + setAttrib(elm, 'id'); + setAttrib(elm, 'style'); + setAttrib(elm, 'class', getSelectValue(f, 'classlist')); + setAttrib(elm, 'dir'); + setAttrib(elm, 'lang'); + setAttrib(elm, 'tabindex'); + setAttrib(elm, 'accesskey'); + setAttrib(elm, 'onfocus'); + setAttrib(elm, 'onblur'); + setAttrib(elm, 'onclick'); + setAttrib(elm, 'ondblclick'); + setAttrib(elm, 'onmousedown'); + setAttrib(elm, 'onmouseup'); + setAttrib(elm, 'onmouseover'); + setAttrib(elm, 'onmousemove'); + setAttrib(elm, 'onmouseout'); + setAttrib(elm, 'onkeypress'); + setAttrib(elm, 'onkeydown'); + setAttrib(elm, 'onkeyup'); + + // Refresh in old MSIE +// if (tinyMCE.isMSIE5) +// elm.outerHTML = elm.outerHTML; +} + +function insertAttribute() { + tinyMCEPopup.close(); +} + +tinyMCEPopup.onInit.add(init); +tinyMCEPopup.requireLangPack(); diff --git a/lib/editor/tinymce/plugins/xhtmlxtras/js/cite.js b/lib/editor/tinymce/plugins/xhtmlxtras/js/cite.js index 98f19927a36..693f6e2095c 100644 --- a/lib/editor/tinymce/plugins/xhtmlxtras/js/cite.js +++ b/lib/editor/tinymce/plugins/xhtmlxtras/js/cite.js @@ -1,25 +1,25 @@ - /** - * $Id$ - * - * @author Moxiecode - based on work by Andrew Tetlaw - * @copyright Copyright 2004-2008, Moxiecode Systems AB, All rights reserved. - */ - -function init() { - SXE.initElementDialog('cite'); - if (SXE.currentAction == "update") { - SXE.showRemoveButton(); - } -} - -function insertCite() { - SXE.insertElement('cite'); - tinyMCEPopup.close(); -} - -function removeCite() { - SXE.removeElement('cite'); - tinyMCEPopup.close(); -} - -tinyMCEPopup.onInit.add(init); + /** + * $Id$ + * + * @author Moxiecode - based on work by Andrew Tetlaw + * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +function init() { + SXE.initElementDialog('cite'); + if (SXE.currentAction == "update") { + SXE.showRemoveButton(); + } +} + +function insertCite() { + SXE.insertElement('cite'); + tinyMCEPopup.close(); +} + +function removeCite() { + SXE.removeElement('cite'); + tinyMCEPopup.close(); +} + +tinyMCEPopup.onInit.add(init); diff --git a/lib/editor/tinymce/plugins/xhtmlxtras/js/del.js b/lib/editor/tinymce/plugins/xhtmlxtras/js/del.js index 1f6ebe752b7..28d83caeacb 100644 --- a/lib/editor/tinymce/plugins/xhtmlxtras/js/del.js +++ b/lib/editor/tinymce/plugins/xhtmlxtras/js/del.js @@ -1,60 +1,60 @@ - /** - * $Id$ - * - * @author Moxiecode - based on work by Andrew Tetlaw - * @copyright Copyright 2004-2008, Moxiecode Systems AB, All rights reserved. - */ - -function init() { - SXE.initElementDialog('del'); - if (SXE.currentAction == "update") { - setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime')); - setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite')); - SXE.showRemoveButton(); - } -} - -function setElementAttribs(elm) { - setAllCommonAttribs(elm); - setAttrib(elm, 'datetime'); - setAttrib(elm, 'cite'); -} - -function insertDel() { - var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'DEL'); - - tinyMCEPopup.execCommand('mceBeginUndoLevel'); - if (elm == null) { - var s = SXE.inst.selection.getContent(); - if(s.length > 0) { - insertInlineElement('del'); - var elementArray = tinymce.grep(SXE.inst.dom.select('del'), function(n) {return n.id == '#sxe_temp_del#';}); - for (var i=0; i 0) { + insertInlineElement('del'); + var elementArray = tinymce.grep(SXE.inst.dom.select('del'), function(n) {return n.id == '#sxe_temp_del#';}); + for (var i=0; i 0) { - tagName = element_name; - - if (tinymce.isIE && element_name.indexOf('html:') == 0) - element_name = element_name.substring(5).toLowerCase(); - - insertInlineElement(element_name); - var elementArray = tinymce.grep(SXE.inst.dom.select(element_name)); - for (var i=0; i -1) ? true : false; -} - -SXE.removeClass = function(elm,cl) { - if(elm.className == null || elm.className == "" || !SXE.containsClass(elm,cl)) { - return true; - } - var classNames = elm.className.split(" "); - var newClassNames = ""; - for (var x = 0, cnl = classNames.length; x < cnl; x++) { - if (classNames[x] != cl) { - newClassNames += (classNames[x] + " "); - } - } - elm.className = newClassNames.substring(0,newClassNames.length-1); //removes extra space at the end -} - -SXE.addClass = function(elm,cl) { - if(!SXE.containsClass(elm,cl)) elm.className ? elm.className += " " + cl : elm.className = cl; - return true; -} - -function insertInlineElement(en) { - var ed = tinyMCEPopup.editor, dom = ed.dom; - - ed.getDoc().execCommand('FontName', false, 'mceinline'); - tinymce.each(dom.select('span,font'), function(n) { - if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline') - dom.replace(dom.create(en, {_mce_new : 1}), n, 1); - }); -} + /** + * $Id$ + * + * @author Moxiecode - based on work by Andrew Tetlaw + * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +tinyMCEPopup.requireLangPack(); + +function initCommonAttributes(elm) { + var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom; + + // Setup form data for common element attributes + setFormValue('title', dom.getAttrib(elm, 'title')); + setFormValue('id', dom.getAttrib(elm, 'id')); + selectByValue(formObj, 'class', dom.getAttrib(elm, 'class'), true); + setFormValue('style', dom.getAttrib(elm, 'style')); + selectByValue(formObj, 'dir', dom.getAttrib(elm, 'dir')); + setFormValue('lang', dom.getAttrib(elm, 'lang')); + setFormValue('onfocus', dom.getAttrib(elm, 'onfocus')); + setFormValue('onblur', dom.getAttrib(elm, 'onblur')); + setFormValue('onclick', dom.getAttrib(elm, 'onclick')); + setFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick')); + setFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown')); + setFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup')); + setFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover')); + setFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove')); + setFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout')); + setFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress')); + setFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown')); + setFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup')); +} + +function setFormValue(name, value) { + if(document.forms[0].elements[name]) document.forms[0].elements[name].value = value; +} + +function insertDateTime(id) { + document.getElementById(id).value = getDateTime(new Date(), "%Y-%m-%dT%H:%M:%S"); +} + +function getDateTime(d, fmt) { + fmt = fmt.replace("%D", "%m/%d/%y"); + fmt = fmt.replace("%r", "%I:%M:%S %p"); + fmt = fmt.replace("%Y", "" + d.getFullYear()); + fmt = fmt.replace("%y", "" + d.getYear()); + fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2)); + fmt = fmt.replace("%d", addZeros(d.getDate(), 2)); + fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2)); + fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2)); + fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2)); + fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1)); + fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM")); + fmt = fmt.replace("%%", "%"); + + return fmt; +} + +function addZeros(value, len) { + var i; + + value = "" + value; + + if (value.length < len) { + for (i=0; i<(len-value.length); i++) + value = "0" + value; + } + + return value; +} + +function selectByValue(form_obj, field_name, value, add_custom, ignore_case) { + if (!form_obj || !form_obj.elements[field_name]) + return; + + var sel = form_obj.elements[field_name]; + + var found = false; + for (var i=0; i 0) { + tagName = element_name; + + if (tinymce.isIE && element_name.indexOf('html:') == 0) + element_name = element_name.substring(5).toLowerCase(); + + insertInlineElement(element_name); + var elementArray = tinymce.grep(SXE.inst.dom.select(element_name)); + for (var i=0; i -1) ? true : false; +} + +SXE.removeClass = function(elm,cl) { + if(elm.className == null || elm.className == "" || !SXE.containsClass(elm,cl)) { + return true; + } + var classNames = elm.className.split(" "); + var newClassNames = ""; + for (var x = 0, cnl = classNames.length; x < cnl; x++) { + if (classNames[x] != cl) { + newClassNames += (classNames[x] + " "); + } + } + elm.className = newClassNames.substring(0,newClassNames.length-1); //removes extra space at the end +} + +SXE.addClass = function(elm,cl) { + if(!SXE.containsClass(elm,cl)) elm.className ? elm.className += " " + cl : elm.className = cl; + return true; +} + +function insertInlineElement(en) { + var ed = tinyMCEPopup.editor, dom = ed.dom; + + ed.getDoc().execCommand('FontName', false, 'mceinline'); + tinymce.each(dom.select('span,font'), function(n) { + if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline') + dom.replace(dom.create(en, {_mce_new : 1}), n, 1); + }); +} diff --git a/lib/editor/tinymce/plugins/xhtmlxtras/js/ins.js b/lib/editor/tinymce/plugins/xhtmlxtras/js/ins.js index 64e7b0c0e1e..a3d374ef658 100644 --- a/lib/editor/tinymce/plugins/xhtmlxtras/js/ins.js +++ b/lib/editor/tinymce/plugins/xhtmlxtras/js/ins.js @@ -1,59 +1,59 @@ - /** - * $Id$ - * - * @author Moxiecode - based on work by Andrew Tetlaw - * @copyright Copyright 2004-2008, Moxiecode Systems AB, All rights reserved. - */ - -function init() { - SXE.initElementDialog('ins'); - if (SXE.currentAction == "update") { - setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime')); - setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite')); - SXE.showRemoveButton(); - } -} - -function setElementAttribs(elm) { - setAllCommonAttribs(elm); - setAttrib(elm, 'datetime'); - setAttrib(elm, 'cite'); -} - -function insertIns() { - var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'INS'); - tinyMCEPopup.execCommand('mceBeginUndoLevel'); - if (elm == null) { - var s = SXE.inst.selection.getContent(); - if(s.length > 0) { - insertInlineElement('INS'); - var elementArray = tinymce.grep(SXE.inst.dom.select('ins'), function(n) {return n.id == '#sxe_temp_ins#';}); - for (var i=0; i 0) { + insertInlineElement('INS'); + var elementArray = tinymce.grep(SXE.inst.dom.select('ins'), function(n) {return n.id == '#sxe_temp_ins#';}); + for (var i=0; i - - - {#advanced_dlg.about_title} - - - - - - - -
    -
    -

    {#advanced_dlg.about_title}

    -

    Version: ()

    -

    TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL - by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.

    -

    Copyright © 2003-2008, Moxiecode Systems AB, All rights reserved.

    -

    For more information about this software visit the TinyMCE website.

    - -
    - Got Moxie? - Hosted By Sourceforge - Also on freshmeat -
    -
    - -
    -
    -

    {#advanced_dlg.about_loaded}

    - -
    -
    - -

     

    -
    -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    - - + + + + {#advanced_dlg.about_title} + + + + + + + +
    +
    +

    {#advanced_dlg.about_title}

    +

    Version: ()

    +

    TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL + by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.

    +

    Copyright © 2003-2008, Moxiecode Systems AB, All rights reserved.

    +

    For more information about this software visit the TinyMCE website.

    + +
    + Got Moxie? + Hosted By Sourceforge + Also on freshmeat +
    +
    + +
    +
    +

    {#advanced_dlg.about_loaded}

    + +
    +
    + +

     

    +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    + + diff --git a/lib/editor/tinymce/themes/advanced/anchor.htm b/lib/editor/tinymce/themes/advanced/anchor.htm index 42095a1c0ca..86779cbb71b 100644 --- a/lib/editor/tinymce/themes/advanced/anchor.htm +++ b/lib/editor/tinymce/themes/advanced/anchor.htm @@ -1,31 +1,31 @@ - - - - {#advanced_dlg.anchor_title} - - - - -
    - - - - - - - - -
    {#advanced_dlg.anchor_title}
    {#advanced_dlg.anchor_name}:
    - -
    -
    - -
    - -
    - -
    -
    -
    - - + + + + {#advanced_dlg.anchor_title} + + + + +
    + + + + + + + + +
    {#advanced_dlg.anchor_title}
    {#advanced_dlg.anchor_name}:
    + +
    +
    + +
    + +
    + +
    +
    +
    + + diff --git a/lib/editor/tinymce/themes/advanced/charmap.htm b/lib/editor/tinymce/themes/advanced/charmap.htm index f11a38ad8a2..f1b514450ee 100644 --- a/lib/editor/tinymce/themes/advanced/charmap.htm +++ b/lib/editor/tinymce/themes/advanced/charmap.htm @@ -1,53 +1,53 @@ - - - - {#advanced_dlg.charmap_title} - - - - - - - - - - - - - - - - -
    {#advanced_dlg.charmap_title}
    - - - - - - - - - -
     
     
    -
    - - - - - - - - - - - - - - - - -
    HTML-Code
     
     
    NUM-Code
     
    -
    - - - + + + + {#advanced_dlg.charmap_title} + + + + + + + + + + + + + + + + +
    {#advanced_dlg.charmap_title}
    + + + + + + + + + +
     
     
    +
    + + + + + + + + + + + + + + + + +
    HTML-Code
     
     
    NUM-Code
     
    +
    + + + diff --git a/lib/editor/tinymce/themes/advanced/color_picker.htm b/lib/editor/tinymce/themes/advanced/color_picker.htm index 90eb4c2ee1f..2f3695232ba 100644 --- a/lib/editor/tinymce/themes/advanced/color_picker.htm +++ b/lib/editor/tinymce/themes/advanced/color_picker.htm @@ -1,75 +1,75 @@ - - - - {#advanced_dlg.colorpicker_title} - - - - - -
    - - -
    -
    -
    - {#advanced_dlg.colorpicker_picker_title} -
    -  - -
    - -
    - -
    -
    -
    -
    - -
    -
    - {#advanced_dlg.colorpicker_palette_title} -
    - -
    - -
    -
    -
    - -
    -
    - {#advanced_dlg.colorpicker_named_title} -
    - -
    - -
    - -
    - {#advanced_dlg.colorpicker_name} -
    -
    -
    -
    - -
    -
    - -
    - -
    - -
    - -
    -
    -
    - - + + + + {#advanced_dlg.colorpicker_title} + + + + + +
    + + +
    +
    +
    + {#advanced_dlg.colorpicker_picker_title} +
    +  + +
    + +
    + +
    +
    +
    +
    + +
    +
    + {#advanced_dlg.colorpicker_palette_title} +
    + +
    + +
    +
    +
    + +
    +
    + {#advanced_dlg.colorpicker_named_title} +
    + +
    + +
    + +
    + {#advanced_dlg.colorpicker_name} +
    +
    +
    +
    + +
    +
    + +
    + +
    + +
    + +
    +
    +
    + + diff --git a/lib/editor/tinymce/themes/advanced/editor_template_src.js b/lib/editor/tinymce/themes/advanced/editor_template_src.js index 9a43724f41d..30b3f7a1c29 100644 --- a/lib/editor/tinymce/themes/advanced/editor_template_src.js +++ b/lib/editor/tinymce/themes/advanced/editor_template_src.js @@ -1,1153 +1,1153 @@ -/** - * $Id$ - * - * @author Moxiecode - * @copyright Copyright 2004-2008, Moxiecode Systems AB, All rights reserved. - */ - -(function(tinymce) { - var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, each = tinymce.each, Cookie = tinymce.util.Cookie, lastExtID, explode = tinymce.explode; - - // Tell it to load theme specific language pack(s) - tinymce.ThemeManager.requireLangPack('advanced'); - - tinymce.create('tinymce.themes.AdvancedTheme', { - sizes : [8, 10, 12, 14, 18, 24, 36], - - // Control name lookup, format: title, command - controls : { - bold : ['bold_desc', 'Bold'], - italic : ['italic_desc', 'Italic'], - underline : ['underline_desc', 'Underline'], - strikethrough : ['striketrough_desc', 'Strikethrough'], - justifyleft : ['justifyleft_desc', 'JustifyLeft'], - justifycenter : ['justifycenter_desc', 'JustifyCenter'], - justifyright : ['justifyright_desc', 'JustifyRight'], - justifyfull : ['justifyfull_desc', 'JustifyFull'], - bullist : ['bullist_desc', 'InsertUnorderedList'], - numlist : ['numlist_desc', 'InsertOrderedList'], - outdent : ['outdent_desc', 'Outdent'], - indent : ['indent_desc', 'Indent'], - cut : ['cut_desc', 'Cut'], - copy : ['copy_desc', 'Copy'], - paste : ['paste_desc', 'Paste'], - undo : ['undo_desc', 'Undo'], - redo : ['redo_desc', 'Redo'], - link : ['link_desc', 'mceLink'], - unlink : ['unlink_desc', 'unlink'], - image : ['image_desc', 'mceImage'], - cleanup : ['cleanup_desc', 'mceCleanup'], - help : ['help_desc', 'mceHelp'], - code : ['code_desc', 'mceCodeEditor'], - hr : ['hr_desc', 'InsertHorizontalRule'], - removeformat : ['removeformat_desc', 'RemoveFormat'], - sub : ['sub_desc', 'subscript'], - sup : ['sup_desc', 'superscript'], - forecolor : ['forecolor_desc', 'ForeColor'], - forecolorpicker : ['forecolor_desc', 'mceForeColor'], - backcolor : ['backcolor_desc', 'HiliteColor'], - backcolorpicker : ['backcolor_desc', 'mceBackColor'], - charmap : ['charmap_desc', 'mceCharMap'], - visualaid : ['visualaid_desc', 'mceToggleVisualAid'], - anchor : ['anchor_desc', 'mceInsertAnchor'], - newdocument : ['newdocument_desc', 'mceNewDocument'], - blockquote : ['blockquote_desc', 'mceBlockQuote'] - }, - - stateControls : ['bold', 'italic', 'underline', 'strikethrough', 'bullist', 'numlist', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'sub', 'sup', 'blockquote'], - - init : function(ed, url) { - var t = this, s, v, o; - - t.editor = ed; - t.url = url; - t.onResolveName = new tinymce.util.Dispatcher(this); - - // Default settings - t.settings = s = extend({ - theme_advanced_path : true, - theme_advanced_toolbar_location : 'bottom', - theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect", - theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code", - theme_advanced_buttons3 : "hr,removeformat,visualaid,|,sub,sup,|,charmap", - theme_advanced_blockformats : "p,address,pre,h1,h2,h3,h4,h5,h6", - theme_advanced_toolbar_align : "center", - theme_advanced_fonts : "Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats", - theme_advanced_more_colors : 1, - theme_advanced_row_height : 23, - theme_advanced_resize_horizontal : 1, - theme_advanced_resizing_use_cookie : 1, - theme_advanced_font_sizes : "1,2,3,4,5,6,7", - readonly : ed.settings.readonly - }, ed.settings); - - // Setup default font_size_style_values - if (!s.font_size_style_values) - s.font_size_style_values = "8pt,10pt,12pt,14pt,18pt,24pt,36pt"; - - if (tinymce.is(s.theme_advanced_font_sizes, 'string')) { - s.font_size_style_values = tinymce.explode(s.font_size_style_values); - s.font_size_classes = tinymce.explode(s.font_size_classes || ''); - - // Parse string value - o = {}; - ed.settings.theme_advanced_font_sizes = s.theme_advanced_font_sizes; - each(ed.getParam('theme_advanced_font_sizes', '', 'hash'), function(v, k) { - var cl; - - if (k == v && v >= 1 && v <= 7) { - k = v + ' (' + t.sizes[v - 1] + 'pt)'; - - if (ed.settings.convert_fonts_to_spans) { - cl = s.font_size_classes[v - 1]; - v = s.font_size_style_values[v - 1] || (t.sizes[v - 1] + 'pt'); - } - } - - if (/^\s*\./.test(v)) - cl = v.replace(/\./g, ''); - - o[k] = cl ? {'class' : cl} : {fontSize : v}; - }); - - s.theme_advanced_font_sizes = o; - } - - if ((v = s.theme_advanced_path_location) && v != 'none') - s.theme_advanced_statusbar_location = s.theme_advanced_path_location; - - if (s.theme_advanced_statusbar_location == 'none') - s.theme_advanced_statusbar_location = 0; - - // Init editor - ed.onInit.add(function() { - ed.onNodeChange.add(t._nodeChanged, t); - - if (ed.settings.content_css !== false) - ed.dom.loadCSS(ed.baseURI.toAbsolute("themes/advanced/skins/" + ed.settings.skin + "/content.css")); - }); - - ed.onSetProgressState.add(function(ed, b, ti) { - var co, id = ed.id, tb; - - if (b) { - t.progressTimer = setTimeout(function() { - co = ed.getContainer(); - co = co.insertBefore(DOM.create('DIV', {style : 'position:relative'}), co.firstChild); - tb = DOM.get(ed.id + '_tbl'); - - DOM.add(co, 'div', {id : id + '_blocker', 'class' : 'mceBlocker', style : {width : tb.clientWidth + 2, height : tb.clientHeight + 2}}); - DOM.add(co, 'div', {id : id + '_progress', 'class' : 'mceProgress', style : {left : tb.clientWidth / 2, top : tb.clientHeight / 2}}); - }, ti || 0); - } else { - DOM.remove(id + '_blocker'); - DOM.remove(id + '_progress'); - clearTimeout(t.progressTimer); - } - }); - - DOM.loadCSS(s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : url + "/skins/" + ed.settings.skin + "/ui.css"); - - if (s.skin_variant) - DOM.loadCSS(url + "/skins/" + ed.settings.skin + "/ui_" + s.skin_variant + ".css"); - }, - - createControl : function(n, cf) { - var cd, c; - - if (c = cf.createControl(n)) - return c; - - switch (n) { - case "styleselect": - return this._createStyleSelect(); - - case "formatselect": - return this._createBlockFormats(); - - case "fontselect": - return this._createFontSelect(); - - case "fontsizeselect": - return this._createFontSizeSelect(); - - case "forecolor": - return this._createForeColorMenu(); - - case "backcolor": - return this._createBackColorMenu(); - } - - if ((cd = this.controls[n])) - return cf.createButton(n, {title : "advanced." + cd[0], cmd : cd[1], ui : cd[2], value : cd[3]}); - }, - - execCommand : function(cmd, ui, val) { - var f = this['_' + cmd]; - - if (f) { - f.call(this, ui, val); - return true; - } - - return false; - }, - - _importClasses : function(e) { - var ed = this.editor, c = ed.controlManager.get('styleselect'); - - if (c.getLength() == 0) { - each(ed.dom.getClasses(), function(o) { - c.add(o['class'], o['class']); - }); - } - }, - - _createStyleSelect : function(n) { - var t = this, ed = t.editor, cf = ed.controlManager, c = cf.createListBox('styleselect', { - title : 'advanced.style_select', - onselect : function(v) { - if (c.selectedValue === v) { - ed.execCommand('mceSetStyleInfo', 0, {command : 'removeformat'}); - c.select(); - return false; - } else - ed.execCommand('mceSetCSSClass', 0, v); - } - }); - - if (c) { - each(ed.getParam('theme_advanced_styles', '', 'hash'), function(v, k) { - if (v) - c.add(t.editor.translate(k), v); - }); - - c.onPostRender.add(function(ed, n) { - if (!c.NativeListBox) { - Event.add(n.id + '_text', 'focus', t._importClasses, t); - Event.add(n.id + '_text', 'mousedown', t._importClasses, t); - Event.add(n.id + '_open', 'focus', t._importClasses, t); - Event.add(n.id + '_open', 'mousedown', t._importClasses, t); - } else - Event.add(n.id, 'focus', t._importClasses, t); - }); - } - - return c; - }, - - _createFontSelect : function() { - var c, t = this, ed = t.editor; - - c = ed.controlManager.createListBox('fontselect', {title : 'advanced.fontdefault', cmd : 'FontName'}); - if (c) { - each(ed.getParam('theme_advanced_fonts', t.settings.theme_advanced_fonts, 'hash'), function(v, k) { - c.add(ed.translate(k), v, {style : v.indexOf('dings') == -1 ? 'font-family:' + v : ''}); - }); - } - - return c; - }, - - _createFontSizeSelect : function() { - var t = this, ed = t.editor, c, i = 0, cl = []; - - c = ed.controlManager.createListBox('fontsizeselect', {title : 'advanced.font_size', onselect : function(v) { - if (v.fontSize) - ed.execCommand('FontSize', false, v.fontSize); - else { - each(t.settings.theme_advanced_font_sizes, function(v, k) { - if (v['class']) - cl.push(v['class']); - }); - - ed.editorCommands._applyInlineStyle('span', {'class' : v['class']}, {check_classes : cl}); - } - }}); - - if (c) { - each(t.settings.theme_advanced_font_sizes, function(v, k) { - var fz = v.fontSize; - - if (fz >= 1 && fz <= 7) - fz = t.sizes[parseInt(fz) - 1] + 'pt'; - - c.add(k, v, {'style' : 'font-size:' + fz, 'class' : 'mceFontSize' + (i++) + (' ' + (v['class'] || ''))}); - }); - } - - return c; - }, - - _createBlockFormats : function() { - var c, fmts = { - p : 'advanced.paragraph', - address : 'advanced.address', - pre : 'advanced.pre', - h1 : 'advanced.h1', - h2 : 'advanced.h2', - h3 : 'advanced.h3', - h4 : 'advanced.h4', - h5 : 'advanced.h5', - h6 : 'advanced.h6', - div : 'advanced.div', - blockquote : 'advanced.blockquote', - code : 'advanced.code', - dt : 'advanced.dt', - dd : 'advanced.dd', - samp : 'advanced.samp' - }, t = this; - - c = t.editor.controlManager.createListBox('formatselect', {title : 'advanced.block', cmd : 'FormatBlock'}); - if (c) { - each(t.editor.getParam('theme_advanced_blockformats', t.settings.theme_advanced_blockformats, 'hash'), function(v, k) { - c.add(t.editor.translate(k != v ? k : fmts[v]), v, {'class' : 'mce_formatPreview mce_' + v}); - }); - } - - return c; - }, - - _createForeColorMenu : function() { - var c, t = this, s = t.settings, o = {}, v; - - if (s.theme_advanced_more_colors) { - o.more_colors_func = function() { - t._mceColorPicker(0, { - color : c.value, - func : function(co) { - c.setColor(co); - } - }); - }; - } - - if (v = s.theme_advanced_text_colors) - o.colors = v; - - if (s.theme_advanced_default_foreground_color) - o.default_color = s.theme_advanced_default_foreground_color; - - o.title = 'advanced.forecolor_desc'; - o.cmd = 'ForeColor'; - o.scope = this; - - c = t.editor.controlManager.createColorSplitButton('forecolor', o); - - return c; - }, - - _createBackColorMenu : function() { - var c, t = this, s = t.settings, o = {}, v; - - if (s.theme_advanced_more_colors) { - o.more_colors_func = function() { - t._mceColorPicker(0, { - color : c.value, - func : function(co) { - c.setColor(co); - } - }); - }; - } - - if (v = s.theme_advanced_background_colors) - o.colors = v; - - if (s.theme_advanced_default_background_color) - o.default_color = s.theme_advanced_default_background_color; - - o.title = 'advanced.backcolor_desc'; - o.cmd = 'HiliteColor'; - o.scope = this; - - c = t.editor.controlManager.createColorSplitButton('backcolor', o); - - return c; - }, - - renderUI : function(o) { - var n, ic, tb, t = this, ed = t.editor, s = t.settings, sc, p, nl; - - n = p = DOM.create('span', {id : ed.id + '_parent', 'class' : 'mceEditor ' + ed.settings.skin + 'Skin' + (s.skin_variant ? ' ' + ed.settings.skin + 'Skin' + t._ufirst(s.skin_variant) : '')}); - - if (!DOM.boxModel) - n = DOM.add(n, 'div', {'class' : 'mceOldBoxModel'}); - - n = sc = DOM.add(n, 'table', {id : ed.id + '_tbl', 'class' : 'mceLayout', cellSpacing : 0, cellPadding : 0}); - n = tb = DOM.add(n, 'tbody'); - - switch ((s.theme_advanced_layout_manager || '').toLowerCase()) { - case "rowlayout": - ic = t._rowLayout(s, tb, o); - break; - - case "customlayout": - ic = ed.execCallback("theme_advanced_custom_layout", s, tb, o, p); - break; - - default: - ic = t._simpleLayout(s, tb, o, p); - } - - n = o.targetNode; - - // Add classes to first and last TRs - nl = DOM.stdMode ? sc.getElementsByTagName('tr') : sc.rows; // Quick fix for IE 8 - DOM.addClass(nl[0], 'mceFirst'); - DOM.addClass(nl[nl.length - 1], 'mceLast'); - - // Add classes to first and last TDs - each(DOM.select('tr', tb), function(n) { - DOM.addClass(n.firstChild, 'mceFirst'); - DOM.addClass(n.childNodes[n.childNodes.length - 1], 'mceLast'); - }); - - if (DOM.get(s.theme_advanced_toolbar_container)) - DOM.get(s.theme_advanced_toolbar_container).appendChild(p); - else - DOM.insertAfter(p, n); - - Event.add(ed.id + '_path_row', 'click', function(e) { - e = e.target; - - if (e.nodeName == 'A') { - t._sel(e.className.replace(/^.*mcePath_([0-9]+).*$/, '$1')); - - return Event.cancel(e); - } - }); -/* - if (DOM.get(ed.id + '_path_row')) { - Event.add(ed.id + '_tbl', 'mouseover', function(e) { - var re; - - e = e.target; - - if (e.nodeName == 'SPAN' && DOM.hasClass(e.parentNode, 'mceButton')) { - re = DOM.get(ed.id + '_path_row'); - t.lastPath = re.innerHTML; - DOM.setHTML(re, e.parentNode.title); - } - }); - - Event.add(ed.id + '_tbl', 'mouseout', function(e) { - if (t.lastPath) { - DOM.setHTML(ed.id + '_path_row', t.lastPath); - t.lastPath = 0; - } - }); - } -*/ - - if (!ed.getParam('accessibility_focus')) - Event.add(DOM.add(p, 'a', {href : '#'}, ''), 'focus', function() {tinyMCE.get(ed.id).focus();}); - - if (s.theme_advanced_toolbar_location == 'external') - o.deltaHeight = 0; - - t.deltaHeight = o.deltaHeight; - o.targetNode = null; - - return { - iframeContainer : ic, - editorContainer : ed.id + '_parent', - sizeContainer : sc, - deltaHeight : o.deltaHeight - }; - }, - - getInfo : function() { - return { - longname : 'Advanced theme', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - version : tinymce.majorVersion + "." + tinymce.minorVersion - } - }, - - resizeBy : function(dw, dh) { - var e = DOM.get(this.editor.id + '_tbl'); - - this.resizeTo(e.clientWidth + dw, e.clientHeight + dh); - }, - - resizeTo : function(w, h) { - var ed = this.editor, s = ed.settings, e = DOM.get(ed.id + '_tbl'), ifr = DOM.get(ed.id + '_ifr'), dh; - - // Boundery fix box - w = Math.max(s.theme_advanced_resizing_min_width || 100, w); - h = Math.max(s.theme_advanced_resizing_min_height || 100, h); - w = Math.min(s.theme_advanced_resizing_max_width || 0xFFFF, w); - h = Math.min(s.theme_advanced_resizing_max_height || 0xFFFF, h); - - // Calc difference between iframe and container - dh = e.clientHeight - ifr.clientHeight; - - // Resize iframe and container - DOM.setStyle(ifr, 'height', h - dh); - DOM.setStyles(e, {width : w, height : h}); - }, - - destroy : function() { - var id = this.editor.id; - - Event.clear(id + '_resize'); - Event.clear(id + '_path_row'); - Event.clear(id + '_external_close'); - }, - - // Internal functions - - _simpleLayout : function(s, tb, o, p) { - var t = this, ed = t.editor, lo = s.theme_advanced_toolbar_location, sl = s.theme_advanced_statusbar_location, n, ic, etb, c; - - if (s.readonly) { - n = DOM.add(tb, 'tr'); - n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); - return ic; - } - - // Create toolbar container at top - if (lo == 'top') - t._addToolbars(tb, o); - - // Create external toolbar - if (lo == 'external') { - n = c = DOM.create('div', {style : 'position:relative'}); - n = DOM.add(n, 'div', {id : ed.id + '_external', 'class' : 'mceExternalToolbar'}); - DOM.add(n, 'a', {id : ed.id + '_external_close', href : 'javascript:;', 'class' : 'mceExternalClose'}); - n = DOM.add(n, 'table', {id : ed.id + '_tblext', cellSpacing : 0, cellPadding : 0}); - etb = DOM.add(n, 'tbody'); - - if (p.firstChild.className == 'mceOldBoxModel') - p.firstChild.appendChild(c); - else - p.insertBefore(c, p.firstChild); - - t._addToolbars(etb, o); - - ed.onMouseUp.add(function() { - var e = DOM.get(ed.id + '_external'); - DOM.show(e); - - DOM.hide(lastExtID); - - var f = Event.add(ed.id + '_external_close', 'click', function() { - DOM.hide(ed.id + '_external'); - Event.remove(ed.id + '_external_close', 'click', f); - }); - - DOM.show(e); - DOM.setStyle(e, 'top', 0 - DOM.getRect(ed.id + '_tblext').h - 1); - - // Fixes IE rendering bug - DOM.hide(e); - DOM.show(e); - e.style.filter = ''; - - lastExtID = ed.id + '_external'; - - e = null; - }); - } - - if (sl == 'top') - t._addStatusBar(tb, o); - - // Create iframe container - if (!s.theme_advanced_toolbar_container) { - n = DOM.add(tb, 'tr'); - n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); - } - - // Create toolbar container at bottom - if (lo == 'bottom') - t._addToolbars(tb, o); - - if (sl == 'bottom') - t._addStatusBar(tb, o); - - return ic; - }, - - _rowLayout : function(s, tb, o) { - var t = this, ed = t.editor, dc, da, cf = ed.controlManager, n, ic, to, a; - - dc = s.theme_advanced_containers_default_class || ''; - da = s.theme_advanced_containers_default_align || 'center'; - - each(explode(s.theme_advanced_containers || ''), function(c, i) { - var v = s['theme_advanced_container_' + c] || ''; - - switch (v.toLowerCase()) { - case 'mceeditor': - n = DOM.add(tb, 'tr'); - n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); - break; - - case 'mceelementpath': - t._addStatusBar(tb, o); - break; - - default: - a = (s['theme_advanced_container_' + c + '_align'] || da).toLowerCase(); - a = 'mce' + t._ufirst(a); - - n = DOM.add(DOM.add(tb, 'tr'), 'td', { - 'class' : 'mceToolbar ' + (s['theme_advanced_container_' + c + '_class'] || dc) + ' ' + a || da - }); - - to = cf.createToolbar("toolbar" + i); - t._addControls(v, to); - DOM.setHTML(n, to.renderHTML()); - o.deltaHeight -= s.theme_advanced_row_height; - } - }); - - return ic; - }, - - _addControls : function(v, tb) { - var t = this, s = t.settings, di, cf = t.editor.controlManager; - - if (s.theme_advanced_disable && !t._disabled) { - di = {}; - - each(explode(s.theme_advanced_disable), function(v) { - di[v] = 1; - }); - - t._disabled = di; - } else - di = t._disabled; - - each(explode(v), function(n) { - var c; - - if (di && di[n]) - return; - - // Compatiblity with 2.x - if (n == 'tablecontrols') { - each(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"], function(n) { - n = t.createControl(n, cf); - - if (n) - tb.add(n); - }); - - return; - } - - c = t.createControl(n, cf); - - if (c) - tb.add(c); - }); - }, - - _addToolbars : function(c, o) { - var t = this, i, tb, ed = t.editor, s = t.settings, v, cf = ed.controlManager, di, n, h = [], a; - - a = s.theme_advanced_toolbar_align.toLowerCase(); - a = 'mce' + t._ufirst(a); - - n = DOM.add(DOM.add(c, 'tr'), 'td', {'class' : 'mceToolbar ' + a}); - - if (!ed.getParam('accessibility_focus')) - h.push(DOM.createHTML('a', {href : '#', onfocus : 'tinyMCE.get(\'' + ed.id + '\').focus();'}, '')); - - h.push(DOM.createHTML('a', {href : '#', accesskey : 'q', title : ed.getLang("advanced.toolbar_focus")}, '')); - - // Create toolbar and add the controls - for (i=1; (v = s['theme_advanced_buttons' + i]); i++) { - tb = cf.createToolbar("toolbar" + i, {'class' : 'mceToolbarRow' + i}); - - if (s['theme_advanced_buttons' + i + '_add']) - v += ',' + s['theme_advanced_buttons' + i + '_add']; - - if (s['theme_advanced_buttons' + i + '_add_before']) - v = s['theme_advanced_buttons' + i + '_add_before'] + ',' + v; - - t._addControls(v, tb); - - //n.appendChild(n = tb.render()); - h.push(tb.renderHTML()); - - o.deltaHeight -= s.theme_advanced_row_height; - } - - h.push(DOM.createHTML('a', {href : '#', accesskey : 'z', title : ed.getLang("advanced.toolbar_focus"), onfocus : 'tinyMCE.getInstanceById(\'' + ed.id + '\').focus();'}, '')); - DOM.setHTML(n, h.join('')); - }, - - _addStatusBar : function(tb, o) { - var n, t = this, ed = t.editor, s = t.settings, r, mf, me, td; - - n = DOM.add(tb, 'tr'); - n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'}); - n = DOM.add(n, 'div', {id : ed.id + '_path_row'}, s.theme_advanced_path ? ed.translate('advanced.path') + ': ' : ' '); - DOM.add(n, 'a', {href : '#', accesskey : 'x'}); - - if (s.theme_advanced_resizing) { - DOM.add(td, 'a', {id : ed.id + '_resize', href : 'javascript:;', onclick : "return false;", 'class' : 'mceResize'}); - - if (s.theme_advanced_resizing_use_cookie) { - ed.onPostRender.add(function() { - var o = Cookie.getHash("TinyMCE_" + ed.id + "_size"), c = DOM.get(ed.id + '_tbl'); - - if (!o) - return; - - if (s.theme_advanced_resize_horizontal) - c.style.width = Math.max(10, o.cw) + 'px'; - - c.style.height = Math.max(10, o.ch) + 'px'; - DOM.get(ed.id + '_ifr').style.height = Math.max(10, parseInt(o.ch) + t.deltaHeight) + 'px'; - }); - } - - ed.onPostRender.add(function() { - Event.add(ed.id + '_resize', 'mousedown', function(e) { - var c, p, w, h, n, pa; - - // Measure container - c = DOM.get(ed.id + '_tbl'); - w = c.clientWidth; - h = c.clientHeight; - - miw = s.theme_advanced_resizing_min_width || 100; - mih = s.theme_advanced_resizing_min_height || 100; - maw = s.theme_advanced_resizing_max_width || 0xFFFF; - mah = s.theme_advanced_resizing_max_height || 0xFFFF; - - // Setup placeholder - p = DOM.add(DOM.get(ed.id + '_parent'), 'div', {'class' : 'mcePlaceHolder'}); - DOM.setStyles(p, {width : w, height : h}); - - // Replace with placeholder - DOM.hide(c); - DOM.show(p); - - // Create internal resize obj - r = { - x : e.screenX, - y : e.screenY, - w : w, - h : h, - dx : null, - dy : null - }; - - // Start listening - mf = Event.add(DOM.doc, 'mousemove', function(e) { - var w, h; - - // Calc delta values - r.dx = e.screenX - r.x; - r.dy = e.screenY - r.y; - - // Boundery fix box - w = Math.max(miw, r.w + r.dx); - h = Math.max(mih, r.h + r.dy); - w = Math.min(maw, w); - h = Math.min(mah, h); - - // Resize placeholder - if (s.theme_advanced_resize_horizontal) - p.style.width = w + 'px'; - - p.style.height = h + 'px'; - - return Event.cancel(e); - }); - - me = Event.add(DOM.doc, 'mouseup', function(e) { - var ifr; - - // Stop listening - Event.remove(DOM.doc, 'mousemove', mf); - Event.remove(DOM.doc, 'mouseup', me); - - c.style.display = ''; - DOM.remove(p); - - if (r.dx === null) - return; - - ifr = DOM.get(ed.id + '_ifr'); - - if (s.theme_advanced_resize_horizontal) - c.style.width = Math.max(10, r.w + r.dx) + 'px'; - - c.style.height = Math.max(10, r.h + r.dy) + 'px'; - ifr.style.height = Math.max(10, ifr.clientHeight + r.dy) + 'px'; - - if (s.theme_advanced_resizing_use_cookie) { - Cookie.setHash("TinyMCE_" + ed.id + "_size", { - cw : r.w + r.dx, - ch : r.h + r.dy - }); - } - }); - - return Event.cancel(e); - }); - }); - } - - o.deltaHeight -= 21; - n = tb = null; - }, - - _nodeChanged : function(ed, cm, n, co) { - var t = this, p, de = 0, v, c, s = t.settings, cl, fz, fn; - - if (s.readonly) - return; - - tinymce.each(t.stateControls, function(c) { - cm.setActive(c, ed.queryCommandState(t.controls[c][1])); - }); - - cm.setActive('visualaid', ed.hasVisual); - cm.setDisabled('undo', !ed.undoManager.hasUndo() && !ed.typing); - cm.setDisabled('redo', !ed.undoManager.hasRedo()); - cm.setDisabled('outdent', !ed.queryCommandState('Outdent')); - - p = DOM.getParent(n, 'A'); - if (c = cm.get('link')) { - if (!p || !p.name) { - c.setDisabled(!p && co); - c.setActive(!!p); - } - } - - if (c = cm.get('unlink')) { - c.setDisabled(!p && co); - c.setActive(!!p && !p.name); - } - - if (c = cm.get('anchor')) { - c.setActive(!!p && p.name); - - if (tinymce.isWebKit) { - p = DOM.getParent(n, 'IMG'); - c.setActive(!!p && DOM.getAttrib(p, 'mce_name') == 'a'); - } - } - - p = DOM.getParent(n, 'IMG'); - if (c = cm.get('image')) - c.setActive(!!p && n.className.indexOf('mceItem') == -1); - - if (c = cm.get('styleselect')) { - if (n.className) { - t._importClasses(); - c.select(n.className); - } else - c.select(); - } - - if (c = cm.get('formatselect')) { - p = DOM.getParent(n, DOM.isBlock); - - if (p) - c.select(p.nodeName.toLowerCase()); - } - - if (ed.settings.convert_fonts_to_spans) { - ed.dom.getParent(n, function(n) { - if (n.nodeName === 'SPAN') { - if (!cl && n.className) - cl = n.className; - - if (!fz && n.style.fontSize) - fz = n.style.fontSize; - - if (!fn && n.style.fontFamily) - fn = n.style.fontFamily.replace(/[\"\']+/g, '').replace(/^([^,]+).*/, '$1').toLowerCase(); - } - - return false; - }); - - if (c = cm.get('fontselect')) { - c.select(function(v) { - return v.replace(/^([^,]+).*/, '$1').toLowerCase() == fn; - }); - } - - if (c = cm.get('fontsizeselect')) { - c.select(function(v) { - if (v.fontSize && v.fontSize === fz) - return true; - - if (v['class'] && v['class'] === cl) - return true; - }); - } - } else { - if (c = cm.get('fontselect')) - c.select(ed.queryCommandValue('FontName')); - - if (c = cm.get('fontsizeselect')) { - v = ed.queryCommandValue('FontSize'); - c.select(function(iv) { - return iv.fontSize == v; - }); - } - } - - if (s.theme_advanced_path && s.theme_advanced_statusbar_location) { - p = DOM.get(ed.id + '_path') || DOM.add(ed.id + '_path_row', 'span', {id : ed.id + '_path'}); - DOM.setHTML(p, ''); - - ed.dom.getParent(n, function(n) { - var na = n.nodeName.toLowerCase(), u, pi, ti = ''; - - // Ignore non element and hidden elements - if (n.nodeType != 1 || n.nodeName === 'BR' || (DOM.hasClass(n, 'mceItemHidden') || DOM.hasClass(n, 'mceItemRemoved'))) - return; - - // Fake name - if (v = DOM.getAttrib(n, 'mce_name')) - na = v; - - // Handle prefix - if (tinymce.isIE && n.scopeName !== 'HTML') - na = n.scopeName + ':' + na; - - // Remove internal prefix - na = na.replace(/mce\:/g, ''); - - // Handle node name - switch (na) { - case 'b': - na = 'strong'; - break; - - case 'i': - na = 'em'; - break; - - case 'img': - if (v = DOM.getAttrib(n, 'src')) - ti += 'src: ' + v + ' '; - - break; - - case 'a': - if (v = DOM.getAttrib(n, 'name')) { - ti += 'name: ' + v + ' '; - na += '#' + v; - } - - if (v = DOM.getAttrib(n, 'href')) - ti += 'href: ' + v + ' '; - - break; - - case 'font': - if (s.convert_fonts_to_spans) - na = 'span'; - - if (v = DOM.getAttrib(n, 'face')) - ti += 'font: ' + v + ' '; - - if (v = DOM.getAttrib(n, 'size')) - ti += 'size: ' + v + ' '; - - if (v = DOM.getAttrib(n, 'color')) - ti += 'color: ' + v + ' '; - - break; - - case 'span': - if (v = DOM.getAttrib(n, 'style')) - ti += 'style: ' + v + ' '; - - break; - } - - if (v = DOM.getAttrib(n, 'id')) - ti += 'id: ' + v + ' '; - - if (v = n.className) { - v = v.replace(/(webkit-[\w\-]+|Apple-[\w\-]+|mceItem\w+|mceVisualAid)/g, ''); - - if (v && v.indexOf('mceItem') == -1) { - ti += 'class: ' + v + ' '; - - if (DOM.isBlock(n) || na == 'img' || na == 'span') - na += '.' + v; - } - } - - na = na.replace(/(html:)/g, ''); - na = {name : na, node : n, title : ti}; - t.onResolveName.dispatch(t, na); - ti = na.title; - na = na.name; - - //u = "javascript:tinymce.EditorManager.get('" + ed.id + "').theme._sel('" + (de++) + "');"; - pi = DOM.create('a', {'href' : "javascript:;", onmousedown : "return false;", title : ti, 'class' : 'mcePath_' + (de++)}, na); - - if (p.hasChildNodes()) { - p.insertBefore(DOM.doc.createTextNode(' \u00bb '), p.firstChild); - p.insertBefore(pi, p.firstChild); - } else - p.appendChild(pi); - }, ed.getBody()); - } - }, - - // Commands gets called by execCommand - - _sel : function(v) { - this.editor.execCommand('mceSelectNodeDepth', false, v); - }, - - _mceInsertAnchor : function(ui, v) { - var ed = this.editor; - - ed.windowManager.open({ - url : tinymce.baseURL + '/themes/advanced/anchor.htm', - width : 320 + parseInt(ed.getLang('advanced.anchor_delta_width', 0)), - height : 90 + parseInt(ed.getLang('advanced.anchor_delta_height', 0)), - inline : true - }, { - theme_url : this.url - }); - }, - - _mceCharMap : function() { - var ed = this.editor; - - ed.windowManager.open({ - url : tinymce.baseURL + '/themes/advanced/charmap.htm', - width : 550 + parseInt(ed.getLang('advanced.charmap_delta_width', 0)), - height : 250 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)), - inline : true - }, { - theme_url : this.url - }); - }, - - _mceHelp : function() { - var ed = this.editor; - - ed.windowManager.open({ - url : tinymce.baseURL + '/themes/advanced/about.htm', - width : 480, - height : 380, - inline : true - }, { - theme_url : this.url - }); - }, - - _mceColorPicker : function(u, v) { - var ed = this.editor; - - v = v || {}; - - ed.windowManager.open({ - url : tinymce.baseURL + '/themes/advanced/color_picker.htm', - width : 375 + parseInt(ed.getLang('advanced.colorpicker_delta_width', 0)), - height : 250 + parseInt(ed.getLang('advanced.colorpicker_delta_height', 0)), - close_previous : false, - inline : true - }, { - input_color : v.color, - func : v.func, - theme_url : this.url - }); - }, - - _mceCodeEditor : function(ui, val) { - var ed = this.editor; - - ed.windowManager.open({ - url : tinymce.baseURL + '/themes/advanced/source_editor.htm', - width : parseInt(ed.getParam("theme_advanced_source_editor_width", 720)), - height : parseInt(ed.getParam("theme_advanced_source_editor_height", 580)), - inline : true, - resizable : true, - maximizable : true - }, { - theme_url : this.url - }); - }, - - _mceImage : function(ui, val) { - var ed = this.editor; - - // Internal image object like a flash placeholder - if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1) - return; - - ed.windowManager.open({ - url : tinymce.baseURL + '/themes/advanced/image.htm', - width : 355 + parseInt(ed.getLang('advanced.image_delta_width', 0)), - height : 275 + parseInt(ed.getLang('advanced.image_delta_height', 0)), - inline : true - }, { - theme_url : this.url - }); - }, - - _mceLink : function(ui, val) { - var ed = this.editor; - - ed.windowManager.open({ - url : tinymce.baseURL + '/themes/advanced/link.htm', - width : 310 + parseInt(ed.getLang('advanced.link_delta_width', 0)), - height : 200 + parseInt(ed.getLang('advanced.link_delta_height', 0)), - inline : true - }, { - theme_url : this.url - }); - }, - - _mceNewDocument : function() { - var ed = this.editor; - - ed.windowManager.confirm('advanced.newdocument', function(s) { - if (s) - ed.execCommand('mceSetContent', false, ''); - }); - }, - - _mceForeColor : function() { - var t = this; - - this._mceColorPicker(0, { - color: t.fgColor, - func : function(co) { - t.fgColor = co; - t.editor.execCommand('ForeColor', false, co); - } - }); - }, - - _mceBackColor : function() { - var t = this; - - this._mceColorPicker(0, { - color: t.bgColor, - func : function(co) { - t.bgColor = co; - t.editor.execCommand('HiliteColor', false, co); - } - }); - }, - - _ufirst : function(s) { - return s.substring(0, 1).toUpperCase() + s.substring(1); - } - }); - - tinymce.ThemeManager.add('advanced', tinymce.themes.AdvancedTheme); +/** + * $Id$ + * + * @author Moxiecode + * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(function(tinymce) { + var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, each = tinymce.each, Cookie = tinymce.util.Cookie, lastExtID, explode = tinymce.explode; + + // Tell it to load theme specific language pack(s) + tinymce.ThemeManager.requireLangPack('advanced'); + + tinymce.create('tinymce.themes.AdvancedTheme', { + sizes : [8, 10, 12, 14, 18, 24, 36], + + // Control name lookup, format: title, command + controls : { + bold : ['bold_desc', 'Bold'], + italic : ['italic_desc', 'Italic'], + underline : ['underline_desc', 'Underline'], + strikethrough : ['striketrough_desc', 'Strikethrough'], + justifyleft : ['justifyleft_desc', 'JustifyLeft'], + justifycenter : ['justifycenter_desc', 'JustifyCenter'], + justifyright : ['justifyright_desc', 'JustifyRight'], + justifyfull : ['justifyfull_desc', 'JustifyFull'], + bullist : ['bullist_desc', 'InsertUnorderedList'], + numlist : ['numlist_desc', 'InsertOrderedList'], + outdent : ['outdent_desc', 'Outdent'], + indent : ['indent_desc', 'Indent'], + cut : ['cut_desc', 'Cut'], + copy : ['copy_desc', 'Copy'], + paste : ['paste_desc', 'Paste'], + undo : ['undo_desc', 'Undo'], + redo : ['redo_desc', 'Redo'], + link : ['link_desc', 'mceLink'], + unlink : ['unlink_desc', 'unlink'], + image : ['image_desc', 'mceImage'], + cleanup : ['cleanup_desc', 'mceCleanup'], + help : ['help_desc', 'mceHelp'], + code : ['code_desc', 'mceCodeEditor'], + hr : ['hr_desc', 'InsertHorizontalRule'], + removeformat : ['removeformat_desc', 'RemoveFormat'], + sub : ['sub_desc', 'subscript'], + sup : ['sup_desc', 'superscript'], + forecolor : ['forecolor_desc', 'ForeColor'], + forecolorpicker : ['forecolor_desc', 'mceForeColor'], + backcolor : ['backcolor_desc', 'HiliteColor'], + backcolorpicker : ['backcolor_desc', 'mceBackColor'], + charmap : ['charmap_desc', 'mceCharMap'], + visualaid : ['visualaid_desc', 'mceToggleVisualAid'], + anchor : ['anchor_desc', 'mceInsertAnchor'], + newdocument : ['newdocument_desc', 'mceNewDocument'], + blockquote : ['blockquote_desc', 'mceBlockQuote'] + }, + + stateControls : ['bold', 'italic', 'underline', 'strikethrough', 'bullist', 'numlist', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'sub', 'sup', 'blockquote'], + + init : function(ed, url) { + var t = this, s, v, o; + + t.editor = ed; + t.url = url; + t.onResolveName = new tinymce.util.Dispatcher(this); + + // Default settings + t.settings = s = extend({ + theme_advanced_path : true, + theme_advanced_toolbar_location : 'bottom', + theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect", + theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code", + theme_advanced_buttons3 : "hr,removeformat,visualaid,|,sub,sup,|,charmap", + theme_advanced_blockformats : "p,address,pre,h1,h2,h3,h4,h5,h6", + theme_advanced_toolbar_align : "center", + theme_advanced_fonts : "Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats", + theme_advanced_more_colors : 1, + theme_advanced_row_height : 23, + theme_advanced_resize_horizontal : 1, + theme_advanced_resizing_use_cookie : 1, + theme_advanced_font_sizes : "1,2,3,4,5,6,7", + readonly : ed.settings.readonly + }, ed.settings); + + // Setup default font_size_style_values + if (!s.font_size_style_values) + s.font_size_style_values = "8pt,10pt,12pt,14pt,18pt,24pt,36pt"; + + if (tinymce.is(s.theme_advanced_font_sizes, 'string')) { + s.font_size_style_values = tinymce.explode(s.font_size_style_values); + s.font_size_classes = tinymce.explode(s.font_size_classes || ''); + + // Parse string value + o = {}; + ed.settings.theme_advanced_font_sizes = s.theme_advanced_font_sizes; + each(ed.getParam('theme_advanced_font_sizes', '', 'hash'), function(v, k) { + var cl; + + if (k == v && v >= 1 && v <= 7) { + k = v + ' (' + t.sizes[v - 1] + 'pt)'; + + if (ed.settings.convert_fonts_to_spans) { + cl = s.font_size_classes[v - 1]; + v = s.font_size_style_values[v - 1] || (t.sizes[v - 1] + 'pt'); + } + } + + if (/^\s*\./.test(v)) + cl = v.replace(/\./g, ''); + + o[k] = cl ? {'class' : cl} : {fontSize : v}; + }); + + s.theme_advanced_font_sizes = o; + } + + if ((v = s.theme_advanced_path_location) && v != 'none') + s.theme_advanced_statusbar_location = s.theme_advanced_path_location; + + if (s.theme_advanced_statusbar_location == 'none') + s.theme_advanced_statusbar_location = 0; + + // Init editor + ed.onInit.add(function() { + ed.onNodeChange.add(t._nodeChanged, t); + + if (ed.settings.content_css !== false) + ed.dom.loadCSS(ed.baseURI.toAbsolute("themes/advanced/skins/" + ed.settings.skin + "/content.css")); + }); + + ed.onSetProgressState.add(function(ed, b, ti) { + var co, id = ed.id, tb; + + if (b) { + t.progressTimer = setTimeout(function() { + co = ed.getContainer(); + co = co.insertBefore(DOM.create('DIV', {style : 'position:relative'}), co.firstChild); + tb = DOM.get(ed.id + '_tbl'); + + DOM.add(co, 'div', {id : id + '_blocker', 'class' : 'mceBlocker', style : {width : tb.clientWidth + 2, height : tb.clientHeight + 2}}); + DOM.add(co, 'div', {id : id + '_progress', 'class' : 'mceProgress', style : {left : tb.clientWidth / 2, top : tb.clientHeight / 2}}); + }, ti || 0); + } else { + DOM.remove(id + '_blocker'); + DOM.remove(id + '_progress'); + clearTimeout(t.progressTimer); + } + }); + + DOM.loadCSS(s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : url + "/skins/" + ed.settings.skin + "/ui.css"); + + if (s.skin_variant) + DOM.loadCSS(url + "/skins/" + ed.settings.skin + "/ui_" + s.skin_variant + ".css"); + }, + + createControl : function(n, cf) { + var cd, c; + + if (c = cf.createControl(n)) + return c; + + switch (n) { + case "styleselect": + return this._createStyleSelect(); + + case "formatselect": + return this._createBlockFormats(); + + case "fontselect": + return this._createFontSelect(); + + case "fontsizeselect": + return this._createFontSizeSelect(); + + case "forecolor": + return this._createForeColorMenu(); + + case "backcolor": + return this._createBackColorMenu(); + } + + if ((cd = this.controls[n])) + return cf.createButton(n, {title : "advanced." + cd[0], cmd : cd[1], ui : cd[2], value : cd[3]}); + }, + + execCommand : function(cmd, ui, val) { + var f = this['_' + cmd]; + + if (f) { + f.call(this, ui, val); + return true; + } + + return false; + }, + + _importClasses : function(e) { + var ed = this.editor, c = ed.controlManager.get('styleselect'); + + if (c.getLength() == 0) { + each(ed.dom.getClasses(), function(o) { + c.add(o['class'], o['class']); + }); + } + }, + + _createStyleSelect : function(n) { + var t = this, ed = t.editor, cf = ed.controlManager, c = cf.createListBox('styleselect', { + title : 'advanced.style_select', + onselect : function(v) { + if (c.selectedValue === v) { + ed.execCommand('mceSetStyleInfo', 0, {command : 'removeformat'}); + c.select(); + return false; + } else + ed.execCommand('mceSetCSSClass', 0, v); + } + }); + + if (c) { + each(ed.getParam('theme_advanced_styles', '', 'hash'), function(v, k) { + if (v) + c.add(t.editor.translate(k), v); + }); + + c.onPostRender.add(function(ed, n) { + if (!c.NativeListBox) { + Event.add(n.id + '_text', 'focus', t._importClasses, t); + Event.add(n.id + '_text', 'mousedown', t._importClasses, t); + Event.add(n.id + '_open', 'focus', t._importClasses, t); + Event.add(n.id + '_open', 'mousedown', t._importClasses, t); + } else + Event.add(n.id, 'focus', t._importClasses, t); + }); + } + + return c; + }, + + _createFontSelect : function() { + var c, t = this, ed = t.editor; + + c = ed.controlManager.createListBox('fontselect', {title : 'advanced.fontdefault', cmd : 'FontName'}); + if (c) { + each(ed.getParam('theme_advanced_fonts', t.settings.theme_advanced_fonts, 'hash'), function(v, k) { + c.add(ed.translate(k), v, {style : v.indexOf('dings') == -1 ? 'font-family:' + v : ''}); + }); + } + + return c; + }, + + _createFontSizeSelect : function() { + var t = this, ed = t.editor, c, i = 0, cl = []; + + c = ed.controlManager.createListBox('fontsizeselect', {title : 'advanced.font_size', onselect : function(v) { + if (v.fontSize) + ed.execCommand('FontSize', false, v.fontSize); + else { + each(t.settings.theme_advanced_font_sizes, function(v, k) { + if (v['class']) + cl.push(v['class']); + }); + + ed.editorCommands._applyInlineStyle('span', {'class' : v['class']}, {check_classes : cl}); + } + }}); + + if (c) { + each(t.settings.theme_advanced_font_sizes, function(v, k) { + var fz = v.fontSize; + + if (fz >= 1 && fz <= 7) + fz = t.sizes[parseInt(fz) - 1] + 'pt'; + + c.add(k, v, {'style' : 'font-size:' + fz, 'class' : 'mceFontSize' + (i++) + (' ' + (v['class'] || ''))}); + }); + } + + return c; + }, + + _createBlockFormats : function() { + var c, fmts = { + p : 'advanced.paragraph', + address : 'advanced.address', + pre : 'advanced.pre', + h1 : 'advanced.h1', + h2 : 'advanced.h2', + h3 : 'advanced.h3', + h4 : 'advanced.h4', + h5 : 'advanced.h5', + h6 : 'advanced.h6', + div : 'advanced.div', + blockquote : 'advanced.blockquote', + code : 'advanced.code', + dt : 'advanced.dt', + dd : 'advanced.dd', + samp : 'advanced.samp' + }, t = this; + + c = t.editor.controlManager.createListBox('formatselect', {title : 'advanced.block', cmd : 'FormatBlock'}); + if (c) { + each(t.editor.getParam('theme_advanced_blockformats', t.settings.theme_advanced_blockformats, 'hash'), function(v, k) { + c.add(t.editor.translate(k != v ? k : fmts[v]), v, {'class' : 'mce_formatPreview mce_' + v}); + }); + } + + return c; + }, + + _createForeColorMenu : function() { + var c, t = this, s = t.settings, o = {}, v; + + if (s.theme_advanced_more_colors) { + o.more_colors_func = function() { + t._mceColorPicker(0, { + color : c.value, + func : function(co) { + c.setColor(co); + } + }); + }; + } + + if (v = s.theme_advanced_text_colors) + o.colors = v; + + if (s.theme_advanced_default_foreground_color) + o.default_color = s.theme_advanced_default_foreground_color; + + o.title = 'advanced.forecolor_desc'; + o.cmd = 'ForeColor'; + o.scope = this; + + c = t.editor.controlManager.createColorSplitButton('forecolor', o); + + return c; + }, + + _createBackColorMenu : function() { + var c, t = this, s = t.settings, o = {}, v; + + if (s.theme_advanced_more_colors) { + o.more_colors_func = function() { + t._mceColorPicker(0, { + color : c.value, + func : function(co) { + c.setColor(co); + } + }); + }; + } + + if (v = s.theme_advanced_background_colors) + o.colors = v; + + if (s.theme_advanced_default_background_color) + o.default_color = s.theme_advanced_default_background_color; + + o.title = 'advanced.backcolor_desc'; + o.cmd = 'HiliteColor'; + o.scope = this; + + c = t.editor.controlManager.createColorSplitButton('backcolor', o); + + return c; + }, + + renderUI : function(o) { + var n, ic, tb, t = this, ed = t.editor, s = t.settings, sc, p, nl; + + n = p = DOM.create('span', {id : ed.id + '_parent', 'class' : 'mceEditor ' + ed.settings.skin + 'Skin' + (s.skin_variant ? ' ' + ed.settings.skin + 'Skin' + t._ufirst(s.skin_variant) : '')}); + + if (!DOM.boxModel) + n = DOM.add(n, 'div', {'class' : 'mceOldBoxModel'}); + + n = sc = DOM.add(n, 'table', {id : ed.id + '_tbl', 'class' : 'mceLayout', cellSpacing : 0, cellPadding : 0}); + n = tb = DOM.add(n, 'tbody'); + + switch ((s.theme_advanced_layout_manager || '').toLowerCase()) { + case "rowlayout": + ic = t._rowLayout(s, tb, o); + break; + + case "customlayout": + ic = ed.execCallback("theme_advanced_custom_layout", s, tb, o, p); + break; + + default: + ic = t._simpleLayout(s, tb, o, p); + } + + n = o.targetNode; + + // Add classes to first and last TRs + nl = DOM.stdMode ? sc.getElementsByTagName('tr') : sc.rows; // Quick fix for IE 8 + DOM.addClass(nl[0], 'mceFirst'); + DOM.addClass(nl[nl.length - 1], 'mceLast'); + + // Add classes to first and last TDs + each(DOM.select('tr', tb), function(n) { + DOM.addClass(n.firstChild, 'mceFirst'); + DOM.addClass(n.childNodes[n.childNodes.length - 1], 'mceLast'); + }); + + if (DOM.get(s.theme_advanced_toolbar_container)) + DOM.get(s.theme_advanced_toolbar_container).appendChild(p); + else + DOM.insertAfter(p, n); + + Event.add(ed.id + '_path_row', 'click', function(e) { + e = e.target; + + if (e.nodeName == 'A') { + t._sel(e.className.replace(/^.*mcePath_([0-9]+).*$/, '$1')); + + return Event.cancel(e); + } + }); +/* + if (DOM.get(ed.id + '_path_row')) { + Event.add(ed.id + '_tbl', 'mouseover', function(e) { + var re; + + e = e.target; + + if (e.nodeName == 'SPAN' && DOM.hasClass(e.parentNode, 'mceButton')) { + re = DOM.get(ed.id + '_path_row'); + t.lastPath = re.innerHTML; + DOM.setHTML(re, e.parentNode.title); + } + }); + + Event.add(ed.id + '_tbl', 'mouseout', function(e) { + if (t.lastPath) { + DOM.setHTML(ed.id + '_path_row', t.lastPath); + t.lastPath = 0; + } + }); + } +*/ + + if (!ed.getParam('accessibility_focus')) + Event.add(DOM.add(p, 'a', {href : '#'}, ''), 'focus', function() {tinyMCE.get(ed.id).focus();}); + + if (s.theme_advanced_toolbar_location == 'external') + o.deltaHeight = 0; + + t.deltaHeight = o.deltaHeight; + o.targetNode = null; + + return { + iframeContainer : ic, + editorContainer : ed.id + '_parent', + sizeContainer : sc, + deltaHeight : o.deltaHeight + }; + }, + + getInfo : function() { + return { + longname : 'Advanced theme', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + version : tinymce.majorVersion + "." + tinymce.minorVersion + } + }, + + resizeBy : function(dw, dh) { + var e = DOM.get(this.editor.id + '_tbl'); + + this.resizeTo(e.clientWidth + dw, e.clientHeight + dh); + }, + + resizeTo : function(w, h) { + var ed = this.editor, s = ed.settings, e = DOM.get(ed.id + '_tbl'), ifr = DOM.get(ed.id + '_ifr'), dh; + + // Boundery fix box + w = Math.max(s.theme_advanced_resizing_min_width || 100, w); + h = Math.max(s.theme_advanced_resizing_min_height || 100, h); + w = Math.min(s.theme_advanced_resizing_max_width || 0xFFFF, w); + h = Math.min(s.theme_advanced_resizing_max_height || 0xFFFF, h); + + // Calc difference between iframe and container + dh = e.clientHeight - ifr.clientHeight; + + // Resize iframe and container + DOM.setStyle(ifr, 'height', h - dh); + DOM.setStyles(e, {width : w, height : h}); + }, + + destroy : function() { + var id = this.editor.id; + + Event.clear(id + '_resize'); + Event.clear(id + '_path_row'); + Event.clear(id + '_external_close'); + }, + + // Internal functions + + _simpleLayout : function(s, tb, o, p) { + var t = this, ed = t.editor, lo = s.theme_advanced_toolbar_location, sl = s.theme_advanced_statusbar_location, n, ic, etb, c; + + if (s.readonly) { + n = DOM.add(tb, 'tr'); + n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); + return ic; + } + + // Create toolbar container at top + if (lo == 'top') + t._addToolbars(tb, o); + + // Create external toolbar + if (lo == 'external') { + n = c = DOM.create('div', {style : 'position:relative'}); + n = DOM.add(n, 'div', {id : ed.id + '_external', 'class' : 'mceExternalToolbar'}); + DOM.add(n, 'a', {id : ed.id + '_external_close', href : 'javascript:;', 'class' : 'mceExternalClose'}); + n = DOM.add(n, 'table', {id : ed.id + '_tblext', cellSpacing : 0, cellPadding : 0}); + etb = DOM.add(n, 'tbody'); + + if (p.firstChild.className == 'mceOldBoxModel') + p.firstChild.appendChild(c); + else + p.insertBefore(c, p.firstChild); + + t._addToolbars(etb, o); + + ed.onMouseUp.add(function() { + var e = DOM.get(ed.id + '_external'); + DOM.show(e); + + DOM.hide(lastExtID); + + var f = Event.add(ed.id + '_external_close', 'click', function() { + DOM.hide(ed.id + '_external'); + Event.remove(ed.id + '_external_close', 'click', f); + }); + + DOM.show(e); + DOM.setStyle(e, 'top', 0 - DOM.getRect(ed.id + '_tblext').h - 1); + + // Fixes IE rendering bug + DOM.hide(e); + DOM.show(e); + e.style.filter = ''; + + lastExtID = ed.id + '_external'; + + e = null; + }); + } + + if (sl == 'top') + t._addStatusBar(tb, o); + + // Create iframe container + if (!s.theme_advanced_toolbar_container) { + n = DOM.add(tb, 'tr'); + n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); + } + + // Create toolbar container at bottom + if (lo == 'bottom') + t._addToolbars(tb, o); + + if (sl == 'bottom') + t._addStatusBar(tb, o); + + return ic; + }, + + _rowLayout : function(s, tb, o) { + var t = this, ed = t.editor, dc, da, cf = ed.controlManager, n, ic, to, a; + + dc = s.theme_advanced_containers_default_class || ''; + da = s.theme_advanced_containers_default_align || 'center'; + + each(explode(s.theme_advanced_containers || ''), function(c, i) { + var v = s['theme_advanced_container_' + c] || ''; + + switch (v.toLowerCase()) { + case 'mceeditor': + n = DOM.add(tb, 'tr'); + n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); + break; + + case 'mceelementpath': + t._addStatusBar(tb, o); + break; + + default: + a = (s['theme_advanced_container_' + c + '_align'] || da).toLowerCase(); + a = 'mce' + t._ufirst(a); + + n = DOM.add(DOM.add(tb, 'tr'), 'td', { + 'class' : 'mceToolbar ' + (s['theme_advanced_container_' + c + '_class'] || dc) + ' ' + a || da + }); + + to = cf.createToolbar("toolbar" + i); + t._addControls(v, to); + DOM.setHTML(n, to.renderHTML()); + o.deltaHeight -= s.theme_advanced_row_height; + } + }); + + return ic; + }, + + _addControls : function(v, tb) { + var t = this, s = t.settings, di, cf = t.editor.controlManager; + + if (s.theme_advanced_disable && !t._disabled) { + di = {}; + + each(explode(s.theme_advanced_disable), function(v) { + di[v] = 1; + }); + + t._disabled = di; + } else + di = t._disabled; + + each(explode(v), function(n) { + var c; + + if (di && di[n]) + return; + + // Compatiblity with 2.x + if (n == 'tablecontrols') { + each(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"], function(n) { + n = t.createControl(n, cf); + + if (n) + tb.add(n); + }); + + return; + } + + c = t.createControl(n, cf); + + if (c) + tb.add(c); + }); + }, + + _addToolbars : function(c, o) { + var t = this, i, tb, ed = t.editor, s = t.settings, v, cf = ed.controlManager, di, n, h = [], a; + + a = s.theme_advanced_toolbar_align.toLowerCase(); + a = 'mce' + t._ufirst(a); + + n = DOM.add(DOM.add(c, 'tr'), 'td', {'class' : 'mceToolbar ' + a}); + + if (!ed.getParam('accessibility_focus')) + h.push(DOM.createHTML('a', {href : '#', onfocus : 'tinyMCE.get(\'' + ed.id + '\').focus();'}, '')); + + h.push(DOM.createHTML('a', {href : '#', accesskey : 'q', title : ed.getLang("advanced.toolbar_focus")}, '')); + + // Create toolbar and add the controls + for (i=1; (v = s['theme_advanced_buttons' + i]); i++) { + tb = cf.createToolbar("toolbar" + i, {'class' : 'mceToolbarRow' + i}); + + if (s['theme_advanced_buttons' + i + '_add']) + v += ',' + s['theme_advanced_buttons' + i + '_add']; + + if (s['theme_advanced_buttons' + i + '_add_before']) + v = s['theme_advanced_buttons' + i + '_add_before'] + ',' + v; + + t._addControls(v, tb); + + //n.appendChild(n = tb.render()); + h.push(tb.renderHTML()); + + o.deltaHeight -= s.theme_advanced_row_height; + } + + h.push(DOM.createHTML('a', {href : '#', accesskey : 'z', title : ed.getLang("advanced.toolbar_focus"), onfocus : 'tinyMCE.getInstanceById(\'' + ed.id + '\').focus();'}, '')); + DOM.setHTML(n, h.join('')); + }, + + _addStatusBar : function(tb, o) { + var n, t = this, ed = t.editor, s = t.settings, r, mf, me, td; + + n = DOM.add(tb, 'tr'); + n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'}); + n = DOM.add(n, 'div', {id : ed.id + '_path_row'}, s.theme_advanced_path ? ed.translate('advanced.path') + ': ' : ' '); + DOM.add(n, 'a', {href : '#', accesskey : 'x'}); + + if (s.theme_advanced_resizing) { + DOM.add(td, 'a', {id : ed.id + '_resize', href : 'javascript:;', onclick : "return false;", 'class' : 'mceResize'}); + + if (s.theme_advanced_resizing_use_cookie) { + ed.onPostRender.add(function() { + var o = Cookie.getHash("TinyMCE_" + ed.id + "_size"), c = DOM.get(ed.id + '_tbl'); + + if (!o) + return; + + if (s.theme_advanced_resize_horizontal) + c.style.width = Math.max(10, o.cw) + 'px'; + + c.style.height = Math.max(10, o.ch) + 'px'; + DOM.get(ed.id + '_ifr').style.height = Math.max(10, parseInt(o.ch) + t.deltaHeight) + 'px'; + }); + } + + ed.onPostRender.add(function() { + Event.add(ed.id + '_resize', 'mousedown', function(e) { + var c, p, w, h, n, pa; + + // Measure container + c = DOM.get(ed.id + '_tbl'); + w = c.clientWidth; + h = c.clientHeight; + + miw = s.theme_advanced_resizing_min_width || 100; + mih = s.theme_advanced_resizing_min_height || 100; + maw = s.theme_advanced_resizing_max_width || 0xFFFF; + mah = s.theme_advanced_resizing_max_height || 0xFFFF; + + // Setup placeholder + p = DOM.add(DOM.get(ed.id + '_parent'), 'div', {'class' : 'mcePlaceHolder'}); + DOM.setStyles(p, {width : w, height : h}); + + // Replace with placeholder + DOM.hide(c); + DOM.show(p); + + // Create internal resize obj + r = { + x : e.screenX, + y : e.screenY, + w : w, + h : h, + dx : null, + dy : null + }; + + // Start listening + mf = Event.add(DOM.doc, 'mousemove', function(e) { + var w, h; + + // Calc delta values + r.dx = e.screenX - r.x; + r.dy = e.screenY - r.y; + + // Boundery fix box + w = Math.max(miw, r.w + r.dx); + h = Math.max(mih, r.h + r.dy); + w = Math.min(maw, w); + h = Math.min(mah, h); + + // Resize placeholder + if (s.theme_advanced_resize_horizontal) + p.style.width = w + 'px'; + + p.style.height = h + 'px'; + + return Event.cancel(e); + }); + + me = Event.add(DOM.doc, 'mouseup', function(e) { + var ifr; + + // Stop listening + Event.remove(DOM.doc, 'mousemove', mf); + Event.remove(DOM.doc, 'mouseup', me); + + c.style.display = ''; + DOM.remove(p); + + if (r.dx === null) + return; + + ifr = DOM.get(ed.id + '_ifr'); + + if (s.theme_advanced_resize_horizontal) + c.style.width = Math.max(10, r.w + r.dx) + 'px'; + + c.style.height = Math.max(10, r.h + r.dy) + 'px'; + ifr.style.height = Math.max(10, ifr.clientHeight + r.dy) + 'px'; + + if (s.theme_advanced_resizing_use_cookie) { + Cookie.setHash("TinyMCE_" + ed.id + "_size", { + cw : r.w + r.dx, + ch : r.h + r.dy + }); + } + }); + + return Event.cancel(e); + }); + }); + } + + o.deltaHeight -= 21; + n = tb = null; + }, + + _nodeChanged : function(ed, cm, n, co) { + var t = this, p, de = 0, v, c, s = t.settings, cl, fz, fn; + + if (s.readonly) + return; + + tinymce.each(t.stateControls, function(c) { + cm.setActive(c, ed.queryCommandState(t.controls[c][1])); + }); + + cm.setActive('visualaid', ed.hasVisual); + cm.setDisabled('undo', !ed.undoManager.hasUndo() && !ed.typing); + cm.setDisabled('redo', !ed.undoManager.hasRedo()); + cm.setDisabled('outdent', !ed.queryCommandState('Outdent')); + + p = DOM.getParent(n, 'A'); + if (c = cm.get('link')) { + if (!p || !p.name) { + c.setDisabled(!p && co); + c.setActive(!!p); + } + } + + if (c = cm.get('unlink')) { + c.setDisabled(!p && co); + c.setActive(!!p && !p.name); + } + + if (c = cm.get('anchor')) { + c.setActive(!!p && p.name); + + if (tinymce.isWebKit) { + p = DOM.getParent(n, 'IMG'); + c.setActive(!!p && DOM.getAttrib(p, 'mce_name') == 'a'); + } + } + + p = DOM.getParent(n, 'IMG'); + if (c = cm.get('image')) + c.setActive(!!p && n.className.indexOf('mceItem') == -1); + + if (c = cm.get('styleselect')) { + if (n.className) { + t._importClasses(); + c.select(n.className); + } else + c.select(); + } + + if (c = cm.get('formatselect')) { + p = DOM.getParent(n, DOM.isBlock); + + if (p) + c.select(p.nodeName.toLowerCase()); + } + + if (ed.settings.convert_fonts_to_spans) { + ed.dom.getParent(n, function(n) { + if (n.nodeName === 'SPAN') { + if (!cl && n.className) + cl = n.className; + + if (!fz && n.style.fontSize) + fz = n.style.fontSize; + + if (!fn && n.style.fontFamily) + fn = n.style.fontFamily.replace(/[\"\']+/g, '').replace(/^([^,]+).*/, '$1').toLowerCase(); + } + + return false; + }); + + if (c = cm.get('fontselect')) { + c.select(function(v) { + return v.replace(/^([^,]+).*/, '$1').toLowerCase() == fn; + }); + } + + if (c = cm.get('fontsizeselect')) { + c.select(function(v) { + if (v.fontSize && v.fontSize === fz) + return true; + + if (v['class'] && v['class'] === cl) + return true; + }); + } + } else { + if (c = cm.get('fontselect')) + c.select(ed.queryCommandValue('FontName')); + + if (c = cm.get('fontsizeselect')) { + v = ed.queryCommandValue('FontSize'); + c.select(function(iv) { + return iv.fontSize == v; + }); + } + } + + if (s.theme_advanced_path && s.theme_advanced_statusbar_location) { + p = DOM.get(ed.id + '_path') || DOM.add(ed.id + '_path_row', 'span', {id : ed.id + '_path'}); + DOM.setHTML(p, ''); + + ed.dom.getParent(n, function(n) { + var na = n.nodeName.toLowerCase(), u, pi, ti = ''; + + // Ignore non element and hidden elements + if (n.nodeType != 1 || n.nodeName === 'BR' || (DOM.hasClass(n, 'mceItemHidden') || DOM.hasClass(n, 'mceItemRemoved'))) + return; + + // Fake name + if (v = DOM.getAttrib(n, 'mce_name')) + na = v; + + // Handle prefix + if (tinymce.isIE && n.scopeName !== 'HTML') + na = n.scopeName + ':' + na; + + // Remove internal prefix + na = na.replace(/mce\:/g, ''); + + // Handle node name + switch (na) { + case 'b': + na = 'strong'; + break; + + case 'i': + na = 'em'; + break; + + case 'img': + if (v = DOM.getAttrib(n, 'src')) + ti += 'src: ' + v + ' '; + + break; + + case 'a': + if (v = DOM.getAttrib(n, 'name')) { + ti += 'name: ' + v + ' '; + na += '#' + v; + } + + if (v = DOM.getAttrib(n, 'href')) + ti += 'href: ' + v + ' '; + + break; + + case 'font': + if (s.convert_fonts_to_spans) + na = 'span'; + + if (v = DOM.getAttrib(n, 'face')) + ti += 'font: ' + v + ' '; + + if (v = DOM.getAttrib(n, 'size')) + ti += 'size: ' + v + ' '; + + if (v = DOM.getAttrib(n, 'color')) + ti += 'color: ' + v + ' '; + + break; + + case 'span': + if (v = DOM.getAttrib(n, 'style')) + ti += 'style: ' + v + ' '; + + break; + } + + if (v = DOM.getAttrib(n, 'id')) + ti += 'id: ' + v + ' '; + + if (v = n.className) { + v = v.replace(/(webkit-[\w\-]+|Apple-[\w\-]+|mceItem\w+|mceVisualAid)/g, ''); + + if (v && v.indexOf('mceItem') == -1) { + ti += 'class: ' + v + ' '; + + if (DOM.isBlock(n) || na == 'img' || na == 'span') + na += '.' + v; + } + } + + na = na.replace(/(html:)/g, ''); + na = {name : na, node : n, title : ti}; + t.onResolveName.dispatch(t, na); + ti = na.title; + na = na.name; + + //u = "javascript:tinymce.EditorManager.get('" + ed.id + "').theme._sel('" + (de++) + "');"; + pi = DOM.create('a', {'href' : "javascript:;", onmousedown : "return false;", title : ti, 'class' : 'mcePath_' + (de++)}, na); + + if (p.hasChildNodes()) { + p.insertBefore(DOM.doc.createTextNode(' \u00bb '), p.firstChild); + p.insertBefore(pi, p.firstChild); + } else + p.appendChild(pi); + }, ed.getBody()); + } + }, + + // Commands gets called by execCommand + + _sel : function(v) { + this.editor.execCommand('mceSelectNodeDepth', false, v); + }, + + _mceInsertAnchor : function(ui, v) { + var ed = this.editor; + + ed.windowManager.open({ + url : tinymce.baseURL + '/themes/advanced/anchor.htm', + width : 320 + parseInt(ed.getLang('advanced.anchor_delta_width', 0)), + height : 90 + parseInt(ed.getLang('advanced.anchor_delta_height', 0)), + inline : true + }, { + theme_url : this.url + }); + }, + + _mceCharMap : function() { + var ed = this.editor; + + ed.windowManager.open({ + url : tinymce.baseURL + '/themes/advanced/charmap.htm', + width : 550 + parseInt(ed.getLang('advanced.charmap_delta_width', 0)), + height : 250 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)), + inline : true + }, { + theme_url : this.url + }); + }, + + _mceHelp : function() { + var ed = this.editor; + + ed.windowManager.open({ + url : tinymce.baseURL + '/themes/advanced/about.htm', + width : 480, + height : 380, + inline : true + }, { + theme_url : this.url + }); + }, + + _mceColorPicker : function(u, v) { + var ed = this.editor; + + v = v || {}; + + ed.windowManager.open({ + url : tinymce.baseURL + '/themes/advanced/color_picker.htm', + width : 375 + parseInt(ed.getLang('advanced.colorpicker_delta_width', 0)), + height : 250 + parseInt(ed.getLang('advanced.colorpicker_delta_height', 0)), + close_previous : false, + inline : true + }, { + input_color : v.color, + func : v.func, + theme_url : this.url + }); + }, + + _mceCodeEditor : function(ui, val) { + var ed = this.editor; + + ed.windowManager.open({ + url : tinymce.baseURL + '/themes/advanced/source_editor.htm', + width : parseInt(ed.getParam("theme_advanced_source_editor_width", 720)), + height : parseInt(ed.getParam("theme_advanced_source_editor_height", 580)), + inline : true, + resizable : true, + maximizable : true + }, { + theme_url : this.url + }); + }, + + _mceImage : function(ui, val) { + var ed = this.editor; + + // Internal image object like a flash placeholder + if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1) + return; + + ed.windowManager.open({ + url : tinymce.baseURL + '/themes/advanced/image.htm', + width : 355 + parseInt(ed.getLang('advanced.image_delta_width', 0)), + height : 275 + parseInt(ed.getLang('advanced.image_delta_height', 0)), + inline : true + }, { + theme_url : this.url + }); + }, + + _mceLink : function(ui, val) { + var ed = this.editor; + + ed.windowManager.open({ + url : tinymce.baseURL + '/themes/advanced/link.htm', + width : 310 + parseInt(ed.getLang('advanced.link_delta_width', 0)), + height : 200 + parseInt(ed.getLang('advanced.link_delta_height', 0)), + inline : true + }, { + theme_url : this.url + }); + }, + + _mceNewDocument : function() { + var ed = this.editor; + + ed.windowManager.confirm('advanced.newdocument', function(s) { + if (s) + ed.execCommand('mceSetContent', false, ''); + }); + }, + + _mceForeColor : function() { + var t = this; + + this._mceColorPicker(0, { + color: t.fgColor, + func : function(co) { + t.fgColor = co; + t.editor.execCommand('ForeColor', false, co); + } + }); + }, + + _mceBackColor : function() { + var t = this; + + this._mceColorPicker(0, { + color: t.bgColor, + func : function(co) { + t.bgColor = co; + t.editor.execCommand('HiliteColor', false, co); + } + }); + }, + + _ufirst : function(s) { + return s.substring(0, 1).toUpperCase() + s.substring(1); + } + }); + + tinymce.ThemeManager.add('advanced', tinymce.themes.AdvancedTheme); }(tinymce)); \ No newline at end of file diff --git a/lib/editor/tinymce/themes/advanced/image.htm b/lib/editor/tinymce/themes/advanced/image.htm index 7ec1052ba54..c04afeec6da 100644 --- a/lib/editor/tinymce/themes/advanced/image.htm +++ b/lib/editor/tinymce/themes/advanced/image.htm @@ -1,85 +1,85 @@ - - - - {#advanced_dlg.image_title} - - - - - - -
    - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - -
     
    - x -
    -
    -
    - -
    -
    - -
    - -
    - -
    -
    -
    - - + + + + {#advanced_dlg.image_title} + + + + + + +
    + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + +
     
    + x +
    +
    +
    + +
    +
    + +
    + +
    + +
    +
    +
    + + diff --git a/lib/editor/tinymce/themes/advanced/js/about.js b/lib/editor/tinymce/themes/advanced/js/about.js index 5cee9ed863c..7fc8ba2a3f5 100644 --- a/lib/editor/tinymce/themes/advanced/js/about.js +++ b/lib/editor/tinymce/themes/advanced/js/about.js @@ -1,72 +1,72 @@ -tinyMCEPopup.requireLangPack(); - -function init() { - var ed, tcont; - - tinyMCEPopup.resizeToInnerSize(); - ed = tinyMCEPopup.editor; - - // Give FF some time - window.setTimeout(insertHelpIFrame, 10); - - tcont = document.getElementById('plugintablecontainer'); - document.getElementById('plugins_tab').style.display = 'none'; - - var html = ""; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - - tinymce.each(ed.plugins, function(p, n) { - var info; - - if (!p.getInfo) - return; - - html += ''; - - info = p.getInfo(); - - if (info.infourl != null && info.infourl != '') - html += ''; - else - html += ''; - - if (info.authorurl != null && info.authorurl != '') - html += ''; - else - html += ''; - - html += ''; - html += ''; - - document.getElementById('plugins_tab').style.display = ''; - - }); - - html += ''; - html += '
    ' + ed.getLang('advanced_dlg.about_plugin') + '' + ed.getLang('advanced_dlg.about_author') + '' + ed.getLang('advanced_dlg.about_version') + '
    ' + info.longname + '' + info.longname + '' + info.author + '' + info.author + '' + info.version + '
    '; - - tcont.innerHTML = html; - - tinyMCEPopup.dom.get('version').innerHTML = tinymce.majorVersion + "." + tinymce.minorVersion; - tinyMCEPopup.dom.get('date').innerHTML = tinymce.releaseDate; -} - -function insertHelpIFrame() { - var html; - - if (tinyMCEPopup.getParam('docs_url')) { - html = ''; - document.getElementById('iframecontainer').innerHTML = html; - document.getElementById('help_tab').style.display = 'block'; - } -} - -tinyMCEPopup.onInit.add(init); +tinyMCEPopup.requireLangPack(); + +function init() { + var ed, tcont; + + tinyMCEPopup.resizeToInnerSize(); + ed = tinyMCEPopup.editor; + + // Give FF some time + window.setTimeout(insertHelpIFrame, 10); + + tcont = document.getElementById('plugintablecontainer'); + document.getElementById('plugins_tab').style.display = 'none'; + + var html = ""; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + + tinymce.each(ed.plugins, function(p, n) { + var info; + + if (!p.getInfo) + return; + + html += ''; + + info = p.getInfo(); + + if (info.infourl != null && info.infourl != '') + html += ''; + else + html += ''; + + if (info.authorurl != null && info.authorurl != '') + html += ''; + else + html += ''; + + html += ''; + html += ''; + + document.getElementById('plugins_tab').style.display = ''; + + }); + + html += ''; + html += '
    ' + ed.getLang('advanced_dlg.about_plugin') + '' + ed.getLang('advanced_dlg.about_author') + '' + ed.getLang('advanced_dlg.about_version') + '
    ' + info.longname + '' + info.longname + '' + info.author + '' + info.author + '' + info.version + '
    '; + + tcont.innerHTML = html; + + tinyMCEPopup.dom.get('version').innerHTML = tinymce.majorVersion + "." + tinymce.minorVersion; + tinyMCEPopup.dom.get('date').innerHTML = tinymce.releaseDate; +} + +function insertHelpIFrame() { + var html; + + if (tinyMCEPopup.getParam('docs_url')) { + html = ''; + document.getElementById('iframecontainer').innerHTML = html; + document.getElementById('help_tab').style.display = 'block'; + } +} + +tinyMCEPopup.onInit.add(init); diff --git a/lib/editor/tinymce/themes/advanced/js/anchor.js b/lib/editor/tinymce/themes/advanced/js/anchor.js index b5efd1ec973..76f4f7dd2bb 100644 --- a/lib/editor/tinymce/themes/advanced/js/anchor.js +++ b/lib/editor/tinymce/themes/advanced/js/anchor.js @@ -1,37 +1,37 @@ -tinyMCEPopup.requireLangPack(); - -var AnchorDialog = { - init : function(ed) { - var action, elm, f = document.forms[0]; - - this.editor = ed; - elm = ed.dom.getParent(ed.selection.getNode(), 'A,IMG'); - v = ed.dom.getAttrib(elm, 'name'); - - if (v) { - this.action = 'update'; - f.anchorName.value = v; - } - - f.insert.value = ed.getLang(elm ? 'update' : 'insert'); - }, - - update : function() { - var ed = this.editor; - - tinyMCEPopup.restoreSelection(); - - if (this.action != 'update') - ed.selection.collapse(1); - - // Webkit acts weird if empty inline element is inserted so we need to use a image instead - if (tinymce.isWebKit) - ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('img', {mce_name : 'a', name : document.forms[0].anchorName.value, 'class' : 'mceItemAnchor'})); - else - ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', {name : document.forms[0].anchorName.value, 'class' : 'mceItemAnchor'}, '')); - - tinyMCEPopup.close(); - } -}; - -tinyMCEPopup.onInit.add(AnchorDialog.init, AnchorDialog); +tinyMCEPopup.requireLangPack(); + +var AnchorDialog = { + init : function(ed) { + var action, elm, f = document.forms[0]; + + this.editor = ed; + elm = ed.dom.getParent(ed.selection.getNode(), 'A,IMG'); + v = ed.dom.getAttrib(elm, 'name'); + + if (v) { + this.action = 'update'; + f.anchorName.value = v; + } + + f.insert.value = ed.getLang(elm ? 'update' : 'insert'); + }, + + update : function() { + var ed = this.editor; + + tinyMCEPopup.restoreSelection(); + + if (this.action != 'update') + ed.selection.collapse(1); + + // Webkit acts weird if empty inline element is inserted so we need to use a image instead + if (tinymce.isWebKit) + ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('img', {mce_name : 'a', name : document.forms[0].anchorName.value, 'class' : 'mceItemAnchor'})); + else + ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', {name : document.forms[0].anchorName.value, 'class' : 'mceItemAnchor'}, '')); + + tinyMCEPopup.close(); + } +}; + +tinyMCEPopup.onInit.add(AnchorDialog.init, AnchorDialog); diff --git a/lib/editor/tinymce/themes/advanced/js/charmap.js b/lib/editor/tinymce/themes/advanced/js/charmap.js index 8467ef60366..d9fd8d3271a 100644 --- a/lib/editor/tinymce/themes/advanced/js/charmap.js +++ b/lib/editor/tinymce/themes/advanced/js/charmap.js @@ -1,325 +1,325 @@ -tinyMCEPopup.requireLangPack(); - -var charmap = [ - [' ', ' ', true, 'no-break space'], - ['&', '&', true, 'ampersand'], - ['"', '"', true, 'quotation mark'], -// finance - ['¢', '¢', true, 'cent sign'], - ['€', '€', true, 'euro sign'], - ['£', '£', true, 'pound sign'], - ['¥', '¥', true, 'yen sign'], -// signs - ['©', '©', true, 'copyright sign'], - ['®', '®', true, 'registered sign'], - ['™', '™', true, 'trade mark sign'], - ['‰', '‰', true, 'per mille sign'], - ['µ', 'µ', true, 'micro sign'], - ['·', '·', true, 'middle dot'], - ['•', '•', true, 'bullet'], - ['…', '…', true, 'three dot leader'], - ['′', '′', true, 'minutes / feet'], - ['″', '″', true, 'seconds / inches'], - ['§', '§', true, 'section sign'], - ['¶', '¶', true, 'paragraph sign'], - ['ß', 'ß', true, 'sharp s / ess-zed'], -// quotations - ['‹', '‹', true, 'single left-pointing angle quotation mark'], - ['›', '›', true, 'single right-pointing angle quotation mark'], - ['«', '«', true, 'left pointing guillemet'], - ['»', '»', true, 'right pointing guillemet'], - ['‘', '‘', true, 'left single quotation mark'], - ['’', '’', true, 'right single quotation mark'], - ['“', '“', true, 'left double quotation mark'], - ['”', '”', true, 'right double quotation mark'], - ['‚', '‚', true, 'single low-9 quotation mark'], - ['„', '„', true, 'double low-9 quotation mark'], - ['<', '<', true, 'less-than sign'], - ['>', '>', true, 'greater-than sign'], - ['≤', '≤', true, 'less-than or equal to'], - ['≥', '≥', true, 'greater-than or equal to'], - ['–', '–', true, 'en dash'], - ['—', '—', true, 'em dash'], - ['¯', '¯', true, 'macron'], - ['‾', '‾', true, 'overline'], - ['¤', '¤', true, 'currency sign'], - ['¦', '¦', true, 'broken bar'], - ['¨', '¨', true, 'diaeresis'], - ['¡', '¡', true, 'inverted exclamation mark'], - ['¿', '¿', true, 'turned question mark'], - ['ˆ', 'ˆ', true, 'circumflex accent'], - ['˜', '˜', true, 'small tilde'], - ['°', '°', true, 'degree sign'], - ['−', '−', true, 'minus sign'], - ['±', '±', true, 'plus-minus sign'], - ['÷', '÷', true, 'division sign'], - ['⁄', '⁄', true, 'fraction slash'], - ['×', '×', true, 'multiplication sign'], - ['¹', '¹', true, 'superscript one'], - ['²', '²', true, 'superscript two'], - ['³', '³', true, 'superscript three'], - ['¼', '¼', true, 'fraction one quarter'], - ['½', '½', true, 'fraction one half'], - ['¾', '¾', true, 'fraction three quarters'], -// math / logical - ['ƒ', 'ƒ', true, 'function / florin'], - ['∫', '∫', true, 'integral'], - ['∑', '∑', true, 'n-ary sumation'], - ['∞', '∞', true, 'infinity'], - ['√', '√', true, 'square root'], - ['∼', '∼', false,'similar to'], - ['≅', '≅', false,'approximately equal to'], - ['≈', '≈', true, 'almost equal to'], - ['≠', '≠', true, 'not equal to'], - ['≡', '≡', true, 'identical to'], - ['∈', '∈', false,'element of'], - ['∉', '∉', false,'not an element of'], - ['∋', '∋', false,'contains as member'], - ['∏', '∏', true, 'n-ary product'], - ['∧', '∧', false,'logical and'], - ['∨', '∨', false,'logical or'], - ['¬', '¬', true, 'not sign'], - ['∩', '∩', true, 'intersection'], - ['∪', '∪', false,'union'], - ['∂', '∂', true, 'partial differential'], - ['∀', '∀', false,'for all'], - ['∃', '∃', false,'there exists'], - ['∅', '∅', false,'diameter'], - ['∇', '∇', false,'backward difference'], - ['∗', '∗', false,'asterisk operator'], - ['∝', '∝', false,'proportional to'], - ['∠', '∠', false,'angle'], -// undefined - ['´', '´', true, 'acute accent'], - ['¸', '¸', true, 'cedilla'], - ['ª', 'ª', true, 'feminine ordinal indicator'], - ['º', 'º', true, 'masculine ordinal indicator'], - ['†', '†', true, 'dagger'], - ['‡', '‡', true, 'double dagger'], -// alphabetical special chars - ['À', 'À', true, 'A - grave'], - ['Á', 'Á', true, 'A - acute'], - ['Â', 'Â', true, 'A - circumflex'], - ['Ã', 'Ã', true, 'A - tilde'], - ['Ä', 'Ä', true, 'A - diaeresis'], - ['Å', 'Å', true, 'A - ring above'], - ['Æ', 'Æ', true, 'ligature AE'], - ['Ç', 'Ç', true, 'C - cedilla'], - ['È', 'È', true, 'E - grave'], - ['É', 'É', true, 'E - acute'], - ['Ê', 'Ê', true, 'E - circumflex'], - ['Ë', 'Ë', true, 'E - diaeresis'], - ['Ì', 'Ì', true, 'I - grave'], - ['Í', 'Í', true, 'I - acute'], - ['Î', 'Î', true, 'I - circumflex'], - ['Ï', 'Ï', true, 'I - diaeresis'], - ['Ð', 'Ð', true, 'ETH'], - ['Ñ', 'Ñ', true, 'N - tilde'], - ['Ò', 'Ò', true, 'O - grave'], - ['Ó', 'Ó', true, 'O - acute'], - ['Ô', 'Ô', true, 'O - circumflex'], - ['Õ', 'Õ', true, 'O - tilde'], - ['Ö', 'Ö', true, 'O - diaeresis'], - ['Ø', 'Ø', true, 'O - slash'], - ['Œ', 'Œ', true, 'ligature OE'], - ['Š', 'Š', true, 'S - caron'], - ['Ù', 'Ù', true, 'U - grave'], - ['Ú', 'Ú', true, 'U - acute'], - ['Û', 'Û', true, 'U - circumflex'], - ['Ü', 'Ü', true, 'U - diaeresis'], - ['Ý', 'Ý', true, 'Y - acute'], - ['Ÿ', 'Ÿ', true, 'Y - diaeresis'], - ['Þ', 'Þ', true, 'THORN'], - ['à', 'à', true, 'a - grave'], - ['á', 'á', true, 'a - acute'], - ['â', 'â', true, 'a - circumflex'], - ['ã', 'ã', true, 'a - tilde'], - ['ä', 'ä', true, 'a - diaeresis'], - ['å', 'å', true, 'a - ring above'], - ['æ', 'æ', true, 'ligature ae'], - ['ç', 'ç', true, 'c - cedilla'], - ['è', 'è', true, 'e - grave'], - ['é', 'é', true, 'e - acute'], - ['ê', 'ê', true, 'e - circumflex'], - ['ë', 'ë', true, 'e - diaeresis'], - ['ì', 'ì', true, 'i - grave'], - ['í', 'í', true, 'i - acute'], - ['î', 'î', true, 'i - circumflex'], - ['ï', 'ï', true, 'i - diaeresis'], - ['ð', 'ð', true, 'eth'], - ['ñ', 'ñ', true, 'n - tilde'], - ['ò', 'ò', true, 'o - grave'], - ['ó', 'ó', true, 'o - acute'], - ['ô', 'ô', true, 'o - circumflex'], - ['õ', 'õ', true, 'o - tilde'], - ['ö', 'ö', true, 'o - diaeresis'], - ['ø', 'ø', true, 'o slash'], - ['œ', 'œ', true, 'ligature oe'], - ['š', 'š', true, 's - caron'], - ['ù', 'ù', true, 'u - grave'], - ['ú', 'ú', true, 'u - acute'], - ['û', 'û', true, 'u - circumflex'], - ['ü', 'ü', true, 'u - diaeresis'], - ['ý', 'ý', true, 'y - acute'], - ['þ', 'þ', true, 'thorn'], - ['ÿ', 'ÿ', true, 'y - diaeresis'], - ['Α', 'Α', true, 'Alpha'], - ['Β', 'Β', true, 'Beta'], - ['Γ', 'Γ', true, 'Gamma'], - ['Δ', 'Δ', true, 'Delta'], - ['Ε', 'Ε', true, 'Epsilon'], - ['Ζ', 'Ζ', true, 'Zeta'], - ['Η', 'Η', true, 'Eta'], - ['Θ', 'Θ', true, 'Theta'], - ['Ι', 'Ι', true, 'Iota'], - ['Κ', 'Κ', true, 'Kappa'], - ['Λ', 'Λ', true, 'Lambda'], - ['Μ', 'Μ', true, 'Mu'], - ['Ν', 'Ν', true, 'Nu'], - ['Ξ', 'Ξ', true, 'Xi'], - ['Ο', 'Ο', true, 'Omicron'], - ['Π', 'Π', true, 'Pi'], - ['Ρ', 'Ρ', true, 'Rho'], - ['Σ', 'Σ', true, 'Sigma'], - ['Τ', 'Τ', true, 'Tau'], - ['Υ', 'Υ', true, 'Upsilon'], - ['Φ', 'Φ', true, 'Phi'], - ['Χ', 'Χ', true, 'Chi'], - ['Ψ', 'Ψ', true, 'Psi'], - ['Ω', 'Ω', true, 'Omega'], - ['α', 'α', true, 'alpha'], - ['β', 'β', true, 'beta'], - ['γ', 'γ', true, 'gamma'], - ['δ', 'δ', true, 'delta'], - ['ε', 'ε', true, 'epsilon'], - ['ζ', 'ζ', true, 'zeta'], - ['η', 'η', true, 'eta'], - ['θ', 'θ', true, 'theta'], - ['ι', 'ι', true, 'iota'], - ['κ', 'κ', true, 'kappa'], - ['λ', 'λ', true, 'lambda'], - ['μ', 'μ', true, 'mu'], - ['ν', 'ν', true, 'nu'], - ['ξ', 'ξ', true, 'xi'], - ['ο', 'ο', true, 'omicron'], - ['π', 'π', true, 'pi'], - ['ρ', 'ρ', true, 'rho'], - ['ς', 'ς', true, 'final sigma'], - ['σ', 'σ', true, 'sigma'], - ['τ', 'τ', true, 'tau'], - ['υ', 'υ', true, 'upsilon'], - ['φ', 'φ', true, 'phi'], - ['χ', 'χ', true, 'chi'], - ['ψ', 'ψ', true, 'psi'], - ['ω', 'ω', true, 'omega'], -// symbols - ['ℵ', 'ℵ', false,'alef symbol'], - ['ϖ', 'ϖ', false,'pi symbol'], - ['ℜ', 'ℜ', false,'real part symbol'], - ['ϑ','ϑ', false,'theta symbol'], - ['ϒ', 'ϒ', false,'upsilon - hook symbol'], - ['℘', '℘', false,'Weierstrass p'], - ['ℑ', 'ℑ', false,'imaginary part'], -// arrows - ['←', '←', true, 'leftwards arrow'], - ['↑', '↑', true, 'upwards arrow'], - ['→', '→', true, 'rightwards arrow'], - ['↓', '↓', true, 'downwards arrow'], - ['↔', '↔', true, 'left right arrow'], - ['↵', '↵', false,'carriage return'], - ['⇐', '⇐', false,'leftwards double arrow'], - ['⇑', '⇑', false,'upwards double arrow'], - ['⇒', '⇒', false,'rightwards double arrow'], - ['⇓', '⇓', false,'downwards double arrow'], - ['⇔', '⇔', false,'left right double arrow'], - ['∴', '∴', false,'therefore'], - ['⊂', '⊂', false,'subset of'], - ['⊃', '⊃', false,'superset of'], - ['⊄', '⊄', false,'not a subset of'], - ['⊆', '⊆', false,'subset of or equal to'], - ['⊇', '⊇', false,'superset of or equal to'], - ['⊕', '⊕', false,'circled plus'], - ['⊗', '⊗', false,'circled times'], - ['⊥', '⊥', false,'perpendicular'], - ['⋅', '⋅', false,'dot operator'], - ['⌈', '⌈', false,'left ceiling'], - ['⌉', '⌉', false,'right ceiling'], - ['⌊', '⌊', false,'left floor'], - ['⌋', '⌋', false,'right floor'], - ['⟨', '〈', false,'left-pointing angle bracket'], - ['⟩', '〉', false,'right-pointing angle bracket'], - ['◊', '◊', true,'lozenge'], - ['♠', '♠', false,'black spade suit'], - ['♣', '♣', true, 'black club suit'], - ['♥', '♥', true, 'black heart suit'], - ['♦', '♦', true, 'black diamond suit'], - [' ', ' ', false,'en space'], - [' ', ' ', false,'em space'], - [' ', ' ', false,'thin space'], - ['‌', '‌', false,'zero width non-joiner'], - ['‍', '‍', false,'zero width joiner'], - ['‎', '‎', false,'left-to-right mark'], - ['‏', '‏', false,'right-to-left mark'], - ['­', '­', false,'soft hyphen'] -]; - -tinyMCEPopup.onInit.add(function() { - tinyMCEPopup.dom.setHTML('charmapView', renderCharMapHTML()); -}); - -function renderCharMapHTML() { - var charsPerRow = 20, tdWidth=20, tdHeight=20, i; - var html = ''; - var cols=-1; - - for (i=0; i' - + '' - + charmap[i][1] - + ''; - if ((cols+1) % charsPerRow == 0) - html += ''; - } - } - - if (cols % charsPerRow > 0) { - var padd = charsPerRow - (cols % charsPerRow); - for (var i=0; i '; - } - - html += '
    '; - - return html; -} - -function insertChar(chr) { - tinyMCEPopup.execCommand('mceInsertContent', false, '&#' + chr + ';'); - - // Refocus in window - if (tinyMCEPopup.isWindow) - window.focus(); - - tinyMCEPopup.editor.focus(); - tinyMCEPopup.close(); -} - -function previewChar(codeA, codeB, codeN) { - var elmA = document.getElementById('codeA'); - var elmB = document.getElementById('codeB'); - var elmV = document.getElementById('codeV'); - var elmN = document.getElementById('codeN'); - - if (codeA=='#160;') { - elmV.innerHTML = '__'; - } else { - elmV.innerHTML = '&' + codeA; - } - - elmB.innerHTML = '&' + codeA; - elmA.innerHTML = '&' + codeB; - elmN.innerHTML = codeN; -} +tinyMCEPopup.requireLangPack(); + +var charmap = [ + [' ', ' ', true, 'no-break space'], + ['&', '&', true, 'ampersand'], + ['"', '"', true, 'quotation mark'], +// finance + ['¢', '¢', true, 'cent sign'], + ['€', '€', true, 'euro sign'], + ['£', '£', true, 'pound sign'], + ['¥', '¥', true, 'yen sign'], +// signs + ['©', '©', true, 'copyright sign'], + ['®', '®', true, 'registered sign'], + ['™', '™', true, 'trade mark sign'], + ['‰', '‰', true, 'per mille sign'], + ['µ', 'µ', true, 'micro sign'], + ['·', '·', true, 'middle dot'], + ['•', '•', true, 'bullet'], + ['…', '…', true, 'three dot leader'], + ['′', '′', true, 'minutes / feet'], + ['″', '″', true, 'seconds / inches'], + ['§', '§', true, 'section sign'], + ['¶', '¶', true, 'paragraph sign'], + ['ß', 'ß', true, 'sharp s / ess-zed'], +// quotations + ['‹', '‹', true, 'single left-pointing angle quotation mark'], + ['›', '›', true, 'single right-pointing angle quotation mark'], + ['«', '«', true, 'left pointing guillemet'], + ['»', '»', true, 'right pointing guillemet'], + ['‘', '‘', true, 'left single quotation mark'], + ['’', '’', true, 'right single quotation mark'], + ['“', '“', true, 'left double quotation mark'], + ['”', '”', true, 'right double quotation mark'], + ['‚', '‚', true, 'single low-9 quotation mark'], + ['„', '„', true, 'double low-9 quotation mark'], + ['<', '<', true, 'less-than sign'], + ['>', '>', true, 'greater-than sign'], + ['≤', '≤', true, 'less-than or equal to'], + ['≥', '≥', true, 'greater-than or equal to'], + ['–', '–', true, 'en dash'], + ['—', '—', true, 'em dash'], + ['¯', '¯', true, 'macron'], + ['‾', '‾', true, 'overline'], + ['¤', '¤', true, 'currency sign'], + ['¦', '¦', true, 'broken bar'], + ['¨', '¨', true, 'diaeresis'], + ['¡', '¡', true, 'inverted exclamation mark'], + ['¿', '¿', true, 'turned question mark'], + ['ˆ', 'ˆ', true, 'circumflex accent'], + ['˜', '˜', true, 'small tilde'], + ['°', '°', true, 'degree sign'], + ['−', '−', true, 'minus sign'], + ['±', '±', true, 'plus-minus sign'], + ['÷', '÷', true, 'division sign'], + ['⁄', '⁄', true, 'fraction slash'], + ['×', '×', true, 'multiplication sign'], + ['¹', '¹', true, 'superscript one'], + ['²', '²', true, 'superscript two'], + ['³', '³', true, 'superscript three'], + ['¼', '¼', true, 'fraction one quarter'], + ['½', '½', true, 'fraction one half'], + ['¾', '¾', true, 'fraction three quarters'], +// math / logical + ['ƒ', 'ƒ', true, 'function / florin'], + ['∫', '∫', true, 'integral'], + ['∑', '∑', true, 'n-ary sumation'], + ['∞', '∞', true, 'infinity'], + ['√', '√', true, 'square root'], + ['∼', '∼', false,'similar to'], + ['≅', '≅', false,'approximately equal to'], + ['≈', '≈', true, 'almost equal to'], + ['≠', '≠', true, 'not equal to'], + ['≡', '≡', true, 'identical to'], + ['∈', '∈', false,'element of'], + ['∉', '∉', false,'not an element of'], + ['∋', '∋', false,'contains as member'], + ['∏', '∏', true, 'n-ary product'], + ['∧', '∧', false,'logical and'], + ['∨', '∨', false,'logical or'], + ['¬', '¬', true, 'not sign'], + ['∩', '∩', true, 'intersection'], + ['∪', '∪', false,'union'], + ['∂', '∂', true, 'partial differential'], + ['∀', '∀', false,'for all'], + ['∃', '∃', false,'there exists'], + ['∅', '∅', false,'diameter'], + ['∇', '∇', false,'backward difference'], + ['∗', '∗', false,'asterisk operator'], + ['∝', '∝', false,'proportional to'], + ['∠', '∠', false,'angle'], +// undefined + ['´', '´', true, 'acute accent'], + ['¸', '¸', true, 'cedilla'], + ['ª', 'ª', true, 'feminine ordinal indicator'], + ['º', 'º', true, 'masculine ordinal indicator'], + ['†', '†', true, 'dagger'], + ['‡', '‡', true, 'double dagger'], +// alphabetical special chars + ['À', 'À', true, 'A - grave'], + ['Á', 'Á', true, 'A - acute'], + ['Â', 'Â', true, 'A - circumflex'], + ['Ã', 'Ã', true, 'A - tilde'], + ['Ä', 'Ä', true, 'A - diaeresis'], + ['Å', 'Å', true, 'A - ring above'], + ['Æ', 'Æ', true, 'ligature AE'], + ['Ç', 'Ç', true, 'C - cedilla'], + ['È', 'È', true, 'E - grave'], + ['É', 'É', true, 'E - acute'], + ['Ê', 'Ê', true, 'E - circumflex'], + ['Ë', 'Ë', true, 'E - diaeresis'], + ['Ì', 'Ì', true, 'I - grave'], + ['Í', 'Í', true, 'I - acute'], + ['Î', 'Î', true, 'I - circumflex'], + ['Ï', 'Ï', true, 'I - diaeresis'], + ['Ð', 'Ð', true, 'ETH'], + ['Ñ', 'Ñ', true, 'N - tilde'], + ['Ò', 'Ò', true, 'O - grave'], + ['Ó', 'Ó', true, 'O - acute'], + ['Ô', 'Ô', true, 'O - circumflex'], + ['Õ', 'Õ', true, 'O - tilde'], + ['Ö', 'Ö', true, 'O - diaeresis'], + ['Ø', 'Ø', true, 'O - slash'], + ['Œ', 'Œ', true, 'ligature OE'], + ['Š', 'Š', true, 'S - caron'], + ['Ù', 'Ù', true, 'U - grave'], + ['Ú', 'Ú', true, 'U - acute'], + ['Û', 'Û', true, 'U - circumflex'], + ['Ü', 'Ü', true, 'U - diaeresis'], + ['Ý', 'Ý', true, 'Y - acute'], + ['Ÿ', 'Ÿ', true, 'Y - diaeresis'], + ['Þ', 'Þ', true, 'THORN'], + ['à', 'à', true, 'a - grave'], + ['á', 'á', true, 'a - acute'], + ['â', 'â', true, 'a - circumflex'], + ['ã', 'ã', true, 'a - tilde'], + ['ä', 'ä', true, 'a - diaeresis'], + ['å', 'å', true, 'a - ring above'], + ['æ', 'æ', true, 'ligature ae'], + ['ç', 'ç', true, 'c - cedilla'], + ['è', 'è', true, 'e - grave'], + ['é', 'é', true, 'e - acute'], + ['ê', 'ê', true, 'e - circumflex'], + ['ë', 'ë', true, 'e - diaeresis'], + ['ì', 'ì', true, 'i - grave'], + ['í', 'í', true, 'i - acute'], + ['î', 'î', true, 'i - circumflex'], + ['ï', 'ï', true, 'i - diaeresis'], + ['ð', 'ð', true, 'eth'], + ['ñ', 'ñ', true, 'n - tilde'], + ['ò', 'ò', true, 'o - grave'], + ['ó', 'ó', true, 'o - acute'], + ['ô', 'ô', true, 'o - circumflex'], + ['õ', 'õ', true, 'o - tilde'], + ['ö', 'ö', true, 'o - diaeresis'], + ['ø', 'ø', true, 'o slash'], + ['œ', 'œ', true, 'ligature oe'], + ['š', 'š', true, 's - caron'], + ['ù', 'ù', true, 'u - grave'], + ['ú', 'ú', true, 'u - acute'], + ['û', 'û', true, 'u - circumflex'], + ['ü', 'ü', true, 'u - diaeresis'], + ['ý', 'ý', true, 'y - acute'], + ['þ', 'þ', true, 'thorn'], + ['ÿ', 'ÿ', true, 'y - diaeresis'], + ['Α', 'Α', true, 'Alpha'], + ['Β', 'Β', true, 'Beta'], + ['Γ', 'Γ', true, 'Gamma'], + ['Δ', 'Δ', true, 'Delta'], + ['Ε', 'Ε', true, 'Epsilon'], + ['Ζ', 'Ζ', true, 'Zeta'], + ['Η', 'Η', true, 'Eta'], + ['Θ', 'Θ', true, 'Theta'], + ['Ι', 'Ι', true, 'Iota'], + ['Κ', 'Κ', true, 'Kappa'], + ['Λ', 'Λ', true, 'Lambda'], + ['Μ', 'Μ', true, 'Mu'], + ['Ν', 'Ν', true, 'Nu'], + ['Ξ', 'Ξ', true, 'Xi'], + ['Ο', 'Ο', true, 'Omicron'], + ['Π', 'Π', true, 'Pi'], + ['Ρ', 'Ρ', true, 'Rho'], + ['Σ', 'Σ', true, 'Sigma'], + ['Τ', 'Τ', true, 'Tau'], + ['Υ', 'Υ', true, 'Upsilon'], + ['Φ', 'Φ', true, 'Phi'], + ['Χ', 'Χ', true, 'Chi'], + ['Ψ', 'Ψ', true, 'Psi'], + ['Ω', 'Ω', true, 'Omega'], + ['α', 'α', true, 'alpha'], + ['β', 'β', true, 'beta'], + ['γ', 'γ', true, 'gamma'], + ['δ', 'δ', true, 'delta'], + ['ε', 'ε', true, 'epsilon'], + ['ζ', 'ζ', true, 'zeta'], + ['η', 'η', true, 'eta'], + ['θ', 'θ', true, 'theta'], + ['ι', 'ι', true, 'iota'], + ['κ', 'κ', true, 'kappa'], + ['λ', 'λ', true, 'lambda'], + ['μ', 'μ', true, 'mu'], + ['ν', 'ν', true, 'nu'], + ['ξ', 'ξ', true, 'xi'], + ['ο', 'ο', true, 'omicron'], + ['π', 'π', true, 'pi'], + ['ρ', 'ρ', true, 'rho'], + ['ς', 'ς', true, 'final sigma'], + ['σ', 'σ', true, 'sigma'], + ['τ', 'τ', true, 'tau'], + ['υ', 'υ', true, 'upsilon'], + ['φ', 'φ', true, 'phi'], + ['χ', 'χ', true, 'chi'], + ['ψ', 'ψ', true, 'psi'], + ['ω', 'ω', true, 'omega'], +// symbols + ['ℵ', 'ℵ', false,'alef symbol'], + ['ϖ', 'ϖ', false,'pi symbol'], + ['ℜ', 'ℜ', false,'real part symbol'], + ['ϑ','ϑ', false,'theta symbol'], + ['ϒ', 'ϒ', false,'upsilon - hook symbol'], + ['℘', '℘', false,'Weierstrass p'], + ['ℑ', 'ℑ', false,'imaginary part'], +// arrows + ['←', '←', true, 'leftwards arrow'], + ['↑', '↑', true, 'upwards arrow'], + ['→', '→', true, 'rightwards arrow'], + ['↓', '↓', true, 'downwards arrow'], + ['↔', '↔', true, 'left right arrow'], + ['↵', '↵', false,'carriage return'], + ['⇐', '⇐', false,'leftwards double arrow'], + ['⇑', '⇑', false,'upwards double arrow'], + ['⇒', '⇒', false,'rightwards double arrow'], + ['⇓', '⇓', false,'downwards double arrow'], + ['⇔', '⇔', false,'left right double arrow'], + ['∴', '∴', false,'therefore'], + ['⊂', '⊂', false,'subset of'], + ['⊃', '⊃', false,'superset of'], + ['⊄', '⊄', false,'not a subset of'], + ['⊆', '⊆', false,'subset of or equal to'], + ['⊇', '⊇', false,'superset of or equal to'], + ['⊕', '⊕', false,'circled plus'], + ['⊗', '⊗', false,'circled times'], + ['⊥', '⊥', false,'perpendicular'], + ['⋅', '⋅', false,'dot operator'], + ['⌈', '⌈', false,'left ceiling'], + ['⌉', '⌉', false,'right ceiling'], + ['⌊', '⌊', false,'left floor'], + ['⌋', '⌋', false,'right floor'], + ['⟨', '〈', false,'left-pointing angle bracket'], + ['⟩', '〉', false,'right-pointing angle bracket'], + ['◊', '◊', true,'lozenge'], + ['♠', '♠', false,'black spade suit'], + ['♣', '♣', true, 'black club suit'], + ['♥', '♥', true, 'black heart suit'], + ['♦', '♦', true, 'black diamond suit'], + [' ', ' ', false,'en space'], + [' ', ' ', false,'em space'], + [' ', ' ', false,'thin space'], + ['‌', '‌', false,'zero width non-joiner'], + ['‍', '‍', false,'zero width joiner'], + ['‎', '‎', false,'left-to-right mark'], + ['‏', '‏', false,'right-to-left mark'], + ['­', '­', false,'soft hyphen'] +]; + +tinyMCEPopup.onInit.add(function() { + tinyMCEPopup.dom.setHTML('charmapView', renderCharMapHTML()); +}); + +function renderCharMapHTML() { + var charsPerRow = 20, tdWidth=20, tdHeight=20, i; + var html = ''; + var cols=-1; + + for (i=0; i' + + '' + + charmap[i][1] + + ''; + if ((cols+1) % charsPerRow == 0) + html += ''; + } + } + + if (cols % charsPerRow > 0) { + var padd = charsPerRow - (cols % charsPerRow); + for (var i=0; i '; + } + + html += '
    '; + + return html; +} + +function insertChar(chr) { + tinyMCEPopup.execCommand('mceInsertContent', false, '&#' + chr + ';'); + + // Refocus in window + if (tinyMCEPopup.isWindow) + window.focus(); + + tinyMCEPopup.editor.focus(); + tinyMCEPopup.close(); +} + +function previewChar(codeA, codeB, codeN) { + var elmA = document.getElementById('codeA'); + var elmB = document.getElementById('codeB'); + var elmV = document.getElementById('codeV'); + var elmN = document.getElementById('codeN'); + + if (codeA=='#160;') { + elmV.innerHTML = '__'; + } else { + elmV.innerHTML = '&' + codeA; + } + + elmB.innerHTML = '&' + codeA; + elmA.innerHTML = '&' + codeB; + elmN.innerHTML = codeN; +} diff --git a/lib/editor/tinymce/themes/advanced/js/color_picker.js b/lib/editor/tinymce/themes/advanced/js/color_picker.js index fd9700f2224..c1a65db2c47 100644 --- a/lib/editor/tinymce/themes/advanced/js/color_picker.js +++ b/lib/editor/tinymce/themes/advanced/js/color_picker.js @@ -1,253 +1,253 @@ -tinyMCEPopup.requireLangPack(); - -var detail = 50, strhex = "0123456789abcdef", i, isMouseDown = false, isMouseOver = false; - -var colors = [ - "#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033", - "#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099", - "#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff", - "#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033", - "#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399", - "#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff", - "#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333", - "#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399", - "#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff", - "#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633", - "#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699", - "#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff", - "#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633", - "#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999", - "#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff", - "#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933", - "#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999", - "#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff", - "#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33", - "#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99", - "#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff", - "#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33", - "#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99", - "#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff", - "#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33", - "#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99", - "#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff" -]; - -var named = { - '#F0F8FF':'AliceBlue','#FAEBD7':'AntiqueWhite','#00FFFF':'Aqua','#7FFFD4':'Aquamarine','#F0FFFF':'Azure','#F5F5DC':'Beige', - '#FFE4C4':'Bisque','#000000':'Black','#FFEBCD':'BlanchedAlmond','#0000FF':'Blue','#8A2BE2':'BlueViolet','#A52A2A':'Brown', - '#DEB887':'BurlyWood','#5F9EA0':'CadetBlue','#7FFF00':'Chartreuse','#D2691E':'Chocolate','#FF7F50':'Coral','#6495ED':'CornflowerBlue', - '#FFF8DC':'Cornsilk','#DC143C':'Crimson','#00FFFF':'Cyan','#00008B':'DarkBlue','#008B8B':'DarkCyan','#B8860B':'DarkGoldenRod', - '#A9A9A9':'DarkGray','#A9A9A9':'DarkGrey','#006400':'DarkGreen','#BDB76B':'DarkKhaki','#8B008B':'DarkMagenta','#556B2F':'DarkOliveGreen', - '#FF8C00':'Darkorange','#9932CC':'DarkOrchid','#8B0000':'DarkRed','#E9967A':'DarkSalmon','#8FBC8F':'DarkSeaGreen','#483D8B':'DarkSlateBlue', - '#2F4F4F':'DarkSlateGray','#2F4F4F':'DarkSlateGrey','#00CED1':'DarkTurquoise','#9400D3':'DarkViolet','#FF1493':'DeepPink','#00BFFF':'DeepSkyBlue', - '#696969':'DimGray','#696969':'DimGrey','#1E90FF':'DodgerBlue','#B22222':'FireBrick','#FFFAF0':'FloralWhite','#228B22':'ForestGreen', - '#FF00FF':'Fuchsia','#DCDCDC':'Gainsboro','#F8F8FF':'GhostWhite','#FFD700':'Gold','#DAA520':'GoldenRod','#808080':'Gray','#808080':'Grey', - '#008000':'Green','#ADFF2F':'GreenYellow','#F0FFF0':'HoneyDew','#FF69B4':'HotPink','#CD5C5C':'IndianRed','#4B0082':'Indigo','#FFFFF0':'Ivory', - '#F0E68C':'Khaki','#E6E6FA':'Lavender','#FFF0F5':'LavenderBlush','#7CFC00':'LawnGreen','#FFFACD':'LemonChiffon','#ADD8E6':'LightBlue', - '#F08080':'LightCoral','#E0FFFF':'LightCyan','#FAFAD2':'LightGoldenRodYellow','#D3D3D3':'LightGray','#D3D3D3':'LightGrey','#90EE90':'LightGreen', - '#FFB6C1':'LightPink','#FFA07A':'LightSalmon','#20B2AA':'LightSeaGreen','#87CEFA':'LightSkyBlue','#778899':'LightSlateGray','#778899':'LightSlateGrey', - '#B0C4DE':'LightSteelBlue','#FFFFE0':'LightYellow','#00FF00':'Lime','#32CD32':'LimeGreen','#FAF0E6':'Linen','#FF00FF':'Magenta','#800000':'Maroon', - '#66CDAA':'MediumAquaMarine','#0000CD':'MediumBlue','#BA55D3':'MediumOrchid','#9370D8':'MediumPurple','#3CB371':'MediumSeaGreen','#7B68EE':'MediumSlateBlue', - '#00FA9A':'MediumSpringGreen','#48D1CC':'MediumTurquoise','#C71585':'MediumVioletRed','#191970':'MidnightBlue','#F5FFFA':'MintCream','#FFE4E1':'MistyRose','#FFE4B5':'Moccasin', - '#FFDEAD':'NavajoWhite','#000080':'Navy','#FDF5E6':'OldLace','#808000':'Olive','#6B8E23':'OliveDrab','#FFA500':'Orange','#FF4500':'OrangeRed','#DA70D6':'Orchid', - '#EEE8AA':'PaleGoldenRod','#98FB98':'PaleGreen','#AFEEEE':'PaleTurquoise','#D87093':'PaleVioletRed','#FFEFD5':'PapayaWhip','#FFDAB9':'PeachPuff', - '#CD853F':'Peru','#FFC0CB':'Pink','#DDA0DD':'Plum','#B0E0E6':'PowderBlue','#800080':'Purple','#FF0000':'Red','#BC8F8F':'RosyBrown','#4169E1':'RoyalBlue', - '#8B4513':'SaddleBrown','#FA8072':'Salmon','#F4A460':'SandyBrown','#2E8B57':'SeaGreen','#FFF5EE':'SeaShell','#A0522D':'Sienna','#C0C0C0':'Silver', - '#87CEEB':'SkyBlue','#6A5ACD':'SlateBlue','#708090':'SlateGray','#708090':'SlateGrey','#FFFAFA':'Snow','#00FF7F':'SpringGreen', - '#4682B4':'SteelBlue','#D2B48C':'Tan','#008080':'Teal','#D8BFD8':'Thistle','#FF6347':'Tomato','#40E0D0':'Turquoise','#EE82EE':'Violet', - '#F5DEB3':'Wheat','#FFFFFF':'White','#F5F5F5':'WhiteSmoke','#FFFF00':'Yellow','#9ACD32':'YellowGreen' -}; - -function init() { - var inputColor = convertRGBToHex(tinyMCEPopup.getWindowArg('input_color')); - - tinyMCEPopup.resizeToInnerSize(); - - generatePicker(); - - if (inputColor) { - changeFinalColor(inputColor); - - col = convertHexToRGB(inputColor); - - if (col) - updateLight(col.r, col.g, col.b); - } -} - -function insertAction() { - var color = document.getElementById("color").value, f = tinyMCEPopup.getWindowArg('func'); - - tinyMCEPopup.restoreSelection(); - - if (f) - f(color); - - tinyMCEPopup.close(); -} - -function showColor(color, name) { - if (name) - document.getElementById("colorname").innerHTML = name; - - document.getElementById("preview").style.backgroundColor = color; - document.getElementById("color").value = color.toLowerCase(); -} - -function convertRGBToHex(col) { - var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi"); - - if (!col) - return col; - - var rgb = col.replace(re, "$1,$2,$3").split(','); - if (rgb.length == 3) { - r = parseInt(rgb[0]).toString(16); - g = parseInt(rgb[1]).toString(16); - b = parseInt(rgb[2]).toString(16); - - r = r.length == 1 ? '0' + r : r; - g = g.length == 1 ? '0' + g : g; - b = b.length == 1 ? '0' + b : b; - - return "#" + r + g + b; - } - - return col; -} - -function convertHexToRGB(col) { - if (col.indexOf('#') != -1) { - col = col.replace(new RegExp('[^0-9A-F]', 'gi'), ''); - - r = parseInt(col.substring(0, 2), 16); - g = parseInt(col.substring(2, 4), 16); - b = parseInt(col.substring(4, 6), 16); - - return {r : r, g : g, b : b}; - } - - return null; -} - -function generatePicker() { - var el = document.getElementById('light'), h = '', i; - - for (i = 0; i < detail; i++){ - h += '
    '; - } - - el.innerHTML = h; -} - -function generateWebColors() { - var el = document.getElementById('webcolors'), h = '', i; - - if (el.className == 'generated') - return; - - h += '' - + ''; - - for (i=0; i' - + '' - + ''; - if ((i+1) % 18 == 0) - h += ''; - } - - h += '
    '; - - el.innerHTML = h; - el.className = 'generated'; -} - -function generateNamedColors() { - var el = document.getElementById('namedcolors'), h = '', n, v, i = 0; - - if (el.className == 'generated') - return; - - for (n in named) { - v = named[n]; - h += '' - } - - el.innerHTML = h; - el.className = 'generated'; -} - -function dechex(n) { - return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16); -} - -function computeColor(e) { - var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB; - - x = e.offsetX ? e.offsetX : (e.target ? e.clientX - e.target.x : 0); - y = e.offsetY ? e.offsetY : (e.target ? e.clientY - e.target.y : 0); - - partWidth = document.getElementById('colors').width / 6; - partDetail = detail / 2; - imHeight = document.getElementById('colors').height; - - r = (x >= 0)*(x < partWidth)*255 + (x >= partWidth)*(x < 2*partWidth)*(2*255 - x * 255 / partWidth) + (x >= 4*partWidth)*(x < 5*partWidth)*(-4*255 + x * 255 / partWidth) + (x >= 5*partWidth)*(x < 6*partWidth)*255; - g = (x >= 0)*(x < partWidth)*(x * 255 / partWidth) + (x >= partWidth)*(x < 3*partWidth)*255 + (x >= 3*partWidth)*(x < 4*partWidth)*(4*255 - x * 255 / partWidth); - b = (x >= 2*partWidth)*(x < 3*partWidth)*(-2*255 + x * 255 / partWidth) + (x >= 3*partWidth)*(x < 5*partWidth)*255 + (x >= 5*partWidth)*(x < 6*partWidth)*(6*255 - x * 255 / partWidth); - - coef = (imHeight - y) / imHeight; - r = 128 + (r - 128) * coef; - g = 128 + (g - 128) * coef; - b = 128 + (b - 128) * coef; - - changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b)); - updateLight(r, g, b); -} - -function updateLight(r, g, b) { - var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color; - - for (i=0; i=0) && (i'; + } + + el.innerHTML = h; +} + +function generateWebColors() { + var el = document.getElementById('webcolors'), h = '', i; + + if (el.className == 'generated') + return; + + h += '' + + ''; + + for (i=0; i' + + '' + + ''; + if ((i+1) % 18 == 0) + h += ''; + } + + h += '
    '; + + el.innerHTML = h; + el.className = 'generated'; +} + +function generateNamedColors() { + var el = document.getElementById('namedcolors'), h = '', n, v, i = 0; + + if (el.className == 'generated') + return; + + for (n in named) { + v = named[n]; + h += '' + } + + el.innerHTML = h; + el.className = 'generated'; +} + +function dechex(n) { + return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16); +} + +function computeColor(e) { + var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB; + + x = e.offsetX ? e.offsetX : (e.target ? e.clientX - e.target.x : 0); + y = e.offsetY ? e.offsetY : (e.target ? e.clientY - e.target.y : 0); + + partWidth = document.getElementById('colors').width / 6; + partDetail = detail / 2; + imHeight = document.getElementById('colors').height; + + r = (x >= 0)*(x < partWidth)*255 + (x >= partWidth)*(x < 2*partWidth)*(2*255 - x * 255 / partWidth) + (x >= 4*partWidth)*(x < 5*partWidth)*(-4*255 + x * 255 / partWidth) + (x >= 5*partWidth)*(x < 6*partWidth)*255; + g = (x >= 0)*(x < partWidth)*(x * 255 / partWidth) + (x >= partWidth)*(x < 3*partWidth)*255 + (x >= 3*partWidth)*(x < 4*partWidth)*(4*255 - x * 255 / partWidth); + b = (x >= 2*partWidth)*(x < 3*partWidth)*(-2*255 + x * 255 / partWidth) + (x >= 3*partWidth)*(x < 5*partWidth)*255 + (x >= 5*partWidth)*(x < 6*partWidth)*(6*255 - x * 255 / partWidth); + + coef = (imHeight - y) / imHeight; + r = 128 + (r - 128) * coef; + g = 128 + (g - 128) * coef; + b = 128 + (b - 128) * coef; + + changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b)); + updateLight(r, g, b); +} + +function updateLight(r, g, b) { + var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color; + + for (i=0; i=0) && (i'); - }, - - init : function() { - var f = document.forms[0], ed = tinyMCEPopup.editor; - - // Setup browse button - document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image'); - if (isVisible('srcbrowser')) - document.getElementById('src').style.width = '180px'; - - e = ed.selection.getNode(); - - this.fillFileList('image_list', 'tinyMCEImageList'); - - if (e.nodeName == 'IMG') { - f.src.value = ed.dom.getAttrib(e, 'src'); - f.alt.value = ed.dom.getAttrib(e, 'alt'); - f.border.value = this.getAttrib(e, 'border'); - f.vspace.value = this.getAttrib(e, 'vspace'); - f.hspace.value = this.getAttrib(e, 'hspace'); - f.width.value = ed.dom.getAttrib(e, 'width'); - f.height.value = ed.dom.getAttrib(e, 'height'); - f.insert.value = ed.getLang('update'); - this.styleVal = ed.dom.getAttrib(e, 'style'); - selectByValue(f, 'image_list', f.src.value); - selectByValue(f, 'align', this.getAttrib(e, 'align')); - this.updateStyle(); - } - }, - - fillFileList : function(id, l) { - var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; - - l = window[l]; - - if (l && l.length > 0) { - lst.options[lst.options.length] = new Option('', ''); - - tinymce.each(l, function(o) { - lst.options[lst.options.length] = new Option(o[0], o[1]); - }); - } else - dom.remove(dom.getParent(id, 'tr')); - }, - - update : function() { - var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, args = {}, el; - - tinyMCEPopup.restoreSelection(); - - if (f.src.value === '') { - if (ed.selection.getNode().nodeName == 'IMG') { - ed.dom.remove(ed.selection.getNode()); - ed.execCommand('mceRepaint'); - } - - tinyMCEPopup.close(); - return; - } - - if (!ed.settings.inline_styles) { - args = tinymce.extend(args, { - vspace : nl.vspace.value, - hspace : nl.hspace.value, - border : nl.border.value, - align : getSelectValue(f, 'align') - }); - } else - args.style = this.styleVal; - - tinymce.extend(args, { - src : f.src.value, - alt : f.alt.value, - width : f.width.value, - height : f.height.value - }); - - el = ed.selection.getNode(); - - if (el && el.nodeName == 'IMG') { - ed.dom.setAttribs(el, args); - } else { - ed.execCommand('mceInsertContent', false, '', {skip_undo : 1}); - ed.dom.setAttribs('__mce_tmp', args); - ed.dom.setAttrib('__mce_tmp', 'id', ''); - ed.undoManager.add(); - } - - tinyMCEPopup.close(); - }, - - updateStyle : function() { - var dom = tinyMCEPopup.dom, st, v, f = document.forms[0]; - - if (tinyMCEPopup.editor.settings.inline_styles) { - st = tinyMCEPopup.dom.parseStyle(this.styleVal); - - // Handle align - v = getSelectValue(f, 'align'); - if (v) { - if (v == 'left' || v == 'right') { - st['float'] = v; - delete st['vertical-align']; - } else { - st['vertical-align'] = v; - delete st['float']; - } - } else { - delete st['float']; - delete st['vertical-align']; - } - - // Handle border - v = f.border.value; - if (v || v == '0') { - if (v == '0') - st['border'] = '0'; - else - st['border'] = v + 'px solid black'; - } else - delete st['border']; - - // Handle hspace - v = f.hspace.value; - if (v) { - delete st['margin']; - st['margin-left'] = v + 'px'; - st['margin-right'] = v + 'px'; - } else { - delete st['margin-left']; - delete st['margin-right']; - } - - // Handle vspace - v = f.vspace.value; - if (v) { - delete st['margin']; - st['margin-top'] = v + 'px'; - st['margin-bottom'] = v + 'px'; - } else { - delete st['margin-top']; - delete st['margin-bottom']; - } - - // Merge - st = tinyMCEPopup.dom.parseStyle(dom.serializeStyle(st)); - this.styleVal = dom.serializeStyle(st); - } - }, - - getAttrib : function(e, at) { - var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2; - - if (ed.settings.inline_styles) { - switch (at) { - case 'align': - if (v = dom.getStyle(e, 'float')) - return v; - - if (v = dom.getStyle(e, 'vertical-align')) - return v; - - break; - - case 'hspace': - v = dom.getStyle(e, 'margin-left') - v2 = dom.getStyle(e, 'margin-right'); - if (v && v == v2) - return parseInt(v.replace(/[^0-9]/g, '')); - - break; - - case 'vspace': - v = dom.getStyle(e, 'margin-top') - v2 = dom.getStyle(e, 'margin-bottom'); - if (v && v == v2) - return parseInt(v.replace(/[^0-9]/g, '')); - - break; - - case 'border': - v = 0; - - tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) { - sv = dom.getStyle(e, 'border-' + sv + '-width'); - - // False or not the same as prev - if (!sv || (sv != v && v !== 0)) { - v = 0; - return false; - } - - if (sv) - v = sv; - }); - - if (v) - return parseInt(v.replace(/[^0-9]/g, '')); - - break; - } - } - - if (v = dom.getAttrib(e, at)) - return v; - - return ''; - }, - - resetImageData : function() { - var f = document.forms[0]; - - f.width.value = f.height.value = ""; - }, - - updateImageData : function() { - var f = document.forms[0], t = ImageDialog; - - if (f.width.value == "") - f.width.value = t.preloadImg.width; - - if (f.height.value == "") - f.height.value = t.preloadImg.height; - }, - - getImageData : function() { - var f = document.forms[0]; - - this.preloadImg = new Image(); - this.preloadImg.onload = this.updateImageData; - this.preloadImg.onerror = this.resetImageData; - this.preloadImg.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(f.src.value); - } -}; - -ImageDialog.preInit(); -tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog); +var ImageDialog = { + preInit : function() { + var url; + + tinyMCEPopup.requireLangPack(); + + if (url = tinyMCEPopup.getParam("external_image_list_url")) + document.write(''); + }, + + init : function() { + var f = document.forms[0], ed = tinyMCEPopup.editor; + + // Setup browse button + document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image'); + if (isVisible('srcbrowser')) + document.getElementById('src').style.width = '180px'; + + e = ed.selection.getNode(); + + this.fillFileList('image_list', 'tinyMCEImageList'); + + if (e.nodeName == 'IMG') { + f.src.value = ed.dom.getAttrib(e, 'src'); + f.alt.value = ed.dom.getAttrib(e, 'alt'); + f.border.value = this.getAttrib(e, 'border'); + f.vspace.value = this.getAttrib(e, 'vspace'); + f.hspace.value = this.getAttrib(e, 'hspace'); + f.width.value = ed.dom.getAttrib(e, 'width'); + f.height.value = ed.dom.getAttrib(e, 'height'); + f.insert.value = ed.getLang('update'); + this.styleVal = ed.dom.getAttrib(e, 'style'); + selectByValue(f, 'image_list', f.src.value); + selectByValue(f, 'align', this.getAttrib(e, 'align')); + this.updateStyle(); + } + }, + + fillFileList : function(id, l) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + l = window[l]; + + if (l && l.length > 0) { + lst.options[lst.options.length] = new Option('', ''); + + tinymce.each(l, function(o) { + lst.options[lst.options.length] = new Option(o[0], o[1]); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + update : function() { + var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, args = {}, el; + + tinyMCEPopup.restoreSelection(); + + if (f.src.value === '') { + if (ed.selection.getNode().nodeName == 'IMG') { + ed.dom.remove(ed.selection.getNode()); + ed.execCommand('mceRepaint'); + } + + tinyMCEPopup.close(); + return; + } + + if (!ed.settings.inline_styles) { + args = tinymce.extend(args, { + vspace : nl.vspace.value, + hspace : nl.hspace.value, + border : nl.border.value, + align : getSelectValue(f, 'align') + }); + } else + args.style = this.styleVal; + + tinymce.extend(args, { + src : f.src.value, + alt : f.alt.value, + width : f.width.value, + height : f.height.value + }); + + el = ed.selection.getNode(); + + if (el && el.nodeName == 'IMG') { + ed.dom.setAttribs(el, args); + } else { + ed.execCommand('mceInsertContent', false, '', {skip_undo : 1}); + ed.dom.setAttribs('__mce_tmp', args); + ed.dom.setAttrib('__mce_tmp', 'id', ''); + ed.undoManager.add(); + } + + tinyMCEPopup.close(); + }, + + updateStyle : function() { + var dom = tinyMCEPopup.dom, st, v, f = document.forms[0]; + + if (tinyMCEPopup.editor.settings.inline_styles) { + st = tinyMCEPopup.dom.parseStyle(this.styleVal); + + // Handle align + v = getSelectValue(f, 'align'); + if (v) { + if (v == 'left' || v == 'right') { + st['float'] = v; + delete st['vertical-align']; + } else { + st['vertical-align'] = v; + delete st['float']; + } + } else { + delete st['float']; + delete st['vertical-align']; + } + + // Handle border + v = f.border.value; + if (v || v == '0') { + if (v == '0') + st['border'] = '0'; + else + st['border'] = v + 'px solid black'; + } else + delete st['border']; + + // Handle hspace + v = f.hspace.value; + if (v) { + delete st['margin']; + st['margin-left'] = v + 'px'; + st['margin-right'] = v + 'px'; + } else { + delete st['margin-left']; + delete st['margin-right']; + } + + // Handle vspace + v = f.vspace.value; + if (v) { + delete st['margin']; + st['margin-top'] = v + 'px'; + st['margin-bottom'] = v + 'px'; + } else { + delete st['margin-top']; + delete st['margin-bottom']; + } + + // Merge + st = tinyMCEPopup.dom.parseStyle(dom.serializeStyle(st)); + this.styleVal = dom.serializeStyle(st); + } + }, + + getAttrib : function(e, at) { + var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2; + + if (ed.settings.inline_styles) { + switch (at) { + case 'align': + if (v = dom.getStyle(e, 'float')) + return v; + + if (v = dom.getStyle(e, 'vertical-align')) + return v; + + break; + + case 'hspace': + v = dom.getStyle(e, 'margin-left') + v2 = dom.getStyle(e, 'margin-right'); + if (v && v == v2) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + + case 'vspace': + v = dom.getStyle(e, 'margin-top') + v2 = dom.getStyle(e, 'margin-bottom'); + if (v && v == v2) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + + case 'border': + v = 0; + + tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) { + sv = dom.getStyle(e, 'border-' + sv + '-width'); + + // False or not the same as prev + if (!sv || (sv != v && v !== 0)) { + v = 0; + return false; + } + + if (sv) + v = sv; + }); + + if (v) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + } + } + + if (v = dom.getAttrib(e, at)) + return v; + + return ''; + }, + + resetImageData : function() { + var f = document.forms[0]; + + f.width.value = f.height.value = ""; + }, + + updateImageData : function() { + var f = document.forms[0], t = ImageDialog; + + if (f.width.value == "") + f.width.value = t.preloadImg.width; + + if (f.height.value == "") + f.height.value = t.preloadImg.height; + }, + + getImageData : function() { + var f = document.forms[0]; + + this.preloadImg = new Image(); + this.preloadImg.onload = this.updateImageData; + this.preloadImg.onerror = this.resetImageData; + this.preloadImg.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(f.src.value); + } +}; + +ImageDialog.preInit(); +tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog); diff --git a/lib/editor/tinymce/themes/advanced/js/link.js b/lib/editor/tinymce/themes/advanced/js/link.js index 21aae6cbf88..f46137c5939 100644 --- a/lib/editor/tinymce/themes/advanced/js/link.js +++ b/lib/editor/tinymce/themes/advanced/js/link.js @@ -1,156 +1,156 @@ -tinyMCEPopup.requireLangPack(); - -var LinkDialog = { - preInit : function() { - var url; - - if (url = tinyMCEPopup.getParam("external_link_list_url")) - document.write(''); - }, - - init : function() { - var f = document.forms[0], ed = tinyMCEPopup.editor; - - // Setup browse button - document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser', 'href', 'file', 'theme_advanced_link'); - if (isVisible('hrefbrowser')) - document.getElementById('href').style.width = '180px'; - - this.fillClassList('class_list'); - this.fillFileList('link_list', 'tinyMCELinkList'); - this.fillTargetList('target_list'); - - if (e = ed.dom.getParent(ed.selection.getNode(), 'A')) { - f.href.value = ed.dom.getAttrib(e, 'href'); - f.linktitle.value = ed.dom.getAttrib(e, 'title'); - f.insert.value = ed.getLang('update'); - selectByValue(f, 'link_list', f.href.value); - selectByValue(f, 'target_list', ed.dom.getAttrib(e, 'target')); - selectByValue(f, 'class_list', ed.dom.getAttrib(e, 'class')); - } - }, - - update : function() { - var f = document.forms[0], ed = tinyMCEPopup.editor, e, b; - - tinyMCEPopup.restoreSelection(); - e = ed.dom.getParent(ed.selection.getNode(), 'A'); - - // Remove element if there is no href - if (!f.href.value) { - if (e) { - tinyMCEPopup.execCommand("mceBeginUndoLevel"); - b = ed.selection.getBookmark(); - ed.dom.remove(e, 1); - ed.selection.moveToBookmark(b); - tinyMCEPopup.execCommand("mceEndUndoLevel"); - tinyMCEPopup.close(); - return; - } - } - - tinyMCEPopup.execCommand("mceBeginUndoLevel"); - - // Create new anchor elements - if (e == null) { - ed.getDoc().execCommand("unlink", false, null); - tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1}); - - tinymce.each(ed.dom.select("a"), function(n) { - if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') { - e = n; - - ed.dom.setAttribs(e, { - href : f.href.value, - title : f.linktitle.value, - target : f.target_list ? f.target_list.options[f.target_list.selectedIndex].value : null, - 'class' : f.class_list ? f.class_list.options[f.class_list.selectedIndex].value : null - }); - } - }); - } else { - ed.dom.setAttribs(e, { - href : f.href.value, - title : f.linktitle.value, - target : f.target_list ? f.target_list.options[f.target_list.selectedIndex].value : null, - 'class' : f.class_list ? f.class_list.options[f.class_list.selectedIndex].value : null - }); - } - - // Don't move caret if selection was image - if (e.childNodes.length != 1 || e.firstChild.nodeName != 'IMG') { - ed.focus(); - ed.selection.select(e); - ed.selection.collapse(0); - tinyMCEPopup.storeSelection(); - } - - tinyMCEPopup.execCommand("mceEndUndoLevel"); - tinyMCEPopup.close(); - }, - - checkPrefix : function(n) { - if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_email'))) - n.value = 'mailto:' + n.value; - - if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_external'))) - n.value = 'http://' + n.value; - }, - - fillFileList : function(id, l) { - var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; - - l = window[l]; - - if (l && l.length > 0) { - lst.options[lst.options.length] = new Option('', ''); - - tinymce.each(l, function(o) { - lst.options[lst.options.length] = new Option(o[0], o[1]); - }); - } else - dom.remove(dom.getParent(id, 'tr')); - }, - - fillClassList : function(id) { - var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; - - if (v = tinyMCEPopup.getParam('theme_advanced_styles')) { - cl = []; - - tinymce.each(v.split(';'), function(v) { - var p = v.split('='); - - cl.push({'title' : p[0], 'class' : p[1]}); - }); - } else - cl = tinyMCEPopup.editor.dom.getClasses(); - - if (cl.length > 0) { - lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); - - tinymce.each(cl, function(o) { - lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']); - }); - } else - dom.remove(dom.getParent(id, 'tr')); - }, - - fillTargetList : function(id) { - var dom = tinyMCEPopup.dom, lst = dom.get(id), v; - - lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); - lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_same'), '_self'); - lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_blank'), '_blank'); - - if (v = tinyMCEPopup.getParam('theme_advanced_link_targets')) { - tinymce.each(v.split(','), function(v) { - v = v.split('='); - lst.options[lst.options.length] = new Option(v[0], v[1]); - }); - } - } -}; - -LinkDialog.preInit(); -tinyMCEPopup.onInit.add(LinkDialog.init, LinkDialog); +tinyMCEPopup.requireLangPack(); + +var LinkDialog = { + preInit : function() { + var url; + + if (url = tinyMCEPopup.getParam("external_link_list_url")) + document.write(''); + }, + + init : function() { + var f = document.forms[0], ed = tinyMCEPopup.editor; + + // Setup browse button + document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser', 'href', 'file', 'theme_advanced_link'); + if (isVisible('hrefbrowser')) + document.getElementById('href').style.width = '180px'; + + this.fillClassList('class_list'); + this.fillFileList('link_list', 'tinyMCELinkList'); + this.fillTargetList('target_list'); + + if (e = ed.dom.getParent(ed.selection.getNode(), 'A')) { + f.href.value = ed.dom.getAttrib(e, 'href'); + f.linktitle.value = ed.dom.getAttrib(e, 'title'); + f.insert.value = ed.getLang('update'); + selectByValue(f, 'link_list', f.href.value); + selectByValue(f, 'target_list', ed.dom.getAttrib(e, 'target')); + selectByValue(f, 'class_list', ed.dom.getAttrib(e, 'class')); + } + }, + + update : function() { + var f = document.forms[0], ed = tinyMCEPopup.editor, e, b; + + tinyMCEPopup.restoreSelection(); + e = ed.dom.getParent(ed.selection.getNode(), 'A'); + + // Remove element if there is no href + if (!f.href.value) { + if (e) { + tinyMCEPopup.execCommand("mceBeginUndoLevel"); + b = ed.selection.getBookmark(); + ed.dom.remove(e, 1); + ed.selection.moveToBookmark(b); + tinyMCEPopup.execCommand("mceEndUndoLevel"); + tinyMCEPopup.close(); + return; + } + } + + tinyMCEPopup.execCommand("mceBeginUndoLevel"); + + // Create new anchor elements + if (e == null) { + ed.getDoc().execCommand("unlink", false, null); + tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1}); + + tinymce.each(ed.dom.select("a"), function(n) { + if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') { + e = n; + + ed.dom.setAttribs(e, { + href : f.href.value, + title : f.linktitle.value, + target : f.target_list ? f.target_list.options[f.target_list.selectedIndex].value : null, + 'class' : f.class_list ? f.class_list.options[f.class_list.selectedIndex].value : null + }); + } + }); + } else { + ed.dom.setAttribs(e, { + href : f.href.value, + title : f.linktitle.value, + target : f.target_list ? f.target_list.options[f.target_list.selectedIndex].value : null, + 'class' : f.class_list ? f.class_list.options[f.class_list.selectedIndex].value : null + }); + } + + // Don't move caret if selection was image + if (e.childNodes.length != 1 || e.firstChild.nodeName != 'IMG') { + ed.focus(); + ed.selection.select(e); + ed.selection.collapse(0); + tinyMCEPopup.storeSelection(); + } + + tinyMCEPopup.execCommand("mceEndUndoLevel"); + tinyMCEPopup.close(); + }, + + checkPrefix : function(n) { + if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_email'))) + n.value = 'mailto:' + n.value; + + if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_external'))) + n.value = 'http://' + n.value; + }, + + fillFileList : function(id, l) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + l = window[l]; + + if (l && l.length > 0) { + lst.options[lst.options.length] = new Option('', ''); + + tinymce.each(l, function(o) { + lst.options[lst.options.length] = new Option(o[0], o[1]); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + fillClassList : function(id) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + if (v = tinyMCEPopup.getParam('theme_advanced_styles')) { + cl = []; + + tinymce.each(v.split(';'), function(v) { + var p = v.split('='); + + cl.push({'title' : p[0], 'class' : p[1]}); + }); + } else + cl = tinyMCEPopup.editor.dom.getClasses(); + + if (cl.length > 0) { + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); + + tinymce.each(cl, function(o) { + lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + fillTargetList : function(id) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v; + + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_same'), '_self'); + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_blank'), '_blank'); + + if (v = tinyMCEPopup.getParam('theme_advanced_link_targets')) { + tinymce.each(v.split(','), function(v) { + v = v.split('='); + lst.options[lst.options.length] = new Option(v[0], v[1]); + }); + } + } +}; + +LinkDialog.preInit(); +tinyMCEPopup.onInit.add(LinkDialog.init, LinkDialog); diff --git a/lib/editor/tinymce/themes/advanced/js/source_editor.js b/lib/editor/tinymce/themes/advanced/js/source_editor.js index 279328614c5..81063ecbcde 100644 --- a/lib/editor/tinymce/themes/advanced/js/source_editor.js +++ b/lib/editor/tinymce/themes/advanced/js/source_editor.js @@ -1,62 +1,62 @@ -tinyMCEPopup.requireLangPack(); -tinyMCEPopup.onInit.add(onLoadInit); - -function saveContent() { - tinyMCEPopup.editor.setContent(document.getElementById('htmlSource').value, {source_view : true}); - tinyMCEPopup.close(); -} - -function onLoadInit() { - tinyMCEPopup.resizeToInnerSize(); - - // Remove Gecko spellchecking - if (tinymce.isGecko) - document.body.spellcheck = tinyMCEPopup.editor.getParam("gecko_spellcheck"); - - document.getElementById('htmlSource').value = tinyMCEPopup.editor.getContent({source_view : true}); - - if (tinyMCEPopup.editor.getParam("theme_advanced_source_editor_wrap", true)) { - setWrap('soft'); - document.getElementById('wraped').checked = true; - } - - resizeInputs(); -} - -function setWrap(val) { - var v, n, s = document.getElementById('htmlSource'); - - s.wrap = val; - - if (!tinymce.isIE) { - v = s.value; - n = s.cloneNode(false); - n.setAttribute("wrap", val); - s.parentNode.replaceChild(n, s); - n.value = v; - } -} - -function toggleWordWrap(elm) { - if (elm.checked) - setWrap('soft'); - else - setWrap('off'); -} - -var wHeight=0, wWidth=0, owHeight=0, owWidth=0; - -function resizeInputs() { - var el = document.getElementById('htmlSource'); - - if (!tinymce.isIE) { - wHeight = self.innerHeight - 65; - wWidth = self.innerWidth - 16; - } else { - wHeight = document.body.clientHeight - 70; - wWidth = document.body.clientWidth - 16; - } - - el.style.height = Math.abs(wHeight) + 'px'; - el.style.width = Math.abs(wWidth) + 'px'; -} +tinyMCEPopup.requireLangPack(); +tinyMCEPopup.onInit.add(onLoadInit); + +function saveContent() { + tinyMCEPopup.editor.setContent(document.getElementById('htmlSource').value, {source_view : true}); + tinyMCEPopup.close(); +} + +function onLoadInit() { + tinyMCEPopup.resizeToInnerSize(); + + // Remove Gecko spellchecking + if (tinymce.isGecko) + document.body.spellcheck = tinyMCEPopup.editor.getParam("gecko_spellcheck"); + + document.getElementById('htmlSource').value = tinyMCEPopup.editor.getContent({source_view : true}); + + if (tinyMCEPopup.editor.getParam("theme_advanced_source_editor_wrap", true)) { + setWrap('soft'); + document.getElementById('wraped').checked = true; + } + + resizeInputs(); +} + +function setWrap(val) { + var v, n, s = document.getElementById('htmlSource'); + + s.wrap = val; + + if (!tinymce.isIE) { + v = s.value; + n = s.cloneNode(false); + n.setAttribute("wrap", val); + s.parentNode.replaceChild(n, s); + n.value = v; + } +} + +function toggleWordWrap(elm) { + if (elm.checked) + setWrap('soft'); + else + setWrap('off'); +} + +var wHeight=0, wWidth=0, owHeight=0, owWidth=0; + +function resizeInputs() { + var el = document.getElementById('htmlSource'); + + if (!tinymce.isIE) { + wHeight = self.innerHeight - 65; + wWidth = self.innerWidth - 16; + } else { + wHeight = document.body.clientHeight - 70; + wWidth = document.body.clientWidth - 16; + } + + el.style.height = Math.abs(wHeight) + 'px'; + el.style.width = Math.abs(wWidth) + 'px'; +} diff --git a/lib/editor/tinymce/themes/advanced/langs/en.js b/lib/editor/tinymce/themes/advanced/langs/en.js index 69694b1f9f8..52989e39363 100644 --- a/lib/editor/tinymce/themes/advanced/langs/en.js +++ b/lib/editor/tinymce/themes/advanced/langs/en.js @@ -1,62 +1,62 @@ -tinyMCE.addI18n('en.advanced',{ -style_select:"Styles", -font_size:"Font size", -fontdefault:"Font family", -block:"Format", -paragraph:"Paragraph", -div:"Div", -address:"Address", -pre:"Preformatted", -h1:"Heading 1", -h2:"Heading 2", -h3:"Heading 3", -h4:"Heading 4", -h5:"Heading 5", -h6:"Heading 6", -blockquote:"Blockquote", -code:"Code", -samp:"Code sample", -dt:"Definition term ", -dd:"Definition description", -bold_desc:"Bold (Ctrl+B)", -italic_desc:"Italic (Ctrl+I)", -underline_desc:"Underline (Ctrl+U)", -striketrough_desc:"Strikethrough", -justifyleft_desc:"Align left", -justifycenter_desc:"Align center", -justifyright_desc:"Align right", -justifyfull_desc:"Align full", -bullist_desc:"Unordered list", -numlist_desc:"Ordered list", -outdent_desc:"Outdent", -indent_desc:"Indent", -undo_desc:"Undo (Ctrl+Z)", -redo_desc:"Redo (Ctrl+Y)", -link_desc:"Insert/edit link", -unlink_desc:"Unlink", -image_desc:"Insert/edit image", -cleanup_desc:"Cleanup messy code", -code_desc:"Edit HTML Source", -sub_desc:"Subscript", -sup_desc:"Superscript", -hr_desc:"Insert horizontal ruler", -removeformat_desc:"Remove formatting", -custom1_desc:"Your custom description here", -forecolor_desc:"Select text color", -backcolor_desc:"Select background color", -charmap_desc:"Insert custom character", -visualaid_desc:"Toggle guidelines/invisible elements", -anchor_desc:"Insert/edit anchor", -cut_desc:"Cut", -copy_desc:"Copy", -paste_desc:"Paste", -image_props_desc:"Image properties", -newdocument_desc:"New document", -help_desc:"Help", -blockquote_desc:"Blockquote", -clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\r\nDo you want more information about this issue?", -path:"Path", -newdocument:"Are you sure you want clear all contents?", -toolbar_focus:"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X", -more_colors:"More colors" +tinyMCE.addI18n('en.advanced',{ +style_select:"Styles", +font_size:"Font size", +fontdefault:"Font family", +block:"Format", +paragraph:"Paragraph", +div:"Div", +address:"Address", +pre:"Preformatted", +h1:"Heading 1", +h2:"Heading 2", +h3:"Heading 3", +h4:"Heading 4", +h5:"Heading 5", +h6:"Heading 6", +blockquote:"Blockquote", +code:"Code", +samp:"Code sample", +dt:"Definition term ", +dd:"Definition description", +bold_desc:"Bold (Ctrl+B)", +italic_desc:"Italic (Ctrl+I)", +underline_desc:"Underline (Ctrl+U)", +striketrough_desc:"Strikethrough", +justifyleft_desc:"Align left", +justifycenter_desc:"Align center", +justifyright_desc:"Align right", +justifyfull_desc:"Align full", +bullist_desc:"Unordered list", +numlist_desc:"Ordered list", +outdent_desc:"Outdent", +indent_desc:"Indent", +undo_desc:"Undo (Ctrl+Z)", +redo_desc:"Redo (Ctrl+Y)", +link_desc:"Insert/edit link", +unlink_desc:"Unlink", +image_desc:"Insert/edit image", +cleanup_desc:"Cleanup messy code", +code_desc:"Edit HTML Source", +sub_desc:"Subscript", +sup_desc:"Superscript", +hr_desc:"Insert horizontal ruler", +removeformat_desc:"Remove formatting", +custom1_desc:"Your custom description here", +forecolor_desc:"Select text color", +backcolor_desc:"Select background color", +charmap_desc:"Insert custom character", +visualaid_desc:"Toggle guidelines/invisible elements", +anchor_desc:"Insert/edit anchor", +cut_desc:"Cut", +copy_desc:"Copy", +paste_desc:"Paste", +image_props_desc:"Image properties", +newdocument_desc:"New document", +help_desc:"Help", +blockquote_desc:"Blockquote", +clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\r\nDo you want more information about this issue?", +path:"Path", +newdocument:"Are you sure you want clear all contents?", +toolbar_focus:"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X", +more_colors:"More colors" }); \ No newline at end of file diff --git a/lib/editor/tinymce/themes/advanced/langs/en_dlg.js b/lib/editor/tinymce/themes/advanced/langs/en_dlg.js index 9d124d7db69..80e49419c63 100644 --- a/lib/editor/tinymce/themes/advanced/langs/en_dlg.js +++ b/lib/editor/tinymce/themes/advanced/langs/en_dlg.js @@ -1,51 +1,51 @@ -tinyMCE.addI18n('en.advanced_dlg',{ -about_title:"About TinyMCE", -about_general:"About", -about_help:"Help", -about_license:"License", -about_plugins:"Plugins", -about_plugin:"Plugin", -about_author:"Author", -about_version:"Version", -about_loaded:"Loaded plugins", -anchor_title:"Insert/edit anchor", -anchor_name:"Anchor name", -code_title:"HTML Source Editor", -code_wordwrap:"Word wrap", -colorpicker_title:"Select a color", -colorpicker_picker_tab:"Picker", -colorpicker_picker_title:"Color picker", -colorpicker_palette_tab:"Palette", -colorpicker_palette_title:"Palette colors", -colorpicker_named_tab:"Named", -colorpicker_named_title:"Named colors", -colorpicker_color:"Color:", -colorpicker_name:"Name:", -charmap_title:"Select custom character", -image_title:"Insert/edit image", -image_src:"Image URL", -image_alt:"Image description", -image_list:"Image list", -image_border:"Border", -image_dimensions:"Dimensions", -image_vspace:"Vertical space", -image_hspace:"Horizontal space", -image_align:"Alignment", -image_align_baseline:"Baseline", -image_align_top:"Top", -image_align_middle:"Middle", -image_align_bottom:"Bottom", -image_align_texttop:"Text top", -image_align_textbottom:"Text bottom", -image_align_left:"Left", -image_align_right:"Right", -link_title:"Insert/edit link", -link_url:"Link URL", -link_target:"Target", -link_target_same:"Open link in the same window", -link_target_blank:"Open link in a new window", -link_titlefield:"Title", -link_is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?", -link_is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?", -link_list:"Link list" +tinyMCE.addI18n('en.advanced_dlg',{ +about_title:"About TinyMCE", +about_general:"About", +about_help:"Help", +about_license:"License", +about_plugins:"Plugins", +about_plugin:"Plugin", +about_author:"Author", +about_version:"Version", +about_loaded:"Loaded plugins", +anchor_title:"Insert/edit anchor", +anchor_name:"Anchor name", +code_title:"HTML Source Editor", +code_wordwrap:"Word wrap", +colorpicker_title:"Select a color", +colorpicker_picker_tab:"Picker", +colorpicker_picker_title:"Color picker", +colorpicker_palette_tab:"Palette", +colorpicker_palette_title:"Palette colors", +colorpicker_named_tab:"Named", +colorpicker_named_title:"Named colors", +colorpicker_color:"Color:", +colorpicker_name:"Name:", +charmap_title:"Select custom character", +image_title:"Insert/edit image", +image_src:"Image URL", +image_alt:"Image description", +image_list:"Image list", +image_border:"Border", +image_dimensions:"Dimensions", +image_vspace:"Vertical space", +image_hspace:"Horizontal space", +image_align:"Alignment", +image_align_baseline:"Baseline", +image_align_top:"Top", +image_align_middle:"Middle", +image_align_bottom:"Bottom", +image_align_texttop:"Text top", +image_align_textbottom:"Text bottom", +image_align_left:"Left", +image_align_right:"Right", +link_title:"Insert/edit link", +link_url:"Link URL", +link_target:"Target", +link_target_same:"Open link in the same window", +link_target_blank:"Open link in a new window", +link_titlefield:"Title", +link_is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?", +link_is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?", +link_list:"Link list" }); \ No newline at end of file diff --git a/lib/editor/tinymce/themes/advanced/link.htm b/lib/editor/tinymce/themes/advanced/link.htm index a78bd334d5e..3c5e79d4aa2 100644 --- a/lib/editor/tinymce/themes/advanced/link.htm +++ b/lib/editor/tinymce/themes/advanced/link.htm @@ -1,63 +1,63 @@ - - - - {#advanced_dlg.link_title} - - - - - - - -
    - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - -
    - - - - -
     
    -
    -
    - -
    -
    - -
    - -
    - -
    -
    -
    - - + + + + {#advanced_dlg.link_title} + + + + + + + +
    + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + + + +
     
    +
    +
    + +
    +
    + +
    + +
    + +
    +
    +
    + + diff --git a/lib/editor/tinymce/themes/advanced/skins/default/content.css b/lib/editor/tinymce/themes/advanced/skins/default/content.css index 19da1943bc0..cb7604e7916 100644 --- a/lib/editor/tinymce/themes/advanced/skins/default/content.css +++ b/lib/editor/tinymce/themes/advanced/skins/default/content.css @@ -1,32 +1,32 @@ -body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} -body {background:#FFF;} -body.mceForceColors {background:#FFF; color:#000;} -h1 {font-size: 2em} -h2 {font-size: 1.5em} -h3 {font-size: 1.17em} -h4 {font-size: 1em} -h5 {font-size: .83em} -h6 {font-size: .75em} -.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} -a.mceItemAnchor {width:12px; line-height:6px; overflow:hidden; padding-left:12px; background:url(img/items.gif) no-repeat bottom left;} -img.mceItemAnchor {width:12px; height:12px; background:url(img/items.gif) no-repeat;} -img {border:0;} -table {cursor:default} -table td, table th {cursor:text} -ins {border-bottom:1px solid green; text-decoration: none; color:green} -del {color:red; text-decoration:line-through} -cite {border-bottom:1px dashed blue} -acronym {border-bottom:1px dotted #CCC; cursor:help} -abbr, html\:abbr {border-bottom:1px dashed #CCC; cursor:help} - -/* IE */ -* html body { -scrollbar-3dlight-color:#F0F0EE; -scrollbar-arrow-color:#676662; -scrollbar-base-color:#F0F0EE; -scrollbar-darkshadow-color:#DDD; -scrollbar-face-color:#E0E0DD; -scrollbar-highlight-color:#F0F0EE; -scrollbar-shadow-color:#F0F0EE; -scrollbar-track-color:#F5F5F5; -} +body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} +body {background:#FFF;} +body.mceForceColors {background:#FFF; color:#000;} +h1 {font-size: 2em} +h2 {font-size: 1.5em} +h3 {font-size: 1.17em} +h4 {font-size: 1em} +h5 {font-size: .83em} +h6 {font-size: .75em} +.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} +a.mceItemAnchor {width:12px; line-height:6px; overflow:hidden; padding-left:12px; background:url(img/items.gif) no-repeat bottom left;} +img.mceItemAnchor {width:12px; height:12px; background:url(img/items.gif) no-repeat;} +img {border:0;} +table {cursor:default} +table td, table th {cursor:text} +ins {border-bottom:1px solid green; text-decoration: none; color:green} +del {color:red; text-decoration:line-through} +cite {border-bottom:1px dashed blue} +acronym {border-bottom:1px dotted #CCC; cursor:help} +abbr, html\:abbr {border-bottom:1px dashed #CCC; cursor:help} + +/* IE */ +* html body { +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +} diff --git a/lib/editor/tinymce/themes/advanced/skins/default/dialog.css b/lib/editor/tinymce/themes/advanced/skins/default/dialog.css index 873c67e3c44..fa2df254140 100644 --- a/lib/editor/tinymce/themes/advanced/skins/default/dialog.css +++ b/lib/editor/tinymce/themes/advanced/skins/default/dialog.css @@ -1,116 +1,116 @@ -/* Generic */ -body { -font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; -scrollbar-3dlight-color:#F0F0EE; -scrollbar-arrow-color:#676662; -scrollbar-base-color:#F0F0EE; -scrollbar-darkshadow-color:#DDDDDD; -scrollbar-face-color:#E0E0DD; -scrollbar-highlight-color:#F0F0EE; -scrollbar-shadow-color:#F0F0EE; -scrollbar-track-color:#F5F5F5; -background:#F0F0EE; -padding:0; -margin:8px 8px 0 8px; -} - -html {background:#F0F0EE;} -td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} -textarea {resize:none;outline:none;} -a:link, a:visited {color:black;} -a:hover {color:#2B6FB6;} -.nowrap {white-space: nowrap} - -/* Forms */ -fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} -legend {color:#2B6FB6; font-weight:bold;} -label.msg {display:none;} -label.invalid {color:#EE0000; display:inline;} -input.invalid {border:1px solid #EE0000;} -input {background:#FFF; border:1px solid #CCC;} -input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} -input, select, textarea {border:1px solid #808080;} -input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} -input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} -.input_noborder {border:0;} - -/* Buttons */ -#insert, #cancel, input.button, .updateButton { -border:0; margin:0; padding:0; -font-weight:bold; -width:94px; height:26px; -background:url(img/buttons.png) 0 -26px; -cursor:pointer; -padding-bottom:2px; -} - -#insert {background:url(img/buttons.png) 0 -52px;} -#cancel {background:url(img/buttons.png) 0 0;} - -/* Browse */ -a.pickcolor, a.browse {text-decoration:none} -a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} -.mceOldBoxModel a.browse span {width:22px; height:20px;} -a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} -a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} -a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} -a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} -.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} -a.pickcolor:hover span {background-color:#B2BBD0;} -a.pickcolor:hover span.disabled {} - -/* Charmap */ -table.charmap {border:1px solid #AAA; text-align:center} -td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} -#charmap a {display:block; color:#000; text-decoration:none; border:0} -#charmap a:hover {background:#CCC;color:#2B6FB6} -#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} -#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} - -/* Source */ -.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} -.mceActionPanel {margin-top:5px;} - -/* Tabs classes */ -.tabs {width:100%; height:18px; line-height:normal; background:url(img/tabs.gif) repeat-x 0 -72px;} -.tabs ul {margin:0; padding:0; list-style:none;} -.tabs li {float:left; background:url(img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;} -.tabs li.current {background:url(img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} -.tabs span {float:left; display:block; background:url(img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} -.tabs .current span {background:url(img/tabs.gif) no-repeat right -54px;} -.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} -.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} - -/* Panels */ -.panel_wrapper div.panel {display:none;} -.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} -.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} - -/* Columns */ -.column {float:left;} -.properties {width:100%;} -.properties .column1 {} -.properties .column2 {text-align:left;} - -/* Titles */ -h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} -h3 {font-size:14px;} -.title {font-size:12px; font-weight:bold; color:#2B6FB6;} - -/* Dialog specific */ -#link .panel_wrapper, #link div.current {height:125px;} -#image .panel_wrapper, #image div.current {height:200px;} -#plugintable thead {font-weight:bold; background:#DDD;} -#plugintable, #about #plugintable td {border:1px solid #919B9C;} -#plugintable {width:96%; margin-top:10px;} -#pluginscontainer {height:290px; overflow:auto;} -#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;} -#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} -#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} -#colorpicker #light div {overflow:hidden;} -#colorpicker #previewblock {float:right; padding-left:10px; height:20px;} -#colorpicker .panel_wrapper div.current {height:175px;} -#colorpicker #namedcolors {width:150px;} -#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} -#colorpicker #colornamecontainer {margin-top:5px;} +/* Generic */ +body { +font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDDDDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +background:#F0F0EE; +padding:0; +margin:8px 8px 0 8px; +} + +html {background:#F0F0EE;} +td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +textarea {resize:none;outline:none;} +a:link, a:visited {color:black;} +a:hover {color:#2B6FB6;} +.nowrap {white-space: nowrap} + +/* Forms */ +fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} +legend {color:#2B6FB6; font-weight:bold;} +label.msg {display:none;} +label.invalid {color:#EE0000; display:inline;} +input.invalid {border:1px solid #EE0000;} +input {background:#FFF; border:1px solid #CCC;} +input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +input, select, textarea {border:1px solid #808080;} +input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} +input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} +.input_noborder {border:0;} + +/* Buttons */ +#insert, #cancel, input.button, .updateButton { +border:0; margin:0; padding:0; +font-weight:bold; +width:94px; height:26px; +background:url(img/buttons.png) 0 -26px; +cursor:pointer; +padding-bottom:2px; +} + +#insert {background:url(img/buttons.png) 0 -52px;} +#cancel {background:url(img/buttons.png) 0 0;} + +/* Browse */ +a.pickcolor, a.browse {text-decoration:none} +a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} +.mceOldBoxModel a.browse span {width:22px; height:20px;} +a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} +a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} +a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} +.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} +a.pickcolor:hover span {background-color:#B2BBD0;} +a.pickcolor:hover span.disabled {} + +/* Charmap */ +table.charmap {border:1px solid #AAA; text-align:center} +td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} +#charmap a {display:block; color:#000; text-decoration:none; border:0} +#charmap a:hover {background:#CCC;color:#2B6FB6} +#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} +#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} + +/* Source */ +.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} +.mceActionPanel {margin-top:5px;} + +/* Tabs classes */ +.tabs {width:100%; height:18px; line-height:normal; background:url(img/tabs.gif) repeat-x 0 -72px;} +.tabs ul {margin:0; padding:0; list-style:none;} +.tabs li {float:left; background:url(img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;} +.tabs li.current {background:url(img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} +.tabs span {float:left; display:block; background:url(img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} +.tabs .current span {background:url(img/tabs.gif) no-repeat right -54px;} +.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} +.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} + +/* Panels */ +.panel_wrapper div.panel {display:none;} +.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} +.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} + +/* Columns */ +.column {float:left;} +.properties {width:100%;} +.properties .column1 {} +.properties .column2 {text-align:left;} + +/* Titles */ +h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} +h3 {font-size:14px;} +.title {font-size:12px; font-weight:bold; color:#2B6FB6;} + +/* Dialog specific */ +#link .panel_wrapper, #link div.current {height:125px;} +#image .panel_wrapper, #image div.current {height:200px;} +#plugintable thead {font-weight:bold; background:#DDD;} +#plugintable, #about #plugintable td {border:1px solid #919B9C;} +#plugintable {width:96%; margin-top:10px;} +#pluginscontainer {height:290px; overflow:auto;} +#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;} +#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} +#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} +#colorpicker #light div {overflow:hidden;} +#colorpicker #previewblock {float:right; padding-left:10px; height:20px;} +#colorpicker .panel_wrapper div.current {height:175px;} +#colorpicker #namedcolors {width:150px;} +#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} +#colorpicker #colornamecontainer {margin-top:5px;} #colorpicker #picker_panel fieldset {margin:auto;width:325px;} \ No newline at end of file diff --git a/lib/editor/tinymce/themes/advanced/skins/default/ui.css b/lib/editor/tinymce/themes/advanced/skins/default/ui.css index 230a2ee288d..2c90d498cc3 100644 --- a/lib/editor/tinymce/themes/advanced/skins/default/ui.css +++ b/lib/editor/tinymce/themes/advanced/skins/default/ui.css @@ -1,214 +1,214 @@ -/* Reset */ -.defaultSkin table, .defaultSkin tbody, .defaultSkin a, .defaultSkin img, .defaultSkin tr, .defaultSkin div, .defaultSkin td, .defaultSkin iframe, .defaultSkin span, .defaultSkin *, .defaultSkin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left} -.defaultSkin a:hover, .defaultSkin a:link, .defaultSkin a:visited, .defaultSkin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} -.defaultSkin table td {vertical-align:middle} - -/* Containers */ -.defaultSkin table {background:#F0F0EE} -.defaultSkin iframe {display:block; background:#FFF} -.defaultSkin .mceToolbar {height:26px} -.defaultSkin .mceLeft {text-align:left} -.defaultSkin .mceRight {text-align:right} - -/* External */ -.defaultSkin .mceExternalToolbar {position:absolute; border:1px solid #CCC; border-bottom:0; display:none;} -.defaultSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;} -.defaultSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0} - -/* Layout */ -.defaultSkin table.mceLayout {border:0; border-left:1px solid #CCC; border-right:1px solid #CCC} -.defaultSkin table.mceLayout tr.mceFirst td {border-top:1px solid #CCC} -.defaultSkin table.mceLayout tr.mceLast td {border-bottom:1px solid #CCC} -.defaultSkin table.mceToolbar, .defaultSkin tr.mceFirst .mceToolbar tr td, .defaultSkin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0;} -.defaultSkin td.mceToolbar {padding-top:1px; vertical-align:top} -.defaultSkin .mceIframeContainer {border-top:1px solid #CCC; border-bottom:1px solid #CCC} -.defaultSkin .mceStatusbar {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; display:block; height:20px} -.defaultSkin .mceStatusbar div {float:left; margin:2px} -.defaultSkin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize} -.defaultSkin .mceStatusbar a:hover {text-decoration:underline} -.defaultSkin table.mceToolbar {margin-left:3px} -.defaultSkin span.mceIcon, .defaultSkin img.mceIcon {display:block; width:20px; height:20px} -.defaultSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} -.defaultSkin td.mceCenter {text-align:center;} -.defaultSkin td.mceCenter table {margin:0 auto; text-align:left;} -.defaultSkin td.mceRight table {margin:0 0 0 auto;} - -/* Button */ -.defaultSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px; margin-right:1px} -.defaultSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0} -.defaultSkin a.mceButtonActive, .defaultSkin a.mceButtonSelected {border:1px solid #0A246A; background-color:#C2CBE0} -.defaultSkin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} -.defaultSkin .mceButtonLabeled {width:auto} -.defaultSkin .mceButtonLabeled span.mceIcon {float:left} -.defaultSkin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica} -.defaultSkin .mceButtonDisabled .mceButtonLabel {color:#888} - -/* Separator */ -.defaultSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:2px 2px 0 4px} - -/* ListBox */ -.defaultSkin .mceListBox {direction:ltr} -.defaultSkin .mceListBox, .defaultSkin .mceListBox a {display:block} -.defaultSkin .mceListBox .mceText {padding-left:4px; width:70px; text-align:left; border:1px solid #CCC; border-right:0; background:#FFF; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden} -.defaultSkin .mceListBox .mceOpen {width:9px; height:20px; background:url(../../img/icons.gif) -741px 0; margin-right:2px; border:1px solid #CCC;} -.defaultSkin table.mceListBoxEnabled:hover .mceText, .defaultSkin .mceListBoxHover .mceText, .defaultSkin .mceListBoxSelected .mceText {border:1px solid #A2ABC0; border-right:0; background:#FFF} -.defaultSkin table.mceListBoxEnabled:hover .mceOpen, .defaultSkin .mceListBoxHover .mceOpen, .defaultSkin .mceListBoxSelected .mceOpen {background-color:#FFF; border:1px solid #A2ABC0} -.defaultSkin .mceListBoxDisabled a.mceText {color:gray; background-color:transparent;} -.defaultSkin .mceListBoxMenu {overflow:auto; overflow-x:hidden} -.defaultSkin .mceOldBoxModel .mceListBox .mceText {height:22px} -.defaultSkin .mceOldBoxModel .mceListBox .mceOpen {width:11px; height:22px;} -.defaultSkin select.mceNativeListBox {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:7pt; background:#F0F0EE; border:1px solid gray; margin-right:2px;} - -/* SplitButton */ -.defaultSkin .mceSplitButton {width:32px; height:20px; direction:ltr} -.defaultSkin .mceSplitButton a, .defaultSkin .mceSplitButton span {height:20px; display:block} -.defaultSkin .mceSplitButton a.mceAction {width:20px; border:1px solid #F0F0EE; border-right:0;} -.defaultSkin .mceSplitButton span.mceAction {width:20px; background:url(../../img/icons.gif) 20px 20px;} -.defaultSkin .mceSplitButton a.mceOpen {width:9px; background:url(../../img/icons.gif) -741px 0; border:1px solid #F0F0EE;} -.defaultSkin .mceSplitButton span.mceOpen {display:none} -.defaultSkin table.mceSplitButtonEnabled:hover a.mceAction, .defaultSkin .mceSplitButtonHover a.mceAction, .defaultSkin .mceSplitButtonSelected a.mceAction {border:1px solid #0A246A; border-right:0; background-color:#B2BBD0} -.defaultSkin table.mceSplitButtonEnabled:hover a.mceOpen, .defaultSkin .mceSplitButtonHover a.mceOpen, .defaultSkin .mceSplitButtonSelected a.mceOpen {background-color:#B2BBD0; border:1px solid #0A246A;} -.defaultSkin .mceSplitButtonDisabled .mceAction, .defaultSkin .mceSplitButtonDisabled a.mceOpen {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} -.defaultSkin .mceSplitButtonActive a.mceAction {border:1px solid #0A246A; background-color:#C2CBE0} -.defaultSkin .mceSplitButtonActive a.mceOpen {border-left:0;} - -/* ColorSplitButton */ -.defaultSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray} -.defaultSkin .mceColorSplitMenu td {padding:2px} -.defaultSkin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080} -.defaultSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} -.defaultSkin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} -.defaultSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2} -.defaultSkin a.mceMoreColors:hover {border:1px solid #0A246A} -.defaultSkin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a} -.defaultSkin .mce_forecolor span.mceAction, .defaultSkin .mce_backcolor span.mceAction {overflow:hidden; height:16px} - -/* Menu */ -.defaultSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #D4D0C8} -.defaultSkin .mceNoIcons span.mceIcon {width:0;} -.defaultSkin .mceNoIcons a .mceText {padding-left:10px} -.defaultSkin .mceMenu table {background:#FFF} -.defaultSkin .mceMenu a, .defaultSkin .mceMenu span, .defaultSkin .mceMenu {display:block} -.defaultSkin .mceMenu td {height:20px} -.defaultSkin .mceMenu a {position:relative;padding:3px 0 4px 0} -.defaultSkin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block} -.defaultSkin .mceMenu span.mceText, .defaultSkin .mceMenu .mcePreview {font-size:11px} -.defaultSkin .mceMenu pre.mceText {font-family:Monospace} -.defaultSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;} -.defaultSkin .mceMenu .mceMenuItemEnabled a:hover, .defaultSkin .mceMenu .mceMenuItemActive {background-color:#dbecf3} -.defaultSkin td.mceMenuItemSeparator {background:#DDD; height:1px} -.defaultSkin .mceMenuItemTitle a {border:0; background:#EEE; border-bottom:1px solid #DDD} -.defaultSkin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px} -.defaultSkin .mceMenuItemDisabled .mceText {color:#888} -.defaultSkin .mceMenuItemSelected .mceIcon {background:url(img/menu_check.gif)} -.defaultSkin .mceNoIcons .mceMenuItemSelected a {background:url(img/menu_arrow.gif) no-repeat -6px center} -.defaultSkin .mceMenu span.mceMenuLine {display:none} -.defaultSkin .mceMenuItemSub a {background:url(img/menu_arrow.gif) no-repeat top right;} - -/* Progress,Resize */ -.defaultSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50); background:#FFF} -.defaultSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} -.defaultSkin .mcePlaceHolder {border:1px dotted gray} - -/* Formats */ -.defaultSkin .mce_formatPreview a {font-size:10px} -.defaultSkin .mce_p span.mceText {} -.defaultSkin .mce_address span.mceText {font-style:italic} -.defaultSkin .mce_pre span.mceText {font-family:monospace} -.defaultSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} -.defaultSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} -.defaultSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} -.defaultSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} -.defaultSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} -.defaultSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} - -/* Theme */ -.defaultSkin span.mce_bold {background-position:0 0} -.defaultSkin span.mce_italic {background-position:-60px 0} -.defaultSkin span.mce_underline {background-position:-140px 0} -.defaultSkin span.mce_strikethrough {background-position:-120px 0} -.defaultSkin span.mce_undo {background-position:-160px 0} -.defaultSkin span.mce_redo {background-position:-100px 0} -.defaultSkin span.mce_cleanup {background-position:-40px 0} -.defaultSkin span.mce_bullist {background-position:-20px 0} -.defaultSkin span.mce_numlist {background-position:-80px 0} -.defaultSkin span.mce_justifyleft {background-position:-460px 0} -.defaultSkin span.mce_justifyright {background-position:-480px 0} -.defaultSkin span.mce_justifycenter {background-position:-420px 0} -.defaultSkin span.mce_justifyfull {background-position:-440px 0} -.defaultSkin span.mce_anchor {background-position:-200px 0} -.defaultSkin span.mce_indent {background-position:-400px 0} -.defaultSkin span.mce_outdent {background-position:-540px 0} -.defaultSkin span.mce_link {background-position:-500px 0} -.defaultSkin span.mce_unlink {background-position:-640px 0} -.defaultSkin span.mce_sub {background-position:-600px 0} -.defaultSkin span.mce_sup {background-position:-620px 0} -.defaultSkin span.mce_removeformat {background-position:-580px 0} -.defaultSkin span.mce_newdocument {background-position:-520px 0} -.defaultSkin span.mce_image {background-position:-380px 0} -.defaultSkin span.mce_help {background-position:-340px 0} -.defaultSkin span.mce_code {background-position:-260px 0} -.defaultSkin span.mce_hr {background-position:-360px 0} -.defaultSkin span.mce_visualaid {background-position:-660px 0} -.defaultSkin span.mce_charmap {background-position:-240px 0} -.defaultSkin span.mce_paste {background-position:-560px 0} -.defaultSkin span.mce_copy {background-position:-700px 0} -.defaultSkin span.mce_cut {background-position:-680px 0} -.defaultSkin span.mce_blockquote {background-position:-220px 0} -.defaultSkin .mce_forecolor span.mceAction {background-position:-720px 0} -.defaultSkin .mce_backcolor span.mceAction {background-position:-760px 0} -.defaultSkin span.mce_forecolorpicker {background-position:-720px 0} -.defaultSkin span.mce_backcolorpicker {background-position:-760px 0} - -/* Plugins */ -.defaultSkin span.mce_advhr {background-position:-0px -20px} -.defaultSkin span.mce_ltr {background-position:-20px -20px} -.defaultSkin span.mce_rtl {background-position:-40px -20px} -.defaultSkin span.mce_emotions {background-position:-60px -20px} -.defaultSkin span.mce_fullpage {background-position:-80px -20px} -.defaultSkin span.mce_fullscreen {background-position:-100px -20px} -.defaultSkin span.mce_iespell {background-position:-120px -20px} -.defaultSkin span.mce_insertdate {background-position:-140px -20px} -.defaultSkin span.mce_inserttime {background-position:-160px -20px} -.defaultSkin span.mce_absolute {background-position:-180px -20px} -.defaultSkin span.mce_backward {background-position:-200px -20px} -.defaultSkin span.mce_forward {background-position:-220px -20px} -.defaultSkin span.mce_insert_layer {background-position:-240px -20px} -.defaultSkin span.mce_insertlayer {background-position:-260px -20px} -.defaultSkin span.mce_movebackward {background-position:-280px -20px} -.defaultSkin span.mce_moveforward {background-position:-300px -20px} -.defaultSkin span.mce_media {background-position:-320px -20px} -.defaultSkin span.mce_nonbreaking {background-position:-340px -20px} -.defaultSkin span.mce_pastetext {background-position:-360px -20px} -.defaultSkin span.mce_pasteword {background-position:-380px -20px} -.defaultSkin span.mce_selectall {background-position:-400px -20px} -.defaultSkin span.mce_preview {background-position:-420px -20px} -.defaultSkin span.mce_print {background-position:-440px -20px} -.defaultSkin span.mce_cancel {background-position:-460px -20px} -.defaultSkin span.mce_save {background-position:-480px -20px} -.defaultSkin span.mce_replace {background-position:-500px -20px} -.defaultSkin span.mce_search {background-position:-520px -20px} -.defaultSkin span.mce_styleprops {background-position:-560px -20px} -.defaultSkin span.mce_table {background-position:-580px -20px} -.defaultSkin span.mce_cell_props {background-position:-600px -20px} -.defaultSkin span.mce_delete_table {background-position:-620px -20px} -.defaultSkin span.mce_delete_col {background-position:-640px -20px} -.defaultSkin span.mce_delete_row {background-position:-660px -20px} -.defaultSkin span.mce_col_after {background-position:-680px -20px} -.defaultSkin span.mce_col_before {background-position:-700px -20px} -.defaultSkin span.mce_row_after {background-position:-720px -20px} -.defaultSkin span.mce_row_before {background-position:-740px -20px} -.defaultSkin span.mce_merge_cells {background-position:-760px -20px} -.defaultSkin span.mce_table_props {background-position:-980px -20px} -.defaultSkin span.mce_row_props {background-position:-780px -20px} -.defaultSkin span.mce_split_cells {background-position:-800px -20px} -.defaultSkin span.mce_template {background-position:-820px -20px} -.defaultSkin span.mce_visualchars {background-position:-840px -20px} -.defaultSkin span.mce_abbr {background-position:-860px -20px} -.defaultSkin span.mce_acronym {background-position:-880px -20px} -.defaultSkin span.mce_attribs {background-position:-900px -20px} -.defaultSkin span.mce_cite {background-position:-920px -20px} -.defaultSkin span.mce_del {background-position:-940px -20px} -.defaultSkin span.mce_ins {background-position:-960px -20px} -.defaultSkin span.mce_pagebreak {background-position:0 -40px} -.defaultSkin .mce_spellchecker span.mceAction {background-position:-540px -20px} +/* Reset */ +.defaultSkin table, .defaultSkin tbody, .defaultSkin a, .defaultSkin img, .defaultSkin tr, .defaultSkin div, .defaultSkin td, .defaultSkin iframe, .defaultSkin span, .defaultSkin *, .defaultSkin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left} +.defaultSkin a:hover, .defaultSkin a:link, .defaultSkin a:visited, .defaultSkin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} +.defaultSkin table td {vertical-align:middle} + +/* Containers */ +.defaultSkin table {background:#F0F0EE} +.defaultSkin iframe {display:block; background:#FFF} +.defaultSkin .mceToolbar {height:26px} +.defaultSkin .mceLeft {text-align:left} +.defaultSkin .mceRight {text-align:right} + +/* External */ +.defaultSkin .mceExternalToolbar {position:absolute; border:1px solid #CCC; border-bottom:0; display:none;} +.defaultSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;} +.defaultSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0} + +/* Layout */ +.defaultSkin table.mceLayout {border:0; border-left:1px solid #CCC; border-right:1px solid #CCC} +.defaultSkin table.mceLayout tr.mceFirst td {border-top:1px solid #CCC} +.defaultSkin table.mceLayout tr.mceLast td {border-bottom:1px solid #CCC} +.defaultSkin table.mceToolbar, .defaultSkin tr.mceFirst .mceToolbar tr td, .defaultSkin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0;} +.defaultSkin td.mceToolbar {padding-top:1px; vertical-align:top} +.defaultSkin .mceIframeContainer {border-top:1px solid #CCC; border-bottom:1px solid #CCC} +.defaultSkin .mceStatusbar {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; display:block; height:20px} +.defaultSkin .mceStatusbar div {float:left; margin:2px} +.defaultSkin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize} +.defaultSkin .mceStatusbar a:hover {text-decoration:underline} +.defaultSkin table.mceToolbar {margin-left:3px} +.defaultSkin span.mceIcon, .defaultSkin img.mceIcon {display:block; width:20px; height:20px} +.defaultSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} +.defaultSkin td.mceCenter {text-align:center;} +.defaultSkin td.mceCenter table {margin:0 auto; text-align:left;} +.defaultSkin td.mceRight table {margin:0 0 0 auto;} + +/* Button */ +.defaultSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px; margin-right:1px} +.defaultSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0} +.defaultSkin a.mceButtonActive, .defaultSkin a.mceButtonSelected {border:1px solid #0A246A; background-color:#C2CBE0} +.defaultSkin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.defaultSkin .mceButtonLabeled {width:auto} +.defaultSkin .mceButtonLabeled span.mceIcon {float:left} +.defaultSkin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica} +.defaultSkin .mceButtonDisabled .mceButtonLabel {color:#888} + +/* Separator */ +.defaultSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:2px 2px 0 4px} + +/* ListBox */ +.defaultSkin .mceListBox {direction:ltr} +.defaultSkin .mceListBox, .defaultSkin .mceListBox a {display:block} +.defaultSkin .mceListBox .mceText {padding-left:4px; width:70px; text-align:left; border:1px solid #CCC; border-right:0; background:#FFF; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden} +.defaultSkin .mceListBox .mceOpen {width:9px; height:20px; background:url(../../img/icons.gif) -741px 0; margin-right:2px; border:1px solid #CCC;} +.defaultSkin table.mceListBoxEnabled:hover .mceText, .defaultSkin .mceListBoxHover .mceText, .defaultSkin .mceListBoxSelected .mceText {border:1px solid #A2ABC0; border-right:0; background:#FFF} +.defaultSkin table.mceListBoxEnabled:hover .mceOpen, .defaultSkin .mceListBoxHover .mceOpen, .defaultSkin .mceListBoxSelected .mceOpen {background-color:#FFF; border:1px solid #A2ABC0} +.defaultSkin .mceListBoxDisabled a.mceText {color:gray; background-color:transparent;} +.defaultSkin .mceListBoxMenu {overflow:auto; overflow-x:hidden} +.defaultSkin .mceOldBoxModel .mceListBox .mceText {height:22px} +.defaultSkin .mceOldBoxModel .mceListBox .mceOpen {width:11px; height:22px;} +.defaultSkin select.mceNativeListBox {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:7pt; background:#F0F0EE; border:1px solid gray; margin-right:2px;} + +/* SplitButton */ +.defaultSkin .mceSplitButton {width:32px; height:20px; direction:ltr} +.defaultSkin .mceSplitButton a, .defaultSkin .mceSplitButton span {height:20px; display:block} +.defaultSkin .mceSplitButton a.mceAction {width:20px; border:1px solid #F0F0EE; border-right:0;} +.defaultSkin .mceSplitButton span.mceAction {width:20px; background:url(../../img/icons.gif) 20px 20px;} +.defaultSkin .mceSplitButton a.mceOpen {width:9px; background:url(../../img/icons.gif) -741px 0; border:1px solid #F0F0EE;} +.defaultSkin .mceSplitButton span.mceOpen {display:none} +.defaultSkin table.mceSplitButtonEnabled:hover a.mceAction, .defaultSkin .mceSplitButtonHover a.mceAction, .defaultSkin .mceSplitButtonSelected a.mceAction {border:1px solid #0A246A; border-right:0; background-color:#B2BBD0} +.defaultSkin table.mceSplitButtonEnabled:hover a.mceOpen, .defaultSkin .mceSplitButtonHover a.mceOpen, .defaultSkin .mceSplitButtonSelected a.mceOpen {background-color:#B2BBD0; border:1px solid #0A246A;} +.defaultSkin .mceSplitButtonDisabled .mceAction, .defaultSkin .mceSplitButtonDisabled a.mceOpen {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.defaultSkin .mceSplitButtonActive a.mceAction {border:1px solid #0A246A; background-color:#C2CBE0} +.defaultSkin .mceSplitButtonActive a.mceOpen {border-left:0;} + +/* ColorSplitButton */ +.defaultSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray} +.defaultSkin .mceColorSplitMenu td {padding:2px} +.defaultSkin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080} +.defaultSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} +.defaultSkin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} +.defaultSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2} +.defaultSkin a.mceMoreColors:hover {border:1px solid #0A246A} +.defaultSkin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a} +.defaultSkin .mce_forecolor span.mceAction, .defaultSkin .mce_backcolor span.mceAction {overflow:hidden; height:16px} + +/* Menu */ +.defaultSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #D4D0C8} +.defaultSkin .mceNoIcons span.mceIcon {width:0;} +.defaultSkin .mceNoIcons a .mceText {padding-left:10px} +.defaultSkin .mceMenu table {background:#FFF} +.defaultSkin .mceMenu a, .defaultSkin .mceMenu span, .defaultSkin .mceMenu {display:block} +.defaultSkin .mceMenu td {height:20px} +.defaultSkin .mceMenu a {position:relative;padding:3px 0 4px 0} +.defaultSkin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block} +.defaultSkin .mceMenu span.mceText, .defaultSkin .mceMenu .mcePreview {font-size:11px} +.defaultSkin .mceMenu pre.mceText {font-family:Monospace} +.defaultSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;} +.defaultSkin .mceMenu .mceMenuItemEnabled a:hover, .defaultSkin .mceMenu .mceMenuItemActive {background-color:#dbecf3} +.defaultSkin td.mceMenuItemSeparator {background:#DDD; height:1px} +.defaultSkin .mceMenuItemTitle a {border:0; background:#EEE; border-bottom:1px solid #DDD} +.defaultSkin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px} +.defaultSkin .mceMenuItemDisabled .mceText {color:#888} +.defaultSkin .mceMenuItemSelected .mceIcon {background:url(img/menu_check.gif)} +.defaultSkin .mceNoIcons .mceMenuItemSelected a {background:url(img/menu_arrow.gif) no-repeat -6px center} +.defaultSkin .mceMenu span.mceMenuLine {display:none} +.defaultSkin .mceMenuItemSub a {background:url(img/menu_arrow.gif) no-repeat top right;} + +/* Progress,Resize */ +.defaultSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50); background:#FFF} +.defaultSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} +.defaultSkin .mcePlaceHolder {border:1px dotted gray} + +/* Formats */ +.defaultSkin .mce_formatPreview a {font-size:10px} +.defaultSkin .mce_p span.mceText {} +.defaultSkin .mce_address span.mceText {font-style:italic} +.defaultSkin .mce_pre span.mceText {font-family:monospace} +.defaultSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} +.defaultSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} +.defaultSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} +.defaultSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} +.defaultSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} +.defaultSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} + +/* Theme */ +.defaultSkin span.mce_bold {background-position:0 0} +.defaultSkin span.mce_italic {background-position:-60px 0} +.defaultSkin span.mce_underline {background-position:-140px 0} +.defaultSkin span.mce_strikethrough {background-position:-120px 0} +.defaultSkin span.mce_undo {background-position:-160px 0} +.defaultSkin span.mce_redo {background-position:-100px 0} +.defaultSkin span.mce_cleanup {background-position:-40px 0} +.defaultSkin span.mce_bullist {background-position:-20px 0} +.defaultSkin span.mce_numlist {background-position:-80px 0} +.defaultSkin span.mce_justifyleft {background-position:-460px 0} +.defaultSkin span.mce_justifyright {background-position:-480px 0} +.defaultSkin span.mce_justifycenter {background-position:-420px 0} +.defaultSkin span.mce_justifyfull {background-position:-440px 0} +.defaultSkin span.mce_anchor {background-position:-200px 0} +.defaultSkin span.mce_indent {background-position:-400px 0} +.defaultSkin span.mce_outdent {background-position:-540px 0} +.defaultSkin span.mce_link {background-position:-500px 0} +.defaultSkin span.mce_unlink {background-position:-640px 0} +.defaultSkin span.mce_sub {background-position:-600px 0} +.defaultSkin span.mce_sup {background-position:-620px 0} +.defaultSkin span.mce_removeformat {background-position:-580px 0} +.defaultSkin span.mce_newdocument {background-position:-520px 0} +.defaultSkin span.mce_image {background-position:-380px 0} +.defaultSkin span.mce_help {background-position:-340px 0} +.defaultSkin span.mce_code {background-position:-260px 0} +.defaultSkin span.mce_hr {background-position:-360px 0} +.defaultSkin span.mce_visualaid {background-position:-660px 0} +.defaultSkin span.mce_charmap {background-position:-240px 0} +.defaultSkin span.mce_paste {background-position:-560px 0} +.defaultSkin span.mce_copy {background-position:-700px 0} +.defaultSkin span.mce_cut {background-position:-680px 0} +.defaultSkin span.mce_blockquote {background-position:-220px 0} +.defaultSkin .mce_forecolor span.mceAction {background-position:-720px 0} +.defaultSkin .mce_backcolor span.mceAction {background-position:-760px 0} +.defaultSkin span.mce_forecolorpicker {background-position:-720px 0} +.defaultSkin span.mce_backcolorpicker {background-position:-760px 0} + +/* Plugins */ +.defaultSkin span.mce_advhr {background-position:-0px -20px} +.defaultSkin span.mce_ltr {background-position:-20px -20px} +.defaultSkin span.mce_rtl {background-position:-40px -20px} +.defaultSkin span.mce_emotions {background-position:-60px -20px} +.defaultSkin span.mce_fullpage {background-position:-80px -20px} +.defaultSkin span.mce_fullscreen {background-position:-100px -20px} +.defaultSkin span.mce_iespell {background-position:-120px -20px} +.defaultSkin span.mce_insertdate {background-position:-140px -20px} +.defaultSkin span.mce_inserttime {background-position:-160px -20px} +.defaultSkin span.mce_absolute {background-position:-180px -20px} +.defaultSkin span.mce_backward {background-position:-200px -20px} +.defaultSkin span.mce_forward {background-position:-220px -20px} +.defaultSkin span.mce_insert_layer {background-position:-240px -20px} +.defaultSkin span.mce_insertlayer {background-position:-260px -20px} +.defaultSkin span.mce_movebackward {background-position:-280px -20px} +.defaultSkin span.mce_moveforward {background-position:-300px -20px} +.defaultSkin span.mce_media {background-position:-320px -20px} +.defaultSkin span.mce_nonbreaking {background-position:-340px -20px} +.defaultSkin span.mce_pastetext {background-position:-360px -20px} +.defaultSkin span.mce_pasteword {background-position:-380px -20px} +.defaultSkin span.mce_selectall {background-position:-400px -20px} +.defaultSkin span.mce_preview {background-position:-420px -20px} +.defaultSkin span.mce_print {background-position:-440px -20px} +.defaultSkin span.mce_cancel {background-position:-460px -20px} +.defaultSkin span.mce_save {background-position:-480px -20px} +.defaultSkin span.mce_replace {background-position:-500px -20px} +.defaultSkin span.mce_search {background-position:-520px -20px} +.defaultSkin span.mce_styleprops {background-position:-560px -20px} +.defaultSkin span.mce_table {background-position:-580px -20px} +.defaultSkin span.mce_cell_props {background-position:-600px -20px} +.defaultSkin span.mce_delete_table {background-position:-620px -20px} +.defaultSkin span.mce_delete_col {background-position:-640px -20px} +.defaultSkin span.mce_delete_row {background-position:-660px -20px} +.defaultSkin span.mce_col_after {background-position:-680px -20px} +.defaultSkin span.mce_col_before {background-position:-700px -20px} +.defaultSkin span.mce_row_after {background-position:-720px -20px} +.defaultSkin span.mce_row_before {background-position:-740px -20px} +.defaultSkin span.mce_merge_cells {background-position:-760px -20px} +.defaultSkin span.mce_table_props {background-position:-980px -20px} +.defaultSkin span.mce_row_props {background-position:-780px -20px} +.defaultSkin span.mce_split_cells {background-position:-800px -20px} +.defaultSkin span.mce_template {background-position:-820px -20px} +.defaultSkin span.mce_visualchars {background-position:-840px -20px} +.defaultSkin span.mce_abbr {background-position:-860px -20px} +.defaultSkin span.mce_acronym {background-position:-880px -20px} +.defaultSkin span.mce_attribs {background-position:-900px -20px} +.defaultSkin span.mce_cite {background-position:-920px -20px} +.defaultSkin span.mce_del {background-position:-940px -20px} +.defaultSkin span.mce_ins {background-position:-960px -20px} +.defaultSkin span.mce_pagebreak {background-position:0 -40px} +.defaultSkin .mce_spellchecker span.mceAction {background-position:-540px -20px} diff --git a/lib/editor/tinymce/themes/advanced/skins/o2k7/content.css b/lib/editor/tinymce/themes/advanced/skins/o2k7/content.css index b8431d16955..a40493175b0 100644 --- a/lib/editor/tinymce/themes/advanced/skins/o2k7/content.css +++ b/lib/editor/tinymce/themes/advanced/skins/o2k7/content.css @@ -1,32 +1,32 @@ -body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} -body {background:#FFF;} -body.mceForceColors {background:#FFF; color:#000;} -h1 {font-size: 2em} -h2 {font-size: 1.5em} -h3 {font-size: 1.17em} -h4 {font-size: 1em} -h5 {font-size: .83em} -h6 {font-size: .75em} -.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} -a.mceItemAnchor {width:12px; line-height:6px; overflow:hidden; padding-left:12px; background:url(../default/img/items.gif) no-repeat bottom left;} -img.mceItemAnchor {width:12px; height:12px; background:url(../default/img/items.gif) no-repeat;} -img {border:0;} -table {cursor:default} -table td, table th {cursor:text} -ins {border-bottom:1px solid green; text-decoration: none; color:green} -del {color:red; text-decoration:line-through} -cite {border-bottom:1px dashed blue} -acronym {border-bottom:1px dotted #CCC; cursor:help} -abbr, html\:abbr {border-bottom:1px dashed #CCC; cursor:help} - -/* IE */ -* html body { -scrollbar-3dlight-color:#F0F0EE; -scrollbar-arrow-color:#676662; -scrollbar-base-color:#F0F0EE; -scrollbar-darkshadow-color:#DDD; -scrollbar-face-color:#E0E0DD; -scrollbar-highlight-color:#F0F0EE; -scrollbar-shadow-color:#F0F0EE; -scrollbar-track-color:#F5F5F5; -} +body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} +body {background:#FFF;} +body.mceForceColors {background:#FFF; color:#000;} +h1 {font-size: 2em} +h2 {font-size: 1.5em} +h3 {font-size: 1.17em} +h4 {font-size: 1em} +h5 {font-size: .83em} +h6 {font-size: .75em} +.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} +a.mceItemAnchor {width:12px; line-height:6px; overflow:hidden; padding-left:12px; background:url(../default/img/items.gif) no-repeat bottom left;} +img.mceItemAnchor {width:12px; height:12px; background:url(../default/img/items.gif) no-repeat;} +img {border:0;} +table {cursor:default} +table td, table th {cursor:text} +ins {border-bottom:1px solid green; text-decoration: none; color:green} +del {color:red; text-decoration:line-through} +cite {border-bottom:1px dashed blue} +acronym {border-bottom:1px dotted #CCC; cursor:help} +abbr, html\:abbr {border-bottom:1px dashed #CCC; cursor:help} + +/* IE */ +* html body { +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +} diff --git a/lib/editor/tinymce/themes/advanced/skins/o2k7/dialog.css b/lib/editor/tinymce/themes/advanced/skins/o2k7/dialog.css index 6c37d6fb839..6b278b64f96 100644 --- a/lib/editor/tinymce/themes/advanced/skins/o2k7/dialog.css +++ b/lib/editor/tinymce/themes/advanced/skins/o2k7/dialog.css @@ -1,115 +1,115 @@ -/* Generic */ -body { -font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; -scrollbar-3dlight-color:#F0F0EE; -scrollbar-arrow-color:#676662; -scrollbar-base-color:#F0F0EE; -scrollbar-darkshadow-color:#DDDDDD; -scrollbar-face-color:#E0E0DD; -scrollbar-highlight-color:#F0F0EE; -scrollbar-shadow-color:#F0F0EE; -scrollbar-track-color:#F5F5F5; -background:#F0F0EE; -padding:0; -margin:8px 8px 0 8px; -} - -html {background:#F0F0EE;} -td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} -textarea {resize:none;outline:none;} -a:link, a:visited {color:black;} -a:hover {color:#2B6FB6;} -.nowrap {white-space: nowrap} - -/* Forms */ -fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} -legend {color:#2B6FB6; font-weight:bold;} -label.msg {display:none;} -label.invalid {color:#EE0000; display:inline;} -input.invalid {border:1px solid #EE0000;} -input {background:#FFF; border:1px solid #CCC;} -input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} -input, select, textarea {border:1px solid #808080;} -input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} -input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} -.input_noborder {border:0;} - -/* Buttons */ -#insert, #cancel, input.button, .updateButton { -border:0; margin:0; padding:0; -font-weight:bold; -width:94px; height:26px; -background:url(../default/img/buttons.png) 0 -26px; -cursor:pointer; -padding-bottom:2px; -} - -#insert {background:url(../default/img/buttons.png) 0 -52px;} -#cancel {background:url(../default/img/buttons.png) 0 0;} - -/* Browse */ -a.pickcolor, a.browse {text-decoration:none} -a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} -.mceOldBoxModel a.browse span {width:22px; height:20px;} -a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} -a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} -a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} -a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} -.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} -a.pickcolor:hover span {background-color:#B2BBD0;} -a.pickcolor:hover span.disabled {} - -/* Charmap */ -table.charmap {border:1px solid #AAA; text-align:center} -td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} -#charmap a {display:block; color:#000; text-decoration:none; border:0} -#charmap a:hover {background:#CCC;color:#2B6FB6} -#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} -#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} - -/* Source */ -.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} -.mceActionPanel {margin-top:5px;} - -/* Tabs classes */ -.tabs {width:100%; height:18px; line-height:normal; background:url(../default/img/tabs.gif) repeat-x 0 -72px;} -.tabs ul {margin:0; padding:0; list-style:none;} -.tabs li {float:left; background:url(../default/img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;} -.tabs li.current {background:url(../default/img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} -.tabs span {float:left; display:block; background:url(../default/img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} -.tabs .current span {background:url(../default/img/tabs.gif) no-repeat right -54px;} -.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} -.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} - -/* Panels */ -.panel_wrapper div.panel {display:none;} -.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} -.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} - -/* Columns */ -.column {float:left;} -.properties {width:100%;} -.properties .column1 {} -.properties .column2 {text-align:left;} - -/* Titles */ -h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} -h3 {font-size:14px;} -.title {font-size:12px; font-weight:bold; color:#2B6FB6;} - -/* Dialog specific */ -#link .panel_wrapper, #link div.current {height:125px;} -#image .panel_wrapper, #image div.current {height:200px;} -#plugintable thead {font-weight:bold; background:#DDD;} -#plugintable, #about #plugintable td {border:1px solid #919B9C;} -#plugintable {width:96%; margin-top:10px;} -#pluginscontainer {height:290px; overflow:auto;} -#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;} -#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} -#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} -#colorpicker #light div {overflow:hidden;} -#colorpicker #previewblock {float:right; padding-left:10px; height:20px;} -#colorpicker .panel_wrapper div.current {height:175px;} -#colorpicker #namedcolors {width:150px;} -#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} -#colorpicker #colornamecontainer {margin-top:5px;} +/* Generic */ +body { +font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDDDDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +background:#F0F0EE; +padding:0; +margin:8px 8px 0 8px; +} + +html {background:#F0F0EE;} +td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +textarea {resize:none;outline:none;} +a:link, a:visited {color:black;} +a:hover {color:#2B6FB6;} +.nowrap {white-space: nowrap} + +/* Forms */ +fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} +legend {color:#2B6FB6; font-weight:bold;} +label.msg {display:none;} +label.invalid {color:#EE0000; display:inline;} +input.invalid {border:1px solid #EE0000;} +input {background:#FFF; border:1px solid #CCC;} +input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +input, select, textarea {border:1px solid #808080;} +input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} +input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} +.input_noborder {border:0;} + +/* Buttons */ +#insert, #cancel, input.button, .updateButton { +border:0; margin:0; padding:0; +font-weight:bold; +width:94px; height:26px; +background:url(../default/img/buttons.png) 0 -26px; +cursor:pointer; +padding-bottom:2px; +} + +#insert {background:url(../default/img/buttons.png) 0 -52px;} +#cancel {background:url(../default/img/buttons.png) 0 0;} + +/* Browse */ +a.pickcolor, a.browse {text-decoration:none} +a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} +.mceOldBoxModel a.browse span {width:22px; height:20px;} +a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} +a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} +a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} +.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} +a.pickcolor:hover span {background-color:#B2BBD0;} +a.pickcolor:hover span.disabled {} + +/* Charmap */ +table.charmap {border:1px solid #AAA; text-align:center} +td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} +#charmap a {display:block; color:#000; text-decoration:none; border:0} +#charmap a:hover {background:#CCC;color:#2B6FB6} +#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} +#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} + +/* Source */ +.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} +.mceActionPanel {margin-top:5px;} + +/* Tabs classes */ +.tabs {width:100%; height:18px; line-height:normal; background:url(../default/img/tabs.gif) repeat-x 0 -72px;} +.tabs ul {margin:0; padding:0; list-style:none;} +.tabs li {float:left; background:url(../default/img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;} +.tabs li.current {background:url(../default/img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} +.tabs span {float:left; display:block; background:url(../default/img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} +.tabs .current span {background:url(../default/img/tabs.gif) no-repeat right -54px;} +.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} +.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} + +/* Panels */ +.panel_wrapper div.panel {display:none;} +.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} +.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} + +/* Columns */ +.column {float:left;} +.properties {width:100%;} +.properties .column1 {} +.properties .column2 {text-align:left;} + +/* Titles */ +h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} +h3 {font-size:14px;} +.title {font-size:12px; font-weight:bold; color:#2B6FB6;} + +/* Dialog specific */ +#link .panel_wrapper, #link div.current {height:125px;} +#image .panel_wrapper, #image div.current {height:200px;} +#plugintable thead {font-weight:bold; background:#DDD;} +#plugintable, #about #plugintable td {border:1px solid #919B9C;} +#plugintable {width:96%; margin-top:10px;} +#pluginscontainer {height:290px; overflow:auto;} +#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;} +#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} +#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} +#colorpicker #light div {overflow:hidden;} +#colorpicker #previewblock {float:right; padding-left:10px; height:20px;} +#colorpicker .panel_wrapper div.current {height:175px;} +#colorpicker #namedcolors {width:150px;} +#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} +#colorpicker #colornamecontainer {margin-top:5px;} diff --git a/lib/editor/tinymce/themes/advanced/skins/o2k7/ui.css b/lib/editor/tinymce/themes/advanced/skins/o2k7/ui.css index c10a3f0161f..0f8d5c24b61 100644 --- a/lib/editor/tinymce/themes/advanced/skins/o2k7/ui.css +++ b/lib/editor/tinymce/themes/advanced/skins/o2k7/ui.css @@ -1,215 +1,215 @@ -/* Reset */ -.o2k7Skin table, .o2k7Skin tbody, .o2k7Skin a, .o2k7Skin img, .o2k7Skin tr, .o2k7Skin div, .o2k7Skin td, .o2k7Skin iframe, .o2k7Skin span, .o2k7Skin *, .o2k7Skin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left} -.o2k7Skin a:hover, .o2k7Skin a:link, .o2k7Skin a:visited, .o2k7Skin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} -.o2k7Skin table td {vertical-align:middle} - -/* Containers */ -.o2k7Skin table {background:#E5EFFD} -.o2k7Skin iframe {display:block; background:#FFF} -.o2k7Skin .mceToolbar {height:26px} - -/* External */ -.o2k7Skin .mceExternalToolbar {position:absolute; border:1px solid #ABC6DD; border-bottom:0; display:none} -.o2k7Skin .mceExternalToolbar td.mceToolbar {padding-right:13px;} -.o2k7Skin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0} - -/* Layout */ -.o2k7Skin table.mceLayout {border:0; border-left:1px solid #ABC6DD; border-right:1px solid #ABC6DD} -.o2k7Skin table.mceLayout tr.mceFirst td {border-top:1px solid #ABC6DD} -.o2k7Skin table.mceLayout tr.mceLast td {border-bottom:1px solid #ABC6DD} -.o2k7Skin table.mceToolbar, .o2k7Skin tr.mceFirst .mceToolbar tr td, .o2k7Skin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0} -.o2k7Skin .mceIframeContainer {border-top:1px solid #ABC6DD; border-bottom:1px solid #ABC6DD} -.o2k7Skin .mceStatusbar {display:block; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; height:20px} -.o2k7Skin .mceStatusbar div {float:left; padding:2px} -.o2k7Skin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize} -.o2k7Skin .mceStatusbar a:hover {text-decoration:underline} -.o2k7Skin table.mceToolbar {margin-left:3px} -.o2k7Skin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; margin-left:3px;} -.o2k7Skin .mceToolbar td.mceFirst span {margin:0} -.o2k7Skin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px} -.o2k7Skin .mceToolbar .mceToolbarEndListBox span, .o2k7Skin .mceToolbar .mceToolbarStartListBox span {display:none} -.o2k7Skin span.mceIcon, .o2k7Skin img.mceIcon {display:block; width:20px; height:20px} -.o2k7Skin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} -.o2k7Skin td.mceCenter {text-align:center;} -.o2k7Skin td.mceCenter table {margin:0 auto; text-align:left;} -.o2k7Skin td.mceRight table {margin:0 0 0 auto;} - -/* Button */ -.o2k7Skin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px} -.o2k7Skin a.mceButton span, .o2k7Skin a.mceButton img {margin-left:1px} -.o2k7Skin .mceOldBoxModel a.mceButton span, .o2k7Skin .mceOldBoxModel a.mceButton img {margin:0 0 0 1px} -.o2k7Skin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px} -.o2k7Skin a.mceButtonActive, .o2k7Skin a.mceButtonSelected {background-position:0 -44px} -.o2k7Skin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} -.o2k7Skin .mceButtonLabeled {width:auto} -.o2k7Skin .mceButtonLabeled span.mceIcon {float:left} -.o2k7Skin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica} -.o2k7Skin .mceButtonDisabled .mceButtonLabel {color:#888} - -/* Separator */ -.o2k7Skin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px} - -/* ListBox */ -.o2k7Skin .mceListBox {margin-left:3px} -.o2k7Skin .mceListBox, .o2k7Skin .mceListBox a {display:block} -.o2k7Skin .mceListBox .mceText {padding-left:4px; text-align:left; width:70px; border:1px solid #b3c7e1; border-right:0; background:#eaf2fb; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden} -.o2k7Skin .mceListBox .mceOpen {width:14px; height:22px; background:url(img/button_bg.png) -66px 0} -.o2k7Skin table.mceListBoxEnabled:hover .mceText, .o2k7Skin .mceListBoxHover .mceText, .o2k7Skin .mceListBoxSelected .mceText {background:#FFF} -.o2k7Skin table.mceListBoxEnabled:hover .mceOpen, .o2k7Skin .mceListBoxHover .mceOpen, .o2k7Skin .mceListBoxSelected .mceOpen {background-position:-66px -22px} -.o2k7Skin .mceListBoxDisabled .mceText {color:gray} -.o2k7Skin .mceListBoxMenu {overflow:auto; overflow-x:hidden} -.o2k7Skin .mceOldBoxModel .mceListBox .mceText {height:22px} -.o2k7Skin select.mceListBox {font-family:Tahoma,Verdana,Arial,Helvetica; font-size:12px; border:1px solid #b3c7e1; background:#FFF;} - -/* SplitButton */ -.o2k7Skin .mceSplitButton, .o2k7Skin .mceSplitButton a, .o2k7Skin .mceSplitButton span {display:block; height:22px} -.o2k7Skin .mceSplitButton {background:url(img/button_bg.png)} -.o2k7Skin .mceSplitButton a.mceAction {width:22px} -.o2k7Skin .mceSplitButton span.mceAction {width:22px; background:url(../../img/icons.gif) 20px 20px} -.o2k7Skin .mceSplitButton a.mceOpen {width:10px; background:url(img/button_bg.png) -44px 0} -.o2k7Skin .mceSplitButton span.mceOpen {display:none} -.o2k7Skin table.mceSplitButtonEnabled:hover a.mceAction, .o2k7Skin .mceSplitButtonHover a.mceAction, .o2k7Skin .mceSplitButtonSelected {background:url(img/button_bg.png) 0 -22px} -.o2k7Skin table.mceSplitButtonEnabled:hover a.mceOpen, .o2k7Skin .mceSplitButtonHover a.mceOpen, .o2k7Skin .mceSplitButtonSelected a.mceOpen {background-position:-44px -44px} -.o2k7Skin .mceSplitButtonDisabled .mceAction {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} -.o2k7Skin .mceSplitButtonActive {background-position:0 -44px} - -/* ColorSplitButton */ -.o2k7Skin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray} -.o2k7Skin .mceColorSplitMenu td {padding:2px} -.o2k7Skin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080} -.o2k7Skin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} -.o2k7Skin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} -.o2k7Skin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2} -.o2k7Skin a.mceMoreColors:hover {border:1px solid #0A246A} -.o2k7Skin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a;overflow:hidden} -.o2k7Skin .mce_forecolor span.mceAction, .o2k7Skin .mce_backcolor span.mceAction {height:15px;overflow:hidden} - -/* Menu */ -.o2k7Skin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #ABC6DD} -.o2k7Skin .mceNoIcons span.mceIcon {width:0;} -.o2k7Skin .mceNoIcons a .mceText {padding-left:10px} -.o2k7Skin .mceMenu table {background:#FFF} -.o2k7Skin .mceMenu a, .o2k7Skin .mceMenu span, .o2k7Skin .mceMenu {display:block} -.o2k7Skin .mceMenu td {height:20px} -.o2k7Skin .mceMenu a {position:relative;padding:3px 0 4px 0} -.o2k7Skin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block} -.o2k7Skin .mceMenu span.mceText, .o2k7Skin .mceMenu .mcePreview {font-size:11px} -.o2k7Skin .mceMenu pre.mceText {font-family:Monospace} -.o2k7Skin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;} -.o2k7Skin .mceMenu .mceMenuItemEnabled a:hover, .o2k7Skin .mceMenu .mceMenuItemActive {background-color:#dbecf3} -.o2k7Skin td.mceMenuItemSeparator {background:#DDD; height:1px} -.o2k7Skin .mceMenuItemTitle a {border:0; background:#E5EFFD; border-bottom:1px solid #ABC6DD} -.o2k7Skin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px} -.o2k7Skin .mceMenuItemDisabled .mceText {color:#888} -.o2k7Skin .mceMenuItemSelected .mceIcon {background:url(../default/img/menu_check.gif)} -.o2k7Skin .mceNoIcons .mceMenuItemSelected a {background:url(../default/img/menu_arrow.gif) no-repeat -6px center} -.o2k7Skin .mceMenu span.mceMenuLine {display:none} -.o2k7Skin .mceMenuItemSub a {background:url(../default/img/menu_arrow.gif) no-repeat top right;} - -/* Progress,Resize */ -.o2k7Skin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF} -.o2k7Skin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} -.o2k7Skin .mcePlaceHolder {border:1px dotted gray} - -/* Formats */ -.o2k7Skin .mce_formatPreview a {font-size:10px} -.o2k7Skin .mce_p span.mceText {} -.o2k7Skin .mce_address span.mceText {font-style:italic} -.o2k7Skin .mce_pre span.mceText {font-family:monospace} -.o2k7Skin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} -.o2k7Skin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} -.o2k7Skin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} -.o2k7Skin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} -.o2k7Skin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} -.o2k7Skin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} - -/* Theme */ -.o2k7Skin span.mce_bold {background-position:0 0} -.o2k7Skin span.mce_italic {background-position:-60px 0} -.o2k7Skin span.mce_underline {background-position:-140px 0} -.o2k7Skin span.mce_strikethrough {background-position:-120px 0} -.o2k7Skin span.mce_undo {background-position:-160px 0} -.o2k7Skin span.mce_redo {background-position:-100px 0} -.o2k7Skin span.mce_cleanup {background-position:-40px 0} -.o2k7Skin span.mce_bullist {background-position:-20px 0} -.o2k7Skin span.mce_numlist {background-position:-80px 0} -.o2k7Skin span.mce_justifyleft {background-position:-460px 0} -.o2k7Skin span.mce_justifyright {background-position:-480px 0} -.o2k7Skin span.mce_justifycenter {background-position:-420px 0} -.o2k7Skin span.mce_justifyfull {background-position:-440px 0} -.o2k7Skin span.mce_anchor {background-position:-200px 0} -.o2k7Skin span.mce_indent {background-position:-400px 0} -.o2k7Skin span.mce_outdent {background-position:-540px 0} -.o2k7Skin span.mce_link {background-position:-500px 0} -.o2k7Skin span.mce_unlink {background-position:-640px 0} -.o2k7Skin span.mce_sub {background-position:-600px 0} -.o2k7Skin span.mce_sup {background-position:-620px 0} -.o2k7Skin span.mce_removeformat {background-position:-580px 0} -.o2k7Skin span.mce_newdocument {background-position:-520px 0} -.o2k7Skin span.mce_image {background-position:-380px 0} -.o2k7Skin span.mce_help {background-position:-340px 0} -.o2k7Skin span.mce_code {background-position:-260px 0} -.o2k7Skin span.mce_hr {background-position:-360px 0} -.o2k7Skin span.mce_visualaid {background-position:-660px 0} -.o2k7Skin span.mce_charmap {background-position:-240px 0} -.o2k7Skin span.mce_paste {background-position:-560px 0} -.o2k7Skin span.mce_copy {background-position:-700px 0} -.o2k7Skin span.mce_cut {background-position:-680px 0} -.o2k7Skin span.mce_blockquote {background-position:-220px 0} -.o2k7Skin .mce_forecolor span.mceAction {background-position:-720px 0} -.o2k7Skin .mce_backcolor span.mceAction {background-position:-760px 0} -.o2k7Skin span.mce_forecolorpicker {background-position:-720px 0} -.o2k7Skin span.mce_backcolorpicker {background-position:-760px 0} - -/* Plugins */ -.o2k7Skin span.mce_advhr {background-position:-0px -20px} -.o2k7Skin span.mce_ltr {background-position:-20px -20px} -.o2k7Skin span.mce_rtl {background-position:-40px -20px} -.o2k7Skin span.mce_emotions {background-position:-60px -20px} -.o2k7Skin span.mce_fullpage {background-position:-80px -20px} -.o2k7Skin span.mce_fullscreen {background-position:-100px -20px} -.o2k7Skin span.mce_iespell {background-position:-120px -20px} -.o2k7Skin span.mce_insertdate {background-position:-140px -20px} -.o2k7Skin span.mce_inserttime {background-position:-160px -20px} -.o2k7Skin span.mce_absolute {background-position:-180px -20px} -.o2k7Skin span.mce_backward {background-position:-200px -20px} -.o2k7Skin span.mce_forward {background-position:-220px -20px} -.o2k7Skin span.mce_insert_layer {background-position:-240px -20px} -.o2k7Skin span.mce_insertlayer {background-position:-260px -20px} -.o2k7Skin span.mce_movebackward {background-position:-280px -20px} -.o2k7Skin span.mce_moveforward {background-position:-300px -20px} -.o2k7Skin span.mce_media {background-position:-320px -20px} -.o2k7Skin span.mce_nonbreaking {background-position:-340px -20px} -.o2k7Skin span.mce_pastetext {background-position:-360px -20px} -.o2k7Skin span.mce_pasteword {background-position:-380px -20px} -.o2k7Skin span.mce_selectall {background-position:-400px -20px} -.o2k7Skin span.mce_preview {background-position:-420px -20px} -.o2k7Skin span.mce_print {background-position:-440px -20px} -.o2k7Skin span.mce_cancel {background-position:-460px -20px} -.o2k7Skin span.mce_save {background-position:-480px -20px} -.o2k7Skin span.mce_replace {background-position:-500px -20px} -.o2k7Skin span.mce_search {background-position:-520px -20px} -.o2k7Skin span.mce_styleprops {background-position:-560px -20px} -.o2k7Skin span.mce_table {background-position:-580px -20px} -.o2k7Skin span.mce_cell_props {background-position:-600px -20px} -.o2k7Skin span.mce_delete_table {background-position:-620px -20px} -.o2k7Skin span.mce_delete_col {background-position:-640px -20px} -.o2k7Skin span.mce_delete_row {background-position:-660px -20px} -.o2k7Skin span.mce_col_after {background-position:-680px -20px} -.o2k7Skin span.mce_col_before {background-position:-700px -20px} -.o2k7Skin span.mce_row_after {background-position:-720px -20px} -.o2k7Skin span.mce_row_before {background-position:-740px -20px} -.o2k7Skin span.mce_merge_cells {background-position:-760px -20px} -.o2k7Skin span.mce_table_props {background-position:-980px -20px} -.o2k7Skin span.mce_row_props {background-position:-780px -20px} -.o2k7Skin span.mce_split_cells {background-position:-800px -20px} -.o2k7Skin span.mce_template {background-position:-820px -20px} -.o2k7Skin span.mce_visualchars {background-position:-840px -20px} -.o2k7Skin span.mce_abbr {background-position:-860px -20px} -.o2k7Skin span.mce_acronym {background-position:-880px -20px} -.o2k7Skin span.mce_attribs {background-position:-900px -20px} -.o2k7Skin span.mce_cite {background-position:-920px -20px} -.o2k7Skin span.mce_del {background-position:-940px -20px} -.o2k7Skin span.mce_ins {background-position:-960px -20px} -.o2k7Skin span.mce_pagebreak {background-position:0 -40px} -.o2k7Skin .mce_spellchecker span.mceAction {background-position:-540px -20px} +/* Reset */ +.o2k7Skin table, .o2k7Skin tbody, .o2k7Skin a, .o2k7Skin img, .o2k7Skin tr, .o2k7Skin div, .o2k7Skin td, .o2k7Skin iframe, .o2k7Skin span, .o2k7Skin *, .o2k7Skin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left} +.o2k7Skin a:hover, .o2k7Skin a:link, .o2k7Skin a:visited, .o2k7Skin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} +.o2k7Skin table td {vertical-align:middle} + +/* Containers */ +.o2k7Skin table {background:#E5EFFD} +.o2k7Skin iframe {display:block; background:#FFF} +.o2k7Skin .mceToolbar {height:26px} + +/* External */ +.o2k7Skin .mceExternalToolbar {position:absolute; border:1px solid #ABC6DD; border-bottom:0; display:none} +.o2k7Skin .mceExternalToolbar td.mceToolbar {padding-right:13px;} +.o2k7Skin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0} + +/* Layout */ +.o2k7Skin table.mceLayout {border:0; border-left:1px solid #ABC6DD; border-right:1px solid #ABC6DD} +.o2k7Skin table.mceLayout tr.mceFirst td {border-top:1px solid #ABC6DD} +.o2k7Skin table.mceLayout tr.mceLast td {border-bottom:1px solid #ABC6DD} +.o2k7Skin table.mceToolbar, .o2k7Skin tr.mceFirst .mceToolbar tr td, .o2k7Skin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0} +.o2k7Skin .mceIframeContainer {border-top:1px solid #ABC6DD; border-bottom:1px solid #ABC6DD} +.o2k7Skin .mceStatusbar {display:block; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; height:20px} +.o2k7Skin .mceStatusbar div {float:left; padding:2px} +.o2k7Skin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize} +.o2k7Skin .mceStatusbar a:hover {text-decoration:underline} +.o2k7Skin table.mceToolbar {margin-left:3px} +.o2k7Skin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; margin-left:3px;} +.o2k7Skin .mceToolbar td.mceFirst span {margin:0} +.o2k7Skin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px} +.o2k7Skin .mceToolbar .mceToolbarEndListBox span, .o2k7Skin .mceToolbar .mceToolbarStartListBox span {display:none} +.o2k7Skin span.mceIcon, .o2k7Skin img.mceIcon {display:block; width:20px; height:20px} +.o2k7Skin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} +.o2k7Skin td.mceCenter {text-align:center;} +.o2k7Skin td.mceCenter table {margin:0 auto; text-align:left;} +.o2k7Skin td.mceRight table {margin:0 0 0 auto;} + +/* Button */ +.o2k7Skin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px} +.o2k7Skin a.mceButton span, .o2k7Skin a.mceButton img {margin-left:1px} +.o2k7Skin .mceOldBoxModel a.mceButton span, .o2k7Skin .mceOldBoxModel a.mceButton img {margin:0 0 0 1px} +.o2k7Skin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px} +.o2k7Skin a.mceButtonActive, .o2k7Skin a.mceButtonSelected {background-position:0 -44px} +.o2k7Skin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.o2k7Skin .mceButtonLabeled {width:auto} +.o2k7Skin .mceButtonLabeled span.mceIcon {float:left} +.o2k7Skin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica} +.o2k7Skin .mceButtonDisabled .mceButtonLabel {color:#888} + +/* Separator */ +.o2k7Skin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px} + +/* ListBox */ +.o2k7Skin .mceListBox {margin-left:3px} +.o2k7Skin .mceListBox, .o2k7Skin .mceListBox a {display:block} +.o2k7Skin .mceListBox .mceText {padding-left:4px; text-align:left; width:70px; border:1px solid #b3c7e1; border-right:0; background:#eaf2fb; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden} +.o2k7Skin .mceListBox .mceOpen {width:14px; height:22px; background:url(img/button_bg.png) -66px 0} +.o2k7Skin table.mceListBoxEnabled:hover .mceText, .o2k7Skin .mceListBoxHover .mceText, .o2k7Skin .mceListBoxSelected .mceText {background:#FFF} +.o2k7Skin table.mceListBoxEnabled:hover .mceOpen, .o2k7Skin .mceListBoxHover .mceOpen, .o2k7Skin .mceListBoxSelected .mceOpen {background-position:-66px -22px} +.o2k7Skin .mceListBoxDisabled .mceText {color:gray} +.o2k7Skin .mceListBoxMenu {overflow:auto; overflow-x:hidden} +.o2k7Skin .mceOldBoxModel .mceListBox .mceText {height:22px} +.o2k7Skin select.mceListBox {font-family:Tahoma,Verdana,Arial,Helvetica; font-size:12px; border:1px solid #b3c7e1; background:#FFF;} + +/* SplitButton */ +.o2k7Skin .mceSplitButton, .o2k7Skin .mceSplitButton a, .o2k7Skin .mceSplitButton span {display:block; height:22px} +.o2k7Skin .mceSplitButton {background:url(img/button_bg.png)} +.o2k7Skin .mceSplitButton a.mceAction {width:22px} +.o2k7Skin .mceSplitButton span.mceAction {width:22px; background:url(../../img/icons.gif) 20px 20px} +.o2k7Skin .mceSplitButton a.mceOpen {width:10px; background:url(img/button_bg.png) -44px 0} +.o2k7Skin .mceSplitButton span.mceOpen {display:none} +.o2k7Skin table.mceSplitButtonEnabled:hover a.mceAction, .o2k7Skin .mceSplitButtonHover a.mceAction, .o2k7Skin .mceSplitButtonSelected {background:url(img/button_bg.png) 0 -22px} +.o2k7Skin table.mceSplitButtonEnabled:hover a.mceOpen, .o2k7Skin .mceSplitButtonHover a.mceOpen, .o2k7Skin .mceSplitButtonSelected a.mceOpen {background-position:-44px -44px} +.o2k7Skin .mceSplitButtonDisabled .mceAction {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.o2k7Skin .mceSplitButtonActive {background-position:0 -44px} + +/* ColorSplitButton */ +.o2k7Skin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray} +.o2k7Skin .mceColorSplitMenu td {padding:2px} +.o2k7Skin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080} +.o2k7Skin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} +.o2k7Skin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} +.o2k7Skin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2} +.o2k7Skin a.mceMoreColors:hover {border:1px solid #0A246A} +.o2k7Skin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a;overflow:hidden} +.o2k7Skin .mce_forecolor span.mceAction, .o2k7Skin .mce_backcolor span.mceAction {height:15px;overflow:hidden} + +/* Menu */ +.o2k7Skin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #ABC6DD} +.o2k7Skin .mceNoIcons span.mceIcon {width:0;} +.o2k7Skin .mceNoIcons a .mceText {padding-left:10px} +.o2k7Skin .mceMenu table {background:#FFF} +.o2k7Skin .mceMenu a, .o2k7Skin .mceMenu span, .o2k7Skin .mceMenu {display:block} +.o2k7Skin .mceMenu td {height:20px} +.o2k7Skin .mceMenu a {position:relative;padding:3px 0 4px 0} +.o2k7Skin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block} +.o2k7Skin .mceMenu span.mceText, .o2k7Skin .mceMenu .mcePreview {font-size:11px} +.o2k7Skin .mceMenu pre.mceText {font-family:Monospace} +.o2k7Skin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;} +.o2k7Skin .mceMenu .mceMenuItemEnabled a:hover, .o2k7Skin .mceMenu .mceMenuItemActive {background-color:#dbecf3} +.o2k7Skin td.mceMenuItemSeparator {background:#DDD; height:1px} +.o2k7Skin .mceMenuItemTitle a {border:0; background:#E5EFFD; border-bottom:1px solid #ABC6DD} +.o2k7Skin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px} +.o2k7Skin .mceMenuItemDisabled .mceText {color:#888} +.o2k7Skin .mceMenuItemSelected .mceIcon {background:url(../default/img/menu_check.gif)} +.o2k7Skin .mceNoIcons .mceMenuItemSelected a {background:url(../default/img/menu_arrow.gif) no-repeat -6px center} +.o2k7Skin .mceMenu span.mceMenuLine {display:none} +.o2k7Skin .mceMenuItemSub a {background:url(../default/img/menu_arrow.gif) no-repeat top right;} + +/* Progress,Resize */ +.o2k7Skin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF} +.o2k7Skin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} +.o2k7Skin .mcePlaceHolder {border:1px dotted gray} + +/* Formats */ +.o2k7Skin .mce_formatPreview a {font-size:10px} +.o2k7Skin .mce_p span.mceText {} +.o2k7Skin .mce_address span.mceText {font-style:italic} +.o2k7Skin .mce_pre span.mceText {font-family:monospace} +.o2k7Skin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} +.o2k7Skin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} +.o2k7Skin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} +.o2k7Skin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} +.o2k7Skin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} +.o2k7Skin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} + +/* Theme */ +.o2k7Skin span.mce_bold {background-position:0 0} +.o2k7Skin span.mce_italic {background-position:-60px 0} +.o2k7Skin span.mce_underline {background-position:-140px 0} +.o2k7Skin span.mce_strikethrough {background-position:-120px 0} +.o2k7Skin span.mce_undo {background-position:-160px 0} +.o2k7Skin span.mce_redo {background-position:-100px 0} +.o2k7Skin span.mce_cleanup {background-position:-40px 0} +.o2k7Skin span.mce_bullist {background-position:-20px 0} +.o2k7Skin span.mce_numlist {background-position:-80px 0} +.o2k7Skin span.mce_justifyleft {background-position:-460px 0} +.o2k7Skin span.mce_justifyright {background-position:-480px 0} +.o2k7Skin span.mce_justifycenter {background-position:-420px 0} +.o2k7Skin span.mce_justifyfull {background-position:-440px 0} +.o2k7Skin span.mce_anchor {background-position:-200px 0} +.o2k7Skin span.mce_indent {background-position:-400px 0} +.o2k7Skin span.mce_outdent {background-position:-540px 0} +.o2k7Skin span.mce_link {background-position:-500px 0} +.o2k7Skin span.mce_unlink {background-position:-640px 0} +.o2k7Skin span.mce_sub {background-position:-600px 0} +.o2k7Skin span.mce_sup {background-position:-620px 0} +.o2k7Skin span.mce_removeformat {background-position:-580px 0} +.o2k7Skin span.mce_newdocument {background-position:-520px 0} +.o2k7Skin span.mce_image {background-position:-380px 0} +.o2k7Skin span.mce_help {background-position:-340px 0} +.o2k7Skin span.mce_code {background-position:-260px 0} +.o2k7Skin span.mce_hr {background-position:-360px 0} +.o2k7Skin span.mce_visualaid {background-position:-660px 0} +.o2k7Skin span.mce_charmap {background-position:-240px 0} +.o2k7Skin span.mce_paste {background-position:-560px 0} +.o2k7Skin span.mce_copy {background-position:-700px 0} +.o2k7Skin span.mce_cut {background-position:-680px 0} +.o2k7Skin span.mce_blockquote {background-position:-220px 0} +.o2k7Skin .mce_forecolor span.mceAction {background-position:-720px 0} +.o2k7Skin .mce_backcolor span.mceAction {background-position:-760px 0} +.o2k7Skin span.mce_forecolorpicker {background-position:-720px 0} +.o2k7Skin span.mce_backcolorpicker {background-position:-760px 0} + +/* Plugins */ +.o2k7Skin span.mce_advhr {background-position:-0px -20px} +.o2k7Skin span.mce_ltr {background-position:-20px -20px} +.o2k7Skin span.mce_rtl {background-position:-40px -20px} +.o2k7Skin span.mce_emotions {background-position:-60px -20px} +.o2k7Skin span.mce_fullpage {background-position:-80px -20px} +.o2k7Skin span.mce_fullscreen {background-position:-100px -20px} +.o2k7Skin span.mce_iespell {background-position:-120px -20px} +.o2k7Skin span.mce_insertdate {background-position:-140px -20px} +.o2k7Skin span.mce_inserttime {background-position:-160px -20px} +.o2k7Skin span.mce_absolute {background-position:-180px -20px} +.o2k7Skin span.mce_backward {background-position:-200px -20px} +.o2k7Skin span.mce_forward {background-position:-220px -20px} +.o2k7Skin span.mce_insert_layer {background-position:-240px -20px} +.o2k7Skin span.mce_insertlayer {background-position:-260px -20px} +.o2k7Skin span.mce_movebackward {background-position:-280px -20px} +.o2k7Skin span.mce_moveforward {background-position:-300px -20px} +.o2k7Skin span.mce_media {background-position:-320px -20px} +.o2k7Skin span.mce_nonbreaking {background-position:-340px -20px} +.o2k7Skin span.mce_pastetext {background-position:-360px -20px} +.o2k7Skin span.mce_pasteword {background-position:-380px -20px} +.o2k7Skin span.mce_selectall {background-position:-400px -20px} +.o2k7Skin span.mce_preview {background-position:-420px -20px} +.o2k7Skin span.mce_print {background-position:-440px -20px} +.o2k7Skin span.mce_cancel {background-position:-460px -20px} +.o2k7Skin span.mce_save {background-position:-480px -20px} +.o2k7Skin span.mce_replace {background-position:-500px -20px} +.o2k7Skin span.mce_search {background-position:-520px -20px} +.o2k7Skin span.mce_styleprops {background-position:-560px -20px} +.o2k7Skin span.mce_table {background-position:-580px -20px} +.o2k7Skin span.mce_cell_props {background-position:-600px -20px} +.o2k7Skin span.mce_delete_table {background-position:-620px -20px} +.o2k7Skin span.mce_delete_col {background-position:-640px -20px} +.o2k7Skin span.mce_delete_row {background-position:-660px -20px} +.o2k7Skin span.mce_col_after {background-position:-680px -20px} +.o2k7Skin span.mce_col_before {background-position:-700px -20px} +.o2k7Skin span.mce_row_after {background-position:-720px -20px} +.o2k7Skin span.mce_row_before {background-position:-740px -20px} +.o2k7Skin span.mce_merge_cells {background-position:-760px -20px} +.o2k7Skin span.mce_table_props {background-position:-980px -20px} +.o2k7Skin span.mce_row_props {background-position:-780px -20px} +.o2k7Skin span.mce_split_cells {background-position:-800px -20px} +.o2k7Skin span.mce_template {background-position:-820px -20px} +.o2k7Skin span.mce_visualchars {background-position:-840px -20px} +.o2k7Skin span.mce_abbr {background-position:-860px -20px} +.o2k7Skin span.mce_acronym {background-position:-880px -20px} +.o2k7Skin span.mce_attribs {background-position:-900px -20px} +.o2k7Skin span.mce_cite {background-position:-920px -20px} +.o2k7Skin span.mce_del {background-position:-940px -20px} +.o2k7Skin span.mce_ins {background-position:-960px -20px} +.o2k7Skin span.mce_pagebreak {background-position:0 -40px} +.o2k7Skin .mce_spellchecker span.mceAction {background-position:-540px -20px} diff --git a/lib/editor/tinymce/themes/advanced/skins/o2k7/ui_black.css b/lib/editor/tinymce/themes/advanced/skins/o2k7/ui_black.css index 153f0c38a6c..81dbfe4180b 100644 --- a/lib/editor/tinymce/themes/advanced/skins/o2k7/ui_black.css +++ b/lib/editor/tinymce/themes/advanced/skins/o2k7/ui_black.css @@ -1,8 +1,8 @@ -/* Black */ -.o2k7SkinBlack .mceToolbar .mceToolbarStart span, .o2k7SkinBlack .mceToolbar .mceToolbarEnd span, .o2k7SkinBlack .mceButton, .o2k7SkinBlack .mceSplitButton, .o2k7SkinBlack .mceSeparator, .o2k7SkinBlack .mceSplitButton a.mceOpen, .o2k7SkinBlack .mceListBox a.mceOpen {background-image:url(img/button_bg_black.png)} -.o2k7SkinBlack table, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack .mceMenuItemTitle span.mceText, .o2k7SkinBlack .mceStatusbar div, .o2k7SkinBlack .mceStatusbar span, .o2k7SkinBlack .mceStatusbar a {background:#535353; color:#FFF} -.o2k7SkinBlack table.mceListBoxEnabled .mceText, o2k7SkinBlack .mceListBox .mceText {background:#FFF; border:1px solid #CBCFD4; border-bottom-color:#989FA9; border-right:0} -.o2k7SkinBlack table.mceListBoxEnabled:hover .mceText, .o2k7SkinBlack .mceListBoxHover .mceText, .o2k7SkinBlack .mceListBoxSelected .mceText {background:#FFF; border:1px solid #FFBD69; border-right:0} -.o2k7SkinBlack .mceExternalToolbar, .o2k7SkinBlack .mceListBox .mceText, .o2k7SkinBlack div.mceMenu, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceFirst td, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceLast td, .o2k7SkinBlack .mceIframeContainer {border-color: #535353;} -.o2k7SkinBlack table.mceSplitButtonEnabled:hover a.mceAction, .o2k7SkinBlack .mceSplitButtonHover a.mceAction, .o2k7SkinBlack .mceSplitButtonSelected {background-image:url(img/button_bg_black.png)} +/* Black */ +.o2k7SkinBlack .mceToolbar .mceToolbarStart span, .o2k7SkinBlack .mceToolbar .mceToolbarEnd span, .o2k7SkinBlack .mceButton, .o2k7SkinBlack .mceSplitButton, .o2k7SkinBlack .mceSeparator, .o2k7SkinBlack .mceSplitButton a.mceOpen, .o2k7SkinBlack .mceListBox a.mceOpen {background-image:url(img/button_bg_black.png)} +.o2k7SkinBlack table, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack .mceMenuItemTitle span.mceText, .o2k7SkinBlack .mceStatusbar div, .o2k7SkinBlack .mceStatusbar span, .o2k7SkinBlack .mceStatusbar a {background:#535353; color:#FFF} +.o2k7SkinBlack table.mceListBoxEnabled .mceText, o2k7SkinBlack .mceListBox .mceText {background:#FFF; border:1px solid #CBCFD4; border-bottom-color:#989FA9; border-right:0} +.o2k7SkinBlack table.mceListBoxEnabled:hover .mceText, .o2k7SkinBlack .mceListBoxHover .mceText, .o2k7SkinBlack .mceListBoxSelected .mceText {background:#FFF; border:1px solid #FFBD69; border-right:0} +.o2k7SkinBlack .mceExternalToolbar, .o2k7SkinBlack .mceListBox .mceText, .o2k7SkinBlack div.mceMenu, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceFirst td, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceLast td, .o2k7SkinBlack .mceIframeContainer {border-color: #535353;} +.o2k7SkinBlack table.mceSplitButtonEnabled:hover a.mceAction, .o2k7SkinBlack .mceSplitButtonHover a.mceAction, .o2k7SkinBlack .mceSplitButtonSelected {background-image:url(img/button_bg_black.png)} .o2k7SkinBlack .mceMenu .mceMenuItemEnabled a:hover, .o2k7SkinBlack .mceMenu .mceMenuItemActive {background-color:#FFE7A1} \ No newline at end of file diff --git a/lib/editor/tinymce/themes/advanced/skins/o2k7/ui_silver.css b/lib/editor/tinymce/themes/advanced/skins/o2k7/ui_silver.css index 7fe3b45e126..e8ae844f4ae 100644 --- a/lib/editor/tinymce/themes/advanced/skins/o2k7/ui_silver.css +++ b/lib/editor/tinymce/themes/advanced/skins/o2k7/ui_silver.css @@ -1,5 +1,5 @@ -/* Silver */ -.o2k7SkinSilver .mceToolbar .mceToolbarStart span, .o2k7SkinSilver .mceButton, .o2k7SkinSilver .mceSplitButton, .o2k7SkinSilver .mceSeparator, .o2k7SkinSilver .mceSplitButton a.mceOpen, .o2k7SkinSilver .mceListBox a.mceOpen {background-image:url(img/button_bg_silver.png)} -.o2k7SkinSilver table, .o2k7SkinSilver .mceMenuItemTitle a {background:#eee} -.o2k7SkinSilver .mceListBox .mceText {background:#FFF} -.o2k7SkinSilver .mceExternalToolbar, .o2k7SkinSilver .mceListBox .mceText, .o2k7SkinSilver div.mceMenu, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceFirst td, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceLast td, .o2k7SkinSilver .mceIframeContainer {border-color: #bbb} +/* Silver */ +.o2k7SkinSilver .mceToolbar .mceToolbarStart span, .o2k7SkinSilver .mceButton, .o2k7SkinSilver .mceSplitButton, .o2k7SkinSilver .mceSeparator, .o2k7SkinSilver .mceSplitButton a.mceOpen, .o2k7SkinSilver .mceListBox a.mceOpen {background-image:url(img/button_bg_silver.png)} +.o2k7SkinSilver table, .o2k7SkinSilver .mceMenuItemTitle a {background:#eee} +.o2k7SkinSilver .mceListBox .mceText {background:#FFF} +.o2k7SkinSilver .mceExternalToolbar, .o2k7SkinSilver .mceListBox .mceText, .o2k7SkinSilver div.mceMenu, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceFirst td, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceLast td, .o2k7SkinSilver .mceIframeContainer {border-color: #bbb} diff --git a/lib/editor/tinymce/themes/advanced/source_editor.htm b/lib/editor/tinymce/themes/advanced/source_editor.htm index 553e7bb2bc7..acb0d084d85 100644 --- a/lib/editor/tinymce/themes/advanced/source_editor.htm +++ b/lib/editor/tinymce/themes/advanced/source_editor.htm @@ -1,31 +1,31 @@ - - - - {#advanced_dlg.code_title} - - - - -
    -
    {#advanced_dlg.code_title}
    - -
    - -
    - -
    - - - -
    -
    - -
    - -
    - -
    -
    -
    - - + + + + {#advanced_dlg.code_title} + + + + +
    +
    {#advanced_dlg.code_title}
    + +
    + +
    + +
    + + + +
    +
    + +
    + +
    + +
    +
    +
    + + diff --git a/lib/editor/tinymce/themes/simple/editor_template_src.js b/lib/editor/tinymce/themes/simple/editor_template_src.js index e57fe6c584d..825d0e7944b 100644 --- a/lib/editor/tinymce/themes/simple/editor_template_src.js +++ b/lib/editor/tinymce/themes/simple/editor_template_src.js @@ -1,85 +1,85 @@ -/** - * $Id$ - * - * This file is meant to showcase how to create a simple theme. The advanced - * theme is more suitable for production use. - * - * @author Moxiecode - * @copyright Copyright 2004-2008, Moxiecode Systems AB, All rights reserved. - */ - -(function() { - var DOM = tinymce.DOM; - - // Tell it to load theme specific language pack(s) - tinymce.ThemeManager.requireLangPack('simple'); - - tinymce.create('tinymce.themes.SimpleTheme', { - init : function(ed, url) { - var t = this, states = ['Bold', 'Italic', 'Underline', 'Strikethrough', 'InsertUnorderedList', 'InsertOrderedList'], s = ed.settings; - - t.editor = ed; - - ed.onInit.add(function() { - ed.onNodeChange.add(function(ed, cm) { - tinymce.each(states, function(c) { - cm.get(c.toLowerCase()).setActive(ed.queryCommandState(c)); - }); - }); - - ed.dom.loadCSS(url + "/skins/" + s.skin + "/content.css"); - }); - - DOM.loadCSS((s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : '') || url + "/skins/" + s.skin + "/ui.css"); - }, - - renderUI : function(o) { - var t = this, n = o.targetNode, ic, tb, ed = t.editor, cf = ed.controlManager, sc; - - n = DOM.insertAfter(DOM.create('span', {id : ed.id + '_container', 'class' : 'mceEditor ' + ed.settings.skin + 'SimpleSkin'}), n); - n = sc = DOM.add(n, 'table', {cellPadding : 0, cellSpacing : 0, 'class' : 'mceLayout'}); - n = tb = DOM.add(n, 'tbody'); - - // Create iframe container - n = DOM.add(tb, 'tr'); - n = ic = DOM.add(DOM.add(n, 'td'), 'div', {'class' : 'mceIframeContainer'}); - - // Create toolbar container - n = DOM.add(DOM.add(tb, 'tr', {'class' : 'last'}), 'td', {'class' : 'mceToolbar mceLast', align : 'center'}); - - // Create toolbar - tb = t.toolbar = cf.createToolbar("tools1"); - tb.add(cf.createButton('bold', {title : 'simple.bold_desc', cmd : 'Bold'})); - tb.add(cf.createButton('italic', {title : 'simple.italic_desc', cmd : 'Italic'})); - tb.add(cf.createButton('underline', {title : 'simple.underline_desc', cmd : 'Underline'})); - tb.add(cf.createButton('strikethrough', {title : 'simple.striketrough_desc', cmd : 'Strikethrough'})); - tb.add(cf.createSeparator()); - tb.add(cf.createButton('undo', {title : 'simple.undo_desc', cmd : 'Undo'})); - tb.add(cf.createButton('redo', {title : 'simple.redo_desc', cmd : 'Redo'})); - tb.add(cf.createSeparator()); - tb.add(cf.createButton('cleanup', {title : 'simple.cleanup_desc', cmd : 'mceCleanup'})); - tb.add(cf.createSeparator()); - tb.add(cf.createButton('insertunorderedlist', {title : 'simple.bullist_desc', cmd : 'InsertUnorderedList'})); - tb.add(cf.createButton('insertorderedlist', {title : 'simple.numlist_desc', cmd : 'InsertOrderedList'})); - tb.renderTo(n); - - return { - iframeContainer : ic, - editorContainer : ed.id + '_container', - sizeContainer : sc, - deltaHeight : -20 - }; - }, - - getInfo : function() { - return { - longname : 'Simple theme', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - version : tinymce.majorVersion + "." + tinymce.minorVersion - } - } - }); - - tinymce.ThemeManager.add('simple', tinymce.themes.SimpleTheme); +/** + * $Id$ + * + * This file is meant to showcase how to create a simple theme. The advanced + * theme is more suitable for production use. + * + * @author Moxiecode + * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved. + */ + +(function() { + var DOM = tinymce.DOM; + + // Tell it to load theme specific language pack(s) + tinymce.ThemeManager.requireLangPack('simple'); + + tinymce.create('tinymce.themes.SimpleTheme', { + init : function(ed, url) { + var t = this, states = ['Bold', 'Italic', 'Underline', 'Strikethrough', 'InsertUnorderedList', 'InsertOrderedList'], s = ed.settings; + + t.editor = ed; + + ed.onInit.add(function() { + ed.onNodeChange.add(function(ed, cm) { + tinymce.each(states, function(c) { + cm.get(c.toLowerCase()).setActive(ed.queryCommandState(c)); + }); + }); + + ed.dom.loadCSS(url + "/skins/" + s.skin + "/content.css"); + }); + + DOM.loadCSS((s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : '') || url + "/skins/" + s.skin + "/ui.css"); + }, + + renderUI : function(o) { + var t = this, n = o.targetNode, ic, tb, ed = t.editor, cf = ed.controlManager, sc; + + n = DOM.insertAfter(DOM.create('span', {id : ed.id + '_container', 'class' : 'mceEditor ' + ed.settings.skin + 'SimpleSkin'}), n); + n = sc = DOM.add(n, 'table', {cellPadding : 0, cellSpacing : 0, 'class' : 'mceLayout'}); + n = tb = DOM.add(n, 'tbody'); + + // Create iframe container + n = DOM.add(tb, 'tr'); + n = ic = DOM.add(DOM.add(n, 'td'), 'div', {'class' : 'mceIframeContainer'}); + + // Create toolbar container + n = DOM.add(DOM.add(tb, 'tr', {'class' : 'last'}), 'td', {'class' : 'mceToolbar mceLast', align : 'center'}); + + // Create toolbar + tb = t.toolbar = cf.createToolbar("tools1"); + tb.add(cf.createButton('bold', {title : 'simple.bold_desc', cmd : 'Bold'})); + tb.add(cf.createButton('italic', {title : 'simple.italic_desc', cmd : 'Italic'})); + tb.add(cf.createButton('underline', {title : 'simple.underline_desc', cmd : 'Underline'})); + tb.add(cf.createButton('strikethrough', {title : 'simple.striketrough_desc', cmd : 'Strikethrough'})); + tb.add(cf.createSeparator()); + tb.add(cf.createButton('undo', {title : 'simple.undo_desc', cmd : 'Undo'})); + tb.add(cf.createButton('redo', {title : 'simple.redo_desc', cmd : 'Redo'})); + tb.add(cf.createSeparator()); + tb.add(cf.createButton('cleanup', {title : 'simple.cleanup_desc', cmd : 'mceCleanup'})); + tb.add(cf.createSeparator()); + tb.add(cf.createButton('insertunorderedlist', {title : 'simple.bullist_desc', cmd : 'InsertUnorderedList'})); + tb.add(cf.createButton('insertorderedlist', {title : 'simple.numlist_desc', cmd : 'InsertOrderedList'})); + tb.renderTo(n); + + return { + iframeContainer : ic, + editorContainer : ed.id + '_container', + sizeContainer : sc, + deltaHeight : -20 + }; + }, + + getInfo : function() { + return { + longname : 'Simple theme', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + version : tinymce.majorVersion + "." + tinymce.minorVersion + } + } + }); + + tinymce.ThemeManager.add('simple', tinymce.themes.SimpleTheme); })(); \ No newline at end of file diff --git a/lib/editor/tinymce/themes/simple/langs/en.js b/lib/editor/tinymce/themes/simple/langs/en.js index 9f08f102fb8..6f095311d20 100644 --- a/lib/editor/tinymce/themes/simple/langs/en.js +++ b/lib/editor/tinymce/themes/simple/langs/en.js @@ -1,11 +1,11 @@ -tinyMCE.addI18n('en.simple',{ -bold_desc:"Bold (Ctrl+B)", -italic_desc:"Italic (Ctrl+I)", -underline_desc:"Underline (Ctrl+U)", -striketrough_desc:"Strikethrough", -bullist_desc:"Unordered list", -numlist_desc:"Ordered list", -undo_desc:"Undo (Ctrl+Z)", -redo_desc:"Redo (Ctrl+Y)", -cleanup_desc:"Cleanup messy code" +tinyMCE.addI18n('en.simple',{ +bold_desc:"Bold (Ctrl+B)", +italic_desc:"Italic (Ctrl+I)", +underline_desc:"Underline (Ctrl+U)", +striketrough_desc:"Strikethrough", +bullist_desc:"Unordered list", +numlist_desc:"Ordered list", +undo_desc:"Undo (Ctrl+Z)", +redo_desc:"Redo (Ctrl+Y)", +cleanup_desc:"Cleanup messy code" }); \ No newline at end of file diff --git a/lib/editor/tinymce/themes/simple/skins/default/content.css b/lib/editor/tinymce/themes/simple/skins/default/content.css index 2506c807ca3..783b170f70b 100644 --- a/lib/editor/tinymce/themes/simple/skins/default/content.css +++ b/lib/editor/tinymce/themes/simple/skins/default/content.css @@ -1,25 +1,25 @@ -body, td, pre { - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 10px; -} - -body { - background-color: #FFFFFF; -} - -.mceVisualAid { - border: 1px dashed #BBBBBB; -} - -/* MSIE specific */ - -* html body { - scrollbar-3dlight-color: #F0F0EE; - scrollbar-arrow-color: #676662; - scrollbar-base-color: #F0F0EE; - scrollbar-darkshadow-color: #DDDDDD; - scrollbar-face-color: #E0E0DD; - scrollbar-highlight-color: #F0F0EE; - scrollbar-shadow-color: #F0F0EE; - scrollbar-track-color: #F5F5F5; -} +body, td, pre { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; +} + +body { + background-color: #FFFFFF; +} + +.mceVisualAid { + border: 1px dashed #BBBBBB; +} + +/* MSIE specific */ + +* html body { + scrollbar-3dlight-color: #F0F0EE; + scrollbar-arrow-color: #676662; + scrollbar-base-color: #F0F0EE; + scrollbar-darkshadow-color: #DDDDDD; + scrollbar-face-color: #E0E0DD; + scrollbar-highlight-color: #F0F0EE; + scrollbar-shadow-color: #F0F0EE; + scrollbar-track-color: #F5F5F5; +} diff --git a/lib/editor/tinymce/themes/simple/skins/default/ui.css b/lib/editor/tinymce/themes/simple/skins/default/ui.css index 076fe84e344..32feae628d1 100644 --- a/lib/editor/tinymce/themes/simple/skins/default/ui.css +++ b/lib/editor/tinymce/themes/simple/skins/default/ui.css @@ -1,32 +1,32 @@ -/* Reset */ -.defaultSimpleSkin table, .defaultSimpleSkin tbody, .defaultSimpleSkin a, .defaultSimpleSkin img, .defaultSimpleSkin tr, .defaultSimpleSkin div, .defaultSimpleSkin td, .defaultSimpleSkin iframe, .defaultSimpleSkin span, .defaultSimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000} - -/* Containers */ -.defaultSimpleSkin {position:relative} -.defaultSimpleSkin table.mceLayout {background:#F0F0EE; border:1px solid #CCC;} -.defaultSimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #CCC;} -.defaultSimpleSkin .mceToolbar {height:24px;} - -/* Layout */ -.defaultSimpleSkin span.mceIcon, .defaultSimpleSkin img.mceIcon {display:block; width:20px; height:20px} -.defaultSimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} - -/* Button */ -.defaultSimpleSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px} -.defaultSimpleSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0} -.defaultSimpleSkin a.mceButtonActive {border:1px solid #0A246A; background-color:#C2CBE0} -.defaultSimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} - -/* Separator */ -.defaultSimpleSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:0 2px 0 4px} - -/* Theme */ -.defaultSimpleSkin span.mce_bold {background-position:0 0} -.defaultSimpleSkin span.mce_italic {background-position:-60px 0} -.defaultSimpleSkin span.mce_underline {background-position:-140px 0} -.defaultSimpleSkin span.mce_strikethrough {background-position:-120px 0} -.defaultSimpleSkin span.mce_undo {background-position:-160px 0} -.defaultSimpleSkin span.mce_redo {background-position:-100px 0} -.defaultSimpleSkin span.mce_cleanup {background-position:-40px 0} -.defaultSimpleSkin span.mce_insertunorderedlist {background-position:-20px 0} -.defaultSimpleSkin span.mce_insertorderedlist {background-position:-80px 0} +/* Reset */ +.defaultSimpleSkin table, .defaultSimpleSkin tbody, .defaultSimpleSkin a, .defaultSimpleSkin img, .defaultSimpleSkin tr, .defaultSimpleSkin div, .defaultSimpleSkin td, .defaultSimpleSkin iframe, .defaultSimpleSkin span, .defaultSimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000} + +/* Containers */ +.defaultSimpleSkin {position:relative} +.defaultSimpleSkin table.mceLayout {background:#F0F0EE; border:1px solid #CCC;} +.defaultSimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #CCC;} +.defaultSimpleSkin .mceToolbar {height:24px;} + +/* Layout */ +.defaultSimpleSkin span.mceIcon, .defaultSimpleSkin img.mceIcon {display:block; width:20px; height:20px} +.defaultSimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} + +/* Button */ +.defaultSimpleSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px} +.defaultSimpleSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0} +.defaultSimpleSkin a.mceButtonActive {border:1px solid #0A246A; background-color:#C2CBE0} +.defaultSimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} + +/* Separator */ +.defaultSimpleSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:0 2px 0 4px} + +/* Theme */ +.defaultSimpleSkin span.mce_bold {background-position:0 0} +.defaultSimpleSkin span.mce_italic {background-position:-60px 0} +.defaultSimpleSkin span.mce_underline {background-position:-140px 0} +.defaultSimpleSkin span.mce_strikethrough {background-position:-120px 0} +.defaultSimpleSkin span.mce_undo {background-position:-160px 0} +.defaultSimpleSkin span.mce_redo {background-position:-100px 0} +.defaultSimpleSkin span.mce_cleanup {background-position:-40px 0} +.defaultSimpleSkin span.mce_insertunorderedlist {background-position:-20px 0} +.defaultSimpleSkin span.mce_insertorderedlist {background-position:-80px 0} diff --git a/lib/editor/tinymce/themes/simple/skins/o2k7/content.css b/lib/editor/tinymce/themes/simple/skins/o2k7/content.css index 595809fa617..e10558f9d4e 100644 --- a/lib/editor/tinymce/themes/simple/skins/o2k7/content.css +++ b/lib/editor/tinymce/themes/simple/skins/o2k7/content.css @@ -1,17 +1,17 @@ -body, td, pre {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} - -body {background: #FFF;} -.mceVisualAid {border: 1px dashed #BBB;} - -/* IE */ - -* html body { -scrollbar-3dlight-color: #F0F0EE; -scrollbar-arrow-color: #676662; -scrollbar-base-color: #F0F0EE; -scrollbar-darkshadow-color: #DDDDDD; -scrollbar-face-color: #E0E0DD; -scrollbar-highlight-color: #F0F0EE; -scrollbar-shadow-color: #F0F0EE; -scrollbar-track-color: #F5F5F5; -} +body, td, pre {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} + +body {background: #FFF;} +.mceVisualAid {border: 1px dashed #BBB;} + +/* IE */ + +* html body { +scrollbar-3dlight-color: #F0F0EE; +scrollbar-arrow-color: #676662; +scrollbar-base-color: #F0F0EE; +scrollbar-darkshadow-color: #DDDDDD; +scrollbar-face-color: #E0E0DD; +scrollbar-highlight-color: #F0F0EE; +scrollbar-shadow-color: #F0F0EE; +scrollbar-track-color: #F5F5F5; +} diff --git a/lib/editor/tinymce/themes/simple/skins/o2k7/ui.css b/lib/editor/tinymce/themes/simple/skins/o2k7/ui.css index cf6c35d1093..021d650f7df 100644 --- a/lib/editor/tinymce/themes/simple/skins/o2k7/ui.css +++ b/lib/editor/tinymce/themes/simple/skins/o2k7/ui.css @@ -1,35 +1,35 @@ -/* Reset */ -.o2k7SimpleSkin table, .o2k7SimpleSkin tbody, .o2k7SimpleSkin a, .o2k7SimpleSkin img, .o2k7SimpleSkin tr, .o2k7SimpleSkin div, .o2k7SimpleSkin td, .o2k7SimpleSkin iframe, .o2k7SimpleSkin span, .o2k7SimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000} - -/* Containers */ -.o2k7SimpleSkin {position:relative} -.o2k7SimpleSkin table.mceLayout {background:#E5EFFD; border:1px solid #ABC6DD;} -.o2k7SimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #ABC6DD;} -.o2k7SimpleSkin .mceToolbar {height:26px;} - -/* Layout */ -.o2k7SimpleSkin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; } -.o2k7SimpleSkin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px} -.o2k7SimpleSkin span.mceIcon, .o2k7SimpleSkin img.mceIcon {display:block; width:20px; height:20px} -.o2k7SimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} - -/* Button */ -.o2k7SimpleSkin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px} -.o2k7SimpleSkin a.mceButton span, .o2k7SimpleSkin a.mceButton img {margin:1px 0 0 1px} -.o2k7SimpleSkin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px} -.o2k7SimpleSkin a.mceButtonActive {background-position:0 -44px} -.o2k7SimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} - -/* Separator */ -.o2k7SimpleSkin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px} - -/* Theme */ -.o2k7SimpleSkin span.mce_bold {background-position:0 0} -.o2k7SimpleSkin span.mce_italic {background-position:-60px 0} -.o2k7SimpleSkin span.mce_underline {background-position:-140px 0} -.o2k7SimpleSkin span.mce_strikethrough {background-position:-120px 0} -.o2k7SimpleSkin span.mce_undo {background-position:-160px 0} -.o2k7SimpleSkin span.mce_redo {background-position:-100px 0} -.o2k7SimpleSkin span.mce_cleanup {background-position:-40px 0} -.o2k7SimpleSkin span.mce_insertunorderedlist {background-position:-20px 0} -.o2k7SimpleSkin span.mce_insertorderedlist {background-position:-80px 0} +/* Reset */ +.o2k7SimpleSkin table, .o2k7SimpleSkin tbody, .o2k7SimpleSkin a, .o2k7SimpleSkin img, .o2k7SimpleSkin tr, .o2k7SimpleSkin div, .o2k7SimpleSkin td, .o2k7SimpleSkin iframe, .o2k7SimpleSkin span, .o2k7SimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000} + +/* Containers */ +.o2k7SimpleSkin {position:relative} +.o2k7SimpleSkin table.mceLayout {background:#E5EFFD; border:1px solid #ABC6DD;} +.o2k7SimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #ABC6DD;} +.o2k7SimpleSkin .mceToolbar {height:26px;} + +/* Layout */ +.o2k7SimpleSkin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; } +.o2k7SimpleSkin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px} +.o2k7SimpleSkin span.mceIcon, .o2k7SimpleSkin img.mceIcon {display:block; width:20px; height:20px} +.o2k7SimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} + +/* Button */ +.o2k7SimpleSkin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px} +.o2k7SimpleSkin a.mceButton span, .o2k7SimpleSkin a.mceButton img {margin:1px 0 0 1px} +.o2k7SimpleSkin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px} +.o2k7SimpleSkin a.mceButtonActive {background-position:0 -44px} +.o2k7SimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} + +/* Separator */ +.o2k7SimpleSkin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px} + +/* Theme */ +.o2k7SimpleSkin span.mce_bold {background-position:0 0} +.o2k7SimpleSkin span.mce_italic {background-position:-60px 0} +.o2k7SimpleSkin span.mce_underline {background-position:-140px 0} +.o2k7SimpleSkin span.mce_strikethrough {background-position:-120px 0} +.o2k7SimpleSkin span.mce_undo {background-position:-160px 0} +.o2k7SimpleSkin span.mce_redo {background-position:-100px 0} +.o2k7SimpleSkin span.mce_cleanup {background-position:-40px 0} +.o2k7SimpleSkin span.mce_insertunorderedlist {background-position:-20px 0} +.o2k7SimpleSkin span.mce_insertorderedlist {background-position:-80px 0} diff --git a/lib/editor/tinymce/utils/editable_selects.js b/lib/editor/tinymce/utils/editable_selects.js index 1959f6c1de1..e0a429a91bb 100644 --- a/lib/editor/tinymce/utils/editable_selects.js +++ b/lib/editor/tinymce/utils/editable_selects.js @@ -1,69 +1,69 @@ -/** - * $Id$ - * - * Makes select boxes editable. - * - * @author Moxiecode - * @copyright Copyright 2004-2008, Moxiecode Systems AB, All rights reserved. - */ - -var TinyMCE_EditableSelects = { - editSelectElm : null, - - init : function() { - var nl = document.getElementsByTagName("select"), i, d = document, o; - - for (i=0; i'; - h += ' '; - - return h; -} - -function updateColor(img_id, form_element_id) { - document.getElementById(img_id).style.backgroundColor = document.forms[0].elements[form_element_id].value; -} - -function setBrowserDisabled(id, state) { - var img = document.getElementById(id); - var lnk = document.getElementById(id + "_link"); - - if (lnk) { - if (state) { - lnk.setAttribute("realhref", lnk.getAttribute("href")); - lnk.removeAttribute("href"); - tinyMCEPopup.dom.addClass(img, 'disabled'); - } else { - if (lnk.getAttribute("realhref")) - lnk.setAttribute("href", lnk.getAttribute("realhref")); - - tinyMCEPopup.dom.removeClass(img, 'disabled'); - } - } -} - -function getBrowserHTML(id, target_form_element, type, prefix) { - var option = prefix + "_" + type + "_browser_callback", cb, html; - - cb = tinyMCEPopup.getParam(option, tinyMCEPopup.getParam("file_browser_callback")); - - if (!cb) - return ""; - - html = ""; - if (id=='filebrowser') { - // for moodlemedia plugin - html += ''; - html += tinyMCEPopup.getLang('browsemedia'); - html += ''; - } else if (id=='srcbrowser') { - // for advimage plugin - html += ''; - html += tinyMCEPopup.getLang('browseimage'); - html += ''; - } else { - html += ''; - html += ' '; - } - - return html; -} - -function openBrowser(img_id, target_form_element, type, option) { - var img = document.getElementById(img_id); - - if (!img || img.className != "mceButtonDisabled") - tinyMCEPopup.openBrowser(target_form_element, type, option); -} - -function selectByValue(form_obj, field_name, value, add_custom, ignore_case) { - if (!form_obj || !form_obj.elements[field_name]) - return; - - var sel = form_obj.elements[field_name]; - - var found = false; - for (var i=0; i'; + h += ' '; + + return h; +} + +function updateColor(img_id, form_element_id) { + document.getElementById(img_id).style.backgroundColor = document.forms[0].elements[form_element_id].value; +} + +function setBrowserDisabled(id, state) { + var img = document.getElementById(id); + var lnk = document.getElementById(id + "_link"); + + if (lnk) { + if (state) { + lnk.setAttribute("realhref", lnk.getAttribute("href")); + lnk.removeAttribute("href"); + tinyMCEPopup.dom.addClass(img, 'disabled'); + } else { + if (lnk.getAttribute("realhref")) + lnk.setAttribute("href", lnk.getAttribute("realhref")); + + tinyMCEPopup.dom.removeClass(img, 'disabled'); + } + } +} + +function getBrowserHTML(id, target_form_element, type, prefix) { + var option = prefix + "_" + type + "_browser_callback", cb, html; + + cb = tinyMCEPopup.getParam(option, tinyMCEPopup.getParam("file_browser_callback")); + + if (!cb) + return ""; + + html = ""; + if (id=='filebrowser') { + // for moodlemedia plugin + html += ''; + html += tinyMCEPopup.getLang('browsemedia'); + html += ''; + } else if (id=='srcbrowser') { + // for advimage plugin + html += ''; + html += tinyMCEPopup.getLang('browseimage'); + html += ''; + } else { + html += ''; + html += ' '; + } + + return html; +} + +function openBrowser(img_id, target_form_element, type, option) { + var img = document.getElementById(img_id); + + if (!img || img.className != "mceButtonDisabled") + tinyMCEPopup.openBrowser(target_form_element, type, option); +} + +function selectByValue(form_obj, field_name, value, add_custom, ignore_case) { + if (!form_obj || !form_obj.elements[field_name]) + return; + + var sel = form_obj.elements[field_name]; + + var found = false; + for (var i=0; i parseInt(v)) - st = this.mark(f, n); - } - } - - return st; - }, - - hasClass : function(n, c, d) { - return new RegExp('\\b' + c + (d ? '[0-9]+' : '') + '\\b', 'g').test(n.className); - }, - - getNum : function(n, c) { - c = n.className.match(new RegExp('\\b' + c + '([0-9]+)\\b', 'g'))[0]; - c = c.replace(/[^0-9]/g, ''); - - return c; - }, - - addClass : function(n, c, b) { - var o = this.removeClass(n, c); - n.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c; - }, - - removeClass : function(n, c) { - c = n.className.replace(new RegExp("(^|\\s+)" + c + "(\\s+|$)"), ' '); - return n.className = c != ' ' ? c : ''; - }, - - tags : function(f, s) { - return f.getElementsByTagName(s); - }, - - mark : function(f, n) { - var s = this.settings; - - this.addClass(n, s.invalid_cls); - this.markLabels(f, n, s.invalid_cls); - - return false; - }, - - markLabels : function(f, n, ic) { - var nl, i; - - nl = this.tags(f, "label"); - for (i=0; i parseInt(v)) + st = this.mark(f, n); + } + } + + return st; + }, + + hasClass : function(n, c, d) { + return new RegExp('\\b' + c + (d ? '[0-9]+' : '') + '\\b', 'g').test(n.className); + }, + + getNum : function(n, c) { + c = n.className.match(new RegExp('\\b' + c + '([0-9]+)\\b', 'g'))[0]; + c = c.replace(/[^0-9]/g, ''); + + return c; + }, + + addClass : function(n, c, b) { + var o = this.removeClass(n, c); + n.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c; + }, + + removeClass : function(n, c) { + c = n.className.replace(new RegExp("(^|\\s+)" + c + "(\\s+|$)"), ' '); + return n.className = c != ' ' ? c : ''; + }, + + tags : function(f, s) { + return f.getElementsByTagName(s); + }, + + mark : function(f, n) { + var s = this.settings; + + this.addClass(n, s.invalid_cls); + this.markLabels(f, n, s.invalid_cls); + + return false; + }, + + markLabels : function(f, n, ic) { + var nl, i; + + nl = this.tags(f, "label"); + for (i=0; i -* -* The majority of this is _NOT_ my code. I simply ported it from the -* PERL Spreadsheet::WriteExcel module. -* -* The author of the Spreadsheet::WriteExcel module is John McNamara -* -* -* I _DO_ maintain this code, and John McNamara has nothing to do with the -* porting of this code to PHP. Any questions directly related to this -* class library should be directed to me. -* -* License Information: -* -* Spreadsheet::WriteExcel: A library for generating Excel Spreadsheets -* Copyright (C) 2002 Xavier Noguer xnoguer@rezebra.com -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; either -* version 2.1 of the License, or (at your option) any later version. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/** -* Class for writing Excel BIFF records. -* -* From "MICROSOFT EXCEL BINARY FILE FORMAT" by Mark O'Brien (Microsoft Corporation): -* -* BIFF (BInary File Format) is the file format in which Excel documents are -* saved on disk. A BIFF file is a complete description of an Excel document. -* BIFF files consist of sequences of variable-length records. There are many -* different types of BIFF records. For example, one record type describes a -* formula entered into a cell; one describes the size and location of a -* window into a document; another describes a picture format. -* -* @author Xavier Noguer -* @package Spreadsheet_WriteExcel -*/ - -class BIFFWriter -{ - var $_BIFF_version = 0x0500; - -/** -* Constructor -* -* @access public -*/ - function BIFFwriter() - { - // The byte order of this architecture. 0 => little endian, 1 => big endian - $this->_byte_order = ''; - // The string containing the data of the BIFF stream - $this->_data = ''; - // Should be the same as strlen($this->_data) - $this->_datasize = 0; - // The maximun length for a BIFF record. See _add_continue() - $this->_limit = 2080; - // Set the byte order - $this->_set_byte_order(); - } - -/** -* Determine the byte order and store it as class data to avoid -* recalculating it for each call to new(). -* -* @access private -*/ - function _set_byte_order() - { - if ($this->_byte_order == '') - { - // Check if "pack" gives the required IEEE 64bit float - $teststr = pack("d", 1.2345); - $number = pack("C8", 0x8D, 0x97, 0x6E, 0x12, 0x83, 0xC0, 0xF3, 0x3F); - if ($number == $teststr) { - $byte_order = 0; // Little Endian - } - elseif ($number == strrev($teststr)){ - $byte_order = 1; // Big Endian - } - else { - // Give up. I'll fix this in a later version. - die("Required floating point format not supported ". - "on this platform. See the portability section ". - "of the documentation." - ); - } - } - $this->_byte_order = $byte_order; - } - -/** -* General storage function -* -* @param string $data binary data to prepend -* @access private -*/ - function _prepend($data) - { - if (strlen($data) > $this->_limit) { - $data = $this->_add_continue($data); - } - $this->_data = $data.$this->_data; - $this->_datasize += strlen($data); - } - -/** -* General storage function -* -* @param string $data binary data to append -* @access private -*/ - function _append($data) - { - if (strlen($data) > $this->_limit) { - $data = $this->_add_continue($data); - } - $this->_data = $this->_data.$data; - $this->_datasize += strlen($data); - } - -/** -* Writes Excel BOF record to indicate the beginning of a stream or -* sub-stream in the BIFF file. -* -* @param integer $type type of BIFF file to write: 0x0005 Workbook, 0x0010 Worksheet. -* @access private -*/ - function _store_bof($type) - { - $record = 0x0809; // Record identifier - $length = 0x0008; // Number of bytes to follow - $version = $this->_BIFF_version; - - // According to the SDK $build and $year should be set to zero. - // However, this throws a warning in Excel 5. So, use these - // magic numbers. - $build = 0x096C; - $year = 0x07C9; - - $header = pack("vv", $record, $length); - $data = pack("vvvv", $version, $type, $build, $year); - $this->_prepend($header.$data); - } - -/** -* Writes Excel EOF record to indicate the end of a BIFF stream. -* -* @access private -*/ - function _store_eof() - { - $record = 0x000A; // Record identifier - $length = 0x0000; // Number of bytes to follow - $header = pack("vv", $record, $length); - $this->_append($header); - } - -/** -* Excel limits the size of BIFF records. In Excel 5 the limit is 2084 bytes. In -* Excel 97 the limit is 8228 bytes. Records that are longer than these limits -* must be split up into CONTINUE blocks. -* -* This function takes a long BIFF record and inserts CONTINUE records as -* necessary. -* -* @param string $data The original binary data to be written -* @return string A very convenient string of continue blocks -* @access private -*/ - function _add_continue($data) - { - $limit = $this->_limit; - $record = 0x003C; // Record identifier - - // The first 2080/8224 bytes remain intact. However, we have to change - // the length field of the record. - $tmp = substr($data, 0, 2).pack("v", $limit-4).substr($data, 4, $limit - 4); - - $header = pack("vv", $record, $limit); // Headers for continue records - - // Retrieve chunks of 2080/8224 bytes +4 for the header. - for($i = $limit; $i < strlen($data) - $limit; $i += $limit) - { - $tmp .= $header; - $tmp .= substr($data, $i, $limit); - } - - // Retrieve the last chunk of data - $header = pack("vv", $record, strlen($data) - $i); - $tmp .= $header; - $tmp .= substr($data,$i,strlen($data) - $i); - - return($tmp); - } -} + +* +* The majority of this is _NOT_ my code. I simply ported it from the +* PERL Spreadsheet::WriteExcel module. +* +* The author of the Spreadsheet::WriteExcel module is John McNamara +* +* +* I _DO_ maintain this code, and John McNamara has nothing to do with the +* porting of this code to PHP. Any questions directly related to this +* class library should be directed to me. +* +* License Information: +* +* Spreadsheet::WriteExcel: A library for generating Excel Spreadsheets +* Copyright (C) 2002 Xavier Noguer xnoguer@rezebra.com +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2.1 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/** +* Class for writing Excel BIFF records. +* +* From "MICROSOFT EXCEL BINARY FILE FORMAT" by Mark O'Brien (Microsoft Corporation): +* +* BIFF (BInary File Format) is the file format in which Excel documents are +* saved on disk. A BIFF file is a complete description of an Excel document. +* BIFF files consist of sequences of variable-length records. There are many +* different types of BIFF records. For example, one record type describes a +* formula entered into a cell; one describes the size and location of a +* window into a document; another describes a picture format. +* +* @author Xavier Noguer +* @package Spreadsheet_WriteExcel +*/ + +class BIFFWriter +{ + var $_BIFF_version = 0x0500; + +/** +* Constructor +* +* @access public +*/ + function BIFFwriter() + { + // The byte order of this architecture. 0 => little endian, 1 => big endian + $this->_byte_order = ''; + // The string containing the data of the BIFF stream + $this->_data = ''; + // Should be the same as strlen($this->_data) + $this->_datasize = 0; + // The maximun length for a BIFF record. See _add_continue() + $this->_limit = 2080; + // Set the byte order + $this->_set_byte_order(); + } + +/** +* Determine the byte order and store it as class data to avoid +* recalculating it for each call to new(). +* +* @access private +*/ + function _set_byte_order() + { + if ($this->_byte_order == '') + { + // Check if "pack" gives the required IEEE 64bit float + $teststr = pack("d", 1.2345); + $number = pack("C8", 0x8D, 0x97, 0x6E, 0x12, 0x83, 0xC0, 0xF3, 0x3F); + if ($number == $teststr) { + $byte_order = 0; // Little Endian + } + elseif ($number == strrev($teststr)){ + $byte_order = 1; // Big Endian + } + else { + // Give up. I'll fix this in a later version. + die("Required floating point format not supported ". + "on this platform. See the portability section ". + "of the documentation." + ); + } + } + $this->_byte_order = $byte_order; + } + +/** +* General storage function +* +* @param string $data binary data to prepend +* @access private +*/ + function _prepend($data) + { + if (strlen($data) > $this->_limit) { + $data = $this->_add_continue($data); + } + $this->_data = $data.$this->_data; + $this->_datasize += strlen($data); + } + +/** +* General storage function +* +* @param string $data binary data to append +* @access private +*/ + function _append($data) + { + if (strlen($data) > $this->_limit) { + $data = $this->_add_continue($data); + } + $this->_data = $this->_data.$data; + $this->_datasize += strlen($data); + } + +/** +* Writes Excel BOF record to indicate the beginning of a stream or +* sub-stream in the BIFF file. +* +* @param integer $type type of BIFF file to write: 0x0005 Workbook, 0x0010 Worksheet. +* @access private +*/ + function _store_bof($type) + { + $record = 0x0809; // Record identifier + $length = 0x0008; // Number of bytes to follow + $version = $this->_BIFF_version; + + // According to the SDK $build and $year should be set to zero. + // However, this throws a warning in Excel 5. So, use these + // magic numbers. + $build = 0x096C; + $year = 0x07C9; + + $header = pack("vv", $record, $length); + $data = pack("vvvv", $version, $type, $build, $year); + $this->_prepend($header.$data); + } + +/** +* Writes Excel EOF record to indicate the end of a BIFF stream. +* +* @access private +*/ + function _store_eof() + { + $record = 0x000A; // Record identifier + $length = 0x0000; // Number of bytes to follow + $header = pack("vv", $record, $length); + $this->_append($header); + } + +/** +* Excel limits the size of BIFF records. In Excel 5 the limit is 2084 bytes. In +* Excel 97 the limit is 8228 bytes. Records that are longer than these limits +* must be split up into CONTINUE blocks. +* +* This function takes a long BIFF record and inserts CONTINUE records as +* necessary. +* +* @param string $data The original binary data to be written +* @return string A very convenient string of continue blocks +* @access private +*/ + function _add_continue($data) + { + $limit = $this->_limit; + $record = 0x003C; // Record identifier + + // The first 2080/8224 bytes remain intact. However, we have to change + // the length field of the record. + $tmp = substr($data, 0, 2).pack("v", $limit-4).substr($data, 4, $limit - 4); + + $header = pack("vv", $record, $limit); // Headers for continue records + + // Retrieve chunks of 2080/8224 bytes +4 for the header. + for($i = $limit; $i < strlen($data) - $limit; $i += $limit) + { + $tmp .= $header; + $tmp .= substr($data, $i, $limit); + } + + // Retrieve the last chunk of data + $header = pack("vv", $record, strlen($data) - $i); + $tmp .= $header; + $tmp .= substr($data,$i,strlen($data) - $i); + + return($tmp); + } +} ?> \ No newline at end of file diff --git a/lib/excel/Format.php b/lib/excel/Format.php index ff8cc7e14f2..76331ba490b 100644 --- a/lib/excel/Format.php +++ b/lib/excel/Format.php @@ -1,637 +1,637 @@ - -* -* The majority of this is _NOT_ my code. I simply ported it from the -* PERL Spreadsheet::WriteExcel module. -* -* The author of the Spreadsheet::WriteExcel module is John McNamara -* -* -* I _DO_ maintain this code, and John McNamara has nothing to do with the -* porting of this code to PHP. Any questions directly related to this -* class library should be directed to me. -* -* License Information: -* -* Spreadsheet::WriteExcel: A library for generating Excel Spreadsheets -* Copyright (C) 2002 Xavier Noguer xnoguer@rezebra.com -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; either -* version 2.1 of the License, or (at your option) any later version. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/** -* Class for generating Excel XF records (formats) -* -* @author Xavier Noguer -* @package Spreadsheet_WriteExcel -*/ - -class Format -{ - /** - * Constructor - * - * @access public - * @param integer $index the XF index for the format. - * @param array $properties array with properties to be set on initialization. - */ - function Format($index = 0,$properties = array()) - { - $this->xf_index = $index; - - $this->font_index = 0; - $this->font = 'Arial'; - $this->size = 10; - $this->bold = 0x0190; - $this->_italic = 0; - $this->color = 0x7FFF; - $this->_underline = 0; - $this->font_strikeout = 0; - $this->font_outline = 0; - $this->font_shadow = 0; - $this->font_script = 0; - $this->font_family = 0; - $this->font_charset = 0; - - $this->_num_format = 0; - - $this->hidden = 0; - $this->locked = 1; - - $this->_text_h_align = 0; - $this->_text_wrap = 0; - $this->text_v_align = 2; - $this->text_justlast = 0; - $this->rotation = 0; - - $this->fg_color = 0x40; - $this->bg_color = 0x41; - - $this->pattern = 0; - - $this->bottom = 0; - $this->top = 0; - $this->left = 0; - $this->right = 0; - - $this->bottom_color = 0x40; - $this->top_color = 0x40; - $this->left_color = 0x40; - $this->right_color = 0x40; - - // Set properties passed to Workbook::add_format() - foreach($properties as $property => $value) - { - if(method_exists($this,"set_$property")) - { - $aux = 'set_'.$property; - $this->$aux($value); - } - } - } - - /** - * Generate an Excel BIFF XF record (style or cell). - * - * @param string $style The type of the XF record ('style' or 'cell'). - * @return string The XF record - */ - function get_xf($style) - { - // Set the type of the XF record and some of the attributes. - if ($style == "style") { - $style = 0xFFF5; - } - else { - $style = $this->locked; - $style |= $this->hidden << 1; - } - - // Flags to indicate if attributes have been set. - $atr_num = ($this->_num_format != 0)?1:0; - $atr_fnt = ($this->font_index != 0)?1:0; - $atr_alc = ($this->_text_wrap)?1:0; - $atr_bdr = ($this->bottom || - $this->top || - $this->left || - $this->right)?1:0; - $atr_pat = (($this->fg_color != 0x40) || - ($this->bg_color != 0x41) || - $this->pattern)?1:0; - $atr_prot = 0; - - // Zero the default border colour if the border has not been set. - if ($this->bottom == 0) { - $this->bottom_color = 0; - } - if ($this->top == 0) { - $this->top_color = 0; - } - if ($this->right == 0) { - $this->right_color = 0; - } - if ($this->left == 0) { - $this->left_color = 0; - } - - $record = 0x00E0; // Record identifier - $length = 0x0010; // Number of bytes to follow - - $ifnt = $this->font_index; // Index to FONT record - $ifmt = $this->_num_format; // Index to FORMAT record - - $align = $this->_text_h_align; // Alignment - $align |= $this->_text_wrap << 3; - $align |= $this->text_v_align << 4; - $align |= $this->text_justlast << 7; - $align |= $this->rotation << 8; - $align |= $atr_num << 10; - $align |= $atr_fnt << 11; - $align |= $atr_alc << 12; - $align |= $atr_bdr << 13; - $align |= $atr_pat << 14; - $align |= $atr_prot << 15; - - $icv = $this->fg_color; // fg and bg pattern colors - $icv |= $this->bg_color << 7; - - $fill = $this->pattern; // Fill and border line style - $fill |= $this->bottom << 6; - $fill |= $this->bottom_color << 9; - - $border1 = $this->top; // Border line style and color - $border1 |= $this->left << 3; - $border1 |= $this->right << 6; - $border1 |= $this->top_color << 9; - - $border2 = $this->left_color; // Border color - $border2 |= $this->right_color << 7; - - $header = pack("vv", $record, $length); - $data = pack("vvvvvvvv", $ifnt, $ifmt, $style, $align, - $icv, $fill, - $border1, $border2); - return($header.$data); - } - - /** - * Generate an Excel BIFF FONT record. - * - * @see Workbook::_store_all_fonts() - * @return string The FONT record - */ - function get_font() - { - $dyHeight = $this->size * 20; // Height of font (1/20 of a point) - $icv = $this->color; // Index to color palette - $bls = $this->bold; // Bold style - $sss = $this->font_script; // Superscript/subscript - $uls = $this->_underline; // Underline - $bFamily = $this->font_family; // Font family - $bCharSet = $this->font_charset; // Character set - $rgch = $this->font; // Font name - - $cch = strlen($rgch); // Length of font name - $record = 0x31; // Record identifier - $length = 0x0F + $cch; // Record length - $reserved = 0x00; // Reserved - $grbit = 0x00; // Font attributes - if ($this->_italic) { - $grbit |= 0x02; - } - if ($this->font_strikeout) { - $grbit |= 0x08; - } - if ($this->font_outline) { - $grbit |= 0x10; - } - if ($this->font_shadow) { - $grbit |= 0x20; - } - - $header = pack("vv", $record, $length); - $data = pack("vvvvvCCCCC", $dyHeight, $grbit, $icv, $bls, - $sss, $uls, $bFamily, - $bCharSet, $reserved, $cch); - return($header . $data. $this->font); - } - - /** - * Returns a unique hash key for a font. Used by Workbook->_store_all_fonts() - * - * The elements that form the key are arranged to increase the probability of - * generating a unique key. Elements that hold a large range of numbers - * (eg. _color) are placed between two binary elements such as _italic - * - * @return string A key for this font - */ - function get_font_key() - { - $key = "$this->font$this->size"; - $key .= "$this->font_script$this->_underline"; - $key .= "$this->font_strikeout$this->bold$this->font_outline"; - $key .= "$this->font_family$this->font_charset"; - $key .= "$this->font_shadow$this->color$this->_italic"; - $key = str_replace(" ","_",$key); - return ($key); - } - - /** - * Returns the index used by Worksheet->_XF() - * - * @return integer The index for the XF record - */ - function get_xf_index() - { - return($this->xf_index); - } - - /** - * Used in conjunction with the set_xxx_color methods to convert a color - * string into a number. Color range is 0..63 but we will restrict it - * to 8..63 to comply with Gnumeric. Colors 0..7 are repeated in 8..15. - * - * @param string $name_color name of the color (i.e.: 'blue', 'red', etc..). Optional. - * @return integer The color index - */ - function _get_color($name_color = '') - { - $colors = array( - 'aqua' => 0x0F, - 'cyan' => 0x0F, - 'black' => 0x08, - 'blue' => 0x0C, - 'brown' => 0x10, - 'magenta' => 0x0E, - 'fuchsia' => 0x0E, - 'gray' => 0x17, - 'grey' => 0x17, - 'green' => 0x11, - 'lime' => 0x0B, - 'navy' => 0x12, - 'orange' => 0x35, - 'purple' => 0x14, - 'red' => 0x0A, - 'silver' => 0x16, - 'white' => 0x09, - 'yellow' => 0x0D - ); - - // Return the default color, 0x7FFF, if undef, - if($name_color == '') { - return(0x7FFF); - } - - // or the color string converted to an integer, - if(isset($colors[$name_color])) { - return($colors[$name_color]); - } - - // or the default color if string is unrecognised, - if(preg_match("/\D/",$name_color)) { - return(0x7FFF); - } - - // or an index < 8 mapped into the correct range, - if($name_color < 8) { - return($name_color + 8); - } - - // or the default color if arg is outside range, - if($name_color > 63) { - return(0x7FFF); - } - - // or an integer in the valid range - return($name_color); - } - - /** - * Set cell alignment. - * - * @access public - * @param string $location alignment for the cell ('left', 'right', etc...). - */ - function set_align($location) - { - if (preg_match("/\d/",$location)) { - return; // Ignore numbers - } - - $location = strtolower($location); - - if ($location == 'left') - $this->_text_h_align = 1; - if ($location == 'centre') - $this->_text_h_align = 2; - if ($location == 'center') - $this->_text_h_align = 2; - if ($location == 'right') - $this->_text_h_align = 3; - if ($location == 'fill') - $this->_text_h_align = 4; - if ($location == 'justify') - $this->_text_h_align = 5; - if ($location == 'merge') - $this->_text_h_align = 6; - if ($location == 'equal_space') // For T.K. - $this->_text_h_align = 7; - if ($location == 'top') - $this->text_v_align = 0; - if ($location == 'vcentre') - $this->text_v_align = 1; - if ($location == 'vcenter') - $this->text_v_align = 1; - if ($location == 'bottom') - $this->text_v_align = 2; - if ($location == 'vjustify') - $this->text_v_align = 3; - if ($location == 'vequal_space') // For T.K. - $this->text_v_align = 4; - } - - /** - * This is an alias for the unintuitive set_align('merge') - * - * @access public - */ - function set_merge() - { - $this->set_align('merge'); - } - - /** - * Bold has a range 0x64..0x3E8. - * 0x190 is normal. 0x2BC is bold. - * - * @access public - * @param integer $weight Weight for the text, 0 maps to 0x190, 1 maps to 0x2BC. - It's Optional, default is 1 (bold). - */ - function set_bold($weight = 1) - { - if($weight == 1) { - $weight = 0x2BC; // Bold text - } - if($weight == 0) { - $weight = 0x190; // Normal text - } - if($weight < 0x064) { - $weight = 0x190; // Lower bound - } - if($weight > 0x3E8) { - $weight = 0x190; // Upper bound - } - $this->bold = $weight; - } - - - /************************************ - * FUNCTIONS FOR SETTING CELLS BORDERS - */ - - /** - * Sets the bottom border of the cell - * - * @access public - * @param integer $style style of the cell border. 1 => thin, 2 => thick. - */ - function set_bottom($style) - { - $this->bottom = $style; - } - - /** - * Sets the top border of the cell - * - * @access public - * @param integer $style style of the cell top border. 1 => thin, 2 => thick. - */ - function set_top($style) - { - $this->top = $style; - } - - /** - * Sets the left border of the cell - * - * @access public - * @param integer $style style of the cell left border. 1 => thin, 2 => thick. - */ - function set_left($style) - { - $this->left = $style; - } - - /** - * Sets the right border of the cell - * - * @access public - * @param integer $style style of the cell right border. 1 => thin, 2 => thick. - */ - function set_right($style) - { - $this->right = $style; - } - - - /** - * Set cells borders to the same style - * - * @access public - * @param integer $style style to apply for all cell borders. 1 => thin, 2 => thick. - */ - function set_border($style) - { - $this->set_bottom($style); - $this->set_top($style); - $this->set_left($style); - $this->set_right($style); - } - - - /******************************************* - * FUNCTIONS FOR SETTING CELLS BORDERS COLORS - */ - - /** - * Sets all the cell's borders to the same color - * - * @access public - * @param mixed $color The color we are setting. Either a string (like 'blue'), - * or an integer (like 0x41). - */ - function set_border_color($color) - { - $this->set_bottom_color($color); - $this->set_top_color($color); - $this->set_left_color($color); - $this->set_right_color($color); - } - - /** - * Sets the cell's bottom border color - * - * @access public - * @param mixed $color either a string (like 'blue'), or an integer (range is [8...63]). - */ - function set_bottom_color($color) - { - $value = $this->_get_color($color); - $this->bottom_color = $value; - } - - /** - * Sets the cell's top border color - * - * @access public - * @param mixed $color either a string (like 'blue'), or an integer (range is [8...63]). - */ - function set_top_color($color) - { - $value = $this->_get_color($color); - $this->top_color = $value; - } - - /** - * Sets the cell's left border color - * - * @access public - * @param mixed $color either a string (like 'blue'), or an integer (like 0x41). - */ - function set_left_color($color) - { - $value = $this->_get_color($color); - $this->left_color = $value; - } - - /** - * Sets the cell's right border color - * - * @access public - * @param mixed $color either a string (like 'blue'), or an integer (like 0x41). - */ - function set_right_color($color) - { - $value = $this->_get_color($color); - $this->right_color = $value; - } - - - /** - * Sets the cell's foreground color - * - * @access public - * @param mixed $color either a string (like 'blue'), or an integer (like 0x41). - */ - function set_fg_color($color) - { - $value = $this->_get_color($color); - $this->fg_color = $value; - } - - /** - * Sets the cell's background color - * - * @access public - * @param mixed $color either a string (like 'blue'), or an integer (like 0x41). - */ - function set_bg_color($color) - { - $value = $this->_get_color($color); - $this->bg_color = $value; - } - - /** - * Sets the cell's color - * - * @access public - * @param mixed $color either a string (like 'blue'), or an integer (like 0x41). - */ - function set_color($color) - { - $value = $this->_get_color($color); - $this->color = $value; - } - - /** - * Sets the pattern attribute of a cell - * - * @access public - * @param integer $arg Optional. Defaults to 1. - */ - function set_pattern($arg = 1) - { - $this->pattern = $arg; - } - - /** - * Sets the underline of the text - * - * @access public - * @param integer $underline The value for underline. Possible values are: - * 1 => underline, 2 => double underline. - */ - function set_underline($underline) - { - $this->_underline = $underline; - } - - /** - * Sets the font style as italic - * - * @access public - */ - function set_italic() - { - $this->_italic = 1; - } - - /** - * Sets the font size - * - * @access public - * @param integer $size The font size (in pixels I think). - */ - function set_size($size) - { - $this->size = $size; - } - - /** - * Sets the num format - * - * @access public - * @param integer $num_format The num format. - */ - function set_num_format($num_format) - { - $this->_num_format = $num_format; - } - - /** - * Sets text wrapping - * - * @access public - * @param integer $text_wrap Optional. 0 => no text wrapping, 1 => text wrapping. - * Defaults to 1. - */ - function set_text_wrap($text_wrap = 1) - { - $this->_text_wrap = $text_wrap; - } -} + +* +* The majority of this is _NOT_ my code. I simply ported it from the +* PERL Spreadsheet::WriteExcel module. +* +* The author of the Spreadsheet::WriteExcel module is John McNamara +* +* +* I _DO_ maintain this code, and John McNamara has nothing to do with the +* porting of this code to PHP. Any questions directly related to this +* class library should be directed to me. +* +* License Information: +* +* Spreadsheet::WriteExcel: A library for generating Excel Spreadsheets +* Copyright (C) 2002 Xavier Noguer xnoguer@rezebra.com +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2.1 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/** +* Class for generating Excel XF records (formats) +* +* @author Xavier Noguer +* @package Spreadsheet_WriteExcel +*/ + +class Format +{ + /** + * Constructor + * + * @access public + * @param integer $index the XF index for the format. + * @param array $properties array with properties to be set on initialization. + */ + function Format($index = 0,$properties = array()) + { + $this->xf_index = $index; + + $this->font_index = 0; + $this->font = 'Arial'; + $this->size = 10; + $this->bold = 0x0190; + $this->_italic = 0; + $this->color = 0x7FFF; + $this->_underline = 0; + $this->font_strikeout = 0; + $this->font_outline = 0; + $this->font_shadow = 0; + $this->font_script = 0; + $this->font_family = 0; + $this->font_charset = 0; + + $this->_num_format = 0; + + $this->hidden = 0; + $this->locked = 1; + + $this->_text_h_align = 0; + $this->_text_wrap = 0; + $this->text_v_align = 2; + $this->text_justlast = 0; + $this->rotation = 0; + + $this->fg_color = 0x40; + $this->bg_color = 0x41; + + $this->pattern = 0; + + $this->bottom = 0; + $this->top = 0; + $this->left = 0; + $this->right = 0; + + $this->bottom_color = 0x40; + $this->top_color = 0x40; + $this->left_color = 0x40; + $this->right_color = 0x40; + + // Set properties passed to Workbook::add_format() + foreach($properties as $property => $value) + { + if(method_exists($this,"set_$property")) + { + $aux = 'set_'.$property; + $this->$aux($value); + } + } + } + + /** + * Generate an Excel BIFF XF record (style or cell). + * + * @param string $style The type of the XF record ('style' or 'cell'). + * @return string The XF record + */ + function get_xf($style) + { + // Set the type of the XF record and some of the attributes. + if ($style == "style") { + $style = 0xFFF5; + } + else { + $style = $this->locked; + $style |= $this->hidden << 1; + } + + // Flags to indicate if attributes have been set. + $atr_num = ($this->_num_format != 0)?1:0; + $atr_fnt = ($this->font_index != 0)?1:0; + $atr_alc = ($this->_text_wrap)?1:0; + $atr_bdr = ($this->bottom || + $this->top || + $this->left || + $this->right)?1:0; + $atr_pat = (($this->fg_color != 0x40) || + ($this->bg_color != 0x41) || + $this->pattern)?1:0; + $atr_prot = 0; + + // Zero the default border colour if the border has not been set. + if ($this->bottom == 0) { + $this->bottom_color = 0; + } + if ($this->top == 0) { + $this->top_color = 0; + } + if ($this->right == 0) { + $this->right_color = 0; + } + if ($this->left == 0) { + $this->left_color = 0; + } + + $record = 0x00E0; // Record identifier + $length = 0x0010; // Number of bytes to follow + + $ifnt = $this->font_index; // Index to FONT record + $ifmt = $this->_num_format; // Index to FORMAT record + + $align = $this->_text_h_align; // Alignment + $align |= $this->_text_wrap << 3; + $align |= $this->text_v_align << 4; + $align |= $this->text_justlast << 7; + $align |= $this->rotation << 8; + $align |= $atr_num << 10; + $align |= $atr_fnt << 11; + $align |= $atr_alc << 12; + $align |= $atr_bdr << 13; + $align |= $atr_pat << 14; + $align |= $atr_prot << 15; + + $icv = $this->fg_color; // fg and bg pattern colors + $icv |= $this->bg_color << 7; + + $fill = $this->pattern; // Fill and border line style + $fill |= $this->bottom << 6; + $fill |= $this->bottom_color << 9; + + $border1 = $this->top; // Border line style and color + $border1 |= $this->left << 3; + $border1 |= $this->right << 6; + $border1 |= $this->top_color << 9; + + $border2 = $this->left_color; // Border color + $border2 |= $this->right_color << 7; + + $header = pack("vv", $record, $length); + $data = pack("vvvvvvvv", $ifnt, $ifmt, $style, $align, + $icv, $fill, + $border1, $border2); + return($header.$data); + } + + /** + * Generate an Excel BIFF FONT record. + * + * @see Workbook::_store_all_fonts() + * @return string The FONT record + */ + function get_font() + { + $dyHeight = $this->size * 20; // Height of font (1/20 of a point) + $icv = $this->color; // Index to color palette + $bls = $this->bold; // Bold style + $sss = $this->font_script; // Superscript/subscript + $uls = $this->_underline; // Underline + $bFamily = $this->font_family; // Font family + $bCharSet = $this->font_charset; // Character set + $rgch = $this->font; // Font name + + $cch = strlen($rgch); // Length of font name + $record = 0x31; // Record identifier + $length = 0x0F + $cch; // Record length + $reserved = 0x00; // Reserved + $grbit = 0x00; // Font attributes + if ($this->_italic) { + $grbit |= 0x02; + } + if ($this->font_strikeout) { + $grbit |= 0x08; + } + if ($this->font_outline) { + $grbit |= 0x10; + } + if ($this->font_shadow) { + $grbit |= 0x20; + } + + $header = pack("vv", $record, $length); + $data = pack("vvvvvCCCCC", $dyHeight, $grbit, $icv, $bls, + $sss, $uls, $bFamily, + $bCharSet, $reserved, $cch); + return($header . $data. $this->font); + } + + /** + * Returns a unique hash key for a font. Used by Workbook->_store_all_fonts() + * + * The elements that form the key are arranged to increase the probability of + * generating a unique key. Elements that hold a large range of numbers + * (eg. _color) are placed between two binary elements such as _italic + * + * @return string A key for this font + */ + function get_font_key() + { + $key = "$this->font$this->size"; + $key .= "$this->font_script$this->_underline"; + $key .= "$this->font_strikeout$this->bold$this->font_outline"; + $key .= "$this->font_family$this->font_charset"; + $key .= "$this->font_shadow$this->color$this->_italic"; + $key = str_replace(" ","_",$key); + return ($key); + } + + /** + * Returns the index used by Worksheet->_XF() + * + * @return integer The index for the XF record + */ + function get_xf_index() + { + return($this->xf_index); + } + + /** + * Used in conjunction with the set_xxx_color methods to convert a color + * string into a number. Color range is 0..63 but we will restrict it + * to 8..63 to comply with Gnumeric. Colors 0..7 are repeated in 8..15. + * + * @param string $name_color name of the color (i.e.: 'blue', 'red', etc..). Optional. + * @return integer The color index + */ + function _get_color($name_color = '') + { + $colors = array( + 'aqua' => 0x0F, + 'cyan' => 0x0F, + 'black' => 0x08, + 'blue' => 0x0C, + 'brown' => 0x10, + 'magenta' => 0x0E, + 'fuchsia' => 0x0E, + 'gray' => 0x17, + 'grey' => 0x17, + 'green' => 0x11, + 'lime' => 0x0B, + 'navy' => 0x12, + 'orange' => 0x35, + 'purple' => 0x14, + 'red' => 0x0A, + 'silver' => 0x16, + 'white' => 0x09, + 'yellow' => 0x0D + ); + + // Return the default color, 0x7FFF, if undef, + if($name_color == '') { + return(0x7FFF); + } + + // or the color string converted to an integer, + if(isset($colors[$name_color])) { + return($colors[$name_color]); + } + + // or the default color if string is unrecognised, + if(preg_match("/\D/",$name_color)) { + return(0x7FFF); + } + + // or an index < 8 mapped into the correct range, + if($name_color < 8) { + return($name_color + 8); + } + + // or the default color if arg is outside range, + if($name_color > 63) { + return(0x7FFF); + } + + // or an integer in the valid range + return($name_color); + } + + /** + * Set cell alignment. + * + * @access public + * @param string $location alignment for the cell ('left', 'right', etc...). + */ + function set_align($location) + { + if (preg_match("/\d/",$location)) { + return; // Ignore numbers + } + + $location = strtolower($location); + + if ($location == 'left') + $this->_text_h_align = 1; + if ($location == 'centre') + $this->_text_h_align = 2; + if ($location == 'center') + $this->_text_h_align = 2; + if ($location == 'right') + $this->_text_h_align = 3; + if ($location == 'fill') + $this->_text_h_align = 4; + if ($location == 'justify') + $this->_text_h_align = 5; + if ($location == 'merge') + $this->_text_h_align = 6; + if ($location == 'equal_space') // For T.K. + $this->_text_h_align = 7; + if ($location == 'top') + $this->text_v_align = 0; + if ($location == 'vcentre') + $this->text_v_align = 1; + if ($location == 'vcenter') + $this->text_v_align = 1; + if ($location == 'bottom') + $this->text_v_align = 2; + if ($location == 'vjustify') + $this->text_v_align = 3; + if ($location == 'vequal_space') // For T.K. + $this->text_v_align = 4; + } + + /** + * This is an alias for the unintuitive set_align('merge') + * + * @access public + */ + function set_merge() + { + $this->set_align('merge'); + } + + /** + * Bold has a range 0x64..0x3E8. + * 0x190 is normal. 0x2BC is bold. + * + * @access public + * @param integer $weight Weight for the text, 0 maps to 0x190, 1 maps to 0x2BC. + It's Optional, default is 1 (bold). + */ + function set_bold($weight = 1) + { + if($weight == 1) { + $weight = 0x2BC; // Bold text + } + if($weight == 0) { + $weight = 0x190; // Normal text + } + if($weight < 0x064) { + $weight = 0x190; // Lower bound + } + if($weight > 0x3E8) { + $weight = 0x190; // Upper bound + } + $this->bold = $weight; + } + + + /************************************ + * FUNCTIONS FOR SETTING CELLS BORDERS + */ + + /** + * Sets the bottom border of the cell + * + * @access public + * @param integer $style style of the cell border. 1 => thin, 2 => thick. + */ + function set_bottom($style) + { + $this->bottom = $style; + } + + /** + * Sets the top border of the cell + * + * @access public + * @param integer $style style of the cell top border. 1 => thin, 2 => thick. + */ + function set_top($style) + { + $this->top = $style; + } + + /** + * Sets the left border of the cell + * + * @access public + * @param integer $style style of the cell left border. 1 => thin, 2 => thick. + */ + function set_left($style) + { + $this->left = $style; + } + + /** + * Sets the right border of the cell + * + * @access public + * @param integer $style style of the cell right border. 1 => thin, 2 => thick. + */ + function set_right($style) + { + $this->right = $style; + } + + + /** + * Set cells borders to the same style + * + * @access public + * @param integer $style style to apply for all cell borders. 1 => thin, 2 => thick. + */ + function set_border($style) + { + $this->set_bottom($style); + $this->set_top($style); + $this->set_left($style); + $this->set_right($style); + } + + + /******************************************* + * FUNCTIONS FOR SETTING CELLS BORDERS COLORS + */ + + /** + * Sets all the cell's borders to the same color + * + * @access public + * @param mixed $color The color we are setting. Either a string (like 'blue'), + * or an integer (like 0x41). + */ + function set_border_color($color) + { + $this->set_bottom_color($color); + $this->set_top_color($color); + $this->set_left_color($color); + $this->set_right_color($color); + } + + /** + * Sets the cell's bottom border color + * + * @access public + * @param mixed $color either a string (like 'blue'), or an integer (range is [8...63]). + */ + function set_bottom_color($color) + { + $value = $this->_get_color($color); + $this->bottom_color = $value; + } + + /** + * Sets the cell's top border color + * + * @access public + * @param mixed $color either a string (like 'blue'), or an integer (range is [8...63]). + */ + function set_top_color($color) + { + $value = $this->_get_color($color); + $this->top_color = $value; + } + + /** + * Sets the cell's left border color + * + * @access public + * @param mixed $color either a string (like 'blue'), or an integer (like 0x41). + */ + function set_left_color($color) + { + $value = $this->_get_color($color); + $this->left_color = $value; + } + + /** + * Sets the cell's right border color + * + * @access public + * @param mixed $color either a string (like 'blue'), or an integer (like 0x41). + */ + function set_right_color($color) + { + $value = $this->_get_color($color); + $this->right_color = $value; + } + + + /** + * Sets the cell's foreground color + * + * @access public + * @param mixed $color either a string (like 'blue'), or an integer (like 0x41). + */ + function set_fg_color($color) + { + $value = $this->_get_color($color); + $this->fg_color = $value; + } + + /** + * Sets the cell's background color + * + * @access public + * @param mixed $color either a string (like 'blue'), or an integer (like 0x41). + */ + function set_bg_color($color) + { + $value = $this->_get_color($color); + $this->bg_color = $value; + } + + /** + * Sets the cell's color + * + * @access public + * @param mixed $color either a string (like 'blue'), or an integer (like 0x41). + */ + function set_color($color) + { + $value = $this->_get_color($color); + $this->color = $value; + } + + /** + * Sets the pattern attribute of a cell + * + * @access public + * @param integer $arg Optional. Defaults to 1. + */ + function set_pattern($arg = 1) + { + $this->pattern = $arg; + } + + /** + * Sets the underline of the text + * + * @access public + * @param integer $underline The value for underline. Possible values are: + * 1 => underline, 2 => double underline. + */ + function set_underline($underline) + { + $this->_underline = $underline; + } + + /** + * Sets the font style as italic + * + * @access public + */ + function set_italic() + { + $this->_italic = 1; + } + + /** + * Sets the font size + * + * @access public + * @param integer $size The font size (in pixels I think). + */ + function set_size($size) + { + $this->size = $size; + } + + /** + * Sets the num format + * + * @access public + * @param integer $num_format The num format. + */ + function set_num_format($num_format) + { + $this->_num_format = $num_format; + } + + /** + * Sets text wrapping + * + * @access public + * @param integer $text_wrap Optional. 0 => no text wrapping, 1 => text wrapping. + * Defaults to 1. + */ + function set_text_wrap($text_wrap = 1) + { + $this->_text_wrap = $text_wrap; + } +} ?> \ No newline at end of file diff --git a/lib/excel/OLEwriter.php b/lib/excel/OLEwriter.php index 6af35d244e7..8c017d2e1fa 100644 --- a/lib/excel/OLEwriter.php +++ b/lib/excel/OLEwriter.php @@ -1,414 +1,414 @@ - -* -* The majority of this is _NOT_ my code. I simply ported it from the -* PERL Spreadsheet::WriteExcel module. -* -* The author of the Spreadsheet::WriteExcel module is John McNamara -* -* -* I _DO_ maintain this code, and John McNamara has nothing to do with the -* porting of this code to PHP. Any questions directly related to this -* class library should be directed to me. -* -* License Information: -* -* Spreadsheet::WriteExcel: A library for generating Excel Spreadsheets -* Copyright (C) 2002 Xavier Noguer xnoguer@rezebra.com -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; either -* version 2.1 of the License, or (at your option) any later version. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/** -* Class for creating OLE streams for Excel Spreadsheets -* -* @author Xavier Noguer -* @package Spreadsheet_WriteExcel -*/ -class OLEwriter -{ - /** - * Filename for the OLE stream - * @var string - * @see _initialize() - */ - var $_OLEfilename; - - /** - * Filehandle for the OLE stream - * @var resource - */ - var $_filehandle; - - /** - * Name of the temporal file in case OLE stream goes to stdout - * @var string - */ - var $_tmp_filename; - - /** - * Variable for preventing closing two times - * @var integer - */ - var $_fileclosed; - - /** - * Size of the data to be written to the OLE stream - * @var integer - */ - var $_biffsize; - - /** - * Real data size to be written to the OLE stream - * @var integer - */ - var $_booksize; - - /** - * Number of big blocks in the OLE stream - * @var integer - */ - var $_big_blocks; - - /** - * Number of list blocks in the OLE stream - * @var integer - */ - var $_list_blocks; - - /** - * Number of big blocks in the OLE stream - * @var integer - */ - var $_root_start; - - /** - * Class for creating an OLEwriter - * - * @param string $OLEfilename the name of the file for the OLE stream - */ - function OLEwriter($OLEfilename) - { - $this->_OLEfilename = $OLEfilename; - $this->_filehandle = ""; - $this->_tmp_filename = ""; - $this->_fileclosed = 0; - //$this->_size_allowed = 0; - $this->_biffsize = 0; - $this->_booksize = 0; - $this->_big_blocks = 0; - $this->_list_blocks = 0; - $this->_root_start = 0; - //$this->_block_count = 4; - $this->_initialize(); - } - -/** -* Check for a valid filename and store the filehandle. -* Filehandle "-" writes to STDOUT -*/ - function _initialize() - { - $OLEfile = $this->_OLEfilename; - - if(($OLEfile == '-') or ($OLEfile == '')) - { - $this->_tmp_filename = tempnam("/tmp", "OLEwriter"); - $fh = fopen($this->_tmp_filename,"wb"); - if ($fh == false) { - die("Can't create temporary file."); - } - } - else - { - // Create a new file, open for writing (in binmode) - $fh = fopen($OLEfile,"wb"); - if ($fh == false) { - die("Can't open $OLEfile. It may be in use or protected."); - } - } - - // Store filehandle - $this->_filehandle = $fh; - } - - - /** - * Set the size of the data to be written to the OLE stream. - * The maximun size comes from this: - * $big_blocks = (109 depot block x (128 -1 marker word) - * - (1 x end words)) = 13842 - * $maxsize = $big_blocks * 512 bytes = 7087104 - * - * @access public - * @see Workbook::store_OLE_file() - * @param integer $biffsize The size of the data to be written to the OLE stream - * @return integer 1 for success - */ - function set_size($biffsize) - { - $maxsize = 7087104; // TODO: extend max size - - if ($biffsize > $maxsize) { - die("Maximum file size, $maxsize, exceeded."); - } - - $this->_biffsize = $biffsize; - // Set the min file size to 4k to avoid having to use small blocks - if ($biffsize > 4096) { - $this->_booksize = $biffsize; - } - else { - $this->_booksize = 4096; - } - //$this->_size_allowed = 1; - return(1); - } - - - /** - * Calculate various sizes needed for the OLE stream - */ - function _calculate_sizes() - { - $datasize = $this->_booksize; - if ($datasize % 512 == 0) { - $this->_big_blocks = $datasize/512; - } - else { - $this->_big_blocks = floor($datasize/512) + 1; - } - // There are 127 list blocks and 1 marker blocks for each big block - // depot + 1 end of chain block - $this->_list_blocks = floor(($this->_big_blocks)/127) + 1; - $this->_root_start = $this->_big_blocks; - } - - /** - * Write root entry, big block list and close the filehandle. - * This routine is used to explicitly close the open filehandle without - * having to wait for DESTROY. - * - * @access public - * @see Workbook::store_OLE_file() - */ - function close() - { - //return if not $this->{_size_allowed}; - $this->_write_padding(); - $this->_write_property_storage(); - $this->_write_big_block_depot(); - // Close the filehandle - fclose($this->_filehandle); - if(($this->_OLEfilename == '-') or ($this->_OLEfilename == '')) - { - $fh = fopen($this->_tmp_filename, "rb"); - if ($fh == false) { - die("Can't read temporary file."); - } - fpassthru($fh); - // Delete the temporary file. - @unlink($this->_tmp_filename); - } - $this->_fileclosed = 1; - } - - - /** - * Write BIFF data to OLE file. - * - * @param string $data string of bytes to be written - */ - function write($data) //por ahora slo a STDOUT - { - fwrite($this->_filehandle,$data,strlen($data)); - } - - - /** - * Write OLE header block. - */ - function write_header() - { - $this->_calculate_sizes(); - $root_start = $this->_root_start; - $num_lists = $this->_list_blocks; - $id = pack("nnnn", 0xD0CF, 0x11E0, 0xA1B1, 0x1AE1); - $unknown1 = pack("VVVV", 0x00, 0x00, 0x00, 0x00); - $unknown2 = pack("vv", 0x3E, 0x03); - $unknown3 = pack("v", -2); - $unknown4 = pack("v", 0x09); - $unknown5 = pack("VVV", 0x06, 0x00, 0x00); - $num_bbd_blocks = pack("V", $num_lists); - $root_startblock = pack("V", $root_start); - $unknown6 = pack("VV", 0x00, 0x1000); - $sbd_startblock = pack("V", -2); - $unknown7 = pack("VVV", 0x00, -2 ,0x00); - $unused = pack("V", -1); - - fwrite($this->_filehandle,$id); - fwrite($this->_filehandle,$unknown1); - fwrite($this->_filehandle,$unknown2); - fwrite($this->_filehandle,$unknown3); - fwrite($this->_filehandle,$unknown4); - fwrite($this->_filehandle,$unknown5); - fwrite($this->_filehandle,$num_bbd_blocks); - fwrite($this->_filehandle,$root_startblock); - fwrite($this->_filehandle,$unknown6); - fwrite($this->_filehandle,$sbd_startblock); - fwrite($this->_filehandle,$unknown7); - - for($i=1; $i <= $num_lists; $i++) - { - $root_start++; - fwrite($this->_filehandle,pack("V",$root_start)); - } - for($i = $num_lists; $i <=108; $i++) - { - fwrite($this->_filehandle,$unused); - } - } - - - /** - * Write big block depot. - */ - function _write_big_block_depot() - { - $num_blocks = $this->_big_blocks; - $num_lists = $this->_list_blocks; - $total_blocks = $num_lists *128; - $used_blocks = $num_blocks + $num_lists +2; - - $marker = pack("V", -3); - $end_of_chain = pack("V", -2); - $unused = pack("V", -1); - - for($i=1; $i < $num_blocks; $i++) - { - fwrite($this->_filehandle,pack("V",$i)); - } - fwrite($this->_filehandle,$end_of_chain); - fwrite($this->_filehandle,$end_of_chain); - for($i=0; $i < $num_lists; $i++) - { - fwrite($this->_filehandle,$marker); - } - for($i=$used_blocks; $i <= $total_blocks; $i++) - { - fwrite($this->_filehandle,$unused); - } - } - -/** -* Write property storage. TODO: add summary sheets -*/ - function _write_property_storage() - { - //$rootsize = -2; - /*************** name type dir start size */ - $this->_write_pps("Root Entry", 0x05, 1, -2, 0x00); - $this->_write_pps("Book", 0x02, -1, 0x00, $this->_booksize); - $this->_write_pps('', 0x00, -1, 0x00, 0x0000); - $this->_write_pps('', 0x00, -1, 0x00, 0x0000); - } - -/** -* Write property sheet in property storage -* -* @param string $name name of the property storage. -* @param integer $type type of the property storage. -* @param integer $dir dir of the property storage. -* @param integer $start start of the property storage. -* @param integer $size size of the property storage. -* @access private -*/ - function _write_pps($name,$type,$dir,$start,$size) - { - $length = 0; - $rawname = ''; - - if ($name != '') - { - $name = $name . "\0"; - for($i=0;$i_filehandle,$rawname); - for($i=0; $i < (64 -$length); $i++) { - fwrite($this->_filehandle,$zero); - } - fwrite($this->_filehandle,$pps_sizeofname); - fwrite($this->_filehandle,$pps_type); - fwrite($this->_filehandle,$pps_prev); - fwrite($this->_filehandle,$pps_next); - fwrite($this->_filehandle,$pps_dir); - for($i=0; $i < 5; $i++) { - fwrite($this->_filehandle,$unknown1); - } - fwrite($this->_filehandle,$pps_ts1s); - fwrite($this->_filehandle,$pps_ts1d); - fwrite($this->_filehandle,$pps_ts2d); - fwrite($this->_filehandle,$pps_ts2d); - fwrite($this->_filehandle,$pps_sb); - fwrite($this->_filehandle,$pps_size); - fwrite($this->_filehandle,$unknown1); - } - - /** - * Pad the end of the file - */ - function _write_padding() - { - $biffsize = $this->_biffsize; - if ($biffsize < 4096) { - $min_size = 4096; - } - else { - $min_size = 512; - } - if ($biffsize % $min_size != 0) - { - $padding = $min_size - ($biffsize % $min_size); - for($i=0; $i < $padding; $i++) { - fwrite($this->_filehandle,"\0"); - } - } - } -} + +* +* The majority of this is _NOT_ my code. I simply ported it from the +* PERL Spreadsheet::WriteExcel module. +* +* The author of the Spreadsheet::WriteExcel module is John McNamara +* +* +* I _DO_ maintain this code, and John McNamara has nothing to do with the +* porting of this code to PHP. Any questions directly related to this +* class library should be directed to me. +* +* License Information: +* +* Spreadsheet::WriteExcel: A library for generating Excel Spreadsheets +* Copyright (C) 2002 Xavier Noguer xnoguer@rezebra.com +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2.1 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/** +* Class for creating OLE streams for Excel Spreadsheets +* +* @author Xavier Noguer +* @package Spreadsheet_WriteExcel +*/ +class OLEwriter +{ + /** + * Filename for the OLE stream + * @var string + * @see _initialize() + */ + var $_OLEfilename; + + /** + * Filehandle for the OLE stream + * @var resource + */ + var $_filehandle; + + /** + * Name of the temporal file in case OLE stream goes to stdout + * @var string + */ + var $_tmp_filename; + + /** + * Variable for preventing closing two times + * @var integer + */ + var $_fileclosed; + + /** + * Size of the data to be written to the OLE stream + * @var integer + */ + var $_biffsize; + + /** + * Real data size to be written to the OLE stream + * @var integer + */ + var $_booksize; + + /** + * Number of big blocks in the OLE stream + * @var integer + */ + var $_big_blocks; + + /** + * Number of list blocks in the OLE stream + * @var integer + */ + var $_list_blocks; + + /** + * Number of big blocks in the OLE stream + * @var integer + */ + var $_root_start; + + /** + * Class for creating an OLEwriter + * + * @param string $OLEfilename the name of the file for the OLE stream + */ + function OLEwriter($OLEfilename) + { + $this->_OLEfilename = $OLEfilename; + $this->_filehandle = ""; + $this->_tmp_filename = ""; + $this->_fileclosed = 0; + //$this->_size_allowed = 0; + $this->_biffsize = 0; + $this->_booksize = 0; + $this->_big_blocks = 0; + $this->_list_blocks = 0; + $this->_root_start = 0; + //$this->_block_count = 4; + $this->_initialize(); + } + +/** +* Check for a valid filename and store the filehandle. +* Filehandle "-" writes to STDOUT +*/ + function _initialize() + { + $OLEfile = $this->_OLEfilename; + + if(($OLEfile == '-') or ($OLEfile == '')) + { + $this->_tmp_filename = tempnam("/tmp", "OLEwriter"); + $fh = fopen($this->_tmp_filename,"wb"); + if ($fh == false) { + die("Can't create temporary file."); + } + } + else + { + // Create a new file, open for writing (in binmode) + $fh = fopen($OLEfile,"wb"); + if ($fh == false) { + die("Can't open $OLEfile. It may be in use or protected."); + } + } + + // Store filehandle + $this->_filehandle = $fh; + } + + + /** + * Set the size of the data to be written to the OLE stream. + * The maximun size comes from this: + * $big_blocks = (109 depot block x (128 -1 marker word) + * - (1 x end words)) = 13842 + * $maxsize = $big_blocks * 512 bytes = 7087104 + * + * @access public + * @see Workbook::store_OLE_file() + * @param integer $biffsize The size of the data to be written to the OLE stream + * @return integer 1 for success + */ + function set_size($biffsize) + { + $maxsize = 7087104; // TODO: extend max size + + if ($biffsize > $maxsize) { + die("Maximum file size, $maxsize, exceeded."); + } + + $this->_biffsize = $biffsize; + // Set the min file size to 4k to avoid having to use small blocks + if ($biffsize > 4096) { + $this->_booksize = $biffsize; + } + else { + $this->_booksize = 4096; + } + //$this->_size_allowed = 1; + return(1); + } + + + /** + * Calculate various sizes needed for the OLE stream + */ + function _calculate_sizes() + { + $datasize = $this->_booksize; + if ($datasize % 512 == 0) { + $this->_big_blocks = $datasize/512; + } + else { + $this->_big_blocks = floor($datasize/512) + 1; + } + // There are 127 list blocks and 1 marker blocks for each big block + // depot + 1 end of chain block + $this->_list_blocks = floor(($this->_big_blocks)/127) + 1; + $this->_root_start = $this->_big_blocks; + } + + /** + * Write root entry, big block list and close the filehandle. + * This routine is used to explicitly close the open filehandle without + * having to wait for DESTROY. + * + * @access public + * @see Workbook::store_OLE_file() + */ + function close() + { + //return if not $this->{_size_allowed}; + $this->_write_padding(); + $this->_write_property_storage(); + $this->_write_big_block_depot(); + // Close the filehandle + fclose($this->_filehandle); + if(($this->_OLEfilename == '-') or ($this->_OLEfilename == '')) + { + $fh = fopen($this->_tmp_filename, "rb"); + if ($fh == false) { + die("Can't read temporary file."); + } + fpassthru($fh); + // Delete the temporary file. + @unlink($this->_tmp_filename); + } + $this->_fileclosed = 1; + } + + + /** + * Write BIFF data to OLE file. + * + * @param string $data string of bytes to be written + */ + function write($data) //por ahora s�lo a STDOUT + { + fwrite($this->_filehandle,$data,strlen($data)); + } + + + /** + * Write OLE header block. + */ + function write_header() + { + $this->_calculate_sizes(); + $root_start = $this->_root_start; + $num_lists = $this->_list_blocks; + $id = pack("nnnn", 0xD0CF, 0x11E0, 0xA1B1, 0x1AE1); + $unknown1 = pack("VVVV", 0x00, 0x00, 0x00, 0x00); + $unknown2 = pack("vv", 0x3E, 0x03); + $unknown3 = pack("v", -2); + $unknown4 = pack("v", 0x09); + $unknown5 = pack("VVV", 0x06, 0x00, 0x00); + $num_bbd_blocks = pack("V", $num_lists); + $root_startblock = pack("V", $root_start); + $unknown6 = pack("VV", 0x00, 0x1000); + $sbd_startblock = pack("V", -2); + $unknown7 = pack("VVV", 0x00, -2 ,0x00); + $unused = pack("V", -1); + + fwrite($this->_filehandle,$id); + fwrite($this->_filehandle,$unknown1); + fwrite($this->_filehandle,$unknown2); + fwrite($this->_filehandle,$unknown3); + fwrite($this->_filehandle,$unknown4); + fwrite($this->_filehandle,$unknown5); + fwrite($this->_filehandle,$num_bbd_blocks); + fwrite($this->_filehandle,$root_startblock); + fwrite($this->_filehandle,$unknown6); + fwrite($this->_filehandle,$sbd_startblock); + fwrite($this->_filehandle,$unknown7); + + for($i=1; $i <= $num_lists; $i++) + { + $root_start++; + fwrite($this->_filehandle,pack("V",$root_start)); + } + for($i = $num_lists; $i <=108; $i++) + { + fwrite($this->_filehandle,$unused); + } + } + + + /** + * Write big block depot. + */ + function _write_big_block_depot() + { + $num_blocks = $this->_big_blocks; + $num_lists = $this->_list_blocks; + $total_blocks = $num_lists *128; + $used_blocks = $num_blocks + $num_lists +2; + + $marker = pack("V", -3); + $end_of_chain = pack("V", -2); + $unused = pack("V", -1); + + for($i=1; $i < $num_blocks; $i++) + { + fwrite($this->_filehandle,pack("V",$i)); + } + fwrite($this->_filehandle,$end_of_chain); + fwrite($this->_filehandle,$end_of_chain); + for($i=0; $i < $num_lists; $i++) + { + fwrite($this->_filehandle,$marker); + } + for($i=$used_blocks; $i <= $total_blocks; $i++) + { + fwrite($this->_filehandle,$unused); + } + } + +/** +* Write property storage. TODO: add summary sheets +*/ + function _write_property_storage() + { + //$rootsize = -2; + /*************** name type dir start size */ + $this->_write_pps("Root Entry", 0x05, 1, -2, 0x00); + $this->_write_pps("Book", 0x02, -1, 0x00, $this->_booksize); + $this->_write_pps('', 0x00, -1, 0x00, 0x0000); + $this->_write_pps('', 0x00, -1, 0x00, 0x0000); + } + +/** +* Write property sheet in property storage +* +* @param string $name name of the property storage. +* @param integer $type type of the property storage. +* @param integer $dir dir of the property storage. +* @param integer $start start of the property storage. +* @param integer $size size of the property storage. +* @access private +*/ + function _write_pps($name,$type,$dir,$start,$size) + { + $length = 0; + $rawname = ''; + + if ($name != '') + { + $name = $name . "\0"; + for($i=0;$i_filehandle,$rawname); + for($i=0; $i < (64 -$length); $i++) { + fwrite($this->_filehandle,$zero); + } + fwrite($this->_filehandle,$pps_sizeofname); + fwrite($this->_filehandle,$pps_type); + fwrite($this->_filehandle,$pps_prev); + fwrite($this->_filehandle,$pps_next); + fwrite($this->_filehandle,$pps_dir); + for($i=0; $i < 5; $i++) { + fwrite($this->_filehandle,$unknown1); + } + fwrite($this->_filehandle,$pps_ts1s); + fwrite($this->_filehandle,$pps_ts1d); + fwrite($this->_filehandle,$pps_ts2d); + fwrite($this->_filehandle,$pps_ts2d); + fwrite($this->_filehandle,$pps_sb); + fwrite($this->_filehandle,$pps_size); + fwrite($this->_filehandle,$unknown1); + } + + /** + * Pad the end of the file + */ + function _write_padding() + { + $biffsize = $this->_biffsize; + if ($biffsize < 4096) { + $min_size = 4096; + } + else { + $min_size = 512; + } + if ($biffsize % $min_size != 0) + { + $padding = $min_size - ($biffsize % $min_size); + for($i=0; $i < $padding; $i++) { + fwrite($this->_filehandle,"\0"); + } + } + } +} ?> \ No newline at end of file diff --git a/lib/excel/Parser.php b/lib/excel/Parser.php index 3d3e92e7da8..f91cf9895f9 100644 --- a/lib/excel/Parser.php +++ b/lib/excel/Parser.php @@ -1,996 +1,996 @@ - -* @package Spreadsheet_WriteExcel -*/ -class Parser - { -/** -* The class constructor -* -* @param integer $byte_order The byte order (Little endian or Big endian) of the architecture - (optional). 1 => big endian, 0 (default) => little endian. -*/ - function Parser($byte_order = 0) - { - $this->_current_char = 0; // The index of the character we are currently looking at. - $this->_current_token = ''; // The token we are working on. - $this->_formula = ""; // The formula to parse. - $this->_lookahead = ''; // The character ahead of the current char. - $this->_parse_tree = ''; // The parse tree to be generated. - $this->_initialize_hashes(); // Initialize the hashes: ptg's and function's ptg's - $this->_byte_order = $byte_order; // Little Endian or Big Endian - $this->_func_args = 0; // Number of arguments for the current function - $this->_volatile = 0; - } - -/** -* Initialize the ptg and function hashes. -*/ - function _initialize_hashes() - { - // The Excel ptg indices - $this->ptg = array( - 'ptgExp' => 0x01, - 'ptgTbl' => 0x02, - 'ptgAdd' => 0x03, - 'ptgSub' => 0x04, - 'ptgMul' => 0x05, - 'ptgDiv' => 0x06, - 'ptgPower' => 0x07, - 'ptgConcat' => 0x08, - 'ptgLT' => 0x09, - 'ptgLE' => 0x0A, - 'ptgEQ' => 0x0B, - 'ptgGE' => 0x0C, - 'ptgGT' => 0x0D, - 'ptgNE' => 0x0E, - 'ptgIsect' => 0x0F, - 'ptgUnion' => 0x10, - 'ptgRange' => 0x11, - 'ptgUplus' => 0x12, - 'ptgUminus' => 0x13, - 'ptgPercent' => 0x14, - 'ptgParen' => 0x15, - 'ptgMissArg' => 0x16, - 'ptgStr' => 0x17, - 'ptgAttr' => 0x19, - 'ptgSheet' => 0x1A, - 'ptgEndSheet' => 0x1B, - 'ptgErr' => 0x1C, - 'ptgBool' => 0x1D, - 'ptgInt' => 0x1E, - 'ptgNum' => 0x1F, - 'ptgArray' => 0x20, - 'ptgFunc' => 0x21, - 'ptgFuncVar' => 0x22, - 'ptgName' => 0x23, - 'ptgRef' => 0x24, - 'ptgArea' => 0x25, - 'ptgMemArea' => 0x26, - 'ptgMemErr' => 0x27, - 'ptgMemNoMem' => 0x28, - 'ptgMemFunc' => 0x29, - 'ptgRefErr' => 0x2A, - 'ptgAreaErr' => 0x2B, - 'ptgRefN' => 0x2C, - 'ptgAreaN' => 0x2D, - 'ptgMemAreaN' => 0x2E, - 'ptgMemNoMemN' => 0x2F, - 'ptgNameX' => 0x39, - 'ptgRef3d' => 0x3A, - 'ptgArea3d' => 0x3B, - 'ptgRefErr3d' => 0x3C, - 'ptgAreaErr3d' => 0x3D, - 'ptgArrayV' => 0x40, - 'ptgFuncV' => 0x41, - 'ptgFuncVarV' => 0x42, - 'ptgNameV' => 0x43, - 'ptgRefV' => 0x44, - 'ptgAreaV' => 0x45, - 'ptgMemAreaV' => 0x46, - 'ptgMemErrV' => 0x47, - 'ptgMemNoMemV' => 0x48, - 'ptgMemFuncV' => 0x49, - 'ptgRefErrV' => 0x4A, - 'ptgAreaErrV' => 0x4B, - 'ptgRefNV' => 0x4C, - 'ptgAreaNV' => 0x4D, - 'ptgMemAreaNV' => 0x4E, - 'ptgMemNoMemN' => 0x4F, - 'ptgFuncCEV' => 0x58, - 'ptgNameXV' => 0x59, - 'ptgRef3dV' => 0x5A, - 'ptgArea3dV' => 0x5B, - 'ptgRefErr3dV' => 0x5C, - 'ptgAreaErr3d' => 0x5D, - 'ptgArrayA' => 0x60, - 'ptgFuncA' => 0x61, - 'ptgFuncVarA' => 0x62, - 'ptgNameA' => 0x63, - 'ptgRefA' => 0x64, - 'ptgAreaA' => 0x65, - 'ptgMemAreaA' => 0x66, - 'ptgMemErrA' => 0x67, - 'ptgMemNoMemA' => 0x68, - 'ptgMemFuncA' => 0x69, - 'ptgRefErrA' => 0x6A, - 'ptgAreaErrA' => 0x6B, - 'ptgRefNA' => 0x6C, - 'ptgAreaNA' => 0x6D, - 'ptgMemAreaNA' => 0x6E, - 'ptgMemNoMemN' => 0x6F, - 'ptgFuncCEA' => 0x78, - 'ptgNameXA' => 0x79, - 'ptgRef3dA' => 0x7A, - 'ptgArea3dA' => 0x7B, - 'ptgRefErr3dA' => 0x7C, - 'ptgAreaErr3d' => 0x7D - ); - - // Thanks to Michael Meeks and Gnumeric for the initial arg values. - // - // The following hash was generated by "function_locale.pl" in the distro. - // Refer to function_locale.pl for non-English function names. - // - // The array elements are as follow: - // ptg: The Excel function ptg code. - // args: The number of arguments that the function takes: - // >=0 is a fixed number of arguments. - // -1 is a variable number of arguments. - // class: The reference, value or array class of the function args. - // vol: The function is volatile. - // - $this->_functions = array( - // function ptg args class vol - 'COUNT' => array( 0, -1, 0, 0 ), - 'IF' => array( 1, -1, 1, 0 ), - 'ISNA' => array( 2, 1, 1, 0 ), - 'ISERROR' => array( 3, 1, 1, 0 ), - 'SUM' => array( 4, -1, 0, 0 ), - 'AVERAGE' => array( 5, -1, 0, 0 ), - 'MIN' => array( 6, -1, 0, 0 ), - 'MAX' => array( 7, -1, 0, 0 ), - 'ROW' => array( 8, -1, 0, 0 ), - 'COLUMN' => array( 9, -1, 0, 0 ), - 'NA' => array( 10, 0, 0, 0 ), - 'NPV' => array( 11, -1, 1, 0 ), - 'STDEV' => array( 12, -1, 0, 0 ), - 'DOLLAR' => array( 13, -1, 1, 0 ), - 'FIXED' => array( 14, -1, 1, 0 ), - 'SIN' => array( 15, 1, 1, 0 ), - 'COS' => array( 16, 1, 1, 0 ), - 'TAN' => array( 17, 1, 1, 0 ), - 'ATAN' => array( 18, 1, 1, 0 ), - 'PI' => array( 19, 0, 1, 0 ), - 'SQRT' => array( 20, 1, 1, 0 ), - 'EXP' => array( 21, 1, 1, 0 ), - 'LN' => array( 22, 1, 1, 0 ), - 'LOG10' => array( 23, 1, 1, 0 ), - 'ABS' => array( 24, 1, 1, 0 ), - 'INT' => array( 25, 1, 1, 0 ), - 'SIGN' => array( 26, 1, 1, 0 ), - 'ROUND' => array( 27, 2, 1, 0 ), - 'LOOKUP' => array( 28, -1, 0, 0 ), - 'INDEX' => array( 29, -1, 0, 1 ), - 'REPT' => array( 30, 2, 1, 0 ), - 'MID' => array( 31, 3, 1, 0 ), - 'LEN' => array( 32, 1, 1, 0 ), - 'VALUE' => array( 33, 1, 1, 0 ), - 'TRUE' => array( 34, 0, 1, 0 ), - 'FALSE' => array( 35, 0, 1, 0 ), - 'AND' => array( 36, -1, 0, 0 ), - 'OR' => array( 37, -1, 0, 0 ), - 'NOT' => array( 38, 1, 1, 0 ), - 'MOD' => array( 39, 2, 1, 0 ), - 'DCOUNT' => array( 40, 3, 0, 0 ), - 'DSUM' => array( 41, 3, 0, 0 ), - 'DAVERAGE' => array( 42, 3, 0, 0 ), - 'DMIN' => array( 43, 3, 0, 0 ), - 'DMAX' => array( 44, 3, 0, 0 ), - 'DSTDEV' => array( 45, 3, 0, 0 ), - 'VAR' => array( 46, -1, 0, 0 ), - 'DVAR' => array( 47, 3, 0, 0 ), - 'TEXT' => array( 48, 2, 1, 0 ), - 'LINEST' => array( 49, -1, 0, 0 ), - 'TREND' => array( 50, -1, 0, 0 ), - 'LOGEST' => array( 51, -1, 0, 0 ), - 'GROWTH' => array( 52, -1, 0, 0 ), - 'PV' => array( 56, -1, 1, 0 ), - 'FV' => array( 57, -1, 1, 0 ), - 'NPER' => array( 58, -1, 1, 0 ), - 'PMT' => array( 59, -1, 1, 0 ), - 'RATE' => array( 60, -1, 1, 0 ), - 'MIRR' => array( 61, 3, 0, 0 ), - 'IRR' => array( 62, -1, 0, 0 ), - 'RAND' => array( 63, 0, 1, 1 ), - 'MATCH' => array( 64, -1, 0, 0 ), - 'DATE' => array( 65, 3, 1, 0 ), - 'TIME' => array( 66, 3, 1, 0 ), - 'DAY' => array( 67, 1, 1, 0 ), - 'MONTH' => array( 68, 1, 1, 0 ), - 'YEAR' => array( 69, 1, 1, 0 ), - 'WEEKDAY' => array( 70, -1, 1, 0 ), - 'HOUR' => array( 71, 1, 1, 0 ), - 'MINUTE' => array( 72, 1, 1, 0 ), - 'SECOND' => array( 73, 1, 1, 0 ), - 'NOW' => array( 74, 0, 1, 1 ), - 'AREAS' => array( 75, 1, 0, 1 ), - 'ROWS' => array( 76, 1, 0, 1 ), - 'COLUMNS' => array( 77, 1, 0, 1 ), - 'OFFSET' => array( 78, -1, 0, 1 ), - 'SEARCH' => array( 82, -1, 1, 0 ), - 'TRANSPOSE' => array( 83, 1, 1, 0 ), - 'TYPE' => array( 86, 1, 1, 0 ), - 'ATAN2' => array( 97, 2, 1, 0 ), - 'ASIN' => array( 98, 1, 1, 0 ), - 'ACOS' => array( 99, 1, 1, 0 ), - 'CHOOSE' => array( 100, -1, 1, 0 ), - 'HLOOKUP' => array( 101, -1, 0, 0 ), - 'VLOOKUP' => array( 102, -1, 0, 0 ), - 'ISREF' => array( 105, 1, 0, 0 ), - 'LOG' => array( 109, -1, 1, 0 ), - 'CHAR' => array( 111, 1, 1, 0 ), - 'LOWER' => array( 112, 1, 1, 0 ), - 'UPPER' => array( 113, 1, 1, 0 ), - 'PROPER' => array( 114, 1, 1, 0 ), - 'LEFT' => array( 115, -1, 1, 0 ), - 'RIGHT' => array( 116, -1, 1, 0 ), - 'EXACT' => array( 117, 2, 1, 0 ), - 'TRIM' => array( 118, 1, 1, 0 ), - 'REPLACE' => array( 119, 4, 1, 0 ), - 'SUBSTITUTE' => array( 120, -1, 1, 0 ), - 'CODE' => array( 121, 1, 1, 0 ), - 'FIND' => array( 124, -1, 1, 0 ), - 'CELL' => array( 125, -1, 0, 1 ), - 'ISERR' => array( 126, 1, 1, 0 ), - 'ISTEXT' => array( 127, 1, 1, 0 ), - 'ISNUMBER' => array( 128, 1, 1, 0 ), - 'ISBLANK' => array( 129, 1, 1, 0 ), - 'T' => array( 130, 1, 0, 0 ), - 'N' => array( 131, 1, 0, 0 ), - 'DATEVALUE' => array( 140, 1, 1, 0 ), - 'TIMEVALUE' => array( 141, 1, 1, 0 ), - 'SLN' => array( 142, 3, 1, 0 ), - 'SYD' => array( 143, 4, 1, 0 ), - 'DDB' => array( 144, -1, 1, 0 ), - 'INDIRECT' => array( 148, -1, 1, 1 ), - 'CALL' => array( 150, -1, 1, 0 ), - 'CLEAN' => array( 162, 1, 1, 0 ), - 'MDETERM' => array( 163, 1, 2, 0 ), - 'MINVERSE' => array( 164, 1, 2, 0 ), - 'MMULT' => array( 165, 2, 2, 0 ), - 'IPMT' => array( 167, -1, 1, 0 ), - 'PPMT' => array( 168, -1, 1, 0 ), - 'COUNTA' => array( 169, -1, 0, 0 ), - 'PRODUCT' => array( 183, -1, 0, 0 ), - 'FACT' => array( 184, 1, 1, 0 ), - 'DPRODUCT' => array( 189, 3, 0, 0 ), - 'ISNONTEXT' => array( 190, 1, 1, 0 ), - 'STDEVP' => array( 193, -1, 0, 0 ), - 'VARP' => array( 194, -1, 0, 0 ), - 'DSTDEVP' => array( 195, 3, 0, 0 ), - 'DVARP' => array( 196, 3, 0, 0 ), - 'TRUNC' => array( 197, -1, 1, 0 ), - 'ISLOGICAL' => array( 198, 1, 1, 0 ), - 'DCOUNTA' => array( 199, 3, 0, 0 ), - 'ROUNDUP' => array( 212, 2, 1, 0 ), - 'ROUNDDOWN' => array( 213, 2, 1, 0 ), - 'RANK' => array( 216, -1, 0, 0 ), - 'ADDRESS' => array( 219, -1, 1, 0 ), - 'DAYS360' => array( 220, -1, 1, 0 ), - 'TODAY' => array( 221, 0, 1, 1 ), - 'VDB' => array( 222, -1, 1, 0 ), - 'MEDIAN' => array( 227, -1, 0, 0 ), - 'SUMPRODUCT' => array( 228, -1, 2, 0 ), - 'SINH' => array( 229, 1, 1, 0 ), - 'COSH' => array( 230, 1, 1, 0 ), - 'TANH' => array( 231, 1, 1, 0 ), - 'ASINH' => array( 232, 1, 1, 0 ), - 'ACOSH' => array( 233, 1, 1, 0 ), - 'ATANH' => array( 234, 1, 1, 0 ), - 'DGET' => array( 235, 3, 0, 0 ), - 'INFO' => array( 244, 1, 1, 1 ), - 'DB' => array( 247, -1, 1, 0 ), - 'FREQUENCY' => array( 252, 2, 0, 0 ), - 'ERROR.TYPE' => array( 261, 1, 1, 0 ), - 'REGISTER.ID' => array( 267, -1, 1, 0 ), - 'AVEDEV' => array( 269, -1, 0, 0 ), - 'BETADIST' => array( 270, -1, 1, 0 ), - 'GAMMALN' => array( 271, 1, 1, 0 ), - 'BETAINV' => array( 272, -1, 1, 0 ), - 'BINOMDIST' => array( 273, 4, 1, 0 ), - 'CHIDIST' => array( 274, 2, 1, 0 ), - 'CHIINV' => array( 275, 2, 1, 0 ), - 'COMBIN' => array( 276, 2, 1, 0 ), - 'CONFIDENCE' => array( 277, 3, 1, 0 ), - 'CRITBINOM' => array( 278, 3, 1, 0 ), - 'EVEN' => array( 279, 1, 1, 0 ), - 'EXPONDIST' => array( 280, 3, 1, 0 ), - 'FDIST' => array( 281, 3, 1, 0 ), - 'FINV' => array( 282, 3, 1, 0 ), - 'FISHER' => array( 283, 1, 1, 0 ), - 'FISHERINV' => array( 284, 1, 1, 0 ), - 'FLOOR' => array( 285, 2, 1, 0 ), - 'GAMMADIST' => array( 286, 4, 1, 0 ), - 'GAMMAINV' => array( 287, 3, 1, 0 ), - 'CEILING' => array( 288, 2, 1, 0 ), - 'HYPGEOMDIST' => array( 289, 4, 1, 0 ), - 'LOGNORMDIST' => array( 290, 3, 1, 0 ), - 'LOGINV' => array( 291, 3, 1, 0 ), - 'NEGBINOMDIST' => array( 292, 3, 1, 0 ), - 'NORMDIST' => array( 293, 4, 1, 0 ), - 'NORMSDIST' => array( 294, 1, 1, 0 ), - 'NORMINV' => array( 295, 3, 1, 0 ), - 'NORMSINV' => array( 296, 1, 1, 0 ), - 'STANDARDIZE' => array( 297, 3, 1, 0 ), - 'ODD' => array( 298, 1, 1, 0 ), - 'PERMUT' => array( 299, 2, 1, 0 ), - 'POISSON' => array( 300, 3, 1, 0 ), - 'TDIST' => array( 301, 3, 1, 0 ), - 'WEIBULL' => array( 302, 4, 1, 0 ), - 'SUMXMY2' => array( 303, 2, 2, 0 ), - 'SUMX2MY2' => array( 304, 2, 2, 0 ), - 'SUMX2PY2' => array( 305, 2, 2, 0 ), - 'CHITEST' => array( 306, 2, 2, 0 ), - 'CORREL' => array( 307, 2, 2, 0 ), - 'COVAR' => array( 308, 2, 2, 0 ), - 'FORECAST' => array( 309, 3, 2, 0 ), - 'FTEST' => array( 310, 2, 2, 0 ), - 'INTERCEPT' => array( 311, 2, 2, 0 ), - 'PEARSON' => array( 312, 2, 2, 0 ), - 'RSQ' => array( 313, 2, 2, 0 ), - 'STEYX' => array( 314, 2, 2, 0 ), - 'SLOPE' => array( 315, 2, 2, 0 ), - 'TTEST' => array( 316, 4, 2, 0 ), - 'PROB' => array( 317, -1, 2, 0 ), - 'DEVSQ' => array( 318, -1, 0, 0 ), - 'GEOMEAN' => array( 319, -1, 0, 0 ), - 'HARMEAN' => array( 320, -1, 0, 0 ), - 'SUMSQ' => array( 321, -1, 0, 0 ), - 'KURT' => array( 322, -1, 0, 0 ), - 'SKEW' => array( 323, -1, 0, 0 ), - 'ZTEST' => array( 324, -1, 0, 0 ), - 'LARGE' => array( 325, 2, 0, 0 ), - 'SMALL' => array( 326, 2, 0, 0 ), - 'QUARTILE' => array( 327, 2, 0, 0 ), - 'PERCENTILE' => array( 328, 2, 0, 0 ), - 'PERCENTRANK' => array( 329, -1, 0, 0 ), - 'MODE' => array( 330, -1, 2, 0 ), - 'TRIMMEAN' => array( 331, 2, 0, 0 ), - 'TINV' => array( 332, 2, 1, 0 ), - 'CONCATENATE' => array( 336, -1, 1, 0 ), - 'POWER' => array( 337, 2, 1, 0 ), - 'RADIANS' => array( 342, 1, 1, 0 ), - 'DEGREES' => array( 343, 1, 1, 0 ), - 'SUBTOTAL' => array( 344, -1, 0, 0 ), - 'SUMIF' => array( 345, -1, 0, 0 ), - 'COUNTIF' => array( 346, 2, 0, 0 ), - 'COUNTBLANK' => array( 347, 1, 0, 0 ), - 'ROMAN' => array( 354, -1, 1, 0 ) - ); - } - -/** -* Convert a token to the proper ptg value. -* -* @param mixed $token The token to convert. -*/ - function _convert($token) - { - if(is_numeric($token)) - { - return($this->_convert_number($token)); - } - // match references like A1 - elseif(preg_match("/^([A-I]?[A-Z])(\d+)$/",$token)) - { - return($this->_convert_ref2d($token)); - } - // match ranges like A1:B2 - elseif(preg_match("/^([A-I]?[A-Z])(\d+)\:([A-I]?[A-Z])(\d+)$/",$token)) - { - return($this->_convert_range2d($token)); - } - // match ranges like A1..B2 - elseif(preg_match("/^([A-I]?[A-Z])(\d+)\.\.([A-I]?[A-Z])(\d+)$/",$token)) - { - return($this->_convert_range2d($token)); - } - elseif(isset($this->ptg[$token])) // operators (including parentheses) - { - return(pack("C", $this->ptg[$token])); - } - elseif(preg_match("/[A-Z0-9�-�\.]+/",$token)) - { - return($this->_convert_function($token,$this->_func_args)); - } - // if it's an argument, ignore the token (the argument remains) - elseif($token == 'arg') - { - $this->_func_args++; - return(''); - } - die("Unknown token $token"); - } - -/** -* Convert a number token to ptgInt or ptgNum -* -* @param mixed $num an integer or double for conersion to its ptg value -*/ - function _convert_number($num) - { - // Integer in the range 0..2**16-1 - if ((preg_match("/^\d+$/",$num)) and ($num <= 65535)) { - return pack("Cv", $this->ptg['ptgInt'], $num); - } - else // A float - { - if($this->_byte_order) // if it's Big Endian - { - $num = strrev($num); - } - return pack("Cd", $this->ptg['ptgNum'], $num); - } - } - -/** -* Convert a function to a ptgFunc or ptgFuncVarV depending on the number of -* args that it takes. -* -* @param string $token The name of the function for convertion to ptg value. -* @param integer $num_args The number of arguments the function recieves. -*/ - function _convert_function($token, $num_args) - { - $this->_func_args = 0; // re initialize the number of arguments - $args = $this->_functions[$token][1]; - $volatile = $this->_functions[$token][3]; - - if($volatile) { - $this->_volatile = 1; - } - // Fixed number of args eg. TIME($i,$j,$k). - if ($args >= 0) - { - return(pack("Cv", $this->ptg['ptgFuncV'], $this->_functions[$token][0])); - } - // Variable number of args eg. SUM($i,$j,$k, ..). - if ($args == -1) { - return(pack("CCv", $this->ptg['ptgFuncVarV'], $num_args, $this->_functions[$token][0])); - } - } - -/** -* Convert an Excel range such as A1:D4 to a ptgRefV. -* -* @param string $range An Excel range in the A1:A2 or A1..A2 format. -*/ - function _convert_range2d($range) - { - $class = 2; // as far as I know, this is magick. - - // Split the range into 2 cell refs - if(preg_match("/^([A-I]?[A-Z])(\d+)\:([A-I]?[A-Z])(\d+)$/",$range)) { - list($cell1, $cell2) = split(':', $range); - } - elseif(preg_match("/^([A-I]?[A-Z])(\d+)\.\.([A-I]?[A-Z])(\d+)$/",$range)) { - list($cell1, $cell2) = split('\.\.', $range); - } - else { - die("Unknown range separator"); - } - - // Convert the cell references - list($row1, $col1) = $this->_cell_to_packed_rowcol($cell1); - list($row2, $col2) = $this->_cell_to_packed_rowcol($cell2); - - // The ptg value depends on the class of the ptg. - if ($class == 0) { - $ptgArea = pack("C", $this->ptg['ptgArea']); - } - elseif ($class == 1) { - $ptgArea = pack("C", $this->ptg['ptgAreaV']); - } - elseif ($class == 2) { - $ptgArea = pack("C", $this->ptg['ptgAreaA']); - } - else{ - die("Unknown class "); - } - - return($ptgArea . $row1 . $row2 . $col1. $col2); - } - -/** -* Convert an Excel reference such as A1, $B2, C$3 or $D$4 to a ptgRefV. -* -* @param string $cell An Excel cell reference -*/ - function _convert_ref2d($cell) - { - $class = 2; // as far as I know, this is magick. - - // Convert the cell reference - list($row, $col) = $this->_cell_to_packed_rowcol($cell); - - // The ptg value depends on the class of the ptg. - if ($class == 0) { - $ptgRef = pack("C", $this->ptg['ptgRef']); - } - elseif ($class == 1) { - $ptgRef = pack("C", $this->ptg['ptgRefV']); - } - elseif ($class == 2) { - $ptgRef = pack("C", $this->ptg['ptgRefA']); - } - else{ - die("Unknown class "); - } - return $ptgRef.$row.$col; - } - -/** -* pack() row and column into the required 3 byte format. -* -* @param string $cell The Excel cell reference to be packed -*/ - function _cell_to_packed_rowcol($cell) - { - list($row, $col, $row_rel, $col_rel) = $this->_cell_to_rowcol($cell); - if ($col >= 256) { - die("Column in: $cell greater than 255 "); - } - if ($row >= 16384) { - die("Row in: $cell greater than 16384 "); - } - - // Set the high bits to indicate if row or col are relative. - $row |= $col_rel << 14; - $row |= $row_rel << 15; - - $row = pack('v', $row); - $col = pack('C', $col); - - return (array($row, $col)); - } - -/** -* Convert an Excel cell reference such as A1 or $B2 or C$3 or $D$4 to a zero -* indexed row and column number. Also returns two boolean values to indicate -* whether the row or column are relative references. -* -* @param string $cell The Excel cell reference in A1 format. -*/ - function _cell_to_rowcol($cell) - { - preg_match('/(\$)?([A-I]?[A-Z])(\$)?(\d+)/',$cell,$match); - // return absolute column if there is a $ in the ref - $col_rel = empty($match[1]) ? 1 : 0; - $col_ref = $match[2]; - $row_rel = empty($match[3]) ? 1 : 0; - $row = $match[4]; - - // Convert base26 column string to a number. - $expn = strlen($col_ref) - 1; - $col = 0; - for($i=0; $i < strlen($col_ref); $i++) - { - $col += (ord($col_ref{$i}) - ord('A') + 1) * pow(26, $expn); - $expn--; - } - - // Convert 1-index to zero-index - $row--; - $col--; - - return(array($row, $col, $row_rel, $col_rel)); - } - -/** -* Advance to the next valid token. -*/ - function _advance() - { - $i = $this->_current_char; - // eat up white spaces - if($i < strlen($this->_formula)) - { - while($this->_formula{$i} == " ") - { - $i++; - } - if($i < strlen($this->_formula) - 1) - { - $this->_lookahead = $this->_formula{$i+1}; - } - $token = ""; - } - while($i < strlen($this->_formula)) - { - $token .= $this->_formula{$i}; - if($this->_match($token) != '') - { - if($i < strlen($this->_formula) - 1) - { - $this->_lookahead = $this->_formula{$i+1}; - } - $this->_current_char = $i + 1; - $this->_current_token = $token; - return(1); - } - $this->_lookahead = $this->_formula{$i+2}; - $i++; - } - //die("Lexical error ".$this->_current_char); - } - -/** -* Checks if it's a valid token. -* -* @param mixed $token The token to check. -*/ - function _match($token) - { - switch($token) - { - case ADD: - return($token); - break; - case SUB: - return($token); - break; - case MUL: - return($token); - break; - case DIV: - return($token); - break; - case OPEN: - return($token); - break; - case CLOSE: - return($token); - break; - case COMA: - return($token); - break; - default: - // if it's a reference - if(preg_match("/^[A-I]?[A-Z][0-9]+$/i",$token) and - !preg_match("/[0-9]/",$this->_lookahead) and - ($this->_lookahead != ':') and ($this->_lookahead != '.')) - { - return($token); - } - // if it's a range (A1:A2) - elseif(preg_match("/^[A-I]?[A-Z][0-9]+:[A-I]?[A-Z][0-9]+$/i",$token) and - !preg_match("/[0-9]/",$this->_lookahead)) - { - return($token); - } - // if it's a range (A1..A2) - elseif(preg_match("/^[A-I]?[A-Z][0-9]+\.\.[A-I]?[A-Z][0-9]+$/i",$token) and - !preg_match("/[0-9]/",$this->_lookahead)) - { - return($token); - } - elseif(is_numeric($token) and !is_numeric($token.$this->_lookahead)) - { - return($token); - } - // if it's a function call - elseif(preg_match("/^[A-Z0-9�-�\.]+$/i",$token) and ($this->_lookahead == "(")) - - { - return($token); - } - return ''; - } - } - -/** -* The parsing method. It parses a formula. -* -* @access public -* @param string $formula The formula to parse, without the initial equal sign (=). -*/ - function parse($formula) - { - $this->_current_char = 0; - $this->_formula = $formula; - $this->_lookahead = $formula{1}; - $this->_advance(); - $this->_parse_tree = $this->_expression(); - } - -/** -* It parses a expression. It assumes the following rule: -* Expr -> Term [("+" | "-") Term] -* -* @return mixed The parsed ptg'd tree -*/ - function _expression() - { - $result = $this->_term(); - while ($this->_current_token == ADD or $this->_current_token == SUB) - { - if ($this->_current_token == ADD) - { - $this->_advance(); - $result = $this->_create_tree('ptgAdd', $result, $this->_term()); - } - else - { - $this->_advance(); - $result = $this->_create_tree('ptgSub', $result, $this->_term()); - } - } - return $result; - } - -/** -* This function just introduces a ptgParen element in the tree, so that Excel -* doesn't get confused when working with a parenthesized formula afterwards. -* -* @see _fact -* @return mixed The parsed ptg'd tree -*/ - function _parenthesized_expression() - { - $result = $this->_create_tree('ptgParen', $this->_expression(), ''); - return($result); - } - -/** -* It parses a term. It assumes the following rule: -* Term -> Fact [("*" | "/") Fact] -* -* @return mixed The parsed ptg'd tree -*/ - function _term() - { - $result = $this->_fact(); - while ($this->_current_token == MUL || $this->_current_token == DIV) - { - if ($this->_current_token == MUL) - { - $this->_advance(); - $result = $this->_create_tree('ptgMul', $result, $this->_fact()); - } - else - { - $this->_advance(); - $result = $this->_create_tree('ptgDiv', $result, $this->_fact()); - } - } - return($result); - } - -/** -* It parses a factor. It assumes the following rule: -* Fact -> ( Expr ) -* | CellRef -* | CellRange -* | Number -* | Function -* -* @return mixed The parsed ptg'd tree -*/ - function _fact() - { - if ($this->_current_token == OPEN) - { - $this->_advance(); // eat the "(" - $result = $this->_parenthesized_expression();//$this->_expression(); - - if ($this->_current_token != CLOSE) { - die("')' token expected."); - } - $this->_advance(); // eat the ")" - return($result); - } - // if it's a reference - if (preg_match("/^[A-I]?[A-Z][0-9]+$/i",$this->_current_token)) - { - $result = $this->_create_tree($this->_current_token, '', ''); - $this->_advance(); - return($result); - } - // if it's a range - elseif (preg_match("/^[A-I]?[A-Z][0-9]+:[A-I]?[A-Z][0-9]+$/i",$this->_current_token) or - preg_match("/^[A-I]?[A-Z][0-9]+\.\.[A-I]?[A-Z][0-9]+$/i",$this->_current_token)) - { - $result = $this->_current_token; - $this->_advance(); - return($result); - } - elseif (is_numeric($this->_current_token)) - { - $result = $this->_create_tree($this->_current_token, '', ''); - $this->_advance(); - return($result); - } - // if it's a function call - elseif (preg_match("/^[A-Z0-9�-�\.]+$/i",$this->_current_token)) - { - $result = $this->_func(); - return($result); - } - die("Sintactic error: ".$this->_current_token.", lookahead: ". - $this->_lookahead.", current char: ".$this->_current_char); - } - -/** -* It parses a function call. It assumes the following rule: -* Func -> ( Expr [,Expr]* ) -* -*/ - function _func() - { - $num_args = 0; // number of arguments received - $function = $this->_current_token; - $this->_advance(); - $this->_advance(); // eat the "(" - while($this->_current_token != ')') - { - if($num_args > 0) - { - if($this->_current_token == COMA) { - $this->_advance(); // eat the "," - } - else { - die("Sintactic error: coma expected $num_args"); - } - $result = $this->_create_tree('arg', $result, $this->_expression()); - } - else { - $result = $this->_create_tree('arg', '', $this->_expression()); - } - $num_args++; - } - $args = $this->_functions[$function][1]; - // If fixed number of args eg. TIME($i,$j,$k). Check that the number of args is valid. - if (($args >= 0) and ($args != $num_args)) - { - die("Incorrect number of arguments in function $function() "); - } - - $result = $this->_create_tree($function, $result, ''); - $this->_advance(); // eat the ")" - return($result); - } - -/** -* Creates a tree. In fact an array which may have one or two arrays (sub-trees) -* as elements. -* -* @param mixed $value The value of this node. -* @param mixed $left The left array (sub-tree) or a final node. -* @param mixed $right The right array (sub-tree) or a final node. -*/ - function _create_tree($value, $left, $right) - { - return array('value' => $value, 'left' => $left, 'right' => $right); - } - -/** -* Builds a string containing the tree in reverse polish notation (What you -* would use in a HP calculator stack). -* The following tree: -* -* + -* / \ -* 2 3 -* -* produces: "23+" -* -* The following tree: -* -* + -* / \ -* 3 * -* / \ -* 6 A1 -* -* produces: "36A1*+" -* -* In fact all operands, functions, references, etc... are written as ptg's -* -* @access public -* @param array $tree The optional tree to convert. -*/ - function to_reverse_polish($tree = array()) - { - $polish = ""; // the string we are going to return - if (empty($tree)) // If it's the first call use _parse_tree - { - $tree = $this->_parse_tree; - } - if (is_array($tree['left'])) - { - $polish .= $this->to_reverse_polish($tree['left']); - } - elseif($tree['left'] != '') // It's a final node - { - $polish .= $this->_convert($tree['left']); //$tree['left']; - } - if (is_array($tree['right'])) - { - $polish .= $this->to_reverse_polish($tree['right']); - } - elseif($tree['right'] != '') // It's a final node - { - $polish .= $this->_convert($tree['right']); - } - $polish .= $this->_convert($tree['value']); - return $polish; - } - } + +* @package Spreadsheet_WriteExcel +*/ +class Parser + { +/** +* The class constructor +* +* @param integer $byte_order The byte order (Little endian or Big endian) of the architecture + (optional). 1 => big endian, 0 (default) => little endian. +*/ + function Parser($byte_order = 0) + { + $this->_current_char = 0; // The index of the character we are currently looking at. + $this->_current_token = ''; // The token we are working on. + $this->_formula = ""; // The formula to parse. + $this->_lookahead = ''; // The character ahead of the current char. + $this->_parse_tree = ''; // The parse tree to be generated. + $this->_initialize_hashes(); // Initialize the hashes: ptg's and function's ptg's + $this->_byte_order = $byte_order; // Little Endian or Big Endian + $this->_func_args = 0; // Number of arguments for the current function + $this->_volatile = 0; + } + +/** +* Initialize the ptg and function hashes. +*/ + function _initialize_hashes() + { + // The Excel ptg indices + $this->ptg = array( + 'ptgExp' => 0x01, + 'ptgTbl' => 0x02, + 'ptgAdd' => 0x03, + 'ptgSub' => 0x04, + 'ptgMul' => 0x05, + 'ptgDiv' => 0x06, + 'ptgPower' => 0x07, + 'ptgConcat' => 0x08, + 'ptgLT' => 0x09, + 'ptgLE' => 0x0A, + 'ptgEQ' => 0x0B, + 'ptgGE' => 0x0C, + 'ptgGT' => 0x0D, + 'ptgNE' => 0x0E, + 'ptgIsect' => 0x0F, + 'ptgUnion' => 0x10, + 'ptgRange' => 0x11, + 'ptgUplus' => 0x12, + 'ptgUminus' => 0x13, + 'ptgPercent' => 0x14, + 'ptgParen' => 0x15, + 'ptgMissArg' => 0x16, + 'ptgStr' => 0x17, + 'ptgAttr' => 0x19, + 'ptgSheet' => 0x1A, + 'ptgEndSheet' => 0x1B, + 'ptgErr' => 0x1C, + 'ptgBool' => 0x1D, + 'ptgInt' => 0x1E, + 'ptgNum' => 0x1F, + 'ptgArray' => 0x20, + 'ptgFunc' => 0x21, + 'ptgFuncVar' => 0x22, + 'ptgName' => 0x23, + 'ptgRef' => 0x24, + 'ptgArea' => 0x25, + 'ptgMemArea' => 0x26, + 'ptgMemErr' => 0x27, + 'ptgMemNoMem' => 0x28, + 'ptgMemFunc' => 0x29, + 'ptgRefErr' => 0x2A, + 'ptgAreaErr' => 0x2B, + 'ptgRefN' => 0x2C, + 'ptgAreaN' => 0x2D, + 'ptgMemAreaN' => 0x2E, + 'ptgMemNoMemN' => 0x2F, + 'ptgNameX' => 0x39, + 'ptgRef3d' => 0x3A, + 'ptgArea3d' => 0x3B, + 'ptgRefErr3d' => 0x3C, + 'ptgAreaErr3d' => 0x3D, + 'ptgArrayV' => 0x40, + 'ptgFuncV' => 0x41, + 'ptgFuncVarV' => 0x42, + 'ptgNameV' => 0x43, + 'ptgRefV' => 0x44, + 'ptgAreaV' => 0x45, + 'ptgMemAreaV' => 0x46, + 'ptgMemErrV' => 0x47, + 'ptgMemNoMemV' => 0x48, + 'ptgMemFuncV' => 0x49, + 'ptgRefErrV' => 0x4A, + 'ptgAreaErrV' => 0x4B, + 'ptgRefNV' => 0x4C, + 'ptgAreaNV' => 0x4D, + 'ptgMemAreaNV' => 0x4E, + 'ptgMemNoMemN' => 0x4F, + 'ptgFuncCEV' => 0x58, + 'ptgNameXV' => 0x59, + 'ptgRef3dV' => 0x5A, + 'ptgArea3dV' => 0x5B, + 'ptgRefErr3dV' => 0x5C, + 'ptgAreaErr3d' => 0x5D, + 'ptgArrayA' => 0x60, + 'ptgFuncA' => 0x61, + 'ptgFuncVarA' => 0x62, + 'ptgNameA' => 0x63, + 'ptgRefA' => 0x64, + 'ptgAreaA' => 0x65, + 'ptgMemAreaA' => 0x66, + 'ptgMemErrA' => 0x67, + 'ptgMemNoMemA' => 0x68, + 'ptgMemFuncA' => 0x69, + 'ptgRefErrA' => 0x6A, + 'ptgAreaErrA' => 0x6B, + 'ptgRefNA' => 0x6C, + 'ptgAreaNA' => 0x6D, + 'ptgMemAreaNA' => 0x6E, + 'ptgMemNoMemN' => 0x6F, + 'ptgFuncCEA' => 0x78, + 'ptgNameXA' => 0x79, + 'ptgRef3dA' => 0x7A, + 'ptgArea3dA' => 0x7B, + 'ptgRefErr3dA' => 0x7C, + 'ptgAreaErr3d' => 0x7D + ); + + // Thanks to Michael Meeks and Gnumeric for the initial arg values. + // + // The following hash was generated by "function_locale.pl" in the distro. + // Refer to function_locale.pl for non-English function names. + // + // The array elements are as follow: + // ptg: The Excel function ptg code. + // args: The number of arguments that the function takes: + // >=0 is a fixed number of arguments. + // -1 is a variable number of arguments. + // class: The reference, value or array class of the function args. + // vol: The function is volatile. + // + $this->_functions = array( + // function ptg args class vol + 'COUNT' => array( 0, -1, 0, 0 ), + 'IF' => array( 1, -1, 1, 0 ), + 'ISNA' => array( 2, 1, 1, 0 ), + 'ISERROR' => array( 3, 1, 1, 0 ), + 'SUM' => array( 4, -1, 0, 0 ), + 'AVERAGE' => array( 5, -1, 0, 0 ), + 'MIN' => array( 6, -1, 0, 0 ), + 'MAX' => array( 7, -1, 0, 0 ), + 'ROW' => array( 8, -1, 0, 0 ), + 'COLUMN' => array( 9, -1, 0, 0 ), + 'NA' => array( 10, 0, 0, 0 ), + 'NPV' => array( 11, -1, 1, 0 ), + 'STDEV' => array( 12, -1, 0, 0 ), + 'DOLLAR' => array( 13, -1, 1, 0 ), + 'FIXED' => array( 14, -1, 1, 0 ), + 'SIN' => array( 15, 1, 1, 0 ), + 'COS' => array( 16, 1, 1, 0 ), + 'TAN' => array( 17, 1, 1, 0 ), + 'ATAN' => array( 18, 1, 1, 0 ), + 'PI' => array( 19, 0, 1, 0 ), + 'SQRT' => array( 20, 1, 1, 0 ), + 'EXP' => array( 21, 1, 1, 0 ), + 'LN' => array( 22, 1, 1, 0 ), + 'LOG10' => array( 23, 1, 1, 0 ), + 'ABS' => array( 24, 1, 1, 0 ), + 'INT' => array( 25, 1, 1, 0 ), + 'SIGN' => array( 26, 1, 1, 0 ), + 'ROUND' => array( 27, 2, 1, 0 ), + 'LOOKUP' => array( 28, -1, 0, 0 ), + 'INDEX' => array( 29, -1, 0, 1 ), + 'REPT' => array( 30, 2, 1, 0 ), + 'MID' => array( 31, 3, 1, 0 ), + 'LEN' => array( 32, 1, 1, 0 ), + 'VALUE' => array( 33, 1, 1, 0 ), + 'TRUE' => array( 34, 0, 1, 0 ), + 'FALSE' => array( 35, 0, 1, 0 ), + 'AND' => array( 36, -1, 0, 0 ), + 'OR' => array( 37, -1, 0, 0 ), + 'NOT' => array( 38, 1, 1, 0 ), + 'MOD' => array( 39, 2, 1, 0 ), + 'DCOUNT' => array( 40, 3, 0, 0 ), + 'DSUM' => array( 41, 3, 0, 0 ), + 'DAVERAGE' => array( 42, 3, 0, 0 ), + 'DMIN' => array( 43, 3, 0, 0 ), + 'DMAX' => array( 44, 3, 0, 0 ), + 'DSTDEV' => array( 45, 3, 0, 0 ), + 'VAR' => array( 46, -1, 0, 0 ), + 'DVAR' => array( 47, 3, 0, 0 ), + 'TEXT' => array( 48, 2, 1, 0 ), + 'LINEST' => array( 49, -1, 0, 0 ), + 'TREND' => array( 50, -1, 0, 0 ), + 'LOGEST' => array( 51, -1, 0, 0 ), + 'GROWTH' => array( 52, -1, 0, 0 ), + 'PV' => array( 56, -1, 1, 0 ), + 'FV' => array( 57, -1, 1, 0 ), + 'NPER' => array( 58, -1, 1, 0 ), + 'PMT' => array( 59, -1, 1, 0 ), + 'RATE' => array( 60, -1, 1, 0 ), + 'MIRR' => array( 61, 3, 0, 0 ), + 'IRR' => array( 62, -1, 0, 0 ), + 'RAND' => array( 63, 0, 1, 1 ), + 'MATCH' => array( 64, -1, 0, 0 ), + 'DATE' => array( 65, 3, 1, 0 ), + 'TIME' => array( 66, 3, 1, 0 ), + 'DAY' => array( 67, 1, 1, 0 ), + 'MONTH' => array( 68, 1, 1, 0 ), + 'YEAR' => array( 69, 1, 1, 0 ), + 'WEEKDAY' => array( 70, -1, 1, 0 ), + 'HOUR' => array( 71, 1, 1, 0 ), + 'MINUTE' => array( 72, 1, 1, 0 ), + 'SECOND' => array( 73, 1, 1, 0 ), + 'NOW' => array( 74, 0, 1, 1 ), + 'AREAS' => array( 75, 1, 0, 1 ), + 'ROWS' => array( 76, 1, 0, 1 ), + 'COLUMNS' => array( 77, 1, 0, 1 ), + 'OFFSET' => array( 78, -1, 0, 1 ), + 'SEARCH' => array( 82, -1, 1, 0 ), + 'TRANSPOSE' => array( 83, 1, 1, 0 ), + 'TYPE' => array( 86, 1, 1, 0 ), + 'ATAN2' => array( 97, 2, 1, 0 ), + 'ASIN' => array( 98, 1, 1, 0 ), + 'ACOS' => array( 99, 1, 1, 0 ), + 'CHOOSE' => array( 100, -1, 1, 0 ), + 'HLOOKUP' => array( 101, -1, 0, 0 ), + 'VLOOKUP' => array( 102, -1, 0, 0 ), + 'ISREF' => array( 105, 1, 0, 0 ), + 'LOG' => array( 109, -1, 1, 0 ), + 'CHAR' => array( 111, 1, 1, 0 ), + 'LOWER' => array( 112, 1, 1, 0 ), + 'UPPER' => array( 113, 1, 1, 0 ), + 'PROPER' => array( 114, 1, 1, 0 ), + 'LEFT' => array( 115, -1, 1, 0 ), + 'RIGHT' => array( 116, -1, 1, 0 ), + 'EXACT' => array( 117, 2, 1, 0 ), + 'TRIM' => array( 118, 1, 1, 0 ), + 'REPLACE' => array( 119, 4, 1, 0 ), + 'SUBSTITUTE' => array( 120, -1, 1, 0 ), + 'CODE' => array( 121, 1, 1, 0 ), + 'FIND' => array( 124, -1, 1, 0 ), + 'CELL' => array( 125, -1, 0, 1 ), + 'ISERR' => array( 126, 1, 1, 0 ), + 'ISTEXT' => array( 127, 1, 1, 0 ), + 'ISNUMBER' => array( 128, 1, 1, 0 ), + 'ISBLANK' => array( 129, 1, 1, 0 ), + 'T' => array( 130, 1, 0, 0 ), + 'N' => array( 131, 1, 0, 0 ), + 'DATEVALUE' => array( 140, 1, 1, 0 ), + 'TIMEVALUE' => array( 141, 1, 1, 0 ), + 'SLN' => array( 142, 3, 1, 0 ), + 'SYD' => array( 143, 4, 1, 0 ), + 'DDB' => array( 144, -1, 1, 0 ), + 'INDIRECT' => array( 148, -1, 1, 1 ), + 'CALL' => array( 150, -1, 1, 0 ), + 'CLEAN' => array( 162, 1, 1, 0 ), + 'MDETERM' => array( 163, 1, 2, 0 ), + 'MINVERSE' => array( 164, 1, 2, 0 ), + 'MMULT' => array( 165, 2, 2, 0 ), + 'IPMT' => array( 167, -1, 1, 0 ), + 'PPMT' => array( 168, -1, 1, 0 ), + 'COUNTA' => array( 169, -1, 0, 0 ), + 'PRODUCT' => array( 183, -1, 0, 0 ), + 'FACT' => array( 184, 1, 1, 0 ), + 'DPRODUCT' => array( 189, 3, 0, 0 ), + 'ISNONTEXT' => array( 190, 1, 1, 0 ), + 'STDEVP' => array( 193, -1, 0, 0 ), + 'VARP' => array( 194, -1, 0, 0 ), + 'DSTDEVP' => array( 195, 3, 0, 0 ), + 'DVARP' => array( 196, 3, 0, 0 ), + 'TRUNC' => array( 197, -1, 1, 0 ), + 'ISLOGICAL' => array( 198, 1, 1, 0 ), + 'DCOUNTA' => array( 199, 3, 0, 0 ), + 'ROUNDUP' => array( 212, 2, 1, 0 ), + 'ROUNDDOWN' => array( 213, 2, 1, 0 ), + 'RANK' => array( 216, -1, 0, 0 ), + 'ADDRESS' => array( 219, -1, 1, 0 ), + 'DAYS360' => array( 220, -1, 1, 0 ), + 'TODAY' => array( 221, 0, 1, 1 ), + 'VDB' => array( 222, -1, 1, 0 ), + 'MEDIAN' => array( 227, -1, 0, 0 ), + 'SUMPRODUCT' => array( 228, -1, 2, 0 ), + 'SINH' => array( 229, 1, 1, 0 ), + 'COSH' => array( 230, 1, 1, 0 ), + 'TANH' => array( 231, 1, 1, 0 ), + 'ASINH' => array( 232, 1, 1, 0 ), + 'ACOSH' => array( 233, 1, 1, 0 ), + 'ATANH' => array( 234, 1, 1, 0 ), + 'DGET' => array( 235, 3, 0, 0 ), + 'INFO' => array( 244, 1, 1, 1 ), + 'DB' => array( 247, -1, 1, 0 ), + 'FREQUENCY' => array( 252, 2, 0, 0 ), + 'ERROR.TYPE' => array( 261, 1, 1, 0 ), + 'REGISTER.ID' => array( 267, -1, 1, 0 ), + 'AVEDEV' => array( 269, -1, 0, 0 ), + 'BETADIST' => array( 270, -1, 1, 0 ), + 'GAMMALN' => array( 271, 1, 1, 0 ), + 'BETAINV' => array( 272, -1, 1, 0 ), + 'BINOMDIST' => array( 273, 4, 1, 0 ), + 'CHIDIST' => array( 274, 2, 1, 0 ), + 'CHIINV' => array( 275, 2, 1, 0 ), + 'COMBIN' => array( 276, 2, 1, 0 ), + 'CONFIDENCE' => array( 277, 3, 1, 0 ), + 'CRITBINOM' => array( 278, 3, 1, 0 ), + 'EVEN' => array( 279, 1, 1, 0 ), + 'EXPONDIST' => array( 280, 3, 1, 0 ), + 'FDIST' => array( 281, 3, 1, 0 ), + 'FINV' => array( 282, 3, 1, 0 ), + 'FISHER' => array( 283, 1, 1, 0 ), + 'FISHERINV' => array( 284, 1, 1, 0 ), + 'FLOOR' => array( 285, 2, 1, 0 ), + 'GAMMADIST' => array( 286, 4, 1, 0 ), + 'GAMMAINV' => array( 287, 3, 1, 0 ), + 'CEILING' => array( 288, 2, 1, 0 ), + 'HYPGEOMDIST' => array( 289, 4, 1, 0 ), + 'LOGNORMDIST' => array( 290, 3, 1, 0 ), + 'LOGINV' => array( 291, 3, 1, 0 ), + 'NEGBINOMDIST' => array( 292, 3, 1, 0 ), + 'NORMDIST' => array( 293, 4, 1, 0 ), + 'NORMSDIST' => array( 294, 1, 1, 0 ), + 'NORMINV' => array( 295, 3, 1, 0 ), + 'NORMSINV' => array( 296, 1, 1, 0 ), + 'STANDARDIZE' => array( 297, 3, 1, 0 ), + 'ODD' => array( 298, 1, 1, 0 ), + 'PERMUT' => array( 299, 2, 1, 0 ), + 'POISSON' => array( 300, 3, 1, 0 ), + 'TDIST' => array( 301, 3, 1, 0 ), + 'WEIBULL' => array( 302, 4, 1, 0 ), + 'SUMXMY2' => array( 303, 2, 2, 0 ), + 'SUMX2MY2' => array( 304, 2, 2, 0 ), + 'SUMX2PY2' => array( 305, 2, 2, 0 ), + 'CHITEST' => array( 306, 2, 2, 0 ), + 'CORREL' => array( 307, 2, 2, 0 ), + 'COVAR' => array( 308, 2, 2, 0 ), + 'FORECAST' => array( 309, 3, 2, 0 ), + 'FTEST' => array( 310, 2, 2, 0 ), + 'INTERCEPT' => array( 311, 2, 2, 0 ), + 'PEARSON' => array( 312, 2, 2, 0 ), + 'RSQ' => array( 313, 2, 2, 0 ), + 'STEYX' => array( 314, 2, 2, 0 ), + 'SLOPE' => array( 315, 2, 2, 0 ), + 'TTEST' => array( 316, 4, 2, 0 ), + 'PROB' => array( 317, -1, 2, 0 ), + 'DEVSQ' => array( 318, -1, 0, 0 ), + 'GEOMEAN' => array( 319, -1, 0, 0 ), + 'HARMEAN' => array( 320, -1, 0, 0 ), + 'SUMSQ' => array( 321, -1, 0, 0 ), + 'KURT' => array( 322, -1, 0, 0 ), + 'SKEW' => array( 323, -1, 0, 0 ), + 'ZTEST' => array( 324, -1, 0, 0 ), + 'LARGE' => array( 325, 2, 0, 0 ), + 'SMALL' => array( 326, 2, 0, 0 ), + 'QUARTILE' => array( 327, 2, 0, 0 ), + 'PERCENTILE' => array( 328, 2, 0, 0 ), + 'PERCENTRANK' => array( 329, -1, 0, 0 ), + 'MODE' => array( 330, -1, 2, 0 ), + 'TRIMMEAN' => array( 331, 2, 0, 0 ), + 'TINV' => array( 332, 2, 1, 0 ), + 'CONCATENATE' => array( 336, -1, 1, 0 ), + 'POWER' => array( 337, 2, 1, 0 ), + 'RADIANS' => array( 342, 1, 1, 0 ), + 'DEGREES' => array( 343, 1, 1, 0 ), + 'SUBTOTAL' => array( 344, -1, 0, 0 ), + 'SUMIF' => array( 345, -1, 0, 0 ), + 'COUNTIF' => array( 346, 2, 0, 0 ), + 'COUNTBLANK' => array( 347, 1, 0, 0 ), + 'ROMAN' => array( 354, -1, 1, 0 ) + ); + } + +/** +* Convert a token to the proper ptg value. +* +* @param mixed $token The token to convert. +*/ + function _convert($token) + { + if(is_numeric($token)) + { + return($this->_convert_number($token)); + } + // match references like A1 + elseif(preg_match("/^([A-I]?[A-Z])(\d+)$/",$token)) + { + return($this->_convert_ref2d($token)); + } + // match ranges like A1:B2 + elseif(preg_match("/^([A-I]?[A-Z])(\d+)\:([A-I]?[A-Z])(\d+)$/",$token)) + { + return($this->_convert_range2d($token)); + } + // match ranges like A1..B2 + elseif(preg_match("/^([A-I]?[A-Z])(\d+)\.\.([A-I]?[A-Z])(\d+)$/",$token)) + { + return($this->_convert_range2d($token)); + } + elseif(isset($this->ptg[$token])) // operators (including parentheses) + { + return(pack("C", $this->ptg[$token])); + } + elseif(preg_match("/[A-Z0-9�-�\.]+/",$token)) + { + return($this->_convert_function($token,$this->_func_args)); + } + // if it's an argument, ignore the token (the argument remains) + elseif($token == 'arg') + { + $this->_func_args++; + return(''); + } + die("Unknown token $token"); + } + +/** +* Convert a number token to ptgInt or ptgNum +* +* @param mixed $num an integer or double for conersion to its ptg value +*/ + function _convert_number($num) + { + // Integer in the range 0..2**16-1 + if ((preg_match("/^\d+$/",$num)) and ($num <= 65535)) { + return pack("Cv", $this->ptg['ptgInt'], $num); + } + else // A float + { + if($this->_byte_order) // if it's Big Endian + { + $num = strrev($num); + } + return pack("Cd", $this->ptg['ptgNum'], $num); + } + } + +/** +* Convert a function to a ptgFunc or ptgFuncVarV depending on the number of +* args that it takes. +* +* @param string $token The name of the function for convertion to ptg value. +* @param integer $num_args The number of arguments the function recieves. +*/ + function _convert_function($token, $num_args) + { + $this->_func_args = 0; // re initialize the number of arguments + $args = $this->_functions[$token][1]; + $volatile = $this->_functions[$token][3]; + + if($volatile) { + $this->_volatile = 1; + } + // Fixed number of args eg. TIME($i,$j,$k). + if ($args >= 0) + { + return(pack("Cv", $this->ptg['ptgFuncV'], $this->_functions[$token][0])); + } + // Variable number of args eg. SUM($i,$j,$k, ..). + if ($args == -1) { + return(pack("CCv", $this->ptg['ptgFuncVarV'], $num_args, $this->_functions[$token][0])); + } + } + +/** +* Convert an Excel range such as A1:D4 to a ptgRefV. +* +* @param string $range An Excel range in the A1:A2 or A1..A2 format. +*/ + function _convert_range2d($range) + { + $class = 2; // as far as I know, this is magick. + + // Split the range into 2 cell refs + if(preg_match("/^([A-I]?[A-Z])(\d+)\:([A-I]?[A-Z])(\d+)$/",$range)) { + list($cell1, $cell2) = split(':', $range); + } + elseif(preg_match("/^([A-I]?[A-Z])(\d+)\.\.([A-I]?[A-Z])(\d+)$/",$range)) { + list($cell1, $cell2) = split('\.\.', $range); + } + else { + die("Unknown range separator"); + } + + // Convert the cell references + list($row1, $col1) = $this->_cell_to_packed_rowcol($cell1); + list($row2, $col2) = $this->_cell_to_packed_rowcol($cell2); + + // The ptg value depends on the class of the ptg. + if ($class == 0) { + $ptgArea = pack("C", $this->ptg['ptgArea']); + } + elseif ($class == 1) { + $ptgArea = pack("C", $this->ptg['ptgAreaV']); + } + elseif ($class == 2) { + $ptgArea = pack("C", $this->ptg['ptgAreaA']); + } + else{ + die("Unknown class "); + } + + return($ptgArea . $row1 . $row2 . $col1. $col2); + } + +/** +* Convert an Excel reference such as A1, $B2, C$3 or $D$4 to a ptgRefV. +* +* @param string $cell An Excel cell reference +*/ + function _convert_ref2d($cell) + { + $class = 2; // as far as I know, this is magick. + + // Convert the cell reference + list($row, $col) = $this->_cell_to_packed_rowcol($cell); + + // The ptg value depends on the class of the ptg. + if ($class == 0) { + $ptgRef = pack("C", $this->ptg['ptgRef']); + } + elseif ($class == 1) { + $ptgRef = pack("C", $this->ptg['ptgRefV']); + } + elseif ($class == 2) { + $ptgRef = pack("C", $this->ptg['ptgRefA']); + } + else{ + die("Unknown class "); + } + return $ptgRef.$row.$col; + } + +/** +* pack() row and column into the required 3 byte format. +* +* @param string $cell The Excel cell reference to be packed +*/ + function _cell_to_packed_rowcol($cell) + { + list($row, $col, $row_rel, $col_rel) = $this->_cell_to_rowcol($cell); + if ($col >= 256) { + die("Column in: $cell greater than 255 "); + } + if ($row >= 16384) { + die("Row in: $cell greater than 16384 "); + } + + // Set the high bits to indicate if row or col are relative. + $row |= $col_rel << 14; + $row |= $row_rel << 15; + + $row = pack('v', $row); + $col = pack('C', $col); + + return (array($row, $col)); + } + +/** +* Convert an Excel cell reference such as A1 or $B2 or C$3 or $D$4 to a zero +* indexed row and column number. Also returns two boolean values to indicate +* whether the row or column are relative references. +* +* @param string $cell The Excel cell reference in A1 format. +*/ + function _cell_to_rowcol($cell) + { + preg_match('/(\$)?([A-I]?[A-Z])(\$)?(\d+)/',$cell,$match); + // return absolute column if there is a $ in the ref + $col_rel = empty($match[1]) ? 1 : 0; + $col_ref = $match[2]; + $row_rel = empty($match[3]) ? 1 : 0; + $row = $match[4]; + + // Convert base26 column string to a number. + $expn = strlen($col_ref) - 1; + $col = 0; + for($i=0; $i < strlen($col_ref); $i++) + { + $col += (ord($col_ref{$i}) - ord('A') + 1) * pow(26, $expn); + $expn--; + } + + // Convert 1-index to zero-index + $row--; + $col--; + + return(array($row, $col, $row_rel, $col_rel)); + } + +/** +* Advance to the next valid token. +*/ + function _advance() + { + $i = $this->_current_char; + // eat up white spaces + if($i < strlen($this->_formula)) + { + while($this->_formula{$i} == " ") + { + $i++; + } + if($i < strlen($this->_formula) - 1) + { + $this->_lookahead = $this->_formula{$i+1}; + } + $token = ""; + } + while($i < strlen($this->_formula)) + { + $token .= $this->_formula{$i}; + if($this->_match($token) != '') + { + if($i < strlen($this->_formula) - 1) + { + $this->_lookahead = $this->_formula{$i+1}; + } + $this->_current_char = $i + 1; + $this->_current_token = $token; + return(1); + } + $this->_lookahead = $this->_formula{$i+2}; + $i++; + } + //die("Lexical error ".$this->_current_char); + } + +/** +* Checks if it's a valid token. +* +* @param mixed $token The token to check. +*/ + function _match($token) + { + switch($token) + { + case ADD: + return($token); + break; + case SUB: + return($token); + break; + case MUL: + return($token); + break; + case DIV: + return($token); + break; + case OPEN: + return($token); + break; + case CLOSE: + return($token); + break; + case COMA: + return($token); + break; + default: + // if it's a reference + if(preg_match("/^[A-I]?[A-Z][0-9]+$/i",$token) and + !preg_match("/[0-9]/",$this->_lookahead) and + ($this->_lookahead != ':') and ($this->_lookahead != '.')) + { + return($token); + } + // if it's a range (A1:A2) + elseif(preg_match("/^[A-I]?[A-Z][0-9]+:[A-I]?[A-Z][0-9]+$/i",$token) and + !preg_match("/[0-9]/",$this->_lookahead)) + { + return($token); + } + // if it's a range (A1..A2) + elseif(preg_match("/^[A-I]?[A-Z][0-9]+\.\.[A-I]?[A-Z][0-9]+$/i",$token) and + !preg_match("/[0-9]/",$this->_lookahead)) + { + return($token); + } + elseif(is_numeric($token) and !is_numeric($token.$this->_lookahead)) + { + return($token); + } + // if it's a function call + elseif(preg_match("/^[A-Z0-9�-�\.]+$/i",$token) and ($this->_lookahead == "(")) + + { + return($token); + } + return ''; + } + } + +/** +* The parsing method. It parses a formula. +* +* @access public +* @param string $formula The formula to parse, without the initial equal sign (=). +*/ + function parse($formula) + { + $this->_current_char = 0; + $this->_formula = $formula; + $this->_lookahead = $formula{1}; + $this->_advance(); + $this->_parse_tree = $this->_expression(); + } + +/** +* It parses a expression. It assumes the following rule: +* Expr -> Term [("+" | "-") Term] +* +* @return mixed The parsed ptg'd tree +*/ + function _expression() + { + $result = $this->_term(); + while ($this->_current_token == ADD or $this->_current_token == SUB) + { + if ($this->_current_token == ADD) + { + $this->_advance(); + $result = $this->_create_tree('ptgAdd', $result, $this->_term()); + } + else + { + $this->_advance(); + $result = $this->_create_tree('ptgSub', $result, $this->_term()); + } + } + return $result; + } + +/** +* This function just introduces a ptgParen element in the tree, so that Excel +* doesn't get confused when working with a parenthesized formula afterwards. +* +* @see _fact +* @return mixed The parsed ptg'd tree +*/ + function _parenthesized_expression() + { + $result = $this->_create_tree('ptgParen', $this->_expression(), ''); + return($result); + } + +/** +* It parses a term. It assumes the following rule: +* Term -> Fact [("*" | "/") Fact] +* +* @return mixed The parsed ptg'd tree +*/ + function _term() + { + $result = $this->_fact(); + while ($this->_current_token == MUL || $this->_current_token == DIV) + { + if ($this->_current_token == MUL) + { + $this->_advance(); + $result = $this->_create_tree('ptgMul', $result, $this->_fact()); + } + else + { + $this->_advance(); + $result = $this->_create_tree('ptgDiv', $result, $this->_fact()); + } + } + return($result); + } + +/** +* It parses a factor. It assumes the following rule: +* Fact -> ( Expr ) +* | CellRef +* | CellRange +* | Number +* | Function +* +* @return mixed The parsed ptg'd tree +*/ + function _fact() + { + if ($this->_current_token == OPEN) + { + $this->_advance(); // eat the "(" + $result = $this->_parenthesized_expression();//$this->_expression(); + + if ($this->_current_token != CLOSE) { + die("')' token expected."); + } + $this->_advance(); // eat the ")" + return($result); + } + // if it's a reference + if (preg_match("/^[A-I]?[A-Z][0-9]+$/i",$this->_current_token)) + { + $result = $this->_create_tree($this->_current_token, '', ''); + $this->_advance(); + return($result); + } + // if it's a range + elseif (preg_match("/^[A-I]?[A-Z][0-9]+:[A-I]?[A-Z][0-9]+$/i",$this->_current_token) or + preg_match("/^[A-I]?[A-Z][0-9]+\.\.[A-I]?[A-Z][0-9]+$/i",$this->_current_token)) + { + $result = $this->_current_token; + $this->_advance(); + return($result); + } + elseif (is_numeric($this->_current_token)) + { + $result = $this->_create_tree($this->_current_token, '', ''); + $this->_advance(); + return($result); + } + // if it's a function call + elseif (preg_match("/^[A-Z0-9�-�\.]+$/i",$this->_current_token)) + { + $result = $this->_func(); + return($result); + } + die("Sintactic error: ".$this->_current_token.", lookahead: ". + $this->_lookahead.", current char: ".$this->_current_char); + } + +/** +* It parses a function call. It assumes the following rule: +* Func -> ( Expr [,Expr]* ) +* +*/ + function _func() + { + $num_args = 0; // number of arguments received + $function = $this->_current_token; + $this->_advance(); + $this->_advance(); // eat the "(" + while($this->_current_token != ')') + { + if($num_args > 0) + { + if($this->_current_token == COMA) { + $this->_advance(); // eat the "," + } + else { + die("Sintactic error: coma expected $num_args"); + } + $result = $this->_create_tree('arg', $result, $this->_expression()); + } + else { + $result = $this->_create_tree('arg', '', $this->_expression()); + } + $num_args++; + } + $args = $this->_functions[$function][1]; + // If fixed number of args eg. TIME($i,$j,$k). Check that the number of args is valid. + if (($args >= 0) and ($args != $num_args)) + { + die("Incorrect number of arguments in function $function() "); + } + + $result = $this->_create_tree($function, $result, ''); + $this->_advance(); // eat the ")" + return($result); + } + +/** +* Creates a tree. In fact an array which may have one or two arrays (sub-trees) +* as elements. +* +* @param mixed $value The value of this node. +* @param mixed $left The left array (sub-tree) or a final node. +* @param mixed $right The right array (sub-tree) or a final node. +*/ + function _create_tree($value, $left, $right) + { + return array('value' => $value, 'left' => $left, 'right' => $right); + } + +/** +* Builds a string containing the tree in reverse polish notation (What you +* would use in a HP calculator stack). +* The following tree: +* +* + +* / \ +* 2 3 +* +* produces: "23+" +* +* The following tree: +* +* + +* / \ +* 3 * +* / \ +* 6 A1 +* +* produces: "36A1*+" +* +* In fact all operands, functions, references, etc... are written as ptg's +* +* @access public +* @param array $tree The optional tree to convert. +*/ + function to_reverse_polish($tree = array()) + { + $polish = ""; // the string we are going to return + if (empty($tree)) // If it's the first call use _parse_tree + { + $tree = $this->_parse_tree; + } + if (is_array($tree['left'])) + { + $polish .= $this->to_reverse_polish($tree['left']); + } + elseif($tree['left'] != '') // It's a final node + { + $polish .= $this->_convert($tree['left']); //$tree['left']; + } + if (is_array($tree['right'])) + { + $polish .= $this->to_reverse_polish($tree['right']); + } + elseif($tree['right'] != '') // It's a final node + { + $polish .= $this->_convert($tree['right']); + } + $polish .= $this->_convert($tree['value']); + return $polish; + } + } ?> \ No newline at end of file diff --git a/lib/excel/Workbook.php b/lib/excel/Workbook.php index 0b9fbe6e526..52058990a8d 100644 --- a/lib/excel/Workbook.php +++ b/lib/excel/Workbook.php @@ -1,954 +1,954 @@ - -* -* The majority of this is _NOT_ my code. I simply ported it from the -* PERL Spreadsheet::WriteExcel module. -* -* The author of the Spreadsheet::WriteExcel module is John McNamara -* -* -* I _DO_ maintain this code, and John McNamara has nothing to do with the -* porting of this code to PHP. Any questions directly related to this -* class library should be directed to me. -* -* License Information: -* -* Spreadsheet::WriteExcel: A library for generating Excel Spreadsheets -* Copyright (C) 2002 Xavier Noguer xnoguer@rezebra.com -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; either -* version 2.1 of the License, or (at your option) any later version. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -//require_once('Format.php'); -require_once("$CFG->libdir/excel/Format.php"); -require_once('OLEwriter.php'); -require_once('BIFFwriter.php'); - -/** -* Class for generating Excel Spreadsheets -* -* @author Xavier Noguer -* @package Spreadsheet_WriteExcel -*/ - -class Workbook extends BIFFwriter -{ - /** - * Class constructor - * - * @param string filename for storing the workbook. "-" for writing to stdout. - */ - function Workbook($filename) - { - $this->BIFFwriter(); // It needs to call its parent's constructor explicitly - - $this->_filename = $filename; - $this->parser = new Parser($this->_byte_order); - $this->_1904 = 0; - $this->activesheet = 0; - $this->firstsheet = 0; - $this->selected = 0; - $this->xf_index = 16; // 15 style XF's and 1 cell XF. - $this->_fileclosed = 0; - $this->_biffsize = 0; - $this->sheetname = "Sheet"; - $this->tmp_format = new Format(); - $this->worksheets = array(); - $this->sheetnames = array(); - $this->formats = array(); - $this->palette = array(); - - // Add the default format for hyperlinks - $this->url_format =& $this->add_format(array('color' => 'blue', 'underline' => 1)); - - // Check for a filename - //if ($this->_filename == '') { - // die('Filename required by Spreadsheet::WriteExcel->new()'); - //} - - # Warn if tmpfiles can't be used. - //$this->tmpfile_warning(); - $this->_set_palette_xl97(); - } - - /** - * Calls finalization methods and explicitly close the OLEwriter file - * handle. - */ - function close() - { - if ($this->_fileclosed) { // Prevent close() from being called twice. - return; - } - $this->store_workbook(); - $this->_fileclosed = 1; - } - - - /** - * An accessor for the _worksheets[] array - * Returns an array of the worksheet objects in a workbook - * - * @return array - */ - function sheets() - { - return($this->worksheets()); - } - - /** - * An accessor for the _worksheets[] array. - * - * @return array - */ - function worksheets() - { - return($this->worksheets); - } - - /** - * Add a new worksheet to the Excel workbook. - * TODO: Add accessor for $this->{_sheetname} for international Excel versions. - * - * @access public - * @param string $name the optional name of the worksheet - * @return &object reference to a worksheet object - */ - function &add_worksheet($name = '') - { - $index = count($this->worksheets); - $sheetname = $this->sheetname; - - if($name == '') { - $name = $sheetname.($index+1); - } - - // Check that sheetname is <= 31 chars (Excel limit). - if(strlen($name) > 31) { - die("Sheetname $name must be <= 31 chars"); - } - - // Check that the worksheet name doesn't already exist: a fatal Excel error. - for($i=0; $i < count($this->worksheets); $i++) - { - if($name == $this->worksheets[$i]->get_name()) { - die("Worksheet '$name' already exists"); - } - } - - $worksheet = new Worksheet($name,$index,$this->activesheet, - $this->firstsheet,$this->url_format, - $this->parser); - $this->worksheets[$index] = &$worksheet; // Store ref for iterator - $this->sheetnames[$index] = $name; // Store EXTERNSHEET names - //$this->parser->set_ext_sheet($name,$index); // Store names in Formula.php - return($worksheet); - } - - /** - * DEPRECATED!! Use add_worksheet instead - * - * @access public - * @deprecated Use add_worksheet instead - * @param string $name the optional name of the worksheet - * @return &object reference to a worksheet object - */ - function &addworksheet($name = '') - { - return($this->add_worksheet($name)); - } - - /** - * Add a new format to the Excel workbook. This adds an XF record and - * a FONT record. Also, pass any properties to the Format constructor. - * - * @access public - * @param array $properties array with properties for initializing the format (see Format.php) - * @return &object reference to an XF format - */ - function &add_format($properties = array()) - { - $format = new Format($this->xf_index,$properties); - $this->xf_index += 1; - $this->formats[] = &$format; - return($format); - } - - /** - * DEPRECATED!! Use add_format instead - * - * @access public - * @deprecated Use add_format instead - * @param array $properties array with properties for initializing the format (see Format.php) - * @return &object reference to an XF format - */ - function &addformat($properties = array()) - { - return($this->add_format($properties)); - } - - - /** - * Change the RGB components of the elements in the colour palette. - * - * @access public - * @param integer $index colour index - * @param integer $red red RGB value [0-255] - * @param integer $green green RGB value [0-255] - * @param integer $blue blue RGB value [0-255] - * @return integer The palette index for the custom color - */ - function set_custom_color($index,$red,$green,$blue) - { - // Match a HTML #xxyyzz style parameter - /*if (defined $_[1] and $_[1] =~ /^#(\w\w)(\w\w)(\w\w)/ ) { - @_ = ($_[0], hex $1, hex $2, hex $3); - }*/ - - // Check that the colour index is the right range - if ($index < 8 or $index > 64) { - die("Color index $index outside range: 8 <= index <= 64"); - } - - // Check that the colour components are in the right range - if ( ($red < 0 or $red > 255) || - ($green < 0 or $green > 255) || - ($blue < 0 or $blue > 255) ) - { - die("Color component outside range: 0 <= color <= 255"); - } - - $index -= 8; // Adjust colour index (wingless dragonfly) - - // Set the RGB value - $this->palette[$index] = array($red, $green, $blue, 0); - return($index + 8); - } - - /** - * Sets the colour palette to the Excel 97+ default. - */ - function _set_palette_xl97() - { - $this->palette = array( - array(0x00, 0x00, 0x00, 0x00), // 8 - array(0xff, 0xff, 0xff, 0x00), // 9 - array(0xff, 0x00, 0x00, 0x00), // 10 - array(0x00, 0xff, 0x00, 0x00), // 11 - array(0x00, 0x00, 0xff, 0x00), // 12 - array(0xff, 0xff, 0x00, 0x00), // 13 - array(0xff, 0x00, 0xff, 0x00), // 14 - array(0x00, 0xff, 0xff, 0x00), // 15 - array(0x80, 0x00, 0x00, 0x00), // 16 - array(0x00, 0x80, 0x00, 0x00), // 17 - array(0x00, 0x00, 0x80, 0x00), // 18 - array(0x80, 0x80, 0x00, 0x00), // 19 - array(0x80, 0x00, 0x80, 0x00), // 20 - array(0x00, 0x80, 0x80, 0x00), // 21 - array(0xc0, 0xc0, 0xc0, 0x00), // 22 - array(0x80, 0x80, 0x80, 0x00), // 23 - array(0x99, 0x99, 0xff, 0x00), // 24 - array(0x99, 0x33, 0x66, 0x00), // 25 - array(0xff, 0xff, 0xcc, 0x00), // 26 - array(0xcc, 0xff, 0xff, 0x00), // 27 - array(0x66, 0x00, 0x66, 0x00), // 28 - array(0xff, 0x80, 0x80, 0x00), // 29 - array(0x00, 0x66, 0xcc, 0x00), // 30 - array(0xcc, 0xcc, 0xff, 0x00), // 31 - array(0x00, 0x00, 0x80, 0x00), // 32 - array(0xff, 0x00, 0xff, 0x00), // 33 - array(0xff, 0xff, 0x00, 0x00), // 34 - array(0x00, 0xff, 0xff, 0x00), // 35 - array(0x80, 0x00, 0x80, 0x00), // 36 - array(0x80, 0x00, 0x00, 0x00), // 37 - array(0x00, 0x80, 0x80, 0x00), // 38 - array(0x00, 0x00, 0xff, 0x00), // 39 - array(0x00, 0xcc, 0xff, 0x00), // 40 - array(0xcc, 0xff, 0xff, 0x00), // 41 - array(0xcc, 0xff, 0xcc, 0x00), // 42 - array(0xff, 0xff, 0x99, 0x00), // 43 - array(0x99, 0xcc, 0xff, 0x00), // 44 - array(0xff, 0x99, 0xcc, 0x00), // 45 - array(0xcc, 0x99, 0xff, 0x00), // 46 - array(0xff, 0xcc, 0x99, 0x00), // 47 - array(0x33, 0x66, 0xff, 0x00), // 48 - array(0x33, 0xcc, 0xcc, 0x00), // 49 - array(0x99, 0xcc, 0x00, 0x00), // 50 - array(0xff, 0xcc, 0x00, 0x00), // 51 - array(0xff, 0x99, 0x00, 0x00), // 52 - array(0xff, 0x66, 0x00, 0x00), // 53 - array(0x66, 0x66, 0x99, 0x00), // 54 - array(0x96, 0x96, 0x96, 0x00), // 55 - array(0x00, 0x33, 0x66, 0x00), // 56 - array(0x33, 0x99, 0x66, 0x00), // 57 - array(0x00, 0x33, 0x00, 0x00), // 58 - array(0x33, 0x33, 0x00, 0x00), // 59 - array(0x99, 0x33, 0x00, 0x00), // 60 - array(0x99, 0x33, 0x66, 0x00), // 61 - array(0x33, 0x33, 0x99, 0x00), // 62 - array(0x33, 0x33, 0x33, 0x00), // 63 - ); - } - - - ############################################################################### - # - # _tmpfile_warning() - # - # Check that tmp files can be created for use in Worksheet.pm. A CGI, mod_perl - # or IIS might not have permission to create tmp files. The test is here rather - # than in Worksheet.pm so that only one warning is given. - # - /*sub _tmpfile_warning { - - my $fh = IO::File->new_tmpfile(); - - if ((not defined $fh) && ($^W)) { - carp("Unable to create tmp files via IO::File->new_tmpfile(). " . - "Storing data in memory") - } - }*/ - - /** - * Assemble worksheets into a workbook and send the BIFF data to an OLE - * storage. - */ - function store_workbook() - { - // Ensure that at least one worksheet has been selected. - if ($this->activesheet == 0) { - $this->worksheets[0]->selected = 1; - } - - // Calculate the number of selected worksheet tabs and call the finalization - // methods for each worksheet - for($i=0; $i < count($this->worksheets); $i++) - { - if($this->worksheets[$i]->selected) - $this->selected++; - $this->worksheets[$i]->close($this->sheetnames); - } - - // Add Workbook globals - $this->_store_bof(0x0005); - $this->_store_externs(); // For print area and repeat rows - $this->_store_names(); // For print area and repeat rows - $this->_store_window1(); - $this->_store_1904(); - $this->_store_all_fonts(); - $this->_store_all_num_formats(); - $this->_store_all_xfs(); - $this->_store_all_styles(); - $this->_store_palette(); - $this->_calc_sheet_offsets(); - - // Add BOUNDSHEET records - for($i=0; $i < count($this->worksheets); $i++) { - $this->_store_boundsheet($this->worksheets[$i]->name,$this->worksheets[$i]->offset); - } - - // End Workbook globals - $this->_store_eof(); - - // Store the workbook in an OLE container - $this->_store_OLE_file(); - } - - /** - * Store the workbook in an OLE container if the total size of the workbook data - * is less than ~ 7MB. - */ - function _store_OLE_file() - { - $OLE = new OLEwriter($this->_filename); - // Write Worksheet data if data <~ 7MB - if ($OLE->set_size($this->_biffsize)) - { - $OLE->write_header(); - $OLE->write($this->_data); - foreach($this->worksheets as $sheet) - { - while ($tmp = $sheet->get_data()) { - $OLE->write($tmp); - } - } - } - $OLE->close(); - } - - /** - * Calculate offsets for Worksheet BOF records. - */ - function _calc_sheet_offsets() - { - $BOF = 11; - $EOF = 4; - $offset = $this->_datasize; - for($i=0; $i < count($this->worksheets); $i++) { - $offset += $BOF + strlen($this->worksheets[$i]->name); - } - $offset += $EOF; - for($i=0; $i < count($this->worksheets); $i++) { - $this->worksheets[$i]->offset = $offset; - $offset += $this->worksheets[$i]->_datasize; - } - $this->_biffsize = $offset; - } - - /** - * Store the Excel FONT records. - */ - function _store_all_fonts() - { - // tmp_format is added by new(). We use this to write the default XF's - $format = $this->tmp_format; - $font = $format->get_font(); - - // Note: Fonts are 0-indexed. According to the SDK there is no index 4, - // so the following fonts are 0, 1, 2, 3, 5 - // - for($i=1; $i <= 5; $i++){ - $this->_append($font); - } - - // Iterate through the XF objects and write a FONT record if it isn't the - // same as the default FONT and if it hasn't already been used. - // - $fonts = array(); - $index = 6; // The first user defined FONT - - $key = $format->get_font_key(); // The default font from _tmp_format - $fonts[$key] = 0; // Index of the default font - - for($i=0; $i < count($this->formats); $i++) { - $key = $this->formats[$i]->get_font_key(); - if (isset($fonts[$key])) { - // FONT has already been used - $this->formats[$i]->font_index = $fonts[$key]; - } - else { - // Add a new FONT record - $fonts[$key] = $index; - $this->formats[$i]->font_index = $index; - $index++; - $font = $this->formats[$i]->get_font(); - $this->_append($font); - } - } - } - - /** - * Store user defined numerical formats i.e. FORMAT records - */ - function _store_all_num_formats() - { - // Leaning num_format syndrome - $hash_num_formats = array(); - $num_formats = array(); - $index = 164; - - // Iterate through the XF objects and write a FORMAT record if it isn't a - // built-in format type and if the FORMAT string hasn't already been used. - // - for($i=0; $i < count($this->formats); $i++) - { - $num_format = $this->formats[$i]->_num_format; - - // Check if $num_format is an index to a built-in format. - // Also check for a string of zeros, which is a valid format string - // but would evaluate to zero. - // - if (!preg_match("/^0+\d/",$num_format)) - { - if (preg_match("/^\d+$/",$num_format)) { // built-in format - continue; - } - } - - if (isset($hash_num_formats[$num_format])) { - // FORMAT has already been used - $this->formats[$i]->_num_format = $hash_num_formats[$num_format]; - } - else - { - // Add a new FORMAT - $hash_num_formats[$num_format] = $index; - $this->formats[$i]->_num_format = $index; - array_push($num_formats,$num_format); - $index++; - } - } - - // Write the new FORMAT records starting from 0xA4 - $index = 164; - foreach ($num_formats as $num_format) - { - $this->_store_num_format($num_format,$index); - $index++; - } - } - - /** - * Write all XF records. - */ - function _store_all_xfs() - { - // tmp_format is added by the constructor. We use this to write the default XF's - // The default font index is 0 - // - $format = $this->tmp_format; - for ($i=0; $i <= 14; $i++) - { - $xf = $format->get_xf('style'); // Style XF - $this->_append($xf); - } - - $xf = $format->get_xf('cell'); // Cell XF - $this->_append($xf); - - // User defined XFs - for($i=0; $i < count($this->formats); $i++) - { - $xf = $this->formats[$i]->get_xf('cell'); - $this->_append($xf); - } - } - - /** - * Write all STYLE records. - */ - function _store_all_styles() - { - $this->_store_style(); - } - - /** - * Write the EXTERNCOUNT and EXTERNSHEET records. These are used as indexes for - * the NAME records. - */ - function _store_externs() - { - // Create EXTERNCOUNT with number of worksheets - $this->_store_externcount(count($this->worksheets)); - - // Create EXTERNSHEET for each worksheet - foreach ($this->sheetnames as $sheetname) { - $this->_store_externsheet($sheetname); - } - } - - /** - * Write the NAME record to define the print area and the repeat rows and cols. - */ - function _store_names() - { - // Create the print area NAME records - foreach ($this->worksheets as $worksheet) - { - // Write a Name record if the print area has been defined - if (isset($worksheet->_print_rowmin)) - { - $this->store_name_short( - $worksheet->index, - 0x06, // NAME type - $worksheet->_print_rowmin, - $worksheet->_print_rowmax, - $worksheet->_print_colmin, - $worksheet->_print_colmax - ); - } - } - - // Create the print title NAME records - foreach ($this->worksheets as $worksheet) - { - $rowmin = $worksheet->_title_rowmin; - $rowmax = $worksheet->_title_rowmax; - $colmin = $worksheet->_title_colmin; - $colmax = $worksheet->_title_colmax; - - // Determine if row + col, row, col or nothing has been defined - // and write the appropriate record - // - if (isset($rowmin) && isset($colmin)) - { - // Row and column titles have been defined. - // Row title has been defined. - $this->store_name_long( - $worksheet->index, - 0x07, // NAME type - $rowmin, - $rowmax, - $colmin, - $colmax - ); - } - elseif (isset($rowmin)) - { - // Row title has been defined. - $this->store_name_short( - $worksheet->index, - 0x07, // NAME type - $rowmin, - $rowmax, - 0x00, - 0xff - ); - } - elseif (isset($colmin)) - { - // Column title has been defined. - $this->store_name_short( - $worksheet->index, - 0x07, // NAME type - 0x0000, - 0x3fff, - $colmin, - $colmax - ); - } - else { - // Print title hasn't been defined. - } - } - } - - - - - /****************************************************************************** - * - * BIFF RECORDS - * - */ - - /** - * Write Excel BIFF WINDOW1 record. - */ - function _store_window1() - { - $record = 0x003D; // Record identifier - $length = 0x0012; // Number of bytes to follow - - $xWn = 0x0000; // Horizontal position of window - $yWn = 0x0000; // Vertical position of window - $dxWn = 0x25BC; // Width of window - $dyWn = 0x1572; // Height of window - - $grbit = 0x0038; // Option flags - $ctabsel = $this->selected; // Number of workbook tabs selected - $wTabRatio = 0x0258; // Tab to scrollbar ratio - - $itabFirst = $this->firstsheet; // 1st displayed worksheet - $itabCur = $this->activesheet; // Active worksheet - - $header = pack("vv", $record, $length); - $data = pack("vvvvvvvvv", $xWn, $yWn, $dxWn, $dyWn, - $grbit, - $itabCur, $itabFirst, - $ctabsel, $wTabRatio); - $this->_append($header.$data); - } - - /** - * Writes Excel BIFF BOUNDSHEET record. - * - * @param string $sheetname Worksheet name - * @param integer $offset Location of worksheet BOF - */ - function _store_boundsheet($sheetname,$offset) - { - $record = 0x0085; // Record identifier - $length = 0x07 + strlen($sheetname); // Number of bytes to follow - - $grbit = 0x0000; // Sheet identifier - $cch = strlen($sheetname); // Length of sheet name - - $header = pack("vv", $record, $length); - $data = pack("VvC", $offset, $grbit, $cch); - $this->_append($header.$data.$sheetname); - } - - /** - * Write Excel BIFF STYLE records. - */ - function _store_style() - { - $record = 0x0293; // Record identifier - $length = 0x0004; // Bytes to follow - - $ixfe = 0x8000; // Index to style XF - $BuiltIn = 0x00; // Built-in style - $iLevel = 0xff; // Outline style level - - $header = pack("vv", $record, $length); - $data = pack("vCC", $ixfe, $BuiltIn, $iLevel); - $this->_append($header.$data); - } - - - /** - * Writes Excel FORMAT record for non "built-in" numerical formats. - * - * @param string $format Custom format string - * @param integer $ifmt Format index code - */ - function _store_num_format($format,$ifmt) - { - $record = 0x041E; // Record identifier - $length = 0x03 + strlen($format); // Number of bytes to follow - - $cch = strlen($format); // Length of format string - - $header = pack("vv", $record, $length); - $data = pack("vC", $ifmt, $cch); - $this->_append($header.$data.$format); - } - - /** - * Write Excel 1904 record to indicate the date system in use. - */ - function _store_1904() - { - $record = 0x0022; // Record identifier - $length = 0x0002; // Bytes to follow - - $f1904 = $this->_1904; // Flag for 1904 date system - - $header = pack("vv", $record, $length); - $data = pack("v", $f1904); - $this->_append($header.$data); - } - - - /** - * Write BIFF record EXTERNCOUNT to indicate the number of external sheet - * references in the workbook. - * - * Excel only stores references to external sheets that are used in NAME. - * The workbook NAME record is required to define the print area and the repeat - * rows and columns. - * - * A similar method is used in Worksheet.php for a slightly different purpose. - * - * @param integer $cxals Number of external references - */ - function _store_externcount($cxals) - { - $record = 0x0016; // Record identifier - $length = 0x0002; // Number of bytes to follow - - $header = pack("vv", $record, $length); - $data = pack("v", $cxals); - $this->_append($header.$data); - } - - - /** - * Writes the Excel BIFF EXTERNSHEET record. These references are used by - * formulas. NAME record is required to define the print area and the repeat - * rows and columns. - * - * A similar method is used in Worksheet.php for a slightly different purpose. - * - * @param string $sheetname Worksheet name - */ - function _store_externsheet($sheetname) - { - $record = 0x0017; // Record identifier - $length = 0x02 + strlen($sheetname); // Number of bytes to follow - - $cch = strlen($sheetname); // Length of sheet name - $rgch = 0x03; // Filename encoding - - $header = pack("vv", $record, $length); - $data = pack("CC", $cch, $rgch); - $this->_append($header.$data.$sheetname); - } - - - /** - * Store the NAME record in the short format that is used for storing the print - * area, repeat rows only and repeat columns only. - * - * @param integer $index Sheet index - * @param integer $type Built-in name type - * @param integer $rowmin Start row - * @param integer $rowmax End row - * @param integer $colmin Start colum - * @param integer $colmax End column - */ - function store_name_short($index,$type,$rowmin,$rowmax,$colmin,$colmax) - { - $record = 0x0018; // Record identifier - $length = 0x0024; // Number of bytes to follow - - $grbit = 0x0020; // Option flags - $chKey = 0x00; // Keyboard shortcut - $cch = 0x01; // Length of text name - $cce = 0x0015; // Length of text definition - $ixals = $index + 1; // Sheet index - $itab = $ixals; // Equal to ixals - $cchCustMenu = 0x00; // Length of cust menu text - $cchDescription = 0x00; // Length of description text - $cchHelptopic = 0x00; // Length of help topic text - $cchStatustext = 0x00; // Length of status bar text - $rgch = $type; // Built-in name type - - $unknown03 = 0x3b; - $unknown04 = 0xffff-$index; - $unknown05 = 0x0000; - $unknown06 = 0x0000; - $unknown07 = 0x1087; - $unknown08 = 0x8005; - - $header = pack("vv", $record, $length); - $data = pack("v", $grbit); - $data .= pack("C", $chKey); - $data .= pack("C", $cch); - $data .= pack("v", $cce); - $data .= pack("v", $ixals); - $data .= pack("v", $itab); - $data .= pack("C", $cchCustMenu); - $data .= pack("C", $cchDescription); - $data .= pack("C", $cchHelptopic); - $data .= pack("C", $cchStatustext); - $data .= pack("C", $rgch); - $data .= pack("C", $unknown03); - $data .= pack("v", $unknown04); - $data .= pack("v", $unknown05); - $data .= pack("v", $unknown06); - $data .= pack("v", $unknown07); - $data .= pack("v", $unknown08); - $data .= pack("v", $index); - $data .= pack("v", $index); - $data .= pack("v", $rowmin); - $data .= pack("v", $rowmax); - $data .= pack("C", $colmin); - $data .= pack("C", $colmax); - $this->_append($header.$data); - } - - - /** - * Store the NAME record in the long format that is used for storing the repeat - * rows and columns when both are specified. This share a lot of code with - * _store_name_short() but we use a separate method to keep the code clean. - * Code abstraction for reuse can be carried too far, and I should know. ;-) - * - * @param integer $index Sheet index - * @param integer $type Built-in name type - * @param integer $rowmin Start row - * @param integer $rowmax End row - * @param integer $colmin Start colum - * @param integer $colmax End column - */ - function store_name_long($index,$type,$rowmin,$rowmax,$colmin,$colmax) - { - $record = 0x0018; // Record identifier - $length = 0x003d; // Number of bytes to follow - $grbit = 0x0020; // Option flags - $chKey = 0x00; // Keyboard shortcut - $cch = 0x01; // Length of text name - $cce = 0x002e; // Length of text definition - $ixals = $index + 1; // Sheet index - $itab = $ixals; // Equal to ixals - $cchCustMenu = 0x00; // Length of cust menu text - $cchDescription = 0x00; // Length of description text - $cchHelptopic = 0x00; // Length of help topic text - $cchStatustext = 0x00; // Length of status bar text - $rgch = $type; // Built-in name type - - $unknown01 = 0x29; - $unknown02 = 0x002b; - $unknown03 = 0x3b; - $unknown04 = 0xffff-$index; - $unknown05 = 0x0000; - $unknown06 = 0x0000; - $unknown07 = 0x1087; - $unknown08 = 0x8008; - - $header = pack("vv", $record, $length); - $data = pack("v", $grbit); - $data .= pack("C", $chKey); - $data .= pack("C", $cch); - $data .= pack("v", $cce); - $data .= pack("v", $ixals); - $data .= pack("v", $itab); - $data .= pack("C", $cchCustMenu); - $data .= pack("C", $cchDescription); - $data .= pack("C", $cchHelptopic); - $data .= pack("C", $cchStatustext); - $data .= pack("C", $rgch); - $data .= pack("C", $unknown01); - $data .= pack("v", $unknown02); - // Column definition - $data .= pack("C", $unknown03); - $data .= pack("v", $unknown04); - $data .= pack("v", $unknown05); - $data .= pack("v", $unknown06); - $data .= pack("v", $unknown07); - $data .= pack("v", $unknown08); - $data .= pack("v", $index); - $data .= pack("v", $index); - $data .= pack("v", 0x0000); - $data .= pack("v", 0x3fff); - $data .= pack("C", $colmin); - $data .= pack("C", $colmax); - // Row definition - $data .= pack("C", $unknown03); - $data .= pack("v", $unknown04); - $data .= pack("v", $unknown05); - $data .= pack("v", $unknown06); - $data .= pack("v", $unknown07); - $data .= pack("v", $unknown08); - $data .= pack("v", $index); - $data .= pack("v", $index); - $data .= pack("v", $rowmin); - $data .= pack("v", $rowmax); - $data .= pack("C", 0x00); - $data .= pack("C", 0xff); - // End of data - $data .= pack("C", 0x10); - $this->_append($header.$data); - } - - - /** - * Stores the PALETTE biff record. - */ - function _store_palette() - { - $aref = $this->palette; - - $record = 0x0092; // Record identifier - $length = 2 + 4 * count($aref); // Number of bytes to follow - $ccv = count($aref); // Number of RGB values to follow - $data = ''; // The RGB data - - // Pack the RGB data - foreach($aref as $color) - { - foreach($color as $byte) { - $data .= pack("C",$byte); - } - } - - $header = pack("vvv", $record, $length, $ccv); - $this->_append($header.$data); - } -} + +* +* The majority of this is _NOT_ my code. I simply ported it from the +* PERL Spreadsheet::WriteExcel module. +* +* The author of the Spreadsheet::WriteExcel module is John McNamara +* +* +* I _DO_ maintain this code, and John McNamara has nothing to do with the +* porting of this code to PHP. Any questions directly related to this +* class library should be directed to me. +* +* License Information: +* +* Spreadsheet::WriteExcel: A library for generating Excel Spreadsheets +* Copyright (C) 2002 Xavier Noguer xnoguer@rezebra.com +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2.1 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +//require_once('Format.php'); +require_once("$CFG->libdir/excel/Format.php"); +require_once('OLEwriter.php'); +require_once('BIFFwriter.php'); + +/** +* Class for generating Excel Spreadsheets +* +* @author Xavier Noguer +* @package Spreadsheet_WriteExcel +*/ + +class Workbook extends BIFFwriter +{ + /** + * Class constructor + * + * @param string filename for storing the workbook. "-" for writing to stdout. + */ + function Workbook($filename) + { + $this->BIFFwriter(); // It needs to call its parent's constructor explicitly + + $this->_filename = $filename; + $this->parser = new Parser($this->_byte_order); + $this->_1904 = 0; + $this->activesheet = 0; + $this->firstsheet = 0; + $this->selected = 0; + $this->xf_index = 16; // 15 style XF's and 1 cell XF. + $this->_fileclosed = 0; + $this->_biffsize = 0; + $this->sheetname = "Sheet"; + $this->tmp_format = new Format(); + $this->worksheets = array(); + $this->sheetnames = array(); + $this->formats = array(); + $this->palette = array(); + + // Add the default format for hyperlinks + $this->url_format =& $this->add_format(array('color' => 'blue', 'underline' => 1)); + + // Check for a filename + //if ($this->_filename == '') { + // die('Filename required by Spreadsheet::WriteExcel->new()'); + //} + + # Warn if tmpfiles can't be used. + //$this->tmpfile_warning(); + $this->_set_palette_xl97(); + } + + /** + * Calls finalization methods and explicitly close the OLEwriter file + * handle. + */ + function close() + { + if ($this->_fileclosed) { // Prevent close() from being called twice. + return; + } + $this->store_workbook(); + $this->_fileclosed = 1; + } + + + /** + * An accessor for the _worksheets[] array + * Returns an array of the worksheet objects in a workbook + * + * @return array + */ + function sheets() + { + return($this->worksheets()); + } + + /** + * An accessor for the _worksheets[] array. + * + * @return array + */ + function worksheets() + { + return($this->worksheets); + } + + /** + * Add a new worksheet to the Excel workbook. + * TODO: Add accessor for $this->{_sheetname} for international Excel versions. + * + * @access public + * @param string $name the optional name of the worksheet + * @return &object reference to a worksheet object + */ + function &add_worksheet($name = '') + { + $index = count($this->worksheets); + $sheetname = $this->sheetname; + + if($name == '') { + $name = $sheetname.($index+1); + } + + // Check that sheetname is <= 31 chars (Excel limit). + if(strlen($name) > 31) { + die("Sheetname $name must be <= 31 chars"); + } + + // Check that the worksheet name doesn't already exist: a fatal Excel error. + for($i=0; $i < count($this->worksheets); $i++) + { + if($name == $this->worksheets[$i]->get_name()) { + die("Worksheet '$name' already exists"); + } + } + + $worksheet = new Worksheet($name,$index,$this->activesheet, + $this->firstsheet,$this->url_format, + $this->parser); + $this->worksheets[$index] = &$worksheet; // Store ref for iterator + $this->sheetnames[$index] = $name; // Store EXTERNSHEET names + //$this->parser->set_ext_sheet($name,$index); // Store names in Formula.php + return($worksheet); + } + + /** + * DEPRECATED!! Use add_worksheet instead + * + * @access public + * @deprecated Use add_worksheet instead + * @param string $name the optional name of the worksheet + * @return &object reference to a worksheet object + */ + function &addworksheet($name = '') + { + return($this->add_worksheet($name)); + } + + /** + * Add a new format to the Excel workbook. This adds an XF record and + * a FONT record. Also, pass any properties to the Format constructor. + * + * @access public + * @param array $properties array with properties for initializing the format (see Format.php) + * @return &object reference to an XF format + */ + function &add_format($properties = array()) + { + $format = new Format($this->xf_index,$properties); + $this->xf_index += 1; + $this->formats[] = &$format; + return($format); + } + + /** + * DEPRECATED!! Use add_format instead + * + * @access public + * @deprecated Use add_format instead + * @param array $properties array with properties for initializing the format (see Format.php) + * @return &object reference to an XF format + */ + function &addformat($properties = array()) + { + return($this->add_format($properties)); + } + + + /** + * Change the RGB components of the elements in the colour palette. + * + * @access public + * @param integer $index colour index + * @param integer $red red RGB value [0-255] + * @param integer $green green RGB value [0-255] + * @param integer $blue blue RGB value [0-255] + * @return integer The palette index for the custom color + */ + function set_custom_color($index,$red,$green,$blue) + { + // Match a HTML #xxyyzz style parameter + /*if (defined $_[1] and $_[1] =~ /^#(\w\w)(\w\w)(\w\w)/ ) { + @_ = ($_[0], hex $1, hex $2, hex $3); + }*/ + + // Check that the colour index is the right range + if ($index < 8 or $index > 64) { + die("Color index $index outside range: 8 <= index <= 64"); + } + + // Check that the colour components are in the right range + if ( ($red < 0 or $red > 255) || + ($green < 0 or $green > 255) || + ($blue < 0 or $blue > 255) ) + { + die("Color component outside range: 0 <= color <= 255"); + } + + $index -= 8; // Adjust colour index (wingless dragonfly) + + // Set the RGB value + $this->palette[$index] = array($red, $green, $blue, 0); + return($index + 8); + } + + /** + * Sets the colour palette to the Excel 97+ default. + */ + function _set_palette_xl97() + { + $this->palette = array( + array(0x00, 0x00, 0x00, 0x00), // 8 + array(0xff, 0xff, 0xff, 0x00), // 9 + array(0xff, 0x00, 0x00, 0x00), // 10 + array(0x00, 0xff, 0x00, 0x00), // 11 + array(0x00, 0x00, 0xff, 0x00), // 12 + array(0xff, 0xff, 0x00, 0x00), // 13 + array(0xff, 0x00, 0xff, 0x00), // 14 + array(0x00, 0xff, 0xff, 0x00), // 15 + array(0x80, 0x00, 0x00, 0x00), // 16 + array(0x00, 0x80, 0x00, 0x00), // 17 + array(0x00, 0x00, 0x80, 0x00), // 18 + array(0x80, 0x80, 0x00, 0x00), // 19 + array(0x80, 0x00, 0x80, 0x00), // 20 + array(0x00, 0x80, 0x80, 0x00), // 21 + array(0xc0, 0xc0, 0xc0, 0x00), // 22 + array(0x80, 0x80, 0x80, 0x00), // 23 + array(0x99, 0x99, 0xff, 0x00), // 24 + array(0x99, 0x33, 0x66, 0x00), // 25 + array(0xff, 0xff, 0xcc, 0x00), // 26 + array(0xcc, 0xff, 0xff, 0x00), // 27 + array(0x66, 0x00, 0x66, 0x00), // 28 + array(0xff, 0x80, 0x80, 0x00), // 29 + array(0x00, 0x66, 0xcc, 0x00), // 30 + array(0xcc, 0xcc, 0xff, 0x00), // 31 + array(0x00, 0x00, 0x80, 0x00), // 32 + array(0xff, 0x00, 0xff, 0x00), // 33 + array(0xff, 0xff, 0x00, 0x00), // 34 + array(0x00, 0xff, 0xff, 0x00), // 35 + array(0x80, 0x00, 0x80, 0x00), // 36 + array(0x80, 0x00, 0x00, 0x00), // 37 + array(0x00, 0x80, 0x80, 0x00), // 38 + array(0x00, 0x00, 0xff, 0x00), // 39 + array(0x00, 0xcc, 0xff, 0x00), // 40 + array(0xcc, 0xff, 0xff, 0x00), // 41 + array(0xcc, 0xff, 0xcc, 0x00), // 42 + array(0xff, 0xff, 0x99, 0x00), // 43 + array(0x99, 0xcc, 0xff, 0x00), // 44 + array(0xff, 0x99, 0xcc, 0x00), // 45 + array(0xcc, 0x99, 0xff, 0x00), // 46 + array(0xff, 0xcc, 0x99, 0x00), // 47 + array(0x33, 0x66, 0xff, 0x00), // 48 + array(0x33, 0xcc, 0xcc, 0x00), // 49 + array(0x99, 0xcc, 0x00, 0x00), // 50 + array(0xff, 0xcc, 0x00, 0x00), // 51 + array(0xff, 0x99, 0x00, 0x00), // 52 + array(0xff, 0x66, 0x00, 0x00), // 53 + array(0x66, 0x66, 0x99, 0x00), // 54 + array(0x96, 0x96, 0x96, 0x00), // 55 + array(0x00, 0x33, 0x66, 0x00), // 56 + array(0x33, 0x99, 0x66, 0x00), // 57 + array(0x00, 0x33, 0x00, 0x00), // 58 + array(0x33, 0x33, 0x00, 0x00), // 59 + array(0x99, 0x33, 0x00, 0x00), // 60 + array(0x99, 0x33, 0x66, 0x00), // 61 + array(0x33, 0x33, 0x99, 0x00), // 62 + array(0x33, 0x33, 0x33, 0x00), // 63 + ); + } + + + ############################################################################### + # + # _tmpfile_warning() + # + # Check that tmp files can be created for use in Worksheet.pm. A CGI, mod_perl + # or IIS might not have permission to create tmp files. The test is here rather + # than in Worksheet.pm so that only one warning is given. + # + /*sub _tmpfile_warning { + + my $fh = IO::File->new_tmpfile(); + + if ((not defined $fh) && ($^W)) { + carp("Unable to create tmp files via IO::File->new_tmpfile(). " . + "Storing data in memory") + } + }*/ + + /** + * Assemble worksheets into a workbook and send the BIFF data to an OLE + * storage. + */ + function store_workbook() + { + // Ensure that at least one worksheet has been selected. + if ($this->activesheet == 0) { + $this->worksheets[0]->selected = 1; + } + + // Calculate the number of selected worksheet tabs and call the finalization + // methods for each worksheet + for($i=0; $i < count($this->worksheets); $i++) + { + if($this->worksheets[$i]->selected) + $this->selected++; + $this->worksheets[$i]->close($this->sheetnames); + } + + // Add Workbook globals + $this->_store_bof(0x0005); + $this->_store_externs(); // For print area and repeat rows + $this->_store_names(); // For print area and repeat rows + $this->_store_window1(); + $this->_store_1904(); + $this->_store_all_fonts(); + $this->_store_all_num_formats(); + $this->_store_all_xfs(); + $this->_store_all_styles(); + $this->_store_palette(); + $this->_calc_sheet_offsets(); + + // Add BOUNDSHEET records + for($i=0; $i < count($this->worksheets); $i++) { + $this->_store_boundsheet($this->worksheets[$i]->name,$this->worksheets[$i]->offset); + } + + // End Workbook globals + $this->_store_eof(); + + // Store the workbook in an OLE container + $this->_store_OLE_file(); + } + + /** + * Store the workbook in an OLE container if the total size of the workbook data + * is less than ~ 7MB. + */ + function _store_OLE_file() + { + $OLE = new OLEwriter($this->_filename); + // Write Worksheet data if data <~ 7MB + if ($OLE->set_size($this->_biffsize)) + { + $OLE->write_header(); + $OLE->write($this->_data); + foreach($this->worksheets as $sheet) + { + while ($tmp = $sheet->get_data()) { + $OLE->write($tmp); + } + } + } + $OLE->close(); + } + + /** + * Calculate offsets for Worksheet BOF records. + */ + function _calc_sheet_offsets() + { + $BOF = 11; + $EOF = 4; + $offset = $this->_datasize; + for($i=0; $i < count($this->worksheets); $i++) { + $offset += $BOF + strlen($this->worksheets[$i]->name); + } + $offset += $EOF; + for($i=0; $i < count($this->worksheets); $i++) { + $this->worksheets[$i]->offset = $offset; + $offset += $this->worksheets[$i]->_datasize; + } + $this->_biffsize = $offset; + } + + /** + * Store the Excel FONT records. + */ + function _store_all_fonts() + { + // tmp_format is added by new(). We use this to write the default XF's + $format = $this->tmp_format; + $font = $format->get_font(); + + // Note: Fonts are 0-indexed. According to the SDK there is no index 4, + // so the following fonts are 0, 1, 2, 3, 5 + // + for($i=1; $i <= 5; $i++){ + $this->_append($font); + } + + // Iterate through the XF objects and write a FONT record if it isn't the + // same as the default FONT and if it hasn't already been used. + // + $fonts = array(); + $index = 6; // The first user defined FONT + + $key = $format->get_font_key(); // The default font from _tmp_format + $fonts[$key] = 0; // Index of the default font + + for($i=0; $i < count($this->formats); $i++) { + $key = $this->formats[$i]->get_font_key(); + if (isset($fonts[$key])) { + // FONT has already been used + $this->formats[$i]->font_index = $fonts[$key]; + } + else { + // Add a new FONT record + $fonts[$key] = $index; + $this->formats[$i]->font_index = $index; + $index++; + $font = $this->formats[$i]->get_font(); + $this->_append($font); + } + } + } + + /** + * Store user defined numerical formats i.e. FORMAT records + */ + function _store_all_num_formats() + { + // Leaning num_format syndrome + $hash_num_formats = array(); + $num_formats = array(); + $index = 164; + + // Iterate through the XF objects and write a FORMAT record if it isn't a + // built-in format type and if the FORMAT string hasn't already been used. + // + for($i=0; $i < count($this->formats); $i++) + { + $num_format = $this->formats[$i]->_num_format; + + // Check if $num_format is an index to a built-in format. + // Also check for a string of zeros, which is a valid format string + // but would evaluate to zero. + // + if (!preg_match("/^0+\d/",$num_format)) + { + if (preg_match("/^\d+$/",$num_format)) { // built-in format + continue; + } + } + + if (isset($hash_num_formats[$num_format])) { + // FORMAT has already been used + $this->formats[$i]->_num_format = $hash_num_formats[$num_format]; + } + else + { + // Add a new FORMAT + $hash_num_formats[$num_format] = $index; + $this->formats[$i]->_num_format = $index; + array_push($num_formats,$num_format); + $index++; + } + } + + // Write the new FORMAT records starting from 0xA4 + $index = 164; + foreach ($num_formats as $num_format) + { + $this->_store_num_format($num_format,$index); + $index++; + } + } + + /** + * Write all XF records. + */ + function _store_all_xfs() + { + // tmp_format is added by the constructor. We use this to write the default XF's + // The default font index is 0 + // + $format = $this->tmp_format; + for ($i=0; $i <= 14; $i++) + { + $xf = $format->get_xf('style'); // Style XF + $this->_append($xf); + } + + $xf = $format->get_xf('cell'); // Cell XF + $this->_append($xf); + + // User defined XFs + for($i=0; $i < count($this->formats); $i++) + { + $xf = $this->formats[$i]->get_xf('cell'); + $this->_append($xf); + } + } + + /** + * Write all STYLE records. + */ + function _store_all_styles() + { + $this->_store_style(); + } + + /** + * Write the EXTERNCOUNT and EXTERNSHEET records. These are used as indexes for + * the NAME records. + */ + function _store_externs() + { + // Create EXTERNCOUNT with number of worksheets + $this->_store_externcount(count($this->worksheets)); + + // Create EXTERNSHEET for each worksheet + foreach ($this->sheetnames as $sheetname) { + $this->_store_externsheet($sheetname); + } + } + + /** + * Write the NAME record to define the print area and the repeat rows and cols. + */ + function _store_names() + { + // Create the print area NAME records + foreach ($this->worksheets as $worksheet) + { + // Write a Name record if the print area has been defined + if (isset($worksheet->_print_rowmin)) + { + $this->store_name_short( + $worksheet->index, + 0x06, // NAME type + $worksheet->_print_rowmin, + $worksheet->_print_rowmax, + $worksheet->_print_colmin, + $worksheet->_print_colmax + ); + } + } + + // Create the print title NAME records + foreach ($this->worksheets as $worksheet) + { + $rowmin = $worksheet->_title_rowmin; + $rowmax = $worksheet->_title_rowmax; + $colmin = $worksheet->_title_colmin; + $colmax = $worksheet->_title_colmax; + + // Determine if row + col, row, col or nothing has been defined + // and write the appropriate record + // + if (isset($rowmin) && isset($colmin)) + { + // Row and column titles have been defined. + // Row title has been defined. + $this->store_name_long( + $worksheet->index, + 0x07, // NAME type + $rowmin, + $rowmax, + $colmin, + $colmax + ); + } + elseif (isset($rowmin)) + { + // Row title has been defined. + $this->store_name_short( + $worksheet->index, + 0x07, // NAME type + $rowmin, + $rowmax, + 0x00, + 0xff + ); + } + elseif (isset($colmin)) + { + // Column title has been defined. + $this->store_name_short( + $worksheet->index, + 0x07, // NAME type + 0x0000, + 0x3fff, + $colmin, + $colmax + ); + } + else { + // Print title hasn't been defined. + } + } + } + + + + + /****************************************************************************** + * + * BIFF RECORDS + * + */ + + /** + * Write Excel BIFF WINDOW1 record. + */ + function _store_window1() + { + $record = 0x003D; // Record identifier + $length = 0x0012; // Number of bytes to follow + + $xWn = 0x0000; // Horizontal position of window + $yWn = 0x0000; // Vertical position of window + $dxWn = 0x25BC; // Width of window + $dyWn = 0x1572; // Height of window + + $grbit = 0x0038; // Option flags + $ctabsel = $this->selected; // Number of workbook tabs selected + $wTabRatio = 0x0258; // Tab to scrollbar ratio + + $itabFirst = $this->firstsheet; // 1st displayed worksheet + $itabCur = $this->activesheet; // Active worksheet + + $header = pack("vv", $record, $length); + $data = pack("vvvvvvvvv", $xWn, $yWn, $dxWn, $dyWn, + $grbit, + $itabCur, $itabFirst, + $ctabsel, $wTabRatio); + $this->_append($header.$data); + } + + /** + * Writes Excel BIFF BOUNDSHEET record. + * + * @param string $sheetname Worksheet name + * @param integer $offset Location of worksheet BOF + */ + function _store_boundsheet($sheetname,$offset) + { + $record = 0x0085; // Record identifier + $length = 0x07 + strlen($sheetname); // Number of bytes to follow + + $grbit = 0x0000; // Sheet identifier + $cch = strlen($sheetname); // Length of sheet name + + $header = pack("vv", $record, $length); + $data = pack("VvC", $offset, $grbit, $cch); + $this->_append($header.$data.$sheetname); + } + + /** + * Write Excel BIFF STYLE records. + */ + function _store_style() + { + $record = 0x0293; // Record identifier + $length = 0x0004; // Bytes to follow + + $ixfe = 0x8000; // Index to style XF + $BuiltIn = 0x00; // Built-in style + $iLevel = 0xff; // Outline style level + + $header = pack("vv", $record, $length); + $data = pack("vCC", $ixfe, $BuiltIn, $iLevel); + $this->_append($header.$data); + } + + + /** + * Writes Excel FORMAT record for non "built-in" numerical formats. + * + * @param string $format Custom format string + * @param integer $ifmt Format index code + */ + function _store_num_format($format,$ifmt) + { + $record = 0x041E; // Record identifier + $length = 0x03 + strlen($format); // Number of bytes to follow + + $cch = strlen($format); // Length of format string + + $header = pack("vv", $record, $length); + $data = pack("vC", $ifmt, $cch); + $this->_append($header.$data.$format); + } + + /** + * Write Excel 1904 record to indicate the date system in use. + */ + function _store_1904() + { + $record = 0x0022; // Record identifier + $length = 0x0002; // Bytes to follow + + $f1904 = $this->_1904; // Flag for 1904 date system + + $header = pack("vv", $record, $length); + $data = pack("v", $f1904); + $this->_append($header.$data); + } + + + /** + * Write BIFF record EXTERNCOUNT to indicate the number of external sheet + * references in the workbook. + * + * Excel only stores references to external sheets that are used in NAME. + * The workbook NAME record is required to define the print area and the repeat + * rows and columns. + * + * A similar method is used in Worksheet.php for a slightly different purpose. + * + * @param integer $cxals Number of external references + */ + function _store_externcount($cxals) + { + $record = 0x0016; // Record identifier + $length = 0x0002; // Number of bytes to follow + + $header = pack("vv", $record, $length); + $data = pack("v", $cxals); + $this->_append($header.$data); + } + + + /** + * Writes the Excel BIFF EXTERNSHEET record. These references are used by + * formulas. NAME record is required to define the print area and the repeat + * rows and columns. + * + * A similar method is used in Worksheet.php for a slightly different purpose. + * + * @param string $sheetname Worksheet name + */ + function _store_externsheet($sheetname) + { + $record = 0x0017; // Record identifier + $length = 0x02 + strlen($sheetname); // Number of bytes to follow + + $cch = strlen($sheetname); // Length of sheet name + $rgch = 0x03; // Filename encoding + + $header = pack("vv", $record, $length); + $data = pack("CC", $cch, $rgch); + $this->_append($header.$data.$sheetname); + } + + + /** + * Store the NAME record in the short format that is used for storing the print + * area, repeat rows only and repeat columns only. + * + * @param integer $index Sheet index + * @param integer $type Built-in name type + * @param integer $rowmin Start row + * @param integer $rowmax End row + * @param integer $colmin Start colum + * @param integer $colmax End column + */ + function store_name_short($index,$type,$rowmin,$rowmax,$colmin,$colmax) + { + $record = 0x0018; // Record identifier + $length = 0x0024; // Number of bytes to follow + + $grbit = 0x0020; // Option flags + $chKey = 0x00; // Keyboard shortcut + $cch = 0x01; // Length of text name + $cce = 0x0015; // Length of text definition + $ixals = $index + 1; // Sheet index + $itab = $ixals; // Equal to ixals + $cchCustMenu = 0x00; // Length of cust menu text + $cchDescription = 0x00; // Length of description text + $cchHelptopic = 0x00; // Length of help topic text + $cchStatustext = 0x00; // Length of status bar text + $rgch = $type; // Built-in name type + + $unknown03 = 0x3b; + $unknown04 = 0xffff-$index; + $unknown05 = 0x0000; + $unknown06 = 0x0000; + $unknown07 = 0x1087; + $unknown08 = 0x8005; + + $header = pack("vv", $record, $length); + $data = pack("v", $grbit); + $data .= pack("C", $chKey); + $data .= pack("C", $cch); + $data .= pack("v", $cce); + $data .= pack("v", $ixals); + $data .= pack("v", $itab); + $data .= pack("C", $cchCustMenu); + $data .= pack("C", $cchDescription); + $data .= pack("C", $cchHelptopic); + $data .= pack("C", $cchStatustext); + $data .= pack("C", $rgch); + $data .= pack("C", $unknown03); + $data .= pack("v", $unknown04); + $data .= pack("v", $unknown05); + $data .= pack("v", $unknown06); + $data .= pack("v", $unknown07); + $data .= pack("v", $unknown08); + $data .= pack("v", $index); + $data .= pack("v", $index); + $data .= pack("v", $rowmin); + $data .= pack("v", $rowmax); + $data .= pack("C", $colmin); + $data .= pack("C", $colmax); + $this->_append($header.$data); + } + + + /** + * Store the NAME record in the long format that is used for storing the repeat + * rows and columns when both are specified. This share a lot of code with + * _store_name_short() but we use a separate method to keep the code clean. + * Code abstraction for reuse can be carried too far, and I should know. ;-) + * + * @param integer $index Sheet index + * @param integer $type Built-in name type + * @param integer $rowmin Start row + * @param integer $rowmax End row + * @param integer $colmin Start colum + * @param integer $colmax End column + */ + function store_name_long($index,$type,$rowmin,$rowmax,$colmin,$colmax) + { + $record = 0x0018; // Record identifier + $length = 0x003d; // Number of bytes to follow + $grbit = 0x0020; // Option flags + $chKey = 0x00; // Keyboard shortcut + $cch = 0x01; // Length of text name + $cce = 0x002e; // Length of text definition + $ixals = $index + 1; // Sheet index + $itab = $ixals; // Equal to ixals + $cchCustMenu = 0x00; // Length of cust menu text + $cchDescription = 0x00; // Length of description text + $cchHelptopic = 0x00; // Length of help topic text + $cchStatustext = 0x00; // Length of status bar text + $rgch = $type; // Built-in name type + + $unknown01 = 0x29; + $unknown02 = 0x002b; + $unknown03 = 0x3b; + $unknown04 = 0xffff-$index; + $unknown05 = 0x0000; + $unknown06 = 0x0000; + $unknown07 = 0x1087; + $unknown08 = 0x8008; + + $header = pack("vv", $record, $length); + $data = pack("v", $grbit); + $data .= pack("C", $chKey); + $data .= pack("C", $cch); + $data .= pack("v", $cce); + $data .= pack("v", $ixals); + $data .= pack("v", $itab); + $data .= pack("C", $cchCustMenu); + $data .= pack("C", $cchDescription); + $data .= pack("C", $cchHelptopic); + $data .= pack("C", $cchStatustext); + $data .= pack("C", $rgch); + $data .= pack("C", $unknown01); + $data .= pack("v", $unknown02); + // Column definition + $data .= pack("C", $unknown03); + $data .= pack("v", $unknown04); + $data .= pack("v", $unknown05); + $data .= pack("v", $unknown06); + $data .= pack("v", $unknown07); + $data .= pack("v", $unknown08); + $data .= pack("v", $index); + $data .= pack("v", $index); + $data .= pack("v", 0x0000); + $data .= pack("v", 0x3fff); + $data .= pack("C", $colmin); + $data .= pack("C", $colmax); + // Row definition + $data .= pack("C", $unknown03); + $data .= pack("v", $unknown04); + $data .= pack("v", $unknown05); + $data .= pack("v", $unknown06); + $data .= pack("v", $unknown07); + $data .= pack("v", $unknown08); + $data .= pack("v", $index); + $data .= pack("v", $index); + $data .= pack("v", $rowmin); + $data .= pack("v", $rowmax); + $data .= pack("C", 0x00); + $data .= pack("C", 0xff); + // End of data + $data .= pack("C", 0x10); + $this->_append($header.$data); + } + + + /** + * Stores the PALETTE biff record. + */ + function _store_palette() + { + $aref = $this->palette; + + $record = 0x0092; // Record identifier + $length = 2 + 4 * count($aref); // Number of bytes to follow + $ccv = count($aref); // Number of RGB values to follow + $data = ''; // The RGB data + + // Pack the RGB data + foreach($aref as $color) + { + foreach($color as $byte) { + $data .= pack("C",$byte); + } + } + + $header = pack("vvv", $record, $length, $ccv); + $this->_append($header.$data); + } +} ?> \ No newline at end of file diff --git a/lib/excel/Worksheet.php b/lib/excel/Worksheet.php index d3faf06db14..1eb7682434f 100644 --- a/lib/excel/Worksheet.php +++ b/lib/excel/Worksheet.php @@ -1,2835 +1,2835 @@ - -* -* The majority of this is _NOT_ my code. I simply ported it from the -* PERL Spreadsheet::WriteExcel module. -* -* The author of the Spreadsheet::WriteExcel module is John McNamara -* -* -* I _DO_ maintain this code, and John McNamara has nothing to do with the -* porting of this code to PHP. Any questions directly related to this -* class library should be directed to me. -* -* License Information: -* -* Spreadsheet::WriteExcel: A library for generating Excel Spreadsheets -* Copyright (C) 2002 Xavier Noguer xnoguer@rezebra.com -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; either -* version 2.1 of the License, or (at your option) any later version. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -require_once('Parser.php'); -require_once('BIFFwriter.php'); - -/** -* Class for generating Excel Spreadsheets -* -* @author Xavier Noguer -* @package Spreadsheet_WriteExcel -*/ - -class Worksheet extends BIFFwriter -{ - - /** - * Constructor - * - * @param string $name The name of the new worksheet - * @param integer $index The index of the new worksheet - * @param mixed &$activesheet The current activesheet of the workbook we belong to - * @param mixed &$firstsheet The first worksheet in the workbook we belong to - * @param mixed &$url_format The default format for hyperlinks - * @param mixed &$parser The formula parser created for the Workbook - */ - function Worksheet($name,$index,&$activesheet,&$firstsheet,&$url_format,&$parser) - { - $this->BIFFwriter(); // It needs to call its parent's constructor explicitly - $rowmax = 65536; // 16384 in Excel 5 - $colmax = 256; - $strmax = 255; - - $this->name = $name; - $this->index = $index; - $this->activesheet = &$activesheet; - $this->firstsheet = &$firstsheet; - $this->_url_format = $url_format; - $this->_parser = &$parser; - - $this->ext_sheets = array(); - $this->_using_tmpfile = 1; - $this->_filehandle = ""; - $this->fileclosed = 0; - $this->offset = 0; - $this->xls_rowmax = $rowmax; - $this->xls_colmax = $colmax; - $this->xls_strmax = $strmax; - $this->dim_rowmin = $rowmax +1; - $this->dim_rowmax = 0; - $this->dim_colmin = $colmax +1; - $this->dim_colmax = 0; - $this->colinfo = array(); - $this->_selection = array(0,0,0,0); - $this->_panes = array(); - $this->_active_pane = 3; - $this->_frozen = 0; - $this->selected = 0; - - $this->_paper_size = 0x0; - $this->_orientation = 0x1; - $this->_header = ''; - $this->_footer = ''; - $this->_hcenter = 0; - $this->_vcenter = 0; - $this->_margin_head = 0.50; - $this->_margin_foot = 0.50; - $this->_margin_left = 0.75; - $this->_margin_right = 0.75; - $this->_margin_top = 1.00; - $this->_margin_bottom = 1.00; - - $this->_title_rowmin = NULL; - $this->_title_rowmax = NULL; - $this->_title_colmin = NULL; - $this->_title_colmax = NULL; - $this->_print_rowmin = NULL; - $this->_print_rowmax = NULL; - $this->_print_colmin = NULL; - $this->_print_colmax = NULL; - - $this->_print_gridlines = 1; - $this->_print_headers = 0; - - $this->_fit_page = 0; - $this->_fit_width = 0; - $this->_fit_height = 0; - - $this->_hbreaks = array(); - $this->_vbreaks = array(); - - $this->_protect = 0; - $this->_password = NULL; - - $this->col_sizes = array(); - $this->row_sizes = array(); - - $this->_zoom = 100; - $this->_print_scale = 100; - - $this->_initialize(); - } - - /** - * Open a tmp file to store the majority of the Worksheet data. If this fails, - * for example due to write permissions, store the data in memory. This can be - * slow for large files. - */ - function _initialize() - { - // Open tmp file for storing Worksheet data - $fh = tmpfile(); - if ( $fh) { - // Store filehandle - $this->_filehandle = $fh; - } - else { - // If tmpfile() fails store data in memory - $this->_using_tmpfile = 0; - } - } - - /** - * Add data to the beginning of the workbook (note the reverse order) - * and to the end of the workbook. - * - * @access public - * @see Workbook::store_workbook() - * @param array $sheetnames The array of sheetnames from the Workbook this - * worksheet belongs to - */ - function close($sheetnames) - { - $num_sheets = count($sheetnames); - - /*********************************************** - * Prepend in reverse order!! - */ - - // Prepend the sheet dimensions - $this->_store_dimensions(); - - // Prepend the sheet password - $this->_store_password(); - - // Prepend the sheet protection - $this->_store_protect(); - - // Prepend the page setup - $this->_store_setup(); - - // Prepend the bottom margin - $this->_store_margin_bottom(); - - // Prepend the top margin - $this->_store_margin_top(); - - // Prepend the right margin - $this->_store_margin_right(); - - // Prepend the left margin - $this->_store_margin_left(); - - // Prepend the page vertical centering - $this->store_vcenter(); - - // Prepend the page horizontal centering - $this->store_hcenter(); - - // Prepend the page footer - $this->store_footer(); - - // Prepend the page header - $this->store_header(); - - // Prepend the vertical page breaks - $this->_store_vbreak(); - - // Prepend the horizontal page breaks - $this->_store_hbreak(); - - // Prepend WSBOOL - $this->_store_wsbool(); - - // Prepend GRIDSET - $this->_store_gridset(); - - // Prepend PRINTGRIDLINES - $this->_store_print_gridlines(); - - // Prepend PRINTHEADERS - $this->_store_print_headers(); - - // Prepend EXTERNSHEET references - for ($i = $num_sheets; $i > 0; $i--) { - $sheetname = $sheetnames[$i-1]; - $this->_store_externsheet($sheetname); - } - - // Prepend the EXTERNCOUNT of external references. - $this->_store_externcount($num_sheets); - - // Prepend the COLINFO records if they exist - if (!empty($this->colinfo)){ - for($i=0; $i < count($this->colinfo); $i++) - { - $this->_store_colinfo($this->colinfo[$i]); - } - $this->_store_defcol(); - } - - // Prepend the BOF record - $this->_store_bof(0x0010); - - /* - * End of prepend. Read upwards from here. - ***********************************************/ - - // Append - $this->_store_window2(); - $this->_store_zoom(); - if(!empty($this->_panes)) - $this->_store_panes($this->_panes); - $this->_store_selection($this->_selection); - $this->_store_eof(); - } - - /** - * Retrieve the worksheet name. This is usefull when creating worksheets - * without a name. - * - * @access public - * @return string The worksheet's name - */ - function get_name() - { - return($this->name); - } - - /** - * Retrieves data from memory in one chunk, or from disk in $buffer - * sized chunks. - * - * @return string The data - */ - function get_data() - { - $buffer = 4096; - - // Return data stored in memory - if (isset($this->_data)) { - $tmp = $this->_data; - unset($this->_data); - $fh = $this->_filehandle; - if ($this->_using_tmpfile) { - fseek($fh, 0); - } - return($tmp); - } - // Return data stored on disk - if ($this->_using_tmpfile) { - if ($tmp = fread($this->_filehandle, $buffer)) { - return($tmp); - } - } - - // No data to return - return(''); - } - - /** - * Set this worksheet as a selected worksheet, i.e. the worksheet has its tab - * highlighted. - * - * @access public - */ - function select() - { - $this->selected = 1; - } - - /** - * Set this worksheet as the active worksheet, i.e. the worksheet that is - * displayed when the workbook is opened. Also set it as selected. - * - * @access public - */ - function activate() - { - $this->selected = 1; - $this->activesheet =& $this->index; - } - - /** - * Set this worksheet as the first visible sheet. This is necessary - * when there are a large number of worksheets and the activated - * worksheet is not visible on the screen. - * - * @access public - */ - function set_first_sheet() - { - $this->firstsheet = $this->index; - } - - /** - * Set the worksheet protection flag to prevent accidental modification and to - * hide formulas if the locked and hidden format properties have been set. - * - * @access public - * @param string $password The password to use for protecting the sheet. - */ - function protect($password) - { - $this->_protect = 1; - $this->_password = $this->_encode_password($password); - } - - /** - * Set the width of a single column or a range of columns. - * - * @access public - * @see _store_colinfo() - * @param integer $firstcol first column on the range - * @param integer $lastcol last column on the range - * @param integer $width width to set - * @param mixed $format The optional XF format to apply to the columns - * @param integer $hidden The optional hidden atribute - */ - function set_column($firstcol, $lastcol, $width, $format = 0, $hidden = 0) - { - $this->colinfo[] = array($firstcol, $lastcol, $width, $format, $hidden); - - // Set width to zero if column is hidden - $width = ($hidden) ? 0 : $width; - - for($col = $firstcol; $col <= $lastcol; $col++) { - $this->col_sizes[$col] = $width; - } - } - - /** - * Set which cell or cells are selected in a worksheet - * - * @access public - * @param integer $first_row first row in the selected quadrant - * @param integer $first_column first column in the selected quadrant - * @param integer $last_row last row in the selected quadrant - * @param integer $last_column last column in the selected quadrant - * @see _store_selection() - */ - function set_selection($first_row,$first_column,$last_row,$last_column) - { - $this->_selection = array($first_row,$first_column,$last_row,$last_column); - } - - /** - * Set panes and mark them as frozen. - * - * @access public - * @param array $panes This is the only parameter received and is composed of the following: - * 0 => Vertical split position, - * 1 => Horizontal split position - * 2 => Top row visible - * 3 => Leftmost column visible - * 4 => Active pane - */ - function freeze_panes($panes) - { - $this->_frozen = 1; - $this->_panes = $panes; - } - - /** - * Set panes and mark them as unfrozen. - * - * @access public - * @param array $panes This is the only parameter received and is composed of the following: - * 0 => Vertical split position, - * 1 => Horizontal split position - * 2 => Top row visible - * 3 => Leftmost column visible - * 4 => Active pane - */ - function thaw_panes($panes) - { - $this->_frozen = 0; - $this->_panes = $panes; - } - - /** - * Set the page orientation as portrait. - * - * @access public - */ - function set_portrait() - { - $this->_orientation = 1; - } - - /** - * Set the page orientation as landscape. - * - * @access public - */ - function set_landscape() - { - $this->_orientation = 0; - } - - /** - * Set the paper type. Ex. 1 = US Letter, 9 = A4 - * - * @access public - * @param integer $size The type of paper size to use - */ - function set_paper($size = 0) - { - $this->_paper_size = $size; - } - - - /** - * Set the page header caption and optional margin. - * - * @access public - * @param string $string The header text - * @param float $margin optional head margin in inches. - */ - function set_header($string,$margin = 0.50) - { - if (strlen($string) >= 255) { - //carp 'Header string must be less than 255 characters'; - return; - } - $this->_header = $string; - $this->_margin_head = $margin; - } - - /** - * Set the page footer caption and optional margin. - * - * @access public - * @param string $string The footer text - * @param float $margin optional foot margin in inches. - */ - function set_footer($string,$margin = 0.50) - { - if (strlen($string) >= 255) { - //carp 'Footer string must be less than 255 characters'; - return; - } - $this->_footer = $string; - $this->_margin_foot = $margin; - } - - /** - * Center the page horinzontally. - * - * @access public - * @param integer $center the optional value for centering. Defaults to 1 (center). - */ - function center_horizontally($center = 1) - { - $this->_hcenter = $center; - } - - /** - * Center the page horinzontally. - * - * @access public - * @param integer $center the optional value for centering. Defaults to 1 (center). - */ - function center_vertically($center = 1) - { - $this->_vcenter = $center; - } - - /** - * Set all the page margins to the same value in inches. - * - * @access public - * @param float $margin The margin to set in inches - */ - function set_margins($margin) - { - $this->set_margin_left($margin); - $this->set_margin_right($margin); - $this->set_margin_top($margin); - $this->set_margin_bottom($margin); - } - - /** - * Set the left and right margins to the same value in inches. - * - * @access public - * @param float $margin The margin to set in inches - */ - function set_margins_LR($margin) - { - $this->set_margin_left($margin); - $this->set_margin_right($margin); - } - - /** - * Set the top and bottom margins to the same value in inches. - * - * @access public - * @param float $margin The margin to set in inches - */ - function set_margins_TB($margin) - { - $this->set_margin_top($margin); - $this->set_margin_bottom($margin); - } - - /** - * Set the left margin in inches. - * - * @access public - * @param float $margin The margin to set in inches - */ - function set_margin_left($margin = 0.75) - { - $this->_margin_left = $margin; - } - - /** - * Set the right margin in inches. - * - * @access public - * @param float $margin The margin to set in inches - */ - function set_margin_right($margin = 0.75) - { - $this->_margin_right = $margin; - } - - /** - * Set the top margin in inches. - * - * @access public - * @param float $margin The margin to set in inches - */ - function set_margin_top($margin = 1.00) - { - $this->_margin_top = $margin; - } - - /** - * Set the bottom margin in inches. - * - * @access public - * @param float $margin The margin to set in inches - */ - function set_margin_bottom($margin = 1.00) - { - $this->_margin_bottom = $margin; - } - - /** - * Set the rows to repeat at the top of each printed page. See also the - * _store_name_xxxx() methods in Workbook.php - * - * @access public - * @param integer $first_row First row to repeat - * @param integer $last_row Last row to repeat. Optional. - */ - function repeat_rows($first_row, $last_row = NULL) - { - $this->_title_rowmin = $first_row; - if(isset($last_row)) { //Second row is optional - $this->_title_rowmax = $last_row; - } - else { - $this->_title_rowmax = $first_row; - } - } - - /** - * Set the columns to repeat at the left hand side of each printed page. - * See also the _store_names() methods in Workbook.php - * - * @access public - * @param integer $first_col First column to repeat - * @param integer $last_col Last column to repeat. Optional. - */ - function repeat_columns($first_col, $last_col = NULL) - { - $this->_title_colmin = $first_col; - if(isset($last_col)) { // Second col is optional - $this->_title_colmax = $last_col; - } - else { - $this->_title_colmax = $first_col; - } - } - - /** - * Set the area of each worksheet that will be printed. - * - * @access public - * @see Workbook::_store_names() - * @param integer $first_row First row of the area to print - * @param integer $first_col First column of the area to print - * @param integer $last_row Last row of the area to print - * @param integer $last_col Last column of the area to print - */ - function print_area($first_row, $first_col, $last_row, $last_col) - { - $this->_print_rowmin = $first_row; - $this->_print_colmin = $first_col; - $this->_print_rowmax = $last_row; - $this->_print_colmax = $last_col; - } - - - /** - * Set the option to hide gridlines on the printed page. - * - * @access public - * @see _store_print_gridlines(), _store_gridset() - */ - function hide_gridlines() - { - $this->_print_gridlines = 0; - } - - /** - * Set the option to print the row and column headers on the printed page. - * See also the _store_print_headers() method below. - * - * @access public - * @see _store_print_headers() - * @param integer $print Whether to print the headers or not. Defaults to 1 (print). - */ - function print_row_col_headers($print = 1) - { - $this->_print_headers = $print; - } - - /** - * Store the vertical and horizontal number of pages that will define the - * maximum area printed. It doesn't seem to work with OpenOffice. - * - * @access public - * @param integer $width Maximun width of printed area in pages - * @param integer $heigth Maximun heigth of printed area in pages - * @see set_print_scale() - */ - function fit_to_pages($width, $height) - { - $this->_fit_page = 1; - $this->_fit_width = $width; - $this->_fit_height = $height; - } - - /** - * Store the horizontal page breaks on a worksheet (for printing). - * The breaks represent the row after which the break is inserted. - * - * @access public - * @param array $breaks Array containing the horizontal page breaks - */ - function set_h_pagebreaks($breaks) - { - foreach($breaks as $break) { - array_push($this->_hbreaks,$break); - } - } - - /** - * Store the vertical page breaks on a worksheet (for printing). - * The breaks represent the column after which the break is inserted. - * - * @access public - * @param array $breaks Array containing the vertical page breaks - */ - function set_v_pagebreaks($breaks) - { - foreach($breaks as $break) { - array_push($this->_vbreaks,$break); - } - } - - - /** - * Set the worksheet zoom factor. - * - * @access public - * @param integer $scale The zoom factor - */ - function set_zoom($scale = 100) - { - // Confine the scale to Excel's range - if ($scale < 10 or $scale > 400) { - //carp "Zoom factor $scale outside range: 10 <= zoom <= 400"; - $scale = 100; - } - - $this->_zoom = floor($scale); - } - - /** - * Set the scale factor for the printed page. - * It turns off the "fit to page" option - * - * @access public - * @param integer $scale The optional scale factor. Defaults to 100 - */ - function set_print_scale($scale = 100) - { - // Confine the scale to Excel's range - if ($scale < 10 or $scale > 400) - { - // REPLACE THIS FOR A WARNING - die("Print scale $scale outside range: 10 <= zoom <= 400"); - $scale = 100; - } - - // Turn off "fit to page" option - $this->_fit_page = 0; - - $this->_print_scale = floor($scale); - } - - /** - * Map to the appropriate write method acording to the token recieved. - * - * @access public - * @param integer $row The row of the cell we are writing to - * @param integer $col The column of the cell we are writing to - * @param mixed $token What we are writing - * @param mixed $format The optional format to apply to the cell - */ - function write($row, $col, $token, $format = 0) - { - // Check for a cell reference in A1 notation and substitute row and column - /*if ($_[0] =~ /^\D/) { - @_ = $this->_substitute_cellref(@_); - }*/ - - /* - # Match an array ref. - if (ref $token eq "ARRAY") { - return $this->write_row(@_); - }*/ - - // Match number - if (preg_match("/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/",$token)) { - return $this->write_number($row,$col,$token,$format); - } - // Match http or ftp URL - elseif (preg_match("/^[fh]tt?p:\/\//",$token)) { - return $this->write_url($row, $col, $token, $format); - } - // Match mailto: - elseif (preg_match("/^mailto:/",$token)) { - return $this->write_url($row, $col, $token, $format); - } - // Match internal or external sheet link - elseif (preg_match("/^(?:in|ex)ternal:/",$token)) { - return $this->write_url($row, $col, $token, $format); - } - // Match formula - elseif (preg_match("/^=/",$token)) { - return $this->write_formula($row, $col, $token, $format); - } - // Match formula - elseif (preg_match("/^@/",$token)) { - return $this->write_formula($row, $col, $token, $format); - } - // Match blank - elseif ($token == '') { - return $this->write_blank($row,$col,$format); - } - // Default: match string - else { - return $this->write_string($row,$col,$token,$format); - } - } - - /** - * Returns an index to the XF record in the workbook - * - * @param mixed $format The optional XF format - * @return integer The XF record index - */ - function _XF(&$format) - { - if($format != 0) - { - return($format->get_xf_index()); - } - else - { - return(0x0F); - } - } - - - /****************************************************************************** - ******************************************************************************* - * - * Internal methods - */ - - - /** - * Store Worksheet data in memory using the parent's class append() or to a - * temporary file, the default. - * - * @param string $data The binary data to append - */ - function _append($data) - { - if ($this->_using_tmpfile) - { - // Add CONTINUE records if necessary - if (strlen($data) > $this->_limit) { - $data = $this->_add_continue($data); - } - fwrite($this->_filehandle,$data); - $this->_datasize += strlen($data); - } - else { - parent::_append($data); - } - } - - /** - * Substitute an Excel cell reference in A1 notation for zero based row and - * column values in an argument list. - * - * Ex: ("A4", "Hello") is converted to (3, 0, "Hello"). - * - * @param string $cell The cell reference. Or range of cells. - * @return array - */ - function _substitute_cellref($cell) - { - $cell = strtoupper($cell); - - // Convert a column range: 'A:A' or 'B:G' - if (preg_match("/([A-I]?[A-Z]):([A-I]?[A-Z])/",$cell,$match)) { - list($no_use, $col1) = $this->_cell_to_rowcol($match[1] .'1'); // Add a dummy row - list($no_use, $col2) = $this->_cell_to_rowcol($match[2] .'1'); // Add a dummy row - return(array($col1, $col2)); - } - - // Convert a cell range: 'A1:B7' - if (preg_match("/\$?([A-I]?[A-Z]\$?\d+):\$?([A-I]?[A-Z]\$?\d+)/",$cell,$match)) { - list($row1, $col1) = $this->_cell_to_rowcol($match[1]); - list($row2, $col2) = $this->_cell_to_rowcol($match[2]); - return(array($row1, $col1, $row2, $col2)); - } - - // Convert a cell reference: 'A1' or 'AD2000' - if (preg_match("/\$?([A-I]?[A-Z]\$?\d+)/",$cell)) { - list($row1, $col1) = $this->_cell_to_rowcol($match[1]); - return(array($row1, $col1)); - } - - die("Unknown cell reference $cell "); - } - - /** - * Convert an Excel cell reference in A1 notation to a zero based row and column - * reference; converts C1 to (0, 2). - * - * @param string $cell The cell reference. - * @return array containing (row, column) - */ - function _cell_to_rowcol($cell) - { - preg_match("/\$?([A-I]?[A-Z])\$?(\d+)/",$cell,$match); - $col = $match[1]; - $row = $match[2]; - - // Convert base26 column string to number - $chars = split('', $col); - $expn = 0; - $col = 0; - - while ($chars) { - $char = array_pop($chars); // LS char first - $col += (ord($char) -ord('A') +1) * pow(26,$expn); - $expn++; - } - - // Convert 1-index to zero-index - $row--; - $col--; - - return(array($row, $col)); - } - - /** - * Based on the algorithm provided by Daniel Rentz of OpenOffice. - * - * @param string $plaintext The password to be encoded in plaintext. - * @return string The encoded password - */ - function _encode_password($plaintext) - { - $password = 0x0000; - $i = 1; // char position - - // split the plain text password in its component characters - $chars = preg_split('//', $plaintext, -1, PREG_SPLIT_NO_EMPTY); - foreach($chars as $char) - { - $value = ord($char) << $i; // shifted ASCII value - $bit_16 = $value & 0x8000; // the bit 16 - $bit_16 >>= 15; // 0x0000 or 0x0001 - //$bit_17 = $value & 0x00010000; - //$bit_17 >>= 15; - $value &= 0x7fff; // first 15 bits - $password ^= ($value | $bit_16); - //$password ^= ($value | $bit_16 | $bit_17); - $i++; - } - - $password ^= strlen($plaintext); - $password ^= 0xCE4B; - - return($password); - } - - /****************************************************************************** - ******************************************************************************* - * - * BIFF RECORDS - */ - - - /** - * Write a double to the specified row and column (zero indexed). - * An integer can be written as a double. Excel will display an - * integer. $format is optional. - * - * Returns 0 : normal termination - * -2 : row or column out of range - * - * @access public - * @param integer $row Zero indexed row - * @param integer $col Zero indexed column - * @param float $num The number to write - * @param mixed $format The optional XF format - */ - function write_number($row, $col, $num, $format = 0) - { - $record = 0x0203; // Record identifier - $length = 0x000E; // Number of bytes to follow - $xf = $this->_XF($format); // The cell format - - // Check that row and col are valid and store max and min values - if ($row >= $this->xls_rowmax) - { - return(-2); - } - if ($col >= $this->xls_colmax) - { - return(-2); - } - if ($row < $this->dim_rowmin) - { - $this->dim_rowmin = $row; - } - if ($row > $this->dim_rowmax) - { - $this->dim_rowmax = $row; - } - if ($col < $this->dim_colmin) - { - $this->dim_colmin = $col; - } - if ($col > $this->dim_colmax) - { - $this->dim_colmax = $col; - } - - $header = pack("vv", $record, $length); - $data = pack("vvv", $row, $col, $xf); - $xl_double = pack("d", $num); - if ($this->_byte_order) // if it's Big Endian - { - $xl_double = strrev($xl_double); - } - - $this->_append($header.$data.$xl_double); - return(0); - } - - /** - * Write a string to the specified row and column (zero indexed). - * NOTE: there is an Excel 5 defined limit of 255 characters. - * $format is optional. - * Returns 0 : normal termination - * -1 : insufficient number of arguments - * -2 : row or column out of range - * -3 : long string truncated to 255 chars - * - * @access public - * @param integer $row Zero indexed row - * @param integer $col Zero indexed column - * @param string $str The string to write - * @param mixed $format The XF format for the cell - */ - function write_string($row, $col, $str, $format = 0) - { - $strlen = strlen($str); - $record = 0x0204; // Record identifier - $length = 0x0008 + $strlen; // Bytes to follow - $xf = $this->_XF($format); // The cell format - - $str_error = 0; - - // Check that row and col are valid and store max and min values - if ($row >= $this->xls_rowmax) - { - return(-2); - } - if ($col >= $this->xls_colmax) - { - return(-2); - } - if ($row < $this->dim_rowmin) - { - $this->dim_rowmin = $row; - } - if ($row > $this->dim_rowmax) - { - $this->dim_rowmax = $row; - } - if ($col < $this->dim_colmin) - { - $this->dim_colmin = $col; - } - if ($col > $this->dim_colmax) - { - $this->dim_colmax = $col; - } - - if ($strlen > $this->xls_strmax) // LABEL must be < 255 chars - { - $str = substr($str, 0, $this->xls_strmax); - $length = 0x0008 + $this->xls_strmax; - $strlen = $this->xls_strmax; - $str_error = -3; - } - - $header = pack("vv", $record, $length); - $data = pack("vvvv", $row, $col, $xf, $strlen); - $this->_append($header.$data.$str); - return($str_error); - } - - /** - * Writes a note associated with the cell given by the row and column. - * NOTE records don't have a length limit. - * - * @access public - * @param integer $row Zero indexed row - * @param integer $col Zero indexed column - * @param string $note The note to write - */ - function write_note($row, $col, $note) - { - $note_length = strlen($note); - $record = 0x001C; // Record identifier - $max_length = 2048; // Maximun length for a NOTE record - //$length = 0x0006 + $note_length; // Bytes to follow - - // Check that row and col are valid and store max and min values - if ($row >= $this->xls_rowmax) - { - return(-2); - } - if ($col >= $this->xls_colmax) - { - return(-2); - } - if ($row < $this->dim_rowmin) - { - $this->dim_rowmin = $row; - } - if ($row > $this->dim_rowmax) - { - $this->dim_rowmax = $row; - } - if ($col < $this->dim_colmin) - { - $this->dim_colmin = $col; - } - if ($col > $this->dim_colmax) - { - $this->dim_colmax = $col; - } - - // Length for this record is no more than 2048 + 6 - $length = 0x0006 + min($note_length, 2048); - $header = pack("vv", $record, $length); - $data = pack("vvv", $row, $col, $note_length); - $this->_append($header.$data.substr($note, 0, 2048)); - - for($i = $max_length; $i < $note_length; $i += $max_length) - { - $chunk = substr($note, $i, $max_length); - $length = 0x0006 + strlen($chunk); - $header = pack("vv", $record, $length); - $data = pack("vvv", -1, 0, strlen($chunk)); - $this->_append($header.$data.$chunk); - } - return(0); - } - - /** - * Write a blank cell to the specified row and column (zero indexed). - * A blank cell is used to specify formatting without adding a string - * or a number. - * - * A blank cell without a format serves no purpose. Therefore, we don't write - * a BLANK record unless a format is specified. This is mainly an optimisation - * for the write_row() and write_col() methods. - * - * Returns 0 : normal termination (including no format) - * -1 : insufficient number of arguments - * -2 : row or column out of range - * - * @access public - * @param integer $row Zero indexed row - * @param integer $col Zero indexed column - * @param mixed $format The XF format - */ - function write_blank($row, $col, $format = 0) - { - // Don't write a blank cell unless it has a format - if ($format == 0) - { - return(0); - } - - $record = 0x0201; // Record identifier - $length = 0x0006; // Number of bytes to follow - $xf = $this->_XF($format); // The cell format - - // Check that row and col are valid and store max and min values - if ($row >= $this->xls_rowmax) - { - return(-2); - } - if ($col >= $this->xls_colmax) - { - return(-2); - } - if ($row < $this->dim_rowmin) - { - $this->dim_rowmin = $row; - } - if ($row > $this->dim_rowmax) - { - $this->dim_rowmax = $row; - } - if ($col < $this->dim_colmin) - { - $this->dim_colmin = $col; - } - if ($col > $this->dim_colmax) - { - $this->dim_colmax = $col; - } - - $header = pack("vv", $record, $length); - $data = pack("vvv", $row, $col, $xf); - $this->_append($header.$data); - return 0; - } - - /** - * Write a formula to the specified row and column (zero indexed). - * The textual representation of the formula is passed to the parser in - * Parser.php which returns a packed binary string. - * - * Returns 0 : normal termination - * -2 : row or column out of range - * - * @access public - * @param integer $row Zero indexed row - * @param integer $col Zero indexed column - * @param string $formula The formula text string - * @param mixed $format The optional XF format - */ - function write_formula($row, $col, $formula, $format = 0) - { - $record = 0x0006; // Record identifier - - // Excel normally stores the last calculated value of the formula in $num. - // Clearly we are not in a position to calculate this a priori. Instead - // we set $num to zero and set the option flags in $grbit to ensure - // automatic calculation of the formula when the file is opened. - // - $xf = $this->_XF($format); // The cell format - $num = 0x00; // Current value of formula - $grbit = 0x03; // Option flags - $chn = 0x0000; // Must be zero - - - // Check that row and col are valid and store max and min values - if ($row >= $this->xls_rowmax) - { - return(-2); - } - if ($col >= $this->xls_colmax) - { - return(-2); - } - if ($row < $this->dim_rowmin) - { - $this->dim_rowmin = $row; - } - if ($row > $this->dim_rowmax) - { - $this->dim_rowmax = $row; - } - if ($col < $this->dim_colmin) - { - $this->dim_colmin = $col; - } - if ($col > $this->dim_colmax) - { - $this->dim_colmax = $col; - } - - // Strip the '=' or '@' sign at the beginning of the formula string - if (preg_match("/^=/",$formula)) { - $formula = preg_replace("/(^=)/","",$formula); - } - elseif(preg_match("/^@/",$formula)) { - $formula = preg_replace("/(^@)/","",$formula); - } - else { - die("Unrecognised character for formula"); - } - - // Parse the formula using the parser in Parser.php - //$tree = new Parser($this->_byte_order); - $this->_parser->parse($formula); - //$tree->parse($formula); - $formula = $this->_parser->to_reverse_polish(); - - $formlen = strlen($formula); // Length of the binary string - $length = 0x16 + $formlen; // Length of the record data - - $header = pack("vv", $record, $length); - $data = pack("vvvdvVv", $row, $col, $xf, $num, - $grbit, $chn, $formlen); - - $this->_append($header.$data.$formula); - return 0; - } - - /** - * Write a hyperlink. This is comprised of two elements: the visible label and - * the invisible link. The visible label is the same as the link unless an - * alternative string is specified. The label is written using the - * write_string() method. Therefore the 255 characters string limit applies. - * $string and $format are optional and their order is interchangeable. - * - * The hyperlink can be to a http, ftp, mail, internal sheet, or external - * directory url. - * - * Returns 0 : normal termination - * -1 : insufficient number of arguments - * -2 : row or column out of range - * -3 : long string truncated to 255 chars - * - * @access public - * @param integer $row Row - * @param integer $col Column - * @param string $url URL string - * @param string $string Alternative label - * @param mixed $format The cell format - */ - function write_url($row, $col, $url, $string = '', $format = 0) - { - // Add start row and col to arg list - return($this->_write_url_range($row, $col, $row, $col, $url, $string, $format)); - } - - /** - * This is the more general form of write_url(). It allows a hyperlink to be - * written to a range of cells. This function also decides the type of hyperlink - * to be written. These are either, Web (http, ftp, mailto), Internal - * (Sheet1!A1) or external ('c:\temp\foo.xls#Sheet1!A1'). - * - * See also write_url() above for a general description and return values. - * - * @param integer $row1 Start row - * @param integer $col1 Start column - * @param integer $row2 End row - * @param integer $col2 End column - * @param string $url URL string - * @param string $string Alternative label - * @param mixed $format The cell format - */ - - function _write_url_range($row1, $col1, $row2, $col2, $url, $string = '', $format = 0) - { - // Check for internal/external sheet links or default to web link - if (preg_match('[^internal:]', $url)) { - return($this->_write_url_internal($row1, $col1, $row2, $col2, $url, $string, $format)); - } - if (preg_match('[^external:]', $url)) { - return($this->_write_url_external($row1, $col1, $row2, $col2, $url, $string, $format)); - } - return($this->_write_url_web($row1, $col1, $row2, $col2, $url, $string, $format)); - } - - - /** - * Used to write http, ftp and mailto hyperlinks. - * The link type ($options) is 0x03 is the same as absolute dir ref without - * sheet. However it is differentiated by the $unknown2 data stream. - * - * @see write_url() - * @param integer $row1 Start row - * @param integer $col1 Start column - * @param integer $row2 End row - * @param integer $col2 End column - * @param string $url URL string - * @param string $str Alternative label - * @param mixed $format The cell format - */ - function _write_url_web($row1, $col1, $row2, $col2, $url, $str, $format = 0) - { - $record = 0x01B8; // Record identifier - $length = 0x00000; // Bytes to follow - - if($format == 0) { - $format = $this->_url_format; - } - - // Write the visible label using the write_string() method. - if($str == '') { - $str = $url; - } - $str_error = $this->write_string($row1, $col1, $str, $format); - if ($str_error == -2) { - return($str_error); - } - - // Pack the undocumented parts of the hyperlink stream - $unknown1 = pack("H*", "D0C9EA79F9BACE118C8200AA004BA90B02000000"); - $unknown2 = pack("H*", "E0C9EA79F9BACE118C8200AA004BA90B"); - - // Pack the option flags - $options = pack("V", 0x03); - - // Convert URL to a null terminated wchar string - $url = join("\0", preg_split("''", $url, -1, PREG_SPLIT_NO_EMPTY)); - $url = $url . "\0\0\0"; - - // Pack the length of the URL - $url_len = pack("V", strlen($url)); - - // Calculate the data length - $length = 0x34 + strlen($url); - - // Pack the header data - $header = pack("vv", $record, $length); - $data = pack("vvvv", $row1, $row2, $col1, $col2); - - // Write the packed data - $this->_append( $header. $data. - $unknown1. $options. - $unknown2. $url_len. $url); - return($str_error); - } - - /** - * Used to write internal reference hyperlinks such as "Sheet1!A1". - * - * @see write_url() - * @param integer $row1 Start row - * @param integer $col1 Start column - * @param integer $row2 End row - * @param integer $col2 End column - * @param string $url URL string - * @param string $str Alternative label - * @param mixed $format The cell format - */ - function _write_url_internal($row1, $col1, $row2, $col2, $url, $str, $format = 0) - { - $record = 0x01B8; // Record identifier - $length = 0x00000; // Bytes to follow - - if ($format == 0) { - $format = $this->_url_format; - } - - // Strip URL type - $url = preg_replace('s[^internal:]', '', $url); - - // Write the visible label - if($str == '') { - $str = $url; - } - $str_error = $this->write_string($row1, $col1, $str, $format); - if ($str_error == -2) { - return($str_error); - } - - // Pack the undocumented parts of the hyperlink stream - $unknown1 = pack("H*", "D0C9EA79F9BACE118C8200AA004BA90B02000000"); - - // Pack the option flags - $options = pack("V", 0x08); - - // Convert the URL type and to a null terminated wchar string - $url = join("\0", preg_split("''", $url, -1, PREG_SPLIT_NO_EMPTY)); - $url = $url . "\0\0\0"; - - // Pack the length of the URL as chars (not wchars) - $url_len = pack("V", floor(strlen($url)/2)); - - // Calculate the data length - $length = 0x24 + strlen($url); - - // Pack the header data - $header = pack("vv", $record, $length); - $data = pack("vvvv", $row1, $row2, $col1, $col2); - - // Write the packed data - $this->_append($header. $data. - $unknown1. $options. - $url_len. $url); - return($str_error); - } - - /** - * Write links to external directory names such as 'c:\foo.xls', - * c:\foo.xls#Sheet1!A1', '../../foo.xls'. and '../../foo.xls#Sheet1!A1'. - * - * Note: Excel writes some relative links with the $dir_long string. We ignore - * these cases for the sake of simpler code. - * - * @see write_url() - * @param integer $row1 Start row - * @param integer $col1 Start column - * @param integer $row2 End row - * @param integer $col2 End column - * @param string $url URL string - * @param string $str Alternative label - * @param mixed $format The cell format - */ - function _write_url_external($row1, $col1, $row2, $col2, $url, $str, $format = 0) - { - // Network drives are different. We will handle them separately - // MS/Novell network drives and shares start with \\ - if (preg_match('[^external:\\\\]', $url)) { - return($this->_write_url_external_net($row1, $col1, $row2, $col2, $url, $str, $format)); - } - - $record = 0x01B8; // Record identifier - $length = 0x00000; // Bytes to follow - - if ($format == 0) { - $format = $this->_url_format; - } - - // Strip URL type and change Unix dir separator to Dos style (if needed) - // - $url = preg_replace('[^external:]', '', $url); - $url = preg_replace('[/]', "\\", $url); - - // Write the visible label - if ($str == '') { - $str = preg_replace('[\#]', ' - ', $url); - } - $str_error = $this->write_string($row1, $col1, $str, $format); - if ($str_error == -2) { - return($str_error); - } - - // Determine if the link is relative or absolute: - // relative if link contains no dir separator, "somefile.xls" - // relative if link starts with up-dir, "..\..\somefile.xls" - // otherwise, absolute - - $absolute = 0x02; // Bit mask - if (!preg_match('[\\]', $url)) { - $absolute = 0x00; - } - if (preg_match('[^\.\.\\]', $url)) { - $absolute = 0x00; - } - - // Determine if the link contains a sheet reference and change some of the - // parameters accordingly. - // Split the dir name and sheet name (if it exists) - list($dir_long , $sheet) = split('/\#/', $url); - $link_type = 0x01 | $absolute; - - if (isset($sheet)) { - $link_type |= 0x08; - $sheet_len = pack("V", strlen($sheet) + 0x01); - $sheet = join("\0", split('', $sheet)); - $sheet .= "\0\0\0"; - } - else { - $sheet_len = ''; - $sheet = ''; - } - - // Pack the link type - $link_type = pack("V", $link_type); - - // Calculate the up-level dir count e.g.. (..\..\..\ == 3) - $up_count = preg_match_all("/\.\.\\/", $dir_long, $useless); - $up_count = pack("v", $up_count); - - // Store the short dos dir name (null terminated) - $dir_short = preg_replace('/\.\.\\/', '', $dir_long) . "\0"; - - // Store the long dir name as a wchar string (non-null terminated) - $dir_long = join("\0", split('', $dir_long)); - $dir_long = $dir_long . "\0"; - - // Pack the lengths of the dir strings - $dir_short_len = pack("V", strlen($dir_short) ); - $dir_long_len = pack("V", strlen($dir_long) ); - $stream_len = pack("V", strlen($dir_long) + 0x06); - - // Pack the undocumented parts of the hyperlink stream - $unknown1 = pack("H*",'D0C9EA79F9BACE118C8200AA004BA90B02000000' ); - $unknown2 = pack("H*",'0303000000000000C000000000000046' ); - $unknown3 = pack("H*",'FFFFADDE000000000000000000000000000000000000000'); - $unknown4 = pack("v", 0x03 ); - - // Pack the main data stream - $data = pack("vvvv", $row1, $row2, $col1, $col2) . - $unknown1 . - $link_type . - $unknown2 . - $up_count . - $dir_short_len. - $dir_short . - $unknown3 . - $stream_len . - $dir_long_len . - $unknown4 . - $dir_long . - $sheet_len . - $sheet ; - - // Pack the header data - $length = strlen($data); - $header = pack("vv", $record, $length); - - // Write the packed data - $this->_append($header. $data); - return($str_error); - } - - - /* - ############################################################################### - # - # write_url_xxx($row1, $col1, $row2, $col2, $url, $string, $format) - # - # Write links to external MS/Novell network drives and shares such as - # '//NETWORK/share/foo.xls' and '//NETWORK/share/foo.xls#Sheet1!A1'. - # - # See also write_url() above for a general description and return values. - # - sub _write_url_external_net { - - my $this = shift; - - my $record = 0x01B8; # Record identifier - my $length = 0x00000; # Bytes to follow - - my $row1 = $_[0]; # Start row - my $col1 = $_[1]; # Start column - my $row2 = $_[2]; # End row - my $col2 = $_[3]; # End column - my $url = $_[4]; # URL string - my $str = $_[5]; # Alternative label - my $xf = $_[6] || $this->{_url_format};# The cell format - - - # Strip URL type and change Unix dir separator to Dos style (if needed) - # - $url =~ s[^external:][]; - $url =~ s[/][\\]g; - - - # Write the visible label - ($str = $url) =~ s[\#][ - ] unless defined $str; - my $str_error = $this->write_string($row1, $col1, $str, $xf); - return $str_error if $str_error == -2; - - - # Determine if the link contains a sheet reference and change some of the - # parameters accordingly. - # Split the dir name and sheet name (if it exists) - # - my ($dir_long , $sheet) = split /\#/, $url; - my $link_type = 0x0103; # Always absolute - my $sheet_len; - - if (defined $sheet) { - $link_type |= 0x08; - $sheet_len = pack("V", length($sheet) + 0x01); - $sheet = join("\0", split('', $sheet)); - $sheet .= "\0\0\0"; - } - else { - $sheet_len = ''; - $sheet = ''; - } - - # Pack the link type - $link_type = pack("V", $link_type); - - - # Make the string null terminated - $dir_long = $dir_long . "\0"; - - - # Pack the lengths of the dir string - my $dir_long_len = pack("V", length $dir_long); - - - # Store the long dir name as a wchar string (non-null terminated) - $dir_long = join("\0", split('', $dir_long)); - $dir_long = $dir_long . "\0"; - - - # Pack the undocumented part of the hyperlink stream - my $unknown1 = pack("H*",'D0C9EA79F9BACE118C8200AA004BA90B02000000'); - - - # Pack the main data stream - my $data = pack("vvvv", $row1, $row2, $col1, $col2) . - $unknown1 . - $link_type . - $dir_long_len . - $dir_long . - $sheet_len . - $sheet ; - - - # Pack the header data - $length = length $data; - my $header = pack("vv", $record, $length); - - - # Write the packed data - $this->_append( $header, $data); - - return $str_error; -}*/ - - /** - * This method is used to set the height and XF format for a row. - * Writes the BIFF record ROW. - * - * @access public - * @param integer $row The row to set - * @param integer $height Height we are giving to the row. - * Use NULL to set XF without setting height - * @param mixed $format XF format we are giving to the row - */ - function set_row($row, $height, $format = 0) - { - $record = 0x0208; // Record identifier - $length = 0x0010; // Number of bytes to follow - - $colMic = 0x0000; // First defined column - $colMac = 0x0000; // Last defined column - $irwMac = 0x0000; // Used by Excel to optimise loading - $reserved = 0x0000; // Reserved - $grbit = 0x01C0; // Option flags. (monkey) see $1 do - $ixfe = $this->_XF($format); // XF index - - // Use set_row($row, NULL, $XF) to set XF without setting height - if ($height != NULL) { - $miyRw = $height * 20; // row height - } - else { - $miyRw = 0xff; // default row height is 256 - } - - $header = pack("vv", $record, $length); - $data = pack("vvvvvvvv", $row, $colMic, $colMac, $miyRw, - $irwMac,$reserved, $grbit, $ixfe); - $this->_append($header.$data); - } - - /** - * Writes Excel DIMENSIONS to define the area in which there is data. - */ - function _store_dimensions() - { - $record = 0x0000; // Record identifier - $length = 0x000A; // Number of bytes to follow - $row_min = $this->dim_rowmin; // First row - $row_max = $this->dim_rowmax; // Last row plus 1 - $col_min = $this->dim_colmin; // First column - $col_max = $this->dim_colmax; // Last column plus 1 - $reserved = 0x0000; // Reserved by Excel - - $header = pack("vv", $record, $length); - $data = pack("vvvvv", $row_min, $row_max, - $col_min, $col_max, $reserved); - $this->_prepend($header.$data); - } - - /** - * Write BIFF record Window2. - */ - function _store_window2() - { - $record = 0x023E; // Record identifier - $length = 0x000A; // Number of bytes to follow - - $grbit = 0x00B6; // Option flags - $rwTop = 0x0000; // Top row visible in window - $colLeft = 0x0000; // Leftmost column visible in window - $rgbHdr = 0x00000000; // Row/column heading and gridline color - - // The options flags that comprise $grbit - $fDspFmla = 0; // 0 - bit - $fDspGrid = 1; // 1 - $fDspRwCol = 1; // 2 - $fFrozen = $this->_frozen; // 3 - $fDspZeros = 1; // 4 - $fDefaultHdr = 1; // 5 - $fArabic = 0; // 6 - $fDspGuts = 1; // 7 - $fFrozenNoSplit = 0; // 0 - bit - $fSelected = $this->selected; // 1 - $fPaged = 1; // 2 - - $grbit = $fDspFmla; - $grbit |= $fDspGrid << 1; - $grbit |= $fDspRwCol << 2; - $grbit |= $fFrozen << 3; - $grbit |= $fDspZeros << 4; - $grbit |= $fDefaultHdr << 5; - $grbit |= $fArabic << 6; - $grbit |= $fDspGuts << 7; - $grbit |= $fFrozenNoSplit << 8; - $grbit |= $fSelected << 9; - $grbit |= $fPaged << 10; - - $header = pack("vv", $record, $length); - $data = pack("vvvV", $grbit, $rwTop, $colLeft, $rgbHdr); - $this->_append($header.$data); - } - - /** - * Write BIFF record DEFCOLWIDTH if COLINFO records are in use. - */ - function _store_defcol() - { - $record = 0x0055; // Record identifier - $length = 0x0002; // Number of bytes to follow - $colwidth = 0x0008; // Default column width - - $header = pack("vv", $record, $length); - $data = pack("v", $colwidth); - $this->_prepend($header.$data); - } - - /** - * Write BIFF record COLINFO to define column widths - * - * Note: The SDK says the record length is 0x0B but Excel writes a 0x0C - * length record. - * - * @param array $col_array This is the only parameter received and is composed of the following: - * 0 => First formatted column, - * 1 => Last formatted column, - * 2 => Col width (8.43 is Excel default), - * 3 => The optional XF format of the column, - * 4 => Option flags. - */ - function _store_colinfo($col_array) - { - if(isset($col_array[0])) { - $colFirst = $col_array[0]; - } - if(isset($col_array[1])) { - $colLast = $col_array[1]; - } - if(isset($col_array[2])) { - $coldx = $col_array[2]; - } - else { - $coldx = 8.43; - } - if(isset($col_array[3])) { - $format = $col_array[3]; - } - else { - $format = 0; - } - if(isset($col_array[4])) { - $grbit = $col_array[4]; - } - else { - $grbit = 0; - } - $record = 0x007D; // Record identifier - $length = 0x000B; // Number of bytes to follow - - $coldx += 0.72; // Fudge. Excel subtracts 0.72 !? - $coldx *= 256; // Convert to units of 1/256 of a char - - $ixfe = $this->_XF($format); - $reserved = 0x00; // Reserved - - $header = pack("vv", $record, $length); - $data = pack("vvvvvC", $colFirst, $colLast, $coldx, - $ixfe, $grbit, $reserved); - $this->_prepend($header.$data); - } - - /** - * Write BIFF record SELECTION. - * - * @param array $array array containing ($rwFirst,$colFirst,$rwLast,$colLast) - * @see set_selection() - */ - function _store_selection($array) - { - list($rwFirst,$colFirst,$rwLast,$colLast) = $array; - $record = 0x001D; // Record identifier - $length = 0x000F; // Number of bytes to follow - - $pnn = $this->_active_pane; // Pane position - $rwAct = $rwFirst; // Active row - $colAct = $colFirst; // Active column - $irefAct = 0; // Active cell ref - $cref = 1; // Number of refs - - if (!isset($rwLast)) { - $rwLast = $rwFirst; // Last row in reference - } - if (!isset($colLast)) { - $colLast = $colFirst; // Last col in reference - } - - // Swap last row/col for first row/col as necessary - if ($rwFirst > $rwLast) - { - list($rwFirst, $rwLast) = array($rwLast, $rwFirst); - } - - if ($colFirst > $colLast) - { - list($colFirst, $colLast) = array($colLast, $colFirst); - } - - $header = pack("vv", $record, $length); - $data = pack("CvvvvvvCC", $pnn, $rwAct, $colAct, - $irefAct, $cref, - $rwFirst, $rwLast, - $colFirst, $colLast); - $this->_append($header.$data); - } - - - /** - * Write BIFF record EXTERNCOUNT to indicate the number of external sheet - * references in a worksheet. - * - * Excel only stores references to external sheets that are used in formulas. - * For simplicity we store references to all the sheets in the workbook - * regardless of whether they are used or not. This reduces the overall - * complexity and eliminates the need for a two way dialogue between the formula - * parser the worksheet objects. - * - * @param integer $count The number of external sheet references in this worksheet - */ - function _store_externcount($count) - { - $record = 0x0016; // Record identifier - $length = 0x0002; // Number of bytes to follow - - $header = pack("vv", $record, $length); - $data = pack("v", $count); - $this->_prepend($header.$data); - } - - /** - * Writes the Excel BIFF EXTERNSHEET record. These references are used by - * formulas. A formula references a sheet name via an index. Since we store a - * reference to all of the external worksheets the EXTERNSHEET index is the same - * as the worksheet index. - * - * @param string $sheetname The name of a external worksheet - */ - function _store_externsheet($sheetname) - { - $record = 0x0017; // Record identifier - - // References to the current sheet are encoded differently to references to - // external sheets. - // - if ($this->name == $sheetname) { - $sheetname = ''; - $length = 0x02; // The following 2 bytes - $cch = 1; // The following byte - $rgch = 0x02; // Self reference - } - else { - $length = 0x02 + strlen($sheetname); - $cch = strlen($sheetname); - $rgch = 0x03; // Reference to a sheet in the current workbook - } - - $header = pack("vv", $record, $length); - $data = pack("CC", $cch, $rgch); - $this->_prepend($header.$data.$sheetname); - } - - /** - * Writes the Excel BIFF PANE record. - * The panes can either be frozen or thawed (unfrozen). - * Frozen panes are specified in terms of an integer number of rows and columns. - * Thawed panes are specified in terms of Excel's units for rows and columns. - * - * @param array $panes This is the only parameter received and is composed of the following: - * 0 => Vertical split position, - * 1 => Horizontal split position - * 2 => Top row visible - * 3 => Leftmost column visible - * 4 => Active pane - */ - function _store_panes($panes) - { - $y = $panes[0]; - $x = $panes[1]; - $rwTop = $panes[2]; - $colLeft = $panes[3]; - if(count($panes) > 4) { // if Active pane was received - $pnnAct = $panes[4]; - } - else { - $pnnAct = NULL; - } - $record = 0x0041; // Record identifier - $length = 0x000A; // Number of bytes to follow - - // Code specific to frozen or thawed panes. - if ($this->_frozen) { - // Set default values for $rwTop and $colLeft - if(!isset($rwTop)) { - $rwTop = $y; - } - if(!isset($colLeft)) { - $colLeft = $x; - } - } - else { - // Set default values for $rwTop and $colLeft - if(!isset($rwTop)) { - $rwTop = 0; - } - if(!isset($colLeft)) { - $colLeft = 0; - } - - // Convert Excel's row and column units to the internal units. - // The default row height is 12.75 - // The default column width is 8.43 - // The following slope and intersection values were interpolated. - // - $y = 20*$y + 255; - $x = 113.879*$x + 390; - } - - - // Determine which pane should be active. There is also the undocumented - // option to override this should it be necessary: may be removed later. - // - if (!isset($pnnAct)) - { - if ($x != 0 and $y != 0) - $pnnAct = 0; // Bottom right - if ($x != 0 and $y == 0) - $pnnAct = 1; // Top right - if ($x == 0 and $y != 0) - $pnnAct = 2; // Bottom left - if ($x == 0 and $y == 0) - $pnnAct = 3; // Top left - } - - $this->_active_pane = $pnnAct; // Used in _store_selection - - $header = pack("vv", $record, $length); - $data = pack("vvvvv", $x, $y, $rwTop, $colLeft, $pnnAct); - $this->_append($header.$data); - } - - /** - * Store the page setup SETUP BIFF record. - */ - function _store_setup() - { - $record = 0x00A1; // Record identifier - $length = 0x0022; // Number of bytes to follow - - $iPaperSize = $this->_paper_size; // Paper size - $iScale = $this->_print_scale; // Print scaling factor - $iPageStart = 0x01; // Starting page number - $iFitWidth = $this->_fit_width; // Fit to number of pages wide - $iFitHeight = $this->_fit_height; // Fit to number of pages high - $grbit = 0x00; // Option flags - $iRes = 0x0258; // Print resolution - $iVRes = 0x0258; // Vertical print resolution - $numHdr = $this->_margin_head; // Header Margin - $numFtr = $this->_margin_foot; // Footer Margin - $iCopies = 0x01; // Number of copies - - $fLeftToRight = 0x0; // Print over then down - $fLandscape = $this->_orientation; // Page orientation - $fNoPls = 0x0; // Setup not read from printer - $fNoColor = 0x0; // Print black and white - $fDraft = 0x0; // Print draft quality - $fNotes = 0x0; // Print notes - $fNoOrient = 0x0; // Orientation not set - $fUsePage = 0x0; // Use custom starting page - - $grbit = $fLeftToRight; - $grbit |= $fLandscape << 1; - $grbit |= $fNoPls << 2; - $grbit |= $fNoColor << 3; - $grbit |= $fDraft << 4; - $grbit |= $fNotes << 5; - $grbit |= $fNoOrient << 6; - $grbit |= $fUsePage << 7; - - $numHdr = pack("d", $numHdr); - $numFtr = pack("d", $numFtr); - if ($this->_byte_order) // if it's Big Endian - { - $numHdr = strrev($numHdr); - $numFtr = strrev($numFtr); - } - - $header = pack("vv", $record, $length); - $data1 = pack("vvvvvvvv", $iPaperSize, - $iScale, - $iPageStart, - $iFitWidth, - $iFitHeight, - $grbit, - $iRes, - $iVRes); - $data2 = $numHdr .$numFtr; - $data3 = pack("v", $iCopies); - $this->_prepend($header.$data1.$data2.$data3); - } - - /** - * Store the header caption BIFF record. - */ - function store_header() - { - $record = 0x0014; // Record identifier - - $str = $this->_header; // header string - $cch = strlen($str); // Length of header string - $length = 1 + $cch; // Bytes to follow - - $header = pack("vv", $record, $length); - $data = pack("C", $cch); - - $this->_append($header.$data.$str); - } - - /** - * Store the footer caption BIFF record. - */ - function store_footer() - { - $record = 0x0015; // Record identifier - - $str = $this->_footer; // Footer string - $cch = strlen($str); // Length of footer string - $length = 1 + $cch; // Bytes to follow - - $header = pack("vv", $record, $length); - $data = pack("C", $cch); - - $this->_append($header.$data.$str); - } - - /** - * Store the horizontal centering HCENTER BIFF record. - */ - function store_hcenter() - { - $record = 0x0083; // Record identifier - $length = 0x0002; // Bytes to follow - - $fHCenter = $this->_hcenter; // Horizontal centering - - $header = pack("vv", $record, $length); - $data = pack("v", $fHCenter); - - $this->_append($header.$data); - } - - /** - * Store the vertical centering VCENTER BIFF record. - */ - function store_vcenter() - { - $record = 0x0084; // Record identifier - $length = 0x0002; // Bytes to follow - - $fVCenter = $this->_vcenter; // Horizontal centering - - $header = pack("vv", $record, $length); - $data = pack("v", $fVCenter); - $this->_append($header.$data); - } - - /** - * Store the LEFTMARGIN BIFF record. - */ - function _store_margin_left() - { - $record = 0x0026; // Record identifier - $length = 0x0008; // Bytes to follow - - $margin = $this->_margin_left; // Margin in inches - - $header = pack("vv", $record, $length); - $data = pack("d", $margin); - if ($this->_byte_order) // if it's Big Endian - { - $data = strrev($data); - } - - $this->_append($header.$data); - } - - /** - * Store the RIGHTMARGIN BIFF record. - */ - function _store_margin_right() - { - $record = 0x0027; // Record identifier - $length = 0x0008; // Bytes to follow - - $margin = $this->_margin_right; // Margin in inches - - $header = pack("vv", $record, $length); - $data = pack("d", $margin); - if ($this->_byte_order) // if it's Big Endian - { - $data = strrev($data); - } - - $this->_append($header.$data); - } - - /** - * Store the TOPMARGIN BIFF record. - */ - function _store_margin_top() - { - $record = 0x0028; // Record identifier - $length = 0x0008; // Bytes to follow - - $margin = $this->_margin_top; // Margin in inches - - $header = pack("vv", $record, $length); - $data = pack("d", $margin); - if ($this->_byte_order) // if it's Big Endian - { - $data = strrev($data); - } - - $this->_append($header.$data); - } - - /** - * Store the BOTTOMMARGIN BIFF record. - */ - function _store_margin_bottom() - { - $record = 0x0029; // Record identifier - $length = 0x0008; // Bytes to follow - - $margin = $this->_margin_bottom; // Margin in inches - - $header = pack("vv", $record, $length); - $data = pack("d", $margin); - if ($this->_byte_order) // if it's Big Endian - { - $data = strrev($data); - } - - $this->_append($header.$data); - } - - /** - * This is an Excel97/2000 method. It is required to perform more complicated - * merging than the normal set_align('merge'). It merges the area given by - * its arguments. - * - * @access public - * @param integer $first_row First row of the area to merge - * @param integer $first_col First column of the area to merge - * @param integer $last_row Last row of the area to merge - * @param integer $last_col Last column of the area to merge - */ - function merge_cells($first_row, $first_col, $last_row, $last_col) - { - $record = 0x00E5; // Record identifier - $length = 0x000A; // Bytes to follow - $cref = 1; // Number of refs - - // Swap last row/col for first row/col as necessary - if ($first_row > $last_row) { - list($first_row, $last_row) = array($last_row, $first_row); - } - - if ($first_col > $last_col) { - list($first_col, $last_col) = array($last_col, $first_col); - } - - $header = pack("vv", $record, $length); - $data = pack("vvvvv", $cref, $first_row, $last_row, - $first_col, $last_col); - - $this->_append($header.$data); - } - - /** - * Write the PRINTHEADERS BIFF record. - */ - function _store_print_headers() - { - $record = 0x002a; // Record identifier - $length = 0x0002; // Bytes to follow - - $fPrintRwCol = $this->_print_headers; // Boolean flag - - $header = pack("vv", $record, $length); - $data = pack("v", $fPrintRwCol); - $this->_prepend($header.$data); - } - - /** - * Write the PRINTGRIDLINES BIFF record. Must be used in conjunction with the - * GRIDSET record. - */ - function _store_print_gridlines() - { - $record = 0x002b; // Record identifier - $length = 0x0002; // Bytes to follow - - $fPrintGrid = $this->_print_gridlines; // Boolean flag - - $header = pack("vv", $record, $length); - $data = pack("v", $fPrintGrid); - $this->_prepend($header.$data); - } - - /** - * Write the GRIDSET BIFF record. Must be used in conjunction with the - * PRINTGRIDLINES record. - */ - function _store_gridset() - { - $record = 0x0082; // Record identifier - $length = 0x0002; // Bytes to follow - - $fGridSet = !($this->_print_gridlines); // Boolean flag - - $header = pack("vv", $record, $length); - $data = pack("v", $fGridSet); - $this->_prepend($header.$data); - } - - /** - * Write the WSBOOL BIFF record, mainly for fit-to-page. Used in conjunction - * with the SETUP record. - */ - function _store_wsbool() - { - $record = 0x0081; // Record identifier - $length = 0x0002; // Bytes to follow - - // The only option that is of interest is the flag for fit to page. So we - // set all the options in one go. - // - if ($this->_fit_page) { - $grbit = 0x05c1; - } - else { - $grbit = 0x04c1; - } - - $header = pack("vv", $record, $length); - $data = pack("v", $grbit); - $this->_prepend($header.$data); - } - - - /** - * Write the HORIZONTALPAGEBREAKS BIFF record. - */ - function _store_hbreak() - { - // Return if the user hasn't specified pagebreaks - if(empty($this->_hbreaks)) { - return; - } - - // Sort and filter array of page breaks - $breaks = $this->_hbreaks; - sort($breaks,SORT_NUMERIC); - if($breaks[0] == 0) { // don't use first break if it's 0 - array_shift($breaks); - } - - $record = 0x001b; // Record identifier - $cbrk = count($breaks); // Number of page breaks - $length = ($cbrk + 1) * 2; // Bytes to follow - - $header = pack("vv", $record, $length); - $data = pack("v", $cbrk); - - // Append each page break - foreach($breaks as $break) { - $data .= pack("v", $break); - } - - $this->_prepend($header.$data); - } - - - /** - * Write the VERTICALPAGEBREAKS BIFF record. - */ - function _store_vbreak() - { - // Return if the user hasn't specified pagebreaks - if(empty($this->_vbreaks)) { - return; - } - - // 1000 vertical pagebreaks appears to be an internal Excel 5 limit. - // It is slightly higher in Excel 97/200, approx. 1026 - $breaks = array_slice($this->_vbreaks,0,1000); - - // Sort and filter array of page breaks - sort($breaks,SORT_NUMERIC); - if($breaks[0] == 0) { // don't use first break if it's 0 - array_shift($breaks); - } - - $record = 0x001a; // Record identifier - $cbrk = count($breaks); // Number of page breaks - $length = ($cbrk + 1) * 2; // Bytes to follow - - $header = pack("vv", $record, $length); - $data = pack("v", $cbrk); - - // Append each page break - foreach ($breaks as $break) { - $data .= pack("v", $break); - } - - $this->_prepend($header.$data); - } - - /** - * Set the Biff PROTECT record to indicate that the worksheet is protected. - */ - function _store_protect() - { - // Exit unless sheet protection has been specified - if($this->_protect == 0) { - return; - } - - $record = 0x0012; // Record identifier - $length = 0x0002; // Bytes to follow - - $fLock = $this->_protect; // Worksheet is protected - - $header = pack("vv", $record, $length); - $data = pack("v", $fLock); - - $this->_prepend($header.$data); - } - - /** - * Write the worksheet PASSWORD record. - */ - function _store_password() - { - // Exit unless sheet protection and password have been specified - if(($this->_protect == 0) or (!isset($this->_password))) { - return; - } - - $record = 0x0013; // Record identifier - $length = 0x0002; // Bytes to follow - - $wPassword = $this->_password; // Encoded password - - $header = pack("vv", $record, $length); - $data = pack("v", $wPassword); - - $this->_prepend($header.$data); - } - - /** - * Insert a 24bit bitmap image in a worksheet. The main record required is - * IMDATA but it must be proceeded by a OBJ record to define its position. - * - * @access public - * @param integer $row The row we are going to insert the bitmap into - * @param integer $col The column we are going to insert the bitmap into - * @param string $bitmap The bitmap filename - * @param integer $x The horizontal position (offset) of the image inside the cell. - * @param integer $y The vertical position (offset) of the image inside the cell. - * @param integer $scale_x The horizontal scale - * @param integer $scale_y The vertical scale - */ - function insert_bitmap($row, $col, $bitmap, $x = 0, $y = 0, $scale_x = 1, $scale_y = 1) - { - list($width, $height, $size, $data) = $this->_process_bitmap($bitmap); - - // Scale the frame of the image. - $width *= $scale_x; - $height *= $scale_y; - - // Calculate the vertices of the image and write the OBJ record - $this->_position_image($col, $row, $x, $y, $width, $height); - - // Write the IMDATA record to store the bitmap data - $record = 0x007f; - $length = 8 + $size; - $cf = 0x09; - $env = 0x01; - $lcb = $size; - - $header = pack("vvvvV", $record, $length, $cf, $env, $lcb); - $this->_append($header.$data); - } - - /** - * Calculate the vertices that define the position of the image as required by - * the OBJ record. - * - * +------------+------------+ - * | A | B | - * +-----+------------+------------+ - * | |(x1,y1) | | - * | 1 |(A1)._______|______ | - * | | | | | - * | | | | | - * +-----+----| BITMAP |-----+ - * | | | | | - * | 2 | |______________. | - * | | | (B2)| - * | | | (x2,y2)| - * +---- +------------+------------+ - * - * Example of a bitmap that covers some of the area from cell A1 to cell B2. - * - * Based on the width and height of the bitmap we need to calculate 8 vars: - * $col_start, $row_start, $col_end, $row_end, $x1, $y1, $x2, $y2. - * The width and height of the cells are also variable and have to be taken into - * account. - * The values of $col_start and $row_start are passed in from the calling - * function. The values of $col_end and $row_end are calculated by subtracting - * the width and height of the bitmap from the width and height of the - * underlying cells. - * The vertices are expressed as a percentage of the underlying cell width as - * follows (rhs values are in pixels): - * - * x1 = X / W *1024 - * y1 = Y / H *256 - * x2 = (X-1) / W *1024 - * y2 = (Y-1) / H *256 - * - * Where: X is distance from the left side of the underlying cell - * Y is distance from the top of the underlying cell - * W is the width of the cell - * H is the height of the cell - * - * @note the SDK incorrectly states that the height should be expressed as a - * percentage of 1024. - * @param integer $col_start Col containing upper left corner of object - * @param integer $row_start Row containing top left corner of object - * @param integer $x1 Distance to left side of object - * @param integer $y1 Distance to top of object - * @param integer $width Width of image frame - * @param integer $height Height of image frame - */ - function _position_image($col_start, $row_start, $x1, $y1, $width, $height) - { - // Initialise end cell to the same as the start cell - $col_end = $col_start; // Col containing lower right corner of object - $row_end = $row_start; // Row containing bottom right corner of object - - // Zero the specified offset if greater than the cell dimensions - if ($x1 >= $this->size_col($col_start)) - { - $x1 = 0; - } - if ($y1 >= $this->size_row($row_start)) - { - $y1 = 0; - } - - $width = $width + $x1 -1; - $height = $height + $y1 -1; - - // Subtract the underlying cell widths to find the end cell of the image - while ($width >= $this->size_col($col_end)) { - $width -= $this->size_col($col_end); - $col_end++; - } - - // Subtract the underlying cell heights to find the end cell of the image - while ($height >= $this->size_row($row_end)) { - $height -= $this->size_row($row_end); - $row_end++; - } - - // Bitmap isn't allowed to start or finish in a hidden cell, i.e. a cell - // with zero eight or width. - // - if ($this->size_col($col_start) == 0) - return; - if ($this->size_col($col_end) == 0) - return; - if ($this->size_row($row_start) == 0) - return; - if ($this->size_row($row_end) == 0) - return; - - // Convert the pixel values to the percentage value expected by Excel - $x1 = $x1 / $this->size_col($col_start) * 1024; - $y1 = $y1 / $this->size_row($row_start) * 256; - $x2 = $width / $this->size_col($col_end) * 1024; // Distance to right side of object - $y2 = $height / $this->size_row($row_end) * 256; // Distance to bottom of object - - $this->_store_obj_picture( $col_start, $x1, - $row_start, $y1, - $col_end, $x2, - $row_end, $y2 - ); - } - - /** - * Convert the width of a cell from user's units to pixels. By interpolation - * the relationship is: y = 7x +5. If the width hasn't been set by the user we - * use the default value. If the col is hidden we use a value of zero. - * - * @param integer $col The column - * @return integer The width in pixels - */ - function size_col($col) - { - // Look up the cell value to see if it has been changed - if (isset($this->col_sizes[$col])) { - if ($this->col_sizes[$col] == 0) { - return(0); - } - else { - return(floor(7 * $this->col_sizes[$col] + 5)); - } - } - else { - return(64); - } - } - - /** - * Convert the height of a cell from user's units to pixels. By interpolation - * the relationship is: y = 4/3x. If the height hasn't been set by the user we - * use the default value. If the row is hidden we use a value of zero. (Not - * possible to hide row yet). - * - * @param integer $row The row - * @return integer The width in pixels - */ - function size_row($row) - { - // Look up the cell value to see if it has been changed - if (isset($this->row_sizes[$row])) { - if ($this->row_sizes[$row] == 0) { - return(0); - } - else { - return(floor(4/3 * $this->row_sizes[$row])); - } - } - else { - return(17); - } - } - - /** - * Store the OBJ record that precedes an IMDATA record. This could be generalise - * to support other Excel objects. - * - * @param integer $colL Column containing upper left corner of object - * @param integer $dxL Distance from left side of cell - * @param integer $rwT Row containing top left corner of object - * @param integer $dyT Distance from top of cell - * @param integer $colR Column containing lower right corner of object - * @param integer $dxR Distance from right of cell - * @param integer $rwB Row containing bottom right corner of object - * @param integer $dyB Distance from bottom of cell - */ - function _store_obj_picture($colL,$dxL,$rwT,$dyT,$colR,$dxR,$rwB,$dyB) - { - $record = 0x005d; // Record identifier - $length = 0x003c; // Bytes to follow - - $cObj = 0x0001; // Count of objects in file (set to 1) - $OT = 0x0008; // Object type. 8 = Picture - $id = 0x0001; // Object ID - $grbit = 0x0614; // Option flags - - $cbMacro = 0x0000; // Length of FMLA structure - $Reserved1 = 0x0000; // Reserved - $Reserved2 = 0x0000; // Reserved - - $icvBack = 0x09; // Background colour - $icvFore = 0x09; // Foreground colour - $fls = 0x00; // Fill pattern - $fAuto = 0x00; // Automatic fill - $icv = 0x08; // Line colour - $lns = 0xff; // Line style - $lnw = 0x01; // Line weight - $fAutoB = 0x00; // Automatic border - $frs = 0x0000; // Frame style - $cf = 0x0009; // Image format, 9 = bitmap - $Reserved3 = 0x0000; // Reserved - $cbPictFmla = 0x0000; // Length of FMLA structure - $Reserved4 = 0x0000; // Reserved - $grbit2 = 0x0001; // Option flags - $Reserved5 = 0x0000; // Reserved - - - $header = pack("vv", $record, $length); - $data = pack("V", $cObj); - $data .= pack("v", $OT); - $data .= pack("v", $id); - $data .= pack("v", $grbit); - $data .= pack("v", $colL); - $data .= pack("v", $dxL); - $data .= pack("v", $rwT); - $data .= pack("v", $dyT); - $data .= pack("v", $colR); - $data .= pack("v", $dxR); - $data .= pack("v", $rwB); - $data .= pack("v", $dyB); - $data .= pack("v", $cbMacro); - $data .= pack("V", $Reserved1); - $data .= pack("v", $Reserved2); - $data .= pack("C", $icvBack); - $data .= pack("C", $icvFore); - $data .= pack("C", $fls); - $data .= pack("C", $fAuto); - $data .= pack("C", $icv); - $data .= pack("C", $lns); - $data .= pack("C", $lnw); - $data .= pack("C", $fAutoB); - $data .= pack("v", $frs); - $data .= pack("V", $cf); - $data .= pack("v", $Reserved3); - $data .= pack("v", $cbPictFmla); - $data .= pack("v", $Reserved4); - $data .= pack("v", $grbit2); - $data .= pack("V", $Reserved5); - - $this->_append($header.$data); - } - - /** - * Convert a 24 bit bitmap into the modified internal format used by Windows. - * This is described in BITMAPCOREHEADER and BITMAPCOREINFO structures in the - * MSDN library. - * - * @param string $bitmap The bitmap to process - * @return array Array with data and properties of the bitmap - */ - function _process_bitmap($bitmap) - { - // Open file. - $bmp_fd = fopen($bitmap,"rb"); - if (!$bmp_fd) { - die("Couldn't import $bitmap"); - } - - // Slurp the file into a string. - $data = fread($bmp_fd, filesize($bitmap)); - - // Check that the file is big enough to be a bitmap. - if (strlen($data) <= 0x36) { - die("$bitmap doesn't contain enough data.\n"); - } - - // The first 2 bytes are used to identify the bitmap. - $identity = unpack("A2", $data); - if ($identity[''] != "BM") { - die("$bitmap doesn't appear to be a valid bitmap image.\n"); - } - - // Remove bitmap data: ID. - $data = substr($data, 2); - - // Read and remove the bitmap size. This is more reliable than reading - // the data size at offset 0x22. - // - $size_array = unpack("V", substr($data, 0, 4)); - $size = $size_array['']; - $data = substr($data, 4); - $size -= 0x36; // Subtract size of bitmap header. - $size += 0x0C; // Add size of BIFF header. - - // Remove bitmap data: reserved, offset, header length. - $data = substr($data, 12); - - // Read and remove the bitmap width and height. Verify the sizes. - $width_and_height = unpack("V2", substr($data, 0, 8)); - $width = $width_and_height[1]; - $height = $width_and_height[2]; - $data = substr($data, 8); - if ($width > 0xFFFF) { - die("$bitmap: largest image width supported is 65k.\n"); - } - if ($height > 0xFFFF) { - die("$bitmap: largest image height supported is 65k.\n"); - } - - // Read and remove the bitmap planes and bpp data. Verify them. - $planes_and_bitcount = unpack("v2", substr($data, 0, 4)); - $data = substr($data, 4); - if ($planes_and_bitcount[2] != 24) { // Bitcount - die("$bitmap isn't a 24bit true color bitmap.\n"); - } - if ($planes_and_bitcount[1] != 1) { - die("$bitmap: only 1 plane supported in bitmap image.\n"); - } - - // Read and remove the bitmap compression. Verify compression. - $compression = unpack("V", substr($data, 0, 4)); - $data = substr($data, 4); - - //$compression = 0; - if ($compression[""] != 0) { - die("$bitmap: compression not supported in bitmap image.\n"); - } - - // Remove bitmap data: data size, hres, vres, colours, imp. colours. - $data = substr($data, 20); - - // Add the BITMAPCOREHEADER data - $header = pack("Vvvvv", 0x000c, $width, $height, 0x01, 0x18); - $data = $header . $data; - - return (array($width, $height, $size, $data)); - } - - /** - * Store the window zoom factor. This should be a reduced fraction but for - * simplicity we will store all fractions with a numerator of 100. - */ - function _store_zoom() - { - // If scale is 100 we don't need to write a record - if ($this->_zoom == 100) { - return; - } - - $record = 0x00A0; // Record identifier - $length = 0x0004; // Bytes to follow - - $header = pack("vv", $record, $length); - $data = pack("vv", $this->_zoom, 100); - $this->_append($header.$data); - } -} + +* +* The majority of this is _NOT_ my code. I simply ported it from the +* PERL Spreadsheet::WriteExcel module. +* +* The author of the Spreadsheet::WriteExcel module is John McNamara +* +* +* I _DO_ maintain this code, and John McNamara has nothing to do with the +* porting of this code to PHP. Any questions directly related to this +* class library should be directed to me. +* +* License Information: +* +* Spreadsheet::WriteExcel: A library for generating Excel Spreadsheets +* Copyright (C) 2002 Xavier Noguer xnoguer@rezebra.com +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2.1 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +require_once('Parser.php'); +require_once('BIFFwriter.php'); + +/** +* Class for generating Excel Spreadsheets +* +* @author Xavier Noguer +* @package Spreadsheet_WriteExcel +*/ + +class Worksheet extends BIFFwriter +{ + + /** + * Constructor + * + * @param string $name The name of the new worksheet + * @param integer $index The index of the new worksheet + * @param mixed &$activesheet The current activesheet of the workbook we belong to + * @param mixed &$firstsheet The first worksheet in the workbook we belong to + * @param mixed &$url_format The default format for hyperlinks + * @param mixed &$parser The formula parser created for the Workbook + */ + function Worksheet($name,$index,&$activesheet,&$firstsheet,&$url_format,&$parser) + { + $this->BIFFwriter(); // It needs to call its parent's constructor explicitly + $rowmax = 65536; // 16384 in Excel 5 + $colmax = 256; + $strmax = 255; + + $this->name = $name; + $this->index = $index; + $this->activesheet = &$activesheet; + $this->firstsheet = &$firstsheet; + $this->_url_format = $url_format; + $this->_parser = &$parser; + + $this->ext_sheets = array(); + $this->_using_tmpfile = 1; + $this->_filehandle = ""; + $this->fileclosed = 0; + $this->offset = 0; + $this->xls_rowmax = $rowmax; + $this->xls_colmax = $colmax; + $this->xls_strmax = $strmax; + $this->dim_rowmin = $rowmax +1; + $this->dim_rowmax = 0; + $this->dim_colmin = $colmax +1; + $this->dim_colmax = 0; + $this->colinfo = array(); + $this->_selection = array(0,0,0,0); + $this->_panes = array(); + $this->_active_pane = 3; + $this->_frozen = 0; + $this->selected = 0; + + $this->_paper_size = 0x0; + $this->_orientation = 0x1; + $this->_header = ''; + $this->_footer = ''; + $this->_hcenter = 0; + $this->_vcenter = 0; + $this->_margin_head = 0.50; + $this->_margin_foot = 0.50; + $this->_margin_left = 0.75; + $this->_margin_right = 0.75; + $this->_margin_top = 1.00; + $this->_margin_bottom = 1.00; + + $this->_title_rowmin = NULL; + $this->_title_rowmax = NULL; + $this->_title_colmin = NULL; + $this->_title_colmax = NULL; + $this->_print_rowmin = NULL; + $this->_print_rowmax = NULL; + $this->_print_colmin = NULL; + $this->_print_colmax = NULL; + + $this->_print_gridlines = 1; + $this->_print_headers = 0; + + $this->_fit_page = 0; + $this->_fit_width = 0; + $this->_fit_height = 0; + + $this->_hbreaks = array(); + $this->_vbreaks = array(); + + $this->_protect = 0; + $this->_password = NULL; + + $this->col_sizes = array(); + $this->row_sizes = array(); + + $this->_zoom = 100; + $this->_print_scale = 100; + + $this->_initialize(); + } + + /** + * Open a tmp file to store the majority of the Worksheet data. If this fails, + * for example due to write permissions, store the data in memory. This can be + * slow for large files. + */ + function _initialize() + { + // Open tmp file for storing Worksheet data + $fh = tmpfile(); + if ( $fh) { + // Store filehandle + $this->_filehandle = $fh; + } + else { + // If tmpfile() fails store data in memory + $this->_using_tmpfile = 0; + } + } + + /** + * Add data to the beginning of the workbook (note the reverse order) + * and to the end of the workbook. + * + * @access public + * @see Workbook::store_workbook() + * @param array $sheetnames The array of sheetnames from the Workbook this + * worksheet belongs to + */ + function close($sheetnames) + { + $num_sheets = count($sheetnames); + + /*********************************************** + * Prepend in reverse order!! + */ + + // Prepend the sheet dimensions + $this->_store_dimensions(); + + // Prepend the sheet password + $this->_store_password(); + + // Prepend the sheet protection + $this->_store_protect(); + + // Prepend the page setup + $this->_store_setup(); + + // Prepend the bottom margin + $this->_store_margin_bottom(); + + // Prepend the top margin + $this->_store_margin_top(); + + // Prepend the right margin + $this->_store_margin_right(); + + // Prepend the left margin + $this->_store_margin_left(); + + // Prepend the page vertical centering + $this->store_vcenter(); + + // Prepend the page horizontal centering + $this->store_hcenter(); + + // Prepend the page footer + $this->store_footer(); + + // Prepend the page header + $this->store_header(); + + // Prepend the vertical page breaks + $this->_store_vbreak(); + + // Prepend the horizontal page breaks + $this->_store_hbreak(); + + // Prepend WSBOOL + $this->_store_wsbool(); + + // Prepend GRIDSET + $this->_store_gridset(); + + // Prepend PRINTGRIDLINES + $this->_store_print_gridlines(); + + // Prepend PRINTHEADERS + $this->_store_print_headers(); + + // Prepend EXTERNSHEET references + for ($i = $num_sheets; $i > 0; $i--) { + $sheetname = $sheetnames[$i-1]; + $this->_store_externsheet($sheetname); + } + + // Prepend the EXTERNCOUNT of external references. + $this->_store_externcount($num_sheets); + + // Prepend the COLINFO records if they exist + if (!empty($this->colinfo)){ + for($i=0; $i < count($this->colinfo); $i++) + { + $this->_store_colinfo($this->colinfo[$i]); + } + $this->_store_defcol(); + } + + // Prepend the BOF record + $this->_store_bof(0x0010); + + /* + * End of prepend. Read upwards from here. + ***********************************************/ + + // Append + $this->_store_window2(); + $this->_store_zoom(); + if(!empty($this->_panes)) + $this->_store_panes($this->_panes); + $this->_store_selection($this->_selection); + $this->_store_eof(); + } + + /** + * Retrieve the worksheet name. This is usefull when creating worksheets + * without a name. + * + * @access public + * @return string The worksheet's name + */ + function get_name() + { + return($this->name); + } + + /** + * Retrieves data from memory in one chunk, or from disk in $buffer + * sized chunks. + * + * @return string The data + */ + function get_data() + { + $buffer = 4096; + + // Return data stored in memory + if (isset($this->_data)) { + $tmp = $this->_data; + unset($this->_data); + $fh = $this->_filehandle; + if ($this->_using_tmpfile) { + fseek($fh, 0); + } + return($tmp); + } + // Return data stored on disk + if ($this->_using_tmpfile) { + if ($tmp = fread($this->_filehandle, $buffer)) { + return($tmp); + } + } + + // No data to return + return(''); + } + + /** + * Set this worksheet as a selected worksheet, i.e. the worksheet has its tab + * highlighted. + * + * @access public + */ + function select() + { + $this->selected = 1; + } + + /** + * Set this worksheet as the active worksheet, i.e. the worksheet that is + * displayed when the workbook is opened. Also set it as selected. + * + * @access public + */ + function activate() + { + $this->selected = 1; + $this->activesheet =& $this->index; + } + + /** + * Set this worksheet as the first visible sheet. This is necessary + * when there are a large number of worksheets and the activated + * worksheet is not visible on the screen. + * + * @access public + */ + function set_first_sheet() + { + $this->firstsheet = $this->index; + } + + /** + * Set the worksheet protection flag to prevent accidental modification and to + * hide formulas if the locked and hidden format properties have been set. + * + * @access public + * @param string $password The password to use for protecting the sheet. + */ + function protect($password) + { + $this->_protect = 1; + $this->_password = $this->_encode_password($password); + } + + /** + * Set the width of a single column or a range of columns. + * + * @access public + * @see _store_colinfo() + * @param integer $firstcol first column on the range + * @param integer $lastcol last column on the range + * @param integer $width width to set + * @param mixed $format The optional XF format to apply to the columns + * @param integer $hidden The optional hidden atribute + */ + function set_column($firstcol, $lastcol, $width, $format = 0, $hidden = 0) + { + $this->colinfo[] = array($firstcol, $lastcol, $width, $format, $hidden); + + // Set width to zero if column is hidden + $width = ($hidden) ? 0 : $width; + + for($col = $firstcol; $col <= $lastcol; $col++) { + $this->col_sizes[$col] = $width; + } + } + + /** + * Set which cell or cells are selected in a worksheet + * + * @access public + * @param integer $first_row first row in the selected quadrant + * @param integer $first_column first column in the selected quadrant + * @param integer $last_row last row in the selected quadrant + * @param integer $last_column last column in the selected quadrant + * @see _store_selection() + */ + function set_selection($first_row,$first_column,$last_row,$last_column) + { + $this->_selection = array($first_row,$first_column,$last_row,$last_column); + } + + /** + * Set panes and mark them as frozen. + * + * @access public + * @param array $panes This is the only parameter received and is composed of the following: + * 0 => Vertical split position, + * 1 => Horizontal split position + * 2 => Top row visible + * 3 => Leftmost column visible + * 4 => Active pane + */ + function freeze_panes($panes) + { + $this->_frozen = 1; + $this->_panes = $panes; + } + + /** + * Set panes and mark them as unfrozen. + * + * @access public + * @param array $panes This is the only parameter received and is composed of the following: + * 0 => Vertical split position, + * 1 => Horizontal split position + * 2 => Top row visible + * 3 => Leftmost column visible + * 4 => Active pane + */ + function thaw_panes($panes) + { + $this->_frozen = 0; + $this->_panes = $panes; + } + + /** + * Set the page orientation as portrait. + * + * @access public + */ + function set_portrait() + { + $this->_orientation = 1; + } + + /** + * Set the page orientation as landscape. + * + * @access public + */ + function set_landscape() + { + $this->_orientation = 0; + } + + /** + * Set the paper type. Ex. 1 = US Letter, 9 = A4 + * + * @access public + * @param integer $size The type of paper size to use + */ + function set_paper($size = 0) + { + $this->_paper_size = $size; + } + + + /** + * Set the page header caption and optional margin. + * + * @access public + * @param string $string The header text + * @param float $margin optional head margin in inches. + */ + function set_header($string,$margin = 0.50) + { + if (strlen($string) >= 255) { + //carp 'Header string must be less than 255 characters'; + return; + } + $this->_header = $string; + $this->_margin_head = $margin; + } + + /** + * Set the page footer caption and optional margin. + * + * @access public + * @param string $string The footer text + * @param float $margin optional foot margin in inches. + */ + function set_footer($string,$margin = 0.50) + { + if (strlen($string) >= 255) { + //carp 'Footer string must be less than 255 characters'; + return; + } + $this->_footer = $string; + $this->_margin_foot = $margin; + } + + /** + * Center the page horinzontally. + * + * @access public + * @param integer $center the optional value for centering. Defaults to 1 (center). + */ + function center_horizontally($center = 1) + { + $this->_hcenter = $center; + } + + /** + * Center the page horinzontally. + * + * @access public + * @param integer $center the optional value for centering. Defaults to 1 (center). + */ + function center_vertically($center = 1) + { + $this->_vcenter = $center; + } + + /** + * Set all the page margins to the same value in inches. + * + * @access public + * @param float $margin The margin to set in inches + */ + function set_margins($margin) + { + $this->set_margin_left($margin); + $this->set_margin_right($margin); + $this->set_margin_top($margin); + $this->set_margin_bottom($margin); + } + + /** + * Set the left and right margins to the same value in inches. + * + * @access public + * @param float $margin The margin to set in inches + */ + function set_margins_LR($margin) + { + $this->set_margin_left($margin); + $this->set_margin_right($margin); + } + + /** + * Set the top and bottom margins to the same value in inches. + * + * @access public + * @param float $margin The margin to set in inches + */ + function set_margins_TB($margin) + { + $this->set_margin_top($margin); + $this->set_margin_bottom($margin); + } + + /** + * Set the left margin in inches. + * + * @access public + * @param float $margin The margin to set in inches + */ + function set_margin_left($margin = 0.75) + { + $this->_margin_left = $margin; + } + + /** + * Set the right margin in inches. + * + * @access public + * @param float $margin The margin to set in inches + */ + function set_margin_right($margin = 0.75) + { + $this->_margin_right = $margin; + } + + /** + * Set the top margin in inches. + * + * @access public + * @param float $margin The margin to set in inches + */ + function set_margin_top($margin = 1.00) + { + $this->_margin_top = $margin; + } + + /** + * Set the bottom margin in inches. + * + * @access public + * @param float $margin The margin to set in inches + */ + function set_margin_bottom($margin = 1.00) + { + $this->_margin_bottom = $margin; + } + + /** + * Set the rows to repeat at the top of each printed page. See also the + * _store_name_xxxx() methods in Workbook.php + * + * @access public + * @param integer $first_row First row to repeat + * @param integer $last_row Last row to repeat. Optional. + */ + function repeat_rows($first_row, $last_row = NULL) + { + $this->_title_rowmin = $first_row; + if(isset($last_row)) { //Second row is optional + $this->_title_rowmax = $last_row; + } + else { + $this->_title_rowmax = $first_row; + } + } + + /** + * Set the columns to repeat at the left hand side of each printed page. + * See also the _store_names() methods in Workbook.php + * + * @access public + * @param integer $first_col First column to repeat + * @param integer $last_col Last column to repeat. Optional. + */ + function repeat_columns($first_col, $last_col = NULL) + { + $this->_title_colmin = $first_col; + if(isset($last_col)) { // Second col is optional + $this->_title_colmax = $last_col; + } + else { + $this->_title_colmax = $first_col; + } + } + + /** + * Set the area of each worksheet that will be printed. + * + * @access public + * @see Workbook::_store_names() + * @param integer $first_row First row of the area to print + * @param integer $first_col First column of the area to print + * @param integer $last_row Last row of the area to print + * @param integer $last_col Last column of the area to print + */ + function print_area($first_row, $first_col, $last_row, $last_col) + { + $this->_print_rowmin = $first_row; + $this->_print_colmin = $first_col; + $this->_print_rowmax = $last_row; + $this->_print_colmax = $last_col; + } + + + /** + * Set the option to hide gridlines on the printed page. + * + * @access public + * @see _store_print_gridlines(), _store_gridset() + */ + function hide_gridlines() + { + $this->_print_gridlines = 0; + } + + /** + * Set the option to print the row and column headers on the printed page. + * See also the _store_print_headers() method below. + * + * @access public + * @see _store_print_headers() + * @param integer $print Whether to print the headers or not. Defaults to 1 (print). + */ + function print_row_col_headers($print = 1) + { + $this->_print_headers = $print; + } + + /** + * Store the vertical and horizontal number of pages that will define the + * maximum area printed. It doesn't seem to work with OpenOffice. + * + * @access public + * @param integer $width Maximun width of printed area in pages + * @param integer $heigth Maximun heigth of printed area in pages + * @see set_print_scale() + */ + function fit_to_pages($width, $height) + { + $this->_fit_page = 1; + $this->_fit_width = $width; + $this->_fit_height = $height; + } + + /** + * Store the horizontal page breaks on a worksheet (for printing). + * The breaks represent the row after which the break is inserted. + * + * @access public + * @param array $breaks Array containing the horizontal page breaks + */ + function set_h_pagebreaks($breaks) + { + foreach($breaks as $break) { + array_push($this->_hbreaks,$break); + } + } + + /** + * Store the vertical page breaks on a worksheet (for printing). + * The breaks represent the column after which the break is inserted. + * + * @access public + * @param array $breaks Array containing the vertical page breaks + */ + function set_v_pagebreaks($breaks) + { + foreach($breaks as $break) { + array_push($this->_vbreaks,$break); + } + } + + + /** + * Set the worksheet zoom factor. + * + * @access public + * @param integer $scale The zoom factor + */ + function set_zoom($scale = 100) + { + // Confine the scale to Excel's range + if ($scale < 10 or $scale > 400) { + //carp "Zoom factor $scale outside range: 10 <= zoom <= 400"; + $scale = 100; + } + + $this->_zoom = floor($scale); + } + + /** + * Set the scale factor for the printed page. + * It turns off the "fit to page" option + * + * @access public + * @param integer $scale The optional scale factor. Defaults to 100 + */ + function set_print_scale($scale = 100) + { + // Confine the scale to Excel's range + if ($scale < 10 or $scale > 400) + { + // REPLACE THIS FOR A WARNING + die("Print scale $scale outside range: 10 <= zoom <= 400"); + $scale = 100; + } + + // Turn off "fit to page" option + $this->_fit_page = 0; + + $this->_print_scale = floor($scale); + } + + /** + * Map to the appropriate write method acording to the token recieved. + * + * @access public + * @param integer $row The row of the cell we are writing to + * @param integer $col The column of the cell we are writing to + * @param mixed $token What we are writing + * @param mixed $format The optional format to apply to the cell + */ + function write($row, $col, $token, $format = 0) + { + // Check for a cell reference in A1 notation and substitute row and column + /*if ($_[0] =~ /^\D/) { + @_ = $this->_substitute_cellref(@_); + }*/ + + /* + # Match an array ref. + if (ref $token eq "ARRAY") { + return $this->write_row(@_); + }*/ + + // Match number + if (preg_match("/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/",$token)) { + return $this->write_number($row,$col,$token,$format); + } + // Match http or ftp URL + elseif (preg_match("/^[fh]tt?p:\/\//",$token)) { + return $this->write_url($row, $col, $token, $format); + } + // Match mailto: + elseif (preg_match("/^mailto:/",$token)) { + return $this->write_url($row, $col, $token, $format); + } + // Match internal or external sheet link + elseif (preg_match("/^(?:in|ex)ternal:/",$token)) { + return $this->write_url($row, $col, $token, $format); + } + // Match formula + elseif (preg_match("/^=/",$token)) { + return $this->write_formula($row, $col, $token, $format); + } + // Match formula + elseif (preg_match("/^@/",$token)) { + return $this->write_formula($row, $col, $token, $format); + } + // Match blank + elseif ($token == '') { + return $this->write_blank($row,$col,$format); + } + // Default: match string + else { + return $this->write_string($row,$col,$token,$format); + } + } + + /** + * Returns an index to the XF record in the workbook + * + * @param mixed $format The optional XF format + * @return integer The XF record index + */ + function _XF(&$format) + { + if($format != 0) + { + return($format->get_xf_index()); + } + else + { + return(0x0F); + } + } + + + /****************************************************************************** + ******************************************************************************* + * + * Internal methods + */ + + + /** + * Store Worksheet data in memory using the parent's class append() or to a + * temporary file, the default. + * + * @param string $data The binary data to append + */ + function _append($data) + { + if ($this->_using_tmpfile) + { + // Add CONTINUE records if necessary + if (strlen($data) > $this->_limit) { + $data = $this->_add_continue($data); + } + fwrite($this->_filehandle,$data); + $this->_datasize += strlen($data); + } + else { + parent::_append($data); + } + } + + /** + * Substitute an Excel cell reference in A1 notation for zero based row and + * column values in an argument list. + * + * Ex: ("A4", "Hello") is converted to (3, 0, "Hello"). + * + * @param string $cell The cell reference. Or range of cells. + * @return array + */ + function _substitute_cellref($cell) + { + $cell = strtoupper($cell); + + // Convert a column range: 'A:A' or 'B:G' + if (preg_match("/([A-I]?[A-Z]):([A-I]?[A-Z])/",$cell,$match)) { + list($no_use, $col1) = $this->_cell_to_rowcol($match[1] .'1'); // Add a dummy row + list($no_use, $col2) = $this->_cell_to_rowcol($match[2] .'1'); // Add a dummy row + return(array($col1, $col2)); + } + + // Convert a cell range: 'A1:B7' + if (preg_match("/\$?([A-I]?[A-Z]\$?\d+):\$?([A-I]?[A-Z]\$?\d+)/",$cell,$match)) { + list($row1, $col1) = $this->_cell_to_rowcol($match[1]); + list($row2, $col2) = $this->_cell_to_rowcol($match[2]); + return(array($row1, $col1, $row2, $col2)); + } + + // Convert a cell reference: 'A1' or 'AD2000' + if (preg_match("/\$?([A-I]?[A-Z]\$?\d+)/",$cell)) { + list($row1, $col1) = $this->_cell_to_rowcol($match[1]); + return(array($row1, $col1)); + } + + die("Unknown cell reference $cell "); + } + + /** + * Convert an Excel cell reference in A1 notation to a zero based row and column + * reference; converts C1 to (0, 2). + * + * @param string $cell The cell reference. + * @return array containing (row, column) + */ + function _cell_to_rowcol($cell) + { + preg_match("/\$?([A-I]?[A-Z])\$?(\d+)/",$cell,$match); + $col = $match[1]; + $row = $match[2]; + + // Convert base26 column string to number + $chars = split('', $col); + $expn = 0; + $col = 0; + + while ($chars) { + $char = array_pop($chars); // LS char first + $col += (ord($char) -ord('A') +1) * pow(26,$expn); + $expn++; + } + + // Convert 1-index to zero-index + $row--; + $col--; + + return(array($row, $col)); + } + + /** + * Based on the algorithm provided by Daniel Rentz of OpenOffice. + * + * @param string $plaintext The password to be encoded in plaintext. + * @return string The encoded password + */ + function _encode_password($plaintext) + { + $password = 0x0000; + $i = 1; // char position + + // split the plain text password in its component characters + $chars = preg_split('//', $plaintext, -1, PREG_SPLIT_NO_EMPTY); + foreach($chars as $char) + { + $value = ord($char) << $i; // shifted ASCII value + $bit_16 = $value & 0x8000; // the bit 16 + $bit_16 >>= 15; // 0x0000 or 0x0001 + //$bit_17 = $value & 0x00010000; + //$bit_17 >>= 15; + $value &= 0x7fff; // first 15 bits + $password ^= ($value | $bit_16); + //$password ^= ($value | $bit_16 | $bit_17); + $i++; + } + + $password ^= strlen($plaintext); + $password ^= 0xCE4B; + + return($password); + } + + /****************************************************************************** + ******************************************************************************* + * + * BIFF RECORDS + */ + + + /** + * Write a double to the specified row and column (zero indexed). + * An integer can be written as a double. Excel will display an + * integer. $format is optional. + * + * Returns 0 : normal termination + * -2 : row or column out of range + * + * @access public + * @param integer $row Zero indexed row + * @param integer $col Zero indexed column + * @param float $num The number to write + * @param mixed $format The optional XF format + */ + function write_number($row, $col, $num, $format = 0) + { + $record = 0x0203; // Record identifier + $length = 0x000E; // Number of bytes to follow + $xf = $this->_XF($format); // The cell format + + // Check that row and col are valid and store max and min values + if ($row >= $this->xls_rowmax) + { + return(-2); + } + if ($col >= $this->xls_colmax) + { + return(-2); + } + if ($row < $this->dim_rowmin) + { + $this->dim_rowmin = $row; + } + if ($row > $this->dim_rowmax) + { + $this->dim_rowmax = $row; + } + if ($col < $this->dim_colmin) + { + $this->dim_colmin = $col; + } + if ($col > $this->dim_colmax) + { + $this->dim_colmax = $col; + } + + $header = pack("vv", $record, $length); + $data = pack("vvv", $row, $col, $xf); + $xl_double = pack("d", $num); + if ($this->_byte_order) // if it's Big Endian + { + $xl_double = strrev($xl_double); + } + + $this->_append($header.$data.$xl_double); + return(0); + } + + /** + * Write a string to the specified row and column (zero indexed). + * NOTE: there is an Excel 5 defined limit of 255 characters. + * $format is optional. + * Returns 0 : normal termination + * -1 : insufficient number of arguments + * -2 : row or column out of range + * -3 : long string truncated to 255 chars + * + * @access public + * @param integer $row Zero indexed row + * @param integer $col Zero indexed column + * @param string $str The string to write + * @param mixed $format The XF format for the cell + */ + function write_string($row, $col, $str, $format = 0) + { + $strlen = strlen($str); + $record = 0x0204; // Record identifier + $length = 0x0008 + $strlen; // Bytes to follow + $xf = $this->_XF($format); // The cell format + + $str_error = 0; + + // Check that row and col are valid and store max and min values + if ($row >= $this->xls_rowmax) + { + return(-2); + } + if ($col >= $this->xls_colmax) + { + return(-2); + } + if ($row < $this->dim_rowmin) + { + $this->dim_rowmin = $row; + } + if ($row > $this->dim_rowmax) + { + $this->dim_rowmax = $row; + } + if ($col < $this->dim_colmin) + { + $this->dim_colmin = $col; + } + if ($col > $this->dim_colmax) + { + $this->dim_colmax = $col; + } + + if ($strlen > $this->xls_strmax) // LABEL must be < 255 chars + { + $str = substr($str, 0, $this->xls_strmax); + $length = 0x0008 + $this->xls_strmax; + $strlen = $this->xls_strmax; + $str_error = -3; + } + + $header = pack("vv", $record, $length); + $data = pack("vvvv", $row, $col, $xf, $strlen); + $this->_append($header.$data.$str); + return($str_error); + } + + /** + * Writes a note associated with the cell given by the row and column. + * NOTE records don't have a length limit. + * + * @access public + * @param integer $row Zero indexed row + * @param integer $col Zero indexed column + * @param string $note The note to write + */ + function write_note($row, $col, $note) + { + $note_length = strlen($note); + $record = 0x001C; // Record identifier + $max_length = 2048; // Maximun length for a NOTE record + //$length = 0x0006 + $note_length; // Bytes to follow + + // Check that row and col are valid and store max and min values + if ($row >= $this->xls_rowmax) + { + return(-2); + } + if ($col >= $this->xls_colmax) + { + return(-2); + } + if ($row < $this->dim_rowmin) + { + $this->dim_rowmin = $row; + } + if ($row > $this->dim_rowmax) + { + $this->dim_rowmax = $row; + } + if ($col < $this->dim_colmin) + { + $this->dim_colmin = $col; + } + if ($col > $this->dim_colmax) + { + $this->dim_colmax = $col; + } + + // Length for this record is no more than 2048 + 6 + $length = 0x0006 + min($note_length, 2048); + $header = pack("vv", $record, $length); + $data = pack("vvv", $row, $col, $note_length); + $this->_append($header.$data.substr($note, 0, 2048)); + + for($i = $max_length; $i < $note_length; $i += $max_length) + { + $chunk = substr($note, $i, $max_length); + $length = 0x0006 + strlen($chunk); + $header = pack("vv", $record, $length); + $data = pack("vvv", -1, 0, strlen($chunk)); + $this->_append($header.$data.$chunk); + } + return(0); + } + + /** + * Write a blank cell to the specified row and column (zero indexed). + * A blank cell is used to specify formatting without adding a string + * or a number. + * + * A blank cell without a format serves no purpose. Therefore, we don't write + * a BLANK record unless a format is specified. This is mainly an optimisation + * for the write_row() and write_col() methods. + * + * Returns 0 : normal termination (including no format) + * -1 : insufficient number of arguments + * -2 : row or column out of range + * + * @access public + * @param integer $row Zero indexed row + * @param integer $col Zero indexed column + * @param mixed $format The XF format + */ + function write_blank($row, $col, $format = 0) + { + // Don't write a blank cell unless it has a format + if ($format == 0) + { + return(0); + } + + $record = 0x0201; // Record identifier + $length = 0x0006; // Number of bytes to follow + $xf = $this->_XF($format); // The cell format + + // Check that row and col are valid and store max and min values + if ($row >= $this->xls_rowmax) + { + return(-2); + } + if ($col >= $this->xls_colmax) + { + return(-2); + } + if ($row < $this->dim_rowmin) + { + $this->dim_rowmin = $row; + } + if ($row > $this->dim_rowmax) + { + $this->dim_rowmax = $row; + } + if ($col < $this->dim_colmin) + { + $this->dim_colmin = $col; + } + if ($col > $this->dim_colmax) + { + $this->dim_colmax = $col; + } + + $header = pack("vv", $record, $length); + $data = pack("vvv", $row, $col, $xf); + $this->_append($header.$data); + return 0; + } + + /** + * Write a formula to the specified row and column (zero indexed). + * The textual representation of the formula is passed to the parser in + * Parser.php which returns a packed binary string. + * + * Returns 0 : normal termination + * -2 : row or column out of range + * + * @access public + * @param integer $row Zero indexed row + * @param integer $col Zero indexed column + * @param string $formula The formula text string + * @param mixed $format The optional XF format + */ + function write_formula($row, $col, $formula, $format = 0) + { + $record = 0x0006; // Record identifier + + // Excel normally stores the last calculated value of the formula in $num. + // Clearly we are not in a position to calculate this a priori. Instead + // we set $num to zero and set the option flags in $grbit to ensure + // automatic calculation of the formula when the file is opened. + // + $xf = $this->_XF($format); // The cell format + $num = 0x00; // Current value of formula + $grbit = 0x03; // Option flags + $chn = 0x0000; // Must be zero + + + // Check that row and col are valid and store max and min values + if ($row >= $this->xls_rowmax) + { + return(-2); + } + if ($col >= $this->xls_colmax) + { + return(-2); + } + if ($row < $this->dim_rowmin) + { + $this->dim_rowmin = $row; + } + if ($row > $this->dim_rowmax) + { + $this->dim_rowmax = $row; + } + if ($col < $this->dim_colmin) + { + $this->dim_colmin = $col; + } + if ($col > $this->dim_colmax) + { + $this->dim_colmax = $col; + } + + // Strip the '=' or '@' sign at the beginning of the formula string + if (preg_match("/^=/",$formula)) { + $formula = preg_replace("/(^=)/","",$formula); + } + elseif(preg_match("/^@/",$formula)) { + $formula = preg_replace("/(^@)/","",$formula); + } + else { + die("Unrecognised character for formula"); + } + + // Parse the formula using the parser in Parser.php + //$tree = new Parser($this->_byte_order); + $this->_parser->parse($formula); + //$tree->parse($formula); + $formula = $this->_parser->to_reverse_polish(); + + $formlen = strlen($formula); // Length of the binary string + $length = 0x16 + $formlen; // Length of the record data + + $header = pack("vv", $record, $length); + $data = pack("vvvdvVv", $row, $col, $xf, $num, + $grbit, $chn, $formlen); + + $this->_append($header.$data.$formula); + return 0; + } + + /** + * Write a hyperlink. This is comprised of two elements: the visible label and + * the invisible link. The visible label is the same as the link unless an + * alternative string is specified. The label is written using the + * write_string() method. Therefore the 255 characters string limit applies. + * $string and $format are optional and their order is interchangeable. + * + * The hyperlink can be to a http, ftp, mail, internal sheet, or external + * directory url. + * + * Returns 0 : normal termination + * -1 : insufficient number of arguments + * -2 : row or column out of range + * -3 : long string truncated to 255 chars + * + * @access public + * @param integer $row Row + * @param integer $col Column + * @param string $url URL string + * @param string $string Alternative label + * @param mixed $format The cell format + */ + function write_url($row, $col, $url, $string = '', $format = 0) + { + // Add start row and col to arg list + return($this->_write_url_range($row, $col, $row, $col, $url, $string, $format)); + } + + /** + * This is the more general form of write_url(). It allows a hyperlink to be + * written to a range of cells. This function also decides the type of hyperlink + * to be written. These are either, Web (http, ftp, mailto), Internal + * (Sheet1!A1) or external ('c:\temp\foo.xls#Sheet1!A1'). + * + * See also write_url() above for a general description and return values. + * + * @param integer $row1 Start row + * @param integer $col1 Start column + * @param integer $row2 End row + * @param integer $col2 End column + * @param string $url URL string + * @param string $string Alternative label + * @param mixed $format The cell format + */ + + function _write_url_range($row1, $col1, $row2, $col2, $url, $string = '', $format = 0) + { + // Check for internal/external sheet links or default to web link + if (preg_match('[^internal:]', $url)) { + return($this->_write_url_internal($row1, $col1, $row2, $col2, $url, $string, $format)); + } + if (preg_match('[^external:]', $url)) { + return($this->_write_url_external($row1, $col1, $row2, $col2, $url, $string, $format)); + } + return($this->_write_url_web($row1, $col1, $row2, $col2, $url, $string, $format)); + } + + + /** + * Used to write http, ftp and mailto hyperlinks. + * The link type ($options) is 0x03 is the same as absolute dir ref without + * sheet. However it is differentiated by the $unknown2 data stream. + * + * @see write_url() + * @param integer $row1 Start row + * @param integer $col1 Start column + * @param integer $row2 End row + * @param integer $col2 End column + * @param string $url URL string + * @param string $str Alternative label + * @param mixed $format The cell format + */ + function _write_url_web($row1, $col1, $row2, $col2, $url, $str, $format = 0) + { + $record = 0x01B8; // Record identifier + $length = 0x00000; // Bytes to follow + + if($format == 0) { + $format = $this->_url_format; + } + + // Write the visible label using the write_string() method. + if($str == '') { + $str = $url; + } + $str_error = $this->write_string($row1, $col1, $str, $format); + if ($str_error == -2) { + return($str_error); + } + + // Pack the undocumented parts of the hyperlink stream + $unknown1 = pack("H*", "D0C9EA79F9BACE118C8200AA004BA90B02000000"); + $unknown2 = pack("H*", "E0C9EA79F9BACE118C8200AA004BA90B"); + + // Pack the option flags + $options = pack("V", 0x03); + + // Convert URL to a null terminated wchar string + $url = join("\0", preg_split("''", $url, -1, PREG_SPLIT_NO_EMPTY)); + $url = $url . "\0\0\0"; + + // Pack the length of the URL + $url_len = pack("V", strlen($url)); + + // Calculate the data length + $length = 0x34 + strlen($url); + + // Pack the header data + $header = pack("vv", $record, $length); + $data = pack("vvvv", $row1, $row2, $col1, $col2); + + // Write the packed data + $this->_append( $header. $data. + $unknown1. $options. + $unknown2. $url_len. $url); + return($str_error); + } + + /** + * Used to write internal reference hyperlinks such as "Sheet1!A1". + * + * @see write_url() + * @param integer $row1 Start row + * @param integer $col1 Start column + * @param integer $row2 End row + * @param integer $col2 End column + * @param string $url URL string + * @param string $str Alternative label + * @param mixed $format The cell format + */ + function _write_url_internal($row1, $col1, $row2, $col2, $url, $str, $format = 0) + { + $record = 0x01B8; // Record identifier + $length = 0x00000; // Bytes to follow + + if ($format == 0) { + $format = $this->_url_format; + } + + // Strip URL type + $url = preg_replace('s[^internal:]', '', $url); + + // Write the visible label + if($str == '') { + $str = $url; + } + $str_error = $this->write_string($row1, $col1, $str, $format); + if ($str_error == -2) { + return($str_error); + } + + // Pack the undocumented parts of the hyperlink stream + $unknown1 = pack("H*", "D0C9EA79F9BACE118C8200AA004BA90B02000000"); + + // Pack the option flags + $options = pack("V", 0x08); + + // Convert the URL type and to a null terminated wchar string + $url = join("\0", preg_split("''", $url, -1, PREG_SPLIT_NO_EMPTY)); + $url = $url . "\0\0\0"; + + // Pack the length of the URL as chars (not wchars) + $url_len = pack("V", floor(strlen($url)/2)); + + // Calculate the data length + $length = 0x24 + strlen($url); + + // Pack the header data + $header = pack("vv", $record, $length); + $data = pack("vvvv", $row1, $row2, $col1, $col2); + + // Write the packed data + $this->_append($header. $data. + $unknown1. $options. + $url_len. $url); + return($str_error); + } + + /** + * Write links to external directory names such as 'c:\foo.xls', + * c:\foo.xls#Sheet1!A1', '../../foo.xls'. and '../../foo.xls#Sheet1!A1'. + * + * Note: Excel writes some relative links with the $dir_long string. We ignore + * these cases for the sake of simpler code. + * + * @see write_url() + * @param integer $row1 Start row + * @param integer $col1 Start column + * @param integer $row2 End row + * @param integer $col2 End column + * @param string $url URL string + * @param string $str Alternative label + * @param mixed $format The cell format + */ + function _write_url_external($row1, $col1, $row2, $col2, $url, $str, $format = 0) + { + // Network drives are different. We will handle them separately + // MS/Novell network drives and shares start with \\ + if (preg_match('[^external:\\\\]', $url)) { + return($this->_write_url_external_net($row1, $col1, $row2, $col2, $url, $str, $format)); + } + + $record = 0x01B8; // Record identifier + $length = 0x00000; // Bytes to follow + + if ($format == 0) { + $format = $this->_url_format; + } + + // Strip URL type and change Unix dir separator to Dos style (if needed) + // + $url = preg_replace('[^external:]', '', $url); + $url = preg_replace('[/]', "\\", $url); + + // Write the visible label + if ($str == '') { + $str = preg_replace('[\#]', ' - ', $url); + } + $str_error = $this->write_string($row1, $col1, $str, $format); + if ($str_error == -2) { + return($str_error); + } + + // Determine if the link is relative or absolute: + // relative if link contains no dir separator, "somefile.xls" + // relative if link starts with up-dir, "..\..\somefile.xls" + // otherwise, absolute + + $absolute = 0x02; // Bit mask + if (!preg_match('[\\]', $url)) { + $absolute = 0x00; + } + if (preg_match('[^\.\.\\]', $url)) { + $absolute = 0x00; + } + + // Determine if the link contains a sheet reference and change some of the + // parameters accordingly. + // Split the dir name and sheet name (if it exists) + list($dir_long , $sheet) = split('/\#/', $url); + $link_type = 0x01 | $absolute; + + if (isset($sheet)) { + $link_type |= 0x08; + $sheet_len = pack("V", strlen($sheet) + 0x01); + $sheet = join("\0", split('', $sheet)); + $sheet .= "\0\0\0"; + } + else { + $sheet_len = ''; + $sheet = ''; + } + + // Pack the link type + $link_type = pack("V", $link_type); + + // Calculate the up-level dir count e.g.. (..\..\..\ == 3) + $up_count = preg_match_all("/\.\.\\/", $dir_long, $useless); + $up_count = pack("v", $up_count); + + // Store the short dos dir name (null terminated) + $dir_short = preg_replace('/\.\.\\/', '', $dir_long) . "\0"; + + // Store the long dir name as a wchar string (non-null terminated) + $dir_long = join("\0", split('', $dir_long)); + $dir_long = $dir_long . "\0"; + + // Pack the lengths of the dir strings + $dir_short_len = pack("V", strlen($dir_short) ); + $dir_long_len = pack("V", strlen($dir_long) ); + $stream_len = pack("V", strlen($dir_long) + 0x06); + + // Pack the undocumented parts of the hyperlink stream + $unknown1 = pack("H*",'D0C9EA79F9BACE118C8200AA004BA90B02000000' ); + $unknown2 = pack("H*",'0303000000000000C000000000000046' ); + $unknown3 = pack("H*",'FFFFADDE000000000000000000000000000000000000000'); + $unknown4 = pack("v", 0x03 ); + + // Pack the main data stream + $data = pack("vvvv", $row1, $row2, $col1, $col2) . + $unknown1 . + $link_type . + $unknown2 . + $up_count . + $dir_short_len. + $dir_short . + $unknown3 . + $stream_len . + $dir_long_len . + $unknown4 . + $dir_long . + $sheet_len . + $sheet ; + + // Pack the header data + $length = strlen($data); + $header = pack("vv", $record, $length); + + // Write the packed data + $this->_append($header. $data); + return($str_error); + } + + + /* + ############################################################################### + # + # write_url_xxx($row1, $col1, $row2, $col2, $url, $string, $format) + # + # Write links to external MS/Novell network drives and shares such as + # '//NETWORK/share/foo.xls' and '//NETWORK/share/foo.xls#Sheet1!A1'. + # + # See also write_url() above for a general description and return values. + # + sub _write_url_external_net { + + my $this = shift; + + my $record = 0x01B8; # Record identifier + my $length = 0x00000; # Bytes to follow + + my $row1 = $_[0]; # Start row + my $col1 = $_[1]; # Start column + my $row2 = $_[2]; # End row + my $col2 = $_[3]; # End column + my $url = $_[4]; # URL string + my $str = $_[5]; # Alternative label + my $xf = $_[6] || $this->{_url_format};# The cell format + + + # Strip URL type and change Unix dir separator to Dos style (if needed) + # + $url =~ s[^external:][]; + $url =~ s[/][\\]g; + + + # Write the visible label + ($str = $url) =~ s[\#][ - ] unless defined $str; + my $str_error = $this->write_string($row1, $col1, $str, $xf); + return $str_error if $str_error == -2; + + + # Determine if the link contains a sheet reference and change some of the + # parameters accordingly. + # Split the dir name and sheet name (if it exists) + # + my ($dir_long , $sheet) = split /\#/, $url; + my $link_type = 0x0103; # Always absolute + my $sheet_len; + + if (defined $sheet) { + $link_type |= 0x08; + $sheet_len = pack("V", length($sheet) + 0x01); + $sheet = join("\0", split('', $sheet)); + $sheet .= "\0\0\0"; + } + else { + $sheet_len = ''; + $sheet = ''; + } + + # Pack the link type + $link_type = pack("V", $link_type); + + + # Make the string null terminated + $dir_long = $dir_long . "\0"; + + + # Pack the lengths of the dir string + my $dir_long_len = pack("V", length $dir_long); + + + # Store the long dir name as a wchar string (non-null terminated) + $dir_long = join("\0", split('', $dir_long)); + $dir_long = $dir_long . "\0"; + + + # Pack the undocumented part of the hyperlink stream + my $unknown1 = pack("H*",'D0C9EA79F9BACE118C8200AA004BA90B02000000'); + + + # Pack the main data stream + my $data = pack("vvvv", $row1, $row2, $col1, $col2) . + $unknown1 . + $link_type . + $dir_long_len . + $dir_long . + $sheet_len . + $sheet ; + + + # Pack the header data + $length = length $data; + my $header = pack("vv", $record, $length); + + + # Write the packed data + $this->_append( $header, $data); + + return $str_error; +}*/ + + /** + * This method is used to set the height and XF format for a row. + * Writes the BIFF record ROW. + * + * @access public + * @param integer $row The row to set + * @param integer $height Height we are giving to the row. + * Use NULL to set XF without setting height + * @param mixed $format XF format we are giving to the row + */ + function set_row($row, $height, $format = 0) + { + $record = 0x0208; // Record identifier + $length = 0x0010; // Number of bytes to follow + + $colMic = 0x0000; // First defined column + $colMac = 0x0000; // Last defined column + $irwMac = 0x0000; // Used by Excel to optimise loading + $reserved = 0x0000; // Reserved + $grbit = 0x01C0; // Option flags. (monkey) see $1 do + $ixfe = $this->_XF($format); // XF index + + // Use set_row($row, NULL, $XF) to set XF without setting height + if ($height != NULL) { + $miyRw = $height * 20; // row height + } + else { + $miyRw = 0xff; // default row height is 256 + } + + $header = pack("vv", $record, $length); + $data = pack("vvvvvvvv", $row, $colMic, $colMac, $miyRw, + $irwMac,$reserved, $grbit, $ixfe); + $this->_append($header.$data); + } + + /** + * Writes Excel DIMENSIONS to define the area in which there is data. + */ + function _store_dimensions() + { + $record = 0x0000; // Record identifier + $length = 0x000A; // Number of bytes to follow + $row_min = $this->dim_rowmin; // First row + $row_max = $this->dim_rowmax; // Last row plus 1 + $col_min = $this->dim_colmin; // First column + $col_max = $this->dim_colmax; // Last column plus 1 + $reserved = 0x0000; // Reserved by Excel + + $header = pack("vv", $record, $length); + $data = pack("vvvvv", $row_min, $row_max, + $col_min, $col_max, $reserved); + $this->_prepend($header.$data); + } + + /** + * Write BIFF record Window2. + */ + function _store_window2() + { + $record = 0x023E; // Record identifier + $length = 0x000A; // Number of bytes to follow + + $grbit = 0x00B6; // Option flags + $rwTop = 0x0000; // Top row visible in window + $colLeft = 0x0000; // Leftmost column visible in window + $rgbHdr = 0x00000000; // Row/column heading and gridline color + + // The options flags that comprise $grbit + $fDspFmla = 0; // 0 - bit + $fDspGrid = 1; // 1 + $fDspRwCol = 1; // 2 + $fFrozen = $this->_frozen; // 3 + $fDspZeros = 1; // 4 + $fDefaultHdr = 1; // 5 + $fArabic = 0; // 6 + $fDspGuts = 1; // 7 + $fFrozenNoSplit = 0; // 0 - bit + $fSelected = $this->selected; // 1 + $fPaged = 1; // 2 + + $grbit = $fDspFmla; + $grbit |= $fDspGrid << 1; + $grbit |= $fDspRwCol << 2; + $grbit |= $fFrozen << 3; + $grbit |= $fDspZeros << 4; + $grbit |= $fDefaultHdr << 5; + $grbit |= $fArabic << 6; + $grbit |= $fDspGuts << 7; + $grbit |= $fFrozenNoSplit << 8; + $grbit |= $fSelected << 9; + $grbit |= $fPaged << 10; + + $header = pack("vv", $record, $length); + $data = pack("vvvV", $grbit, $rwTop, $colLeft, $rgbHdr); + $this->_append($header.$data); + } + + /** + * Write BIFF record DEFCOLWIDTH if COLINFO records are in use. + */ + function _store_defcol() + { + $record = 0x0055; // Record identifier + $length = 0x0002; // Number of bytes to follow + $colwidth = 0x0008; // Default column width + + $header = pack("vv", $record, $length); + $data = pack("v", $colwidth); + $this->_prepend($header.$data); + } + + /** + * Write BIFF record COLINFO to define column widths + * + * Note: The SDK says the record length is 0x0B but Excel writes a 0x0C + * length record. + * + * @param array $col_array This is the only parameter received and is composed of the following: + * 0 => First formatted column, + * 1 => Last formatted column, + * 2 => Col width (8.43 is Excel default), + * 3 => The optional XF format of the column, + * 4 => Option flags. + */ + function _store_colinfo($col_array) + { + if(isset($col_array[0])) { + $colFirst = $col_array[0]; + } + if(isset($col_array[1])) { + $colLast = $col_array[1]; + } + if(isset($col_array[2])) { + $coldx = $col_array[2]; + } + else { + $coldx = 8.43; + } + if(isset($col_array[3])) { + $format = $col_array[3]; + } + else { + $format = 0; + } + if(isset($col_array[4])) { + $grbit = $col_array[4]; + } + else { + $grbit = 0; + } + $record = 0x007D; // Record identifier + $length = 0x000B; // Number of bytes to follow + + $coldx += 0.72; // Fudge. Excel subtracts 0.72 !? + $coldx *= 256; // Convert to units of 1/256 of a char + + $ixfe = $this->_XF($format); + $reserved = 0x00; // Reserved + + $header = pack("vv", $record, $length); + $data = pack("vvvvvC", $colFirst, $colLast, $coldx, + $ixfe, $grbit, $reserved); + $this->_prepend($header.$data); + } + + /** + * Write BIFF record SELECTION. + * + * @param array $array array containing ($rwFirst,$colFirst,$rwLast,$colLast) + * @see set_selection() + */ + function _store_selection($array) + { + list($rwFirst,$colFirst,$rwLast,$colLast) = $array; + $record = 0x001D; // Record identifier + $length = 0x000F; // Number of bytes to follow + + $pnn = $this->_active_pane; // Pane position + $rwAct = $rwFirst; // Active row + $colAct = $colFirst; // Active column + $irefAct = 0; // Active cell ref + $cref = 1; // Number of refs + + if (!isset($rwLast)) { + $rwLast = $rwFirst; // Last row in reference + } + if (!isset($colLast)) { + $colLast = $colFirst; // Last col in reference + } + + // Swap last row/col for first row/col as necessary + if ($rwFirst > $rwLast) + { + list($rwFirst, $rwLast) = array($rwLast, $rwFirst); + } + + if ($colFirst > $colLast) + { + list($colFirst, $colLast) = array($colLast, $colFirst); + } + + $header = pack("vv", $record, $length); + $data = pack("CvvvvvvCC", $pnn, $rwAct, $colAct, + $irefAct, $cref, + $rwFirst, $rwLast, + $colFirst, $colLast); + $this->_append($header.$data); + } + + + /** + * Write BIFF record EXTERNCOUNT to indicate the number of external sheet + * references in a worksheet. + * + * Excel only stores references to external sheets that are used in formulas. + * For simplicity we store references to all the sheets in the workbook + * regardless of whether they are used or not. This reduces the overall + * complexity and eliminates the need for a two way dialogue between the formula + * parser the worksheet objects. + * + * @param integer $count The number of external sheet references in this worksheet + */ + function _store_externcount($count) + { + $record = 0x0016; // Record identifier + $length = 0x0002; // Number of bytes to follow + + $header = pack("vv", $record, $length); + $data = pack("v", $count); + $this->_prepend($header.$data); + } + + /** + * Writes the Excel BIFF EXTERNSHEET record. These references are used by + * formulas. A formula references a sheet name via an index. Since we store a + * reference to all of the external worksheets the EXTERNSHEET index is the same + * as the worksheet index. + * + * @param string $sheetname The name of a external worksheet + */ + function _store_externsheet($sheetname) + { + $record = 0x0017; // Record identifier + + // References to the current sheet are encoded differently to references to + // external sheets. + // + if ($this->name == $sheetname) { + $sheetname = ''; + $length = 0x02; // The following 2 bytes + $cch = 1; // The following byte + $rgch = 0x02; // Self reference + } + else { + $length = 0x02 + strlen($sheetname); + $cch = strlen($sheetname); + $rgch = 0x03; // Reference to a sheet in the current workbook + } + + $header = pack("vv", $record, $length); + $data = pack("CC", $cch, $rgch); + $this->_prepend($header.$data.$sheetname); + } + + /** + * Writes the Excel BIFF PANE record. + * The panes can either be frozen or thawed (unfrozen). + * Frozen panes are specified in terms of an integer number of rows and columns. + * Thawed panes are specified in terms of Excel's units for rows and columns. + * + * @param array $panes This is the only parameter received and is composed of the following: + * 0 => Vertical split position, + * 1 => Horizontal split position + * 2 => Top row visible + * 3 => Leftmost column visible + * 4 => Active pane + */ + function _store_panes($panes) + { + $y = $panes[0]; + $x = $panes[1]; + $rwTop = $panes[2]; + $colLeft = $panes[3]; + if(count($panes) > 4) { // if Active pane was received + $pnnAct = $panes[4]; + } + else { + $pnnAct = NULL; + } + $record = 0x0041; // Record identifier + $length = 0x000A; // Number of bytes to follow + + // Code specific to frozen or thawed panes. + if ($this->_frozen) { + // Set default values for $rwTop and $colLeft + if(!isset($rwTop)) { + $rwTop = $y; + } + if(!isset($colLeft)) { + $colLeft = $x; + } + } + else { + // Set default values for $rwTop and $colLeft + if(!isset($rwTop)) { + $rwTop = 0; + } + if(!isset($colLeft)) { + $colLeft = 0; + } + + // Convert Excel's row and column units to the internal units. + // The default row height is 12.75 + // The default column width is 8.43 + // The following slope and intersection values were interpolated. + // + $y = 20*$y + 255; + $x = 113.879*$x + 390; + } + + + // Determine which pane should be active. There is also the undocumented + // option to override this should it be necessary: may be removed later. + // + if (!isset($pnnAct)) + { + if ($x != 0 and $y != 0) + $pnnAct = 0; // Bottom right + if ($x != 0 and $y == 0) + $pnnAct = 1; // Top right + if ($x == 0 and $y != 0) + $pnnAct = 2; // Bottom left + if ($x == 0 and $y == 0) + $pnnAct = 3; // Top left + } + + $this->_active_pane = $pnnAct; // Used in _store_selection + + $header = pack("vv", $record, $length); + $data = pack("vvvvv", $x, $y, $rwTop, $colLeft, $pnnAct); + $this->_append($header.$data); + } + + /** + * Store the page setup SETUP BIFF record. + */ + function _store_setup() + { + $record = 0x00A1; // Record identifier + $length = 0x0022; // Number of bytes to follow + + $iPaperSize = $this->_paper_size; // Paper size + $iScale = $this->_print_scale; // Print scaling factor + $iPageStart = 0x01; // Starting page number + $iFitWidth = $this->_fit_width; // Fit to number of pages wide + $iFitHeight = $this->_fit_height; // Fit to number of pages high + $grbit = 0x00; // Option flags + $iRes = 0x0258; // Print resolution + $iVRes = 0x0258; // Vertical print resolution + $numHdr = $this->_margin_head; // Header Margin + $numFtr = $this->_margin_foot; // Footer Margin + $iCopies = 0x01; // Number of copies + + $fLeftToRight = 0x0; // Print over then down + $fLandscape = $this->_orientation; // Page orientation + $fNoPls = 0x0; // Setup not read from printer + $fNoColor = 0x0; // Print black and white + $fDraft = 0x0; // Print draft quality + $fNotes = 0x0; // Print notes + $fNoOrient = 0x0; // Orientation not set + $fUsePage = 0x0; // Use custom starting page + + $grbit = $fLeftToRight; + $grbit |= $fLandscape << 1; + $grbit |= $fNoPls << 2; + $grbit |= $fNoColor << 3; + $grbit |= $fDraft << 4; + $grbit |= $fNotes << 5; + $grbit |= $fNoOrient << 6; + $grbit |= $fUsePage << 7; + + $numHdr = pack("d", $numHdr); + $numFtr = pack("d", $numFtr); + if ($this->_byte_order) // if it's Big Endian + { + $numHdr = strrev($numHdr); + $numFtr = strrev($numFtr); + } + + $header = pack("vv", $record, $length); + $data1 = pack("vvvvvvvv", $iPaperSize, + $iScale, + $iPageStart, + $iFitWidth, + $iFitHeight, + $grbit, + $iRes, + $iVRes); + $data2 = $numHdr .$numFtr; + $data3 = pack("v", $iCopies); + $this->_prepend($header.$data1.$data2.$data3); + } + + /** + * Store the header caption BIFF record. + */ + function store_header() + { + $record = 0x0014; // Record identifier + + $str = $this->_header; // header string + $cch = strlen($str); // Length of header string + $length = 1 + $cch; // Bytes to follow + + $header = pack("vv", $record, $length); + $data = pack("C", $cch); + + $this->_append($header.$data.$str); + } + + /** + * Store the footer caption BIFF record. + */ + function store_footer() + { + $record = 0x0015; // Record identifier + + $str = $this->_footer; // Footer string + $cch = strlen($str); // Length of footer string + $length = 1 + $cch; // Bytes to follow + + $header = pack("vv", $record, $length); + $data = pack("C", $cch); + + $this->_append($header.$data.$str); + } + + /** + * Store the horizontal centering HCENTER BIFF record. + */ + function store_hcenter() + { + $record = 0x0083; // Record identifier + $length = 0x0002; // Bytes to follow + + $fHCenter = $this->_hcenter; // Horizontal centering + + $header = pack("vv", $record, $length); + $data = pack("v", $fHCenter); + + $this->_append($header.$data); + } + + /** + * Store the vertical centering VCENTER BIFF record. + */ + function store_vcenter() + { + $record = 0x0084; // Record identifier + $length = 0x0002; // Bytes to follow + + $fVCenter = $this->_vcenter; // Horizontal centering + + $header = pack("vv", $record, $length); + $data = pack("v", $fVCenter); + $this->_append($header.$data); + } + + /** + * Store the LEFTMARGIN BIFF record. + */ + function _store_margin_left() + { + $record = 0x0026; // Record identifier + $length = 0x0008; // Bytes to follow + + $margin = $this->_margin_left; // Margin in inches + + $header = pack("vv", $record, $length); + $data = pack("d", $margin); + if ($this->_byte_order) // if it's Big Endian + { + $data = strrev($data); + } + + $this->_append($header.$data); + } + + /** + * Store the RIGHTMARGIN BIFF record. + */ + function _store_margin_right() + { + $record = 0x0027; // Record identifier + $length = 0x0008; // Bytes to follow + + $margin = $this->_margin_right; // Margin in inches + + $header = pack("vv", $record, $length); + $data = pack("d", $margin); + if ($this->_byte_order) // if it's Big Endian + { + $data = strrev($data); + } + + $this->_append($header.$data); + } + + /** + * Store the TOPMARGIN BIFF record. + */ + function _store_margin_top() + { + $record = 0x0028; // Record identifier + $length = 0x0008; // Bytes to follow + + $margin = $this->_margin_top; // Margin in inches + + $header = pack("vv", $record, $length); + $data = pack("d", $margin); + if ($this->_byte_order) // if it's Big Endian + { + $data = strrev($data); + } + + $this->_append($header.$data); + } + + /** + * Store the BOTTOMMARGIN BIFF record. + */ + function _store_margin_bottom() + { + $record = 0x0029; // Record identifier + $length = 0x0008; // Bytes to follow + + $margin = $this->_margin_bottom; // Margin in inches + + $header = pack("vv", $record, $length); + $data = pack("d", $margin); + if ($this->_byte_order) // if it's Big Endian + { + $data = strrev($data); + } + + $this->_append($header.$data); + } + + /** + * This is an Excel97/2000 method. It is required to perform more complicated + * merging than the normal set_align('merge'). It merges the area given by + * its arguments. + * + * @access public + * @param integer $first_row First row of the area to merge + * @param integer $first_col First column of the area to merge + * @param integer $last_row Last row of the area to merge + * @param integer $last_col Last column of the area to merge + */ + function merge_cells($first_row, $first_col, $last_row, $last_col) + { + $record = 0x00E5; // Record identifier + $length = 0x000A; // Bytes to follow + $cref = 1; // Number of refs + + // Swap last row/col for first row/col as necessary + if ($first_row > $last_row) { + list($first_row, $last_row) = array($last_row, $first_row); + } + + if ($first_col > $last_col) { + list($first_col, $last_col) = array($last_col, $first_col); + } + + $header = pack("vv", $record, $length); + $data = pack("vvvvv", $cref, $first_row, $last_row, + $first_col, $last_col); + + $this->_append($header.$data); + } + + /** + * Write the PRINTHEADERS BIFF record. + */ + function _store_print_headers() + { + $record = 0x002a; // Record identifier + $length = 0x0002; // Bytes to follow + + $fPrintRwCol = $this->_print_headers; // Boolean flag + + $header = pack("vv", $record, $length); + $data = pack("v", $fPrintRwCol); + $this->_prepend($header.$data); + } + + /** + * Write the PRINTGRIDLINES BIFF record. Must be used in conjunction with the + * GRIDSET record. + */ + function _store_print_gridlines() + { + $record = 0x002b; // Record identifier + $length = 0x0002; // Bytes to follow + + $fPrintGrid = $this->_print_gridlines; // Boolean flag + + $header = pack("vv", $record, $length); + $data = pack("v", $fPrintGrid); + $this->_prepend($header.$data); + } + + /** + * Write the GRIDSET BIFF record. Must be used in conjunction with the + * PRINTGRIDLINES record. + */ + function _store_gridset() + { + $record = 0x0082; // Record identifier + $length = 0x0002; // Bytes to follow + + $fGridSet = !($this->_print_gridlines); // Boolean flag + + $header = pack("vv", $record, $length); + $data = pack("v", $fGridSet); + $this->_prepend($header.$data); + } + + /** + * Write the WSBOOL BIFF record, mainly for fit-to-page. Used in conjunction + * with the SETUP record. + */ + function _store_wsbool() + { + $record = 0x0081; // Record identifier + $length = 0x0002; // Bytes to follow + + // The only option that is of interest is the flag for fit to page. So we + // set all the options in one go. + // + if ($this->_fit_page) { + $grbit = 0x05c1; + } + else { + $grbit = 0x04c1; + } + + $header = pack("vv", $record, $length); + $data = pack("v", $grbit); + $this->_prepend($header.$data); + } + + + /** + * Write the HORIZONTALPAGEBREAKS BIFF record. + */ + function _store_hbreak() + { + // Return if the user hasn't specified pagebreaks + if(empty($this->_hbreaks)) { + return; + } + + // Sort and filter array of page breaks + $breaks = $this->_hbreaks; + sort($breaks,SORT_NUMERIC); + if($breaks[0] == 0) { // don't use first break if it's 0 + array_shift($breaks); + } + + $record = 0x001b; // Record identifier + $cbrk = count($breaks); // Number of page breaks + $length = ($cbrk + 1) * 2; // Bytes to follow + + $header = pack("vv", $record, $length); + $data = pack("v", $cbrk); + + // Append each page break + foreach($breaks as $break) { + $data .= pack("v", $break); + } + + $this->_prepend($header.$data); + } + + + /** + * Write the VERTICALPAGEBREAKS BIFF record. + */ + function _store_vbreak() + { + // Return if the user hasn't specified pagebreaks + if(empty($this->_vbreaks)) { + return; + } + + // 1000 vertical pagebreaks appears to be an internal Excel 5 limit. + // It is slightly higher in Excel 97/200, approx. 1026 + $breaks = array_slice($this->_vbreaks,0,1000); + + // Sort and filter array of page breaks + sort($breaks,SORT_NUMERIC); + if($breaks[0] == 0) { // don't use first break if it's 0 + array_shift($breaks); + } + + $record = 0x001a; // Record identifier + $cbrk = count($breaks); // Number of page breaks + $length = ($cbrk + 1) * 2; // Bytes to follow + + $header = pack("vv", $record, $length); + $data = pack("v", $cbrk); + + // Append each page break + foreach ($breaks as $break) { + $data .= pack("v", $break); + } + + $this->_prepend($header.$data); + } + + /** + * Set the Biff PROTECT record to indicate that the worksheet is protected. + */ + function _store_protect() + { + // Exit unless sheet protection has been specified + if($this->_protect == 0) { + return; + } + + $record = 0x0012; // Record identifier + $length = 0x0002; // Bytes to follow + + $fLock = $this->_protect; // Worksheet is protected + + $header = pack("vv", $record, $length); + $data = pack("v", $fLock); + + $this->_prepend($header.$data); + } + + /** + * Write the worksheet PASSWORD record. + */ + function _store_password() + { + // Exit unless sheet protection and password have been specified + if(($this->_protect == 0) or (!isset($this->_password))) { + return; + } + + $record = 0x0013; // Record identifier + $length = 0x0002; // Bytes to follow + + $wPassword = $this->_password; // Encoded password + + $header = pack("vv", $record, $length); + $data = pack("v", $wPassword); + + $this->_prepend($header.$data); + } + + /** + * Insert a 24bit bitmap image in a worksheet. The main record required is + * IMDATA but it must be proceeded by a OBJ record to define its position. + * + * @access public + * @param integer $row The row we are going to insert the bitmap into + * @param integer $col The column we are going to insert the bitmap into + * @param string $bitmap The bitmap filename + * @param integer $x The horizontal position (offset) of the image inside the cell. + * @param integer $y The vertical position (offset) of the image inside the cell. + * @param integer $scale_x The horizontal scale + * @param integer $scale_y The vertical scale + */ + function insert_bitmap($row, $col, $bitmap, $x = 0, $y = 0, $scale_x = 1, $scale_y = 1) + { + list($width, $height, $size, $data) = $this->_process_bitmap($bitmap); + + // Scale the frame of the image. + $width *= $scale_x; + $height *= $scale_y; + + // Calculate the vertices of the image and write the OBJ record + $this->_position_image($col, $row, $x, $y, $width, $height); + + // Write the IMDATA record to store the bitmap data + $record = 0x007f; + $length = 8 + $size; + $cf = 0x09; + $env = 0x01; + $lcb = $size; + + $header = pack("vvvvV", $record, $length, $cf, $env, $lcb); + $this->_append($header.$data); + } + + /** + * Calculate the vertices that define the position of the image as required by + * the OBJ record. + * + * +------------+------------+ + * | A | B | + * +-----+------------+------------+ + * | |(x1,y1) | | + * | 1 |(A1)._______|______ | + * | | | | | + * | | | | | + * +-----+----| BITMAP |-----+ + * | | | | | + * | 2 | |______________. | + * | | | (B2)| + * | | | (x2,y2)| + * +---- +------------+------------+ + * + * Example of a bitmap that covers some of the area from cell A1 to cell B2. + * + * Based on the width and height of the bitmap we need to calculate 8 vars: + * $col_start, $row_start, $col_end, $row_end, $x1, $y1, $x2, $y2. + * The width and height of the cells are also variable and have to be taken into + * account. + * The values of $col_start and $row_start are passed in from the calling + * function. The values of $col_end and $row_end are calculated by subtracting + * the width and height of the bitmap from the width and height of the + * underlying cells. + * The vertices are expressed as a percentage of the underlying cell width as + * follows (rhs values are in pixels): + * + * x1 = X / W *1024 + * y1 = Y / H *256 + * x2 = (X-1) / W *1024 + * y2 = (Y-1) / H *256 + * + * Where: X is distance from the left side of the underlying cell + * Y is distance from the top of the underlying cell + * W is the width of the cell + * H is the height of the cell + * + * @note the SDK incorrectly states that the height should be expressed as a + * percentage of 1024. + * @param integer $col_start Col containing upper left corner of object + * @param integer $row_start Row containing top left corner of object + * @param integer $x1 Distance to left side of object + * @param integer $y1 Distance to top of object + * @param integer $width Width of image frame + * @param integer $height Height of image frame + */ + function _position_image($col_start, $row_start, $x1, $y1, $width, $height) + { + // Initialise end cell to the same as the start cell + $col_end = $col_start; // Col containing lower right corner of object + $row_end = $row_start; // Row containing bottom right corner of object + + // Zero the specified offset if greater than the cell dimensions + if ($x1 >= $this->size_col($col_start)) + { + $x1 = 0; + } + if ($y1 >= $this->size_row($row_start)) + { + $y1 = 0; + } + + $width = $width + $x1 -1; + $height = $height + $y1 -1; + + // Subtract the underlying cell widths to find the end cell of the image + while ($width >= $this->size_col($col_end)) { + $width -= $this->size_col($col_end); + $col_end++; + } + + // Subtract the underlying cell heights to find the end cell of the image + while ($height >= $this->size_row($row_end)) { + $height -= $this->size_row($row_end); + $row_end++; + } + + // Bitmap isn't allowed to start or finish in a hidden cell, i.e. a cell + // with zero eight or width. + // + if ($this->size_col($col_start) == 0) + return; + if ($this->size_col($col_end) == 0) + return; + if ($this->size_row($row_start) == 0) + return; + if ($this->size_row($row_end) == 0) + return; + + // Convert the pixel values to the percentage value expected by Excel + $x1 = $x1 / $this->size_col($col_start) * 1024; + $y1 = $y1 / $this->size_row($row_start) * 256; + $x2 = $width / $this->size_col($col_end) * 1024; // Distance to right side of object + $y2 = $height / $this->size_row($row_end) * 256; // Distance to bottom of object + + $this->_store_obj_picture( $col_start, $x1, + $row_start, $y1, + $col_end, $x2, + $row_end, $y2 + ); + } + + /** + * Convert the width of a cell from user's units to pixels. By interpolation + * the relationship is: y = 7x +5. If the width hasn't been set by the user we + * use the default value. If the col is hidden we use a value of zero. + * + * @param integer $col The column + * @return integer The width in pixels + */ + function size_col($col) + { + // Look up the cell value to see if it has been changed + if (isset($this->col_sizes[$col])) { + if ($this->col_sizes[$col] == 0) { + return(0); + } + else { + return(floor(7 * $this->col_sizes[$col] + 5)); + } + } + else { + return(64); + } + } + + /** + * Convert the height of a cell from user's units to pixels. By interpolation + * the relationship is: y = 4/3x. If the height hasn't been set by the user we + * use the default value. If the row is hidden we use a value of zero. (Not + * possible to hide row yet). + * + * @param integer $row The row + * @return integer The width in pixels + */ + function size_row($row) + { + // Look up the cell value to see if it has been changed + if (isset($this->row_sizes[$row])) { + if ($this->row_sizes[$row] == 0) { + return(0); + } + else { + return(floor(4/3 * $this->row_sizes[$row])); + } + } + else { + return(17); + } + } + + /** + * Store the OBJ record that precedes an IMDATA record. This could be generalise + * to support other Excel objects. + * + * @param integer $colL Column containing upper left corner of object + * @param integer $dxL Distance from left side of cell + * @param integer $rwT Row containing top left corner of object + * @param integer $dyT Distance from top of cell + * @param integer $colR Column containing lower right corner of object + * @param integer $dxR Distance from right of cell + * @param integer $rwB Row containing bottom right corner of object + * @param integer $dyB Distance from bottom of cell + */ + function _store_obj_picture($colL,$dxL,$rwT,$dyT,$colR,$dxR,$rwB,$dyB) + { + $record = 0x005d; // Record identifier + $length = 0x003c; // Bytes to follow + + $cObj = 0x0001; // Count of objects in file (set to 1) + $OT = 0x0008; // Object type. 8 = Picture + $id = 0x0001; // Object ID + $grbit = 0x0614; // Option flags + + $cbMacro = 0x0000; // Length of FMLA structure + $Reserved1 = 0x0000; // Reserved + $Reserved2 = 0x0000; // Reserved + + $icvBack = 0x09; // Background colour + $icvFore = 0x09; // Foreground colour + $fls = 0x00; // Fill pattern + $fAuto = 0x00; // Automatic fill + $icv = 0x08; // Line colour + $lns = 0xff; // Line style + $lnw = 0x01; // Line weight + $fAutoB = 0x00; // Automatic border + $frs = 0x0000; // Frame style + $cf = 0x0009; // Image format, 9 = bitmap + $Reserved3 = 0x0000; // Reserved + $cbPictFmla = 0x0000; // Length of FMLA structure + $Reserved4 = 0x0000; // Reserved + $grbit2 = 0x0001; // Option flags + $Reserved5 = 0x0000; // Reserved + + + $header = pack("vv", $record, $length); + $data = pack("V", $cObj); + $data .= pack("v", $OT); + $data .= pack("v", $id); + $data .= pack("v", $grbit); + $data .= pack("v", $colL); + $data .= pack("v", $dxL); + $data .= pack("v", $rwT); + $data .= pack("v", $dyT); + $data .= pack("v", $colR); + $data .= pack("v", $dxR); + $data .= pack("v", $rwB); + $data .= pack("v", $dyB); + $data .= pack("v", $cbMacro); + $data .= pack("V", $Reserved1); + $data .= pack("v", $Reserved2); + $data .= pack("C", $icvBack); + $data .= pack("C", $icvFore); + $data .= pack("C", $fls); + $data .= pack("C", $fAuto); + $data .= pack("C", $icv); + $data .= pack("C", $lns); + $data .= pack("C", $lnw); + $data .= pack("C", $fAutoB); + $data .= pack("v", $frs); + $data .= pack("V", $cf); + $data .= pack("v", $Reserved3); + $data .= pack("v", $cbPictFmla); + $data .= pack("v", $Reserved4); + $data .= pack("v", $grbit2); + $data .= pack("V", $Reserved5); + + $this->_append($header.$data); + } + + /** + * Convert a 24 bit bitmap into the modified internal format used by Windows. + * This is described in BITMAPCOREHEADER and BITMAPCOREINFO structures in the + * MSDN library. + * + * @param string $bitmap The bitmap to process + * @return array Array with data and properties of the bitmap + */ + function _process_bitmap($bitmap) + { + // Open file. + $bmp_fd = fopen($bitmap,"rb"); + if (!$bmp_fd) { + die("Couldn't import $bitmap"); + } + + // Slurp the file into a string. + $data = fread($bmp_fd, filesize($bitmap)); + + // Check that the file is big enough to be a bitmap. + if (strlen($data) <= 0x36) { + die("$bitmap doesn't contain enough data.\n"); + } + + // The first 2 bytes are used to identify the bitmap. + $identity = unpack("A2", $data); + if ($identity[''] != "BM") { + die("$bitmap doesn't appear to be a valid bitmap image.\n"); + } + + // Remove bitmap data: ID. + $data = substr($data, 2); + + // Read and remove the bitmap size. This is more reliable than reading + // the data size at offset 0x22. + // + $size_array = unpack("V", substr($data, 0, 4)); + $size = $size_array['']; + $data = substr($data, 4); + $size -= 0x36; // Subtract size of bitmap header. + $size += 0x0C; // Add size of BIFF header. + + // Remove bitmap data: reserved, offset, header length. + $data = substr($data, 12); + + // Read and remove the bitmap width and height. Verify the sizes. + $width_and_height = unpack("V2", substr($data, 0, 8)); + $width = $width_and_height[1]; + $height = $width_and_height[2]; + $data = substr($data, 8); + if ($width > 0xFFFF) { + die("$bitmap: largest image width supported is 65k.\n"); + } + if ($height > 0xFFFF) { + die("$bitmap: largest image height supported is 65k.\n"); + } + + // Read and remove the bitmap planes and bpp data. Verify them. + $planes_and_bitcount = unpack("v2", substr($data, 0, 4)); + $data = substr($data, 4); + if ($planes_and_bitcount[2] != 24) { // Bitcount + die("$bitmap isn't a 24bit true color bitmap.\n"); + } + if ($planes_and_bitcount[1] != 1) { + die("$bitmap: only 1 plane supported in bitmap image.\n"); + } + + // Read and remove the bitmap compression. Verify compression. + $compression = unpack("V", substr($data, 0, 4)); + $data = substr($data, 4); + + //$compression = 0; + if ($compression[""] != 0) { + die("$bitmap: compression not supported in bitmap image.\n"); + } + + // Remove bitmap data: data size, hres, vres, colours, imp. colours. + $data = substr($data, 20); + + // Add the BITMAPCOREHEADER data + $header = pack("Vvvvv", 0x000c, $width, $height, 0x01, 0x18); + $data = $header . $data; + + return (array($width, $height, $size, $data)); + } + + /** + * Store the window zoom factor. This should be a reduced fraction but for + * simplicity we will store all fractions with a numerator of 100. + */ + function _store_zoom() + { + // If scale is 100 we don't need to write a record + if ($this->_zoom == 100) { + return; + } + + $record = 0x00A0; // Record identifier + $length = 0x0004; // Bytes to follow + + $header = pack("vv", $record, $length); + $data = pack("vv", $this->_zoom, 100); + $this->_append($header.$data); + } +} ?> \ No newline at end of file diff --git a/lib/excel/readme_moodle.txt b/lib/excel/readme_moodle.txt index 0d885f5c56c..50a0c665b5a 100644 --- a/lib/excel/readme_moodle.txt +++ b/lib/excel/readme_moodle.txt @@ -9,79 +9,79 @@ diff -u -r1.1 Parser.php --- Parser.php 26 Sep 2003 04:18:02 -0000 1.1 +++ Parser.php 18 Nov 2009 03:58:49 -0000 @@ -466,7 +466,7 @@ - { - return(pack("C", $this->ptg[$token])); - } -- elseif(preg_match("/[A-Z0-9À-Ü\.]+/",$token)) -+ elseif(preg_match("/[A-Z0-9ᅵ-ᅵ\.]+/",$token)) - { - return($this->_convert_function($token,$this->_func_args)); - } + { + return(pack("C", $this->ptg[$token])); + } +- elseif(preg_match("/[A-Z0-9À-Ü\.]+/",$token)) ++ elseif(preg_match("/[A-Z0-9ᅵ-ᅵ\.]+/",$token)) + { + return($this->_convert_function($token,$this->_func_args)); + } @@ -723,21 +723,21 @@ - break; - default: - // if it's a reference -- if(eregi("^[A-I]?[A-Z][0-9]+$",$token) and -- !ereg("[0-9]",$this->_lookahead) and -+ if(preg_match("/^[A-I]?[A-Z][0-9]+$/i",$token) and -+ !preg_match("/[0-9]/",$this->_lookahead) and - ($this->_lookahead != ':') and ($this->_lookahead != '.')) - { - return($token); - } - // if it's a range (A1:A2) -- elseif(eregi("^[A-I]?[A-Z][0-9]+:[A-I]?[A-Z][0-9]+$",$token) and -- !ereg("[0-9]",$this->_lookahead)) -+ elseif(preg_match("/^[A-I]?[A-Z][0-9]+:[A-I]?[A-Z][0-9]+$/i",$token) and -+ !preg_match("/[0-9]/",$this->_lookahead)) - { - return($token); - } - // if it's a range (A1..A2) -- elseif(eregi("^[A-I]?[A-Z][0-9]+\.\.[A-I]?[A-Z][0-9]+$",$token) and -- !ereg("[0-9]",$this->_lookahead)) -+ elseif(preg_match("/^[A-I]?[A-Z][0-9]+\.\.[A-I]?[A-Z][0-9]+$/i",$token) and -+ !preg_match("/[0-9]/",$this->_lookahead)) - { - return($token); - } + break; + default: + // if it's a reference +- if(eregi("^[A-I]?[A-Z][0-9]+$",$token) and +- !ereg("[0-9]",$this->_lookahead) and ++ if(preg_match("/^[A-I]?[A-Z][0-9]+$/i",$token) and ++ !preg_match("/[0-9]/",$this->_lookahead) and + ($this->_lookahead != ':') and ($this->_lookahead != '.')) + { + return($token); + } + // if it's a range (A1:A2) +- elseif(eregi("^[A-I]?[A-Z][0-9]+:[A-I]?[A-Z][0-9]+$",$token) and +- !ereg("[0-9]",$this->_lookahead)) ++ elseif(preg_match("/^[A-I]?[A-Z][0-9]+:[A-I]?[A-Z][0-9]+$/i",$token) and ++ !preg_match("/[0-9]/",$this->_lookahead)) + { + return($token); + } + // if it's a range (A1..A2) +- elseif(eregi("^[A-I]?[A-Z][0-9]+\.\.[A-I]?[A-Z][0-9]+$",$token) and +- !ereg("[0-9]",$this->_lookahead)) ++ elseif(preg_match("/^[A-I]?[A-Z][0-9]+\.\.[A-I]?[A-Z][0-9]+$/i",$token) and ++ !preg_match("/[0-9]/",$this->_lookahead)) + { + return($token); + } @@ -746,7 +746,7 @@ - return($token); - } - // if it's a function call -- elseif(eregi("^[A-Z0-9À-Ü\.]+$",$token) and ($this->_lookahead == "(")) -+ elseif(preg_match("/^[A-Z0-9ᅵ-ᅵ\.]+$/i",$token) and ($this->_lookahead == "(")) - - { - return($token); + return($token); + } + // if it's a function call +- elseif(eregi("^[A-Z0-9À-Ü\.]+$",$token) and ($this->_lookahead == "(")) ++ elseif(preg_match("/^[A-Z0-9ᅵ-ᅵ\.]+$/i",$token) and ($this->_lookahead == "(")) + + { + return($token); @@ -857,15 +857,15 @@ - return($result); - } - // if it's a reference -- if (eregi("^[A-I]?[A-Z][0-9]+$",$this->_current_token)) -+ if (preg_match("/^[A-I]?[A-Z][0-9]+$/i",$this->_current_token)) - { - $result = $this->_create_tree($this->_current_token, '', ''); - $this->_advance(); - return($result); - } - // if it's a range -- elseif (eregi("^[A-I]?[A-Z][0-9]+:[A-I]?[A-Z][0-9]+$",$this->_current_token) or -- eregi("^[A-I]?[A-Z][0-9]+\.\.[A-I]?[A-Z][0-9]+$",$this->_current_token)) -+ elseif (preg_match("/^[A-I]?[A-Z][0-9]+:[A-I]?[A-Z][0-9]+$/i",$this->_current_token) or -+ preg_match("/^[A-I]?[A-Z][0-9]+\.\.[A-I]?[A-Z][0-9]+$/i",$this->_current_token)) - { - $result = $this->_current_token; - $this->_advance(); + return($result); + } + // if it's a reference +- if (eregi("^[A-I]?[A-Z][0-9]+$",$this->_current_token)) ++ if (preg_match("/^[A-I]?[A-Z][0-9]+$/i",$this->_current_token)) + { + $result = $this->_create_tree($this->_current_token, '', ''); + $this->_advance(); + return($result); + } + // if it's a range +- elseif (eregi("^[A-I]?[A-Z][0-9]+:[A-I]?[A-Z][0-9]+$",$this->_current_token) or +- eregi("^[A-I]?[A-Z][0-9]+\.\.[A-I]?[A-Z][0-9]+$",$this->_current_token)) ++ elseif (preg_match("/^[A-I]?[A-Z][0-9]+:[A-I]?[A-Z][0-9]+$/i",$this->_current_token) or ++ preg_match("/^[A-I]?[A-Z][0-9]+\.\.[A-I]?[A-Z][0-9]+$/i",$this->_current_token)) + { + $result = $this->_current_token; + $this->_advance(); @@ -878,7 +878,7 @@ - return($result); - } - // if it's a function call -- elseif (eregi("^[A-Z0-9À-Ü\.]+$",$this->_current_token)) -+ elseif (preg_match("/^[A-Z0-9ᅵ-ᅵ\.]+$/i",$this->_current_token)) - { - $result = $this->_func(); - return($result); + return($result); + } + // if it's a function call +- elseif (eregi("^[A-Z0-9À-Ü\.]+$",$this->_current_token)) ++ elseif (preg_match("/^[A-Z0-9ᅵ-ᅵ\.]+$/i",$this->_current_token)) + { + $result = $this->_func(); + return($result); Index: Worksheet.php =================================================================== RCS file: /cvsroot/moodle/moodle/lib/excel/Worksheet.php,v @@ -90,15 +90,15 @@ diff -u -r1.1 Worksheet.php --- Worksheet.php 26 Sep 2003 04:18:02 -0000 1.1 +++ Worksheet.php 18 Nov 2009 03:58:50 -0000 @@ -1264,10 +1264,10 @@ - } - - // Strip the '=' or '@' sign at the beginning of the formula string -- if (ereg("^=",$formula)) { -+ if (preg_match("/^=/",$formula)) { - $formula = preg_replace("/(^=)/","",$formula); - } -- elseif(ereg("^@",$formula)) { -+ elseif(preg_match("/^@/",$formula)) { - $formula = preg_replace("/(^@)/","",$formula); - } - else { + } + + // Strip the '=' or '@' sign at the beginning of the formula string +- if (ereg("^=",$formula)) { ++ if (preg_match("/^=/",$formula)) { + $formula = preg_replace("/(^=)/","",$formula); + } +- elseif(ereg("^@",$formula)) { ++ elseif(preg_match("/^@/",$formula)) { + $formula = preg_replace("/(^@)/","",$formula); + } + else { diff --git a/lib/excel/test.php b/lib/excel/test.php index 25a4f1156f0..888bbc36223 100644 --- a/lib/excel/test.php +++ b/lib/excel/test.php @@ -1,90 +1,90 @@ -add_worksheet('First One'); -// set the column width - $worksheet1->set_column(1, 1, 40); -// set the row height - $worksheet1->set_row(1, 20); - $worksheet1->write_string(1, 1, "This worksheet's name is ".$worksheet1->get_name()); - $worksheet1->write(2,1,"http://www.phpclasses.org/browse.html/package/767.html"); - $worksheet1->write_number(3, 0, 11); - $worksheet1->write_number(3, 1, 1); - $worksheet1->write_string(3, 2, "by four is"); - $worksheet1->write_formula(3, 3, "=A4 * (2 + 2)"); - //$worksheet1->write_formula(3, 3, "= SUM(A4:B4)"); - $worksheet1->write(5, 4, "= POWER(2,3)"); - $worksheet1->write(4, 4, "= SUM(5, 5, 5)"); - //$worksheet1->write_formula(4, 4, "= LN(2.71428)"); - //$worksheet1->write_formula(5, 4, "= SIN(PI()/2)"); - - // Creating the second worksheet - $worksheet2 =& $workbook->add_worksheet(); - - // Format for the headings - $formatot =& $workbook->add_format(); - $formatot->set_size(10); - $formatot->set_align('center'); - $formatot->set_color('white'); - $formatot->set_pattern(); - $formatot->set_fg_color('magenta'); - - $worksheet2->set_column(0,0,15); - $worksheet2->set_column(1,2,30); - $worksheet2->set_column(3,3,15); - $worksheet2->set_column(4,4,10); - - $worksheet2->write_string(1,0,"Id",$formatot); - $worksheet2->write_string(1,1,"Name",$formatot); - $worksheet2->write_string(1,2,"Adress",$formatot); - $worksheet2->write_string(1,3,"Phone Number",$formatot); - $worksheet2->write_string(1,4,"Salary",$formatot); - - $worksheet2->write(3,0,"22222222-2"); - $worksheet2->write(3,1,"John Smith"); - $worksheet2->write(3,2,"Main Street 100"); - $worksheet2->write(3,3,"02-5551234"); - $worksheet2->write(3,4,100); - $worksheet2->write(4,0,"11111111-1"); - $worksheet2->write(4,1,"Juan Perez"); - $worksheet2->write(4,2,"Los Paltos 200"); - $worksheet2->write(4,3,"03-5552345"); - $worksheet2->write(4,4,110); - // if you are writing a very long worksheet, you may want to use - // write_xxx() functions, instead of write() for performance reasons. - $worksheet2->write_string(5,0,"11111111-1"); - $worksheet2->write_string(5,1,"Another Guy"); - $worksheet2->write_string(5,2,"Somewhere 300"); - $worksheet2->write_string(5,3,"03-5553456"); - $worksheet2->write(5,4,108); - - - // Calculate some statistics - $worksheet2->write(7, 0, "Average Salary:"); - $worksheet2->write_formula(7, 4, "= AVERAGE(E4:E6)"); - $worksheet2->write(8, 0, "Minimum Salary:"); - $worksheet2->write_formula(8, 4, "= MIN(E4:E6)"); - $worksheet2->write(9, 0, "Maximum Salary:"); - $worksheet2->write_formula(9, 4, "= MAX(E4:E6)"); - - //$worksheet2->insert_bitmap(0, 0, "some.bmp",10,10); - - $workbook->close(); +add_worksheet('First One'); +// set the column width + $worksheet1->set_column(1, 1, 40); +// set the row height + $worksheet1->set_row(1, 20); + $worksheet1->write_string(1, 1, "This worksheet's name is ".$worksheet1->get_name()); + $worksheet1->write(2,1,"http://www.phpclasses.org/browse.html/package/767.html"); + $worksheet1->write_number(3, 0, 11); + $worksheet1->write_number(3, 1, 1); + $worksheet1->write_string(3, 2, "by four is"); + $worksheet1->write_formula(3, 3, "=A4 * (2 + 2)"); + //$worksheet1->write_formula(3, 3, "= SUM(A4:B4)"); + $worksheet1->write(5, 4, "= POWER(2,3)"); + $worksheet1->write(4, 4, "= SUM(5, 5, 5)"); + //$worksheet1->write_formula(4, 4, "= LN(2.71428)"); + //$worksheet1->write_formula(5, 4, "= SIN(PI()/2)"); + + // Creating the second worksheet + $worksheet2 =& $workbook->add_worksheet(); + + // Format for the headings + $formatot =& $workbook->add_format(); + $formatot->set_size(10); + $formatot->set_align('center'); + $formatot->set_color('white'); + $formatot->set_pattern(); + $formatot->set_fg_color('magenta'); + + $worksheet2->set_column(0,0,15); + $worksheet2->set_column(1,2,30); + $worksheet2->set_column(3,3,15); + $worksheet2->set_column(4,4,10); + + $worksheet2->write_string(1,0,"Id",$formatot); + $worksheet2->write_string(1,1,"Name",$formatot); + $worksheet2->write_string(1,2,"Adress",$formatot); + $worksheet2->write_string(1,3,"Phone Number",$formatot); + $worksheet2->write_string(1,4,"Salary",$formatot); + + $worksheet2->write(3,0,"22222222-2"); + $worksheet2->write(3,1,"John Smith"); + $worksheet2->write(3,2,"Main Street 100"); + $worksheet2->write(3,3,"02-5551234"); + $worksheet2->write(3,4,100); + $worksheet2->write(4,0,"11111111-1"); + $worksheet2->write(4,1,"Juan Perez"); + $worksheet2->write(4,2,"Los Paltos 200"); + $worksheet2->write(4,3,"03-5552345"); + $worksheet2->write(4,4,110); + // if you are writing a very long worksheet, you may want to use + // write_xxx() functions, instead of write() for performance reasons. + $worksheet2->write_string(5,0,"11111111-1"); + $worksheet2->write_string(5,1,"Another Guy"); + $worksheet2->write_string(5,2,"Somewhere 300"); + $worksheet2->write_string(5,3,"03-5553456"); + $worksheet2->write(5,4,108); + + + // Calculate some statistics + $worksheet2->write(7, 0, "Average Salary:"); + $worksheet2->write_formula(7, 4, "= AVERAGE(E4:E6)"); + $worksheet2->write(8, 0, "Minimum Salary:"); + $worksheet2->write_formula(8, 4, "= MIN(E4:E6)"); + $worksheet2->write(9, 0, "Maximum Salary:"); + $worksheet2->write_formula(9, 4, "= MAX(E4:E6)"); + + //$worksheet2->insert_bitmap(0, 0, "some.bmp",10,10); + + $workbook->close(); ?> \ No newline at end of file diff --git a/lib/md5.js b/lib/md5.js index 36fc1c22f18..46d2aab7d14 100644 --- a/lib/md5.js +++ b/lib/md5.js @@ -1,256 +1,256 @@ -/* - * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message - * Digest Algorithm, as defined in RFC 1321. - * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002. - * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet - * Distributed under the BSD License - * See http://pajhome.org.uk/crypt/md5 for more info. - */ - -/* - * Configurable variables. You may need to tweak these to be compatible with - * the server-side, but the defaults work in most cases. - */ -var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */ -var b64pad = ""; /* base-64 pad character. "=" for strict RFC compliance */ -var chrsz = 8; /* bits per input character. 8 - ASCII; 16 - Unicode */ - -/* - * These are the functions you'll usually want to call - * They take string arguments and return either hex or base-64 encoded strings - */ -function hex_md5(s){ return binl2hex(core_md5(str2binl(s), s.length * chrsz));} -function b64_md5(s){ return binl2b64(core_md5(str2binl(s), s.length * chrsz));} -function str_md5(s){ return binl2str(core_md5(str2binl(s), s.length * chrsz));} -function hex_hmac_md5(key, data) { return binl2hex(core_hmac_md5(key, data)); } -function b64_hmac_md5(key, data) { return binl2b64(core_hmac_md5(key, data)); } -function str_hmac_md5(key, data) { return binl2str(core_hmac_md5(key, data)); } - -/* - * Perform a simple self-test to see if the VM is working - */ -function md5_vm_test() -{ - return hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72"; -} - -/* - * Calculate the MD5 of an array of little-endian words, and a bit length - */ -function core_md5(x, len) -{ - /* append padding */ - x[len >> 5] |= 0x80 << ((len) % 32); - x[(((len + 64) >>> 9) << 4) + 14] = len; - - var a = 1732584193; - var b = -271733879; - var c = -1732584194; - var d = 271733878; - - for(var i = 0; i < x.length; i += 16) - { - var olda = a; - var oldb = b; - var oldc = c; - var oldd = d; - - a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936); - d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586); - c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819); - b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330); - a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897); - d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426); - c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341); - b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983); - a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416); - d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417); - c = md5_ff(c, d, a, b, x[i+10], 17, -42063); - b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162); - a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682); - d = md5_ff(d, a, b, c, x[i+13], 12, -40341101); - c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290); - b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329); - - a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510); - d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632); - c = md5_gg(c, d, a, b, x[i+11], 14, 643717713); - b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302); - a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691); - d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083); - c = md5_gg(c, d, a, b, x[i+15], 14, -660478335); - b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848); - a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438); - d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690); - c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961); - b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501); - a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467); - d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784); - c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473); - b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734); - - a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558); - d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463); - c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562); - b = md5_hh(b, c, d, a, x[i+14], 23, -35309556); - a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060); - d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353); - c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632); - b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640); - a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174); - d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222); - c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979); - b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189); - a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487); - d = md5_hh(d, a, b, c, x[i+12], 11, -421815835); - c = md5_hh(c, d, a, b, x[i+15], 16, 530742520); - b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651); - - a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844); - d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415); - c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905); - b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055); - a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571); - d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606); - c = md5_ii(c, d, a, b, x[i+10], 15, -1051523); - b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799); - a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359); - d = md5_ii(d, a, b, c, x[i+15], 10, -30611744); - c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380); - b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649); - a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070); - d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379); - c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259); - b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551); - - a = safe_add(a, olda); - b = safe_add(b, oldb); - c = safe_add(c, oldc); - d = safe_add(d, oldd); - } - return Array(a, b, c, d); - -} - -/* - * These functions implement the four basic operations the algorithm uses. - */ -function md5_cmn(q, a, b, x, s, t) -{ - return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b); -} -function md5_ff(a, b, c, d, x, s, t) -{ - return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t); -} -function md5_gg(a, b, c, d, x, s, t) -{ - return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t); -} -function md5_hh(a, b, c, d, x, s, t) -{ - return md5_cmn(b ^ c ^ d, a, b, x, s, t); -} -function md5_ii(a, b, c, d, x, s, t) -{ - return md5_cmn(c ^ (b | (~d)), a, b, x, s, t); -} - -/* - * Calculate the HMAC-MD5, of a key and some data - */ -function core_hmac_md5(key, data) -{ - var bkey = str2binl(key); - if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz); - - var ipad = Array(16), opad = Array(16); - for(var i = 0; i < 16; i++) - { - ipad[i] = bkey[i] ^ 0x36363636; - opad[i] = bkey[i] ^ 0x5C5C5C5C; - } - - var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz); - return core_md5(opad.concat(hash), 512 + 128); -} - -/* - * Add integers, wrapping at 2^32. This uses 16-bit operations internally - * to work around bugs in some JS interpreters. - */ -function safe_add(x, y) -{ - var lsw = (x & 0xFFFF) + (y & 0xFFFF); - var msw = (x >> 16) + (y >> 16) + (lsw >> 16); - return (msw << 16) | (lsw & 0xFFFF); -} - -/* - * Bitwise rotate a 32-bit number to the left. - */ -function bit_rol(num, cnt) -{ - return (num << cnt) | (num >>> (32 - cnt)); -} - -/* - * Convert a string to an array of little-endian words - * If chrsz is ASCII, characters >255 have their hi-byte silently ignored. - */ -function str2binl(str) -{ - var bin = Array(); - var mask = (1 << chrsz) - 1; - for(var i = 0; i < str.length * chrsz; i += chrsz) - bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (i%32); - return bin; -} - -/* - * Convert an array of little-endian words to a string - */ -function binl2str(bin) -{ - var str = ""; - var mask = (1 << chrsz) - 1; - for(var i = 0; i < bin.length * 32; i += chrsz) - str += String.fromCharCode((bin[i>>5] >>> (i % 32)) & mask); - return str; -} - -/* - * Convert an array of little-endian words to a hex string. - */ -function binl2hex(binarray) -{ - var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef"; - var str = ""; - for(var i = 0; i < binarray.length * 4; i++) - { - str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) + - hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF); - } - return str; -} - -/* - * Convert an array of little-endian words to a base-64 string - */ -function binl2b64(binarray) -{ - var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - var str = ""; - for(var i = 0; i < binarray.length * 4; i += 3) - { - var triplet = (((binarray[i >> 2] >> 8 * ( i %4)) & 0xFF) << 16) - | (((binarray[i+1 >> 2] >> 8 * ((i+1)%4)) & 0xFF) << 8 ) - | ((binarray[i+2 >> 2] >> 8 * ((i+2)%4)) & 0xFF); - for(var j = 0; j < 4; j++) - { - if(i * 8 + j * 6 > binarray.length * 32) str += b64pad; - else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F); - } - } - return str; -} +/* + * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message + * Digest Algorithm, as defined in RFC 1321. + * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002. + * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet + * Distributed under the BSD License + * See http://pajhome.org.uk/crypt/md5 for more info. + */ + +/* + * Configurable variables. You may need to tweak these to be compatible with + * the server-side, but the defaults work in most cases. + */ +var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */ +var b64pad = ""; /* base-64 pad character. "=" for strict RFC compliance */ +var chrsz = 8; /* bits per input character. 8 - ASCII; 16 - Unicode */ + +/* + * These are the functions you'll usually want to call + * They take string arguments and return either hex or base-64 encoded strings + */ +function hex_md5(s){ return binl2hex(core_md5(str2binl(s), s.length * chrsz));} +function b64_md5(s){ return binl2b64(core_md5(str2binl(s), s.length * chrsz));} +function str_md5(s){ return binl2str(core_md5(str2binl(s), s.length * chrsz));} +function hex_hmac_md5(key, data) { return binl2hex(core_hmac_md5(key, data)); } +function b64_hmac_md5(key, data) { return binl2b64(core_hmac_md5(key, data)); } +function str_hmac_md5(key, data) { return binl2str(core_hmac_md5(key, data)); } + +/* + * Perform a simple self-test to see if the VM is working + */ +function md5_vm_test() +{ + return hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72"; +} + +/* + * Calculate the MD5 of an array of little-endian words, and a bit length + */ +function core_md5(x, len) +{ + /* append padding */ + x[len >> 5] |= 0x80 << ((len) % 32); + x[(((len + 64) >>> 9) << 4) + 14] = len; + + var a = 1732584193; + var b = -271733879; + var c = -1732584194; + var d = 271733878; + + for(var i = 0; i < x.length; i += 16) + { + var olda = a; + var oldb = b; + var oldc = c; + var oldd = d; + + a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936); + d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586); + c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819); + b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330); + a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897); + d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426); + c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341); + b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983); + a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416); + d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417); + c = md5_ff(c, d, a, b, x[i+10], 17, -42063); + b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162); + a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682); + d = md5_ff(d, a, b, c, x[i+13], 12, -40341101); + c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290); + b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329); + + a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510); + d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632); + c = md5_gg(c, d, a, b, x[i+11], 14, 643717713); + b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302); + a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691); + d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083); + c = md5_gg(c, d, a, b, x[i+15], 14, -660478335); + b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848); + a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438); + d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690); + c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961); + b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501); + a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467); + d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784); + c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473); + b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734); + + a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558); + d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463); + c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562); + b = md5_hh(b, c, d, a, x[i+14], 23, -35309556); + a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060); + d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353); + c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632); + b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640); + a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174); + d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222); + c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979); + b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189); + a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487); + d = md5_hh(d, a, b, c, x[i+12], 11, -421815835); + c = md5_hh(c, d, a, b, x[i+15], 16, 530742520); + b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651); + + a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844); + d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415); + c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905); + b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055); + a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571); + d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606); + c = md5_ii(c, d, a, b, x[i+10], 15, -1051523); + b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799); + a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359); + d = md5_ii(d, a, b, c, x[i+15], 10, -30611744); + c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380); + b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649); + a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070); + d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379); + c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259); + b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551); + + a = safe_add(a, olda); + b = safe_add(b, oldb); + c = safe_add(c, oldc); + d = safe_add(d, oldd); + } + return Array(a, b, c, d); + +} + +/* + * These functions implement the four basic operations the algorithm uses. + */ +function md5_cmn(q, a, b, x, s, t) +{ + return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b); +} +function md5_ff(a, b, c, d, x, s, t) +{ + return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t); +} +function md5_gg(a, b, c, d, x, s, t) +{ + return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t); +} +function md5_hh(a, b, c, d, x, s, t) +{ + return md5_cmn(b ^ c ^ d, a, b, x, s, t); +} +function md5_ii(a, b, c, d, x, s, t) +{ + return md5_cmn(c ^ (b | (~d)), a, b, x, s, t); +} + +/* + * Calculate the HMAC-MD5, of a key and some data + */ +function core_hmac_md5(key, data) +{ + var bkey = str2binl(key); + if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz); + + var ipad = Array(16), opad = Array(16); + for(var i = 0; i < 16; i++) + { + ipad[i] = bkey[i] ^ 0x36363636; + opad[i] = bkey[i] ^ 0x5C5C5C5C; + } + + var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz); + return core_md5(opad.concat(hash), 512 + 128); +} + +/* + * Add integers, wrapping at 2^32. This uses 16-bit operations internally + * to work around bugs in some JS interpreters. + */ +function safe_add(x, y) +{ + var lsw = (x & 0xFFFF) + (y & 0xFFFF); + var msw = (x >> 16) + (y >> 16) + (lsw >> 16); + return (msw << 16) | (lsw & 0xFFFF); +} + +/* + * Bitwise rotate a 32-bit number to the left. + */ +function bit_rol(num, cnt) +{ + return (num << cnt) | (num >>> (32 - cnt)); +} + +/* + * Convert a string to an array of little-endian words + * If chrsz is ASCII, characters >255 have their hi-byte silently ignored. + */ +function str2binl(str) +{ + var bin = Array(); + var mask = (1 << chrsz) - 1; + for(var i = 0; i < str.length * chrsz; i += chrsz) + bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (i%32); + return bin; +} + +/* + * Convert an array of little-endian words to a string + */ +function binl2str(bin) +{ + var str = ""; + var mask = (1 << chrsz) - 1; + for(var i = 0; i < bin.length * 32; i += chrsz) + str += String.fromCharCode((bin[i>>5] >>> (i % 32)) & mask); + return str; +} + +/* + * Convert an array of little-endian words to a hex string. + */ +function binl2hex(binarray) +{ + var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef"; + var str = ""; + for(var i = 0; i < binarray.length * 4; i++) + { + str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) + + hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF); + } + return str; +} + +/* + * Convert an array of little-endian words to a base-64 string + */ +function binl2b64(binarray) +{ + var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + var str = ""; + for(var i = 0; i < binarray.length * 4; i += 3) + { + var triplet = (((binarray[i >> 2] >> 8 * ( i %4)) & 0xFF) << 16) + | (((binarray[i+1 >> 2] >> 8 * ((i+1)%4)) & 0xFF) << 8 ) + | ((binarray[i+2 >> 2] >> 8 * ((i+2)%4)) & 0xFF); + for(var j = 0; j < 4; j++) + { + if(i * 8 + j * 6 > binarray.length * 32) str += b64pad; + else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F); + } + } + return str; +} diff --git a/lib/mp3player/readme.txt b/lib/mp3player/readme.txt index b31444029eb..c300929e2e8 100644 --- a/lib/mp3player/readme.txt +++ b/lib/mp3player/readme.txt @@ -1,87 +1,87 @@ -Many aspects of the appearance and behaviour of the mp3 player can be customised, -these custom values are set by passing variables to the flash movie using "flashvars". -flashvars are supplied to the movie using - - - -alongside the other param tags, and with an extra attribute in the embed tag - -flashvars="some value" - -the "some value" part is a list of urlencoded variables - -&variableName=value&anotherVariable=anotherValue& - - +--------------------------------------------------------------------------------------------------------------------+ - | Variable Name | Possible Values | What it does | - |--------------------------------------------------------------------------------------------------------------------| - | bgColour | a colour in the format RRGGBB where | sets the background colour of the player. | - | | RR, GG and BB are hexadecimal values | | - | | (00 to FF) representing the Red, Green | | - | | and Blue parts of the colour. eg | | - | | ffffff is white, 000000 is black, | | - | | ff9900 is orange, 000033 is a dark blue. | | - | | the default colour is black. | | - |--------------------------------------------------------------------------------------------------------------------| - | btnColour | the same as bgColour, the default colour | sets the colour of the play and pause buttons. | - | | is white. | | - |--------------------------------------------------------------------------------------------------------------------| - | btnBorderColour | the same as bgColour, the default colour | the colour of the border around the buttons. | - | | is grey. | make this the same as btnColour if you don't want | - | | | a border. | - |--------------------------------------------------------------------------------------------------------------------| - | iconColour | the same as bgColour, the default colour | the colour of the play/pause icons. | - | | is black. | | - |--------------------------------------------------------------------------------------------------------------------| - | iconOverColour | the same as bgColour, the default colour | the colour of the play/pause icons when the mouse | - | | is green. | is over the button. | - |--------------------------------------------------------------------------------------------------------------------| - | handleColour | the same as bgColour, the default colour | the colour of the handles on the playback slider, | - | | is white. | volume and pan controls. | - |--------------------------------------------------------------------------------------------------------------------| - | trackColour | the same as bgColour, the default colour | the colour of the track for the playback slider, | - | | is grey. | volume and pan controls. | - |--------------------------------------------------------------------------------------------------------------------| - | loaderColour | the same as bgColour, the default colour | the colour of the loading bar. | - | | is white. | | - |--------------------------------------------------------------------------------------------------------------------| - | font | a name of a font, eg verdana. the | the font used in the movie. | - | | default value is Trebuchet MS. | | - |--------------------------------------------------------------------------------------------------------------------| - | fontColour | the same as bgColour, the default colour | the colour of the text. | - | | is white | | - |--------------------------------------------------------------------------------------------------------------------| - | waitForPlay | yes or no, the default is no. | should the player wait until the play button is | - | | | pressed before starting to download the file? | - |--------------------------------------------------------------------------------------------------------------------| - | autoPlay | yes or no, the default is yes. | will the player wait until the play button is | - | | | pressed before starting to play the file? if | - |--------------------------------------------------------------------------------------------------------------------| - | buffer | a value in seconds, the default is 20. | how many seconds of the file should be buffered | - | | | before playback starts? | - |--------------------------------------------------------------------------------------------------------------------| - | volText | a string (could this come from the | the text used in the player to label the volume | - | | language pack?) the default is "Vol". | control. | - |--------------------------------------------------------------------------------------------------------------------| - | panText | the same as volText. the default is "Pan". | the text used in the player to label the pan | - | | | control. | - +--------------------------------------------------------------------------------------------------------------------+ - - -a brightly coloured example ;) - - - -the content of the value attribute would need to be repeated and included as the value of -the flashvars attribute in the embed tag. - - -extra notes... - -the song information comes from 2 sources, initally the player displays the filename (minus the file extension) -as the title, once the file is fully loaded it checks the id3 data in the mp3 file for the songname, artist and year -and displays this information instead of the filename. - - -Andy Walker (www.altoncollege.ac.uk) - +Many aspects of the appearance and behaviour of the mp3 player can be customised, +these custom values are set by passing variables to the flash movie using "flashvars". +flashvars are supplied to the movie using + + + +alongside the other param tags, and with an extra attribute in the embed tag + +flashvars="some value" + +the "some value" part is a list of urlencoded variables + +&variableName=value&anotherVariable=anotherValue& + + +--------------------------------------------------------------------------------------------------------------------+ + | Variable Name | Possible Values | What it does | + |--------------------------------------------------------------------------------------------------------------------| + | bgColour | a colour in the format RRGGBB where | sets the background colour of the player. | + | | RR, GG and BB are hexadecimal values | | + | | (00 to FF) representing the Red, Green | | + | | and Blue parts of the colour. eg | | + | | ffffff is white, 000000 is black, | | + | | ff9900 is orange, 000033 is a dark blue. | | + | | the default colour is black. | | + |--------------------------------------------------------------------------------------------------------------------| + | btnColour | the same as bgColour, the default colour | sets the colour of the play and pause buttons. | + | | is white. | | + |--------------------------------------------------------------------------------------------------------------------| + | btnBorderColour | the same as bgColour, the default colour | the colour of the border around the buttons. | + | | is grey. | make this the same as btnColour if you don't want | + | | | a border. | + |--------------------------------------------------------------------------------------------------------------------| + | iconColour | the same as bgColour, the default colour | the colour of the play/pause icons. | + | | is black. | | + |--------------------------------------------------------------------------------------------------------------------| + | iconOverColour | the same as bgColour, the default colour | the colour of the play/pause icons when the mouse | + | | is green. | is over the button. | + |--------------------------------------------------------------------------------------------------------------------| + | handleColour | the same as bgColour, the default colour | the colour of the handles on the playback slider, | + | | is white. | volume and pan controls. | + |--------------------------------------------------------------------------------------------------------------------| + | trackColour | the same as bgColour, the default colour | the colour of the track for the playback slider, | + | | is grey. | volume and pan controls. | + |--------------------------------------------------------------------------------------------------------------------| + | loaderColour | the same as bgColour, the default colour | the colour of the loading bar. | + | | is white. | | + |--------------------------------------------------------------------------------------------------------------------| + | font | a name of a font, eg verdana. the | the font used in the movie. | + | | default value is Trebuchet MS. | | + |--------------------------------------------------------------------------------------------------------------------| + | fontColour | the same as bgColour, the default colour | the colour of the text. | + | | is white | | + |--------------------------------------------------------------------------------------------------------------------| + | waitForPlay | yes or no, the default is no. | should the player wait until the play button is | + | | | pressed before starting to download the file? | + |--------------------------------------------------------------------------------------------------------------------| + | autoPlay | yes or no, the default is yes. | will the player wait until the play button is | + | | | pressed before starting to play the file? if | + |--------------------------------------------------------------------------------------------------------------------| + | buffer | a value in seconds, the default is 20. | how many seconds of the file should be buffered | + | | | before playback starts? | + |--------------------------------------------------------------------------------------------------------------------| + | volText | a string (could this come from the | the text used in the player to label the volume | + | | language pack?) the default is "Vol". | control. | + |--------------------------------------------------------------------------------------------------------------------| + | panText | the same as volText. the default is "Pan". | the text used in the player to label the pan | + | | | control. | + +--------------------------------------------------------------------------------------------------------------------+ + + +a brightly coloured example ;) + + + +the content of the value attribute would need to be repeated and included as the value of +the flashvars attribute in the embed tag. + + +extra notes... + +the song information comes from 2 sources, initally the player displays the filename (minus the file extension) +as the title, once the file is fully loaded it checks the id3 data in the mp3 file for the songname, artist and year +and displays this information instead of the filename. + + +Andy Walker (www.altoncollege.ac.uk) + diff --git a/lib/phpmailer/LICENSE b/lib/phpmailer/LICENSE index 03851a33830..f3f1b3b65e1 100644 --- a/lib/phpmailer/LICENSE +++ b/lib/phpmailer/LICENSE @@ -1,504 +1,504 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/lib/phpmailer/README b/lib/phpmailer/README index 2d79f386226..8d48dc05f52 100644 --- a/lib/phpmailer/README +++ b/lib/phpmailer/README @@ -1,218 +1,218 @@ -/******************************************************************* -* The http://phpmailer.codeworxtech.com/ website now carries a few * -* advertisements through the Google Adsense network. Please visit * -* the advertiser sites and help us offset some of our costs. * -* Thanks .... * -********************************************************************/ - -PHPMailer -Full Featured Email Transfer Class for PHP -========================================== - -Version 5.0.0 (April 02, 2009) - -With the release of this version, we are initiating a new version numbering -system to differentiate from the PHP4 version of PHPMailer. - -Most notable in this release is fully object oriented code. - -We now have available the PHPDocumentor (phpdocs) documentation. This is -separate from the regular download to keep file sizes down. Please see the -download area of http://phpmailer.codeworxtech.com. - -We also have created a new test script (see /test_script) that you can use -right out of the box. Copy the /test_script folder directly to your server (in -the same structure ... with class.phpmailer.php and class.smtp.php in the -folder above it. Then launch the test script with: -http://www.yourdomain.com/phpmailer/test_script/index.php -from this one script, you can test your server settings for mail(), sendmail (or -qmail), and SMTP. This will email you a sample email (using contents.html for -the email body) and two attachments. One of the attachments is used as an inline -image to demonstrate how PHPMailer will automatically detect if attachments are -the same source as inline graphics and only include one version. Once you click -the Submit button, the results will be displayed including any SMTP debug -information and send status. We will also display a version of the script that -you can cut and paste to include in your projects. Enjoy! - -Version 2.3 (November 08, 2008) - -We have removed the /phpdoc from the downloads. All documentation is now on -the http://phpmailer.codeworxtech.com website. - -The phpunit.php has been updated to support PHP5. - -For all other changes and notes, please see the changelog. - -Donations are accepted at PayPal with our id "paypal@worxteam.com". - -Version 2.2 (July 15 2008) - -- see the changelog. - -Version 2.1 (June 04 2008) - -With this release, we are announcing that the development of PHPMailer for PHP5 -will be our focus from this date on. We have implemented all the enhancements -and fixes from the latest release of PHPMailer for PHP4. - -Far more important, though, is that this release of PHPMailer (v2.1) is -fully tested with E_STRICT error checking enabled. - -** NOTE: WE HAVE A NEW LANGUAGE VARIABLE FOR DIGITALLY SIGNED S/MIME EMAILS. - IF YOU CAN HELP WITH LANGUAGES OTHER THAN ENGLISH AND SPANISH, IT WOULD BE - APPRECIATED. - -We have now added S/MIME functionality (ability to digitally sign emails). -BIG THANKS TO "sergiocambra" for posting this patch back in November 2007. -The "Signed Emails" functionality adds the Sign method to pass the private key -filename and the password to read it, and then email will be sent with -content-type multipart/signed and with the digital signature attached. - -A quick note on E_STRICT: - -- In about half the test environments the development version was subjected - to, an error was thrown for the date() functions (used at line 1565 and 1569). - This is NOT a PHPMailer error, it is the result of an incorrectly configured - PHP5 installation. The fix is to modify your 'php.ini' file and include the - date.timezone = America/New York - directive, (for your own server timezone) -- If you do get this error, and are unable to access your php.ini file, there is - a workaround. In your PHP script, add - date_default_timezone_set('America/Toronto'); - - * do NOT try to use - $myVar = date_default_timezone_get(); - as a test, it will throw an error. - -We have also included more example files to show the use of "sendmail", "mail()", -"smtp", and "gmail". - -We are also looking for more programmers to join the volunteer development team. -If you have an interest in this, please let us know. - -Enjoy! - - -Version 2.1.0beta1 & beta2 - -please note, this is BETA software -** DO NOT USE THIS IN PRODUCTION OR LIVE PROJECTS -INTENDED STRICTLY FOR TESTING - -** NOTE: - -As of November 2007, PHPMailer has a new project team headed by industry -veteran Andy Prevost (codeworxtech). The first release in more than two -years will focus on fixes, adding ease-of-use enhancements, provide -basic compatibility with PHP4 and PHP5 using PHP5 backwards compatibility -features. A new release is planned before year-end 2007 that will provide -full compatiblity with PHP4 and PHP5, as well as more bug fixes. - -We are looking for project developers to assist in restoring PHPMailer to -its leadership position. Our goals are to simplify use of PHPMailer, provide -good documentation and examples, and retain backward compatibility to level -1.7.3 standards. - -If you are interested in helping out, visit http://sourceforge.net/projects/phpmailer -and indicate your interest. - -** - -http://phpmailer.sourceforge.net/ - -This software is licenced under the LGPL. Please read LICENSE for information on the -software availability and distribution. - -Class Features: -- Send emails with multiple TOs, CCs, BCCs and REPLY-TOs -- Redundant SMTP servers -- Multipart/alternative emails for mail clients that do not read HTML email -- Support for 8bit, base64, binary, and quoted-printable encoding -- Uses the same methods as the very popular AspEmail active server (COM) component -- SMTP authentication -- Native language support -- Word wrap, and more! - -Why you might need it: - -Many PHP developers utilize email in their code. The only PHP function -that supports this is the mail() function. However, it does not expose -any of the popular features that many email clients use nowadays like -HTML-based emails and attachments. There are two proprietary -development tools out there that have all the functionality built into -easy to use classes: AspEmail(tm) and AspMail. Both of these -programs are COM components only available on Windows. They are also a -little pricey for smaller projects. - -Since I do Linux development I�ve missed these tools for my PHP coding. -So I built a version myself that implements the same methods (object -calls) that the Windows-based components do. It is open source and the -LGPL license allows you to place the class in your proprietary PHP -projects. - - -Installation: - -Copy class.phpmailer.php into your php.ini include_path. If you are -using the SMTP mailer then place class.smtp.php in your path as well. -In the language directory you will find several files like -phpmailer.lang-en.php. If you look right before the .php extension -that there are two letters. These represent the language type of the -translation file. For instance "en" is the English file and "br" is -the Portuguese file. Chose the file that best fits with your language -and place it in the PHP include path. If your language is English -then you have nothing more to do. If it is a different language then -you must point PHPMailer to the correct translation. To do this, call -the PHPMailer SetLanguage method like so: - -// To load the Portuguese version -$mail->SetLanguage("br", "/optional/path/to/language/directory/"); - -That's it. You should now be ready to use PHPMailer! - - -A Simple Example: - -IsSMTP(); // set mailer to use SMTP -$mail->Host = "smtp1.example.com;smtp2.example.com"; // specify main and backup server -$mail->SMTPAuth = true; // turn on SMTP authentication -$mail->Username = "jswan"; // SMTP username -$mail->Password = "secret"; // SMTP password - -$mail->From = "from@example.com"; -$mail->FromName = "Mailer"; -$mail->AddAddress("josh@example.net", "Josh Adams"); -$mail->AddAddress("ellen@example.com"); // name is optional -$mail->AddReplyTo("info@example.com", "Information"); - -$mail->WordWrap = 50; // set word wrap to 50 characters -$mail->AddAttachment("/var/tmp/file.tar.gz"); // add attachments -$mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // optional name -$mail->IsHTML(true); // set email format to HTML - -$mail->Subject = "Here is the subject"; -$mail->Body = "This is the HTML message body in bold!"; -$mail->AltBody = "This is the body in plain text for non-HTML mail clients"; - -if(!$mail->Send()) -{ - echo "Message could not be sent.

    "; - echo "Mailer Error: " . $mail->ErrorInfo; - exit; -} - -echo "Message has been sent"; -?> - -CHANGELOG - -See ChangeLog.txt - -Download: http://sourceforge.net/project/showfiles.php?group_id=26031 - -Andy Prevost +/******************************************************************* +* The http://phpmailer.codeworxtech.com/ website now carries a few * +* advertisements through the Google Adsense network. Please visit * +* the advertiser sites and help us offset some of our costs. * +* Thanks .... * +********************************************************************/ + +PHPMailer +Full Featured Email Transfer Class for PHP +========================================== + +Version 5.0.0 (April 02, 2009) + +With the release of this version, we are initiating a new version numbering +system to differentiate from the PHP4 version of PHPMailer. + +Most notable in this release is fully object oriented code. + +We now have available the PHPDocumentor (phpdocs) documentation. This is +separate from the regular download to keep file sizes down. Please see the +download area of http://phpmailer.codeworxtech.com. + +We also have created a new test script (see /test_script) that you can use +right out of the box. Copy the /test_script folder directly to your server (in +the same structure ... with class.phpmailer.php and class.smtp.php in the +folder above it. Then launch the test script with: +http://www.yourdomain.com/phpmailer/test_script/index.php +from this one script, you can test your server settings for mail(), sendmail (or +qmail), and SMTP. This will email you a sample email (using contents.html for +the email body) and two attachments. One of the attachments is used as an inline +image to demonstrate how PHPMailer will automatically detect if attachments are +the same source as inline graphics and only include one version. Once you click +the Submit button, the results will be displayed including any SMTP debug +information and send status. We will also display a version of the script that +you can cut and paste to include in your projects. Enjoy! + +Version 2.3 (November 08, 2008) + +We have removed the /phpdoc from the downloads. All documentation is now on +the http://phpmailer.codeworxtech.com website. + +The phpunit.php has been updated to support PHP5. + +For all other changes and notes, please see the changelog. + +Donations are accepted at PayPal with our id "paypal@worxteam.com". + +Version 2.2 (July 15 2008) + +- see the changelog. + +Version 2.1 (June 04 2008) + +With this release, we are announcing that the development of PHPMailer for PHP5 +will be our focus from this date on. We have implemented all the enhancements +and fixes from the latest release of PHPMailer for PHP4. + +Far more important, though, is that this release of PHPMailer (v2.1) is +fully tested with E_STRICT error checking enabled. + +** NOTE: WE HAVE A NEW LANGUAGE VARIABLE FOR DIGITALLY SIGNED S/MIME EMAILS. + IF YOU CAN HELP WITH LANGUAGES OTHER THAN ENGLISH AND SPANISH, IT WOULD BE + APPRECIATED. + +We have now added S/MIME functionality (ability to digitally sign emails). +BIG THANKS TO "sergiocambra" for posting this patch back in November 2007. +The "Signed Emails" functionality adds the Sign method to pass the private key +filename and the password to read it, and then email will be sent with +content-type multipart/signed and with the digital signature attached. + +A quick note on E_STRICT: + +- In about half the test environments the development version was subjected + to, an error was thrown for the date() functions (used at line 1565 and 1569). + This is NOT a PHPMailer error, it is the result of an incorrectly configured + PHP5 installation. The fix is to modify your 'php.ini' file and include the + date.timezone = America/New York + directive, (for your own server timezone) +- If you do get this error, and are unable to access your php.ini file, there is + a workaround. In your PHP script, add + date_default_timezone_set('America/Toronto'); + + * do NOT try to use + $myVar = date_default_timezone_get(); + as a test, it will throw an error. + +We have also included more example files to show the use of "sendmail", "mail()", +"smtp", and "gmail". + +We are also looking for more programmers to join the volunteer development team. +If you have an interest in this, please let us know. + +Enjoy! + + +Version 2.1.0beta1 & beta2 + +please note, this is BETA software +** DO NOT USE THIS IN PRODUCTION OR LIVE PROJECTS +INTENDED STRICTLY FOR TESTING + +** NOTE: + +As of November 2007, PHPMailer has a new project team headed by industry +veteran Andy Prevost (codeworxtech). The first release in more than two +years will focus on fixes, adding ease-of-use enhancements, provide +basic compatibility with PHP4 and PHP5 using PHP5 backwards compatibility +features. A new release is planned before year-end 2007 that will provide +full compatiblity with PHP4 and PHP5, as well as more bug fixes. + +We are looking for project developers to assist in restoring PHPMailer to +its leadership position. Our goals are to simplify use of PHPMailer, provide +good documentation and examples, and retain backward compatibility to level +1.7.3 standards. + +If you are interested in helping out, visit http://sourceforge.net/projects/phpmailer +and indicate your interest. + +** + +http://phpmailer.sourceforge.net/ + +This software is licenced under the LGPL. Please read LICENSE for information on the +software availability and distribution. + +Class Features: +- Send emails with multiple TOs, CCs, BCCs and REPLY-TOs +- Redundant SMTP servers +- Multipart/alternative emails for mail clients that do not read HTML email +- Support for 8bit, base64, binary, and quoted-printable encoding +- Uses the same methods as the very popular AspEmail active server (COM) component +- SMTP authentication +- Native language support +- Word wrap, and more! + +Why you might need it: + +Many PHP developers utilize email in their code. The only PHP function +that supports this is the mail() function. However, it does not expose +any of the popular features that many email clients use nowadays like +HTML-based emails and attachments. There are two proprietary +development tools out there that have all the functionality built into +easy to use classes: AspEmail(tm) and AspMail. Both of these +programs are COM components only available on Windows. They are also a +little pricey for smaller projects. + +Since I do Linux development I�ve missed these tools for my PHP coding. +So I built a version myself that implements the same methods (object +calls) that the Windows-based components do. It is open source and the +LGPL license allows you to place the class in your proprietary PHP +projects. + + +Installation: + +Copy class.phpmailer.php into your php.ini include_path. If you are +using the SMTP mailer then place class.smtp.php in your path as well. +In the language directory you will find several files like +phpmailer.lang-en.php. If you look right before the .php extension +that there are two letters. These represent the language type of the +translation file. For instance "en" is the English file and "br" is +the Portuguese file. Chose the file that best fits with your language +and place it in the PHP include path. If your language is English +then you have nothing more to do. If it is a different language then +you must point PHPMailer to the correct translation. To do this, call +the PHPMailer SetLanguage method like so: + +// To load the Portuguese version +$mail->SetLanguage("br", "/optional/path/to/language/directory/"); + +That's it. You should now be ready to use PHPMailer! + + +A Simple Example: + +IsSMTP(); // set mailer to use SMTP +$mail->Host = "smtp1.example.com;smtp2.example.com"; // specify main and backup server +$mail->SMTPAuth = true; // turn on SMTP authentication +$mail->Username = "jswan"; // SMTP username +$mail->Password = "secret"; // SMTP password + +$mail->From = "from@example.com"; +$mail->FromName = "Mailer"; +$mail->AddAddress("josh@example.net", "Josh Adams"); +$mail->AddAddress("ellen@example.com"); // name is optional +$mail->AddReplyTo("info@example.com", "Information"); + +$mail->WordWrap = 50; // set word wrap to 50 characters +$mail->AddAttachment("/var/tmp/file.tar.gz"); // add attachments +$mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // optional name +$mail->IsHTML(true); // set email format to HTML + +$mail->Subject = "Here is the subject"; +$mail->Body = "This is the HTML message body in bold!"; +$mail->AltBody = "This is the body in plain text for non-HTML mail clients"; + +if(!$mail->Send()) +{ + echo "Message could not be sent.

    "; + echo "Mailer Error: " . $mail->ErrorInfo; + exit; +} + +echo "Message has been sent"; +?> + +CHANGELOG + +See ChangeLog.txt + +Download: http://sourceforge.net/project/showfiles.php?group_id=26031 + +Andy Prevost diff --git a/lib/phpmailer/changelog.txt b/lib/phpmailer/changelog.txt index dc43a4b607e..a5c0cb57d06 100644 --- a/lib/phpmailer/changelog.txt +++ b/lib/phpmailer/changelog.txt @@ -1,408 +1,408 @@ -ChangeLog - -NOTE: THIS VERSION OF PHPMAILER IS DESIGNED FOR PHP5/PHP6. - IT WILL NOT WORK WITH PHP4. - -Version 5.1 (October 20, 2009) -* fixed filename issue with AddStringAttachment (thanks to Tony) -* fixed "SingleTo" property, now works with Senmail, Qmail, and SMTP in - addition to PHP mail() -* added DKIM digital signing functionality - New properties: - - DKIM_domain (sets the domain name) - - DKIM_private (holds DKIM private key) - - DKIM_passphrase (holds your DKIM passphrase) - - DKIM_selector (holds the DKIM "selector") - - DKIM_identity (holds the identifying email address) -* added callback function support - - callback function parameters include: - result, to, cc, bcc, subject and body - * see the test/test_callback.php file for usage. -* added "auto" identity functionality - - can automatically add: - - Return-path (if Sender not set) - - Reply-To (if ReplyTo not set) - - can be disabled: - - $mail->SetFrom('yourname@yourdomain.com','First Last',false); - - or by adding the $mail->Sender and/or $mail->ReplyTo properties - Note: "auto" identity added to help with emails ending up in spam - or junk boxes because of missing headers - -Version 5.0.2 (May 24, 2009) -* Fix for missing attachments when inline graphics are present -* Fix for missing Cc in header when using SMTP (mail was sent, - but not displayed in header -- Cc receiver only saw email To: - line and no Cc line, but did get the email (To receiver - saw same) - -Version 5.0.1 (April 05, 2009) -* Temporary fix for missing attachments - -Version 5.0.0 (April 02, 2009) - -* With the release of this version, we are initiating a new version numbering - system to differentiate from the PHP4 version of PHPMailer. -* Most notable in this release is fully object oriented code. -class.smtp.php: -* Refactored class.smtp.php to support new exception handling - code size reduced from 29.2 Kb to 25.6 Kb -* Removed unnecessary functions from class.smtp.php: - public function Expand($name) { - public function Help($keyword="") { - public function Noop() { - public function Send($from) { - public function SendOrMail($from) { - public function Verify($name) { -class.phpmailer.php: -* Refactored class.phpmailer.php with new exception handling -* Changed processing functionality of Sendmail and Qmail so they cannot be - inadvertently used -* removed getFile() function, just became a simple wrapper for - file_get_contents() -* added check for PHP version (will gracefully exit if not at least PHP 5.0) -class.phpmailer.php enhancements -* enhanced code to check if an attachment source is the same as an embedded or - inline graphic source to eliminate duplicate attachments -New /test_script -* We have written a test script you can use to test the script as part of your - installation. Once you press submit, the test script will send a multi-mime - email with either the message you type in or an HTML email with an inline - graphic. Two attachments are included in the email (one of the attachments - is also the inline graphic so you can see that only one copy of the graphic - is sent in the email). The test script will also display the functional - script that you can copy/paste to your editor to duplicate the functionality. -New examples -* All new examples in both basic and advanced modes. Advanced examples show - Exception handling. -PHPDocumentator (phpdocs) documentation for PHPMailer version 5.0.0 -* all new documentation - -Please note: the website has been updated to reflect the changes in PHPMailer -version 5.0.0. http://phpmailer.codeworxtech.com/ - -Version 2.3 (November 06, 2008) - -* added Arabic language (many thanks to Bahjat Al Mostafa) -* removed English language from language files and made it a default within - class.phpmailer.php - if no language is found, it will default to use - the english language translation -* fixed public/private declarations -* corrected line 1728, $basedir to $directory -* added $sign_cert_file to avoid improper duplicate use of $sign_key_file -* corrected $this->Hello on line 612 to $this->Helo -* changed default of $LE to "\r\n" to comply with RFC 2822. Can be set by the user - if default is not acceptable -* removed trim() from return results in EncodeQP -* /test and three files it contained are removed from version 2.3 -* fixed phpunit.php for compliance with PHP5 -* changed $this->AltBody = $textMsg; to $this->AltBody = html_entity_decode($textMsg); -* We have removed the /phpdoc from the downloads. All documentation is now on - the http://phpmailer.codeworxtech.com website. - -Version 2.2.1 () July 19 2008 - -* fixed line 1092 in class.smtp.php (my apologies, error on my part) - -Version 2.2 () July 15 2008 - -* Fixed redirect issue (display of UTF-8 in thank you redirect) -* fixed error in getResponse function declaration (class.pop3.php) -* PHPMailer now PHP6 compliant -* fixed line 1092 in class.smtp.php (endless loop from missing = sign) - -Version 2.1 (Wed, June 04 2008) - -** NOTE: WE HAVE A NEW LANGUAGE VARIABLE FOR DIGITALLY SIGNED S/MIME EMAILS. - IF YOU CAN HELP WITH LANGUAGES OTHER THAN ENGLISH AND SPANISH, IT WOULD BE - APPRECIATED. - -* added S/MIME functionality (ability to digitally sign emails) - BIG THANKS TO "sergiocambra" for posting this patch back in November 2007. - The "Signed Emails" functionality adds the Sign method to pass the private key - filename and the password to read it, and then email will be sent with - content-type multipart/signed and with the digital signature attached. -* fully compatible with E_STRICT error level - - Please note: - In about half the test environments this development version was subjected - to, an error was thrown for the date() functions used (line 1565 and 1569). - This is NOT a PHPMailer error, it is the result of an incorrectly configured - PHP5 installation. The fix is to modify your 'php.ini' file and include the - date.timezone = America/New York - directive, to your own server timezone - - If you do get this error, and are unable to access your php.ini file: - In your PHP script, add - date_default_timezone_set('America/Toronto'); - - do not try to use - $myVar = date_default_timezone_get(); - as a test, it will throw an error. -* added ability to define path (mainly for embedded images) - function MsgHTML($message,$basedir='') ... where: - $basedir is the fully qualified path -* fixed MsgHTML() function: - - Embedded Images where images are specified by :// will not be altered or embedded -* fixed the return value of SMTP exit code ( pclose ) -* addressed issue of multibyte characters in subject line and truncating -* added ability to have user specified Message ID - (default is still that PHPMailer create a unique Message ID) -* corrected unidentified message type to 'application/octet-stream' -* fixed chunk_split() multibyte issue (thanks to Colin Brown, et al). -* added check for added attachments -* enhanced conversion of HTML to text in MsgHTML (thanks to "brunny") - -Version 2.1.0beta2 (Sun, Dec 02 2007) -* implemented updated EncodeQP (thanks to coolbru, aka Marcus Bointon) -* finished all testing, all known bugs corrected, enhancements tested -- note: will NOT work with PHP4. - -please note, this is BETA software -** DO NOT USE THIS IN PRODUCTION OR LIVE PROJECTS -INTENDED STRICTLY FOR TESTING - -Version 2.1.0beta1 -please note, this is BETA software -** DO NOT USE THIS IN PRODUCTION OR LIVE PROJECTS -INTENDED STRICTLY FOR TESTING - -Version 2.0.0 rc2 (Fri, Nov 16 2007), interim release -* implements new property to control VERP in class.smtp.php - example (requires instantiating class.smtp.php): - $mail->do_verp = true; -* POP-before-SMTP functionality included, thanks to Richard Davey - (see class.pop3.php & pop3_before_smtp_test.php for examples) -* included example showing how to use PHPMailer with GMAIL -* fixed the missing Cc in SendMail() and Mail() - -****************** -A note on sending bulk emails: - -If the email you are sending is not personalized, consider using the -"undisclosed-recipient:;" strategy. That is, put all of your recipients -in the Bcc field and set the To field to "undisclosed-recipients:;". -It's a lot faster (only one send) and saves quite a bit on resources. -Contrary to some opinions, this will not get you listed in spam engines - -it's a legitimate way for you to send emails. - -A partial example for use with PHPMailer: - -$mail->AddAddress("undisclosed-recipients:;"); -$mail->AddBCC("email1@anydomain.com,email2@anyotherdomain.com,email3@anyalternatedomain.com"); - -Many email service providers restrict the number of emails that can be sent -in any given time period. Often that is between 50 - 60 emails maximum -per hour or per send session. - -If that's the case, then break up your Bcc lists into chunks that are one -less than your limit, and put a pause in your script. -******************* - -Version 2.0.0 rc1 (Thu, Nov 08 2007), interim release -* dramatically simplified using inline graphics ... it's fully automated and requires no user input -* added automatic document type detection for attachments and pictures -* added MsgHTML() function to replace Body tag for HTML emails -* fixed the SendMail security issues (input validation vulnerability) -* enhanced the AddAddresses functionality so that the "Name" portion is used in the email address -* removed the need to use the AltBody method (set from the HTML, or default text used) -* set the PHP Mail() function as the default (still support SendMail, SMTP Mail) -* removed the need to set the IsHTML property (set automatically) -* added Estonian language file by Indrek Päri -* added header injection patch -* added "set" method to permit users to create their own pseudo-properties like 'X-Headers', etc. - example of use: - $mail->set('X-Priority', '3'); - $mail->set('X-MSMail-Priority', 'Normal'); -* fixed warning message in SMTP get_lines method -* added TLS/SSL SMTP support - example of use: - $mail = new PHPMailer(); - $mail->Mailer = "smtp"; - $mail->Host = "smtp.example.com"; - $mail->SMTPSecure = "tls"; // option - //$mail->SMTPSecure = "ssl"; // option - ... - $mail->Send(); -* PHPMailer has been tested with PHP4 (4.4.7) and PHP5 (5.2.7) -* Works with PHP installed as a module or as CGI-PHP -- NOTE: will NOT work with PHP5 in E_STRICT error mode - -Version 1.73 (Sun, Jun 10 2005) -* Fixed denial of service bug: http://www.cybsec.com/vuln/PHPMailer-DOS.pdf -* Now has a total of 20 translations -* Fixed alt attachments bug: http://tinyurl.com/98u9k - -Version 1.72 (Wed, May 25 2004) -* Added Dutch, Swedish, Czech, Norwegian, and Turkish translations. -* Received: Removed this method because spam filter programs like -SpamAssassin reject this header. -* Fixed error count bug. -* SetLanguage default is now "language/". -* Fixed magic_quotes_runtime bug. - -Version 1.71 (Tue, Jul 28 2003) -* Made several speed enhancements -* Added German and Italian translation files -* Fixed HELO/AUTH bugs on keep-alive connects -* Now provides an error message if language file does not load -* Fixed attachment EOL bug -* Updated some unclear documentation -* Added additional tests and improved others - -Version 1.70 (Mon, Jun 20 2003) -* Added SMTP keep-alive support -* Added IsError method for error detection -* Added error message translation support (SetLanguage) -* Refactored many methods to increase library performance -* Hello now sends the newer EHLO message before HELO as per RFC 2821 -* Removed the boundary class and replaced it with GetBoundary -* Removed queue support methods -* New $Hostname variable -* New Message-ID header -* Received header reformat -* Helo variable default changed to $Hostname -* Removed extra spaces in Content-Type definition (#667182) -* Return-Path should be set to Sender when set -* Adds Q or B encoding to headers when necessary -* quoted-encoding should now encode NULs \000 -* Fixed encoding of body/AltBody (#553370) -* Adds "To: undisclosed-recipients:;" when all recipients are hidden (BCC) -* Multiple bug fixes - -Version 1.65 (Fri, Aug 09 2002) -* Fixed non-visible attachment bug (#585097) for Outlook -* SMTP connections are now closed after each transaction -* Fixed SMTP::Expand return value -* Converted SMTP class documentation to phpDocumentor format - -Version 1.62 (Wed, Jun 26 2002) -* Fixed multi-attach bug -* Set proper word wrapping -* Reduced memory use with attachments -* Added more debugging -* Changed documentation to phpDocumentor format - -Version 1.60 (Sat, Mar 30 2002) -* Sendmail pipe and address patch (Christian Holtje) -* Added embedded image and read confirmation support (A. Ognio) -* Added unit tests -* Added SMTP timeout support (*nix only) -* Added possibly temporary PluginDir variable for SMTP class -* Added LE message line ending variable -* Refactored boundary and attachment code -* Eliminated SMTP class warnings -* Added SendToQueue method for future queuing support - -Version 1.54 (Wed, Dec 19 2001) -* Add some queuing support code -* Fixed a pesky multi/alt bug -* Messages are no longer forced to have "To" addresses - -Version 1.50 (Thu, Nov 08 2001) -* Fix extra lines when not using SMTP mailer -* Set WordWrap variable to int with a zero default - -Version 1.47 (Tue, Oct 16 2001) -* Fixed Received header code format -* Fixed AltBody order error -* Fixed alternate port warning - -Version 1.45 (Tue, Sep 25 2001) -* Added enhanced SMTP debug support -* Added support for multiple ports on SMTP -* Added Received header for tracing -* Fixed AddStringAttachment encoding -* Fixed possible header name quote bug -* Fixed wordwrap() trim bug -* Couple other small bug fixes - -Version 1.41 (Wed, Aug 22 2001) -* Fixed AltBody bug w/o attachments -* Fixed rfc_date() for certain mail servers - -Version 1.40 (Sun, Aug 12 2001) -* Added multipart/alternative support (AltBody) -* Documentation update -* Fixed bug in Mercury MTA - -Version 1.29 (Fri, Aug 03 2001) -* Added AddStringAttachment() method -* Added SMTP authentication support - -Version 1.28 (Mon, Jul 30 2001) -* Fixed a typo in SMTP class -* Fixed header issue with Imail (win32) SMTP server -* Made fopen() calls for attachments use "rb" to fix win32 error - -Version 1.25 (Mon, Jul 02 2001) -* Added RFC 822 date fix (Patrice) -* Added improved error handling by adding a $ErrorInfo variable -* Removed MailerDebug variable (obsolete with new error handler) - -Version 1.20 (Mon, Jun 25 2001) -* Added quoted-printable encoding (Patrice) -* Set Version as public and removed PrintVersion() -* Changed phpdoc to only display public variables and methods - -Version 1.19 (Thu, Jun 21 2001) -* Fixed MS Mail header bug -* Added fix for Bcc problem with mail(). *Does not work on Win32* - (See PHP bug report: http://www.php.net/bugs.php?id=11616) -* mail() no longer passes a fifth parameter when not needed - -Version 1.15 (Fri, Jun 15 2001) -[Note: these changes contributed by Patrice Fournier] -* Changed all remaining \n to \r\n -* Bcc: header no longer writen to message except -when sent directly to sendmail -* Added a small message to non-MIME compliant mail reader -* Added Sender variable to change the Sender email -used in -f for sendmail/mail and in 'MAIL FROM' for smtp mode -* Changed boundary setting to a place it will be set only once -* Removed transfer encoding for whole message when using multipart -* Message body now uses Encoding in multipart messages -* Can set encoding and type to attachments 7bit, 8bit -and binary attachment are sent as is, base64 are encoded -* Can set Encoding to base64 to send 8 bits body -through 7 bits servers - -Version 1.10 (Tue, Jun 12 2001) -* Fixed win32 mail header bug (printed out headers in message body) - -Version 1.09 (Fri, Jun 08 2001) -* Changed date header to work with Netscape mail programs -* Altered phpdoc documentation - -Version 1.08 (Tue, Jun 05 2001) -* Added enhanced error-checking -* Added phpdoc documentation to source - -Version 1.06 (Fri, Jun 01 2001) -* Added optional name for file attachments - -Version 1.05 (Tue, May 29 2001) -* Code cleanup -* Eliminated sendmail header warning message -* Fixed possible SMTP error - -Version 1.03 (Thu, May 24 2001) -* Fixed problem where qmail sends out duplicate messages - -Version 1.02 (Wed, May 23 2001) -* Added multiple recipient and attachment Clear* methods -* Added Sendmail public variable -* Fixed problem with loading SMTP library multiple times - -Version 0.98 (Tue, May 22 2001) -* Fixed problem with redundant mail hosts sending out multiple messages -* Added additional error handler code -* Added AddCustomHeader() function -* Added support for Microsoft mail client headers (affects priority) -* Fixed small bug with Mailer variable -* Added PrintVersion() function - -Version 0.92 (Tue, May 15 2001) -* Changed file names to class.phpmailer.php and class.smtp.php to match - current PHP class trend. -* Fixed problem where body not being printed when a message is attached -* Several small bug fixes - -Version 0.90 (Tue, April 17 2001) -* Intial public release +ChangeLog + +NOTE: THIS VERSION OF PHPMAILER IS DESIGNED FOR PHP5/PHP6. + IT WILL NOT WORK WITH PHP4. + +Version 5.1 (October 20, 2009) +* fixed filename issue with AddStringAttachment (thanks to Tony) +* fixed "SingleTo" property, now works with Senmail, Qmail, and SMTP in + addition to PHP mail() +* added DKIM digital signing functionality + New properties: + - DKIM_domain (sets the domain name) + - DKIM_private (holds DKIM private key) + - DKIM_passphrase (holds your DKIM passphrase) + - DKIM_selector (holds the DKIM "selector") + - DKIM_identity (holds the identifying email address) +* added callback function support + - callback function parameters include: + result, to, cc, bcc, subject and body + * see the test/test_callback.php file for usage. +* added "auto" identity functionality + - can automatically add: + - Return-path (if Sender not set) + - Reply-To (if ReplyTo not set) + - can be disabled: + - $mail->SetFrom('yourname@yourdomain.com','First Last',false); + - or by adding the $mail->Sender and/or $mail->ReplyTo properties + Note: "auto" identity added to help with emails ending up in spam + or junk boxes because of missing headers + +Version 5.0.2 (May 24, 2009) +* Fix for missing attachments when inline graphics are present +* Fix for missing Cc in header when using SMTP (mail was sent, + but not displayed in header -- Cc receiver only saw email To: + line and no Cc line, but did get the email (To receiver + saw same) + +Version 5.0.1 (April 05, 2009) +* Temporary fix for missing attachments + +Version 5.0.0 (April 02, 2009) + +* With the release of this version, we are initiating a new version numbering + system to differentiate from the PHP4 version of PHPMailer. +* Most notable in this release is fully object oriented code. +class.smtp.php: +* Refactored class.smtp.php to support new exception handling + code size reduced from 29.2 Kb to 25.6 Kb +* Removed unnecessary functions from class.smtp.php: + public function Expand($name) { + public function Help($keyword="") { + public function Noop() { + public function Send($from) { + public function SendOrMail($from) { + public function Verify($name) { +class.phpmailer.php: +* Refactored class.phpmailer.php with new exception handling +* Changed processing functionality of Sendmail and Qmail so they cannot be + inadvertently used +* removed getFile() function, just became a simple wrapper for + file_get_contents() +* added check for PHP version (will gracefully exit if not at least PHP 5.0) +class.phpmailer.php enhancements +* enhanced code to check if an attachment source is the same as an embedded or + inline graphic source to eliminate duplicate attachments +New /test_script +* We have written a test script you can use to test the script as part of your + installation. Once you press submit, the test script will send a multi-mime + email with either the message you type in or an HTML email with an inline + graphic. Two attachments are included in the email (one of the attachments + is also the inline graphic so you can see that only one copy of the graphic + is sent in the email). The test script will also display the functional + script that you can copy/paste to your editor to duplicate the functionality. +New examples +* All new examples in both basic and advanced modes. Advanced examples show + Exception handling. +PHPDocumentator (phpdocs) documentation for PHPMailer version 5.0.0 +* all new documentation + +Please note: the website has been updated to reflect the changes in PHPMailer +version 5.0.0. http://phpmailer.codeworxtech.com/ + +Version 2.3 (November 06, 2008) + +* added Arabic language (many thanks to Bahjat Al Mostafa) +* removed English language from language files and made it a default within + class.phpmailer.php - if no language is found, it will default to use + the english language translation +* fixed public/private declarations +* corrected line 1728, $basedir to $directory +* added $sign_cert_file to avoid improper duplicate use of $sign_key_file +* corrected $this->Hello on line 612 to $this->Helo +* changed default of $LE to "\r\n" to comply with RFC 2822. Can be set by the user + if default is not acceptable +* removed trim() from return results in EncodeQP +* /test and three files it contained are removed from version 2.3 +* fixed phpunit.php for compliance with PHP5 +* changed $this->AltBody = $textMsg; to $this->AltBody = html_entity_decode($textMsg); +* We have removed the /phpdoc from the downloads. All documentation is now on + the http://phpmailer.codeworxtech.com website. + +Version 2.2.1 () July 19 2008 + +* fixed line 1092 in class.smtp.php (my apologies, error on my part) + +Version 2.2 () July 15 2008 + +* Fixed redirect issue (display of UTF-8 in thank you redirect) +* fixed error in getResponse function declaration (class.pop3.php) +* PHPMailer now PHP6 compliant +* fixed line 1092 in class.smtp.php (endless loop from missing = sign) + +Version 2.1 (Wed, June 04 2008) + +** NOTE: WE HAVE A NEW LANGUAGE VARIABLE FOR DIGITALLY SIGNED S/MIME EMAILS. + IF YOU CAN HELP WITH LANGUAGES OTHER THAN ENGLISH AND SPANISH, IT WOULD BE + APPRECIATED. + +* added S/MIME functionality (ability to digitally sign emails) + BIG THANKS TO "sergiocambra" for posting this patch back in November 2007. + The "Signed Emails" functionality adds the Sign method to pass the private key + filename and the password to read it, and then email will be sent with + content-type multipart/signed and with the digital signature attached. +* fully compatible with E_STRICT error level + - Please note: + In about half the test environments this development version was subjected + to, an error was thrown for the date() functions used (line 1565 and 1569). + This is NOT a PHPMailer error, it is the result of an incorrectly configured + PHP5 installation. The fix is to modify your 'php.ini' file and include the + date.timezone = America/New York + directive, to your own server timezone + - If you do get this error, and are unable to access your php.ini file: + In your PHP script, add + date_default_timezone_set('America/Toronto'); + - do not try to use + $myVar = date_default_timezone_get(); + as a test, it will throw an error. +* added ability to define path (mainly for embedded images) + function MsgHTML($message,$basedir='') ... where: + $basedir is the fully qualified path +* fixed MsgHTML() function: + - Embedded Images where images are specified by :// will not be altered or embedded +* fixed the return value of SMTP exit code ( pclose ) +* addressed issue of multibyte characters in subject line and truncating +* added ability to have user specified Message ID + (default is still that PHPMailer create a unique Message ID) +* corrected unidentified message type to 'application/octet-stream' +* fixed chunk_split() multibyte issue (thanks to Colin Brown, et al). +* added check for added attachments +* enhanced conversion of HTML to text in MsgHTML (thanks to "brunny") + +Version 2.1.0beta2 (Sun, Dec 02 2007) +* implemented updated EncodeQP (thanks to coolbru, aka Marcus Bointon) +* finished all testing, all known bugs corrected, enhancements tested +- note: will NOT work with PHP4. + +please note, this is BETA software +** DO NOT USE THIS IN PRODUCTION OR LIVE PROJECTS +INTENDED STRICTLY FOR TESTING + +Version 2.1.0beta1 +please note, this is BETA software +** DO NOT USE THIS IN PRODUCTION OR LIVE PROJECTS +INTENDED STRICTLY FOR TESTING + +Version 2.0.0 rc2 (Fri, Nov 16 2007), interim release +* implements new property to control VERP in class.smtp.php + example (requires instantiating class.smtp.php): + $mail->do_verp = true; +* POP-before-SMTP functionality included, thanks to Richard Davey + (see class.pop3.php & pop3_before_smtp_test.php for examples) +* included example showing how to use PHPMailer with GMAIL +* fixed the missing Cc in SendMail() and Mail() + +****************** +A note on sending bulk emails: + +If the email you are sending is not personalized, consider using the +"undisclosed-recipient:;" strategy. That is, put all of your recipients +in the Bcc field and set the To field to "undisclosed-recipients:;". +It's a lot faster (only one send) and saves quite a bit on resources. +Contrary to some opinions, this will not get you listed in spam engines - +it's a legitimate way for you to send emails. + +A partial example for use with PHPMailer: + +$mail->AddAddress("undisclosed-recipients:;"); +$mail->AddBCC("email1@anydomain.com,email2@anyotherdomain.com,email3@anyalternatedomain.com"); + +Many email service providers restrict the number of emails that can be sent +in any given time period. Often that is between 50 - 60 emails maximum +per hour or per send session. + +If that's the case, then break up your Bcc lists into chunks that are one +less than your limit, and put a pause in your script. +******************* + +Version 2.0.0 rc1 (Thu, Nov 08 2007), interim release +* dramatically simplified using inline graphics ... it's fully automated and requires no user input +* added automatic document type detection for attachments and pictures +* added MsgHTML() function to replace Body tag for HTML emails +* fixed the SendMail security issues (input validation vulnerability) +* enhanced the AddAddresses functionality so that the "Name" portion is used in the email address +* removed the need to use the AltBody method (set from the HTML, or default text used) +* set the PHP Mail() function as the default (still support SendMail, SMTP Mail) +* removed the need to set the IsHTML property (set automatically) +* added Estonian language file by Indrek Päri +* added header injection patch +* added "set" method to permit users to create their own pseudo-properties like 'X-Headers', etc. + example of use: + $mail->set('X-Priority', '3'); + $mail->set('X-MSMail-Priority', 'Normal'); +* fixed warning message in SMTP get_lines method +* added TLS/SSL SMTP support + example of use: + $mail = new PHPMailer(); + $mail->Mailer = "smtp"; + $mail->Host = "smtp.example.com"; + $mail->SMTPSecure = "tls"; // option + //$mail->SMTPSecure = "ssl"; // option + ... + $mail->Send(); +* PHPMailer has been tested with PHP4 (4.4.7) and PHP5 (5.2.7) +* Works with PHP installed as a module or as CGI-PHP +- NOTE: will NOT work with PHP5 in E_STRICT error mode + +Version 1.73 (Sun, Jun 10 2005) +* Fixed denial of service bug: http://www.cybsec.com/vuln/PHPMailer-DOS.pdf +* Now has a total of 20 translations +* Fixed alt attachments bug: http://tinyurl.com/98u9k + +Version 1.72 (Wed, May 25 2004) +* Added Dutch, Swedish, Czech, Norwegian, and Turkish translations. +* Received: Removed this method because spam filter programs like +SpamAssassin reject this header. +* Fixed error count bug. +* SetLanguage default is now "language/". +* Fixed magic_quotes_runtime bug. + +Version 1.71 (Tue, Jul 28 2003) +* Made several speed enhancements +* Added German and Italian translation files +* Fixed HELO/AUTH bugs on keep-alive connects +* Now provides an error message if language file does not load +* Fixed attachment EOL bug +* Updated some unclear documentation +* Added additional tests and improved others + +Version 1.70 (Mon, Jun 20 2003) +* Added SMTP keep-alive support +* Added IsError method for error detection +* Added error message translation support (SetLanguage) +* Refactored many methods to increase library performance +* Hello now sends the newer EHLO message before HELO as per RFC 2821 +* Removed the boundary class and replaced it with GetBoundary +* Removed queue support methods +* New $Hostname variable +* New Message-ID header +* Received header reformat +* Helo variable default changed to $Hostname +* Removed extra spaces in Content-Type definition (#667182) +* Return-Path should be set to Sender when set +* Adds Q or B encoding to headers when necessary +* quoted-encoding should now encode NULs \000 +* Fixed encoding of body/AltBody (#553370) +* Adds "To: undisclosed-recipients:;" when all recipients are hidden (BCC) +* Multiple bug fixes + +Version 1.65 (Fri, Aug 09 2002) +* Fixed non-visible attachment bug (#585097) for Outlook +* SMTP connections are now closed after each transaction +* Fixed SMTP::Expand return value +* Converted SMTP class documentation to phpDocumentor format + +Version 1.62 (Wed, Jun 26 2002) +* Fixed multi-attach bug +* Set proper word wrapping +* Reduced memory use with attachments +* Added more debugging +* Changed documentation to phpDocumentor format + +Version 1.60 (Sat, Mar 30 2002) +* Sendmail pipe and address patch (Christian Holtje) +* Added embedded image and read confirmation support (A. Ognio) +* Added unit tests +* Added SMTP timeout support (*nix only) +* Added possibly temporary PluginDir variable for SMTP class +* Added LE message line ending variable +* Refactored boundary and attachment code +* Eliminated SMTP class warnings +* Added SendToQueue method for future queuing support + +Version 1.54 (Wed, Dec 19 2001) +* Add some queuing support code +* Fixed a pesky multi/alt bug +* Messages are no longer forced to have "To" addresses + +Version 1.50 (Thu, Nov 08 2001) +* Fix extra lines when not using SMTP mailer +* Set WordWrap variable to int with a zero default + +Version 1.47 (Tue, Oct 16 2001) +* Fixed Received header code format +* Fixed AltBody order error +* Fixed alternate port warning + +Version 1.45 (Tue, Sep 25 2001) +* Added enhanced SMTP debug support +* Added support for multiple ports on SMTP +* Added Received header for tracing +* Fixed AddStringAttachment encoding +* Fixed possible header name quote bug +* Fixed wordwrap() trim bug +* Couple other small bug fixes + +Version 1.41 (Wed, Aug 22 2001) +* Fixed AltBody bug w/o attachments +* Fixed rfc_date() for certain mail servers + +Version 1.40 (Sun, Aug 12 2001) +* Added multipart/alternative support (AltBody) +* Documentation update +* Fixed bug in Mercury MTA + +Version 1.29 (Fri, Aug 03 2001) +* Added AddStringAttachment() method +* Added SMTP authentication support + +Version 1.28 (Mon, Jul 30 2001) +* Fixed a typo in SMTP class +* Fixed header issue with Imail (win32) SMTP server +* Made fopen() calls for attachments use "rb" to fix win32 error + +Version 1.25 (Mon, Jul 02 2001) +* Added RFC 822 date fix (Patrice) +* Added improved error handling by adding a $ErrorInfo variable +* Removed MailerDebug variable (obsolete with new error handler) + +Version 1.20 (Mon, Jun 25 2001) +* Added quoted-printable encoding (Patrice) +* Set Version as public and removed PrintVersion() +* Changed phpdoc to only display public variables and methods + +Version 1.19 (Thu, Jun 21 2001) +* Fixed MS Mail header bug +* Added fix for Bcc problem with mail(). *Does not work on Win32* + (See PHP bug report: http://www.php.net/bugs.php?id=11616) +* mail() no longer passes a fifth parameter when not needed + +Version 1.15 (Fri, Jun 15 2001) +[Note: these changes contributed by Patrice Fournier] +* Changed all remaining \n to \r\n +* Bcc: header no longer writen to message except +when sent directly to sendmail +* Added a small message to non-MIME compliant mail reader +* Added Sender variable to change the Sender email +used in -f for sendmail/mail and in 'MAIL FROM' for smtp mode +* Changed boundary setting to a place it will be set only once +* Removed transfer encoding for whole message when using multipart +* Message body now uses Encoding in multipart messages +* Can set encoding and type to attachments 7bit, 8bit +and binary attachment are sent as is, base64 are encoded +* Can set Encoding to base64 to send 8 bits body +through 7 bits servers + +Version 1.10 (Tue, Jun 12 2001) +* Fixed win32 mail header bug (printed out headers in message body) + +Version 1.09 (Fri, Jun 08 2001) +* Changed date header to work with Netscape mail programs +* Altered phpdoc documentation + +Version 1.08 (Tue, Jun 05 2001) +* Added enhanced error-checking +* Added phpdoc documentation to source + +Version 1.06 (Fri, Jun 01 2001) +* Added optional name for file attachments + +Version 1.05 (Tue, May 29 2001) +* Code cleanup +* Eliminated sendmail header warning message +* Fixed possible SMTP error + +Version 1.03 (Thu, May 24 2001) +* Fixed problem where qmail sends out duplicate messages + +Version 1.02 (Wed, May 23 2001) +* Added multiple recipient and attachment Clear* methods +* Added Sendmail public variable +* Fixed problem with loading SMTP library multiple times + +Version 0.98 (Tue, May 22 2001) +* Fixed problem with redundant mail hosts sending out multiple messages +* Added additional error handler code +* Added AddCustomHeader() function +* Added support for Microsoft mail client headers (affects priority) +* Fixed small bug with Mailer variable +* Added PrintVersion() function + +Version 0.92 (Tue, May 15 2001) +* Changed file names to class.phpmailer.php and class.smtp.php to match + current PHP class trend. +* Fixed problem where body not being printed when a message is attached +* Several small bug fixes + +Version 0.90 (Tue, April 17 2001) +* Intial public release diff --git a/lib/phpmailer/class.smtp.php b/lib/phpmailer/class.smtp.php index 8c303eee3dc..6d3f24eff85 100644 --- a/lib/phpmailer/class.smtp.php +++ b/lib/phpmailer/class.smtp.php @@ -1,814 +1,814 @@ -smtp_conn = 0; - $this->error = null; - $this->helo_rply = null; - - $this->do_debug = 0; - } - - ///////////////////////////////////////////////// - // CONNECTION FUNCTIONS - ///////////////////////////////////////////////// - - /** - * Connect to the server specified on the port specified. - * If the port is not specified use the default SMTP_PORT. - * If tval is specified then a connection will try and be - * established with the server for that number of seconds. - * If tval is not specified the default is 30 seconds to - * try on the connection. - * - * SMTP CODE SUCCESS: 220 - * SMTP CODE FAILURE: 421 - * @access public - * @return bool - */ - public function Connect($host, $port = 0, $tval = 30) { - // set the error val to null so there is no confusion - $this->error = null; - - // make sure we are __not__ connected - if($this->connected()) { - // already connected, generate error - $this->error = array("error" => "Already connected to a server"); - return false; - } - - if(empty($port)) { - $port = $this->SMTP_PORT; - } - - // connect to the smtp server - $this->smtp_conn = @fsockopen($host, // the host of the server - $port, // the port to use - $errno, // error number if any - $errstr, // error message if any - $tval); // give up after ? secs - // verify we connected properly - if(empty($this->smtp_conn)) { - $this->error = array("error" => "Failed to connect to server", - "errno" => $errno, - "errstr" => $errstr); - if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . ": $errstr ($errno)" . $this->CRLF . '
    '; - } - return false; - } - - // SMTP server can take longer to respond, give longer timeout for first read - // Windows does not have support for this timeout function - if(substr(PHP_OS, 0, 3) != "WIN") - socket_set_timeout($this->smtp_conn, $tval, 0); - - // get any announcement - $announce = $this->get_lines(); - - if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $announce . $this->CRLF . '
    '; - } - - return true; - } - - /** - * Initiate a TLS communication with the server. - * - * SMTP CODE 220 Ready to start TLS - * SMTP CODE 501 Syntax error (no parameters allowed) - * SMTP CODE 454 TLS not available due to temporary reason - * @access public - * @return bool success - */ - public function StartTLS() { - $this->error = null; # to avoid confusion - - if(!$this->connected()) { - $this->error = array("error" => "Called StartTLS() without being connected"); - return false; - } - - fputs($this->smtp_conn,"STARTTLS" . $this->CRLF); - - $rply = $this->get_lines(); - $code = substr($rply,0,3); - - if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '
    '; - } - - if($code != 220) { - $this->error = - array("error" => "STARTTLS not accepted from server", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); - if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
    '; - } - return false; - } - - // Begin encrypted connection - if(!stream_socket_enable_crypto($this->smtp_conn, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) { - return false; - } - - return true; - } - - /** - * Performs SMTP authentication. Must be run after running the - * Hello() method. Returns true if successfully authenticated. - * @access public - * @return bool - */ - public function Authenticate($username, $password) { - // Start authentication - fputs($this->smtp_conn,"AUTH LOGIN" . $this->CRLF); - - $rply = $this->get_lines(); - $code = substr($rply,0,3); - - if($code != 334) { - $this->error = - array("error" => "AUTH not accepted from server", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); - if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
    '; - } - return false; - } - - // Send encoded username - fputs($this->smtp_conn, base64_encode($username) . $this->CRLF); - - $rply = $this->get_lines(); - $code = substr($rply,0,3); - - if($code != 334) { - $this->error = - array("error" => "Username not accepted from server", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); - if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
    '; - } - return false; - } - - // Send encoded password - fputs($this->smtp_conn, base64_encode($password) . $this->CRLF); - - $rply = $this->get_lines(); - $code = substr($rply,0,3); - - if($code != 235) { - $this->error = - array("error" => "Password not accepted from server", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); - if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
    '; - } - return false; - } - - return true; - } - - /** - * Returns true if connected to a server otherwise false - * @access public - * @return bool - */ - public function Connected() { - if(!empty($this->smtp_conn)) { - $sock_status = socket_get_status($this->smtp_conn); - if($sock_status["eof"]) { - // the socket is valid but we are not connected - if($this->do_debug >= 1) { - echo "SMTP -> NOTICE:" . $this->CRLF . "EOF caught while checking if connected"; - } - $this->Close(); - return false; - } - return true; // everything looks good - } - return false; - } - - /** - * Closes the socket and cleans up the state of the class. - * It is not considered good to use this function without - * first trying to use QUIT. - * @access public - * @return void - */ - public function Close() { - $this->error = null; // so there is no confusion - $this->helo_rply = null; - if(!empty($this->smtp_conn)) { - // close the connection and cleanup - fclose($this->smtp_conn); - $this->smtp_conn = 0; - } - } - - ///////////////////////////////////////////////// - // SMTP COMMANDS - ///////////////////////////////////////////////// - - /** - * Issues a data command and sends the msg_data to the server - * finializing the mail transaction. $msg_data is the message - * that is to be send with the headers. Each header needs to be - * on a single line followed by a with the message headers - * and the message body being seperated by and additional . - * - * Implements rfc 821: DATA - * - * SMTP CODE INTERMEDIATE: 354 - * [data] - * . - * SMTP CODE SUCCESS: 250 - * SMTP CODE FAILURE: 552,554,451,452 - * SMTP CODE FAILURE: 451,554 - * SMTP CODE ERROR : 500,501,503,421 - * @access public - * @return bool - */ - public function Data($msg_data) { - $this->error = null; // so no confusion is caused - - if(!$this->connected()) { - $this->error = array( - "error" => "Called Data() without being connected"); - return false; - } - - fputs($this->smtp_conn,"DATA" . $this->CRLF); - - $rply = $this->get_lines(); - $code = substr($rply,0,3); - - if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '
    '; - } - - if($code != 354) { - $this->error = - array("error" => "DATA command not accepted from server", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); - if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
    '; - } - return false; - } - - /* the server is ready to accept data! - * according to rfc 821 we should not send more than 1000 - * including the CRLF - * characters on a single line so we will break the data up - * into lines by \r and/or \n then if needed we will break - * each of those into smaller lines to fit within the limit. - * in addition we will be looking for lines that start with - * a period '.' and append and additional period '.' to that - * line. NOTE: this does not count towards limit. - */ - - // normalize the line breaks so we know the explode works - $msg_data = str_replace("\r\n","\n",$msg_data); - $msg_data = str_replace("\r","\n",$msg_data); - $lines = explode("\n",$msg_data); - - /* we need to find a good way to determine is headers are - * in the msg_data or if it is a straight msg body - * currently I am assuming rfc 822 definitions of msg headers - * and if the first field of the first line (':' sperated) - * does not contain a space then it _should_ be a header - * and we can process all lines before a blank "" line as - * headers. - */ - - $field = substr($lines[0],0,strpos($lines[0],":")); - $in_headers = false; - if(!empty($field) && !strstr($field," ")) { - $in_headers = true; - } - - $max_line_length = 998; // used below; set here for ease in change - - while(list(,$line) = @each($lines)) { - $lines_out = null; - if($line == "" && $in_headers) { - $in_headers = false; - } - // ok we need to break this line up into several smaller lines - while(strlen($line) > $max_line_length) { - $pos = strrpos(substr($line,0,$max_line_length)," "); - - // Patch to fix DOS attack - if(!$pos) { - $pos = $max_line_length - 1; - $lines_out[] = substr($line,0,$pos); - $line = substr($line,$pos); - } else { - $lines_out[] = substr($line,0,$pos); - $line = substr($line,$pos + 1); - } - - /* if processing headers add a LWSP-char to the front of new line - * rfc 822 on long msg headers - */ - if($in_headers) { - $line = "\t" . $line; - } - } - $lines_out[] = $line; - - // send the lines to the server - while(list(,$line_out) = @each($lines_out)) { - if(strlen($line_out) > 0) - { - if(substr($line_out, 0, 1) == ".") { - $line_out = "." . $line_out; - } - } - fputs($this->smtp_conn,$line_out . $this->CRLF); - } - } - - // message data has been sent - fputs($this->smtp_conn, $this->CRLF . "." . $this->CRLF); - - $rply = $this->get_lines(); - $code = substr($rply,0,3); - - if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '
    '; - } - - if($code != 250) { - $this->error = - array("error" => "DATA not accepted from server", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); - if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
    '; - } - return false; - } - return true; - } - - /** - * Sends the HELO command to the smtp server. - * This makes sure that we and the server are in - * the same known state. - * - * Implements from rfc 821: HELO - * - * SMTP CODE SUCCESS: 250 - * SMTP CODE ERROR : 500, 501, 504, 421 - * @access public - * @return bool - */ - public function Hello($host = '') { - $this->error = null; // so no confusion is caused - - if(!$this->connected()) { - $this->error = array( - "error" => "Called Hello() without being connected"); - return false; - } - - // if hostname for HELO was not specified send default - if(empty($host)) { - // determine appropriate default to send to server - $host = "localhost"; - } - - // Send extended hello first (RFC 2821) - if(!$this->SendHello("EHLO", $host)) { - if(!$this->SendHello("HELO", $host)) { - return false; - } - } - - return true; - } - - /** - * Sends a HELO/EHLO command. - * @access private - * @return bool - */ - private function SendHello($hello, $host) { - fputs($this->smtp_conn, $hello . " " . $host . $this->CRLF); - - $rply = $this->get_lines(); - $code = substr($rply,0,3); - - if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER: " . $rply . $this->CRLF . '
    '; - } - - if($code != 250) { - $this->error = - array("error" => $hello . " not accepted from server", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); - if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
    '; - } - return false; - } - - $this->helo_rply = $rply; - - return true; - } - - /** - * Starts a mail transaction from the email address specified in - * $from. Returns true if successful or false otherwise. If True - * the mail transaction is started and then one or more Recipient - * commands may be called followed by a Data command. - * - * Implements rfc 821: MAIL FROM: - * - * SMTP CODE SUCCESS: 250 - * SMTP CODE SUCCESS: 552,451,452 - * SMTP CODE SUCCESS: 500,501,421 - * @access public - * @return bool - */ - public function Mail($from) { - $this->error = null; // so no confusion is caused - - if(!$this->connected()) { - $this->error = array( - "error" => "Called Mail() without being connected"); - return false; - } - - $useVerp = ($this->do_verp ? "XVERP" : ""); - fputs($this->smtp_conn,"MAIL FROM:<" . $from . ">" . $useVerp . $this->CRLF); - - $rply = $this->get_lines(); - $code = substr($rply,0,3); - - if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '
    '; - } - - if($code != 250) { - $this->error = - array("error" => "MAIL not accepted from server", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); - if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
    '; - } - return false; - } - return true; - } - - /** - * Sends the quit command to the server and then closes the socket - * if there is no error or the $close_on_error argument is true. - * - * Implements from rfc 821: QUIT - * - * SMTP CODE SUCCESS: 221 - * SMTP CODE ERROR : 500 - * @access public - * @return bool - */ - public function Quit($close_on_error = true) { - $this->error = null; // so there is no confusion - - if(!$this->connected()) { - $this->error = array( - "error" => "Called Quit() without being connected"); - return false; - } - - // send the quit command to the server - fputs($this->smtp_conn,"quit" . $this->CRLF); - - // get any good-bye messages - $byemsg = $this->get_lines(); - - if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $byemsg . $this->CRLF . '
    '; - } - - $rval = true; - $e = null; - - $code = substr($byemsg,0,3); - if($code != 221) { - // use e as a tmp var cause Close will overwrite $this->error - $e = array("error" => "SMTP server rejected quit command", - "smtp_code" => $code, - "smtp_rply" => substr($byemsg,4)); - $rval = false; - if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $e["error"] . ": " . $byemsg . $this->CRLF . '
    '; - } - } - - if(empty($e) || $close_on_error) { - $this->Close(); - } - - return $rval; - } - - /** - * Sends the command RCPT to the SMTP server with the TO: argument of $to. - * Returns true if the recipient was accepted false if it was rejected. - * - * Implements from rfc 821: RCPT TO: - * - * SMTP CODE SUCCESS: 250,251 - * SMTP CODE FAILURE: 550,551,552,553,450,451,452 - * SMTP CODE ERROR : 500,501,503,421 - * @access public - * @return bool - */ - public function Recipient($to) { - $this->error = null; // so no confusion is caused - - if(!$this->connected()) { - $this->error = array( - "error" => "Called Recipient() without being connected"); - return false; - } - - fputs($this->smtp_conn,"RCPT TO:<" . $to . ">" . $this->CRLF); - - $rply = $this->get_lines(); - $code = substr($rply,0,3); - - if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '
    '; - } - - if($code != 250 && $code != 251) { - $this->error = - array("error" => "RCPT not accepted from server", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); - if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
    '; - } - return false; - } - return true; - } - - /** - * Sends the RSET command to abort and transaction that is - * currently in progress. Returns true if successful false - * otherwise. - * - * Implements rfc 821: RSET - * - * SMTP CODE SUCCESS: 250 - * SMTP CODE ERROR : 500,501,504,421 - * @access public - * @return bool - */ - public function Reset() { - $this->error = null; // so no confusion is caused - - if(!$this->connected()) { - $this->error = array( - "error" => "Called Reset() without being connected"); - return false; - } - - fputs($this->smtp_conn,"RSET" . $this->CRLF); - - $rply = $this->get_lines(); - $code = substr($rply,0,3); - - if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '
    '; - } - - if($code != 250) { - $this->error = - array("error" => "RSET failed", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); - if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
    '; - } - return false; - } - - return true; - } - - /** - * Starts a mail transaction from the email address specified in - * $from. Returns true if successful or false otherwise. If True - * the mail transaction is started and then one or more Recipient - * commands may be called followed by a Data command. This command - * will send the message to the users terminal if they are logged - * in and send them an email. - * - * Implements rfc 821: SAML FROM: - * - * SMTP CODE SUCCESS: 250 - * SMTP CODE SUCCESS: 552,451,452 - * SMTP CODE SUCCESS: 500,501,502,421 - * @access public - * @return bool - */ - public function SendAndMail($from) { - $this->error = null; // so no confusion is caused - - if(!$this->connected()) { - $this->error = array( - "error" => "Called SendAndMail() without being connected"); - return false; - } - - fputs($this->smtp_conn,"SAML FROM:" . $from . $this->CRLF); - - $rply = $this->get_lines(); - $code = substr($rply,0,3); - - if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '
    '; - } - - if($code != 250) { - $this->error = - array("error" => "SAML not accepted from server", - "smtp_code" => $code, - "smtp_msg" => substr($rply,4)); - if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
    '; - } - return false; - } - return true; - } - - /** - * This is an optional command for SMTP that this class does not - * support. This method is here to make the RFC821 Definition - * complete for this class and __may__ be implimented in the future - * - * Implements from rfc 821: TURN - * - * SMTP CODE SUCCESS: 250 - * SMTP CODE FAILURE: 502 - * SMTP CODE ERROR : 500, 503 - * @access public - * @return bool - */ - public function Turn() { - $this->error = array("error" => "This method, TURN, of the SMTP ". - "is not implemented"); - if($this->do_debug >= 1) { - echo "SMTP -> NOTICE: " . $this->error["error"] . $this->CRLF . '
    '; - } - return false; - } - - /** - * Get the current error - * @access public - * @return array - */ - public function getError() { - return $this->error; - } - - ///////////////////////////////////////////////// - // INTERNAL FUNCTIONS - ///////////////////////////////////////////////// - - /** - * Read in as many lines as possible - * either before eof or socket timeout occurs on the operation. - * With SMTP we can tell if we have more lines to read if the - * 4th character is '-' symbol. If it is a space then we don't - * need to read anything else. - * @access private - * @return string - */ - private function get_lines() { - $data = ""; - while($str = @fgets($this->smtp_conn,515)) { - if($this->do_debug >= 4) { - echo "SMTP -> get_lines(): \$data was \"$data\"" . $this->CRLF . '
    '; - echo "SMTP -> get_lines(): \$str is \"$str\"" . $this->CRLF . '
    '; - } - $data .= $str; - if($this->do_debug >= 4) { - echo "SMTP -> get_lines(): \$data is \"$data\"" . $this->CRLF . '
    '; - } - // if 4th character is a space, we are done reading, break the loop - if(substr($str,3,1) == " ") { break; } - } - return $data; - } - -} - +smtp_conn = 0; + $this->error = null; + $this->helo_rply = null; + + $this->do_debug = 0; + } + + ///////////////////////////////////////////////// + // CONNECTION FUNCTIONS + ///////////////////////////////////////////////// + + /** + * Connect to the server specified on the port specified. + * If the port is not specified use the default SMTP_PORT. + * If tval is specified then a connection will try and be + * established with the server for that number of seconds. + * If tval is not specified the default is 30 seconds to + * try on the connection. + * + * SMTP CODE SUCCESS: 220 + * SMTP CODE FAILURE: 421 + * @access public + * @return bool + */ + public function Connect($host, $port = 0, $tval = 30) { + // set the error val to null so there is no confusion + $this->error = null; + + // make sure we are __not__ connected + if($this->connected()) { + // already connected, generate error + $this->error = array("error" => "Already connected to a server"); + return false; + } + + if(empty($port)) { + $port = $this->SMTP_PORT; + } + + // connect to the smtp server + $this->smtp_conn = @fsockopen($host, // the host of the server + $port, // the port to use + $errno, // error number if any + $errstr, // error message if any + $tval); // give up after ? secs + // verify we connected properly + if(empty($this->smtp_conn)) { + $this->error = array("error" => "Failed to connect to server", + "errno" => $errno, + "errstr" => $errstr); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . ": $errstr ($errno)" . $this->CRLF . '
    '; + } + return false; + } + + // SMTP server can take longer to respond, give longer timeout for first read + // Windows does not have support for this timeout function + if(substr(PHP_OS, 0, 3) != "WIN") + socket_set_timeout($this->smtp_conn, $tval, 0); + + // get any announcement + $announce = $this->get_lines(); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $announce . $this->CRLF . '
    '; + } + + return true; + } + + /** + * Initiate a TLS communication with the server. + * + * SMTP CODE 220 Ready to start TLS + * SMTP CODE 501 Syntax error (no parameters allowed) + * SMTP CODE 454 TLS not available due to temporary reason + * @access public + * @return bool success + */ + public function StartTLS() { + $this->error = null; # to avoid confusion + + if(!$this->connected()) { + $this->error = array("error" => "Called StartTLS() without being connected"); + return false; + } + + fputs($this->smtp_conn,"STARTTLS" . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '
    '; + } + + if($code != 220) { + $this->error = + array("error" => "STARTTLS not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
    '; + } + return false; + } + + // Begin encrypted connection + if(!stream_socket_enable_crypto($this->smtp_conn, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) { + return false; + } + + return true; + } + + /** + * Performs SMTP authentication. Must be run after running the + * Hello() method. Returns true if successfully authenticated. + * @access public + * @return bool + */ + public function Authenticate($username, $password) { + // Start authentication + fputs($this->smtp_conn,"AUTH LOGIN" . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($code != 334) { + $this->error = + array("error" => "AUTH not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
    '; + } + return false; + } + + // Send encoded username + fputs($this->smtp_conn, base64_encode($username) . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($code != 334) { + $this->error = + array("error" => "Username not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
    '; + } + return false; + } + + // Send encoded password + fputs($this->smtp_conn, base64_encode($password) . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($code != 235) { + $this->error = + array("error" => "Password not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
    '; + } + return false; + } + + return true; + } + + /** + * Returns true if connected to a server otherwise false + * @access public + * @return bool + */ + public function Connected() { + if(!empty($this->smtp_conn)) { + $sock_status = socket_get_status($this->smtp_conn); + if($sock_status["eof"]) { + // the socket is valid but we are not connected + if($this->do_debug >= 1) { + echo "SMTP -> NOTICE:" . $this->CRLF . "EOF caught while checking if connected"; + } + $this->Close(); + return false; + } + return true; // everything looks good + } + return false; + } + + /** + * Closes the socket and cleans up the state of the class. + * It is not considered good to use this function without + * first trying to use QUIT. + * @access public + * @return void + */ + public function Close() { + $this->error = null; // so there is no confusion + $this->helo_rply = null; + if(!empty($this->smtp_conn)) { + // close the connection and cleanup + fclose($this->smtp_conn); + $this->smtp_conn = 0; + } + } + + ///////////////////////////////////////////////// + // SMTP COMMANDS + ///////////////////////////////////////////////// + + /** + * Issues a data command and sends the msg_data to the server + * finializing the mail transaction. $msg_data is the message + * that is to be send with the headers. Each header needs to be + * on a single line followed by a with the message headers + * and the message body being seperated by and additional . + * + * Implements rfc 821: DATA + * + * SMTP CODE INTERMEDIATE: 354 + * [data] + * . + * SMTP CODE SUCCESS: 250 + * SMTP CODE FAILURE: 552,554,451,452 + * SMTP CODE FAILURE: 451,554 + * SMTP CODE ERROR : 500,501,503,421 + * @access public + * @return bool + */ + public function Data($msg_data) { + $this->error = null; // so no confusion is caused + + if(!$this->connected()) { + $this->error = array( + "error" => "Called Data() without being connected"); + return false; + } + + fputs($this->smtp_conn,"DATA" . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '
    '; + } + + if($code != 354) { + $this->error = + array("error" => "DATA command not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
    '; + } + return false; + } + + /* the server is ready to accept data! + * according to rfc 821 we should not send more than 1000 + * including the CRLF + * characters on a single line so we will break the data up + * into lines by \r and/or \n then if needed we will break + * each of those into smaller lines to fit within the limit. + * in addition we will be looking for lines that start with + * a period '.' and append and additional period '.' to that + * line. NOTE: this does not count towards limit. + */ + + // normalize the line breaks so we know the explode works + $msg_data = str_replace("\r\n","\n",$msg_data); + $msg_data = str_replace("\r","\n",$msg_data); + $lines = explode("\n",$msg_data); + + /* we need to find a good way to determine is headers are + * in the msg_data or if it is a straight msg body + * currently I am assuming rfc 822 definitions of msg headers + * and if the first field of the first line (':' sperated) + * does not contain a space then it _should_ be a header + * and we can process all lines before a blank "" line as + * headers. + */ + + $field = substr($lines[0],0,strpos($lines[0],":")); + $in_headers = false; + if(!empty($field) && !strstr($field," ")) { + $in_headers = true; + } + + $max_line_length = 998; // used below; set here for ease in change + + while(list(,$line) = @each($lines)) { + $lines_out = null; + if($line == "" && $in_headers) { + $in_headers = false; + } + // ok we need to break this line up into several smaller lines + while(strlen($line) > $max_line_length) { + $pos = strrpos(substr($line,0,$max_line_length)," "); + + // Patch to fix DOS attack + if(!$pos) { + $pos = $max_line_length - 1; + $lines_out[] = substr($line,0,$pos); + $line = substr($line,$pos); + } else { + $lines_out[] = substr($line,0,$pos); + $line = substr($line,$pos + 1); + } + + /* if processing headers add a LWSP-char to the front of new line + * rfc 822 on long msg headers + */ + if($in_headers) { + $line = "\t" . $line; + } + } + $lines_out[] = $line; + + // send the lines to the server + while(list(,$line_out) = @each($lines_out)) { + if(strlen($line_out) > 0) + { + if(substr($line_out, 0, 1) == ".") { + $line_out = "." . $line_out; + } + } + fputs($this->smtp_conn,$line_out . $this->CRLF); + } + } + + // message data has been sent + fputs($this->smtp_conn, $this->CRLF . "." . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '
    '; + } + + if($code != 250) { + $this->error = + array("error" => "DATA not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
    '; + } + return false; + } + return true; + } + + /** + * Sends the HELO command to the smtp server. + * This makes sure that we and the server are in + * the same known state. + * + * Implements from rfc 821: HELO + * + * SMTP CODE SUCCESS: 250 + * SMTP CODE ERROR : 500, 501, 504, 421 + * @access public + * @return bool + */ + public function Hello($host = '') { + $this->error = null; // so no confusion is caused + + if(!$this->connected()) { + $this->error = array( + "error" => "Called Hello() without being connected"); + return false; + } + + // if hostname for HELO was not specified send default + if(empty($host)) { + // determine appropriate default to send to server + $host = "localhost"; + } + + // Send extended hello first (RFC 2821) + if(!$this->SendHello("EHLO", $host)) { + if(!$this->SendHello("HELO", $host)) { + return false; + } + } + + return true; + } + + /** + * Sends a HELO/EHLO command. + * @access private + * @return bool + */ + private function SendHello($hello, $host) { + fputs($this->smtp_conn, $hello . " " . $host . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER: " . $rply . $this->CRLF . '
    '; + } + + if($code != 250) { + $this->error = + array("error" => $hello . " not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
    '; + } + return false; + } + + $this->helo_rply = $rply; + + return true; + } + + /** + * Starts a mail transaction from the email address specified in + * $from. Returns true if successful or false otherwise. If True + * the mail transaction is started and then one or more Recipient + * commands may be called followed by a Data command. + * + * Implements rfc 821: MAIL FROM: + * + * SMTP CODE SUCCESS: 250 + * SMTP CODE SUCCESS: 552,451,452 + * SMTP CODE SUCCESS: 500,501,421 + * @access public + * @return bool + */ + public function Mail($from) { + $this->error = null; // so no confusion is caused + + if(!$this->connected()) { + $this->error = array( + "error" => "Called Mail() without being connected"); + return false; + } + + $useVerp = ($this->do_verp ? "XVERP" : ""); + fputs($this->smtp_conn,"MAIL FROM:<" . $from . ">" . $useVerp . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '
    '; + } + + if($code != 250) { + $this->error = + array("error" => "MAIL not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
    '; + } + return false; + } + return true; + } + + /** + * Sends the quit command to the server and then closes the socket + * if there is no error or the $close_on_error argument is true. + * + * Implements from rfc 821: QUIT + * + * SMTP CODE SUCCESS: 221 + * SMTP CODE ERROR : 500 + * @access public + * @return bool + */ + public function Quit($close_on_error = true) { + $this->error = null; // so there is no confusion + + if(!$this->connected()) { + $this->error = array( + "error" => "Called Quit() without being connected"); + return false; + } + + // send the quit command to the server + fputs($this->smtp_conn,"quit" . $this->CRLF); + + // get any good-bye messages + $byemsg = $this->get_lines(); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $byemsg . $this->CRLF . '
    '; + } + + $rval = true; + $e = null; + + $code = substr($byemsg,0,3); + if($code != 221) { + // use e as a tmp var cause Close will overwrite $this->error + $e = array("error" => "SMTP server rejected quit command", + "smtp_code" => $code, + "smtp_rply" => substr($byemsg,4)); + $rval = false; + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $e["error"] . ": " . $byemsg . $this->CRLF . '
    '; + } + } + + if(empty($e) || $close_on_error) { + $this->Close(); + } + + return $rval; + } + + /** + * Sends the command RCPT to the SMTP server with the TO: argument of $to. + * Returns true if the recipient was accepted false if it was rejected. + * + * Implements from rfc 821: RCPT TO: + * + * SMTP CODE SUCCESS: 250,251 + * SMTP CODE FAILURE: 550,551,552,553,450,451,452 + * SMTP CODE ERROR : 500,501,503,421 + * @access public + * @return bool + */ + public function Recipient($to) { + $this->error = null; // so no confusion is caused + + if(!$this->connected()) { + $this->error = array( + "error" => "Called Recipient() without being connected"); + return false; + } + + fputs($this->smtp_conn,"RCPT TO:<" . $to . ">" . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '
    '; + } + + if($code != 250 && $code != 251) { + $this->error = + array("error" => "RCPT not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
    '; + } + return false; + } + return true; + } + + /** + * Sends the RSET command to abort and transaction that is + * currently in progress. Returns true if successful false + * otherwise. + * + * Implements rfc 821: RSET + * + * SMTP CODE SUCCESS: 250 + * SMTP CODE ERROR : 500,501,504,421 + * @access public + * @return bool + */ + public function Reset() { + $this->error = null; // so no confusion is caused + + if(!$this->connected()) { + $this->error = array( + "error" => "Called Reset() without being connected"); + return false; + } + + fputs($this->smtp_conn,"RSET" . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '
    '; + } + + if($code != 250) { + $this->error = + array("error" => "RSET failed", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
    '; + } + return false; + } + + return true; + } + + /** + * Starts a mail transaction from the email address specified in + * $from. Returns true if successful or false otherwise. If True + * the mail transaction is started and then one or more Recipient + * commands may be called followed by a Data command. This command + * will send the message to the users terminal if they are logged + * in and send them an email. + * + * Implements rfc 821: SAML FROM: + * + * SMTP CODE SUCCESS: 250 + * SMTP CODE SUCCESS: 552,451,452 + * SMTP CODE SUCCESS: 500,501,502,421 + * @access public + * @return bool + */ + public function SendAndMail($from) { + $this->error = null; // so no confusion is caused + + if(!$this->connected()) { + $this->error = array( + "error" => "Called SendAndMail() without being connected"); + return false; + } + + fputs($this->smtp_conn,"SAML FROM:" . $from . $this->CRLF); + + $rply = $this->get_lines(); + $code = substr($rply,0,3); + + if($this->do_debug >= 2) { + echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '
    '; + } + + if($code != 250) { + $this->error = + array("error" => "SAML not accepted from server", + "smtp_code" => $code, + "smtp_msg" => substr($rply,4)); + if($this->do_debug >= 1) { + echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '
    '; + } + return false; + } + return true; + } + + /** + * This is an optional command for SMTP that this class does not + * support. This method is here to make the RFC821 Definition + * complete for this class and __may__ be implimented in the future + * + * Implements from rfc 821: TURN + * + * SMTP CODE SUCCESS: 250 + * SMTP CODE FAILURE: 502 + * SMTP CODE ERROR : 500, 503 + * @access public + * @return bool + */ + public function Turn() { + $this->error = array("error" => "This method, TURN, of the SMTP ". + "is not implemented"); + if($this->do_debug >= 1) { + echo "SMTP -> NOTICE: " . $this->error["error"] . $this->CRLF . '
    '; + } + return false; + } + + /** + * Get the current error + * @access public + * @return array + */ + public function getError() { + return $this->error; + } + + ///////////////////////////////////////////////// + // INTERNAL FUNCTIONS + ///////////////////////////////////////////////// + + /** + * Read in as many lines as possible + * either before eof or socket timeout occurs on the operation. + * With SMTP we can tell if we have more lines to read if the + * 4th character is '-' symbol. If it is a space then we don't + * need to read anything else. + * @access private + * @return string + */ + private function get_lines() { + $data = ""; + while($str = @fgets($this->smtp_conn,515)) { + if($this->do_debug >= 4) { + echo "SMTP -> get_lines(): \$data was \"$data\"" . $this->CRLF . '
    '; + echo "SMTP -> get_lines(): \$str is \"$str\"" . $this->CRLF . '
    '; + } + $data .= $str; + if($this->do_debug >= 4) { + echo "SMTP -> get_lines(): \$data is \"$data\"" . $this->CRLF . '
    '; + } + // if 4th character is a space, we are done reading, break the loop + if(substr($str,3,1) == " ") { break; } + } + return $data; + } + +} + ?> \ No newline at end of file diff --git a/lib/phpmailer/language/phpmailer.lang-br.php b/lib/phpmailer/language/phpmailer.lang-br.php index 7d64ce4d4cb..6afe60b18cd 100644 --- a/lib/phpmailer/language/phpmailer.lang-br.php +++ b/lib/phpmailer/language/phpmailer.lang-br.php @@ -1,26 +1,26 @@ - \ No newline at end of file diff --git a/lib/phpmailer/language/phpmailer.lang-ca.php b/lib/phpmailer/language/phpmailer.lang-ca.php index 1127567dc82..4a160a21ebe 100644 --- a/lib/phpmailer/language/phpmailer.lang-ca.php +++ b/lib/phpmailer/language/phpmailer.lang-ca.php @@ -1,26 +1,26 @@ - \ No newline at end of file diff --git a/lib/phpmailer/language/phpmailer.lang-cz.php b/lib/phpmailer/language/phpmailer.lang-cz.php index f9589ca19d6..1c8b2063926 100755 --- a/lib/phpmailer/language/phpmailer.lang-cz.php +++ b/lib/phpmailer/language/phpmailer.lang-cz.php @@ -1,25 +1,25 @@ - \ No newline at end of file diff --git a/lib/phpmailer/language/phpmailer.lang-de.php b/lib/phpmailer/language/phpmailer.lang-de.php index 165a86f4f71..b2a76ce1b55 100755 --- a/lib/phpmailer/language/phpmailer.lang-de.php +++ b/lib/phpmailer/language/phpmailer.lang-de.php @@ -1,25 +1,25 @@ - \ No newline at end of file diff --git a/lib/phpmailer/language/phpmailer.lang-dk.php b/lib/phpmailer/language/phpmailer.lang-dk.php index 59b58c0fcec..b26257316b1 100644 --- a/lib/phpmailer/language/phpmailer.lang-dk.php +++ b/lib/phpmailer/language/phpmailer.lang-dk.php @@ -1,26 +1,26 @@ - -*/ - -$PHPMAILER_LANG['authenticate'] = 'SMTP fejl: Kunne ikke logge på.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP fejl: Kunne ikke tilslutte SMTP serveren.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fejl: Data kunne ikke accepteres.'; -//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; -$PHPMAILER_LANG['encoding'] = 'Ukendt encode-format: '; -$PHPMAILER_LANG['execute'] = 'Kunne ikke køre: '; -$PHPMAILER_LANG['file_access'] = 'Ingen adgang til fil: '; -$PHPMAILER_LANG['file_open'] = 'Fil fejl: Kunne ikke åbne filen: '; -$PHPMAILER_LANG['from_failed'] = 'Følgende afsenderadresse er forkert: '; -$PHPMAILER_LANG['instantiate'] = 'Kunne ikke initialisere email funktionen.'; -//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer understøttes ikke.'; -$PHPMAILER_LANG['provide_address'] = 'Du skal indtaste mindst en modtagers emailadresse.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP fejl: Følgende modtagere er forkerte: '; -//$PHPMAILER_LANG['signing'] = 'Signing Error: '; -//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; -//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; -//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; + +*/ + +$PHPMAILER_LANG['authenticate'] = 'SMTP fejl: Kunne ikke logge på.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP fejl: Kunne ikke tilslutte SMTP serveren.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fejl: Data kunne ikke accepteres.'; +//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['encoding'] = 'Ukendt encode-format: '; +$PHPMAILER_LANG['execute'] = 'Kunne ikke køre: '; +$PHPMAILER_LANG['file_access'] = 'Ingen adgang til fil: '; +$PHPMAILER_LANG['file_open'] = 'Fil fejl: Kunne ikke åbne filen: '; +$PHPMAILER_LANG['from_failed'] = 'Følgende afsenderadresse er forkert: '; +$PHPMAILER_LANG['instantiate'] = 'Kunne ikke initialisere email funktionen.'; +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer understøttes ikke.'; +$PHPMAILER_LANG['provide_address'] = 'Du skal indtaste mindst en modtagers emailadresse.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP fejl: Følgende modtagere er forkerte: '; +//$PHPMAILER_LANG['signing'] = 'Signing Error: '; +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; ?> \ No newline at end of file diff --git a/lib/phpmailer/language/phpmailer.lang-es.php b/lib/phpmailer/language/phpmailer.lang-es.php index 0b6982509c5..69b6817482b 100755 --- a/lib/phpmailer/language/phpmailer.lang-es.php +++ b/lib/phpmailer/language/phpmailer.lang-es.php @@ -1,26 +1,26 @@ - \ No newline at end of file diff --git a/lib/phpmailer/language/phpmailer.lang-fi.php b/lib/phpmailer/language/phpmailer.lang-fi.php index 6d7dccee519..12a845aad6b 100644 --- a/lib/phpmailer/language/phpmailer.lang-fi.php +++ b/lib/phpmailer/language/phpmailer.lang-fi.php @@ -1,27 +1,27 @@ - \ No newline at end of file diff --git a/lib/phpmailer/language/phpmailer.lang-fo.php b/lib/phpmailer/language/phpmailer.lang-fo.php index 704c4772da7..6bd9b0a213d 100644 --- a/lib/phpmailer/language/phpmailer.lang-fo.php +++ b/lib/phpmailer/language/phpmailer.lang-fo.php @@ -1,27 +1,27 @@ - \ No newline at end of file diff --git a/lib/phpmailer/language/phpmailer.lang-fr.php b/lib/phpmailer/language/phpmailer.lang-fr.php index 52e9ae2b998..c99ac3caf92 100755 --- a/lib/phpmailer/language/phpmailer.lang-fr.php +++ b/lib/phpmailer/language/phpmailer.lang-fr.php @@ -1,25 +1,25 @@ - \ No newline at end of file diff --git a/lib/phpmailer/language/phpmailer.lang-hu.php b/lib/phpmailer/language/phpmailer.lang-hu.php index a26648484b4..caca0b50f14 100644 --- a/lib/phpmailer/language/phpmailer.lang-hu.php +++ b/lib/phpmailer/language/phpmailer.lang-hu.php @@ -1,25 +1,25 @@ - \ No newline at end of file diff --git a/lib/phpmailer/language/phpmailer.lang-it.php b/lib/phpmailer/language/phpmailer.lang-it.php index 59bf4fb9785..fc1fcb8d2ec 100755 --- a/lib/phpmailer/language/phpmailer.lang-it.php +++ b/lib/phpmailer/language/phpmailer.lang-it.php @@ -1,27 +1,27 @@ - -*/ - -$PHPMAILER_LANG['authenticate'] = 'SMTP Error: Impossibile autenticarsi.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Impossibile connettersi all\'host SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Data non accettati dal server.'; -//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; -$PHPMAILER_LANG['encoding'] = 'Encoding set dei caratteri sconosciuto: '; -$PHPMAILER_LANG['execute'] = 'Impossibile eseguire l\'operazione: '; -$PHPMAILER_LANG['file_access'] = 'Impossibile accedere al file: '; -$PHPMAILER_LANG['file_open'] = 'File Error: Impossibile aprire il file: '; -$PHPMAILER_LANG['from_failed'] = 'I seguenti indirizzi mittenti hanno generato errore: '; -$PHPMAILER_LANG['instantiate'] = 'Impossibile istanziare la funzione mail'; -//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; -$PHPMAILER_LANG['provide_address'] = 'Deve essere fornito almeno un indirizzo ricevente'; -$PHPMAILER_LANG['mailer_not_supported'] = 'Mailer non supportato'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: I seguenti indirizzi destinatari hanno generato errore: '; -//$PHPMAILER_LANG['signing'] = 'Signing Error: '; -//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; -//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; -//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; + +*/ + +$PHPMAILER_LANG['authenticate'] = 'SMTP Error: Impossibile autenticarsi.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Impossibile connettersi all\'host SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Data non accettati dal server.'; +//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['encoding'] = 'Encoding set dei caratteri sconosciuto: '; +$PHPMAILER_LANG['execute'] = 'Impossibile eseguire l\'operazione: '; +$PHPMAILER_LANG['file_access'] = 'Impossibile accedere al file: '; +$PHPMAILER_LANG['file_open'] = 'File Error: Impossibile aprire il file: '; +$PHPMAILER_LANG['from_failed'] = 'I seguenti indirizzi mittenti hanno generato errore: '; +$PHPMAILER_LANG['instantiate'] = 'Impossibile istanziare la funzione mail'; +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; +$PHPMAILER_LANG['provide_address'] = 'Deve essere fornito almeno un indirizzo ricevente'; +$PHPMAILER_LANG['mailer_not_supported'] = 'Mailer non supportato'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: I seguenti indirizzi destinatari hanno generato errore: '; +//$PHPMAILER_LANG['signing'] = 'Signing Error: '; +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; ?> \ No newline at end of file diff --git a/lib/phpmailer/language/phpmailer.lang-ja.php b/lib/phpmailer/language/phpmailer.lang-ja.php index 66da1b6a1d6..63cfb23b6af 100644 --- a/lib/phpmailer/language/phpmailer.lang-ja.php +++ b/lib/phpmailer/language/phpmailer.lang-ja.php @@ -1,26 +1,26 @@ - \ No newline at end of file diff --git a/lib/phpmailer/language/phpmailer.lang-nl.php b/lib/phpmailer/language/phpmailer.lang-nl.php index 355dcdc4994..d2c380b09d3 100755 --- a/lib/phpmailer/language/phpmailer.lang-nl.php +++ b/lib/phpmailer/language/phpmailer.lang-nl.php @@ -1,25 +1,25 @@ - \ No newline at end of file diff --git a/lib/phpmailer/language/phpmailer.lang-no.php b/lib/phpmailer/language/phpmailer.lang-no.php index bf2f84ee9bf..65cb884399c 100755 --- a/lib/phpmailer/language/phpmailer.lang-no.php +++ b/lib/phpmailer/language/phpmailer.lang-no.php @@ -1,25 +1,25 @@ - \ No newline at end of file diff --git a/lib/phpmailer/language/phpmailer.lang-pl.php b/lib/phpmailer/language/phpmailer.lang-pl.php index e8bd5124d7d..f4fd801d616 100644 --- a/lib/phpmailer/language/phpmailer.lang-pl.php +++ b/lib/phpmailer/language/phpmailer.lang-pl.php @@ -1,25 +1,25 @@ - \ No newline at end of file diff --git a/lib/phpmailer/language/phpmailer.lang-ro.php b/lib/phpmailer/language/phpmailer.lang-ro.php index 17cddb76b99..f6aa922556b 100644 --- a/lib/phpmailer/language/phpmailer.lang-ro.php +++ b/lib/phpmailer/language/phpmailer.lang-ro.php @@ -1,27 +1,27 @@ - -*/ - -$PHPMAILER_LANG['authenticate'] = 'Eroare SMTP: Nu a functionat autentificarea.'; -$PHPMAILER_LANG['connect_host'] = 'Eroare SMTP: Nu m-am putut conecta la adresa SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'Eroare SMTP: Continutul mailului nu a fost acceptat.'; -//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; -$PHPMAILER_LANG['encoding'] = 'Encodare necunoscuta: '; -$PHPMAILER_LANG['execute'] = 'Nu pot executa: '; -$PHPMAILER_LANG['file_access'] = 'Nu pot accesa fisierul: '; -$PHPMAILER_LANG['file_open'] = 'Eroare de fisier: Nu pot deschide fisierul: '; -$PHPMAILER_LANG['from_failed'] = 'Urmatoarele adrese From au dat eroare: '; -$PHPMAILER_LANG['instantiate'] = 'Nu am putut instantia functia mail.'; -//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer nu este suportat.'; -$PHPMAILER_LANG['provide_address'] = 'Trebuie sa adaugati cel putin un recipient (adresa de mail).'; -$PHPMAILER_LANG['recipients_failed'] = 'Eroare SMTP: Urmatoarele adrese de mail au dat eroare: '; -//$PHPMAILER_LANG['signing'] = 'Signing Error: '; -//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; -//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; -//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; + +*/ + +$PHPMAILER_LANG['authenticate'] = 'Eroare SMTP: Nu a functionat autentificarea.'; +$PHPMAILER_LANG['connect_host'] = 'Eroare SMTP: Nu m-am putut conecta la adresa SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Eroare SMTP: Continutul mailului nu a fost acceptat.'; +//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['encoding'] = 'Encodare necunoscuta: '; +$PHPMAILER_LANG['execute'] = 'Nu pot executa: '; +$PHPMAILER_LANG['file_access'] = 'Nu pot accesa fisierul: '; +$PHPMAILER_LANG['file_open'] = 'Eroare de fisier: Nu pot deschide fisierul: '; +$PHPMAILER_LANG['from_failed'] = 'Urmatoarele adrese From au dat eroare: '; +$PHPMAILER_LANG['instantiate'] = 'Nu am putut instantia functia mail.'; +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer nu este suportat.'; +$PHPMAILER_LANG['provide_address'] = 'Trebuie sa adaugati cel putin un recipient (adresa de mail).'; +$PHPMAILER_LANG['recipients_failed'] = 'Eroare SMTP: Urmatoarele adrese de mail au dat eroare: '; +//$PHPMAILER_LANG['signing'] = 'Signing Error: '; +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; ?> \ No newline at end of file diff --git a/lib/phpmailer/language/phpmailer.lang-ru.php b/lib/phpmailer/language/phpmailer.lang-ru.php index 295a56ef49e..d6990525de2 100644 --- a/lib/phpmailer/language/phpmailer.lang-ru.php +++ b/lib/phpmailer/language/phpmailer.lang-ru.php @@ -1,25 +1,25 @@ - -*/ - -$PHPMAILER_LANG['authenticate'] = 'Ошибка SMTP: ошибка авторизации.'; -$PHPMAILER_LANG['connect_host'] = 'Ошибка SMTP: не удается подключиться к серверу SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'Ошибка SMTP: данные не приняты.'; -//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; -$PHPMAILER_LANG['encoding'] = 'Неизвестный вид кодировки: '; -$PHPMAILER_LANG['execute'] = 'Невозможно выполнить команду: '; -$PHPMAILER_LANG['file_access'] = 'Нет доступа к файлу: '; -$PHPMAILER_LANG['file_open'] = 'Файловая ошибка: не удается открыть файл: '; -$PHPMAILER_LANG['from_failed'] = 'Неверный адрес отправителя: '; -$PHPMAILER_LANG['instantiate'] = 'Невозможно запустить функцию mail.'; -//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; -$PHPMAILER_LANG['provide_address'] = 'Пожалуйста, введите хотя бы один адрес e-mail получателя.'; -$PHPMAILER_LANG['mailer_not_supported'] = ' - почтовый сервер не поддерживается.'; -$PHPMAILER_LANG['recipients_failed'] = 'Ошибка SMTP: отправка по следующим адресам получателей не удалась: '; -//$PHPMAILER_LANG['signing'] = 'Signing Error: '; -//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; -//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; -//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; + +*/ + +$PHPMAILER_LANG['authenticate'] = 'Ошибка SMTP: ошибка авторизации.'; +$PHPMAILER_LANG['connect_host'] = 'Ошибка SMTP: не удается подключиться к серверу SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Ошибка SMTP: данные не приняты.'; +//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['encoding'] = 'Неизвестный вид кодировки: '; +$PHPMAILER_LANG['execute'] = 'Невозможно выполнить команду: '; +$PHPMAILER_LANG['file_access'] = 'Нет доступа к файлу: '; +$PHPMAILER_LANG['file_open'] = 'Файловая ошибка: не удается открыть файл: '; +$PHPMAILER_LANG['from_failed'] = 'Неверный адрес отправителя: '; +$PHPMAILER_LANG['instantiate'] = 'Невозможно запустить функцию mail.'; +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; +$PHPMAILER_LANG['provide_address'] = 'Пожалуйста, введите хотя бы один адрес e-mail получателя.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' - почтовый сервер не поддерживается.'; +$PHPMAILER_LANG['recipients_failed'] = 'Ошибка SMTP: отправка по следующим адресам получателей не удалась: '; +//$PHPMAILER_LANG['signing'] = 'Signing Error: '; +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; ?> \ No newline at end of file diff --git a/lib/phpmailer/language/phpmailer.lang-se.php b/lib/phpmailer/language/phpmailer.lang-se.php index d459667f7d7..67e05f59c69 100755 --- a/lib/phpmailer/language/phpmailer.lang-se.php +++ b/lib/phpmailer/language/phpmailer.lang-se.php @@ -1,26 +1,26 @@ - -*/ - -$PHPMAILER_LANG['authenticate'] = 'SMTP fel: Kunde inte autentisera.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP fel: Kunde inte ansluta till SMTP-server.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fel: Data accepterades inte.'; -//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; -$PHPMAILER_LANG['encoding'] = 'Okänt encode-format: '; -$PHPMAILER_LANG['execute'] = 'Kunde inte köra: '; -$PHPMAILER_LANG['file_access'] = 'Ingen åtkomst till fil: '; -$PHPMAILER_LANG['file_open'] = 'Fil fel: Kunde inte öppna fil: '; -$PHPMAILER_LANG['from_failed'] = 'Följande avsändaradress är felaktig: '; -$PHPMAILER_LANG['instantiate'] = 'Kunde inte initiera e-postfunktion.'; -//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; -$PHPMAILER_LANG['provide_address'] = 'Du måste ange minst en mottagares e-postadress.'; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer stöds inte.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP fel: Följande mottagare är felaktig: '; -//$PHPMAILER_LANG['signing'] = 'Signing Error: '; -//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; -//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; -//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; + +*/ + +$PHPMAILER_LANG['authenticate'] = 'SMTP fel: Kunde inte autentisera.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP fel: Kunde inte ansluta till SMTP-server.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fel: Data accepterades inte.'; +//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['encoding'] = 'Okänt encode-format: '; +$PHPMAILER_LANG['execute'] = 'Kunde inte köra: '; +$PHPMAILER_LANG['file_access'] = 'Ingen åtkomst till fil: '; +$PHPMAILER_LANG['file_open'] = 'Fil fel: Kunde inte öppna fil: '; +$PHPMAILER_LANG['from_failed'] = 'Följande avsändaradress är felaktig: '; +$PHPMAILER_LANG['instantiate'] = 'Kunde inte initiera e-postfunktion.'; +//$PHPMAILER_LANG['invalid_email'] = 'Not sending, email address is invalid: '; +$PHPMAILER_LANG['provide_address'] = 'Du måste ange minst en mottagares e-postadress.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer stöds inte.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP fel: Följande mottagare är felaktig: '; +//$PHPMAILER_LANG['signing'] = 'Signing Error: '; +//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; +//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; +//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; ?> \ No newline at end of file diff --git a/lib/phpmailer/language/phpmailer.lang-tr.php b/lib/phpmailer/language/phpmailer.lang-tr.php index 8a069d14d03..d24627a49af 100755 --- a/lib/phpmailer/language/phpmailer.lang-tr.php +++ b/lib/phpmailer/language/phpmailer.lang-tr.php @@ -1,27 +1,27 @@ - \ No newline at end of file diff --git a/lib/tcpdf/CHANGELOG.TXT b/lib/tcpdf/CHANGELOG.TXT index 0340425a343..353b322760f 100644 --- a/lib/tcpdf/CHANGELOG.TXT +++ b/lib/tcpdf/CHANGELOG.TXT @@ -598,30 +598,30 @@ - _putbookmarks() function was fixed. - _putannots() was fixed to include internal links. -4.0.029 (2008-09-27) +4.0.029 (2008-09-27) - Infinite loop bug was fixed [Bug item #130309]. - Multicell() problem on Header() was fixed. -4.0.028 (2008-09-26) +4.0.028 (2008-09-26) - setLIsymbol() was added to set the LI symbol used on UL lists. - Missing $padding and $encryption_key variables declarations were added [Bug item #2129058]. -4.0.027 (2008-09-19) +4.0.027 (2008-09-19) - Bug #2118588 "Undefined offset in tcpdf.php on line 9581" was fixed. - arailunicid0.php font was updated. - The problem of javascript form fields duplication after saving was fixed. - -4.0.026 (2008-09-17) + +4.0.026 (2008-09-17) - convertHTMLColorToDec() function was improved to support rgb(RR,GG,BB) notation. - The following inline CSS attributes are now supported: text-decoration, color, background-color and font-size names: xx-small, x-small, small, medium, large, x-large, xx-large - Example n. 6 was updated. - -4.0.025 (2008-09-15) + +4.0.025 (2008-09-15) - _putcidfont0 function was improved to include CJK fonts (Chinese, Japanese, Korean, CJK, Asian fonts) without embedding. - arialunicid0 font was added (see the new example n. 38). - The following Unicode to CID-0 tables were added on fonts folder: uni2cid_ak12.php, uni2cid_aj16.php, uni2cid_ag15.php, uni2cid_ac15.php. - -4.0.024 (2008-09-12) + +4.0.024 (2008-09-12) - "stripos" function was replaced with "strpos + strtolower" for backward compatibility with PHP4. - support for Spot Colors were added. Check the new example n. 37 and the following new functions: AddSpotColor() @@ -631,532 +631,532 @@ _putspotcolors() - Bookmark() function was improved to fix wrong levels. - $lasth changes after header/footer calls were fixed. - -4.0.023 (2008-09-05) + +4.0.023 (2008-09-05) - Some HTML related problems were fixed. - Image alignment on HTML was changed, now it always defaults to the normal mode (see example_006.php). - -4.0.022 (2008-08-28) + +4.0.022 (2008-08-28) - Line height on HTML was fixed. - Image inside an HTML cell problem was fixed. - A new "zarbold" persian font was added. - -4.0.021 (2008-08-24) - - HTTP headers were fixed on Output function(). - - getAliasNbPages() and getPageGroupAlias() functions were changed to support non-unicode fonts on unicode documents. - - Function Write() was fixed. - - The problem of additional vertical spaces on HTML was fixed. - - The problem of frame around HTML links was fixed. - -4.0.020 (2008-08-15) - - "[2052259] WriteHTML & " bug was fixed. - -4.0.019 (2008-08-13) - - "Rowspan on first cell" bug was fixed. - -4.0.018 (2008-08-08) - - Default cellpadding for HTML tables was fixed. - - Annotation() function was added to support some PDF annotations (see example_036.php and section 8.4 of PDF reference 1.7). - - HTML links are now correclty shifted during line alignments. - - function getAliasNbPages() was added and Footer() was updated. - - RowSpan mode for HTML tables was fixed. - - Bugs item #2043610 "Multiple sizes vertical align wrong" was fixed. - - ImageEPS() function was improved and RTL alignment was fixed (see example_032.php). - -4.0.017 (2008-08-05) - - Missing CNZ and CEO style modes were added to Rect() function. - - Fonts utils were updated to include support for OpenType fonts. - - getLastH() function was added. - -4.0.016 (2008-07-30) - - setPageMark() function was added. This function must be called after calling Image() function for a background image. - -4.0.015 (2008-07-29) - - Some functions were changed to support different page formats (see example_028.php). - - The signature of setPage() function is changed. - -4.0.014 (2008-07-29) - - K_PATH_MAIN calculation on tcpdf_config.php was fixed. - - HTML support for EPS/AI images was added (see example_006.php). - - Bugs item #2030807 "Truncated text on multipage html fields" was fixed. - - PDF header bug was fixed. - - helvetica was added as default font family. - - Stroke mode was fixed on Text function. - - several minor bugs were fixed. - -4.0.013 (2008-07-27) - - Bugs item #2027799 " Big spaces between lines after page break" was fixed. - - K_PATH_MAIN calculation on tcpdf_config.php was changed. - - Function setVisibility() was fixed to avoid the "Incorrect PDEObject type" error message. - -4.0.012 (2008-07-24) - - Addpage(), Header() and Footer() functions were changed to simplify the implementation of external header/footer functions. - - The following functions were added: - setHeader() - setFooter() - getImageRBX() - getImageRBY() - getCellHeightRatio() - getHeaderFont() - getFooterFont() - getRTL() - getBarcode() - getHeaderData() - getHeaderMargin() - getFooterMargin() - -4.0.011 (2008-07-23) - - Font support was improved. - - The folder /fonts/utils contains new utilities and instructions for embedd font files. - - Documentation was updated. - -4.0.010 (2008-07-22) - - HTML tables were fixed to work across pages. - - Header() and Footer() functions were updated to preserve previous settings. - - example_035.php was added. - -4.0.009 (2008-07-21) - - UTF8StringToArray() function was fixed for non-unicode mode. - -4.0.008 (2008-07-21) - - Barcodes alignment was fixed (see example_027.php). - - unicode_data.php was updated. - - Arabic shaping for "Zero-Width Non-Joiner" character (U+200C) was fixed. - -4.0.007 (2008-07-18) - - str_split was replaced by preg_split for compatibility with PHP4 version. - - Clipping mode was added to all graphic functions by using parameter $style = "CNZ" or "CEO" (see example_034.php). - -4.0.006 (2008-07-16) - - HTML rowspan bug was fixed. - - Line style for MultiCell() was fixed. - - WriteHTML() function was improved. - - CODE128C barcode was fixed (barcodes.php). - -4.0.005 (2008-07-11) - - Bug [2015715] "PHP Error/Warning" was fixed. - -4.0.004 (2008-07-09) - - HTML cell internal padding was fixed. - -4.0.003 (2008-07-08) - - Removed URL encoding when F option is selected on Output() function. - - fixed some minor bugs in html tables. - -4.0.002 (2008-07-07) - - Bug [2000861] was still unfixed and has been fixed. - -4.0.001 (2008-07-05) - - Bug [2000861] was fixed. - -4.0.000 (2008-07-03) - - THIS IS A MAIN RELEASE THAT INCLUDES SEVERAL NEW FEATURES AND BUGFIXES - - Signature fo SetTextColor() and SetFillColor() functions was changed (parameter $storeprev was removed). - - HTML support was completely rewritten and improved (see example 6). - - Alignments parameters were fixed. - - Functions GetArrStringWidth() and GetStringWidth() now include font parameters. - - Fonts support was improved. - - All core fonts were replaced and moved to fonts/ directory. - - The following functions were added: getMargins(), getFontSize(), getFontSizePt(). - - File config/tcpdf_config_old.php was renamed tcpdf_config_alt.php and updated. - - Multicell and WriteHTMLCell fill function was fixed. - - Several minor bugs were fixed. - - barcodes.php was updated. - - All examples were updated. - ------------------------------------------------------------- - -3.1.001 (2008-06-13) - - Bug [1992515] "K_PATH_FONTS default value wrong" was fixed. - - Vera font was removed, DejaVu font and Free fonts were updated. - - Image handling was improved. - - All examples were updated. - -3.1.000 (2008-06-11) - - setPDFVersion() was added to change the default PDF version (currently 1.7). - - setViewerPreferences() was added to control the way the document is to be presented on the screen or printed (see example 29). - - SetDisplayMode() signature was changed (new options were added). - - LinearGradient(), RadialGradient(), CoonsPatchMesh() functions were added to print various color gradients (see example 30). - - PieSector() function was added to render render pie charts (see example 31). - - ImageEps() was added to display EPS and AI images with limited support (see example 32). - - writeBarcode() function is now depracated, a new write1DBarcode() function was added. The barcode directory was removed and a new barcodes.php file was added. - - The new write1DBarcode() function support more barcodes and do not need the GD library (see example 027). All barcodes are directly written to PDF using graphic functions. - - HTML lists were improved and could be nested (you may now represent trees). - - AddFont() bug was fixed. - - _putfonts() bug was fixed. - - graphics functions were fixed. - - unicode_data.php file was updated (fixed). - - almohanad font was updated. - - example 18 was updated (Farsi and Arabic languages). - - source code cleanup. - - All examples were updated and new examples were added. - -3.0.015 (2008-06-06) - - AddPage() function signature is changed to include page format. - - example 28 was added to show page format changes. - - setPageUnit() function was added to change the page units of measure. - - setPageFormat() function was added to change the page format and orientation between pages. - - setPageOrientation() function was added to change the page orientation. - - Arabic font shaping was fixed for laa letter and square boxes (see the example 18). - -3.0.014 (2008-06-04) - - Arabic font shaping was fixed. - - setDefaultTableColumns() function was added. - - $cell_height_ratio variable was added. - - setCellHeightRatio() function was added to define the default height of cell repect font height. - -3.0.013 (2008-06-03) - - Multicell height parameter was fixed. - - Arabic font shaping was improved. - - unicode_data.php was updated. - -3.0.012 (2008-05-30) - - K_PATH_MAIN and K_PATH_URL constants are now automatically set on config file. - - DOCUMENT_ROOT constant was fixed for IIS Webserver (config file was updated). - - Arabic font shaping was improved. - - TranslateY() function was fixed (bug [1977962]). - - setVisibility() function was fixed. - - writeBarcode() function was fixed to scale using $xref parameter. - - All examples were updated. - -3.0.011 (2008-05-23) - - CMYK color support was added to all graphic functions. - - HTML table support was improved: - -- now it's possible to include additional html tags inside a cell; - -- colspan attribute was added. - - example 006 was updated. - -3.0.010 (2008-05-21) - - fixed $laa_array inclusion on utf8Bidi() function. - -3.0.009 (2008-05-20) - - unicode_data.php was updated. - - Arabic laa letter problem was fixed. - -3.0.008 (2008-05-12) - - Arabic support was fixed and improved (unicode_data.php was updated). - - Polycurve() function was added to draw a poly-Bezier curve. - - list items alignment was fixed. - - example 6 was updated. - -3.0.007 (2008-05-06) - - Arabic support was fixed and improved. - - AlMohanad (arabic) font was added. - - C128 barcode bugs were fixed. - -3.0.006 (2008-04-21) - - Condition to check negative width values was added. - -3.0.005 (2008-04-18) - - back-Slash character escape was fixed on writeHTML() function. - - Exampe 6 was updated. - -3.0.004 (2008-04-11) - - Bug [1939304] (Right to Left Issue) was fixed. - -3.0.003 (2008-04-07) - - Bug [1934523](Words between HTML tags in cell not kept on one line) was fixed. - - "face" attribute of "font" tag is now fully supported. - -3.0.002 (2008-04-01) - - Write() functions now return the number of cells and not the number of lines. - - TCPDF is released under LGPL 2.1, or any later version. - -3.0.001 (2008-05-28) - - _legacyparsejpeg() and _legacyparsepng() were renamed _parsejpeg() and _parsepng(). - - function writeBarcode() was fixed. - - all examples were updated. - - example 27 was added to show various barcodes. - -3.0.000 (2008-03-27) - - private function pixelsToMillimeters() was changed to public function pixelsToUnits() to fix html image size bug. - - Image-related functions were rewritten. - - resize parameter was added to Image() signature to reduce the image size and fit width and height (see example 9). - - TCPDF now supports all images supported by GD library: GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM. - - CMYK support was added to SetDrawColor(), SetFillColor(), SetTextColor() (see example 22). - - Page Groups were added (see example 23). - - setVisibility() function was added to restrict the rendering of some elements to screen or printout (see example 24). - - All private variables and functions were changed to protected. - - setAlpha() function was added to give transparency support for all objects (see example 25). - - Clipping and stroke modes were added to Text() function (see example 26). - - All examples were moved to "examples" directory. - - function setJPEGQuality() was added to set the JPEG image comrpession (see example 9). - -2.9.000 (2008-03-26) - - htmlcolors.php file was added to include html colors. - - Support for HTML color names and three-digit hexadecimal color codes was added. - - private function convertColorHexToDec() was renamed convertHTMLColorToDec(). - - color and bgcolor attributes are now supported on all HTML tags (color nesting is also supported). - - Write() function were fixed. - - example_006.php was updated. - - private function setUserRights() was added to release user rights on Acrobat Reader (this allows to display forms, see example 14) - -2.8.000 (2008-03-20) - - Private variables were changed to protected. - - Function Write() was fixed and improved. - - Support for dl, dt, dd, del HTML tags was introduced. - - Line-trought mode was added for HTML and text. - - Text vertical alignment on cells were fixed. - - Examples were updated to reflect changes. - -2.7.002 (2008-03-13) - - Bug "[1912142] Encrypted PDF created/modified date" was fixed. - -2.7.001 (2008-03-10) - - Cell justification was fixed for non-unicode mode. - -2.7.000 (2008-03-09) - - Cell() stretching mode 4 (forced character spacing) was fixed. - - writeHTMLCell() now uses Multicell() to write. - - Multicell() has a new parameter $ishtml to act as writeHTMLCell(). - - Write() speed was improved for non-arabic strings. - - Example n. 20 was changed. - -2.6.000 (2008-03-07) - - various alignments bugs were fixed. - -2.5.000 (2008-03-07) - - Several bugs were fixed. - - example_019.php was added to test non-unicode mode using old fonts. - -2.4.000 (2008-03-06) - - RTL support was deeply improved. - - GetStringWidth() was fixed to support RTL languages. - - Text() RTL alignment was fixed. - - Some functions were added: GetArrStringWidth(), GetCharWidth(), uniord(), utf8Bidi(). - - example_018.php was added and test_unicode.php was removed. - -2.3.000 (2008-03-05) - - MultiCell() signature is changed. Now support multiple columns across pages (see example_017). - - Write() signature is changed. Now support the cell mode to be used with MultiCell. - - Header() and Footer() were changed. - - The following functions were added: UTF8ArrSubString() and unichr(). - - Examples were updated to reflect last changes. - -2.2.004 (2008-03-04) - - Several examples were added. - - AddPage() Header() and Footer() were fixed. - - Documentation is now available on http://www.tcpdf.org - -2.2.003 (2008-03-03) - - [1894853] Performance of MultiCell() was improved. - - RadioButton and ListBox functions were added. - - javascript form functions were rewritten and properties names are changed. The properties function supported by form fields are listed on Possible values are listed on http://www.adobe.com/devnet/acrobat/pdfs/js_developer_guide.pdf. - -2.2.002 (2008-02-28) - - [1900495] html images path was fixed. - - Legacy image functions were reintroduced to allow PNG and JPEG support without GD library. - -2.2.001 (2008-02-16) - - The bug "[1894700] bug with replace relative path" was fixed - - Justification was fixed - -2.2.000 (2008-02-12) - - fixed javascript bug introduced with latest release - -2.1.002 (2008-02-12) - - Justify function was fixed on PHP4 version. - - Bookmank function was added ([1578250] Table of contents). - - Javascript and Form fields support was added ([1796359] Form fields). - -2.1.001 (2008-02-10) - - The bug "[1885776] Race Condition in function justitfy" was fixed. - - The bug "[1890217] xpdf complains that pdf is incorrect" was fixed. - -2.1.000 (2008-01-07) - - FPDF_FONTPATH constant was changed to K_PATH_FONTS on config file - - Bidirectional Algorithm to correctly reverse bidirectional languages was added. - - SetLeftMargin, SetTopMargin, SetRightMargin functions were fixed. - - SetCellPadding function was added. - - writeHTML was updated with new parameters. - - Text function was fixed. - - MultiCell function was fixed, now works also across multiple pages. - - Line width was fixed on Header and Footer functions and


    tag. - - "GetImageSize" was renamed "getimagesize". - - Document version was changed from 1.3 to 1.5. - - _begindoc() function was fixed. - - ChangeDate was fixed and ModDate was added. - - The following functions were added: - setPage() : Move pointer to the specified document page. - getPage() : Get current document page number. - lastpage() : Reset pointer to the last document page. - getNumPages() : Get the total number of inserted pages. - GetNumChars() : count the number of (UTF-8) characters in a string. - - $stretch parameter was added to Cell() function to fit text on cell: - 0 = disabled - 1 = horizontal scaling only if necessary - 2 = forced horizontal scaling - 3 = character spacing only if necessary - 4 = forced character spacing - - Line function was fixed for RTL. - - Graphic transformation functions were added [1811158]: - StartTransform() - StopTransform() - ScaleX() - ScaleY() - ScaleXY() - Scale() - MirrorH() - MirrorV() - MirrorP() - MirrorL() - TranslateX() - TranslateY() - Translate() - Rotate() - SkewX() - SkewY() - Skew() - - Graphic function were added/updated [1688549]: - SetLineStyle() - _outPoint() - _outLine() - _outRect() - _outCurve() - Line() - Rect() - Curve - Ellipse - Circle - Polygon - RegularPolygon - -2.0.000 (2008-01-04) - - RTL (Right-To-Left) languages support was added. Language direction is set using the $l['a_meta_dir'] setting on /configure/language/xxx.php language files. - - setRTL($enable) method was added to manually enable/disable the RTL text direction. - - The attribute "dir" was added to support custom text direction on HTML tags. Possible values are: ltr - for Left-To-Right and RTL for Right-To-Left. - - RC4 40bit encryption was added. Check the SetProtection method. - - [1815213] Improved image support for GIF, JPEG, PNG formats. - - [1800094] Attribute "value" was added to ordered list items
  • . - - Image function now has a new "align" parameter that indicates the alignment of the pointer next to image insertion and relative to image height. The value can be: - T: top-right for LTR or top-left for RTL - M: middle-right for LTR or middle-left for RTL - B: bottom-right for LTR or bottom-left for RTL - N: next line - - Attribute "align" was added to html tag to set the above image "align" parameter. Possible values are: - top: top-right for LTR or top-left for RTL - middle: middle-right for LTR or middle-left for RTL - bottom: bottom-right for LTR or bottom-left for RTL - - [1798103] newline was added after , and

    tages. - - [1816393] Documentation was updated. - - 'ln' parameter was fixed on writeHTMLCell. Now it's possible to print two or more columns across several pages; - - The method lastPage() was added to move the pointer on the last page; - ------------------------------------------------------------- - -1.53.0.TC034 (2007-07-30) - - fixed htmlentities conversion. - - MultiCell() function returns the number of cells. - -1.53.0.TC033 (2007-07-30) - - fixed bug 1762550: case sensitive for font files - - NOTE: all fonts files names must be in lowercase! - -1.53.0.TC032 (2007-07-27) - - setLastH method was added to resolve bug 1689071. - - all fonts names were converted in lowercase (bug 1713005). - - bug 1740954 was fixed. - - justification was added as Cell option. - -1.53.0.TC031 (2007-03-20) - - ToUnicode CMap were added on _puttruetypeunicode function. Now you may search and copy unicode text. - -1.53.0.TC030 (2007-03-06) - - fixed bug on PHP4 version. - -1.53.0.TC029 (2007-03-06) - - DejaVu Fonts were added. - -1.53.0.TC028 (2007-03-03) - - MultiCell function signature were changed: the $ln parameter were added. Check documentation for further information. - - Greek language were added on example sentences. - - setPrintHeader() and setPrintFooter() functions were added to enable or disable page header and footer. - -1.53.0.TC027 (2006-12-14) - - $attr['face'] bug were fixed. - - K_TCPDF_EXTERNAL_CONFIG control where introduced on /config/tcpdf_config.php to use external configuration files. - -1.53.0.TC026 (2006-10-28) - - writeHTML function call were fixed on examples. - -1.53.0.TC025 (2006-10-27) - - Bugs item #1421290 were fixed (0D - 0A substitution in some characters) - - Bugs item #1573174 were fixed (MultiCell documentation) - -1.53.0.TC024 (2006-09-26) - - getPageHeight() function were fixed (bug 1543476). - - fixed missing breaks on closedHTMLTagHandler function (bug 1535263). - - fixed extra spaces on Write function (bug 1535262). - -1.53.0.TC023 (2006-08-04) - - paths to barcode directory were fixed. - - documentation were updated. - -1.53.0.TC022 (2006-07-16) - - fixed bug: [ 1516858 ] Probs with PHP autoloader and class_exists() - -1.53.0.TC021 (2006-07-01) - - HTML attributes with whitespaces are now supported (thanks to Nelson Benitez for his support) - -1.53.0.TC020 (2006-06-23) - - code cleanup - -1.53.0.TC019 (2006-05-21) - - fixed and closing tags - -1.53.0.TC018 (2006-05-18) - - fixed font names bug - -1.53.0.TC017 (2006-05-18) - - the TTF2UFM utility to convert True Type fonts for TCPDF were included on fonts folder. - - new free unicode fonts were included on /fonts/freefont. - - test_unicode.php example were exended. - - parameter $fill were added on Write, writeHTML and writeHTMLCell functions. - - documentation were updated. - -1.53.0.TC016 (2006-03-09) - - fixed closing tag on html parser. - -1.53.0.TC016 (2005-08-28) - - fpdf.php and tcpdf.php files were joined in one single class (you can still extend TCPDF with your own class). - - fixed problem when mb_internal_encoding is set. - -1.53.0.TC014 (2005-05-29) - - fixed WriteHTMLCell new page issue. - -1.53.0.TC013 (2005-05-29) - - fixed WriteHTMLCell across pages. - -1.53.0.TC012 (2005-05-29) - - font color attribute bug were fixed. - -1.53.0.TC011 (2005-03-31) - - SetFont function were fixed (thank Sjaak Lauwers for bug notice). - -1.53.0.TC010 (2005-03-22) - - the html functions were improved (thanks to Manfred Vervuert for bug reporting). - -1.53.0.TC009 (2005-03-19) - - a wrong reference to convertColorHexToDec were fixed. - -1.53.0.TC008 (2005-02-07) - - removed some extra bytes from PHP files. - -1.53.0.TC007 (2005-01-08) - - fill attribute were removed from writeHTMLCell method. - -1.53.0.TC006 (2005-01-08) - - the documentation were updated. - -1.53.0.TC005 (2005-01-05) - - Steven Wittens's unicode methods were removed. - - All unicode methods were rewritten from scratch. - - TCPDF is now licensed as LGPL. - -1.53.0.TC004 (2005-01-04) - - this changelog were added. - - removed commercial fonts for licensing issue. - - Bitstream Vera Fonts were added (http://www.bitstream.com/font_rendering/products/dev_fonts/vera.html). - - Now the AddFont and SetFont functions returns the basic font if the styled version do not exist. + +4.0.021 (2008-08-24) + - HTTP headers were fixed on Output function(). + - getAliasNbPages() and getPageGroupAlias() functions were changed to support non-unicode fonts on unicode documents. + - Function Write() was fixed. + - The problem of additional vertical spaces on HTML was fixed. + - The problem of frame around HTML links was fixed. + +4.0.020 (2008-08-15) + - "[2052259] WriteHTML & " bug was fixed. + +4.0.019 (2008-08-13) + - "Rowspan on first cell" bug was fixed. + +4.0.018 (2008-08-08) + - Default cellpadding for HTML tables was fixed. + - Annotation() function was added to support some PDF annotations (see example_036.php and section 8.4 of PDF reference 1.7). + - HTML links are now correclty shifted during line alignments. + - function getAliasNbPages() was added and Footer() was updated. + - RowSpan mode for HTML tables was fixed. + - Bugs item #2043610 "Multiple sizes vertical align wrong" was fixed. + - ImageEPS() function was improved and RTL alignment was fixed (see example_032.php). + +4.0.017 (2008-08-05) + - Missing CNZ and CEO style modes were added to Rect() function. + - Fonts utils were updated to include support for OpenType fonts. + - getLastH() function was added. + +4.0.016 (2008-07-30) + - setPageMark() function was added. This function must be called after calling Image() function for a background image. + +4.0.015 (2008-07-29) + - Some functions were changed to support different page formats (see example_028.php). + - The signature of setPage() function is changed. + +4.0.014 (2008-07-29) + - K_PATH_MAIN calculation on tcpdf_config.php was fixed. + - HTML support for EPS/AI images was added (see example_006.php). + - Bugs item #2030807 "Truncated text on multipage html fields" was fixed. + - PDF header bug was fixed. + - helvetica was added as default font family. + - Stroke mode was fixed on Text function. + - several minor bugs were fixed. + +4.0.013 (2008-07-27) + - Bugs item #2027799 " Big spaces between lines after page break" was fixed. + - K_PATH_MAIN calculation on tcpdf_config.php was changed. + - Function setVisibility() was fixed to avoid the "Incorrect PDEObject type" error message. + +4.0.012 (2008-07-24) + - Addpage(), Header() and Footer() functions were changed to simplify the implementation of external header/footer functions. + - The following functions were added: + setHeader() + setFooter() + getImageRBX() + getImageRBY() + getCellHeightRatio() + getHeaderFont() + getFooterFont() + getRTL() + getBarcode() + getHeaderData() + getHeaderMargin() + getFooterMargin() + +4.0.011 (2008-07-23) + - Font support was improved. + - The folder /fonts/utils contains new utilities and instructions for embedd font files. + - Documentation was updated. + +4.0.010 (2008-07-22) + - HTML tables were fixed to work across pages. + - Header() and Footer() functions were updated to preserve previous settings. + - example_035.php was added. + +4.0.009 (2008-07-21) + - UTF8StringToArray() function was fixed for non-unicode mode. + +4.0.008 (2008-07-21) + - Barcodes alignment was fixed (see example_027.php). + - unicode_data.php was updated. + - Arabic shaping for "Zero-Width Non-Joiner" character (U+200C) was fixed. + +4.0.007 (2008-07-18) + - str_split was replaced by preg_split for compatibility with PHP4 version. + - Clipping mode was added to all graphic functions by using parameter $style = "CNZ" or "CEO" (see example_034.php). + +4.0.006 (2008-07-16) + - HTML rowspan bug was fixed. + - Line style for MultiCell() was fixed. + - WriteHTML() function was improved. + - CODE128C barcode was fixed (barcodes.php). + +4.0.005 (2008-07-11) + - Bug [2015715] "PHP Error/Warning" was fixed. + +4.0.004 (2008-07-09) + - HTML cell internal padding was fixed. + +4.0.003 (2008-07-08) + - Removed URL encoding when F option is selected on Output() function. + - fixed some minor bugs in html tables. + +4.0.002 (2008-07-07) + - Bug [2000861] was still unfixed and has been fixed. + +4.0.001 (2008-07-05) + - Bug [2000861] was fixed. + +4.0.000 (2008-07-03) + - THIS IS A MAIN RELEASE THAT INCLUDES SEVERAL NEW FEATURES AND BUGFIXES + - Signature fo SetTextColor() and SetFillColor() functions was changed (parameter $storeprev was removed). + - HTML support was completely rewritten and improved (see example 6). + - Alignments parameters were fixed. + - Functions GetArrStringWidth() and GetStringWidth() now include font parameters. + - Fonts support was improved. + - All core fonts were replaced and moved to fonts/ directory. + - The following functions were added: getMargins(), getFontSize(), getFontSizePt(). + - File config/tcpdf_config_old.php was renamed tcpdf_config_alt.php and updated. + - Multicell and WriteHTMLCell fill function was fixed. + - Several minor bugs were fixed. + - barcodes.php was updated. + - All examples were updated. + +------------------------------------------------------------ + +3.1.001 (2008-06-13) + - Bug [1992515] "K_PATH_FONTS default value wrong" was fixed. + - Vera font was removed, DejaVu font and Free fonts were updated. + - Image handling was improved. + - All examples were updated. + +3.1.000 (2008-06-11) + - setPDFVersion() was added to change the default PDF version (currently 1.7). + - setViewerPreferences() was added to control the way the document is to be presented on the screen or printed (see example 29). + - SetDisplayMode() signature was changed (new options were added). + - LinearGradient(), RadialGradient(), CoonsPatchMesh() functions were added to print various color gradients (see example 30). + - PieSector() function was added to render render pie charts (see example 31). + - ImageEps() was added to display EPS and AI images with limited support (see example 32). + - writeBarcode() function is now depracated, a new write1DBarcode() function was added. The barcode directory was removed and a new barcodes.php file was added. + - The new write1DBarcode() function support more barcodes and do not need the GD library (see example 027). All barcodes are directly written to PDF using graphic functions. + - HTML lists were improved and could be nested (you may now represent trees). + - AddFont() bug was fixed. + - _putfonts() bug was fixed. + - graphics functions were fixed. + - unicode_data.php file was updated (fixed). + - almohanad font was updated. + - example 18 was updated (Farsi and Arabic languages). + - source code cleanup. + - All examples were updated and new examples were added. + +3.0.015 (2008-06-06) + - AddPage() function signature is changed to include page format. + - example 28 was added to show page format changes. + - setPageUnit() function was added to change the page units of measure. + - setPageFormat() function was added to change the page format and orientation between pages. + - setPageOrientation() function was added to change the page orientation. + - Arabic font shaping was fixed for laa letter and square boxes (see the example 18). + +3.0.014 (2008-06-04) + - Arabic font shaping was fixed. + - setDefaultTableColumns() function was added. + - $cell_height_ratio variable was added. + - setCellHeightRatio() function was added to define the default height of cell repect font height. + +3.0.013 (2008-06-03) + - Multicell height parameter was fixed. + - Arabic font shaping was improved. + - unicode_data.php was updated. + +3.0.012 (2008-05-30) + - K_PATH_MAIN and K_PATH_URL constants are now automatically set on config file. + - DOCUMENT_ROOT constant was fixed for IIS Webserver (config file was updated). + - Arabic font shaping was improved. + - TranslateY() function was fixed (bug [1977962]). + - setVisibility() function was fixed. + - writeBarcode() function was fixed to scale using $xref parameter. + - All examples were updated. + +3.0.011 (2008-05-23) + - CMYK color support was added to all graphic functions. + - HTML table support was improved: + -- now it's possible to include additional html tags inside a cell; + -- colspan attribute was added. + - example 006 was updated. + +3.0.010 (2008-05-21) + - fixed $laa_array inclusion on utf8Bidi() function. + +3.0.009 (2008-05-20) + - unicode_data.php was updated. + - Arabic laa letter problem was fixed. + +3.0.008 (2008-05-12) + - Arabic support was fixed and improved (unicode_data.php was updated). + - Polycurve() function was added to draw a poly-Bezier curve. + - list items alignment was fixed. + - example 6 was updated. + +3.0.007 (2008-05-06) + - Arabic support was fixed and improved. + - AlMohanad (arabic) font was added. + - C128 barcode bugs were fixed. + +3.0.006 (2008-04-21) + - Condition to check negative width values was added. + +3.0.005 (2008-04-18) + - back-Slash character escape was fixed on writeHTML() function. + - Exampe 6 was updated. + +3.0.004 (2008-04-11) + - Bug [1939304] (Right to Left Issue) was fixed. + +3.0.003 (2008-04-07) + - Bug [1934523](Words between HTML tags in cell not kept on one line) was fixed. + - "face" attribute of "font" tag is now fully supported. + +3.0.002 (2008-04-01) + - Write() functions now return the number of cells and not the number of lines. + - TCPDF is released under LGPL 2.1, or any later version. + +3.0.001 (2008-05-28) + - _legacyparsejpeg() and _legacyparsepng() were renamed _parsejpeg() and _parsepng(). + - function writeBarcode() was fixed. + - all examples were updated. + - example 27 was added to show various barcodes. + +3.0.000 (2008-03-27) + - private function pixelsToMillimeters() was changed to public function pixelsToUnits() to fix html image size bug. + - Image-related functions were rewritten. + - resize parameter was added to Image() signature to reduce the image size and fit width and height (see example 9). + - TCPDF now supports all images supported by GD library: GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM. + - CMYK support was added to SetDrawColor(), SetFillColor(), SetTextColor() (see example 22). + - Page Groups were added (see example 23). + - setVisibility() function was added to restrict the rendering of some elements to screen or printout (see example 24). + - All private variables and functions were changed to protected. + - setAlpha() function was added to give transparency support for all objects (see example 25). + - Clipping and stroke modes were added to Text() function (see example 26). + - All examples were moved to "examples" directory. + - function setJPEGQuality() was added to set the JPEG image comrpession (see example 9). + +2.9.000 (2008-03-26) + - htmlcolors.php file was added to include html colors. + - Support for HTML color names and three-digit hexadecimal color codes was added. + - private function convertColorHexToDec() was renamed convertHTMLColorToDec(). + - color and bgcolor attributes are now supported on all HTML tags (color nesting is also supported). + - Write() function were fixed. + - example_006.php was updated. + - private function setUserRights() was added to release user rights on Acrobat Reader (this allows to display forms, see example 14) + +2.8.000 (2008-03-20) + - Private variables were changed to protected. + - Function Write() was fixed and improved. + - Support for dl, dt, dd, del HTML tags was introduced. + - Line-trought mode was added for HTML and text. + - Text vertical alignment on cells were fixed. + - Examples were updated to reflect changes. + +2.7.002 (2008-03-13) + - Bug "[1912142] Encrypted PDF created/modified date" was fixed. + +2.7.001 (2008-03-10) + - Cell justification was fixed for non-unicode mode. + +2.7.000 (2008-03-09) + - Cell() stretching mode 4 (forced character spacing) was fixed. + - writeHTMLCell() now uses Multicell() to write. + - Multicell() has a new parameter $ishtml to act as writeHTMLCell(). + - Write() speed was improved for non-arabic strings. + - Example n. 20 was changed. + +2.6.000 (2008-03-07) + - various alignments bugs were fixed. + +2.5.000 (2008-03-07) + - Several bugs were fixed. + - example_019.php was added to test non-unicode mode using old fonts. + +2.4.000 (2008-03-06) + - RTL support was deeply improved. + - GetStringWidth() was fixed to support RTL languages. + - Text() RTL alignment was fixed. + - Some functions were added: GetArrStringWidth(), GetCharWidth(), uniord(), utf8Bidi(). + - example_018.php was added and test_unicode.php was removed. + +2.3.000 (2008-03-05) + - MultiCell() signature is changed. Now support multiple columns across pages (see example_017). + - Write() signature is changed. Now support the cell mode to be used with MultiCell. + - Header() and Footer() were changed. + - The following functions were added: UTF8ArrSubString() and unichr(). + - Examples were updated to reflect last changes. + +2.2.004 (2008-03-04) + - Several examples were added. + - AddPage() Header() and Footer() were fixed. + - Documentation is now available on http://www.tcpdf.org + +2.2.003 (2008-03-03) + - [1894853] Performance of MultiCell() was improved. + - RadioButton and ListBox functions were added. + - javascript form functions were rewritten and properties names are changed. The properties function supported by form fields are listed on Possible values are listed on http://www.adobe.com/devnet/acrobat/pdfs/js_developer_guide.pdf. + +2.2.002 (2008-02-28) + - [1900495] html images path was fixed. + - Legacy image functions were reintroduced to allow PNG and JPEG support without GD library. + +2.2.001 (2008-02-16) + - The bug "[1894700] bug with replace relative path" was fixed + - Justification was fixed + +2.2.000 (2008-02-12) + - fixed javascript bug introduced with latest release + +2.1.002 (2008-02-12) + - Justify function was fixed on PHP4 version. + - Bookmank function was added ([1578250] Table of contents). + - Javascript and Form fields support was added ([1796359] Form fields). + +2.1.001 (2008-02-10) + - The bug "[1885776] Race Condition in function justitfy" was fixed. + - The bug "[1890217] xpdf complains that pdf is incorrect" was fixed. + +2.1.000 (2008-01-07) + - FPDF_FONTPATH constant was changed to K_PATH_FONTS on config file + - Bidirectional Algorithm to correctly reverse bidirectional languages was added. + - SetLeftMargin, SetTopMargin, SetRightMargin functions were fixed. + - SetCellPadding function was added. + - writeHTML was updated with new parameters. + - Text function was fixed. + - MultiCell function was fixed, now works also across multiple pages. + - Line width was fixed on Header and Footer functions and
    tag. + - "GetImageSize" was renamed "getimagesize". + - Document version was changed from 1.3 to 1.5. + - _begindoc() function was fixed. + - ChangeDate was fixed and ModDate was added. + - The following functions were added: + setPage() : Move pointer to the specified document page. + getPage() : Get current document page number. + lastpage() : Reset pointer to the last document page. + getNumPages() : Get the total number of inserted pages. + GetNumChars() : count the number of (UTF-8) characters in a string. + - $stretch parameter was added to Cell() function to fit text on cell: + 0 = disabled + 1 = horizontal scaling only if necessary + 2 = forced horizontal scaling + 3 = character spacing only if necessary + 4 = forced character spacing + - Line function was fixed for RTL. + - Graphic transformation functions were added [1811158]: + StartTransform() + StopTransform() + ScaleX() + ScaleY() + ScaleXY() + Scale() + MirrorH() + MirrorV() + MirrorP() + MirrorL() + TranslateX() + TranslateY() + Translate() + Rotate() + SkewX() + SkewY() + Skew() + - Graphic function were added/updated [1688549]: + SetLineStyle() + _outPoint() + _outLine() + _outRect() + _outCurve() + Line() + Rect() + Curve + Ellipse + Circle + Polygon + RegularPolygon + +2.0.000 (2008-01-04) + - RTL (Right-To-Left) languages support was added. Language direction is set using the $l['a_meta_dir'] setting on /configure/language/xxx.php language files. + - setRTL($enable) method was added to manually enable/disable the RTL text direction. + - The attribute "dir" was added to support custom text direction on HTML tags. Possible values are: ltr - for Left-To-Right and RTL for Right-To-Left. + - RC4 40bit encryption was added. Check the SetProtection method. + - [1815213] Improved image support for GIF, JPEG, PNG formats. + - [1800094] Attribute "value" was added to ordered list items
  • . + - Image function now has a new "align" parameter that indicates the alignment of the pointer next to image insertion and relative to image height. The value can be: + T: top-right for LTR or top-left for RTL + M: middle-right for LTR or middle-left for RTL + B: bottom-right for LTR or bottom-left for RTL + N: next line + - Attribute "align" was added to html tag to set the above image "align" parameter. Possible values are: + top: top-right for LTR or top-left for RTL + middle: middle-right for LTR or middle-left for RTL + bottom: bottom-right for LTR or bottom-left for RTL + - [1798103] newline was added after , and

    tages. + - [1816393] Documentation was updated. + - 'ln' parameter was fixed on writeHTMLCell. Now it's possible to print two or more columns across several pages; + - The method lastPage() was added to move the pointer on the last page; + +------------------------------------------------------------ + +1.53.0.TC034 (2007-07-30) + - fixed htmlentities conversion. + - MultiCell() function returns the number of cells. + +1.53.0.TC033 (2007-07-30) + - fixed bug 1762550: case sensitive for font files + - NOTE: all fonts files names must be in lowercase! + +1.53.0.TC032 (2007-07-27) + - setLastH method was added to resolve bug 1689071. + - all fonts names were converted in lowercase (bug 1713005). + - bug 1740954 was fixed. + - justification was added as Cell option. + +1.53.0.TC031 (2007-03-20) + - ToUnicode CMap were added on _puttruetypeunicode function. Now you may search and copy unicode text. + +1.53.0.TC030 (2007-03-06) + - fixed bug on PHP4 version. + +1.53.0.TC029 (2007-03-06) + - DejaVu Fonts were added. + +1.53.0.TC028 (2007-03-03) + - MultiCell function signature were changed: the $ln parameter were added. Check documentation for further information. + - Greek language were added on example sentences. + - setPrintHeader() and setPrintFooter() functions were added to enable or disable page header and footer. + +1.53.0.TC027 (2006-12-14) + - $attr['face'] bug were fixed. + - K_TCPDF_EXTERNAL_CONFIG control where introduced on /config/tcpdf_config.php to use external configuration files. + +1.53.0.TC026 (2006-10-28) + - writeHTML function call were fixed on examples. + +1.53.0.TC025 (2006-10-27) + - Bugs item #1421290 were fixed (0D - 0A substitution in some characters) + - Bugs item #1573174 were fixed (MultiCell documentation) + +1.53.0.TC024 (2006-09-26) + - getPageHeight() function were fixed (bug 1543476). + - fixed missing breaks on closedHTMLTagHandler function (bug 1535263). + - fixed extra spaces on Write function (bug 1535262). + +1.53.0.TC023 (2006-08-04) + - paths to barcode directory were fixed. + - documentation were updated. + +1.53.0.TC022 (2006-07-16) + - fixed bug: [ 1516858 ] Probs with PHP autoloader and class_exists() + +1.53.0.TC021 (2006-07-01) + - HTML attributes with whitespaces are now supported (thanks to Nelson Benitez for his support) + +1.53.0.TC020 (2006-06-23) + - code cleanup + +1.53.0.TC019 (2006-05-21) + - fixed and closing tags + +1.53.0.TC018 (2006-05-18) + - fixed font names bug + +1.53.0.TC017 (2006-05-18) + - the TTF2UFM utility to convert True Type fonts for TCPDF were included on fonts folder. + - new free unicode fonts were included on /fonts/freefont. + - test_unicode.php example were exended. + - parameter $fill were added on Write, writeHTML and writeHTMLCell functions. + - documentation were updated. + +1.53.0.TC016 (2006-03-09) + - fixed closing tag on html parser. + +1.53.0.TC016 (2005-08-28) + - fpdf.php and tcpdf.php files were joined in one single class (you can still extend TCPDF with your own class). + - fixed problem when mb_internal_encoding is set. + +1.53.0.TC014 (2005-05-29) + - fixed WriteHTMLCell new page issue. + +1.53.0.TC013 (2005-05-29) + - fixed WriteHTMLCell across pages. + +1.53.0.TC012 (2005-05-29) + - font color attribute bug were fixed. + +1.53.0.TC011 (2005-03-31) + - SetFont function were fixed (thank Sjaak Lauwers for bug notice). + +1.53.0.TC010 (2005-03-22) + - the html functions were improved (thanks to Manfred Vervuert for bug reporting). + +1.53.0.TC009 (2005-03-19) + - a wrong reference to convertColorHexToDec were fixed. + +1.53.0.TC008 (2005-02-07) + - removed some extra bytes from PHP files. + +1.53.0.TC007 (2005-01-08) + - fill attribute were removed from writeHTMLCell method. + +1.53.0.TC006 (2005-01-08) + - the documentation were updated. + +1.53.0.TC005 (2005-01-05) + - Steven Wittens's unicode methods were removed. + - All unicode methods were rewritten from scratch. + - TCPDF is now licensed as LGPL. + +1.53.0.TC004 (2005-01-04) + - this changelog were added. + - removed commercial fonts for licensing issue. + - Bitstream Vera Fonts were added (http://www.bitstream.com/font_rendering/products/dev_fonts/vera.html). + - Now the AddFont and SetFont functions returns the basic font if the styled version do not exist. EOF ---------------------------------------------------------------------------- diff --git a/lib/tcpdf/README.TXT b/lib/tcpdf/README.TXT index af9db5262b7..ba64a088085 100755 --- a/lib/tcpdf/README.TXT +++ b/lib/tcpdf/README.TXT @@ -1,87 +1,87 @@ -TCPDF - README -============================================================ - -IF YOU'D LIKE TO SUPPORT TCPDF, PLEASE CONSIDER MAKING A -DONATION: -http://sourceforge.net/donate/index.php?group_id=128076 - ------------------------------------------------------------- - -Name: TCPDF -Version: 4.8.014 -Release date: 2009-11-04 -Author: Nicola Asuni - -Copyright (c) 2001-2009: - Nicola Asuni - Tecnick.com s.r.l. - Via Della Pace, 11 - 09044 Quartucciu (CA) - ITALY - www.tecnick.com - -URLs: - http://www.tcpdf.org - http://www.sourceforge.net/projects/tcpdf - -Description: - TCPDF is a PHP class for generating PDF files on-the-fly without requiring external extensions. - TCPDF has been originally derived from the Public Domain FPDF class by Olivier Plathey (http://www.fpdf.org). - -Main Features: -// * no external libraries are required for the basic functions; +TCPDF - README +============================================================ + +IF YOU'D LIKE TO SUPPORT TCPDF, PLEASE CONSIDER MAKING A +DONATION: +http://sourceforge.net/donate/index.php?group_id=128076 + +------------------------------------------------------------ + +Name: TCPDF +Version: 4.8.014 +Release date: 2009-11-04 +Author: Nicola Asuni + +Copyright (c) 2001-2009: + Nicola Asuni + Tecnick.com s.r.l. + Via Della Pace, 11 + 09044 Quartucciu (CA) + ITALY + www.tecnick.com + +URLs: + http://www.tcpdf.org + http://www.sourceforge.net/projects/tcpdf + +Description: + TCPDF is a PHP class for generating PDF files on-the-fly without requiring external extensions. + TCPDF has been originally derived from the Public Domain FPDF class by Olivier Plathey (http://www.fpdf.org). + +Main Features: +// * no external libraries are required for the basic functions; // * supports all ISO page formats; -// * supports custom page formats, margins and units of measure; +// * supports custom page formats, margins and units of measure; // * supports UTF-8 Unicode and Right-To-Left languages; -// * supports TrueTypeUnicode, OpenTypeUnicode, TrueType, OpenType, Type1 and CID-0 fonts; -// * supports document encryption; -// * includes methods to publish some XHTML code, including forms; -// * includes graphic (geometric) and transformation methods; -// * includes Javascript and Forms support; +// * supports TrueTypeUnicode, OpenTypeUnicode, TrueType, OpenType, Type1 and CID-0 fonts; +// * supports document encryption; +// * includes methods to publish some XHTML code, including forms; +// * includes graphic (geometric) and transformation methods; +// * includes Javascript and Forms support; // * includes a method to print various barcode formats: CODE 39, ANSI MH10.8M-1983, USD-3, 3 of 9, CODE 93, USS-93, Standard 2 of 5, Interleaved 2 of 5, CODE 128 A/B/C, 2 and 5 Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI, POSTNET, PLANET, RMS4CC (Royal Mail 4-state Customer Code), CBC (Customer Bar Code), KIX (Klant index - Customer index), Intelligent Mail Barcode, Onecode, USPS-B-3200, CODABAR, CODE 11, PHARMACODE, PHARMACODE TWO-TRACKS; // * includes methods to set Bookmarks and print a Table of Content; -// * includes methods to move and delete pages; -// * includes methods for automatic page header and footer management; -// * supports automatic page break; -// * supports automatic page numbering and page groups; -// * supports automatic line break and text justification; -// * supports JPEG and PNG images natively, all images supported by GD (GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM) and all images supported via ImagMagick (http://www.imagemagick.org/www/formats.html) -// * supports stroke and clipping mode for text; -// * supports clipping masks; -// * supports Grayscale, RGB, CMYK, Spot Colors and Transparencies; -// * supports several annotations, including links, text and file attachments; +// * includes methods to move and delete pages; +// * includes methods for automatic page header and footer management; +// * supports automatic page break; +// * supports automatic page numbering and page groups; +// * supports automatic line break and text justification; +// * supports JPEG and PNG images natively, all images supported by GD (GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM) and all images supported via ImagMagick (http://www.imagemagick.org/www/formats.html) +// * supports stroke and clipping mode for text; +// * supports clipping masks; +// * supports Grayscale, RGB, CMYK, Spot Colors and Transparencies; +// * supports several annotations, including links, text and file attachments; // * supports page compression (requires zlib extension); // * supports text hyphenation. -// * supports transactions to UNDO commands. +// * supports transactions to UNDO commands. // * supports signature certifications. - -Installation (full instructions on http://www.tcpdf.org): - 1. copy the folder on your Web server - 2. set your installation path and other parameters on the config/tcpdf_config.php - 3. call the examples/example_001.php page with your browser to see an example - -Source Code Documentation: - doc/index.html - -For Additional Documentation: - http://www.tcpdf.org - -License - Copyright (C) 2002-2009 Nicola Asuni - Tecnick.com S.r.l. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 2.1 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program. If not, see . - - See LICENSE.TXT file for more information. - + +Installation (full instructions on http://www.tcpdf.org): + 1. copy the folder on your Web server + 2. set your installation path and other parameters on the config/tcpdf_config.php + 3. call the examples/example_001.php page with your browser to see an example + +Source Code Documentation: + doc/index.html + +For Additional Documentation: + http://www.tcpdf.org + +License + Copyright (C) 2002-2009 Nicola Asuni - Tecnick.com S.r.l. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 2.1 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . + + See LICENSE.TXT file for more information. + ============================================================ diff --git a/lib/tcpdf/fonts/symbol.php b/lib/tcpdf/fonts/symbol.php index ad4e81860d6..9068a79af67 100644 --- a/lib/tcpdf/fonts/symbol.php +++ b/lib/tcpdf/fonts/symbol.php @@ -1,7 +1,7 @@ -250,1=>250,2=>250,3=>250,4=>250,5=>250,6=>250,7=>250,8=>250,9=>250, 10=>250,11=>250,12=>250,13=>250,14=>250,15=>250,16=>250,17=>250,18=>250,19=>250, 20=>250,21=>250,22=>250,23=>250,24=>250,25=>250,26=>250,27=>250,28=>250,29=>250, @@ -28,5 +28,5 @@ $cw=array(0=>250,1=>250,2=>250,3=>250,4=>250,5=>250,6=>250,7=>250,8=>250,9=>250, 223=>603,224=>494,225=>329,226=>790,227=>790,228=>786,229=>713,230=>384,231=>384, 232=>384,233=>384,234=>384,235=>384,236=>494,237=>494,238=>494,239=>494,240=>0, 241=>329,242=>274,243=>686,244=>686,245=>686,246=>384,247=>384,248=>384,249=>384, -250=>384,251=>384,252=>494,253=>494,254=>494,255=>0); +250=>384,251=>384,252=>494,253=>494,254=>494,255=>0); ?> diff --git a/lib/tcpdf/fonts/zapfdingbats.php b/lib/tcpdf/fonts/zapfdingbats.php index f4c679b19e3..d3b7c56c867 100644 --- a/lib/tcpdf/fonts/zapfdingbats.php +++ b/lib/tcpdf/fonts/zapfdingbats.php @@ -1,7 +1,7 @@ -0,1=>0,2=>0,3=>0,4=>0,5=>0,6=>0,7=>0,8=>0,9=>0,10=>0,11=>0,12=>0, 13=>0,14=>0,15=>0,16=>0,17=>0,18=>0,19=>0,20=>0,21=>0,22=>0,23=>0,24=>0,25=>0, 26=>0,27=>0,28=>0,29=>0,30=>0,31=>0,32=>278,33=>974,34=>961,35=>974,36=>980, @@ -28,5 +28,5 @@ $cw=array(0=>0,1=>0,2=>0,3=>0,4=>0,5=>0,6=>0,7=>0,8=>0,9=>0,10=>0,11=>0,12=>0, 227=>924,228=>917,229=>930,230=>931,231=>463,232=>883,233=>836,234=>836,235=>867, 236=>867,237=>696,238=>696,239=>874,240=>0,241=>874,242=>760,243=>946,244=>771, 245=>865,246=>771,247=>888,248=>967,249=>888,250=>831,251=>873,252=>927,253=>970, -254=>918,255=>0); +254=>918,255=>0); ?> diff --git a/lib/zend/Zend/Amf/Adobe/Auth.php b/lib/zend/Zend/Amf/Adobe/Auth.php index e41464affff..a83903492ea 100755 --- a/lib/zend/Zend/Amf/Adobe/Auth.php +++ b/lib/zend/Zend/Amf/Adobe/Auth.php @@ -1,133 +1,133 @@ -_acl = new Zend_Acl(); - $xml = simplexml_load_file($rolefile); -/* -Roles file format: - - - - - - - - -*/ - foreach($xml->role as $role) { - $this->_acl->addRole(new Zend_Acl_Role((string)$role["id"])); - foreach($role->user as $user) { - $this->_users[(string)$user["name"]] = array("password" => (string)$user["password"], - "role" => (string)$role["id"]); - } - } - } - - /** - * Get ACL with roles from XML file - * - * @return Zend_Acl - */ - public function getAcl() - { - return $this->_acl; - } - - /** - * Perform authentication - * - * @throws Zend_Auth_Adapter_Exception - * @return Zend_Auth_Result - * @see Zend_Auth_Adapter_Interface#authenticate() - */ - public function authenticate() - { - if (empty($this->_username) || - empty($this->_password)) { - /** - * @see Zend_Auth_Adapter_Exception - */ - require_once 'Zend/Auth/Adapter/Exception.php'; - throw new Zend_Auth_Adapter_Exception('Username/password should be set'); - } - - if(!isset($this->_users[$this->_username])) { - return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND, - null, - array('Username not found') - ); - } - - $user = $this->_users[$this->_username]; - if($user["password"] != $this->_password) { - return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID, - null, - array('Authentication failed') - ); - } - - $id = new stdClass(); - $id->role = $user["role"]; - $id->name = $this->_username; - return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, $id); - } -} +_acl = new Zend_Acl(); + $xml = simplexml_load_file($rolefile); +/* +Roles file format: + + + + + + + + +*/ + foreach($xml->role as $role) { + $this->_acl->addRole(new Zend_Acl_Role((string)$role["id"])); + foreach($role->user as $user) { + $this->_users[(string)$user["name"]] = array("password" => (string)$user["password"], + "role" => (string)$role["id"]); + } + } + } + + /** + * Get ACL with roles from XML file + * + * @return Zend_Acl + */ + public function getAcl() + { + return $this->_acl; + } + + /** + * Perform authentication + * + * @throws Zend_Auth_Adapter_Exception + * @return Zend_Auth_Result + * @see Zend_Auth_Adapter_Interface#authenticate() + */ + public function authenticate() + { + if (empty($this->_username) || + empty($this->_password)) { + /** + * @see Zend_Auth_Adapter_Exception + */ + require_once 'Zend/Auth/Adapter/Exception.php'; + throw new Zend_Auth_Adapter_Exception('Username/password should be set'); + } + + if(!isset($this->_users[$this->_username])) { + return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND, + null, + array('Username not found') + ); + } + + $user = $this->_users[$this->_username]; + if($user["password"] != $this->_password) { + return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID, + null, + array('Authentication failed') + ); + } + + $id = new stdClass(); + $id->role = $user["role"]; + $id->name = $this->_username; + return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, $id); + } +} diff --git a/lib/zend/Zend/Amf/Adobe/DbInspector.php b/lib/zend/Zend/Amf/Adobe/DbInspector.php index 9a0b4743115..fb540c5064b 100755 --- a/lib/zend/Zend/Amf/Adobe/DbInspector.php +++ b/lib/zend/Zend/Amf/Adobe/DbInspector.php @@ -1,103 +1,103 @@ -describeTable('Pdo_Mysql', - * array( - * 'host' => '127.0.0.1', - * 'username' => 'webuser', - * 'password' => 'xxxxxxxx', - * 'dbname' => 'test' - * ), - * 'mytable' - * ); - * - * @param string $dbType Database adapter type for Zend_Db - * @param array|object $dbDescription Adapter-specific connection settings - * @param string $tableName Table name - * @return array Table description - * @see Zend_Db::describeTable() - * @see Zend_Db::factory() - */ - public function describeTable($dbType, $dbDescription, $tableName) - { - $db = $this->_connect($dbType, $dbDescription); - return $db->describeTable($tableName); - } - - /** - * Test database connection - * - * @param string $dbType Database adapter type for Zend_Db - * @param array|object $dbDescription Adapter-specific connection settings - * @return bool - * @see Zend_Db::factory() - */ - public function connect($dbType, $dbDescription) - { - $db = $this->_connect($dbType, $dbDescription); - $db->listTables(); - return true; - } - - /** - * Get the list of database tables - * - * @param string $dbType Database adapter type for Zend_Db - * @param array|object $dbDescription Adapter-specific connection settings - * @return array List of the tables - */ - public function getTables($dbType, $dbDescription) - { - $db = $this->_connect($dbType, $dbDescription); - return $db->listTables(); - } -} +describeTable('Pdo_Mysql', + * array( + * 'host' => '127.0.0.1', + * 'username' => 'webuser', + * 'password' => 'xxxxxxxx', + * 'dbname' => 'test' + * ), + * 'mytable' + * ); + * + * @param string $dbType Database adapter type for Zend_Db + * @param array|object $dbDescription Adapter-specific connection settings + * @param string $tableName Table name + * @return array Table description + * @see Zend_Db::describeTable() + * @see Zend_Db::factory() + */ + public function describeTable($dbType, $dbDescription, $tableName) + { + $db = $this->_connect($dbType, $dbDescription); + return $db->describeTable($tableName); + } + + /** + * Test database connection + * + * @param string $dbType Database adapter type for Zend_Db + * @param array|object $dbDescription Adapter-specific connection settings + * @return bool + * @see Zend_Db::factory() + */ + public function connect($dbType, $dbDescription) + { + $db = $this->_connect($dbType, $dbDescription); + $db->listTables(); + return true; + } + + /** + * Get the list of database tables + * + * @param string $dbType Database adapter type for Zend_Db + * @param array|object $dbDescription Adapter-specific connection settings + * @return array List of the tables + */ + public function getTables($dbType, $dbDescription) + { + $db = $this->_connect($dbType, $dbDescription); + return $db->listTables(); + } +} diff --git a/lib/zend/Zend/Amf/Adobe/Introspector.php b/lib/zend/Zend/Amf/Adobe/Introspector.php index 988c5576f66..f734db1300f 100755 --- a/lib/zend/Zend/Amf/Adobe/Introspector.php +++ b/lib/zend/Zend/Amf/Adobe/Introspector.php @@ -1,309 +1,309 @@ -_xml = new DOMDocument('1.0', 'utf-8'); - } - - /** - * Create XML definition on an AMF service class - * - * @param string $serviceClass Service class name - * @param array $options invocation options - * @return string XML with service class introspection - */ - public function introspect($serviceClass, $options = array()) - { - $this->_options = $options; - - if (strpbrk($serviceClass, '\\/<>')) { - return $this->_returnError('Invalid service name'); - } - - // Transform com.foo.Bar into com_foo_Bar - $serviceClass = str_replace('.' , '_', $serviceClass); - - // Introspect! - if (!class_exists($serviceClass)) { - require_once 'Zend/Loader.php'; - Zend_Loader::loadClass($serviceClass, $this->_getServicePath()); - } - - $serv = $this->_xml->createElement('service-description'); - $serv->setAttribute('xmlns', 'http://ns.adobe.com/flex/service-description/2008'); - - $this->_types = $this->_xml->createElement('types'); - $this->_ops = $this->_xml->createElement('operations'); - - $r = Zend_Server_Reflection::reflectClass($serviceClass); - $this->_addService($r, $this->_ops); - - $serv->appendChild($this->_types); - $serv->appendChild($this->_ops); - $this->_xml->appendChild($serv); - - return $this->_xml->saveXML(); - } - - /** - * Authentication handler - * - * @param Zend_Acl $acl - * @return unknown_type - */ - public function initAcl(Zend_Acl $acl) - { - return false; // we do not need auth for this class - } - - /** - * Generate map of public class attributes - * - * @param string $typename type name - * @param DOMElement $typexml target XML element - * @return void - */ - protected function _addClassAttributes($typename, DOMElement $typexml) - { - // Do not try to autoload here because _phpTypeToAS should - // have already attempted to load this class - if (!class_exists($typename, false)) { - return; - } - - $rc = new Zend_Reflection_Class($typename); - foreach ($rc->getProperties() as $prop) { - if (!$prop->isPublic()) { - continue; - } - - $propxml = $this->_xml->createElement('property'); - $propxml->setAttribute('name', $prop->getName()); - - $type = $this->_registerType($this->_getPropertyType($prop)); - $propxml->setAttribute('type', $type); - - $typexml->appendChild($propxml); - } - } - - /** - * Build XML service description from reflection class - * - * @param Zend_Server_Reflection_Class $refclass - * @param DOMElement $target target XML element - * @return void - */ - protected function _addService(Zend_Server_Reflection_Class $refclass, DOMElement $target) - { - foreach ($refclass->getMethods() as $method) { - if (!$method->isPublic() - || $method->isConstructor() - || ('__' == substr($method->name, 0, 2)) - ) { - continue; - } - - foreach ($method->getPrototypes() as $proto) { - $op = $this->_xml->createElement('operation'); - $op->setAttribute('name', $method->getName()); - - $rettype = $this->_registerType($proto->getReturnType()); - $op->setAttribute('returnType', $rettype); - - foreach ($proto->getParameters() as $param) { - $arg = $this->_xml->createElement('argument'); - $arg->setAttribute('name', $param->getName()); - - $type = $param->getType(); - if ($type == 'mixed' && ($pclass = $param->getClass())) { - $type = $pclass->getName(); - } - - $ptype = $this->_registerType($type); - $arg->setAttribute('type', $ptype); - - $op->appendChild($arg); - } - - $target->appendChild($op); - } - } - } - - /** - * Extract type of the property from DocBlock - * - * @param Zend_Reflection_Property $prop reflection property object - * @return string Property type - */ - protected function _getPropertyType(Zend_Reflection_Property $prop) - { - $docBlock = $prop->getDocComment(); - - if (!$docBlock) { - return 'Unknown'; - } - - if (!$docBlock->hasTag('var')) { - return 'Unknown'; - } - - $tag = $docBlock->getTag('var'); - return trim($tag->getDescription()); - } - - /** - * Get the array of service directories - * - * @return array Service class directories - */ - protected function _getServicePath() - { - if (isset($this->_options['server'])) { - return $this->_options['server']->getDirectory(); - } - - if (isset($this->_options['directories'])) { - return $this->_options['directories']; - } - - return array(); - } - - /** - * Map from PHP type name to AS type name - * - * @param string $typename PHP type name - * @return string AS type name - */ - protected function _phpTypeToAS($typename) - { - if (class_exists($typename)) { - $vars = get_class_vars($typename); - - if (isset($vars['_explicitType'])) { - return $vars['_explicitType']; - } - } - - if (false !== ($asname = Zend_Amf_Parse_TypeLoader::getMappedClassName($typename))) { - return $asname; - } - - return $typename; - } - - /** - * Register new type on the system - * - * @param string $typename type name - * @return string New type name - */ - protected function _registerType($typename) - { - // Known type - return its AS name - if (isset($this->_typesMap[$typename])) { - return $this->_typesMap[$typename]; - } - - // Standard types - if (in_array($typename, array('void', 'null', 'mixed', 'unknown_type'))) { - return 'Unknown'; - } - - if (in_array($typename, array('int', 'integer', 'bool', 'boolean', 'float', 'string', 'object', 'Unknown', 'stdClass', 'array'))) { - return $typename; - } - - // Resolve and store AS name - $asTypeName = $this->_phpTypeToAS($typename); - $this->_typesMap[$typename] = $asTypeName; - - // Create element for the name - $typeEl = $this->_xml->createElement('type'); - $typeEl->setAttribute('name', $asTypeName); - $this->_addClassAttributes($typename, $typeEl); - $this->_types->appendChild($typeEl); - - return $asTypeName; - } - - /** - * Return error with error message - * - * @param string $msg Error message - * @return string - */ - protected function _returnError($msg) - { - return 'ERROR: $msg'; - } -} +_xml = new DOMDocument('1.0', 'utf-8'); + } + + /** + * Create XML definition on an AMF service class + * + * @param string $serviceClass Service class name + * @param array $options invocation options + * @return string XML with service class introspection + */ + public function introspect($serviceClass, $options = array()) + { + $this->_options = $options; + + if (strpbrk($serviceClass, '\\/<>')) { + return $this->_returnError('Invalid service name'); + } + + // Transform com.foo.Bar into com_foo_Bar + $serviceClass = str_replace('.' , '_', $serviceClass); + + // Introspect! + if (!class_exists($serviceClass)) { + require_once 'Zend/Loader.php'; + Zend_Loader::loadClass($serviceClass, $this->_getServicePath()); + } + + $serv = $this->_xml->createElement('service-description'); + $serv->setAttribute('xmlns', 'http://ns.adobe.com/flex/service-description/2008'); + + $this->_types = $this->_xml->createElement('types'); + $this->_ops = $this->_xml->createElement('operations'); + + $r = Zend_Server_Reflection::reflectClass($serviceClass); + $this->_addService($r, $this->_ops); + + $serv->appendChild($this->_types); + $serv->appendChild($this->_ops); + $this->_xml->appendChild($serv); + + return $this->_xml->saveXML(); + } + + /** + * Authentication handler + * + * @param Zend_Acl $acl + * @return unknown_type + */ + public function initAcl(Zend_Acl $acl) + { + return false; // we do not need auth for this class + } + + /** + * Generate map of public class attributes + * + * @param string $typename type name + * @param DOMElement $typexml target XML element + * @return void + */ + protected function _addClassAttributes($typename, DOMElement $typexml) + { + // Do not try to autoload here because _phpTypeToAS should + // have already attempted to load this class + if (!class_exists($typename, false)) { + return; + } + + $rc = new Zend_Reflection_Class($typename); + foreach ($rc->getProperties() as $prop) { + if (!$prop->isPublic()) { + continue; + } + + $propxml = $this->_xml->createElement('property'); + $propxml->setAttribute('name', $prop->getName()); + + $type = $this->_registerType($this->_getPropertyType($prop)); + $propxml->setAttribute('type', $type); + + $typexml->appendChild($propxml); + } + } + + /** + * Build XML service description from reflection class + * + * @param Zend_Server_Reflection_Class $refclass + * @param DOMElement $target target XML element + * @return void + */ + protected function _addService(Zend_Server_Reflection_Class $refclass, DOMElement $target) + { + foreach ($refclass->getMethods() as $method) { + if (!$method->isPublic() + || $method->isConstructor() + || ('__' == substr($method->name, 0, 2)) + ) { + continue; + } + + foreach ($method->getPrototypes() as $proto) { + $op = $this->_xml->createElement('operation'); + $op->setAttribute('name', $method->getName()); + + $rettype = $this->_registerType($proto->getReturnType()); + $op->setAttribute('returnType', $rettype); + + foreach ($proto->getParameters() as $param) { + $arg = $this->_xml->createElement('argument'); + $arg->setAttribute('name', $param->getName()); + + $type = $param->getType(); + if ($type == 'mixed' && ($pclass = $param->getClass())) { + $type = $pclass->getName(); + } + + $ptype = $this->_registerType($type); + $arg->setAttribute('type', $ptype); + + $op->appendChild($arg); + } + + $target->appendChild($op); + } + } + } + + /** + * Extract type of the property from DocBlock + * + * @param Zend_Reflection_Property $prop reflection property object + * @return string Property type + */ + protected function _getPropertyType(Zend_Reflection_Property $prop) + { + $docBlock = $prop->getDocComment(); + + if (!$docBlock) { + return 'Unknown'; + } + + if (!$docBlock->hasTag('var')) { + return 'Unknown'; + } + + $tag = $docBlock->getTag('var'); + return trim($tag->getDescription()); + } + + /** + * Get the array of service directories + * + * @return array Service class directories + */ + protected function _getServicePath() + { + if (isset($this->_options['server'])) { + return $this->_options['server']->getDirectory(); + } + + if (isset($this->_options['directories'])) { + return $this->_options['directories']; + } + + return array(); + } + + /** + * Map from PHP type name to AS type name + * + * @param string $typename PHP type name + * @return string AS type name + */ + protected function _phpTypeToAS($typename) + { + if (class_exists($typename)) { + $vars = get_class_vars($typename); + + if (isset($vars['_explicitType'])) { + return $vars['_explicitType']; + } + } + + if (false !== ($asname = Zend_Amf_Parse_TypeLoader::getMappedClassName($typename))) { + return $asname; + } + + return $typename; + } + + /** + * Register new type on the system + * + * @param string $typename type name + * @return string New type name + */ + protected function _registerType($typename) + { + // Known type - return its AS name + if (isset($this->_typesMap[$typename])) { + return $this->_typesMap[$typename]; + } + + // Standard types + if (in_array($typename, array('void', 'null', 'mixed', 'unknown_type'))) { + return 'Unknown'; + } + + if (in_array($typename, array('int', 'integer', 'bool', 'boolean', 'float', 'string', 'object', 'Unknown', 'stdClass', 'array'))) { + return $typename; + } + + // Resolve and store AS name + $asTypeName = $this->_phpTypeToAS($typename); + $this->_typesMap[$typename] = $asTypeName; + + // Create element for the name + $typeEl = $this->_xml->createElement('type'); + $typeEl->setAttribute('name', $asTypeName); + $this->_addClassAttributes($typename, $typeEl); + $this->_types->appendChild($typeEl); + + return $asTypeName; + } + + /** + * Return error with error message + * + * @param string $msg Error message + * @return string + */ + protected function _returnError($msg) + { + return 'ERROR: $msg'; + } +} diff --git a/lib/zend/Zend/Amf/Auth/Abstract.php b/lib/zend/Zend/Amf/Auth/Abstract.php index 7bc5744824c..8fe0ead27d1 100755 --- a/lib/zend/Zend/Amf/Auth/Abstract.php +++ b/lib/zend/Zend/Amf/Auth/Abstract.php @@ -1,42 +1,42 @@ -_username = $username; - $this->_password = $password; - } -} +_username = $username; + $this->_password = $password; + } +} diff --git a/lib/zend/Zend/Amf/Parse/Resource/MysqlResult.php b/lib/zend/Zend/Amf/Parse/Resource/MysqlResult.php index ed4656f1102..d4f9bf4b134 100755 --- a/lib/zend/Zend/Amf/Parse/Resource/MysqlResult.php +++ b/lib/zend/Zend/Amf/Parse/Resource/MysqlResult.php @@ -1,70 +1,70 @@ - Value is Mysql type (exact string) => PHP type - */ - static public $fieldTypes = array( - "int" => "int", - "timestamp" => "int", - "year" => "int", - "real" => "float", - ); - /** - * Parse resource into array - * - * @param resource $resource - * @return array - */ - public function parse($resource) { - $result = array(); - $fieldcnt = mysql_num_fields($resource); - $fields_transform = array(); - for($i=0;$i<$fieldcnt;$i++) { - $type = mysql_field_type($resource, $i); - if(isset(self::$fieldTypes[$type])) { - $fields_transform[mysql_field_name($resource, $i)] = self::$fieldTypes[$type]; - } - } - - while($row = mysql_fetch_object($resource)) { - foreach($fields_transform as $fieldname => $fieldtype) { - settype($row->$fieldname, $fieldtype); - } - $result[] = $row; - } - return $result; - } -} + Value is Mysql type (exact string) => PHP type + */ + static public $fieldTypes = array( + "int" => "int", + "timestamp" => "int", + "year" => "int", + "real" => "float", + ); + /** + * Parse resource into array + * + * @param resource $resource + * @return array + */ + public function parse($resource) { + $result = array(); + $fieldcnt = mysql_num_fields($resource); + $fields_transform = array(); + for($i=0;$i<$fieldcnt;$i++) { + $type = mysql_field_type($resource, $i); + if(isset(self::$fieldTypes[$type])) { + $fields_transform[mysql_field_name($resource, $i)] = self::$fieldTypes[$type]; + } + } + + while($row = mysql_fetch_object($resource)) { + foreach($fields_transform as $fieldname => $fieldtype) { + settype($row->$fieldname, $fieldtype); + } + $result[] = $row; + } + return $result; + } +} diff --git a/lib/zend/Zend/Amf/Parse/Resource/Stream.php b/lib/zend/Zend/Amf/Parse/Resource/Stream.php index 9f269603b89..007df138f8c 100755 --- a/lib/zend/Zend/Amf/Parse/Resource/Stream.php +++ b/lib/zend/Zend/Amf/Parse/Resource/Stream.php @@ -1,42 +1,42 @@ - - * This Message structure defines how a local client would - * invoke a method/operation on a remote server. Additionally, - * the response from the Server is structured identically. - * - * @package Zend_Amf - * @subpackage Value - * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License - */ -class Zend_Amf_Value_MessageBody -{ - /** - * A string describing which operation, function, or method - * is to be remotley invoked. - * @var string - */ - protected $_targetUri = ""; - - /** - * Universal Resource Identifier that uniquely targets the originator's - * Object that should receive the server's response. The server will - * use this path specification to target the "OnResult()" or "onStatus()" - * handlers within the client. For Flash, it specifies an ActionScript - * Object path only. The NetResponse object pointed to by the Response Uri - * contains the connection state information. Passing/specifying this - * provides a convenient mechanism for the client/server to share access - * to an object that is managing the state of the shared connection. - * - * Since the server will use this field in the event of an error, - * this field is required even if a successful server request would - * not be expected to return a value to the client. - * - * @var string - */ - protected $_responseUri = ""; - - /** - * Contains the actual data associated with the operation. It contains - * the client's parameter data that is passed to the server's operation/method. - * When serializing a root level data type or a parameter list array, no - * name field is included. That is, the data is anonomously represented - * as "Type Marker"/"Value" pairs. When serializing member data, the data is - * represented as a series of "Name"/"Type"/"Value" combinations. - * - * For server generated responses, it may contain any ActionScript - * data/objects that the server was expected to provide. - * - * @var string - */ - protected $_data; - - /** - * Constructor - * - * @param string $targetUri - * @param string $responseUri - * @param string $data - * @return void - */ - public function __construct($targetUri, $responseUri, $data) - { - $this->setTargetUri($targetUri); - $this->setResponseUri($responseUri); - $this->setData($data); - } - - /** - * Retrieve target Uri - * - * @return string - */ - public function getTargetUri() - { - return $this->_targetUri; - } - - /** - * Set target Uri - * - * @param string $targetUri - * @return Zend_Amf_Value_MessageBody - */ - public function setTargetUri($targetUri) - { - if (null === $targetUri) { - $targetUri = ''; - } - $this->_targetUri = (string) $targetUri; - return $this; - } - - /** - * Get target Uri - * - * @return string - */ - public function getResponseUri() - { - return $this->_responseUri; - } - - /** - * Set response Uri - * - * @param string $responseUri - * @return Zend_Amf_Value_MessageBody - */ - public function setResponseUri($responseUri) - { - if (null === $responseUri) { - $responseUri = ''; - } - $this->_responseUri = $responseUri; - return $this; - } - - /** - * Retrieve response data - * - * @return string - */ - public function getData() - { - return $this->_data; - } - - /** - * Set response data - * - * @param mixed $data - * @return Zend_Amf_Value_MessageBody - */ - public function setData($data) - { - $this->_data = $data; - return $this; - } - - /** - * Set reply method - * - * @param string $methodName - * @return Zend_Amf_Value_MessageBody - */ - public function setReplyMethod($methodName) - { - if (!preg_match('#^[/?]#', $methodName)) { - $this->_targetUri = rtrim($this->_targetUri, '/') . '/'; - } - $this->_targetUri = $this->_targetUri . $methodName; - return $this; - } -} + + * This Message structure defines how a local client would + * invoke a method/operation on a remote server. Additionally, + * the response from the Server is structured identically. + * + * @package Zend_Amf + * @subpackage Value + * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Amf_Value_MessageBody +{ + /** + * A string describing which operation, function, or method + * is to be remotley invoked. + * @var string + */ + protected $_targetUri = ""; + + /** + * Universal Resource Identifier that uniquely targets the originator's + * Object that should receive the server's response. The server will + * use this path specification to target the "OnResult()" or "onStatus()" + * handlers within the client. For Flash, it specifies an ActionScript + * Object path only. The NetResponse object pointed to by the Response Uri + * contains the connection state information. Passing/specifying this + * provides a convenient mechanism for the client/server to share access + * to an object that is managing the state of the shared connection. + * + * Since the server will use this field in the event of an error, + * this field is required even if a successful server request would + * not be expected to return a value to the client. + * + * @var string + */ + protected $_responseUri = ""; + + /** + * Contains the actual data associated with the operation. It contains + * the client's parameter data that is passed to the server's operation/method. + * When serializing a root level data type or a parameter list array, no + * name field is included. That is, the data is anonomously represented + * as "Type Marker"/"Value" pairs. When serializing member data, the data is + * represented as a series of "Name"/"Type"/"Value" combinations. + * + * For server generated responses, it may contain any ActionScript + * data/objects that the server was expected to provide. + * + * @var string + */ + protected $_data; + + /** + * Constructor + * + * @param string $targetUri + * @param string $responseUri + * @param string $data + * @return void + */ + public function __construct($targetUri, $responseUri, $data) + { + $this->setTargetUri($targetUri); + $this->setResponseUri($responseUri); + $this->setData($data); + } + + /** + * Retrieve target Uri + * + * @return string + */ + public function getTargetUri() + { + return $this->_targetUri; + } + + /** + * Set target Uri + * + * @param string $targetUri + * @return Zend_Amf_Value_MessageBody + */ + public function setTargetUri($targetUri) + { + if (null === $targetUri) { + $targetUri = ''; + } + $this->_targetUri = (string) $targetUri; + return $this; + } + + /** + * Get target Uri + * + * @return string + */ + public function getResponseUri() + { + return $this->_responseUri; + } + + /** + * Set response Uri + * + * @param string $responseUri + * @return Zend_Amf_Value_MessageBody + */ + public function setResponseUri($responseUri) + { + if (null === $responseUri) { + $responseUri = ''; + } + $this->_responseUri = $responseUri; + return $this; + } + + /** + * Retrieve response data + * + * @return string + */ + public function getData() + { + return $this->_data; + } + + /** + * Set response data + * + * @param mixed $data + * @return Zend_Amf_Value_MessageBody + */ + public function setData($data) + { + $this->_data = $data; + return $this; + } + + /** + * Set reply method + * + * @param string $methodName + * @return Zend_Amf_Value_MessageBody + */ + public function setReplyMethod($methodName) + { + if (!preg_match('#^[/?]#', $methodName)) { + $this->_targetUri = rtrim($this->_targetUri, '/') . '/'; + } + $this->_targetUri = $this->_targetUri . $methodName; + return $this; + } +} diff --git a/lib/zend/Zend/Amf/Value/Messaging/CommandMessage.php b/lib/zend/Zend/Amf/Value/Messaging/CommandMessage.php index 3779a55c0f1..a8e2d828a3a 100644 --- a/lib/zend/Zend/Amf/Value/Messaging/CommandMessage.php +++ b/lib/zend/Zend/Amf/Value/Messaging/CommandMessage.php @@ -1,131 +1,131 @@ -body - * of the message. - * @const int - */ - const LOGIN_OPERATION = 8; - - /** - * This operation is used to log the user out of the current channel, and - * will invalidate the server session if the channel is HTTP based. - * @const int - */ - const LOGOUT_OPERATION = 9; - - /** - * This operation is used to indicate that the client's subscription to a - * remote destination has been invalidated. - * @const int - */ - const SESSION_INVALIDATE_OPERATION = 10; - - /** - * This operation is used by the MultiTopicConsumer to subscribe/unsubscribe - * from multiple subtopics/selectors in the same message. - * @const int - */ - const MULTI_SUBSCRIBE_OPERATION = 11; - - /** - * This operation is used to indicate that a channel has disconnected - * @const int - */ - const DISCONNECT_OPERATION = 12; - - /** - * This is the default operation for new CommandMessage instances. - * @const int - */ - const UNKNOWN_OPERATION = 10000; - - /** - * The operation to execute for messages of this type - * @var int - */ - public $operation = self::UNKNOWN_OPERATION; -} + */ +require_once 'Zend/Amf/Value/Messaging/AsyncMessage.php'; + +/** + * A message that represents an infrastructure command passed between + * client and server. Subscribe/unsubscribe operations result in + * CommandMessage transmissions, as do polling operations. + * + * Corresponds to flex.messaging.messages.CommandMessage + * + * Note: THESE VALUES MUST BE THE SAME ON CLIENT AND SERVER + * + * @package Zend_Amf + * @subpackage Value + * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Amf_Value_Messaging_CommandMessage extends Zend_Amf_Value_Messaging_AsyncMessage +{ + /** + * This operation is used to subscribe to a remote destination. + * @const int + */ + const SUBSCRIBE_OPERATION = 0; + + /** + * This operation is used to unsubscribe from a remote destination. + * @const int + */ + const UNSUSBSCRIBE_OPERATION = 1; + + /** + * This operation is used to poll a remote destination for pending, + * undelivered messages. + * @const int + */ + const POLL_OPERATION = 2; + + /** + * This operation is used by a remote destination to sync missed or cached messages + * back to a client as a result of a client issued poll command. + * @const int + */ + const CLIENT_SYNC_OPERATION = 4; + + /** + * This operation is used to test connectivity over the current channel to + * the remote endpoint. + * @const int + */ + const CLIENT_PING_OPERATION = 5; + + /** + * This operation is used to request a list of failover endpoint URIs + * for the remote destination based on cluster membership. + * @const int + */ + const CLUSTER_REQUEST_OPERATION = 7; + + /** + * This operation is used to send credentials to the endpoint so that + * the user can be logged in over the current channel. + * The credentials need to be Base64 encoded and stored in the body + * of the message. + * @const int + */ + const LOGIN_OPERATION = 8; + + /** + * This operation is used to log the user out of the current channel, and + * will invalidate the server session if the channel is HTTP based. + * @const int + */ + const LOGOUT_OPERATION = 9; + + /** + * This operation is used to indicate that the client's subscription to a + * remote destination has been invalidated. + * @const int + */ + const SESSION_INVALIDATE_OPERATION = 10; + + /** + * This operation is used by the MultiTopicConsumer to subscribe/unsubscribe + * from multiple subtopics/selectors in the same message. + * @const int + */ + const MULTI_SUBSCRIBE_OPERATION = 11; + + /** + * This operation is used to indicate that a channel has disconnected + * @const int + */ + const DISCONNECT_OPERATION = 12; + + /** + * This is the default operation for new CommandMessage instances. + * @const int + */ + const UNKNOWN_OPERATION = 10000; + + /** + * The operation to execute for messages of this type + * @var int + */ + public $operation = self::UNKNOWN_OPERATION; +} diff --git a/lib/zend/Zend/Amf/Value/Messaging/ErrorMessage.php b/lib/zend/Zend/Amf/Value/Messaging/ErrorMessage.php index d0f04c769a4..bc4d3ec1be8 100644 --- a/lib/zend/Zend/Amf/Value/Messaging/ErrorMessage.php +++ b/lib/zend/Zend/Amf/Value/Messaging/ErrorMessage.php @@ -1,67 +1,67 @@ -