Conditions | 5 |
Paths | 4 |
Total Lines | 21 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | public function getSubModule($subModuleKey) { |
||
17 | if(!module()->canBrowse()) return cb()->redirect(cb()->getAdminUrl(),cbLang("you_dont_have_privilege_to_this_area")); |
||
18 | if(!verifyReferalUrl()) return cb()->redirect(module()->url(),"It looks like your url is incorrect"); |
||
19 | |||
20 | if($subModule = Cache::get("subModule".$subModuleKey)) { |
||
21 | $foreignKey = $subModule['foreignKey']; |
||
22 | $foreignValue = $subModule['foreignValue']; |
||
23 | |||
24 | $query = $this->repository(); |
||
|
|||
25 | $query->where($foreignKey, $foreignValue); |
||
26 | $result = $query->paginate( request("limit")?:cbConfig("LIMIT_TABLE_DATA") ); |
||
27 | $data['result'] = $result; |
||
28 | |||
29 | $data['additionalHeaderTitle'] = $subModule['parentTitle']; |
||
30 | $data['additionalHeaderContent'] = $subModule['info']; |
||
31 | $data['subModuleKey'] = $subModuleKey; |
||
32 | |||
33 | return view("crudbooster::module.index.index", array_merge($data, $this->data)); |
||
34 | } |
||
35 | |||
36 | return cb()->redirect(module()->url(),"It looks like your url is incorrect"); |
||
37 | } |
||
39 | } |