-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '2.x' of https://github.com/GemsTracker/gemstracker-library
- Loading branch information
Showing
4 changed files
with
77 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace Gems\Snippets\Token; | ||
|
||
use Zalt\Snippets\MessageableSnippetAbstract; | ||
|
||
/** | ||
* Token snippet to return when a completed token is required but the selected | ||
* token is not completed. | ||
*/ | ||
class TokenNotCompletedSnippet extends MessageableSnippetAbstract | ||
{ | ||
/** | ||
* Optional: id of the selected token to show | ||
* | ||
* Can be derived from $request or $token | ||
* | ||
* @var string | ||
*/ | ||
protected $tokenId; | ||
|
||
/** | ||
* Create the snippets content. | ||
* | ||
* @return mixed Something that can be rendered | ||
*/ | ||
public function getHtmlOutput() | ||
{ | ||
$messenger = $this->getMessenger(); | ||
if ($this->tokenId) { | ||
$messenger->addMessage(sprintf($this->_('Token %s not completed.'), $this->tokenId)); | ||
} else { | ||
$messenger->addMessage($this->_('No token specified.')); | ||
} | ||
} | ||
} |
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