Thanks patrick,
I will need to use the before_delete_user because I am trying to clear up the grouping relation ship table when I delete any user. So the relation ship table has the user id and groupid, so every time I delete a user, I do need to before the delete to the grouping table too.
But in the future when I will build a plug in for group, I will do you second suggestion.
Mean while, I was trying to create a controller and extend it from exhibitscontroller. The reason behind this is, when the user click on edit or add in exhibit-metadata-form I will perform different actions.
I tried to use after save hook, but I was not sure how to know if the user clicked on Add or edit. I checked $post, $exhibit, $user but I did not see the value of the action that performed. So I though to create a second controller for exhibits in addition to my first controller that works ok that extends from users.
I do not think my controller has a problem but maybe the router. I am attaching the code of the router in case I am doing something wrong.
class OmexhibitControllerPlugin extends Zend_Controller_Plugin_Abstract {
public function routeStartup(Zend_Controller_Request_Abstract $request) {
$router = Omeka_Context::getInstance()->getFrontController()->getRouter();
$route = new Zend_Controller_Router_Route(
'exhibits/add',
array(
'module' => 'omlibrary',
'controller' => 'Omexhibit',
'action' => 'add'
));
$router->addRoute('addOmexhibit', $route);
}
}
class OmlibraryControllerPlugin extends Zend_Controller_Plugin_Abstract {
public function routeStartup(Zend_Controller_Request_Abstract $request) {
$router = Omeka_Context::getInstance()->getFrontController()->getRouter();
$route = new Zend_Controller_Router_Route(
'users/add/',
array(
'module' => 'omlibrary',
'controller' => 'omlibrary',
'action' => 'add'
));
$router->addRoute('addOmlibraryUser', $route);
$route = new Zend_Controller_Router_Route(
'users/edit/:id',
array(
'module' => 'omlibrary',
'controller' => 'omlibrary',
'action' => 'edit'
));
$router->addRoute('editOmlibraryUser', $route);
}
}
thanks
Nancy