File: /home/unimil/public_html/wp-content/plugins/wd-google-maps/admin/models/GMWDModelPolylines_gmwd.php
<?php
class GMWDModelPolylines_gmwd extends GMWDModel {
////////////////////////////////////////////////////////////////////////////////////////
// Events //
////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
// Constants //
////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
// Variables //
////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
// Constructor & Destructor //
////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
// Public Methods //
////////////////////////////////////////////////////////////////////////////////////////
public function get_row($id){
global $wpdb;
$id = (int)$id;
if(isset($_POST["data"]) && sanitize_text_field($_POST["data"]) != "{}"){
$row = json_decode(htmlspecialchars_decode(stripslashes($_POST["data"])));
$row = json_decode($row);
$row->title = str_replace("@@@",'"',$row->title);
if(isset($_GET["dublicated"]) && intval($_GET["dublicated"]) == 1){
$row->id = "";
}
}
else{
$row = parent::get_row_by_id($id);
$row->line_width = 2;
$row->line_color = "#000";
$row->line_opacity = 0.8;
$row->line_opacity_hover = 0.9;
$row->line_color_hover = "#000";
$row->show_markers = 1;
$row->published = 1;
}
return $row;
}
public function get_rows(){
global $wpdb;
$query = "SELECT * FROM " . $wpdb->prefix . "gmwd_polylines " ;
$rows = $wpdb->get_results($query);
return $rows;
}
////////////////////////////////////////////////////////////////////////////////////////
// Getters & Setters //
////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
// Private Methods //
////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
// Listeners //
////////////////////////////////////////////////////////////////////////////////////////
}