22/**
33 * @package yii2-editable
44 * @author Kartik Visweswaran <[email protected] > 5- * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2021
6- * @version 1.7.9
5+ * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2022
6+ * @version 1.8.0
77 */
88
99namespace kartik \editable ;
1212use Exception ;
1313use kartik \base \Config ;
1414use kartik \base \InputWidget ;
15+ use kartik \base \Lib ;
1516use kartik \popover \PopoverX ;
1617use Yii ;
1718use yii \base \InvalidConfigException ;
@@ -602,7 +603,7 @@ public function registerAssets()
602603 if (!empty ($ this ->pjaxContainerId )) {
603604 EditablePjaxAsset::register ($ view );
604605 $ toggleButton = $ this ->_popoverOptions ['toggleButton ' ]['id ' ];
605- $ initPjaxVar = 'kvEdPjax_ ' . str_replace ('- ' , '_ ' , $ this ->_popoverOptions ['options ' ]['id ' ]);
606+ $ initPjaxVar = 'kvEdPjax_ ' . Lib:: str_replace ('- ' , '_ ' , $ this ->_popoverOptions ['options ' ]['id ' ]);
606607 $ view ->registerJs ("var {$ initPjaxVar } = false; " , View::POS_HEAD );
607608 if ($ this ->asPopover ) {
608609 $ js = "initEditablePjax(' {$ this ->pjaxContainerId }', ' {$ toggleButton }', ' {$ initPjaxVar }'); " ;
@@ -836,8 +837,8 @@ protected function initOptions()
836837 }
837838 if ($ this ->header == null ) {
838839 $ attribute = $ this ->attribute ;
839- if (strpos ($ attribute , '] ' ) > 0 ) {
840- $ tags = explode ('] ' , $ attribute );
840+ if (Lib:: strpos ($ attribute , '] ' ) > 0 ) {
841+ $ tags = Lib:: explode ('] ' , $ attribute );
841842 $ attribute = array_pop ($ tags );
842843 }
843844 $ this ->_popoverOptions ['header ' ] = $ this ->preHeader .
@@ -896,7 +897,7 @@ protected function renderActionButtons()
896897 '{reset} ' => Html::button ($ resetLabel , $ resetOpts ),
897898 '{submit} ' => Html::button ($ submitLabel , $ submitOpts ),
898899 ];
899- return strtr ($ this ->buttonsTemplate , $ params );
900+ return Lib:: strtr ($ this ->buttonsTemplate , $ params );
900901 }
901902
902903 /**
@@ -906,7 +907,7 @@ protected function renderActionButtons()
906907 */
907908 protected function renderFooter ()
908909 {
909- return strtr ($ this ->footer , ['{loading} ' => self ::LOAD_INDICATOR , '{buttons} ' => $ this ->renderActionButtons ()]);
910+ return Lib:: strtr ($ this ->footer , ['{loading} ' => self ::LOAD_INDICATOR , '{buttons} ' => $ this ->renderActionButtons ()]);
910911 }
911912
912913 /**
@@ -926,11 +927,11 @@ protected function parseTemplate($template)
926927 '{close} ' => $ this ->inlineSettings ['closeButton ' ],
927928 '{loading} ' => self ::LOAD_INDICATOR ,
928929 ];
929- $ out = strtr ($ this ->inlineSettings [$ template ], $ params );
930- if (strpos ($ out , '{buttons} ' ) === false ) {
930+ $ out = Lib:: strtr ($ this ->inlineSettings [$ template ], $ params );
931+ if (Lib:: strpos ($ out , '{buttons} ' ) === false ) {
931932 return $ out ;
932933 }
933- return strtr ($ out , ['{buttons} ' => $ this ->renderActionButtons ()]);
934+ return Lib:: strtr ($ out , ['{buttons} ' => $ this ->renderActionButtons ()]);
934935 }
935936
936937 /**
0 commit comments