Browse Source

Ajustes no plugin

master
Matheus Garcia 6 years ago
parent
commit
5eab180ece
  1. 6
      amd/src/config.js
  2. 16
      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:"" dataSrc:""
}, },
columns: [ columns: [
{ data: "id" }, { data: "id_conversa" },
{ data: "title" }, { data: "titulo" },
{ data: "description" } { data: "cpf" }
], ],
//select: true //select: true
}); });

16
index.php

@ -1,7 +1,7 @@
<?php <?php
require_once("../../config.php"); require_once("../../config.php");
require_once("./searchform.php"); require_once("./searchform.php");
include('httpful.phar'); //include('httpful.phar');
// Check if user is logged and not guest // Check if user is logged and not guest
require_login(); require_login();
@ -9,26 +9,17 @@ if (isguestuser()) {
die(); die();
} }
global $DB;
// Prepare page // Prepare page
$context = context_system::instance(); $context = context_system::instance();
$PAGE->set_pagelayout('standard'); $PAGE->set_pagelayout('standard');
$PAGE->set_url('/blocks/fale_conosco/index.php'); $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://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://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); $PAGE->set_context($context);
// Get data // Get data
$strtitle = get_string('fale_conosco', 'block_fale_conosco'); $strtitle = get_string('fale_conosco', 'block_fale_conosco');
$user = $USER; $user = $USER;
@ -63,7 +54,6 @@ echo $OUTPUT->header();
echo $OUTPUT->box_start('generalbox boxaligncenter'); echo $OUTPUT->box_start('generalbox boxaligncenter');
echo $OUTPUT->heading(get_string('fale_conosco', 'block_fale_conosco')); echo $OUTPUT->heading(get_string('fale_conosco', 'block_fale_conosco'));
//Instantiate simplehtml_form //Instantiate simplehtml_form
$mform = new searchform(); $mform = new searchform();
@ -159,7 +149,7 @@ if ($mform->is_cancelled()) {
</script> </script>
<?php <?php
$PAGE->requires->js_call_amd('block_fale_conosco/config', 'init'); $PAGE->requires->js_call_amd('block_fale_conosco/config', 'init');
//$PAGE->requires->js_call_amd('block_fale_conosco/config', 'getTableContacts'); //$PAGE->requires->js_call_amd('block_fale_conosco/config', 'getTableContacts');
?> ?>

4
proxy.php

@ -28,12 +28,12 @@ if(isset($_GET["contactID"])) {
->send(); ->send();
} }
else { 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) $response = \Httpful\Request::post($uri)
->sendsJson() ->sendsJson()
->body( ->body(
'{ '{
"school_initial": "SSL", "school_initials": "SSL",
"page" : "1", "page" : "1",
"limit": "10" "limit": "10"
}' }'

Loading…
Cancel
Save