From 49831432bc0b7fcdb813eccf0c87ebfbcee0c52a Mon Sep 17 00:00:00 2001 From: Bianka Martinovic Date: Wed, 23 Oct 2013 15:09:53 +0200 Subject: [PATCH] updated "wrapper" to v2.7.4, fixing issue #187 --- upload/modules/wrapper/add.php | 40 ++++++++------ upload/modules/wrapper/delete.php | 40 ++++++++------ .../wrapper/htt/{iframe.lte => iframe.tpl} | 0 .../wrapper/htt/{modify.lte => modify.tpl} | 2 +- .../wrapper/htt/{object.lte => object.tpl} | 0 upload/modules/wrapper/index.php | 42 ++++++++------- upload/modules/wrapper/info.php | 46 +++++++++------- upload/modules/wrapper/install.php | 43 ++++++++------- upload/modules/wrapper/modify.php | 43 ++++++++------- upload/modules/wrapper/save.php | 41 ++++++++------- upload/modules/wrapper/uninstall.php | 40 ++++++++------ upload/modules/wrapper/upgrade.php | 52 ++++++++++++------- upload/modules/wrapper/view.php | 45 +++++++++------- 13 files changed, 249 insertions(+), 185 deletions(-) rename upload/modules/wrapper/htt/{iframe.lte => iframe.tpl} (100%) rename upload/modules/wrapper/htt/{modify.lte => modify.tpl} (98%) rename upload/modules/wrapper/htt/{object.lte => object.tpl} (100%) diff --git a/upload/modules/wrapper/add.php b/upload/modules/wrapper/add.php index f3e75785..a29dfa6d 100644 --- a/upload/modules/wrapper/add.php +++ b/upload/modules/wrapper/add.php @@ -1,25 +1,32 @@ . + * + * @author Website Baker Project, LEPTON Project, Black Cat Development + * @copyright 2004-2010, Website Baker Project + * @copyright 2011-2012, LEPTON Project + * @copyright 2013, Black Cat Development + * @link http://blackcat-cms.org + * @license http://www.gnu.org/licenses/gpl.html + * @category CAT_Module + * @package wrapper * */ -// include class.secure.php to protect this file and the whole CMS! -if (defined('CAT_PATH')) { - include(CAT_PATH.'/framework/class.secure.php'); +if (defined('CAT_PATH')) { + include(CAT_PATH.'/framework/class.secure.php'); } else { $root = "../"; $level = 1; @@ -27,13 +34,12 @@ $root .= "../"; $level += 1; } - if (file_exists($root.'/framework/class.secure.php')) { - include($root.'/framework/class.secure.php'); + if (file_exists($root.'/framework/class.secure.php')) { + include($root.'/framework/class.secure.php'); } else { trigger_error(sprintf("[ %s ] Can't include class.secure.php!", $_SERVER['SCRIPT_NAME']), E_USER_ERROR); } } -// end include class.secure.php global $database, $page_id, $section_id; diff --git a/upload/modules/wrapper/delete.php b/upload/modules/wrapper/delete.php index 2b3634e0..a66080d4 100644 --- a/upload/modules/wrapper/delete.php +++ b/upload/modules/wrapper/delete.php @@ -1,25 +1,32 @@ . + * + * @author Website Baker Project, LEPTON Project, Black Cat Development + * @copyright 2004-2010, Website Baker Project + * @copyright 2011-2012, LEPTON Project + * @copyright 2013, Black Cat Development + * @link http://blackcat-cms.org + * @license http://www.gnu.org/licenses/gpl.html + * @category CAT_Module + * @package wrapper * */ -// include class.secure.php to protect this file and the whole CMS! -if (defined('CAT_PATH')) { - include(CAT_PATH.'/framework/class.secure.php'); +if (defined('CAT_PATH')) { + include(CAT_PATH.'/framework/class.secure.php'); } else { $root = "../"; $level = 1; @@ -27,13 +34,12 @@ $root .= "../"; $level += 1; } - if (file_exists($root.'/framework/class.secure.php')) { - include($root.'/framework/class.secure.php'); + if (file_exists($root.'/framework/class.secure.php')) { + include($root.'/framework/class.secure.php'); } else { trigger_error(sprintf("[ %s ] Can't include class.secure.php!", $_SERVER['SCRIPT_NAME']), E_USER_ERROR); } } -// end include class.secure.php // Delete page from mod_wrapper $database->query("DELETE FROM ".CAT_TABLE_PREFIX."mod_wrapper WHERE section_id = '$section_id'"); diff --git a/upload/modules/wrapper/htt/iframe.lte b/upload/modules/wrapper/htt/iframe.tpl similarity index 100% rename from upload/modules/wrapper/htt/iframe.lte rename to upload/modules/wrapper/htt/iframe.tpl diff --git a/upload/modules/wrapper/htt/modify.lte b/upload/modules/wrapper/htt/modify.tpl similarity index 98% rename from upload/modules/wrapper/htt/modify.lte rename to upload/modules/wrapper/htt/modify.tpl index 091c6bcc..b88ac16e 100644 --- a/upload/modules/wrapper/htt/modify.lte +++ b/upload/modules/wrapper/htt/modify.tpl @@ -1,4 +1,4 @@ -
+ diff --git a/upload/modules/wrapper/htt/object.lte b/upload/modules/wrapper/htt/object.tpl similarity index 100% rename from upload/modules/wrapper/htt/object.lte rename to upload/modules/wrapper/htt/object.tpl diff --git a/upload/modules/wrapper/index.php b/upload/modules/wrapper/index.php index f05215de..da344988 100644 --- a/upload/modules/wrapper/index.php +++ b/upload/modules/wrapper/index.php @@ -1,25 +1,32 @@ . + * + * @author Website Baker Project, LEPTON Project, Black Cat Development + * @copyright 2004-2010, Website Baker Project + * @copyright 2011-2012, LEPTON Project + * @copyright 2013, Black Cat Development + * @link http://blackcat-cms.org + * @license http://www.gnu.org/licenses/gpl.html + * @category CAT_Module + * @package wrapper * */ -// include class.secure.php to protect this file and the whole CMS! -if (defined('CAT_PATH')) { - include(CAT_PATH.'/framework/class.secure.php'); +if (defined('CAT_PATH')) { + include(CAT_PATH.'/framework/class.secure.php'); } else { $root = "../"; $level = 1; @@ -27,12 +34,9 @@ $root .= "../"; $level += 1; } - if (file_exists($root.'/framework/class.secure.php')) { - include($root.'/framework/class.secure.php'); + if (file_exists($root.'/framework/class.secure.php')) { + include($root.'/framework/class.secure.php'); } else { trigger_error(sprintf("[ %s ] Can't include class.secure.php!", $_SERVER['SCRIPT_NAME']), E_USER_ERROR); } } -// end include class.secure.php - -?> \ No newline at end of file diff --git a/upload/modules/wrapper/info.php b/upload/modules/wrapper/info.php index a570e2c6..cfcdcfc0 100644 --- a/upload/modules/wrapper/info.php +++ b/upload/modules/wrapper/info.php @@ -1,25 +1,32 @@ . + * + * @author Website Baker Project, LEPTON Project, Black Cat Development + * @copyright 2004-2010, Website Baker Project + * @copyright 2011-2012, LEPTON Project + * @copyright 2013, Black Cat Development + * @link http://blackcat-cms.org + * @license http://www.gnu.org/licenses/gpl.html + * @category CAT_Module + * @package wrapper * */ -// include class.secure.php to protect this file and the whole CMS! -if (defined('CAT_PATH')) { - include(CAT_PATH.'/framework/class.secure.php'); +if (defined('CAT_PATH')) { + include(CAT_PATH.'/framework/class.secure.php'); } else { $root = "../"; $level = 1; @@ -27,25 +34,26 @@ $root .= "../"; $level += 1; } - if (file_exists($root.'/framework/class.secure.php')) { - include($root.'/framework/class.secure.php'); + if (file_exists($root.'/framework/class.secure.php')) { + include($root.'/framework/class.secure.php'); } else { trigger_error(sprintf("[ %s ] Can't include class.secure.php!", $_SERVER['SCRIPT_NAME']), E_USER_ERROR); } } -// end include class.secure.php $module_directory = 'wrapper'; $module_name = 'Wrapper'; $module_function = 'page'; -$module_version = '2.7.3'; +$module_version = '2.7.4'; $module_platform = '2.x'; -$module_author = 'Ryan Djurovich, Dietrich Roland Pehlke (last)'; +$module_author = 'Ryan Djurovich, Dietrich Roland Pehlke, Black Cat Development (last)'; $module_license = 'GNU General Public License'; $module_description = 'This module allows you to wrap your site around another using an inline frame'; $module_guid = 'a5830654-06f3-402a-9d25-a03c53fc5574'; /** + * 2.7.4 2013-10-23 - fix for BlackCat CMS + * * 2.7.3 2012-02-09 - added upgrade.php. * * 2.7.1 2010-11-02 - Bugfix inside the html-template to get valid output. diff --git a/upload/modules/wrapper/install.php b/upload/modules/wrapper/install.php index 568e0127..d57f429d 100644 --- a/upload/modules/wrapper/install.php +++ b/upload/modules/wrapper/install.php @@ -1,24 +1,32 @@ . * + * @author Website Baker Project, LEPTON Project, Black Cat Development + * @copyright 2004-2010, Website Baker Project + * @copyright 2011-2012, LEPTON Project + * @copyright 2013, Black Cat Development + * @link http://blackcat-cms.org + * @license http://www.gnu.org/licenses/gpl.html + * @category CAT_Module + * @package wrapper * */ -// include class.secure.php to protect this file and the whole CMS! -if (defined('CAT_PATH')) { - include(CAT_PATH.'/framework/class.secure.php'); +if (defined('CAT_PATH')) { + include(CAT_PATH.'/framework/class.secure.php'); } else { $root = "../"; $level = 1; @@ -26,13 +34,12 @@ $root .= "../"; $level += 1; } - if (file_exists($root.'/framework/class.secure.php')) { - include($root.'/framework/class.secure.php'); + if (file_exists($root.'/framework/class.secure.php')) { + include($root.'/framework/class.secure.php'); } else { trigger_error(sprintf("[ %s ] Can't include class.secure.php!", $_SERVER['SCRIPT_NAME']), E_USER_ERROR); } } -// end include class.secure.php if(defined('CAT_URL')) { @@ -61,5 +68,3 @@ error_log( "Unable to register file -$file-!" ); } } - -?> \ No newline at end of file diff --git a/upload/modules/wrapper/modify.php b/upload/modules/wrapper/modify.php index cbd95121..4be5b0b2 100644 --- a/upload/modules/wrapper/modify.php +++ b/upload/modules/wrapper/modify.php @@ -1,26 +1,32 @@ . + * + * @author Website Baker Project, LEPTON Project, Black Cat Development + * @copyright 2004-2010, Website Baker Project + * @copyright 2011-2012, LEPTON Project + * @copyright 2013, Black Cat Development + * @link http://blackcat-cms.org + * @license http://www.gnu.org/licenses/gpl.html + * @category CAT_Module + * @package wrapper * */ -// include class.secure.php to protect this file and the whole CMS! -if (defined('CAT_PATH')) { - include(CAT_PATH.'/framework/class.secure.php'); +if (defined('CAT_PATH')) { + include(CAT_PATH.'/framework/class.secure.php'); } else { $root = "../"; $level = 1; @@ -28,13 +34,12 @@ $root .= "../"; $level += 1; } - if (file_exists($root.'/framework/class.secure.php')) { - include($root.'/framework/class.secure.php'); + if (file_exists($root.'/framework/class.secure.php')) { + include($root.'/framework/class.secure.php'); } else { trigger_error(sprintf("[ %s ] Can't include class.secure.php!", $_SERVER['SCRIPT_NAME']), E_USER_ERROR); } } -// end include class.secure.php // Get page content $query = "SELECT url,height,width,wtype FROM " . CAT_TABLE_PREFIX . "mod_wrapper WHERE section_id = '$section_id'"; @@ -52,6 +57,6 @@ ); $parser->setPath( CAT_PATH.'/modules/wrapper/htt' ); -$parser->output( 'modify.lte', $data ); +$parser->output( 'modify.tpl', $data ); ?> \ No newline at end of file diff --git a/upload/modules/wrapper/save.php b/upload/modules/wrapper/save.php index c2e624f2..fa4c7cb3 100644 --- a/upload/modules/wrapper/save.php +++ b/upload/modules/wrapper/save.php @@ -1,26 +1,32 @@ . + * + * @author Website Baker Project, LEPTON Project, Black Cat Development + * @copyright 2004-2010, Website Baker Project + * @copyright 2011-2012, LEPTON Project + * @copyright 2013, Black Cat Development + * @link http://blackcat-cms.org + * @license http://www.gnu.org/licenses/gpl.html + * @category CAT_Module + * @package wrapper * */ -// include class.secure.php to protect this file and the whole CMS! -if (defined('CAT_PATH')) { - include(CAT_PATH.'/framework/class.secure.php'); +if (defined('CAT_PATH')) { + include(CAT_PATH.'/framework/class.secure.php'); } else { $root = "../"; $level = 1; @@ -28,13 +34,12 @@ $root .= "../"; $level += 1; } - if (file_exists($root.'/framework/class.secure.php')) { - include($root.'/framework/class.secure.php'); + if (file_exists($root.'/framework/class.secure.php')) { + include($root.'/framework/class.secure.php'); } else { trigger_error(sprintf("[ %s ] Can't include class.secure.php!", $_SERVER['SCRIPT_NAME']), E_USER_ERROR); } } -// end include class.secure.php // Include WB admin wrapper script $update_when_modified = true; // Tells script to update when this page was last updated diff --git a/upload/modules/wrapper/uninstall.php b/upload/modules/wrapper/uninstall.php index fae3f67c..ca9c4f49 100644 --- a/upload/modules/wrapper/uninstall.php +++ b/upload/modules/wrapper/uninstall.php @@ -1,25 +1,32 @@ . + * + * @author Website Baker Project, LEPTON Project, Black Cat Development + * @copyright 2004-2010, Website Baker Project + * @copyright 2011-2012, LEPTON Project + * @copyright 2013, Black Cat Development + * @link http://blackcat-cms.org + * @license http://www.gnu.org/licenses/gpl.html + * @category CAT_Module + * @package wrapper * */ -// include class.secure.php to protect this file and the whole CMS! -if (defined('CAT_PATH')) { - include(CAT_PATH.'/framework/class.secure.php'); +if (defined('CAT_PATH')) { + include(CAT_PATH.'/framework/class.secure.php'); } else { $root = "../"; $level = 1; @@ -27,13 +34,12 @@ $root .= "../"; $level += 1; } - if (file_exists($root.'/framework/class.secure.php')) { - include($root.'/framework/class.secure.php'); + if (file_exists($root.'/framework/class.secure.php')) { + include($root.'/framework/class.secure.php'); } else { trigger_error(sprintf("[ %s ] Can't include class.secure.php!", $_SERVER['SCRIPT_NAME']), E_USER_ERROR); } } -// end include class.secure.php // delete table $database->query("DROP TABLE IF EXISTS `".CAT_TABLE_PREFIX."mod_wrapper`"); diff --git a/upload/modules/wrapper/upgrade.php b/upload/modules/wrapper/upgrade.php index dd494b06..b14835cb 100644 --- a/upload/modules/wrapper/upgrade.php +++ b/upload/modules/wrapper/upgrade.php @@ -1,24 +1,32 @@ . * + * @author Website Baker Project, LEPTON Project, Black Cat Development + * @copyright 2004-2010, Website Baker Project + * @copyright 2011-2012, LEPTON Project + * @copyright 2013, Black Cat Development + * @link http://blackcat-cms.org + * @license http://www.gnu.org/licenses/gpl.html + * @category CAT_Module + * @package wrapper * */ -// include class.secure.php to protect this file and the whole CMS! -if (defined('CAT_PATH')) { - include(CAT_PATH.'/framework/class.secure.php'); +if (defined('CAT_PATH')) { + include(CAT_PATH.'/framework/class.secure.php'); } else { $root = "../"; $level = 1; @@ -26,15 +34,17 @@ $root .= "../"; $level += 1; } - if (file_exists($root.'/framework/class.secure.php')) { - include($root.'/framework/class.secure.php'); + if (file_exists($root.'/framework/class.secure.php')) { + include($root.'/framework/class.secure.php'); } else { trigger_error(sprintf("[ %s ] Can't include class.secure.php!", $_SERVER['SCRIPT_NAME']), E_USER_ERROR); } } -// end include class.secure.php - +if(!isset($module_version)) +{ + include dirname(__FILE__).'/info.php'; +} if ( $module_version <= '2.7.1' ) { $database->query('ALTER TABLE `'.CAT_TABLE_PREFIX.'mod_wrapper` ADD COLUMN `width` INT(11) NOT NULL DEFAULT \'630\''); $database->query('ALTER TABLE `'.CAT_TABLE_PREFIX.'mod_wrapper` ADD COLUMN `type` VARCHAR(50) NOT NULL DEFAULT \'iframe\' AFTER `width`;'); @@ -43,4 +53,8 @@ $database->query('ALTER TABLE `'.CAT_TABLE_PREFIX.'mod_wrapper` CHANGE COLUMN `type` `wtype` VARCHAR(50) NOT NULL DEFAULT \'iframe\' AFTER `width`;'); } -?> \ No newline at end of file +// remove old template files +$ltes = CAT_Helper_Directory::getInstance()->findFiles( '.*\.lte', dirname(__FILE__).'/htt' ); +if(count($ltes)) + foreach($ltes as $file) + @unlink($file); \ No newline at end of file diff --git a/upload/modules/wrapper/view.php b/upload/modules/wrapper/view.php index cdbd71fa..2e30efd1 100644 --- a/upload/modules/wrapper/view.php +++ b/upload/modules/wrapper/view.php @@ -1,26 +1,32 @@ . + * + * @author Website Baker Project, LEPTON Project, Black Cat Development + * @copyright 2004-2010, Website Baker Project + * @copyright 2011-2012, LEPTON Project + * @copyright 2013, Black Cat Development + * @link http://blackcat-cms.org + * @license http://www.gnu.org/licenses/gpl.html + * @category CAT_Module + * @package wrapper * */ -// include class.secure.php to protect this file and the whole CMS! -if (defined('CAT_PATH')) { - include(CAT_PATH.'/framework/class.secure.php'); +if (defined('CAT_PATH')) { + include(CAT_PATH.'/framework/class.secure.php'); } else { $root = "../"; $level = 1; @@ -28,13 +34,12 @@ $root .= "../"; $level += 1; } - if (file_exists($root.'/framework/class.secure.php')) { - include($root.'/framework/class.secure.php'); + if (file_exists($root.'/framework/class.secure.php')) { + include($root.'/framework/class.secure.php'); } else { trigger_error(sprintf("[ %s ] Can't include class.secure.php!", $_SERVER['SCRIPT_NAME']), E_USER_ERROR); } } -// end include class.secure.php global $parser; @@ -59,7 +64,7 @@ $fetch_settings['wtype'] = 'iframe'; } -if ( !file_exists(CAT_PATH.'/modules/wrapper/htt/'.$fetch_settings['wtype'].'.lte') ) { +if ( !file_exists(CAT_PATH.'/modules/wrapper/htt/'.$fetch_settings['wtype'].'.tpl') ) { echo "ERROR: No such type!
"; } else { @@ -68,7 +73,7 @@ 'SETTINGS' => $fetch_settings ); $parser->setPath( CAT_PATH.'/modules/wrapper/htt' ); - $parser->output( $fetch_settings['wtype'].'.lte', $data ); + $parser->output( $fetch_settings['wtype'].'.tpl', $data ); } ?> \ No newline at end of file