/**
 * @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']);
Ejemplo n.º 2
0
" class="cjfm-show-login-form acomment-reply"><?php 
    _e('Comment', 'buddypress');
    ?>
</a>
			<a href="<?php 
    echo cjtheme_string(cjfm_generate_url('page_login')) . 'redirect=' . cjtheme_current_url();
    ?>
" data-redirect="<?php 
    echo cjtheme_current_url();
    ?>
" class="cjfm-show-login-form acomment-reply"><?php 
    _e('Like', 'buddypress');
    ?>
</a>
			<a href="<?php 
    echo cjtheme_string(cjfm_generate_url('page_login')) . 'redirect=' . cjtheme_current_url();
    ?>
" data-redirect="<?php 
    echo cjtheme_current_url();
    ?>
" class="cjfm-show-login-form acomment-reply"><?php 
    _e('Thanks', 'buddypress');
    ?>
</a>
		<?php 
}
?>

		<?php 
if (bp_activity_user_can_delete()) {
    ?>
function cjtheme_generate_url($option_id = null, $url_string = null, $params = array())
{
    if (is_null($option_id)) {
        $display[] = __('Opiton ID not defined, please check code.', 'cjtheme');
    } else {
        if (is_null($url_string)) {
            $display[] = get_permalink(cjtheme_get_option($option_id));
        } else {
            if (!empty($params)) {
                $url_string = '';
                $count = 0;
                foreach ($params as $key => $value) {
                    $count++;
                    if ($count == 1) {
                        $url_string .= $key . '=' . $value;
                    } else {
                        $url_string .= '&' . $key . '=' . $value;
                    }
                }
            }
            $display[] = cjtheme_string(get_permalink(cjtheme_get_option($option_id))) . $url_string;
        }
    }
    return implode("\n", $display);
}
							<header class="page-header">
								<?php 
the_title('<h1 class="page-title">', '</h1>');
?>
							</header><!-- .page-header -->

							<div class="page-content">
								<?php 
if (!is_user_logged_in()) {
    wp_redirect(site_url());
} else {
    $user_info = cjtheme_user_info($current_user->ID);
}
$table_notifications = $wpdb->prefix . 'cjtheme_notifications';
$notifications = $wpdb->get_results("SELECT * FROM {$table_notifications} WHERE user_id = '{$user_info['ID']}' ORDER BY dated DESC");
$mark_read_url = cjtheme_string(cjtheme_current_url()) . 'mark-all=read';
if (isset($_GET['mark-all'])) {
    $wpdb->query("UPDATE {$table_notifications} SET unread = 0 WHERE user_id = '{$user_info['ID']}'");
    wp_redirect(cjtheme_current_url('only'));
    die;
}
?>

								<h2 class="sep-heading">
									<span>Notifications</span>
									<a href="<?php 
echo $mark_read_url;
?>
" class="pull-right">Mark All Read</a>
								</h2>
function cjtheme_assistant_url($key, $callback)
{
    return cjtheme_string(cjtheme_current_url()) . 'cjtheme_complete_step=' . $key . '&cjtheme_step_redirect=' . urlencode($callback);
}
<?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
*/
$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 {
					<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'];
        ?>
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>';