__( 'What should we call this preset?', 'graphene' ),
'preset_name_req' => __( 'Preset name is required to save a preset.', 'graphene' ),
'preset_delete_confirm' => __( 'You are deleting this preset:', 'graphene' ),
'preset_select_file' => __( 'Please select the exported Graphene colour presets file to import.', 'graphene' ),
'chosen_no_search_result' => __( 'Oops, nothing found.', 'graphene' ),
'is_rtl' => is_rtl(),
'import_select_file' => __( 'Please select the exported Graphene options file to import.', 'graphene' ),
));
// wp_enqueue_script( 'wp-pointer' );
wp_enqueue_script( 'graphene-codemirror', GRAPHENE_ROOTURI . '/js/codemirror/codemirror.js', array(), '', false );
wp_deregister_script( 'chosen' );
wp_enqueue_script( 'chosen', GRAPHENE_ROOTURI . '/js/chosen/chosen.jquery.min.js', array( 'jquery' ), '', false );
if ( isset( $_GET['tab'] ) && $_GET['tab'] == 'display' )
wp_enqueue_script( 'jquery-ui-slider' );
else if ( isset( $_GET['tab'] ) && $_GET['tab'] == 'colours' )
wp_enqueue_script( 'farbtastic' );
else
wp_enqueue_script( 'jquery-ui-sortable' );
}
/**
* Generates the tabs in the theme's options page
*/
if ( ! function_exists( 'graphene_options_tabs' ) ) :
function graphene_options_tabs( $current = 'general', $tabs = array( 'general' => 'General' ) ) {
$links = array();
foreach( $tabs as $tab => $name ) :
if ( $tab == $current ) :
$links[] = "$name";
else :
$links[] = "$name";
endif;
endforeach;
echo '
';
}
endif;
/**
* Output the options content
*
* @param string $tab The slug of the option tab to display
*
* @package Graphene
* @since Graphene 1.8
*/
if ( ! function_exists( 'graphene_options_tabs_content' ) ) :
function graphene_options_tabs_content( $tab ){
require( get_template_directory() . '/admin/options-' . $tab . '.php' );
call_user_func( 'graphene_options_' . $tab );
}
endif;
/**
* Include the file for additional user fields
*/
include( GRAPHENE_ROOTDIR . '/admin/user.php' );
/**
* Include the file for additional custom fields in posts and pages editing screens
*/
include( GRAPHENE_ROOTDIR . '/admin/custom-fields.php' );
/**
* Add a link to the theme's options page in the admin bar
*/
function graphene_wp_admin_bar_theme_options(){
if ( ! current_user_can( 'edit_theme_options' ) ) return;
global $wp_admin_bar;
$wp_admin_bar->add_menu( array(
'parent' => 'appearance',
'id' => 'graphene-options',
'title' => 'Graphene Options',
'href' => admin_url( 'themes.php?page=graphene_options' ) ) );
}
add_action( 'admin_bar_menu', 'graphene_wp_admin_bar_theme_options', 61 );
/**
* Displays a graphic visualizer for template selection in the Edit Page screen
*/
function graphene_page_template_visualizer() {
global $graphene_settings, $post_id;
$template_not_found = __( 'Template preview not found.', 'graphene' );
if ( ! get_post_meta( $post_id, '_wp_page_template', true ) ){
$default_template = __( 'default', 'graphene' );
} else {
switch( $graphene_settings['column_mode']){
case 'one_column':
$default_template = 'template-onecolumn.php';
break;
case 'two_col_right':
$default_template = 'template-twocolumnsright.php';
break;
case 'three_col_left':
$default_template = 'template-threecolumnsleft.php';
break;
case 'three_col_right':
$default_template = 'template-threecolumnsright.php';
break;
case 'three_col_center':
$default_template = 'template-threecolumnscenter.php';
break;
default:
$default_template = 'template-twocolumnsleft.php';
break;
}
}
$preview_img_path = GRAPHENE_ROOTURI . '/admin/images/';
?>