]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - plugins/readityourself/readityourself.php
New init function for plugins, supports errors reporting
[github/shaarli/Shaarli.git] / plugins / readityourself / readityourself.php
index 4bfcf50115c98211743539850bb6606ecbd1b318..961c5bda0c2f79347e9e69e63d4eedfde776c6cb 100644 (file)
@@ -8,10 +8,21 @@
 // it seems kinda dead.
 // Not tested.
 
-$riyUrl = $conf->get('plugins.READITYOUSELF_URL');
-if (empty($riyUrl)) {
-    $GLOBALS['plugin_errors'][] = 'Readityourself plugin error: '.
-        'Please define the "READITYOUSELF_URL" setting in the plugin administration page.';
+/**
+ * Init function, return an error if the server is not set.
+ *
+ * @param $conf ConfigManager instance.
+ *
+ * @return array Eventual error.
+ */
+function readityourself_init($conf)
+{
+    $riyUrl = $conf->get('plugins.READITYOUSELF_URL');
+    if (empty($riyUrl)) {
+        $error = 'Readityourself plugin error: '.
+            'Please define the "READITYOUSELF_URL" setting in the plugin administration page.';
+        return array($error);
+    }
 }
 
 /**