public function load_mk_templates_downloaded()
 {
     $temp = new Chronosly_Templates();
     //moking del json que se recibiria
     $templates_list = $temp->load_template_settings($temp->get_templates_options(1), 1);
     echo json_encode($templates_list);
     die;
 }
    $calendar = $settings["chronosly_calendar_template_default"];
    if (isset($_REQUEST["small"]) and $_REQUEST["small"]) {
        $calendar .= " small";
    }
    echo "<div class='chronosly-calendar-block'>";
    if (!$_REQUEST["shortcode"] or $_REQUEST["shortcode"] and $_REQUEST["before_events"]) {
        do_action("chronosly-before-events", $stilo);
    }
    echo "<div class='chronosly-content-block' style='" . $stilo . ";clear:both;'>";
    if ($_REQUEST["from"]) {
        echo "<div style='display:none'>\r\n            <div class='ch_from'>" . $_REQUEST["from"] . "</div>\r\n            <div class='ch_to'>" . $_REQUEST["to"] . "</div>\r\n            <input type='hidden' name='y' value='{$year}'/>\r\n            <input type='hidden' name='mo' value='{$month}'/>\r\n            <input type='hidden' name='w' value='{$week}'/>\r\n        </div>";
    }
    if (isset($Post_Type_Chronosly->template)) {
        $template = $Post_Type_Chronosly->template;
    } else {
        $template = new Chronosly_Templates();
    }
    $template->templates_tabs("dad1", 1);
    ?>


            <?php 
    $days = Post_Type_Chronosly_Calendar::get_days_by_date($year, $month, $week, $query, $repeated);
    $events = $repeats = array();
    $type = "year";
    $week_in_sunday = 0;
    if ($Post_Type_Chronosly->settings["chronosly_week_start"] == 1) {
        $week_in_sunday = 1;
    }
    if ($month) {
        $type = "month";
 public function chronosly_shortcode($atts)
 {
     $settings = unserialize(get_option("chronosly-settings"));
     $args = array('type' => 'calendar', "upcoming" => 0, "year" => 0, "month" => 0, "week" => 0, "day" => 0, 'id' => 0, 'exclude' => 0, 'single' => 0, 'count' => $settings["chronosly_events_x_page"], 'category' => 0, 'organizer' => 0, 'place' => 0, 'navigation' => 0, 'pagination' => 0, 'small' => 0, 'featured' => 0, 'before_events' => 0, 'after_events' => 0, 'show_past' => 0, 'template' => '');
     $args = apply_filters("chronosly-shortcode-extra-params", $args);
     $code = shortcode_atts($args, $atts);
     $code = apply_filters("chronosly-shortcode-extra-params-run", $code);
     //print_r($code);
     $_REQUEST["small"] = $code["small"];
     $_REQUEST["navigation"] = $code["navigation"];
     Chronosly_Templates::set_shortcode_template_css();
     if ($code["template"]) {
         $_REQUEST["force_template"] = $code["template"];
         Chronosly_Templates::set_shortcode_template_css($code["template"]);
     }
     if ($code["year"]) {
         $_REQUEST["chronosly_event_list_format"] = "year";
         $_REQUEST["chronosly_event_list_time"] = $code["year"];
         $_REQUEST["y"] = $code["year"];
     }
     if ($code["month"]) {
         $_REQUEST["mo"] = $code["month"];
         $_REQUEST["chronosly_event_list_time"] = $code["month"];
         $_REQUEST["chronosly_event_list_format"] = "month";
     }
     if ($code["week"]) {
         $_REQUEST["week"] = $code["week"];
         $_REQUEST["chronosly_event_list_time"] = $code["week"];
         $_REQUEST["chronosly_event_list_format"] = "week";
     }
     if ($code["day"]) {
         //show event list for day
         if ($code["type"] != "category") {
             $code["type"] = "event";
         }
         $_REQUEST["chronosly_event_list_format"] = "day";
         $_REQUEST["chronosly_event_list_time"] = $code["day"];
     }
     if ($code["upcoming"]) {
         //show event list for day
         //$code["type"] = "event";
         $_REQUEST["chronosly_event_list_format"] = "upcoming";
         $_REQUEST["chronosly_event_list_time"] = $code["upcoming"];
     }
     if ($code["show_past"]) {
         //show event list for day
         //$code["type"] = "event";
         $_REQUEST["ch_show_past"] = 1;
     }
     // $_REQUEST["ch_code"] = "[chronosly";
     // if(is_array($atts)){
     //     foreach($atts as $k=>$v){
     //         $_REQUEST["ch_code"] .= " $k='$v'";
     //     }
     // }
     // $_REQUEST["ch_code"] .= "]";
     // $_REQUEST["ch_code"] = str_replace(array("'", '"', "\\\\"), array("\'", "\"", "\\"), $_REQUEST["ch_code"]);
     $_REQUEST["ch_code"] = json_encode($atts);
     //  echo $_REQUEST["ch_code"];
     ob_start();
     $this->run_templates($code["type"], $code);
     $content = ob_get_clean();
     $_REQUEST["chronosly_event_list_format"] = "";
     $_REQUEST["chronosly_event_list_time"] = "";
     $_REQUEST["y"] = "";
     $_REQUEST["mo"] = "";
     $_REQUEST["week"] = "";
     $_REQUEST["count"] = "";
     $_REQUEST["category"] = "";
     $_REQUEST["organizer"] = "";
     $_REQUEST["place"] = "";
     $_REQUEST["small"] = "";
     $_REQUEST["pagination"] = "";
     $_REQUEST["ch_code"] = "";
     $_REQUEST["force_template"] = "";
     return $content;
 }