|
@@ 203-215 (lines=13) @@
|
| 200 |
|
$tplfile->setVar('tpl_lastmodified', time()); |
| 201 |
|
$tplfile->setVar('tpl_lastimported', time()); |
| 202 |
|
$tplfile->setVar('tpl_type', $type); |
| 203 |
|
if (!$tplfile_handler->insert($tplfile)) { |
| 204 |
|
$msgs[] = ' <span style="color:#ff0000;">' . sprintf(_AM_SYSTEM_MODULES_TEMPLATE_ADD_ERROR, '<strong>' . $tpl['file'] . '</strong>') . '</span>'; |
| 205 |
|
} else { |
| 206 |
|
$newtplid = $tplfile->getVar('tpl_id'); |
| 207 |
|
$msgs[] = ' ' . sprintf(_AM_SYSTEM_MODULES_TEMPLATE_ADD_DATA, '<strong>' . $tpl['file'] . '</strong>') . '(ID: <strong>' . $newtplid . '</strong>)'; |
| 208 |
|
// generate compiled file |
| 209 |
|
include_once XOOPS_ROOT_PATH . '/class/template.php'; |
| 210 |
|
if (!xoops_template_touch($newtplid)) { |
| 211 |
|
$msgs[] = ' <span style="color:#ff0000;">' . sprintf(_AM_SYSTEM_MODULES_TEMPLATE_COMPILED_FAILED, '<strong>' . $tpl['file'] . '</strong>') . '</span>'; |
| 212 |
|
} else { |
| 213 |
|
$msgs[] = ' ' . sprintf(_AM_SYSTEM_MODULES_TEMPLATE_COMPILED, '<strong>' . $tpl['file'] . '</strong>'); |
| 214 |
|
} |
| 215 |
|
} |
| 216 |
|
unset($tplfile, $tpldata); |
| 217 |
|
} |
| 218 |
|
} |
|
@@ 266-278 (lines=13) @@
|
| 263 |
|
$tplfile->setVar('tpl_desc', $block['description'], true); |
| 264 |
|
$tplfile->setVar('tpl_lastimported', 0); |
| 265 |
|
$tplfile->setVar('tpl_lastmodified', time()); |
| 266 |
|
if (!$tplfile_handler->insert($tplfile)) { |
| 267 |
|
$msgs[] = ' <span style="color:#ff0000;">' . sprintf(_AM_SYSTEM_MODULES_TEMPLATE_ADD_ERROR, '<strong>' . $block['template'] . '</strong>') . '</span>'; |
| 268 |
|
} else { |
| 269 |
|
$newtplid = $tplfile->getVar('tpl_id'); |
| 270 |
|
$msgs[] = ' ' . sprintf(_AM_SYSTEM_MODULES_TEMPLATE_ADD_DATA, '<strong>' . $block['template'] . '</strong>') . ' (ID: <strong>' . $newtplid . '</strong>)'; |
| 271 |
|
// generate compiled file |
| 272 |
|
include_once XOOPS_ROOT_PATH . '/class/template.php'; |
| 273 |
|
if (!xoops_template_touch($newtplid)) { |
| 274 |
|
$msgs[] = ' <span style="color:#ff0000;">' . sprintf(_AM_SYSTEM_MODULES_TEMPLATE_COMPILED_FAILED, '<strong>' . $block['template'] . '</strong>') . '</span>'; |
| 275 |
|
} else { |
| 276 |
|
$msgs[] = ' ' . sprintf(_AM_SYSTEM_MODULES_TEMPLATE_COMPILED, '<strong>' . $block['template'] . '</strong>'); |
| 277 |
|
} |
| 278 |
|
} |
| 279 |
|
unset($tplfile); |
| 280 |
|
} |
| 281 |
|
} |