Skip to content

Commit f80502b

Browse files
committed
remove unused function
1 parent 66833cf commit f80502b

File tree

1 file changed

+0
-103
lines changed

1 file changed

+0
-103
lines changed

administrator/components/com_modules/src/Helper/ModulesHelper.php

Lines changed: 0 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -347,107 +347,4 @@ function ($var) use ($pk, $workflowId)
347347
)
348348
);
349349
}
350-
351-
/**
352-
* Prepares a form
353-
*
354-
* @param Form $form The form to change
355-
* @param array|object $data The form data
356-
*
357-
* @return void
358-
*
359-
* @since __DEPLOY_VERSION__
360-
*/
361-
public static function onPrepareForm(Form $form, $data)
362-
{
363-
$db = Factory::getDbo();
364-
365-
$data = (array) $data;
366-
367-
// Make workflows translatable
368-
Factory::getLanguage()->load('com_workflow', JPATH_ADMINISTRATOR);
369-
370-
$form->setFieldAttribute('workflow_id', 'default', 'inherit');
371-
372-
$query = $db->getQuery(true);
373-
374-
$query->select($db->quoteName('title'))
375-
->from($db->quoteName('#__workflows'))
376-
->where(
377-
[
378-
$db->quoteName('default') . ' = 1',
379-
$db->quoteName('published') . ' = 1',
380-
]
381-
);
382-
383-
$defaulttitle = $db->setQuery($query)->loadResult();
384-
385-
$option = Text::_('COM_WORKFLOW_INHERIT_WORKFLOW_NEW');
386-
387-
if (!empty($data['id']))
388-
{
389-
$category = new Category($db);
390-
391-
$categories = $category->getPath((int) $data['id']);
392-
393-
// Remove the current category, because we search for inheritance from parent.
394-
array_pop($categories);
395-
396-
$option = Text::sprintf('COM_WORKFLOW_INHERIT_WORKFLOW', Text::_($defaulttitle));
397-
398-
if (!empty($categories))
399-
{
400-
$categories = array_reverse($categories);
401-
402-
$query = $db->getQuery(true);
403-
404-
$query->select($db->quoteName('title'))
405-
->from($db->quoteName('#__workflows'))
406-
->where(
407-
[
408-
$db->quoteName('id') . ' = :workflowId',
409-
$db->quoteName('published') . ' = 1',
410-
]
411-
)
412-
->bind(':workflowId', $workflow_id, ParameterType::INTEGER);
413-
414-
$db->setQuery($query);
415-
416-
foreach ($categories as $cat)
417-
{
418-
$cat->params = new Registry($cat->params);
419-
420-
$workflow_id = $cat->params->get('workflow_id');
421-
422-
if ($workflow_id == 'inherit')
423-
{
424-
continue;
425-
}
426-
elseif ($workflow_id == 'use_default')
427-
{
428-
break;
429-
}
430-
elseif ($workflow_id = (int) $workflow_id)
431-
{
432-
$title = $db->loadResult();
433-
434-
if (!is_null($title))
435-
{
436-
$option = Text::sprintf('COM_WORKFLOW_INHERIT_WORKFLOW', Text::_($title));
437-
438-
break;
439-
}
440-
}
441-
}
442-
}
443-
}
444-
445-
$field = $form->getField('workflow_id', 'params');
446-
447-
$field->addOption($option, ['value' => 'inherit']);
448-
449-
$field->addOption(Text::sprintf('COM_WORKFLOW_USE_DEFAULT_WORKFLOW', Text::_($defaulttitle)), ['value' => 'use_default']);
450-
451-
$field->addOption('- ' . Text::_('COM_MODULE_WORKFLOWS') . ' -', ['disabled' => 'true']);
452-
}
453350
}

0 commit comments

Comments
 (0)