function getCurrentContextId() { $context = PKPApplication::getRequest()->getContext(); return is_null($context) ? 0 : $context->getId(); }