On 10-Apr-10, at 6:58 AM, Suleman Siddiqui wrote:
I was working in status net, and wants to make subscription a
separate plugin. After some read and development I came to know
that I have to either change a core file (action/all.php) to alter
the form action for subscribe button (in profile page so that it
will post it to my custom class) or have to modify subscribe class
(classes/subscribe.php). This means I am making changes to the core
of the status net, latter on for upgradation to next versions will
update the files and my added functionality will be over-ridden.
Please suggest me some way so that I can over-ride the profle page
subscribe action or over-ride the subscribe class functionality to
perform my custom actions. Is it possible to over-ride the handle
function? Like we can over-ride the Custom navigation menu tabs by
making their functions in plugins.
I don't know exactly what you want to do, but you should be able to
hook into the StartSubscribe event and return 'false' if you want to
completely override, or prevent, subscription, or you could hook into
the EndSubscribe event if you want to perform some action when
subscriptions are made.
Depending on what you're doing it may also be useful to hook into the
corresponding Unsubscribe event.
Secondly, Please suggest me the way to generate models for my
custom tables.
This is currently a slightly complex procedure. At least I feel it is.
You should look at the OpenID plugin.
The User_openid.php file, for example, contains the DB_DataObject
class that represents the table, including the required staticGet(),
table(), keys(), keyTypes(), and sometimes sequenceKey() functions.
Then that class is loaded by the onAutoload() function of
OpenIDPlugin.php, and the table is made in the onCheckSchema()
function also in OpenIDPlugin.php.
_______________________________________________
StatusNet-dev mailing list
[email protected]
http://lists.status.net/mailman/listinfo/statusnet-dev