REDROOM
PHP 8.1.33
Path:
Logout
Edit File
Size: 3.26 KB
Close
/home/jambtst2015/public_html/ida.com.ng/libraries/src/Workflow/WorkflowPluginTrait.php
Text
Base64
<?php /** * Joomla! Content Management System * * @copyright (C) 2020 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE */ namespace Joomla\CMS\Workflow; \defined('JPATH_PLATFORM') or die; use Joomla\CMS\Form\Form; use Joomla\CMS\Object\CMSObject; use ReflectionClass; /** * Trait for component workflow plugins. * * @since 4.0.0 */ trait WorkflowPluginTrait { /** * Add different parameter options to the transition view, we need when executing the transition * * @param Form $form The form * @param \stdClass $data The data * * @return boolean * * @since 4.0.0 */ protected function enhanceWorkflowTransitionForm(Form $form, $data) { $workflow_id = (int) ($data->workflow_id ?? $form->getValue('workflow_id')); $workflow = $this->getWorkflow($workflow_id); if (empty($workflow->id) || !$this->isSupported($workflow->extension)) { return false; } // Load XML file from "parent" plugin $path = dirname((new ReflectionClass(static::class))->getFileName()); if (is_file($path . '/forms/action.xml')) { $form->loadFile($path . '/forms/action.xml'); } return $workflow; } /** * Get the workflow for a given ID * * @param int|null $workflowId ID of the workflow * * @return CMSObject|boolean Object on success, false on failure. * * @since 4.0.0 */ protected function getWorkflow(int $workflowId = null) { $workflowId = !empty($workflowId) ? $workflowId : $this->app->input->getInt('workflow_id'); if (is_array($workflowId)) { return false; } return $this->app->bootComponent('com_workflow') ->getMVCFactory() ->createModel('Workflow', 'Administrator', ['ignore_request' => true]) ->getItem($workflowId); } /** * Check if the current plugin should execute workflow related activities * * @param string $context Context to check * * @return boolean * * @since 4.0.0 */ protected function isSupported($context) { return false; } /** * Check if the context is listed in the allowed of forbidden lists and return the result. * * @param string $context Context to check * * @return boolean */ protected function checkAllowedAndForbiddenlist($context) { $allowedlist = \array_filter((array) $this->params->get('allowedlist', [])); $forbiddenlist = \array_filter((array) $this->params->get('forbiddenlist', [])); if (!empty($allowedlist)) { foreach ($allowedlist as $allowed) { if ($context === $allowed) { return true; } } return false; } foreach ($forbiddenlist as $forbidden) { if ($context === $forbidden) { return false; } } return true; } /** * Check if the context supports a specific functionality. * * @param string $context Context to check * @param string $functionality The functionality * * @return boolean */ protected function checkExtensionSupport($context, $functionality) { $parts = explode('.', $context); $component = $this->app->bootComponent($parts[0]); if (!$component instanceof WorkflowServiceInterface || !$component->isWorkflowActive($context) || !$component->supportFunctionality($functionality, $context)) { return false; } return true; } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 4
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
Workflow.php
12.70 KB
lrw-r--r--
2024-11-22 17:53:12
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
WorkflowPluginTrait.php
3.26 KB
lrw-r--r--
2024-11-22 17:53:12
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
WorkflowServiceInterface.php
2.28 KB
lrw-r--r--
2024-11-22 17:53:12
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
WorkflowServiceTrait.php
3.93 KB
lrw-r--r--
2024-11-22 17:53:12
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).