-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
Showing
55 changed files
with
1,429 additions
and
943 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,29 @@ | ||
Notification Center Changelog | ||
=========================== | ||
|
||
Version 1.3.0 (2015-09-03) | ||
--------------------------------- | ||
|
||
### New | ||
- Added a sendNotificationMessage hook (#72) | ||
- Allow recipient token to contain a list of recipients. (#75) | ||
|
||
### Fixed | ||
- Do not add a new line if file storage mode append but existing file was empty | ||
|
||
|
||
Version 1.3.0-rc1 (2015-07-07) | ||
--------------------------------- | ||
|
||
### New | ||
- The Notification Center now provides a queue gateway that buffers messages and sends them based on cron job settings (#63) | ||
- The "store to file" gateway now supports appending to an already existing file (#65) | ||
- InsertTags as well as Simple Tokens are now allowed in sender e-mail name and sender e-mail address fields as well (#40 and #58) | ||
- Added support for file uploads in form generator fields that can now use the upload attachment token (#39) | ||
|
||
|
||
Versions previous to 1.3.0-rc1 | ||
--------------------------------- | ||
|
||
Changelog was not maintained in previous versions. | ||
Try to use the git history for details. |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,18 @@ | ||
#!/usr/bin/env php | ||
|
||
<?php | ||
|
||
/** | ||
* Use as follows: | ||
* $ queue -s <queue_gateway_id> -n <number of messages to be sent> | ||
* | ||
* E.g. to send 15 messages of source queue gateway ID 2, do this: | ||
* | ||
* $ queue -s 2 -n 15 | ||
*/ | ||
|
||
define('TL_MODE', 'FE'); | ||
require __DIR__ . '/../../../initialize.php'; | ||
$queueManager = $GLOBALS['NOTIFICATION_CENTER']['QUEUE_MANAGER']; | ||
|
||
$queueManager->sendFromQueue($argv[2], $argv[4]); |
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 |
---|---|---|
@@ -1,32 +1,17 @@ | ||
<?php | ||
|
||
/** | ||
* Contao Open Source CMS | ||
* Copyright (C) 2005-2011 Leo Feyer | ||
* notification_center extension for Contao Open Source CMS | ||
* | ||
* Formerly known as TYPOlight Open Source CMS. | ||
* | ||
* This program is free software: you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation, either | ||
* version 3 of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this program. If not, please visit the Free | ||
* Software Foundation website at <http://www.gnu.org/licenses/>. | ||
* | ||
* PHP version 5 | ||
* @copyright terminal42 gmbh 2014 | ||
* @copyright Copyright (c) 2008-2015, terminal42 | ||
* @author terminal42 gmbh <[email protected]> | ||
* @license LGPL | ||
*/ | ||
|
||
namespace NotificationCenter; | ||
|
||
use NotificationCenter\Util\Form; | ||
|
||
class tl_form extends \Backend | ||
{ | ||
|
||
|
@@ -105,6 +90,11 @@ public function generateTokens(array $arrData, array $arrForm, array $arrFiles, | |
// Administrator e-mail | ||
$arrTokens['admin_email'] = $GLOBALS['TL_ADMIN_EMAIL']; | ||
|
||
// Upload fields | ||
foreach ($arrFiles as $fieldName => $file) { | ||
$arrTokens['form_' . $fieldName] = Form::getFileUploadPathForToken($file); | ||
} | ||
|
||
return $arrTokens; | ||
} | ||
|
||
|
@@ -125,13 +115,17 @@ public function flatten($varValue, $strKey, &$arrData) | |
} | ||
|
||
$blnAssoc = array_is_assoc($varValue); | ||
$arrValues = array(); | ||
|
||
foreach ($varValue as $k => $v) { | ||
if ($blnAssoc && !is_array($v)) { | ||
$this->flatten($v, $strKey.'_'.$k, $arrData); | ||
} else { | ||
$arrData[$strKey.'_'.$v] = '1'; | ||
$arrValues[] = $v; | ||
} | ||
} | ||
|
||
$arrData[$strKey] = implode(', ', $arrValues); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,27 +1,10 @@ | ||
<?php | ||
|
||
/** | ||
* Contao Open Source CMS | ||
* Copyright (C) 2005-2011 Leo Feyer | ||
* notification_center extension for Contao Open Source CMS | ||
* | ||
* Formerly known as TYPOlight Open Source CMS. | ||
* | ||
* This program is free software: you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation, either | ||
* version 3 of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this program. If not, please visit the Free | ||
* Software Foundation website at <http://www.gnu.org/licenses/>. | ||
* | ||
* PHP version 5 | ||
* @copyright terminal42 gmbh 2014 | ||
* @copyright Copyright (c) 2008-2015, terminal42 | ||
* @author terminal42 gmbh <[email protected]> | ||
* @license LGPL | ||
*/ | ||
|
||
|
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 |
---|---|---|
@@ -1,32 +1,18 @@ | ||
<?php | ||
|
||
/** | ||
* Contao Open Source CMS | ||
* Copyright (C) 2005-2011 Leo Feyer | ||
* notification_center extension for Contao Open Source CMS | ||
* | ||
* Formerly known as TYPOlight Open Source CMS. | ||
* | ||
* This program is free software: you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation, either | ||
* version 3 of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this program. If not, please visit the Free | ||
* Software Foundation website at <http://www.gnu.org/licenses/>. | ||
* | ||
* PHP version 5 | ||
* @copyright terminal42 gmbh 2014 | ||
* @copyright Copyright (c) 2008-2015, terminal42 | ||
* @author terminal42 gmbh <[email protected]> | ||
* @license LGPL | ||
*/ | ||
|
||
namespace NotificationCenter; | ||
|
||
use NotificationCenter\Gateway\LabelCallbackInterface; | ||
use NotificationCenter\Model\Gateway; | ||
|
||
class tl_nc_gateway extends \Backend | ||
{ | ||
/** | ||
|
@@ -65,4 +51,42 @@ public function checkFileServerConnection(\DataContainer $dc) | |
|
||
\Message::addConfirmation($GLOBALS['TL_LANG']['tl_nc_gateway']['ftp_confirm']); | ||
} | ||
} | ||
|
||
/** | ||
* Gets the back end list label | ||
* | ||
* @param array $row | ||
* @param string $label | ||
* @param \DataContainer $dc | ||
* @param array $args | ||
* | ||
* @return string | ||
*/ | ||
public function executeLabelCallback($row, $label, \DataContainer $dc, $args) | ||
{ | ||
$model = Gateway::findByPk($row['id']); | ||
$gateway = $model->getGateway(); | ||
|
||
if ($gateway instanceof LabelCallbackInterface) { | ||
|
||
return $gateway->getLabel($row, $label,$dc, $args); | ||
} | ||
|
||
return $label; | ||
} | ||
|
||
/** | ||
* Gets the cron job explanation | ||
* | ||
* @param \DataContainer $dc | ||
*/ | ||
public function queueCronjobExplanation(\DataContainer $dc) | ||
{ | ||
return sprintf('<div style="color: #4b85ba; | ||
background: #eff5fa; | ||
padding: 10px; | ||
border-radius: 3px;">%s</div>', | ||
str_replace('{gateway_id}', $dc->id, $GLOBALS['TL_LANG']['queueCronjobExplanation']) | ||
); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,38 +1,44 @@ | ||
<?php | ||
|
||
/** | ||
* Contao Open Source CMS | ||
* Copyright (C) 2005-2011 Leo Feyer | ||
* notification_center extension for Contao Open Source CMS | ||
* | ||
* Formerly known as TYPOlight Open Source CMS. | ||
* | ||
* This program is free software: you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation, either | ||
* version 3 of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this program. If not, please visit the Free | ||
* Software Foundation website at <http://www.gnu.org/licenses/>. | ||
* | ||
* PHP version 5 | ||
* @copyright terminal42 gmbh 2014 | ||
* @copyright Copyright (c) 2008-2015, terminal42 | ||
* @author terminal42 gmbh <[email protected]> | ||
* @license LGPL | ||
*/ | ||
|
||
namespace NotificationCenter; | ||
|
||
use NotificationCenter\Model\Gateway; | ||
use NotificationCenter\Model\Language; | ||
use NotificationCenter\Model\Notification; | ||
|
||
class tl_nc_language extends \Backend | ||
{ | ||
|
||
/** | ||
* Modifies the palette for the queue gateway so it takes the one from the | ||
* target gateway | ||
* | ||
* @param \DataContainer $dc | ||
*/ | ||
public function modifyPalette(\DataContainer $dc) | ||
{ | ||
if (\Input::get('act') != 'edit') { | ||
return; | ||
} | ||
|
||
$language = Language::findByPk($dc->id); | ||
$message = $language->getRelated('pid'); | ||
$gateway = $message->getRelated('gateway'); | ||
|
||
if ($gateway !== null && $gateway->type == 'queue') { | ||
$targetGateway = Gateway::findByPk($gateway->queue_targetGateway); | ||
$GLOBALS['TL_DCA']['tl_nc_language']['palettes']['queue'] = | ||
$GLOBALS['TL_DCA']['tl_nc_language']['palettes'][$targetGateway->type]; | ||
} | ||
} | ||
|
||
/** | ||
* Save gateway type in language when creating new record | ||
* @param string | ||
|
Oops, something went wrong.