/var/www/vhosts/ihelp.ro/ajutam.ro/wp-content/plugins/trx_utils/widgets
Edit: /var/www/vhosts/ihelp.ro/ajutam.ro/wp-content/plugins/trx_utils/widgets/calendar.php (7285B)
'widget_calendar', 'description' => esc_html__('Calendar for posts and/or Events', 'trx_utils'));
parent::__construct( 'charity_is_hope_widget_calendar', esc_html__('Charity Is Hope - Advanced Calendar', 'trx_utils'), $widget_ops );
}
// Show widget
function widget($args, $instance) {
extract($args);
$title = apply_filters('widget_title', isset($instance['title']) ? $instance['title'] : '');
$post_type = isset($instance['post_type']) ? $instance['post_type'] : 'post';
$output = charity_is_hope_get_calendar(false, 0, 0, array('post_type'=>$post_type));
if (!empty($output)) {
// Before widget (defined by themes)
charity_is_hope_show_layout($before_widget);
// Display the widget title if one was input (before and after defined by themes)
if ($title) charity_is_hope_show_layout($title, $before_title, $after_title);
charity_is_hope_show_layout($output);
// After widget (defined by themes)
charity_is_hope_show_layout($after_widget);
}
}
// Update the widget settings.
function update($new_instance, $old_instance) {
$instance = $old_instance;
$instance['title'] = strip_tags($new_instance['title']);
$instance['post_type'] = isset($new_instance['post_type']) ? join(',', $new_instance['post_type']) : 'post';
return $instance;
}
// Displays the widget settings controls on the widget panel.
function form($instance) {
// Set up some default widget settings
$instance = wp_parse_args( (array) $instance, array(
'title' => '',
'post_type'=>'post'
)
);
$title = $instance['title'];
$post_type = $instance['post_type'];
$posts_types = charity_is_hope_get_list_posts_types(false);
?>
0) {
foreach ($posts_types as $type=>$type_title) {
$i++;
echo '';
}
}
?>
"",
"weekdays" => "short",
// Common params
"id" => "",
"class" => "",
"css" => ""
), $atts));
if ($atts['weekdays']=='') $atts['weekdays'] = 'short';
extract($atts);
$type = 'charity_is_hope_widget_calendar';
$output = '';
global $wp_widget_factory;
if ( is_object( $wp_widget_factory ) && isset( $wp_widget_factory->widgets, $wp_widget_factory->widgets[ $type ] ) ) {
$output = '
';
ob_start();
the_widget( $type, $atts, charity_is_hope_prepare_widgets_args(charity_is_hope_storage_get('widgets_args'), $id ? $id.'_widget' : 'widget_calendar', 'widget_calendar') );
$output .= ob_get_contents();
ob_end_clean();
$output .= '
';
}
return apply_filters('charity_is_hope_shortcode_output', $output, 'trx_widget_calendar', $atts, $content);
}
add_shortcode("trx_widget_calendar", "charity_is_hope_sc_widget_calendar");
}
// Add [trx_widget_calendar] in the VC shortcodes list
if (!function_exists('charity_is_hope_widget_calendar_reg_shortcodes_vc')) {
//add_action('charity_is_hope_action_shortcodes_list_vc','charity_is_hope_widget_calendar_reg_shortcodes_vc');
function charity_is_hope_widget_calendar_reg_shortcodes_vc() {
vc_map( array(
"base" => "trx_widget_calendar",
"name" => esc_html__("Widget Calendar", 'trx_utils'),
"description" => wp_kses_data( __("Insert standard WP Calendar, but allow user select week day's captions", 'trx_utils') ),
"category" => esc_html__('Content', 'trx_utils'),
"icon" => 'icon_trx_widget_calendar',
"class" => "trx_widget_calendar",
"content_element" => true,
"is_container" => false,
"show_settings_on_create" => true,
"params" => array(
array(
"param_name" => "title",
"heading" => esc_html__("Widget title", 'trx_utils'),
"description" => wp_kses_data( __("Title of the widget", 'trx_utils') ),
"admin_label" => true,
"class" => "",
"value" => "",
"type" => "textfield"
),
array(
"param_name" => "weekdays",
"heading" => esc_html__("Week days", 'trx_utils'),
"description" => wp_kses_data( __("Show captions for the week days as three letters (Sun, Mon, etc.) or as one initial letter (S, M, etc.)", 'trx_utils') ),
"class" => "",
"value" => array(esc_html__("Initial letter", 'trx_utils') => "initial" ),
"type" => "checkbox"
),
charity_is_hope_get_vc_param('id'),
charity_is_hope_get_vc_param('class'),
charity_is_hope_get_vc_param('css')
)
) );
class WPBakeryShortCode_Trx_Widget_Calendar extends WPBakeryShortCode {}
}
}
?>