!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/node-red/node_modules/jsdoc/lib/jsdoc/   drwxr-xr-x
Free 13.13 GB of 57.97 GB (22.66%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     template.js (2.27 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/**
 * Wrapper for underscore's template utility to allow loading templates from files.
 * @module jsdoc/template
 */
const _ = require('underscore');
const fs = require('jsdoc/fs');
const path = require('path');

/**
 * Underscore template helper.
 */
class Template {
    /**
     * @param {string} filepath - Templates directory.
     */
    constructor(filepath) {
        this.path = filepath;
        this.layout = null;
        this.cache = {};
        // override default template tag settings
        this.settings = {
            evaluate: /<\?js([\s\S]+?)\?>/g,
            interpolate: /<\?js=([\s\S]+?)\?>/g,
            escape: /<\?js~([\s\S]+?)\?>/g
        };
    }

    /**
     * Loads template from given file.
     * @param {string} file - Template filename.
     * @return {function} Returns template closure.
     */
    load(file) {
        return _.template(fs.readFileSync(file, 'utf8'), null, this.settings);
    }

    /**
     * Renders template using given data.
     *
     * This is low-level function, for rendering full templates use {@link Template.render()}.
     *
     * @param {string} file - Template filename.
     * @param {object} data - Template variables (doesn't have to be object, but passing variables dictionary is best way and most common use).
     * @return {string} Rendered template.
     */
    partial(file, data) {
        file = path.resolve(this.path, file);

        // load template into cache
        if (!(file in this.cache)) {
            this.cache[file] = this.load(file);
        }

        // keep template helper context
        return this.cache[file].call(this, data);
    }

    /**
     * Renders template with given data.
     *
     * This method automaticaly applies layout if set.
     *
     * @param {string} file - Template filename.
     * @param {object} data - Template variables (doesn't have to be object, but passing variables dictionary is best way and most common use).
     * @return {string} Rendered template.
     */
    render(file, data) {
        // main content
        let content = this.partial(file, data);

        // apply layout
        if (this.layout) {
            data.content = content;
            content = this.partial(this.layout, data);
        }

        return content;
    }
}
exports.Template = Template;

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0198 ]--