Пример #1
0
require_once dirname(__FILE__) . '/admin.php';
/** Load HiveQueen dashboard API */
require_once ABSPATH . 'hq-admin/includes/dashboard.php';
hq_dashboard_setup();
hq_enqueue_script('dashboard');
if (current_user_can('edit_theme_options')) {
    hq_enqueue_script('customize-loader');
}
if (current_user_can('install_plugins')) {
    hq_enqueue_script('plugin-install');
}
if (current_user_can('upload_files')) {
    hq_enqueue_script('media-upload');
}
add_thickbox();
if (hq_is_mobile()) {
    hq_enqueue_script('jquery-touch-punch');
}
$title = __('Dashboard');
$parent_file = 'index.php';
$help = '<p>' . __('Welcome to your HiveQueen Dashboard! This is the screen you will see when you log in to your site, and gives you access to all the site management features of HiveQueen. You can get help for any screen by clicking the Help tab in the upper corner.') . '</p>';
// Not using chaining here, so as to be parseable by PHP4.
$screen = get_current_screen();
$screen->add_help_tab(array('id' => 'overview', 'title' => __('Overview'), 'content' => $help));
// Help tabs
$help = '<p>' . __('The left-hand navigation menu provides links to all of the HiveQueen administration screens, with submenu items displayed on hover. You can minimize this menu to a narrow icon strip by clicking on the Collapse Menu arrow at the bottom.') . '</p>';
$help .= '<p>' . __('Links in the Toolbar at the top of the screen connect your dashboard and the front end of your site, and provide access to your profile and helpful HiveQueen information.') . '</p>';
$screen->add_help_tab(array('id' => 'help-navigation', 'title' => __('Navigation'), 'content' => $help));
$help = '<p>' . __('You can use the following controls to arrange your Dashboard screen to suit your workflow. This is true on most other administration screens as well.') . '</p>';
$help .= '<p>' . __('<strong>Screen Options</strong> - Use the Screen Options tab to choose which Dashboard boxes to show.') . '</p>';
$help .= '<p>' . __('<strong>Drag and Drop</strong> - To rearrange the boxes, drag and drop by clicking on the title bar of the selected box and releasing when you see a gray dotted-line rectangle appear in the location you want to place the box.') . '</p>';
Пример #2
0
            ?>
</p>
                </td>
        </tr>
</table>

<p class="step"><a href="../hq-login.php" class="button button-large"><?php 
            _e('Log In');
            ?>
</a></p>

<?php 
        }
        break;
}
if (!hq_is_mobile()) {
    ?>
<script type="text/javascript">var t = document.getElementById('weblog_title'); if (t){ t.focus(); }</script>
<?php 
}
hq_print_scripts('user-profile');
hq_print_scripts('language-chooser');
?>
<script type="text/javascript">
jQuery( function( $ ) {
        $( '.hide-if-no-js' ).removeClass( 'hide-if-no-js' );
} );
</script>
</body>
</html>
Пример #3
0
/**
 * Whether the user should have a WYSIWIG editor.
 *
 * Checks that the user requires a WYSIWIG editor and that the editor is
 * supported in the users browser.
 *
 * @since 0.0.1
 *
 * @global bool $hq_rich_edit
 * @global bool $is_gecko
 * @global bool $is_opera
 * @global bool $is_safari
 * @global bool $is_chrome
 * @global bool $is_IE
 *
 * @return bool
 */
function user_can_richedit()
{
    global $hq_rich_edit, $is_gecko, $is_opera, $is_safari, $is_chrome, $is_IE;
    if (!isset($hq_rich_edit)) {
        $hq_rich_edit = false;
        if (get_user_option('rich_editing') == 'true' || !is_user_logged_in()) {
            // default to 'true' for logged out users
            if ($is_safari) {
                $hq_rich_edit = !hq_is_mobile() || preg_match('!AppleWebKit/(\\d+)!', $_SERVER['HTTP_USER_AGENT'], $match) && intval($match[1]) >= 534;
            } elseif ($is_gecko || $is_chrome || $is_IE || $is_opera && !hq_is_mobile()) {
                $hq_rich_edit = true;
            }
        }
    }
    /**
     * Filter whether the user can access the rich (Visual) editor.
     *
     * @since 0.0.1
     *
     * @param bool $hq_rich_edit Whether the user can access to the rich (Visual) editor.
     */
    return apply_filters('user_can_richedit', $hq_rich_edit);
}
Пример #4
0
/**
 * Adds settings for the customize-loader script.
 *
 * @since 0.0.1
 */
function _hq_customize_loader_settings()
{
    $admin_origin = parse_url(admin_url());
    $home_origin = parse_url(home_url());
    $cross_domain = strtolower($admin_origin['host']) != strtolower($home_origin['host']);
    $browser = array('mobile' => hq_is_mobile(), 'ios' => hq_is_mobile() && preg_match('/iPad|iPod|iPhone/', $_SERVER['HTTP_USER_AGENT']));
    $settings = array('url' => esc_url(admin_url('customize.php')), 'isCrossDomain' => $cross_domain, 'browser' => $browser, 'l10n' => array('saveAlert' => __('The changes you made will be lost if you navigate away from this page.'), 'mainIframeTitle' => __('Customizer')));
    $script = 'var _hqCustomizeLoaderSettings = ' . hq_json_encode($settings) . ';';
    $hq_scripts = hq_scripts();
    $data = $hq_scripts->get_data('customize-loader', 'data');
    if ($data) {
        $script = "{$data}\n{$script}";
    }
    $hq_scripts->add_data('customize-loader', 'data', $script);
}
Пример #5
0
/**
 * Prints default plupload arguments.
 *
 * @since 0.0.1
 */
function hq_plupload_default_settings()
{
    $hq_scripts = hq_scripts();
    $data = $hq_scripts->get_data('hq-plupload', 'data');
    if ($data && false !== strpos($data, '_hqPluploadSettings')) {
        return;
    }
    $max_upload_size = hq_max_upload_size();
    $defaults = array('runtimes' => 'html5,flash,silverlight,html4', 'file_data_name' => 'async-upload', 'url' => admin_url('async-upload.php', 'relative'), 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'), 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'), 'filters' => array('max_file_size' => $max_upload_size . 'b'));
    // Currently only iOS Safari supports multiple files uploading but iOS 7.x has a bug that prevents uploading of videos
    // when enabled. See #29602.
    if (hq_is_mobile() && strpos($_SERVER['HTTP_USER_AGENT'], 'OS 7_') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'like Mac OS X') !== false) {
        $defaults['multi_selection'] = false;
    }
    /**
     * Filter the Plupload default settings.
     *
     * @since 0.0.1
     *
     * @param array $defaults Default Plupload settings array.
     */
    $defaults = apply_filters('plupload_default_settings', $defaults);
    $params = array('action' => 'upload-attachment');
    /**
     * Filter the Plupload default parameters.
     *
     * @since 0.0.1
     *
     * @param array $params Default Plupload parameters array.
     */
    $params = apply_filters('plupload_default_params', $params);
    $params['_hqnonce'] = hq_create_nonce('media-form');
    $defaults['multipart_params'] = $params;
    $settings = array('defaults' => $defaults, 'browser' => array('mobile' => hq_is_mobile(), 'supported' => _device_can_upload()), 'limitExceeded' => is_multisite() && !is_upload_space_available());
    $script = 'var _hqPluploadSettings = ' . hq_json_encode($settings) . ';';
    if ($data) {
        $script = "{$data}\n{$script}";
    }
    $hq_scripts->add_data('hq-plupload', 'data', $script);
}
Пример #6
0
/**
 * @since 0.0.1
 */
function _ipad_meta()
{
    if (hq_is_mobile()) {
        ?>
		<meta name="viehqort" id="viehqort-meta" content="width=device-width, initial-scale=1">
		<?php 
    }
}
Пример #7
0
/**
 * @since 0.0.1
 */
function hq_shake_js()
{
    if (hq_is_mobile()) {
        return;
    }
    ?>
<script type="text/javascript">
addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof hqOnload!='function'){hqOnload=func;}else{var oldonload=hqOnload;hqOnload=function(){oldonload();func();}}};
function s(id,pos){g(id).left=pos+'px';}
function g(id){return document.getElementById(id).style;}
function shake(id,a,d){c=a.shift();s(id,c);if(a.length>0){setTimeout(function(){shake(id,a,d);},d);}else{try{g(id).position='static';hq_attempt_focus();}catch(e){}}}
addLoadEvent(function(){ var p=new Array(15,30,15,0,-15,-30,-15,0);p=p.concat(p.concat(p));var i=document.forms[0].id;g(i).position='relative';shake(i,p,20);});
</script>
<?php 
}