You should first study and understand views in Elgg. They are like blocks in Drupal, but have a wider context, like an include file. Elgg plug-ins now have a better structure, so you better go on with the newest version.
For the client-side JavaScript part, examine the TinyMCE related views, there you can see an example showing how to replace the text editor window. Then include your PHP functions in the plug-in's main file. Any initialization functions should be called in the init() function of your plug-in.
发布评论
评论(1)
你应该首先学习并理解Elgg中的观点。它们就像 Drupal 中的块,但具有更广泛的上下文,例如包含文件。 Elgg 插件现在有更好的结构,所以你最好继续使用最新版本。
对于客户端 JavaScript 部分,请检查 TinyMCE 相关视图,您可以在其中看到一个示例如何替换文本编辑器窗口。然后将您的 PHP 函数包含在插件的主文件中。所有初始化函数都应该在插件的
init()
函数中调用。You should first study and understand views in Elgg. They are like blocks in Drupal, but have a wider context, like an include file. Elgg plug-ins now have a better structure, so you better go on with the newest version.
For the client-side JavaScript part, examine the TinyMCE related views, there you can see an example showing how to replace the text editor window. Then include your PHP functions in the plug-in's main file. Any initialization functions should be called in the
init()
function of your plug-in.