8889841cSecurity/Kses.php 0000644 00000022755 15051312625 0010004 0 ustar 00 array(),
'a' => array(
'href' => true,
'rel' => true,
'rev' => true,
'name' => true,
'target' => true,
'download' => array(
'valueless' => 'y',
),
),
'abbr' => array(),
'acronym' => array(),
'area' => array(
'alt' => true,
'coords' => true,
'href' => true,
'nohref' => true,
'shape' => true,
'target' => true,
),
'article' => array(
'align' => true,
),
'aside' => array(
'align' => true,
),
'audio' => array(
'autoplay' => true,
'controls' => true,
'loop' => true,
'muted' => true,
'preload' => true,
'src' => true,
),
'b' => array(),
'bdo' => array(),
'big' => array(),
'blockquote' => array(
'cite' => true,
),
'br' => array(),
'button' => array(
'disabled' => true,
'name' => true,
'type' => true,
'value' => true,
),
'caption' => array(
'align' => true,
),
'cite' => array(),
'code' => array(),
'col' => array(
'align' => true,
'char' => true,
'charoff' => true,
'span' => true,
'valign' => true,
'width' => true,
),
'colgroup' => array(
'align' => true,
'char' => true,
'charoff' => true,
'span' => true,
'valign' => true,
'width' => true,
),
'del' => array(
'datetime' => true,
),
'dd' => array(),
'dfn' => array(),
'details' => array(
'align' => true,
'open' => true,
),
'div' => array(
'align' => true,
),
'dl' => array(),
'dt' => array(),
'em' => array(),
'fieldset' => array(),
'figure' => array(
'align' => true,
),
'figcaption' => array(
'align' => true,
),
'font' => array(
'color' => true,
'face' => true,
'size' => true,
),
'footer' => array(
'align' => true,
),
'h1' => array(
'align' => true,
),
'h2' => array(
'align' => true,
),
'h3' => array(
'align' => true,
),
'h4' => array(
'align' => true,
),
'h5' => array(
'align' => true,
),
'h6' => array(
'align' => true,
),
'header' => array(
'align' => true,
),
'hgroup' => array(
'align' => true,
),
'hr' => array(
'align' => true,
'noshade' => true,
'size' => true,
'width' => true,
),
'i' => array(),
'img' => array(
'alt' => true,
'align' => true,
'border' => true,
'height' => true,
'hspace' => true,
'loading' => true,
'longdesc' => true,
'vspace' => true,
'src' => true,
'usemap' => true,
'width' => true,
),
'ins' => array(
'datetime' => true,
'cite' => true,
),
'kbd' => array(),
'label' => array(
'for' => true,
),
'legend' => array(
'align' => true,
),
'li' => array(
'align' => true,
'value' => true,
),
'main' => array(
'align' => true,
),
'map' => array(
'name' => true,
),
'mark' => array(),
'menu' => array(
'type' => true,
),
'nav' => array(
'align' => true,
),
'object' => array(
'data' => array(
'required' => true,
'value_callback' => '_wp_kses_allow_pdf_objects',
),
'type' => array(
'required' => true,
'values' => array('application/pdf'),
),
),
'p' => array(
'align' => true,
),
'pre' => array(
'width' => true,
),
'q' => array(
'cite' => true,
),
'rb' => array(),
'rp' => array(),
'rt' => array(),
'rtc' => array(),
'ruby' => array(),
's' => array(),
'samp' => array(),
'span' => array(
'align' => true,
),
'section' => array(
'align' => true,
),
'small' => array(),
'strike' => array(),
'strong' => array(),
'sub' => array(),
'summary' => array(
'align' => true,
),
'sup' => array(),
'table' => array(
'align' => true,
'bgcolor' => true,
'border' => true,
'cellpadding' => true,
'cellspacing' => true,
'rules' => true,
'summary' => true,
'width' => true,
),
'tbody' => array(
'align' => true,
'char' => true,
'charoff' => true,
'valign' => true,
),
'td' => array(
'abbr' => true,
'align' => true,
'axis' => true,
'bgcolor' => true,
'char' => true,
'charoff' => true,
'colspan' => true,
'headers' => true,
'height' => true,
'nowrap' => true,
'rowspan' => true,
'scope' => true,
'valign' => true,
'width' => true,
),
'textarea' => array(
'cols' => true,
'rows' => true,
'disabled' => true,
'name' => true,
'readonly' => true,
),
'tfoot' => array(
'align' => true,
'char' => true,
'charoff' => true,
'valign' => true,
),
'th' => array(
'abbr' => true,
'align' => true,
'axis' => true,
'bgcolor' => true,
'char' => true,
'charoff' => true,
'colspan' => true,
'headers' => true,
'height' => true,
'nowrap' => true,
'rowspan' => true,
'scope' => true,
'valign' => true,
'width' => true,
),
'thead' => array(
'align' => true,
'char' => true,
'charoff' => true,
'valign' => true,
),
'title' => array(),
'tr' => array(
'align' => true,
'bgcolor' => true,
'char' => true,
'charoff' => true,
'valign' => true,
),
'track' => array(
'default' => true,
'kind' => true,
'label' => true,
'src' => true,
'srclang' => true,
),
'tt' => array(),
'u' => array(),
'ul' => array(
'type' => true,
),
'ol' => array(
'start' => true,
'type' => true,
'reversed' => true,
),
'var' => array(),
'video' => array(
'autoplay' => true,
'controls' => true,
'height' => true,
'loop' => true,
'muted' => true,
'playsinline' => true,
'poster' => true,
'preload' => true,
'src' => true,
'width' => true,
),
);
public static $allowedtags = array(
'a' => array(
'href' => true,
'title' => true,
),
'abbr' => array(
'title' => true,
),
'acronym' => array(
'title' => true,
),
'b' => array(),
'blockquote' => array(
'cite' => true,
),
'cite' => array(),
'code' => array(),
'del' => array(
'datetime' => true,
),
'em' => array(),
'i' => array(),
'q' => array(
'cite' => true,
),
's' => array(),
'strike' => array(),
'strong' => array(),
);
} WordPress/Fail.php 0000644 00000005633 15051312625 0010067 0 ustar 00 =')) {
@wp_die(sprintf('
', sprintf('Smart Slider 3 requires PHP version 7.0+, plugin is currently NOT RUNNING. Current PHP version: %1$s. %2$s%2$s Consult your host about %3$s upgrading your PHP version%4$s.', PHP_VERSION, '
', '', '')));
} else if (!version_compare(get_bloginfo('version'), '5.0', '>=')) {
@wp_die(sprintf('', 'Smart Slider 3 requires WordPress version 5.0+. Because you are using an earlier version, the plugin is currently NOT RUNNING.'));
} else if (!defined('NONCE_SALT')) {
@wp_die(sprintf('', 'NONCE_SALT constant is missing from the wp-config.php file.', sprintf('%1$sMake sure it is defined.%2$s', '', '')));
}
}
}
if (!function_exists('smartslider3_fail_php_version')) {
function smartslider3_fail_php_version() {
$html_message = sprintf('', sprintf('Smart Slider 3 requires PHP version 7.0+, plugin is currently NOT RUNNING. Current PHP version: %1$s. %2$s%2$s Consult your host about %3$s upgrading your PHP version%4$s.', PHP_VERSION, '
', '', ''));
echo wp_kses_post($html_message);
}
}
if (!function_exists('smartslider3_fail_wp_version')) {
function smartslider3_fail_wp_version() {
$html_message = sprintf('', 'Smart Slider 3 requires WordPress version 5.0+. Because you are using an earlier version, the plugin is currently NOT RUNNING.');
echo wp_kses_post($html_message);
}
}
if (!function_exists('smartslider3_fail_nonce_salt')) {
function smartslider3_fail_nonce_salt() {
$html_message = sprintf('', 'NONCE_SALT constant is missing from the wp-config.php file.', sprintf('%1$sMake sure it is defined.%2$s', '', ''));
echo wp_kses_post($html_message);
}
} WordPress/OutputBuffer.php 0000644 00000016212 15051312625 0011641 0 ustar 00 priority);
add_action('shutdown', array(
$this,
'closeOutputBuffers'
), -1 * $this->priority);
/**
* Fix for KeyCDN cache enabled
* @url https://wordpress.org/plugins/cache-enabler/
*/
if (class_exists('Cache_Enabler', false)) {
add_action('template_redirect', function () {
ob_start(array(
$this,
"outputCallback"
));
}, 0);
}
/**
* Fix for Hyper Cache
* @url https://wordpress.org/plugins/hyper-cache/
*/
if (function_exists('hyper_cache_callback')) {
add_filter('cache_buffer', array(
$this,
'prepareOutput'
));
}
/**
* Fix for Speed booster Pack
* @url https://wordpress.org/plugins/speed-booster-pack/
*/
if (defined('SBP_VERSION')) {
add_filter('sbp_output_buffer', array(
$this,
'prepareOutput'
));
}
if (class_exists('PagespeedNinja')) {
/**
* @see SSDEV-2358
*/
add_action('template_redirect', function () {
ob_start(array(
$this,
"outputCallback"
));
});
}
if (class_exists('Cachify')) {
/**
* @see SSDEV-2776
*/
add_action('template_redirect', function () {
ob_start(array(
$this,
"outputCallback"
));
});
}
if (class_exists('Ionos\Performance\Caching')) {
/**
* @see SSDEV-3780
*/
add_action('template_redirect', function () {
ob_start(array(
$this,
"outputCallback"
));
});
}
if (class_exists('WP_Grid_Builder\Autoload')) {
/**
* @see SSDEV-3888
*/
add_action('template_redirect', function () {
ob_start(array(
$this,
"outputCallback"
));
});
}
if (class_exists('wps_ic')) {
/**
* @see SSDEV-3916
*/
add_action('template_redirect', function () {
ob_start(array(
$this,
"outputCallback"
));
});
}
}
/**
* Theme's functions.php loaded at this point.
*/
public function onInit() {
/**
* Borlabs cache
* @url https://borlabs.io/download/
*/
if (defined('BORLABS_CACHE_SLUG') && !is_admin()) {
add_action('template_redirect', array(
$this,
'outputStart'
), -1 * $this->priority);
return;
}
if (defined('THEMIFY_VERSION') && !is_admin()) {
add_filter('template_include', array(
$this,
'templateIncludeOutputStart'
), 1); // Themify use priority: 0
return;
}
add_action('pp_end_html', array(
$this,
'closeOutputBuffers'
), -10000); // ProPhoto 6 theme: we must close the buffer before the cache
add_action('headway_html_close', array(
$this,
'closeOutputBuffers'
), $this->priority); // Headway theme
$this->outputStart();
}
public function templateIncludeOutputStart($template) {
$this->outputStart();
return $template;
}
public function outputStart() {
static $started = false;
if ($started) {
return true;
}
$started = true;
if (defined('AUTOPTIMIZE_PLUGIN_DIR')) {
add_filter('autoptimize_filter_html_before_minify', array(
$this,
'prepareOutput'
));
}
if (defined('WP_ROCKET_VERSION')) {
add_filter('rocket_buffer', array(
$this,
'prepareOutput'
), -100000);
}
/**
* Gantry 4 improvement to use the inbuilt output filter
*/
if (defined('GANTRY_VERSION') && version_compare(GANTRY_VERSION, '4.0.0', '>=') && version_compare(GANTRY_VERSION, '5.0.0', '<')) {
if (!is_admin()) {
add_filter('gantry_before_render_output', array(
$this,
'prepareOutput'
));
remove_action('shutdown', array(
$this,
'closeOutputBuffers'
), -1 * $this->priority);
return true;
}
}
ob_start(array(
$this,
"outputCallback"
));
for ($i = 0; $i < $this->extraObStart; $i++) {
ob_start();
}
/**
* Ultimate reviews open a buffer on init and tries to close it on wp_footer.
* To prevent that, lets open a new buffer which can be closed on wp_footer.
*
* @bug install Speed Contact Bar + Ultimate Reviews
* @see https://wordpress.org/plugins/ultimate-reviews/
*/
if (function_exists('EWD_URP_add_ob_start')) {
ob_start();
}
/**
* Cart66 closes our output buffer in forceDownload method
* @url http://www.cart66.com
*/
if (class_exists('Cart66')) {
ob_start();
}
return true;
}
public function closeOutputBuffers() {
if (!defined('WC_DOING_AJAX') || !WC_DOING_AJAX) {
$handlers = ob_list_handlers();
$callback = self::class . '::outputCallback';
if (in_array($callback, $handlers)) {
for ($i = count($handlers) - 1; $i >= 0; $i--) {
ob_end_flush();
if ($handlers[$i] === $callback) {
break;
}
}
}
}
}
public function outputCallback($buffer, $phase) {
if ($phase & PHP_OUTPUT_HANDLER_FINAL || $phase & PHP_OUTPUT_HANDLER_END) {
return $this->prepareOutput($buffer);
}
return $buffer;
}
public function prepareOutput($buffer) {
return apply_filters('wordpress_prepare_output', $buffer);
}
/**
* @param int $priority
*/
public function setPriority($priority) {
$this->priority = $priority;
}
/**
* @param int $extraObStart
*/
public function setExtraObStart($extraObStart) {
$this->extraObStart = $extraObStart;
}
} Framework/Request/Parser/AbstractRequestParser.php 0000644 00000000217 15051312625 0016367 0 ustar 00 isSlashed = did_action('init') > 0;
}
public function parseData($data) {
if ($this->isSlashed) {
if (is_array($data)) {
return $this->stripslashesRecursive($data);
}
return stripslashes($data);
}
return $data;
}
private function stripslashesRecursive($array) {
foreach ($array as $key => $value) {
$array[$key] = is_array($value) ? $this->stripslashesRecursive($value) : stripslashes($value);
}
return $array;
}
} Framework/Request/Parser/JoomlaRequestParser.php 0000644 00000000263 15051312625 0016046 0 ustar 00 parserInstance = new WordPressRequestParser();
$this->originalStorage = $data;
$this->returnOriginal = $returnOriginal;
$this->storage = array();
}
public function set($var, $val) {
$this->storage[$var] = $val;
}
protected function get($var, $default = false) {
if (!$this->returnOriginal) {
if (isset($this->storage[$var])) {
return $this->storage[$var];
} else if (isset($this->originalStorage[$var])) {
$this->storage[$var] = $this->parserInstance->parseData($this->originalStorage[$var]);
return $this->storage[$var];
}
} else if (isset($this->originalStorage[$var])) {
return $this->originalStorage[$var];
}
return $default;
}
public function getVar($var, $default = null) {
return $this->get($var, $default);
}
public function getInt($var, $default = 0) {
return intval($this->get($var, $default));
}
public function getCmd($var, $default = '') {
return preg_replace("/[^\w_]/", "", $this->get($var, $default));
}
public function exists($var) {
if (isset($this->storage[$var])) {
return true;
} else if (isset($this->originalStorage[$var])) {
return true;
}
return false;
}
} Framework/Request/Request.php 0000644 00000002330 15051312625 0012270 0 ustar 00 getName();
}
public static function getLabel() {
return self::$platform->getLabel();
}
public static function getVersion() {
return self::$platform->getVersion();
}
public static function isAdmin() {
return self::$platform->isAdmin();
}
public static function setIsAdmin($isAdmin) {
self::$platform->setIsAdmin($isAdmin);
}
public static function hasPosts() {
return self::$platform->hasPosts();
}
public static function getSiteUrl() {
return self::$platform->getSiteUrl();
}
public static function getCharset() {
return self::$platform->getCharset();
}
public static function getMysqlDate() {
return self::$platform->getMysqlDate();
}
public static function getTimestamp() {
return self::$platform->getTimestamp();
}
public static function localizeDate($date) {
return self::$platform->localizeDate($date);
}
public static function getPublicDirectory() {
return self::$platform->getPublicDirectory();
}
public static function getUserEmail() {
return self::$platform->getUserEmail();
}
public static function needStrongerCss() {
return self::$platform->needStrongerCss();
}
public static function getDebug() {
return self::$platform->getDebug();
}
public static function filterAssetsPath($assetsPath) {
return self::$platform->filterAssetsPath($assetsPath);
}
}
Platform::getInstance(); Framework/Platform/WordPress/PlatformWordPress.php 0000644 00000010511 15051312625 0016361 0 ustar 00 isBeaverBuilderActive()) {
$this->isAdmin = true;
}
}
public function getName() {
return 'wordpress';
}
public function getLabel() {
return 'WordPress';
}
public function getVersion() {
global $wp_version;
return $wp_version;
}
public function getSiteUrl() {
return str_replace(array(
'http://',
'https://'
), '//', site_url('/'));
}
public function getCharset() {
return get_option('blog_charset');
}
public function getMysqlDate() {
return current_time('mysql');
}
public function getTimestamp() {
return current_time('timestamp');
}
public function localizeDate($date) {
return date_i18n(get_option('date_format'), $date);
}
public function filterAssetsPath($assetsPath) {
return str_replace(SMARTSLIDER3_LIBRARY_PATH, NEXTEND_SMARTSLIDER_3 . 'Public', $assetsPath);
}
public function getPublicDirectory() {
$upload_dir = wp_upload_dir();
if (!stream_is_local($upload_dir['basedir'])) {
return $upload_dir['basedir'];
}
/**
* We need to use realpath() to resolve the basedir values where some parts point to the parent folder ( e.g.: ../)
*/
$upload_base_dir_real_path = realpath($upload_dir['basedir']);
$upload_base_dir = $upload_base_dir_real_path ? $upload_base_dir_real_path : $upload_dir['basedir'];
return Filesystem::convertToRealDirectorySeparator(str_replace('//', '/', $upload_base_dir));
}
public function getUserEmail() {
return wp_get_current_user()->user_email;
}
public function needStrongerCss() {
/**
* If Divi plugin installed without Divi theme we must use stronger CSS selectors
*/
if (!$this->isAdmin() && function_exists('et_is_builder_plugin_active') && et_is_builder_plugin_active()) {
return true;
}
return false;
}
public function getDebug() {
$debug = array('');
$debug[] = 'get_site_url: ' . get_site_url();
$debug[] = 'WP_CONTENT_URL: ' . WP_CONTENT_URL;
$translateUrl = Settings::get('translate-url', '|*|');
$debug[] = 'Translate url: ' . ($translateUrl == '|*|' ? 'not used' : $translateUrl);
$debug[] = '';
$debug[] = 'Path to uri:';
$uris = Url::getUris();
$paths = Filesystem::getPaths();
foreach ($uris as $i => $uri) {
$debug[] = $paths[$i] . ' => ' . $uri;
}
$debug[] = '';
$debug[] = 'wp_upload_dir() => ';
foreach (wp_upload_dir() as $k => $v) {
$debug[] = $k . ': ' . $v;
}
$debug[] = '<=';
$debug[] = '';
$theme = wp_get_theme();
$parentTheme = $theme->parent();
if ($parentTheme) {
$debug[] = 'Parent theme: ' . $theme->get('Name') . " is version " . $theme->get('Version');
}
$debug[] = 'Theme: ' . $theme->get('Name') . " is version " . $theme->get('Version');
$plugins = get_plugins();
$notActive = array();
$debug[] = '';
$debug[] = 'Activated Plugins:';
foreach ($plugins as $plugin => $pluginData) {
if (is_plugin_active($plugin)) {
$debug[] = ' - ' . $plugin . ' - ' . $pluginData['Version'] . ' - ' . $pluginData['Name'];
} else {
$notActive[$plugin] = $pluginData;
}
}
$debug[] = '';
$debug[] = '';
$debug[] = 'NOT Activated Plugins:';
foreach ($notActive as $plugin => $pluginData) {
$debug[] = ' - ' . $plugin . ' - ' . $pluginData['Version'] . ' - ' . $pluginData['Name'];
}
return $debug;
}
public function isBeaverBuilderActive() {
return Request::$GET->getVar('fl_builder') !== null;
}
} Framework/Platform/AbstractPlatform.php 0000644 00000002304 15051312625 0014245 0 ustar 00 isAdmin;
}
public function setIsAdmin($isAdmin) {
$this->isAdmin = $isAdmin;
}
public abstract function getName();
public abstract function getLabel();
public abstract function getVersion();
public function hasPosts() {
return $this->hasPosts;
}
public abstract function getSiteUrl();
public function getCharset() {
return 'UTF-8';
}
public function getMysqlDate() {
return date("Y-m-d H:i:s");
}
public function getTimestamp() {
return time();
}
/**
* @return string
*/
public abstract function getPublicDirectory();
public function getUserEmail() {
return '';
}
public function needStrongerCss() {
return false;
}
public function getDebug() {
return array();
}
public function filterAssetsPath($assetsPath) {
return $assetsPath;
}
} Framework/Response/ResponseAjax.php 0000644 00000003341 15051312625 0013413 0 ustar 00 null,
'notification' => array()
);
public function __construct($appType) {
$this->appType = $appType;
}
public function error($showNotification = true) {
$this->isError = true;
$this->respond(null, $showNotification);
}
public function respond($data = null, $showNotification = true) {
$this->response['data'] = $data;
self::fix_output_buffer();
if ($showNotification) {
$this->response['notification'] = Notification::showAjax();
}
header("Content-Type: application/json");
if ($this->isError) {
header("HTTP/1.0 403 Forbidden");
}
echo json_encode($this->response);
PageFlow::exitApplication();
}
public function redirect($url) {
self::fix_output_buffer();
$this->response['redirect'] = $url;
echo json_encode($this->response);
PageFlow::exitApplication();
}
private static function fix_output_buffer() {
$ob_list_handlers = ob_list_handlers();
$ob_list_handlers_count = count($ob_list_handlers);
$exclude = array(
'ob_gzhandler',
'zlib output compression'
);
if ($ob_list_handlers_count && !in_array($ob_list_handlers[$ob_list_handlers_count - 1], $exclude)) {
ob_clean();
}
}
} Framework/Acl/Acl.php 0000644 00000001156 15051312625 0010413 0 ustar 00 authorise($action, $MVCHelper);
}
}
new Acl(); Framework/Acl/WordPress/WordPressAcl.php 0000644 00000000501 15051312625 0014205 0 ustar 00 getContainer(), 'font', n2_('Font settings'));
$table->setFieldsetPositionEnd();
new Button($table->getFieldsetLabel(), 'font-clear-tab', false, n2_('Clear tab'));
new Tab($table->getFieldsetLabel(), 'font-state');
$row1 = $table->createRow('font-row-1');
new Family($row1, 'family', n2_('Family'), 'Arial, Helvetica', array(
'style' => 'width:150px;'
));
new Color($row1, 'color', n2_('Color'), '000000FF', array(
'alpha' => true
));
new MixedField\FontSize($row1, 'size', n2_('Size'), '14|*|px');
new FontWeight($row1, 'weight', n2_('Font weight'), '');
new Decoration($row1, 'decoration', n2_('Decoration'));
new TextAutoComplete($row1, 'lineheight', n2_('Line height'), '18px', array(
'values' => array(
'normal',
'1',
'1.2',
'1.5',
'1.8',
'2'
),
'style' => 'width:70px;'
));
new TextAlign($row1, 'textalign', n2_('Text align'), 'inherit');
$row2 = $table->createRow('font-row-2');
new TextAutoComplete($row2, 'letterspacing', n2_('Letter spacing'), 'normal', array(
'values' => array(
'normal',
'1px',
'2px',
'5px',
'10px',
'15px'
),
'style' => 'width:50px;'
));
new TextAutoComplete($row2, 'wordspacing', n2_('Word spacing'), 'normal', array(
'values' => array(
'normal',
'2px',
'5px',
'10px',
'15px'
),
'style' => 'width:50px;'
));
new Select($row2, 'texttransform', n2_('Transform'), 'none', array(
'options' => array(
'none' => n2_('None'),
'capitalize' => n2_('Capitalize'),
'uppercase' => n2_('Uppercase'),
'lowercase' => n2_('Lowercase')
)
));
new MixedField\TextShadow($row2, 'tshadow', n2_('Text shadow'), '0|*|0|*|1|*|000000FF');
new Textarea($row2, 'extracss', 'CSS', '', array(
'width' => 200,
'height' => 26
));
$previewTable = new ContainerTable($form->getContainer(), 'font-preview', n2_('Preview'));
$previewTable->setFieldsetPositionEnd();
new Color($previewTable->getFieldsetLabel(), 'preview-background', false, 'ced3d5');
$form->render();
}
} Framework/Font/FontSources.php 0000644 00000002357 15051312625 0012401 0 ustar 00 getName()] = $source;
}
/**
* @return AbstractFontSource[]
*/
public static function getFontSources() {
return self::$fontSources;
}
public static function onFontManagerLoad($force = false) {
foreach (self::$fontSources as $source) {
$source->onFontManagerLoad($force);
}
}
public static function onFontManagerLoadBackend() {
foreach (self::$fontSources as $source) {
$source->onFontManagerLoadBackend();
}
}
}
new FontSources(); Framework/Font/FontRenderer.php 0000644 00000024245 15051312625 0012524 0 ustar 00 self::$defaultFont,
'color' => '000000ff',
'size' => '14||px',
'tshadow' => '0|*|0|*|0|*|000000ff',
'lineheight' => '1.5',
'bold' => 0,
'italic' => 0,
'underline' => 0,
'align' => 'left',
'letterspacing' => "normal",
'wordspacing' => "normal",
'texttransform' => "none",
'extra' => ''
), $tabs[0]);
if (self::$mode[$mode]['renderOptions']['combined']) {
for ($i = 1; $i < count($tabs); $i++) {
$tabs[$i] = array_merge($tabs[$i - 1], $tabs[$i]);
if ($tabs[$i]['size'] == $tabs[0]['size']) {
$tabs[$i]['size'] = '100||%';
} else {
$size1 = explode('||', $tabs[0]['size']);
$size2 = explode('||', $tabs[$i]['size']);
if (isset($size1[1]) && isset($size2[1]) && $size1[1] == 'px' && $size2[1] == 'px') {
$tabs[$i]['size'] = round($size2[0] / $size1[0] * 100) . '||%';
}
}
}
}
foreach ($tabs as $k => $tab) {
$search[] = '@tab' . $k;
FontStyle::$fontSize = $fontSize;
$replace[] = self::$style->style($tab);
}
$template = '';
foreach (self::$mode[$mode]['selectors'] as $s => $style) {
$key = array_search($style, $search);
if (is_numeric($key) && !empty($replace[$key])) {
$template .= $s . "{" . $style . "}";
}
}
return str_replace($search, $replace, $template);
}
}
$frontendAccessibility = intval(Settings::get('frontend-accessibility', 1));
FontRenderer::$mode = array(
'0' => array(
'id' => '0',
'label' => n2_('Text'),
'tabs' => array(
n2_('Text')
),
'renderOptions' => array(
'combined' => false
),
'preview' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
',
'selectors' => array(
'@pre@selector' => '@tab0'
)
),
'simple' => array(
'id' => 'simple',
'label' => n2_('Text'),
'tabs' => array(
n2_('Text')
),
'renderOptions' => array(
'combined' => false
),
'preview' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
',
'selectors' => array(
'@pre@selector' => '@tab0'
)
),
'hover' => array(
'id' => 'hover',
'label' => n2_('Hover'),
'tabs' => array(
n2_('Text'),
n2_('Hover')
),
'renderOptions' => array(
'combined' => false
),
'preview' => '' . n2_('Heading') . '
',
'selectors' => $frontendAccessibility ? array(
'@pre@selector' => '@tab0',
'@pre@selector:HOVER, @pre@selector:ACTIVE, @pre@selector:FOCUS' => '@tab1'
) : array(
'@pre@selector, @pre@selector:FOCUS' => '@tab0',
'@pre@selector:HOVER, @pre@selector:ACTIVE' => '@tab1'
)
),
'link' => array(
'id' => 'link',
'label' => n2_('Link'),
'tabs' => array(
n2_('Text'),
n2_('Hover')
),
'renderOptions' => array(
'combined' => false
),
'preview' => '',
'selectors' => $frontendAccessibility ? array(
'@pre@selector a' => '@tab0',
'@pre@selector a:HOVER, @pre@selector a:ACTIVE, @pre@selector a:FOCUS' => '@tab1'
) : array(
'@pre@selector a, @pre@selector a:FOCUS' => '@tab0',
'@pre@selector a:HOVER, @pre@selector a:ACTIVE' => '@tab1'
)
),
'paragraph' => array(
'id' => 'paragraph',
'label' => n2_('Paragraph'),
'tabs' => array(
n2_('Text'),
n2_('Link'),
n2_('Hover')
),
'renderOptions' => array(
'combined' => true
),
'preview' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
test link incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
test link velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
test link, sunt in culpa qui officia deserunt mollit anim id est laborum.
',
'selectors' => array(
'@pre@selector' => '@tab0',
'@pre@selector a, @pre@selector a:FOCUS' => '@tab1',
'@pre@selector a:HOVER, @pre@selector a:ACTIVE' => '@tab2'
)
),
'input' => array(
'id' => 'input',
'label' => 'Input',
'tabs' => array(
n2_('Text'),
n2_('Hover')
),
'renderOptions' => array(
'combined' => false
),
'preview' => 'Excepteur sint occaecat
',
'selectors' => array(
'@pre@selector' => '@tab0',
'@pre@selector:HOVER, @pre@selector:FOCUS' => '@tab2'
)
),
'dot' => array(
'id' => 'dot',
'label' => n2_('Dot'),
'tabs' => array(
n2_('Text'),
n2_('Active')
),
'renderOptions' => array(
'combined' => false
),
'preview' => '',
'selectors' => array(
'@pre@selector, @pre@selector:FOCUS' => '@tab0',
'@pre@selector.n2-active, @pre@selector:HOVER, @pre@selector:ACTIVE' => '@tab1'
)
),
'list' => array(
'id' => 'list',
'label' => n2_('List'),
'tabs' => array(
n2_('Text'),
n2_('Link'),
n2_('Hover')
),
'renderOptions' => array(
'combined' => false
),
'preview' => '',
'selectors' => array(
'@pre@selector li' => '@tab0',
'@pre@selector li a, @pre@selector li a:FOCUS' => '@tab1',
'@pre@selector li a:HOVER, @pre@selector li a:ACTIVE' => '@tab2'
)
),
'highlight' => array(
'id' => 'highlight',
'label' => n2_('Highlight'),
'tabs' => array(
n2_('Text'),
n2_('Highlight'),
n2_('Hover')
),
'renderOptions' => array(
'combined' => true
),
'preview' => '' . n2_('Button') . '
',
'selectors' => $frontendAccessibility ? array(
'@pre@selector' => '@tab0',
'@pre@selector .n2-highlighted' => '@tab1',
'@pre@selector .n2-highlighted:HOVER, @pre@selector .n2-highlighted:ACTIVE, @pre@selector .n2-highlighted:FOCUS' => '@tab2'
) : array(
'@pre@selector' => '@tab0',
'@pre@selector .n2-highlighted, @pre@selector .n2-highlighted:FOCUS' => '@tab1',
'@pre@selector .n2-highlighted:HOVER, @pre@selector .n2-highlighted:ACTIVE' => '@tab2'
)
),
);
FontRenderer::$style = new FontStyle(); Framework/Font/AbstractFontSource.php 0000644 00000001026 15051312625 0013672 0 ustar 00 name;
}
public function onFontManagerLoad($force = false) {
}
public function onFontManagerLoadBackend() {
}
/**
* @param ContainerInterface $container
*/
abstract public function renderFields($container);
} Framework/Font/FontSettings.php 0000644 00000006666 15051312625 0012565 0 ustar 00 get('default-family'));
}
public static function load() {
self::$data = new Data(array(
'default-family' => n2_x('Roboto,Arial', 'Default font'),
'preset-families' => n2_x(implode("\n", array(
"Abel",
"Arial",
"Arimo",
"Average",
"Bevan",
"Bitter",
"'Bree Serif'",
"Cabin",
"Calligraffitti",
"Chewy",
"Comfortaa",
"'Covered By Your Grace'",
"'Crafty Girls'",
"'Dancing Script'",
"'Noto Sans'",
"'Noto Serif'",
"'Francois One'",
"'Fredoka One'",
"'Gloria Hallelujah'",
"'Happy Monkey'",
"'Josefin Slab'",
"Lato",
"Lobster",
"'Luckiest Guy'",
"Montserrat",
"'Nova Square'",
"Nunito",
"'Open Sans'",
"Oswald",
"Oxygen",
"Pacifico",
"'Permanent Marker'",
"'Playfair Display'",
"'PT Sans'",
"'Poiret One'",
"Raleway",
"Roboto",
"'Rock Salt'",
"Quicksand",
"Satisfy",
"'Squada One'",
"'The Girl Next Door'",
"'Titillium Web'",
"'Varela Round'",
"Vollkorn",
"'Walter Turncoat'"
)), 'Default font family list'),
'plugins' => array()
));
foreach (Section::getAll('system', 'fonts') as $data) {
self::$data->set($data['referencekey'], $data['value']);
}
self::$pluginsData = new Data(self::$data->get('plugins'), true);
}
public static function store($data) {
if (is_array($data)) {
foreach ($data as $key => $value) {
if (self::$data->has($key)) {
self::$data->set($key, $value);
Section::set('system', 'fonts', $key, $value, 1, 1);
unset($data[$key]);
}
}
if (count($data)) {
self::$pluginsData = new Data($data);
Section::set('system', 'fonts', 'plugins', self::$pluginsData->toJSON(), 1, 1);
}
return true;
}
return false;
}
/**
* @return Data
*/
public static function getData() {
return self::$data;
}
/**
* @return Data
*/
public static function getPluginsData() {
return self::$pluginsData;
}
public static function getDefaultFamily() {
return self::$data->get('default-family');
}
/**
* @return array
*/
public static function getPresetFamilies() {
return array_filter(explode("\n", self::$data->get('preset-families')));
}
}
new FontSettings(); Framework/Font/FontStyle.php 0000644 00000010640 15051312625 0012050 0 ustar 00 $v) {
$style .= $this->parse($k, $v);
}
$style .= $this->parse('extra', $extra);
return $style;
}
/**
* @param $property
* @param $value
*
* @return mixed
*/
public function parse($property, $value) {
$fn = 'parse' . $property;
return $this->$fn($value);
}
/**
* @param $v
*
* @return string
*/
public function parseColor($v) {
$hex = Color::hex82hex($v);
if ($hex[1] == 'ff') {
return 'color: #' . $hex[0] . ';';
}
$rgba = Color::hex2rgba($v);
return 'color: RGBA(' . $rgba[0] . ',' . $rgba[1] . ',' . $rgba[2] . ',' . round($rgba[3] / 127, 2) . ');';
}
/**
* @param $v
*
* @return string
*/
public function parseSize($v) {
if (self::$fontSize) {
$fontSize = Common::parse($v);
if ($fontSize[1] == 'px') {
return 'font-size:' . ($fontSize[0] / self::$fontSize * 100) . '%;';
}
}
return 'font-size:' . Sanitize::esc_css_value(Common::parse($v, '')) . ';';
}
/**
* @param $v
*
* @return string
*/
public function parseTshadow($v) {
$v = Common::parse($v);
$rgba = Color::hex2rgba($v[3]);
if ($v[0] == 0 && $v[1] == 0 && $v[2] == 0) return 'text-shadow: none;';
return 'text-shadow: ' . Sanitize::esc_css_value($v[0]) . 'px ' . Sanitize::esc_css_value($v[1]) . 'px ' . Sanitize::esc_css_value($v[2]) . 'px RGBA(' . $rgba[0] . ',' . $rgba[1] . ',' . $rgba[2] . ',' . round($rgba[3] / 127, 2) . ');';
}
/**
* @param $v
*
* @return string
*/
public function parseAfont($v) {
return 'font-family: ' . $this->loadFont(Sanitize::esc_css_value($v)) . ';';
}
/**
* @param $v
*
* @return string
*/
public function parseLineheight($v) {
if ($v == '') return '';
return 'line-height: ' . Sanitize::esc_css_value($v) . ';';
}
/**
* @param $v
*
* @return string
*/
public function parseBold($v) {
return $this->parseWeight($v);
}
public function parseWeight($v) {
if ($v == '1') return 'font-weight: bold;';
if ($v > 1) return 'font-weight: ' . intval($v) . ';';
return 'font-weight: normal;';
}
/**
* @param $v
*
* @return string
*/
public function parseItalic($v) {
if ($v == '1') return 'font-style: italic;';
return 'font-style: normal;';
}
/**
* @param $v
*
* @return string
*/
public function parseUnderline($v) {
if ($v == '1') return 'text-decoration: underline;';
return 'text-decoration: none;';
}
/**
* @param $v
*
* @return string
*/
public function parseAlign($v) {
return 'text-align: ' . Sanitize::esc_css_value($v) . ';';
}
public function parseLetterSpacing($v) {
return 'letter-spacing: ' . Sanitize::esc_css_value($v) . ';';
}
public function parseWordSpacing($v) {
return 'word-spacing: ' . Sanitize::esc_css_value($v) . ';';
}
public function parseTextTransform($v) {
return 'text-transform: ' . Sanitize::esc_css_value($v) . ';';
}
public function parseExtra($v) {
return Sanitize::esc_css_string($v);
}
/**
* @param $families
*
* @return mixed
*/
public function loadFont($families) {
$families = explode(',', $families);
for ($i = 0; $i < count($families); $i++) {
if ($families[$i] != "inherit") {
$families[$i] = $this->getFamily(trim(trim($families[$i]), '\'"'));
}
}
return implode(',', $families);
}
private function getFamily($family) {
return "'" . Plugin::applyFilters('fontFamily', $family) . "'";
}
} Framework/Font/FontStorage.php 0000644 00000004441 15051312625 0012356 0 ustar 00 sets,
&$this->fonts
));
for ($i = 0; $i < count($this->fonts); $i++) {
if (!isset($this->fontsBySet[$this->fonts[$i]['referencekey']])) {
$this->fontsBySet[$this->fonts[$i]['referencekey']] = array();
}
$this->fontsBySet[$this->fonts[$i]['referencekey']][] = &$this->fonts[$i];
$this->fontsById[$this->fonts[$i]['id']] = &$this->fonts[$i];
}
$loaded = true;
}
}
public function fontSet($referenceKey, &$sets) {
$this->load();
for ($i = count($this->sets) - 1; $i >= 0; $i--) {
$this->sets[$i]['isSystem'] = 1;
$this->sets[$i]['editable'] = 0;
array_unshift($sets, $this->sets[$i]);
}
}
public function fonts($referenceKey, &$fonts) {
$this->load();
if (isset($this->fontsBySet[$referenceKey])) {
$_fonts = &$this->fontsBySet[$referenceKey];
for ($i = count($_fonts) - 1; $i >= 0; $i--) {
$_fonts[$i]['isSystem'] = 1;
$_fonts[$i]['editable'] = 0;
array_unshift($fonts, $_fonts[$i]);
}
}
}
public function font($id, &$font) {
$this->load();
if (isset($this->fontsById[$id])) {
$this->fontsById[$id]['isSystem'] = 1;
$this->fontsById[$id]['editable'] = 0;
$font = $this->fontsById[$id];
}
}
} Framework/Font/FontParser.php 0000644 00000002427 15051312625 0012210 0 ustar 00 n2_('Frontend'),
'tipDescription' => n2_('You can load Google Fonts on the frontend.'),
'relatedFieldsOn' => array(
'fontsgoogle-cache'
)
));
new OnOff($row1, 'google-cache', n2_('Save fonts locally'), 0, array(
'tipLabel' => n2_('Save fonts locally'),
'tipDescription' => n2_('You can store the used Google Fonts on your server. This way all Google Fonts will load from your own domain.'),
'tipLink' => 'https://smartslider.helpscoutdocs.com/article/1787-fonts#google'
));
new OnOff($row1, 'google-enabled-backend', n2_('Backend'), 1, array(
'tipLabel' => n2_('Backend'),
'tipDescription' => n2_('You can load Google Fonts in the backend.')
));
$rowGroupStyle = new ContainerRowGroup($container, 'fonts-google-style', n2_('Style'));
$rowStyle = $rowGroupStyle->createRow('fonts-google-style');
new OnOff($rowStyle, 'google-style-100', '100', 0);
new OnOff($rowStyle, 'google-style-100italic', '100 ' . n2_x('Italic', "Font style"), 0);
new OnOff($rowStyle, 'google-style-200', '200', 0);
new OnOff($rowStyle, 'google-style-200italic', '200 ' . n2_x('Italic', "Font style"), 0);
new OnOff($rowStyle, 'google-style-300', '300', 1);
new OnOff($rowStyle, 'google-style-300italic', '300 ' . n2_x('Italic', "Font style"), 0);
new OnOff($rowStyle, 'google-style-400', n2_('Normal'), 1);
new OnOff($rowStyle, 'google-style-400italic', n2_('Normal') . ' ' . n2_x('Italic', "Font style"), 0);
new OnOff($rowStyle, 'google-style-500', '500', 0);
new OnOff($rowStyle, 'google-style-500italic', '500 ' . n2_x('Italic', "Font style"), 0);
new OnOff($rowStyle, 'google-style-600', '600', 0);
new OnOff($rowStyle, 'google-style-600italic', '600 ' . n2_x('Italic', "Font style"), 0);
new OnOff($rowStyle, 'google-style-700', '700', 0);
new OnOff($rowStyle, 'google-style-700italic', '700 ' . n2_x('Italic', "Font style"), 0);
new OnOff($rowStyle, 'google-style-800', '800', 0);
new OnOff($rowStyle, 'google-style-800italic', '800 ' . n2_x('Italic', "Font style"), 0);
new OnOff($rowStyle, 'google-style-900', '900', 0);
new OnOff($rowStyle, 'google-style-900italic', '900 ' . n2_x('Italic', "Font style"), 0);
}
public function getPath() {
return dirname(__FILE__) . DIRECTORY_SEPARATOR . 'google' . DIRECTORY_SEPARATOR;
}
public function onFontManagerLoad($force = false) {
static $loaded;
if (!$loaded || $force) {
$loaded = true;
$parameters = FontSettings::getPluginsData();
if ((!Platform::isAdmin() && $parameters->get('google-enabled', 1)) || (Platform::isAdmin() && $parameters->get('google-enabled-backend', 1))) {
Google::$enabled = 1;
for ($i = 100; $i < 1000; $i += 100) {
$this->addStyle($parameters, $i);
$this->addStyle($parameters, $i . 'italic');
}
if (empty(self::$styles)) {
self::$styles[] = '300';
self::$styles[] = '400';
}
Plugin::addAction('fontFamily', array(
$this,
'onFontFamily'
));
}
}
}
public function onFontManagerLoadBackend() {
$parameters = FontSettings::getPluginsData();
if ($parameters->get('google-enabled-backend', 1)) {
Js::addInline('new _N2.NextendFontServiceGoogle("' . implode(',', self::$styles) . '", ' . json_encode(self::$fonts) . ', ' . json_encode(AssetManager::$googleFonts->getLoadedFamilies()) . ');');
}
}
function addStyle($parameters, $weight) {
if ($parameters->get('google-style-' . $weight, 0)) {
self::$styles[] = $weight;
}
}
function onFontFamily($family) {
$familyLower = strtolower($family);
if (isset(self::$fonts[$familyLower])) {
foreach (self::$styles as $style) {
Google::addFont(self::$fonts[$familyLower], $style);
}
return self::$fonts[$familyLower];
}
return $family;
}
}
FontSources::registerSource(GoogleFonts::class); Framework/Font/FontManager.php 0000644 00000000540 15051312625 0012320 0 ustar 00 MVCHelper);
$fontManagerBlock->display();
}
} Framework/Font/Block/FontManager/BlockFontManager.php 0000644 00000003100 15051312625 0016521 0 ustar 00 model;
}
public function display() {
$this->model = new ModelFont($this);
$this->renderTemplatePart('Index');
}
public function displayTopBar() {
$buttonCancel = new BlockButtonCancel($this);
$buttonCancel->addClass('n2_fullscreen_editor__cancel');
$buttonCancel->display();
$buttonApply = new BlockButtonApply($this);
$buttonApply->addClass('n2_fullscreen_editor__save');
$buttonApply->display();
}
public function displayContent() {
$model = $this->getModel();
Js::addFirstCode("
_N2.CSSRendererFont.defaultFamily = " . json_encode(FontSettings::getDefaultFamily()) . ";
_N2.CSSRendererFont.rendererModes = " . json_encode(FontRenderer::$mode) . ";
_N2.CSSRendererFont.pre = " . json_encode(FontRenderer::$pre) . ";
new _N2.NextendFontManager();
");
$model->renderForm();
}
} Framework/Font/Block/FontManager/Index.php 0000644 00000001474 15051312625 0014430 0 ustar 00