Attached Files |
move_modules_inside_separate_folder_other_modules_fix.patch [^] (7,206 bytes) 2010-01-13 12:57
[Show Content]
Index: custom/install/install_data.sql
===================================================================
--- custom/install/install_data.sql (revision 13106)
+++ custom/install/install_data.sql (working copy)
@@ -6,7 +6,7 @@
INSERT INTO Permissions VALUES(DEFAULT, 'custom:widgets.add', 11, 1, 1, 0);
INSERT INTO Permissions VALUES(DEFAULT, 'custom:widgets.view', 11, 1, 1, 0);
-INSERT INTO Modules VALUES ('Custom', 'custom/', 'custom-sections', DEFAULT, 1, 10, 'custom/', 0, NULL);
+INSERT INTO Modules VALUES ('Custom', 'modules/custom/', 'custom-sections', DEFAULT, 1, 10, 'custom/', 0, NULL);
# ===== SQLs above this line already on LIVE ================================================================================================
Index: custom/install/upgrades.sql
===================================================================
--- custom/install/upgrades.sql (revision 13106)
+++ custom/install/upgrades.sql (working copy)
@@ -11,4 +11,7 @@
# ===== v 1.0.2-RC1 =====
-# ===== v 1.0.2 =====
\ No newline at end of file
+# ===== v 1.0.2 =====
+
+# ===== v 1.1.0-B1 =====
+UPDATE Modules SET Path = 'modules/custom/' WHERE `Name` = 'Custom';
\ No newline at end of file
Index: in-auction/install/install_data.sql
===================================================================
--- in-auction/install/install_data.sql (revision 13106)
+++ in-auction/install/install_data.sql (working copy)
@@ -1851,4 +1851,4 @@
INSERT INTO Permissions VALUES (DEFAULT, 'ebay:configuration_feedbacks.edit', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'ebay:configuration_general.edit', 11, 1, 1, 0);
-INSERT INTO Modules VALUES ('In-Auction', 'in-auction/', 'ebay-sections', DEFAULT, 1, 6, 'in-auction/', 2, NULL);
+INSERT INTO Modules VALUES ('In-Auction', 'modules/in-auction/', 'ebay-sections', DEFAULT, 1, 6, 'in-auction/', 2, NULL);
Index: in-auction/install/upgrades.sql
===================================================================
--- in-auction/install/upgrades.sql (revision 13106)
+++ in-auction/install/upgrades.sql (working copy)
@@ -43,4 +43,7 @@
# ===== v 5.0.2-RC1 =====
-# ===== v 5.0.2 =====
\ No newline at end of file
+# ===== v 5.0.2 =====
+
+# ===== v 5.1.0-B1 =====
+UPDATE Modules SET Path = 'modules/in-auction/' WHERE `Name` = 'In-Auction';
Index: in-bulletin/install/install_data.sql
===================================================================
--- in-bulletin/install/install_data.sql (revision 13106)
+++ in-bulletin/install/install_data.sql (working copy)
@@ -282,4 +282,4 @@
INSERT INTO CustomField VALUES (DEFAULT, 1, 'bb_ItemTemplate', 'la_fld_cust_bb_ItemTemplate', 0, 'la_title_SystemCF', 'la_fld_cust_bb_ItemTemplate', 'text', NULL, '', 0, 0, 1, 0);
-INSERT INTO Modules VALUES ('In-Bulletin', 'in-bulletin/', 'bb', DEFAULT, 1, 3, 'in-bulletin/', {TopicCatId}, NULL);
+INSERT INTO Modules VALUES ('In-Bulletin', 'modules/in-bulletin/', 'bb', DEFAULT, 1, 3, 'in-bulletin/', {TopicCatId}, NULL);
Index: in-bulletin/install/upgrades.sql
===================================================================
--- in-bulletin/install/upgrades.sql (revision 13106)
+++ in-bulletin/install/upgrades.sql (working copy)
@@ -167,4 +167,7 @@
# ===== v 5.0.2-RC1 =====
-# ===== v 5.0.2 =====
\ No newline at end of file
+# ===== v 5.0.2 =====
+
+# ===== v 5.1.0-B1 =====
+UPDATE Modules SET Path = 'modules/in-bulletin/' WHERE `Name` = 'In-Bulletin';
\ No newline at end of file
Index: in-commerce/install/install_data.sql
===================================================================
--- in-commerce/install/install_data.sql (revision 13106)
+++ in-commerce/install/install_data.sql (working copy)
@@ -582,4 +582,4 @@
INSERT INTO ImportScripts VALUES (DEFAULT, 'Products from CSV file [In-Commerce]', '', 'p', 'In-Commerce', '', 'CSV', '1');
-INSERT INTO Modules VALUES ('In-Commerce', 'in-commerce/', 'p', DEFAULT, 1, 4, 'in-commerce/', 2, NULL);
+INSERT INTO Modules VALUES ('In-Commerce', 'modules/in-commerce/', 'p', DEFAULT, 1, 4, 'in-commerce/', 2, NULL);
Index: in-commerce/install/upgrades.sql
===================================================================
--- in-commerce/install/upgrades.sql (revision 13106)
+++ in-commerce/install/upgrades.sql (working copy)
@@ -119,4 +119,7 @@
# ===== v 5.0.2-RC1 =====
-# ===== v 5.0.2 =====
\ No newline at end of file
+# ===== v 5.0.2 =====
+
+# ===== v 5.1.0-B1 =====
+UPDATE Modules SET Path = 'modules/in-commerce/' WHERE `Name` = 'In-Commerce';
\ No newline at end of file
Index: in-commerce/units/pricing/pricing_event_handler.php
===================================================================
--- in-commerce/units/pricing/pricing_event_handler.php (revision 13106)
+++ in-commerce/units/pricing/pricing_event_handler.php (working copy)
@@ -12,7 +12,7 @@
*/
// include globals.php from current folder
-k4_include_once(FULL_PATH.'/in-commerce/units/pricing/globals.php');
+k4_include_once(MODULES_PATH .'/in-commerce/units/pricing/globals.php');
class PricingEventHandler extends kDBEventHandler {
Index: in-link/install/install_data.sql
===================================================================
--- in-link/install/install_data.sql (revision 13106)
+++ in-link/install/install_data.sql (working copy)
@@ -302,4 +302,4 @@
INSERT INTO Counters VALUES (DEFAULT, 'linkhits_count', 'SELECT ROUND(SUM(Hits)) FROM <%PREFIX%>Link', NULL, NULL, '300', '0', '|Link|');
-INSERT INTO Modules VALUES ('In-Link', 'in-link/', 'l', DEFAULT, 1, 1, 'in-link/', 2, NULL);
+INSERT INTO Modules VALUES ('In-Link', 'modules/in-link/', 'l', DEFAULT, 1, 1, 'in-link/', 2, NULL);
Index: in-link/install/upgrades.sql
===================================================================
--- in-link/install/upgrades.sql (revision 13106)
+++ in-link/install/upgrades.sql (working copy)
@@ -61,4 +61,7 @@
# ===== v 5.0.2-RC1 =====
-# ===== v 5.0.2 =====
\ No newline at end of file
+# ===== v 5.0.2 =====
+
+# ===== v 5.1.0-B1 =====
+UPDATE Modules SET Path = 'modules/in-link/' WHERE `Name` = 'In-Link';
Index: in-news/install/install_data.sql
===================================================================
--- in-news/install/install_data.sql (revision 13106)
+++ in-news/install/install_data.sql (working copy)
@@ -245,4 +245,4 @@
INSERT INTO ImportScripts VALUES (DEFAULT, 'Articles from CSV file [In-News]', '', 'n', 'In-News', '', 'CSV', '1');
-INSERT INTO Modules VALUES ('In-News', 'in-news/', 'n', DEFAULT, 1, 2, 'in-news/', {NewsCatId}, NULL);
\ No newline at end of file
+INSERT INTO Modules VALUES ('In-News', 'modules/in-news/', 'n', DEFAULT, 1, 2, 'in-news/', {NewsCatId}, NULL);
\ No newline at end of file
Index: in-news/install/upgrades.sql
===================================================================
--- in-news/install/upgrades.sql (revision 13106)
+++ in-news/install/upgrades.sql (working copy)
@@ -61,4 +61,7 @@
# ===== v 5.0.2-RC1 =====
-# ===== v 5.0.2 =====
\ No newline at end of file
+# ===== v 5.0.2 =====
+
+# ===== v 5.1.0-B1 =====
+UPDATE Modules SET Path = 'modules/in-news/' WHERE `Name` = 'In-News';
move_modules_inside_separate_folder_core_fix.patch [^] (19,852 bytes) 2010-01-13 12:57
[Show Content]
Index: admin_templates/js/catalog.js
===================================================================
--- admin_templates/js/catalog.js (revision 13106)
+++ admin_templates/js/catalog.js (working copy)
@@ -115,10 +115,10 @@
else if ($params[0].length) {
document.getElementById($params[0]).innerHTML = $text;
}
-
+
// pass catalog object and loaded tab name to event handler
$('body').trigger('CatalogTabLoad', [$object, $params[0].replace(/_div$/, '')]);
-
+
if (typeof($object.OnResponceMethod) == 'function') {
$object.OnResponceMethod($object);
$object.OnResponceMethod = null;
Index: admin_templates/js/toolbar.js
===================================================================
--- admin_templates/js/toolbar.js (revision 13106)
+++ admin_templates/js/toolbar.js (working copy)
@@ -42,9 +42,10 @@
if (this.Title.match(/([^:]+):(.*)$/)) {
// has module set directly
this.Title = RegExp.$2;
- this.Module = RegExp.$1;
+ this.Module = RegExp.$1.toLowerCase();
+
if (this.Module == 'in-portal') {
- this.Module = 'kernel';
+ this.Module = 'core';
}
}
else {
@@ -58,7 +59,14 @@
if (typeof(img_path) == 'undefined') {
//alert('error: toolbar image path not set');
}
- return img_path.replace('#MODULE#', this.Module) + 'toolbar/';
+
+ var $module_path = this.Module;
+
+ if (this.Module != 'core') {
+ $module_path = 'modules/' + $module_path;
+ }
+
+ return img_path.replace('#MODULE#', $module_path) + 'toolbar/';
}
ToolBarButton.prototype.GetHTML = function() {
@@ -93,18 +101,6 @@
this.SetOnClick();
this.SetOnRightClick()
if (this.Hidden) this.Hide();
-
- if (!img.complete) {
- var real_path = img_path.replace('#MODULE#', this.Module) + 'toolbar/';
- var old_path = img_path.replace('#MODULE#', 'kernel') + 'toolbar/'+this.ToolBar.IconPrefix + this.Title+'.gif';
- real_path = real_path.replace('http://kostja.prod.intechnic.lv/in-portal.RC', '.');
- old_path = old_path.replace('http://kostja.prod.intechnic.lv/in-portal.RC', '.');
- var source = old_path.replace('/core/', '/kernel/').replace('.gif', '*.gif');
- var path = 'cp '+source+' '+real_path;
-// prompt('exec: ', path)
-// img.src = 'img/bad_button.GIF';
- }
-// preg_print_pre(img, /natural|compl/i)
}
ToolBarButton.prototype.EditTitle = function() {
Index: install.php
===================================================================
--- install.php (revision 13106)
+++ install.php (working copy)
@@ -1166,10 +1166,6 @@
while ( ($sub_folder = readdir($fh)) ) {
$folder_path = MODULES_PATH . '/'.$sub_folder;
if ($sub_folder != '.' && $sub_folder != '..' && is_dir($folder_path)) {
- if ($sub_folder == 'core') {
- // skip modules here
- continue;
- }
// this is folder in MODULES_PATH directory
if (file_exists($folder_path.'/install.php') && file_exists($folder_path.'/install/install_schema.sql')) {
$install_order = trim( file_get_contents($folder_path . '/install/install_order.txt') );
Index: install/install_toolkit.php
===================================================================
--- install/install_toolkit.php (revision 13106)
+++ install/install_toolkit.php (working copy)
@@ -239,14 +239,14 @@
$upgrades_file = sprintf(UPGRADES_FILE, mb_strtolower($module_name).'/', 'sql');
if (!file_exists($upgrades_file)) {
// no upgrade file
- return '4.0.1';
+ return '5.0.0';
}
$sqls = file_get_contents($upgrades_file);
$versions_found = preg_match_all('/'.VERSION_MARK.'/s', $sqls, $regs);
if (!$versions_found) {
// upgrades file doesn't contain version definitions
- return '4.0.1';
+ return '5.0.0';
}
return end($regs[1]);
Index: kernel/nparser/template_cache.php
===================================================================
--- kernel/nparser/template_cache.php (revision 13106)
+++ kernel/nparser/template_cache.php (working copy)
@@ -68,7 +68,7 @@
$module_paths = Array ();
foreach ($this->Application->ModuleInfo as $module_name => $module_info) {
- $module_paths[$module_name] = rtrim($module_info['Path'], '/');
+ $module_paths[ mb_strtolower($module_name) ] = rtrim($module_info['Path'], '/');
}
$this->_modulePaths = $module_paths;
@@ -84,6 +84,7 @@
function GetTemplatePaths($filename)
{
if ($this->Application->isAdmin && array_key_exists($filename, $this->Application->ReplacementTemplates)) {
+ // process admin template replacement
$filename = $this->Application->ReplacementTemplates[$filename];
}
@@ -91,8 +92,8 @@
$filename = preg_replace('/^original:(.*)/', '\\1', $filename);
if (preg_match('#^[\/]{0,1}([^\/]*)\/(.*)#', $filename, $regs)) {
- $module_filename = $regs[2];
$first_dir = $regs[1];
+ $module_filename = $regs[2];
}
else {
$first_dir = '';
@@ -104,31 +105,18 @@
$first_dir = 'theme:' . $this->forceThemeName . ($first_dir ? '/' . $first_dir : '');
}
- // !preg_match for backward compatability with full-path plugins
- if ($this->Application->isAdmin && ($first_dir == 'plugins') && !preg_match('/admin_templates/', $module_filename)) {
- if (preg_match('#^[\/]{0,1}([^\/]*)\/(.*)#', $module_filename, $regs)) {;
- $path = MODULES_PATH.'/'.mb_strtolower($first_dir).'/'.$regs[1].'/admin_templates';
- $module_filename = $regs[2];
- }
- else {
- $first_dir = '';
- $module_filename = $filename;
- }
+ if ($this->Application->isAdmin && array_key_exists($first_dir, $this->_modulePaths)) {
+ // template belongs to one of the modules
+ $path = FULL_PATH . '/' . $this->_modulePaths[$first_dir] . '/admin_templates';
}
- elseif ($this->Application->isAdmin && in_array($first_dir, $this->_modulePaths)) {
- // $this->Application->findModule('Name', $first_dir)
- /*if ($first_dir == 'in-portal') {
- $first_dir = 'kernel';
- }*/
- $path = MODULES_PATH.'/'.mb_strtolower($first_dir).'/admin_templates';
- }
elseif ($this->forceThemeName && preg_match('/^theme:(.*)/', $first_dir, $regs)) {
// ability to use Front-End templates in admin (only during mass compilation)
$path = FULL_PATH . '/themes/' . $regs[1];
}
else {
+ // template from "core" module
$path = $this->BasePath;
- $module_filename = $first_dir.'/'.$module_filename;
+ $module_filename = $first_dir . '/' . $module_filename;
}
return Array ($path, $module_filename);
Index: kernel/processors/main_processor.php
===================================================================
--- kernel/processors/main_processor.php (revision 13106)
+++ kernel/processors/main_processor.php (working copy)
@@ -39,16 +39,23 @@
$cache_key = crc32( serialize($params) );
if (!array_key_exists($cache_key, $cached)) {
- $force_admin = array_key_exists('force_admin', $params) && $params['force_admin'];
$module = array_key_exists('module', $params) ? $params['module'] : 'core';
- if ($this->Application->isAdmin || $force_admin) {
+ if ($this->Application->isAdmin) {
if ($module == 'in-portal') {
$module = 'kernel';
}
- $path = $force_admin ? '/core/admin_templates' : THEMES_PATH;
- $path = preg_replace('/\/(.*?)\/(.*)/', $module.'/\\2', $path); // remove leading slash + substitute module
+ // remove leading slash + substitute module
+ $module_path = $this->Application->findModule('Name', $module, 'Path');
+
+ if ($module_path !== false) {
+ $path = $module_path . 'admin_templates';
+ }
+ else {
+ // remove leading slash + substitute module
+ $path = preg_replace('/\/(.*?)\/(.*)/', $module . '/\\2', THEMES_PATH);
+ }
}
else {
$path = mb_substr(THEMES_PATH, 1);
@@ -574,6 +581,7 @@
function ModuleInclude($params)
{
$ret = '';
+ $included = Array ();
$block_params = array_merge($params, Array('is_silent' => 2)); // don't make fatal errors in case if template is missing
$current_template = $this->Application->GetVar('t');
@@ -581,8 +589,6 @@
$skip_prefixes = isset($params['skip_prefixes']) ? explode(',', $params['skip_prefixes']) : Array();
$cms_mode = $this->Application->GetVar('admin');
- $included = Array ();
-
foreach ($this->Application->ModuleInfo as $module_name => $module_data) {
$module_key = mb_strtolower($module_name);
@@ -596,7 +602,7 @@
$module_prefix = $module_data['TemplatePath'];
}
elseif ($this->Application->isAdmin) {
- $module_prefix = $module_data['Path']; // was $module_key . '/';
+ $module_prefix = $module_key . '/'; // was $module_data['Path'];
}
else {
$module_prefix = $module_data['TemplatePath']; // always have trailing "/"
Index: kernel/startup.php
===================================================================
--- kernel/startup.php (revision 13106)
+++ kernel/startup.php (working copy)
@@ -87,7 +87,7 @@
ini_set('memory_limit', '50M');
- define('MODULES_PATH', FULL_PATH);
+ define('MODULES_PATH', FULL_PATH . '/modules');
define('EXPORT_BASE_PATH', WRITEBALE_BASE . '/export');
define('EXPORT_PATH', FULL_PATH . EXPORT_BASE_PATH);
Index: kernel/utility/unit_config_reader.php
===================================================================
--- kernel/utility/unit_config_reader.php (revision 13106)
+++ kernel/utility/unit_config_reader.php (working copy)
@@ -42,6 +42,13 @@
var $_directorySeparator = '';
/**
+ * Regular expression for detecting module folder
+ *
+ * @var string
+ */
+ var $_moduleFolderRegExp = '';
+
+ /**
* Folders to skip during unit config search
*
* @var Array
@@ -58,11 +65,12 @@
{
parent::Init($prefix,$special);
- $this->_directorySeparator = preg_quote( DIRECTORY_SEPARATOR );
- $this->_skipFolders[] = trim(WRITEBALE_BASE, '/'); // system folder (where web server can write)
+ $this->_directorySeparator = preg_quote(DIRECTORY_SEPARATOR);
$editor_path = explode('/', trim(EDITOR_PATH, '/'));
$this->_skipFolders[] = array_pop($editor_path); // last of cmseditor folders
+
+ $this->_moduleFolderRegExp = '#' . $this->_directorySeparator . '(core|modules' . $this->_directorySeparator . '.*?)' . $this->_directorySeparator . '#';
}
function CacheParsedData()
@@ -95,24 +103,24 @@
}
$cache = Array(
- 'Factory.Files' => $this->Application->Factory->Files,
- 'Factory.realClasses' => $this->Application->Factory->realClasses,
- 'Factory.Dependencies' => $this->Application->Factory->Dependencies,
- 'ConfigReader.prefixFiles' => $this->prefixFiles,
- 'EventManager.buildEvents' => $event_manager->buildEvents,
- 'EventManager.beforeRegularEvents' => $event_manager->beforeRegularEvents,
- 'EventManager.afterRegularEvents' => $event_manager->afterRegularEvents,
- 'EventManager.beforeHooks' => $event_manager->beforeHooks,
- 'EventManager.afterHooks' => $event_manager->afterHooks,
- 'TagsAggregator.data' => $aggregator->_Array,
+ 'Factory.Files' => $this->Application->Factory->Files,
+ 'Factory.realClasses' => $this->Application->Factory->realClasses,
+ 'Factory.Dependencies' => $this->Application->Factory->Dependencies,
+ 'ConfigReader.prefixFiles' => $this->prefixFiles,
+ 'EventManager.buildEvents' => $event_manager->buildEvents,
+ 'EventManager.beforeRegularEvents' => $event_manager->beforeRegularEvents,
+ 'EventManager.afterRegularEvents' => $event_manager->afterRegularEvents,
+ 'EventManager.beforeHooks' => $event_manager->beforeHooks,
+ 'EventManager.afterHooks' => $event_manager->afterHooks,
+ 'TagsAggregator.data' => $aggregator->_Array,
- // the following caches should be reset based on admin interaction (adjusting config, enabling modules etc)
- 'Application.Caches.ConfigVariables' => $this->Application->Caches['ConfigVariables'],
- 'Application.ConfigCacheIds' => $this->Application->ConfigCacheIds,
- 'Application.ConfigHash' => $this->Application->ConfigHash,
- 'Application.ReplacementTemplates' => $this->Application->ReplacementTemplates,
- 'Application.RewriteListeners' => $this->Application->RewriteListeners,
- 'Application.ModuleInfo' => $this->Application->ModuleInfo,
+ // the following caches should be reset based on admin interaction (adjusting config, enabling modules etc)
+ 'Application.Caches.ConfigVariables' => $this->Application->Caches['ConfigVariables'],
+ 'Application.ConfigCacheIds' => $this->Application->ConfigCacheIds,
+ 'Application.ConfigHash' => $this->Application->ConfigHash,
+ 'Application.ReplacementTemplates' => $this->Application->ReplacementTemplates,
+ 'Application.RewriteListeners' => $this->Application->RewriteListeners,
+ 'Application.ModuleInfo' => $this->Application->ModuleInfo,
);
$conn =& $this->Application->GetADODBConnection();
@@ -275,7 +283,8 @@
shuffle($this->configFiles);
}
else {
- $this->findConfigFiles($folderPath); // search from base directory
+ $this->findConfigFiles(FULL_PATH . '/core'); // search from core directory
+ $this->findConfigFiles($folderPath); // search from modules directory
}
foreach ($this->configFiles as $filename)
@@ -743,7 +752,7 @@
function PreloadConfigFile($filename)
{
- $config_found = file_exists(FULL_PATH.$filename) && $this->configAllowed($filename);
+ $config_found = file_exists(FULL_PATH . $filename) && $this->configAllowed($filename);
if (defined('DEBUG_MODE') && DEBUG_MODE && defined('DBG_PROFILE_INCLUDES') && DBG_PROFILE_INCLUDES) {
if ( in_array($filename, get_required_files()) ) {
@@ -771,7 +780,7 @@
// config file is included for 1st time -> save it's content for future processing
$prefix = array_key_exists('Prefix', $config) ? $config['Prefix'] : '';
- preg_match('#' . $this->_directorySeparator . '(.*)' . $this->_directorySeparator . '#U', $filename, $rets);
+ preg_match($this->_moduleFolderRegExp, $filename, $rets);
$config['ModuleFolder'] = $rets[1];
$config['BasePath'] = dirname(FULL_PATH . $filename);
@@ -928,33 +937,36 @@
*/
function configAllowed($config_path)
{
+ static $module_paths = null;
+
if (defined('IS_INSTALL') && IS_INSTALL) {
// at installation start no modules in db and kernel configs could not be read
return true;
}
- if (preg_match('#' . $this->_directorySeparator . 'plugins' . $this->_directorySeparator . '|' . $this->_directorySeparator . 'core#', $config_path)) {
- // always allow to include configs from core and plugins folder
+ if (preg_match('#^' . $this->_directorySeparator . 'core#', $config_path)) {
+ // always allow to include configs from "core" module's folder
return true;
}
- $module_found = false;
if (!$this->Application->ModuleInfo) {
return false;
}
- foreach ($this->Application->ModuleInfo as $module_name => $module_info) {
- $module_path = DIRECTORY_SEPARATOR . trim($module_info['Path'], '/') . DIRECTORY_SEPARATOR;
+ if (!isset($module_paths)) {
+ $module_paths = Array ();
- // config file path starts with module folder path
- if (substr($config_path, 0, strlen($module_path)) == $module_path) {
-// if (preg_match('#^' . preg_quote($module_path, '/') . '#', $config_path)) {
- $module_found = true;
- break;
+ foreach ($this->Application->ModuleInfo as $module_name => $module_info) {
+ $module_paths[] = rtrim($module_info['Path'], '/');
}
+
+ $module_paths = array_unique($module_paths);
}
- return $module_found;
+ preg_match($this->_moduleFolderRegExp, $config_path, $rets);
+
+ // config file path starts with module folder path
+ return in_array($rets[1], $module_paths);
}
/**
Index: units/admin/admin_config.php
===================================================================
--- units/admin/admin_config.php (revision 13106)
+++ units/admin/admin_config.php (working copy)
@@ -61,7 +61,7 @@
'priority' => 0,
'container' => true,
'type' => stTREE,
- 'icon_module' => 'in-portal',
+ 'icon_module' => 'core',
),
'in-portal:service' => Array (
Index: units/helpers/modules_helper.php
===================================================================
--- units/helpers/modules_helper.php (revision 13106)
+++ units/helpers/modules_helper.php (working copy)
@@ -212,7 +212,7 @@
$ret = Array ();
while (($entry = $folder->read()) !== false) {
$entry_lowercased = strtolower($entry);
- if (!is_dir($folder->path . '/' . $entry) || in_array($entry_lowercased, $skip_modules) || (substr($entry_lowercased, 0, 3) != 'in-')) {
+ if (!is_dir($folder->path . '/' . $entry) || in_array($entry_lowercased, $skip_modules)) {
continue;
}
Index: units/helpers/sections_helper.php
===================================================================
--- units/helpers/sections_helper.php (revision 13106)
+++ units/helpers/sections_helper.php (working copy)
@@ -143,6 +143,7 @@
$this->Tree[$section_name]['icon'] = $regs[2];
$this->Tree[$section_name]['icon_module'] = $regs[1]; // set "icon_module" used in "combined_header" block
$module_folder = trim( $this->Application->findModule('Name', $regs[1], 'Path'), '/');
+
if ($module_folder == '') {
$module_folder = 'core';
}
@@ -150,25 +151,27 @@
else {
$module_folder = $this->Application->getUnitOption($section_params['SectionPrefix'], 'ModuleFolder');
if (!array_key_exists('icon_module', $section_params)) {
- $this->Tree[$section_name]['icon_module'] = $module_folder; // set "icon_module" used in "combined_header" block
+ // set "icon_module" used in "combined_header" block
+ $this->Tree[$section_name]['icon_module'] = $this->Application->findModule('Path', $module_folder . '/', 'Name');
}
}
// this is to display HELP icon instead of missing one.. can be replaced with some other icon to draw attention
$icon_file = $module_folder.'/admin_templates/img/icons/icon24_'.$this->Tree[$section_name]['icon'];
- /*$core_file = FULL_PATH.'/core/admin_templates/img/icons/icon24_' . $this->Tree[$section_name]['icon'].'.gif';
- if ($module_folder != 'core' && file_exists($core_file) && file_exists(FULL_PATH.'/'.$icon_file.'.gif')) {
- if (crc32(file_get_contents($core_file)) == crc32(file_get_contents(FULL_PATH.'/'.$icon_file.'.gif'))) {
+ /*$core_file = FULL_PATH.'/core/admin_templates/img/icons/icon24_' . $this->Tree[$section_name]['icon'].'.png';
+ if ($module_folder != 'core' && file_exists($core_file) && file_exists(FULL_PATH.'/'.$icon_file.'.png')) {
+ if (crc32(file_get_contents($core_file)) == crc32(file_get_contents(FULL_PATH.'/'.$icon_file.'.png'))) {
trigger_error('Section "<strong>' . $section_name . '</strong>" uses icon copy from "Core" module', E_USER_NOTICE);
}
}*/
-// if (!file_exists(FULL_PATH.'/'.$icon_file.'.png')) {
-// $this->Tree[$section_name]['icon'] = 'help';
-// $this->Tree[$section_name]['icon_module'] = 'core';
-// }
+ if (!file_exists(FULL_PATH . '/' . $icon_file . '.png')) {
+ $this->Tree[$section_name]['icon'] = 'help';
+ $this->Tree[$section_name]['icon_module'] = 'core';
+ }
}
+
$this->Application->HandleEvent( new kEvent('adm:OnAfterBuildTree') );
if (isset($this->Application->Memcached)) {
Index: units/modules/modules_event_handler.php
===================================================================
--- units/modules/modules_event_handler.php (revision 13106)
+++ units/modules/modules_event_handler.php (working copy)
@@ -131,7 +131,7 @@
foreach ($new_modules as $module) {
$module_record = Array (
'Name' => $toolkit->getModuleName($module),
- 'Path' => $module . '/',
+ 'Path' => 'modules/' . $module . '/',
'Version' => $toolkit->GetMaxModuleVersion($module),
'Loaded' => 0,
'BuildDate' => null,
move_modules_inside_separate_folder_core_fix_part2.patch [^] (770 bytes) 2010-01-13 13:21
[Show Content]
Index: units/modules/modules_tag_processor.php
===================================================================
--- units/modules/modules_tag_processor.php (revision 13106)
+++ units/modules/modules_tag_processor.php (working copy)
@@ -108,10 +108,10 @@
$object =& $this->getObject($params);
/* @var $object kDBList */
- $module_path = strtolower( $object->GetDBField('Name') );
+ $module_path = strtolower( $object->GetDBField('Path') );
$url_params = Array ('redirect' => 1, 'admin' => 1);
- return $this->Application->HREF('dummy', '_FRONT_END_', $url_params, $module_path . '/install.php');
+ return $this->Application->HREF('dummy', '_FRONT_END_', $url_params, $module_path . 'install.php');
}
}
\ No newline at end of file
move_modules_inside_separate_folder_other_modules_fix_part2.patch [^] (9,218 bytes) 2010-01-13 13:22
[Show Content]
Index: custom/install.php
===================================================================
--- custom/install.php (revision 13106)
+++ custom/install.php (working copy)
@@ -1,12 +1,12 @@
<?php
- $module_folder = 'custom';
+ $module_folder = 'modules/custom';
if (!defined('IS_INSTALL')) {
// separate module install
define('IS_INSTALL', 1);
define('ADMIN', 1);
define('REL_PATH', $module_folder);
- define('FULL_PATH', realpath(dirname(__FILE__) . '/..') );
+ define('FULL_PATH', realpath(dirname(__FILE__) . '/../..') );
include_once(FULL_PATH . '/core/kernel/startup.php');
require_once FULL_PATH . '/core/install/install_toolkit.php';
@@ -30,4 +30,4 @@
$toolkit->RunSQL('/' . $module_folder .'/install/install_data.sql');
$toolkit->ImportLanguage('/' . $module_folder .'/install/english');
- $toolkit->finalizeModuleInstall($module_folder, false);
\ No newline at end of file
+ $toolkit->finalizeModuleInstall(basename($module_folder), false);
\ No newline at end of file
Index: in-auction/install.php
===================================================================
--- in-auction/install.php (revision 13106)
+++ in-auction/install.php (working copy)
@@ -10,14 +10,14 @@
* and will be prosecuted to the maximum extent possible under the law
* See http://www.in-portal.org/commercial-license for copyright notices and details.
*/
- $module_folder = 'in-auction';
+ $module_folder = 'modules/in-auction';
if (!defined('IS_INSTALL')) {
// separate module install
define('IS_INSTALL', 1);
define('ADMIN', 1);
define('REL_PATH', $module_folder);
- define('FULL_PATH', realpath(dirname(__FILE__) . '/..') );
+ define('FULL_PATH', realpath(dirname(__FILE__) . '/../..') );
include_once(FULL_PATH . '/core/kernel/startup.php');
require_once FULL_PATH . '/core/install/install_toolkit.php';
@@ -41,4 +41,4 @@
$toolkit->RunSQL('/' . $module_folder . '/install/install_data.sql');
$toolkit->ImportLanguage('/' . $module_folder . '/install/english');
- $toolkit->finalizeModuleInstall($module_folder, false);
\ No newline at end of file
+ $toolkit->finalizeModuleInstall(basename($module_folder), false);
\ No newline at end of file
Index: in-bulletin/install.php
===================================================================
--- in-bulletin/install.php (revision 13106)
+++ in-bulletin/install.php (working copy)
@@ -11,14 +11,14 @@
* or other free or open source software licenses.
* See http://www.in-portal.org/license for copyright notices and details.
*/
- $module_folder = 'in-bulletin';
+ $module_folder = 'modules/in-bulletin';
if (!defined('IS_INSTALL')) {
// separate module install
define('IS_INSTALL', 1);
define('ADMIN', 1);
define('REL_PATH', $module_folder);
- define('FULL_PATH', realpath(dirname(__FILE__) . '/..') );
+ define('FULL_PATH', realpath(dirname(__FILE__) . '/../..') );
include_once(FULL_PATH . '/core/kernel/startup.php');
require_once FULL_PATH . '/core/install/install_toolkit.php';
@@ -44,10 +44,10 @@
$toolkit->RunSQL('/' . $module_folder . '/install/install_data.sql', '{TopicCatId}', $category->GetID());
$toolkit->ImportLanguage('/' . $module_folder . '/install/english');
- $toolkit->SetModuleRootCategory($module_folder, $category->GetID());
+ $toolkit->SetModuleRootCategory(basename($module_folder), $category->GetID());
-// $toolkit->linkCustomFields($module_folder, 'bb', 3); // to create Custom Fields for Topics
+// $toolkit->linkCustomFields(basename($module_folder), 'bb', 3); // to create Custom Fields for Topics
$toolkit->linkCustomFields('KERNEL', 'c', 1); // to create ItemTemplate custom field
$toolkit->setModuleItemTemplate($category, 'bb', '#in-bulletin/item_design#');
- $toolkit->finalizeModuleInstall($module_folder, true);
\ No newline at end of file
+ $toolkit->finalizeModuleInstall(basename($module_folder), true);
\ No newline at end of file
Index: in-commerce/install.php
===================================================================
--- in-commerce/install.php (revision 13106)
+++ in-commerce/install.php (working copy)
@@ -10,14 +10,14 @@
* and will be prosecuted to the maximum extent possible under the law
* See http://www.in-portal.org/commercial-license for copyright notices and details.
*/
- $module_folder = 'in-commerce';
+ $module_folder = 'modules/in-commerce';
if (!defined('IS_INSTALL')) {
// separate module install
define('IS_INSTALL', 1);
define('ADMIN', 1);
define('REL_PATH', $module_folder);
- define('FULL_PATH', realpath(dirname(__FILE__) . '/..') );
+ define('FULL_PATH', realpath(dirname(__FILE__) . '/../..') );
include_once(FULL_PATH . '/core/kernel/startup.php');
require_once FULL_PATH . '/core/install/install_toolkit.php';
@@ -43,11 +43,11 @@
$toolkit->RunSQL('/' . $module_folder . '/install/install_data.sql', '{ProductCatId}', $category->GetID());
$toolkit->ImportLanguage('/' . $module_folder . '/install/english');
- $toolkit->SetModuleRootCategory($module_folder, $category->GetID());
+ $toolkit->SetModuleRootCategory(basename($module_folder), $category->GetID());
- $toolkit->linkCustomFields($module_folder, 'p', 11); // to create Custom Fields for Products
+ $toolkit->linkCustomFields(basename($module_folder), 'p', 11); // to create Custom Fields for Products
$toolkit->linkCustomFields('KERNEL', 'u', 6); // to create shipping related Custom Fields for Users
$toolkit->linkCustomFields('KERNEL', 'c', 1); // to create ItemTemplate custom field
$toolkit->setModuleItemTemplate($category, 'p', '#in-commerce/item_design#');
- $toolkit->finalizeModuleInstall($module_folder, true);
\ No newline at end of file
+ $toolkit->finalizeModuleInstall(basename($module_folder), true);
\ No newline at end of file
Index: in-link/install.php
===================================================================
--- in-link/install.php (revision 13106)
+++ in-link/install.php (working copy)
@@ -11,14 +11,14 @@
* or other free or open source software licenses.
* See http://www.in-portal.org/license for copyright notices and details.
*/
- $module_folder = 'in-link';
+ $module_folder = 'modules/in-link';
if (!defined('IS_INSTALL')) {
// separate module install
define('IS_INSTALL', 1);
define('ADMIN', 1);
define('REL_PATH', $module_folder);
- define('FULL_PATH', realpath(dirname(__FILE__) . '/..') );
+ define('FULL_PATH', realpath(dirname(__FILE__) . '/../..') );
include_once(FULL_PATH . '/core/kernel/startup.php');
require_once FULL_PATH . '/core/install/install_toolkit.php';
@@ -44,10 +44,10 @@
$toolkit->RunSQL('/' . $module_folder . '/install/install_data.sql', '{LinkCatId}', $category->GetID());
$toolkit->ImportLanguage('/' . $module_folder . '/install/english');
- $toolkit->SetModuleRootCategory($module_folder, $category->GetID());
+ $toolkit->SetModuleRootCategory(basename($module_folder), $category->GetID());
- $toolkit->linkCustomFields($module_folder, 'l', 4); // to create Custom Fields for Links
+ $toolkit->linkCustomFields(basename($module_folder), 'l', 4); // to create Custom Fields for Links
$toolkit->linkCustomFields('KERNEL', 'c', 1); // to create ItemTemplate custom field
$toolkit->setModuleItemTemplate($category, 'l', '#in-link/item_design#');
- $toolkit->finalizeModuleInstall($module_folder, true);
\ No newline at end of file
+ $toolkit->finalizeModuleInstall(basename($module_folder), true);
\ No newline at end of file
Index: in-news/install.php
===================================================================
--- in-news/install.php (revision 13106)
+++ in-news/install.php (working copy)
@@ -11,14 +11,14 @@
* or other free or open source software licenses.
* See http://www.in-portal.org/license for copyright notices and details.
*/
- $module_folder = 'in-news';
+ $module_folder = 'modules/in-news';
if (!defined('IS_INSTALL')) {
// separate module install
define('IS_INSTALL', 1);
define('ADMIN', 1);
define('REL_PATH', $module_folder);
- define('FULL_PATH', realpath(dirname(__FILE__) . '/..') );
+ define('FULL_PATH', realpath(dirname(__FILE__) . '/../..') );
include_once(FULL_PATH . '/core/kernel/startup.php');
require_once FULL_PATH . '/core/install/install_toolkit.php';
@@ -44,10 +44,10 @@
$toolkit->RunSQL('/' . $module_folder . '/install/install_data.sql', '{NewsCatId}', $category->GetID());
$toolkit->ImportLanguage('/' . $module_folder . '/install/english');
- $toolkit->SetModuleRootCategory($module_folder, $category->GetID());
+ $toolkit->SetModuleRootCategory(basename($module_folder), $category->GetID());
- $toolkit->linkCustomFields($module_folder, 'n', 2); // to create Custom Fields for News
+ $toolkit->linkCustomFields(basename($module_folder), 'n', 2); // to create Custom Fields for News
$toolkit->linkCustomFields('KERNEL', 'c', 1); // to create ItemTemplate custom field
$toolkit->setModuleItemTemplate($category, 'n', '#in-news/item_design#');
- $toolkit->finalizeModuleInstall($module_folder, true);
\ No newline at end of file
+ $toolkit->finalizeModuleInstall(basename($module_folder), true);
\ No newline at end of file
move_modules_inside_separate_folder_other_modules_fix_part3.patch [^] (3,085 bytes) 2010-03-02 14:38
[Show Content]
Index: custom/install/module_info.xml
===================================================================
--- custom/install/module_info.xml (revision 13152)
+++ custom/install/module_info.xml (working copy)
@@ -2,5 +2,5 @@
<module_info>
<name>Custom</name>
<description>Development Kit</description>
- <image>custom/install/img/icon_development_kit.gif</image>
+ <image>modules/custom/install/img/icon_development_kit.gif</image>
</module_info>
\ No newline at end of file
Index: in-auction/install/module_info.xml
===================================================================
--- in-auction/install/module_info.xml (revision 13152)
+++ in-auction/install/module_info.xml (working copy)
@@ -2,5 +2,5 @@
<module_info>
<name>In-Auction</name>
<description>eBay Auction Management</description>
- <image>in-auction/install/img/icon_auction_management.gif</image>
+ <image>modules/in-auction/install/img/icon_auction_management.gif</image>
</module_info>
\ No newline at end of file
Index: in-bulletin/install/module_info.xml
===================================================================
--- in-bulletin/install/module_info.xml (revision 13152)
+++ in-bulletin/install/module_info.xml (working copy)
@@ -2,5 +2,5 @@
<module_info>
<name>In-Bulletin</name>
<description>Discussion Forum</description>
- <image>in-bulletin/install/img/icon_discussion_forum.gif</image>
+ <image>modules/in-bulletin/install/img/icon_discussion_forum.gif</image>
</module_info>
\ No newline at end of file
Index: in-commerce/install/module_info.xml
===================================================================
--- in-commerce/install/module_info.xml (revision 13152)
+++ in-commerce/install/module_info.xml (working copy)
@@ -2,5 +2,5 @@
<module_info>
<name>In-Commerce</name>
<description>Commercial Shopping Cart</description>
- <image>in-commerce/install/img/icon_shopping_cart.gif</image>
+ <image>modules/in-commerce/install/img/icon_shopping_cart.gif</image>
</module_info>
\ No newline at end of file
Index: in-link/install/module_info.xml
===================================================================
--- in-link/install/module_info.xml (revision 13152)
+++ in-link/install/module_info.xml (working copy)
@@ -2,5 +2,5 @@
<module_info>
<name>In-Link</name>
<description>Directory Management</description>
- <image>in-link/install/img/icon_directory_management.gif</image>
+ <image>modules/in-link/install/img/icon_directory_management.gif</image>
</module_info>
\ No newline at end of file
Index: in-news/install/module_info.xml
===================================================================
--- in-news/install/module_info.xml (revision 13152)
+++ in-news/install/module_info.xml (working copy)
@@ -2,5 +2,5 @@
<module_info>
<name>In-News</name>
<description>News Management</description>
- <image>in-news/install/img/icon_news_management.gif</image>
+ <image>modules/in-news/install/img/icon_news_management.gif</image>
</module_info>
\ No newline at end of file
move_modules_inside_separate_folder_core_fix_part3.patch [^] (6,244 bytes) 2010-03-10 04:44
[Show Content]
Index: install.php
===================================================================
--- install.php (revision 13182)
+++ install.php (working copy)
@@ -345,7 +345,7 @@
'password=' . md5( $this->GetVar('password') ),
'action=check',
'license_code=' . base64_encode( $this->toolkit->getSystemConfig('Intechnic', 'LicenseCode') ),
- 'version=' . '4.3.0',//$this->toolkit->GetMaxModuleVersion('In-Portal'),
+ 'version=' . '4.3.0',//$this->toolkit->GetMaxModuleVersion('core/'),
'domain=' . base64_encode($_SERVER['HTTP_HOST']),
);
@@ -585,10 +585,10 @@
$this->toolkit->SetModuleRootCategory('Core', $this->Conn->getInsertID());
// set module "Core" version after install (based on upgrade scripts)
- $this->toolkit->SetModuleVersion('Core');
+ $this->toolkit->SetModuleVersion('Core', 'core/');
// for now we set "In-Portal" module version to "Core" module version (during clean install)
- $this->toolkit->SetModuleVersion('In-Portal', $this->toolkit->GetMaxModuleVersion('Core'));
+ $this->toolkit->SetModuleVersion('In-Portal', 'core/');
}
break;
@@ -656,7 +656,7 @@
$url_params = Array (
'login=' . md5($license_login),
'password=' . md5($license_password),
- 'version=' . $this->toolkit->GetMaxModuleVersion('In-Portal'),
+ 'version=' . $this->toolkit->GetMaxModuleVersion('core/'),
'domain=' . base64_encode($_SERVER['HTTP_HOST']),
);
@@ -695,7 +695,7 @@
'license_id=' . md5($license_id),
'dlog=' . md5($license_login),
'dpass=' . md5($license_password),
- 'version=' . $this->toolkit->GetMaxModuleVersion('In-Portal'),
+ 'version=' . $this->toolkit->GetMaxModuleVersion('core/'),
'domain=' . base64_encode($_SERVER['HTTP_HOST']),
);
@@ -792,9 +792,6 @@
$install_file = MODULES_PATH.'/'.$module.'/install.php';
if (file_exists($install_file)) {
include_once($install_file);
-
- // set module version after install (based on upgrade scripts)
- $this->toolkit->SetModuleVersion($module);
}
}
}
Index: install/install_toolkit.php
===================================================================
--- install/install_toolkit.php (revision 13182)
+++ install/install_toolkit.php (working copy)
@@ -185,12 +185,18 @@
* Sets module version to passed
*
* @param string $module_name
+ * @param string $module_path
* @param string $version
*/
- function SetModuleVersion($module_name, $version = false)
+ function SetModuleVersion($module_name, $module_path = false, $version = false)
{
if ($version === false) {
- $version = $this->GetMaxModuleVersion($module_name);
+ if (!$module_path) {
+ trigger_error('Module path must be given to "SetModuleVersion" method to auto-detect version', E_USER_ERROR);
+ return ;
+ }
+
+ $version = $this->GetMaxModuleVersion($module_path);
}
// get table prefix from config, because application may not be available here
@@ -234,9 +240,11 @@
* @param string $module_name
* @return string
*/
- function GetMaxModuleVersion($module_name)
+ function GetMaxModuleVersion($module_path)
{
- $upgrades_file = sprintf(UPGRADES_FILE, mb_strtolower($module_name).'/', 'sql');
+ $module_path = rtrim(mb_strtolower($module_path), '/');
+ $upgrades_file = sprintf(UPGRADES_FILE, $module_path . '/', 'sql');
+
if (!file_exists($upgrades_file)) {
// no upgrade file
return '5.0.0';
@@ -815,12 +823,12 @@
*/
function finalizeModuleInstall($module_folder, $refresh_permissions = false)
{
+ $this->SetModuleVersion(basename($module_folder), $module_folder);
+
if (!$this->Application->GetVar('redirect')) {
return ;
}
- $this->SetModuleVersion($module_folder);
-
$this->deleteCache($refresh_permissions);
$url_params = Array (
Index: install/step_templates/choose_modules.tpl
===================================================================
--- install/step_templates/choose_modules.tpl (revision 13182)
+++ install/step_templates/choose_modules.tpl (working copy)
@@ -33,8 +33,8 @@
$modules = $this->ScanModules();
foreach ($modules as $module) {
- $module_version = $this->toolkit->GetMaxModuleVersion($module);
- $prerequisites_errors = $this->toolkit->CheckPrerequisites($module . '/', Array ($module_version), 'install');
+ $module_version = $this->toolkit->GetMaxModuleVersion('modules/' . $module . '/');
+ $prerequisites_errors = $this->toolkit->CheckPrerequisites('modules/' . $module . '/', Array ($module_version), 'install');
$license_module = $module;
Index: units/modules/modules_event_handler.php
===================================================================
--- units/modules/modules_event_handler.php (revision 13182)
+++ units/modules/modules_event_handler.php (working copy)
@@ -132,7 +132,7 @@
$module_record = Array (
'Name' => $toolkit->getModuleName($module),
'Path' => 'modules/' . $module . '/',
- 'Version' => $toolkit->GetMaxModuleVersion($module),
+ 'Version' => $toolkit->GetMaxModuleVersion('modules/' . $module . '/'),
'Loaded' => 0,
'BuildDate' => null,
);
Index: units/modules/modules_tag_processor.php
===================================================================
--- units/modules/modules_tag_processor.php (revision 13182)
+++ units/modules/modules_tag_processor.php (working copy)
@@ -72,7 +72,7 @@
$object =& $this->getObject($params);
/* @var $object kDBList */
- $module_path = strtolower( $object->GetDBField('Name') );
+ $module_path = $object->GetDBField('Path');
if (!array_key_exists($module_path, $errors)) {
require_once FULL_PATH . '/core/install/install_toolkit.php';
@@ -81,7 +81,7 @@
$module_version = $toolkit->GetMaxModuleVersion($module_path);
- $errors[$module_path] = $toolkit->CheckPrerequisites($module_path . '/', Array ($module_version), 'standalone');
+ $errors[$module_path] = $toolkit->CheckPrerequisites($module_path, Array ($module_version), 'standalone');
}
return $errors[$module_path];
move_modules_inside_separate_folder_other_modules_fix_part4.patch [^] (3,920 bytes) 2010-03-10 04:45
[Show Content]
Index: custom/install.php
===================================================================
--- custom/install.php (revision 13152)
+++ custom/install.php (working copy)
@@ -30,4 +30,4 @@
$toolkit->RunSQL('/' . $module_folder .'/install/install_data.sql');
$toolkit->ImportLanguage('/' . $module_folder .'/install/english');
- $toolkit->finalizeModuleInstall(basename($module_folder), false);
\ No newline at end of file
+ $toolkit->finalizeModuleInstall($module_folder, false);
\ No newline at end of file
Index: in-auction/install.php
===================================================================
--- in-auction/install.php (revision 13152)
+++ in-auction/install.php (working copy)
@@ -41,4 +41,4 @@
$toolkit->RunSQL('/' . $module_folder . '/install/install_data.sql');
$toolkit->ImportLanguage('/' . $module_folder . '/install/english');
- $toolkit->finalizeModuleInstall(basename($module_folder), false);
\ No newline at end of file
+ $toolkit->finalizeModuleInstall($module_folder, false);
\ No newline at end of file
Index: in-auction/install/prerequisites.php
===================================================================
--- in-auction/install/prerequisites.php (revision 13152)
+++ in-auction/install/prerequisites.php (working copy)
@@ -54,7 +54,7 @@
}
if ($this->Application->isModuleEnabled('In-Commerce')) {
- $current_version = $this->_toolkit->GetMaxModuleVersion('in-commerce');
+ $current_version = $this->_toolkit->GetMaxModuleVersion('modules/in-commerce/');
$min_version = $this->_toolkit->ConvertModuleVersion('4.2.0');
if ($this->_toolkit->ConvertModuleVersion($current_version) < $min_version) {
Index: in-bulletin/install.php
===================================================================
--- in-bulletin/install.php (revision 13152)
+++ in-bulletin/install.php (working copy)
@@ -50,4 +50,4 @@
$toolkit->linkCustomFields('KERNEL', 'c', 1); // to create ItemTemplate custom field
$toolkit->setModuleItemTemplate($category, 'bb', '#in-bulletin/item_design#');
- $toolkit->finalizeModuleInstall(basename($module_folder), true);
\ No newline at end of file
+ $toolkit->finalizeModuleInstall($module_folder, true);
\ No newline at end of file
Index: in-commerce/install.php
===================================================================
--- in-commerce/install.php (revision 13152)
+++ in-commerce/install.php (working copy)
@@ -50,4 +50,4 @@
$toolkit->linkCustomFields('KERNEL', 'c', 1); // to create ItemTemplate custom field
$toolkit->setModuleItemTemplate($category, 'p', '#in-commerce/item_design#');
- $toolkit->finalizeModuleInstall(basename($module_folder), true);
\ No newline at end of file
+ $toolkit->finalizeModuleInstall($module_folder, true);
\ No newline at end of file
Index: in-link/install.php
===================================================================
--- in-link/install.php (revision 13152)
+++ in-link/install.php (working copy)
@@ -50,4 +50,4 @@
$toolkit->linkCustomFields('KERNEL', 'c', 1); // to create ItemTemplate custom field
$toolkit->setModuleItemTemplate($category, 'l', '#in-link/item_design#');
- $toolkit->finalizeModuleInstall(basename($module_folder), true);
\ No newline at end of file
+ $toolkit->finalizeModuleInstall($module_folder, true);
\ No newline at end of file
Index: in-news/install.php
===================================================================
--- in-news/install.php (revision 13152)
+++ in-news/install.php (working copy)
@@ -50,4 +50,4 @@
$toolkit->linkCustomFields('KERNEL', 'c', 1); // to create ItemTemplate custom field
$toolkit->setModuleItemTemplate($category, 'n', '#in-news/item_design#');
- $toolkit->finalizeModuleInstall(basename($module_folder), true);
\ No newline at end of file
+ $toolkit->finalizeModuleInstall($module_folder, true);
\ No newline at end of file
category_item_import_export_fix.patch [^] (2,206 bytes) 2010-03-11 12:58
[Show Content]
Index: admin_templates/tools/import2.tpl
===================================================================
--- admin_templates/tools/import2.tpl (revision 13203)
+++ admin_templates/tools/import2.tpl (working copy)
@@ -35,7 +35,7 @@
{
<inp2:m_DefineElement name="import_js_script">
if (import_id == <inp2:m_Param name="script_id"/>) {
- redirect('<inp2:m_Link template="{$module_path}import" pass="{$script_prefix}.import" {$script_prefix}.import_event="OnResetSettings"/>');
+ redirect('<inp2:m_Link template="{$script_module}/import" pass="{$script_prefix}.import" {$script_prefix}.import_event="OnResetSettings"/>');
return ;
}
</inp2:m_DefineElement>
Index: units/admin/admin_tag_processor.php
===================================================================
--- units/admin/admin_tag_processor.php (revision 13203)
+++ units/admin/admin_tag_processor.php (working copy)
@@ -1028,7 +1028,7 @@
$ret = '';
foreach ($import_sources as $import_source) {
$block_params['script_id'] = $import_source['ImportId'];
- $block_params['script_module'] = $import_source['Module'];
+ $block_params['script_module'] = mb_strtolower($import_source['Module']);
$block_params['script_name'] = $import_source['Name'];
$block_params['script_prefix'] = $import_source['Prefix'];
$block_params['module_path'] = $this->Application->findModule('Name', $import_source['Module'], 'Path');
Index: units/categories/categories_tag_processor.php
===================================================================
--- units/categories/categories_tag_processor.php (revision 13203)
+++ units/categories/categories_tag_processor.php (working copy)
@@ -1845,7 +1845,10 @@
$ret = Array ();
foreach ($prefixes as $prefix) {
if ($this->Application->prefixRegistred($prefix)) {
- $ret[$prefix] = $this->Application->getUnitOption($prefix, 'ModuleFolder') . '/export';
+ $module_path = $this->Application->getUnitOption($prefix, 'ModuleFolder') . '/';
+ $module_name = $this->Application->findModule('Path', $module_path, 'Name');
+
+ $ret[$prefix] = mb_strtolower($module_name) . '/export';
}
}
category_item_import_export_fix_part2.patch [^] (1,654 bytes) 2010-03-11 13:11
[Show Content]
Index: kernel/db/cat_event_handler.php
===================================================================
--- kernel/db/cat_event_handler.php (revision 13203)
+++ kernel/db/cat_event_handler.php (working copy)
@@ -1871,7 +1871,7 @@
$event->SetRedirectParam('opener', 'u');
}
elseif ($event->Special == 'export') {
- $event->redirect = $this->Application->getUnitOption($event->Prefix, 'ModuleFolder') . '/' . $event->Special . '_finish';
+ $event->redirect = $export_object->getModuleName($event) . '/' . $event->Special . '_finish';
$event->SetRedirectParam('pass', 'all');
}
Index: units/helpers/cat_dbitem_export_helper.php
===================================================================
--- units/helpers/cat_dbitem_export_helper.php (revision 13203)
+++ units/helpers/cat_dbitem_export_helper.php (working copy)
@@ -1304,9 +1304,12 @@
* @param kEvent $event
* @return string
*/
- function getModuleFolder(&$event)
+ function getModuleName(&$event)
{
- return $this->Application->getUnitOption($event->Prefix, 'ModuleFolder');
+ $module_path = $this->Application->getUnitOption($event->Prefix, 'ModuleFolder') . '/';
+ $module_name = $this->Application->findModule('Path', $module_path, 'Name');
+
+ return mb_strtolower($module_name);
}
/**
@@ -1369,7 +1372,7 @@
$this->Application->RemoveVar('export_progress_t');
}
else {
- $progress_t = $export_object->getModuleFolder($event).'/'.$event->Special.'_progress';
+ $progress_t = $export_object->getModuleName($event).'/'.$event->Special.'_progress';
}
$event->redirect = $progress_t;
modules_missing_on_upgrade_fix.patch [^] (3,407 bytes) 2010-04-10 07:09
[Show Content]
Index: install.php
===================================================================
--- install.php (revision 13329)
+++ install.php (working copy)
@@ -1181,6 +1181,30 @@
}
/**
+ * Virtually place module under "modules" folder or it won't be recognized during upgrade to 5.1.0 version
+ *
+ * @param string $name
+ * @param string $path
+ * @param string $version
+ * @return string
+ */
+ function getModulePath($name, $path, $version)
+ {
+ if ($name == 'Core') {
+ // don't transform path for Core module
+ return $path;
+ }
+
+ $version = $this->toolkit->ConvertModuleVersion($version);
+
+ if ($version < $this->toolkit->ConvertModuleVersion('5.1.0')) {
+ return 'modules/' . $path;
+ }
+
+ return $path;
+ }
+
+ /**
* Returns list of modules, that can be upgraded
*
*/
@@ -1194,7 +1218,9 @@
continue;
}
+ $module_info['Path'] = $this->getModulePath($module_name, $module_info['Path'], $module_info['Version']);
$upgrades_file = sprintf(UPGRADES_FILE, $module_info['Path'], 'sql');
+
if (!file_exists($upgrades_file)) {
// no upgrade file
continue;
Index: install/install_toolkit.php
===================================================================
--- install/install_toolkit.php (revision 13329)
+++ install/install_toolkit.php (working copy)
@@ -310,6 +310,7 @@
$sqls = str_replace('CREATE TABLE ', 'CREATE TABLE IF NOT EXISTS ' . $table_prefix, $sqls);
$sqls = str_replace('DROP TABLE ', 'DROP TABLE IF EXISTS ' . $table_prefix, $sqls);
$sqls = str_replace('<%TABLE_PREFIX%>', $table_prefix, $sqls);
+ $sqls = str_replace('<%PRIMARY_LANGUAGE%>', $this->Application->GetDefaultLanguageId(), $sqls);
if (isset($replace_from) && isset($replace_to)) {
// replace something additionally, e.g. module root category
@@ -591,12 +592,17 @@
/**
* Returns information about module (based on "install/module_info.xml" file)
*
- * @param string $module_folder
+ * @param string $module_name
* @return Array
*/
- function getModuleInfo($module_folder)
+ function getModuleInfo($module_name)
{
- $info_file = MODULES_PATH . '/' . $module_folder . '/install/module_info.xml';
+ if ($module_name == 'core') {
+ $info_file = FULL_PATH . '/' . $module_name . '/install/module_info.xml';
+ }
+ else {
+ $info_file = MODULES_PATH . '/' . $module_name . '/install/module_info.xml';
+ }
if (!file_exists($info_file)) {
return Array ();
@@ -625,22 +631,22 @@
/**
* Returns nice module string to be used on install/upgrade screens
*
- * @param string $module_folder
+ * @param string $module_name
* @param string $version_string
* @return string
*/
- function getModuleString($module_folder, $version_string)
+ function getModuleString($module_name, $version_string)
{
// image (if exists) <description> (<name> <version>)
$ret = Array ();
- $module_info = $this->getModuleInfo($module_folder);
+ $module_info = $this->getModuleInfo($module_name);
if (array_key_exists('name', $module_info) && $module_info['name']) {
$module_name = $module_info['name'];
}
else {
- $module_name = $this->getModuleName($module_folder);
+ $module_name = $this->getModuleName($module_name);
}
if (array_key_exists('image', $module_info) && $module_info['image']) {
incorrect_version_during_upgrade.patch [^] (927 bytes) 2010-04-11 07:55
[Show Content]
Index: install.php
===================================================================
--- install.php (revision 13367)
+++ install.php (working copy)
@@ -906,12 +906,12 @@
$this->RunUpgrades($module_info['Path'], $regs[1], 'after'); // upgrade script could operate resulting language pack
// after upgrade sqls are executed update version and upgrade language pack
- $this->toolkit->SetModuleVersion($module_name, $module_info['ToVersion']);
+ $this->toolkit->SetModuleVersion($module_name, false, $module_info['ToVersion']);
}
// for now we set "In-Portal" module version to "Core" module version (during upgrade)
if (in_array('core', $modules)) {
- $this->toolkit->SetModuleVersion('In-Portal', $upgrade_data['core']['ToVersion']);
+ $this->toolkit->SetModuleVersion('In-Portal', false, $upgrade_data['core']['ToVersion']);
}
}
break;
Fatal-when-editing-Catalog-Item.jpg [^] (167,220 bytes) 2010-04-25 17:03

broken_link_in_catalog_grid.patch [^] (635 bytes) 2010-04-27 08:17
[Show Content]
Index: kernel/utility/unit_config_reader.php
===================================================================
--- kernel/utility/unit_config_reader.php (revision 13400)
+++ kernel/utility/unit_config_reader.php (working copy)
@@ -803,7 +803,7 @@
if (array_key_exists('AdminTemplatePath', $config)) {
// append template base folder for admin templates path of this prefix
- $module_templates = $rets[1] == 'core' ? '' : $rets[1] . '/';
+ $module_templates = $rets[1] == 'core' ? '' : substr($rets[1], 8) . '/';
$config['AdminTemplatePath'] = $module_templates . $config['AdminTemplatePath'];
}
|