-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [ADD] Add Public Link notifications
- Loading branch information
Showing
11 changed files
with
1,269 additions
and
1,010 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
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
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
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,102 @@ | ||
<?php | ||
/** | ||
* sysPass | ||
* | ||
* @author nuxsmin | ||
* @link http://syspass.org | ||
* @copyright 2012-2017, Rubén Domínguez nuxsmin@$syspass.org | ||
* | ||
* This file is part of sysPass. | ||
* | ||
* sysPass is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* sysPass 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 General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with sysPass. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
namespace SP\Core\Messages; | ||
|
||
/** | ||
* Class MessageBase | ||
* | ||
* @package SP\Core\Messages | ||
*/ | ||
abstract class MessageBase implements MessageInterface | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
protected $title; | ||
/** | ||
* @var string | ||
*/ | ||
protected $footer; | ||
/** | ||
* @var array | ||
*/ | ||
protected $description = []; | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getTitle() | ||
{ | ||
return $this->title; | ||
} | ||
|
||
/** | ||
* @param string $title | ||
*/ | ||
public function setTitle($title) | ||
{ | ||
$this->title = $title; | ||
} | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function getDescription() | ||
{ | ||
return $this->description; | ||
} | ||
|
||
/** | ||
* @param array $description | ||
*/ | ||
public function setDescription(array $description) | ||
{ | ||
$this->description = $description; | ||
} | ||
|
||
/** | ||
* @param string $description | ||
*/ | ||
public function addDescription($description) | ||
{ | ||
$this->description[] = $description; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getFooter() | ||
{ | ||
return $this->footer; | ||
} | ||
|
||
/** | ||
* @param string $footer | ||
*/ | ||
public function setFooter($footer) | ||
{ | ||
$this->footer = $footer; | ||
} | ||
} |
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,47 @@ | ||
<?php | ||
/** | ||
* sysPass | ||
* | ||
* @author nuxsmin | ||
* @link http://syspass.org | ||
* @copyright 2012-2017, Rubén Domínguez nuxsmin@$syspass.org | ||
* | ||
* This file is part of sysPass. | ||
* | ||
* sysPass is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* sysPass 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 General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with sysPass. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
namespace SP\Core\Messages; | ||
|
||
/** | ||
* Interface MessageInterface | ||
* | ||
* @package SP\Core\Messages | ||
*/ | ||
interface MessageInterface | ||
{ | ||
/** | ||
* Componer un mensaje en formato texto | ||
* | ||
* @return string | ||
*/ | ||
public function composeText(); | ||
|
||
/** | ||
* Componer un mensaje en formato HTML | ||
* | ||
* @return mixed | ||
*/ | ||
public function composeHtml(); | ||
} |
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,63 @@ | ||
<?php | ||
/** | ||
* sysPass | ||
* | ||
* @author nuxsmin | ||
* @link http://syspass.org | ||
* @copyright 2012-2017, Rubén Domínguez nuxsmin@$syspass.org | ||
* | ||
* This file is part of sysPass. | ||
* | ||
* sysPass is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* sysPass 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 General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with sysPass. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
namespace SP\Core\Messages; | ||
|
||
/** | ||
* Class NoticeMessage | ||
* | ||
* @package SP\Core\Messages | ||
*/ | ||
class NoticeMessage extends MessageBase | ||
{ | ||
/** | ||
* Componer un mensaje en formato HTML | ||
* | ||
* @return string | ||
*/ | ||
public function composeHtml() | ||
{ | ||
$message[] = '<div class="notice-message">'; | ||
$message[] = '<h1>' . $this->title . '</h1>'; | ||
$message[] = '<p>' . implode('<br>', $this->description) . '</p>'; | ||
$message[] = '<footer>' . $this->footer . '</footer>'; | ||
$message[] = '</div>'; | ||
|
||
return implode($message); | ||
} | ||
|
||
/** | ||
* Componer un mensaje en formato texto | ||
* | ||
* @return string | ||
*/ | ||
public function composeText() | ||
{ | ||
$message[] = $this->title; | ||
$message[] = implode(PHP_EOL, $this->description); | ||
$message[] = $this->footer; | ||
|
||
return implode(PHP_EOL, $message); | ||
} | ||
} |
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
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
Oops, something went wrong.