Browse Source

Ajustes no plugin

master
Matheus Garcia 6 years ago
parent
commit
5eab180ece
  1. 6
      amd/src/config.js
  2. 14
      index.php
  3. 4
      proxy.php

6
amd/src/config.js

@ -16,9 +16,9 @@ define(['jquery', 'js/jquery.dataTables.min.js', 'js/jquery-ui.min.js'] , functi
dataSrc:""
},
columns: [
{ data: "id" },
{ data: "title" },
{ data: "description" }
{ data: "id_conversa" },
{ data: "titulo" },
{ data: "cpf" }
],
//select: true
});

14
index.php

@ -1,7 +1,7 @@
<?php
require_once("../../config.php");
require_once("./searchform.php");
include('httpful.phar');
//include('httpful.phar');
// Check if user is logged and not guest
require_login();
@ -9,26 +9,17 @@ if (isguestuser()) {
die();
}
global $DB;
// Prepare page
$context = context_system::instance();
$PAGE->set_pagelayout('standard');
$PAGE->set_url('/blocks/fale_conosco/index.php');
$PAGE->requires->css(new moodle_url('https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css'));
$PAGE->requires->css(new moodle_url('https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css'));
$PAGE->requires->css(new moodle_url('https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css'));
$PAGE->requires->css(new moodle_url('https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css'));
//$PAGE->requires->js('/blocks/fale_conosco/datatable.js', true);
/*
$PAGE->requires->js(new moodle_url('https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js'),true);
$PAGE->requires->js(new moodle_url('https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js'),true);
*/
$PAGE->set_context($context);
// Get data
$strtitle = get_string('fale_conosco', 'block_fale_conosco');
$user = $USER;
@ -63,7 +54,6 @@ echo $OUTPUT->header();
echo $OUTPUT->box_start('generalbox boxaligncenter');
echo $OUTPUT->heading(get_string('fale_conosco', 'block_fale_conosco'));
//Instantiate simplehtml_form
$mform = new searchform();

4
proxy.php

@ -28,12 +28,12 @@ if(isset($_GET["contactID"])) {
->send();
}
else {
$uri = 'https://escolamodelows.interlegis.leg.br/api/v1/fale_conosco';
$uri = 'https://escolamodelows.interlegis.leg.br/api/v1/fale_conosco/conversa';
$response = \Httpful\Request::post($uri)
->sendsJson()
->body(
'{
"school_initial": "SSL",
"school_initials": "SSL",
"page" : "1",
"limit": "10"
}'

Loading…
Cancel
Save