// <![CDATA[
                        var fo = new SWFObject("%(src)s", "%(title)s", "%(width)s", "%(height)s","#336699", true);
                        fo.addParam("allowScriptAccess", "always");  //Probar y ver si es necesario quitar!!!!!
                        fo.write("swfholder");
                     // ]]>
                     </script>
                    """ % values
            return result

        elif ext=='mp3':
            values = {'src' : tag_url,
                      'title' : escape(title, 1),
                     }
            return """
            <script language="JavaScript" src="model0/audio-player.js"></script>
            <object type="application/x-shockwave-flash" data="model0/player.swf" id="audioplayer1" height="24" width="290">
            <param name="movie" value="model0/player.swf">
            <param name="FlashVars" value="playerID=1&amp;soundFile=%(src)s">
            <param name="quality" value="high">
            <param name="menu" value="false">
            <param name="wmode" value="transparent">
            </object>
            """ % values
        else:
            return "<span style='color:red'>No es una extensi&oacute;n reconocida para reporducir</span>"



# Unregistered views cannot selected by author
registerArticleModel(PAEduIntelligent)
class PloneArticleModel1View(PloneArticleModelView):
    """
    Images are displayed on the right, while attachments are on the bottom of
    the document.

    This is a simple layout that can be used for documentation, for example.
    """
    implements(IPloneArticleModel1View)

    template_id = 'pa_model1'
    title = u'Documentation model'
    title_msgid = 'model1_title'
    icon = 'pa_model1.gif'
    description_msgid = 'model1_description'

registerArticleModel(PloneArticleModel1View)

class PloneArticleModel2View(PloneArticleModelView):
    """
    The first image is displayed in the text header.

    Other images are displayed on the right, while attachments are on the bottom
    of the document.
    
    This is a simple layout that can be used for end-user articles, for example.
    """
    implements(IPloneArticleModel2View)    

    template_id = 'pa_model2'
    title = u'Newspaper article model'
    title_msgid = 'model2_title'
    """

    implements(IPAViewWithAuthor)

    template_id = 'author_pa_model' # Your layer directory must have 'my_pa_model.pt'
    title = u"Documentation model with author portrait" # Always Unicode and english
    title_msgid = 'author_model_title' # See mypamodel/i18n
    description_msgid = 'author_model_description' # See mypamodel/i18n/*
    icon = 'author_pa_model.png' # Your layer directory must have this picture

    def authorInfo(self):
        """
        See IPAViewWithAuthor
        """

        context = self.context
        portal_membership = getToolByName(context, 'portal_membership')
        portal_url = getToolByName(context, 'portal_url')()
        creator = context.Creator()
        info = portal_membership.getMemberInfo(creator)
        return {
            'fullname': info and info['fullname'] or creator,
            'url': '%s/author/%s' % (portal_url, creator),
            'portrait': portal_membership.getPersonalPortrait(creator)
            }
        


# Unregistered views cannot selected by author
registerArticleModel(PAViewWithAuthor)