Thiago Gomes Verissimo 1 éve
commit
90249eddc2
6 módosított fájl, 97 hozzáadás és 0 törlés
  1. 9 0
      README.md
  2. 28 0
      block_tasksummary.php
  3. 29 0
      db/access.php
  4. 7 0
      lang/en/block_tasksummary.php
  5. 18 0
      pages/tasksummary.php
  6. 6 0
      version.php

+ 9 - 0
README.md

@@ -0,0 +1,9 @@
+Plugin moodle (em desenvolvimento) para disciplina: 
+
+MAC5857 - Desenvolvimento de Sistemas Web para Apoio ao Ensino/Aprendizagem
+prof. Leonidas de Oliveira Brandao
+
+Ambiente dev:
+
+    cd blocks
+    git clone 

+ 28 - 0
block_tasksummary.php

@@ -0,0 +1,28 @@
+<?php
+
+class block_tasksummary extends block_base {
+    public function init() {
+        $this->title = get_string('block_title', 'block_tasksummary');
+    }
+
+    public function get_content() {
+        global $USER;
+        
+        $this->content =  new stdClass;
+
+        $this->content->text = 'Exemplo Bloco Educação e Dados';
+
+        $url = new moodle_url('/blocks/tasksummary/pages/tasksummary.php', [
+            #'var1' => $var1,
+        ]);
+
+        $attr = [
+            'class'=>'btn btn-xs btn-success'
+        ];
+
+        $this->content->text .= html_writer::link($url, 'Ver resumo completo', $attr) . '<br><br>';
+
+        return $this->content;
+    }
+
+}

+ 29 - 0
db/access.php

@@ -0,0 +1,29 @@
+<?php
+
+defined('MOODLE_INTERNAL') || die();
+
+$capabilities = array(
+
+    'block/tasksummary:myaddinstance' => array(
+            'captype' => 'write',
+            'contextlevel' => CONTEXT_SYSTEM,
+            'archetypes' => array(
+                'user' => CAP_ALLOW
+            ),
+
+            'clonepermissionsfrom' => 'moodle/my:manageblocks'
+        ),
+
+    'block/tasksummary:addinstance' => array(
+        'riskbitmask' => RISK_SPAM | RISK_XSS,
+
+        'captype' => 'write',
+        'contextlevel' => CONTEXT_BLOCK,
+        'archetypes' => array(
+            'editingteacher' => CAP_ALLOW,
+            'manager' => CAP_ALLOW
+        ),
+
+        'clonepermissionsfrom' => 'moodle/site:manageblocks'
+    ),
+);

+ 7 - 0
lang/en/block_tasksummary.php

@@ -0,0 +1,7 @@
+<?php
+
+defined('MOODLE_INTERNAL') || die();
+
+$string['pluginname'] = 'Task Summary';
+$string['block_title'] = 'Disciplina IME USP';
+

+ 18 - 0
pages/tasksummary.php

@@ -0,0 +1,18 @@
+<?php
+
+require_once('../../../config.php');
+
+$url = new moodle_url("/blocks/tasksummary/pages/tasksummary.php");
+$PAGE->set_url($url);
+$PAGE->set_context(context_system::instance());
+$PAGE->set_pagelayout('admin');
+
+require_login();
+
+$title = get_string('pluginname', 'block_tasksummary');
+$page_title = 'Aqui teremos muitas coisas legais de data science e educação';
+$PAGE->set_title($page_title);
+$PAGE->set_heading($page_title);
+
+echo $OUTPUT->header();
+echo $OUTPUT->footer();

+ 6 - 0
version.php

@@ -0,0 +1,6 @@
+<?php
+
+defined('MOODLE_INTERNAL') || die();
+
+$plugin->component = 'block_tasksummary';
+$plugin->version = 2022090901;