Revision 1712
Added by Luisehahne about 13 years ago
| details.php | ||
|---|---|---|
| 4 | 4 |
* @category admin |
| 5 | 5 |
* @package templates |
| 6 | 6 |
* @author Ryan Djurovich, WebsiteBaker Project |
| 7 |
* @copyright 2009-2011, Website Baker Org. e.V.
|
|
| 7 |
* @copyright 2009-2012, WebsiteBaker Org. e.V.
|
|
| 8 | 8 |
* @link http://www.websitebaker2.org/ |
| 9 | 9 |
* @license http://www.gnu.org/licenses/gpl.html |
| 10 | 10 |
* @platform WebsiteBaker 2.8.x |
| ... | ... | |
| 27 | 27 |
$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS']); |
| 28 | 28 |
} |
| 29 | 29 |
|
| 30 |
// After check print the header |
|
| 31 |
$admin->print_header(); |
|
| 30 | 32 |
// Get template name |
| 31 | 33 |
if(!isset($_POST['file']) OR $_POST['file'] == "") {
|
| 34 |
$admin->print_error($MESSAGE['GENERIC_FORGOT_OPTIONS']); |
|
| 35 |
} else {
|
|
| 36 |
$file = preg_replace('/[^a-z0-9_-]/i', "", $_POST['file']); // fix secunia 2010-92-2
|
|
| 37 |
} |
|
| 38 |
|
|
| 39 |
// Check if the template exists |
|
| 40 |
if(!is_dir(WB_PATH.'/templates/'.$file)) {
|
|
| 41 |
$admin->print_error($MESSAGE['GENERIC_NOT_INSTALLED']); |
|
| 42 |
} |
|
| 43 |
|
|
| 44 |
// Check if the template exists |
|
| 45 |
if(!is_readable(WB_PATH.'/templates/'.$file)) {
|
|
| 46 |
$admin->print_error($MESSAGE['ADMIN_INSUFFICIENT_PRIVELLIGES']); |
|
| 47 |
} |
|
| 48 |
|
|
| 49 |
/* |
|
| 50 |
if(!isset($_POST['file']) OR $_POST['file'] == "") {
|
|
| 32 | 51 |
header("Location: index.php");
|
| 33 | 52 |
exit(0); |
| 34 | 53 |
} else {
|
| 35 | 54 |
$file = preg_replace('/[^a-z0-9_-]/i', "", $_POST['file']); // fix secunia 2010-92-2
|
| 36 | 55 |
} |
| 37 | 56 |
|
| 38 |
// Check if the template exists |
|
| 39 | 57 |
if(!file_exists(WB_PATH.'/templates/'.$file)) {
|
| 40 | 58 |
header("Location: index.php");
|
| 41 | 59 |
exit(0); |
| 42 | 60 |
} |
| 61 |
// Check if the template exists |
|
| 62 |
if(!is_dir(WB_PATH.'/templates/'.$file)) {
|
|
| 63 |
$admin->print_error($MESSAGE['GENERIC_NOT_INSTALLED']); |
|
| 64 |
} |
|
| 65 |
*/ |
|
| 43 | 66 |
|
| 44 | 67 |
// Print admin header |
| 45 |
$admin = new admin('Addons', 'templates_view');
|
|
| 68 |
//$admin = new admin('Addons', 'templates_view');
|
|
| 46 | 69 |
|
| 47 | 70 |
// Setup template object, parse vars to it, then parse it |
| 48 | 71 |
// Create new template object |
| ... | ... | |
| 75 | 98 |
if($tool_description !== false) {
|
| 76 | 99 |
// Override the template-description with correct desription in users language |
| 77 | 100 |
$row['description'] = $tool_description; |
| 78 |
}
|
|
| 101 |
} |
|
| 79 | 102 |
|
| 80 | 103 |
$template->set_var(array( |
| 81 | 104 |
'NAME' => $row['name'], |
| ... | ... | |
| 87 | 110 |
) |
| 88 | 111 |
); |
| 89 | 112 |
|
| 90 |
// Insert language headings |
|
| 91 |
$template->set_var(array( |
|
| 92 |
'HEADING_TEMPLATE_DETAILS' => $HEADING['TEMPLATE_DETAILS'] |
|
| 93 |
) |
|
| 94 |
); |
|
| 95 |
// Insert language text and messages |
|
| 96 |
$template->set_var(array( |
|
| 97 |
'TEXT_NAME' => $TEXT['NAME'], |
|
| 98 |
'TEXT_AUTHOR' => $TEXT['AUTHOR'], |
|
| 99 |
'TEXT_VERSION' => $TEXT['VERSION'], |
|
| 100 |
'TEXT_DESIGNED_FOR' => $TEXT['DESIGNED_FOR'], |
|
| 101 |
'TEXT_DESCRIPTION' => $TEXT['DESCRIPTION'], |
|
| 102 |
'TEXT_BACK' => $TEXT['BACK'], |
|
| 103 |
'TEXT_LICENSE' => $TEXT['LICENSE'], |
|
| 104 |
) |
|
| 105 |
); |
|
| 106 |
$template->set_var('TEXT_FUNCTION', ($row['function'] == 'theme' ? $TEXT['THEME'] : $TEXT['TEMPLATE']));
|
|
| 113 |
$mLang = ModLanguage::getInstance(); |
|
| 114 |
$mLang->setLanguage(ADMIN_PATH.'/addons/languages/', LANGUAGE, DEFAULT_LANGUAGE); |
|
| 115 |
|
|
| 116 |
/*-- insert all needed vars from language files ----------------------------------------*/ |
|
| 117 |
$template->set_var($mLang->getLangArray()); |
|
| 118 |
|
|
| 119 |
$template->set_var('TEXT_FUNCTION', ($row['function'] == 'theme' ? $mLang->TEXT_THEME : $mLang->TEXT_TEMPLATE));
|
|
| 107 | 120 |
// Parse template object |
| 108 | 121 |
$template->parse('main', 'main_block', false);
|
| 109 | 122 |
$template->pparse('output', 'page');
|
| 110 | 123 |
|
| 111 | 124 |
// Print admin footer |
| 112 | 125 |
$admin->print_footer(); |
| 113 |
|
|
| 114 |
?> |
|
Also available in: Unified diff
! update folder admin/addons admin/skel/htt