Merged colosa/processmaker into master
This commit is contained in:
@@ -315,19 +315,6 @@ class WebApplication
|
||||
|
||||
$this->rest->setOverridingFormats('JsonFormat', 'UploadFormat');
|
||||
|
||||
$isPluginRequest = strpos($uri, '/plugin-') !== false ? true : false;
|
||||
|
||||
if ($isPluginRequest) {
|
||||
$tmp = explode('/', $uri);
|
||||
array_shift($tmp);
|
||||
$tmp = array_shift($tmp);
|
||||
$tmp = explode('-', $tmp);
|
||||
$pluginName = $tmp[1];
|
||||
$uri = str_replace('/plugin-'.$pluginName, '', $uri);
|
||||
}
|
||||
|
||||
// Override $_SERVER['REQUEST_URI'] to Restler handles the modified url
|
||||
|
||||
// scan all api directory to find api classes
|
||||
$classesList = Util\Common::rglob($apiDir . "/*");
|
||||
|
||||
@@ -356,24 +343,36 @@ class WebApplication
|
||||
}
|
||||
}
|
||||
|
||||
//if (! $isPluginRequest) { // if it is not a request for a plugin endpoint
|
||||
//
|
||||
// Register API Plugins classes
|
||||
$isPluginRequest = strpos($uri, '/plugin-') !== false ? true : false;
|
||||
|
||||
if ($isPluginRequest) {
|
||||
$tmp = explode('/', $uri);
|
||||
array_shift($tmp);
|
||||
$tmp = array_shift($tmp);
|
||||
$tmp = explode('-', $tmp);
|
||||
$pluginName = $tmp[1];
|
||||
$uri = str_replace('plugin-'.$pluginName, strtolower($pluginName), $uri);
|
||||
}
|
||||
|
||||
// hook to get rest api classes from plugins
|
||||
if (class_exists('PMPluginRegistry') && file_exists(PATH_DATA_SITE . 'plugin.singleton')) {
|
||||
$pluginRegistry = \PMPluginRegistry::loadSingleton(PATH_DATA_SITE . 'plugin.singleton');
|
||||
$plugins = $pluginRegistry->getRegisteredRestServices();
|
||||
|
||||
if (! empty($plugins)) {
|
||||
$pluginSourceDir = PATH_PLUGINS . $pluginName . DIRECTORY_SEPARATOR . 'src';
|
||||
foreach ($plugins as $pluginName => $plugin) {
|
||||
$pluginSourceDir = PATH_PLUGINS . $pluginName . DIRECTORY_SEPARATOR . 'src';
|
||||
|
||||
$loader = \Maveriks\Util\ClassLoader::getInstance();
|
||||
$loader->add($pluginSourceDir);
|
||||
|
||||
if (is_array($plugins) && array_key_exists($pluginName, $plugins)) {
|
||||
foreach ($plugins[$pluginName] as $class) {
|
||||
$loader = \Maveriks\Util\ClassLoader::getInstance();
|
||||
$loader->add($pluginSourceDir);
|
||||
|
||||
foreach ($plugin as $class) {
|
||||
if (class_exists($class['namespace'])) {
|
||||
$this->rest->addAPIClass($class['namespace']);
|
||||
}
|
||||
}
|
||||
$this->rest->addAPIClass($class['namespace'], strtolower($pluginName));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -597,3 +596,4 @@ class WebApplication
|
||||
@unlink(PATH_DATA . 'sites' . DS . $workspace . DS . 'api-config.php');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1408,16 +1408,16 @@ class PMPluginRegistry
|
||||
|
||||
// Ensure that is registering only existent classes.
|
||||
if (class_exists($ns)) {
|
||||
$this->_restServices[strtolower($sNamespace)][] = array(
|
||||
$this->_restServices[$sNamespace][] = array(
|
||||
"filepath" => $classFile,
|
||||
"namespace" => $ns
|
||||
);
|
||||
|
||||
\Maveriks\WebApplication::purgeRestApiCache(basename(PATH_DATA_SITE));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
\Maveriks\WebApplication::purgeRestApiCache(basename(PATH_DATA_SITE));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1429,6 +1429,7 @@ class PMPluginRegistry
|
||||
public function unregisterRestService ($sNamespace)
|
||||
{
|
||||
unset($this->_restServices[$sNamespace]);
|
||||
\Maveriks\WebApplication::purgeRestApiCache(basename(PATH_DATA_SITE));
|
||||
}
|
||||
|
||||
public function getRegisteredRestServices()
|
||||
|
||||
@@ -89,7 +89,7 @@ class AppDelegation extends BaseAppDelegation
|
||||
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
$delIndex = 1;
|
||||
$delPreviusUsrUid = '';
|
||||
$delPreviusUsrUid = $sUsrUid;
|
||||
if ($rs->next()) {
|
||||
$row = $rs->getRow();
|
||||
|
||||
|
||||
@@ -411,6 +411,8 @@ class Trigger
|
||||
}
|
||||
|
||||
$range = range($iniPos, $finPos);
|
||||
$stepChangeIds = array();
|
||||
$stepChangePos = array();
|
||||
foreach ($aStepTriggers as $dataStep) {
|
||||
if (($dataStep['st_type'] == $typeCompare) && (in_array($dataStep['st_position'], $range)) && ($dataStep['tri_uid'] != $triUid)) {
|
||||
$stepChangeIds[] = $dataStep['tri_uid'];
|
||||
|
||||
@@ -751,7 +751,6 @@ Ext.onReady( function() {
|
||||
width : 200 ,
|
||||
fieldLabel : _('ID_NAME') ,
|
||||
name : 'name' ,
|
||||
allowBlank : false,
|
||||
msgTarget: 'side',
|
||||
enableKeyEvents: true,
|
||||
listeners: {
|
||||
|
||||
Reference in New Issue
Block a user