This repository has been archived by the owner on Dec 28, 2023. It is now read-only.
-
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.
Merge pull request #299 from mirko-pagliai/develop
Develop
- Loading branch information
Showing
66 changed files
with
382 additions
and
224 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
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,60 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
/** | ||
* This file is part of me-cms. | ||
* | ||
* Licensed under The MIT License | ||
* For full copyright and license information, please see the LICENSE.txt | ||
* Redistributions of files must retain the above copyright notice. | ||
* | ||
* @copyright Copyright (c) Mirko Pagliai | ||
* @link https://github.com/mirko-pagliai/me-cms | ||
* @license https://opensource.org/licenses/mit-license.php MIT License | ||
* @since 2.31.7 | ||
*/ | ||
|
||
namespace MeCms\View\Helper; | ||
|
||
use Cake\View\Helper; | ||
|
||
/** | ||
* PriorityBadge helper | ||
* @property \MeTools\View\Helper\HtmlHelper $Html | ||
*/ | ||
class PriorityBadgeHelper extends Helper | ||
{ | ||
/** | ||
* Helpers | ||
* @var array | ||
*/ | ||
public $helpers = ['MeTools.Html']; | ||
|
||
/** | ||
* Creates a "priority" badge | ||
* @param int $priority Priority value | ||
* @return string Html string | ||
*/ | ||
public function badge(int $priority): string | ||
{ | ||
switch ($priority) { | ||
case '1': | ||
[$priority, $class, $tooltip] = ['1', 'priority-verylow', __d('me_cms', 'Very low')]; | ||
break; | ||
case '2': | ||
[$priority, $class, $tooltip] = ['2', 'priority-low', __d('me_cms', 'Low')]; | ||
break; | ||
case '4': | ||
[$priority, $class, $tooltip] = ['4', 'priority-high', __d('me_cms', 'High')]; | ||
break; | ||
case '5': | ||
[$priority, $class, $tooltip] = ['5', 'priority-veryhigh', __d('me_cms', 'Very high')]; | ||
break; | ||
default: | ||
[$priority, $class, $tooltip] = ['3', 'priority-normal', __d('me_cms', 'Normal')]; | ||
break; | ||
} | ||
|
||
return $this->Html->badge($priority, compact('class', 'tooltip')); | ||
} | ||
} |
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
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
Oops, something went wrong.