@@ -15,6 +15,10 @@ class Setting extends Model
1515 */
1616 protected $ table = 'settings ' ;
1717
18+ protected $ fillable = [
19+ 'id ' , 'group_id ' , 'key ' , 'type ' , 'options ' , 'label ' , 'value ' , 'order ' , 'system '
20+ ];
21+
1822 /**
1923 * Tell the Model this Table doesn't support timestamps.
2024 *
@@ -45,28 +49,28 @@ public function getListValueAttribute()
4549 switch ($ this ->type ) {
4650 case 'image ' :
4751 if (!empty ($ this ->value )) {
48- $ value = '<a href=" ' .asset ('storage/ ' .$ this ->value ).'" title="View " target="_blank">View </a> ' ;
52+ $ value = '<a href=" ' .asset ('storage/ ' .$ this ->value ).'" title=" ' . __ ( ' app.settings.view ' ). ' " target="_blank"> ' . __ ( ' app.settings.view ' ). ' </a> ' ;
4953 } else {
50- $ value = ' - not set - ' ;
54+ $ value = __ ( ' app.options.none ' ) ;
5155 }
5256 break ;
5357 case 'boolean ' :
5458 if ((bool )$ this ->value === true ) {
55- $ value = ' Yes ' ;
59+ $ value = __ ( ' app.options.yes ' ) ;
5660 } else {
57- $ value = ' No ' ;
61+ $ value = __ ( ' app.options.no ' ) ;
5862 }
5963 break ;
6064 case 'select ' :
6165 if (!empty ($ this ->value ) && $ this ->value !== 'none ' ) {
6266 $ options = (array )json_decode ($ this ->options );
63- $ value = $ options [$ this ->value ];
67+ $ value = __ ( $ options [$ this ->value ]) ;
6468 } else {
65- $ value = ' - not set - ' ;
69+ $ value = __ ( ' app.options.none ' ) ;
6670 }
6771 break ;
6872 default :
69- $ value = $ this ->value ;
73+ $ value = __ ( $ this ->value ) ;
7074 break ;
7175 }
7276
@@ -80,11 +84,11 @@ public function getEditValueAttribute()
8084 case 'image ' :
8185 $ value = '' ;
8286 if (isset ($ this ->value ) && !empty ($ this ->value )) {
83- $ value .= '<a class="setting-view-image" href=" ' .asset ('storage/ ' .$ this ->value ).'" title="View " target="_blank"><img src=" ' .asset ('storage/ ' .$ this ->value ).'" /></a> ' ;
87+ $ value .= '<a class="setting-view-image" href=" ' .asset ('storage/ ' .$ this ->value ).'" title=" ' . __ ( ' app.settings.view ' ). ' " target="_blank"><img src=" ' .asset ('storage/ ' .$ this ->value ).'" /></a> ' ;
8488 }
8589 $ value .= Form::file ('value ' , ['class ' => 'form-control ' ]);
8690 if (isset ($ this ->value ) && !empty ($ this ->value )) {
87- $ value .= '<a class="settinglink" href=" ' .route ('settings.clear ' , $ this ->id ).'" title="Remove">Reset back to default </a> ' ;
91+ $ value .= '<a class="settinglink" href=" ' .route ('settings.clear ' , $ this ->id ).'" title=" ' . __ ( ' app.settings.remove ' ). ' "> ' . __ ( ' app.settings.reset ' ). ' </a> ' ;
8892 }
8993
9094 break ;
@@ -102,6 +106,9 @@ public function getEditValueAttribute()
102106 break ;
103107 case 'select ' :
104108 $ options = json_decode ($ this ->options );
109+ foreach ($ options as $ key => $ opt ) {
110+ $ options ->$ key = __ ($ opt );
111+ }
105112 $ value = Form::select ('value ' , $ options , null , ['class ' => 'form-control ' ]);
106113 break ;
107114 default :
@@ -199,8 +206,8 @@ public static function search()
199206 $ output .= '<div class="searchform"> ' ;
200207 $ output .= Form::open (['url ' => $ url , 'method ' => 'get ' ]);
201208 $ output .= '<div class="input-container"> ' ;
202- $ output .= Form::text ($ var , null , ['class ' => 'homesearch ' , 'placeholder ' => $ name .' search... ' ]);
203- $ output .= '<button type="submit">Search </button> ' ;
209+ $ output .= Form::text ($ var , null , ['class ' => 'homesearch ' , 'placeholder ' => __ ( $ name) .' ' . __ ( ' app.settings. search' ). ' ... ' ]);
210+ $ output .= '<button type="submit"> ' . ucwords ( __ ( ' app.settings.search ' )). ' </button> ' ;
204211 $ output .= '</div> ' ;
205212 $ output .= Form::close ();
206213 $ output .= '</div> ' ;
0 commit comments