tabs[$this->general_settings_key] = __('Settings');
register_setting( $this->general_settings_key, 'archivesCalendar', 'archivesCalendar_options_validate' );
add_settings_section( 'section_general', '', 'archivesCalendar_options', $this->general_settings_key );
}
function register_advanced_settings() {
$this->tabs[$this->advanced_settings_key] = __('Customize');
register_setting( $this->advanced_settings_key, 'archivesCalendarThemer', 'archivesCalendar_themer_validate' );
add_settings_section( 'section_themer', '', 'archivesCalendar_themer', $this->advanced_settings_key );
}
function add_admin_menus() {
global $archivesCalendar_options;
$arcw_page = add_options_page('Archives Calendar Settings', 'Archives Calendar', 'manage_options', $this->plugin_options_key, array( &$this, 'archives_calendar_options_page' ));
remove_submenu_page( 'options-general.php', 'archives_calendar_editor' );
if($archivesCalendar_options['show_settings'] == 0)
remove_submenu_page( 'options-general.php', 'archives_calendar' );
add_action('admin_print_scripts-'.$arcw_page, 'arcw_admin_scripts');
}
function archives_calendar_options_page() {
$tab = isset( $_GET['tab'] ) ? $_GET['tab'] : $this->general_settings_key;
?>
Archives Calendar Widget
tabs(); ?>
general_settings_key;
echo '';
foreach ( $this->tabs as $tab_key => $tab_caption ) {
$active = $current_tab == $tab_key ? 'nav-tab-active' : '';
echo '' . $tab_caption . ' ';
}
echo ' ';
}
};
add_action( 'plugins_loaded', create_function( '', '$settings_api_tabs_demo_plugin = new Archives_Calendar_Widget_Settings;' ) );
function arcw_admin_scripts() {
wp_enqueue_script(
'arcw-admin',
plugins_url( '/admin/js/admin.min.js' , __FILE__ ),
array( 'jquery' ),
ARCWV
);
wp_register_style( 'acwr-themer-style', plugins_url('/admin/css/style.css', __FILE__), array(), ARCWV );
wp_enqueue_style( 'acwr-themer-style' );
if(isset($_GET['tab']) && $_GET['tab'] == 'themer') {
wp_enqueue_script(
'arcw-aceedit',
plugins_url( '/admin/js/lib/ace-edit/ace.js' , __FILE__ ),
array( 'jquery' ),
ARCWV
);
wp_enqueue_script(
'arcw-themer',
plugins_url( '/admin/js/themer.min.js' , __FILE__ ),
array( 'jquery' ),
ARCWV
);
}
}
function archivesCalendar_options_validate($args)
{
if(!isset($args['show_settings']))
$args['show_settings'] = 0;
else
$args['show_settings'] = 1;
if(!isset($args['css']))
$args['css'] = 0;
else
$args['css'] = 1;
if(!isset($args['theme']))
$args['theme'] = "default";
if(!isset($args['jquery']))
$args['jquery'] = 0;
else $args['jquery'] = 1;
if(!isset($args['js']))
$args['js'] = 0;
else
$args['js'] = 1;
if(!isset($args['filter']))
$args['filter'] = 0;
else
$args['filter'] = 1;
if(!isset($args['javascript']) || $args['javascript'] == "" )
$args['javascript'] = "jQuery(document).ready(function($){\n\t$('.calendar-archives').archivesCW();\n});";
return $args;
}
function archivesCalendar_options()
{
global $archivesCalendar_options;
$options = $archivesCalendar_options;
$theme = $options['theme'];
add_thickbox();
?>
item : array();
$count = count($items);
if($count > 0):
?>
RSS feed
pubDate);
echo '
';
echo ''.date('d/m', $date).' ';
echo ''.$item->title.' ';
echo '
';
}
$i++;
}
if($count > 3){
$cat_url = 'http://labs.alek.be/category/archives-calendar/';
echo '';
echo ''. __('More') .' ... ';
echo '
';
}
if($count <= 0) _e( 'No posts', 'arwloc' );
?>
support my work, buy me a beer or a coffee . Click Donate and specify your amount.', 'arwloc');?>
null,
'id' => null,
'class' => null,
'show_current' => false
);
$args = wp_parse_args( (array) $args, $defaults );
extract($args);
echo '';
foreach($themes as $key=>$value)
{
if($archivesCalendar_options['theme'] != $key || $show_current)
echo ''.$value.' ';
}
if( $custom = get_option( 'archivesCalendarThemer' )) {
$i = 1;
foreach ( $custom as $filename => $css ) {
if ( $css ) {
echo '' . __( 'Custom', 'arwloc' ) . ' ' . $i . ' ';
$i ++;
}
}
}
echo ' ';
}
/***** Walker for categories checkboxes *****/
class acw_Walker_Category_Checklist extends Walker
{
var $tree_type = 'category';
var $db_fields = array ('parent' => 'parent', 'id' => 'term_id');
var $conf;
function __construct($conf)
{
$this->conf = $conf;
}
function start_lvl( &$output, $depth = 0, $args = array() )
{
$indent = str_repeat("\t", $depth);
$output .= "$indent\n";
}
function end_lvl( &$output, $depth = 0, $args = array() )
{
$indent = str_repeat("\t", $depth);
$output .= "$indent \n";
}
function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 )
{
extract($args);
$conf = $this->conf;
if ( empty($taxonomy) )
$taxonomy = 'category';
if ( $taxonomy == 'category' )
$name = 'post_category';
else
$name = 'tax_input['.$taxonomy.']';
$class = in_array( $category->term_id, $popular_cats ) ? ' class="popular-category"' : '';
/** This filter is documented in wp-includes/category-template.php */
$output .= "\n" . ' term_id, $selected_cats ), true, false ) . disabled( empty( $args['disabled'] ), false, false ) . ' /> ' . esc_html( apply_filters( 'the_category', $category->name ) ) . ' ';
}
function end_el( &$output, $category, $depth = 0, $args = array() )
{
$output .= " \n";
}
}
/***** CHECKBOXES CHECK *****/
function arcw_checked($option, $value = 1)
{
$options = get_option('archivesCalendar');
if($options[$option] == $value)
echo 'checked="checked"';
}