sgc_072

Script error

Jun 7th, 2017
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.39 KB | None | 0 0
  1. {{velocity}}
  2.  
  3. #set($glossaryHome = $doc.getObject("Glossary.GlossaryClass"))
  4. #if($glossaryHome)
  5. ## Don't display doc extra tabs for Glossary home pages
  6. #set($docextras=[])
  7. $doc.use("Glossary.GlossaryClass")
  8.  
  9. ## The space where to add and search for Glossary Entries
  10. #set ($glossarySpace = $doc.space)
  11. ## If this page is called with createGlossary=true then create a new page using the GlossaryTemplate template
  12. #if ($request.createGlossary == 'true')
  13. ## Remove the "?" if it's the last character since the Glossary sheet adds one automatically
  14. #set ($glossaryItem = $stringtool.stripEnd($stringtool.trim($!{request.glossaryItem}), '?'))
  15. ## If there's no glossaryItem then issue a warning below
  16. #if (!$stringtool.isBlank($glossaryItem))
  17. #set ($newGlossaryReference = $services.model.createDocumentReference('', '', "$glossaryItem"))
  18. $response.sendRedirect($xwiki.getURL($newGlossaryReference, 'inline', "$!{request.queryString}&title=${escapetool.url($glossaryItem)}"))
  19.  
  20.  
  21. #end
  22. #end
  23.  
  24. ##Adding 'Add Glossary' button on the main page
  25. (((
  26. {{html wiki = "true"}}
  27. #if ($isGuest)
  28. #set($login = ${escapetool.xml($doc.getURL("login", "xredirect=$doc.externalURL"))})
  29. #set($register = ${escapetool.xml($xwiki.getURL($services.model.resolveDocument('', 'default'), "register", "xredirect=$doc.externalURL"))})
  30. $services.localization.render('platform.glossary.need', ["<a href=$login>","</a>","<a href=$register>","</a>"])
  31. #else
  32. <form action="$doc.getURL()" id="newglossary" class="xformInline">
  33. <div>
  34. <input type="hidden" name="parent" value="${glossarySpace}.WebHome" />
  35. <input type="hidden" name="template" value="Glossary.GlossaryTemplate" />
  36. <input type="hidden" name="createGlossary" value="true" />
  37. #if ($request.createGlossary == 'true' && $stringtool.isBlank($glossaryItem))
  38. {{error}}$services.localization.render('platform.glossary.create.empty'){{/error}}
  39. #end
  40. <input class="withTip" type="text" name="glossaryItem" value="$services.localization.render('glossary.add.searchHint')" size="16"/>
  41. <span class="buttonwrapper">
  42. <input class="btn btn-success button" type="submit" value="$services.localization.render('glossary.add.submit')" />
  43. </span>
  44. </div>
  45. </form>
  46. #end
  47. {{/html}}
  48. )))
  49. #end
  50. {{/velocity}}
Add Comment
Please, Sign In to add comment