ect.velocity.sakai-velocity-tool.23.2.source-code.VM_chef_library.vm Maven / Gradle / Ivy
#* ------------------------------------------------------------------
#
# The CHEF Velocity Macro library
#
# To be included in each webapp's velocity file area.
#
*# ------------------------------------------------------------------
#* ------------------------------------------------------------------
# The standard way to escape text to make it safe for embedding in html
*# ------------------------------------------------------------------
#macro (chef_html $txt)$sakai_Validator.escapeHtml($txt)#end
#* ------------------------------------------------------------------
# The standard toolbar based on the $sakai_menu definition
# Note: url type items don't support form field sending, override other settings, and go to a new window
# CSS requirements: navIntraTool inlineForm searchField
# portletToolBarDisabled chefToolBarSelected chefToolBarDisabled
*# ------------------------------------------------------------------
#macro (chef_toolbar)
## use the standard menu reference
#set ($mnu=$sakai_menu)
#set($hasItems="false")
#foreach ($item in $mnu.Items)
#if ($item.IsEnabled || $item.IsChecked || $mnu.Showdisabled)
#set($hasItems="true")
#end
#end
#if (($mnu) && (!$mnu.isEmpty()) && ($hasItems=="true"))
$flashNotif
$flashNotifCloseTitle
#end
#end
#* ------------------------------------------------------------------
# The standard way to deal with the ToolPortlet Alert
*# ------------------------------------------------------------------
#macro (chef_alert)
#if(!$sakai_alert.isEmpty())$sakai_alert.Alert#end
#end
#* ------------------------------------------------------------------
# The standard way to deal with the message at the top of a tool
*# ------------------------------------------------------------------
#macro (chef_viewmsg $msg)
#chef_html($msg)
#end
#* ------------------------------------------------------------------
# The standard way to deal with the message in place of a flat list
*# ------------------------------------------------------------------
#macro (chef_listmsg $msg)
#chef_html($msg)
#end
#* ------------------------------------------------------------------
# The standard way to start a vm file - deal with fragment or not & css
*# ------------------------------------------------------------------
#macro (chef_start)
#if ($sakai_fragment=='false')
$!{toolTitle}
$!sakai_head
#if ($frameRefresh)
#foreach ($id in $frameRefresh)
#end
#end
#if ($topRefresh)
#end
#if ($focusChange)
#end
#end
## no comment
#end
#* ------------------------------------------------------------------
# Macros for adding content to the header
*# ------------------------------------------------------------------
#* ------------------------------------------------------------------
# Prepends a line to the section of the page.
# This is useful for adding CSS which should go before the skin CSS
# so that it can be easily overridden by the skin.
*# ------------------------------------------------------------------
#macro (header_prepend $extra)
#set($sakai_head="${extra}
${sakai_head}")
#end
#* ------------------------------------------------------------------
# Appends a line to the section of the page.
# This is useful for adding JavaScript which needs to exist after the
# standard JavaScript.
*# ------------------------------------------------------------------
#macro (header_append $extra)
#set($sakai_head="${sakai_head}
${extra}")
#end
#* ------------------------------------------------------------------
# The standard way to end a vm file - deal with fragment or not
*# ------------------------------------------------------------------
#macro (chef_end)
#if ($sakai_fragment=='false')#end
#end
#* ------------------------------------------------------------------
# The standard way to start a portlet body - end with portletContainerEnd
*# ------------------------------------------------------------------
#macro (chef_portletContainer)
#end
#* ------------------------------------------------------------------
# The standard way to end a portlet body - started with portletContainer
*# ------------------------------------------------------------------
#macro (chef_portletContainerEnd)
#end
#* ------------------------------------------------------------------
# The standard way to start a portlet content - end with portletContentEnd
*# ------------------------------------------------------------------
#macro (chef_portletContent)
#end
#* ------------------------------------------------------------------
# The standard way to end a portlet content - started with portletContent
*# ------------------------------------------------------------------
#macro (chef_portletContentEnd)
#end
#* ------------------------------------------------------------------
# The standard way to start a flat list view table - end with portletFlatListEnd
*# ------------------------------------------------------------------
#macro (chef_portletFlatList $summary)
#end
#* ------------------------------------------------------------------
# The standard way to end a flat list view table - started with portletFlatList
*# ------------------------------------------------------------------
#macro (chef_portletFlatListEnd)
#end
#* ------------------------------------------------------------------
# The standard way to setup a date selection widget
#
# IMPORTANT: ResourceBundle with months referenced by $tlang.getString("jan")
# through $tlang.getString("dec") _must_ be defined
#
# Creates a drop-down date selection, as well as a pop-up date selection
# $yearselect_id The name and id attribute of the year selection dropdown list (html SELECT tag)
# $monthselect_id The name and id attribute of the month selection dropdown list (html SELECT tag)
# $dayselect_id The name and id attribute of the day selection dropdown list (html SELECT tag)
# $earliestYear The earliest year to display in the year dropdown (2002 for example)
# $latestYear The latest year to display in the year dropdown (2005 for examlple)
# $yearSelected The year selected
# $monthSelected The month selected
# $daySelected The day selected
# $dateFormat Locale specific date format pattern
# $onChangeAction optional javascript for onchange attribute
*# ------------------------------------------------------------------
#macro (chef_dateselectionwidget $yearselect_id $monthselect_id $dayselect_id $earliestYear $latestYear $yearSelected $monthSelected $daySelected $dateFormat $onChangeAction)
#set($yearList = [$earliestYear .. $latestYear])
#foreach ( $format in $dateFormat )
#* Create Month Select Box
*#
#if ($format=="m")
#if ($onChangeAction)
## end if "if there's a menu" if
#end
#end
#* ------------------------------------------------------------------
# The standard way to deal with the flash notifications
*# ------------------------------------------------------------------
#macro (chef_flashnotif)
#if($flashNotif)
© 2015 - 2024 Weber Informatics LLC | Privacy Policy