1 | <?php |
||
20 | class LocaliseControllerLanguage extends JControllerForm |
||
21 | { |
||
22 | /** |
||
23 | * Method to get a model object, loading it if required. |
||
24 | * |
||
25 | * @param string $name The model name. Optional. |
||
26 | * @param string $prefix The class prefix. Optional. |
||
27 | * @param array $config Configuration array for model. Optional. |
||
28 | * |
||
29 | * @return object The model. |
||
30 | */ |
||
31 | public function getModel($name = 'Language', $prefix = 'LocaliseModel', $config = array('ignore_request' => true)) |
||
35 | |||
36 | /** |
||
37 | * Method to check if you can add a new record. |
||
38 | * |
||
39 | * Extended classes can override this if necessary. |
||
40 | * |
||
41 | * @param array $data An array of input data. |
||
42 | * |
||
43 | * @return boolean |
||
44 | */ |
||
45 | protected function allowAdd($data = array()) |
||
49 | |||
50 | /** |
||
51 | * Method to check if you can add a new record. |
||
52 | * |
||
53 | * Extended classes can override this if necessary. |
||
54 | * |
||
55 | * @param array $data An array of input data. |
||
56 | * @param string $key The name of the key for the primary key. |
||
57 | * |
||
58 | * @return boolean |
||
59 | */ |
||
60 | protected function allowEdit($data = array(), $key = 'id') |
||
64 | |||
65 | /** |
||
66 | * Gets the URL arguments to append to an item redirect. |
||
67 | * |
||
68 | * @param int $recordId The primary key id for the item. |
||
69 | * @param string $urlVar The name of the URL variable for the id. |
||
70 | * |
||
71 | * @return string The arguments to append to the redirect URL. |
||
72 | */ |
||
73 | protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id') |
||
74 | { |
||
75 | // Get the infos |
||
76 | $input = JFactory::getApplication()->input; |
||
77 | $client = $input->get('client', ''); |
||
78 | |||
79 | if (empty($client)) |
||
80 | { |
||
81 | $data = $input->get('jform', array(), 'array'); |
||
82 | |||
83 | if ($data) |
||
84 | { |
||
85 | $client = $data['client']; |
||
86 | } |
||
87 | } |
||
88 | |||
89 | if (empty($client)) |
||
90 | { |
||
91 | $select = $input->get('filters', array(), 'array'); |
||
92 | $client = isset($select['select']['client']) ? $select['select']['client'] : 'site'; |
||
93 | } |
||
94 | |||
95 | $tag = $input->get('tag', ''); |
||
96 | |||
97 | if (empty($tag)) |
||
98 | { |
||
99 | $tag = isset($data['tag']) ? $data['tag'] : ''; |
||
100 | } |
||
101 | |||
102 | // Get the append string |
||
103 | $append = parent::getRedirectToItemAppend($recordId, $urlVar); |
||
104 | $append .= '&client=' . $client . '&tag=' . $tag; |
||
105 | |||
106 | return $append; |
||
107 | } |
||
108 | |||
109 | /** |
||
110 | * Delete the language |
||
111 | * |
||
112 | * @return void |
||
113 | */ |
||
114 | public function delete() |
||
136 | |||
137 | /** |
||
138 | * Method for copying the language files from the reference language. |
||
139 | * |
||
140 | * @return void |
||
141 | * |
||
142 | * @since 4.0.17 |
||
143 | */ |
||
144 | public function copy() |
||
171 | } |
||
172 |