Skip to content

Commit

Permalink
Added a new MOD text template parser and removed the old parser.
Browse files Browse the repository at this point in the history
Moved the functions for outputing the parser data to a new class.
  • Loading branch information
Jari Kanerva committed Dec 30, 2009
1 parent 145f7f1 commit 54e57d9
Show file tree
Hide file tree
Showing 8 changed files with 889 additions and 793 deletions.
4 changes: 2 additions & 2 deletions constants.php
Expand Up @@ -21,8 +21,8 @@

define('MOD', 1);
define('MODX', 2);
define('MODX_V1', 1);
define('MODX_V2', 2);
define('MODX_10', 1);
define('MODX_12', 2);

define('EASY', 1);
define('INTERMEDIATE', 2);
Expand Down
4 changes: 2 additions & 2 deletions functions.php
Expand Up @@ -294,11 +294,11 @@ function modx_version($xmlns)
{
if(preg_match('#modx\\-1\\.0(\\.\d)*\\.xsd#s', $xmlns))
{
return(MODX_V1);
return(MODX_10);
}
if(preg_match('#modx\\-1\\.2(\\.\d)\\.xsd#s', $xmlns))
{
return(MODX_V2);
return(MODX_12);
}
return(false);
}
Expand Down
7 changes: 5 additions & 2 deletions index.php
Expand Up @@ -30,7 +30,7 @@
{
// Lets start with the extension...
$extension = strtolower(array_pop(explode('.', $_FILES['upload-file']['name'])));
$str = file_get_contents($_FILES['upload-file']['tmp_name'], 0, NULL, 0, 20);
$str = file_get_contents($_FILES['upload-file']['tmp_name'], 0, NULL, 0, 200);

// We'll need to know what kind of file it is
$submit_file = get_mod_type($str, $extension);
Expand All @@ -56,7 +56,10 @@
}
else if($submit_file == MOD)
{
include('./read_mod.php');
include('./mod_parser.php');
$parser = new mod_parser($modx_data);

include('./read_modx.php');
}
else
{
Expand Down

0 comments on commit 54e57d9

Please sign in to comment.