function test()
{
    if (cjtheme_get_option('maintenance_mode_status') == 'enable') {
        echo '<div class="error">
       			<p>
       				' . sprintf(__('Maintenance mode is active. <a href="%s">Manage Settings</a>', 'cjtheme'), cjtheme_callback_url('core_maintenance_mode')) . '
       			</p>
    		  </div>';
    }
}
function cjtheme_assistant_menu_item()
{
    echo '<li class="assistant-menu-item"><a href="#cjtheme-item-assistant" class="toggle-id">Help & Support</a>';
    echo '<ul>';
    echo '<li class="assistant-menu-item"><a href="' . cjtheme_assistant_url('start-over', cjtheme_callback_url('core_welcome')) . '" class="toggle-id">Setup Assistant</a></li>';
    echo '<li><a target="_blank" href="' . cjtheme_item_info('quick_start_guide_url') . '">Quick Start Guide</a></li>';
    echo '<li><a target="_blank" href="' . cjtheme_item_info('documentation_url') . '">Documentation</a></li>';
    echo '<li><a target="_blank" href="' . cjtheme_item_info('support_forum_url') . '">Support Forum</a></li>';
    echo '<li><a target="_blank" href="' . cjtheme_item_info('feature_request_url') . '">Reques new features</a></li>';
    echo '<li><a target="_blank" href="' . cjtheme_item_info('report_bugs_url') . '">Report Bugs & Issues</a></li>';
    echo '</ul>';
    echo '</li>';
}
/**
 * @package CSSJockey WordPress Framework
 * @author Mohit Aneja (cssjockey.com)
 * @version FW-20150208
*/
$help_support_value[] = '<a href="' . cjtheme_item_info('quick_start_guide_url') . '" target="_blank">' . __('Quick Start Guide', 'cjtheme') . '</a>';
$help_support_value[] = '<a href="' . cjtheme_item_info('documentation_url') . '" target="_blank">' . __('Documentation', 'cjtheme') . '</a>';
$help_support_value[] = '<a href="' . cjtheme_item_info('support_forum_url') . '" target="_blank">' . __('Support Fourm', 'cjtheme') . '</a>';
if (isset($_REQUEST['cjmsg']) && $_REQUEST['cjmsg'] == 'pc-no-match') {
    echo cjtheme_show_message('error', sprintf(__('Could not reset your license for this installation. <br><a target="_blank" href="%s">Click here</a> to create a support ticket.', 'cjtheme'), cjtheme_item_info('support_forum_url')));
}
$cjtheme_purchase_code = '';
$eon = sha1('cjtheme_verify_epc' . site_url());
$eov = get_option($eon);
if ($eov != '') {
    $cjtheme_purchase_code = array('type' => 'info', 'id' => 'cjtheme_purchase_code', 'label' => __('Purchase code', 'cjtheme'), 'info' => '', 'suffix' => '', 'prefix' => '', 'default' => '<span class="btn btn-success btn-sm" style=" margin-right: 10px;"><i class="fa fa-check-circle"></i>&nbsp;&nbsp;' . __('Verified & Active', 'cjtheme') . '</span>' . sprintf('<a href="%s" class="btn btn-danger btn-sm cj-confirm" data-confirm="%s">Reset License</a>', cjtheme_string(cjtheme_callback_url('core_welcome')) . 'cjtheme_action=reset-license', __("Are you sure?\nThis will reset your license for this installation.\nYou may use this license again on any installation.", 'cjtheme')), 'options' => '');
} else {
    $cjtheme_purchase_code = array('type' => 'info', 'id' => 'cjtheme_purchase_code', 'label' => __('Purchase code', 'cjtheme'), 'info' => '', 'suffix' => '', 'prefix' => '', 'default' => '<span class="label label-danger" style="padding:5px 10px; font-size:14px; font-weight:normal;"><i class="fa fa-times-circle"></i>&nbsp;&nbsp;' . __('Not Verified', 'cjtheme') . '</span>', 'options' => '');
}
if (cjtheme_is_local()) {
    $cjtheme_purchase_code = array('type' => 'info', 'id' => 'cjtheme_purchase_code', 'label' => __('Purchase code', 'cjtheme'), 'info' => '', 'suffix' => '', 'prefix' => '', 'default' => '<span class="label label-default" style="padding:5px 10px; font-size:14px; font-weight:normal;"><i class="fa fa-info-circle"></i>&nbsp;&nbsp;' . __('Local Server', 'cjtheme') . '</span><span class="margin-10-left italic red">' . __('You will be asked to validate your purchase code to use this product on live server.', 'cjtheme') . '</span>', 'options' => '');
}
if (cjtheme_item_info('item_id') == 'NA') {
    $cjtheme_purchase_code = null;
    $contribute = null;
} else {
    $contribute = array('type' => 'info', 'id' => 'contribute', 'label' => __('Contribute', 'cjtheme'), 'info' => '', 'suffix' => '', 'prefix' => '', 'default' => sprintf(__('<p>You can contribute to support further development and new features for this product.</p> <p><a target="_blank" class="btn btn-danger" href="%s">Contribute</a></p>', 'cjtheme'), 'http://cssjockey.com/contribute'), 'options' => '');
}
$localization_string = sprintf(__('You can download <a class="bold" target="_blank" href="%s">Loco Translate WordPress Plugin (FREE)</a> to easily create language files within your WordPress dashboard without using Poedit software.', 'cjtheme'), 'https://wordpress.org/plugins/loco-translate/');
$cjtheme_form_options['welcome'] = array(array('type' => 'sub-heading', 'id' => 'welcome_heading', 'label' => '', 'info' => '', 'suffix' => '', 'prefix' => '', 'default' => sprintf(__('%s Information', 'cjtheme'), ucwords(cjtheme_item_info('item_type'))), 'options' => ''), array('type' => 'info', 'id' => 'product_type', 'label' => __('Product Type', 'cjtheme'), 'info' => '', 'suffix' => '', 'prefix' => '', 'default' => sprintf(__('WordPress %s', 'cjtheme'), ucwords(cjtheme_item_info('item_type'))), 'options' => ''), array('type' => 'info', 'id' => 'product_name', 'label' => __('Product Name', 'cjtheme'), 'info' => '', 'suffix' => '', 'prefix' => '', 'default' => cjtheme_item_info('item_name'), 'options' => ''), array('type' => 'info', 'id' => 'product_id', 'label' => __('Product ID', 'cjtheme'), 'info' => '', 'suffix' => '', 'prefix' => '', 'default' => cjtheme_item_info('item_id'), 'options' => ''), array('type' => 'info', 'id' => 'version', 'label' => __('Installed Version', 'cjtheme'), 'info' => '', 'suffix' => '', 'prefix' => '', 'default' => cjtheme_item_info('item_version'), 'options' => ''), $cjtheme_purchase_code, array('type' => 'info', 'id' => 'license', 'label' => __('License & Terms of use', 'cjtheme'), 'info' => '', 'suffix' => '', 'prefix' => '', 'default' => sprintf(__('<a target="_blank" href="%s">Click here</a> to view license and terms of use.', 'cjtheme'), cjtheme_item_info('license_url')), 'options' => ''), array('type' => 'info', 'id' => 'help_support', 'label' => __('Help & Support', 'cjtheme'), 'info' => '', 'suffix' => '', 'prefix' => '', 'default' => implode(' &nbsp; &bull; &nbsp; ', $help_support_value), 'options' => ''), array('type' => 'info', 'id' => 'translate', 'label' => __('Localization', 'cjtheme'), 'info' => '', 'suffix' => '', 'prefix' => '', 'default' => $localization_string, 'options' => ''), $contribute);
cjtheme_admin_form_raw($cjtheme_form_options['welcome']);
                    $li_id = $key;
                    if (is_array($menu)) {
                        echo '<li id="' . $li_id . '" class="has-sub-menu"><a href="#" onclick="return false;" title="">' . ucwords(str_replace('_', ' ', $key)) . ' <i class="cj-icon icon-white cj-icon-caret-down"></i></a>';
                        echo '<ul>';
                        foreach ($menu as $skey => $sub_menu) {
                            echo '<li id="' . $li_id . '"><a href="' . cjtheme_callback_url($skey) . '" title="">' . $sub_menu . '</a></li>';
                        }
                        echo '</ul>';
                        echo '</li>';
                    } else {
                        echo '<li id="' . $li_id . '"><a href="' . cjtheme_callback_url($key) . '" title="">' . $menu . '</a></li>';
                    }
                }
                echo '</ul>';
            }
            require_once $cjtheme_addon_options;
            global $cjtheme_item_options;
            if (!empty($cjtheme_item_options) && !empty($cjtheme_item_options[$callback])) {
                cjtheme_admin_form($cjtheme_item_options[$callback]);
            }
        }
    }
} else {
    $location = cjtheme_callback_url('core_welcome');
    wp_redirect($location, $status = 302);
    exit;
}
?>
	</div>

</div><!-- wrap -->
function cjtheme_add_settings_link($links)
{
    $settings_link = '<a href="' . cjtheme_callback_url('core_welcome') . '">' . __('Settings', 'cjtheme') . '</a>';
    $settings_link .= ' | <a href="' . cjtheme_callback_url('core_uninstall') . '">' . __('Uninstall', 'cjtheme') . '</a>';
    array_push($links, $settings_link);
    return $links;
}
$end_tour_msg = <<<EOF
<p>
<b>Thank You, {$user_info['display_name']}</b>,<br>
</p>
<p>
Its been nice interacting with you. In case you need me again,<br> you can call me from <b>Help & Support</b> menu from the navigation on plugin settigns page.
</p>
<p>
Here are a few useful links for further help and contact with CSSJockey team.
</p>
<ul>
<li><a href="http://demo.cssjockey.com/cjtheme/quick-start-guide/" target="_blank">Quick Start Guide</a></li>
<li><a href="http://demo.cssjockey.com/cjtheme" target="_blank">Documentation</a></li>
<li><a href="http://api.cssjockey.com/support" target="_blank">Support Fourm</a></li>
<li><a href="http://api.cssjockey.com/support" target="_blank">Feature Requests</a></li>
<li><a href="http://api.cssjockey.com/support" target="_blank">Report Bugs</a></li>
</ul>
<p>
<h4>Good luck with your project.</h4>
</p>
EOF;
$configure_plugin = <<<EOF
<h3>Plugin Configuration</h3>
<p>
Check out each setting on this page to configure this plugin as per your requirements.
</p>
EOF;
$cjtheme_assistant_steps[] = array('id' => 'welcome', 'text' => $welcome_msg, 'button_text' => 'Configure RSS Feed', 'callback' => cjtheme_callback_url('cjtheme_configuration'), 'cancel_text' => 'No, I will check out my self.', 'cancel_link' => cjtheme_assistant_url('end-tour', cjtheme_callback_url('core_welcome')));
$cjtheme_assistant_steps[] = array('id' => 'manage-popups', 'text' => $configure_plugin, 'button_text' => 'Got It', 'callback' => cjtheme_callback_url('cjtheme_configuration'), 'cancel_text' => 'End Tour', 'cancel_link' => cjtheme_assistant_url('end-tour', cjtheme_callback_url('core_welcome')));
$cjtheme_assistant_steps[] = array('id' => 'create-placeholder', 'text' => $end_tour_msg, 'button_text' => 'Ok', 'callback' => cjtheme_callback_url('cjtheme_configuration'), 'cancel_text' => 'End Tour', 'cancel_link' => cjtheme_assistant_url('end-tour', cjtheme_callback_url('core_welcome')));
<?php

/**
 * @package CSSJockey WordPress Framework
 * @author Mohit Aneja (cssjockey.com)
 * @version FW-20150208
*/
$cjtheme_envato_username = get_option('cjtheme_envato_username');
$cjtheme_envato_api_key = get_option('cjtheme_envato_api_key');
$cjtheme_envato_purchase_code = get_option('cjtheme_envato_purchase_code');
$cjtheme_envato_item_id = get_option('cjtheme_envato_item_id');
$cjtheme_last_update = get_option('cjtheme_last_update');
// Download Url
$download_latest_version_url = 'http://marketplace.envato.com/api/edge/' . get_option('cjtheme_envato_username') . '/' . get_option('cjtheme_envato_api_key') . '/download-purchase:' . get_option('cjtheme_envato_purchase_code') . '.json';
$process_download_url = cjtheme_string(cjtheme_callback_url('core_upgrades')) . 'cjtheme_action=process_download';
// Item Details Url
$item_info_url = 'http://marketplace.envato.com/api/edge/item:' . $cjtheme_envato_item_id . '.json';
if (!isset($_GET['cjtheme_action']) && $cjtheme_envato_username != '') {
    $cjtheme_check_upgrade = wp_remote_get($item_info_url);
    if (is_wp_error($cjtheme_check_upgrade)) {
        echo cjtheme_show_message('error', $cjtheme_check_upgrade->get_error_message());
    } else {
        $cjtheme_check_upgrade = json_decode($cjtheme_check_upgrade['body']);
        $remote_last_update_timestamp = strtotime($cjtheme_check_upgrade->item->last_update);
        if ($cjtheme_last_update == '') {
            update_option('cjtheme_last_update', time());
        } else {
            $cjtheme_last_update = get_option('cjtheme_last_update');
            if ($remote_last_update_timestamp > $cjtheme_last_update) {
                echo cjtheme_show_message('info', sprintf(__('<b>New version is available to download.</b> <br><a href="%s" class="bold">Click here</a> to download latest version.', 'cjtheme'), $process_download_url));
            } else {
<?php

global $wp_roles;
$menu_locations = get_registered_nav_menus();
$saved_menus = cjtheme_navigation_menus();
$roles = $wp_roles->role_names;
$roles['non-user'] = __('Visitor', 'cjtheme');
$cjtheme_role_menus = cjtheme_get_option('cjtheme_role_menus');
if (isset($_POST['cjtheme_save_menus'])) {
    cjtheme_update_option('cjtheme_role_menus', $_POST['data']);
    $location = cjtheme_string(cjtheme_callback_url()) . 'msg=saved';
    wp_safe_redirect($location);
    exit;
}
if (isset($_GET['msg']) && $_GET['msg'] == 'saved') {
    echo cjtheme_show_message('success', __('Menu options saved successfully.', 'cjtheme'));
}
?>
<form action="" method="post">
<table width="100%" cellpadding="0" cellspacing="0">
<thead>
	<tr>
		<th colspan="3"><h2 class="main-heading"><?php 
_e('Role Based Menus', 'cjtheme');
?>
</h2></th>
	</tr>
	<tr>
		<td width="15%"><?php 
_e('User Role', 'cjtheme');
?>
<?php

/**
 * @package CSSJockey WordPress Framework
 * @author Mohit Aneja (cssjockey.com)
 * @version FW-20150208
*/
global $wpdb;
$options_table = cjtheme_item_info('options_table');
$settings = $wpdb->get_results("SELECT * FROM {$options_table}");
$export_settings = urlencode(serialize($settings));
$cjtheme_form_options['export_settings'] = array(array('type' => 'sub-heading', 'id' => 'export_heading', 'label' => '', 'info' => '', 'suffix' => '', 'prefix' => '', 'default' => sprintf(__('Export %s Settings', 'cjtheme'), ucwords(cjtheme_item_info('item_type'))), 'options' => ''), array('type' => 'textarea-readonly', 'id' => 'export_settings', 'label' => __('Export Settings', 'cjtheme'), 'info' => __('Copy the contents and save it in a text file.', 'cjtheme'), 'suffix' => '', 'prefix' => '', 'default' => cjtheme_post_default('export_settings', $export_settings), 'options' => '', 'params' => ' onclick="this.focus();this.select()" '));
cjtheme_admin_form_raw($cjtheme_form_options['export_settings']);
if (isset($_POST['do_import_settings'])) {
    $import_settings = unserialize(urldecode($_POST['import_settings']));
    if (is_array($import_settings)) {
        $wpdb->query("TRUNCATE TABLE {$options_table}");
        foreach ($import_settings as $key => $value) {
            $insert_data = array('option_name' => $value->option_name, 'option_value' => $value->option_value);
            cjtheme_insert($options_table, $insert_data);
        }
        $location = cjtheme_callback_url();
        wp_redirect($location, $status = 302);
        exit;
    }
}
$cjtheme_form_options['import_settings'] = array(array('type' => 'heading', 'id' => 'import_heading', 'label' => '', 'info' => '', 'suffix' => '', 'prefix' => '', 'default' => sprintf(__('Import %s Settings', 'cjtheme'), ucwords(cjtheme_item_info('item_type'))), 'options' => ''), array('type' => 'textarea', 'id' => 'import_settings', 'label' => __('Import Settings', 'cjtheme'), 'info' => __('Paste the previously copied settings and click Import Settings.', 'cjtheme'), 'suffix' => '', 'prefix' => '', 'default' => '', 'options' => ''), array('type' => 'submit', 'id' => 'do_import_settings', 'label' => __('Import Settings', 'cjtheme'), 'info' => '', 'suffix' => '', 'prefix' => '', 'default' => '', 'options' => ''));
echo '<form class="margin-30-top" action="' . admin_url('admin.php?page=' . @$_GET['page'] . '&callback=' . @$_GET['callback'] . '') . '" method="post" enctype="multipart/form-data">';
cjtheme_admin_form_raw($cjtheme_form_options['import_settings']);
echo '</form>';
function cjtheme_themes_ettings_page()
{
    wp_safe_redirect(cjtheme_callback_url('core_welcome'));
    exit;
}
					<th width="15%"><?php 
_e('Actions', 'cjtheme');
?>
</th>
				</tr>
	<?php 
if (!empty($wp_registered_sidebars)) {
    foreach ($wp_registered_sidebars as $key => $sidebar) {
        ?>

		<?php 
        if ($sidebar['class'] == 'required') {
            $action_links = '--';
        } else {
            $action_links = '<a href="' . cjtheme_string(cjtheme_callback_url('dynamic_sidebars')) . 'cj_action=edit_sidebar&id=' . $key . '" title="">' . __('Edit', 'cjtheme') . '</a> | ';
            $action_links .= '<a href="' . cjtheme_string(cjtheme_callback_url('dynamic_sidebars')) . 'cj_action=delete_sidebar&id=' . $key . '" class="cj-confirm red" data-confirm="' . __("Are you sure?\nThis cannot be undone.", 'cjtheme') . '" title="">' . __('Delete', 'cjtheme') . '</a>';
        }
        ?>

		<tr>
			<td><?php 
        echo $sidebar['id'];
        ?>
</td>
			<td><?php 
        echo $sidebar['name'];
        ?>
</td>
			<td><?php 
        echo $sidebar['description'];
        ?>
function cjtheme_verify_epcp()
{
    global $wpdb, $current_user;
    $cjtheme_eon = sha1('cjtheme_verify_epc' . site_url());
    $cjtheme_eov = get_option($cjtheme_eon);
    $item_info = cjtheme_item_info();
    $cssjockey_api_url = 'http://api.cssjockey.com/';
    $errors = null;
    $success = null;
    $error_msg = null;
    $success_msg = null;
    // Handle local install
    if (isset($_POST['cjtheme_verify_purchase_code'])) {
        if ($_POST['cjtheme_purchase_code'] == '') {
            $errors[] = __('Please enter purchase code for this product.', 'cjtheme');
        }
        if (is_null($errors)) {
            $pdata = array('cj_action' => 'verify_envato_code', 'purchase_code' => $_POST['cjtheme_purchase_code'], 'item_id' => $item_info['item_id'], 'textdomain' => $item_info['page_slug'], 'site_url' => site_url());
            $response = wp_remote_post($cssjockey_api_url, array('method' => 'POST', 'timeout' => 45, 'redirection' => 5, 'httpversion' => '1.0', 'blocking' => true, 'headers' => array(), 'body' => $pdata, 'cookies' => array()));
            if (is_wp_error($response)) {
                $error_message = $response->get_error_message();
                $errors[] = $error_message;
            } else {
                $result = json_decode($response['body']);
                if (isset($result->success)) {
                    update_option($cjtheme_eon, $_POST['cjtheme_purchase_code']);
                    $location = cjtheme_callback_url('core_welcome');
                    wp_redirect($location);
                    exit;
                }
                if (isset($result->error)) {
                    $errors['envato'] = $result->error;
                }
            }
        }
        if (!is_null($errors)) {
            $error_msg = '<p class="red">' . implode('<br>', $errors) . '</p>';
        }
    }
    if (!cjtheme_is_local() && cjtheme_item_info('item_id') != 'NA') {
        $display[] = '<div id="verify-purchase-code" class="updated push-notification-message">';
        $display[] = '<div class="notification-icon">';
        $display[] = '<img src="http://api.cssjockey.com/files/leaf-64.png" />';
        $display[] = '</div>';
        $display[] = '<div class="notification-content">';
        $display[] = '<h3 style="margin:0 0 10px 0; line-height:1;">' . $item_info['item_name'] . '</h3>';
        $display[] = $success_msg;
        $display[] = '<p>' . sprintf(__('Verify purchase code to enable automatic upgrades and use this %s on this installation.', 'cjtheme'), $item_info['item_type']) . '</p>';
        $display[] = '<form action="" method="post">';
        $display[] = $error_msg;
        $display[] = '<p><input name="cjtheme_purchase_code" type="text" value="' . cjtheme_post_default('cjtheme_purchase_code', '') . '" class="verify-input" /></p>';
        $display[] = '<p>';
        $display[] = '<button name="cjtheme_verify_purchase_code" class="button-primary" style="margin-right:10px;" type="submit">' . __('Verify & Activate License', 'cjtheme') . '</button>';
        $display[] = sprintf(__('<a target="_blank" href="%s">Where can I find my Purchase Code?</a>', 'cjtheme'), 'https://help.market.envato.com/hc/en-us/articles/202822600-Where-can-I-find-my-Purchase-Code-');
        $display[] = '</p>';
        $display[] = '</form>';
        $display[] = '</div>';
        $display[] = '</div>';
    } else {
        $display[] = '';
    }
    if ($cjtheme_eov == '') {
        echo implode(null, $display);
    }
}
foreach ($options as $key => $option) {
    $params = '';
    if (isset($option['params'])) {
        $params_object = $option['params'];
        if (is_array($params_object)) {
            foreach ($params_object as $pk => $pv) {
                $params .= ' ' . $pk . '="' . $pv . '" ';
            }
        }
    }
    if ($option['type'] == 'heading') {
        $settings_search_box = '
			<span class="settings-search-box">

				<a href="' . cjtheme_string(cjtheme_callback_url($_GET['callback'])) . 'cjtheme_reset=' . $_GET['callback'] . '" class="button-secondary cj-confirm margin-5-right margin-6-top inline-block" data-confirm="' . __("Are you sure?\nThis canont be undone.", 'cjtheme') . '">' . __('Reset Section', 'cjtheme') . '</a>
				<a href="' . cjtheme_string(cjtheme_callback_url($_GET['callback'])) . 'cjtheme_reset=all" class="button-secondary cj-confirm margin-5-right margin-6-top inline-block" data-confirm="' . __("Are you sure?\nThis canont be undone.", 'cjtheme') . '">' . __('Reset All', 'cjtheme') . '</a>

				<input id="settings-search-box" name="settings-search-box" type="text" placeholder="search" />
				<i class="cj-icon fa fa-search"></i>
			</span>
		';
        $display[] = '<tr>';
        $display[] = '<th colspan="2">';
        $display[] = '<h2 class="main-heading">' . __($option['default'], 'cjtheme') . $settings_search_box . '</h2>';
        $display[] = '</th>';
        $display[] = '</tr>';
    }
    if ($option['type'] == 'sub-heading') {
        $display[] = '<tr>';
        $display[] = '<th colspan="2">';
        $display[] = '<h2 id="' . $option['id'] . '" class="sub-heading">' . __($option['default'], 'cjtheme') . '</h2>';