• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP escape_js函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中escape_js函数的典型用法代码示例。如果您正苦于以下问题:PHP escape_js函数的具体用法?PHP escape_js怎么用?PHP escape_js使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了escape_js函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: generate_autocomplete

function generate_autocomplete($id, $options)
{
    global $autocomplete_length_breaks;
    $js = '';
    // Turn the array into a simple, numerically indexed, array
    $options = array_values($options);
    $n_options = count($options);
    if ($n_options > 0) {
        // Work out a suitable value for the autocomplete minLength
        // option, ie the number of characters that must be typed before
        // a list of options appears.   We want to avoid presenting a huge
        // list of options.
        $min_length = 0;
        if (isset($autocomplete_length_breaks) && is_array($autocomplete_length_breaks)) {
            foreach ($autocomplete_length_breaks as $break) {
                if ($n_options < $break) {
                    break;
                }
                $min_length++;
            }
        }
        // Start forming the array literal
        // Escape the options
        for ($i = 0; $i < $n_options; $i++) {
            $options[$i] = escape_js($options[$i]);
        }
        $options_string = "'" . implode("','", $options) . "'";
        // Build the JavaScript.   We don't support autocomplete in IE6 and below
        // because the browser doesn't render the autocomplete box properly - it
        // gets hidden behind other elements.   Although there are fixes for this,
        // it's not worth it ...
        $js .= "if (!lteIE6)\n";
        $js .= "{\n";
        $js .= "  \$('#{$id}').autocomplete({\n";
        $js .= "    source: [{$options_string}],\n";
        $js .= "    minLength: {$min_length}\n";
        $js .= "  })";
        // If the minLength is 0, then the autocomplete widget doesn't do
        // quite what you might expect and you need to force it to display
        // the available options when it receives focus
        if ($min_length == 0) {
            $js .= ".focus(function() {\n";
            $js .= "    \$(this).autocomplete('search', '');\n";
            $js .= "  })";
        }
        $js .= "  ;\n";
        $js .= "}\n";
    }
    return $js;
}
开发者ID:koroder,项目名称:Web-portal-for-academic-institution,代码行数:50,代码来源:report.js.php


示例2: create_field_entry_areas

function create_field_entry_areas($disabled = FALSE)
{
    global $areas, $area_id, $rooms;
    echo "<div id=\"div_areas\">\n";
    echo "</div>\n";
    // if there is more than one area then give the option
    // to choose areas.
    if (count($areas) > 1) {
        ?>
 
      <script type="text/javascript">
      //<![CDATA[
      
      var area = <?php 
        echo $area_id;
        ?>
;
      
      function changeRooms( formObj )
      {
        areasObj = eval( "formObj.area" );

        area = areasObj[areasObj.selectedIndex].value;
        roomsObj = eval( "formObj.elements['rooms']" );

        // remove all entries
        roomsNum = roomsObj.length;
        for (i=(roomsNum-1); i >= 0; i--)
        {
          roomsObj.options[i] = null;
        }
        // add entries based on area selected
        switch (area){
          <?php 
        foreach ($areas as $a) {
            print "case \"" . $a['id'] . "\":\n";
            // get rooms for this area
            $i = 0;
            foreach ($rooms as $r) {
                if ($r['area_id'] == $a['id']) {
                    print "roomsObj.options[{$i}] = new Option(\"" . escape_js($r['room_name']) . "\"," . $r['id'] . ");\n";
                    $i++;
                }
            }
            // select the first entry by default to ensure
            // that one room is selected to begin with
            if ($i > 0) {
                print "roomsObj.options[0].selected = true;\n";
            }
            print "break;\n";
        }
        ?>
        } //switch
        
        <?php 
        // Replace the start and end selectors with those for the new area
        // (1) We set the display for the old elements to "none" and the new
        // elements to "block".   (2) We also need to disable the old selectors and
        // enable the new ones: they all have the same name, so we only want
        // one passed through with the form.  (3) We take a note of the currently
        // selected start and end values so that we can have a go at finding a
        // similar time/period in the new area. (4) We also take a note of the old
        // area id because we'll need that when trying to match up slots: it only
        // makes sense to match up slots if both old and new area used the same
        // mode (periods/times).
        // For the "all day" checkbox, the process is slightly different.  This
        // is because the checkboxes themselves are visible or not depending on
        // the time restrictions for that particular area. (1) We set the display
        // for the old *container* element to "none" and the new elements to
        // "block".  (2) We disable the old checkboxes and enable the new ones for
        // the same reasons as above.  (3) We copy the value of the old check box
        // to the new check box
        ?>
        var oldStartId = "start_seconds" + currentArea;
        var oldEndId = "end_seconds" + currentArea;
        var newStartId = "start_seconds" + area;
        var newEndId = "end_seconds" + area;
        var oldAllDayId = "ad" + currentArea;
        var newAllDayId = "ad" + area;
        var oldAreaStartValue = formObj[oldStartId].options[formObj[oldStartId].selectedIndex].value;
        var oldAreaEndValue = formObj[oldEndId].options[formObj[oldEndId].selectedIndex].value;
        $("#" + oldStartId).hide()
                           .attr('disabled', 'disabled');
        $("#" + oldEndId).hide()
                         .attr('disabled', 'disabled');
        $("#" + newStartId).show()
                           .removeAttr('disabled');
        $("#" + newEndId).show()
                         .removeAttr('disabled');
                         +        $("#" + oldAllDayId).hide();
        $("#" + newAllDayId).show();
        if($("#all_day" + currentArea).attr('checked') == 'checked')
        { 
          $("#all_day" + area).attr('checked', 'checked').removeAttr('disabled');
        }
        else
        {
          $("#all_day" + area).removeAttr('checked').removeAttr('disabled');
        }
        $("#all_day" + currentArea).removeAttr('disabled');
//.........这里部分代码省略.........
开发者ID:koroder,项目名称:Web-portal-for-academic-institution,代码行数:101,代码来源:edit_entry.php


示例3: escape_js

    defaultOptions.bProcessing = true;
    defaultOptions.bScrollCollapse = true;
    defaultOptions.bStateSave = true;
    defaultOptions.iDisplayLength = 25;
    defaultOptions.sDom = 'C<"clear">lfrtip';
    defaultOptions.sScrollX = "100%";
    defaultOptions.sPaginationType = "full_numbers";
    defaultOptions.oColReorder = {};
    defaultOptions.oColVis = {sSize: "auto",
                              buttonText: '<?php 
echo escape_js(get_vocab("show_hide_columns"));
?>
',
                              bRestore: true,
                              sRestore: '<?php 
echo escape_js(get_vocab("restore_original"));
?>
'};

    defaultOptions.fnInitComplete = function(){
    
        if (((leftCol !== undefined) && (leftCol !== null)) ||
            ((rightCol !== undefined) && (rightCol !== null)) )
        {
          <?php 
// Fix the left and/or right columns.  This has to be done when
// initialisation is complete as the language files are loaded
// asynchronously
?>
          var options = {};
          if ((leftCol !== undefined) && (leftCol !== null))
开发者ID:dev-lav,项目名称:htdocs,代码行数:31,代码来源:datatables.js.php


示例4: escape_js

                                {
                                  alertMessage += '<?php 
    echo escape_js(mrbs_entity_decode(get_vocab("conflict")));
    ?>
' + ":  \n\n";
                                  var conflictsList = getErrorList(result.conflicts);
                                  alertMessage += conflictsList.text;
                                }
                                if (result.rules_broken.length > 0)
                                {
                                  if (result.conflicts.length > 0)
                                  {
                                    alertMessage += "\n\n";
                                  }
                                  alertMessage += '<?php 
    echo escape_js(mrbs_entity_decode(get_vocab("rules_broken")));
    ?>
' + ":  \n\n";
                                  var rulesList = getErrorList(result.rules_broken);
                                  alertMessage += rulesList.text;
                                }
                                window.alert(alertMessage);
                              }
                              turnOnPageRefresh();
                            },
                           'json');
                  }   <?php 
    // if (rectanglesIdentical(r1, r2))
    ?>
              
                };  <?php 
开发者ID:bdwong-mirrors,项目名称:mrbs,代码行数:31,代码来源:resizable.js.php


示例5: my_name_is

    /**
     * AJAX response handler for the 'my_name_is' step
     */
    static function my_name_is()
    {
        // Grab the new name from POST data
        $in = ps('my_name');
        // ...further processing might go here: Database updates, input validation, ...
        self::$my_name = $in;
        // Prepare response string
        $in = escape_js($in);
        // Send a javascript response to render this posted data back into the document's headline.
        // Find the target HTML fragment via jQuery through its selector '#my_name_output'
        // and replace its text.
        send_script_response(<<<EOS
\t\t\$('#my_name_output').text('{$in}');
EOS
);
    }
开发者ID:rwetzlmayr,项目名称:wet_sample_txpajax,代码行数:19,代码来源:wet_sample_txpajax.php


示例6: section_save

function section_save()
{
    global $txpcfg, $app_mode;
    extract(doSlash(psa(array('page', 'css', 'old_name'))));
    extract(psa(array('name', 'title')));
    $prequel = '';
    $sequel = '';
    if (empty($title)) {
        $title = $name;
    }
    // Prevent non url chars on section names
    include_once txpath . '/lib/classTextile.php';
    $textile = new Textile();
    $title = doSlash($textile->TextileThis($title, 1));
    $name = doSlash(sanitizeForUrl($name));
    if ($old_name && strtolower($name) != strtolower($old_name)) {
        if (safe_field('name', 'txp_section', "name='{$name}'")) {
            $message = array(gTxt('section_name_already_exists', array('{name}' => $name)), E_ERROR);
            if ($app_mode == 'async') {
                // TODO: Better/themeable popup
                send_script_response('window.alert("' . escape_js(strip_tags(gTxt('section_name_already_exists', array('{name}' => $name)))) . '")');
            } else {
                sec_section_list($message);
                return;
            }
        }
    }
    if ($name == 'default') {
        safe_update('txp_section', "page = '{$page}', css = '{$css}'", "name = 'default'");
        update_lastmod();
    } else {
        extract(array_map('assert_int', psa(array('is_default', 'on_frontpage', 'in_rss', 'searchable'))));
        // note this means 'selected by default' not 'default page'
        if ($is_default) {
            safe_update("txp_section", "is_default = 0", "name != '{$old_name}'");
            // switch off $is_default for all sections in async app_mode
            if ($app_mode == 'async') {
                $prequel = '$("input[name=\\"is_default\\"][value=\\"1\\"]").attr("checked", false);' . '$("input[name=\\"is_default\\"][value=\\"0\\"]").attr("checked", true);';
            }
        }
        safe_update('txp_section', "\n\t\t\t\tname         = '{$name}',\n\t\t\t\ttitle        = '{$title}',\n\t\t\t\tpage         = '{$page}',\n\t\t\t\tcss          = '{$css}',\n\t\t\t\tis_default   = {$is_default},\n\t\t\t\ton_frontpage = {$on_frontpage},\n\t\t\t\tin_rss       = {$in_rss},\n\t\t\t\tsearchable   = {$searchable}\n\t\t\t", "name = '{$old_name}'");
        safe_update('textpattern', "Section = '{$name}'", "Section = '{$old_name}'");
        update_lastmod();
    }
    $message = gTxt('section_updated', array('{name}' => $name));
    if ($app_mode == 'async') {
        // Caveat: Use unslashed params for DTO
        $s = psa(array('name', 'title', 'page', 'css')) + compact('is_default', 'on_frontpage', 'in_rss', 'searchable');
        $s = section_detail_partial($s);
        send_script_response($prequel . '$("#section-form-' . $name . '").replaceWith("' . escape_js($s) . '");' . $sequel);
    } else {
        sec_section_list($message);
    }
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:54,代码来源:txp_section.php


示例7: article_edit


//.........这里部分代码省略.........
        // Next record?
        $rs['next_id'] = checkIfNeighbour('next', $sPosted);
    } else {
        $rs['prev_id'] = $rs['next_id'] = 0;
    }
    // Let plugins chime in on partials meta data.
    callback_event_ref('article_ui', 'partials_meta', 0, $rs, $partials);
    $rs['partials_meta'] =& $partials;
    // Get content for volatile partials.
    foreach ($partials as $k => $p) {
        if ($p['mode'] == PARTIAL_VOLATILE || $p['mode'] == PARTIAL_VOLATILE_VALUE) {
            $cb = $p['cb'];
            $partials[$k]['html'] = is_array($cb) ? call_user_func($cb, $rs, $k) : $cb($rs, $k);
        }
    }
    if ($refresh_partials) {
        $response[] = announce($message);
        $response[] = '$("#article_form [type=submit]").val(textpattern.gTxt("save"))';
        if ($Status < STATUS_LIVE) {
            $response[] = '$("#article_form").addClass("saved").removeClass("published")';
        } else {
            $response[] = '$("#article_form").addClass("published").removeClass("saved")';
        }
        // Update the volatile partials.
        foreach ($partials as $k => $p) {
            // Volatile partials need a target DOM selector.
            if (empty($p['selector']) && $p['mode'] != PARTIAL_STATIC) {
                trigger_error("Empty selector for partial '{$k}'", E_USER_ERROR);
            } else {
                // Build response script.
                if ($p['mode'] == PARTIAL_VOLATILE) {
                    // Volatile partials replace *all* of the existing HTML
                    // fragment for their selector.
                    $response[] = '$("' . $p['selector'] . '").replaceWith("' . escape_js($p['html']) . '")';
                } elseif ($p['mode'] == PARTIAL_VOLATILE_VALUE) {
                    // Volatile partial values replace the *value* of elements
                    // matching their selector.
                    $response[] = '$("' . $p['selector'] . '").val("' . escape_js($p['html']) . '")';
                }
            }
        }
        send_script_response(join(";\n", $response));
        // Bail out.
        return;
    }
    foreach ($partials as $k => $p) {
        if ($p['mode'] == PARTIAL_STATIC) {
            $cb = $p['cb'];
            $partials[$k]['html'] = is_array($cb) ? call_user_func($cb, $rs, $k) : $cb($rs, $k);
        }
    }
    $page_title = $ID ? $Title : gTxt('write');
    pagetop($page_title, $message);
    $class = array();
    if ($Status >= STATUS_LIVE) {
        $class[] = 'published';
    } elseif ($ID) {
        $class[] = 'saved';
    }
    if ($step !== 'create') {
        $class[] = 'async';
    }
    echo n . tag_start('form', array('class' => $class, 'id' => 'article_form', 'name' => 'article_form', 'method' => 'post', 'action' => 'index.php'));
    if (!empty($store_out)) {
        echo hInput('store', base64_encode(serialize($store_out)));
    }
开发者ID:ClaireBrione,项目名称:textpattern,代码行数:67,代码来源:txp_article.php


示例8: article_edit


//.........这里部分代码省略.........
        $textile_body = $use_textile;
        $textile_excerpt = $use_textile;
    }
    if ($step != 'create' && isset($sPosted)) {
        // Previous record?
        $rs['prev_id'] = checkIfNeighbour('prev', $sPosted);
        // Next record?
        $rs['next_id'] = checkIfNeighbour('next', $sPosted);
    } else {
        $rs['prev_id'] = $rs['next_id'] = 0;
    }
    // let plugins chime in on partials meta data
    callback_event_ref('article_ui', 'partials_meta', 0, $rs, $partials);
    $rs['partials_meta'] =& $partials;
    // get content for volatile partials
    foreach ($partials as $k => $p) {
        if ($p['mode'] == PARTIAL_VOLATILE || $p['mode'] == PARTIAL_VOLATILE_VALUE) {
            $cb = $p['cb'];
            $partials[$k]['html'] = is_array($cb) ? call_user_func($cb, $rs, $k) : $cb($rs, $k);
        }
    }
    if ($refresh_partials) {
        global $theme;
        $response[] = $theme->announce_async($message);
        // update the volatile partials
        foreach ($partials as $k => $p) {
            // volatile partials need a target DOM selector
            if (empty($p['selector']) && $p['mode'] != PARTIAL_STATIC) {
                trigger_error("Empty selector for partial '{$k}'", E_USER_ERROR);
            } else {
                // build response script
                if ($p['mode'] == PARTIAL_VOLATILE) {
                    // volatile partials replace *all* of the existing HTML fragment for their selector
                    $response[] = '$("' . $p['selector'] . '").replaceWith("' . escape_js($p['html']) . '")';
                } elseif ($p['mode'] == PARTIAL_VOLATILE_VALUE) {
                    // volatile partial values replace the *value* of elements matching their selector
                    $response[] = '$("' . $p['selector'] . '").val("' . escape_js($p['html']) . '")';
                }
            }
        }
        send_script_response(join(";\n", $response));
        // bail out
        return;
    }
    foreach ($partials as $k => $p) {
        if ($p['mode'] == PARTIAL_STATIC) {
            $cb = $p['cb'];
            $partials[$k]['html'] = is_array($cb) ? call_user_func($cb, $rs, $k) : $cb($rs, $k);
        }
    }
    $page_title = $Title ? $Title : gTxt('write');
    pagetop($page_title, $message);
    echo n . '<div id="' . $event . '_container" class="txp-container">';
    echo n . n . '<form id="article_form" name="article_form" method="post" action="index.php" ' . ($step == 'create' ? '>' : ' class="async">');
    if (!empty($store_out)) {
        echo hInput('store', base64_encode(serialize($store_out)));
    }
    echo hInput('ID', $ID) . n . eInput('article') . n . sInput($step) . n . hInput('sPosted', $sPosted) . n . hInput('sLastMod', $sLastMod) . n . hInput('AuthorID', $AuthorID) . n . hInput('LastModID', $LastModID) . '<input type="hidden" name="view" />' . startTable('', '', 'txp-columntable') . '<tr>' . n . '<td id="article-col-1"><div id="configuration_content">';
    if ($view == 'text') {
        //-- markup help --------------
        echo pluggable_ui('article_ui', 'sidehelp', side_help($textile_body, $textile_excerpt), $rs);
        //-- custom menu entries --------------
        echo pluggable_ui('article_ui', 'extend_col_1', '', $rs);
        //-- advanced --------------
        echo '<div id="advanced_group"><h3 class="lever' . (get_pref('pane_article_advanced_visible') ? ' expanded' : '') . '"><a href="#advanced">' . gTxt('advanced_options') . '</a></h3>' . '<div id="advanced" class="toggle" style="display:' . (get_pref('pane_article_advanced_visible') ? 'block' : 'none') . '">';
        // markup selection
开发者ID:bgarrels,项目名称:textpattern,代码行数:67,代码来源:txp_article.php


示例9: escape_js

      return false;
    }
    <?php 
// Remove the <colgroup>.  This is only needed to assist in the formatting
// of the non-datatable version of the table.   When we have a datatable,
// the datatable sorts out its own formatting.
?>
    table.find('colgroup').remove();
    
    <?php 
// Set up the default options
?>
    defaultOptions = {
      buttons: [{extend: 'colvis', 
                 text: '<?php 
echo escape_js(get_vocab("show_hide_columns"));
?>
'}],
      deferRender: true,
      paging: true,
      pageLength: 25,
      pagingType: 'full_numbers',
      processing: true,
      scrollCollapse: true,
      stateSave: true,
      dom: 'B<"clear">lfrtip',
      scrollX: '100%',
      colReorder: {}
    };
    
    <?php 
开发者ID:ailurus1991,项目名称:MRBS,代码行数:31,代码来源:datatables.js.php


示例10: escape_js

            if (preg_match("~{$search}~i", $row['address'])) {
                $descriptions[$row['id']] = escape_js(trans('Address:') . ' ' . $row['address']);
                continue;
            } else {
                if (preg_match("~{$search}~i", $row['post_name'])) {
                    $descriptions[$row['id']] = escape_js(trans('Name:') . ' ' . $row['post_name']);
                    continue;
                } else {
                    if (preg_match("~{$search}~i", $row['post_address'])) {
                        $descriptions[$row['id']] = escape_js(trans('Address:') . ' ' . $row['post_address']);
                        continue;
                    }
                }
            }
            if (preg_match("~{$search}~i", $row['email'])) {
                $descriptions[$row['id']] = escape_js(trans('E-mail:') . ' ' . $row['email']);
                continue;
            }
            $descriptions[$row['id']] = '';
        }
    }
    header('Content-type: text/plain');
    if ($eglible) {
        print "this.eligible = [\"" . implode('","', $eglible) . "\"];\n";
        print "this.descriptions = [\"" . implode('","', $descriptions) . "\"];\n";
        print "this.actions = [\"" . implode('","', $actions) . "\"];\n";
    } else {
        print "false;\n";
    }
    exit;
}
开发者ID:krzysztofpuchala,项目名称:lms-magazyn,代码行数:31,代码来源:quicksearch-supplier.php


示例11: escape_js

              return false;
            }
          }
        }
        <?php 
}
?>
      if ((thisValue > startValue) ||
          ((thisValue === startValue) && enablePeriods) ||
          (dateDifference !== 0))
      {
        optionClone = $(this).clone();
        if (dateDifference < 0)
        {
          optionClone.text('<?php 
echo escape_js(get_vocab("start_after_end"));
?>
');
        }
        else
        {
          optionClone.text($(this).text() + nbsp + nbsp +
                           '(' + getDuration(startValue, thisValue, dateDifference) +
                           ')');
        }
        endSelect.append(optionClone);
      }
    });
  
  endValue = Math.min(endValue, parseInt(endSelect.find('option').last().val(), 10));
  endSelect.val(endValue);
开发者ID:ailurus1991,项目名称:MRBS,代码行数:31,代码来源:edit_entry.js.php


示例12: function

      area_select.setAttribute('name', 'area');
      area_select.onchange = function(){changeRooms(this.form)}; // setAttribute doesn't work for onChange with IE6
      // populated with options
      var option;
      var option_text
      <?php 
    // go through the areas and create the options
    foreach ($areas as $a) {
        ?>
        option = document.createElement('option');
        option.value = <?php 
        echo $a['id'];
        ?>
;
        option_text = document.createTextNode('<?php 
        echo escape_js($a['area_name']);
        ?>
');
        <?php 
        if ($a['id'] == $area_id) {
            ?>
          option.selected = true;
          <?php 
        }
        ?>
        option.appendChild(option_text);
        area_select.appendChild(option);
        <?php 
    }
    ?>
      // insert the <select> which we've just assembled into the <div>
开发者ID:JeremyJacquemont,项目名称:SchoolProjects,代码行数:31,代码来源:edit_entry.php


示例13: update

 /**
  * Hooks to article saving process and updates short URLs
  */
 public static function update()
 {
     global $prefs;
     if (empty($prefs['rah_bitly_login']) || empty($prefs['rah_bitly_apikey']) || empty($prefs['rah_bitly_field'])) {
         return;
     }
     static $old = array();
     static $updated = false;
     $id = !empty($GLOBALS['ID']) ? $GLOBALS['ID'] : ps('ID');
     if (!$id || ps('_txp_token') != form_token() || intval(ps('Status')) < 4) {
         $old = array('permlink' => NULL, 'status' => NULL);
         return;
     }
     include_once txpath . '/publish/taghandlers.php';
     /*
     	Get the old article permlink before anything is saved
     */
     if (!$old) {
         $old = array('permlink' => permlinkurl_id($id), 'status' => fetch('Status', 'textpattern', 'ID', $id));
         return;
     }
     /*
     	Clear the permlink cache
     */
     unset($GLOBALS['permlinks'][$id]);
     /*
     	Generate a new if permlink has changed or if article is published
     */
     if (callback_event('rah_bitly.update') !== '') {
         return;
     }
     if ($updated == false && ($permlink = permlinkurl_id($id)) && ($old['permlink'] != $permlink || !ps('custom_' . $prefs['rah_bitly_field']) || $old['status'] != ps('Status'))) {
         $uri = self::fetch($permlink);
         if ($uri) {
             $fields = getCustomFields();
             if (!isset($fields[$prefs['rah_bitly_field']])) {
                 return;
             }
             safe_update('textpattern', 'custom_' . intval($prefs['rah_bitly_field']) . "='" . doSlash($uri) . "'", "ID='" . doSlash($id) . "'");
             $_POST['custom_' . $prefs['rah_bitly_field']] = $uri;
         }
         $updated = true;
     }
     if (!empty($uri)) {
         echo script_js('$(\'input[name="custom_' . $prefs['rah_bitly_field'] . '"]\').val("' . escape_js($uri) . '");');
     }
 }
开发者ID:rwetzlmayr,项目名称:rah_bitly,代码行数:50,代码来源:rah_bitly.php


示例14: header

    return $JSResponse;
}
$LMS->InitXajax();
$LMS->RegisterXajaxFunction(array('getGroupTableRow'));
$SMARTY->assign('xajax', $LMS->RunXajax());
if (isset($_GET['ajax'])) {
    header('Content-type: text/plain');
    $search = urldecode(trim($_GET['what']));
    $result = $DB->GetAll('SELECT id, name as item
                           FROM voip_prefix_groups
                           WHERE name ?LIKE? ?
                           LIMIT 20', array('%' . $search . '%'));
    $eglible = $descriptions = array();
    if ($result) {
        foreach ($result as $idx => $row) {
            $eglible[$row['item']] = escape_js($row['item']);
            $descriptions[$row['item']] = $row['id'] . ' :id';
        }
    }
    if ($eglible) {
        print "this.eligible = [\"" . implode('","', $eglible) . "\"];\n";
        print "this.descriptions = [\"" . implode('","', $descriptions) . "\"];\n";
    } else {
        print "false;\n";
    }
    exit;
}
$rule = isset($_POST['rule']) ? $_POST['rule'] : NULL;
$rule_id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
$error = array();
if (isset($_GET['action']) && $_GET['action'] == 'delete') {
开发者ID:prezeskk,项目名称:lms,代码行数:31,代码来源:voiptariffrules.php


示例15: escape_js

    // Check whether everything has finished
    ?>
                                    if (results.length >= nBatches)
                                    {
                                      $('#report_table_processing').css('visibility', 'hidden');
                                      <?php 
    // If all's gone well the result will contain the number of entries deleted
    ?>
                                      nDeleted = 0;
                                      isInt = /^\s*\d+\s*$/;
                                      for (i=0; i<results.length; i++)
                                      {
                                        if (!isInt.test(results[i]))
                                        {
                                          window.alert("<?php 
    echo escape_js(get_vocab('delete_entries_failed'));
    ?>
");
                                          break;
                                        }
                                        nDeleted += parseInt(results[i], 10);
                                      }
                                      <?php 
    // Reload the page to get the new dataset.   If we're using
    // an Ajax data source (for true Ajax data sources, not server
    // side processing) and there's no summary table we can be
    // slightly more elegant and just reload the Ajax data source.
    ?>
                                      oSettings = reportTable.fnSettings();
                                      if (oSettings.ajax && 
                                          !oSettings.bServerSide &&
开发者ID:ailurus1991,项目名称:MRBS,代码行数:31,代码来源:report.js.php


示例16: str_replace

$search = str_replace(' ', '%', $search);
$sql_search = $DB->Escape("%{$search}%");
if (isset($_GET['ajax'])) {
    $candidates = $DB->GetAll("SELECT s.id, s.productid, s.serialnumber, s.pricebuynet, s.pricebuygross, s.bdate,\n\t\t\t\t\t" . $DB->Concat('m.name', "' '", 'p.name') . " as name, p.ean\n\t\t\t\t\tFROM stck_stock s\n\t\t\t\t\tLEFT JOIN stck_products p ON p.id = s.productid\n\t\t\t\t\tLEFT JOIN stck_manufacturers m ON m.id = p.manufacturerid\n\t\t\t\t\tLEFT JOIN stck_warehouses w ON s.warehouseid = w.id\n\t\t\t\t\tWHERE s.leavedate = 0 AND\n\t\t\t\t\t(" . (preg_match('/^[0-9]+$/', $search) ? 's.productid = ' . intval($search) . ' OR ' : '') . "\n\t\t\t\t\tLOWER(" . $DB->Concat('m.name', "' '", 'p.name') . ") ?LIKE? LOWER(" . $sql_search . ")\n\t\t\t\t\tOR LOWER(p.ean) ?LIKE? LOWER(" . $sql_search . ")\n\t\t\t\t\tOR LOWER(s.serialnumber) ?LIKE? LOWER(" . $sql_search . "))\n\t\t\t\t\tAND w.commerce = 1\n\t\t\t\t\tORDER BY s.creationdate ASC, name\n\t\t\t\t\tLIMIT 15");
    $eglible = array();
    $actions = array();
    $descriptions = array();
    if ($candidates) {
        foreach ($candidates as $idx => $row) {
            $desc = $row['name'];
            if ($row['serialnumber']) {
                $desc = $desc . " (S/N: " . $row['serialnumber'] . ")";
            }
            //$actions[$row['id']] = 'javascript:pinv(\''.$row['id'].'\',\''.$row['pricebuynet'].'\',\''.$row['pricebuygross'].'\')';
            $actions[$row['id']] = '?m=stckproductinfo&id=' . $row['productid'];
            $eglible[$row['id']] = escape_js(($row['deleted'] ? '<font class="blend">' : '') . truncate_str($desc, 100) . ($row['deleted'] ? '</font>' : ''));
            $descriptions[$row['id']] = '<b>' . trans("Gross:") . " " . $row['pricebuygross'] . "</b> " . trans("Bought:") . " " . date("d/m/Y", $row['bdate']);
        }
    }
    header('Content-type: text/plain');
    if ($eglible) {
        print "this.eligible = [\"" . implode('","', $eglible) . "\"];\n";
        print "this.descriptions = [\"" . implode('","', $descriptions) . "\"];\n";
        print "this.actions = [\"" . implode('","', $actions) . "\"];\n";
    } else {
        print "false;\n";
    }
}
exit;
break;
开发者ID:krzysztofpuchala,项目名称:lms-magazyn,代码行数:30,代码来源:quicksearch-productprice.php


示例17: ON

					JOIN domains d ON (a.domainid = d.id)
					WHERE a.login ?LIKE? LOWER($username)
					".($domain ? "AND d.name ?LIKE? LOWER($domain)" : '').")
					ORDER BY login, domain
					LIMIT 15");

			$eglible=array(); $actions=array(); $descriptions=array();

			if ($candidates) foreach($candidates as $idx => $row)
			{
				if($row['type'])
					$actions[$row['id']] = '?m=aliasinfo&id='.$row['id'];
				else
					$actions[$row['id']] = '?m=accountinfo&id='.$row['id'];

				$eglible[$row['id']] = escape_js($row['login'].'@'.$row['domain']);
				$descriptions[$row['id']] = '';
			}
			header('Content-type: text/plain');
			if ($eglible) {
				print "this.eligible = [\"".implode('","',$eglible)."\"];\n";
				print "this.descriptions = [\"".implode('","',$descriptions)."\"];\n";
				print "this.actions = [\"".implode('","',$actions)."\"];\n";
			} else {
				print "false;\n";
			}
			exit;
		}

		$search = array();
		$search['login'] = $ac[0];
开发者ID:rzt,项目名称:lms,代码行数:31,代码来源:quicksearch.php


示例18: _announce

    private function _announce($thing, $async, $modal)
    {
        // $thing[0]: message text.
        // $thing[1]: message type, defaults to "success" unless empty or a different flag is set.
        if (!is_array($thing) || !isset($thing[1])) {
            $thing = array($thing, 0);
        }
        // Still nothing to say?
        if (trim($thing[0]) === '') {
            return '';
        }
        switch ($thing[1]) {
            case E_ERROR:
                $class = 'error';
                break;
            case E_WARNING:
                $class = 'warning';
                break;
            default:
                $class = 'success';
                break;
        }
        if ($modal) {
            $html = '';
            // TODO: Say what?
            $js = 'window.alert("' . escape_js(strip_tags($thing[0])) . '")';
        } else {
            $html = span(gTxt($thing[0]) . sp . href('&#215;', '#close', ' class="close" role="button" title="' . gTxt('close') . '" aria-label="' . gTxt('close') . '"'), array('class' => $class, 'id' => 'message', 'role' => 'alert'));
            // Try to inject $html into the message pane no matter when _announce()'s output is printed.
            $js = escape_js($html);
            $js = <<<EOS
                \$(document).ready(function () {
                    \$("#messagepane").html("{$js}");
                    \$('#message.success, #message.warning, #message.error').fadeOut('fast').fadeIn('fast');
                });
EOS;
        }
        if ($async) {
            return $js;
        } else {
            return script_js(str_replace('</', '<\\/', $js), $html);
        }
    }
开发者ID:hcgtv,项目名称:textpattern,代码行数:43,代码来源:classic.php


示例19: escape_js

						case DOC_INVOICE:
							$actions[$row['id']] = '?m=invoice&id=' . $row['id'];
							break;
						case DOC_RECEIPT:
							$actions[$row['id']] = '?m=receipt&id=' . $row['id'];
							break;
						case DOC_CNOTE:
							$actions[$row['id']] = '?m=note&id=' . $row['id'];
							break;
						default:
							$actions[$row['id']] = '?m=documentview&id=' . $row['id'];
					}
*/
					$actions[$row['id']] = '?m=customerinfo&id=' . $row['cid'];
					$eglible[$row['id']] = escape_js($row['fullnumber']);
					$descriptions[$row['id']] = escape_js(truncate_str($row['customername'], 35));
					//$descriptions[$row['id']] = trans('Document id:') . ' ' . $row['id'];
				}
			header('Content-type: text/plain');
			if ($eglible) {
				print "this.eligible = [\"".implode('","',$eglible)."\"];\n";
				print "this.descriptions = [\"".implode('","',$descriptions)."\"];\n";
				print "this.actions = [\"".implode('","',$actions)."\"];\n";
			} else {
				print "false;\n";
			}
                        $SESSION->close();
                        $DB->Destroy();
			exit;
		}
开发者ID:askipl,项目名称:lms,代码行数:30,代码来源:quicksearch.php


示例20: ON

    }
    $list = $DB->GetAll('SELECT c.id, c.name,
			b.name AS borough, b.type AS btype,
			d.name AS district, d.id AS districtid,
			s.name AS state, s.id AS stateid
		FROM location_cities c
		JOIN location_boroughs b ON (c.boroughid = b.id)
		JOIN location_districts d ON (b.districtid = d.id)
		JOIN location_states s ON (d.stateid = s.id)
		WHERE c.name ?LIKE? ' . $DB->Escape("%{$search}%") . '
		ORDER BY c.name, b.type LIMIT 10');
    $eligible = $actions = array();
    if ($list) {
        foreach ($list as $idx => $row) {
            $name = sprintf('%s (%s%s, %s)', $row['name'], $row['btype'] < 4 ? trans('<!borough_abbr>') : '', $row['borough'], trans('<!district_abbr>') . $row['district']);
            $eligible[$idx] = escape_js($name);
            $actions[$idx] = sprintf("javascript: search_update(%d,%d,%d)", $row['id'], $row['districtid'], $row['stateid']);
        }
    }
    if ($eligible) {
        print "this.eligible = [\"" . implode('"," 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP escape_once函数代码示例发布时间:2022-05-15
下一篇:
PHP escape_javascript函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap