diff options
author | Simon Rettberg | 2016-05-03 19:03:09 +0200 |
---|---|---|
committer | Simon Rettberg | 2016-05-03 19:03:09 +0200 |
commit | 50404f3b23b7fd6aeae4c9d2f6df0ea25e984e66 (patch) | |
tree | 05e99fdffa696434960d7c77966c0bc36d6339e8 /modules-available/support | |
parent | Second half of merge.... (diff) | |
download | slx-admin-50404f3b23b7fd6aeae4c9d2f6df0ea25e984e66.tar.gz slx-admin-50404f3b23b7fd6aeae4c9d2f6df0ea25e984e66.tar.xz slx-admin-50404f3b23b7fd6aeae4c9d2f6df0ea25e984e66.zip |
WIP
Diffstat (limited to 'modules-available/support')
-rw-r--r-- | modules-available/support/config.json | 4 | ||||
-rw-r--r-- | modules-available/support/faq.json | 19 | ||||
-rw-r--r-- | modules-available/support/lang/en/module.json | 3 | ||||
-rw-r--r-- | modules-available/support/lang/pt/module.json | 18 | ||||
-rw-r--r-- | modules-available/support/page.inc.php | 83 | ||||
-rw-r--r-- | modules-available/support/templates/page-faq.html | 29 | ||||
-rw-r--r-- | modules-available/support/templates/page-support.html | 59 |
7 files changed, 215 insertions, 0 deletions
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 @@ +<?php + +class Page_Support extends Page +{ + + protected function doPreprocess(){ + User::load(); + if (!User::hasPermission('superadmin')) { + Message::addError('no-permission'); + Util::redirect('?do=Main'); + } + error_reporting(E_ALL); + ini_set('display_errors','on'); + + Session::get('token'); + + + //THIS IS NOT WORKING + //Cant connect to ANY smtp server + /* + if (strpos($_SERVER['REQUEST_URI'], "action=send") !== false){ + require '/var/www/slx-admin/phpmailer/PHPMailerAutoload.php'; + + $mail = new PHPMailer; + $mail->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 <b>in bold!</b>'; + $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 @@ +<div class="panel panel-default"> + <div class="panel-heading"> + <strong>{{lang_faq}}</strong> + </div> + <!-- //FAQ --> + <div class="panel-body" id="accordion" role="tablist" aria-multiselectable="true"> + + {{#faq}} + <div class="panel panel-default"> + <div class="panel-heading" role="tab" id="heading{{order}}"> + <h4 class="panel-title"> + <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapse{{order}}" aria-expanded="false" aria-controls="collapse{{order}}"> + {{question}} + </a> + </h4> + </div> + <div id="collapse{{order}}" class="panel-collapse collapse" role="tabpanel" aria-labelledby="heading{{order}}"> + <div class="panel-body"> + {{answer}} + </div> + </div> + </div> + {{/faq}} + + <a class="btn btn-default" href="?do=Support&showfaq=false" role="button"><strong>{{lang_supIntro}}</strong></a> + </div></div> +</div> + + 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 @@ +<p>{{lang_supIntro}}</p> +<div class="panel panel-default"> + <div class="panel-heading"> + <strong>{{lang_faq}}</strong> + </div> + <!-- //FAQ --> + <div class="panel-body" id="accordion" role="tablist" aria-multiselectable="true"> + + {{#faq}} + {{#highlight}} + <div class="panel panel-default"> + <div class="panel-heading" role="tab" id="heading{{order}}"> + <h4 class="panel-title"> + <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapse{{order}}" aria-expanded="false" aria-controls="collapse{{order}}"> + {{question}} + </a> + </h4> + </div> + <div id="collapse{{order}}" class="panel-collapse collapse" role="tabpanel" aria-labelledby="heading{{order}}"> + <div class="panel-body"> + {{answer}} + </div> + </div> + </div> + {{/highlight}} + {{/faq}} + + <a class="btn btn-default" href="?do=Support&showfaq=true" role="button"><strong>{{lang_showall}}</strong></a> + </div> +</div> + + <!-- //Send questions (token and input not ok) --> +<div class="panel panel-default"> + <div class="panel-heading"> + <strong>{{lang_form}}</strong> + </div> + <div class="panel-body"> + <form action="?do=Support&showfaq=false&action=send" method="post" enctype="multipart/form-data"> + <input type="hidden" name="token" value="{{token}}"> + <div class="form-group"> + <label for="emailHeader">{{lang_header}}</label> + <input type="text" class="form-control" placeholder="{{lang_header}}" value="{{assuntoEmail}}"> + </div> + <div class="form-group"> + <label for="emailContent">{{lang_content}}</label> + <textarea class="form-control" rows="2" cols="20" placeholder="{{lang_content}}">{{conteudoEmail}}</textarea> + </div> + <div class="form-group"> + <label for="inputFile">{{lang_fileInput}}</label> + <input type="file" name="inp_file" id="inp_file"> + <input type="hidden" name="token" value="{{token}}"> + <p class="help-block">{{lang_helpInput}}</p> + </div> + <button type="submit" class="btn btn-default">{{lang_submit}}</button> + </form> + </div> +</div> + + |