]> _ Git - cubist_cms-back.git/commitdiff
wait #5294 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 30 May 2022 13:35:52 +0000 (15:35 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 30 May 2022 13:35:52 +0000 (15:35 +0200)
src/app/Magic/Form.php
src/resources/views/form/form.blade.php

index 8ddf68bc519e34158a803c5351e3f4a836b6bfce..932f0cec83e53e1a233ef31032998767db45638e 100644 (file)
@@ -17,7 +17,7 @@ class Form extends SubForm
     protected $_csrf = true;
     protected $_title = '';
     protected $_submitLabel = 'save';
-    protected $_submitIcon='la-save';
+    protected $_submitIcon = 'la-save';
     protected $crud;
 
     public function __construct($action = '', $method = 'post')
@@ -173,7 +173,13 @@ class Form extends SubForm
      */
     public function getSubmitIcon(): string
     {
-        return $this->_submitIcon;
+        $res = $this->_submitIcon;
+        $e = explode(' ', $res);
+        $la = ['la', 'las', 'lab'];
+        if (!count(array_intersect($e, $la))) {
+            $res = 'la ' . $res;
+        }
+        return $res;
     }
 
     /**
index 11a0d0cb08acbf52ae23420bc3511e91edf4ab85..7d0e9c411c2a8ce0e3a1430f85cf3922a65d214e 100644 (file)
@@ -13,7 +13,7 @@ start_measure('Render form '.$form->getTitle());
     @endif
     @include('crud::form_content')
     <button type="submit" class="btn btn-success">
-        <span class="la {{$form->getSubmitIcon()}}" role="presentation" aria-hidden="true"></span> &nbsp;
+        <span class="{{$form->getSubmitIcon()}}" role="presentation" aria-hidden="true"></span> &nbsp;
         <span data-value="save_and_back">{{$form->getSubmitLabel()}}</span>
     </button>
 </form>