[geeklog-devel] Re: Geeklog 2 Module API

Vincent Furia vmf at abtech.org
Tue Oct 21 16:18:37 EDT 2003

OK, I've included some of the ideas mentioned so far on the thread, 
including those that Warren mentioned on geeklog-devtalk.  The slightly 
modified module API is included below.  I forgot to mention this in the 
previous email, but I had wanted to say that I was only working on the 
call-back functions.  So functions like registering events and APIs 
weren't included because those should be called by the from within the 
plugin code, rather than by the core geeklog code.  Outlining all the 
functions available to the modules would be huge undertaking, but maybe 
something we should work on at the same time as the interace.

Here are some of the functions that would be called by the modules.  
Perhaps these should all be contained within a non-instantiated class?

function registerAPI();
function unregisterAPI();
function registerEvents();
function rasiseEvent();
function getSmiles();
function sendMessage();
function sendEmail();

On top of these there should probably be classes and functions available 
to handle common tasks like file (and image) uploads.

Tony, I'm not an XHTML/CSS deity, but I think a lot could be 
accomplished by modules generating html div blocks that then could be 
modified by css classes.  That combined with some creative function 
calls could get theme developers enough flexibility...  But again, my 
knowledge of css/xhtml isn't thorough enough to know if that would be 

Also that brings us to one of Warren's points about injecting code into 
template files. Should this be handled by functions or by editing the 
template manually...?  I guess this depends on the template system we're 
going to use (looks like FLEXY currently I believe) and what sort of 
magic we can do.  I'm hesitant to create fifty (or however many) 
functions so that the plugins can place code anywhere.  I think we'll 
wind up adding a new function every time a plugin or theme developer 
decides they need access to a new location to achieve a certain look... 
I think this is something we should sort out soon.

Should we move this discussion on the forums?  It really doesn't matter 
to me. We could also move the discussion onto project.geeklog.net which 
might give us a bit more flexibility than using the geeklog.net forums...

Anyway, I just want to emphasize the difference between callback 
functions and functions that will called by the plugin.  It will make 
things easier if everyone keeps the distinction in mind as we work on 
the two simultaneously.

One last question I suppose.  For GL2 are we calling them "plugins", 
"modules" or will we just continue using the two terms interchangably 
until we confuse everyone?  ;)


interface glPlugin {
    /* installation functions */
    function install();                /* install the plugin */
    function uninstall();            /* uninstall the plugin */
    function upgrade();                /* upgrade the plugin from a 
previous version */
    function getVersion();            /* return plugin name and version 
(author(s)?, website?)*/

    /* user modifications */
    function onNewUser();            /* process new user */
    function onDeleteUser();        /* process user deletion */
    function onLogin();                /* process user login */
    function onLogout();            /* process user logout */

    /* moderation */
    function getSubmissionForm();    /* return the form for plugin 
submission */
    function getModerationList();    /* return list of items for 
moderation */
    function onApproveSubmission();    /* process a submission approval */
    function onDeleteSubmission();    /* delete a submission */
    function onEditSubmission();    /* return the form to edit a 
submission */
    function getSubmissionCount();  /* return count of current 
submissions */

    /* search functions */
    function getSearchResults();    /* search items for keywords */
    function getSearchTypes();        /* return plugin search options */

    /* comment functions */
    function onCommentAction();        /* plugin action on comment 
submit, delete, etc */
    function getCommentParent();    /* for display of the parent above 
comments */

    /* ratings functions */
    function onRatingAction();        /* plugin action  on ratings 
actions (submit rating) */

    /* menu/display items */
    function getMenuItems();        /* return menu items related to the 
plugin */
    function getUserMenu();            /* return user menu options */
    function getAdminMenu();        /* return admin menu options */
    function getControlMenu();        /* return control menu options */
    function getCenterBlock();        /* return centerblock */

    /* profile */
    function getProfileBlock();        /* display plugin block profile 
values */
    function getEditProfileBlock();    /* return form to edit block 
profile values */
    function getProfileVar();        /* display plugin variable profile 
values */
    function getEditProfileVar();    /* return form to edit variable 
profile values */
    function saveProfileOptions();  /* save plugin profile options */

    /* export files (rdf feeds, ical files, etc) */
    function getExportNames();        /* return export file names the 
plugin uses */
    function getExportContent();    /* return export file content */
    function getExportCurrent();    /* return if exports are current */

    /* other */
    function getHeaderCode();        /* return plugin JS or Meta Data */
    function getStats();            /* return plugin stats information */
    function onEvent();                /* handle a registered event */

More information about the geeklog-devel mailing list