TYPO3 API  SVNRelease
Public Member Functions | Public Attributes | Protected Member Functions
tx_tsconfighelp_module1 Class Reference
Inheritance diagram for tx_tsconfighelp_module1:
Inheritance graph
[legend]
Collaboration diagram for tx_tsconfighelp_module1:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 init ()
 menuConfig ()
 main ()
 printContent ()
 moduleContent ()
 getZIPFileContents ($ZIPfile, $filename)
 unzip ($file, $path)
 parseStyles ($vals)
 isStyleChildOf ($child, $parent)
 nextTSDefinitionTable ($vals, $index, &$id)
 styleTags ($node)
 styleHTML ($style, $char)
 HSCtext ($text)
 parseTable ($vals, $start, $end)
 dumpIntoSQL ($extension, $table, $tableName)
 purgeSQLContents ($extension='')
 loadExtensionManual ($extension, $contents)

Public Attributes

 $pageinfo
 $objStringsPerExtension = array()
 $allObjStrings = array()

Protected Member Functions

 getButtons ()

Detailed Description

Definition at line 44 of file index.php.


Member Function Documentation

tx_tsconfighelp_module1::dumpIntoSQL ( extension,
table,
tableName 
)

Load the contents of the table into the SQL database

Parameters:
stringName of the extension to load the documentation for. This is used to make the unique hash in the database
arrayContents of the documentation table
stringName of the table from the source document (name at the bottom of the table in OpenOffice)
Returns:
boolean TRUE on success and FALSE on failure from the INSERT database query

Definition at line 670 of file index.php.

References $GLOBALS, and $row.

Referenced by loadExtensionManual().

tx_tsconfighelp_module1::getButtons ( ) [protected]

Create the panel of buttons for submitting the form or otherwise perform operations.

Returns:
array all available buttons as an assoc. array

Definition at line 157 of file index.php.

References $BACK_PATH, $BE_USER, and $TCA.

Referenced by main().

tx_tsconfighelp_module1::getZIPFileContents ( ZIPfile,
filename 
)

Returns the contents of a specific file within the ZIP

Returns:
string contents

Definition at line 279 of file index.php.

References t3lib_utility_Command\exec(), t3lib_div\getURL(), t3lib_div\mkdir(), and unzip().

Referenced by moduleContent().

tx_tsconfighelp_module1::HSCtext ( text)

This function does a little more than just HSC'ing the text passed to it. It does a general cleaning of the input: htmlspecialchars() : general cleaning for the HTML display, including single quotes transformation stripslashes() : otherwise the backslashes will cause an issue with a future unserialize of the data &nbsp if empty : if the input is empty, we return a   string so that in the HTML output something will be displayed utf8 to entities cleaning : in some SXW docs we can find UTF8 characters that need to be converted to be displayed on screen

Parameters:
stringText that will need to be transformed according to the HSC and other rules
Returns:
string Transformed text that can now be freely serialized or exported to HTML

Definition at line 500 of file index.php.

tx_tsconfighelp_module1::init ( )

Initializes the Module

Returns:
void

Reimplemented from t3lib_SCbase.

Definition at line 53 of file index.php.

References $BACK_PATH, $BE_USER, $CLIENT, $TCA, and $TYPO3_CONF_VARS.

tx_tsconfighelp_module1::isStyleChildOf ( child,
parent 
)

Checks if the style is a child of a specified parent. This is useful for example to check if a specific style that has a generic name ("P8" for example) is a child of the "Table Contents" style. It would not only inherit its style (bold/ italic) but also its properties like being part of a Table.

This function references the global $Styles variables which must have been created previously with parseStyles()

Parameters:
stringName of the child style that we want to get properties for
stringName of the parent style that we want to compare the child against
Returns:
boolean true if the child and parent are linked together. false otherwise.

Definition at line 394 of file index.php.

Referenced by nextTSDefinitionTable().

tx_tsconfighelp_module1::loadExtensionManual ( extension,
contents 
)

This is the main function of the loading process. It will first parse the input data and load it into an XML array. It will then find all the styles associated with the contents so that later on we can distinguish bold and italic characters for example. It then parses the XML array to find all the TS-like description tables and parses them before loading them into the SQL database.

Parameters:
stringName of the extension to load manual from
stringInput data from the manual.sxw in a string form. One large string with the whole OO manual document.
Returns:
integer Number of individual tables found in the document and loaded into the SQL database

Definition at line 749 of file index.php.

References t3lib_SCbase\$id, dumpIntoSQL(), nextTSDefinitionTable(), parseStyles(), and parseTable().

Referenced by moduleContent().

tx_tsconfighelp_module1::main ( )

Main function of the module. Write the content to $this->content

Returns:
void

Definition at line 83 of file index.php.

References $BACK_PATH, $BE_USER, $CLIENT, $TCA, $TYPO3_CONF_VARS, t3lib_div\fixed_lgd_cs(), getButtons(), t3lib_BEfunc\getFuncMenu(), t3lib_div\makeInstance(), and moduleContent().

tx_tsconfighelp_module1::menuConfig ( )

Adds items to the ->MOD_MENU array. Used for the function menu selector.

Returns:
void

Reimplemented from t3lib_SCbase.

Definition at line 63 of file index.php.

References $GLOBALS.

tx_tsconfighelp_module1::moduleContent ( )
tx_tsconfighelp_module1::nextTSDefinitionTable ( vals,
index,
&$  id 
)

Find the table description that we want, then find a TABLE:TABLE close, immediately followed by a TEXT:P which has a style which is a child of a "Table Contents", then look up the index to find where the TABLE begins, and start browsing from there (returns these start and end indexes).

This function only finds the next TS definition table. In order to find all TS definition tables from the document, the function needs to be called several times, starting where it left off last time. The third parameter is the index that is used to indicate where to start, and which is modified when the function returns to indicate where we left off.

This function uses the unusual index XML array in addition to the values, this is necessary to find where in the XML tree a TABLE starts once we found where it ends.

Parameters:
arrayThe XML values array
arrayThe XML index array
integerThis is a reference to the index in the array where we should be starting the search
Returns:
array Array of the table start index and table end index where TS is defined. table start is FALSE if there are no more TS entries in the document (consider it similar to an EOF reached status).

Definition at line 426 of file index.php.

References t3lib_SCbase\$id, and isStyleChildOf().

Referenced by loadExtensionManual().

tx_tsconfighelp_module1::parseStyles ( vals)

Parses the whole XML file in order to understand the Styles structure. This function is mostly looking at the styles that create bold or italic characters in the document, as these will later on need to be translated to and tags This function takes into account the hierarchy of the styles, as created by OpenOffice. This means that if a style has a parant, this function will make it inherit the styles of the parent. Therefore bold and italic styles are propagated to children as well.

This function assumes the STYLE definitions are not nested. If they are then, then "close" type will need to be used more carefully, and a depth counter will need to be implemented.

Parameters:
arrayThe XML values array. The XML index is not necessary in this function.
Returns:
array Array that contains the different styles with their parent (required to recognise "Table Contents"-type styles), and their style (bold/italic)

Definition at line 329 of file index.php.

Referenced by loadExtensionManual().

tx_tsconfighelp_module1::parseTable ( vals,
start,
end 
)

This function parses a Table from an Open Office document, in an XML format, and extracts the information. It will therefore crawl the XML tree and aggregate all the accepted contents into an array with the table contents.

This function needs to extract the following information from the TABLE: property => (column 1) datatype => (column 2) description => (column 3) default => (column 4) column_count => number of columns found in table. Usually 4, but for spanned columns, it would be less (1 for example) is_propertyTable => ??? (almost always equal to 1)

Parameters:
arrayThis is the input XML data that is to be parsed
integerThe starting ID in the XML array to parse the data from
integerThe ending ID in the XML array to stop parsing data
Returns:
array An array with the contents of the different columns extracted from the input data

Definition at line 528 of file index.php.

References t3lib_SCbase\$id, styleHTML(), and styleTags().

Referenced by loadExtensionManual().

tx_tsconfighelp_module1::printContent ( )

Prints out the module HTML

Returns:
void

Definition at line 148 of file index.php.

tx_tsconfighelp_module1::purgeSQLContents ( extension = '')

Purges the existing contents for TypoScript help in the database. This ensures that several runs of the import process will not push duplicate information in the database, but that we clean it first before adding new contents.

Parameters:
stringName of the extension for which to delete all the data in the database. If empty, all database will be cleaned
Returns:
void

Definition at line 731 of file index.php.

References $GLOBALS.

Referenced by moduleContent().

tx_tsconfighelp_module1::styleHTML ( style,
char 
)

Converts an array containing style strings (for example ['b','i']) into their HTML equivalents

Parameters:
arrayan array containing all the style tags
stringeither '' or '/' depending on whether the style definition is to open or close the style
Returns:
string the sequence of tags to open or close the style, for example

Definition at line 480 of file index.php.

Referenced by parseTable().

tx_tsconfighelp_module1::styleTags ( node)

Converts an Open Office like style (font-weight:bold for example) into an HTML style (b is for bold). This function uses the global $Styles defined through the parseStyles function

Parameters:
arrayan array containing the [attributes][style] items in the OO format
Returns:
array an array where the items are all the HTML styles to apply to closely match the input OO-like styles

Definition at line 453 of file index.php.

Referenced by parseTable().

tx_tsconfighelp_module1::unzip ( file,
path 
)

Unzips a zip file in the given path. Uses the Extension Manager unzip functions.

Parameters:
string$fileFull path to zip file
string$pathPath to change to before extracting
Returns:
boolean True on success, false in failure

Definition at line 304 of file index.php.

References t3lib_extMgm\isLoaded(), t3lib_div\makeInstance(), and t3lib_div\requireOnce().

Referenced by getZIPFileContents().


Member Data Documentation

tx_tsconfighelp_module1::$allObjStrings = array()

Definition at line 47 of file index.php.

tx_tsconfighelp_module1::$objStringsPerExtension = array()

Definition at line 46 of file index.php.

tx_tsconfighelp_module1::$pageinfo

Definition at line 45 of file index.php.


The documentation for this class was generated from the following file: