本文整理汇总了PHP中Kwf_Trl类的典型用法代码示例。如果您正苦于以下问题:PHP Kwf_Trl类的具体用法?PHP Kwf_Trl怎么用?PHP Kwf_Trl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Kwf_Trl类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: _initColumns
protected function _initColumns()
{
parent::_initColumns();
$this->_columns->add(new Kwf_Grid_Column('id'));
//shows editDialog
$this->_columns->add(new Kwf_Grid_Column_Button('properties', ' ', 20))->setButtonIcon('/assets/silkicons/newspaper.png')->setTooltip(trlKwf('Properties'));
if (is_instance_of(Kwc_Abstract::getSetting($this->_getParam('class'), 'extConfig'), 'Kwc_Directories_Item_Directory_ExtConfigEditButtons')) {
$extConfigType = 'extConfig';
} else {
if (is_instance_of(Kwc_Abstract::getSetting($this->_getParam('class'), 'extConfigControllerIndex'), 'Kwc_Directories_Item_Directory_ExtConfigEditButtons')) {
$extConfigType = 'extConfigControllerIndex';
}
}
$extConfig = Kwf_Component_Abstract_ExtConfig_Abstract::getInstance($this->_getParam('class'), $extConfigType)->getConfig(Kwf_Component_Abstract_ExtConfig_Abstract::TYPE_DEFAULT);
$extConfig = $extConfig['items'];
if (count($extConfig['countDetailClasses']) > 1 && !$this->_getModel()->hasColumn('component')) {
throw new Kwf_Exception('If you have more than one detail-component your table has to have a column named "component"');
}
$i = 0;
foreach ($extConfig['contentEditComponents'] as $ec) {
$name = Kwf_Trl::getInstance()->trlStaticExecute(Kwc_Abstract::getSetting($ec['componentClass'], 'componentName'));
$icon = Kwc_Abstract::getSetting($ec['componentClass'], 'componentIcon');
$icon = new Kwf_Asset($icon);
$this->_columns->add(new Kwc_Directories_Item_Directory_Trl_ControllerEditButton('edit_' . $i, ' ', 20))->setColumnType('editContent')->setEditComponentClass($ec['componentClass'])->setEditComponent($ec['component'])->setEditType($ec['type'])->setEditIdTemplate($ec['idTemplate'])->setEditComponentIdSuffix($ec['componentIdSuffix'])->setButtonIcon($icon->toString(array('arrow')))->setTooltip(trlKwf('Edit {0}', $name));
$i++;
}
}
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:27,代码来源:Controller.php
示例2: _processInput
protected function _processInput($postData)
{
$users = Kwf_Registry::get('userModel');
$showPassword = false;
//is there a password auth?
foreach ($users->getAuthMethods() as $auth) {
if ($auth instanceof Kwf_User_Auth_Interface_Password) {
$showPassword = true;
}
}
if (!$showPassword) {
throw new Kwf_Exception("No password auth method found");
}
//if a redirect auth doesn't allow password hide it
foreach ($users->getAuthMethods() as $auth) {
if ($auth instanceof Kwf_User_Auth_Interface_Redirect) {
if (!$auth->allowPasswordForUser($users->getAuthedUser())) {
$label = $auth->getLoginRedirectLabel();
$label = Kwf_Trl::getInstance()->trlStaticExecute($label['name']);
$msg = $this->getData()->trlKwf("This user doesn't have a password, he must log in using {0}", $label);
$this->_errors[] = array('messages' => array($msg));
break;
}
}
}
parent::_processInput($postData);
}
开发者ID:koala-framework,项目名称:koala-framework,代码行数:27,代码来源:Component.php
示例3: setUp
public function setUp()
{
$trlElements = array();
$trlElements['kwf']['de']['.-decimal separator'] = ',';
$trlElements['kwf']['de']['C-locale'] = 'de_AT.UTF-8, de.UTF-8, de_DE.UTF-8';
Kwf_Trl::getInstance()->setTrlElements($trlElements);
}
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:7,代码来源:PhpTest.php
示例4: assets
public function assets(Kwf_Assets_Package $assetsPackage, $language = null)
{
if (!$language) {
$language = Kwf_Trl::getInstance()->getTargetLanguage();
}
$indent = str_repeat(' ', 8);
$ret = '';
foreach ($assetsPackage->getPackageUrls('text/css', $language) as $file) {
$ret .= "{$indent}<link rel=\"stylesheet\" type=\"text/css\" href=\"" . htmlspecialchars($file) . "\" />\n";
}
foreach ($assetsPackage->getPackageUrls('text/css; media=print', $language) as $file) {
$ret .= "{$indent}<link rel=\"stylesheet\" type=\"text/css\" href=\"" . htmlspecialchars($file) . "\" ";
if (!Kwf_Config::getValue('debug.assets.usePrintCssForAllMedia')) {
$ret .= "media=\"print\" ";
}
$ret .= "/>\n";
}
foreach ($assetsPackage->getPackageUrls('text/javascript', $language) as $file) {
$ret .= "{$indent}<script type=\"text/javascript\" src=\"" . htmlspecialchars($file) . "\"></script>\n";
}
foreach ($assetsPackage->getPackageUrls('text/javascript; defer', $language) as $file) {
$ret .= "<script type=\"text/javascript\">\n var se=document.createElement('script');se.type='text/javascript';se.async=true;\n se.src='" . $file . "';\n var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(se,s);\n </script>";
}
return $ret;
}
开发者ID:nsams,项目名称:koala-framework,代码行数:25,代码来源:Assets.php
示例5: setUp
public function setUp()
{
parent::setUp('Kwc_Trl_NewsCategories_Root');
$trlElements = array();
$trlElements['kwf']['de'] = array();
Kwf_Trl::getInstance()->setTrlElements($trlElements);
}
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:7,代码来源:Test.php
示例6: getValue
public static function getValue($key, $what = self::NAME)
{
$language = Kwf_Trl::getInstance()->getTargetLanguage();
$masterFile = KWF_PATH . '/Kwf/Form/Field/SelectCountry/countries.xml';
$cacheId = "countries_{$language}_{$what}";
$cache = Kwf_Cache::factory('File', 'File', array('master_file' => $masterFile, 'lifetime' => null, 'automatic_serialization' => true), array('cache_dir' => 'cache/config'));
$result = $cache->load($cacheId);
if (!$result) {
$xml = simplexml_load_file($masterFile);
$result = array();
$x = 0;
foreach ($xml->country as $country) {
$value = null;
foreach ($country as $k => $c) {
if ($k == $what) {
$attributes = $c->attributes();
if (isset($attributes['language']) && $attributes['language'] == $language) {
$result[(string) $country->iso2] = (string) $c;
}
}
}
}
$cache->save($result, $cacheId);
}
if (isset($result[$key])) {
return $result[$key];
}
return null;
}
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:29,代码来源:Country.php
示例7: assets
public function assets(Kwf_Assets_Package $assetsPackage, $language = null, $subroot = null)
{
if (!$language) {
$language = Kwf_Trl::getInstance()->getTargetLanguage();
}
$ev = new Kwf_Events_Event_CreateAssetsPackageUrls(get_class($assetsPackage), $assetsPackage, $subroot);
Kwf_Events_Dispatcher::fireEvent($ev);
$prefix = $ev->prefix;
$indent = str_repeat(' ', 8);
$ret = '';
foreach ($assetsPackage->getPackageUrls('text/css', $language) as $file) {
$ret .= "{$indent}<link rel=\"stylesheet\" type=\"text/css\" href=\"" . htmlspecialchars($prefix . $file) . "\" />\n";
}
foreach ($assetsPackage->getPackageUrls('text/css; ie8', $language) as $file) {
$ret .= "{$indent}<!--[if lte IE 8]><link rel=\"stylesheet\" type=\"text/css\" href=\"" . htmlspecialchars($prefix . $file) . "\" /><![endif]-->\n";
}
foreach ($assetsPackage->getPackageUrls('text/javascript; ie8', $language) as $file) {
$ret .= "{$indent}<!--[if lte IE 8]><script type=\"text/javascript\" src=\"" . htmlspecialchars($prefix . $file) . "\"></script><![endif]-->\n";
}
foreach ($assetsPackage->getPackageUrls('text/javascript', $language) as $file) {
$ret .= "{$indent}<script type=\"text/javascript\" src=\"" . htmlspecialchars($prefix . $file) . "\"></script>\n";
}
foreach ($assetsPackage->getPackageUrls('text/javascript; defer', $language) as $file) {
//single line to allow parsing
$ret .= "<script type=\"text/javascript\">var se=document.createElement('script');se.type='text/javascript';se.async=true;se.src='" . $prefix . $file . "';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(se,s);</script>\n";
}
return $ret;
}
开发者ID:koala-framework,项目名称:koala-framework,代码行数:28,代码来源:Assets.php
示例8: trlStaticExecute
public function trlStaticExecute($language = null)
{
parent::trlStaticExecute($language);
$trl = Kwf_Trl::getInstance();
$values = $this->getValues();
if (is_array($values)) {
foreach ($values as $k => $v) {
$newKey = $k;
$newValue = $v;
if (is_string($k)) {
$newKey = $trl->trlStaticExecute($k, $language);
}
//TODO key nicht (immer) übersetzen
if (is_string($v)) {
$newValue = $trl->trlStaticExecute($v, $language);
} else {
if (is_array($v)) {
foreach ($v as $k2 => $v2) {
if (is_string($v2)) {
$newValue[$k2] = $trl->trlStaticExecute($v2, $language);
}
}
}
}
unset($values[$k]);
$values[$newKey] = $newValue;
}
$this->setProperty('values', $values);
}
}
开发者ID:koala-framework,项目名称:koala-framework,代码行数:30,代码来源:ShowSelect.php
示例9: _initColumns
protected function _initColumns()
{
$this->_model = Kwf_Model_Abstract::getInstance(Kwc_Abstract::getSetting(Kwf_Component_Data_Root::getInstance()->getComponentByDbId($this->_getParam('componentId'))->parent->componentClass, 'childModel'))->getReferencedModel('Order');
$cc = Kwc_Abstract::getChildComponentClasses($this->_getParam('class'), 'payment');
$paymentsFilterData = array();
$payments = array();
foreach ($cc as $k => $c) {
$payments[$k] = Kwf_Trl::getInstance()->trlStaticExecute(Kwc_Abstract::getSetting($c, 'componentName'));
$paymentsFilterData[] = array($k, $payments[$k]);
}
$this->_filters['text'] = true;
if (count($payments) > 1) {
$this->_filters['payment'] = array('type' => 'ComboBox', 'text' => trlKwf('Payment'), 'data' => $paymentsFilterData, 'width' => 100);
}
$this->_filters['canceled'] = array('type' => 'Button', 'skipWhere' => true, 'cls' => 'x2-btn-text-icon', 'icon' => '/assets/silkicons/stop.png', 'text' => trlKwf('canceled'), 'tooltip' => trlKwf('Show canceled orders'));
$this->_filters['shipped'] = array('type' => 'Button', 'skipWhere' => true, 'cls' => 'x2-btn-text-icon', 'icon' => '/assets/silkicons/package.png', 'text' => trlKwf('shipped'), 'tooltip' => trlKwf('Show shipped orders'));
$this->_columns->add(new Kwf_Grid_Column('order_number', trlKwf('Order Nr'), 50));
$this->_columns->add(new Kwf_Grid_Column('invoice_number', trlKwf('Invoice Nr'), 50))->setHidden(true);
$this->_columns->add(new Kwf_Grid_Column_Datetime('date', trlKwf('Date')));
$this->_columns->add(new Kwf_Grid_Column('firstname', trlKwf('Firstname'), 90));
$this->_columns->add(new Kwf_Grid_Column('lastname', trlKwf('Lastname'), 90));
$this->_columns->add(new Kwf_Grid_Column('country', trlKwf('Country'), 15));
// TODO: Pfusch
$this->_columns->add(new Kwf_Grid_Column('sum_amount', trlKwf('Amt'), 30))->setData(new Kwc_Shop_Cart_Checkout_OrdersController_SumAmount())->setSortable(false);
$this->_columns->add(new Kwf_Grid_Column('sum_price', trlKwf('Sum'), 50))->setData(new Kwc_Shop_Cart_Checkout_OrdersController_SumPrice())->setSortable(false)->setRenderer('euroMoney');
if (count($payments) > 1) {
$this->_columns->add(new Kwf_Grid_Column('payment', trlKwf('Payment'), 80))->setData(new Kwc_Shop_Cart_Checkout_OrdersController_Payment($payments))->setSortable(false);
}
$this->_columns->add(new Kwf_Grid_Column_Date('payed', trlKwf('Payed')));
if (Kwc_Abstract::getSetting($this->_getParam('class'), 'generateInvoices')) {
$this->_columns->add(new Kwf_Grid_Column_Button('invoice', trlcKwf('Invoice', 'IN')));
}
$this->_columns->add(new Kwf_Grid_Column_Button('shipped', trlcKwf('Shipped', 'SH')))->setButtonIcon('/assets/silkicons/package_go.png');
$this->_columns->add(new Kwf_Grid_Column('shipped'));
}
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:35,代码来源:OrdersController.php
示例10: _initFields
protected function _initFields()
{
parent::_initFields();
$this->setCreateMissingRow(true);
if (!$this->getClass()) {
return;
}
$generators = Kwc_Abstract::getSetting($this->getClass(), 'generators');
$classes = $generators['child']['component'];
foreach ($classes as $key => $class) {
if (!$class) {
continue;
}
$form = Kwc_Abstract_Form::createChildComponentForm($this->getClass(), "-{$key}", $key);
if ($form && count($form->fields)) {
if ($this->_getIdTemplateForChild($key)) {
$form->setIdTemplate($this->_getIdTemplateForChild($key));
}
if (!$this->_createFieldsets || !Kwc_Abstract::hasSetting($class, 'componentName')) {
$this->add($form);
} else {
$name = Kwf_Trl::getInstance()->trlStaticExecute(Kwc_Abstract::getSetting($class, 'componentName'));
$name = str_replace('.', ' ', $name);
$this->add(new Kwf_Form_Container_FieldSet($name))->setName($key)->add($form);
}
}
}
}
开发者ID:nsams,项目名称:koala-framework,代码行数:28,代码来源:Form.php
示例11: getPlaceholders
public static function getPlaceholders(Kwc_Mail_Recipient_Interface $recipient, $language)
{
$ret = array();
$trl = Kwf_Trl::getInstance();
$ret['firstname'] = $recipient->getMailFirstname();
$ret['lastname'] = $recipient->getMailLastname();
if ($recipient instanceof Kwc_Mail_Recipient_TitleInterface) {
$replace = array($recipient->getMailTitle(), $recipient->getMailLastname());
$politeM = $trl->trlKwf('Dear Mr. {0} {1}', $replace, $language);
$politeF = $trl->trlKwf('Dear Mrs. {0} {1}', $replace, $language);
if ($recipient->getMailGender() == 'male' && $recipient->getMailLastname()) {
$t = $trl->trlKwf('Dear Mr. {0} {1}', $replace, $language);
} else {
if ($recipient->getMailGender() == 'female' && $recipient->getMailLastname()) {
$t = $trl->trlKwf('Dear Mrs. {0} {1}', $replace, $language);
} else {
$t = $trl->trlKwf('Dear Mrs./Mr. {0} {1}', $replace, $language);
}
}
$ret['salutation_polite'] = trim(str_replace(' ', ' ', $t));
if ($recipient->getMailGender() == 'male') {
$t = $trl->trlKwf('Mr. {0}', $recipient->getMailTitle(), $language);
} else {
if ($recipient->getMailGender() == 'female') {
$t = $trl->trlKwf('Mrs. {0}', $recipient->getMailTitle(), $language);
} else {
$t = $recipient->getMailTitle();
}
}
$ret['salutation_title'] = trim(str_replace(' ', ' ', $t));
$ret['title'] = $recipient->getMailTitle();
}
if ($recipient instanceof Kwc_Mail_Recipient_GenderInterface) {
$replace = array($recipient->getMailLastname());
if ($recipient->getMailGender() == 'male') {
$ret['salutation_polite_notitle'] = $trl->trlKwf('Dear Mr. {0}', $replace, $language);
$ret['salutation_hello'] = $trl->trlKwf('Hello Mr. {0}', $replace, $language);
$ret['salutation'] = $trl->trlKwf('Mr.', array(), $language);
$ret['salutation_firstname'] = $trl->trlcKwf('salutation firstname male', 'Dear {0}', array($recipient->getMailFirstname()), $language);
} else {
if ($recipient->getMailGender() == 'female') {
$ret['salutation_polite_notitle'] = $trl->trlKwf('Dear Mrs. {0}', $replace, $language);
$ret['salutation_hello'] = $trl->trlKwf('Hello Mrs. {0}', $replace, $language);
$ret['salutation'] = $trl->trlKwf('Mrs.', array(), $language);
$ret['salutation_firstname'] = $trl->trlcKwf('salutation firstname female', 'Dear {0}', array($recipient->getMailFirstname()), $language);
} else {
$replace = array($recipient->getMailFirstname(), $recipient->getMailLastname());
if ($recipient->getMailFirstname() && $recipient->getMailLastname()) {
$ret['salutation_polite_notitle'] = trim($trl->trlKwf('Dear {0} {1}', $replace, $language));
} else {
$ret['salutation_polite_notitle'] = $trl->trlKwf('Dear Sir or Madam', array(), $language);
}
$ret['salutation_hello'] = trim($trl->trlKwf('Hello {0} {1}', $replace, $language));
$ret['salutation_firstname'] = $trl->trlcKwf('salutation firstname unknown gender', 'Dear {0}', array($recipient->getMailFirstname()), $language);
}
}
}
return $ret;
}
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:59,代码来源:Placeholders.php
示例12: getCardForms
public function getCardForms()
{
$ret = array();
$title = Kwf_Trl::getInstance()->trlStaticExecute(Kwc_Abstract::getSetting($this->_class, 'componentName'));
$title = str_replace('.', ' ', $title);
$ret['form'] = array('form' => Kwc_Abstract_Form::createComponentForm($this->_class, 'child'), 'title' => $title);
return $ret;
}
开发者ID:koala-framework,项目名称:koala-framework,代码行数:8,代码来源:Admin.php
示例13: tearDown
public function tearDown()
{
Kwf_Trl::getInstance()->setWebCodeLanguage(null);
Kwf_Trl::getInstance()->unsetTrlElements();
Kwf_Cache_SimpleStatic::clear('trl-');
Kwf_Cache_SimpleStatic::clear('trlp-');
parent::tearDown();
}
开发者ID:koala-framework,项目名称:koala-framework,代码行数:8,代码来源:Test.php
示例14: setUp
public function setUp()
{
$trlElements = array();
$trlElements['kwf']['de']['Yes-'] = 'Ja';
$trlElements['kwf']['de']['.-decimal separator'] = ',';
$trlElements['kwf']['de'][',-thousands separator'] = '.';
Kwf_Trl::getInstance()->setTrlElements($trlElements);
}
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:8,代码来源:Test.php
示例15: trlStaticExecute
public function trlStaticExecute($language = null)
{
parent::trlStaticExecute($language);
if (!$language) {
$language = Kwf_Trl::getInstance()->getTargetLanguage();
}
$this->_floatValidator->setLocale($language);
}
开发者ID:koala-framework,项目名称:koala-framework,代码行数:8,代码来源:NumberField.php
示例16: getReplacements
public function getReplacements($parsedElements, $language)
{
$ret = array();
$trl = Kwf_Trl::getInstance();
foreach ($parsedElements as $i => $trlelement) {
$values = array();
if (!isset($trlelement['error'])) {
if ($trlelement['source'] == Kwf_Trl::SOURCE_KWF) {
$mode = "Kwf";
$source = Kwf_Trl::SOURCE_KWF;
} else {
$mode = '';
$source = Kwf_Trl::SOURCE_WEB;
}
//TODO: vereinfachen
if ($trlelement['type'] == 'trl') {
$values['before'] = $trlelement['before'];
$values['tochange'] = $trlelement['text'];
$method = $trlelement['type'] . $mode;
$values['now'] = $trl->{$method}($values['tochange'], array(), $language);
$values['now'] = str_replace("'", "\\'", $values['now']);
$values['now'] = str_replace($values['tochange'], $values['now'], $values['before']);
} else {
if ($trlelement['type'] == 'trlc') {
$values['context'] = $trlelement['context'];
$values['before'] = $trlelement['before'];
$values['tochange'] = $trlelement['text'];
$method = $trlelement['type'] . $mode;
$values['now'] = $trl->{$method}($values['context'], $values['tochange'], array(), $language);
$beforeWithoutContext = preg_replace('#[\'"]' . $values['context'] . '[\'"], ?#', '', $values['before']);
$values['now'] = str_replace($values['tochange'], $values['now'], $beforeWithoutContext);
} else {
if ($trlelement['type'] == 'trlp') {
$values['before'] = $trlelement['before'];
$values['single'] = $trlelement['text'];
$values['plural'] = $trlelement['plural'];
$newValues = Kwf_Trl::getInstance()->getTrlpValues(null, $values['single'], $values['plural'], $trlelement['source'], $language);
$values['now'] = str_replace($values['plural'], $newValues['plural'], $values['before']);
$values['now'] = str_replace($values['single'], $newValues['single'], $values['now']);
} else {
if ($trlelement['type'] == 'trlcp') {
$values['before'] = $trlelement['before'];
$values['context'] = $trlelement['context'];
$values['single'] = $trlelement['text'];
$values['plural'] = $trlelement['plural'];
$newValues = Kwf_Trl::getInstance()->getTrlpValues($values['context'], $values['single'], $values['plural'], $trlelement['source'], $language);
$beforeWithoutContext = preg_replace('#[\'"]' . $values['context'] . '[\'"], ?#', '', $values['before']);
$values['now'] = str_replace($values['plural'], $newValues['plural'], $beforeWithoutContext);
$values['now'] = str_replace($values['single'], $newValues['single'], $values['now']);
}
}
}
}
$ret[] = array('search' => $values['before'], 'replace' => $values['now']);
}
}
return $ret;
}
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:58,代码来源:JsLoader.php
示例17: componentToString
public function componentToString(Kwf_Component_Data $data)
{
$row = $data->getComponent()->getRow();
$fRow = $row->getParentRow(Kwc_Abstract::getSetting($data->componentClass, 'uploadModelRule'));
if (!$fRow) {
return str_replace('.', ' ', Kwf_Trl::getInstance()->trlStaticExecute(Kwc_Abstract::getSetting($data->componentClass, 'componentName')));
}
return $fRow->filename . '.' . $fRow->extension;
}
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:9,代码来源:Admin.php
示例18: getTemplateVars
public function getTemplateVars($values, $fieldNamePostfix = '', $idPrefix = '')
{
$ret = parent::getTemplateVars($values, $fieldNamePostfix, $idPrefix);
$name = $this->getFieldName();
$valueYear = 0;
$valueMonth = 0;
$valueDay = 0;
$value = isset($values[$name]) ? $values[$name] : $this->getDefaultValue();
if ($value) {
$value = strtotime($value);
if ($value) {
$valueYear = (int) date('Y', $value);
$valueMonth = (int) date('m', $value);
$valueDay = (int) date('d', $value);
}
}
$kwfTrl = Kwf_Trl::getInstance();
$ret['id'] = $idPrefix . str_replace(array('[', ']'), array('_', '_'), $name . $fieldNamePostfix);
$ret['html'] = "<select name=\"{$name}_day\">";
$ret['html'] .= "<option value=\"\">{$kwfTrl->trlKwf('Day', array(), $this->_language)}</option>";
for ($i = 1; $i <= 31; $i++) {
$v = str_pad($i, 2, '0', STR_PAD_LEFT);
$ret['html'] .= "<option value=\"{$v}\"";
if ($i == $valueDay) {
$ret['html'] .= ' selected="selected"';
}
$ret['html'] .= ">{$i}</option>";
}
$ret['html'] .= "</select>";
$ret['html'] = '<div class="outerSelect day">' . $ret['html'] . '</div><div class="outerSelect month">';
$months = array($kwfTrl->trlKwf('January', array(), $this->_language), $kwfTrl->trlKwf('February', array(), $this->_language), $kwfTrl->trlKwf('March', array(), $this->_language), $kwfTrl->trlKwf('April', array(), $this->_language), $kwfTrl->trlKwf('May', array(), $this->_language), $kwfTrl->trlKwf('June', array(), $this->_language), $kwfTrl->trlKwf('July', array(), $this->_language), $kwfTrl->trlKwf('August', array(), $this->_language), $kwfTrl->trlKwf('September', array(), $this->_language), $kwfTrl->trlKwf('October', array(), $this->_language), $kwfTrl->trlKwf('November', array(), $this->_language), $kwfTrl->trlKwf('December', array(), $this->_language));
$ret['html'] .= "<select name=\"{$name}_month\">";
$ret['html'] .= "<option value=\"\">{$kwfTrl->trlKwf('Month', array(), $this->_language)}</option>";
for ($i = 1; $i <= 12; $i++) {
$v = str_pad($i, 2, '0', STR_PAD_LEFT);
$ret['html'] .= "<option value=\"{$v}\"";
if ($i == $valueMonth) {
$ret['html'] .= ' selected="selected"';
}
$ret['html'] .= ">{$months[$i - 1]}</option>";
}
$ret['html'] .= "</select>";
$ret['html'] = $ret['html'] . '</div><div class="outerSelect year">';
$ret['html'] .= "<select name=\"{$name}_year\">";
$ret['html'] .= "<option value=\"\">{$kwfTrl->trlKwf('Year', array(), $this->_language)}</option>";
for ($i = date('Y'); $i >= 1900; $i--) {
$ret['html'] .= "<option value=\"{$i}\"";
if ($i == $valueYear) {
$ret['html'] .= ' selected="selected"';
}
$ret['html'] .= ">{$i}</option>";
}
$ret['html'] .= "</select>";
$ret['html'] = $ret['html'] . '</div>';
return $ret;
}
开发者ID:koala-framework,项目名称:koala-framework,代码行数:56,代码来源:DateSelect.php
示例19: setAssetsPackage
public function setAssetsPackage(Kwf_Assets_Package $package)
{
$t = Kwf_Model_Abstract::getInstance(Kwc_Abstract::getSetting($this->getClass(), 'stylesModel'));
$urls = $package->getPackageUrls('text/css', Kwf_Trl::getInstance()->getTargetLanguage());
$styleEditorUrl = Kwc_Admin::getInstance($this->getClass())->getControllerUrl() . '/styles-content';
$styleEditorUrl .= '?t=' . $t->getMTime();
$urls[] = $styleEditorUrl;
$this->fields['content']->setStylesCssFile($styleEditorUrl);
$this->fields['content']->setCssFiles($urls);
}
开发者ID:nsams,项目名称:koala-framework,代码行数:10,代码来源:Form.php
示例20: trlStaticExecute
public function trlStaticExecute($language = null)
{
parent::trlStaticExecute($language);
$locale = Kwf_Trl::getInstance()->trlcKwf('locale', 'C', array(), $language);
if ($locale == 'C') {
$locale = 'en_US';
}
$l = Zend_Locale::findLocale($locale);
$this->_floatValidator->setLocale($l);
}
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:10,代码来源:NumberField.php
注:本文中的Kwf_Trl类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论