8 namespace Fossology\Monk;
14 use Symfony\Component\HttpFoundation\Request;
15 use Symfony\Component\HttpFoundation\Response;
20 const NAME =
'admin_monk_revision';
22 function __construct()
24 parent::__construct(self::NAME, array(
25 self::TITLE => _(
"Manage Monk Revision"),
26 self::MENU_LIST =>
"Admin::Agent::Monk",
35 protected function handle(Request $request)
38 $agentDao = $this->
getObject(
'dao.agent');
40 $monk = $agentDao->getCurrentAgentRef(
'monk');
41 $rev = $request->get(
'rev');
42 if ($rev==$monk->getAgentRevision() && $agentDao->renewCurrentAgent(
'monk')) {
43 $text = _(
"You have renewed the monk revision.");
44 return $this->
render(
'include/base.html.twig', $this->mergeWithDefault(array(
'message'=>$text)));
46 $vars[
'content'] =
'<a href="?mod=admin_monk_revision&rev='.$monk->getAgentRevision().
'">'._(
'Renew monk revision').
'</a>';
47 return $this->
render(
'include/base.html.twig', $this->mergeWithDefault($vars));
Contains the constants and helpers for authentication of user.
render($templateName, $vars=null, $headers=null)