Files
crm.clientright.ru/modules/Workflow2/lib/Workflow/AssistentManager.php

33 lines
722 B
PHP
Raw Normal View History

<?php
namespace Workflow;
class AssistentManager
{
public function getAvailableAssistents() {
$filePath = MODULE_ROOTPATH . DS . 'extends' . DS . 'assistents' . DS . '*' . DS . 'Assistent.php';
$files = glob($filePath);
$assistents = array();
foreach($files as $file) {
require_once($file);
$key = basename(dirname($file));
$className = '\\Workflow\\Plugins\\Assistents\\' . $key;
$assistent = new $className($key);
$assistents[$key] = array(
'name' => $assistent->getName(),
'description' => $assistent->getDescription()
);
}
return $assistents;
}
}