2626use PhpMyAdmin \Url ;
2727use PhpMyAdmin \Util ;
2828use Throwable ;
29+ use Twig \Attribute \AsTwigFunction ;
2930use Twig \Error \LoaderError ;
3031use Twig \Error \RuntimeError ;
3132use Twig \Error \SyntaxError ;
@@ -92,6 +93,7 @@ public static function showCopyToClipboard(string $text): string
9293 *
9394 * @return string link or empty string
9495 */
96+ #[AsTwigFunction('link_to_var_documentation ' , isSafe: ['html ' ])]
9597 public static function linkToVarDocumentation (
9698 string $ name ,
9799 bool $ useMariaDB = false ,
@@ -109,6 +111,7 @@ public static function linkToVarDocumentation(
109111 *
110112 * @param string $message the message for the tooltip
111113 */
114+ #[AsTwigFunction('show_hint ' , isSafe: ['html ' ])]
112115 public static function showHint (string $ message ): string
113116 {
114117 $ classClause = Config::getInstance ()->settings ['ShowHint ' ] ? ' class="pma_hint" ' : '' ;
@@ -165,6 +168,7 @@ public static function getDbLink(string $database): string
165168 *
166169 * @return string an html snippet
167170 */
171+ #[AsTwigFunction('get_icon ' , isSafe: ['html ' ])]
168172 public static function getIcon (
169173 string $ icon ,
170174 string $ alternate = '' ,
@@ -638,6 +642,7 @@ public static function getMessage(
638642 *
639643 * @return string the html link
640644 */
645+ #[AsTwigFunction('show_php_docu ' , isSafe: ['html ' ])]
641646 public static function showPHPDocumentation (string $ target ): string
642647 {
643648 return self ::showDocumentationLink (Core::getPHPDocLink ($ target ));
@@ -867,6 +872,7 @@ public static function mysqlDie(
867872 *
868873 * @return string an html IMG tag
869874 */
875+ #[AsTwigFunction('get_image ' , isSafe: ['html ' ])]
870876 public static function getImage (string $ image , string $ alternate = '' , array $ attributes = []): string
871877 {
872878 $ alternate = htmlspecialchars ($ alternate );
@@ -917,6 +923,7 @@ public static function getImage(string $image, string $alternate = '', array $at
917923 *
918924 * @return string the results to be echoed or saved in an array
919925 */
926+ #[AsTwigFunction('link_or_button ' , isSafe: ['html ' ])]
920927 public static function linkOrButton (
921928 string $ urlPath ,
922929 array |null $ urlParams ,
@@ -1014,6 +1021,7 @@ public static function linkOrButton(
10141021 *
10151022 * @todo use $pos from $_url_params
10161023 */
1024+ #[AsTwigFunction('get_list_navigator ' , isSafe: ['html ' ])]
10171025 public static function getListNavigator (
10181026 int $ count ,
10191027 int $ pos ,
@@ -1061,6 +1069,7 @@ public static function getListNavigator(
10611069 *
10621070 * @return string the formatted sql
10631071 */
1072+ #[AsTwigFunction('format_sql ' , isSafe: ['html ' ])]
10641073 public static function formatSql (string $ sqlQuery , bool $ truncate = false ): string
10651074 {
10661075 $ config = Config::getInstance ();
@@ -1080,6 +1089,7 @@ public static function formatSql(string $sqlQuery, bool $truncate = false): stri
10801089 *
10811090 * @param string $selected The value to mark as selected in HTML mode
10821091 */
1092+ #[AsTwigFunction('get_supported_datatypes ' , isSafe: ['html ' ])]
10831093 public static function getSupportedDatatypes (string $ selected ): string
10841094 {
10851095 // NOTE: the SELECT tag is not included in this snippet.
0 commit comments