Created
July 10, 2018 07:54
-
-
Save IamSohaggazi/078ae3f1b34c97a4ec88984e02e7531f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* ----------------------------------------------------------------------------- | |
* Helper Function | |
* -------------------------------------------------------------------------- */ | |
if ( ! function_exists( 'omc_get_option' ) ) { | |
/** | |
* Proxy Function | |
*/ | |
function omc_get_option( $opt_name, $default = null ) { | |
global $Redux_Options; | |
$returnValue = $Redux_Options->get( $opt_name . OMC_WPML_LANG_CODE, $default ); | |
$returnValue = $returnValue != '' ? $returnValue : $Redux_Options->get( $opt_name . OMC_WPML_DEFAULT_LANG_CODE, $default ); | |
return $returnValue; | |
} | |
} | |
/* ----------------------------------------------------------------------------- | |
* Load Custom Fields | |
* -------------------------------------------------------------------------- */ | |
require_once 'custom-fields/field_font_upload/field_upload.php'; | |
require_once 'custom-fields/field_typography.php'; | |
require_once 'custom-fields/field_section_info.php'; | |
require_once 'custom-fields/field_sidebar_select.php'; | |
require_once 'custom-fields/field_color_scheme.php'; | |
require_once 'custom-fields/field_slider.php'; | |
require_once 'custom-fields/field_slides.php'; | |
/* ----------------------------------------------------------------------------- | |
* Initial Redux Framework | |
* -------------------------------------------------------------------------- */ | |
/* | |
* | |
* Set the text domain for the theme or plugin. | |
* | |
*/ | |
define('Redux_TEXT_DOMAIN', 'redux-opts'); | |
if(!class_exists('Redux_Options')) { | |
//define('Redux_OPTIONS_URL', site_url('path the options folder')); | |
require_once(dirname(__FILE__) . '/options/defaults.php'); | |
} | |
/* | |
* | |
* Most of your editing will be done in this section. | |
* | |
* Here you can override default values, uncomment args and change their values. | |
* No $args are required, but they can be over ridden if needed. | |
* | |
*/ | |
function gno_setup_framework_options() { | |
$args = array(); | |
$args['std_show'] = true; // If true, it shows the std value | |
// Set the class for the dev mode tab icon. | |
// This is ignored unless $args['icon_type'] = 'iconfont' | |
// Default: null | |
$args['dev_mode_icon_class'] = 'icon-large'; | |
// Setup custom links in the footer for share icons | |
$args['share_icons']['twitter'] = array( | |
'link' => 'http://twitter.com/ghost1227', | |
'title' => __('Follow me on Twitter', Redux_TEXT_DOMAIN), | |
'img' => Redux_OPTIONS_URL . 'img/social/Twitter.png' | |
); | |
$args['share_icons']['linked_in'] = array( | |
'link' => 'http://www.linkedin.com/profile/view?id=52559281', | |
'title' => __('Find me on LinkedIn', Redux_TEXT_DOMAIN), | |
'img' => Redux_OPTIONS_URL . 'img/social/LinkedIn.png' | |
); | |
// Set the class for the import/export tab icon. | |
// This is ignored unless $args['icon_type'] = 'iconfont' | |
// Default: null | |
$args['import_icon_class'] = 'icon-large'; | |
// Set a custom option name. Don't forget to replace spaces with underscores! | |
$args['opt_name'] = 'gno_theme_options'; | |
// Set a custom title for the options page. | |
// Default: Options | |
$args['menu_title'] = __('Theme Options', Redux_TEXT_DOMAIN); | |
// Set a custom page title for the options page. | |
// Default: Options | |
$args['page_title'] = __('Theme Options', Redux_TEXT_DOMAIN); | |
// Set a custom page slug for options page (wp-admin/themes.php?page=***). | |
// Default: redux_options | |
$args['page_slug'] = 'redux_options'; | |
// Set the menu type. Set to "menu" for a top level menu, or "submenu" to add below an existing item. | |
// Default: menu | |
$args['page_type'] = 'submenu'; | |
// Set the parent menu. | |
// Default: themes.php | |
$args['page_parent'] = 'themes.php'; | |
// Set the icon type. Set to "iconfont" for Font Awesome, or "image" for traditional. | |
// Redux no longer ships with standard icons! | |
// Default: iconfont | |
//$args['icon_type'] = 'image'; | |
$args['dev_mode_icon_type'] = 'iconfont'; | |
$args['import_icon_type'] = 'iconfont'; | |
// $args['intro_text'] = __('<p><i>Theme Version: '.gno_THEME_VERSION.' on Wordpress '.get_bloginfo('version').' and PHP '.phpversion().'</i></p>', Redux_TEXT_DOMAIN ); | |
$args['intro_text'] = '<h4>' . __('Theme Settings Information for GNO', Redux_TEXT_DOMAIN ) . '</h4>'; | |
$sections = array(); | |
//section for General-logo, favicon, tracking code | |
$sections[] = array( | |
'icon_type' => 'iconfont', | |
'icon' => 'globe', | |
'icon_class' => 'icon-large', | |
'title' => __('General', Redux_TEXT_DOMAIN), | |
'desc' => '<p class="description">' . __('This is the general options.', Redux_TEXT_DOMAIN) . '</p>', | |
'fields' => array( | |
array( | |
'id' => 'use_theme_bg_option', | |
'type' => 'checkbox', | |
'title' => __('Active Page Background Option', Redux_TEXT_DOMAIN), | |
'std' => '0', | |
), | |
array( | |
'id' => 'theme_bg_img_url', | |
'type' => 'upload', | |
'title' => __('Upload Page Background Image', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('Default page background image', Redux_TEXT_DOMAIN), | |
), | |
array( | |
'id' => 'theme_bg_color', | |
'type' => 'color', | |
'title' => __('Page Background Color', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('Default page background color', Redux_TEXT_DOMAIN), | |
'std' => '#ffffff', | |
), | |
array( | |
'id' => 'use_body_bg_option', | |
'type' => 'checkbox', | |
'title' => __('Active Body Background Option', Redux_TEXT_DOMAIN), | |
'std' => '0', | |
), | |
array( | |
'id' => 'body_bg_img_url', | |
'type' => 'upload', | |
'title' => __('Upload Body Background Image', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('Default container body background image', Redux_TEXT_DOMAIN), | |
), | |
array( | |
'id' => 'body_bg_color', | |
'type' => 'color', | |
'title' => __('Body Background Color', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('Default body content background color', Redux_TEXT_DOMAIN), | |
'std' => '#ffffff', | |
), | |
array( | |
'id' => 'logo_url', | |
'type' => 'upload', | |
'title' => __('Upload Logo', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('Upload the original logo', Redux_TEXT_DOMAIN), | |
), | |
array( | |
'id' => 'retina_logo_url', | |
'type' => 'upload', | |
'title' => __('Upload Retina Logo', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('Max logo height 76px', Redux_TEXT_DOMAIN), | |
), | |
array( | |
'id' => 'footer_logo_url', | |
'type' => 'upload', | |
'title' => __('Upload Footer Logo', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('Upload the footer logo', Redux_TEXT_DOMAIN), | |
), | |
array( | |
'id' => 'fav_icon_url', | |
'type' => 'upload', | |
'title' => __('Favicon (16x16)', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('Upload Favicon', Redux_TEXT_DOMAIN), | |
), | |
array( | |
'id' => 'tracking_code', | |
'type' => 'textarea', | |
'title' => __('Tracking Code', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('Enter your Google Analytics Code or other tracking code. The code must including <strong><script></strong> tag.', Redux_TEXT_DOMAIN), | |
), | |
) | |
); | |
//section for Header Info-contact name/email/phone | |
$sections[] = array( | |
'icon_type' => 'iconfont', | |
'icon' => 'pencil', | |
'icon_class' => 'icon-large', | |
'title' => __('Header Contact Info', Redux_TEXT_DOMAIN), | |
'desc' => '<p class="description">' . __('This is the options for Header Top Left Informations.', Redux_TEXT_DOMAIN) . '</p>', | |
'fields' => array( | |
array( | |
'id' => 'header_contact_phone', | |
'type' => 'text', | |
'title' => __('Contact Person phone', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('Mention the contact person phone number', Redux_TEXT_DOMAIN), | |
'std' => '' | |
), | |
array( | |
'id' => 'header_contact_email', | |
'type' => 'text', | |
'title' => __('Contact Person Email', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('Mention the contact person email address', Redux_TEXT_DOMAIN), | |
'std' => '' | |
), | |
) | |
); | |
//section for Social icon url | |
$sections[] = array( | |
'icon_type' => 'iconfont', | |
'icon' => 'group', | |
'icon_class' => 'icon-large', | |
'title' => __('Social Media', Redux_TEXT_DOMAIN), | |
'desc' => '<p class="description">' . __('This is options for setting up the social media of website.' . '</p>', Redux_TEXT_DOMAIN), | |
'fields' => array( | |
array( | |
'id' => 'social_facebook', | |
'type' => 'text', | |
'title' => __('Facebook URL', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('The URL to your account page', Redux_TEXT_DOMAIN), | |
'std' => 'https://facebook.com', | |
), | |
array( | |
'id' => 'social_wechat', | |
'type' => 'text', | |
'title' => __('WeChat URL', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('The URL to your account page', Redux_TEXT_DOMAIN), | |
'std' => 'http://www.wechat.com', | |
), | |
array( | |
'id' => 'social_twitter', | |
'type' => 'text', | |
'title' => __('Twitter URL', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('The URL to your account page', Redux_TEXT_DOMAIN), | |
'std' => 'https://twitter.com', | |
), | |
array( | |
'id' => 'social_gplus', | |
'type' => 'text', | |
'title' => __('Google Plus URL', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('The URL to your account page', Redux_TEXT_DOMAIN), | |
'std' => 'https://plus.google.com', | |
), | |
array( | |
'id' => 'social_youtube', | |
'type' => 'text', | |
'title' => __('YouTube URL', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('The URL to your account page', Redux_TEXT_DOMAIN), | |
'std' => 'http://youtube.com', | |
) | |
) | |
); | |
/* | |
Pop up section | |
*/ | |
$sections[] = array( | |
'icon_type' => 'iconfont', | |
'icon' => 'comment', | |
'icon_class' => 'icon-large', | |
'title' => __('Popup Contents', Redux_TEXT_DOMAIN), | |
'desc' => '<p class="description">' . __('Modal titles and contents.', Redux_TEXT_DOMAIN) . '</p>', | |
'fields' => array( | |
/* array( | |
'id' => 'moneyback_popup_title', | |
'type' => 'text', | |
'title' => __('Money Back guarantee Popup Title', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('', Redux_TEXT_DOMAIN), | |
'std' => 'MONEY BACK GUARANTEE' | |
), | |
array ( | |
'id' => 'moneyback_popup_details', | |
'type' => 'editor', | |
'title' => __('Money Back guarantee Popup Text', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('To show this model use below text with link tag - <br /><b>data-toggle="modal" data-target="#money-back-modal" </b>', Redux_TEXT_DOMAIN), | |
'args' => array( | |
'teeny' => true, | |
'textarea_rows' => 10 | |
) | |
),*/ | |
array( | |
'id' => 'smartship_popup_title', | |
'type' => 'text', | |
'title' => __('Smartship Popup Title', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('', Redux_TEXT_DOMAIN), | |
'std' => '' | |
), | |
array ( | |
'id' => 'smartship_popup_details', | |
'type' => 'editor', | |
'title' => __('Smartship Popup Text', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('To show this model use below text with link tag - <br /><b>data-toggle="modal" data-target="#smartship-modal" </b>', Redux_TEXT_DOMAIN), | |
'args' => array( | |
'teeny' => true, | |
'textarea_rows' => 10 | |
) | |
), | |
array( | |
'id' => 'rewards_popup_title', | |
'type' => 'text', | |
'title' => __('Rewards Popup Title', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('', Redux_TEXT_DOMAIN), | |
'std' => '' | |
), | |
array( | |
'id' => 'rewards_popup_details', | |
'type' => 'editor', | |
'title' => __('Rewards Popup Text', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('To show this model use below text with link tag - <br /><b>data-toggle="modal" data-target="#rewards-modal" </b>', Redux_TEXT_DOMAIN), | |
'args' => array( | |
'teeny' => true, | |
'textarea_rows' => 10 | |
) | |
), | |
array( | |
'id' => 'active_pleasenote_popup', | |
'type' => 'checkbox', | |
'title' => __('Active Please-Note popup', Redux_TEXT_DOMAIN), | |
'std' => '0', | |
), | |
array( | |
'id' => 'pleasenote_popup_title', | |
'type' => 'text', | |
'title' => __('Please-Note Popup Title', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('', Redux_TEXT_DOMAIN), | |
'std' => '' | |
), | |
array ( | |
'id' => 'pleasenote_popup_details', | |
'type' => 'editor', | |
'title' => __('Please-Note Popup Text', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('To show this model use below text with link tag - <br /><b>data-toggle="modal" data-target="#pleasenote-modal" </b>', Redux_TEXT_DOMAIN), | |
'args' => array( | |
'teeny' => true, | |
'textarea_rows' => 10 | |
) | |
), | |
) | |
); | |
/* | |
End of pop up section | |
*/ | |
$sections[] = array( | |
'icon_type' => 'iconfont', | |
'icon' => 'picture', | |
'icon_class' => 'icon-large', | |
'title' => __('Page Title and Breadcrumb Settings', Redux_TEXT_DOMAIN), | |
'desc' => '<p class="description">' . __('This option for page breadcrumb color & background image.', Redux_TEXT_DOMAIN) . '</p>', | |
'fields' => array( | |
/*array( | |
'id' => 'use_page_title_bg_option', | |
'type' => 'checkbox', | |
'title' => __('Active Page Title Background Option', Redux_TEXT_DOMAIN), | |
'std' => '0', | |
),*/ | |
array( | |
'id' => 'page_title_bg_color', | |
'type' => 'color', | |
'title' => __('Page Title Background Color', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('Default page title background color', Redux_TEXT_DOMAIN), | |
'std' => '#ffffff', | |
), | |
array( | |
'id' => 'page_title_txt_color', | |
'type' => 'color', | |
'title' => __('Page Title TEXT Color', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('Default page title Text color', Redux_TEXT_DOMAIN), | |
'std' => '#000000', | |
), | |
array( | |
'id' => 'page_title_bg_imgae', | |
'type' => 'upload', | |
'title' => __('Page Title Background Image', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('Upload the page title background image', Redux_TEXT_DOMAIN), | |
), | |
/*array( | |
'id' => 'use_breadcrumb_bg_option', | |
'type' => 'checkbox', | |
'title' => __('Active Breadcrumb Background Option', Redux_TEXT_DOMAIN), | |
'std' => '0', | |
),*/ | |
array( | |
'id' => 'breadcrumb_full_width', | |
'type' => 'checkbox', | |
'title' => __('Breadcrumb Full Width', Redux_TEXT_DOMAIN), | |
'std' => '0', | |
), | |
array( | |
'id' => 'breadcrumb_bg_color', | |
'type' => 'color', | |
'title' => __('Breadcrumb Background Color', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('Default breadcrumb background color', Redux_TEXT_DOMAIN), | |
'std' => '#ffffff', | |
), | |
array( | |
'id' => 'breadcrumb_txt_color', | |
'type' => 'color', | |
'title' => __('Breadcrumb TEXT Color', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('Default breadcrumb Text color', Redux_TEXT_DOMAIN), | |
'std' => '#000000', | |
), | |
array( | |
'id' => 'breadcrumb_bg_imgae', | |
'type' => 'upload', | |
'title' => __('Breadcrumb Background Image', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('Upload the breadcrumb background image', Redux_TEXT_DOMAIN), | |
), | |
) | |
); | |
/* | |
//section for Referrar validation | |
$sections[] = array( | |
'icon_type' => 'iconfont', | |
'icon' => 'rocket', | |
'icon_class' => 'icon-large', | |
'title' => __('Referrar Validation Settings', Redux_TEXT_DOMAIN), | |
'desc' => '<p class="description">' . __('This is options for setting up the Referrar Validation of website.', Redux_TEXT_DOMAIN) . '</p>', | |
'fields' => array( | |
array( | |
'id' => 'ref_pop_title', | |
'type' => 'text', | |
'title' => __('Pop-up Title', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('POP-UP text of Referrar Validation', Redux_TEXT_DOMAIN), | |
'std' => 'Who Refferred You ?', | |
), | |
array( | |
'id' => 'ref_label', | |
'type' => 'text', | |
'title' => __('Label', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('The info text of Referrar Validation', Redux_TEXT_DOMAIN), | |
'std' => '', | |
), | |
array( | |
'id' => 'ref_contact_text', | |
'type' => 'text', | |
'title' => __('Contact Text', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('Contact Information of Referrar Validation', Redux_TEXT_DOMAIN), | |
'std' => '', | |
), | |
array( | |
'id' => 'ref_contact_email', | |
'type' => 'text', | |
'title' => __('Contact Email', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('Contact email of Referrar Validation', Redux_TEXT_DOMAIN), | |
'std' => '', | |
), | |
array( | |
'id' => 'ref_error', | |
'type' => 'text', | |
'title' => __('Error Message', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('The Error Message of Referrar Validation', Redux_TEXT_DOMAIN), | |
'std' => '', | |
), | |
) | |
); | |
*/ | |
//section for Referrar validation | |
$sections[] = array( | |
'icon_type' => 'iconfont', | |
'icon' => 'tint', | |
'icon_class' => 'icon-large', | |
'title' => __('Agent Login POP-UP Settings', Redux_TEXT_DOMAIN), | |
'desc' => '<p class="description">' . __('This is options for setting up Agent Login POP-UP', Redux_TEXT_DOMAIN) . '</p>', | |
'fields' => array( | |
array( | |
'id' => 'agent_login_title', | |
'type' => 'text', | |
'title' => __('POP-UP Title', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('POP-UP title of Agent Login', Redux_TEXT_DOMAIN), | |
'std' => 'Members Only ?', | |
), | |
array( | |
'id' => 'agent_login_label', | |
'type' => 'text', | |
'title' => __('Label', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('The info text of Agent Login', Redux_TEXT_DOMAIN), | |
'std' => '', | |
), | |
array( | |
'id' => 'agent_login_error', | |
'type' => 'text', | |
'title' => __('Error Message', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('The Error Message of Agent Login', Redux_TEXT_DOMAIN), | |
'std' => '', | |
), | |
) | |
); | |
//section for Footer | |
$sections[] = array( | |
'icon_type' => 'iconfont', | |
'icon' => 'columns', | |
'icon_class' => 'icon-large', | |
'title' => __('Footer', Redux_TEXT_DOMAIN), | |
'desc' => '<p class="description">' . __('This is options for footer.', Redux_TEXT_DOMAIN) . '</p>', | |
'fields' => array( | |
array( | |
'id' => 'copyright_text', | |
'type' => 'textarea', | |
'title' => __('Copyright Text', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('Enter your copyright text. HTML and shortcode is allowed.', Redux_TEXT_DOMAIN), | |
'std' => 'Copyright © 2014. All rights reserved.', | |
), | |
) | |
); | |
$tabs = array(); | |
$theme_data = wp_get_theme(); | |
$item_uri = $theme_data->get('ThemeURI'); | |
$description = $theme_data->get('Description'); | |
$author = $theme_data->get('Author'); | |
$author_uri = $theme_data->get('AuthorURI'); | |
$version = $theme_data->get('Version'); | |
$tags = $theme_data->get('Tags'); | |
$item_info = '<div class="redux-opts-section-desc">'; | |
$item_info .= '<p class="redux-opts-item-data description item-uri">' . __('<strong>Theme URL:</strong> ', Redux_TEXT_DOMAIN) . '<a href="' . esc_url( $item_uri ) . '" target="_blank">' . $item_uri . '</a></p>'; | |
$item_info .= '<p class="redux-opts-item-data description item-author">' . __('<strong>Author:</strong> ', Redux_TEXT_DOMAIN) . ($author_uri ? '<a href="' . esc_url( $author_uri ) . '" target="_blank">' . $author . '</a>' : $author) . '</p>'; | |
$item_info .= '<p class="redux-opts-item-data description item-version">' . __('<strong>Version:</strong> ', Redux_TEXT_DOMAIN) . $version . '</p>'; | |
$item_info .= '<p class="redux-opts-item-data description item-description">' . $description . '</p>'; | |
$item_info .= '<p class="redux-opts-item-data description item-tags">' . __('<strong>Tags:</strong> ', Redux_TEXT_DOMAIN) . implode(', ', $tags) . '</p>'; | |
$item_info .= '</div>'; | |
$tabs['item_info'] = array( | |
'icon' => 'info-sign', | |
'icon_class' => 'icon-large', | |
'title' => __('Theme Information', Redux_TEXT_DOMAIN), | |
'content' => $item_info | |
); | |
if (count($sections)) { | |
$currentAdminLang = ICL_LANGUAGE_CODE != '' && ICL_LANGUAGE_CODE != 'ICL_LANGUAGE_CODE' ? ICL_LANGUAGE_CODE : ''; | |
foreach($sections as $sectionKey => $section) { | |
if (isset($section['fields']) && is_array($section['fields']) && count($section['fields'])) { | |
foreach($section['fields'] as $sectionFieldKey => $sectionField) { | |
//$sections[$sectionKey]['fields'][$sectionFieldKey]['id'] = $sectionField['id'] . (($sectionField['type'] == 'text' || $sectionField['type'] == 'textarea' ) && $sectionField['id'] != 'tracking_code' ? OMC_WPML_LANG_CODE : OMC_WPML_DEFAULT_LANG_CODE); | |
$sections[$sectionKey]['fields'][$sectionFieldKey]['id'] = $sectionField['id'] . OMC_WPML_DEFAULT_LANG_CODE; | |
if (($sectionField['type'] == 'text' || $sectionField['type'] == 'textarea' ) && $sectionField['id'] != 'tracking_code') { | |
$langList = omc_theme_opt_lang_list_callback(); | |
if (count($langList) > 1) { | |
$tmpFieldsArray = array(); | |
foreach ($langList as $langInfo) { | |
$tmpFieldInfo = $sectionField; | |
$tmpFieldInfo['id'] = $sectionField['id'] . '_' . $langInfo['language_code']; | |
if ($langInfo['language_code'] != $currentAdminLang) $tmpFieldInfo['class'] = 'omcHide omc-admin-opt-hield-hide'; | |
$tmpFieldsArray[] = $tmpFieldInfo; | |
}//end foreach | |
$sections[$sectionKey]['fields'] = $tmpFieldsArray; | |
} | |
} | |
}// end foreach | |
} | |
}//end foreach | |
}//end if | |
global $Redux_Options; | |
$Redux_Options = new Redux_Options($sections, $args, $tabs); | |
} | |
add_action('init', 'gno_setup_framework_options', 0); | |
function omc_theme_opt_lang_list_callback() { | |
$langList = array(); | |
if (function_exists('icl_get_languages')) { | |
$langDetailsList = icl_get_languages('skip_missing=N&orderby=KEY&order=DIR&link_empty_to=str'); | |
if (!empty($langDetailsList) && is_array($langDetailsList) && count($langDetailsList)) { | |
foreach ($langDetailsList as $langInfo) { | |
$langList[] = array( | |
'default_locale' => $langInfo['default_locale'], | |
'language_code' => $langInfo['language_code'], | |
'native_name' => $langInfo['native_name'], | |
'translated_name' => $langInfo['translated_name'] | |
); | |
}// end foreach | |
}//end if | |
} | |
return $langList; | |
}<?php | |
/* ----------------------------------------------------------------------------- | |
* Helper Function | |
* -------------------------------------------------------------------------- */ | |
if ( ! function_exists( 'omc_get_option' ) ) { | |
/** | |
* Proxy Function | |
*/ | |
function omc_get_option( $opt_name, $default = null ) { | |
global $Redux_Options; | |
$returnValue = $Redux_Options->get( $opt_name . OMC_WPML_LANG_CODE, $default ); | |
$returnValue = $returnValue != '' ? $returnValue : $Redux_Options->get( $opt_name . OMC_WPML_DEFAULT_LANG_CODE, $default ); | |
return $returnValue; | |
} | |
} | |
/* ----------------------------------------------------------------------------- | |
* Load Custom Fields | |
* -------------------------------------------------------------------------- */ | |
require_once 'custom-fields/field_font_upload/field_upload.php'; | |
require_once 'custom-fields/field_typography.php'; | |
require_once 'custom-fields/field_section_info.php'; | |
require_once 'custom-fields/field_sidebar_select.php'; | |
require_once 'custom-fields/field_color_scheme.php'; | |
require_once 'custom-fields/field_slider.php'; | |
require_once 'custom-fields/field_slides.php'; | |
/* ----------------------------------------------------------------------------- | |
* Initial Redux Framework | |
* -------------------------------------------------------------------------- */ | |
/* | |
* | |
* Set the text domain for the theme or plugin. | |
* | |
*/ | |
define('Redux_TEXT_DOMAIN', 'redux-opts'); | |
if(!class_exists('Redux_Options')) { | |
//define('Redux_OPTIONS_URL', site_url('path the options folder')); | |
require_once(dirname(__FILE__) . '/options/defaults.php'); | |
} | |
/* | |
* | |
* Most of your editing will be done in this section. | |
* | |
* Here you can override default values, uncomment args and change their values. | |
* No $args are required, but they can be over ridden if needed. | |
* | |
*/ | |
function gno_setup_framework_options() { | |
$args = array(); | |
$args['std_show'] = true; // If true, it shows the std value | |
// Set the class for the dev mode tab icon. | |
// This is ignored unless $args['icon_type'] = 'iconfont' | |
// Default: null | |
$args['dev_mode_icon_class'] = 'icon-large'; | |
// Setup custom links in the footer for share icons | |
$args['share_icons']['twitter'] = array( | |
'link' => 'http://twitter.com/ghost1227', | |
'title' => __('Follow me on Twitter', Redux_TEXT_DOMAIN), | |
'img' => Redux_OPTIONS_URL . 'img/social/Twitter.png' | |
); | |
$args['share_icons']['linked_in'] = array( | |
'link' => 'http://www.linkedin.com/profile/view?id=52559281', | |
'title' => __('Find me on LinkedIn', Redux_TEXT_DOMAIN), | |
'img' => Redux_OPTIONS_URL . 'img/social/LinkedIn.png' | |
); | |
// Set the class for the import/export tab icon. | |
// This is ignored unless $args['icon_type'] = 'iconfont' | |
// Default: null | |
$args['import_icon_class'] = 'icon-large'; | |
// Set a custom option name. Don't forget to replace spaces with underscores! | |
$args['opt_name'] = 'gno_theme_options'; | |
// Set a custom title for the options page. | |
// Default: Options | |
$args['menu_title'] = __('Theme Options', Redux_TEXT_DOMAIN); | |
// Set a custom page title for the options page. | |
// Default: Options | |
$args['page_title'] = __('Theme Options', Redux_TEXT_DOMAIN); | |
// Set a custom page slug for options page (wp-admin/themes.php?page=***). | |
// Default: redux_options | |
$args['page_slug'] = 'redux_options'; | |
// Set the menu type. Set to "menu" for a top level menu, or "submenu" to add below an existing item. | |
// Default: menu | |
$args['page_type'] = 'submenu'; | |
// Set the parent menu. | |
// Default: themes.php | |
$args['page_parent'] = 'themes.php'; | |
// Set the icon type. Set to "iconfont" for Font Awesome, or "image" for traditional. | |
// Redux no longer ships with standard icons! | |
// Default: iconfont | |
//$args['icon_type'] = 'image'; | |
$args['dev_mode_icon_type'] = 'iconfont'; | |
$args['import_icon_type'] = 'iconfont'; | |
// $args['intro_text'] = __('<p><i>Theme Version: '.gno_THEME_VERSION.' on Wordpress '.get_bloginfo('version').' and PHP '.phpversion().'</i></p>', Redux_TEXT_DOMAIN ); | |
$args['intro_text'] = '<h4>' . __('Theme Settings Information for GNO', Redux_TEXT_DOMAIN ) . '</h4>'; | |
$sections = array(); | |
//section for General-logo, favicon, tracking code | |
$sections[] = array( | |
'icon_type' => 'iconfont', | |
'icon' => 'globe', | |
'icon_class' => 'icon-large', | |
'title' => __('General', Redux_TEXT_DOMAIN), | |
'desc' => '<p class="description">' . __('This is the general options.', Redux_TEXT_DOMAIN) . '</p>', | |
'fields' => array( | |
array( | |
'id' => 'use_theme_bg_option', | |
'type' => 'checkbox', | |
'title' => __('Active Page Background Option', Redux_TEXT_DOMAIN), | |
'std' => '0', | |
), | |
array( | |
'id' => 'theme_bg_img_url', | |
'type' => 'upload', | |
'title' => __('Upload Page Background Image', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('Default page background image', Redux_TEXT_DOMAIN), | |
), | |
array( | |
'id' => 'theme_bg_color', | |
'type' => 'color', | |
'title' => __('Page Background Color', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('Default page background color', Redux_TEXT_DOMAIN), | |
'std' => '#ffffff', | |
), | |
array( | |
'id' => 'use_body_bg_option', | |
'type' => 'checkbox', | |
'title' => __('Active Body Background Option', Redux_TEXT_DOMAIN), | |
'std' => '0', | |
), | |
array( | |
'id' => 'body_bg_img_url', | |
'type' => 'upload', | |
'title' => __('Upload Body Background Image', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('Default container body background image', Redux_TEXT_DOMAIN), | |
), | |
array( | |
'id' => 'body_bg_color', | |
'type' => 'color', | |
'title' => __('Body Background Color', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('Default body content background color', Redux_TEXT_DOMAIN), | |
'std' => '#ffffff', | |
), | |
array( | |
'id' => 'logo_url', | |
'type' => 'upload', | |
'title' => __('Upload Logo', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('Upload the original logo', Redux_TEXT_DOMAIN), | |
), | |
array( | |
'id' => 'retina_logo_url', | |
'type' => 'upload', | |
'title' => __('Upload Retina Logo', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('Max logo height 76px', Redux_TEXT_DOMAIN), | |
), | |
array( | |
'id' => 'footer_logo_url', | |
'type' => 'upload', | |
'title' => __('Upload Footer Logo', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('Upload the footer logo', Redux_TEXT_DOMAIN), | |
), | |
array( | |
'id' => 'fav_icon_url', | |
'type' => 'upload', | |
'title' => __('Favicon (16x16)', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('Upload Favicon', Redux_TEXT_DOMAIN), | |
), | |
array( | |
'id' => 'tracking_code', | |
'type' => 'textarea', | |
'title' => __('Tracking Code', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('Enter your Google Analytics Code or other tracking code. The code must including <strong><script></strong> tag.', Redux_TEXT_DOMAIN), | |
), | |
) | |
); | |
//section for Header Info-contact name/email/phone | |
$sections[] = array( | |
'icon_type' => 'iconfont', | |
'icon' => 'pencil', | |
'icon_class' => 'icon-large', | |
'title' => __('Header Contact Info', Redux_TEXT_DOMAIN), | |
'desc' => '<p class="description">' . __('This is the options for Header Top Left Informations.', Redux_TEXT_DOMAIN) . '</p>', | |
'fields' => array( | |
array( | |
'id' => 'header_contact_phone', | |
'type' => 'text', | |
'title' => __('Contact Person phone', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('Mention the contact person phone number', Redux_TEXT_DOMAIN), | |
'std' => '' | |
), | |
array( | |
'id' => 'header_contact_email', | |
'type' => 'text', | |
'title' => __('Contact Person Email', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('Mention the contact person email address', Redux_TEXT_DOMAIN), | |
'std' => '' | |
), | |
) | |
); | |
//section for Social icon url | |
$sections[] = array( | |
'icon_type' => 'iconfont', | |
'icon' => 'group', | |
'icon_class' => 'icon-large', | |
'title' => __('Social Media', Redux_TEXT_DOMAIN), | |
'desc' => '<p class="description">' . __('This is options for setting up the social media of website.' . '</p>', Redux_TEXT_DOMAIN), | |
'fields' => array( | |
array( | |
'id' => 'social_facebook', | |
'type' => 'text', | |
'title' => __('Facebook URL', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('The URL to your account page', Redux_TEXT_DOMAIN), | |
'std' => 'https://facebook.com', | |
), | |
array( | |
'id' => 'social_wechat', | |
'type' => 'text', | |
'title' => __('WeChat URL', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('The URL to your account page', Redux_TEXT_DOMAIN), | |
'std' => 'http://www.wechat.com', | |
), | |
array( | |
'id' => 'social_twitter', | |
'type' => 'text', | |
'title' => __('Twitter URL', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('The URL to your account page', Redux_TEXT_DOMAIN), | |
'std' => 'https://twitter.com', | |
), | |
array( | |
'id' => 'social_gplus', | |
'type' => 'text', | |
'title' => __('Google Plus URL', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('The URL to your account page', Redux_TEXT_DOMAIN), | |
'std' => 'https://plus.google.com', | |
), | |
array( | |
'id' => 'social_youtube', | |
'type' => 'text', | |
'title' => __('YouTube URL', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('The URL to your account page', Redux_TEXT_DOMAIN), | |
'std' => 'http://youtube.com', | |
) | |
) | |
); | |
/* | |
Pop up section | |
*/ | |
$sections[] = array( | |
'icon_type' => 'iconfont', | |
'icon' => 'comment', | |
'icon_class' => 'icon-large', | |
'title' => __('Popup Contents', Redux_TEXT_DOMAIN), | |
'desc' => '<p class="description">' . __('Modal titles and contents.', Redux_TEXT_DOMAIN) . '</p>', | |
'fields' => array( | |
/* array( | |
'id' => 'moneyback_popup_title', | |
'type' => 'text', | |
'title' => __('Money Back guarantee Popup Title', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('', Redux_TEXT_DOMAIN), | |
'std' => 'MONEY BACK GUARANTEE' | |
), | |
array ( | |
'id' => 'moneyback_popup_details', | |
'type' => 'editor', | |
'title' => __('Money Back guarantee Popup Text', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('To show this model use below text with link tag - <br /><b>data-toggle="modal" data-target="#money-back-modal" </b>', Redux_TEXT_DOMAIN), | |
'args' => array( | |
'teeny' => true, | |
'textarea_rows' => 10 | |
) | |
),*/ | |
array( | |
'id' => 'smartship_popup_title', | |
'type' => 'text', | |
'title' => __('Smartship Popup Title', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('', Redux_TEXT_DOMAIN), | |
'std' => '' | |
), | |
array ( | |
'id' => 'smartship_popup_details', | |
'type' => 'editor', | |
'title' => __('Smartship Popup Text', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('To show this model use below text with link tag - <br /><b>data-toggle="modal" data-target="#smartship-modal" </b>', Redux_TEXT_DOMAIN), | |
'args' => array( | |
'teeny' => true, | |
'textarea_rows' => 10 | |
) | |
), | |
array( | |
'id' => 'rewards_popup_title', | |
'type' => 'text', | |
'title' => __('Rewards Popup Title', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('', Redux_TEXT_DOMAIN), | |
'std' => '' | |
), | |
array( | |
'id' => 'rewards_popup_details', | |
'type' => 'editor', | |
'title' => __('Rewards Popup Text', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('To show this model use below text with link tag - <br /><b>data-toggle="modal" data-target="#rewards-modal" </b>', Redux_TEXT_DOMAIN), | |
'args' => array( | |
'teeny' => true, | |
'textarea_rows' => 10 | |
) | |
), | |
array( | |
'id' => 'active_pleasenote_popup', | |
'type' => 'checkbox', | |
'title' => __('Active Please-Note popup', Redux_TEXT_DOMAIN), | |
'std' => '0', | |
), | |
array( | |
'id' => 'pleasenote_popup_title', | |
'type' => 'text', | |
'title' => __('Please-Note Popup Title', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('', Redux_TEXT_DOMAIN), | |
'std' => '' | |
), | |
array ( | |
'id' => 'pleasenote_popup_details', | |
'type' => 'editor', | |
'title' => __('Please-Note Popup Text', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('To show this model use below text with link tag - <br /><b>data-toggle="modal" data-target="#pleasenote-modal" </b>', Redux_TEXT_DOMAIN), | |
'args' => array( | |
'teeny' => true, | |
'textarea_rows' => 10 | |
) | |
), | |
) | |
); | |
/* | |
End of pop up section | |
*/ | |
$sections[] = array( | |
'icon_type' => 'iconfont', | |
'icon' => 'picture', | |
'icon_class' => 'icon-large', | |
'title' => __('Page Title and Breadcrumb Settings', Redux_TEXT_DOMAIN), | |
'desc' => '<p class="description">' . __('This option for page breadcrumb color & background image.', Redux_TEXT_DOMAIN) . '</p>', | |
'fields' => array( | |
/*array( | |
'id' => 'use_page_title_bg_option', | |
'type' => 'checkbox', | |
'title' => __('Active Page Title Background Option', Redux_TEXT_DOMAIN), | |
'std' => '0', | |
),*/ | |
array( | |
'id' => 'page_title_bg_color', | |
'type' => 'color', | |
'title' => __('Page Title Background Color', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('Default page title background color', Redux_TEXT_DOMAIN), | |
'std' => '#ffffff', | |
), | |
array( | |
'id' => 'page_title_txt_color', | |
'type' => 'color', | |
'title' => __('Page Title TEXT Color', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('Default page title Text color', Redux_TEXT_DOMAIN), | |
'std' => '#000000', | |
), | |
array( | |
'id' => 'page_title_bg_imgae', | |
'type' => 'upload', | |
'title' => __('Page Title Background Image', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('Upload the page title background image', Redux_TEXT_DOMAIN), | |
), | |
/*array( | |
'id' => 'use_breadcrumb_bg_option', | |
'type' => 'checkbox', | |
'title' => __('Active Breadcrumb Background Option', Redux_TEXT_DOMAIN), | |
'std' => '0', | |
),*/ | |
array( | |
'id' => 'breadcrumb_full_width', | |
'type' => 'checkbox', | |
'title' => __('Breadcrumb Full Width', Redux_TEXT_DOMAIN), | |
'std' => '0', | |
), | |
array( | |
'id' => 'breadcrumb_bg_color', | |
'type' => 'color', | |
'title' => __('Breadcrumb Background Color', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('Default breadcrumb background color', Redux_TEXT_DOMAIN), | |
'std' => '#ffffff', | |
), | |
array( | |
'id' => 'breadcrumb_txt_color', | |
'type' => 'color', | |
'title' => __('Breadcrumb TEXT Color', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('Default breadcrumb Text color', Redux_TEXT_DOMAIN), | |
'std' => '#000000', | |
), | |
array( | |
'id' => 'breadcrumb_bg_imgae', | |
'type' => 'upload', | |
'title' => __('Breadcrumb Background Image', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('Upload the breadcrumb background image', Redux_TEXT_DOMAIN), | |
), | |
) | |
); | |
/* | |
//section for Referrar validation | |
$sections[] = array( | |
'icon_type' => 'iconfont', | |
'icon' => 'rocket', | |
'icon_class' => 'icon-large', | |
'title' => __('Referrar Validation Settings', Redux_TEXT_DOMAIN), | |
'desc' => '<p class="description">' . __('This is options for setting up the Referrar Validation of website.', Redux_TEXT_DOMAIN) . '</p>', | |
'fields' => array( | |
array( | |
'id' => 'ref_pop_title', | |
'type' => 'text', | |
'title' => __('Pop-up Title', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('POP-UP text of Referrar Validation', Redux_TEXT_DOMAIN), | |
'std' => 'Who Refferred You ?', | |
), | |
array( | |
'id' => 'ref_label', | |
'type' => 'text', | |
'title' => __('Label', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('The info text of Referrar Validation', Redux_TEXT_DOMAIN), | |
'std' => '', | |
), | |
array( | |
'id' => 'ref_contact_text', | |
'type' => 'text', | |
'title' => __('Contact Text', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('Contact Information of Referrar Validation', Redux_TEXT_DOMAIN), | |
'std' => '', | |
), | |
array( | |
'id' => 'ref_contact_email', | |
'type' => 'text', | |
'title' => __('Contact Email', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('Contact email of Referrar Validation', Redux_TEXT_DOMAIN), | |
'std' => '', | |
), | |
array( | |
'id' => 'ref_error', | |
'type' => 'text', | |
'title' => __('Error Message', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('The Error Message of Referrar Validation', Redux_TEXT_DOMAIN), | |
'std' => '', | |
), | |
) | |
); | |
*/ | |
//section for Referrar validation | |
$sections[] = array( | |
'icon_type' => 'iconfont', | |
'icon' => 'tint', | |
'icon_class' => 'icon-large', | |
'title' => __('Agent Login POP-UP Settings', Redux_TEXT_DOMAIN), | |
'desc' => '<p class="description">' . __('This is options for setting up Agent Login POP-UP', Redux_TEXT_DOMAIN) . '</p>', | |
'fields' => array( | |
array( | |
'id' => 'agent_login_title', | |
'type' => 'text', | |
'title' => __('POP-UP Title', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('POP-UP title of Agent Login', Redux_TEXT_DOMAIN), | |
'std' => 'Members Only ?', | |
), | |
array( | |
'id' => 'agent_login_label', | |
'type' => 'text', | |
'title' => __('Label', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('The info text of Agent Login', Redux_TEXT_DOMAIN), | |
'std' => '', | |
), | |
array( | |
'id' => 'agent_login_error', | |
'type' => 'text', | |
'title' => __('Error Message', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('The Error Message of Agent Login', Redux_TEXT_DOMAIN), | |
'std' => '', | |
), | |
) | |
); | |
//section for Footer | |
$sections[] = array( | |
'icon_type' => 'iconfont', | |
'icon' => 'columns', | |
'icon_class' => 'icon-large', | |
'title' => __('Footer', Redux_TEXT_DOMAIN), | |
'desc' => '<p class="description">' . __('This is options for footer.', Redux_TEXT_DOMAIN) . '</p>', | |
'fields' => array( | |
array( | |
'id' => 'copyright_text', | |
'type' => 'textarea', | |
'title' => __('Copyright Text', Redux_TEXT_DOMAIN), | |
'sub_desc' => __('Enter your copyright text. HTML and shortcode is allowed.', Redux_TEXT_DOMAIN), | |
'std' => 'Copyright © 2014. All rights reserved.', | |
), | |
) | |
); | |
$tabs = array(); | |
$theme_data = wp_get_theme(); | |
$item_uri = $theme_data->get('ThemeURI'); | |
$description = $theme_data->get('Description'); | |
$author = $theme_data->get('Author'); | |
$author_uri = $theme_data->get('AuthorURI'); | |
$version = $theme_data->get('Version'); | |
$tags = $theme_data->get('Tags'); | |
$item_info = '<div class="redux-opts-section-desc">'; | |
$item_info .= '<p class="redux-opts-item-data description item-uri">' . __('<strong>Theme URL:</strong> ', Redux_TEXT_DOMAIN) . '<a href="' . esc_url( $item_uri ) . '" target="_blank">' . $item_uri . '</a></p>'; | |
$item_info .= '<p class="redux-opts-item-data description item-author">' . __('<strong>Author:</strong> ', Redux_TEXT_DOMAIN) . ($author_uri ? '<a href="' . esc_url( $author_uri ) . '" target="_blank">' . $author . '</a>' : $author) . '</p>'; | |
$item_info .= '<p class="redux-opts-item-data description item-version">' . __('<strong>Version:</strong> ', Redux_TEXT_DOMAIN) . $version . '</p>'; | |
$item_info .= '<p class="redux-opts-item-data description item-description">' . $description . '</p>'; | |
$item_info .= '<p class="redux-opts-item-data description item-tags">' . __('<strong>Tags:</strong> ', Redux_TEXT_DOMAIN) . implode(', ', $tags) . '</p>'; | |
$item_info .= '</div>'; | |
$tabs['item_info'] = array( | |
'icon' => 'info-sign', | |
'icon_class' => 'icon-large', | |
'title' => __('Theme Information', Redux_TEXT_DOMAIN), | |
'content' => $item_info | |
); | |
if (count($sections)) { | |
$currentAdminLang = ICL_LANGUAGE_CODE != '' && ICL_LANGUAGE_CODE != 'ICL_LANGUAGE_CODE' ? ICL_LANGUAGE_CODE : ''; | |
foreach($sections as $sectionKey => $section) { | |
if (isset($section['fields']) && is_array($section['fields']) && count($section['fields'])) { | |
foreach($section['fields'] as $sectionFieldKey => $sectionField) { | |
//$sections[$sectionKey]['fields'][$sectionFieldKey]['id'] = $sectionField['id'] . (($sectionField['type'] == 'text' || $sectionField['type'] == 'textarea' ) && $sectionField['id'] != 'tracking_code' ? OMC_WPML_LANG_CODE : OMC_WPML_DEFAULT_LANG_CODE); | |
$sections[$sectionKey]['fields'][$sectionFieldKey]['id'] = $sectionField['id'] . OMC_WPML_DEFAULT_LANG_CODE; | |
if (($sectionField['type'] == 'text' || $sectionField['type'] == 'textarea' ) && $sectionField['id'] != 'tracking_code') { | |
$langList = omc_theme_opt_lang_list_callback(); | |
if (count($langList) > 1) { | |
$tmpFieldsArray = array(); | |
foreach ($langList as $langInfo) { | |
$tmpFieldInfo = $sectionField; | |
$tmpFieldInfo['id'] = $sectionField['id'] . '_' . $langInfo['language_code']; | |
if ($langInfo['language_code'] != $currentAdminLang) $tmpFieldInfo['class'] = 'omcHide omc-admin-opt-hield-hide'; | |
$tmpFieldsArray[] = $tmpFieldInfo; | |
}//end foreach | |
$sections[$sectionKey]['fields'] = $tmpFieldsArray; | |
} | |
} | |
}// end foreach | |
} | |
}//end foreach | |
}//end if | |
global $Redux_Options; | |
$Redux_Options = new Redux_Options($sections, $args, $tabs); | |
} | |
add_action('init', 'gno_setup_framework_options', 0); | |
function omc_theme_opt_lang_list_callback() { | |
$langList = array(); | |
if (function_exists('icl_get_languages')) { | |
$langDetailsList = icl_get_languages('skip_missing=N&orderby=KEY&order=DIR&link_empty_to=str'); | |
if (!empty($langDetailsList) && is_array($langDetailsList) && count($langDetailsList)) { | |
foreach ($langDetailsList as $langInfo) { | |
$langList[] = array( | |
'default_locale' => $langInfo['default_locale'], | |
'language_code' => $langInfo['language_code'], | |
'native_name' => $langInfo['native_name'], | |
'translated_name' => $langInfo['translated_name'] | |
); | |
}// end foreach | |
}//end if | |
} | |
return $langList; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment