-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
202b0d6
commit e166c89
Showing
19 changed files
with
864 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<Files "\.(php)$"> | ||
order allow,deny | ||
deny from all | ||
</Files> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<h3>Вы можете поддержать развитие проекта, сделав пожертвование</h3> | ||
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"> | ||
<input type="hidden" name="cmd" value="_s-xclick"> | ||
<input type="hidden" name="hosted_button_id" value="FGRFBSFEW5V3Y"> | ||
<input type="image" src="https://www.paypalobjects.com/en_US/RU/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"> | ||
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1"> | ||
</form> |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
/** | ||
* @file PluginGuestbook.class.php | ||
* @description | ||
* | ||
* PHP Version 5.3 | ||
* | ||
* @package | ||
* @category | ||
* @plugin URI | ||
* @copyright 2013, Vadim Pshentsov. All Rights Reserved. | ||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0 | ||
* @author Vadim Pshentsov <[email protected]> | ||
* @created 18.04.13 | ||
*/ | ||
|
||
if (!class_exists('Plugin')) { | ||
die('This script can not be executed directly.'); | ||
} | ||
|
||
class PluginGuestbook extends Plugin { | ||
|
||
public function Init() { | ||
parent::Init(); | ||
$this->Viewer_AppendStyle(Plugin::GetTemplateWebPath(__CLASS__).'css/guestbook.css'); | ||
|
||
$this->Viewer_AppendScript(Plugin::GetTemplateWebPath(__CLASS__).'js/jquery.validate.min.js'); | ||
$this->Viewer_AppendScript(Plugin::GetTemplateWebPath(__CLASS__).'js/messages_ru.js'); | ||
$this->Viewer_AppendScript(Plugin::GetTemplateWebPath(__CLASS__).'js/guestbook.js'); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
На странице модуля необходимо разместить инструкцию по работе сервиса и форму отправки. Форма отправки отзыва должна | ||
включать в себя следующие поля: Ф.И.О. отправителя, адрес электронной почты, суть отзыва. | ||
Отзыв отправляется на отдельный адрес электронной почты администрации портала, с функцией отправки сообщения о принятии | ||
заявки в работу на адрес заявителя. | ||
Форма отправки отзыва должна располагаться во всплывающем окне. | ||
Информация, направленная от пользователей, является закрытой, не предусматривает открытой публикации или тиражирования. | ||
Сводная информация модуля «Электронная книга отзывов» направляется в департамент здравоохранения Тюменской области в | ||
еженедельном режиме. | ||
Все обновления модуля «Электронная книга отзывов» автоматически должны размещаться в разделе «Актуально» на первой | ||
странице портала http://takzdorovo-to.ru, по истечении месяца архивироваться в профильный раздел. Техническую поддержку | ||
и сопровождение модуля «Электронная книга отзывов» ведут специалисты портала http://takzdorovo-to.ru | ||
|
||
@todo: Форма отправки отзыва должна располагаться во всплывающем окне. | ||
@todo: Загрузку параметров по обращению к плагину | ||
@todo: Сохранение параметров без автозагрузки | ||
|
||
История версий: | ||
|
||
0.1.4 | ||
Добавлена страница настроек в админку | ||
Для работы плагина необходим активированный плагин Configengine | ||
0.0.6 | ||
форма для отправки сообщений | ||
управление параметрами плагина через config/config.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
<?php | ||
/** | ||
* @file ActionGuestbook.class.php | ||
* @description | ||
* | ||
* PHP Version 5.3 | ||
* | ||
* @package | ||
* @category | ||
* @plugin URI | ||
* @copyright 2013, Vadim Pshentsov. All Rights Reserved. | ||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0 | ||
* @author Vadim Pshentsov <[email protected]> | ||
* @created 18.04.13 | ||
*/ | ||
|
||
if (!class_exists('Action')) { | ||
die('This script can not be executed directly.'); | ||
} | ||
|
||
class PluginGuestbook_ActionGuestbook extends Action { | ||
|
||
protected $oViewerLocal; | ||
|
||
public function Init() { | ||
$this->oViewerLocal=$this->Viewer_GetLocalViewer(); | ||
$this->SetDefaultEvent('index'); | ||
} | ||
|
||
public function RegisterEvent() { | ||
//Common service actions and pages | ||
$this->AddEvent('description', 'ShowDescription'); | ||
$this->AddEvent('license', 'ShowLicense'); | ||
$this->AddEvent('donate', 'ShowDonate'); | ||
|
||
$this->AddEvent('index', 'EventDefault'); | ||
$this->AddEvent('admin', 'EventAdmin'); | ||
} | ||
|
||
protected function ShowDescription() { | ||
$this->Viewer_Assign('sShowTextTitle', $this->Lang_Get('plugin.guestbook.title').' : '.$this->Lang_Get('plugin.guestbook.description')); | ||
$this->Viewer_Assign('sURLBack', 'guestbook/admin'); | ||
$this->Viewer_Assign('sURLBackTitle', $this->Lang_Get('plugin.guestbook.goback')); | ||
$this->Viewer_Assign('sTextFile', Plugin::GetPath(__CLASS__).'/Readme.txt'); | ||
$this->SetTemplateAction('showtext'); | ||
} | ||
|
||
protected function ShowLicense() { | ||
$this->Viewer_Assign('sShowTextTitle', $this->Lang_Get('plugin.guestbook.title').' : '.$this->Lang_Get('plugin.guestbook.license')); | ||
$this->Viewer_Assign('sURLBack', 'guestbook/admin'); | ||
$this->Viewer_Assign('sURLBackTitle', $this->Lang_Get('plugin.guestbook.goback')); | ||
$this->Viewer_Assign('sTextFile', Plugin::GetPath(__CLASS__).'/License.txt'); | ||
$this->SetTemplateAction('showtext'); | ||
} | ||
|
||
protected function ShowDonate() { | ||
$this->Viewer_Assign('sShowTextTitle', $this->Lang_Get('plugin.guestbook.title').' : '.$this->Lang_Get('plugin.guestbook.donate')); | ||
$this->Viewer_Assign('sURLBack', 'guestbook/admin'); | ||
$this->Viewer_Assign('sURLBackTitle', $this->Lang_Get('plugin.guestbook.goback')); | ||
$this->Viewer_Assign('sHTMLFile', Plugin::GetPath(__CLASS__).'/Donate.html'); | ||
$this->SetTemplateAction('showtext'); | ||
} | ||
|
||
protected function SendMail($sMail, $sName, $sSubject, $sMailTemplate, $aTemplateAssign = array()) { | ||
|
||
foreach($aTemplateAssign as $key => $value) { | ||
$this->oViewerLocal->Assign($key, $value); | ||
} | ||
$sMessage = $this->oViewerLocal->Fetch($sMailTemplate); | ||
|
||
$this->Mail_SetAdress($sMail,$sName); | ||
$this->Mail_SetSubject($sSubject); | ||
$this->Mail_SetBody($sMessage); | ||
$this->Mail_setHTML(); | ||
$this->Mail_Send(); | ||
|
||
if(Config::Get('plugin.guestbook.email.log')) { | ||
$this->Logger_Notice("Mail sent to $sName <$sMail> with subject '$sSubject'"); | ||
// $this->Logger_Notice($sMessage); | ||
} | ||
|
||
} | ||
|
||
protected function Send() { | ||
$aMessage = getRequest('guestbook', array(), 'post'); | ||
|
||
$this->SendMail( | ||
Config::Get('plugin.guestbook.email.address'), | ||
Config::Get('plugin.guestbook.email.name'), | ||
Config::Get('plugin.guestbook.email.subject'), | ||
Plugin::GetTemplatePath(__CLASS__).'actions/ActionGuestbook/'.Config::Get('plugin.guestbook.email.template'), | ||
$aMessage | ||
); | ||
$this->Viewer_Assign('sGuestbookMessage', $this->Lang_Get('plugin.guestbook.thanx', Config::Get('plugin.guestbook.redirect'))); | ||
return true; | ||
} | ||
|
||
protected function EventDefault() { | ||
|
||
$bShowForm = true; | ||
|
||
if(isPost('guestbook_submit')) { | ||
$bShowForm = !$this->Send(); | ||
} | ||
|
||
$this->Viewer_Assign('bShowForm', $bShowForm); | ||
$this->SetTemplateAction('index'); | ||
} | ||
|
||
protected function EventAdmin() { | ||
if(!LS::Adm()) { | ||
return parent::EventNotFound(); | ||
} | ||
|
||
if(isPost('guestbook_save_config')) { | ||
$config = array(); | ||
$config['email'] = getRequest('email', array(), 'post'); | ||
$config['redirect'] = getRequest('redirect', array(), 'post'); | ||
|
||
//@todo Ïðîâåðêó ïàðàìåòðîâ | ||
|
||
Config::Set('plugin.guestbook.email', $config['email']); | ||
Config::Set('plugin.guestbook.redirect', $config['redirect']); | ||
|
||
ConfigEngine::SaveMyConfig($this); | ||
} | ||
|
||
$this->Viewer_Assign('sActionGuestbookMenuTemplate', Plugin::GetTemplatePath(__CLASS__).'actions/ActionGuestbook/admin/menu.tpl'); | ||
$this->Viewer_Assign('bShowDonateLink', Config::Get('plugin.guestbook.show_donate_link')); | ||
$this->Viewer_Assign('aGuestbookConfig', Config::Get('plugin.guestbook')); | ||
$this->SetTemplateAction('admin/index'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
/** | ||
* @file config.php | ||
* @description | ||
* | ||
* PHP Version 5.3 | ||
* | ||
* @package | ||
* @category | ||
* @plugin URI | ||
* @copyright 2013, Vadim Pshentsov. All Rights Reserved. | ||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0 | ||
* @author Vadim Pshentsov <[email protected]> | ||
* @created 18.04.13 | ||
*/ | ||
|
||
$config = array(); | ||
|
||
//plugin routing | ||
$config['$root$']['router']['page']['guestbook'] = 'PluginGuestbook_ActionGuestbook'; | ||
|
||
$config['redirect'] = array( | ||
'url' => '/', | ||
'title' => 'Вернуться', | ||
'text' => '<small>На главную ></small>', | ||
); | ||
|
||
$config['email'] = array( | ||
'address' => '[email protected]', | ||
'name' => 'Vadim', | ||
'subject' => 'Guestbook, plugin for Livestreet', | ||
'template' => 'mail.tpl', | ||
'log' => true, | ||
); | ||
|
||
$config['show_donate_link'] = 1; | ||
|
||
return $config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<plugin> | ||
<name> | ||
<lang name="default">Guestbook</lang> | ||
<lang name="russian">Гостевая книга</lang> | ||
</name> | ||
<author> | ||
<lang name="default">pshentsoff</lang> | ||
</author> | ||
<homepage>http://pshentsoff.ru</homepage> | ||
<version>0.1.4</version> | ||
<requires> | ||
<livestreet>1.x</livestreet> | ||
<plugins> | ||
<plugin>configengine</plugin> | ||
</plugins> | ||
<system> | ||
<php>5.3</php> | ||
</system> | ||
</requires> | ||
<description> | ||
<lang name="default">Site guestbook</lang> | ||
<lang name="russian">Гостевая книга.</lang> | ||
</description> | ||
<settings>{guestbook/admin}</settings> | ||
<delegate> | ||
<module></module> | ||
<action></action> | ||
<template></template> | ||
<entity></entity> | ||
</delegate> | ||
</plugin> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
/** | ||
* @file english.php | ||
* @description | ||
* | ||
* PHP Version 5.3 | ||
* | ||
* @package Gusetbook plugin | ||
* @category Language | ||
* @plugin URI | ||
* @copyright 2013, Vadim Pshentsov. All Rights Reserved. | ||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0 | ||
* @author Vadim Pshentsov <[email protected]> | ||
* @created 22.04.13 | ||
*/ | ||
|
||
return array( | ||
|
||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
/** | ||
* @file russian.php | ||
* @description | ||
* | ||
* PHP Version 5.3 | ||
* | ||
* @package Gusetbook plugin | ||
* @category Language | ||
* @plugin URI | ||
* @copyright 2013, Vadim Pshentsov. All Rights Reserved. | ||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0 | ||
* @author Vadim Pshentsov <[email protected]> | ||
* @created 22.04.13 | ||
*/ | ||
|
||
return array( | ||
|
||
'title' => 'Гостевая книга', | ||
'admin' => 'Настройки', | ||
'description' => 'Описание', | ||
'license' => 'Лицензия', | ||
'donate' => 'Пожертвования', | ||
'goback' => 'Вернуться', | ||
'nodata' => 'Нет данных', | ||
|
||
'thanx' => "Спасибо Вам за Ваш отзыв. <a href=\"%%url%%\" title=\"%%title%%\">%%text%%</a>", | ||
'please_select' => 'Выберите, пожалуйста...', | ||
'ask_question' => 'Задайте свой вопрос', | ||
'your_name' => 'Пожалуйста, представьтесь', | ||
'your_mail' => 'Ваш Email (не публикуется)', | ||
'your_question' => 'Ваш вопрос', | ||
'send_question' => 'Отправить вопрос', | ||
|
||
'buttons' => array( | ||
'save_config' => 'Сохранить настройки', | ||
), | ||
|
||
'config' => array( | ||
|
||
'redirect' => array( | ||
'header' => 'Перенаправление после отправки', | ||
'url' => 'URL', | ||
'title' => 'Title ссылки', | ||
'text' => 'Текст', | ||
), | ||
|
||
'email' => array( | ||
'header' => 'Настройки сообщений', | ||
'address' => 'EMail', | ||
'name' => 'Имя', | ||
'subject' => 'Тема', | ||
'template' => 'Шаблон', | ||
'log' => 'Вести лог', | ||
), | ||
), | ||
); |
Oops, something went wrong.