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


PHP addslashes_js函数代码示例

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


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

示例1: m4a_filter_callback

function m4a_filter_callback($link)
{
    global $CFG;
    $ret = '';
    static $count = 0;
    $count++;
    if ($count === 1) {
        $ret .= '<script type="text/javascript" src="' . $CFG->wwwroot . '/filter/m4a/flowplayer-3.1.4.min.js"></script>';
    }
    $id = 'filter_flv_' . time() . $count;
    //we need something unique because it might be stored in text cache
    $url = addslashes_js($link[1]);
    $ret .= '   <a href="#" style="display:block;width:400px;height:20px" id="' . $id . '"></a>
                <script>
                    flowplayer("' . $id . '", "' . $CFG->wwwroot . '/filter/m4a/flowplayer-3.1.5.swf", {
                        clip: {
                            url: "' . $url . '",
                            autoBuffering: true,
                            autoPlay: false
                        },
                        plugins: {
                            controls: {
                                fullscreen: false,
                                height: 20
                            }
                        }
                    });
                </script>';
    return $ret;
}
开发者ID:ndunand,项目名称:moodle-filter_m4a,代码行数:30,代码来源:filter.php

示例2: print_textarea

function print_textarea($usehtmleditor, $rows, $cols, $width, $height, $name, $value = '', $courseid = 0, $return = false, $id = '')
{
    global $CFG, $COURSE, $HTTPSPAGEREQUIRED;
    $str = '';
    if ($id === '') {
        $id = 'edit-' . $name;
    }
    if (empty($courseid)) {
        $courseid = $COURSE->id;
    }
    if ($usehtmleditor) {
        $str .= '<textarea class="form-textarea" id="' . $id . '" name="' . $name . '" rows="' . $rows . '" cols="' . $cols . '">';
        $str .= htmlspecialchars($value);
        $str .= '</textarea><br />' . "\n";
        $toggle_ed = '<img width="50" height="17" src="' . $CFG->wwwroot . '/lib/editor/tinymce/images/toggle.gif" alt="' . get_string('toggleeditor', 'editor') . '" title="' . get_string('toggleeditor', 'editor') . '" />';
        $str .= "<a href=\"javascript:toggleEditor('" . $id . "');\">" . $toggle_ed . "</a> ";
        $str .= '<script type="text/javascript">
            document.write(\'' . addslashes_js(editorshortcutshelpbutton()) . '\');
        </script>';
    } else {
        $str .= '<textarea class="alltext" id="' . $id . '" name="' . $name . '" rows="' . $rows . '" cols="' . $cols . '">';
        $str .= s($value);
        $str .= '</textarea>' . "\n";
    }
    if ($return) {
        return $str;
    }
    echo $str;
}
开发者ID:nadavkav,项目名称:MoodleTAO,代码行数:29,代码来源:meta.php

示例3: block_exabis_eportfolio_print_extern_item

function block_exabis_eportfolio_print_extern_item($item, $access)
{
    global $CFG;
    print_heading(format_string($item->name));
    $box_content = '';
    if ($item->type == 'link') {
        $link = clean_param($item->url, PARAM_URL);
        $link_js = str_replace('http://', '', $link);
        if ($link) {
            $box_content .= '<p><a href="#" onclick="window.open(\'http://' . addslashes_js($link_js) . '\',\'validate\',\'width=620,height=450,scrollbars=yes,status=yes,resizable=yes,menubar=yes,location=yes\');return true;">' . $link . '</a></p>';
        }
    } elseif ($item->type == 'file') {
        if ($item->attachment) {
            $type = mimeinfo("type", $item->attachment);
            $ffurl = "{$CFG->wwwroot}/blocks/exabis_eportfolio/portfoliofile.php?access=" . $access . "&itemid=" . $item->id;
            if (in_array($type, array('image/gif', 'image/jpeg', 'image/png'))) {
                // Image attachments don't get printed as links
                $box_content .= "<img width=\"100%\" src=\"{$ffurl}\" alt=\"" . format_string($item->name) . "\" /><br/>";
            } else {
                $box_content .= "<p>" . link_to_popup_window("{$ffurl}", 'popup', "{$ffurl}", $height = 400, $width = 500, format_string($item->name), 'none', true) . "</p>";
            }
        }
    }
    $box_content .= format_text($item->intro, FORMAT_HTML);
    print_box($box_content);
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:26,代码来源:externlib.php

示例4: question_plugin_filter_callback

function question_plugin_filter_callback($link)
{
    global $CFG;
    static $count = 0;
    $count++;
    $id = 'filter_question_' . time() . $count;
    //we need something unique because it might be stored in text cache
    $url = addslashes_js($link[1]);
    return $link[0] . '<iframe id=' . $id . ' src="' . $url . '" width="60%"></iframe>';
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:10,代码来源:filter.php

示例5: print_js_data

function print_js_data($typename, $datarow, $number)
{
    echo $typename . 's[' . ($number - 1) . '] = new ' . $typename . '(';
    $firstitem = false;
    foreach ($datarow as $name => $value) {
        if ($firstitem) {
            echo ', ';
        }
        $firstitem = true;
        echo "'" . addslashes_js($value) . "'";
    }
    echo ");\n";
}
开发者ID:0hyeah,项目名称:yurivn,代码行数:13,代码来源:functions_external.php

示例6: scorm_get_resources

function scorm_get_resources($blocks) {
    $resources = array();
    foreach ($blocks as $block) {
        if ($block['name'] == 'RESOURCES' && isset($block['children'])) {
            foreach ($block['children'] as $resource) {
                if ($resource['name'] == 'RESOURCE') {
                    $resources[addslashes_js($resource['attrs']['IDENTIFIER'])] = $resource['attrs'];
                }
            }
        }
    }
    return $resources;
}
开发者ID:numbas,项目名称:moodle,代码行数:13,代码来源:scormlib.php

示例7: toHtml

    function toHtml()
    {
        if ($this->_flagFrozen) {
            return $this->getFrozenHtml();
        } else {
            $id = $this->getAttribute('id');
            $unmask = get_string('unmaskpassword', 'form');
            $unmaskjs = '<script type="text/javascript">
//<![CDATA[
document.write(\'<div class="unmask"><input id="' . $id . 'unmask" value="1" type="checkbox" onclick="unmaskPassword(\\\'' . $id . '\\\')"/><label for="' . $id . 'unmask">' . addslashes_js($unmask) . '<\\/label><\\/div>\');
//]]>
</script>';
            return $this->_getTabs() . '<input' . $this->_getAttrString($this->_attributes) . ' />' . $unmaskjs;
        }
    }
开发者ID:r007,项目名称:PMoodle,代码行数:15,代码来源:passwordunmask.php

示例8: wrap_html_start

 function wrap_html_start()
 {
     if (!$this->is_downloading()) {
         if ($this->candelete) {
             // Start form
             $strreallydel = addslashes_js(get_string('deleteattemptcheck', 'quiz'));
             echo '<div id="tablecontainer">';
             echo '<form id="attemptsform" method="post" action="' . $this->reporturl->out(true) . '" onsubmit="confirm(\'' . $strreallydel . '\');">';
             echo '<div style="display: none;">';
             echo $this->reporturl->hidden_params_out(array(), 0, $this->displayoptions);
             echo '</div>';
             echo '<div>';
         }
     }
 }
开发者ID:ajv,项目名称:Offline-Caching,代码行数:15,代码来源:responses_table.php

示例9: toHtml

    function toHtml()
    {
        if ($this->_flagFrozen) {
            return $this->getFrozenHtml();
        } else {
            $id = $this->getAttribute('id');
            $reveal = get_string('revealpassword', 'form');
            $revealjs = '<script type="text/javascript">
//<![CDATA[
document.write(\'<div class="reveal"><input id="' . $id . 'reveal" value="1" type="checkbox" onclick="revealPassword(\\\'' . $id . '\\\')"/><label for="' . $id . 'reveal">' . addslashes_js($reveal) . '<\\/label><\\/div>\');
document.getElementById("' . $this->getAttribute('id') . '").setAttribute("autocomplete", "off");
//]]>
</script>';
            return $this->_getTabs() . '<input' . $this->_getAttrString($this->_attributes) . ' />' . $revealjs;
        }
    }
开发者ID:veritech,项目名称:pare-project,代码行数:16,代码来源:passwordreveal.php

示例10: wrap_html_start

 function wrap_html_start()
 {
     if (!$this->is_downloading()) {
         if ($this->candelete) {
             // Start form
             $displayurl = new moodle_url($this->reporturl, $this->displayoptions);
             $strreallydel = addslashes_js(get_string('deleteattemptcheck', 'quiz'));
             echo '<div id="tablecontainer">';
             echo '<form id="attemptsform" method="post" action="' . $displayurl->out_omit_querystring() . '" onsubmit="confirm(\'' . $strreallydel . '\');">';
             echo '<div style="display: none;">';
             echo html_writer::input_hidden_params($displayurl);
             echo html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'sesskey', 'value' => sesskey())) . "\n";
             echo '</div>';
             echo '<div>';
         }
     }
 }
开发者ID:vuchannguyen,项目名称:web,代码行数:17,代码来源:responses_table.php

示例11: wrap_html_finish

 function wrap_html_finish()
 {
     if (!$this->is_downloading()) {
         // Print "Select all" etc.
         if ($this->candelete) {
             $strreallydel = addslashes_js(get_string('deleteattemptcheck', 'quiz'));
             echo '<div id="commands">';
             echo '<a href="javascript:select_all_in(\'DIV\',null,\'tablecontainer\');">' . get_string('selectall', 'quiz') . '</a> / ';
             echo '<a href="javascript:deselect_all_in(\'DIV\',null,\'tablecontainer\');">' . get_string('selectnone', 'quiz') . '</a> ';
             echo '&nbsp;&nbsp;';
             echo '<input type="submit" onclick="return confirm(\'' . $strreallydel . '\');" name="delete" value="' . get_string('deleteselected', 'quiz_overview') . '"/>';
             echo '</div>';
             // Close form
             echo '</div>';
             echo '</form></div>';
         }
     }
 }
开发者ID:esyacelga,项目名称:sisadmaca,代码行数:18,代码来源:responses_table.php

示例12: toHtml

    function toHtml()
    {
        if ($this->_flagFrozen) {
            return $this->getFrozenHtml();
        } else {
            $id = $this->getAttribute('id');
            $unmask = get_string('unmaskpassword', 'form');
            $unmaskjs = '<script type="text/javascript">
//<![CDATA[

var is_ie = (navigator.userAgent.toLowerCase().indexOf("msie") != -1);

document.getElementById("' . $id . '").setAttribute("autocomplete", "off");

var unmaskdiv = document.getElementById("' . $id . 'unmaskdiv");

var unmaskchb = document.createElement("input");
unmaskchb.setAttribute("type", "checkbox");
unmaskchb.setAttribute("id", "' . $id . 'unmask");
unmaskchb.onchange = function() {unmaskPassword("' . $id . '");};
unmaskdiv.appendChild(unmaskchb);

var unmasklbl = document.createElement("label");
unmasklbl.innerHTML = "' . addslashes_js($unmask) . '";
if (is_ie) {
  unmasklbl.setAttribute("htmlFor", "' . $id . 'unmask");
} else {
  unmasklbl.setAttribute("for", "' . $id . 'unmask");
}
unmaskdiv.appendChild(unmasklbl);

if (is_ie) {
  // ugly hack to work around the famous onchange IE bug
  unmaskchb.onclick = function() {this.blur();};
  unmaskdiv.onclick = function() {this.blur();};
}
//]]>
</script>';
            return $this->_getTabs() . '<input' . $this->_getAttrString($this->_attributes) . ' /><div class="unmask" id="' . $id . 'unmaskdiv"></div>' . $unmaskjs;
        }
    }
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:41,代码来源:passwordunmask.php

示例13: array

 }
 $postbit_obj->cachable = $post_cachable;
 $post['postcount'] = ++$postcount;
 $post['attachments'] = $postattach['byattachment'];
 $post['allattachments'] = $postattach['bycontent'][$post['postid']];
 $parsed_postcache = array('text' => '', 'images' => 1);
 $bgclass = 'alt2';
 if ($threadedmode == 2) {
     $postbits .= $postbit_obj->construct_postbit($post);
 } else {
     $postbit = $postbit_obj->construct_postbit($post);
     if ($curpostid == $post['postid']) {
         $curpostdateline = $post['dateline'];
         $curpostbit = $postbit;
     }
     $postbit = preg_replace('#</script>#i', "<\\/scr' + 'ipt>", addslashes_js($postbit));
     $jspostbits .= "pd[{$post['postid']}] = '{$postbit}';\n";
 }
 // end threaded mode
 if ($post_cachable and $post['pagetext_html'] == '') {
     if (!empty($saveparsed)) {
         $saveparsed .= ',';
     }
     $saveparsed .= "({$post['postid']}, " . intval($thread['lastpost']) . ', ' . intval($postbit_obj->post_cache['has_images']) . ", '" . $db->escape_string($postbit_obj->post_cache['text']) . "'," . intval(STYLEID) . ", " . intval(LANGUAGEID) . ")";
 }
 if ($sigs_cachable and !empty($postbit_obj->sig_cache) and $post['userid']) {
     if (!empty($save_parsed_sigs)) {
         $save_parsed_sigs .= ',';
     }
     $save_parsed_sigs .= "({$post['userid']}, " . intval(STYLEID) . ", " . intval(LANGUAGEID) . ", '" . $db->escape_string($postbit_obj->sig_cache['text']) . "', " . intval($postbit_obj->sig_cache['has_images']) . ")";
 }
开发者ID:0hyeah,项目名称:yurivn,代码行数:31,代码来源:showthread.php

示例14: addslashes_js

    $userdata->score_raw = '';
}
$userdata->student_id = addslashes_js($USER->username);
$userdata->student_name = addslashes_js($USER->lastname .', '. $USER->firstname);
$userdata->mode = 'normal';
if (!empty($mode)) {
    $userdata->mode = $mode;
}
if ($userdata->mode == 'normal') {
    $userdata->credit = 'credit';
} else {
    $userdata->credit = 'no-credit';
}
if ($scodatas = scorm_get_sco($scoid, SCO_DATA)) {
    foreach ($scodatas as $key => $value) {
        $userdata->$key = addslashes_js($value);
    }
} else {
    print_error('cannotfindsco', 'scorm');
}
if (!$sco = scorm_get_sco($scoid)) {
    print_error('cannotfindsco', 'scorm');
}
if (scorm_version_check($scorm->version, SCORM_13)) {
    $objectives = $DB->get_records('scorm_seq_objective', array('scoid' => $scoid));
    $index = 0;
    foreach ($objectives as $objective) {
        if (!empty($objective->minnormalizedmeasure)) {
            $userdata->{'cmi.scaled_passing_score'} = $objective->minnormalizedmeasure;
        }
        if (!empty($objective->objectiveid)) {
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:31,代码来源:loaddatamodel.php

示例15: output_html

    /**
     * Returns XHTML for the field
     * Writes Javascript into the HTML below right before the last div
     *
     * @todo Make javascript available through newer methods if possible
     * @param string $data Value for the field
     * @param string $query Passed as final argument for format_admin_setting
     * @return string XHTML field
     */
    public function output_html($data, $query = '')
    {
        $id = $this->get_id();
        $unmask = get_string('unmaskpassword', 'form');
        $unmaskjs = '<script type="text/javascript">
//<![CDATA[
var is_ie = (navigator.userAgent.toLowerCase().indexOf("msie") != -1);

document.getElementById("' . $id . '").setAttribute("autocomplete", "off");

var unmaskdiv = document.getElementById("' . $id . 'unmaskdiv");

var unmaskchb = document.createElement("input");
unmaskchb.setAttribute("type", "checkbox");
unmaskchb.setAttribute("id", "' . $id . 'unmask");
unmaskchb.onchange = function() {unmaskPassword("' . $id . '");};
unmaskdiv.appendChild(unmaskchb);

var unmasklbl = document.createElement("label");
unmasklbl.innerHTML = "' . addslashes_js($unmask) . '";
if (is_ie) {
  unmasklbl.setAttribute("htmlFor", "' . $id . 'unmask");
} else {
  unmasklbl.setAttribute("for", "' . $id . 'unmask");
}
unmaskdiv.appendChild(unmasklbl);

if (is_ie) {
  // ugly hack to work around the famous onchange IE bug
  unmaskchb.onclick = function() {this.blur();};
  unmaskdiv.onclick = function() {this.blur();};
}
//]]>
</script>';
        return format_admin_setting($this, $this->visiblename, '<div class="form-password"><input type="password" size="' . $this->size . '" id="' . $id . '" name="' . $this->get_full_name() . '" value="' . s($data) . '" /><div class="unmask" id="' . $id . 'unmaskdiv"></div>' . $unmaskjs . '</div>', $this->description, true, '', NULL, $query);
    }
开发者ID:raymondAntonio,项目名称:moodle,代码行数:45,代码来源:adminlib.php


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