05-29-2011, 10:12 AM
Affected files are (see in patch):
add.php
edit.php
functions.php
As you can see, callPluginMethod('onAfterAdd'); was changed to callPluginMethod('onAfterAdd', $fileId); (and for onBeforeEdit and onAfterEdit).
Changes in Plugin_class.php are optional (for documentation)
Patch.diff:
add.php
edit.php
functions.php
As you can see, callPluginMethod('onAfterAdd'); was changed to callPluginMethod('onAfterAdd', $fileId); (and for onBeforeEdit and onAfterEdit).
Changes in Plugin_class.php are optional (for documentation)
Patch.diff:
Code:
diff -urB opendocman-unstable-daily-orig/add.php opendocman-unstable-daily/add.php
--- opendocman-unstable-daily-orig/add.php 2011-05-27 08:01:13.000000000 +0200
+++ opendocman-unstable-daily/add.php 2011-05-27 22:00:59.949135276 +0200
@@ -634,7 +634,7 @@
$message = urlencode(msg('message_document_added'));
// Call the plugin API
- callPluginMethod('onAfterAdd');
+ callPluginMethod('onAfterAdd', $fileId);
header('Location: out.php?last_message=' . $message);
}
diff -urB opendocman-unstable-daily-orig/edit.php opendocman-unstable-daily/edit.php
--- opendocman-unstable-daily-orig/edit.php 2011-05-27 08:01:13.000000000 +0200
+++ opendocman-unstable-daily/edit.php 2011-05-27 22:18:05.584915775 +0200
@@ -474,7 +474,7 @@
</td>
<?php
// Call Plugin API
- callPluginMethod('onBeforeEditFile');
+ callPluginMethod('onBeforeEditFile', $data_id);
?>
</tr>
</table>
@@ -576,7 +576,7 @@
$message = urlencode('Document successfully updated');
// Call the plugin API
- callPluginMethod('onAfterEditFile');
+ callPluginMethod('onAfterEditFile', $_REQUEST['id']);
header('Location: out.php?last_message=' . $message);
}
diff -urB opendocman-unstable-daily-orig/functions.php opendocman-unstable-daily/functions.php
--- opendocman-unstable-daily-orig/functions.php 2011-05-27 08:01:13.000000000 +0200
+++ opendocman-unstable-daily/functions.php 2011-05-27 22:00:40.918758424 +0200
@@ -788,7 +788,7 @@
* @param string $method The name of the plugin method being envoked.
* @return null
*/
- function callPluginMethod($method)
+ function callPluginMethod($method, $data=null)
{
foreach ($GLOBALS['plugin']->pluginslist as $value)
{
@@ -797,6 +797,6 @@
echo 'Sorry, your plugin ' . $value . ' is not setup properly';
}
$plugin_obj = new $value;
- $plugin_obj->$method();
+ $plugin_obj->$method($data);
}
}