first commit
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
function st_task_scheduler_import_price_margin_type_select_tag($name, $value)
|
||||
{
|
||||
$priceMarginTypes = stPrice::getPriceMarginTypes();
|
||||
|
||||
$types = options_for_select($priceMarginTypes, $value);
|
||||
|
||||
return select_tag($name, $types);
|
||||
}
|
||||
|
||||
function st_task_scheduler_import_price_margin($name, $value)
|
||||
{
|
||||
$content = input_tag($name.'[value]', isset($value['value']) ? $value['value'] : 0, array('size' => 8, 'data-format' => 'decimal'));
|
||||
$content .= ' ' . st_task_scheduler_import_price_margin_type_select_tag($name.'[type]', isset($value['type']) ? $value['type'] : null);
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
function st_task_scheduler_import_select_tag($name, $value, array $options = [])
|
||||
{
|
||||
$imports = [];
|
||||
|
||||
foreach (stTaskSchedulerImportConfiguration::getAll() as $configuration)
|
||||
{
|
||||
if (!$configuration->getParent())
|
||||
{
|
||||
$imports[$configuration->getId()] = $configuration->getLabel();
|
||||
}
|
||||
}
|
||||
|
||||
asort($imports, SORT_NATURAL);
|
||||
|
||||
$options['selected'] = $value;
|
||||
|
||||
return select_tag($name, $imports, $options);
|
||||
}
|
||||
Reference in New Issue
Block a user