本文整理汇总了PHP中TElement::setUseLineBreaks方法的典型用法代码示例。如果您正苦于以下问题:PHP TElement::setUseLineBreaks方法的具体用法?PHP TElement::setUseLineBreaks怎么用?PHP TElement::setUseLineBreaks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TElement
的用法示例。
在下文中一共展示了TElement::setUseLineBreaks方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: clearField
/**
* Clear the field
* @param $form_name Form name
* @param $field Field name
*/
public static function clearField($form_name, $field)
{
$script = new TElement('script');
$script->{'language'} = 'JavaScript';
$script->setUseSingleQuotes(TRUE);
$script->setUseLineBreaks(FALSE);
$script->add(" setTimeout(function(){ \$('[name={$field}]').cleditor()[0].clear(); },1);");
$script->show();
}
示例2: disableField
/**
* Disable the field
* @param $form_name Form name
* @param $field Field name
*/
public static function disableField($form_name, $field)
{
$script = new TElement('script');
$script->{'language'} = 'JavaScript';
$script->setUseSingleQuotes(TRUE);
$script->setUseLineBreaks(FALSE);
$script->add(" setTimeout(function(){ \$('[name={$field}]').attr('disabled', true) },1); ");
$script->add(" setTimeout(function(){ \$('[name={$field}]').next().hide() },1);");
$script->show();
}
示例3: reload
/**
* Reload combobox items after it is already shown
* @param $formname form name (used in gtk version)
* @param $name field name
* @param $items array with items
*/
public static function reload($formname, $name, $items)
{
$script = new TElement('script');
$script->{'language'} = 'JavaScript';
$script->setUseSingleQuotes(TRUE);
$script->setUseLineBreaks(FALSE);
$code = '$(function() {';
$code .= '$(\'select[name="' . $name . '"]\').html("");';
foreach ($items as $key => $value) {
$code .= '$("<option value=\'' . $key . '\'>' . $value . '</option>").appendTo(\'select[name="' . $name . '"]\');';
}
$code .= '});';
$script->add($code);
$script->show();
}
示例4: sendData
/**
* Send data for a form located in the parent window
* @param $form_name Form Name
* @param $object An Object containing the form data
*/
public static function sendData($form_name, $object, $aggregate = FALSE)
{
// iterate the object properties
if ($object) {
foreach ($object as $field => $value) {
if (is_object($value)) {
foreach ($value as $property => $data) {
// if inside ajax request, then utf8_encode if isn't utf8
if (utf8_encode(utf8_decode($data)) !== $data) {
$data = utf8_encode(addslashes($data));
} else {
$data = addslashes($data);
}
// send the property value to the form
$script = new TElement('script');
$script->{'language'} = 'JavaScript';
$script->setUseSingleQuotes(TRUE);
$script->setUseLineBreaks(FALSE);
$script->add(" try {\n \$('form[name={$form_name}]').find('[name={$field}_{$property}]').val('{$data}');\n } catch (e) { } ");
$script->show();
}
} else {
// if inside ajax request, then utf8_encode if isn't utf8
if (utf8_encode(utf8_decode($value)) !== $value) {
$value = utf8_encode(addslashes($value));
} else {
$value = addslashes($value);
}
// send the property value to the form
$script = new TElement('script');
$script->{'language'} = 'JavaScript';
$script->setUseSingleQuotes(TRUE);
$script->setUseLineBreaks(FALSE);
if ($aggregate) {
$script->add("try\n {\n if (document.{$form_name}.{$field}.value == \"\")\n {\n \$('form[name={$form_name}]').find('[name={$field}]').val('{$value}');\n }\n else\n {\n document.{$form_name}.{$field}.value = document.{$form_name}.{$field}.value + ', {$value}'\n }\n } catch (e) { } ");
} else {
$script->add("\n \$('form[name={$form_name}]').find('[name={$field}]').val('{$value}');\n if (\$('form[name={$form_name}]').find('[name={$field}]').attr('exitaction'))\n {\n eval(\$('form[name={$form_name}]').find('[name={$field}]').attr('exitaction'));\n }\n ");
}
$script->show();
}
}
}
}
示例5: closeAll
/**
Close all TJQueryDialog
*/
public static function closeAll()
{
$script = new TElement('script');
$script->{'language'} = 'JavaScript';
$script->setUseLineBreaks(FALSE);
$script->setUseSingleQuotes(TRUE);
$script->add('$(\'[widget="T' . 'Window"]\').remove();');
$script->show();
}
示例6: disableField
/**
* Disable the field
* @param $form_name Form name
* @param $field Field name
*/
public static function disableField($form_name, $field)
{
$script = new TElement('script');
$script->{'language'} = 'JavaScript';
$script->setUseSingleQuotes(TRUE);
$script->setUseLineBreaks(FALSE);
$script->add(" try { document.{$form_name}.{$field}.disabled = true; } catch (e) { } ");
$script->add(" try { document.{$form_name}.{$field}.className = 'tfield_disabled'; } catch (e) { } ");
$script->add(" setTimeout(function(){ \$('[name=_{$field}_link]').hide() },1); ");
$script->show();
}
示例7: disableField
/**
* Disable the field
* @param $form_name Form name
* @param $field Field name
*/
public static function disableField($form_name, $field)
{
$script = new TElement('script');
$script->{'language'} = 'JavaScript';
$script->setUseSingleQuotes(TRUE);
$script->setUseLineBreaks(FALSE);
$script->add(" try { document.{$form_name}.{$field}.disabled = true; } catch (e) { } ");
$script->add(" try { document.{$form_name}.{$field}.className = 'tcombo_disabled'; } catch (e) { } ");
$script->show();
}
示例8: clearField
/**
* Clear the field
* @param $form_name Form name
* @param $field Field name
*/
public static function clearField($form_name, $field)
{
$script = new TElement('script');
$script->{'language'} = 'JavaScript';
$script->setUseSingleQuotes(TRUE);
$script->setUseLineBreaks(FALSE);
$script->add(" try { document.{$form_name}.{$field}.value='' } catch (e) { } ");
$script->add(" try { document.{$form_name}.{$field}.nextSibling.value='' } catch (e) { } ");
$script->show();
}
示例9: clearField
/**
* Clear the field
* @param $form_name Form name
* @param $field Field name
*/
public static function clearField($form_name, $field)
{
$script = new TElement('script');
$script->{'language'} = 'JavaScript';
$script->setUseSingleQuotes(TRUE);
$script->setUseLineBreaks(FALSE);
$script->add(" try {\n var parentDiv = document.{$form_name}.{$field}.parentNode;\n if( parentDiv.firstChild.tagName == 'IMG' )\n {\n parentDiv.firstChild.remove();\n }\n } catch (e) { } ");
$script->add(" try { document.{$form_name}.{$field}.value='' } catch (e) { } ");
$script->add(" try { document.{$form_name}.file_{$field}.value='' } catch (e) { } ");
$script->show();
}
示例10: clearField
/**
* clear the field
* @param $form_name Form name
* @param $field Field name
*/
public static function clearField($form_name, $field)
{
$script = new TElement('script');
$script->{'language'} = 'JavaScript';
$script->setUseSingleQuotes(TRUE);
$script->setUseLineBreaks(FALSE);
$script->add(" setTimeout(function(){ \$('[checkgroup={$field}]').attr('checked', false) },1);");
$script->show();
}
示例11: disableField
/**
* Disable the field
* @param $form_name Form name
* @param $field Field name
*/
public static function disableField($form_name, $field)
{
$script = new TElement('script');
$script->{'language'} = 'JavaScript';
$script->setUseSingleQuotes(TRUE);
$script->setUseLineBreaks(FALSE);
$script->add(" try { document.{$form_name}.{$field}.setAttribute('disabled', true); } catch (e) { } ");
$script->show();
}
示例12: clearField
/**
* Clear the field
* @param $form_name Form name
* @param $field Field name
*/
public static function clearField($form_name, $field)
{
$script = new TElement('script');
$script->{'language'} = 'JavaScript';
$script->setUseSingleQuotes(TRUE);
$script->setUseLineBreaks(FALSE);
$script->add("\$('#{$field}mfTable .tmultifield_scrolling').html('');");
$script->show();
}