MMCT TEAM
Server IP : 192.185.129.71  /  Your IP : 3.128.181.81
Web Server : Apache
System : Linux bh-ht-3.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : svymadmin ( 4072)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home4/svymadmin/public_html/vivekaexcel.edu.in/bkp/application/libraries/assets/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home4/svymadmin/public_html/vivekaexcel.edu.in/bkp/application/libraries/assets/App_scripts.php
<?php

defined('BASEPATH') or exit('No direct script access allowed');

include_once(__DIR__ . '/App_assets.php');

class App_scripts extends App_assets
{
    public function add($name, $data, $group = 'admin', $deps = [])
    {
        if (isset($this->registered[$group][$name])) {
            return false;
        }

        $this->initializeEmptyGroup($group);

        if (is_string($data)) {
            $data = ['path' => $data];
        }

        if (!isset($data['deps'])) {
            $data['deps'] = $deps;
        }

        $this->registered[$group][$name] = $data;

        return true;
    }

    public function get($group = 'admin')
    {
        return $group === null ? $this->registered[$group] : $this->registered;
    }

    public function compile($group = 'admin')
    {
        $html = '';

        $defaults = [
            'type' => 'text/javascript',
        ];

        hooks()->do_action('before_compile_scripts_assets', $group);

        $items = $this->do_items(array_keys($this->registered[$group]), $group);

        foreach ($items as $id => $data) {
            $attributes = $defaults;

            /**
             * Set id key for the attributes
             */
            $attributes['id'] = $id;

            /**
             * Check if versioning is set
             * @var boolean
             */
            $version = isset($data['version']) ? $data['version'] : true;

            /**
            * Compile the URL
            */
            $attributes['src'] = $this->compileUrl($data['path'], $version);

            /**
            * Finally build the <script> for JS file
            */

            $html .= '<script' . $this->attributesToString($id, $attributes, $data) . '></script>' . PHP_EOL;
        }

        return $html;
    }

    /**
     * @deprecated 2.3.0
     */
    public function coreScript($path, $fileName)
    {
        if (get_option('use_minified_files') == 1) {
            $fileName = $this->getMinifiedFileName($fileName, $path);
        }

        $ver = ENVIRONMENT == 'development' ? time() : get_app_version();

        return '<script src="' . base_url($path . '/' . $fileName . '?v=' . $ver) . '"></script>' . PHP_EOL;
    }
}

MMCT - 2023