public function widget($args, $instance)
 {
     //widget title
     $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base);
     $map = HW_Module_Gmap::get();
     // before and after widget arguments are defined by themes
     echo $args['before_widget'];
     if (!empty($title)) {
         echo $args['before_title'] . $title . $args['after_title'];
     }
     //render map
     echo $map->_hw_render_google_map($instance);
     echo $args['after_widget'];
 }
Example #2
0
    /**
     * @hook admin_enqueue_scripts
     */
    public function admin_enqueue_scripts()
    {
        #$this->enqueue_script('admin-tooltip.js');
        #HW_Libraries::enqueue_jquery_libs('tooltipster');
        $this->enqueue_scripts();
    }
    /**
     * Triggered when the tab is loaded.
     */
    public function replyToAddFormElements($oAdminPage)
    {
        $field_addr = $this->create_field_name('address');
        //address field
        $field_location = $this->create_field_name('location');
        $oAdminPage->addSettingFields(array('field_id' => $field_addr, 'type' => 'text', 'title' => 'Địa chỉ', 'description' => '<a href="javascript:void(0)" onclick="__hw_module_map.get_location(this, jQuery(\'#' . $field_addr . '__0\').val(),\'#' . $field_location . '__0\')">Lấy tọa độ</a>'), array('field_id' => $field_location, 'type' => 'hidden'), array('field_id' => $this->create_field_name('show_searchbox'), 'type' => 'checkbox', 'title' => 'Hiển thị hộp tìm kiếm.'), array('field_id' => $this->create_field_name('width'), 'type' => 'text', 'title' => 'Width (px/%)', 'description' => '(mặc định px)'), array('field_id' => $this->create_field_name('height'), 'type' => 'text', 'title' => 'Height (px/%)', 'description' => '(mặc định px)'), array());
    }
}
HW_Module_Gmap::register();
function hw_module_map_register_activation_hook()
{
    #_print('activation hook for gmap');
}
hw_register_activation_hook(__FILE__, 'hw_module_map_register_activation_hook');
function hw_module_map_register_deactivation_hook()
{
    #_print('deactivation hook for gmap');
}
hw_register_deactivation_hook(__FILE__, 'hw_module_map_register_deactivation_hook');