Addes flash messages after printing note, quick note or cinema repertoire. #11

Merged
krzysiej merged 3 commits from issue-7 into master 2018-04-15 15:44:19 +02:00
2 changed files with 6 additions and 6 deletions
Showing only changes of commit 162a736f12 - Show all commits

View File

@@ -160,17 +160,20 @@ class Main extends Controller
/**
* post::/print/{id}
* @param Request $request
* @param $id
* @return \Illuminate\Http\RedirectResponse
*/
public function printText($id)
public function printText(Request $request, $id)
{
$note = DB::table('note')->where('id', $id)->first();
$this->paper->sendPrint($note->topic, $note->text, $note->icon);
$request->session()->flash('status', 'Wydrukowano notatkę: ' . $note->topic . '!');
return back();
}
private function templateReplace($input){
private function templateReplace($input)
{
return str_replace(['[d]', '[m]', '[y]', '[h]', '[i]', '[s]'],
[date('d'), date('m'), date('Y'), date('H'), date('i'), date('s')],

View File

@@ -12,7 +12,6 @@ use Mockery\Exception;
class Paper
{
private $imageDirectory = 'large/';
private $imageDirectorySmall = 'small/';
private $printer;
@@ -71,7 +70,7 @@ class Paper
$htmlToPos = new HtmlToPos();
$this->printer->text($htmlToPos->convert($text));
$this->printer->feed(4);
$this->printer->feed(3);
}
/**
@@ -84,8 +83,6 @@ class Paper
*/
public function getIcons()
{
// $icons = array_diff(scandir($this->imageDirectorySmall), ['.', '..']);
$icons = ["address-card-o","anchor","archive-3","at","balance-scale","ban","bar-chart-o","barcode","battery-empty","battery-full","battery-half","battery-quarter","battery-three-quarters","bed","beer","bell-o","bell-slash-o","bicycle","birthday-cake","bolt","bomb","book","bug","building-o","bullhorn","bus","camera","car","chain","chat-2","check","cloud","code","coffee","cog","cutlery","dashboard","database","diamond","dollar","dribbble","envelope-o","envira","exclamation-triangle","female","file-text-o","film","fingerprint","fire-extinguisher","fire","flag-o","flask","floppy-o","folder-o","folder-open-o","frown-o","gamepad","gift","git","glass","graduation-cap","grav","group","hand-o-left","heart-o","home","lemon-o","lightbulb-o","list-alt","location-arrow","lock","male","map-1","map-marker","microchip","money","moon-o","music","paper-plane","paperclip","paw","pencil","phone","pie-chart","piggy-bank","plane","question-circle-o","rocket","search","ship","shopping-cart","smile-o","snowflake-o","steam","subway","success","support","thermometer-2","thumbs-o-down","thumbs-o-up","ticket","times","trash-o","tree","trophy","truck","umbrella","usd","warning","wifi","wpexplorer","wrench","youtube-play"];