‰PNG
IHDR Ÿ f Õ†C1 sRGB ®Îé gAMA ±üa pHYs à ÃÇo¨d GIDATx^íÜL”÷ð÷Yçªö("Bh_ò«®¸¢§q5kÖ*:þ0AºšÖ¥]VkJ¢M»¶f¸±8\k2íll£1]q®ÙÔ‚ÆT
PK ! 0JT? T? lib/mkdf.framework.phpnu &1i mkdOptions = QuartMikadoClassOptions::get_instance();
$this->mkdMetaBoxes = QuartMikadoClassMetaBoxes::get_instance();
$this->mkdTaxonomyOptions = QuartMikadoClassTaxonomyOptions::get_instance();
$this->mkdUserOptions = QuartMikadoClassUserOptions::get_instance();
$this->mkdDashboardOptions = QuartMikadoClassDashboardOptions::get_instance();
}
public static function get_instance() {
if ( null == self::$instance ) {
self::$instance = new self;
}
return self::$instance;
}
public function getSkin() {
return $this->skin;
}
public function setSkin( QuartMikadoClassSkinAbstract $skinObject ) {
$this->skin = $skinObject;
}
}
/**
* Class QuartMikadoClassSkinManager
*
* Class that used like a factory for skins.
* It loads required skin file and instantiates skin class
*/
class QuartMikadoClassSkinManager {
/**
* @var this will be an instance of skin
*/
private $skin;
/**
* @see QuartMikadoClassSkinManager::setSkin()
*/
public function __construct() {
$this->setSkin();
}
/**
* Loads wanted skin, instantiates skin class and stores it in $skin attribute
*
* @param string $skinName skin to load. Must match skin folder name
*/
private function setSkin( $skinName = MIKADO_PROFILE_SLUG ) {
if ( $skinName !== '' ) {
if ( file_exists( get_template_directory() . '/framework/admin/skins/' . $skinName . '/skin.php' ) ) {
require_once get_template_directory() . '/framework/admin/skins/' . $skinName . '/skin.php';
$skinName = ucfirst( $skinName ) . esc_html__( 'Skin', 'quart' );
$this->skin = new $skinName();
}
} else {
$this->skin = false;
}
}
/**
* Returns current skin object. It $skin attribute isn't set it calls setSkin method
*
* @return mixed
*
* @see QuartMikadoClassSkinManager::setSkin()
*/
public function getSkin() {
if ( empty( $this->skin ) ) {
$this->setSkin();
}
return $this->skin;
}
}
/**
* Class QuartMikadoClassSkinAbstract
*
* Abstract class that each skin class must extend
*/
abstract class QuartMikadoClassSkinAbstract {
/**
* @var string
*/
protected $skinName;
/**
* @var array of styles that skin will be including
*/
protected $styles;
/**
* @var array of scripts that skin will be including
*/
protected $scripts;
/**
* @var array of icons names for each menu item that theme is adding
*/
protected $icons;
/**
* @var array of menu items positions of each menu item that theme is adding
*/
protected $itemPosition;
/**
* Returns skin name attribute whenever skin is used in concatenation
* @return mixed
*/
public function __toString() {
return $this->skinName;
}
/**
* @return mixed
*/
public function getSkinName() {
return $this->skinName;
}
/**
* Loads template part with params. Uses locate_template function which is child theme friendly
*
* @param $template string template to load
* @param array $params parameters to pass to template
*/
public function loadTemplatePart( $template, $params = array() ) {
if ( is_array( $params ) && count( $params ) ) {
extract( $params );
}
if ( $template !== '' ) {
include( quart_mikado_find_template_path( 'framework/admin/skins/' . $this->skinName . '/templates/' . $template . '.php' ) );
}
}
/**
* Goes through each added scripts and enqueus it
*/
public function enqueueScripts() {
if ( is_array( $this->scripts ) && count( $this->scripts ) ) {
foreach ( $this->scripts as $scriptHandle => $scriptPath ) {
wp_enqueue_script( $scriptHandle );
}
}
}
/**
* Goes through each added styles and enqueus it
*/
public function enqueueStyles() {
if ( is_array( $this->styles ) && count( $this->styles ) ) {
foreach ( $this->styles as $styleHandle => $stylePath ) {
wp_enqueue_style( $styleHandle );
}
}
}
/**
* Echoes script tag that generates global variable that will be used in TinyMCE
*/
public function setShortcodeJSParams() { ?>
skinName );
}
/**
* Returns URI to skin folder
* @return string
*/
public function getSkinURI() {
return get_template_directory_uri() . '/framework/admin/skins/' . $this->skinName;
}
/**
* Here options page content will be generated
* @return mixed
*/
public abstract function renderOptions();
/**
* Here backup options page will be generated
* @return mixed
*/
public abstract function renderBackupOptions();
/**
* Here import page will be generated
* @return mixed
*/
public abstract function renderImport();
/**
* Here all scripts will be registered
* @return mixed
*/
public abstract function registerScripts();
/**
* Here all styles will be registered
* @return mixed
*/
public abstract function registerStyles();
}
/*
Class: QuartMikadoClassOptions
A class that initializes Mikado Options
*/
class QuartMikadoClassOptions {
private static $instance;
public $adminPages;
public $options;
public $optionsByType;
private function __construct() {
$this->adminPages = array();
$this->options = array();
$this->optionsByType = array();
}
public static function get_instance() {
if ( null == self::$instance ) {
self::$instance = new self;
}
return self::$instance;
}
public function addAdminPage( $key, $page ) {
$this->adminPages[ $key ] = $page;
}
public function getAdminPage( $key ) {
return $this->adminPages[ $key ];
}
public function adminPageExists( $key ) {
return array_key_exists( $key, $this->adminPages );
}
public function getAdminPageFromSlug( $slug ) {
foreach ( $this->adminPages as $key => $page ) {
if ( $page->slug == $slug ) {
return $page;
}
}
return;
}
public function addOption( $key, $value, $type = '' ) {
$this->options[ $key ] = $value;
$this->addOptionByType( $type, $key );
}
public function getOption( $key ) {
if ( isset( $this->options[ $key ] ) ) {
return $this->options[ $key ];
}
return;
}
public function addOptionByType( $type, $key ) {
$this->optionsByType[ $type ][] = $key;
}
public function getOptionsByType( $type ) {
if ( array_key_exists( $type, $this->optionsByType ) ) {
return $this->optionsByType[ $type ];
}
return false;
}
public function getOptionValue( $key ) {
global $quart_mikado_global_options;
if ( array_key_exists( $key, $quart_mikado_global_options ) ) {
return $quart_mikado_global_options[ $key ];
} elseif ( array_key_exists( $key, $this->options ) ) {
return $this->getOption( $key );
}
return false;
}
}
/*
Class: QuartMikadoClassAdminPage
A class that initializes Mikado Admin Page
*/
class QuartMikadoClassAdminPage implements iQuartMikadoInterfaceLayoutNode {
public $layout;
private $factory;
public $slug;
public $title;
public $icon;
function __construct( $slug = "", $title_label = "", $icon = "" ) {
$this->layout = array();
$this->factory = new QuartMikadoClassFieldFactory();
$this->slug = $slug;
$this->title = $title_label;
$this->icon = $icon;
}
public function hasChidren() {
return ( count( $this->layout ) > 0 ) ? true : false;
}
public function getChild( $key ) {
return $this->layout[ $key ];
}
public function addChild( $key, $value ) {
$this->layout[ $key ] = $value;
}
function render() {
foreach ( $this->layout as $child ) {
$this->renderChild( $child );
}
}
public function renderChild( iQuartMikadoInterfaceRender $child ) {
$child->render( $this->factory );
}
}
/*
Class: QuartMikadoClassMetaBoxes
A class that initializes Mikado Meta Boxes
*/
class QuartMikadoClassMetaBoxes {
private static $instance;
public $metaBoxes;
public $options;
public $optionsByType;
private function __construct() {
$this->metaBoxes = array();
$this->options = array();
$this->optionsByType = array();
}
public static function get_instance() {
if ( null == self::$instance ) {
self::$instance = new self;
}
return self::$instance;
}
public function addMetaBox( $key, $box ) {
$this->metaBoxes[ $key ] = $box;
}
public function getMetaBox( $key ) {
return $this->metaBoxes[ $key ];
}
public function addOption( $key, $value, $type = '' ) {
$this->options[ $key ] = $value;
$this->addOptionByType($type, $key);
}
public function getOption( $key ) {
if ( isset( $this->options[ $key ] ) ) {
return $this->options[ $key ];
}
return;
}
public function addOptionByType($type, $key) {
$this->optionsByType[$type][] = $key;
}
public function getOptionsByType($type) {
if(array_key_exists($type, $this->optionsByType)) {
return $this->optionsByType[$type];
}
return array();
}
public function getMetaBoxesByScope( $scope ) {
$boxes = array();
if ( is_array( $this->metaBoxes ) && count( $this->metaBoxes ) ) {
foreach ( $this->metaBoxes as $metabox ) {
if ( is_array( $metabox->scope ) && in_array( $scope, $metabox->scope ) ) {
$boxes[] = $metabox;
} elseif ( $metabox->scope !== '' && $metabox->scope === $scope ) {
$boxes[] = $metabox;
}
}
}
return $boxes;
}
}
/*
Class: QuartMikadoClassMetaBox
A class that initializes Mikado Meta Box
*/
class QuartMikadoClassMetaBox implements iQuartMikadoInterfaceLayoutNode {
public $layout;
private $factory;
public $scope;
public $title;
public $hidden_property;
public $hidden_values = array();
public $name;
function __construct( $scope = "", $title_label = "", $hidden_property = "", $hidden_values = array(), $name = '' ) {
$this->layout = array();
$this->factory = new QuartMikadoClassFieldFactory();
$this->scope = $scope;
$this->title = $this->setTitle( $title_label );
$this->hidden_property = $hidden_property;
$this->hidden_values = $hidden_values;
$this->name = $name;
}
public function hasChidren() {
return ( count( $this->layout ) > 0 ) ? true : false;
}
public function getChild( $key ) {
return $this->layout[ $key ];
}
public function addChild( $key, $value ) {
$this->layout[ $key ] = $value;
}
function render() {
foreach ( $this->layout as $child ) {
$this->renderChild( $child );
}
}
public function renderChild( iQuartMikadoInterfaceRender $child ) {
$child->render( $this->factory );
}
public function setTitle( $label ) {
global $quart_mikado_global_Framework;
return $quart_mikado_global_Framework->getSkin()->getSkinLabel() . ' ' . $label;
}
}
/*
Class: QuartMikadoClassTaxonomyOptions
A class that initializes QuartMikadoClass Taxonomy Options
*/
class QuartMikadoClassTaxonomyOptions {
private static $instance;
public $taxonomyOptions;
private function __construct() {
$this->taxonomyOptions = array();
}
public static function get_instance() {
if ( null == self::$instance ) {
self::$instance = new self;
}
return self::$instance;
}
public function addTaxonomyOptions( $key, $options ) {
$this->taxonomyOptions[ $key ] = $options;
}
public function getTaxonomyOptions( $key ) {
return $this->taxonomyOptions[ $key ];
}
}
/*
Class: QuartMikadoClassTaxonomyOption
A class that initializes QuartMikadoClass Taxonomy Option
*/
class QuartMikadoClassTaxonomyOption implements iQuartMikadoInterfaceLayoutNode {
public $layout;
private $factory;
public $scope;
function __construct( $scope = "" ) {
$this->layout = array();
$this->factory = new QuartMikadoClassTaxonomyFieldFactory();
$this->scope = $scope;
}
public function hasChidren() {
return ( count( $this->layout ) > 0 ) ? true : false;
}
public function getChild( $key ) {
return $this->layout[ $key ];
}
public function addChild( $key, $value ) {
$this->layout[ $key ] = $value;
}
function render() {
foreach ( $this->layout as $child ) {
$this->renderChild( $child );
}
}
public function renderChild( iQuartMikadoInterfaceRender $child ) {
$child->render( $this->factory );
}
}
/*
Class: QuartMikadoClassUserOptions
A class that initializes QuartMikadoClass User Options
*/
class QuartMikadoClassUserOptions {
private static $instance;
public $userOptions;
private function __construct() {
$this->userOptions = array();
}
public static function get_instance() {
if ( null == self::$instance ) {
self::$instance = new self;
}
return self::$instance;
}
public function addUserOptions( $key, $options ) {
$this->userOptions[ $key ] = $options;
}
public function getUserOptions( $key ) {
return $this->userOptions[ $key ];
}
}
/*
Class: QuartMikadoClassUserOption
A class that initializes QuartMikadoClass User Option
*/
class QuartMikadoClassUserOption implements iQuartMikadoInterfaceLayoutNode {
public $layout;
private $factory;
public $scope;
function __construct( $scope = "" ) {
$this->layout = array();
$this->factory = new QuartMikadoClassUserFieldFactory();
$this->scope = $scope;
}
public function hasChidren() {
return ( count( $this->layout ) > 0 ) ? true : false;
}
public function getChild( $key ) {
return $this->layout[ $key ];
}
public function addChild( $key, $value ) {
$this->layout[ $key ] = $value;
}
function render() {
foreach ( $this->layout as $child ) {
$this->renderChild( $child );
}
}
public function renderChild( iQuartMikadoInterfaceRender $child ) {
$child->render( $this->factory );
}
}
/*
Class: QuartMikadoClassDashboardOptions
A class that initializes QuartMikadoClass Dashboard Options
*/
class QuartMikadoClassDashboardOptions {
private static $instance;
public $dashboardOptions;
private function __construct() {
$this->dashboardOptions = array();
}
public static function get_instance() {
if ( null == self::$instance ) {
self::$instance = new self;
}
return self::$instance;
}
public function addDashboardOptions( $key, $options ) {
$this->dashboardOptions[ $key ] = $options;
}
public function getDashboardOptions( $key ) {
return $this->dashboardOptions[ $key ];
}
}
/*
Class: QuartMikadoClassDashboardOption
A class that initializes QuartMikadoClass Dashboard Option
*/
class QuartMikadoClassDashboardOption implements iQuartMikadoInterfaceLayoutNode {
public $layout;
private $factory;
function __construct() {
$this->layout = array();
$this->factory = new QuartMikadoClassDashboardFieldFactory();
}
public function hasChidren() {
return ( count( $this->layout ) > 0 ) ? true : false;
}
public function getChild( $key ) {
return $this->layout[ $key ];
}
public function addChild( $key, $value ) {
$this->layout[ $key ] = $value;
}
function render() {
foreach ( $this->layout as $child ) {
$this->renderChild( $child );
}
}
public function renderChild( iQuartMikadoInterfaceRender $child ) {
$child->render( $this->factory );
}
}
if ( ! function_exists( 'quart_mikado_init_framework_variable' ) ) {
function quart_mikado_init_framework_variable() {
global $quart_mikado_global_Framework;
$quart_mikado_global_Framework = QuartMikadoClassFramework::get_instance();
$mkdSkinManager = new QuartMikadoClassSkinManager();
$quart_mikado_global_Framework->setSkin( $mkdSkinManager->getSkin() );
}
add_action( 'quart_mikado_action_before_options_map', 'quart_mikado_init_framework_variable' );
}
?>PK ! BMx x lib/mkdf.layout3.phpnu &1i name = $name;
$this->label = $label;
$this->description = $description;
$quart_mikado_global_Framework->mkdMetaBoxes->addOption( $this->name, "" );
}
public function render( $factory ) {
global $post;
?>
label ); ?>
description ); ?>
ID, $this->name, true );
if ( $image_gallery_val != '' ) {
$image_gallery_array = explode( ',', $image_gallery_val );
}
if ( isset( $image_gallery_array ) && count( $image_gallery_array ) != 0 ):
foreach ( $image_gallery_array as $gimg_id ):
$gimage_wp = wp_get_attachment_image_src( $gimg_id, 'thumbnail', true );
echo ' ';
endforeach;
endif;
?>
obtainAccessToken();
if ( $responseObj->status ) {
$message = esc_html__( 'You have successfully connected with your Twitter account. If you have any issues fetching data from Twitter try reconnecting.', 'quart' );
} else {
$message = $responseObj->message;
}
}
$buttonText = $twitterApi->hasUserConnected() ? esc_html__( 'Re-connect with Twitter', 'quart' ) : esc_html__( 'Connect with Twitter', 'quart' );
?>
setConnectionType( 'instagram' );
$instagram_api->instagramStoreCode();
$instagram_api->instagramExchangeCodeForToken();
$message = esc_html__( 'You have successfully connected with your Instagram Personal account.', 'quart' );
}
//check if code parameter and instagram parameter is set in URL
if ( ! empty( $_GET['access_token'] ) && ! empty( $_GET['facebook'] ) ) {
//update code option so we can use it later
$instagram_api->setConnectionType( 'facebook' );
$instagram_api->facebookStoreToken();
$message = esc_html__( 'You have successfully connected with your Instagram Business account.', 'quart' );
}
//check if code parameter and instagram parameter is set in URL
if ( ! empty( $_GET['disconnect'] ) ) {
//update code option so we can use it later
$instagram_api->disconnect();
$message = esc_html__( 'You have have been disconnected from all Instagram accounts.', 'quart' );
}
?>
facebookRequestCode() ); ?>
label = $label;
$this->description = $description;
$this->fields = $fields;
$this->name = $name;
$this->num_of_rows = 1;
$this->button_text = ! empty( $button_text ) ? $button_text : esc_html__( 'Add New Item', 'quart' );
$this->table_layout = $table_layout;
$counter = 0;
foreach ( $this->fields as $field ) {
if ( ! isset( $this->fields[ $counter ]['options'] ) ) {
$this->fields[ $counter ]['options'] = array();
}
if ( ! isset( $this->fields[ $counter ]['args'] ) ) {
$this->fields[ $counter ]['args'] = array();
}
if ( ! isset( $this->fields[ $counter ]['label'] ) ) {
$this->fields[ $counter ]['label'] = '';
}
if ( ! isset( $this->fields[ $counter ]['description'] ) ) {
$this->fields[ $counter ]['description'] = '';
}
if ( ! isset( $this->fields[ $counter ]['default_value'] ) ) {
$this->fields[ $counter ]['default_value'] = '';
}
$counter ++;
}
$quart_mikado_global_Framework->mkdMetaBoxes->addOption( $this->name, '' );
}
public function render( $factory ) {
global $post;
$clones = array();
$wrapper_classes = array();
if ( ! empty( $post ) ) {
$clones = get_post_meta( $post->ID, $this->name, true );
}
$sortable_class = 'sortable';
foreach ( $this->fields as $field ) {
if ( $field['type'] == 'textareahtml' ) {
$sortable_class = '';
break;
}
}
if ( $this->table_layout ) {
$wrapper_classes[] = 'mkdf-repeater-table';
}
?>
label !== '' ) { ?>
label ); ?>
description != '' ) { ?>
description ); ?>
table_layout ) { ?>
fields as $field ) {
$col_width_class = 'col-xs-12';
if ( ! empty( $field['col_width'] ) ) {
$col_width_class = 'col-xs-' . $field['col_width'];
} ?>
0 ) {
$counter = 0;
foreach ( $clones as $clone ) {
?>
fields as $field ) {
$col_width_class = 'col-xs-12';
if ( ! empty( $field['col_width'] ) ) {
$col_width_class = 'col-xs-' . $field['col_width'];
}
?>
0) {
$counter2 = 0;
foreach($clone[$field['name']] as $clone_inner) {
?>
$field,
'repeaterName' => $this->name,
'counter' => $counter,
'fieldInner' => $field_inner,
'counter2' => $counter2
));
$data = $dependencyValues['data'];
$containerClass = $dependencyValues['class'];
}
?>
>
render($field_inner['type'], $field_inner['name'], $field_inner['label'], $field_inner['description'], $field_inner['options'], $field_inner['args'], array('name'=> $this->name . '['.$counter.']['.$field['name'].']', 'index' => $counter2, 'value' => $repeater_inner_field_value));
?>
$field,
'repeaterName' => $this->name,
'counter' => $counter
));
$data = $dependencyValues['data'];
$containerClass = $dependencyValues['class'];
}
?>
>
render($field['type'], $field['name'], $field['label'], $field['description'], $field['options'], $field['args'], array('name'=> $this->name, 'index' => $counter, 'value' => $repeater_field_value));
?>
fields as $field) {
if($field['type'] == 'repeater') {
?>
getOptionValue( 'google_maps_api_key' );
if ( empty( $google_maps_api_key ) ) { ?>
getIconCollectionsEmpty();
$icons_collections = quart_mikado_icon_collections()->getIconCollectionsKeys();
?>
$value ) {
if ( $key == "-1" ) {
$key = "";
} ?>
value="">
getIconCollectionParamNameByKey( $icons_collection );
$field_class = ! empty( $rvalue ) && $rvalue['icon_pack'] == $icons_collection ? 'mkdf-show-field' : 'mkdf-hide-field';
?>
getIconCollection( $icons_collection );
$active_icon = $rvalue[ $icons_param ];
foreach ( $icons->icons as $option => $key ) { ?>
>
mkdOptions->addAdminPage( $slug, $admin_page );
return $admin_page;
}
return false;
}
}
if ( ! function_exists( 'quart_mikado_add_admin_panel' ) ) {
/**
* Generates panel object from given parameters
* $attributes can container:
* $title - title of panel
* $name - name of panel with which it will be registered in admin page
* $page - slug of that page to which to add panel
*
* @param $attributes
*
* @return bool|QuartMikadoClassPanel
*/
function quart_mikado_add_admin_panel( $attributes ) {
$title = '';
$name = '';
$dependency = array();
$args = array();
$page = '';
extract( $attributes );
if ( isset( $page ) && ! empty( $title ) && ! empty( $name ) && quart_mikado_framework()->mkdOptions->adminPageExists( $page ) ) {
$admin_page = quart_mikado_framework()->mkdOptions->getAdminPage( $page );
if ( is_object( $admin_page ) ) {
$panel = new QuartMikadoClassPanel( $title, $name, $args, $dependency);
$admin_page->addChild( $name, $panel );
return $panel;
}
}
return false;
}
}
if ( ! function_exists( 'quart_mikado_add_admin_container' ) ) {
/**
* Generates container object
* $attributes can contain:
* $name - name of the container with which it will be added to parent element
* $parent - parent object to which to add container
*
* @param $attributes
*
* @return bool|QuartMikadoClassContainer
*/
function quart_mikado_add_admin_container( $attributes ) {
$name = '';
$parent = '';
$dependency = array();
extract( $attributes );
if ( ! empty( $name ) && is_object( $parent ) ) {
$container = new QuartMikadoClassContainer( $name, $dependency );
$parent->addChild( $name, $container );
return $container;
}
return false;
}
}
if ( ! function_exists( 'quart_mikado_add_admin_twitter_button' ) ) {
/**
* Generates twitter button field
*
* @param $attributes
*
* @return bool|QuartMikadoClassTwitterFramework
*/
function quart_mikado_add_admin_twitter_button( $attributes ) {
$name = '';
$parent = '';
extract( $attributes );
if ( ! empty( $parent ) && ! empty( $name ) ) {
$field = new QuartMikadoClassTwitterFramework();
if ( is_object( $parent ) ) {
$parent->addChild( $name, $field );
}
return $field;
}
return false;
}
}
if ( ! function_exists( 'quart_mikado_add_admin_instagram_button' ) ) {
/**
* Generates instagram button field
*
* @param $attributes
*
* @return bool|QuartMikadoClassInstagramFramework
*/
function quart_mikado_add_admin_instagram_button( $attributes ) {
$name = '';
$parent = '';
extract( $attributes );
if ( ! empty( $parent ) && ! empty( $name ) ) {
$field = new QuartMikadoClassInstagramFramework();
if ( is_object( $parent ) ) {
$parent->addChild( $name, $field );
}
return $field;
}
return false;
}
}
if ( ! function_exists( 'quart_mikado_add_admin_container_no_style' ) ) {
/**
* Generates container object
* $attributes can contain:
* $name - name of the container with which it will be added to parent element
* $parent - parent object to which to add container
*
* @param $attributes
*
* @return bool|QuartMikadoClassContainerNoStyle
*/
function quart_mikado_add_admin_container_no_style( $attributes ) {
$name = '';
$parent = '';
$args = array();
$dependency = array();
extract( $attributes );
if ( ! empty( $name ) && is_object( $parent ) ) {
$container = new QuartMikadoClassContainerNoStyle( $name, $args, $dependency );
$parent->addChild( $name, $container );
return $container;
}
return false;
}
}
if ( ! function_exists( 'quart_mikado_add_admin_group' ) ) {
/**
* Generates group object
* $attributes can contain:
* $name - name of the group with which it will be added to parent element
* $title - title of group
* $description - description of group
* $parent - parent object to which to add group
*
* @param $attributes
*
* @return bool|QuartMikadoClassGroup
*/
function quart_mikado_add_admin_group( $attributes ) {
$name = '';
$title = '';
$description = '';
$parent = '';
extract( $attributes );
if ( ! empty( $name ) && ! empty( $title ) && is_object( $parent ) ) {
$group = new QuartMikadoClassGroup( $title, $description );
$parent->addChild( $name, $group );
return $group;
}
return false;
}
}
if ( ! function_exists( 'quart_mikado_add_admin_row' ) ) {
/**
* Generates row object
* $attributes can contain:
* $name - name of the group with which it will be added to parent element
* $parent - parent object to which to add row
* $next - whether row has next row. Used to add bottom margin class
*
* @param $attributes
*
* @return bool|QuartMikadoClassRow
*/
function quart_mikado_add_admin_row( $attributes ) {
$parent = '';
$next = false;
$name = '';
extract( $attributes );
if ( is_object( $parent ) ) {
$row = new QuartMikadoClassRow( $next );
$parent->addChild( $name, $row );
return $row;
}
return false;
}
}
if ( ! function_exists( 'quart_mikado_add_admin_field' ) ) {
/**
* Generates admin field object
* $attributes can container:
* $type - type of the field to generate
* $name - name of the field. This will be name of the option in database
* $default_value
* $label - title of the option
* $description
* $options - assoc array of option. Used only for select and radiogroup field types
* $args - assoc array of additional parameters. Used for dependency
* $parent - parent object to which to add field
*
* @param $attributes
*
* @return bool|QuartMikadoClassField
*/
function quart_mikado_add_admin_field( $attributes ) {
$type = '';
$name = '';
$default_value = '';
$label = '';
$description = '';
$options = array();
$args = array();
$parent = '';
$dependency = array();
extract( $attributes );
if ( ! empty( $parent ) && ! empty( $type ) && ! empty( $name ) ) {
$field = new QuartMikadoClassField( $type, $name, $default_value, $label, $description, $options, $args, $dependency );
if ( is_object( $parent ) ) {
$parent->addChild( $name, $field );
return $field;
}
}
return false;
}
}
if ( ! function_exists( 'quart_mikado_add_admin_section_title' ) ) {
/**
* Generates admin title field
* $attributes can contain:
* $parent - parent object to which to add title
* $name - name of title with which to add it to the parent
* $title - title text
*
* @param $attributes
*
* @return bool|QuartMikadoClassTitle
*/
function quart_mikado_add_admin_section_title( $attributes ) {
$parent = '';
$name = '';
$title = '';
extract( $attributes );
if ( is_object( $parent ) && ! empty( $title ) && ! empty( $name ) ) {
$section_title = new QuartMikadoClassTitle( $name, $title );
$parent->addChild( $name, $section_title );
return $section_title;
}
return false;
}
}
if ( ! function_exists( 'quart_mikado_add_admin_notice' ) ) {
/**
* Generates QuartMikadoClassNotice object from given parameters
* $attributes array can contain:
* $title - title of notice object
* $description - description of notice object
* $notice - text of notice to display
* $name - unique name of notice with which it will be added to it's parent
* $parent - object to which to add notice object using addChild method
*
* @param $attributes
*
* @return bool|QuartMikadoClassNotice
*/
function quart_mikado_add_admin_notice( $attributes ) {
$title = '';
$description = '';
$notice = '';
$parent = '';
$name = '';
extract( $attributes );
if ( is_object( $parent ) && ! empty( $title ) && ! empty( $notice ) && ! empty( $name ) ) {
$notice_object = new QuartMikadoClassNotice( $title, $description, $notice);
$parent->addChild( $name, $notice_object );
return $notice_object;
}
return false;
}
}
if ( ! function_exists( 'quart_mikado_framework' ) ) {
/**
* Function that returns instance of QuartMikadoClassFramework class
*
* @return QuartMikadoClassFramework
*/
function quart_mikado_framework() {
return QuartMikadoClassFramework::get_instance();
}
}
if ( ! function_exists( 'quart_mikado_options' ) ) {
/**
* Returns instance of QuartMikadoClassOptions class
*
* @return QuartMikadoClassOptions
*/
function quart_mikado_options() {
return quart_mikado_framework()->mkdOptions;
}
}
if ( ! function_exists( 'quart_mikado_meta_boxes' ) ) {
/**
* Returns instance of QuartMikadoClassMetaBoxes class
*
* @return QuartMikadoClassMetaBoxes
*/
function quart_mikado_meta_boxes() {
return quart_mikado_framework()->mkdMetaBoxes;
}
}
/**
* Meta boxes functions
*/
if ( ! function_exists( 'quart_mikado_create_meta_box' ) ) {
/**
* Adds new meta box
*
* @param $attributes
*
* @return bool|QuartMikadoClassMetaBox
*/
function quart_mikado_create_meta_box( $attributes ) {
$scope = array();
$title = '';
$name = '';
extract( $attributes );
if ( ! empty( $scope ) && $title !== '' && $name !== '' ) {
$meta_box_obj = new QuartMikadoClassMetaBox( $scope, $title, $name );
quart_mikado_framework()->mkdMetaBoxes->addMetaBox( $name, $meta_box_obj );
return $meta_box_obj;
}
return false;
}
}
if ( ! function_exists( 'quart_mikado_create_meta_box_field' ) ) {
/**
* Generates meta box field object
* $attributes can contain:
* $type - type of the field to generate
* $name - name of the field. This will be name of the option in database
* $default_value
* $label - title of the option
* $description
* $options - assoc array of option. Used only for select and radiogroup field types
* $args - assoc array of additional parameters. Used for dependency
* $parent - parent object to which to add field
*
* @param $attributes
*
* @return bool|QuartMikadoClassField
*/
function quart_mikado_create_meta_box_field( $attributes ) {
$type = '';
$name = '';
$default_value = '';
$label = '';
$description = '';
$options = array();
$args = array();
$dependency = array();
$parent = '';
extract( $attributes );
if ( ! empty( $parent ) && ! empty( $type ) && ! empty( $name ) ) {
$field = new QuartMikadoClassMetaField( $type, $name, $default_value, $label, $description, $options, $args, $dependency );
if ( is_object( $parent ) ) {
$parent->addChild( $name, $field );
return $field;
}
}
return false;
}
}
if ( ! function_exists( 'quart_mikado_add_multiple_images_field' ) ) {
/**
* Generates meta box field object
* $attributes can contain:
* $name - name of the field. This will be name of the option in database
* $label - title of the option
* $description
* $parent - parent object to which to add field
*
* @param $attributes
*
* @return bool|QuartMikadoClassField
*/
function quart_mikado_add_multiple_images_field( $attributes ) {
$name = '';
$label = '';
$description = '';
$parent = '';
extract( $attributes );
if ( ! empty( $parent ) && ! empty( $name ) ) {
$field = new QuartMikadoClassMultipleImages( $name, $label, $description );
if ( is_object( $parent ) ) {
$parent->addChild( $name, $field );
return $field;
}
}
return false;
}
}
if ( ! function_exists( 'quart_mikado_get_yes_no_select_array' ) ) {
/**
* Returns array of yes no
* @return array
*/
function quart_mikado_get_yes_no_select_array( $enable_default = true, $set_yes_to_be_first = false ) {
$select_options = array();
if ( $enable_default ) {
$select_options[''] = esc_html__( 'Default', 'quart' );
}
if ( $set_yes_to_be_first ) {
$select_options['yes'] = esc_html__( 'Yes', 'quart' );
$select_options['no'] = esc_html__( 'No', 'quart' );
} else {
$select_options['no'] = esc_html__( 'No', 'quart' );
$select_options['yes'] = esc_html__( 'Yes', 'quart' );
}
return $select_options;
}
}
if ( ! function_exists( 'quart_mikado_get_query_order_by_array' ) ) {
/**
* Returns array of query order by
*
* @param bool $first_empty whether to add empty first member
* @param array $additional_elements
*
* @return array
*/
function quart_mikado_get_query_order_by_array( $first_empty = false, $additional_elements = array() ) {
$orderBy = array();
if ( $first_empty ) {
$orderBy[''] = esc_html__( 'Default', 'quart' );
}
$orderBy['date'] = esc_html__( 'Date', 'quart' );
$orderBy['ID'] = esc_html__( 'ID', 'quart' );
$orderBy['menu_order'] = esc_html__( 'Menu Order', 'quart' );
$orderBy['name'] = esc_html__( 'Post Name', 'quart' );
$orderBy['rand'] = esc_html__( 'Random', 'quart' );
$orderBy['title'] = esc_html__( 'Title', 'quart' );
if ( ! empty( $additional_elements ) ) {
$orderBy = array_merge( $orderBy, $additional_elements );
}
return $orderBy;
}
}
if ( ! function_exists( 'quart_mikado_get_query_order_array' ) ) {
/**
* Returns array of query order
*
* @param bool $first_empty whether to add empty first member
*
* @return array
*/
function quart_mikado_get_query_order_array( $first_empty = false ) {
$order = array();
if ( $first_empty ) {
$order[''] = esc_html__( 'Default', 'quart' );
}
$order['ASC'] = esc_html__( 'ASC', 'quart' );
$order['DESC'] = esc_html__( 'DESC', 'quart' );
return $order;
}
}
if ( ! function_exists( 'quart_mikado_get_number_of_columns_array' ) ) {
/**
* Returns array of columns number
*
* @param bool $first_empty whether to add empty first member
* @param array $removed_items
*
* @return array
*/
function quart_mikado_get_number_of_columns_array( $first_empty = false, $removed_items = array() ) {
$options = array();
if ( $first_empty ) {
$options[''] = esc_html__( 'Default', 'quart' );
}
$options['one'] = esc_html__( 'One', 'quart' );
$options['two'] = esc_html__( 'Two', 'quart' );
$options['three'] = esc_html__( 'Three', 'quart' );
$options['four'] = esc_html__( 'Four', 'quart' );
$options['five'] = esc_html__( 'Five', 'quart' );
$options['six'] = esc_html__( 'Six', 'quart' );
if ( ! empty( $removed_items ) ) {
foreach ( $removed_items as $removed_item ) {
unset( $options[ $removed_item ] );
}
}
return $options;
}
}
if ( ! function_exists( 'quart_mikado_get_space_between_items_array' ) ) {
/**
* Returns array of space between items
*
* @param bool $first_empty whether to add empty first member
* @param array $disable_by_keys
*
* @return array
*/
function quart_mikado_get_space_between_items_array( $first_empty = false, $disable_by_keys = array() ) {
$options = array();
if ( $first_empty ) {
$options[''] = esc_html__( 'Default', 'quart' );
}
$options['huge'] = esc_html__( 'Huge (40)', 'quart' );
$options['large'] = esc_html__( 'Large (25)', 'quart' );
$options['medium'] = esc_html__( 'Medium (20)', 'quart' );
$options['normal'] = esc_html__( 'Normal (15)', 'quart' );
$options['small'] = esc_html__( 'Small (10)', 'quart' );
$options['tiny'] = esc_html__( 'Tiny (5)', 'quart' );
$options['no'] = esc_html__( 'No (0)', 'quart' );
if ( ! empty( $disable_by_keys ) ) {
foreach ( $disable_by_keys as $key ) {
if ( array_key_exists( $key, $options ) ) {
unset( $options[ $key ] );
}
}
}
return $options;
}
}
if ( ! function_exists( 'quart_mikado_get_link_target_array' ) ) {
/**
* Returns array of link target
*
* @param bool $first_empty whether to add empty first member
*
* @return array
*/
function quart_mikado_get_link_target_array( $first_empty = false ) {
$order = array();
if ( $first_empty ) {
$order[''] = esc_html__( 'Default', 'quart' );
}
$order['_self'] = esc_html__( 'Same Window', 'quart' );
$order['_blank'] = esc_html__( 'New Window', 'quart' );
return $order;
}
}
if ( ! function_exists( 'quart_mikado_get_title_tag' ) ) {
/**
* Returns array of title tags
*
* @param bool $first_empty
* @param array $additional_elements
*
* @return array
*/
function quart_mikado_get_title_tag( $first_empty = false, $additional_elements = array() ) {
$title_tag = array();
if ( $first_empty ) {
$title_tag[''] = esc_html__( 'Default', 'quart' );
}
$title_tag['h1'] = 'h1';
$title_tag['h2'] = 'h2';
$title_tag['h3'] = 'h3';
$title_tag['h4'] = 'h4';
$title_tag['h5'] = 'h5';
$title_tag['h6'] = 'h6';
if ( ! empty( $additional_elements ) ) {
$title_tag = array_merge( $title_tag, $additional_elements );
}
return $title_tag;
}
}
if ( ! function_exists( 'quart_mikado_get_font_weight_array' ) ) {
/**
* Returns array of font weights
*
* @param bool $first_empty whether to add empty first member
*
* @return array
*/
function quart_mikado_get_font_weight_array( $first_empty = false ) {
$font_weights = array();
if ( $first_empty ) {
$font_weights[''] = esc_html__( 'Default', 'quart' );
}
$font_weights['100'] = esc_html__( '100 Thin', 'quart' );
$font_weights['200'] = esc_html__( '200 Thin-Light', 'quart' );
$font_weights['300'] = esc_html__( '300 Light', 'quart' );
$font_weights['400'] = esc_html__( '400 Normal', 'quart' );
$font_weights['500'] = esc_html__( '500 Medium', 'quart' );
$font_weights['600'] = esc_html__( '600 Semi-Bold', 'quart' );
$font_weights['700'] = esc_html__( '700 Bold', 'quart' );
$font_weights['800'] = esc_html__( '800 Extra-Bold', 'quart' );
$font_weights['900'] = esc_html__( '900 Ultra-Bold', 'quart' );
return $font_weights;
}
}
if ( ! function_exists( 'quart_mikado_get_font_style_array' ) ) {
/**
* Returns array of font styles
*
* @param bool $first_empty
*
* @return array
*/
function quart_mikado_get_font_style_array( $first_empty = false ) {
$font_styles = array();
if ( $first_empty ) {
$font_styles[''] = esc_html__( 'Default', 'quart' );
}
$font_styles['normal'] = esc_html__( 'Normal', 'quart' );
$font_styles['italic'] = esc_html__( 'Italic', 'quart' );
$font_styles['oblique'] = esc_html__( 'Oblique', 'quart' );
$font_styles['initial'] = esc_html__( 'Initial', 'quart' );
$font_styles['inherit'] = esc_html__( 'Inherit', 'quart' );
return $font_styles;
}
}
if ( ! function_exists( 'quart_mikado_get_text_transform_array' ) ) {
/**
* Returns array of text transforms
*
* @param bool $first_empty
*
* @return array
*/
function quart_mikado_get_text_transform_array( $first_empty = false ) {
$text_transforms = array();
if ( $first_empty ) {
$text_transforms[''] = esc_html__( 'Default', 'quart' );
}
$text_transforms['none'] = esc_html__( 'None', 'quart' );
$text_transforms['capitalize'] = esc_html__( 'Capitalize', 'quart' );
$text_transforms['uppercase'] = esc_html__( 'Uppercase', 'quart' );
$text_transforms['lowercase'] = esc_html__( 'Lowercase', 'quart' );
$text_transforms['initial'] = esc_html__( 'Initial', 'quart' );
$text_transforms['inherit'] = esc_html__( 'Inherit', 'quart' );
return $text_transforms;
}
}
if ( ! function_exists( 'quart_mikado_get_text_decorations' ) ) {
/**
* Returns array of text transforms
*
* @param bool $first_empty
*
* @return array
*/
function quart_mikado_get_text_decorations( $first_empty = false ) {
$text_decorations = array();
if ( $first_empty ) {
$text_decorations[''] = esc_html__( 'Default', 'quart' );
}
$text_decorations['none'] = esc_html__( 'None', 'quart' );
$text_decorations['underline'] = esc_html__( 'Underline', 'quart' );
$text_decorations['overline'] = esc_html__( 'Overline', 'quart' );
$text_decorations['line-through'] = esc_html__( 'Line-Through', 'quart' );
$text_decorations['initial'] = esc_html__( 'Initial', 'quart' );
$text_decorations['inherit'] = esc_html__( 'Inherit', 'quart' );
return $text_decorations;
}
}
if ( ! function_exists( 'quart_mikado_is_font_option_valid' ) ) {
/**
* Checks if font family option is valid (different that -1)
*
* @param $option_name
*
* @return bool
*/
function quart_mikado_is_font_option_valid( $option_name ) {
return $option_name !== '-1' && $option_name !== '';
}
}
if ( ! function_exists( 'quart_mikado_get_font_option_val' ) ) {
/**
* Returns font option value without + so it can be used in css
*
* @param $option_val
*
* @return mixed
*/
function quart_mikado_get_font_option_val( $option_val ) {
$option_val = str_replace( '+', ' ', $option_val );
return $option_val;
}
}
if ( ! function_exists( 'quart_mikado_get_icon_sources_array' ) ) {
/**
* Returns array of icon sources
*
* @param bool $first_empty
* @param bool $enable_predefined
*
* @return array
*/
function quart_mikado_get_icon_sources_array( $first_empty = false, $enable_predefined = true ) {
$icon_sources = array();
if ( $first_empty ) {
$icon_sources[''] = esc_html__( 'Default', 'quart' );
}
$icon_sources['icon_pack'] = esc_html__( 'Icon Pack', 'quart' );
$icon_sources['svg_path'] = esc_html__( 'SVG Path', 'quart' );
if ( $enable_predefined ) {
$icon_sources['predefined'] = esc_html__( 'Predefined', 'quart' );
}
return $icon_sources;
}
}
if ( ! function_exists( 'quart_mikado_get_icon_sources_class' ) ) {
/**
* Returns class for icon sources
*
* @param string $option_name
* @param string $class_prefix
*
* @return string
*/
function quart_mikado_get_icon_sources_class( $option_name = '', $class_prefix = '' ) {
$class = '';
if ( ! empty( $option_name ) && ! empty( $class_prefix ) ) {
$icon_source = quart_mikado_options()->getOptionValue( $option_name . '_icon_source' );
if ( $icon_source === 'icon_pack' ) {
$class = $class_prefix . '-icon-pack';
} else if ( $icon_source === 'svg_path' ) {
$class = $class_prefix . '-svg-path';
} else if ( $icon_source === 'predefined' ) {
$class = $class_prefix . '-predefined';
}
}
return $class;
}
}
if ( ! function_exists( 'quart_mikado_get_icon_sources_html' ) ) {
/**
* Returns html for icon sources
*
* @param string $option_name
* @param bool $is_close_icon
* @param array $args
*
* @return string/html
*/
function quart_mikado_get_icon_sources_html( $option_name = '', $is_close_icon = false, $args = array() ) {
$html = '';
if ( ! empty( $option_name ) ) {
$icon_source = quart_mikado_options()->getOptionValue( $option_name . '_icon_source' );
$icon_pack = quart_mikado_options()->getOptionValue( $option_name . '_icon_pack' );
$icon_svg_path = quart_mikado_options()->getOptionValue( $option_name . '_icon_svg_path' );
$close_icon_svg_path = quart_mikado_options()->getOptionValue( $option_name . '_close_icon_svg_path' );
$is_search_icon = isset( $args['search'] ) && $args['search'] === 'yes';
$is_dropdown_cart = isset( $args['dropdown_cart'] ) && $args['dropdown_cart'] === 'yes';
if ( $icon_source === 'icon_pack' && isset( $icon_pack ) ) {
if ( $is_search_icon ) {
if ( $is_close_icon ) {
$html .= quart_mikado_icon_collections()->getSearchClose( $icon_pack, true );
} else {
$html .= quart_mikado_icon_collections()->getSearchIcon( $icon_pack, true );
}
} else if ( $is_dropdown_cart ) {
$html .= quart_mikado_icon_collections()->getDropdownCartIcon( $icon_pack, true );
} else if ( $is_close_icon ) {
$html .= quart_mikado_icon_collections()->getMenuCloseIcon( $icon_pack, true );
} else {
$html .= quart_mikado_icon_collections()->getMenuIcon( $icon_pack, true );
}
} else if ( ( isset( $icon_svg_path ) && ! empty( $icon_svg_path ) ) || ( isset( $close_icon_svg_path ) && ! empty( $close_icon_svg_path ) ) ) {
if ( $is_close_icon ) {
$html .= $close_icon_svg_path;
} else {
$html .= $icon_svg_path;
}
} else if ( $icon_source === 'predefined' ) {
if ( $is_close_icon ) {
$html .= quart_mikado_icon_collections()->getMenuCloseIcon( 'font_elegant', true );
} else {
$html .= '';
$html .= ' ';
$html .= ' ';
$html .= ' ';
}
}
}
return $html;
}
}
if ( ! function_exists( 'quart_mikado_is_customizer_item_enabled' ) ) {
/**
* Function check is item enabled throw customizer options
*
* @param $item string - module path
* @param $option_name string - customizer option name
* @param $is_item_id_class bool
*
* @return bool
*/
function quart_mikado_is_customizer_item_enabled( $item, $option_name, $is_item_id_class = false ) {
$item_slug = $is_item_id_class ? $item : basename( dirname( $item ) );
$item_id_class = str_replace( '-', '_', $item_slug );
$item_option = get_option( $option_name . $item_id_class );
$is_item_enabled = empty( $item_option );
return $is_item_enabled;
}
}
if ( ! function_exists( 'quart_mikado_add_repeater_field' ) ) {
/**
* Generates meta box field object
* $attributes can contain:
* $name - name of the field. This will be name of the option in database
* $label - title of the option
* $description
* $field_type - type of the field that will be rendered and repeated
* $parent - parent object to which to add field
*
* @param $attributes
*
* @return bool|RepeaterField
*/
function quart_mikado_add_repeater_field( $attributes ) {
$name = '';
$label = '';
$description = '';
$fields = array();
$parent = '';
$button_text = '';
$table_layout = false;
extract( $attributes );
if ( ! empty( $parent ) && ! empty( $name ) ) {
$field = new QuartMikadoClassRepeater( $fields, $name, $label, $description, $button_text, $table_layout );
if ( is_object( $parent ) ) {
$parent->addChild( $name, $field );
return $field;
}
}
return false;
}
}
/**
* Taxonomy fields function
*/
if ( ! function_exists( 'quart_mikado_add_taxonomy_fields' ) ) {
/**
* Adds new meta box
*
* @param $attributes
*
* @return bool|MikadoMetaBox
*/
function quart_mikado_add_taxonomy_fields( $attributes ) {
$scope = array();
$name = '';
extract( $attributes );
if ( ! empty( $scope ) ) {
$tax_obj = new QuartMikadoClassTaxonomyOption( $scope );
quart_mikado_framework()->mkdTaxonomyOptions->addTaxonomyOptions( $name, $tax_obj );
return $tax_obj;
}
return false;
}
}
if ( ! function_exists( 'quart_mikado_add_taxonomy_field' ) ) {
/**
* Generates meta box field object
* $attributes can contain:
* $type - type of the field to generate
* $name - name of the field. This will be name of the option in database
* $label - title of the option
* $description
* $options - assoc array of option. Used only for select and radiogroup field types
* $args - assoc array of additional parameters. Used for dependency
* $parent - parent object to which to add field
*
* @param $attributes
*
* @return bool|RepeaterField
*/
function quart_mikado_add_taxonomy_field( $attributes ) {
$type = '';
$name = '';
$label = '';
$description = '';
$options = array();
$args = array();
$parent = '';
extract( $attributes );
if ( ! empty( $parent ) && ! empty( $name ) ) {
$field = new QuartMikadoClassTaxonomyField( $type, $name, $label, $description, $options, $args);
if ( is_object( $parent ) ) {
$parent->addChild( $name, $field );
return $field;
}
}
return false;
}
}
/**
* User fields function
*/
if ( ! function_exists( 'quart_mikado_add_user_fields' ) ) {
/**
* Adds new meta box
*
* @param $attributes
*
* @return bool|MikadoMetaBox
*/
function quart_mikado_add_user_fields( $attributes ) {
$scope = array();
$name = '';
extract( $attributes );
if ( ! empty( $scope ) ) {
$user_obj = new QuartMikadoClassUserOption( $scope );
quart_mikado_framework()->mkdUserOptions->addUserOptions( $name, $user_obj );
return $user_obj;
}
return false;
}
}
if ( ! function_exists( 'quart_mikado_add_user_field' ) ) {
/**
* Generates meta box field object
* $attributes can contain:
* $type - type of the field to generate
* $name - name of the field. This will be name of the option in database
* $label - title of the option
* $description
* $options - assoc array of option. Used only for select and radiogroup field types
* $args - assoc array of additional parameters. Used for dependency
* $parent - parent object to which to add field
*
* @param $attributes
*
* @return bool|RepeaterField
*/
function quart_mikado_add_user_field( $attributes ) {
$type = '';
$name = '';
$label = '';
$description = '';
$options = array();
$args = array();
$parent = '';
extract( $attributes );
if ( ! empty( $parent ) && ! empty( $name ) ) {
$field = new QuartMikadoClassUserField( $type, $name, $label, $description, $options, $args );
if ( is_object( $parent ) ) {
$parent->addChild( $name, $field );
return $field;
}
}
return false;
}
}
if ( ! function_exists( 'quart_mikado_add_user_group' ) ) {
/**
* Generates group object
* $attributes can contain:
* $name - name of the group with which it will be added to parent element
* $title - title of group
* $description - description of group
* $parent - parent object to which to add group
*
* @param $attributes
*
* @return bool|QuartMikadoClassUserGroup
*/
function quart_mikado_add_user_group( $attributes ) {
$name = '';
$title = '';
$description = '';
$parent = '';
extract( $attributes );
if ( ! empty( $name ) && ! empty( $title ) && is_object( $parent ) ) {
$group = new QuartMikadoClassUserGroup( $title, $description );
$parent->addChild( $name, $group );
return $group;
}
return false;
}
}
/**
* Dashboard fields function
*/
if ( ! function_exists( 'quart_mikado_add_dashboard_fields' ) ) {
/**
* Adds new meta box
*
* @param $attributes
*
* @return bool|QuartMikadoClassDashboardOption
*/
function quart_mikado_add_dashboard_fields( $attributes ) {
$name = '';
extract( $attributes );
if ( $name !== '') {
$dash_obj = new QuartMikadoClassDashboardOption();
quart_mikado_framework()->mkdDashboardOptions->addDashboardOptions( $name, $dash_obj );
return $dash_obj;
}
return false;
}
}
if ( ! function_exists( 'quart_mikado_add_dashboard_form' ) ) {
/**
* Generates form object
* $attributes can contain:
* $name - name of the form with which it will be added to parent element
* $parent - parent object to which to add form
* $form_id - id of form generated
* $form_method - method for form generated
* $form_nonce - nonce for form generated
*
* @param $attributes
*
* @return bool|QuartMikadoClassContainer
*/
function quart_mikado_add_dashboard_form( $attributes ) {
$name = '';
$form_id = '';
$form_method = 'post';
$form_action = '';
$form_nonce_action = '';
$form_nonce_name = '';
$button_label = esc_html__('SUMBIT','quart');
$button_args = array();
$parent = '';
extract( $attributes );
if ( ! empty( $name ) && is_object( $parent ) && $form_id !== '') {
$container = new QuartMikadoClassDashboardForm( $name, $form_id, $form_method, $form_action, $form_nonce_action, $form_nonce_name, $button_label, $button_args);
$parent->addChild( $name, $container );
return $container;
}
return false;
}
}
if ( ! function_exists( 'quart_mikado_add_dashboard_group' ) ) {
/**
* Generates form object
* $attributes can contain:
* $name - name of the form with which it will be added to parent element
* $parent - parent object to which to add form
*
* @param $attributes
*
* @return bool|QuartMikadoClassContainer
*/
function quart_mikado_add_dashboard_group( $attributes ) {
$name = '';
$title = '';
$description = '';
$parent = '';
extract( $attributes );
if ( ! empty( $name ) && is_object( $parent ) ) {
$container = new QuartMikadoClassDashboardGroup( $name, $title, $description );
$parent->addChild( $name, $container );
return $container;
}
return false;
}
}
if ( ! function_exists( 'quart_mikado_add_dashboard_section_title' ) ) {
/**
* Generates dashboard title field
* $attributes can contain:
* $parent - parent object to which to add title
* $name - name of title with which to add it to the parent
* $title - title text
*
* @param $attributes
*
* @return bool|QuartMikadoClassDashboardTitle
*/
function quart_mikado_add_dashboard_section_title( $attributes ) {
$parent = '';
$name = '';
$title = '';
$args = array();
extract( $attributes );
if ( is_object( $parent ) && ! empty( $title ) && ! empty( $name ) ) {
$section_title = new QuartMikadoClassDashboardTitle( $name, $title, $args );
$parent->addChild( $name, $section_title );
return $section_title;
}
return false;
}
}
if ( ! function_exists( 'quart_mikado_add_dashboard_repeater_field' ) ) {
/**
* Generates meta box field object
* $attributes can contain:
* $name - name of the field. This will be name of the option in database
* $label - title of the option
* $description
* $field_type - type of the field that will be rendered and repeated
* $parent - parent object to which to add field
*
* @param $attributes
*
* @return bool|QuartMikadoClassDashboardRepeater
*/
function quart_mikado_add_dashboard_repeater_field( $attributes ) {
$name = '';
$label = '';
$description = '';
$fields = array();
$parent = '';
$button_text = '';
$table_layout = false;
$value = array();
extract( $attributes );
if ( ! empty( $parent ) && ! empty( $name ) ) {
$field = new QuartMikadoClassDashboardRepeater( $fields, $name, $label, $description, $button_text, $table_layout, $value);
if ( is_object( $parent ) ) {
$parent->addChild( $name, $field );
return $field;
}
}
return false;
}
}
if ( ! function_exists( 'quart_mikado_add_dashboard_field' ) ) {
/**
* Generates dashboard field object
* $attributes can contain:
* $type - type of the field to generate
* $name - name of the field. This will be name of the option in database
* $label - title of the option
* $description
* $options - assoc array of option. Used only for select and radiogroup field types
* $args - assoc array of additional parameters. Used for dependency
* $parent - parent object to which to add field
* $hidden_property - name of option that hides field
* $hidden_values - array of valus of $hidden_property that hides field
*
* @param $attributes
*
* @return bool|QuartMikadoClassDashboardField
*/
function quart_mikado_add_dashboard_field( $attributes ) {
$type = '';
$name = '';
$label = '';
$description = '';
$options = array();
$args = array();
$value = '';
$parent = '';
$repeat = array();
extract( $attributes );
if ( ! empty( $parent ) && ! empty( $name ) ) {
$field = new QuartMikadoClassDashboardField( $type, $name, $label, $description, $options, $args, $value, $repeat);
if ( is_object( $parent ) ) {
$parent->addChild( $name, $field );
return $field;
}
}
return false;
}
}PK ! 53b| | lib/mkdf.layout2.phpnu &1i
' . $label . ' ';
echo wp_kses( $html, array(
'input' => array(
'type' => true,
'name' => true,
'value' => true,
'checked' => true
),
'br' => true
) );
}
}
class QuartMikadoClassFieldRadioGroup extends QuartMikadoClassFieldType {
public function render( $name, $label = "", $description = "", $options = array(), $args = array() ) {
$use_images = isset( $args["use_images"] ) && $args["use_images"] ? true : false;
$hide_labels = isset( $args["hide_labels"] ) && $args["hide_labels"] ? true : false;
$hide_radios = $use_images ? 'display: none' : '';
$checked_value = quart_mikado_option_get_value( $name );
?>
';
$html .= '';
$html .= '
';
$html .= '
';
$html .= '
';
$html .= ' ';
$html .= ' ' . $label . ' ';
$html .= ' ';
$html .= '
'; //close col-lg-3
$html .= '
'; //close row
$html .= '
'; //close container-fluid
$html .= '
'; //close mkdf-section-content
$html .= ''; //close mkdf-page-form-section
echo wp_kses( $html, array(
'input' => array(
'type' => true,
'id' => true,
'name' => true,
'value' => true,
'checked' => true,
'class' => true,
'disabled' => true
),
'div' => array(
'class' => true
),
'br' => true,
'label' => array(
'for' => true
)
) );
}
}
class QuartMikadoClassFieldDate extends QuartMikadoClassFieldType {
public function render( $name, $label = "", $description = "", $options = array(), $args = array(), $repeat = array() ) {
$col_width = 2;
if ( isset( $args["col_width"] ) ) {
$col_width = $args["col_width"];
}
$suffix = ! empty( $args['suffix'] ) ? $args['suffix'] : false;
$class = '';
if ( ! empty( $repeat ) && array_key_exists( 'name', $repeat ) && array_key_exists( 'index', $repeat ) ) {
$id = $name . '-' . $repeat['index'];
$name = $repeat['name'] . '[' . $repeat['index'] . '][' . $name . ']';
$value = $repeat['value'];
} else {
$id = $name;
$value = quart_mikado_option_get_value( $name );
}
if ( $label === '' && $description === '' ) {
$class .= ' mkdf-no-description';
}
if ( isset( $args['custom_class'] ) && $args['custom_class'] != '' ) {
$class .= ' ' . $args['custom_class'];
}
$data_string = '';
if ( isset( $args['input-data'] ) && $args['input-data'] != '' ) {
foreach ( $args['input-data'] as $data_key => $data_value ) {
$data_string .= $data_key . '=' . $data_value;
$data_string .= ' ';
}
}
?>
render( $name, $label, $description, $options, $args, $repeat );
break;
case 'textsimple':
$field = new QuartMikadoClassFieldTextSimple();
$field->render( $name, $label, $description, $options, $args );
break;
case 'textarea':
$field = new QuartMikadoClassFieldTextArea();
$field->render( $name, $label, $description, $options, $args, $repeat );
break;
case 'textareasimple':
$field = new QuartMikadoClassFieldTextAreaSimple();
$field->render( $name, $label, $description, $options, $args );
break;
case 'textareahtml':
$field = new QuartMikadoClassFieldTextAreaHtml();
$field->render( $name, $label, $description, $options, $args, $repeat );
break;
case 'color':
$field = new QuartMikadoClassFieldColor();
$field->render( $name, $label, $description, $options, $args, $repeat );
break;
case 'colorsimple':
$field = new QuartMikadoClassFieldColorSimple();
$field->render( $name, $label, $description, $options, $args );
break;
case 'image':
$field = new QuartMikadoClassFieldImage();
$field->render( $name, $label, $description, $options, $args, $repeat );
break;
case 'imagesimple':
$field = new QuartMikadoClassFieldImageSimple();
$field->render( $name, $label, $description, $options, $args );
break;
case 'font':
$field = new QuartMikadoClassFieldFont();
$field->render( $name, $label, $description, $options, $args, $repeat );
break;
case 'fontsimple':
$field = new QuartMikadoClassFieldFontSimple();
$field->render( $name, $label, $description, $options, $args );
break;
case 'select':
$field = new QuartMikadoClassFieldSelect();
$field->render( $name, $label, $description, $options, $args, $repeat );
break;
case 'selectblank':
$field = new QuartMikadoClassFieldSelectBlank();
$field->render( $name, $label, $description, $options, $args, $repeat );
break;
case 'selectsimple':
$field = new QuartMikadoClassFieldSelectSimple();
$field->render( $name, $label, $description, $options, $args );
break;
case 'selectblanksimple':
$field = new QuartMikadoClassFieldSelectBlankSimple();
$field->render( $name, $label, $description, $options, $args );
break;
case 'yesno':
$field = new QuartMikadoClassFieldYesNo();
$field->render( $name, $label, $description, $options, $args, $repeat );
break;
case 'yesnosimple':
$field = new QuartMikadoClassFieldYesNoSimple();
$field->render( $name, $label, $description, $options, $args );
break;
case 'portfoliofollow':
$field = new QuartMikadoClassFieldPortfolioFollow();
$field->render( $name, $label, $description, $options, $args );
break;
case 'zeroone':
$field = new QuartMikadoClassFieldZeroOne();
$field->render( $name, $label, $description, $options, $args );
break;
case 'imagevideo':
$field = new QuartMikadoClassFieldImageVideo();
$field->render( $name, $label, $description, $options, $args );
break;
case 'yesempty':
$field = new QuartMikadoClassFieldYesEmpty();
$field->render( $name, $label, $description, $options, $args );
break;
case 'file':
$field = new QuartMikadoClassFieldFile();
$field->render( $name, $label, $description, $options, $args, $repeat );
break;
case 'flagpost':
$field = new QuartMikadoClassFieldFlagPost();
$field->render( $name, $label, $description, $options, $args );
break;
case 'flagpage':
$field = new QuartMikadoClassFieldFlagPage();
$field->render( $name, $label, $description, $options, $args );
break;
case 'flagmedia':
$field = new QuartMikadoClassFieldFlagMedia();
$field->render( $name, $label, $description, $options, $args );
break;
case 'flagportfolio':
$field = new QuartMikadoClassFieldFlagPortfolio();
$field->render( $name, $label, $description, $options, $args );
break;
case 'flagproduct':
$field = new QuartMikadoClassFieldFlagProduct();
$field->render( $name, $label, $description, $options, $args );
break;
case 'range':
$field = new QuartMikadoClassFieldRange();
$field->render( $name, $label, $description, $options, $args );
break;
case 'rangesimple':
$field = new QuartMikadoClassFieldRangeSimple();
$field->render( $name, $label, $description, $options, $args );
break;
case 'radio':
$field = new QuartMikadoClassFieldRadio();
$field->render( $name, $label, $description, $options, $args );
break;
case 'checkbox':
$field = new QuartMikadoClassFieldCheckBox();
$field->render( $name, $label, $description, $options, $args );
break;
case 'date':
$field = new QuartMikadoClassFieldDate();
$field->render( $name, $label, $description, $options, $args, $repeat );
break;
case 'radiogroup':
$field = new QuartMikadoClassFieldRadioGroup();
$field->render( $name, $label, $description, $options, $args );
break;
case 'checkboxgroup':
$field = new QuartMikadoClassFieldCheckBoxGroup();
$field->render( $name, $label, $description, $options, $args, $repeat );
break;
case 'address':
$field = new QuartMikadoClassFieldAddress();
$field->render( $name, $label, $description, $options, $args, $repeat );
break;
case 'icon':
$field = new QuartMikadoClassFieldIcon();
$field->render( $name, $label, $description, $options, $args, $repeat );
break;
default:
break;
}
}
}PK ! ˹m m lib/mkdf.functions.phpnu &1i mkdOptions->options ) ) {
return isset( $quart_mikado_global_options[ $name ] ) && $quart_mikado_global_options[ $name ] !== '';
} else {
global $post;
$value = get_post_meta( $post->ID, $name, true );
return isset( $value ) && $value !== '';
}
}
/**
* Function that gets option by it's name.
* It first checks if option exists in $quart_mikado_global_options global array and if it does'nt exists there
* it checks default theme options array.
*
* @param $name string name of the option to retrieve
*
* @return mixed|void
*/
function quart_mikado_option_get_value( $name ) {
global $quart_mikado_global_options;
global $quart_mikado_global_Framework;
if ( array_key_exists( $name, $quart_mikado_global_Framework->mkdOptions->options ) ) {
if ( isset( $quart_mikado_global_options[ $name ] ) && $quart_mikado_global_options[ $name ] !== '' ) {
return $quart_mikado_global_options[ $name ];
} else {
return $quart_mikado_global_Framework->mkdOptions->getOption( $name );
}
} else {
global $post;
if ( ! empty( $post ) ) {
$value = get_post_meta( $post->ID, $name, true );
}
if ( isset( $value ) && $value !== '' ) {
return $value;
} else {
return $quart_mikado_global_Framework->mkdMetaBoxes->getOption( $name );
}
}
}
/**
* Function that gets attachment thumbnail url from attachment url
*
* @param $attachment_url string url of the attachment
*
* @return bool|string
*
* @see quart_mikado_get_attachment_id_from_url()
*/
function quart_mikado_get_attachment_thumb_url( $attachment_url ) {
$attachment_id = quart_mikado_get_attachment_id_from_url( $attachment_url );
if ( ! empty( $attachment_id ) ) {
return wp_get_attachment_thumb_url( $attachment_id );
} else {
return $attachment_url;
}
}
/**
* Function that registers skin style. Wrapper around wp_register_style function,
* it prepends $src with skin path
*
* @param $handle string unique key for style
* @param $src string path inside skin folder
* @param array $deps array of handles that style will depend on
* @param bool|string $ver whether to add version string or not.
* @param string $media media for which to add style. Defaults to 'all'
*
* @see wp_register_style()
*/
function quart_mikado_register_skin_style( $handle, $src, $deps = array(), $ver = false, $media = 'all' ) {
global $quart_mikado_global_Framework;
$src = get_template_directory_uri() . '/framework/admin/skins/' . $quart_mikado_global_Framework->getSkin() . '/' . $src;
wp_register_style( $handle, $src, $deps = array(), $ver = false, $media = 'all' );
}
/**
* Function that registers skin script. Wrapper around wp_register_script function,
* it prepends $src with skin path
*
* @param $handle string unique key for style
* @param $src string path inside skin folder
* @param array $deps array of handles that style will depend on
* @param bool|string $ver whether to add version string or not.
* @param bool $in_footer whether to include script in footer or not.
*
* @see wp_register_script()
*/
function quart_mikado_register_skin_script( $handle, $src, $deps = array(), $ver = false, $in_footer = false ) {
global $quart_mikado_global_Framework;
$src = get_template_directory_uri() . '/framework/admin/skins/' . $quart_mikado_global_Framework->getSkin() . '/' . $src;
wp_register_script( $handle, $src, $deps, $ver, $in_footer );
}
if ( ! function_exists( 'quart_mikado_generate_dynamic_css_and_js' ) ) {
/**
* Function that gets content of dynamic assets files and puts that in static ones
*/
function quart_mikado_generate_dynamic_css_and_js() {
global $wp_filesystem;
WP_Filesystem();
if ( quart_mikado_is_css_folder_writable() ) {
$css_dir = MIKADO_ASSETS_ROOT_DIR . '/css/';
ob_start();
include_once $css_dir . 'style_dynamic.php';
$css = ob_get_clean();
if ( is_multisite() ) {
$wp_filesystem->put_contents( $css_dir . 'style_dynamic_ms_id_' . quart_mikado_get_multisite_blog_id() . '.css', $css );
} else {
$wp_filesystem->put_contents( $css_dir . 'style_dynamic.css', $css );
}
ob_start();
include_once $css_dir . 'style_dynamic_responsive.php';
$css = ob_get_clean();
if ( is_multisite() ) {
$wp_filesystem->put_contents( $css_dir . 'style_dynamic_responsive_ms_id_' . quart_mikado_get_multisite_blog_id() . '.css', $css );
} else {
$wp_filesystem->put_contents( $css_dir . 'style_dynamic_responsive.css', $css );
}
}
}
add_action( 'quart_mikado_action_after_theme_option_save', 'quart_mikado_generate_dynamic_css_and_js' );
}
if ( ! function_exists( 'quart_mikado_gallery_upload_get_images' ) ) {
/**
* Function that outputs single image html that is used in multiple image upload field
* Hooked to wp_ajax_quart_mikado_gallery_upload_get_images action
*/
function quart_mikado_gallery_upload_get_images() {
$ids = sanitize_text_field( $_POST['ids'] );
$ids = explode( ",", $ids );
foreach ( $ids as $id ):
$image = wp_get_attachment_image_src( $id, 'thumbnail', true );
echo ' ';
endforeach;
exit;
}
add_action( 'wp_ajax_quart_mikado_gallery_upload_get_images', 'quart_mikado_gallery_upload_get_images' );
}
if ( ! function_exists( 'quart_mikado_hex2rgb' ) ) {
/**
* Function that transforms hex color to rgb color
*
* @param $hex string original hex string
*
* @return array array containing three elements (r, g, b)
*/
function quart_mikado_hex2rgb( $hex ) {
$hex = str_replace( "#", "", $hex );
if ( strlen( $hex ) == 3 ) {
$r = hexdec( substr( $hex, 0, 1 ) . substr( $hex, 0, 1 ) );
$g = hexdec( substr( $hex, 1, 1 ) . substr( $hex, 1, 1 ) );
$b = hexdec( substr( $hex, 2, 1 ) . substr( $hex, 2, 1 ) );
} else {
$r = hexdec( substr( $hex, 0, 2 ) );
$g = hexdec( substr( $hex, 2, 2 ) );
$b = hexdec( substr( $hex, 4, 2 ) );
}
$rgb = array( $r, $g, $b );
//return implode(",", $rgb); // returns the rgb values separated by commas
return $rgb; // returns an array with the rgb values
}
}
if ( ! function_exists( 'quart_mikado_get_attachment_meta' ) ) {
/**
* Function that returns attachment meta data from attachment id
*
* @param $attachment_id
* @param array $keys sub array of attachment meta
*
* @return array|mixed
*/
function quart_mikado_get_attachment_meta( $attachment_id, $keys = array() ) {
$meta_data = array();
//is attachment id set?
if ( ! empty( $attachment_id ) ) {
//get all post meta for given attachment id
$meta_data = get_post_meta( $attachment_id, '_wp_attachment_metadata', true );
//is subarray of meta array keys set?
if ( is_array( $keys ) && count( $keys ) ) {
$sub_array = array();
//for each defined key
foreach ( $keys as $key ) {
//check if that key exists in all meta array
if ( array_key_exists( $key, $meta_data ) ) {
//assign key from meta array for current key to meta subarray
$sub_array[ $key ] = $meta_data[ $key ];
}
}
//we want meta array to be subarray because that is what used whants to get
$meta_data = $sub_array;
}
}
//return meta array
return $meta_data;
}
}
if ( ! function_exists( 'quart_mikado_get_attachment_id_from_url' ) ) {
/**
* Function that retrieves attachment id for passed attachment url
*
* @param $attachment_url
*
* @return null|string
*/
function quart_mikado_get_attachment_id_from_url( $attachment_url ) {
global $wpdb;
$attachment_id = '';
//is attachment url set?
if ( $attachment_url !== '' ) {
//prepare query
$query = $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE guid=%s", $attachment_url );
//get attachment id
$attachment_id = $wpdb->get_var( $query );
// Additional check for undefined reason when guid is not image src
if ( empty( $attachment_id ) ) {
// Skip if image is from theme folder ( ex. logo.png )
$theme_folder_name = substr( get_template_directory(), strrpos( get_template_directory(), '/' ) + 1 );
$check_theme_files_urls = strpos( $attachment_url, $theme_folder_name . '/assets/img' );
if ( false === $check_theme_files_urls ) {
$modified_url = substr( $attachment_url, strrpos( $attachment_url, '/' ) + 1 );
$query = $wpdb->prepare( "SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key='_wp_attached_file' AND meta_value LIKE %s", '%' . $modified_url . '%' );
//get attachment id
$attachment_id = $wpdb->get_var( $query );
}
}
}
//return id
return $attachment_id;
}
}
if ( ! function_exists( 'quart_mikado_get_attachment_meta_from_url' ) ) {
/**
* Function that returns meta array for give attachment url
*
* @param $attachment_url
* @param array $keys sub array of attachment meta
*
* @return array|mixed
*
* @see quart_mikado_get_attachment_id_from_url()
* @see quart_mikado_get_attachment_meta()
*
* @version 0.1
*/
function quart_mikado_get_attachment_meta_from_url( $attachment_url, $keys = array() ) {
$attachment_meta = array();
//get attachment id for attachment url
$attachment_id = quart_mikado_get_attachment_id_from_url( $attachment_url );
//is attachment id set?
if ( ! empty( $attachment_id ) ) {
//get post meta
$attachment_meta = quart_mikado_get_attachment_meta( $attachment_id, $keys );
$attachment_meta['attachment_id'] = $attachment_id;
}
//return post meta
return $attachment_meta;
}
}
if ( ! function_exists( 'quart_mikado_get_image_dimensions' ) ) {
/**
* Function that returns image sizes array. First looks in post_meta table if attachment exists in the database,
* if it does not than it uses getimagesize PHP function to get image sizes
*
* @param $url string url of the image
*
* @return array array of image sizes that contains height and width
*
* @see quart_mikado_get_attachment_meta_from_url()
* @uses getimagesize
*
* @version 0.1
*/
function quart_mikado_get_image_dimensions( $url ) {
$image_sizes = array();
//is url passed?
if ( $url !== '' ) {
//get image sizes from posts meta if attachment exists
$image_sizes = quart_mikado_get_attachment_meta_from_url( $url, array( 'width', 'height' ) );
//image does not exists in post table, we have to use PHP way of getting image size
if ( ! count( $image_sizes ) ) {
require_once( ABSPATH . 'wp-admin/includes/file.php' );
//can we open file by url?
if ( ini_get( 'allow_url_fopen' ) == 1 && file_exists( $url ) ) {
list( $width, $height, $type, $attr ) = getimagesize( $url );
} else {
//we can't open file directly, have to locate it with relative path.
$image_obj = parse_url( $url );
$image_relative_path = rtrim( get_home_path(), '/' ) . $image_obj['path'];
if ( file_exists( $image_relative_path ) ) {
list( $width, $height, $type, $attr ) = getimagesize( $image_relative_path );
}
}
//did we get width and height from some of above methods?
if ( isset( $width ) && isset( $height ) ) {
//set them to our image sizes array
$image_sizes = array(
'width' => $width,
'height' => $height
);
}
}
}
return $image_sizes;
}
}
if ( ! function_exists( 'quart_mikado_get_native_fonts_list' ) ) {
/**
* Function that returns array of native fonts
* @return array
*/
function quart_mikado_get_native_fonts_list() {
return apply_filters( 'quart_mikado_filter_get_native_fonts_list', array(
'Arial',
'Arial Black',
'Comic Sans MS',
'Courier New',
'Georgia',
'Impact',
'Lucida Console',
'Lucida Sans Unicode',
'Palatino Linotype',
'Tahoma',
'Times New Roman',
'Trebuchet MS',
'Verdana'
) );
}
}
if ( ! function_exists( 'quart_mikado_get_native_fonts_array' ) ) {
/**
* Function that returns formatted array of native fonts
*
* @uses quart_mikado_get_native_fonts_list()
* @return array
*/
function quart_mikado_get_native_fonts_array() {
$native_fonts_list = quart_mikado_get_native_fonts_list();
$native_font_index = 0;
$native_fonts_array = array();
foreach ( $native_fonts_list as $native_font ) {
$native_fonts_array[ $native_font_index ] = array( 'family' => $native_font );
$native_font_index ++;
}
return $native_fonts_array;
}
}
if ( ! function_exists( 'quart_mikado_is_native_font' ) ) {
/**
* Function that checks if given font is native font
*
* @param $font_family string
*
* @return bool
*/
function quart_mikado_is_native_font( $font_family ) {
return in_array( str_replace( '+', ' ', $font_family ), quart_mikado_get_native_fonts_list() );
}
}
if ( ! function_exists( 'quart_mikado_disable_google_font' ) ) {
/**
* Function that remove Google fonts loading
*
* @return bool
*/
function quart_mikado_disable_google_font() {
return 'no' !== quart_mikado_options()->getOptionValue( 'enable_google_fonts' );
}
add_filter( 'quart_mikado_filter_enable_google_fonts', 'quart_mikado_disable_google_font' );
}
if ( ! function_exists( 'quart_mikado_merge_fonts' ) ) {
/**
* Function that merge google and native fonts
*
* @uses quart_mikado_get_native_fonts_array()
* @return array
*/
function quart_mikado_merge_fonts() {
global $quart_mikado_global_fonts_array;
if ( isset( $quart_mikado_global_fonts_array ) ) {
$native_fonts = quart_mikado_get_native_fonts_array();
if ( is_array( $native_fonts ) && count( $native_fonts ) ) {
$is_enabled = boolval( apply_filters( 'quart_mikado_filter_enable_google_fonts', true ) );
if ( quart_mikado_core_plugin_installed() && $is_enabled ) {
$quart_mikado_global_fonts_array = array_merge( $native_fonts, $quart_mikado_global_fonts_array );
} else {
$quart_mikado_global_fonts_array = $native_fonts;
}
}
}
}
add_action( 'admin_init', 'quart_mikado_merge_fonts' );
}
if ( ! function_exists( 'quart_mikado_is_css_folder_writable' ) ) {
/**
* Function that checks if css folder is writable
* @return bool
*
* @version 0.1
* @uses is_writable()
*/
function quart_mikado_is_css_folder_writable() {
$css_dir = MIKADO_ASSETS_ROOT_DIR . '/css';
return is_writable( $css_dir );
}
}
if ( ! function_exists( 'quart_mikado_is_js_folder_writable' ) ) {
/**
* Function that checks if js folder is writable
* @return bool
*
* @version 0.1
* @uses is_writable()
*/
function quart_mikado_is_js_folder_writable() {
$js_dir = MIKADO_ASSETS_ROOT_DIR . '/js';
return is_writable( $js_dir );
}
}
if ( ! function_exists( 'quart_mikado_assets_folders_writable' ) ) {
/**
* Function that if css and js folders are writable
* @return bool
*
* @version 0.1
* @see quart_mikado_is_css_folder_writable()
* @see quart_mikado_is_js_folder_writable()
*/
function quart_mikado_assets_folders_writable() {
return quart_mikado_is_css_folder_writable() && quart_mikado_is_js_folder_writable();
}
}
if ( ! function_exists( 'quart_mikado_writable_assets_folders_notice' ) ) {
/**
* Function that prints notice that css and js folders aren't writable. Hooks to admin_notices action
*
* @version 0.1
* @link http://codex.wordpress.org/Plugin_API/Action_Reference/admin_notices
*/
function quart_mikado_writable_assets_folders_notice() {
global $pagenow;
$is_theme_options_page = isset( $_GET['page'] ) && strstr( $_GET['page'], MIKADO_OPTIONS_SLUG );
if ( $pagenow === 'admin.php' && $is_theme_options_page ) {
if ( ! quart_mikado_assets_folders_writable() ) { ?>
$value ) {
$output .= ' ' . quart_mikado_get_inline_attr( $value, $attr, '', true );
}
} else {
foreach ( $attrs as $attr => $value ) {
$output .= ' ' . quart_mikado_get_inline_attr( $value, $attr );
}
}
}
$output = ltrim( $output );
return $output;
}
}
if ( ! function_exists( 'quart_mikado_get_skin_uri' ) ) {
/**
* Returns current skin URI
* @return mixed
*/
function quart_mikado_get_skin_uri() {
global $quart_mikado_global_Framework;
$current_skin = $quart_mikado_global_Framework->getSkin();
return $current_skin->getSkinURI();
}
}
if ( ! function_exists( 'quart_mikado_core_plugin_message' ) ) {
/**
* Function that prints a mesasge in the admin if user hides TGMPA plugin activation message
*/
function quart_mikado_core_plugin_message() {
if ( get_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice', true ) && ! quart_mikado_core_plugin_installed() ) {
echo apply_filters( 'quart_mikado_filter_core_plugin_message', '' . esc_html__( 'Installation of the "Mikado Core" plugin is essential for proper theme functioning. Please ', 'quart' ) . '
' . esc_html__( 'install', 'quart' ) . ' ' . esc_html__( ' this plugin and activate it', 'quart' ) . '
' );
}
}
add_action( 'admin_notices', 'quart_mikado_core_plugin_message' );
}
if ( ! function_exists( 'quart_mikado_get_theme_info_item' ) ) {
/**
* Returns desired info of the current theme
*
* @param $item string info item to get
*
* @return string
*/
function quart_mikado_get_theme_info_item( $item ) {
if ( $item !== '' ) {
$current_theme = wp_get_theme();
if ( $current_theme->parent() ) {
$current_theme = $current_theme->parent();
}
if ( $current_theme->exists() && $current_theme->get( $item ) != "" ) {
return $current_theme->get( $item );
}
}
return '';
}
}
if ( ! function_exists( 'quart_mikado_resize_image' ) ) {
/**
* Function that generates custom thumbnail for given attachment
*
* @param null $attach_id id of attachment
* @param null $attach_url URL of attachment
* @param int $width desired height of custom thumbnail
* @param int $height desired width of custom thumbnail
* @param bool $crop whether to crop image or not
*
* @return array returns array containing img_url, width and height
*
* @see quart_mikado_get_attachment_id_from_url()
* @see get_attached_file()
* @see wp_get_attachment_url()
* @see wp_get_image_editor()
*/
function quart_mikado_resize_image( $attach_id = null, $attach_url = null, $width = null, $height = null, $crop = true ) {
$return_array = array();
//is attachment id empty?
if ( empty( $attach_id ) && $attach_url !== '' ) {
//get attachment id from url
$attach_id = quart_mikado_get_attachment_id_from_url( $attach_url );
}
if ( ! empty( $attach_id ) && ( isset( $width ) && isset( $height ) ) ) {
//get file path of the attachment
$img_path = get_attached_file( $attach_id );
//get attachment url
$img_url = wp_get_attachment_url( $attach_id );
//break down img path to array so we can use it's components in building thumbnail path
$img_path_array = pathinfo( $img_path );
//build thumbnail path
$new_img_path = $img_path_array['dirname'] . '/' . $img_path_array['filename'] . '-' . $width . 'x' . $height . '.' . $img_path_array['extension'];
//build thumbnail url
$new_img_url = str_replace( $img_path_array['filename'], $img_path_array['filename'] . '-' . $width . 'x' . $height, $img_url );
//check if thumbnail exists by it's path
if ( ! file_exists( $new_img_path ) ) {
//get image manipulation object
$image_object = wp_get_image_editor( $img_path );
if ( ! is_wp_error( $image_object ) ) {
//resize image and save it new to path
$image_object->resize( $width, $height, $crop );
$image_object->save( $new_img_path );
//get sizes of newly created thumbnail.
///we don't use $width and $height because those might differ from end result based on $crop parameter
$image_sizes = $image_object->get_size();
$width = $image_sizes['width'];
$height = $image_sizes['height'];
}
}
//generate data to be returned
$return_array = array(
'img_url' => $new_img_url,
'img_width' => $width,
'img_height' => $height
);
} //attachment wasn't found, probably because it comes from external source
elseif ( $attach_url !== '' && ( isset( $width ) && isset( $height ) ) ) {
//generate data to be returned
$return_array = array(
'img_url' => $attach_url,
'img_width' => $width,
'img_height' => $height
);
}
return $return_array;
}
}
if ( ! function_exists( 'quart_mikado_generate_thumbnail' ) ) {
/**
* Generates thumbnail img tag. It calls quart_mikado_resize_image function which resizes img on the fly
*
* @param null $attach_id attachment id
* @param null $attach_url attachment URL
* @param int $width width of thumbnail
* @param int $height height of thumbnail
* @param bool $crop whether to crop thumbnail or not
*
* @return string generated img tag
*
* @see quart_mikado_resize_image()
* @see quart_mikado_get_attachment_id_from_url()
*/
function quart_mikado_generate_thumbnail( $attach_id = null, $attach_url = null, $width = null, $height = null, $crop = true ) {
//is attachment id empty?
if ( empty( $attach_id ) ) {
//get attachment id from attachment url
$attach_id = quart_mikado_get_attachment_id_from_url( $attach_url );
}
if ( ! empty( $attach_id ) || ! empty( $attach_url ) ) {
$img_info = quart_mikado_resize_image( $attach_id, $attach_url, $width, $height, $crop );
$img_alt = ! empty( $attach_id ) ? get_post_meta( $attach_id, '_wp_attachment_image_alt', true ) : '';
if ( is_array( $img_info ) && count( $img_info ) ) {
return ' ';
}
}
return '';
}
}
if ( ! function_exists( 'quart_mikado_get_template_part' ) ) {
/**
* Loads template part with parameters. If file with slug parameter added exists it will load that file, else it will load file without slug added.
* Child theme friendly function
*
* @param string $template name of the template to load without extension
* @param string $slug
* @param array $params array of parameters to pass to template
* @param boolean $plugin if template path should be overridden with plugin module
*/
function quart_mikado_get_template_part( $template, $slug = '', $params = array(), $plugin = false ) {
if ( is_array( $params ) && count( $params ) ) {
extract( $params );
}
$templates = array();
if ( $template !== '' ) {
if ( $slug !== '' ) {
$templates[] = "{$template}-{$slug}.php";
}
$templates[] = $template . '.php';
}
$located = quart_mikado_find_template_path( $templates, $plugin );
if ( $located ) {
include( $located );
}
}
}
if ( ! function_exists( 'quart_mikado_get_module_template_part' ) ) {
/**
* Loads module template part.
*
* @param string $template name of the template to load
* @param string $module name of the module folder
* @param string $slug
* @param array $params array of parameters to pass to template
* @param boolean $plugin if template path should be overridden with plugin module
*
* @see quart_mikado_get_template_part()
*/
function quart_mikado_get_module_template_part( $template, $module, $slug = '', $params = array(), $plugin = false ) {
$root = $plugin ? apply_filters( 'quart_mikado_filter_edit_module_template_path', $root = 'framework/modules/' ) : 'framework/modules/';
$template_path = $root . $module;
quart_mikado_get_template_part( $template_path . '/' . $template, $slug, $params, $plugin );
}
}
if ( ! function_exists( 'quart_mikado_get_html_template_part' ) ) {
/**
* Loads template part with parameters. If file with slug parameter added exists it will load that file, else it will load file without slug added.
* Child theme friendly function
*
* @param string $template name of the template to load without extension
* @param string $slug
* @param array $params array of parameters to pass to template
* @param boolean $plugin if template path should be overridden with plugin module
*
* @return html
*/
function quart_mikado_get_html_template_part( $template, $slug = '', $params = array(), $plugin = false ) {
$html = '';
if ( is_array( $params ) && count( $params ) ) {
extract( $params );
}
$templates = array();
if ( $template !== '' ) {
if ( $slug !== '' ) {
$templates[] = "{$template}-{$slug}.php";
}
$templates[] = $template . '.php';
}
$located = quart_mikado_find_template_path( $templates, $plugin );
if ( $located ) {
ob_start();
include( $located );
$html = ob_get_clean();
}
return $html;
}
}
if ( ! function_exists( 'quart_mikado_get_html_module_template_part' ) ) {
/**
* Loads module template part.
*
* @param string $template name of the template to load
* @param string $module name of the module folder
* @param string $slug
* @param array $params array of parameters to pass to template
* @param boolean $plugin if template path should be overridden with plugin module
*
* @return html
*/
function quart_mikado_get_html_module_template_part( $template, $module, $slug = '', $params = array(), $plugin = false ) {
$root = $plugin ? apply_filters( 'quart_mikado_filter_edit_html_module_template_path', $root = 'framework/modules/' ) : 'framework/modules/';
$template_path = $root . $module;
return quart_mikado_get_html_template_part( $template_path . '/' . $template, $slug, $params, $plugin );
}
}
if ( ! function_exists( 'quart_mikado_get_blog_module_template_part' ) ) {
/**
* Loads module template part.
*
* @param string $module name of the module folder
* @param string $slug
* @param array $params array of parameters to pass to template
*
* @return html
* @see quart_mikado_get_template_part()
*/
function quart_mikado_get_blog_module_template_part( $module, $slug = '', $params = array() ) {
//HTML Content from template
$html = '';
$template_path = 'framework/modules/blog/' . $module;
$temp = $template_path;
if ( is_array( $params ) && count( $params ) ) {
extract( $params );
}
$templates = array();
if ( $temp !== '' ) {
if ( $slug !== '' ) {
$templates[] = "{$temp}-{$slug}.php";
}
$templates[] = $temp . '.php';
}
$located = quart_mikado_find_template_path( $templates );
if ( $located ) {
ob_start();
include( $located );
$html = ob_get_clean();
}
return $html;
}
}
if ( ! function_exists( 'quart_mikado_find_template_path' ) ) {
/**
* Find template path and return it
*
* @param $template_names
* @param $plugin
*
* @return string
*/
function quart_mikado_find_template_path( $template_names, $plugin = false ) {
$located = '';
foreach ( (array) $template_names as $template_name ) {
if ( ! $template_name ) {
continue;
}
if ( file_exists( get_stylesheet_directory() . '/' . $template_name ) ) {
$located = get_stylesheet_directory() . '/' . $template_name;
break;
} elseif ( file_exists( get_template_directory() . '/' . $template_name ) ) {
$located = get_template_directory() . '/' . $template_name;
break;
} elseif ( $plugin && file_exists( $template_name ) ) {
$located = $template_name;
break;
}
}
return $located;
}
}
if ( ! function_exists( 'quart_mikado_filter_suffix' ) ) {
/**
* Removes suffix from given value. Useful when you have to remove parts of user input, e.g px at the end of string
*
* @param $value
* @param $suffix
*
* @return string
*/
function quart_mikado_filter_suffix( $value, $suffix ) {
if ( $value !== '' && quart_mikado_string_ends_with( $value, $suffix ) ) {
$value = substr( $value, 0, strpos( $value, $suffix ) );
}
return $value;
}
}
if ( ! function_exists( 'quart_mikado_filter_px' ) ) {
/**
* Removes px in provided value if value ends with px
*
* @param $value
*
* @return string
*
* @see quart_mikado_filter_suffix
*/
function quart_mikado_filter_px( $value ) {
return quart_mikado_filter_suffix( $value, 'px' );
}
}
if ( ! function_exists( 'quart_mikado_string_ends_with' ) ) {
/**
* Checks if $haystack ends with $needle and returns proper bool value
*
* @param $haystack string to check
* @param $needle string with which $haystack needs to end
*
* @return bool
*/
function quart_mikado_string_ends_with( $haystack, $needle ) {
if ( $haystack !== '' && $needle !== '' ) {
return ( substr( $haystack, - strlen( $needle ), strlen( $needle ) ) == $needle );
}
return true;
}
}
if ( ! function_exists( 'quart_mikado_dynamic_css' ) ) {
/**
* Generates css based on selector and rules that are provided
*
* @param array|string $selector selector for which to generate styles
* @param array $rules associative array of rules.
*
* Example of usage: if you want to generate this css:
* header { width: 100%; }
* function call should look like this: quart_mikado_dynamic_css('header', array('width' => '100%'));
*
* @return string
*/
function quart_mikado_dynamic_css( $selector, $rules ) {
$output = '';
//check if selector and rules are valid data
if ( ! empty( $selector ) && ( is_array( $rules ) && count( $rules ) ) ) {
if ( MIKADO_THEME_ENV === 'true' ) {
$calling_function = debug_backtrace();
if ( isset( $calling_function[0]['file'] ) && isset( $calling_function[1]['function'] ) ) {
$output .= '/* generated in ' . $calling_function[0]['file'] . ' ' . $calling_function[1]['function'] . ' function */' . "\n";
}
}
if ( is_array( $selector ) && count( $selector ) ) {
$output .= implode( ', ', $selector );
} else {
$output .= $selector;
}
$output .= ' { ';
foreach ( $rules as $prop => $value ) {
if ( $prop !== '' ) {
$output .= $prop . ': ' . esc_attr( $value ) . ';';
}
}
$output .= '}';
}
return $output;
}
}
if ( ! function_exists( 'quart_mikado_get_formatted_font_family' ) ) {
/**
* Returns formatted font family name for css usage
*
* @param $value
*
* @return mixed
*/
function quart_mikado_get_formatted_font_family( $value ) {
return str_replace( '+', ' ', $value );
}
}
if ( ! function_exists( 'quart_mikado_active_widget' ) ) {
/**
* Whether widget is displayed on the front-end.
*/
function quart_mikado_active_widget( $callback = false, $widget_id = false, $id_base = false, $skip_inactive = true ) {
global $wp_registered_widgets;
$sidebars_widgets = wp_get_sidebars_widgets();
$sidebars_array = array();
if ( is_array( $sidebars_widgets ) ) {
foreach ( $sidebars_widgets as $sidebar => $widgets ) {
if ( $skip_inactive && ( 'wp_inactive_widgets' === $sidebar || 'orphaned_widgets' === substr( $sidebar, 0, 16 ) ) ) {
continue;
}
if ( is_array( $widgets ) ) {
foreach ( $widgets as $widget ) {
if ( ( $callback && isset( $wp_registered_widgets[ $widget ]['callback'] ) && $wp_registered_widgets[ $widget ]['callback'] == $callback ) || ( $id_base && _get_widget_id_base( $widget ) == $id_base ) ) {
if ( ! $widget_id || $widget_id == $wp_registered_widgets[ $widget ]['id'] ) {
$sidebars_array[] = $sidebar;
}
}
}
}
}
return $sidebars_array;
}
return false;
}
}
if ( ! function_exists( 'quart_mikado_widget_modified_before_title' ) ) {
/**
* Return modified before title html with style attribute
*
* @param $before_title string to modified
* @param $title_styles array title styles
*
* @return string
*/
function quart_mikado_widget_modified_before_title( $before_title, $title_styles ) {
return substr( $before_title, 0, strlen( $before_title ) - 1 ) . ' ' . quart_mikado_get_inline_style( $title_styles ) . '>';
}
}
if ( ! function_exists( 'quart_mikado_execute_shortcode' ) ) {
/**
* @param $shortcode_tag - shortcode base
* @param $atts - shortcode attributes
* @param null $content - shortcode content
*
* @return mixed|string
*/
function quart_mikado_execute_shortcode( $shortcode_tag, $atts, $content = null ) {
global $shortcode_tags;
if ( ! isset( $shortcode_tags[ $shortcode_tag ] ) ) {
return;
}
if ( is_array( $shortcode_tags[ $shortcode_tag ] ) ) {
$shortcode_array = $shortcode_tags[ $shortcode_tag ];
return call_user_func( array(
$shortcode_array[0],
$shortcode_array[1]
), $atts, $content, $shortcode_tag );
}
return call_user_func( $shortcode_tags[ $shortcode_tag ], $atts, $content, $shortcode_tag );
}
}
if ( ! function_exists( 'quart_mikado_is_page_smooth_scroll_enabled' ) ) {
/**
* Function that check is page smooth scroll is enabled
*/
function quart_mikado_is_page_smooth_scroll_enabled() {
$mac_os = strpos( getenv("HTTP_USER_AGENT"), 'Mac' );
$is_enabled = false;
//is smooth scroll enabled enabled and not Mac device?
if ( quart_mikado_options()->getOptionValue( 'page_smooth_scroll' ) == 'yes' && $mac_os == false ) {
$is_enabled = true;
}
return $is_enabled;
}
}
if ( ! function_exists( 'quart_mikado_show_comments' ) ) {
/**
* Functions which check are comments enabled on page
*
* @return boolean
*/
function quart_mikado_show_comments() {
$comments = false;
$id = quart_mikado_get_page_id();
$page_comments_meta = get_post_meta( $id, 'mkdf_page_comments_meta', true );
if ( ! empty( $page_comments_meta ) ) {
$comments = $page_comments_meta == 'no' ? false : true;
} else {
if ( is_page() && quart_mikado_options()->getOptionValue( 'page_show_comments' ) == 'yes' ) {
$comments = true;
} elseif ( is_singular( 'post' ) && quart_mikado_options()->getOptionValue( 'blog_single_comments' ) == 'yes' ) {
$comments = true;
} else {
$comments = apply_filters( 'quart_mikado_filter_post_type_comments', $comments );
}
}
return $comments;
}
}
if ( ! function_exists( 'quart_mikado_page_comments' ) ) {
/**
* Functions which show comments on page
*
* @return boolean
*/
function quart_mikado_page_comments() {
$comments = quart_mikado_show_comments();
if ( $comments ) {
comments_template( '', true );
}
}
add_action( 'quart_mikado_action_page_after_content', 'quart_mikado_page_comments' );
}
if ( ! function_exists( 'quart_mikado_page_show_pagination' ) ) {
/**
* Functions which show pagination on pages
*
* @return boolean
*/
function quart_mikado_page_show_pagination() {
$args_pages = array(
'before' => '',
'pagelink' => '% '
);
wp_link_pages( $args_pages );
}
add_action( 'quart_mikado_action_page_after_content', 'quart_mikado_page_show_pagination' );
}
if ( ! function_exists( 'quart_mikado_icon_collections' ) ) {
/**
* Returns instance of QuartMikadoClassIconCollections class
*
* @return QuartMikadoClassIconCollections
*/
function quart_mikado_icon_collections() {
return QuartMikadoClassIconCollections::get_instance();
}
}
if ( ! function_exists( 'quart_mikado_get_meta_field_intersect' ) ) {
/**
* @param $name
* @param $post_id
*
* @return bool|mixed|void
*/
function quart_mikado_get_meta_field_intersect( $name, $post_id = '' ) {
$post_id = ! empty( $post_id ) ? $post_id : get_the_ID();
if ( quart_mikado_is_woocommerce_installed() && quart_mikado_is_woocommerce_shop() ) {
$post_id = quart_mikado_get_woo_shop_page_id();
}
$value = quart_mikado_options()->getOptionValue( $name );
if ( $post_id !== - 1 ) {
$meta_field = get_post_meta( $post_id, 'mkdf_' . $name . '_meta', true );
if ( $meta_field !== '' && $meta_field !== false ) {
$value = $meta_field;
}
}
$value = apply_filters( 'quart_mikado_meta_field_intersect_' . $name, $value );
return $value;
}
}
if ( ! function_exists( 'quart_mikado_get_typography_styles' ) ) {
/**
* Generates typography styles for global options
*
* @param $prefix - unique name of global option
* @param $suffix - additional name of global option
*
* @return array
*/
function quart_mikado_get_typography_styles( $prefix = '', $suffix = '' ) {
$color = quart_mikado_options()->getOptionValue( $prefix . '_color' . $suffix );
$font_family = quart_mikado_options()->getOptionValue( $prefix . '_google_fonts' . $suffix );
$font_size = quart_mikado_options()->getOptionValue( $prefix . '_font_size' . $suffix );
$line_height = quart_mikado_options()->getOptionValue( $prefix . '_line_height' . $suffix );
$font_style = quart_mikado_options()->getOptionValue( $prefix . '_font_style' . $suffix );
$font_weight = quart_mikado_options()->getOptionValue( $prefix . '_font_weight' . $suffix );
$letter_spacing = quart_mikado_options()->getOptionValue( $prefix . '_letter_spacing' . $suffix );
$text_transform = quart_mikado_options()->getOptionValue( $prefix . '_text_transform' . $suffix );
$styles = array();
if ( ! empty( $color ) ) {
$styles['color'] = $color;
}
if ( isset( $font_family ) && $font_family !== false && $font_family !== '-1' && $font_family !== '' ) {
$styles['font-family'] = quart_mikado_get_formatted_font_family( $font_family );
}
if ( ! empty( $font_size ) ) {
if ( quart_mikado_string_ends_with( $font_size, 'px' ) || quart_mikado_string_ends_with( $font_size, 'em' ) ) {
$styles['font-size'] = $font_size;
} else {
$styles['font-size'] = quart_mikado_filter_px( $font_size ) . 'px';
}
}
if ( ! empty( $line_height ) ) {
if ( quart_mikado_string_ends_with( $line_height, 'px' ) || quart_mikado_string_ends_with( $line_height, 'em' ) ) {
$styles['line-height'] = $line_height;
} else {
$styles['line-height'] = quart_mikado_filter_px( $line_height ) . 'px';
}
}
if ( ! empty( $font_style ) ) {
$styles['font-style'] = $font_style;
}
if ( ! empty( $font_weight ) ) {
$styles['font-weight'] = $font_weight;
}
if ( $letter_spacing !== '' ) {
if ( quart_mikado_string_ends_with( $letter_spacing, 'px' ) || quart_mikado_string_ends_with( $letter_spacing, 'em' ) ) {
$styles['letter-spacing'] = $letter_spacing;
} else {
$styles['letter-spacing'] = quart_mikado_filter_px( $letter_spacing ) . 'px';
}
}
if ( ! empty( $text_transform ) ) {
$styles['text-transform'] = $text_transform;
}
return $styles;
}
}
if ( ! function_exists( 'quart_mikado_get_responsive_typography_styles' ) ) {
/**
* Generates typography responsive styles for global options
*
* @param $prefix - unique name of global option
* @param $suffix - additional name of global option
*
* @return array
*/
function quart_mikado_get_responsive_typography_styles( $prefix = '', $suffix = '' ) {
$font_size = quart_mikado_options()->getOptionValue( $prefix . '_font_size' . $suffix );
$line_height = quart_mikado_options()->getOptionValue( $prefix . '_line_height' . $suffix );
$letter_spacing = quart_mikado_options()->getOptionValue( $prefix . '_letter_spacing' . $suffix );
$styles = array();
if ( ! empty( $font_size ) ) {
if ( quart_mikado_string_ends_with( $font_size, 'px' ) || quart_mikado_string_ends_with( $font_size, 'em' ) ) {
$styles['font-size'] = $font_size;
} else {
$styles['font-size'] = quart_mikado_filter_px( $font_size ) . 'px';
}
}
if ( ! empty( $line_height ) ) {
if ( quart_mikado_string_ends_with( $line_height, 'px' ) || quart_mikado_string_ends_with( $line_height, 'em' ) ) {
$styles['line-height'] = $line_height;
} else {
$styles['line-height'] = quart_mikado_filter_px( $line_height ) . 'px';
}
}
if ( $letter_spacing !== '' ) {
if ( quart_mikado_string_ends_with( $letter_spacing, 'px' ) || quart_mikado_string_ends_with( $letter_spacing, 'em' ) ) {
$styles['letter-spacing'] = $letter_spacing;
} else {
$styles['letter-spacing'] = quart_mikado_filter_px( $letter_spacing ) . 'px';
}
}
return $styles;
}
}
if ( ! function_exists( 'quart_mikado_register_button' ) ) {
/**
* Register button with shortcodes for WP editor
*
* @param $buttons
*
* @return mixed
*/
function quart_mikado_register_button( $buttons ) {
array_push( $buttons, "|", "mkdf_shortcodes" );
return $buttons;
}
}
if ( ! function_exists( 'quart_mikado_add_plugin' ) ) {
function quart_mikado_add_plugin( $plugin_array ) {
$plugin_array['mkdf_shortcodes'] = MIKADO_FRAMEWORK_ROOT . '/admin/assets/js/mkdf-ui/mkdf-shortcodes.js';
return $plugin_array;
}
}
if ( ! function_exists( 'quart_mikado_shortcodes_button' ) ) {
/**
* Register Mikado Shortcodes in WP Editor
*/
function quart_mikado_shortcodes_button() {
if ( ! current_user_can( 'edit_posts' ) && ! current_user_can( 'edit_pages' ) ) {
return;
}
if ( get_user_option( 'rich_editing' ) == 'true' ) {
add_filter( 'mce_external_plugins', 'quart_mikado_add_plugin' );
add_filter( 'mce_buttons', 'quart_mikado_register_button' );
}
}
add_action( 'after_setup_theme', 'quart_mikado_shortcodes_button' );
}
/**
* Get size information for all currently-registered image sizes.
*
* @global $_wp_additional_image_sizes
* @uses get_intermediate_image_sizes()
* @return array $sizes Data for all currently-registered image sizes.
*/
function quart_mikado_get_image_sizes() {
global $_wp_additional_image_sizes;
$sizes = array();
foreach ( get_intermediate_image_sizes() as $_size ) {
if ( in_array( $_size, array( 'medium', 'large' ) ) ) {
$sizes[ $_size ]['width'] = get_option( "{$_size}_size_w" );
$sizes[ $_size ]['height'] = get_option( "{$_size}_size_h" );
$sizes[ $_size ]['crop'] = (bool) get_option( "{$_size}_crop" );
} elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) {
$sizes[ $_size ] = array(
'width' => $_wp_additional_image_sizes[ $_size ]['width'],
'height' => $_wp_additional_image_sizes[ $_size ]['height'],
'crop' => $_wp_additional_image_sizes[ $_size ]['crop'],
);
}
}
return $sizes;
}
/**
* Get size information for a specific image size.
*
* @uses quart_mikado_get_image_size()
*
* @param string $size The image size for which to retrieve data.
*
* @return bool|array $size Size data about an image size or false if the size doesn't exist.
*/
function quart_mikado_get_image_size( $size ) {
$sizes = quart_mikado_get_image_sizes();
if ( isset( $sizes[ $size ] ) ) {
return $sizes[ $size ];
}
return false;
}
if ( ! function_exists( 'quart_mikado_option_get_uploaded_file_icon' ) ) {
function quart_mikado_option_get_uploaded_file_icon( $value ) {
$id = quart_mikado_get_attachment_id_from_url( $value );
return wp_mime_type_icon( $id );
}
}
if ( ! function_exists( 'quart_mikado_option_get_uploaded_file_title' ) ) {
function quart_mikado_option_get_uploaded_file_title( $value ) {
$id = quart_mikado_get_attachment_id_from_url( $value );
return get_the_title( $id );
}
}
if ( ! function_exists( 'quart_mikado_return_button_html' ) ) {
function quart_mikado_return_button_html( $params = array() ) {
$html = '';
$type = ! empty( $params['type'] ) ? esc_attr( $params['type'] ) : 'solid';
$size = ! empty( $params['size'] ) ? esc_attr( $params['size'] ) : 'medium';
$link = ! empty( $params['link'] ) ? esc_url( $params['link'] ) : '#';
$text = ! empty( $params['text'] ) ? esc_attr( $params['text'] ) : '';
$icon_pack = !empty($params['icon_pack']) ? esc_attr($params['icon_pack']) : '';
$fe_icon = !empty($params['fe_icon']) ? esc_attr($params['fe_icon']) : '';
$custom_class = ! empty( $params['custom_class'] ) ? esc_attr( $params['custom_class'] ) : '';
if ( quart_mikado_core_plugin_installed() ) {
$html .= quart_mikado_get_button_html(
apply_filters(
'quart_mikado_filter_blog_template_read_more_button',
array(
'type' => $type,
'size' => $size,
'link' => $link,
'text' => $text,
'custom_class' => $custom_class,
'icon_pack' => $icon_pack,
'fe_icon' => $fe_icon
)
)
);
} else {
$html .= '';
$html .= '' . $text . ' ';
$html .= ' ';
$html .= ' ';
}
return $html;
}
}
if ( ! function_exists( 'quart_mikado_get_holder_data_for_cpt' ) ) {
function quart_mikado_get_holder_data_for_cpt( $params, $additional_params, $additional_data = '' ) {
$dataString = '';
if ( get_query_var( 'paged' ) ) {
$paged = get_query_var( 'paged' );
} elseif ( get_query_var( 'page' ) ) {
$paged = get_query_var( 'page' );
} else {
$paged = 1;
}
$query_results = $additional_params['query_results'];
$params['max_num_pages'] = $query_results->max_num_pages;
if ( ! empty( $paged ) ) {
$params['next_page'] = $paged + 1;
}
foreach ( $params as $key => $value ) {
if ( $value !== '' ) {
$new_key = str_replace( '_', '-', $key );
$dataString .= ' data-' . $new_key . '=' . esc_attr( str_replace( ' ', '', $value ) );
}
}
if ( ! empty( $additional_data ) ) {
$dataString .= ' ' . esc_attr( $additional_data );
}
return $dataString;
}
}
if ( ! function_exists( 'quart_mikado_return_dependency_options_array' ) ) {
function quart_mikado_return_dependency_options_array( $dependencyValues = array(), $hideContainer = false, $repeater = false ) {
$returnArray = array();
$optionsValues = array();
if ( ! empty( $dependencyValues ) ) {
foreach ( $dependencyValues as $key => $values ) {
if ( is_array( $values ) ) {
$dataValues[ $key ] = implode( ',', $values );
if ( $repeater ) {
$repKey = explode('[', str_replace(']', '', $key) );
if ( ! empty ($repKey) && count($repKey) > 2) {
$repMainOption = $repKey[0];
$repKeyIndex = $repKey[1];
$repMainKey = $repKey[2];
if (count($repKey) === 5) {
$repKeyInnerIndex = $repKey[3];
$repMainInnerKey = $repKey[4];
$repOption = quart_mikado_option_get_value( $repMainOption );
if ( in_array($repOption[$repKeyIndex][$repMainKey][$repKeyInnerIndex][$repMainInnerKey], $values) ) {
$optionsValues[] = true;
} else {
$optionsValues[] = false;
}
} else {
$repOption = quart_mikado_option_get_value( $repMainOption );
if ( in_array($repOption[$repKeyIndex][$repMainKey], $values) ) {
$optionsValues[] = true;
} else {
$optionsValues[] = false;
}
}
}
} else if ( in_array( quart_mikado_option_get_value( $key ), $values ) ) {
$optionsValues[] = true;
} else {
$optionsValues[] = false;
}
} else {
$dataValues[ $key ] = $values;
if ( $repeater ) {
$repKey = explode('[', str_replace(']', '', $key) );
if ( ! empty ($repKey) && count($repKey) > 2) {
$repMainOption = $repKey[0];
$repKeyIndex = $repKey[1];
$repMainKey = $repKey[2];
if (count($repKey) === 5) {
$repKeyInnerIndex = $repKey[3];
$repMainInnerKey = $repKey[4];
$repOption = quart_mikado_option_get_value( $repMainOption );
if ($repOption[$repKeyIndex][$repMainKey][$repKeyInnerIndex][$repMainInnerKey] === $values) {
$optionsValues[] = true;
} else {
$optionsValues[] = false;
}
} else {
$repOption = quart_mikado_option_get_value( $repMainOption );
if ($repOption[$repKeyIndex][$repMainKey] === $values) {
$optionsValues[] = true;
} else {
$optionsValues[] = false;
}
}
}
} else if ( quart_mikado_option_get_value( $key ) == $values ) {
$optionsValues[] = true;
} else {
$optionsValues[] = false;
}
}
}
if ( count( array_unique( $optionsValues ) ) === 1 ) {
if ($optionsValues[0] === true && ! $hideContainer ) {
$hideItem = false;
} else if ($optionsValues[0] === true && $hideContainer ) {
$hideItem = true;
} else if ($optionsValues[0] === false && ! $hideContainer ) {
$hideItem = true;
} else if ($optionsValues[0] === false && $hideContainer ) {
$hideItem = false;
} else {
$hideItem = $hideContainer;
}
} else {
$hideItem = $hideContainer ? false : true;
}
$returnArray = array(
'data_values' => $dataValues,
'hide_container' => $hideItem
);
}
return $returnArray;
}
}
if ( ! function_exists( 'quart_mikado_return_repeater_dependency_options_array' ) ) {
function quart_mikado_return_repeater_dependency_options_array( $dependencyArray = array() ) {
$field = array();
$repeaterName = '';
$counter = '';
$fieldInner = array();
$counter2 = '';
$newFieldDepedency = false;
extract($dependencyArray);
$repeaterField = ! empty($fieldInner) ? $fieldInner : $field;
$repeaterFieldVisibility = key($repeaterField['dependency']);
$new_dependency = array();
//rename key to match field
foreach ($repeaterField['dependency'][$repeaterFieldVisibility] as $key => $value) {
if (! empty ($fieldInner)) {
$new_key = $repeaterName.'['.$counter.']['.$field['name'].']['.$counter2.']['.$key.']';
} else {
$new_key = $repeaterName.'['.$counter.']['.$key.']';
}
$new_dependency[$new_key] = $value;
}
$repeaterField['dependency'][$repeaterFieldVisibility] = $new_dependency;
$show = array_key_exists('show',$repeaterField['dependency']) ? quart_mikado_return_dependency_options_array( $repeaterField['dependency']['show'], $newFieldDepedency, !$newFieldDepedency ) : array();
$hide = array_key_exists('hide',$repeaterField['dependency']) ? quart_mikado_return_dependency_options_array( $repeaterField['dependency']['hide'], !$newFieldDepedency, !$newFieldDepedency ) : array();
$showDataValues = '';
$hideDataValues = '';
$hideContainer = true;
$dataValues = array();
$classes = 'mkdf-dependency-holder';
if ( ! empty( $show ) ) {
$showDataValues = $show['data_values'];
$hideContainer = $show['hide_container'];
}
if ( ! empty( $hide ) ) {
$hideDataValues = $hide['data_values'];
$hideContainer = $hide['hide_container'];
}
$dataValues['data-show'] = ! empty( $showDataValues ) ? json_encode( $showDataValues ) : '';
$dataValues['data-hide'] = ! empty( $hideDataValues ) ? json_encode( $hideDataValues ) : '';
if ( $hideContainer ) {
$classes .= ' mkdf-hide-dependency-holder';
}
$returnArray = array(
'data' => $dataValues,
'class' => $classes
);
return $returnArray;
}
}PK ! M;, , lib/mkdf.layout1.phpnu &1i children = array();
$this->title = $title_panel;
$this->name = $name;
$this->args = $args;
$this->dependency = $dependency;
}
public function hasChidren() {
return ( count( $this->children ) > 0 ) ? true : false;
}
public function getChild( $key ) {
return $this->children[ $key ];
}
public function addChild( $key, $value ) {
$this->children[ $key ] = $value;
}
public function render( $factory ) {
$containerClass = '';
$data = array();
if ( ! empty( $this->dependency ) ) {
$show = array_key_exists( 'show', $this->dependency ) ? quart_mikado_return_dependency_options_array( $this->dependency['show'], false ) : array();
$hide = array_key_exists( 'hide', $this->dependency ) ? quart_mikado_return_dependency_options_array( $this->dependency['hide'], true ) : array();
$showDataValues = '';
$hideDataValues = '';
$hideContainer = true;
$containerClass = 'mkdf-dependency-holder';
if ( ! empty( $show ) ) {
$showDataValues = $show['data_values'];
$hideContainer = $show['hide_container'];
}
if ( ! empty( $hide ) ) {
$hideDataValues = $hide['data_values'];
$hideContainer = $hide['hide_container'];
}
$data['data-show'] = ! empty( $showDataValues ) ? json_encode( $showDataValues ) : '';
$data['data-hide'] = ! empty( $hideDataValues ) ? json_encode( $hideDataValues ) : '';
if ( $hideContainer ) {
$containerClass .= ' mkdf-hide-dependency-holder';
}
}
?>
>
title ); ?>
children as $child ) {
$this->renderChild( $child, $factory );
} ?>
render( $factory );
}
}
/*
Class: QuartMikadoClassContainer
A class that initializes Mikado Container
*/
class QuartMikadoClassContainer implements iQuartMikadoInterfaceLayoutNode, iQuartMikadoInterfaceRender {
public $children;
public $name;
public $dependency;
function __construct( $name = "", $dependency = array() ) {
$this->children = array();
$this->name = $name;
$this->dependency = $dependency;
}
public function hasChidren() {
return ( count( $this->children ) > 0 ) ? true : false;
}
public function getChild( $key ) {
return $this->children[ $key ];
}
public function addChild( $key, $value ) {
$this->children[ $key ] = $value;
}
public function render( $factory ) {
$containerClass = '';
$data = array();
if ( ! empty( $this->dependency ) ) {
$show = array_key_exists( 'show', $this->dependency ) ? quart_mikado_return_dependency_options_array( $this->dependency['show'], false ) : array();
$hide = array_key_exists( 'hide', $this->dependency ) ? quart_mikado_return_dependency_options_array( $this->dependency['hide'], true ) : array();
$showDataValues = '';
$hideDataValues = '';
$hideContainer = true;
$containerClass = 'mkdf-dependency-holder';
if ( ! empty( $show ) ) {
$showDataValues = $show['data_values'];
$hideContainer = $show['hide_container'];
}
if ( ! empty( $hide ) ) {
$hideDataValues = $hide['data_values'];
$hideContainer = $hide['hide_container'];
}
$data['data-show'] = ! empty( $showDataValues ) ? json_encode( $showDataValues ) : '';
$data['data-hide'] = ! empty( $hideDataValues ) ? json_encode( $hideDataValues ) : '';
if ( $hideContainer ) {
$containerClass .= ' mkdf-hide-dependency-holder';
}
}
?>
>
children as $child ) {
$this->renderChild( $child, $factory );
} ?>
render( $factory );
}
}
/*
Class: QuartMikadoClassContainerNoStyle
A class that initializes Mikado Container without css classes
*/
class QuartMikadoClassContainerNoStyle implements iQuartMikadoInterfaceLayoutNode, iQuartMikadoInterfaceRender {
public $children;
public $name;
public $args;
public $dependency;
function __construct( $name = "", $args = array(), $dependency = array() ) {
$this->children = array();
$this->name = $name;
$this->dependency = $dependency;
$this->args = $args;
}
public function hasChidren() {
return ( count( $this->children ) > 0 ) ? true : false;
}
public function getChild( $key ) {
return $this->children[ $key ];
}
public function addChild( $key, $value ) {
$this->children[ $key ] = $value;
}
public function render( $factory ) {
$containerClass = '';
$data = array();
if ( ! empty( $this->dependency ) ) {
$show = array_key_exists( 'show', $this->dependency ) ? quart_mikado_return_dependency_options_array( $this->dependency['show'], false ) : array();
$hide = array_key_exists( 'hide', $this->dependency ) ? quart_mikado_return_dependency_options_array( $this->dependency['hide'], true ) : array();
$showDataValues = '';
$hideDataValues = '';
$hideContainer = true;
$containerClass = 'mkdf-dependency-holder';
if ( ! empty( $show ) ) {
$showDataValues = $show['data_values'];
$hideContainer = $show['hide_container'];
}
if ( ! empty( $hide ) ) {
$hideDataValues = $hide['data_values'];
$hideContainer = $hide['hide_container'];
}
$data['data-show'] = ! empty( $showDataValues ) ? json_encode( $showDataValues ) : '';
$data['data-hide'] = ! empty( $hideDataValues ) ? json_encode( $hideDataValues ) : '';
if ( $hideContainer ) {
$containerClass .= ' mkdf-hide-dependency-holder';
}
}
?>
>
children as $child ) {
$this->renderChild( $child, $factory );
} ?>
render( $factory );
}
}
/*
Class: QuartMikadoClassGroup
A class that initializes Mikado Group
*/
class QuartMikadoClassGroup implements iQuartMikadoInterfaceLayoutNode, iQuartMikadoInterfaceRender {
public $children;
public $title;
public $description;
function __construct( $title_group = "", $description = "" ) {
$this->children = array();
$this->title = $title_group;
$this->description = $description;
}
public function hasChidren() {
return ( count( $this->children ) > 0 ) ? true : false;
}
public function getChild( $key ) {
return $this->children[ $key ];
}
public function addChild( $key, $value ) {
$this->children[ $key ] = $value;
}
public function render( $factory ) { ?>
title ); ?>
description ); ?>
children as $child ) {
$this->renderChild( $child, $factory );
} ?>
render( $factory );
}
}
/*
Class: QuartMikadoClassNotice
A class that initializes Mikado Notice
*/
class QuartMikadoClassNotice implements iQuartMikadoInterfaceRender {
public $children;
public $title;
public $description;
public $notice;
function __construct( $title_notice = "", $description = "", $notice = "" ) {
$this->children = array();
$this->title = $title_notice;
$this->description = $description;
$this->notice = $notice;
}
public function render( $factory ) { ?>
title ); ?>
description ); ?>
children = array();
$this->next = $next;
}
public function hasChidren() {
return ( count( $this->children ) > 0 ) ? true : false;
}
public function getChild( $key ) {
return $this->children[ $key ];
}
public function addChild( $key, $value ) {
$this->children[ $key ] = $value;
}
public function render( $factory ) { ?>
">
children as $child ) {
$this->renderChild( $child, $factory );
} ?>
render( $factory );
}
}
/*
Class: QuartMikadoClassTitle
A class that initializes Mikado Title
*/
class QuartMikadoClassTitle implements iQuartMikadoInterfaceRender {
private $name;
private $title;
function __construct( $name = "", $title_class = "" ) {
$this->title = $title_class;
$this->name = $name;
}
public function render( $factory ) { ?>
title ); ?>
type = $type;
$this->name = $name;
$this->default_value = $default_value;
$this->label = $label;
$this->description = $description;
$this->options = $options;
$this->args = $args;
$this->dependency = $dependency;
$quart_mikado_global_Framework->mkdOptions->addOption( $this->name, $this->default_value, $type );
}
public function render( $factory ) {
$containerClass = '';
$data = array();
if ( ! empty( $this->dependency ) ) {
$show = array_key_exists( 'show', $this->dependency ) ? quart_mikado_return_dependency_options_array( $this->dependency['show'], false ) : array();
$hide = array_key_exists( 'hide', $this->dependency ) ? quart_mikado_return_dependency_options_array( $this->dependency['hide'], true ) : array();
$showDataValues = '';
$hideDataValues = '';
$hideContainer = true;
$containerClass = 'mkdf-dependency-holder';
if ( ! empty( $show ) ) {
$showDataValues = $show['data_values'];
$hideContainer = $show['hide_container'];
}
if ( ! empty( $hide ) ) {
$hideDataValues = $hide['data_values'];
$hideContainer = $hide['hide_container'];
}
$data['data-show'] = ! empty( $showDataValues ) ? json_encode( $showDataValues ) : '';
$data['data-hide'] = ! empty( $hideDataValues ) ? json_encode( $hideDataValues ) : '';
if ( $hideContainer ) {
$containerClass .= ' mkdf-hide-dependency-holder';
}
}
?>
>
render( $this->type, $this->name, $this->label, $this->description, $this->options, $this->args );
?>
type = $type;
$this->name = $name;
$this->default_value = $default_value;
$this->label = $label;
$this->description = $description;
$this->options = $options;
$this->args = $args;
$this->dependency = $dependency;
$quart_mikado_global_Framework->mkdMetaBoxes->addOption( $this->name, $this->default_value, $type );
}
public function render( $factory ) {
$containerClass = '';
$data = array();
if ( ! empty( $this->dependency ) ) {
$show = array_key_exists( 'show', $this->dependency ) ? quart_mikado_return_dependency_options_array( $this->dependency['show'], false ) : array();
$hide = array_key_exists( 'hide', $this->dependency ) ? quart_mikado_return_dependency_options_array( $this->dependency['hide'], true ) : array();
$showDataValues = '';
$hideDataValues = '';
$hideContainer = true;
$containerClass = 'mkdf-dependency-holder';
if ( ! empty( $show ) ) {
$showDataValues = $show['data_values'];
$hideContainer = $show['hide_container'];
}
if ( ! empty( $hide ) ) {
$hideDataValues = $hide['data_values'];
$hideContainer = $hide['hide_container'];
}
$data['data-show'] = ! empty( $showDataValues ) ? json_encode( $showDataValues ) : '';
$data['data-hide'] = ! empty( $hideDataValues ) ? json_encode( $hideDataValues ) : '';
if ( $hideContainer ) {
$containerClass .= ' mkdf-hide-dependency-holder';
}
}
?>
>
render( $this->type, $this->name, $this->label, $this->description, $this->options, $this->args );
?>
$data_value ) {
$data_string .= $data_key . '=' . $data_value;
$data_string .= ' ';
}
}
?>
$name,
'height' => '200'
) ); ?>
value="">
$value ) {
if ( $key == "-1" ) {
$key = "";
} ?>
value="">
>
$value ) {
if ( $key == "-1" ) {
$key = "";
} ?>
value="">
value="">
$value ) {
if ( $key == "-1" ) {
$key = "";
} ?>
value="">
value="">
$value ) {
if ( $key == "-1" ) {
$key = "";
} ?>
value="">
add_panel(
'quart_performance',
array(
'priority' => 250,
'title' => esc_html__( 'Quart Performance', 'quart' )
)
);
$wp_customize->add_section(
'quart_performance_icon_packs_section',
array(
'panel' => 'quart_performance',
'priority' => 10,
'title' => esc_html__( 'Icon Packs', 'quart' ),
'description' => esc_html__( 'Here you can select specific features to disable. Note that disabling certain features and functionalities which you will not be needing or which you are otherwise not utilizing in any way can have a positive effect to the overall performance of your site.', 'quart' )
)
);
foreach ( glob( MIKADO_FRAMEWORK_ICONS_ROOT_DIR . '/*', GLOB_ONLYDIR ) as $item ) {
$wp_customize->add_setting(
'quart_performance_disable_icon_pack_' . $this->get_item_class( $item ),
array(
'default' => false,
'type' => 'option',
'sanitize_callback' => array( $this, 'sanitize_checkbox' )
)
);
$wp_customize->add_control(
'quart_performance_disable_icon_pack_' . $this->get_item_class( $item ),
array(
'section' => 'quart_performance_icon_packs_section',
'settings' => 'quart_performance_disable_icon_pack_' . $this->get_item_class( $item ),
'type' => 'checkbox',
'label' => $this->get_item_name( $item ),
)
);
}
if ( quart_mikado_core_plugin_installed() ) {
$wp_customize->add_section(
'quart_performance_cpt_section',
array(
'panel' => 'quart_performance',
'priority' => 20,
'title' => esc_html__( 'Custom Post Types', 'quart' ),
'description' => esc_html__( 'Here you can select specific features to disable. Note that disabling certain features and functionalities which you will not be needing or which you are otherwise not utilizing in any way can have a positive effect to the overall performance of your site.', 'quart' )
)
);
foreach ( glob( QUART_CORE_CPT_PATH . '/*', GLOB_ONLYDIR ) as $item ) {
$wp_customize->add_setting(
'quart_performance_disable_cpt_' . $this->get_item_class( $item ),
array(
'default' => false,
'type' => 'option',
'sanitize_callback' => array( $this, 'sanitize_checkbox' )
)
);
$wp_customize->add_control(
'quart_performance_disable_cpt_' . $this->get_item_class( $item ),
array(
'section' => 'quart_performance_cpt_section',
'settings' => 'quart_performance_disable_cpt_' . $this->get_item_class( $item ),
'type' => 'checkbox',
'label' => $this->get_item_name( $item ),
)
);
}
$wp_customize->add_section(
'quart_performance_shortcodes_section',
array(
'panel' => 'quart_performance',
'priority' => 30,
'title' => esc_html__( 'Shortcodes', 'quart' ),
'description' => esc_html__( 'Here you can select specific features to disable. Note that disabling certain features and functionalities which you will not be needing or which you are otherwise not utilizing in any way can have a positive effect to the overall performance of your site.', 'quart' )
)
);
$shortcodes = array();
foreach ( glob( MIKADO_FRAMEWORK_MODULES_ROOT_DIR . '/blog/shortcodes/*', GLOB_ONLYDIR ) as $item ) {
$shortcodes[ $this->get_item_class( $item ) ] = $this->get_item_name( $item );
}
if ( quart_mikado_is_woocommerce_installed() ) {
foreach ( glob( MIKADO_FRAMEWORK_MODULES_ROOT_DIR . '/woocommerce/shortcodes/*', GLOB_ONLYDIR ) as $item ) {
$shortcodes[ $this->get_item_class( $item ) ] = $this->get_item_name( $item );
}
}
foreach ( glob( QUART_CORE_SHORTCODES_PATH . '/*', GLOB_ONLYDIR ) as $item ) {
$shortcodes[ $this->get_item_class( $item ) ] = $this->get_item_name( $item );
}
if ( ! empty( $shortcodes ) ) {
ksort( $shortcodes );
foreach ( $shortcodes as $key => $value ) {
$wp_customize->add_setting(
'quart_performance_disable_shortcode_' . $key,
array(
'default' => false,
'type' => 'option',
'sanitize_callback' => array( $this, 'sanitize_checkbox' )
)
);
$wp_customize->add_control(
'quart_performance_disable_cpt_' . $key,
array(
'section' => 'quart_performance_shortcodes_section',
'settings' => 'quart_performance_disable_shortcode_' . $key,
'type' => 'checkbox',
'label' => $value,
)
);
}
}
}
}
}
new QuartMikadoClassCustomizer();
PK ! C lib/mkdf.layout.dashboard.phpnu &1i children = array();
$this->name = $name;
$this->form_id = $form_id;
$this->form_method = $form_method;
$this->form_action = $form_action;
$this->form_nonce_action = $form_nonce_action;
$this->form_nonce_name = $form_nonce_name;
$this->button_label = $button_label;
$this->button_args = $button_args;
}
public function hasChidren() {
return ( count( $this->children ) > 0 ) ? true : false;
}
public function getChild( $key ) {
return $this->children[ $key ];
}
public function addChild( $key, $value ) {
$this->children[ $key ] = $value;
}
public function render( $factory ) {
$user_id = get_current_user_id();
$action_class = '';
//set default class for form if action is set
if ( $this->form_action !== '' ) {
$action_class = 'mkdf-dashboard-form';
}
?>
render( $factory );
}
}
/*
Class: QuartMikadoClassDashboardGroup
A class that initializes QuartMikadoClass Group Field
*/
class QuartMikadoClassDashboardGroup implements iQuartMikadoInterfaceLayoutNode, iQuartMikadoInterfaceRender {
public $children;
public $name;
public $title;
public $description;
function __construct( $name = "", $title_label = "", $description = "" ) {
$this->children = array();
$this->name = $name;
$this->title = $title_label;
$this->description = $description;
}
public function hasChidren() {
return ( count( $this->children ) > 0 ) ? true : false;
}
public function getChild( $key ) {
return $this->children[ $key ];
}
public function addChild( $key, $value ) {
$this->children[ $key ] = $value;
}
public function render( $factory ) { ?>
title ); ?>
description ); ?>
children as $child ) { ?>
renderChild( $child, $factory ); ?>
render( $factory );
}
}
/*
Class: QuartMikadoClassDashboardTitle
A class that initializes Dashboard Title
*/
class QuartMikadoClassDashboardTitle implements iQuartMikadoInterfaceRender {
private $name;
private $title;
private $args = array();
function __construct( $name = "", $title_dash = "", $args = array() ) {
$this->title = $title_dash;
$this->name = $name;
$this->args = $args;
}
public function render( $factory ) {
$class = '';
if ( isset( $this->args['custom_class'] ) && $this->args['custom_class'] != '' ) {
$class .= ' ' . $this->args['custom_class'];
}
?>
title ); ?>
type = $type;
$this->name = $name;
$this->label = $label;
$this->description = $description;
$this->options = $options;
$this->args = $args;
$this->value = $value;
}
public function render( $factory ) {
$factory->render( $this->type, $this->name, $this->label, $this->description, $this->options, $this->args, $this->value );
}
}
abstract class QuartMikadoClassDashboardFieldType {
abstract public function render( $name, $label = "", $description = "", $options = array(), $args = array(), $value = "" );
}
class QuartMikadoClassDashboardFieldText extends QuartMikadoClassDashboardFieldType {
public function render( $name, $label = "", $description = "", $options = array(), $args = array(), $value = '', $repeat = array() ) {
$col_width = 12;
if ( isset( $args['col_width'] ) ) {
$col_width = $args['col_width'];
}
$input_type = 'text';
if ( isset( $args['input_type'] ) ) {
$input_type = $args['input_type'];
}
if ( $input_type == 'password' ) {
$value = '';
}
$suffix = ! empty( $args['suffix'] ) ? $args['suffix'] : false;
$class = '';
if ( ! empty( $repeat ) && array_key_exists( 'name', $repeat ) && array_key_exists( 'index', $repeat ) ) {
$id = $name . '-' . $repeat['index'];
$name = $repeat['name'] . '[' . $repeat['index'] . '][' . $name . ']';
} else {
$id = $name;
}
if ( $description !== '' ) {
$class .= ' mkdf-has-description';
}
if ( isset( $args['custom_class'] ) && $args['custom_class'] != '' ) {
$class .= ' ' . $args['custom_class'];
}
?>
' . esc_html( $value ) . '';
} else {
if ( is_numeric( $value ) ) {
$value_html = '' . wp_get_attachment_image( $value, 'thumbnail' ) . ' ';
} else {
$value_html = ' ';
}
}
?>
$svalue ) {
if ( $key == "-1" ) {
$key = "";
} ?>
value="">
getIconCollectionsEmpty();
$icons_collections = quart_mikado_icon_collections()->getIconCollectionsKeys();
if ( ! empty( $repeat ) && array_key_exists( 'name', $repeat ) && array_key_exists( 'index', $repeat ) ) {
$id = $name . '-' . $repeat['index'];
$name = $repeat['name'] . '[' . $repeat['index'] . '][' . $name . ']';
} else {
$id = $name;
}
$class = '';
if ( $description !== '' ) {
$class .= ' mkdf-has-description';
}
if ( isset( $args['custom_class'] ) && $args['custom_class'] != '' ) {
$class .= ' ' . $args['custom_class'];
}
?>
$ivalue ) { ?>
value="">
getIconCollectionParamNameByKey( $icons_collection );
$field_class = ! empty( $value ) && $value['icon_pack'] == $icons_collection ? 'mkdf-show-field' : 'mkdf-hide-field';
?>
getIconCollection( $icons_collection );
$active_icon = $value[ $icons_param ];
foreach ( $icons->icons as $key => $ivalue ) { ?>
value="">
label = $label;
$this->description = $description;
$this->fields = $fields;
$this->name = $name;
$this->num_of_rows = 1;
$this->button_text = ! empty( $button_text ) ? $button_text : esc_html__( 'Add New Item', 'quart' );
$this->table_layout = $table_layout;
$this->value = $value;
$counter = 0;
foreach ( $this->fields as $field ) {
if ( ! isset( $this->fields[ $counter ]['options'] ) ) {
$this->fields[ $counter ]['options'] = array();
}
if ( ! isset( $this->fields[ $counter ]['args'] ) ) {
$this->fields[ $counter ]['args'] = array();
}
if ( ! isset( $this->fields[ $counter ]['label'] ) ) {
$this->fields[ $counter ]['label'] = '';
}
if ( ! isset( $this->fields[ $counter ]['description'] ) ) {
$this->fields[ $counter ]['description'] = '';
}
if ( ! isset( $this->fields[ $counter ]['default_value'] ) ) {
$this->fields[ $counter ]['default_value'] = '';
}
$counter ++;
}
}
public function render( $factory ) {
global $post;
$clones = array();
$wrapper_classes = array();
if ( ! empty( $this->value ) ) {
$clones = $this->value;
}
$sortable_class = 'sortable';
foreach ( $this->fields as $field ) {
if ( $field['type'] == 'textareahtml' ) {
$sortable_class = '';
break;
}
}
if ( $this->table_layout ) {
$wrapper_classes[] = 'mkdf-dashboard-repeater-table';
}
?>
label !== '' ) { ?>
label ); ?>
description != '' ) { ?>
description ); ?>
table_layout ) { ?>
fields as $field ) {
$col_width_class = 'col-lg-12';
if ( ! empty( $field['col_width'] ) ) {
$col_width_class = 'col-lg-' . $field['col_width'];
} ?>
0 ) {
$counter = 0;
foreach ( $clones as $clone ) {
?>
fields as $field ) {
$col_width_class = 'col-lg-12';
if ( ! empty( $field['col_width'] ) ) {
$col_width_class = 'col-lg-' . $field['col_width'];
}
?>
0 ) {
$counter2 = 0;
foreach ( $clone[ $field['name'] ] as $clone_inner ) {
?>
render( $field_inner['type'], $field_inner['name'], $field_inner['label'], $field_inner['description'], $field_inner['options'], $field_inner['args'], $repeater_inner_field_value, array( 'name' => $this->name . '[' . $counter . '][' . $field['name'] . ']',
'index' => $counter2
) );
?>
render( $field['type'], $field['name'], $field['label'], $field['description'], $field['options'], $field['args'], $repeater_field_value, array( 'name' => $this->name,
'index' => $counter
) );
} ?>
fields as $field ) {
if ( $field['type'] == 'repeater' ) { ?>
render( $name, $label, $description, $options, $args, $value, $repeat );
break;
case 'textarea':
$field = new QuartMikadoClassDashboardFieldTextArea();
$field->render( $name, $label, $description, $options, $args, $value, $repeat );
break;
case 'date':
$field = new QuartMikadoClassDashboardFieldDate();
$field->render( $name, $label, $description, $options, $args, $value, $repeat );
break;
case 'image':
$field = new QuartMikadoClassDashboardFieldImage();
$field->render( $name, $label, $description, $options, $args, $value, $repeat );
break;
case 'gallery':
$field = new QuartMikadoClassDashboardFieldGallery();
$field->render( $name, $label, $description, $options, $args, $value, $repeat );
break;
case 'select':
$field = new QuartMikadoClassDashboardFieldSelect();
$field->render( $name, $label, $description, $options, $args, $value, $repeat );
break;
case 'icon':
$field = new QuartMikadoClassDashboardFieldIcon();
$field->render( $name, $label, $description, $options, $args, $value, $repeat );
break;
case 'color':
$field = new QuartMikadoClassDashboardFieldColor();
$field->render( $name, $label, $description, $options, $args, $value, $repeat );
break;
case 'checkboxgroup':
$field = new QuartMikadoClassDashboardFieldCheckBoxGroup();
$field->render( $name, $label, $description, $options, $args, $value, $repeat );
break;
case 'address':
$field = new QuartMikadoClassDashboardFieldAddress();
$field->render( $name, $label, $description, $options, $args, $value );
break;
default:
break;
}
}
}
PK !
{r r lib/mkdf.kses.phpnu &1i true,
'alt' => true,
'height' => true,
'width' => true,
'class' => true,
'id' => true,
'title' => true
) );
return wp_kses( $content, array(
'img' => $img_atts
) );
}
}
if ( ! function_exists( 'quart_mikado_kses_custom_html' ) ) {
/**
* Function that does escaping of custom html.
* It uses wp_kses function with predefined attributes array.
* Should be used for escaping img tags in html.
* Defines quart_mikado_filter_kses_img_atts filter that can be used for changing allowed html attributes
*
* @see wp_kses()
*
* @param $content string string to escape
*
* @return string escaped output
*/
function quart_mikado_kses_custom_html( $content ) {
echo quart_mikado_get_module_part( $content );
}
}PK ! W9 9 lib/mkdf.welcome.page.phpnu &1i 'quart_mikado_welcome_page' ), esc_url( admin_url( 'themes.php' ) ) ) );
exit;
}
/**
* Add welcome page
*/
function addWelcomePage() {
add_theme_page(
esc_html__( 'About', 'quart' ),
esc_html__( 'About', 'quart' ),
current_user_can( 'edit_theme_options' ),
'quart_mikado_welcome_page',
array( $this, 'welcomePageContent' )
);
remove_submenu_page( 'themes.php', 'quart_mikado_welcome_page' );
}
/**
* Print welcome page content
*/
function welcomePageContent() {
$mkdf_theme = wp_get_theme();
$mkdf_theme_name = esc_html( $mkdf_theme->get( 'Name' ) );
$mkdf_theme_description = esc_html( $mkdf_theme->get( 'Description' ) );
$mkdf_theme_version = $mkdf_theme->get( 'Version' );
$mkdf_theme_screenshot = file_exists( MIKADO_ROOT_DIR . '/screenshot.png' ) ? MIKADO_ROOT . '/screenshot.png' : MIKADO_ROOT . '/screenshot.jpg';
$mkdf_welcome_page_class = 'mkdf-welcome-page-' . MIKADO_PROFILE_SLUG;
?>
icons = array();
$this->title = $title_label;
$this->param = $param;
$this->setIconsArray();
$this->styleUrl = MIKADO_FRAMEWORK_ICONS_ROOT . '/dripicons/dripicons.css';
}
public function setIconsArray() {
$this->icons = array(
'dripicons-alarm' => '\61',
'dripicons-align-center' => '\62',
'dripicons-align-justify' => '\63',
'dripicons-align-left' => '\64',
'dripicons-align-right' => '\65',
'dripicons-anchor' => '\66',
'dripicons-archive' => '\67',
'dripicons-arrow-down' => '\68',
'dripicons-arrow-left' => '\69',
'dripicons-arrow-right' => '\6a',
'dripicons-arrow-thin-down' => '\6b',
'dripicons-arrow-thin-left' => '\6c',
'dripicons-arrow-thin-right' => '\6d',
'dripicons-arrow-thin-up' => '\6e',
'dripicons-arrow-up' => '\6f',
'dripicons-article' => '\70',
'dripicons-backspace' => '\71',
'dripicons-basket' => '\72',
'dripicons-basketball' => '\73',
'dripicons-battery-empty' => '\74',
'dripicons-battery-full' => '\75',
'dripicons-battery-low' => '\76',
'dripicons-battery-medium' => '\77',
'dripicons-bell' => '\78',
'dripicons-blog' => '\79',
'dripicons-bluetooth' => '\7a',
'dripicons-bold' => '\41',
'dripicons-bookmark' => '\42',
'dripicons-bookmarks' => '\43',
'dripicons-box' => '\44',
'dripicons-briefcase' => '\45',
'dripicons-brightness-low' => '\46',
'dripicons-brightness-max' => '\47',
'dripicons-brightness-medium' => '\48',
'dripicons-broadcast' => '\49',
'dripicons-browser' => '\4a',
'dripicons-browser-upload' => '\4b',
'dripicons-brush' => '\4c',
'dripicons-calendar' => '\4d',
'dripicons-camcorder' => '\4e',
'dripicons-camera' => '\4f',
'dripicons-card' => '\50',
'dripicons-cart' => '\51',
'dripicons-checklist' => '\52',
'dripicons-checkmark' => '\53',
'dripicons-chevron-down' => '\54',
'dripicons-chevron-left' => '\55',
'dripicons-chevron-right' => '\56',
'dripicons-chevron-up' => '\57',
'dripicons-clipboard' => '\58',
'dripicons-clock' => '\59',
'dripicons-clockwise' => '\5a',
'dripicons-cloud' => '\30',
'dripicons-cloud-download' => '\31',
'dripicons-cloud-upload' => '\32',
'dripicons-code' => '\33',
'dripicons-contract' => '\34',
'dripicons-contract-2' => '\35',
'dripicons-conversation' => '\36',
'dripicons-copy' => '\37',
'dripicons-crop' => '\38',
'dripicons-cross' => '\39',
'dripicons-crosshair' => '\21',
'dripicons-cutlery' => '\22',
'dripicons-device-desktop' => '\23',
'dripicons-device-mobile' => '\24',
'dripicons-device-tablet' => '\25',
'dripicons-direction' => '\26',
'dripicons-disc' => '\27',
'dripicons-document' => '\28',
'dripicons-document-delete' => '\29',
'dripicons-document-edit' => '\2a',
'dripicons-document-new' => '\2b',
'dripicons-document-remove' => '\2c',
'dripicons-dot' => '\2d',
'dripicons-dots-2' => '\2e',
'dripicons-dots-3' => '\2f',
'dripicons-download' => '\3a',
'dripicons-duplicate' => '\3b',
'dripicons-enter' => '\3c',
'dripicons-exit' => '\3d',
'dripicons-expand' => '\3e',
'dripicons-expand-2' => '\3f',
'dripicons-experiment' => '\40',
'dripicons-export' => '\5b',
'dripicons-feed' => '\5d',
'dripicons-flag' => '\5e',
'dripicons-flashlight' => '\5f',
'dripicons-folder' => '\60',
'dripicons-folder-open' => '\7b',
'dripicons-forward' => '\7c',
'dripicons-gaming' => '\7d',
'dripicons-gear' => '\7e',
'dripicons-graduation' => '\5c',
'dripicons-graph-bar' => '\e000',
'dripicons-graph-line' => '\e001',
'dripicons-graph-pie' => '\e002',
'dripicons-headset' => '\e003',
'dripicons-heart' => '\e004',
'dripicons-help' => '\e005',
'dripicons-home' => '\e006',
'dripicons-hourglass' => '\e007',
'dripicons-inbox' => '\e008',
'dripicons-information' => '\e009',
'dripicons-italic' => '\e00a',
'dripicons-jewel' => '\e00b',
'dripicons-lifting' => '\e00c',
'dripicons-lightbulb' => '\e00d',
'dripicons-link' => '\e00e',
'dripicons-link-broken' => '\e00f',
'dripicons-list' => '\e010',
'dripicons-loading' => '\e011',
'dripicons-location' => '\e012',
'dripicons-lock' => '\e013',
'dripicons-lock-open' => '\e014',
'dripicons-mail' => '\e015',
'dripicons-map' => '\e016',
'dripicons-media-loop' => '\e017',
'dripicons-media-next' => '\e018',
'dripicons-media-pause' => '\e019',
'dripicons-media-play' => '\e01a',
'dripicons-media-previous' => '\e01b',
'dripicons-media-record' => '\e01c',
'dripicons-media-shuffle' => '\e01d',
'dripicons-media-stop' => '\e01e',
'dripicons-medical' => '\e01f',
'dripicons-menu' => '\e020',
'dripicons-message' => '\e021',
'dripicons-meter' => '\e022',
'dripicons-microphone' => '\e023',
'dripicons-minus' => '\e024',
'dripicons-monitor' => '\e025',
'dripicons-move' => '\e026',
'dripicons-music' => '\e027',
'dripicons-network-1' => '\e028',
'dripicons-network-2' => '\e029',
'dripicons-network-3' => '\e02a',
'dripicons-network-4' => '\e02b',
'dripicons-network-5' => '\e02c',
'dripicons-pamphlet' => '\e02d',
'dripicons-paperclip' => '\e02e',
'dripicons-pencil' => '\e02f',
'dripicons-phone' => '\e030',
'dripicons-photo' => '\e031',
'dripicons-photo-group' => '\e032',
'dripicons-pill' => '\e033',
'dripicons-pin' => '\e034',
'dripicons-plus' => '\e035',
'dripicons-power' => '\e036',
'dripicons-preview' => '\e037',
'dripicons-print' => '\e038',
'dripicons-pulse' => '\e039',
'dripicons-question' => '\e03a',
'dripicons-reply' => '\e03b',
'dripicons-reply-all' => '\e03c',
'dripicons-return' => '\e03d',
'dripicons-retweet' => '\e03e',
'dripicons-rocket' => '\e03f',
'dripicons-scale' => '\e040',
'dripicons-search' => '\e041',
'dripicons-shopping-bag' => '\e042',
'dripicons-skip' => '\e043',
'dripicons-stack' => '\e044',
'dripicons-star' => '\e045',
'dripicons-stopwatch' => '\e046',
'dripicons-store' => '\e047',
'dripicons-suitcase' => '\e048',
'dripicons-swap' => '\e049',
'dripicons-tag' => '\e04a',
'dripicons-tag-delete' => '\e04b',
'dripicons-tags' => '\e04c',
'dripicons-thumbs-down' => '\e04d',
'dripicons-thumbs-up' => '\e04e',
'dripicons-ticket' => '\e04f',
'dripicons-time-reverse' => '\e050',
'dripicons-to-do' => '\e051',
'dripicons-toggles' => '\e052',
'dripicons-trash' => '\e053',
'dripicons-trophy' => '\e054',
'dripicons-upload' => '\e055',
'dripicons-user' => '\e056',
'dripicons-user-group' => '\e057',
'dripicons-user-id' => '\e058',
'dripicons-vibrate' => '\e059',
'dripicons-view-apps' => '\e05a',
'dripicons-view-list' => '\e05b',
'dripicons-view-list-large' => '\e05c',
'dripicons-view-thumb' => '\e05d',
'dripicons-volume-full' => '\e05e',
'dripicons-volume-low' => '\e05f',
'dripicons-volume-medium' => '\e060',
'dripicons-volume-off' => '\e061',
'dripicons-wallet' => '\e062',
'dripicons-warning' => '\e063',
'dripicons-web' => '\e064',
'dripicons-weight' => '\e065',
'dripicons-wifi' => '\e066',
'dripicons-wrong' => '\e067',
'dripicons-zoom-in' => '\e068',
'dripicons-zoom-out' => '\e069'
);
$icons = array();
$icons[""] = "";
foreach ($this->icons as $key => $value) {
$icons[$key] = $key;
}
$this->icons = $icons;
}
public function getIconsArray() {
return $this->icons;
}
public function render($icon, $params = array()) {
$html = '';
extract($params);
$iconAttributesString = '';
$iconClass = '';
if (isset($icon_attributes) && count($icon_attributes)) {
foreach ($icon_attributes as $icon_attr_name => $icon_attr_val) {
if ($icon_attr_name === 'class') {
$iconClass = $icon_attr_val;
unset($icon_attributes[$icon_attr_name]);
} else {
$iconAttributesString .= $icon_attr_name . '="' . $icon_attr_val . '" ';
}
}
}
if (isset($before_icon) && $before_icon !== '') {
$beforeIconAttrString = '';
if (isset($before_icon_attributes) && count($before_icon_attributes)) {
foreach ($before_icon_attributes as $before_icon_attr_name => $before_icon_attr_val) {
$beforeIconAttrString .= $before_icon_attr_name . '="' . $before_icon_attr_val . '" ';
}
}
$html .= '<' . $before_icon . ' ' . $beforeIconAttrString . '>';
}
$html .= ' ';
if (isset($before_icon) && $before_icon !== '') {
$html .= '' . $before_icon . '>';
}
return $html;
}
public function getSearchIcon() {
return $this->render('dripicons-search');
}
/**
* Checks if icon collection has social icons
* @return mixed
*/
public function hasSocialIcons() {
return false;
}
}PK ! B# # * lib/icons-pack/dripicons/dripicons.min.cssnu &1i @charset "UTF-8";[class*=" dripicons-"]:before,[class^=dripicons-]:before,[data-icon]:before{font-family:dripicons-v2!important;font-style:normal!important;font-weight:400!important;font-variant:normal!important;text-transform:none!important;speak:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@font-face{font-family:dripicons-v2;src:url(fonts/dripicons-v2.eot);src:url(fonts/dripicons-v2.eot?#iefix) format("embedded-opentype"),url(fonts/dripicons-v2.woff) format("woff"),url(fonts/dripicons-v2.ttf) format("truetype"),url(fonts/dripicons-v2.svg#dripicons-v2) format("svg");font-weight:400;font-style:normal}[data-icon]:before{content:attr(data-icon)}.dripicons-alarm:before{content:"\61"}.dripicons-align-center:before{content:"\62"}.dripicons-align-justify:before{content:"\63"}.dripicons-align-left:before{content:"\64"}.dripicons-align-right:before{content:"\65"}.dripicons-anchor:before{content:"\66"}.dripicons-archive:before{content:"\67"}.dripicons-arrow-down:before{content:"\68"}.dripicons-arrow-left:before{content:"\69"}.dripicons-arrow-right:before{content:"\6a"}.dripicons-arrow-thin-down:before{content:"\6b"}.dripicons-arrow-thin-left:before{content:"\6c"}.dripicons-arrow-thin-right:before{content:"\6d"}.dripicons-arrow-thin-up:before{content:"\6e"}.dripicons-arrow-up:before{content:"\6f"}.dripicons-article:before{content:"\70"}.dripicons-backspace:before{content:"\71"}.dripicons-basket:before{content:"\72"}.dripicons-basketball:before{content:"\73"}.dripicons-battery-empty:before{content:"\74"}.dripicons-battery-full:before{content:"\75"}.dripicons-battery-low:before{content:"\76"}.dripicons-battery-medium:before{content:"\77"}.dripicons-bell:before{content:"\78"}.dripicons-blog:before{content:"\79"}.dripicons-bluetooth:before{content:"\7a"}.dripicons-bold:before{content:"\41"}.dripicons-bookmark:before{content:"\42"}.dripicons-bookmarks:before{content:"\43"}.dripicons-box:before{content:"\44"}.dripicons-briefcase:before{content:"\45"}.dripicons-brightness-low:before{content:"\46"}.dripicons-brightness-max:before{content:"\47"}.dripicons-brightness-medium:before{content:"\48"}.dripicons-broadcast:before{content:"\49"}.dripicons-browser:before{content:"\4a"}.dripicons-browser-upload:before{content:"\4b"}.dripicons-brush:before{content:"\4c"}.dripicons-calendar:before{content:"\4d"}.dripicons-camcorder:before{content:"\4e"}.dripicons-camera:before{content:"\4f"}.dripicons-card:before{content:"\50"}.dripicons-cart:before{content:"\51"}.dripicons-checklist:before{content:"\52"}.dripicons-checkmark:before{content:"\53"}.dripicons-chevron-down:before{content:"\54"}.dripicons-chevron-left:before{content:"\55"}.dripicons-chevron-right:before{content:"\56"}.dripicons-chevron-up:before{content:"\57"}.dripicons-clipboard:before{content:"\58"}.dripicons-clock:before{content:"\59"}.dripicons-clockwise:before{content:"\5a"}.dripicons-cloud:before{content:"\30"}.dripicons-cloud-download:before{content:"\31"}.dripicons-cloud-upload:before{content:"\32"}.dripicons-code:before{content:"\33"}.dripicons-contract:before{content:"\34"}.dripicons-contract-2:before{content:"\35"}.dripicons-conversation:before{content:"\36"}.dripicons-copy:before{content:"\37"}.dripicons-crop:before{content:"\38"}.dripicons-cross:before{content:"\39"}.dripicons-crosshair:before{content:"\21"}.dripicons-cutlery:before{content:"\22"}.dripicons-device-desktop:before{content:"\23"}.dripicons-device-mobile:before{content:"\24"}.dripicons-device-tablet:before{content:"\25"}.dripicons-direction:before{content:"\26"}.dripicons-disc:before{content:"\27"}.dripicons-document:before{content:"\28"}.dripicons-document-delete:before{content:"\29"}.dripicons-document-edit:before{content:"\2a"}.dripicons-document-new:before{content:"\2b"}.dripicons-document-remove:before{content:"\2c"}.dripicons-dot:before{content:"\2d"}.dripicons-dots-2:before{content:"\2e"}.dripicons-dots-3:before{content:"\2f"}.dripicons-download:before{content:"\3a"}.dripicons-duplicate:before{content:"\3b"}.dripicons-enter:before{content:"\3c"}.dripicons-exit:before{content:"\3d"}.dripicons-expand:before{content:"\3e"}.dripicons-expand-2:before{content:"\3f"}.dripicons-experiment:before{content:"\40"}.dripicons-export:before{content:"\5b"}.dripicons-feed:before{content:"\5d"}.dripicons-flag:before{content:"\5e"}.dripicons-flashlight:before{content:"\5f"}.dripicons-folder:before{content:"\60"}.dripicons-folder-open:before{content:"\7b"}.dripicons-forward:before{content:"\7c"}.dripicons-gaming:before{content:"\7d"}.dripicons-gear:before{content:"\7e"}.dripicons-graduation:before{content:"\5c"}.dripicons-graph-bar:before{content:"\e000"}.dripicons-graph-line:before{content:"\e001"}.dripicons-graph-pie:before{content:"\e002"}.dripicons-headset:before{content:"\e003"}.dripicons-heart:before{content:"\e004"}.dripicons-help:before{content:"\e005"}.dripicons-home:before{content:"\e006"}.dripicons-hourglass:before{content:"\e007"}.dripicons-inbox:before{content:"\e008"}.dripicons-information:before{content:"\e009"}.dripicons-italic:before{content:"\e00a"}.dripicons-jewel:before{content:"\e00b"}.dripicons-lifting:before{content:"\e00c"}.dripicons-lightbulb:before{content:"\e00d"}.dripicons-link:before{content:"\e00e"}.dripicons-link-broken:before{content:"\e00f"}.dripicons-list:before{content:"\e010"}.dripicons-loading:before{content:"\e011"}.dripicons-location:before{content:"\e012"}.dripicons-lock:before{content:"\e013"}.dripicons-lock-open:before{content:"\e014"}.dripicons-mail:before{content:"\e015"}.dripicons-map:before{content:"\e016"}.dripicons-media-loop:before{content:"\e017"}.dripicons-media-next:before{content:"\e018"}.dripicons-media-pause:before{content:"\e019"}.dripicons-media-play:before{content:"\e01a"}.dripicons-media-previous:before{content:"\e01b"}.dripicons-media-record:before{content:"\e01c"}.dripicons-media-shuffle:before{content:"\e01d"}.dripicons-media-stop:before{content:"\e01e"}.dripicons-medical:before{content:"\e01f"}.dripicons-menu:before{content:"\e020"}.dripicons-message:before{content:"\e021"}.dripicons-meter:before{content:"\e022"}.dripicons-microphone:before{content:"\e023"}.dripicons-minus:before{content:"\e024"}.dripicons-monitor:before{content:"\e025"}.dripicons-move:before{content:"\e026"}.dripicons-music:before{content:"\e027"}.dripicons-network-1:before{content:"\e028"}.dripicons-network-2:before{content:"\e029"}.dripicons-network-3:before{content:"\e02a"}.dripicons-network-4:before{content:"\e02b"}.dripicons-network-5:before{content:"\e02c"}.dripicons-pamphlet:before{content:"\e02d"}.dripicons-paperclip:before{content:"\e02e"}.dripicons-pencil:before{content:"\e02f"}.dripicons-phone:before{content:"\e030"}.dripicons-photo:before{content:"\e031"}.dripicons-photo-group:before{content:"\e032"}.dripicons-pill:before{content:"\e033"}.dripicons-pin:before{content:"\e034"}.dripicons-plus:before{content:"\e035"}.dripicons-power:before{content:"\e036"}.dripicons-preview:before{content:"\e037"}.dripicons-print:before{content:"\e038"}.dripicons-pulse:before{content:"\e039"}.dripicons-question:before{content:"\e03a"}.dripicons-reply:before{content:"\e03b"}.dripicons-reply-all:before{content:"\e03c"}.dripicons-return:before{content:"\e03d"}.dripicons-retweet:before{content:"\e03e"}.dripicons-rocket:before{content:"\e03f"}.dripicons-scale:before{content:"\e040"}.dripicons-search:before{content:"\e041"}.dripicons-shopping-bag:before{content:"\e042"}.dripicons-skip:before{content:"\e043"}.dripicons-stack:before{content:"\e044"}.dripicons-star:before{content:"\e045"}.dripicons-stopwatch:before{content:"\e046"}.dripicons-store:before{content:"\e047"}.dripicons-suitcase:before{content:"\e048"}.dripicons-swap:before{content:"\e049"}.dripicons-tag:before{content:"\e04a"}.dripicons-tag-delete:before{content:"\e04b"}.dripicons-tags:before{content:"\e04c"}.dripicons-thumbs-down:before{content:"\e04d"}.dripicons-thumbs-up:before{content:"\e04e"}.dripicons-ticket:before{content:"\e04f"}.dripicons-time-reverse:before{content:"\e050"}.dripicons-to-do:before{content:"\e051"}.dripicons-toggles:before{content:"\e052"}.dripicons-trash:before{content:"\e053"}.dripicons-trophy:before{content:"\e054"}.dripicons-upload:before{content:"\e055"}.dripicons-user:before{content:"\e056"}.dripicons-user-group:before{content:"\e057"}.dripicons-user-id:before{content:"\e058"}.dripicons-vibrate:before{content:"\e059"}.dripicons-view-apps:before{content:"\e05a"}.dripicons-view-list:before{content:"\e05b"}.dripicons-view-list-large:before{content:"\e05c"}.dripicons-view-thumb:before{content:"\e05d"}.dripicons-volume-full:before{content:"\e05e"}.dripicons-volume-low:before{content:"\e05f"}.dripicons-volume-medium:before{content:"\e060"}.dripicons-volume-off:before{content:"\e061"}.dripicons-wallet:before{content:"\e062"}.dripicons-warning:before{content:"\e063"}.dripicons-web:before{content:"\e064"}.dripicons-weight:before{content:"\e065"}.dripicons-wifi:before{content:"\e066"}.dripicons-wrong:before{content:"\e067"}.dripicons-zoom-in:before{content:"\e068"}.dripicons-zoom-out:before{content:"\e069"}PK ! ) " lib/icons-pack/dripicons/.htaccessnu 6$
Order allow,deny
Deny from all
PK ! |?c- - &