当前位置: 首页>>代码示例>>PHP>>正文


PHP TElement::setUseSingleQuotes方法代码示例

本文整理汇总了PHP中TElement::setUseSingleQuotes方法的典型用法代码示例。如果您正苦于以下问题:PHP TElement::setUseSingleQuotes方法的具体用法?PHP TElement::setUseSingleQuotes怎么用?PHP TElement::setUseSingleQuotes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TElement的用法示例。


在下文中一共展示了TElement::setUseSingleQuotes方法的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();
 }
开发者ID:jhonleandres,项目名称:pecommerce,代码行数:14,代码来源:THtmlEditor.class.php

示例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();
 }
开发者ID:jhonleandres,项目名称:pecommerce,代码行数:15,代码来源:TSlider.class.php

示例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();
 }
开发者ID:enieber,项目名称:adianti,代码行数:21,代码来源:TCombo.class.php

示例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();
             }
         }
     }
 }
开发者ID:jhonleandres,项目名称:pecommerce,代码行数:48,代码来源:TForm.class.php

示例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();
 }
开发者ID:enieber,项目名称:adianti,代码行数:12,代码来源:TJQueryDialog.class.php

示例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();
 }
开发者ID:jhonleandres,项目名称:pecommerce,代码行数:16,代码来源:TSeekButton.class.php

示例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();
 }
开发者ID:jhonleandres,项目名称:pecommerce,代码行数:15,代码来源:TCombo.class.php

示例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();
 }
开发者ID:jhonleandres,项目名称:pecommerce,代码行数:15,代码来源:TComboCombined.class.php

示例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();
 }
开发者ID:jhonleandres,项目名称:pecommerce,代码行数:16,代码来源:TFile.class.php

示例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();
 }
开发者ID:jhonleandres,项目名称:pecommerce,代码行数:14,代码来源:TCheckGroup.class.php

示例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();
 }
开发者ID:jhonleandres,项目名称:pecommerce,代码行数:14,代码来源:TButton.class.php

示例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();
 }
开发者ID:jhonleandres,项目名称:pecommerce,代码行数:14,代码来源:TMultiField.class.php


注:本文中的TElement::setUseSingleQuotes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。