forked from modxcms/evolution
-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] Check Role and Blade directive.
- Loading branch information
Showing
3 changed files
with
99 additions
and
55 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 |
---|---|---|
@@ -1,50 +1,59 @@ | ||
<?php namespace EvolutionCMS\Support; | ||
|
||
class BladeDirective | ||
{ | ||
|
||
public static function evoParser($content) : string | ||
{ | ||
return '<?php echo evo_parser(' . $content . ');?>'; | ||
} | ||
|
||
public static function evoLang($key) : string | ||
{ | ||
return '<?php echo ManagerTheme::getLexicon(' . $key . ');?>'; | ||
} | ||
|
||
public static function evoStyle($key) : string | ||
{ | ||
return '<?php echo ManagerTheme::getStyle(' . $key . ');?>'; | ||
} | ||
|
||
public static function evoAdminLang() : string | ||
{ | ||
return '<?php echo ManagerTheme::getLangName();?>'; | ||
} | ||
|
||
public static function evoCharset() : string | ||
{ | ||
return '<?php echo ManagerTheme::getCharset();?>'; | ||
} | ||
|
||
public static function evoAdminThemeUrl() : string | ||
{ | ||
return '<?php echo ManagerTheme::getThemeUrl();?>'; | ||
} | ||
|
||
public static function evoAdminThemeName() : string | ||
{ | ||
return '<?php echo ManagerTheme::getTheme();?>'; | ||
} | ||
|
||
public static function makeUrl($id) : string | ||
{ | ||
return '<?php echo app("UrlProcessor")->makeUrlWithString(' . $id . ');?>'; | ||
} | ||
public static function csrf() : string | ||
{ | ||
return '<?php echo csrf_field();?>'; | ||
} | ||
|
||
} | ||
<?php namespace EvolutionCMS\Support; | ||
|
||
class BladeDirective | ||
{ | ||
|
||
public static function evoParser($content): string | ||
{ | ||
return '<?php echo evo_parser(' . $content . ');?>'; | ||
} | ||
|
||
public static function evoLang($key): string | ||
{ | ||
return '<?php echo ManagerTheme::getLexicon(' . $key . ');?>'; | ||
} | ||
|
||
public static function evoStyle($key): string | ||
{ | ||
return '<?php echo ManagerTheme::getStyle(' . $key . ');?>'; | ||
} | ||
|
||
public static function evoAdminLang(): string | ||
{ | ||
return '<?php echo ManagerTheme::getLangName();?>'; | ||
} | ||
|
||
public static function evoCharset(): string | ||
{ | ||
return '<?php echo ManagerTheme::getCharset();?>'; | ||
} | ||
|
||
public static function evoAdminThemeUrl(): string | ||
{ | ||
return '<?php echo ManagerTheme::getThemeUrl();?>'; | ||
} | ||
|
||
public static function evoAdminThemeName(): string | ||
{ | ||
return '<?php echo ManagerTheme::getTheme();?>'; | ||
} | ||
|
||
public static function makeUrl($id): string | ||
{ | ||
return '<?php echo app("UrlProcessor")->makeUrlWithString(' . $id . ');?>'; | ||
} | ||
public static function csrf(): string | ||
{ | ||
return '<?php echo csrf_field();?>'; | ||
} | ||
|
||
public static function evoRole($role = ''): string | ||
{ | ||
return "<?php if(evo_role($role)): ?>"; | ||
} | ||
|
||
public static function evoEndRole(): string | ||
{ | ||
return '<?php endif; ?>'; | ||
} | ||
} |