當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。