Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1051541
languages_tag_processor.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Jul 4, 1:14 AM
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Jul 6, 1:14 AM (1 d, 10 h)
Engine
blob
Format
Raw Data
Handle
679314
Attached To
rINP In-Portal
languages_tag_processor.php
View Options
<?php
class
LanguagesTagProcessor
extends
kDBTagProcessor
{
/**
* Guesses what charset should be used:
* 1. use lang.current_Field field="Charset" by default
* 2. if using temp tables then use lang_Field field="Charset"
*
* @param Array $params
* @return string
*/
function
GetCharset
(
$params
)
{
$edit_direct
=
$this
->
Application
->
GetVar
(
'phrases_label'
);
$top_prefix
=
$this
->
Application
->
GetTopmostPrefix
(
$this
->
Prefix
);
if
(
substr
(
$this
->
Application
->
GetVar
(
$top_prefix
.
'_mode'
),
0
,
1
)
==
't'
&&
!
$edit_direct
)
{
$object
=&
$this
->
getObject
();
return
$object
->
GetDBField
(
'Charset'
);
}
$lang_current
=&
$this
->
Application
->
recallObject
(
'lang.current'
);
return
$lang_current
->
GetDBField
(
'Charset'
);
}
function
ListLanguages
(
$params
)
{
$this
->
Special
=
'enabled'
;
return
$this
->
PrintList2
(
$params
);
}
function
SelectedLanguage
(
$params
)
{
$object
=&
$this
->
Application
->
recallObject
(
$this
->
getPrefixSpecial
());
return
$object
->
GetDBField
(
'LanguageId'
)
==
$this
->
Application
->
GetVar
(
'm_lang'
);
}
/**
* Returns path where exported languages should be saved
*
* @param unknown_type $params
*/
function
ExportPath
(
$params
)
{
$ret
=
EXPORT_PATH
.
'/'
;
if
(
getArrayValue
(
$params
,
'as_url'
)
)
{
$ret
=
str_replace
(
FULL_PATH
.
'/'
,
$this
->
Application
->
BaseURL
(),
$ret
);
}
return
$ret
;
}
/**
* Returns true if system has more then 1 language installed
*
* @param Array $params
* @return bool
*/
function
IsMultiLanguage
(
$params
)
{
return
$this
->
TotalRecords
(
$params
)
>
1
;
}
/* function Main_IsMetricUnits($params)
{
$object =& $this->Application->recallObject($this->Prefix.'.current');
$measure_system = $object->GetDBField('UnitSystem');
return $measure_system == 1 ? 1 : 0;
}*/
}
?>
Event Timeline
Log In to Comment