{def $rating = $attribute.content}
{'Rating: %current_rating/5'|i18n('extension/ezstarrating/datatype', '', hash( '%current_rating', concat('') ))} ({'%rating_count votes cast'|i18n('extension/ezstarrating/datatype', '', hash( '%rating_count', concat('', $rating.rating_count|wash, '') ))}) {if $attribute.data_int} {'disabled'|i18n('extension/ezstarrating/datatype')}.{/if} {run-once} {ezcss_require( 'star_rating.css' )} {* Enable rating code if not disabled on attribute and user has access to rate! *} {if and( $attribute.data_int|not, has_access_to_limitation( 'ezjscore', 'call', hash( 'FunctionList', 'ezstarrating_rate' ) ))} {* eZStarRating supports both yui3.0 and jQuery as decided by ezjscore.ini[eZJSCore]PreferredLibrary For the JavaScript code look in: design/standard/javascript/ezstarrating_*.js (This dual approach is not something you need to do in your extensions, but currently a service done on official extensions for now!) *} {def $preferred_lib = ezini('eZJSCore', 'PreferredLibrary', 'ezjscore.ini')} {if array( 'yui3', 'jquery' )|contains( $preferred_lib )|not()} {* Prefer jQuery if something else is used globally, since it's smaller then yui3. *} {set $preferred_lib = 'jquery'} {/if} {ezscript_require( array( concat( 'ezjsc::', $preferred_lib ), concat( 'ezjsc::', $preferred_lib, 'io' ), concat( 'ezstarrating_', $preferred_lib, '.js' ) ) )} {else} {if fetch( 'user', 'current_user' ).is_logged_in} {else} {if ezmodule( 'user/register' )} {else} {/if} {/if} {/if} {/run-once} {undef $rating}