Template:PluginLink: Difference between revisions

From Miranda NG
Jump to navigation Jump to search
(other -> rest)
(case "links"; if no "Type", display protocols and plugins without "type" - case "list"/"download"; code cleaning)
Line 1: Line 1:
<includeonly>{{#vardefine:PluginFileName | {{{1}}}}}{{#vardefine:suffix | /{{#var:PluginLang}}}}{{PluginInfo|}}{{#switch: {{#var:Form}}
<includeonly>{{
|#default = Wrong "form" parameter
  #vardefine:PluginFileName | {{{1}}}
|list = {{#if: {{#var:Type}}  
}}{{
| {{#ifeq: {{#var:Type}} | rest | {{#if: {{#hashvalue:{{#var:PluginFileName}} |type}} || {{PluginLink/List|}} }} | {{#ifeq: {{#var:Type}} | {{#hashvalue:{{#var:PluginFileName}} |type}} | {{PluginLink/List|}} |}} }}  
  #vardefine:suffix | /{{#var:PluginLang}}
| {{#ifeq: {{#hashvalue:{{#var:PluginFileName}} |type}} | tested || {{PluginLink/List|}} }} }}
}}{{PluginInfo|}}{{
|download = {{#vardefine:linkBasename|/{{lc:{{#var:PluginFileName}}}}}}{{#if: {{#var:Type}}  
  #switch: {{#var:Form}}
| {{#ifeq: {{#var:Type}} | rest | {{#if: {{#hashvalue:{{#var:PluginFileName}} |type}} || {{PluginLink/Download|}} }} | {{#ifeq: {{#var:Type}} | {{#hashvalue:{{#var:PluginFileName}} |type}} | {{PluginLink/Download|}} |}} }}  
  |#default = Wrong "form" parameter
| {{#ifeq: {{#hashvalue:{{#var:PluginFileName}} |type}} | tested || {{PluginLink/Download|}} }} }}
  |list = {{
    #if: {{#var:Type}}
    |{{
      #ifeq: {{#var:Type}} | rest
      |{{
          #if: {{#hashvalue:{{#var:PluginFileName}} |type}}  
          |
          | {{PluginLink/List|}}
        }}
      |{{
          #ifeq: {{#var:Type}} | {{#hashvalue:{{#var:PluginFileName}} |type}}
          | {{PluginLink/List|}}  
          |
        }}
    }}
    |{{ <!-- display protocols and plugins without "type" -->
      #if: {{#hashvalue:{{#var:PluginFileName}} |type}}
      |{{
          #ifeq: {{#hashvalue:{{#var:PluginFileName}} |type}} | protocol
          | {{User:Goraf/PluginLink/List|}}
          |
        }}
      | {{PluginLink/List|}}
    }}
  }}
  |download = {{#vardefine:linkBasename|/{{lc:{{#var:PluginFileName}}}}}}{{
    #if: {{#var:Type}}
    |{{
      #ifeq: {{#var:Type}} | rest
      |{{
          #if: {{#hashvalue:{{#var:PluginFileName}} |type}}
          |
          | {{PluginLink/Download|}}
        }}
      |{{
          #ifeq: {{#var:Type}} | {{#hashvalue:{{#var:PluginFileName}} |type}}
          | {{PluginLink/Download|}}
          |
        }}
    }}
    |{{ <!-- display protocols and plugins without "type" -->
      #if: {{#hashvalue:{{#var:PluginFileName}} |type}}
      |{{
          #ifeq: {{#hashvalue:{{#var:PluginFileName}} |type}} | protocol
          | {{PluginLink/Download|}}
          |
        }}
      | {{PluginLink/Download|}}
    }}
  }}
  |links = {{
    #if: {{#var:Type}}
    |{{
      #ifeq: {{#var:Type}} | {{#hashvalue:{{#var:PluginFileName}} |type}}
      |* [[Plugin:{{#var:PluginFileName}}{{#var:suffix}} | {{#var:PluginFileName}}]] {{
          #var: {{#var:PluginFileName}}
        }}
      |
    }}
    |
  }}
}}<nowiki/></includeonly><noinclude>
}}<nowiki/></includeonly><noinclude>
{{Todo | Commentary}}
{{Todo | Commentary}}
</noinclude>
</noinclude>

Revision as of 16:30, 12 April 2013

Todo: Commentary