Index: branches/RC/core/kernel/utility/debugger/debugger.js
===================================================================
diff -u -r9307 -r9335
--- branches/RC/core/kernel/utility/debugger/debugger.js (.../debugger.js) (revision 9307)
+++ branches/RC/core/kernel/utility/debugger/debugger.js (.../debugger.js) (revision 9335)
@@ -75,6 +75,7 @@
this.ResizeHappening = false;
this.ResizeTimer = null;
this.InitialPos = null;
+
// window.$Debugger = this; // this should be uncommented in case if debugger variable is not $Debugger
this.AddEvent(window, 'scroll', function (ev) { window.$Debugger.Resize(ev); });
this.AddEvent(window, 'resize', function (ev) { window.$Debugger.Resize(ev); });
@@ -123,9 +124,9 @@
if (this.SQLCount > 0) {
$toolbar_content += '
| ' + this.SQLCount + ' sqls | ';
}
-
- $span.innerHTML = '';
-
+
+ $span.innerHTML = '';
+
this.DebuggerToolbar = $span;
this.SetOpacity(20);
$span.onmouseover = function() {
@@ -137,6 +138,8 @@
var $body = document.getElementsByTagName('BODY')[0];
$body.insertBefore($span, $body.firstChild);
+
+// alert($span.offsetWidth)
this.MakeDragable('debug_toolbar_span', function() {}, function() {}, function() {});
}
@@ -351,6 +354,7 @@
$status = el.addEventListener(evname, func, true);
}
}
+
Debugger.prototype.mouseCoords = function(ev)
{
if(ev.pageX || ev.pageY){
@@ -364,6 +368,7 @@
}
return res;
}
+
Debugger.prototype.MakeDragable = function(object_id, startCallback, moveCallback, endCallback, options)
{
var drag_object = document.getElementById(object_id);
Index: branches/RC/kernel/include/category.php
===================================================================
diff -u -r8929 -r9335
--- branches/RC/kernel/include/category.php (.../category.php) (revision 8929)
+++ branches/RC/kernel/include/category.php (.../category.php) (revision 9335)
@@ -333,6 +333,8 @@
$item_template = '';
$ml_helper =& $this->Application->recallObject('kMultiLanguageHelper');
+ /* @var $ml_helper kMultiLanguageHelper */
+
$language_count = $ml_helper->getLanguageCount();
$primary_lang_id = $this->Application->GetDefaultLanguageId();
@@ -343,6 +345,9 @@
$i = 1;
while ($i <= $language_count) {
+ if (!$ml_helper->LanguageFound($i)) {
+ continue;
+ }
$nav_parts[$i][] = $rs->fields['l'.$i.'_Name'] ? $rs->fields['l'.$i.'_Name'] : $rs->fields['l'.$primary_lang_id.'_Name'];
$i++;
}
Index: branches/RC/core/units/categories/cache_updater.php
===================================================================
diff -u -r9286 -r9335
--- branches/RC/core/units/categories/cache_updater.php (.../cache_updater.php) (revision 9286)
+++ branches/RC/core/units/categories/cache_updater.php (.../cache_updater.php) (revision 9335)
@@ -189,6 +189,8 @@
// cache widely used values to speed up process: begin
$ml_helper =& $this->Application->recallObject('kMultiLanguageHelper');
+ /* @var $ml_helper kMultiLanguageHelper */
+
$this->languageCount = $ml_helper->getLanguageCount();
$this->primaryLanguageId = $this->Application->GetDefaultLanguageId();
// cache widely used values to speed up process: end
@@ -209,6 +211,26 @@
}
}
+ /**
+ * Checks if language with specified id is created
+ *
+ * @param int $language_id
+ * @return bool
+ */
+ function LanguageFound($language_id)
+ {
+ static $language_ids = null;
+
+ if (!isset($language_ids)) {
+ $ml_helper =& $this->Application->recallObject('kMultiLanguageHelper');
+ /* @var $ml_helper kMultiLanguageHelper */
+
+ $language_ids = $ml_helper->languagesIDs;
+ }
+
+ return in_array($language_id, $language_ids) || $language_id <= 5;
+ }
+
function InitUpdater()
{
$this->Stack = new clsRecursionStack();
@@ -390,6 +412,9 @@
$i = 1;
while ($i <= $this->languageCount) {
+ if (!$this->LanguageFound($i)) {
+ continue;
+ }
$fields_hash['l'.$i.'_CachedNavbar'] = implode('&|&', $data['titles'][$i]);
$i++;
}
Index: branches/RC/admin/install/install_lib.php
===================================================================
diff -u -r8929 -r9335
--- branches/RC/admin/install/install_lib.php (.../install_lib.php) (revision 8929)
+++ branches/RC/admin/install/install_lib.php (.../install_lib.php) (revision 9335)
@@ -349,11 +349,11 @@
if ($version === false) {
$version = K4_GetMaxModuleVersion($module_name);
}
-
+
$sql = 'UPDATE '.TABLE_PREFIX.'Modules
SET Version = "'.$version.'"
WHERE Name = "'.$module_name.'"';
-
+
$db =& inst_GetADODBConnection(true);
$db->Query($sql);
}
@@ -362,23 +362,23 @@
{
define('UPGRADES_FILE', FULL_PATH.'/%sinstall/upgrades.sql');
define('VERSION_MARK', '# ===== v ([\d]+\.[\d]+\.[\d]+) =====');
-
+
$upgrades_file = sprintf(UPGRADES_FILE, strtolower($module_name).'/');
if (!file_exists($upgrades_file)) {
// no upgrade file
return '4.0.1';
}
-
+
$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 end($regs[1]);
}
-
+
function RunRestoreFile($ado,$filename,$FileOffset,$MaxLines)
{
$size = filesize($filename);
@@ -1010,7 +1010,7 @@
$lang_path = FULL_PATH.'/'.$module_name.'/admin/install/langpacks';
$lang_xml->Parse($lang_path.'/english.lang', '|0|1|2|', '');
-
+
$app->Redirect('in-portal/modules/modules_list', Array('pass' => 'all', 'admin' => 1, 'RefreshTree' => 1), '', 'index.php');
}
@@ -1055,6 +1055,8 @@
$application =& kApplication::Instance();
$ml_helper =& $application->recallObject('kMultiLanguageHelper');
+ /* @var $ml_helper kMultiLanguageHelper */
+
$ml_helper->createFields($prefix.'-cdata', true);
$db =& $application->GetADODBConnection();
@@ -1077,6 +1079,9 @@
$field_mask = '';
$language_count = $ml_helper->getLanguageCount();
while ($i <= $language_count) {
+ if (!$ml_helper->LanguageFound($i)) {
+ continue;
+ }
$field_mask .= 'cdata%1$s.l'.$i.'_Value AS l'.$i.'_cust_%1$s, ';
$i++;
}