From 50404f3b23b7fd6aeae4c9d2f6df0ea25e984e66 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 3 May 2016 19:03:09 +0200 Subject: WIP --- modules-available/support/config.json | 4 ++ modules-available/support/faq.json | 19 +++++ modules-available/support/lang/en/module.json | 3 + modules-available/support/lang/pt/module.json | 18 +++++ modules-available/support/page.inc.php | 83 ++++++++++++++++++++++ modules-available/support/templates/page-faq.html | 29 ++++++++ .../support/templates/page-support.html | 59 +++++++++++++++ 7 files changed, 215 insertions(+) create mode 100644 modules-available/support/config.json create mode 100644 modules-available/support/faq.json create mode 100644 modules-available/support/lang/en/module.json create mode 100644 modules-available/support/lang/pt/module.json create mode 100644 modules-available/support/page.inc.php create mode 100644 modules-available/support/templates/page-faq.html create mode 100644 modules-available/support/templates/page-support.html (limited to 'modules-available/support') diff --git a/modules-available/support/config.json b/modules-available/support/config.json new file mode 100644 index 00000000..6c189b63 --- /dev/null +++ b/modules-available/support/config.json @@ -0,0 +1,4 @@ +{ + "category":"main.content", + "enabled":"true" +} diff --git a/modules-available/support/faq.json b/modules-available/support/faq.json new file mode 100644 index 00000000..1c1d372f --- /dev/null +++ b/modules-available/support/faq.json @@ -0,0 +1,19 @@ +{ + "faq": [ + {"question": "Este é o FAQ", + "answer": "Ao clicar em cada uma pergunta, elas se expandem exibindo as respostas!", + "order": "One", + "highlight": true + }, + {"question": "Por enquanto não há nada por aqui (ツ)_/¯ ", + "answer": "As perguntas serão adicionadas conforme as dúvidas forem surgindo", + "order": "Two", + "highlight": true + }, + {"question": "Nem todas as perguntas estarão aqui", + "answer": "Se tiver uma dúvida que não está no FAQ, envie um e-mail clicando no botão abaixo ;)", + "order": "Three", + "highlight": false + } + ] +} diff --git a/modules-available/support/lang/en/module.json b/modules-available/support/lang/en/module.json new file mode 100644 index 00000000..c44dc44f --- /dev/null +++ b/modules-available/support/lang/en/module.json @@ -0,0 +1,3 @@ +[ + +] \ No newline at end of file diff --git a/modules-available/support/lang/pt/module.json b/modules-available/support/lang/pt/module.json new file mode 100644 index 00000000..f82f6a04 --- /dev/null +++ b/modules-available/support/lang/pt/module.json @@ -0,0 +1,18 @@ +{ + "lang_content": "Conte\u00fado", + "lang_content#1": "Ao clicar em cada uma pergunta, elas se expandem exibindo as respostas!", + "lang_content#2": "As perguntas ser\u00e3o adicionadas conforme as d\u00favidas forem surgindo", + "lang_content#3": "Se tiver uma d\u00favida que n\u00e3o est\u00e1 no FAQ, envie um e-mail clicando no bot\u00e3o abaixo ;)", + "lang_faq": "FAQ", + "lang_faq#1": "Este \u00e9 o FAQ", + "lang_faq#2": "Por enquanto n\u00e3o h\u00e1 nada por aqui (\u30c4)_\/\u00af", + "lang_faq#3": "Nem todas as perguntas estar\u00e3o aqui", + "lang_fileInput": "Arquivo:", + "lang_form": "Formul\u00e1rio", + "lang_header": "Assunto", + "lang_helpInput": "Voc\u00ea pode mandar uma foto\/arquivo que nos auxilie a entender o problema.", + "lang_showall": "Clique aqui para mostrar todo o FAQ", + "lang_submit": "Enviar", + "lang_supIntro": "N\u00e3o encontrou o que queria no FAQ? Mande-nos um e-mail informando o problema", + "module_name": "Suporte" +} \ No newline at end of file diff --git a/modules-available/support/page.inc.php b/modules-available/support/page.inc.php new file mode 100644 index 00000000..10695969 --- /dev/null +++ b/modules-available/support/page.inc.php @@ -0,0 +1,83 @@ +SMTPDebug = 3; // Enable verbose debug output + $mail->isSMTP(); // Set mailer to use SMTP + $mail->Host = 'mx.c3sl.ufpr.br'; // Specify main and backup SMTP servers + $mail->SMTPAuth = true; // Enable SMTP authentication + $mail->Username = 'xxx00@inf.ufpr.br'; // SMTP username + $mail->Password = ''; // SMTP password + // $mail->SMTPSecure = 'false'; // Enable TLS encryption, `ssl` also accepted + $mail->Port = 25; // TCP port to connect to + + $mail->From = 'xxx00@inf.ufpr.br'; + $mail->FromName = 'Someone'; + $mail->addAddress('receiver@email.com', 'Another One'); // Add a recipient + // $mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments + // $mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name + $mail->isHTML(true); // Set email format to HTML + $mail->Subject = 'Here is the subject'; + $mail->Body = 'This is the HTML message body in bold!'; + $mail->AltBody = 'This is the body in plain text for non-HTML mail clients'; + + if(!$mail->send()) { + echo 'Message could not be sent.'; + echo 'Mailer Error: ' . $mail->ErrorInfo; + } else { + echo 'Message has been sent'; + } + */ +// $uploaddir = '/var/www/uploads/'; +// $uploadfile = $uploaddir . basename($_FILES['inp_file']['name']); +// if(move_uploaded_file($_FILES['inp_file']['tmp_name'], $uploadfile)) +// Message::addSuccess('news-save-success'); +// else +// Message::addError('news-empty'); +// mail($to,$_POST[assuntoEmail],$_POST[conteudoEmail],"-r".$from); +// mail($to,$assunto,$content,$headers); + + + } + + + + protected function doRender(){ + error_reporting(E_ALL); + ini_set('display_errors','on'); + if (strpos($_SERVER['REQUEST_URI'], "true") !== false){ + Render::addTemplate('page-faq', + json_decode(file_get_contents("modules/support/faq.json"),true) + ); + } + else{ + Render::addTemplate('page-support', + json_decode(file_get_contents("modules/support/faq.json"),true) + ); + } +// Render::addTemplate('page-support', array( +// 'token' => Session:get('token')); + } + + +} diff --git a/modules-available/support/templates/page-faq.html b/modules-available/support/templates/page-faq.html new file mode 100644 index 00000000..ae706f4b --- /dev/null +++ b/modules-available/support/templates/page-faq.html @@ -0,0 +1,29 @@ +
+
+ {{lang_faq}} +
+ +
+ + {{#faq}} +
+ +
+
+ {{answer}} +
+
+
+ {{/faq}} + + {{lang_supIntro}} +
+ + + diff --git a/modules-available/support/templates/page-support.html b/modules-available/support/templates/page-support.html new file mode 100644 index 00000000..196e0891 --- /dev/null +++ b/modules-available/support/templates/page-support.html @@ -0,0 +1,59 @@ +

{{lang_supIntro}}

+
+
+ {{lang_faq}} +
+ +
+ + {{#faq}} + {{#highlight}} +
+ +
+
+ {{answer}} +
+
+
+ {{/highlight}} + {{/faq}} + + {{lang_showall}} +
+
+ + +
+
+ {{lang_form}} +
+
+
+ +
+ + +
+
+ + +
+
+ + + +

{{lang_helpInput}}

+
+ +
+
+
+ + -- cgit v1.2.3-55-g7522