Index: branches/RC/core/install/install_schema.sql
===================================================================
diff -u -N -r11646 -r11870
--- branches/RC/core/install/install_schema.sql (.../install_schema.sql) (revision 11646)
+++ branches/RC/core/install/install_schema.sql (.../install_schema.sql) (revision 11870)
@@ -130,6 +130,7 @@
AdminInterfaceLang tinyint(3) unsigned NOT NULL default '0',
Priority int(11) NOT NULL default '0',
IconURL varchar(255) default NULL,
+ IconDisabledURL varchar(255) default NULL,
DateFormat varchar(50) NOT NULL default '',
TimeFormat varchar(50) NOT NULL default '',
InputDateFormat varchar(50) NOT NULL default 'm/d/Y',
Index: branches/RC/core/units/general/cat_tag_processor.php
===================================================================
diff -u -N -r11823 -r11870
--- branches/RC/core/units/general/cat_tag_processor.php (.../cat_tag_processor.php) (revision 11823)
+++ branches/RC/core/units/general/cat_tag_processor.php (.../cat_tag_processor.php) (revision 11870)
@@ -733,6 +733,42 @@
return $this->Application->HREF($edit_template,'', $url_params);
}
+
+ function LanguageVisible($params)
+ {
+ $field = $this->SelectParam($params, 'name,field');
+
+ preg_match('/l([\d]+)_(.*)/', $field, $regs);
+ $params['name'] = $regs[2];
+
+ return $this->HasLanguageError($params) || $this->Application->GetVar('m_lang') == $regs[1];
+ }
+
+ function HasLanguageError($params)
+ {
+ static $languages = null;
+
+ if (!isset($languages)) {
+ $sql = 'SELECT ' . $this->Application->getUnitOption('lang', 'IDField') . '
+ FROM ' . $this->Application->getUnitOption('lang', 'TableName') . '
+ WHERE Enabled = 1';
+ $languages = $this->Conn->GetCol($sql);
+ }
+
+ $field = $this->SelectParam($params, 'name,field');
+
+ $object =& $this->getObject($params);
+ /* @var $object kDBItem */
+
+ foreach ($languages as $language_id) {
+ $check_field = 'l' . $language_id . '_' . $field;
+ if ($object->GetErrorMsg($check_field, false)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
}
?>
\ No newline at end of file
Index: branches/RC/core/install/upgrades.sql
===================================================================
diff -u -N -r11749 -r11870
--- branches/RC/core/install/upgrades.sql (.../upgrades.sql) (revision 11749)
+++ branches/RC/core/install/upgrades.sql (.../upgrades.sql) (revision 11870)
@@ -1319,5 +1319,7 @@
INSERT INTO ConfigurationAdmin VALUES ('DebugOnlyFormConfigurator', 'la_section_SettingsAdmin', 'la_config_DebugOnlyFormConfigurator', 'checkbox', '', '', 40.09, 0, 0);
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'DebugOnlyFormConfigurator', '0', 'In-Portal', 'in-portal:configure_advanced');
+ALTER TABLE Language ADD IconDisabledURL VARCHAR(255) NULL DEFAULT NULL AFTER IconURL;
+
DELETE FROM Modules WHERE Name = 'Proj-Base';
UPDATE Modules SET Version = '5.0.0', Loaded = 1 WHERE Name = 'In-Portal';
\ No newline at end of file
Index: branches/RC/core/admin_templates/regional/languages_edit.tpl
===================================================================
diff -u -N -r11760 -r11870
--- branches/RC/core/admin_templates/regional/languages_edit.tpl (.../languages_edit.tpl) (revision 11760)
+++ branches/RC/core/admin_templates/regional/languages_edit.tpl (.../languages_edit.tpl) (revision 11870)
@@ -63,6 +63,7 @@
+
Index: branches/RC/core/kernel/nparser/ntags.php
===================================================================
diff -u -N -r11678 -r11870
--- branches/RC/core/kernel/nparser/ntags.php (.../ntags.php) (revision 11678)
+++ branches/RC/core/kernel/nparser/ntags.php (.../ntags.php) (revision 11870)
@@ -419,6 +419,13 @@
*/
var $_Inversed = false;
+ /**
+ * Count of "elseif" tags inside
+ *
+ * @var int
+ */
+ var $_elseIfCount = 0;
+
function _Tag_If($tag)
{
parent::_BlockTag($tag);
@@ -464,14 +471,18 @@
$to_pass = $this->Parser->CompileParamsArray($tag['NP']);
+ $this->_elseIfCount++; // add same count of closing brackets in closing tag
+
+ $this->AppendCode($o, "} else {");
+
$code[] = "\$_splited = \$_parser->SplitTag(array('tag'=>\"{$tag['NP']['check']}\", 'file'=>'{$tag['file']}', 'line'=>{$tag['line']}));";
$code[] = 'if ($_splited[\'prefix\'] == \'__auto__\') {$_splited[\'prefix\'] = $PrefixSpecial;}';
$code[] = '$_p_ =& $_parser->GetProcessor($_splited[\'prefix\']);';
if (isset($tag['NP']['inverse']) || $this->_Inversed) {
- $code[] = "} else if (!\$_p_->ProcessParsedTag(\$_splited['name'], $to_pass, \$_splited['prefix'], '{$tag['file']}', {$tag['line']})) {";
+ $code[] = "if (!\$_p_->ProcessParsedTag(\$_splited['name'], $to_pass, \$_splited['prefix'], '{$tag['file']}', {$tag['line']})) {";
}
else {
- $code[] = "} else if (\$_p_->ProcessParsedTag(\$_splited['name'], $to_pass, \$_splited['prefix'], '{$tag['file']}', {$tag['line']})) {";
+ $code[] = "if (\$_p_->ProcessParsedTag(\$_splited['name'], $to_pass, \$_splited['prefix'], '{$tag['file']}', {$tag['line']})) {";
}
$this->AppendCode($o, $code);
@@ -483,7 +494,10 @@
function Close($tag)
{
$o = $this->Parser->Buffers[$this->Parser->Level];
- $this->AppendCode($o, "}\n");
+
+ $code = str_repeat("}\n", $this->_elseIfCount + 1);
+ $this->AppendCode($o, $code);
+
return $o;
}
}
Index: branches/RC/core/install/english.lang
===================================================================
diff -u -N -r11749 -r11870
--- branches/RC/core/install/english.lang (.../english.lang) (revision 11749)
+++ branches/RC/core/install/english.lang (.../english.lang) (revision 11870)
@@ -794,6 +794,7 @@
SGl0cw==
SG90
SFRNTCBWZXJzaW9u
+ SWNvbiBVUkwgKGRpc2FibGVkKQ==
SWNvbiBVUkw=
SUQ=
SW1hZ2UgSUQ=
Index: branches/RC/core/units/languages/languages_config.php
===================================================================
diff -u -N -r11711 -r11870
--- branches/RC/core/units/languages/languages_config.php (.../languages_config.php) (revision 11711)
+++ branches/RC/core/units/languages/languages_config.php (.../languages_config.php) (revision 11870)
@@ -195,7 +195,8 @@
'PrimaryLang' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0),
'AdminInterfaceLang' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0),
'Priority' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
- 'IconURL' => Array('type' => 'string','default' => null),
+ 'IconURL' => Array ('type' => 'string', 'max_len' => 255, 'default' => NULL),
+ 'IconDisabledURL' => Array ('type' => 'string', 'max_len' => 255, 'default' => NULL),
'DateFormat' => Array('type' => 'string','not_null' => '1','default' => '','required'=>1),
'TimeFormat' => Array('type' => 'string','not_null' => '1','default' => '','required'=>1),
'InputDateFormat' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array('m/d/Y' => 'mm/dd/yyyy', 'd/m/Y' => 'dd/mm/yyyy', 'm.d.Y' => 'mm.dd.yyyy', 'd.m.Y' => 'dd.mm.yyyy'), 'not_null' => '1','default' => 'm/d/Y', 'required' => 1),