| 19 |
require_once( $mainframe->getPath( 'admin_html' ) ); |
require_once( $mainframe->getPath( 'admin_html' ) ); |
| 20 |
require_once( $mosConfig_absolute_path .'/administrator/components/com_templates/admin.templates.class.php' ); |
require_once( $mosConfig_absolute_path .'/administrator/components/com_templates/admin.templates.class.php' ); |
| 21 |
// XML library |
// XML library |
| 22 |
require_once( $mosConfig_absolute_path .'/includes/domit/xml_domit_lite_include.php' ); |
//require_once( $mosConfig_absolute_path .'/includes/domit/xml_domit_lite_include.php' ); |
| 23 |
|
|
| 24 |
$task = trim( strtolower( mosGetParam( $_REQUEST, "task", "" ) ) ); |
$task = trim( strtolower( mosGetParam( $_REQUEST, "task", "" ) ) ); |
| 25 |
$cid = mosGetParam( $_REQUEST, "cid", array(0) ); |
$cid = mosGetParam( $_REQUEST, "cid", array(0) ); |
| 128 |
|
|
| 129 |
foreach($xmlFilesInDir as $xmlfile) { |
foreach($xmlFilesInDir as $xmlfile) { |
| 130 |
// Read the file to see if it's a valid template XML file |
// Read the file to see if it's a valid template XML file |
| 131 |
|
$parser =& new mosXMLDescription($dirName.$xmlfile); |
| 132 |
|
if ($parser->getType() != 'template') continue; |
| 133 |
|
/* |
| 134 |
$xmlDoc =& new DOMIT_Lite_Document(); |
$xmlDoc =& new DOMIT_Lite_Document(); |
| 135 |
$xmlDoc->resolveErrors( true ); |
$xmlDoc->resolveErrors( true ); |
| 136 |
if (!$xmlDoc->loadXML( $dirName . $xmlfile, false, true )) { |
if (!$xmlDoc->loadXML( $dirName . $xmlfile, false, true )) { |
| 145 |
if ($element->getAttribute( 'type' ) != 'template') { |
if ($element->getAttribute( 'type' ) != 'template') { |
| 146 |
continue; |
continue; |
| 147 |
} |
} |
| 148 |
|
*/ |
| 149 |
$row = new StdClass(); |
$row = new StdClass(); |
| 150 |
$row->id = $rowid; |
$row->id = $rowid; |
| 151 |
$row->directory = $templateDir; |
$row->directory = $templateDir; |
| 152 |
|
|
| 153 |
|
$row->creationdate = $parser->getCreationDate('template'); |
| 154 |
|
$row->name = $parser->getName('template'); |
| 155 |
|
$row->author = $parser->getAuthor('template'); |
| 156 |
|
$row->copyright = $parser->getCopyright('template'); |
| 157 |
|
$row->authorEmail = $parser->getAuthorEmail('template'); |
| 158 |
|
$row->authorUrl = $parser->getAuthorUrl('template'); |
| 159 |
|
$row->version = $parser->getVersion('template'); |
| 160 |
|
/* |
| 161 |
$element = &$xmlDoc->getElementsByPath('name', 1 ); |
$element = &$xmlDoc->getElementsByPath('name', 1 ); |
| 162 |
$row->name = $element->getText(); |
$row->name = $element->getText(); |
| 163 |
|
|
| 178 |
|
|
| 179 |
$element = &$xmlDoc->getElementsByPath('version', 1); |
$element = &$xmlDoc->getElementsByPath('version', 1); |
| 180 |
$row->version = $element ? $element->getText() : ''; |
$row->version = $element ? $element->getText() : ''; |
| 181 |
|
*/ |
| 182 |
// Get info from db |
// Get info from db |
| 183 |
if ($cur_template == $templateDir) { |
if ($cur_template == $templateDir) { |
| 184 |
$row->published = 1; |
$row->published = 1; |