$33 GRAYBYTE WORDPRESS FILE MANAGER $43

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.217.254 | ADMIN IP 216.73.216.23
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/home/bravrvjk/itiministry.org/wp-content/plugins/give/src/DonorDashboards/

HOME
Current File : /home/bravrvjk/itiministry.org/wp-content/plugins/give/src/DonorDashboards//App.php
<?php

namespace Give\DonorDashboards;

use Give\DonorDashboards\Helpers\LocationList;
use Give\Helpers\EnqueueScript;

/**
 * Class App
 * @package Give\DonorDashboards
 *
 * @since 2.10.2
 */
class App
{
    /**
     * @var Profile
     */
    protected $profile;

    /**
     * App constructor.
     */
    public function __construct()
    {
        $this->profile = new Profile();
    }

    /**
     * @since 3.6.0 Escape attributes
     *
     * @param array $attributes
     *
     * @return string
     */
    public function getOutput($attributes)
    {
        $url = get_site_url() . '/?give-embed=donor-dashboard';

        $queryArgs = [];

        if (isset($attributes['accent_color'])) {
            $queryArgs['accent-color'] = urlencode(esc_attr($attributes['accent_color']));
        }

        if (isset($_GET['give_nl'])) {
            $queryArgs['give_nl'] = urlencode(give_clean($_GET['give_nl']));
        }

        if (isset($_GET['_give_hash'])) {
            $queryArgs['_give_hash'] = urlencode(give_clean($_GET['_give_hash']));
        }

        if (isset($_GET['action'])) {
            $queryArgs['action'] = urlencode(give_clean($_GET['action']));
        }

        $url = esc_url(add_query_arg($queryArgs, $url));

        $loader = $this->getIframeLoader(esc_attr($attributes['accent_color']));

        return sprintf(
            '<div style="position: relative; max-width: 100%%;"><iframe
				name="give-embed-donor-profile"
				%1$s
				%4$s
				data-autoScroll="%2$s"
				onload="if( \'undefined\' !== typeof Give ) { Give.initializeIframeResize(this) }"
				style="border: 0;visibility: hidden;%3$s"></iframe>%5$s</div>',
            "src=\"{$url}#/dashboard\"",
            true,
            'min-height: 776px; width: 100%; max-width: 100% !important;',
            '',
            $loader
        );
    }

    /**
     * Get output markup for Donor Dashboard app
     *
     * @since 2.10.0
     *
     * @param string $accentColor
     *
     * @return string
     */
    public function getIframeLoader($accentColor)
    {
        ob_start();

        require $this->getLoaderTemplatePath();

        return ob_get_clean();
    }

    /**
     * Get output markup for Donor Dashboard app
     *
     * @since 2.10.0
     * @return string
     */
    public function getIframeContent()
    {
        ob_start();

        require $this->getTemplatePath();

        return ob_get_clean();
    }

    /**
     * Get template path for Donor Dashboard component template
     * @since 2.10.0
     **/
    public function getTemplatePath()
    {
        return GIVE_PLUGIN_DIR . '/src/DonorDashboards/resources/views/donordashboard.php';
    }

    /**
     * Get template path for Donor Dashboard component template
     * @since 2.10.0
     **/
    public function getLoaderTemplatePath()
    {
        return GIVE_PLUGIN_DIR . '/src/DonorDashboards/resources/views/donordashboardloader.php';
    }

    /**
     * Enqueue assets for front-end donor dashboards
     *
     * @since 3.19.0 Add action to allow enqueueing additional assets.
     * @since      2.11.0 Set script translations.
     * @since 2.10.0
     *
     * @return void
     */
    public function loadAssets()
    {
        // Load assets only if rendering donor dashboard.
        if (!isset($_GET['give-embed']) || 'donor-dashboard' !== $_GET['give-embed']) {
            return;
        }

        $recaptcha_key = give_get_option('recaptcha_key');
        $recaptcha_secret = give_get_option('recaptcha_secret');
        $recaptcha_enabled = (give_is_setting_enabled(give_get_option('enable_recaptcha'))) &&
            !empty($recaptcha_key) && !empty($recaptcha_secret);

        $data = [
            'apiRoot' => esc_url_raw(rest_url()),
            'apiNonce' => wp_create_nonce('wp_rest'),
            'profile' => give()->donorDashboard->getProfileData(),
            'countries' => LocationList::getCountries(),
            'states' => LocationList::getStates(give()->donorDashboard->getCountry()),
            'id' => give()->donorDashboard->getId(),
            'emailAccessEnabled' => give_is_setting_enabled(give_get_option('email_access')),
            'loginEnabled' => $this->loginEnabled(),
            'registeredTabs' => give()->donorDashboardTabs->getRegisteredIds(),
            'loggedInWithoutDonor' => get_current_user_id() !== 0 && give()->donorDashboard->getId() === null,
            'recaptchaKey' => $recaptcha_enabled ? $recaptcha_key : '',
        ];

        EnqueueScript::make(
            'give-donor-dashboards-app',
            'build/assets/dist/js/donor-dashboards-app.js'
        )
            ->loadInFooter()
            ->registerTranslations()
            ->registerLocalizeData('giveDonorDashboardData', $data)
            ->enqueue();

        wp_enqueue_style(
            'give-google-font-montserrat',
            'https://fonts.googleapis.com/css?family=Montserrat:500,500i,600,600i,700,700i&display=swap',
            [],
            null
        );

        do_action('give_donor_dashboard_enqueue_assets');
    }

    /**
     * Determine if the login should be enabled.
     *
     * @since 2.15.0
     *
     * @return bool
     */
    protected function loginEnabled()
    {
        // We need to get all the form IDs.
        $formIds = get_posts(
            [
                'fields' => 'ids',
                'numberposts' => -1,
                'post_status' => 'publish',
                'post_type' => 'give_forms',
            ]
        );

        // By default, the login is disabled.
        $loginEnabled = false;
        foreach ($formIds as $formId) {
            if (give_show_login_register_option($formId) !== 'none') {
                // Once there is a single form that it is enabled, we can bail out
                // early since the login needs to be enabled.
                $loginEnabled = true;
                break;
            }
        }

        return $loginEnabled;
    }
}


Current_dir [ WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
4 Apr 2026 1.57 AM
bravrvjk / bravrvjk
0755
Admin
--
4 Apr 2026 1.57 AM
bravrvjk / bravrvjk
0755
Exceptions
--
4 Apr 2026 1.57 AM
bravrvjk / bravrvjk
0755
Factories
--
4 Apr 2026 1.57 AM
bravrvjk / bravrvjk
0755
Helpers
--
4 Apr 2026 1.57 AM
bravrvjk / bravrvjk
0755
Pipeline
--
4 Apr 2026 1.57 AM
bravrvjk / bravrvjk
0755
Repositories
--
4 Apr 2026 1.57 AM
bravrvjk / bravrvjk
0755
Routes
--
4 Apr 2026 1.57 AM
bravrvjk / bravrvjk
0755
Tabs
--
4 Apr 2026 1.57 AM
bravrvjk / bravrvjk
0755
resources
--
4 Apr 2026 1.57 AM
bravrvjk / bravrvjk
0755
App.php
5.841 KB
31 Mar 2025 11.17 PM
bravrvjk / bravrvjk
0644
Block.php
2.375 KB
31 Mar 2025 11.17 PM
bravrvjk / bravrvjk
0644
Helpers.php
1.763 KB
11 Jun 2025 10.57 PM
bravrvjk / bravrvjk
0644
Profile.php
5.513 KB
3 Feb 2025 8.13 PM
bravrvjk / bravrvjk
0644
RequestHandler.php
3.747 KB
28 Jan 2026 8.00 PM
bravrvjk / bravrvjk
0644
ServiceProvider.php
2.931 KB
11 Jan 2024 12.22 AM
bravrvjk / bravrvjk
0644
Shortcode.php
1.228 KB
14 Mar 2024 1.54 AM
bravrvjk / bravrvjk
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF