Revision 1712
Added by Luisehahne about 13 years ago
| branches/2.8.x/CHANGELOG | ||
|---|---|---|
| 13 | 13 |
|
| 14 | 14 |
|
| 15 | 15 |
|
| 16 |
29 Aug-2012 Build 1712 Dietmar Woellbrink (Luisehahne) |
|
| 17 |
! update folder admin/addons admin/skel/htt |
|
| 16 | 18 |
29 Aug-2012 Build 1711 Dietmar Woellbrink (Luisehahne) |
| 17 | 19 |
! update folder admin/start, admin/admintools, admin/skel/htt |
| 18 | 20 |
29 Aug-2012 Build 1710 Dietmar Woellbrink (Luisehahne) |
| branches/2.8.x/wb/admin/templates/uninstall.php | ||
|---|---|---|
| 3 | 3 |
* |
| 4 | 4 |
* @category admin |
| 5 | 5 |
* @package templates |
| 6 |
* @author WebsiteBaker Project |
|
| 7 |
* @copyright 2004-2009, Ryan Djurovich |
|
| 8 |
* @copyright 2009-2011, Website Baker Org. e.V. |
|
| 6 |
* @author Ryan Djurovich, WebsiteBaker Project |
|
| 7 |
* @copyright 2009-2012, WebsiteBaker Org. e.V. |
|
| 9 | 8 |
* @link http://www.websitebaker2.org/ |
| 10 | 9 |
* @license http://www.gnu.org/licenses/gpl.html |
| 11 | 10 |
* @platform WebsiteBaker 2.8.x |
| ... | ... | |
| 28 | 27 |
} |
| 29 | 28 |
// After check print the header |
| 30 | 29 |
$admin->print_header(); |
| 30 |
if(!isset($_POST['file']) OR $_POST['file'] == "") {
|
|
| 31 |
$admin->print_error($MESSAGE['GENERIC_FORGOT_OPTIONS']); |
|
| 32 |
} else {
|
|
| 33 |
$file = preg_replace('/[^a-z0-9_-]/i', "", $_POST['file']); // fix secunia 2010-92-2
|
|
| 34 |
} |
|
| 31 | 35 |
|
| 36 |
// Check if the template exists |
|
| 37 |
if(!is_dir(WB_PATH.'/templates/'.$file)) {
|
|
| 38 |
$admin->print_error($MESSAGE['GENERIC_NOT_INSTALLED']); |
|
| 39 |
} |
|
| 40 |
|
|
| 41 |
// Check if the template exists |
|
| 42 |
if(!is_readable(WB_PATH.'/templates/'.$file)) {
|
|
| 43 |
$admin->print_error($MESSAGE['ADMIN_INSUFFICIENT_PRIVELLIGES']); |
|
| 44 |
} |
|
| 45 |
|
|
| 32 | 46 |
// Check if user selected template |
| 47 |
/* |
|
| 33 | 48 |
if(!isset($_POST['file']) OR $_POST['file'] == "") {
|
| 34 | 49 |
header("Location: index.php");
|
| 35 | 50 |
exit(0); |
| ... | ... | |
| 42 | 57 |
header("Location: index.php");
|
| 43 | 58 |
exit(0); |
| 44 | 59 |
} |
| 60 |
*/ |
|
| 45 | 61 |
|
| 46 | 62 |
// Include the WB functions file |
| 47 | 63 |
require_once(WB_PATH.'/framework/functions.php'); |
| 48 |
|
|
| 49 |
// Check if the template exists |
|
| 50 |
if(!is_dir(WB_PATH.'/templates/'.$file)) {
|
|
| 51 |
$admin->print_error($MESSAGE['GENERIC']['NOT_INSTALLED']); |
|
| 52 |
} |
|
| 53 |
|
|
| 54 | 64 |
if (!function_exists("replace_all")) {
|
| 55 | 65 |
function replace_all ($aStr = "", &$aArray ) {
|
| 56 | 66 |
foreach($aArray as $k=>$v) $aStr = str_replace("{{".$k."}}", $v, $aStr);
|
| ... | ... | |
| 62 | 72 |
* Check if the template is the standard-template or still in use |
| 63 | 73 |
*/ |
| 64 | 74 |
if (!array_key_exists('CANNOT_UNINSTALL_IS_DEFAULT_TEMPLATE', $MESSAGE['GENERIC'] ) )
|
| 65 |
$MESSAGE['GENERIC']['CANNOT_UNINSTALL_IS_DEFAULT_TEMPLATE'] = "Can't uninstall this template <b>{{name}}</b> because it's the standardtemplate!";
|
|
| 75 |
$MESSAGE['GENERIC_CANNOT_UNINSTALL_IS_DEFAULT_TEMPLATE'] = "Can't uninstall this template <b>{{name}}</b> because it's the standardtemplate!";
|
|
| 66 | 76 |
|
| 67 | 77 |
// check whether the template is used as default wb theme |
| 68 | 78 |
if($file == DEFAULT_THEME) {
|
| 69 | 79 |
$temp = array ('name' => $file );
|
| 70 |
$msg = replace_all( $MESSAGE['GENERIC']['CANNOT_UNINSTALL_IS_DEFAULT_TEMPLATE'], $temp );
|
|
| 80 |
$msg = replace_all( $MESSAGE['GENERIC_CANNOT_UNINSTALL_IS_DEFAULT_TEMPLATE'], $temp );
|
|
| 71 | 81 |
$admin->print_error( $msg ); |
| 72 | 82 |
} |
| 73 | 83 |
|
| 74 | 84 |
if ($file == DEFAULT_TEMPLATE) {
|
| 75 | 85 |
$temp = array ('name' => $file );
|
| 76 |
$msg = replace_all( $MESSAGE['GENERIC']['CANNOT_UNINSTALL_IS_DEFAULT_TEMPLATE'], $temp );
|
|
| 86 |
$msg = replace_all( $MESSAGE['GENERIC_CANNOT_UNINSTALL_IS_DEFAULT_TEMPLATE'], $temp );
|
|
| 77 | 87 |
$admin->print_error( $msg ); |
| 78 | 88 |
|
| 79 | 89 |
} else {
|
| 80 |
|
|
| 90 |
|
|
| 81 | 91 |
/** |
| 82 | 92 |
* Check if the template is still in use by a page ... |
| 83 | 93 |
*/ |
| 84 | 94 |
$info = $database->query("SELECT page_id, page_title FROM ".TABLE_PREFIX."pages WHERE template='".$file."' order by page_title");
|
| 85 |
|
|
| 95 |
|
|
| 86 | 96 |
if ($info->numRows() > 0) {
|
| 87 | 97 |
/** |
| 88 | 98 |
* Template is still in use, so we're collecting the page-titles |
| 89 | 99 |
*/ |
| 90 |
|
|
| 100 |
|
|
| 91 | 101 |
/** |
| 92 | 102 |
* The base-message template-string for the top of the message |
| 93 | 103 |
*/ |
| ... | ... | |
| 96 | 106 |
$msg_template_str = "<br /><br />{{type}} <b>{{type_name}}</b> could not be uninstalled because it is still in use by {{pages}}";
|
| 97 | 107 |
$msg_template_str .= ":<br /><i>click for editing.</i><br /><br />"; |
| 98 | 108 |
} else {
|
| 99 |
$msg_template_str = $MESSAGE['GENERIC']['CANNOT_UNINSTALL_IN_USE_TMPL'];
|
|
| 100 |
$temp = explode(";",$MESSAGE['GENERIC']['CANNOT_UNINSTALL_IN_USE_TMPL_PAGES']);
|
|
| 109 |
$msg_template_str = $MESSAGE['GENERIC_CANNOT_UNINSTALL_IN_USE_TMPL'];
|
|
| 110 |
$temp = explode(";",$MESSAGE['GENERIC_CANNOT_UNINSTALL_IN_USE_TMPL_PAGES']);
|
|
| 101 | 111 |
$add = $info->numRows() == 1 ? $temp[0] : $temp[1]; |
| 102 | 112 |
} |
| 103 | 113 |
/** |
| 104 | 114 |
* The template-string for displaying the Page-Titles ... in this case as a link |
| 105 | 115 |
*/ |
| 106 | 116 |
$page_template_str = "- <b><a href='../pages/settings.php?page_id={{id}}'>{{title}}</a></b><br />";
|
| 107 |
|
|
| 117 |
|
|
| 108 | 118 |
$values = array ('type' => 'Template', 'type_name' => $file, 'pages' => $add);
|
| 109 | 119 |
$msg = replace_all ( $msg_template_str, $values ); |
| 110 |
|
|
| 120 |
|
|
| 111 | 121 |
$page_names = ""; |
| 112 |
|
|
| 122 |
|
|
| 113 | 123 |
while ($data = $info->fetchRow() ) {
|
| 114 |
|
|
| 124 |
|
|
| 115 | 125 |
$page_info = array( |
| 116 |
'id' => $data['page_id'],
|
|
| 126 |
'id' => $data['page_id'], |
|
| 117 | 127 |
'title' => $data['page_title'] |
| 118 | 128 |
); |
| 119 |
|
|
| 129 |
|
|
| 120 | 130 |
$page_names .= replace_all ( $page_template_str, $page_info ); |
| 121 | 131 |
} |
| 122 |
|
|
| 132 |
|
|
| 123 | 133 |
/** |
| 124 | 134 |
* Printing out the error-message and die(). |
| 125 | 135 |
*/ |
| 126 |
$admin->print_error($MESSAGE['GENERIC']['CANNOT_UNINSTALL_IN_USE'].$msg.$page_names);
|
|
| 136 |
$admin->print_error($MESSAGE['GENERIC_CANNOT_UNINSTALL_IN_USE'].$msg.$page_names);
|
|
| 127 | 137 |
} |
| 128 | 138 |
} |
| 129 | 139 |
|
| 130 | 140 |
// Check if we have permissions on the directory |
| 131 | 141 |
if(!is_writable(WB_PATH.'/templates/'.$file)) {
|
| 132 |
$admin->print_error($MESSAGE['GENERIC']['CANNOT_UNINSTALL'].WB_PATH.'/templates/'.$file);
|
|
| 142 |
$admin->print_error($MESSAGE['GENERIC_CANNOT_UNINSTALL'].WB_PATH.'/templates/'.$file);
|
|
| 133 | 143 |
} |
| 134 | 144 |
|
| 135 | 145 |
// Try to delete the template dir |
| 136 | 146 |
if(!rm_full_dir(WB_PATH.'/templates/'.$file)) {
|
| 137 |
$admin->print_error($MESSAGE['GENERIC']['CANNOT_UNINSTALL']);
|
|
| 147 |
$admin->print_error($MESSAGE['GENERIC_CANNOT_UNINSTALL']);
|
|
| 138 | 148 |
} else {
|
| 139 | 149 |
// Remove entry from DB |
| 140 | 150 |
$database->query("DELETE FROM ".TABLE_PREFIX."addons WHERE directory = '".$file."' AND type = 'template'");
|
| ... | ... | |
| 145 | 155 |
$database->query("UPDATE ".TABLE_PREFIX."pages SET template = '".DEFAULT_TEMPLATE."' WHERE template = '$file'");
|
| 146 | 156 |
|
| 147 | 157 |
// Print success message |
| 148 |
$admin->print_success($MESSAGE['GENERIC']['UNINSTALLED']);
|
|
| 158 |
$admin->print_success($MESSAGE['GENERIC_UNINSTALLED']);
|
|
| 149 | 159 |
|
| 150 | 160 |
// Print admin footer |
| 151 | 161 |
$admin->print_footer(); |
| 152 |
|
|
| 153 |
?> |
|
| branches/2.8.x/wb/admin/templates/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 |
?> |
|
| branches/2.8.x/wb/admin/templates/install.php | ||
|---|---|---|
| 3 | 3 |
* |
| 4 | 4 |
* @category admin |
| 5 | 5 |
* @package templates |
| 6 |
* @author WebsiteBaker Project |
|
| 7 |
* @copyright 2004-2009, Ryan Djurovich |
|
| 8 |
* @copyright 2009-2011, Website Baker Org. e.V. |
|
| 6 |
* @author Ryan Djurovich, WebsiteBaker Project |
|
| 7 |
* @copyright 2009-2012, WebsiteBaker Org. e.V. |
|
| 9 | 8 |
* @link http://www.websitebaker2.org/ |
| 10 | 9 |
* @license http://www.gnu.org/licenses/gpl.html |
| 11 | 10 |
* @platform WebsiteBaker 2.8.x |
| ... | ... | |
| 48 | 47 |
|
| 49 | 48 |
// Try to upload the file to the temp dir |
| 50 | 49 |
if(!move_uploaded_file($_FILES['userfile']['tmp_name'], $temp_file)) {
|
| 51 |
$admin->print_error($MESSAGE['GENERIC']['CANNOT_UPLOAD']);
|
|
| 50 |
$admin->print_error($MESSAGE['GENERIC_CANNOT_UPLOAD']);
|
|
| 52 | 51 |
} |
| 53 | 52 |
|
| 54 |
// Include the PclZip class file (thanks to
|
|
| 53 |
// Include the PclZip class file (thanks to |
|
| 55 | 54 |
require_once(WB_PATH.'/include/pclzip/pclzip.lib.php'); |
| 56 | 55 |
|
| 57 | 56 |
// Remove any vars with name "template_directory" and "theme_directory" |
| ... | ... | |
| 64 | 63 |
$list = $archive->extract(PCLZIP_OPT_PATH, $temp_unzip); |
| 65 | 64 |
|
| 66 | 65 |
// Check if uploaded file is a valid Add-On zip file |
| 67 |
if (!($list && file_exists($temp_unzip . 'index.php'))) $admin->print_error($MESSAGE['GENERIC']['INVALID_ADDON_FILE']);
|
|
| 66 |
if (!($list && file_exists($temp_unzip . 'index.php'))) $admin->print_error($MESSAGE['GENERIC_INVALID_ADDON_FILE']);
|
|
| 68 | 67 |
|
| 69 | 68 |
// Include the templates info file |
| 70 | 69 |
require($temp_unzip.'info.php'); |
| ... | ... | |
| 79 | 78 |
// Check if the file is valid |
| 80 | 79 |
if(!isset($template_directory)) {
|
| 81 | 80 |
if(file_exists($temp_file)) { unlink($temp_file); } // Remove temp file
|
| 82 |
$admin->print_error($MESSAGE['GENERIC']['INVALID']);
|
|
| 81 |
$admin->print_error($MESSAGE['GENERIC_INVALID']);
|
|
| 83 | 82 |
} |
| 84 | 83 |
|
| 85 | 84 |
// Check if this module is already installed |
| ... | ... | |
| 91 | 90 |
// Version to be installed is older than currently installed version |
| 92 | 91 |
if (versionCompare($template_version, $new_template_version, '>=')) {
|
| 93 | 92 |
if(file_exists($temp_file)) { unlink($temp_file); } // Remove temp file
|
| 94 |
$admin->print_error($MESSAGE['GENERIC']['ALREADY_INSTALLED']);
|
|
| 93 |
$admin->print_error($MESSAGE['GENERIC_ALREADY_INSTALLED']);
|
|
| 95 | 94 |
} |
| 96 |
}
|
|
| 97 |
$success_message=$MESSAGE['GENERIC']['UPGRADED'];
|
|
| 95 |
} |
|
| 96 |
$success_message=$MESSAGE['GENERIC_UPGRADED'];
|
|
| 98 | 97 |
} else {
|
| 99 |
$success_message=$MESSAGE['GENERIC']['INSTALLED'];
|
|
| 98 |
$success_message=$MESSAGE['GENERIC_INSTALLED'];
|
|
| 100 | 99 |
} |
| 101 | 100 |
|
| 102 | 101 |
// Check if template dir is writable |
| 103 | 102 |
if(!is_writable(WB_PATH.'/templates/')) {
|
| 104 | 103 |
if(file_exists($temp_file)) { unlink($temp_file); } // Remove temp file
|
| 105 |
$admin->print_error($MESSAGE['TEMPLATES']['BAD_PERMISSIONS']);
|
|
| 104 |
$admin->print_error($MESSAGE['TEMPLATES_BAD_PERMISSIONS']);
|
|
| 106 | 105 |
} |
| 107 | 106 |
|
| 108 | 107 |
// Set template dir |
| ... | ... | |
| 116 | 115 |
} |
| 117 | 116 |
|
| 118 | 117 |
// Unzip template to the template dir |
| 119 |
$list = $archive->extract(PCLZIP_OPT_PATH, $template_dir, PCLZIP_OPT_REPLACE_NEWER); |
|
| 118 |
//$list = $archive->extract(PCLZIP_OPT_PATH, $template_dir, PCLZIP_OPT_REPLACE_NEWER); |
|
| 119 |
if(isset($_POST['overwrite'])){
|
|
| 120 |
$list = $archive->extract(PCLZIP_OPT_PATH, $template_dir, PCLZIP_OPT_REPLACE_NEWER ); |
|
| 121 |
} else {
|
|
| 122 |
$list = $archive->extract(PCLZIP_OPT_PATH, $template_dir ); |
|
| 123 |
} |
|
| 120 | 124 |
if(!$list) {
|
| 121 |
$admin->print_error($MESSAGE['GENERIC']['CANNOT_UNZIP']);
|
|
| 125 |
$admin->print_error($MESSAGE['GENERIC_CANNOT_UNZIP']);
|
|
| 122 | 126 |
} |
| 123 | 127 |
|
| 124 | 128 |
// Delete the temp zip file |
| ... | ... | |
| 142 | 146 |
|
| 143 | 147 |
// Print admin footer |
| 144 | 148 |
$admin->print_footer(); |
| 145 |
|
|
| 146 |
?> |
|
| branches/2.8.x/wb/admin/templates/index.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 |
| ... | ... | |
| 22 | 22 |
|
| 23 | 23 |
// Setup template object, parse vars to it, then parse it |
| 24 | 24 |
// Create new template object |
| 25 |
$template = new Template(dirname($admin->correct_theme_source('templates.htt')));
|
|
| 25 |
$template = new Template(dirname($admin->correct_theme_source('templates.htt')),'keep');
|
|
| 26 | 26 |
// $template->debug = true; |
| 27 | 27 |
$template->set_file('page', 'templates.htt');
|
| 28 | 28 |
$template->set_block('page', 'main_block', 'main');
|
| ... | ... | |
| 33 | 33 |
$sql = 'SELECT `directory`, `name`, `function` FROM `'.TABLE_PREFIX.'addons` ' |
| 34 | 34 |
. 'WHERE `type`=\'template\' ORDER BY `name`'; |
| 35 | 35 |
if(($result = $database->query($sql))) {
|
| 36 |
while($addon = $result->fetchRow(MYSQL_ASSOC)) {
|
|
| 36 |
while($addon = $result->fetchRow(MYSQL_ASSOC)) |
|
| 37 |
{
|
|
| 38 |
if ($admin->get_permission($addon['directory'],'template')==false) { continue;}
|
|
| 37 | 39 |
$template->set_var('VALUE', $addon['directory']);
|
| 38 | 40 |
$template->set_var('NAME', (($addon['function'] == 'theme' ? '[Theme] ' : '').$addon['name']));
|
| 39 | 41 |
$template->parse('template_list', 'template_list_block', true);
|
| ... | ... | |
| 51 | 53 |
$template->set_var('DISPLAY_LIST', 'hide');
|
| 52 | 54 |
} |
| 53 | 55 |
|
| 54 |
// Insert language headings |
|
| 55 |
$template->set_var(array( |
|
| 56 |
'HEADING_INSTALL_TEMPLATE' => $HEADING['INSTALL_TEMPLATE'], |
|
| 57 |
'HEADING_UNINSTALL_TEMPLATE' => $HEADING['UNINSTALL_TEMPLATE'], |
|
| 58 |
'HEADING_TEMPLATE_DETAILS' => $HEADING['TEMPLATE_DETAILS'] |
|
| 59 |
) |
|
| 60 |
); |
|
| 56 |
$mLang = ModLanguage::getInstance(); |
|
| 57 |
$mLang->setLanguage(ADMIN_PATH.'/addons/languages/', LANGUAGE, DEFAULT_LANGUAGE); |
|
| 58 |
|
|
| 59 |
/*-- insert all needed vars from language files ----------------------------------------*/ |
|
| 60 |
$template->set_var($mLang->getLangArray()); |
|
| 61 |
|
|
| 61 | 62 |
// insert urls |
| 62 | 63 |
$template->set_var(array( |
| 63 | 64 |
'ADMIN_URL' => ADMIN_URL, |
| ... | ... | |
| 68 | 69 |
); |
| 69 | 70 |
// Insert language text and messages |
| 70 | 71 |
$template->set_var(array( |
| 71 |
'URL_MODULES' => $admin->get_permission('modules') ?
|
|
| 72 |
'<a href="' . ADMIN_URL . '/modules/index.php">' . $MENU['MODULES'] . '</a>' : '',
|
|
| 72 |
'URL_MODULES' => $admin->get_permission('modules') ?
|
|
| 73 |
'<a href="' . ADMIN_URL . '/modules/index.php">' . $mLang->MENU_MODULES . '</a>' : '<b>'.$mLang->MENU_MODULES.'</b>',
|
|
| 73 | 74 |
'URL_LANGUAGES' => $admin->get_permission('languages') ?
|
| 74 |
'<a href="' . ADMIN_URL . '/languages/index.php">' . $MENU['LANGUAGES'] . '</a>' : '', |
|
| 75 |
'URL_ADVANCED' => '          ', |
|
| 76 |
'TEXT_INSTALL' => $TEXT['INSTALL'], |
|
| 77 |
'TEXT_UNINSTALL' => $TEXT['UNINSTALL'], |
|
| 78 |
'TEXT_VIEW_DETAILS' => $TEXT['VIEW_DETAILS'], |
|
| 79 |
'TEXT_PLEASE_SELECT' => $TEXT['PLEASE_SELECT'], |
|
| 80 |
'CHANGE_TEMPLATE_NOTICE' => $MESSAGE['TEMPLATES']['CHANGE_TEMPLATE_NOTICE'] |
|
| 75 |
'<a href="' . ADMIN_URL . '/languages/index.php">' . $mLang->MENU_LANGUAGES . '</a>' : '<b>'.$mLang->MENU_LANGUAGES.'</b>', |
|
| 76 |
'URL_ADVANCED' => $admin->get_permission('settings_advanced')
|
|
| 77 |
? '<a href="' . ADMIN_URL . '/addons/index.php?advanced">' . $mLang->TEXT_ADVANCED . '</a>' : '<b>'.$mLang->TEXT_ADVANCED.'</b>' , |
|
| 81 | 78 |
) |
| 82 | 79 |
); |
| 83 | 80 |
|
| branches/2.8.x/wb/admin/skel/themes/htt/templates_details.htt | ||
|---|---|---|
| 1 | 1 |
<!-- BEGIN main_block --> |
| 2 |
<table summary="" cellpadding="5" cellspacing="0" border="0" align="center" width="100%" style="margin-bottom:10px;"> |
|
| 3 |
<tr style="background:#f0f0f0;"> |
|
| 4 |
<td align="right"> </td> |
|
| 5 |
</tr> |
|
| 6 |
</table> |
|
| 2 | 7 |
|
| 3 |
<h2>{HEADING_TEMPLATE_DETAILS} ({TEXT_FUNCTION})</h2>
|
|
| 8 |
<h2 class="left">{HEADING_TEMPLATE_DETAILS} ({TEXT_FUNCTION})</h2>
|
|
| 4 | 9 |
|
| 5 |
<table summary="" cellpadding="5" cellspacing="0" border="0">
|
|
| 10 |
<table summary="" class="left">
|
|
| 6 | 11 |
<tr> |
| 7 | 12 |
<td width="100">{TEXT_NAME}:</td>
|
| 8 | 13 |
<td>{NAME}</td>
|
| branches/2.8.x/wb/admin/skel/themes/htt/modules.htt | ||
|---|---|---|
| 1 | 1 |
<!-- BEGIN main_block --> |
| 2 | 2 |
<table summary="" cellpadding="5" cellspacing="0" border="0" align="center" width="100%" style="margin-bottom:10px;"> |
| 3 | 3 |
<tr style="background:#f0f0f0;"> |
| 4 |
<td align="left">{HEADING_CHANGE_TEMPLATE_NOTICE}</td>
|
|
| 4 | 5 |
<td align="right"> |
| 5 | 6 |
{URL_TEMPLATES}
|
| 6 | 7 |
- |
| ... | ... | |
| 11 | 12 |
</tr> |
| 12 | 13 |
</table> |
| 13 | 14 |
|
| 14 |
<form name="install" enctype="multipart/form-data" action="install.php" method="post" class="{DISPLAY_INSTALL}">
|
|
| 15 |
<form name="install" enctype="multipart/form-data" action="install.php" method="post" class="{DISPLAY_INSTALL} left">
|
|
| 15 | 16 |
{FTAN}
|
| 16 | 17 |
<h2>{HEADING_INSTALL_MODULE}</h2>
|
| 17 | 18 |
<table summary="" cellpadding="2" cellspacing="0" border="0" width="100%"> |
| 18 | 19 |
<tr> |
| 19 | 20 |
<td valign="middle"> |
| 20 |
<input type="file" name="userfile" size="97" />
|
|
| 21 |
<input type="file" name="userfile" size="60" />
|
|
| 21 | 22 |
<script type="text/javascript"> |
| 22 | 23 |
document.install.userfile.focus(); |
| 23 |
</script><br /> |
|
| 24 |
</script><br /><br />
|
|
| 24 | 25 |
<input type="checkbox" name="overwrite" value="false" /> |
| 25 |
<span>{OVERWRITE_NEWER_FILES}</span>
|
|
| 26 |
<span>{MESSAGE_ADDON_OVERWRITE_NEWER_FILES}</span>
|
|
| 26 | 27 |
</td> |
| 27 | 28 |
<td width="110" align="left"> |
| 28 |
<input type="submit" name="submit" value="{TEXT_INSTALL}" style="width: 100px;" />
|
|
| 29 |
<input type="submit" name="submit" value="{TEXT_INSTALL}" style="width: 100px;" /><br /><br /><br />
|
|
| 29 | 30 |
</td> |
| 30 | 31 |
</tr> |
| 31 | 32 |
</table> |
| 32 | 33 |
<br /> |
| 33 | 34 |
</form> |
| 34 |
<form name="uninstall" action="uninstall.php" method="post" class="{DISPLAY_UNINSTALL}">
|
|
| 35 |
<form name="uninstall" action="uninstall.php" method="post" class="{DISPLAY_UNINSTALL} left">
|
|
| 35 | 36 |
{FTAN}
|
| 36 | 37 |
<h2>{HEADING_UNINSTALL_MODULE}</h2>
|
| 37 | 38 |
<table summary="" cellpadding="2" cellspacing="0" border="0" width="100%"> |
| ... | ... | |
| 51 | 52 |
</table> |
| 52 | 53 |
<br /> |
| 53 | 54 |
</form> |
| 54 |
<form name="details" action="details.php" method="post" class="{DISPLAY_LIST}">
|
|
| 55 |
<form name="details" action="details.php" method="post" class="{DISPLAY_LIST} left">
|
|
| 55 | 56 |
{FTAN}
|
| 56 | 57 |
<h2>{HEADING_MODULE_DETAILS}</h2>
|
| 57 | 58 |
<table summary="" cellpadding="2" cellspacing="0" border="0" width="100%"> |
| ... | ... | |
| 71 | 72 |
</table> |
| 72 | 73 |
<br /> |
| 73 | 74 |
</form> |
| 74 |
<div class="{DISPLAY_MANUAL_INSTALL}">
|
|
| 75 |
<div class="{DISPLAY_MANUAL_INSTALL} left">
|
|
| 75 | 76 |
<h2>{HEADING_INVOKE_MODULE_FILES}</h2>
|
| 76 |
<p>{TEXT_MANUAL_INSTALLATION}</p>
|
|
| 77 |
<p class="warning">{MESSAGE_ADDON_MANUAL_INSTALLATION}</p>
|
|
| 77 | 78 |
<form name="manual_install" action="manual_install.php" method="post" class="{INSTALL_VISIBLE}">
|
| 78 | 79 |
{FTAN}
|
| 79 | 80 |
<table summary="" cellpadding="0" cellspacing="2" border="0" width="80%"> |
| 80 | 81 |
<tr> |
| 81 |
<td width="150" valign="middle" nowrap="nowrap">{TEXT_FILE}: "install.php"</td>
|
|
| 82 |
<td width="150" valign="middle" nowrap="nowrap">{TEXT_FUNCTION}: install</td>
|
|
| 82 | 83 |
<td valign="middle"> |
| 83 | 84 |
<input type="hidden" name="action" value="install" /> |
| 84 | 85 |
<select name="file" style="width: 250px;"> |
| ... | ... | |
| 92 | 93 |
</tr> |
| 93 | 94 |
</table> |
| 94 | 95 |
</form> |
| 95 |
|
|
| 96 |
|
|
| 96 | 97 |
<form name="manual_upgrade" action="manual_install.php" method="post" class="{UPGRADE_VISIBLE}">
|
| 97 | 98 |
{FTAN}
|
| 98 | 99 |
<table summary="" cellpadding="0" cellspacing="2" border="0" width="80%"> |
| 99 | 100 |
<tr> |
| 100 |
<td width="150" valign="middle" nowrap="nowrap">{TEXT_FILE}: "upgrade.php"</td>
|
|
| 101 |
<td width="150" valign="middle" nowrap="nowrap">{TEXT_FUNCTION}: upgrade</td>
|
|
| 101 | 102 |
<td valign="middle" > |
| 102 | 103 |
<input type="hidden" name="action" value="upgrade" /> |
| 103 | 104 |
<select name="file" style="width: 250px;"> |
| ... | ... | |
| 116 | 117 |
{FTAN}
|
| 117 | 118 |
<table summary="" cellpadding="0" cellspacing="2" border="0" width="80%"> |
| 118 | 119 |
<tr> |
| 119 |
<td width="150" valign="middle" nowrap="nowrap">{TEXT_FILE}: "uninstall.php"</td>
|
|
| 120 |
<td width="150" valign="middle" nowrap="nowrap">{TEXT_FUNCTION}: uninstall</td>
|
|
| 120 | 121 |
<td valign="middle"> |
| 121 | 122 |
<input type="hidden" name="action" value="uninstall" /> |
| 122 | 123 |
<select name="file" style="width: 250px;"> |
| ... | ... | |
| 131 | 132 |
</table> |
| 132 | 133 |
</form> |
| 133 | 134 |
|
| 134 |
<p style="color:red;">{TEXT_MANUAL_INSTALLATION_WARNING}</p>
|
|
| 135 |
<p class="warning">{MESSAGE_ADDON_MANUAL_INSTALLATION_WARNING}</p>
|
|
| 135 | 136 |
</div> |
| 136 | 137 |
<!-- END main_block --> |
| branches/2.8.x/wb/admin/skel/themes/htt/languages_details.htt | ||
|---|---|---|
| 1 | 1 |
<!-- BEGIN main_block --> |
| 2 |
<table summary="" cellpadding="5" cellspacing="0" border="0" align="center" width="100%" style="margin-bottom:10px;"> |
|
| 3 |
<tr style="background:#f0f0f0;"> |
|
| 4 |
<td align="right"> </td> |
|
| 5 |
</tr> |
|
| 6 |
</table> |
|
| 2 | 7 |
|
| 3 |
<h2>{HEADING_LANGUAGE_DETAILS}</h2>
|
|
| 8 |
<h2 class="left">{HEADING_LANGUAGE_DETAILS}</h2>
|
|
| 4 | 9 |
|
| 5 |
<table summary="" cellpadding="5" cellspacing="0" border="0">
|
|
| 10 |
<table summary="" class="left">
|
|
| 6 | 11 |
<tr> |
| 7 | 12 |
<td width="100">{TEXT_NAME}:</td>
|
| 8 | 13 |
<td>{NAME}</td>
|
| branches/2.8.x/wb/admin/skel/themes/htt/templates.htt | ||
|---|---|---|
| 2 | 2 |
|
| 3 | 3 |
<table summary="" cellpadding="5" cellspacing="0" border="0" align="center" width="100%" style="margin-bottom:10px;"> |
| 4 | 4 |
<tr style="background:#f0f0f0;"> |
| 5 |
<td align="left">{CHANGE_TEMPLATE_NOTICE}</td>
|
|
| 5 |
<td align="left">{HEADING_CHANGE_TEMPLATE_NOTICE}</td>
|
|
| 6 | 6 |
<td align="right"> |
| 7 |
{URL_LANGUAGES}
|
|
| 8 |
- |
|
| 7 | 9 |
{URL_MODULES}
|
| 8 | 10 |
- |
| 9 |
{URL_LANGUAGES}
|
|
| 10 |
- |
|
| 11 | 11 |
{URL_ADVANCED}
|
| 12 | 12 |
</td> |
| 13 | 13 |
</tr> |
| 14 | 14 |
</table> |
| 15 | 15 |
|
| 16 |
<form name="install" enctype="multipart/form-data" action="install.php" method="post" class="{DISPLAY_INSTALL}">
|
|
| 16 |
<form name="install" enctype="multipart/form-data" action="install.php" method="post" class="{DISPLAY_INSTALL} left">
|
|
| 17 | 17 |
{FTAN}
|
| 18 | 18 |
|
| 19 | 19 |
<h2>{HEADING_INSTALL_TEMPLATE}</h2>
|
| ... | ... | |
| 21 | 21 |
<table summary="" cellpadding="2" cellspacing="0" border="0" width="100%"> |
| 22 | 22 |
<tr> |
| 23 | 23 |
<td> |
| 24 |
<input type="file" name="userfile" size="82" />
|
|
| 25 |
<script type="text/javascript">
|
|
| 24 |
<input type="file" name="userfile" size="60" />
|
|
| 25 |
<script type="text/javascript">
|
|
| 26 | 26 |
document.install.userfile.focus(); |
| 27 | 27 |
</script><br /><br /> |
| 28 |
<input type="checkbox" name="overwrite" value="false" /> |
|
| 29 |
<span>{MESSAGE_ADDON_OVERWRITE_NEWER_FILES}</span>
|
|
| 28 | 30 |
</td> |
| 29 | 31 |
<td width="110" align="left"> |
| 30 |
<input type="submit" name="submit" value="{TEXT_INSTALL}" style="width: 100px;" />
|
|
| 32 |
<input type="submit" name="submit" value="{TEXT_INSTALL}" style="width: 100px;" /><br /><br />
|
|
| 31 | 33 |
</td> |
| 32 | 34 |
</tr> |
| 33 | 35 |
</table> |
| ... | ... | |
| 36 | 38 |
|
| 37 | 39 |
</form> |
| 38 | 40 |
|
| 39 |
<form name="uninstall" action="uninstall.php" method="post" class="{DISPLAY_UNINSTALL}">
|
|
| 41 |
<form name="uninstall" action="uninstall.php" method="post" class="{DISPLAY_UNINSTALL} left">
|
|
| 40 | 42 |
{FTAN}
|
| 41 | 43 |
|
| 42 | 44 |
<h2>{HEADING_UNINSTALL_TEMPLATE}</h2>
|
| ... | ... | |
| 61 | 63 |
|
| 62 | 64 |
</form> |
| 63 | 65 |
|
| 64 |
<form name="details" action="details.php" method="post" class="{DISPLAY_LIST}">
|
|
| 66 |
<form name="details" action="details.php" method="post" class="{DISPLAY_LIST} left">
|
|
| 65 | 67 |
{FTAN}
|
| 66 | 68 |
|
| 67 | 69 |
<h2>{HEADING_TEMPLATE_DETAILS}</h2>
|
| branches/2.8.x/wb/admin/skel/themes/htt/languages.htt | ||
|---|---|---|
| 2 | 2 |
|
| 3 | 3 |
<table summary="" cellpadding="5" cellspacing="0" border="0" align="center" width="100%" style="margin-bottom:10px;"> |
| 4 | 4 |
<tr style="background:#f0f0f0;"> |
| 5 |
<td align="left">{CHANGE_TEMPLATE_NOTICE}</td>
|
|
| 5 |
<td align="left">{HEADING_CHANGE_TEMPLATE_NOTICE}</td>
|
|
| 6 | 6 |
<td align="right"> |
| 7 |
{URL_TEMPLATES}
|
|
| 8 |
- |
|
| 7 | 9 |
{URL_MODULES}
|
| 8 | 10 |
- |
| 9 |
{URL_TEMPLATES}
|
|
| 10 |
- |
|
| 11 | 11 |
{URL_ADVANCED}
|
| 12 | 12 |
</td> |
| 13 | 13 |
</tr> |
| 14 | 14 |
</table> |
| 15 | 15 |
|
| 16 |
<form name="install" enctype="multipart/form-data" action="install.php" method="post" class="{DISPLAY_INSTALL}">
|
|
| 16 |
<form name="install" enctype="multipart/form-data" action="install.php" method="post" class="{DISPLAY_INSTALL} left">
|
|
| 17 | 17 |
{FTAN}
|
| 18 | 18 |
<h2>{HEADING_INSTALL_LANGUAGE}</h2>
|
| 19 | 19 |
<table summary="" cellpadding="2" cellspacing="0" border="0" width="100%"> |
| 20 | 20 |
<tr> |
| 21 | 21 |
<td> |
| 22 |
<input type="file" name="userfile" size="97" />
|
|
| 22 |
<input type="file" name="userfile" size="60" />
|
|
| 23 | 23 |
<script type="text/javascript"> |
| 24 | 24 |
document.install.userfile.focus(); |
| 25 | 25 |
</script><br /><br /> |
| 26 |
<span style="visibility: hidden;"> |
|
| 27 |
<input type="checkbox" name="overwrite" value="false" /> |
|
| 28 |
{MESSAGE_ADDON_OVERWRITE_NEWER_FILES}
|
|
| 29 |
</span> |
|
| 30 |
|
|
| 26 | 31 |
</td> |
| 27 | 32 |
<td width="110" align="left"> |
| 28 |
<input type="submit" name="submit" value="{TEXT_INSTALL}" style="width: 100px;" />
|
|
| 33 |
<input type="submit" name="submit" value="{TEXT_INSTALL}" style="width: 100px;" /><br /><br />
|
|
| 29 | 34 |
</td> |
| 30 | 35 |
</tr> |
| 31 | 36 |
</table> |
| 32 | 37 |
<br /> |
| 33 | 38 |
</form> |
| 34 |
<form name="uninstall" action="uninstall.php" method="post" class="{DISPLAY_UNINSTALL}">
|
|
| 39 |
<form name="uninstall" action="uninstall.php" method="post" class="{DISPLAY_UNINSTALL} left">
|
|
| 35 | 40 |
{FTAN}
|
| 36 | 41 |
<h2>{HEADING_UNINSTALL_LANGUAGE}</h2>
|
| 37 | 42 |
<table summary="" cellpadding="2" cellspacing="0" border="0" width="100%"> |
| branches/2.8.x/wb/admin/skel/themes/htt/modules_details.htt | ||
|---|---|---|
| 1 | 1 |
<!-- BEGIN main_block --> |
| 2 |
<table summary="" cellpadding="5" cellspacing="0" border="0" align="center" width="100%" style="margin-bottom:10px;"> |
|
| 3 |
<tr style="background:#f0f0f0;"> |
|
| 4 |
<td align="right"> </td> |
|
| 5 |
</tr> |
|
| 6 |
</table> |
|
| 2 | 7 |
|
| 3 |
<h2>{HEADING_MODULE_DETAILS}</h2>
|
|
| 8 |
<h2 class="left">{HEADING_MODULE_DETAILS}</h2>
|
|
| 4 | 9 |
|
| 5 |
<table summary="" cellpadding="5" cellspacing="0" border="0">
|
|
| 10 |
<table summary="" class="left">
|
|
| 6 | 11 |
<tr> |
| 7 | 12 |
<td width="100">{TEXT_NAME}:</td>
|
| 8 | 13 |
<td>{NAME}</td>
|
| branches/2.8.x/wb/admin/interface/version.php | ||
|---|---|---|
| 51 | 51 |
|
| 52 | 52 |
// check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled) |
| 53 | 53 |
if(!defined('VERSION')) define('VERSION', '2.8.3');
|
| 54 |
if(!defined('REVISION')) define('REVISION', '1711');
|
|
| 54 |
if(!defined('REVISION')) define('REVISION', '1712');
|
|
| 55 | 55 |
if(!defined('SP')) define('SP', '');
|
| branches/2.8.x/wb/admin/languages/uninstall.php | ||
|---|---|---|
| 3 | 3 |
* |
| 4 | 4 |
* @category admin |
| 5 | 5 |
* @package languages |
| 6 |
* @author WebsiteBaker Project |
|
| 7 |
* @copyright 2004-2009, Ryan Djurovich |
|
| 8 |
* @copyright 2009-2011, Website Baker Org. e.V. |
|
| 6 |
* @author Ryan Djurovich, WebsiteBaker Project |
|
| 7 |
* @copyright 2009-2012, WebsiteBaker Org. e.V. |
|
| 9 | 8 |
* @link http://www.websitebaker2.org/ |
| 10 | 9 |
* @license http://www.gnu.org/licenses/gpl.html |
| 11 | 10 |
* @platform WebsiteBaker 2.8.x |
| ... | ... | |
| 29 | 28 |
// After check print the header |
| 30 | 29 |
$admin->print_header(); |
| 31 | 30 |
|
| 31 |
// Get language name |
|
| 32 |
if(!isset($_POST['code']) OR $_POST['code'] == "") {
|
|
| 33 |
$code = ''; |
|
| 34 |
$file = ''; |
|
| 35 |
} else {
|
|
| 36 |
$code = $_POST['code']; |
|
| 37 |
$file = $_POST['code'].'.php'; |
|
| 38 |
} |
|
| 39 |
// fix secunia 2010-93-2 |
|
| 40 |
if (!preg_match('/^([A-Z]{2}.php)/', $file)) {
|
|
| 41 |
$admin->print_error($MESSAGE['GENERIC_FORGOT_OPTIONS']); |
|
| 42 |
} |
|
| 43 |
|
|
| 44 |
// Check if the template exists |
|
| 45 |
if(!is_file(WB_PATH.'/languages/'.$file)) {
|
|
| 46 |
$admin->print_error($MESSAGE['GENERIC_NOT_INSTALLED']); |
|
| 47 |
} |
|
| 48 |
|
|
| 49 |
// Check if the template exists |
|
| 50 |
if(!is_readable(WB_PATH.'/languages/'.$file)) {
|
|
| 51 |
$admin->print_error($MESSAGE['ADMIN_INSUFFICIENT_PRIVELLIGES']); |
|
| 52 |
} |
|
| 53 |
|
|
| 54 |
/* |
|
| 32 | 55 |
// Check if user selected language |
| 33 | 56 |
if(!isset($_POST['code']) OR $_POST['code'] == "") {
|
| 34 | 57 |
header("Location: index.php");
|
| ... | ... | |
| 41 | 64 |
exit(0); |
| 42 | 65 |
} |
| 43 | 66 |
|
| 44 |
// Include the WB functions file |
|
| 45 |
require_once(WB_PATH.'/framework/functions.php'); |
|
| 46 |
|
|
| 47 | 67 |
// Check if the language exists |
| 48 | 68 |
if(!file_exists(WB_PATH.'/languages/'.$_POST['code'].'.php')) {
|
| 49 |
$admin->print_error($MESSAGE['GENERIC']['NOT_INSTALLED']);
|
|
| 69 |
$admin->print_error($MESSAGE['GENERIC_NOT_INSTALLED']);
|
|
| 50 | 70 |
} |
| 71 |
*/ |
|
| 72 |
// Include the WB functions file |
|
| 73 |
require_once(WB_PATH.'/framework/functions.php'); |
|
| 51 | 74 |
|
| 52 | 75 |
// Check if the language is in use |
| 53 |
if($_POST['code'] == DEFAULT_LANGUAGE OR $_POST['code'] == LANGUAGE) {
|
|
| 54 |
$admin->print_error($MESSAGE['GENERIC']['CANNOT_UNINSTALL_IN_USE']);
|
|
| 76 |
if($code == DEFAULT_LANGUAGE OR $code == LANGUAGE) {
|
|
| 77 |
$admin->print_error($MESSAGE['GENERIC_CANNOT_UNINSTALL_IN_USE']);
|
|
| 55 | 78 |
} else {
|
| 56 |
$query_users = $database->query("SELECT user_id FROM ".TABLE_PREFIX."users WHERE language = '".$admin->add_slashes($_POST['code'])."' LIMIT 1");
|
|
| 79 |
$query_users = $database->query("SELECT user_id FROM ".TABLE_PREFIX."users WHERE language = '".$admin->add_slashes($code)."' LIMIT 1");
|
|
| 57 | 80 |
if($query_users->numRows() > 0) {
|
| 58 |
$admin->print_error($MESSAGE['GENERIC']['CANNOT_UNINSTALL_IN_USE']);
|
|
| 81 |
$admin->print_error($MESSAGE['GENERIC_CANNOT_UNINSTALL_IN_USE']);
|
|
| 59 | 82 |
} |
| 60 | 83 |
} |
| 61 | 84 |
|
| 62 | 85 |
// Try to delete the language code |
| 63 |
if(!unlink(WB_PATH.'/languages/'.$_POST['code'].'.php')) {
|
|
| 64 |
$admin->print_error($MESSAGE['GENERIC']['CANNOT_UNINSTALL']);
|
|
| 86 |
if(!unlink(WB_PATH.'/languages/'.$file)) {
|
|
| 87 |
$admin->print_error($MESSAGE['GENERIC_CANNOT_UNINSTALL']);
|
|
| 65 | 88 |
} else {
|
| 66 | 89 |
// Remove entry from DB |
| 67 |
$database->query("DELETE FROM ".TABLE_PREFIX."addons WHERE directory = '".$_POST['code']."' AND type = 'language'");
|
|
| 90 |
$database->query("DELETE FROM ".TABLE_PREFIX."addons WHERE directory = \'".$code."\' AND type = 'language'");
|
|
| 68 | 91 |
} |
| 69 | 92 |
|
| 70 | 93 |
// Print success message |
| 71 |
$admin->print_success($MESSAGE['GENERIC']['UNINSTALLED']);
|
|
| 94 |
$admin->print_success($MESSAGE['GENERIC_UNINSTALLED']);
|
|
| 72 | 95 |
|
| 73 | 96 |
// Print admin footer |
| 74 | 97 |
$admin->print_footer(); |
| 75 |
|
|
| 76 |
?> |
|
| branches/2.8.x/wb/admin/languages/details.php | ||
|---|---|---|
| 4 | 4 |
* @category admin |
| 5 | 5 |
* @package languages |
| 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 |
| ... | ... | |
| 33 | 33 |
// Get language name |
| 34 | 34 |
if(!isset($_POST['code']) OR $_POST['code'] == "") {
|
| 35 | 35 |
$code = ''; |
| 36 |
$file = ''; |
|
| 36 | 37 |
} else {
|
| 37 | 38 |
$code = $_POST['code']; |
| 39 |
$file = $_POST['code'].'.php'; |
|
| 38 | 40 |
} |
| 41 |
// fix secunia 2010-93-2 |
|
| 42 |
if (!preg_match('/^([A-Z]{2}.php)/', $file)) {
|
|
| 43 |
$admin->print_error($MESSAGE['GENERIC_FORGOT_OPTIONS']); |
|
| 44 |
} |
|
| 39 | 45 |
|
| 40 |
// fix secunia 2010-93-2 |
|
| 46 |
// Check if the template exists |
|
| 47 |
if(!is_file(WB_PATH.'/languages/'.$file) ) {
|
|
| 48 |
$admin->print_error($MESSAGE['GENERIC_NOT_INSTALLED']); |
|
| 49 |
} |
|
| 50 |
|
|
| 51 |
// Check if the template exists |
|
| 52 |
if(!is_readable(WB_PATH.'/languages/'.$file) ) {
|
|
| 53 |
$admin->print_error($MESSAGE['ADMIN_INSUFFICIENT_PRIVELLIGES']); |
|
| 54 |
} |
|
| 55 |
|
|
| 56 |
/* |
|
| 57 |
print '<pre style="text-align: left;"><strong>function '.__FUNCTION__.'( '.''.' );</strong> basename: '.basename(__FILE__).' line: '.__LINE__.' -> <br />'; |
|
| 58 |
print_r( $file ); print '</pre>'; // flush ();sleep(10); die(); |
|
| 59 |
|
|
| 41 | 60 |
if (!preg_match('/^[A-Z]{2}$/', $code)) {
|
| 42 | 61 |
header("Location: index.php");
|
| 43 | 62 |
exit(0); |
| ... | ... | |
| 48 | 67 |
header("Location: index.php");
|
| 49 | 68 |
exit(0); |
| 50 | 69 |
} |
| 70 |
*/ |
|
| 51 | 71 |
|
| 52 | 72 |
// Setup template object, parse vars to it, then parse it |
| 53 | 73 |
// Create new template object |
| 54 |
$template = new Template(dirname($admin->correct_theme_source('languages_details.htt')));
|
|
| 74 |
$template = new Template(dirname($admin->correct_theme_source('languages_details.htt')),'keep');
|
|
| 55 | 75 |
// $template->debug = true; |
| 56 | 76 |
$template->set_file('page', 'languages_details.htt');
|
| 57 | 77 |
$template->set_block('page', 'main_block', 'main');
|
| 58 | 78 |
|
| 59 | 79 |
// Insert values |
| 60 |
require(WB_PATH.'/languages/'.$code.'.php');
|
|
| 80 |
require(WB_PATH.'/languages/'.$file);
|
|
| 61 | 81 |
$template->set_var(array( |
| 62 |
'CODE' => $language_code,
|
|
| 63 |
'NAME' => $language_name,
|
|
| 64 |
'AUTHOR' => $language_author,
|
|
| 65 |
'VERSION' => $language_version,
|
|
| 66 |
'DESIGNED_FOR' => $language_platform,
|
|
| 67 |
'ADMIN_URL' => ADMIN_URL,
|
|
| 68 |
'WB_URL' => WB_URL,
|
|
| 69 |
'THEME_URL' => THEME_URL
|
|
| 70 |
)
|
|
| 71 |
);
|
|
| 82 |
'CODE' => $language_code, |
|
| 83 |
'NAME' => $language_name, |
|
| 84 |
'AUTHOR' => $language_author, |
|
| 85 |
'VERSION' => $language_version, |
|
| 86 |
'DESIGNED_FOR' => $language_platform, |
|
| 87 |
'ADMIN_URL' => ADMIN_URL, |
|
| 88 |
'WB_URL' => WB_URL, |
|
| 89 |
'THEME_URL' => THEME_URL |
|
| 90 |
) |
|
| 91 |
); |
|
| 72 | 92 |
|
| 73 |
// Restore language to original code
|
|
| 74 |
require(WB_PATH.'/languages/'.LANGUAGE.'.php');
|
|
| 93 |
$mLang = ModLanguage::getInstance();
|
|
| 94 |
$mLang->setLanguage(ADMIN_PATH.'/addons/languages/', LANGUAGE, DEFAULT_LANGUAGE);
|
|
| 75 | 95 |
|
| 76 |
// Insert language headings |
|
| 77 |
$template->set_var(array( |
|
| 78 |
'HEADING_LANGUAGE_DETAILS' => $HEADING['LANGUAGE_DETAILS'] |
|
| 79 |
) |
|
| 80 |
); |
|
| 81 |
// Insert language text and messages |
|
| 82 |
$template->set_var(array( |
|
| 83 |
'TEXT_CODE' => $TEXT['CODE'], |
|
| 84 |
'TEXT_NAME' => $TEXT['NAME'], |
|
| 85 |
'TEXT_TYPE' => $TEXT['TYPE'], |
|
| 86 |
'TEXT_AUTHOR' => $TEXT['AUTHOR'], |
|
| 87 |
'TEXT_VERSION' => $TEXT['VERSION'], |
|
| 88 |
'TEXT_DESIGNED_FOR' => $TEXT['DESIGNED_FOR'], |
|
| 89 |
'TEXT_BACK' => $TEXT['BACK'] |
|
| 90 |
) |
|
| 91 |
); |
|
| 96 |
/*-- insert all needed vars from language files ----------------------------------------*/ |
|
| 97 |
$template->set_var($mLang->getLangArray()); |
|
| 92 | 98 |
|
| 93 | 99 |
// Parse language object |
| 94 | 100 |
$template->parse('main', 'main_block', false);
|
| branches/2.8.x/wb/admin/languages/install.php | ||
|---|---|---|
| 3 | 3 |
* |
| 4 | 4 |
* @category admin |
| 5 | 5 |
* @package languages |
| 6 |
* @author WebsiteBaker Project |
|
| 7 |
* @copyright 2004-2009, Ryan Djurovich |
|
| 8 |
* @copyright 2009-2011, Website Baker Org. e.V. |
|
| 6 |
* @author Ryan Djurovich, WebsiteBaker Project |
|
| 7 |
* @copyright 2009-2012, WebsiteBaker Org. e.V. |
|
| 9 | 8 |
* @link http://www.websitebaker2.org/ |
| 10 | 9 |
* @license http://www.gnu.org/licenses/gpl.html |
| 11 | 10 |
* @platform WebsiteBaker 2.8.x |
| ... | ... | |
| 60 | 59 |
// Check if language dir is writable |
| 61 | 60 |
if(!is_writable(WB_PATH.'/languages/')) {
|
| 62 | 61 |
if(file_exists($temp_file)) { unlink($temp_file); } // Remove temp file
|
| 63 |
$admin->print_error($MESSAGE['GENERIC']['BAD_PERMISSIONS']);
|
|
| 62 |
$admin->print_error($MESSAGE['GENERIC_BAD_PERMISSIONS']);
|
|
| 64 | 63 |
} |
| 65 | 64 |
|
| 66 | 65 |
// Try to upload the file to the temp dir |
| 67 | 66 |
if(!move_uploaded_file($_FILES['userfile']['tmp_name'], $temp_file)) {
|
| 68 | 67 |
if(file_exists($temp_file)) { unlink($temp_file); } // Remove temp file
|
| 69 |
$admin->print_error($MESSAGE['GENERIC']['CANNOT_UPLOAD']);
|
|
| 68 |
$admin->print_error($MESSAGE['GENERIC_CANNOT_UPLOAD']);
|
|
| 70 | 69 |
} |
| 71 | 70 |
|
| 72 | 71 |
// Check if uploaded file is a valid language file (no binary file etc.) |
| 73 | 72 |
$content = file_get_contents($temp_file); |
| 74 |
if (strpos($content, '<?php') === false) $admin->print_error($MESSAGE['GENERIC']['INVALID_LANGUAGE_FILE']);
|
|
| 73 |
if (strpos($content, '<?php') === false) $admin->print_error($MESSAGE['GENERIC_INVALID_LANGUAGE_FILE']);
|
|
| 75 | 74 |
|
| 76 | 75 |
// Remove any vars with name "language_code" |
| 77 | 76 |
unset($language_code); |
| ... | ... | |
| 88 | 87 |
if(file_exists($temp_file)) { unlink($temp_file); } // Remove temp file
|
| 89 | 88 |
// Restore to correct language |
| 90 | 89 |
require(WB_PATH.'/languages/'.LANGUAGE.'.php'); |
| 91 |
$admin->print_error($MESSAGE['GENERIC']['INVALID_LANGUAGE_FILE']);
|
|
| 90 |
$admin->print_error($MESSAGE['GENERIC_INVALID_LANGUAGE_FILE']);
|
|
| 92 | 91 |
} |
| 93 | 92 |
|
| 94 | 93 |
// Set destination for language file |
| ... | ... | |
| 101 | 100 |
if (versionCompare($language_version, $new_language_version, '>=')) {
|
| 102 | 101 |
// Restore to correct language |
| 103 | 102 |
require(WB_PATH . '/languages/' . LANGUAGE . '.php'); |
| 104 |
$admin->print_error($MESSAGE['GENERIC']['ALREADY_INSTALLED']);
|
|
| 103 |
$admin->print_error($MESSAGE['GENERIC_ALREADY_INSTALLED']);
|
|
| 105 | 104 |
} |
| 106 | 105 |
$action="upgrade"; |
| 107 | 106 |
unlink($language_file); |
| ... | ... | |
| 120 | 119 |
|
| 121 | 120 |
// Print success message |
| 122 | 121 |
if ($action=="install") {
|
| 123 |
$admin->print_success($MESSAGE['GENERIC']['INSTALLED']);
|
|
| 122 |
$admin->print_success($MESSAGE['GENERIC_INSTALLED']);
|
|
| 124 | 123 |
} else {
|
| 125 |
$admin->print_success($MESSAGE['GENERIC']['UPGRADED']);
|
|
| 124 |
$admin->print_success($MESSAGE['GENERIC_UPGRADED']);
|
|
| 126 | 125 |
} |
| 127 | 126 |
|
| 128 | 127 |
// Print admin footer |
| 129 | 128 |
$admin->print_footer(); |
| 130 |
|
|
| 131 |
?> |
|
| branches/2.8.x/wb/admin/languages/index.php | ||
|---|---|---|
| 4 | 4 |
* @category admin |
| 5 | 5 |
* @package languages |
| 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 |
| ... | ... | |
| 23 | 23 |
|
| 24 | 24 |
// Setup template object, parse vars to it, then parse it |
| 25 | 25 |
// Create new template object |
| 26 |
$template = new Template(dirname($admin->correct_theme_source('languages.htt')));
|
|
| 26 |
$template = new Template(dirname($admin->correct_theme_source('languages.htt')),'keep');
|
|
| 27 | 27 |
// $template->debug = true; |
| 28 | 28 |
$template->set_file('page', 'languages.htt');
|
| 29 | 29 |
$template->set_block('page', 'main_block', 'main');
|
| ... | ... | |
| 50 | 50 |
$template->set_var('DISPLAY_LIST', 'hide');
|
| 51 | 51 |
} |
| 52 | 52 |
|
| 53 |
// Insert language headings |
|
| 54 |
$template->set_var(array( |
|
| 55 |
'HEADING_INSTALL_LANGUAGE' => $HEADING['INSTALL_LANGUAGE'], |
|
| 56 |
'HEADING_UNINSTALL_LANGUAGE' => $HEADING['UNINSTALL_LANGUAGE'], |
|
| 57 |
'HEADING_LANGUAGE_DETAILS' => $HEADING['LANGUAGE_DETAILS'] |
|
| 58 |
) |
|
| 59 |
); |
|
| 53 |
$mLang = ModLanguage::getInstance(); |
|
| 54 |
$mLang->setLanguage(ADMIN_PATH.'/addons/languages/', LANGUAGE, DEFAULT_LANGUAGE); |
|
| 55 |
|
|
| 56 |
/*-- insert all needed vars from language files ----------------------------------------*/ |
|
| 57 |
$template->set_var($mLang->getLangArray()); |
|
| 60 | 58 |
// insert urls |
| 61 | 59 |
$template->set_var(array( |
| 62 | 60 |
'ADMIN_URL' => ADMIN_URL, |
| ... | ... | |
| 67 | 65 |
); |
| 68 | 66 |
// Insert language text and messages |
| 69 | 67 |
$template->set_var(array( |
| 68 |
'URL_ADVANCED' => '<b>'.$TEXT['ADVANCED'].'</b>' , |
|
| 70 | 69 |
'URL_MODULES' => $admin->get_permission('modules') ?
|
| 71 |
'<a href="' . ADMIN_URL . '/modules/index.php">' . $MENU['MODULES'] . '</a>' : '', |
|
| 72 |
'URL_ADVANCED' => '          ', |
|
| 70 |
'<a href="' . ADMIN_URL . '/modules/index.php">' . $mLang->MENU_MODULES . '</a>' : '<b>'.$mLang->MENU_MODULES.'</b>', |
|
| 73 | 71 |
'URL_TEMPLATES' => $admin->get_permission('templates') ?
|
| 74 |
'<a href="' . ADMIN_URL . '/templates/index.php">' . $MENU['TEMPLATES'] . '</a>' : '', |
|
| 75 |
'TEXT_INSTALL' => $TEXT['INSTALL'], |
|
| 76 |
'TEXT_UNINSTALL' => $TEXT['UNINSTALL'], |
|
| 77 |
'TEXT_VIEW_DETAILS' => $TEXT['VIEW_DETAILS'], |
|
| 78 |
'TEXT_PLEASE_SELECT' => $TEXT['PLEASE_SELECT'] |
|
| 72 |
'<a href="' . ADMIN_URL . '/templates/index.php">' . $mLang->MENU_TEMPLATES . '</a>' : '<b>'.$mLang->MENU_TEMPLATES.'</b>', |
|
| 73 |
'HEADING_CHANGE_TEMPLATE_NOTICE' => '' |
|
| 79 | 74 |
) |
| 80 | 75 |
); |
| 81 | 76 |
|
| branches/2.8.x/wb/admin/modules/uninstall.php | ||
|---|---|---|
| 3 | 3 |
* |
| 4 | 4 |
* @category admin |
| 5 | 5 |
* @package modules |
| 6 |
* @author WebsiteBaker Project |
|
| 7 |
* @copyright 2004-2009, Ryan Djurovich |
|
| 8 |
* @copyright 2009-2011, Website Baker Org. e.V. |
|
| 6 |
* @author Ryan Djurovich,WebsiteBaker Project |
|
| 7 |
* @copyright 2009-2012, WebsiteBaker Org. e.V. |
|
| 9 | 8 |
* @link http://www.websitebaker2.org/ |
| 10 | 9 |
* @license http://www.gnu.org/licenses/gpl.html |
| 11 | 10 |
* @platform WebsiteBaker 2.8.x |
| ... | ... | |
| 27 | 26 |
} |
| 28 | 27 |
// After check print the header |
| 29 | 28 |
$admin->print_header(); |
| 29 |
if(!isset($_POST['file']) OR $_POST['file'] == "") {
|
|
| 30 |
$admin->print_error($MESSAGE['GENERIC_FORGOT_OPTIONS']); |
|
| 31 |
} else {
|
|
| 32 |
$file = preg_replace('/[^a-z0-9_-]/i', "", $_POST['file']); // fix secunia 2010-92-2
|
|
| 33 |
} |
|
| 30 | 34 |
|
| 35 |
// Check if the template exists |
|
| 36 |
if(!is_dir(WB_PATH.'/modules/'.$file)) {
|
|
| 37 |
$admin->print_error($MESSAGE['GENERIC_NOT_INSTALLED']); |
|
| 38 |
} |
|
| 39 |
|
|
| 40 |
// Check if the template exists |
|
| 41 |
if(!is_readable(WB_PATH.'/modules/'.$file)) {
|
|
| 42 |
$admin->print_error($MESSAGE['ADMIN_INSUFFICIENT_PRIVELLIGES']); |
|
| 43 |
} |
|
| 44 |
|
|
| 45 |
/* |
|
| 31 | 46 |
// Check if user selected module |
| 32 | 47 |
if(!isset($_POST['file']) OR $_POST['file'] == "") {
|
| 33 | 48 |
header("Location: index.php");
|
| ... | ... | |
| 42 | 57 |
exit(0); |
| 43 | 58 |
} |
| 44 | 59 |
|
| 45 |
// Include the WB functions file |
|
| 46 |
require_once(WB_PATH.'/framework/functions.php'); |
|
| 47 |
|
|
| 48 | 60 |
// Check if the module exists |
| 49 | 61 |
if(!is_dir(WB_PATH.'/modules/'.$file)) {
|
| 50 |
$admin->print_error($MESSAGE['GENERIC']['NOT_INSTALLED']);
|
|
| 62 |
$admin->print_error($MESSAGE['GENERIC_NOT_INSTALLED']);
|
|
| 51 | 63 |
} |
| 64 |
*/ |
|
| 52 | 65 |
|
| 66 |
// Include the WB functions file |
|
| 67 |
require_once(WB_PATH.'/framework/functions.php'); |
|
| 68 |
|
|
| 53 | 69 |
if (!function_exists("replace_all")) {
|
| 54 | 70 |
function replace_all ($aStr = "", &$aArray ) {
|
| 55 | 71 |
foreach($aArray as $k=>$v) $aStr = str_replace("{{".$k."}}", $v, $aStr);
|
| ... | ... | |
| 60 | 76 |
$info = $database->query("SELECT section_id, page_id FROM ".TABLE_PREFIX."sections WHERE module='".$_POST['file']."'" );
|
| 61 | 77 |
|
| 62 | 78 |
if ( $info->numRows() > 0) {
|
| 63 |
|
|
| 79 |
|
|
| 64 | 80 |
/** |
| 65 | 81 |
* Modul is in use, so we have to warn the user |
| 66 | 82 |
*/ |
| ... | ... | |
| 69 | 85 |
$msg_template_str = "<br /><br />{{type}} <b>{{type_name}}</b> could not be uninstalled because it is still in use on {{pages}}";
|
| 70 | 86 |
$msg_template_str .= ":<br /><i>click for editing.</i><br /><br />"; |
| 71 | 87 |
} else {
|
| 72 |
$msg_template_str = $MESSAGE['GENERIC']['CANNOT_UNINSTALL_IN_USE_TMPL'];
|
|
| 73 |
$temp = explode(";",$MESSAGE['GENERIC']['CANNOT_UNINSTALL_IN_USE_TMPL_PAGES']);
|
|
| 88 |
$msg_template_str = $MESSAGE['GENERIC_CANNOT_UNINSTALL_IN_USE_TMPL'];
|
|
| 89 |
$temp = explode(";",$MESSAGE['GENERIC_CANNOT_UNINSTALL_IN_USE_TMPL_PAGES']);
|
|
| 74 | 90 |
$add = $info->numRows() == 1 ? $temp[0] : $temp[1]; |
| 75 | 91 |
} |
| 76 | 92 |
/** |
| 77 | 93 |
* The template-string for displaying the Page-Titles ... in this case as a link |
| 78 | 94 |
*/ |
| 79 | 95 |
$page_template_str = "- <b><a href='../pages/sections.php?page_id={{id}}'>{{title}}</a></b><br />";
|
| 80 |
|
|
| 96 |
|
|
| 81 | 97 |
$values = array ('type' => 'Modul', 'type_name' => $file, 'pages' => $add );
|
| 82 | 98 |
$msg = replace_all ( $msg_template_str, $values ); |
| 83 |
|
|
| 99 |
|
|
| 84 | 100 |
$page_names = ""; |
| 85 |
|
|
| 101 |
|
|
| 86 | 102 |
while ($data = $info->fetchRow() ) {
|
| 87 |
|
|
| 103 |
|
|
| 88 | 104 |
$temp = $database->query("SELECT page_title from ".TABLE_PREFIX."pages where page_id=".$data['page_id']);
|
| 89 | 105 |
$temp_title = $temp->fetchRow(); |
| 90 |
|
|
| 106 |
|
|
| 91 | 107 |
$page_info = array( |
| 92 |
'id' => $data['page_id'],
|
|
| 108 |
'id' => $data['page_id'], |
|
| 93 | 109 |
'title' => $temp_title['page_title'] |
| 94 | 110 |
); |
| 95 |
|
|
| 111 |
|
|
| 96 | 112 |
$page_names .= replace_all ( $page_template_str, $page_info ); |
| 97 | 113 |
} |
| 98 |
|
|
| 114 |
|
|
| 99 | 115 |
/** |
| 100 | 116 |
* Printing out the error-message and die(). |
| 101 | 117 |
*/ |
| 102 |
$admin->print_error(str_replace ($TEXT['FILE'], "Modul", $MESSAGE['GENERIC']['CANNOT_UNINSTALL_IN_USE']).$msg.$page_names);
|
|
| 118 |
$admin->print_error(str_replace ($TEXT['FILE'], "Modul", $MESSAGE['GENERIC_CANNOT_UNINSTALL_IN_USE']).$msg.$page_names);
|
|
| 103 | 119 |
} |
| 104 | 120 |
|
| 105 | 121 |
// Check if we have permissions on the directory |
| 106 | 122 |
if(!is_writable(WB_PATH.'/modules/'.$file)) {
|
| 107 |
$admin->print_error($MESSAGE['GENERIC']['CANNOT_UNINSTALL']);
|
|
| 123 |
$admin->print_error($MESSAGE['GENERIC_CANNOT_UNINSTALL']);
|
|
| 108 | 124 |
} |
| 109 | 125 |
|
| 110 | 126 |
// Run the modules uninstall script if there is one |
| 111 |
if(file_exists(WB_PATH.'/modules/'.$file.'/uninstall.php')) {
|
|
| 127 |
if(is_readable(WB_PATH.'/modules/'.$file.'/uninstall.php')) {
|
|
| 112 | 128 |
require(WB_PATH.'/modules/'.$file.'/uninstall.php'); |
| 113 | 129 |
} |
| 114 | 130 |
|
| 115 | 131 |
// Try to delete the module dir |
| 116 | 132 |
if(!rm_full_dir(WB_PATH.'/modules/'.$file)) {
|
| 117 |
$admin->print_error($MESSAGE['GENERIC']['CANNOT_UNINSTALL']);
|
|
| 133 |
$admin->print_error($MESSAGE['GENERIC_CANNOT_UNINSTALL']);
|
|
| 118 | 134 |
} else {
|
| 119 | 135 |
// Remove entry from DB |
| 120 | 136 |
$database->query("DELETE FROM ".TABLE_PREFIX."addons WHERE directory = '".$file."' AND type = 'module'");
|
| 121 | 137 |
} |
| 122 | 138 |
|
| 123 | 139 |
// Print success message |
| 124 |
$admin->print_success($MESSAGE['GENERIC']['UNINSTALLED']);
|
|
| 140 |
$admin->print_success($MESSAGE['GENERIC_UNINSTALLED']);
|
|
| 125 | 141 |
|
| 126 | 142 |
// Print admin footer |
| 127 | 143 |
$admin->print_footer(); |
| 128 |
|
|
| 129 |
?> |
|
| branches/2.8.x/wb/admin/modules/details.php | ||
|---|---|---|
| 4 | 4 |
* @category admin |
| 5 | 5 |
* @package modules |
| 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 |
| ... | ... | |
| 29 | 29 |
// After check print the header |
| 30 | 30 |
$admin->print_header(); |
| 31 | 31 |
|
| 32 |
$mLang = ModLanguage::getInstance(); |
|
| 33 |
$mLang->setLanguage(ADMIN_PATH.'/addons/languages/', LANGUAGE, DEFAULT_LANGUAGE); |
|
| 34 |
|
|
| 35 |
if(!isset($_POST['file']) OR $_POST['file'] == "") {
|
|
| 36 |
$admin->print_error($MESSAGE['GENERIC_FORGOT_OPTIONS']); |
|
| 37 |
} else {
|
|
| 38 |
$file = preg_replace('/[^a-z0-9_-]/i', "", $_POST['file']); // fix secunia 2010-92-2
|
|
| 39 |
} |
|
| 40 |
|
|
| 41 |
// Check if the template exists |
|
| 42 |
if(!is_dir(WB_PATH.'/modules/'.$file)) {
|
|
| 43 |
$admin->print_error($MESSAGE['GENERIC_NOT_INSTALLED']); |
|
| 44 |
} |
|
| 45 |
|
|
| 46 |
// Check if the template exists |
|
| 47 |
if(!is_readable(WB_PATH.'/modules/'.$file)) {
|
|
| 48 |
$admin->print_error($MESSAGE['ADMIN_INSUFFICIENT_PRIVELLIGES']); |
|
| 49 |
} |
|
| 50 |
|
|
| 51 |
/* |
|
| 32 | 52 |
// Get module name |
| 33 | 53 |
if(!isset($_POST['file']) OR $_POST['file'] == "") |
| 34 | 54 |
{
|
| ... | ... | |
| 41 | 61 |
} |
| 42 | 62 |
|
| 43 | 63 |
// Check if the module exists |
| 44 |
if(!file_exists(WB_PATH.'/modules/'.$file)) {
|
|
| 64 |
if(!is_readable(WB_PATH.'/modules/'.$file)) {
|
|
| 45 | 65 |
header("Location: index.php");
|
| 46 | 66 |
exit(0); |
| 47 | 67 |
} |
| 68 |
*/ |
|
| 48 | 69 |
|
| 49 | 70 |
// Setup template object, parse vars to it, then parse it |
| 50 | 71 |
// Create new template object |
| 51 |
$template = new Template(dirname($admin->correct_theme_source('modules_details.htt')));
|
|
| 72 |
$template = new Template(dirname($admin->correct_theme_source('modules_details.htt')),'keep');
|
|
| 52 | 73 |
// $template->debug = true; |
| 53 | 74 |
$template->set_file('page', 'modules_details.htt');
|
| 54 | 75 |
$template->set_block('page', 'main_block', 'main');
|
| ... | ... | |
| 59 | 80 |
$module = $result->fetchRow(); |
| 60 | 81 |
} |
| 61 | 82 |
|
| 83 |
/*-- insert all needed vars from language files ----------------------------------------*/ |
|
| 84 |
$template->set_var($mLang->getLangArray()); |
|
| 85 |
|
|
| 62 | 86 |
// check if a module description exists for the displayed backend language |
| 63 | 87 |
$tool_description = false; |
| 64 | 88 |
if(function_exists('file_get_contents') && file_exists(WB_PATH.'/modules/'.$file.'/languages/'.LANGUAGE .'.php')) {
|
| ... | ... | |
| 72 | 96 |
} else {
|
| 73 | 97 |
$tool_description = false; |
| 74 | 98 |
} |
| 75 |
}
|
|
| 99 |
} |
|
| 76 | 100 |
if($tool_description !== false) {
|
| 77 | 101 |
// Override the module-description with correct desription in users language |
| 78 | 102 |
$module['description'] = $tool_description; |
| ... | ... | |
| 89 | 113 |
'THEME_URL' => THEME_URL |
| 90 | 114 |
) |
| 91 | 115 |
); |
| 92 |
|
|
| 116 |
|
|
| 93 | 117 |
switch ($module['function']) {
|
| 94 | 118 |
case NULL: |
| 95 | 119 |
$type_name = $TEXT['UNKNOWN']; |
| ... | ... | |
| 117 | 141 |
} |
| 118 | 142 |
$template->set_var('TYPE', $type_name);
|
| 119 | 143 |
|
| 120 |
// Insert language headings |
|
| 121 |
$template->set_var(array( |
|
| 122 |
'HEADING_MODULE_DETAILS' => $HEADING['MODULE_DETAILS'] |
|
| 123 |
) |
|
| 124 |
); |
|
| 125 |
// Insert language text and messages |
|
| 126 |
$template->set_var(array( |
|
| 127 |
'TEXT_NAME' => $TEXT['NAME'], |
|
| 128 |
'TEXT_TYPE' => $TEXT['TYPE'], |
|
| 129 |
'TEXT_AUTHOR' => $TEXT['AUTHOR'], |
|
| 130 |
'TEXT_VERSION' => $TEXT['VERSION'], |
|
| 131 |
'TEXT_DESIGNED_FOR' => $TEXT['DESIGNED_FOR'], |
|
| 132 |
'TEXT_DESCRIPTION' => $TEXT['DESCRIPTION'], |
|
| 133 |
'TEXT_BACK' => $TEXT['BACK'] |
|
| 134 |
) |
|
| 135 |
); |
|
| 136 |
|
|
| 144 |
//// Insert language headings
|
|
| 145 |
//$template->set_var(array(
|
|
| 146 |
// 'HEADING_MODULE_DETAILS' => $HEADING['MODULE_DETAILS']
|
|
| 147 |
// )
|
|
| 148 |
// );
|
|
| 149 |
//// Insert language text and messages
|
|
| 150 |
//$template->set_var(array(
|
|
| 151 |
// 'TEXT_NAME' => $TEXT['NAME'],
|
|
| 152 |
// 'TEXT_TYPE' => $TEXT['TYPE'],
|
|
| 153 |
// 'TEXT_AUTHOR' => $TEXT['AUTHOR'],
|
|
| 154 |
// 'TEXT_VERSION' => $TEXT['VERSION'],
|
|
| 155 |
// 'TEXT_DESIGNED_FOR' => $TEXT['DESIGNED_FOR'],
|
|
| 156 |
// 'TEXT_DESCRIPTION' => $TEXT['DESCRIPTION'],
|
|
| 157 |
// 'TEXT_BACK' => $TEXT['BACK']
|
|
| 158 |
// )
|
|
| 159 |
// );
|
|
| 160 |
// |
|
| 137 | 161 |
// Parse module object |
| 138 | 162 |
$template->parse('main', 'main_block', false);
|
| 139 | 163 |
$template->pparse('output', 'page');
|
| branches/2.8.x/wb/admin/modules/install.php | ||
|---|---|---|
| 3 | 3 |
* |
| 4 | 4 |
* @category admin |
| 5 | 5 |
* @package modules |
| 6 |
* @author WebsiteBaker Project |
|
| 7 |
* @copyright 2004-2009, Ryan Djurovich |
|
| 8 |
* @copyright 2009-2011, Website Baker Org. e.V. |
|
| 6 |
* @author Ryan Djurovich,WebsiteBaker Project |
|
| 7 |
* @copyright 2009-2012, WebsiteBaker Org. e.V. |
|
| 9 | 8 |
* @link http://www.websitebaker2.org/ |
| 10 | 9 |
* @license http://www.gnu.org/licenses/gpl.html |
| 11 | 10 |
* @platform WebsiteBaker 2.8.x |
| ... | ... | |
| 75 | 74 |
$admin->print_error($MESSAGE[$key].'<br />'.$MESSAGE['GENERIC_CANNOT_UPLOAD']); |
| 76 | 75 |
} |
| 77 | 76 |
|
| 78 |
// Include the PclZip class file (thanks to
|
|
| 77 |
// Include the PclZip class file (thanks to |
|
| 79 | 78 |
require_once(WB_PATH.'/include/pclzip/pclzip.lib.php'); |
| 80 | 79 |
|
| 81 | 80 |
// Remove any vars with name "module_directory" |
| ... | ... | |
| 105 | 104 |
if(!isset($module_directory)) |
| 106 | 105 |
{
|
| 107 | 106 |
if(file_exists($temp_file)) { unlink($temp_file); } // Remove temp file
|
| 108 |
$admin->print_error($MESSAGE['GENERIC']['INVALID']);
|
|
| 107 |
$admin->print_error($MESSAGE['GENERIC_INVALID']);
|
|
| 109 | 108 |
} |
| 110 | 109 |
|
| 111 | 110 |
// Check if this module is already installed |
| ... | ... | |
| 122 | 121 |
{
|
| 123 | 122 |
|
| 124 | 123 |
if(file_exists($temp_file)) { unlink($temp_file); } // Remove temp file
|
| 125 |
$admin->print_error($MESSAGE['GENERIC']['ALREADY_INSTALLED']);
|
|
| 124 |
$admin->print_error($MESSAGE['GENERIC_ALREADY_INSTALLED']);
|
|
| 126 | 125 |
} |
| 127 | 126 |
|
| 128 | 127 |
$action="upgrade"; |
| ... | ... | |
| 134 | 133 |
if(!is_writable(WB_PATH.'/modules/')) |
| 135 | 134 |
{
|
| 136 | 135 |
if(file_exists($temp_file)) { unlink($temp_file); } // Remove temp file
|
| 137 |
$admin->print_error($MESSAGE['GENERIC']['BAD_PERMISSIONS']);
|
|
| 136 |
$admin->print_error($MESSAGE['GENERIC_BAD_PERMISSIONS']);
|
|
| 138 | 137 |
} |
| 139 | 138 |
|
| 140 | 139 |
// Set module directory |
| ... | ... | |
| 152 | 151 |
|
| 153 | 152 |
if(!$list) |
| 154 | 153 |
{
|
| 155 |
$admin->print_error($MESSAGE['GENERIC']['CANNOT_UNZIP']);
|
|
| 154 |
$admin->print_error($MESSAGE['GENERIC_CANNOT_UNZIP']);
|
|
| 156 | 155 |
} |
| 157 | 156 |
/* |
| 158 | 157 |
|
| ... | ... | |
| 186 | 185 |
{
|
| 187 | 186 |
// Load module info into DB |
| 188 | 187 |
load_module(WB_PATH.'/modules/'.$module_directory, false); |
| 189 |
$admin->print_success($MESSAGE['GENERIC']['INSTALLED']);
|
|
| 188 |
$admin->print_success($MESSAGE['GENERIC_INSTALLED']);
|
|
| 190 | 189 |
} elseif ($action=="upgrade") |
| 191 | 190 |
{
|
| 192 | 191 |
|
| 193 | 192 |
upgrade_module($module_directory, false); |
| 194 |
$admin->print_success($MESSAGE['GENERIC']['UPGRADED']);
|
|
| 193 |
$admin->print_success($MESSAGE['GENERIC_UPGRADED']);
|
|
| 195 | 194 |
} |
| 196 | 195 |
|
| 197 | 196 |
// Print admin footer |
| 198 |
$admin->print_footer(); |
|
| 199 |
|
|
| 200 |
?> |
|
| 197 |
$admin->print_footer(); |
|
| branches/2.8.x/wb/admin/modules/index.php | ||
|---|---|---|
| 4 | 4 |
* @category admin |
| 5 | 5 |
* @package modules |
| 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 |
| ... | ... | |
| 22 | 22 |
|
| 23 | 23 |
// Setup template object, parse vars to it, then parse it |
| 24 | 24 |
// Create new template object |
| 25 |
$template = new Template(dirname($admin->correct_theme_source('modules.htt')));
|
|
| 25 |
$template = new Template(dirname($admin->correct_theme_source('modules.htt')),'keep');
|
|
| 26 | 26 |
// $template->debug = true; |
| 27 | 27 |
$template->set_file('page', 'modules.htt');
|
| 28 | 28 |
$template->set_block('page', 'main_block', 'main');
|
| ... | ... | |
| 31 | 31 |
$template->set_block('main_block', 'module_list_block', 'module_list');
|
| 32 | 32 |
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'module' order by name");
|
| 33 | 33 |
if($result->numRows() > 0) {
|
| 34 |
while ($addon = $result->fetchRow()) {
|
|
| 34 |
while ($addon = $result->fetchRow()) |
|
| 35 |
{
|
|
| 36 |
if ($admin->get_permission($addon['directory'],'module')==false) { continue;}
|
|
| 37 |
//echo $addon['directory'].'<br />'; |
|
| 35 | 38 |
$template->set_var('VALUE', $addon['directory']);
|
| 36 | 39 |
$template->set_var('NAME', $addon['name']);
|
| 37 | 40 |
$template->parse('module_list', 'module_list_block', true);
|
| ... | ... | |
| 46 | 49 |
$template->set_var(array('INSTALL_VISIBLE' => 'hide', 'UPGRADE_VISIBLE' => 'hide', 'UNINSTALL_VISIBLE' => 'hide'));
|
| 47 | 50 |
|
| 48 | 51 |
$show_block = false; |
| 49 |
foreach ($module_files as $index => $path) {
|
|
| 52 |
foreach ($module_files as $index => $path) |
|
| 53 |
{
|
|
| 54 |
if ( $admin->get_permission(basename($path),'module')==false ) { continue;}
|
|
| 50 | 55 |
if (is_dir($path)) {
|
| 51 |
if (file_exists($path . '/install.php')) {
|
|
| 56 |
//echo basename($path).'<br />'; |
|
| 57 |
if (is_readable($path . '/install.php')) {
|
|
| 52 | 58 |
$show_block = true; |
| 53 | 59 |
$template->set_var('INSTALL_VISIBLE', '');
|
| 54 | 60 |
$template->set_var('VALUE', basename($path));
|
Also available in: Unified diff
! update folder admin/addons admin/skel/htt