本文整理汇总了PHP中TTi18n::gettext方法的典型用法代码示例。如果您正苦于以下问题:PHP TTi18n::gettext方法的具体用法?PHP TTi18n::gettext怎么用?PHP TTi18n::gettext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TTi18n
的用法示例。
在下文中一共展示了TTi18n::gettext方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: smarty_function_htmlReportSort
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
function smarty_function_htmlReportSort($params, &$smarty)
{
require_once $smarty->_get_plugin_filepath('function', 'html_options');
$filter_data = $params['filter_data'];
$retval .= '<tr onClick="showHelpEntry(\'sort\')">
<td colspan="2" class="cellLeftEditTableHeader">
' . TTi18n::gettext('Sort By:') . '
</td>
<td class="cellRightEditTable">
<select id="columns" name="filter_data[primary_sort]">
{html_options options=$filter_data.sort_options selected=$filter_data.primary_sort}
' . smarty_function_html_options(array('options' => $filter_data['sort_options'], 'selected' => $filter_data['primary_sort']), $smarty) . '
</select>
<select id="columns" name="filter_data[primary_sort_dir]">
' . smarty_function_html_options(array('options' => $filter_data['sort_direction_options'], 'selected' => $filter_data['primary_sort_dir']), $smarty) . '
</select>
<b>' . TTi18n::gettext('then:') . '</b>
<select id="columns" name="filter_data[secondary_sort]">
' . smarty_function_html_options(array('options' => $filter_data['sort_options'], 'selected' => $filter_data['secondary_sort']), $smarty) . '
</select>
<select id="columns" name="filter_data[secondary_sort_dir]">
' . smarty_function_html_options(array('options' => $filter_data['sort_direction_options'], 'selected' => $filter_data['secondary_sort_dir']), $smarty) . '
</select>
</td>
</tr>
';
return $retval;
}
示例2: getByFuzzyValue
static function getByFuzzyValue($value, $options, $value_is_translated = TRUE)
{
// I18n: Calling gettext on the value here enables a match with the translated value in the relevant factory.
// BUT... such string comparisons are messy and we really should be using getByKey for most everything.
// Exceptions can be made by passing false for $value_is_translated.
if ($value_is_translated == TRUE) {
$value = TTi18n::gettext($value);
}
if (is_array($value)) {
return FALSE;
}
if (!is_array($options)) {
return FALSE;
}
$retarr = Misc::findClosestMatch($value, $options, 10, FALSE);
Debug::Arr($retarr, 'RetArr: ', __FILE__, __LINE__, __METHOD__, 10);
/*
//Convert SQL search value ie: 'test%test%' to a regular expression.
$value = str_replace('%', '.*', $value);
foreach( $options as $key => $option_value ) {
if ( preg_match('/^'.$value.'$/i', $option_value) ) {
$retarr[] = $key;
}
}
*/
if (isset($retarr)) {
return $retarr;
}
return FALSE;
}
示例3: _getFactoryOptions
function _getFactoryOptions($name, $parent = NULL)
{
$retval = NULL;
switch ($name) {
case 'columns':
$retval = array('-1100-type' => TTi18n::gettext('Type'), '-1110-status' => TTi18n::gettext('Status'), '-1210-time_stamp' => TTi18n::gettext('Date/Time'), '-1220-date' => TTi18n::gettext('Date'), '-1230-time' => TTi18n::gettext('Time'), '-1239-in_type' => TTi18n::gettext('In Type'), '-1240-in_time_stamp' => TTi18n::gettext('In Date/Time'), '-1250-in_punch_date' => TTi18n::gettext('In Date'), '-1260-in_punch_time' => TTi18n::gettext('In Time'), '-1269-out_type' => TTi18n::gettext('Out Type'), '-1270-out_time_stamp' => TTi18n::gettext('Out Date/Time'), '-1280-out_punch_date' => TTi18n::gettext('Out Date'), '-1290-out_punch_time' => TTi18n::gettext('Out Time'), '-1310-branch' => TTi18n::gettext('Branch'), '-1320-department' => TTi18n::gettext('Department'), '-1410-station_id' => TTi18n::gettext('Station ID'), '-1420-longitude' => TTi18n::gettext('Longitude'), '-1430-latitude' => TTi18n::gettext('Latitude'), '-1500-note' => TTi18n::gettext('Note'));
//Since getOptions() can be called without first setting a company, we don't always know the product edition for the currently
//logged in employee.
if (is_object($this->getCompanyObject()) and $this->getCompanyObject()->getProductEdition() >= TT_PRODUCT_CORPORATE or !is_object($this->getCompanyObject()) and getTTProductEdition() >= TT_PRODUCT_CORPORATE) {
$retval += array('-1330-job' => TTi18n::gettext('Job'), '-1340-job_item' => TTi18n::gettext('Task'), '-1350-quantity' => TTi18n::gettext('Quantity'), '-1360-bad_quantity' => TTi18n::gettext('Bad Quantity'));
}
$retval = Misc::addSortPrefix(Misc::prependArray($this->getUserIdentificationColumns(), Misc::trimSortPrefix($retval)));
ksort($retval);
break;
case 'column_aliases':
//Used for converting column names after they have been parsed.
$retval = array('type' => 'type_id', 'status' => 'status_id', 'branch' => 'branch_id', 'department' => 'department_id', 'job' => 'job_id', 'job_item' => 'job_item_id');
break;
case 'import_options':
$retval = array('-1010-fuzzy_match' => TTi18n::getText('Enable smart matching.'), '-1020-disable_rounding' => TTi18n::getText('Disable rounding.'));
break;
case 'parse_hint':
$upf = TTnew('UserPreferenceFactory');
$retval = array('branch' => array('-1010-name' => TTi18n::gettext('Name'), '-1010-manual_id' => TTi18n::gettext('Code')), 'department' => array('-1010-name' => TTi18n::gettext('Name'), '-1010-manual_id' => TTi18n::gettext('Code')), 'job' => array('-1010-name' => TTi18n::gettext('Name'), '-1010-manual_id' => TTi18n::gettext('Code')), 'job_item' => array('-1010-name' => TTi18n::gettext('Name'), '-1010-manual_id' => TTi18n::gettext('Code')), 'time_stamp' => $upf->getOptions('date_time_format'), 'in_time_stamp' => $upf->getOptions('date_time_format'), 'out_time_stamp' => $upf->getOptions('date_time_format'), 'date' => $upf->getOptions('date_format'), 'in_punch_date' => $upf->getOptions('date_format'), 'out_punch_date' => $upf->getOptions('date_format'), 'time' => $upf->getOptions('time_format'), 'in_punch_time' => $upf->getOptions('time_format'), 'out_punch_time' => $upf->getOptions('time_format'));
break;
}
return $retval;
}
示例4: getTemplateSchema
public function getTemplateSchema($name = NULL)
{
$template_schema = array(array('page' => 1, 'template_page' => 1), array('function' => 'drawPiecemeal', 'value' => '_____________________________', 'coordinates' => array(array('x' => 47, 'y' => 245, 'h' => 5, 'w' => 60, 'halign' => 'L'), array('x' => 147, 'y' => 245, 'h' => 5, 'w' => 60, 'halign' => 'L'), array('x' => 147, 'y' => 255, 'h' => 5, 'w' => 60, 'halign' => 'C')), 'font' => array('size' => 10, 'type' => '')), array('function' => 'drawSegments', 'value' => array(TTi18n::gettext('Employee Signature:'), TTi18n::gettext('Supervisor Signature:'), TTi18n::gettext('(print name)')), 'coordinates' => array(array('x' => 7, 'y' => 245, 'h' => 5, 'w' => 40, 'halign' => 'L'), array('x' => 107, 'y' => 245, 'h' => 5, 'w' => 40, 'halign' => 'R'), array('x' => 140, 'y' => 260, 'h' => 5, 'w' => 60, 'halign' => 'C')), 'font' => array('size' => 10, 'type' => '')), 'full_name' => array('function' => 'drawPiecemeal', 'coordinates' => array(array('x' => 20, 'y' => 28, 'h' => 5, 'w' => 100, 'halign' => 'L'), array('x' => 40, 'y' => 250, 'h' => 5, 'w' => 60, 'halign' => 'C')), 'font' => array('size' => 10, 'type' => '')), 'amount_words_cents' => array('function' => array('filterAmountWordsCents', 'drawNormal'), 'coordinates' => array('x' => 20, 'y' => 36, 'h' => 5, 'w' => 100, 'halign' => 'J'), 'font' => array('size' => 10, 'type' => '')), 'date' => array('function' => array('filterDate', 'drawNormal'), 'coordinates' => array('x' => 100, 'y' => 18, 'h' => 5, 'w' => 38, 'halign' => 'L'), 'font' => array('size' => 10, 'type' => '')), 'amount_padded' => array('function' => array('filterAmountPadded', 'drawNormal'), 'coordinates' => array('x' => 136, 'y' => 27, 'h' => 5, 'w' => 24, 'halign' => 'L'), 'font' => array('size' => 10, 'type' => '')), 'stub_left_column' => array('function' => 'drawPiecemeal', 'coordinates' => array(array('x' => 15, 'y' => 105, 'h' => 95, 'w' => 96, 'halign' => 'L'), array('x' => 15, 'y' => 200, 'h' => 45, 'w' => 96, 'halign' => 'L')), 'font' => array('size' => 10, 'type' => ''), 'multicell' => TRUE), 'stub_right_column' => array('function' => 'drawPiecemeal', 'coordinates' => array(array('x' => 111, 'y' => 105, 'h' => 95, 'w' => 96, 'halign' => 'R'), array('x' => 111, 'y' => 200, 'h' => 45, 'w' => 96, 'halign' => 'R')), 'font' => array('size' => 10, 'type' => ''), 'multicell' => TRUE));
if (isset($template_schema[$name])) {
return $name;
} else {
return $template_schema;
}
}
示例5: getTemplateSchema
public function getTemplateSchema($name = NULL)
{
$template_schema = array(array('page' => 1, 'template_page' => 1, 'value' => TTi18n::gettext('Date:') . ' ', 'coordinates' => array('x' => 172, 'y' => 28, 'h' => 10, 'w' => 10, 'halign' => 'C'), 'font' => array('size' => 10, 'type' => '')), 'full_name' => array('coordinates' => array('x' => 25, 'y' => 41, 'h' => 5, 'w' => 100, 'halign' => 'L'), 'font' => array('size' => 10, 'type' => '')), 'amount_words' => array('function' => array('filterAmountWords', 'drawNormal'), 'coordinates' => array('x' => 25, 'y' => 49, 'h' => 10, 'w' => 100, 'halign' => 'L'), 'font' => array('size' => 10, 'type' => '')), 'amount_cents' => array('function' => array('filterAmountCents', 'drawNormal'), 'coordinates' => array('x' => 125, 'y' => 49, 'h' => 10, 'w' => 15, 'halign' => 'L'), 'font' => array('size' => 10, 'type' => '')), 'date' => array('function' => array('filterDate', 'drawNormal'), 'coordinates' => array('x' => 182, 'y' => 28, 'h' => 10, 'w' => 25, 'halign' => 'C'), 'font' => array('size' => 10, 'type' => '')), 'amount_padded' => array('function' => array('filterAmountPadded', 'drawNormal'), 'coordinates' => array('x' => 172, 'y' => 41, 'h' => 10, 'w' => 35, 'halign' => 'C'), 'font' => array('size' => 10, 'type' => '')), 'stub_left_column' => array('function' => 'drawPiecemeal', 'coordinates' => array(array('x' => 15, 'y' => 105, 'h' => 100, 'w' => 96, 'halign' => 'L'), array('x' => 15, 'y' => 205, 'h' => 100, 'w' => 96, 'halign' => 'L')), 'font' => array('size' => 10, 'type' => ''), 'multicell' => TRUE), 'stub_right_column' => array('function' => 'drawPiecemeal', 'coordinates' => array(array('x' => 111, 'y' => 105, 'h' => 100, 'w' => 96, 'halign' => 'R'), array('x' => 111, 'y' => 205, 'h' => 100, 'w' => 96, 'halign' => 'R')), 'font' => array('size' => 10, 'type' => ''), 'multicell' => TRUE));
if (isset($template_schema[$name])) {
return $name;
} else {
return $template_schema;
}
}
示例6: setOrder
function setOrder($value)
{
$value = trim($value);
if ($this->Validator->isNumeric('order', $value, TTi18n::gettext('Order is invalid'))) {
$this->data['order_value'] = $value;
return TRUE;
}
return FALSE;
}
示例7: setPremiumPolicy
function setPremiumPolicy($id)
{
$id = trim($id);
$pplf = new PremiumPolicyListFactory();
if ($id == 0 or $this->Validator->isResultSetWithRows('premium_policy', $pplf->getByID($id), TTi18n::gettext('Selected Premium Policy is invalid'))) {
$this->data['premium_policy_id'] = $id;
return TRUE;
}
return FALSE;
}
示例8: setRoundInterValPolicy
function setRoundInterValPolicy($id)
{
$id = trim($id);
$riplf = TTnew('RoundIntervalPolicyListFactory');
if ($id == 0 or $this->Validator->isResultSetWithRows('round_inteval_policy', $riplf->getByID($id), TTi18n::gettext('Selected Interval Rounding Policy is invalid'))) {
$this->data['round_interval_policy_id'] = $id;
return TRUE;
}
return FALSE;
}
示例9: setDepartment
function setDepartment($id)
{
$id = trim($id);
$dlf = new DepartmentListFactory();
if ($this->Validator->isResultSetWithRows('department', $dlf->getByID($id), TTi18n::gettext('Selected Department is invalid'))) {
$this->data['department_id'] = $id;
return TRUE;
}
return FALSE;
}
示例10: setOverTimePolicy
function setOverTimePolicy($id)
{
$id = trim($id);
$otplf = new OverTimePolicyListFactory();
if ($id == 0 or $this->Validator->isResultSetWithRows('over_time_policy', $otplf->getByID($id), TTi18n::gettext('Selected Overtime Policy is invalid'))) {
$this->data['over_time_policy_id'] = $id;
return TRUE;
}
return FALSE;
}
示例11: getOptions
function getOptions($name)
{
$retval = NULL;
switch ($name) {
case 'type':
$retval = array('government' => TTi18n::gettext('Government (Multiple Employees/Page)'), 'employee' => TTi18n::gettext('Employee (One Employee/Page)'));
break;
}
return $retval;
}
示例12: setGroup
function setGroup($id)
{
$id = trim($id);
$uglf = new UserGroupListFactory();
if ($id == 0 or $this->Validator->isResultSetWithRows('group', $uglf->getByID($id), TTi18n::gettext('Selected Group is invalid'))) {
$this->data['group_id'] = $id;
return TRUE;
}
return FALSE;
}
示例13: setBranch
function setBranch($id)
{
$id = trim($id);
$blf = TTnew('BranchListFactory');
if ($id != 0 or $this->Validator->isResultSetWithRows('company', $blf->getByID($id), TTi18n::gettext('Company is invalid'))) {
$this->data['branch_id'] = $id;
return TRUE;
}
return FALSE;
}
示例14: setBranch
function setBranch($id)
{
$id = trim($id);
$blf = new BranchListFactory();
if ($this->Validator->isResultSetWithRows('branch', $blf->getByID($id), TTi18n::gettext('Selected Branch is invalid'))) {
$this->data['branch_id'] = $id;
return TRUE;
}
return FALSE;
}
示例15: setUser
function setUser($id)
{
$id = trim($id);
$ulf = TTnew('UserListFactory');
if ($this->Validator->isResultSetWithRows('user', $ulf->getByID($id), TTi18n::gettext('User is invalid'))) {
$this->data['user_id'] = $id;
return TRUE;
}
return FALSE;
}