first commit
This commit is contained in:
30
plugins/stPaczkomatyPlugin/lib/helper/stPaczkomatyHelper.php
Normal file
30
plugins/stPaczkomatyPlugin/lib/helper/stPaczkomatyHelper.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
function show_paczkomaty_dropdown_list($name, $selected = '', $params = array()) {
|
||||
static $machines = null;
|
||||
|
||||
$list = stPaczkomatyMachines::getListOfMachinesByParam(isset($params['paczkomaty']) ? $params['paczkomaty'] : array());
|
||||
|
||||
$machines = array();
|
||||
|
||||
foreach ($list as $m)
|
||||
{
|
||||
$machines[$m['number']] = array(
|
||||
'id' => $m['number'],
|
||||
'name' => $m['number'].': '.$m['street'].' '.$m['house'].', '.$m['postCode'].' '.$m['city']
|
||||
);
|
||||
}
|
||||
|
||||
if ($selected && $selected != 'NONE' && isset($machines[$selected]))
|
||||
{
|
||||
$defaults = array(
|
||||
$machines[$selected],
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$defaults = array();
|
||||
}
|
||||
|
||||
echo st_tokenizer_input_tag($name, array_values($machines), $defaults, array('tokenizer' => array('preventDuplicates' => true, 'hintText' => __('Wpisz szukany paczkomat'), 'tokenLimit' => 1)));
|
||||
}
|
||||
Reference in New Issue
Block a user