added custom functions into Smarty code completion, renamed few classes
authorMartin Fousek <marfous@netbeans.org>
Thu, 10 Jun 2010 16:12:22 +0200
changeset 16327c742b6c9bc54
parent 16326 1c495c035be2
child 16328 7074d66bc2f1
added custom functions into Smarty code completion, renamed few classes
php.smarty/src/org/netbeans/modules/php/smarty/editor/completion/TplCompletionItem.java
php.smarty/src/org/netbeans/modules/php/smarty/editor/completion/TplCompletionQuery.java
php.smarty/src/org/netbeans/modules/php/smarty/editor/completion/entries/CCDataBuiltInFunction.java
php.smarty/src/org/netbeans/modules/php/smarty/editor/completion/entries/CodeCompletionEntries.java
php.smarty/src/org/netbeans/modules/php/smarty/editor/completion/entries/CodeCompletionEntryMetadata.java
php.smarty/src/org/netbeans/modules/php/smarty/editor/completion/entries/CodeCompletionItemAttributes.java
php.smarty/src/org/netbeans/modules/php/smarty/editor/completion/entries/CodeCompletionItemBuiltInFunctionsAtributes.java
php.smarty/src/org/netbeans/modules/php/smarty/editor/completion/entries/EntryMetadata.java
php.smarty/src/org/netbeans/modules/php/smarty/editor/completion/entries/SmartyCodeCompletionOffer.java
php.smarty/src/org/netbeans/modules/php/smarty/editor/completion/entries/TplCodeCompletionData.java
php.smarty/src/org/netbeans/modules/php/smarty/editor/completion/entries/defs/custom-functions.xml
     1.1 --- a/php.smarty/src/org/netbeans/modules/php/smarty/editor/completion/TplCompletionItem.java	Wed Jun 09 17:37:11 2010 +0200
     1.2 +++ b/php.smarty/src/org/netbeans/modules/php/smarty/editor/completion/TplCompletionItem.java	Thu Jun 10 16:12:22 2010 +0200
     1.3 @@ -40,7 +40,6 @@
     1.4   */
     1.5  package org.netbeans.modules.php.smarty.editor.completion;
     1.6  
     1.7 -import java.util.Arrays;
     1.8  import java.awt.Font;
     1.9  import java.awt.Graphics;
    1.10  import java.net.URL;
    1.11 @@ -57,7 +56,6 @@
    1.12  import javax.swing.text.JTextComponent;
    1.13  import org.netbeans.spi.editor.completion.support.AsyncCompletionTask;
    1.14  import org.netbeans.spi.editor.completion.support.CompletionUtilities;
    1.15 -import org.openide.xml.XMLUtil;
    1.16  
    1.17  /**
    1.18   * Code completion result item base class
    1.19 @@ -273,17 +271,17 @@
    1.20          return null;
    1.21      }
    1.22  
    1.23 -    public static class BuiltInFunction extends TplCompletionItem {
    1.24 +    public static class BuiltInFunctionsCompletionItem extends TplCompletionItem {
    1.25  
    1.26 -        protected static final String ATTR_NAME_COLOR = hexColorCode(Color.green.darker());
    1.27 +        protected static final String BUILT_IN_FUNC_COLOR = "529854";
    1.28  
    1.29 -        public BuiltInFunction(String value, int offset, String help, String helpUrl) {
    1.30 +        public BuiltInFunctionsCompletionItem(String value, int offset, String help, String helpUrl) {
    1.31              super(value, offset, help, helpUrl);
    1.32          }
    1.33  
    1.34          @Override
    1.35          protected String getLeftHtmlText() {
    1.36 -            return "<font color=#" + ATTR_NAME_COLOR + ">" + getItemText() + "</font>"; //NOI18N
    1.37 +            return "<font color=#" + BUILT_IN_FUNC_COLOR + ">" + getItemText() + "</font>"; //NOI18N
    1.38          }
    1.39  
    1.40          @Override
    1.41 @@ -293,11 +291,26 @@
    1.42  
    1.43      }
    1.44  
    1.45 -    public static class VariableModifiers extends TplCompletionItem {
    1.46 +    public static class CustomFunctionsCompletionItem extends BuiltInFunctionsCompletionItem {
    1.47 +
    1.48 +        protected static final String CUSTOM_FUNC_COLOR = "3B713B";
    1.49 +
    1.50 +        public CustomFunctionsCompletionItem(String value, int offset, String help, String helpUrl) {
    1.51 +            super(value, offset, help, helpUrl);
    1.52 +        }
    1.53 +
    1.54 +        @Override
    1.55 +        protected String getLeftHtmlText() {
    1.56 +            return "<font color=#" + CUSTOM_FUNC_COLOR + ">" + getItemText() + "</font>"; //NOI18N
    1.57 +        }
    1.58 +
    1.59 +    }
    1.60 +
    1.61 +    public static class VariableModifiersCompletionItem extends TplCompletionItem {
    1.62  
    1.63          protected static final String ATTR_NAME_COLOR = hexColorCode(Color.blue.darker());
    1.64  
    1.65 -        public VariableModifiers(String value, int offset, String help, String helpUrl) {
    1.66 +        public VariableModifiersCompletionItem(String value, int offset, String help, String helpUrl) {
    1.67              super(value, offset, help, helpUrl);
    1.68          }
    1.69  
     2.1 --- a/php.smarty/src/org/netbeans/modules/php/smarty/editor/completion/TplCompletionQuery.java	Wed Jun 09 17:37:11 2010 +0200
     2.2 +++ b/php.smarty/src/org/netbeans/modules/php/smarty/editor/completion/TplCompletionQuery.java	Thu Jun 10 16:12:22 2010 +0200
     2.3 @@ -50,8 +50,8 @@
     2.4  import org.netbeans.modules.parsing.api.Source;
     2.5  import org.netbeans.modules.parsing.api.UserTask;
     2.6  import org.netbeans.modules.parsing.spi.ParseException;
     2.7 -import org.netbeans.modules.php.smarty.editor.completion.entries.EntryMetadata;
     2.8 -import org.netbeans.modules.php.smarty.editor.completion.entries.TplCodeCompletionData;
     2.9 +import org.netbeans.modules.php.smarty.editor.completion.entries.CodeCompletionEntryMetadata;
    2.10 +import org.netbeans.modules.php.smarty.editor.completion.entries.SmartyCodeCompletionOffer;
    2.11  import org.netbeans.spi.editor.completion.CompletionItem;
    2.12  import org.openide.filesystems.FileObject;
    2.13  
    2.14 @@ -92,7 +92,7 @@
    2.15      }
    2.16  
    2.17      private CompletionResult query(ResultIterator resultIterator) {
    2.18 -        return new CompletionResult(TplCodeCompletionData.getCCData());
    2.19 +        return new CompletionResult(SmartyCodeCompletionOffer.getCCData());
    2.20      }
    2.21  
    2.22      public static class CompletionResult {
     3.1 --- a/php.smarty/src/org/netbeans/modules/php/smarty/editor/completion/entries/CCDataBuiltInFunction.java	Wed Jun 09 17:37:11 2010 +0200
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,53 +0,0 @@
     3.4 -/*
     3.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
     3.6 - *
     3.7 - * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
     3.8 - *
     3.9 - * The contents of this file are subject to the terms of either the GNU
    3.10 - * General Public License Version 2 only ("GPL") or the Common
    3.11 - * Development and Distribution License("CDDL") (collectively, the
    3.12 - * "License"). You may not use this file except in compliance with the
    3.13 - * License. You can obtain a copy of the License at
    3.14 - * http://www.netbeans.org/cddl-gplv2.html
    3.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
    3.16 - * specific language governing permissions and limitations under the
    3.17 - * License.  When distributing the software, include this License Header
    3.18 - * Notice in each file and include the License file at
    3.19 - * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
    3.20 - * particular file as subject to the "Classpath" exception as provided
    3.21 - * by Sun in the GPL Version 2 section of the License file that
    3.22 - * accompanied this code. If applicable, add the following below the
    3.23 - * License Header, with the fields enclosed by brackets [] replaced by
    3.24 - * your own identifying information:
    3.25 - * "Portions Copyrighted [year] [name of copyright owner]"
    3.26 - *
    3.27 - * If you wish your version of this file to be governed by only the CDDL
    3.28 - * or only the GPL Version 2, indicate your decision by adding
    3.29 - * "[Contributor] elects to include this software in this distribution
    3.30 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
    3.31 - * single choice of license, a recipient has the option to distribute
    3.32 - * your version of this file under either the CDDL, the GPL Version 2 or
    3.33 - * to extend the choice of license to its licensees as provided above.
    3.34 - * However, if you add GPL Version 2 code and therefore, elected the GPL
    3.35 - * Version 2 license, then the option applies only if the new code is
    3.36 - * made subject to such option by the copyright holder.
    3.37 - *
    3.38 - * Contributor(s):
    3.39 - *
    3.40 - * Portions Copyrighted 2010 Sun Microsystems, Inc.
    3.41 - */
    3.42 -
    3.43 -package org.netbeans.modules.php.smarty.editor.completion.entries;
    3.44 -
    3.45 -/**
    3.46 - *
    3.47 - * @author Martin Fousek
    3.48 - */
    3.49 -public class CCDataBuiltInFunction extends EntryMetadata {
    3.50 -
    3.51 -    public CCDataBuiltInFunction(String keyword, String help, String helpUrl) {
    3.52 -       super(keyword, help, helpUrl);
    3.53 -    }
    3.54 -
    3.55 -
    3.56 -}
     4.1 --- a/php.smarty/src/org/netbeans/modules/php/smarty/editor/completion/entries/CodeCompletionEntries.java	Wed Jun 09 17:37:11 2010 +0200
     4.2 +++ b/php.smarty/src/org/netbeans/modules/php/smarty/editor/completion/entries/CodeCompletionEntries.java	Thu Jun 10 16:12:22 2010 +0200
     4.3 @@ -42,9 +42,6 @@
     4.4  import java.io.InputStream;
     4.5  import java.util.ArrayList;
     4.6  import java.util.Collection;
     4.7 -import java.util.HashMap;
     4.8 -import java.util.Map;
     4.9 -import java.util.TreeMap;
    4.10  import javax.xml.parsers.DocumentBuilder;
    4.11  import javax.xml.parsers.DocumentBuilderFactory;
    4.12  import javax.xml.parsers.ParserConfigurationException;
    4.13 @@ -63,8 +60,8 @@
    4.14      public CodeCompletionEntries() {
    4.15      }
    4.16  
    4.17 -    protected static Collection<EntryMetadata> readAllCodeCompletionEntriesFromXML(InputStream inputStream, String completionType) throws IOException, ParserConfigurationException, SAXException {
    4.18 -        Collection<EntryMetadata> ccEntries = new ArrayList<EntryMetadata>();
    4.19 +    protected static Collection<CodeCompletionEntryMetadata> readAllCodeCompletionEntriesFromXML(InputStream inputStream, String completionType) throws IOException, ParserConfigurationException, SAXException {
    4.20 +        Collection<CodeCompletionEntryMetadata> ccEntries = new ArrayList<CodeCompletionEntryMetadata>();
    4.21          DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    4.22          DocumentBuilder db = dbf.newDocumentBuilder();
    4.23          Document doc = db.parse(inputStream);
    4.24 @@ -80,12 +77,12 @@
    4.25                  String url = elem.getElementsByTagName("url").item(0).getTextContent();
    4.26                  String help = "";
    4.27                  NodeList attributes = elem.getElementsByTagName("attributes");
    4.28 -                if (completionType.equals("built-in-functions")) {
    4.29 +                if (completionType.equals("built-in-functions") || completionType.equals("custom-functions")) {
    4.30                      help = generateHelpForBuiltInFunctions(desc, attributes);
    4.31                  } else {
    4.32                      help = generateHelpForVariableModifiers(desc, attributes);
    4.33                  }
    4.34 -                ccEntries.add(new CCDataBuiltInFunction(elem.getAttribute("name"), help, url));
    4.35 +                ccEntries.add(new CodeCompletionEntryMetadata(elem.getAttribute("name"), help, url));
    4.36              }
    4.37          }
    4.38  
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/php.smarty/src/org/netbeans/modules/php/smarty/editor/completion/entries/CodeCompletionEntryMetadata.java	Thu Jun 10 16:12:22 2010 +0200
     5.3 @@ -0,0 +1,69 @@
     5.4 +/*
     5.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
     5.6 + *
     5.7 + * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
     5.8 + *
     5.9 + * The contents of this file are subject to the terms of either the GNU
    5.10 + * General Public License Version 2 only ("GPL") or the Common
    5.11 + * Development and Distribution License("CDDL") (collectively, the
    5.12 + * "License"). You may not use this file except in compliance with the
    5.13 + * License. You can obtain a copy of the License at
    5.14 + * http://www.netbeans.org/cddl-gplv2.html
    5.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
    5.16 + * specific language governing permissions and limitations under the
    5.17 + * License.  When distributing the software, include this License Header
    5.18 + * Notice in each file and include the License file at
    5.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
    5.20 + * particular file as subject to the "Classpath" exception as provided
    5.21 + * by Sun in the GPL Version 2 section of the License file that
    5.22 + * accompanied this code. If applicable, add the following below the
    5.23 + * License Header, with the fields enclosed by brackets [] replaced by
    5.24 + * your own identifying information:
    5.25 + * "Portions Copyrighted [year] [name of copyright owner]"
    5.26 + *
    5.27 + * If you wish your version of this file to be governed by only the CDDL
    5.28 + * or only the GPL Version 2, indicate your decision by adding
    5.29 + * "[Contributor] elects to include this software in this distribution
    5.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
    5.31 + * single choice of license, a recipient has the option to distribute
    5.32 + * your version of this file under either the CDDL, the GPL Version 2 or
    5.33 + * to extend the choice of license to its licensees as provided above.
    5.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
    5.35 + * Version 2 license, then the option applies only if the new code is
    5.36 + * made subject to such option by the copyright holder.
    5.37 + *
    5.38 + * Contributor(s):
    5.39 + *
    5.40 + * Portions Copyrighted 2010 Sun Microsystems, Inc.
    5.41 + */
    5.42 +
    5.43 +package org.netbeans.modules.php.smarty.editor.completion.entries;
    5.44 +
    5.45 +/**
    5.46 + *
    5.47 + * @author Martin Fousek
    5.48 + */
    5.49 +public class CodeCompletionEntryMetadata {
    5.50 +
    5.51 +    private String keyword;
    5.52 +    private String help;
    5.53 +    private String helpUrl;
    5.54 +
    5.55 +    public CodeCompletionEntryMetadata(String keyword, String help, String helpUrl) {
    5.56 +        this.keyword = keyword;
    5.57 +        this.help = help;
    5.58 +        this.helpUrl = helpUrl;
    5.59 +    }
    5.60 +
    5.61 +    public String getKeyword() {
    5.62 +        return keyword;
    5.63 +    }
    5.64 +
    5.65 +    public String getHelp() {
    5.66 +        return help;
    5.67 +    }
    5.68 +
    5.69 +    public String getHelpUrl() {
    5.70 +        return helpUrl;
    5.71 +    }
    5.72 +}
     6.1 --- a/php.smarty/src/org/netbeans/modules/php/smarty/editor/completion/entries/CodeCompletionItemAttributes.java	Wed Jun 09 17:37:11 2010 +0200
     6.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3 @@ -1,56 +0,0 @@
     6.4 -/*
     6.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
     6.6 - *
     6.7 - * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
     6.8 - *
     6.9 - * The contents of this file are subject to the terms of either the GNU
    6.10 - * General Public License Version 2 only ("GPL") or the Common
    6.11 - * Development and Distribution License("CDDL") (collectively, the
    6.12 - * "License"). You may not use this file except in compliance with the
    6.13 - * License. You can obtain a copy of the License at
    6.14 - * http://www.netbeans.org/cddl-gplv2.html
    6.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
    6.16 - * specific language governing permissions and limitations under the
    6.17 - * License.  When distributing the software, include this License Header
    6.18 - * Notice in each file and include the License file at
    6.19 - * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
    6.20 - * particular file as subject to the "Classpath" exception as provided
    6.21 - * by Sun in the GPL Version 2 section of the License file that
    6.22 - * accompanied this code. If applicable, add the following below the
    6.23 - * License Header, with the fields enclosed by brackets [] replaced by
    6.24 - * your own identifying information:
    6.25 - * "Portions Copyrighted [year] [name of copyright owner]"
    6.26 - *
    6.27 - * If you wish your version of this file to be governed by only the CDDL
    6.28 - * or only the GPL Version 2, indicate your decision by adding
    6.29 - * "[Contributor] elects to include this software in this distribution
    6.30 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
    6.31 - * single choice of license, a recipient has the option to distribute
    6.32 - * your version of this file under either the CDDL, the GPL Version 2 or
    6.33 - * to extend the choice of license to its licensees as provided above.
    6.34 - * However, if you add GPL Version 2 code and therefore, elected the GPL
    6.35 - * Version 2 license, then the option applies only if the new code is
    6.36 - * made subject to such option by the copyright holder.
    6.37 - *
    6.38 - * Contributor(s):
    6.39 - *
    6.40 - * Portions Copyrighted 2010 Sun Microsystems, Inc.
    6.41 - */
    6.42 -
    6.43 -package org.netbeans.modules.php.smarty.editor.completion.entries;
    6.44 -
    6.45 -/**
    6.46 - *
    6.47 - * @author Martin Fousek
    6.48 - */
    6.49 -public class CodeCompletionItemAttributes {
    6.50 -    private String attType, attRequired, attDefault, addDescription;
    6.51 -
    6.52 -    public CodeCompletionItemAttributes(String attType, String attRequired, String attDefault, String addDescription) {
    6.53 -        this.attType = attType;
    6.54 -        this.attRequired = attRequired;
    6.55 -        this.attDefault = attDefault;
    6.56 -        this.addDescription = addDescription;
    6.57 -    }
    6.58 -
    6.59 -}
     7.1 --- a/php.smarty/src/org/netbeans/modules/php/smarty/editor/completion/entries/CodeCompletionItemBuiltInFunctionsAtributes.java	Wed Jun 09 17:37:11 2010 +0200
     7.2 +++ b/php.smarty/src/org/netbeans/modules/php/smarty/editor/completion/entries/CodeCompletionItemBuiltInFunctionsAtributes.java	Thu Jun 10 16:12:22 2010 +0200
     7.3 @@ -43,11 +43,14 @@
     7.4   *
     7.5   * @author Martin Fousek
     7.6   */
     7.7 -public class CodeCompletionItemBuiltInFunctionsAtributes extends CodeCompletionItemAttributes {
     7.8 -    private String attName;
     7.9 +public class CodeCompletionItemBuiltInFunctionsAtributes {
    7.10 +    private String attType, attRequired, attDefault, addDescription, attName;
    7.11  
    7.12 -    public CodeCompletionItemBuiltInFunctionsAtributes(String attName, String attType, String attRequired, String attDefault, String addDescription) {
    7.13 -        super(attType, attRequired, attDefault, addDescription);
    7.14 +    public CodeCompletionItemBuiltInFunctionsAtributes(String attType, String attRequired, String attDefault, String addDescription, String attName) {
    7.15 +        this.attType = attType;
    7.16 +        this.attRequired = attRequired;
    7.17 +        this.attDefault = attDefault;
    7.18 +        this.addDescription = addDescription;
    7.19          this.attName = attName;
    7.20      }
    7.21  
     8.1 --- a/php.smarty/src/org/netbeans/modules/php/smarty/editor/completion/entries/EntryMetadata.java	Wed Jun 09 17:37:11 2010 +0200
     8.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.3 @@ -1,69 +0,0 @@
     8.4 -/*
     8.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
     8.6 - *
     8.7 - * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
     8.8 - *
     8.9 - * The contents of this file are subject to the terms of either the GNU
    8.10 - * General Public License Version 2 only ("GPL") or the Common
    8.11 - * Development and Distribution License("CDDL") (collectively, the
    8.12 - * "License"). You may not use this file except in compliance with the
    8.13 - * License. You can obtain a copy of the License at
    8.14 - * http://www.netbeans.org/cddl-gplv2.html
    8.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
    8.16 - * specific language governing permissions and limitations under the
    8.17 - * License.  When distributing the software, include this License Header
    8.18 - * Notice in each file and include the License file at
    8.19 - * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
    8.20 - * particular file as subject to the "Classpath" exception as provided
    8.21 - * by Sun in the GPL Version 2 section of the License file that
    8.22 - * accompanied this code. If applicable, add the following below the
    8.23 - * License Header, with the fields enclosed by brackets [] replaced by
    8.24 - * your own identifying information:
    8.25 - * "Portions Copyrighted [year] [name of copyright owner]"
    8.26 - *
    8.27 - * If you wish your version of this file to be governed by only the CDDL
    8.28 - * or only the GPL Version 2, indicate your decision by adding
    8.29 - * "[Contributor] elects to include this software in this distribution
    8.30 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
    8.31 - * single choice of license, a recipient has the option to distribute
    8.32 - * your version of this file under either the CDDL, the GPL Version 2 or
    8.33 - * to extend the choice of license to its licensees as provided above.
    8.34 - * However, if you add GPL Version 2 code and therefore, elected the GPL
    8.35 - * Version 2 license, then the option applies only if the new code is
    8.36 - * made subject to such option by the copyright holder.
    8.37 - *
    8.38 - * Contributor(s):
    8.39 - *
    8.40 - * Portions Copyrighted 2010 Sun Microsystems, Inc.
    8.41 - */
    8.42 -
    8.43 -package org.netbeans.modules.php.smarty.editor.completion.entries;
    8.44 -
    8.45 -/**
    8.46 - *
    8.47 - * @author Martin Fousek
    8.48 - */
    8.49 -public abstract class EntryMetadata {
    8.50 -
    8.51 -    private String keyword;
    8.52 -    private String help;
    8.53 -    private String helpUrl;
    8.54 -
    8.55 -    public EntryMetadata(String keyword, String help, String helpUrl) {
    8.56 -        this.keyword = keyword;
    8.57 -        this.help = help;
    8.58 -        this.helpUrl = helpUrl;
    8.59 -    }
    8.60 -
    8.61 -    public String getKeyword() {
    8.62 -        return keyword;
    8.63 -    }
    8.64 -
    8.65 -    public String getHelp() {
    8.66 -        return help;
    8.67 -    }
    8.68 -
    8.69 -    public String getHelpUrl() {
    8.70 -        return helpUrl;
    8.71 -    }
    8.72 -}
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/php.smarty/src/org/netbeans/modules/php/smarty/editor/completion/entries/SmartyCodeCompletionOffer.java	Thu Jun 10 16:12:22 2010 +0200
     9.3 @@ -0,0 +1,101 @@
     9.4 +/*
     9.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
     9.6 + *
     9.7 + * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
     9.8 + *
     9.9 + * The contents of this file are subject to the terms of either the GNU
    9.10 + * General Public License Version 2 only ("GPL") or the Common
    9.11 + * Development and Distribution License("CDDL") (collectively, the
    9.12 + * "License"). You may not use this file except in compliance with the
    9.13 + * License. You can obtain a copy of the License at
    9.14 + * http://www.netbeans.org/cddl-gplv2.html
    9.15 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
    9.16 + * specific language governing permissions and limitations under the
    9.17 + * License.  When distributing the software, include this License Header
    9.18 + * Notice in each file and include the License file at
    9.19 + * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
    9.20 + * particular file as subject to the "Classpath" exception as provided
    9.21 + * by Sun in the GPL Version 2 section of the License file that
    9.22 + * accompanied this code. If applicable, add the following below the
    9.23 + * License Header, with the fields enclosed by brackets [] replaced by
    9.24 + * your own identifying information:
    9.25 + * "Portions Copyrighted [year] [name of copyright owner]"
    9.26 + *
    9.27 + * If you wish your version of this file to be governed by only the CDDL
    9.28 + * or only the GPL Version 2, indicate your decision by adding
    9.29 + * "[Contributor] elects to include this software in this distribution
    9.30 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
    9.31 + * single choice of license, a recipient has the option to distribute
    9.32 + * your version of this file under either the CDDL, the GPL Version 2 or
    9.33 + * to extend the choice of license to its licensees as provided above.
    9.34 + * However, if you add GPL Version 2 code and therefore, elected the GPL
    9.35 + * Version 2 license, then the option applies only if the new code is
    9.36 + * made subject to such option by the copyright holder.
    9.37 + *
    9.38 + * Contributor(s):
    9.39 + *
    9.40 + * Portions Copyrighted 2010 Sun Microsystems, Inc.
    9.41 + */
    9.42 +package org.netbeans.modules.php.smarty.editor.completion.entries;
    9.43 +
    9.44 +import java.io.InputStream;
    9.45 +import java.util.ArrayList;
    9.46 +import java.util.Collection;
    9.47 +import org.netbeans.modules.php.smarty.editor.completion.TplCompletionItem;
    9.48 +import org.netbeans.modules.php.smarty.editor.completion.TplCompletionItem.BuiltInFunctionsCompletionItem;
    9.49 +import org.netbeans.modules.php.smarty.editor.completion.TplCompletionItem.CustomFunctionsCompletionItem;
    9.50 +import org.netbeans.modules.php.smarty.editor.completion.TplCompletionItem.VariableModifiersCompletionItem;
    9.51 +import org.openide.util.Exceptions;
    9.52 +
    9.53 +/**
    9.54 + *
    9.55 + * @author Martin Fousek
    9.56 + */
    9.57 +public class SmartyCodeCompletionOffer {
    9.58 +
    9.59 +    private final static Collection<TplCompletionItem> completionItems = new ArrayList<TplCompletionItem>();
    9.60 +    private final static String[] completionTypes = {"built-in-functions", "variable-modifiers", "custom-functions"};
    9.61 +
    9.62 +    static {
    9.63 +        loadCCData();
    9.64 +    }
    9.65 +
    9.66 +    public static Collection<TplCompletionItem> getCCData() {
    9.67 +        return completionItems;
    9.68 +    }
    9.69 +
    9.70 +    private static void loadCCData() {
    9.71 +        for (String completionType : completionTypes) {
    9.72 +            Collection<CodeCompletionEntryMetadata> ccList = parseCCData(completionType);
    9.73 +            if (completionType.equals("built-in-functions") ) {
    9.74 +                for (CodeCompletionEntryMetadata entryMetadata : ccList) {
    9.75 +                    completionItems.add(new BuiltInFunctionsCompletionItem(entryMetadata.getKeyword(), 0, entryMetadata.getHelp(), entryMetadata.getHelpUrl()));
    9.76 +                }
    9.77 +            }
    9.78 +            else if (completionType.equals("custom-functions")) {
    9.79 +                for (CodeCompletionEntryMetadata entryMetadata : ccList) {
    9.80 +                    completionItems.add(new CustomFunctionsCompletionItem(entryMetadata.getKeyword(), 0, entryMetadata.getHelp(), entryMetadata.getHelpUrl()));
    9.81 +                }
    9.82 +            }
    9.83 +            else if (completionType.equals("variable-modifiers")) {
    9.84 +                for (CodeCompletionEntryMetadata entryMetadata : ccList) {
    9.85 +                    completionItems.add(new VariableModifiersCompletionItem(entryMetadata.getKeyword(), 0, entryMetadata.getHelp(), entryMetadata.getHelpUrl()));
    9.86 +                }
    9.87 +            }
    9.88 +        }
    9.89 +    }
    9.90 +
    9.91 +    private static Collection<CodeCompletionEntryMetadata> parseCCData(String filePath) {
    9.92 +        Collection<CodeCompletionEntryMetadata> ccList = new ArrayList<CodeCompletionEntryMetadata>();
    9.93 +        InputStream inputStream = SmartyCodeCompletionOffer.class.getResourceAsStream("defs/" + filePath + ".xml"); //NOI18N
    9.94 +
    9.95 +        try {
    9.96 +            Collection<CodeCompletionEntryMetadata> ccData = CodeCompletionEntries.readAllCodeCompletionEntriesFromXML(inputStream, filePath);
    9.97 +            ccList.addAll(ccData);
    9.98 +
    9.99 +        } catch (Exception ex) {
   9.100 +            Exceptions.printStackTrace(ex);
   9.101 +        }
   9.102 +        return ccList;
   9.103 +    }
   9.104 +}
    10.1 --- a/php.smarty/src/org/netbeans/modules/php/smarty/editor/completion/entries/TplCodeCompletionData.java	Wed Jun 09 17:37:11 2010 +0200
    10.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.3 @@ -1,100 +0,0 @@
    10.4 -/*
    10.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    10.6 - *
    10.7 - * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
    10.8 - *
    10.9 - * The contents of this file are subject to the terms of either the GNU
   10.10 - * General Public License Version 2 only ("GPL") or the Common
   10.11 - * Development and Distribution License("CDDL") (collectively, the
   10.12 - * "License"). You may not use this file except in compliance with the
   10.13 - * License. You can obtain a copy of the License at
   10.14 - * http://www.netbeans.org/cddl-gplv2.html
   10.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
   10.16 - * specific language governing permissions and limitations under the
   10.17 - * License.  When distributing the software, include this License Header
   10.18 - * Notice in each file and include the License file at
   10.19 - * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
   10.20 - * particular file as subject to the "Classpath" exception as provided
   10.21 - * by Sun in the GPL Version 2 section of the License file that
   10.22 - * accompanied this code. If applicable, add the following below the
   10.23 - * License Header, with the fields enclosed by brackets [] replaced by
   10.24 - * your own identifying information:
   10.25 - * "Portions Copyrighted [year] [name of copyright owner]"
   10.26 - *
   10.27 - * If you wish your version of this file to be governed by only the CDDL
   10.28 - * or only the GPL Version 2, indicate your decision by adding
   10.29 - * "[Contributor] elects to include this software in this distribution
   10.30 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
   10.31 - * single choice of license, a recipient has the option to distribute
   10.32 - * your version of this file under either the CDDL, the GPL Version 2 or
   10.33 - * to extend the choice of license to its licensees as provided above.
   10.34 - * However, if you add GPL Version 2 code and therefore, elected the GPL
   10.35 - * Version 2 license, then the option applies only if the new code is
   10.36 - * made subject to such option by the copyright holder.
   10.37 - *
   10.38 - * Contributor(s):
   10.39 - *
   10.40 - * Portions Copyrighted 2010 Sun Microsystems, Inc.
   10.41 - */
   10.42 -package org.netbeans.modules.php.smarty.editor.completion.entries;
   10.43 -
   10.44 -import java.io.InputStream;
   10.45 -import java.util.ArrayList;
   10.46 -import java.util.Arrays;
   10.47 -import java.util.Collection;
   10.48 -import java.util.List;
   10.49 -import java.util.Map;
   10.50 -import java.util.TreeMap;
   10.51 -import org.netbeans.modules.php.smarty.editor.completion.TplCompletionItem;
   10.52 -import org.netbeans.modules.php.smarty.editor.completion.TplCompletionItem.BuiltInFunction;
   10.53 -import org.netbeans.modules.php.smarty.editor.completion.TplCompletionItem.VariableModifiers;
   10.54 -import org.netbeans.spi.editor.completion.CompletionItem;
   10.55 -import org.openide.util.Exceptions;
   10.56 -
   10.57 -/**
   10.58 - *
   10.59 - * @author Martin Fousek
   10.60 - */
   10.61 -public class TplCodeCompletionData {
   10.62 -
   10.63 -    private final static Collection<TplCompletionItem> completionItems = new ArrayList<TplCompletionItem>();
   10.64 -    private final static String[] completionTypes = {"built-in-functions", "variable-modifiers"};
   10.65 -
   10.66 -    static {
   10.67 -        loadCCData();
   10.68 -    }
   10.69 -
   10.70 -    public static Collection<TplCompletionItem> getCCData() {
   10.71 -        return completionItems;
   10.72 -    }
   10.73 -
   10.74 -    private static void loadCCData() {
   10.75 -        for (String completionType : completionTypes) {
   10.76 -            Collection<EntryMetadata> ccList = parseCCData(completionType);
   10.77 -            if (completionType.equals("built-in-functions")) {
   10.78 -                for (EntryMetadata entryMetadata : ccList) {
   10.79 -                    completionItems.add(new BuiltInFunction(entryMetadata.getKeyword(), 0, entryMetadata.getHelp(), entryMetadata.getHelpUrl()));
   10.80 -                }
   10.81 -            }
   10.82 -            else if (completionType.equals("variable-modifiers")) {
   10.83 -                for (EntryMetadata entryMetadata : ccList) {
   10.84 -                    completionItems.add(new VariableModifiers(entryMetadata.getKeyword(), 0, entryMetadata.getHelp(), entryMetadata.getHelpUrl()));
   10.85 -                }
   10.86 -            }
   10.87 -        }
   10.88 -    }
   10.89 -
   10.90 -    private static Collection<EntryMetadata> parseCCData(String filePath) {
   10.91 -        Collection<EntryMetadata> ccList = new ArrayList<EntryMetadata>();
   10.92 -        InputStream inputStream = TplCodeCompletionData.class.getResourceAsStream("defs/" + filePath + ".xml"); //NOI18N
   10.93 -
   10.94 -        try {
   10.95 -            Collection<EntryMetadata> ccData = CodeCompletionEntries.readAllCodeCompletionEntriesFromXML(inputStream, filePath);
   10.96 -            ccList.addAll(ccData);
   10.97 -
   10.98 -        } catch (Exception ex) {
   10.99 -            Exceptions.printStackTrace(ex);
  10.100 -        }
  10.101 -        return ccList;
  10.102 -    }
  10.103 -}
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/php.smarty/src/org/netbeans/modules/php/smarty/editor/completion/entries/defs/custom-functions.xml	Thu Jun 10 16:12:22 2010 +0200
    11.3 @@ -0,0 +1,1157 @@
    11.4 +<?xml version="1.0" encoding="UTF-8"?>
    11.5 +
    11.6 +<!--
    11.7 +    Document   : custom-functions.xml
    11.8 +    Created on : Jun 10, 2010, 13:00 AM
    11.9 +    Author     : Martin Fousek
   11.10 +    Description:
   11.11 +        Purpose of the document is storage for Smarty code completion keywords - custom functions.
   11.12 +-->
   11.13 +
   11.14 +<entries>
   11.15 +    <entry name="assign">
   11.16 +        <description>{assign} is used for assigning template variables during the execution of a template. </description>
   11.17 +        <attributes>
   11.18 +            <attribute name="var">
   11.19 +                <type>string</type>
   11.20 +                <required>yes</required>
   11.21 +                <default>n/a</default>
   11.22 +                <description>The name of the variable being assigned</description>
   11.23 +            </attribute>
   11.24 +            <attribute name="value">
   11.25 +                <type>string</type>
   11.26 +                <required>yes</required>
   11.27 +                <default>n/a</default>
   11.28 +                <description>The value being assigned</description>
   11.29 +            </attribute>
   11.30 +        </attributes>
   11.31 +        <url>http://www.smarty.net/manual/en/language.custom.functions.php#language.function.assign</url>
   11.32 +    </entry>
   11.33 +
   11.34 +    <entry name="counter">
   11.35 +        <description> {counter} is used to print out a count. {counter} will remember the count on each iteration. You can adjust the number, the interval and the direction of the count, as well as determine whether or not to print the value. You can run multiple counters concurrently by supplying a unique name for each one. If you do not supply a name, the name "default" will be used. &lt;br&gt;&lt;br&gt; If you supply the assign attribute, the output of the {counter} function will be assigned to this template variable instead of being output to the template. </description>
   11.36 +        <attributes>
   11.37 +            <attribute name="name">
   11.38 +                <type>string</type>
   11.39 +                <required>no</required>
   11.40 +                <default>default</default>
   11.41 +                <description>The name of the counter</description>
   11.42 +            </attribute>
   11.43 +            <attribute name="start">
   11.44 +                <type>number</type>
   11.45 +                <required>no</required>
   11.46 +                <default>1</default>
   11.47 +                <description>The initial number to start counting from</description>
   11.48 +            </attribute>
   11.49 +            <attribute name="skip">
   11.50 +                <type>number</type>
   11.51 +                <required>no</required>
   11.52 +                <default>1</default>
   11.53 +                <description>The interval to count by</description>
   11.54 +            </attribute>
   11.55 +            <attribute name="direction">
   11.56 +                <type>string</type>
   11.57 +                <required>no</required>
   11.58 +                <default>up</default>
   11.59 +                <description>The direction to count (up/down)</description>
   11.60 +            </attribute>
   11.61 +            <attribute name="print">
   11.62 +                <type>boolean</type>
   11.63 +                <required>no</required>
   11.64 +                <default>true</default>
   11.65 +                <description>Whether or not to print the value</description>
   11.66 +            </attribute>
   11.67 +            <attribute name="assign">
   11.68 +                <type>string</type>
   11.69 +                <required>no</required>
   11.70 +                <default>n/a</default>
   11.71 +                <description>the template variable the output will be assigned to</description>
   11.72 +            </attribute>
   11.73 +        </attributes>
   11.74 +        <url>http://www.smarty.net/manual/en/language.function.counter.php</url>
   11.75 +    </entry>
   11.76 +
   11.77 +    <entry name="cycle">
   11.78 +        <description> {cycle} is used to alternate a set of values. This makes it easy to for example, alternate between two or more colors in a table, or cycle through an array of values. </description>
   11.79 +        <attributes>
   11.80 +            <attribute name="name">
   11.81 +                <type>string</type>
   11.82 +                <required>no</required>
   11.83 +                <default>default</default>
   11.84 +                <description>The name of the cycle</description>
   11.85 +            </attribute>
   11.86 +            <attribute name="values">
   11.87 +                <type>mixed</type>
   11.88 +                <required>yes</required>
   11.89 +                <default>n/a</default>
   11.90 +                <description>The values to cycle through, either a comma delimited list (see delimiter attribute), or an array of values</description>
   11.91 +            </attribute>
   11.92 +            <attribute name="print">
   11.93 +                <type>boolean</type>
   11.94 +                <required>no</required>
   11.95 +                <default>true</default>
   11.96 +                <description>Whether to print the value or not</description>
   11.97 +            </attribute>
   11.98 +            <attribute name="advance">
   11.99 +                <type>boolean</type>
  11.100 +                <required>no</required>
  11.101 +                <default>true</default>
  11.102 +                <description>Whether or not to advance to the next value</description>
  11.103 +            </attribute>
  11.104 +            <attribute name="delimiter">
  11.105 +                <type>string</type>
  11.106 +                <required>no</required>
  11.107 +                <default>,</default>
  11.108 +                <description>The delimiter to use in the values attribute</description>
  11.109 +            </attribute>
  11.110 +            <attribute name="assign">
  11.111 +                <type>string</type>
  11.112 +                <required>no</required>
  11.113 +                <default>n/a</default>
  11.114 +                <description>The template variable the output will be assigned to</description>
  11.115 +            </attribute>
  11.116 +            <attribute name="reset">
  11.117 +                <type>boolean</type>
  11.118 +                <required>no</required>
  11.119 +                <default>false</default>
  11.120 +                <description>The cycle will be set to the first value and not advanced</description>
  11.121 +            </attribute>
  11.122 +        </attributes>
  11.123 +        <url>http://www.smarty.net/manual/en/language.function.cycle.php</url>
  11.124 +    </entry>
  11.125 +
  11.126 +    <entry name="debug">
  11.127 +        <description> {debug} dumps the debug console to the page. This works regardless of the debug  settings in the php script. Since this gets executed at runtime, this is only able to show the assigned  variables; not the templates that are in use. However, you can see all the currently available variables within the scope of a template.  </description>
  11.128 +        <attributes>
  11.129 +            <attribute name="output">
  11.130 +                <type>string</type>
  11.131 +                <required>no</required>
  11.132 +                <default>javascript</default>
  11.133 +                <description>output type, html or javascript</description>
  11.134 +            </attribute>
  11.135 +        </attributes>
  11.136 +        <url>http://www.smarty.net/manual/en/language.function.debug.php</url>
  11.137 +    </entry>
  11.138 +
  11.139 +    <entry name="eval">
  11.140 +        <description>  {eval} is used to evaluate a variable as a template. This can be used for things like embedding template tags/variables into variables or tags/variables into config file variables. &lt;br&gt;&lt;br&gt;If you supply the assign attribute, the output of the {eval} function will be assigned to this template variable instead of being output to the template.  </description>
  11.141 +        <attributes>
  11.142 +            <attribute name="var">
  11.143 +                <type>mixed</type>
  11.144 +                <required>yes</required>
  11.145 +                <default>n/a</default>
  11.146 +                <description>Variable (or string) to evaluate</description>
  11.147 +            </attribute>
  11.148 +            <attribute name="assign">
  11.149 +                <type>string</type>
  11.150 +                <required>no</required>
  11.151 +                <default>n/a</default>
  11.152 +                <description>The template variable the output will be assigned to</description>
  11.153 +            </attribute>
  11.154 +        </attributes>
  11.155 +        <url>http://www.smarty.net/manual/en/language.function.eval.php</url>
  11.156 +    </entry>
  11.157 +
  11.158 +    <entry name="fetch">
  11.159 +        <description>  {fetch} is used to retrieve files from the local file system, http, or ftp and display the contents. &lt;ul&gt;&lt;li&gt; If the file name begins with http://, the web site page will be fetched and displayed. Note: This will not support http redirects, be sure to include a trailing slash on your web page fetches where necessary. &lt;/li&gt;&lt;li&gt;If the file name begins with ftp://, the file will be downloaded from the ftp server and displayed.&lt;/li&gt; &lt;li&gt;For local files, either a full system file path must be given, or a path relative to the executed php script. Note: If template $security is enabled and you are fetching a file from the local file system, {fetch} will only allow files from within one of the defined secure directories.&lt;/li&gt;&lt;li&gt;If the assign attribute is set, the output of the {fetch} function will be assigned to this template variable instead of being output to the template.&lt;/li&gt;</description>
  11.160 +        <attributes>
  11.161 +            <attribute name="file">
  11.162 +                <type>string</type>
  11.163 +                <required>yes</required>
  11.164 +                <default>n/a</default>
  11.165 +                <description>The file, http or ftp site to fetch</description>
  11.166 +            </attribute>
  11.167 +            <attribute name="assign">
  11.168 +                <type>string</type>
  11.169 +                <required>no</required>
  11.170 +                <default>n/a</default>
  11.171 +                <description>The template variable the output will be assigned to</description>
  11.172 +            </attribute>
  11.173 +        </attributes>
  11.174 +        <url>http://www.smarty.net/manual/en/language.function.fetch.php</url>
  11.175 +    </entry>
  11.176 +    
  11.177 +    <entry name="html_checkboxes">
  11.178 +        <description> {html_checkboxes} is a custom function  that creates an html checkbox group with provided data. It takes care of which item(s) are selected by default as well. </description>
  11.179 +        <attributes>
  11.180 +            <attribute name="name">
  11.181 +                <type>string</type>
  11.182 +                <required>no</required>
  11.183 +                <default>checkbox</default>
  11.184 +                <description>Name of checkbox list</description>
  11.185 +            </attribute>
  11.186 +            <attribute name="values">
  11.187 +                <type>string</type>
  11.188 +                <required>Yes, unless using options attribute</required>
  11.189 +                <default>n/a</default>
  11.190 +                <description>An array of values for checkbox buttons</description>
  11.191 +            </attribute>
  11.192 +            <attribute name="output">
  11.193 +                <type>string/array</type>
  11.194 +                <required>Yes, unless using options attribute</required>
  11.195 +                <default>n/a</default>
  11.196 +                <description>An array of output for checkbox buttons</description>
  11.197 +            </attribute>
  11.198 +            <attribute name="selected">
  11.199 +                <type>associative array</type>
  11.200 +                <required>Yes, unless using options attribute</required>
  11.201 +                <default>empty</default>
  11.202 +                <description>The selected checkbox element(s)</description>
  11.203 +            </attribute>
  11.204 +            <attribute name="options">
  11.205 +                <type>string</type>
  11.206 +                <required>no</required>
  11.207 +                <default>empty</default>
  11.208 +                <description>An associative array of values and output</description>
  11.209 +            </attribute>
  11.210 +            <attribute name="separator">
  11.211 +                <type>string</type>
  11.212 +                <required>no</required>
  11.213 +                <default>empty</default>
  11.214 +                <description>String of text to separate each checkbox item</description>
  11.215 +            </attribute>
  11.216 +            <attribute name="labels">
  11.217 +                <type>boolean</type>
  11.218 +                <required>no</required>
  11.219 +                <default>true</default>
  11.220 +                <description>Add label-tags to the output</description>
  11.221 +            </attribute>
  11.222 +            <attribute name="assign">
  11.223 +                <type>string</type>
  11.224 +                <required>no</required>
  11.225 +                <default>empty</default>
  11.226 +                <description>Assign the output to an array with each checkbox's output as one element.</description>
  11.227 +            </attribute>
  11.228 +        </attributes>
  11.229 +        <url>http://www.smarty.net/manual/en/language.function.html.checkboxes.php</url>
  11.230 +    </entry>
  11.231 +
  11.232 +    <entry name="html_image">
  11.233 +        <description>{html_image} is a custom function  that generates an HTML img tag. The height and width  are automatically calculated from the image file if they are not supplied.  </description>
  11.234 +        <attributes>
  11.235 +            <attribute name="file">
  11.236 +                <type>string</type>
  11.237 +                <required>yes</required>
  11.238 +                <default>n/a</default>
  11.239 +                <description>name/path to image</description>
  11.240 +            </attribute>
  11.241 +            <attribute name="height">
  11.242 +                <type>string</type>
  11.243 +                <required>no</required>
  11.244 +                <default>actual image height</default>
  11.245 +                <description>Height to display image</description>
  11.246 +            </attribute>
  11.247 +            <attribute name="width">
  11.248 +                <type>string</type>
  11.249 +                <required>no</required>
  11.250 +                <default>actual image width</default>
  11.251 +                <description>Width to display image</description>
  11.252 +            </attribute>
  11.253 +            <attribute name="basedir">
  11.254 +                <type>string</type>
  11.255 +                <required>no</required>
  11.256 +                <default>web server doc root</default>
  11.257 +                <description>Directory to base relative paths from</description>
  11.258 +            </attribute>
  11.259 +            <attribute name="alt">
  11.260 +                <type>string</type>
  11.261 +                <required>no</required>
  11.262 +                <default>""</default>
  11.263 +                <description>Alternative description of the image</description>
  11.264 +            </attribute>
  11.265 +            <attribute name="href">
  11.266 +                <type>string</type>
  11.267 +                <required>no</required>
  11.268 +                <default>n/a</default>
  11.269 +                <description>href value to link the image to</description>
  11.270 +            </attribute>
  11.271 +            <attribute name="path_prefix">
  11.272 +                <type>string</type>
  11.273 +                <required>no</required>
  11.274 +                <default>n/a</default>
  11.275 +                <description>Prefix for output path</description>
  11.276 +            </attribute>
  11.277 +        </attributes>
  11.278 +        <url>http://www.smarty.net/manual/en/language.function.html.image.php</url>
  11.279 +    </entry>
  11.280 +
  11.281 +    <entry name="html_options">
  11.282 +        <description>{html_options} is a custom function  that creates the html select-option group with the assigned data. It takes care of which item(s) are selected by default as well.</description>
  11.283 +        <attributes>
  11.284 +            <attribute name="values">
  11.285 +                <type>array</type>
  11.286 +                <required>Yes, unless using options attribute</required>
  11.287 +                <default>n/a</default>
  11.288 +                <description>An array of values for dropdown</description>
  11.289 +            </attribute>
  11.290 +            <attribute name="output">
  11.291 +                <type>array</type>
  11.292 +                <required>Yes, unless using options attribute</required>
  11.293 +                <default>n/a</default>
  11.294 +                <description>An array of output for dropdown</description>
  11.295 +            </attribute>
  11.296 +            <attribute name="selected">
  11.297 +                <type>string/array</type>
  11.298 +                <required>no</required>
  11.299 +                <default>empty</default>
  11.300 +                <description>The selected option element(s)</description>
  11.301 +            </attribute>
  11.302 +            <attribute name="options">
  11.303 +                <type>associative array</type>
  11.304 +                <required>Yes, unless using options attribute</required>
  11.305 +                <default>n/a</default>
  11.306 +                <description>An associative array of values and output</description>
  11.307 +            </attribute>
  11.308 +            <attribute name="name">
  11.309 +                <type>string</type>
  11.310 +                <required>no</required>
  11.311 +                <default>empty</default>
  11.312 +                <description>Name of select group</description>
  11.313 +            </attribute>
  11.314 +        </attributes>
  11.315 +        <url>http://www.smarty.net/manual/en/language.function.html.options.php</url>
  11.316 +    </entry>
  11.317 +
  11.318 +    <entry name="html_radios">
  11.319 +        <description> {html_radios} is a custom function  that creates a HTML radio button group. It also takes care of which item is selected by default as well. </description>
  11.320 +        <attributes>
  11.321 +            <attribute name="name">
  11.322 +                <type>string</type>
  11.323 +                <required>no</required>
  11.324 +                <default>radio</default>
  11.325 +                <description>Name of radio list</description>
  11.326 +            </attribute>
  11.327 +            <attribute name="values">
  11.328 +                <type>array</type>
  11.329 +                <required>Yes, unless using options attribute</required>
  11.330 +                <default>n/a</default>
  11.331 +                <description>An array of values for radio buttons</description>
  11.332 +            </attribute>
  11.333 +            <attribute name="output">
  11.334 +                <type>array</type>
  11.335 +                <required>Yes, unless using options attribute</required>
  11.336 +                <default>n/a</default>
  11.337 +                <description>An array of output for radio buttons</description>
  11.338 +            </attribute>
  11.339 +            <attribute name="selected">
  11.340 +                <type>string</type>
  11.341 +                <required>no</required>
  11.342 +                <default>empty</default>
  11.343 +                <description>The selected radio element</description>
  11.344 +            </attribute>
  11.345 +            <attribute name="options">
  11.346 +                <type>associative array</type>
  11.347 +                <required>Yes, unless using values and output</required>
  11.348 +                <default>n/a</default>
  11.349 +                <description>An associative array of values and output</description>
  11.350 +            </attribute>
  11.351 +            <attribute name="separator">
  11.352 +                <type>string</type>
  11.353 +                <required>no</required>
  11.354 +                <default>empty</default>
  11.355 +                <description>String of text to separate each radio item</description>
  11.356 +            </attribute>
  11.357 +            <attribute name="assign">
  11.358 +                <type>string</type>
  11.359 +                <required>no</required>
  11.360 +                <default>empty</default>
  11.361 +                <description>Assign radio tags to an array instead of output</description>
  11.362 +            </attribute>
  11.363 +        </attributes>
  11.364 +        <url>http://www.smarty.net/manual/en/language.function.html.radios.php</url>
  11.365 +    </entry>
  11.366 +
  11.367 +    <entry name="html_select_date">
  11.368 +        <description>{html_select_date} is a custom function  that creates date dropdowns. It can display any or all of year, month, and day. All parameters that are not in the list below are printed as name/value-pairs inside the select tags of day, month and year. </description>
  11.369 +        <attributes>
  11.370 +            <attribute name="prefix">
  11.371 +                <type>string</type>
  11.372 +                <required>no</required>
  11.373 +                <default>Date_</default>
  11.374 +                <description>What to prefix the var name with</description>
  11.375 +            </attribute>
  11.376 +            <attribute name="time">
  11.377 +                <type>timestamp/ YYYY-MM-DD</type>
  11.378 +                <required>no</required>
  11.379 +                <default>current time in unix timestamp or YYYY-MM-DD format</default>
  11.380 +                <description>What date/time to use</description>
  11.381 +            </attribute>
  11.382 +            <attribute name="start_year">
  11.383 +                <type>string</type>
  11.384 +                <required>no</required>
  11.385 +                <default>current year</default>
  11.386 +                <description>The first year in the dropdown, either year number, or relative to current year (+/- N)</description>
  11.387 +            </attribute>
  11.388 +            <attribute name="end_year">
  11.389 +                <type>string</type>
  11.390 +                <required>no</required>
  11.391 +                <default>same as start_year</default>
  11.392 +                <description>The last year in the dropdown, either year number, or relative to current year (+/- N)</description>
  11.393 +            </attribute>
  11.394 +            <attribute name="display_days">
  11.395 +                <type>boolean</type>
  11.396 +                <required>no</required>
  11.397 +                <default>true</default>
  11.398 +                <description>Whether to display days or not</description>
  11.399 +            </attribute>
  11.400 +            <attribute name="display_months">
  11.401 +                <type>boolean</type>
  11.402 +                <required>no</required>
  11.403 +                <default>true</default>
  11.404 +                <description>Whether to display months or not</description>
  11.405 +            </attribute>
  11.406 +            <attribute name="display_years">
  11.407 +                <type>boolean</type>
  11.408 +                <required>no</required>
  11.409 +                <default>true</default>
  11.410 +                <description>Whether to display years or not</description>
  11.411 +            </attribute>
  11.412 +            <attribute name="month_format">
  11.413 +                <type>string</type>
  11.414 +                <required>no</required>
  11.415 +                <default>%B</default>
  11.416 +                <description>What format the month should be in (strftime)</description>
  11.417 +            </attribute>
  11.418 +            <attribute name="day_format">
  11.419 +                <type>string</type>
  11.420 +                <required>no</required>
  11.421 +                <default>%02d</default>
  11.422 +                <description>What format the day output should be in (sprintf)</description>
  11.423 +            </attribute>
  11.424 +            <attribute name="day_value_format">
  11.425 +                <type>string</type>
  11.426 +                <required>no</required>
  11.427 +                <default>%d</default>
  11.428 +                <description>What format the day value should be in (sprintf)</description>
  11.429 +            </attribute>
  11.430 +            <attribute name="year_as_text">
  11.431 +                <type>boolean</type>
  11.432 +                <required>no</required>
  11.433 +                <default>false</default>
  11.434 +                <description>Whether or not to display the year as text</description>
  11.435 +            </attribute>
  11.436 +            <attribute name="reverse_years">
  11.437 +                <type>boolean</type>
  11.438 +                <required>no</required>
  11.439 +                <default>false</default>
  11.440 +                <description>Display years in reverse order</description>
  11.441 +            </attribute>
  11.442 +            <attribute name="field_array">
  11.443 +                <type>string</type>
  11.444 +                <required>no</required>
  11.445 +                <default>null</default>
  11.446 +                <description>If a name is given, the select boxes will be drawn such that the results will be returned to PHP in the form of name[Day], name[Year], name[Month]. </description>
  11.447 +            </attribute>
  11.448 +            <attribute name="day_size">
  11.449 +                <type>string</type>
  11.450 +                <required>no</required>
  11.451 +                <default>null</default>
  11.452 +                <description>Adds size attribute to select tag if given</description>
  11.453 +            </attribute>
  11.454 +            <attribute name="month_size">
  11.455 +                <type>string</type>
  11.456 +                <required>no</required>
  11.457 +                <default>null</default>
  11.458 +                <description>Adds size attribute to select tag if given</description>
  11.459 +            </attribute>
  11.460 +            <attribute name="year_size">
  11.461 +                <type>string</type>
  11.462 +                <required>no</required>
  11.463 +                <default>null</default>
  11.464 +                <description>Adds size attribute to select tag if given</description>
  11.465 +            </attribute>
  11.466 +            <attribute name="all_extra">
  11.467 +                <type>string</type>
  11.468 +                <required>no</required>
  11.469 +                <default>null</default>
  11.470 +                <description>Adds extra attributes to all select/input tags if given</description>
  11.471 +            </attribute>
  11.472 +            <attribute name="day_extra">
  11.473 +                <type>string</type>
  11.474 +                <required>no</required>
  11.475 +                <default>null</default>
  11.476 +                <description>Adds extra attributes to select/input tags if given</description>
  11.477 +            </attribute>
  11.478 +            <attribute name="month_extra">
  11.479 +                <type>string</type>
  11.480 +                <required>no</required>
  11.481 +                <default>null</default>
  11.482 +                <description>Adds extra attributes to select/input tags if given</description>
  11.483 +            </attribute>
  11.484 +            <attribute name="year_extra">
  11.485 +                <type>string</type>
  11.486 +                <required>no</required>
  11.487 +                <default>null</default>
  11.488 +                <description>Adds extra attributes to select/input tags if given</description>
  11.489 +            </attribute>
  11.490 +            <attribute name="field_order">
  11.491 +                <type>string</type>
  11.492 +                <required>no</required>
  11.493 +                <default>MDY</default>
  11.494 +                <description>The order in which to display the fields</description>
  11.495 +            </attribute>
  11.496 +            <attribute name="field_separator">
  11.497 +                <type>string</type>
  11.498 +                <required>no</required>
  11.499 +                <default>\n</default>
  11.500 +                <description>String printed between different fields</description>
  11.501 +            </attribute>
  11.502 +            <attribute name="month_value_format">
  11.503 +                <type>string</type>
  11.504 +                <required>no</required>
  11.505 +                <default>%m</default>
  11.506 +                <description>strftime() format of the month values, default is %m for month numbers.</description>
  11.507 +            </attribute>
  11.508 +            <attribute name="year_empty">
  11.509 +                <type>string</type>
  11.510 +                <required>no</required>
  11.511 +                <default>null</default>
  11.512 +                <description>If supplied then the first element of the year's select-box has this value as it's label and "" as it's value. This is useful to make the select-box read "Please select a year" for example. Note that you can use values like "-MM-DD"  as time-attribute to indicate an unselected year.</description>
  11.513 +            </attribute>
  11.514 +            <attribute name="month_empty">
  11.515 +                <type>string</type>
  11.516 +                <required>no</required>
  11.517 +                <default>null</default>
  11.518 +                <description>If supplied then the first element of the month's select-box has this value as it's label and "" as it's value. . Note that you can use values like "YYYY--DD"  as time-attribute to indicate an unselected month.</description>
  11.519 +            </attribute>
  11.520 +            <attribute name="day_empty">
  11.521 +                <type>string</type>
  11.522 +                <required>no</required>
  11.523 +                <default>null</default>
  11.524 +                <description>If supplied then the first element of the day's select-box has this value as it's label and "" as it's value. Note that you can use values like "YYYY-MM-"  as time-attribute to indicate an unselected day.</description>
  11.525 +            </attribute>
  11.526 +        </attributes>
  11.527 +        <url>http://www.smarty.net/manual/en/language.function.html.select.date.php</url>
  11.528 +    </entry>
  11.529 +
  11.530 +    <entry name="html_select_time">
  11.531 +        <description>{html_select_time} is a custom function  that creates time dropdowns for you. It can display any or all of hour, minute, second and meridian. &lt;br&gt;&lt;br&gt;The time attribute can have different formats. It can be a unique timestamp, a string of the format YYYYMMDDHHMMSS or a string that is parseable by PHP's strtotime().</description>
  11.532 +        <attributes>
  11.533 +            <attribute name="prefix">
  11.534 +                <type>string</type>
  11.535 +                <required>no</required>
  11.536 +                <default>Time_</default>
  11.537 +                <description>What to prefix the var name with</description>
  11.538 +            </attribute>
  11.539 +            <attribute name="time">
  11.540 +                <type>timestamp</type>
  11.541 +                <required>no</required>
  11.542 +                <default>current time in unix timestamp or YYYY-MM-DD format</default>
  11.543 +                <description>What date/time to use</description>
  11.544 +            </attribute>
  11.545 +            <attribute name="display_hours">
  11.546 +                <type>boolean</type>
  11.547 +                <required>no</required>
  11.548 +                <default>true</default>
  11.549 +                <description>Whether to display hours or not</description>
  11.550 +            </attribute>
  11.551 +            <attribute name="display_minutes">
  11.552 +                <type>boolean</type>
  11.553 +                <required>no</required>
  11.554 +                <default>true</default>
  11.555 +                <description>Whether to display minutes or not</description>
  11.556 +            </attribute>
  11.557 +            <attribute name="display_seconds">
  11.558 +                <type>boolean</type>
  11.559 +                <required>no</required>
  11.560 +                <default>true</default>
  11.561 +                <description>Whether to display seconds or not</description>
  11.562 +            </attribute>
  11.563 +            <attribute name="display_meridian">
  11.564 +                <type>boolean</type>
  11.565 +                <required>no</required>
  11.566 +                <default>true</default>
  11.567 +                <description>Whether to display meridian or not (am/pm)</description>
  11.568 +            </attribute>
  11.569 +            <attribute name="use_24_hours">
  11.570 +                <type>boolean</type>
  11.571 +                <required>no</required>
  11.572 +                <default>ture</default>
  11.573 +                <description>Whether or not to use 24 hour clock</description>
  11.574 +            </attribute>
  11.575 +            <attribute name="minute_interval">
  11.576 +                <type>integer</type>
  11.577 +                <required>no</required>
  11.578 +                <default>1</default>
  11.579 +                <description>Number interval in minute dropdown</description>
  11.580 +            </attribute>
  11.581 +            <attribute name="second_interval">
  11.582 +                <type>integer</type>
  11.583 +                <required>no</required>
  11.584 +                <default>1</default>
  11.585 +                <description>Number interval in second dropdown</description>
  11.586 +            </attribute>
  11.587 +            <attribute name="field_array">
  11.588 +                <type>string</type>
  11.589 +                <required>no</required>
  11.590 +                <default>n/a</default>
  11.591 +                <description>Outputs values to array of this name</description>
  11.592 +            </attribute>
  11.593 +            <attribute name="all_extra">
  11.594 +                <type>string</type>
  11.595 +                <required>no</required>
  11.596 +                <default>null</default>
  11.597 +                <description>Adds extra attributes to select/input tags if given</description>
  11.598 +            </attribute>
  11.599 +            <attribute name="hour_extra">
  11.600 +                <type>string</type>
  11.601 +                <required>no</required>
  11.602 +                <default>null</default>
  11.603 +                <description>Adds extra attributes to select/input tags if given </description>
  11.604 +            </attribute>
  11.605 +            <attribute name="minute_extra">
  11.606 +                <type>string</type>
  11.607 +                <required>no</required>
  11.608 +                <default>null</default>
  11.609 +                <description>Adds extra attributes to select/input tags if given</description>
  11.610 +            </attribute>
  11.611 +            <attribute name="second_extra">
  11.612 +                <type>string</type>
  11.613 +                <required>no</required>
  11.614 +                <default>null</default>
  11.615 +                <description>Adds extra attributes to select/input tags if given</description>
  11.616 +            </attribute>
  11.617 +            <attribute name="meridian_extra">
  11.618 +                <type>string</type>
  11.619 +                <required>no</required>
  11.620 +                <default>null</default>
  11.621 +                <description>Adds extra attributes to select/input tags if given</description>
  11.622 +            </attribute>
  11.623 +        </attributes>
  11.624 +        <url>http://www.smarty.net/manual/en/language.function.html.select.time.php</url>
  11.625 +    </entry>
  11.626 +
  11.627 +
  11.628 +    <entry name="html_table">
  11.629 +        <description> {html_table} is a custom function  that dumps an array of data into an HTML table.</description>
  11.630 +        <attributes>
  11.631 +            <attribute name="loop">
  11.632 +                <type>array</type>
  11.633 +                <required>yes</required>
  11.634 +                <default>n/a</default>
  11.635 +                <description>Array of data to loop through</description>
  11.636 +            </attribute>
  11.637 +            <attribute name="cols">
  11.638 +                <type>mixed</type>
  11.639 +                <required>no</required>
  11.640 +                <default>3</default>
  11.641 +                <description>Number of columns in the table or a comma-separated list of column heading names or an array of column heading names.if the cols-attribute is empty, but rows are given, then the number of cols is computed by the number of rows and the number of elements to display to be just enough cols to display all elements. If both, rows and cols, are omitted cols defaults to 3. if given as a list or array, the number of columns is computed from the number of elements in the list or array. </description>
  11.642 +            </attribute>
  11.643 +            <attribute name="rows">
  11.644 +                <type>integer</type>
  11.645 +                <required>no</required>
  11.646 +                <default>empty</default>
  11.647 +                <description>Number of rows in the table. if the rows-attribute is empty, but cols are given, then the number of rows is computed by the number of cols and the number of elements to display to be just enough rows to display all elements. </description>
  11.648 +            </attribute>
  11.649 +            <attribute name="inner">
  11.650 +                <type>string</type>
  11.651 +                <required>no</required>
  11.652 +                <default>cols</default>
  11.653 +                <description>Direction of consecutive elements in the loop-array to be rendered. cols  means elements are displayed col-by-col. rows  means elements are displayed row-by-row. </description>
  11.654 +            </attribute>
  11.655 +            <attribute name="caption">
  11.656 +                <type>string</type>
  11.657 +                <required>no</required>
  11.658 +                <default>empty</default>
  11.659 +                <description>Text to be used for the caption  element of the table</description>
  11.660 +            </attribute>
  11.661 +            <attribute name="table_attr">
  11.662 +                <type>string</type>
  11.663 +                <required>no</required>
  11.664 +                <default>border="1"</default>
  11.665 +                <description>Attributes for table tag</description>
  11.666 +            </attribute>
  11.667 +            <attribute name="th_attr">
  11.668 +                <type>string</type>
  11.669 +                <required>no</required>
  11.670 +                <default>empty</default>
  11.671 +                <description>Attributes for th tag (arrays are cycled)</description>
  11.672 +            </attribute>
  11.673 +            <attribute name="tr_attr">
  11.674 +                <type>string</type>
  11.675 +                <required>no</required>
  11.676 +                <default>empty</default>
  11.677 +                <description>Attributes for tr tag (arrays are cycled)</description>
  11.678 +            </attribute>
  11.679 +            <attribute name="td_attr">
  11.680 +                <type>string</type>
  11.681 +                <required>no</required>
  11.682 +                <default>empty</default>
  11.683 +                <description>Attributes for td tag (arrays are cycled)</description>
  11.684 +            </attribute>
  11.685 +            <attribute name="trailpad">
  11.686 +                <type>string</type>
  11.687 +                <required>no</required>
  11.688 +                <default>&amp;nbsp;</default>
  11.689 +                <description>Value to pad the trailing cells on last row with (if any)</description>
  11.690 +            </attribute>
  11.691 +            <attribute name="hdir">
  11.692 +                <type>string</type>
  11.693 +                <required>no</required>
  11.694 +                <default>right</default>
  11.695 +                <description>Direction of each row to be rendered. possible values: right (left-to-right), and left (right-to-left) </description>
  11.696 +            </attribute>
  11.697 +            <attribute name="vdir">
  11.698 +                <type>string</type>
  11.699 +                <required>no</required>
  11.700 +                <default>down</default>
  11.701 +                <description>Direction of each column to be rendered. possible values: down (top-to-bottom), up  (bottom-to-top) </description>
  11.702 +            </attribute>
  11.703 +        </attributes>
  11.704 +        <url>http://www.smarty.net/manual/en/language.function.html.table.php</url>
  11.705 +    </entry>
  11.706 +
  11.707 +    <entry name="mailto">
  11.708 +        <description>  {mailto} automates the creation of a mailto:  anchor links and optionally encodes them. Encoding emails makes it more difficult for web spiders to lift email addresses off of a site.&lt;br&gt;&lt;br&gt;Technical Note: Javascript is probably the most thorough form of encoding, although you can use hex encoding too. </description>
  11.709 +        <attributes>
  11.710 +            <attribute name="address">
  11.711 +                <type>string</type>
  11.712 +                <required>yes</required>
  11.713 +                <default>n/a</default>
  11.714 +                <description>The e-mail address</description>
  11.715 +            </attribute>
  11.716 +            <attribute name="text">
  11.717 +                <type>string</type>
  11.718 +                <required>no</required>
  11.719 +                <default>n/a</default>
  11.720 +                <description>The text to display, default is the e-mail address</description>
  11.721 +            </attribute>
  11.722 +            <attribute name="encode">
  11.723 +                <type>string</type>
  11.724 +                <required>no</required>
  11.725 +                <default>none</default>
  11.726 +                <description>How to encode the e-mail. Can be one of none, hex, javascript  or javascript_charcode.</description>
  11.727 +            </attribute>
  11.728 +            <attribute name="cc">
  11.729 +                <type>string</type>
  11.730 +                <required>no</required>
  11.731 +                <default>n/a</default>
  11.732 +                <description>Email addresses to carbon copy, separate entries by a comma. </description>
  11.733 +            </attribute>
  11.734 +            <attribute name="bcc">
  11.735 +                <type>string</type>
  11.736 +                <required>no</required>
  11.737 +                <default>n/a</default>
  11.738 +                <description>Email addresses to blind carbon copy, separate entries by a comma</description>
  11.739 +            </attribute>
  11.740 +            <attribute name="subject">
  11.741 +                <type>string</type>
  11.742 +                <required>no</required>
  11.743 +                <default>n/a</default>
  11.744 +                <description>Email subject</description>
  11.745 +            </attribute>
  11.746 +            <attribute name="newsgroups">
  11.747 +                <type>string</type>
  11.748 +                <required>no</required>
  11.749 +                <default>n/a</default>
  11.750 +                <description>Newsgroups to post to, separate entries by a comma.</description>
  11.751 +            </attribute>
  11.752 +            <attribute name="followupto">
  11.753 +                <type>string</type>
  11.754 +                <required>no</required>
  11.755 +                <default>n/a</default>
  11.756 +                <description>Addresses to follow up to, separate entries by a comma.</description>
  11.757 +            </attribute>
  11.758 +            <attribute name="extra">
  11.759 +                <type>string</type>
  11.760 +                <required>no</required>
  11.761 +                <default>n/a</default>
  11.762 +                <description>Any extra information you want passed to the link, such as style sheet classes</description>
  11.763 +            </attribute>
  11.764 +        </attributes>
  11.765 +        <url>http://www.smarty.net/manual/en/language.function.mailto.php</url>
  11.766 +    </entry>
  11.767 +
  11.768 +    <entry name="math">
  11.769 +        <description> {math} allows the template designer to do math equations in the template.&lt;ul&gt;&lt;li&gt;Any numeric template variables may be used in the equations, and the result is printed in place of the tag.&lt;/li&gt;&lt;li&gt;The variables used in the equation are passed as parameters, which can be template variables or static values.&lt;/li&gt;&lt;li&gt;+, -, /, *, abs, ceil, cos, exp, floor, log, log10, max, min, pi, pow, rand, round, sin, sqrt, srans and tan are all valid operators. Check the PHP documentation for further information on these math functions.&lt;/li&gt;&lt;li&gt;If you supply the assign attribute, the output of the {math} function will be assigned to this template variable instead of being output to the template.&lt;/li&gt;&lt;/ul&gt;&lt;br&gt;Technical Note: {math} is an expensive function in performance due to its use of the php eval() function. Doing the math in PHP is much more efficient, so whenever possible do the math calculations in the script and assign() the results to the template. Definitely avoid repetitive {math} function calls, eg within {section} loops. </description>
  11.770 +        <attributes>
  11.771 +            <attribute name="equation">
  11.772 +                <type>string</type>
  11.773 +                <required>yes</required>
  11.774 +                <default>n/a</default>
  11.775 +                <description>The equation to execute</description>
  11.776 +            </attribute>
  11.777 +            <attribute name="format">
  11.778 +                <type>string</type>
  11.779 +                <required>no</required>
  11.780 +                <default>n/a</default>
  11.781 +                <description>The format of the result (sprintf)</description>
  11.782 +            </attribute>
  11.783 +            <attribute name="var">
  11.784 +                <type>numeric</type>
  11.785 +                <required>yes</required>
  11.786 +                <default>n/a</default>
  11.787 +                <description>Equation variable value</description>
  11.788 +            </attribute>
  11.789 +            <attribute name="assign">
  11.790 +                <type>string</type>
  11.791 +                <required>no</required>
  11.792 +                <default>n/a</default>
  11.793 +                <description>Template variable the output will be assigned to</description>
  11.794 +            </attribute>
  11.795 +            <attribute name="[var ...]">
  11.796 +                <type>numeric</type>
  11.797 +                <required>yes</required>
  11.798 +                <default>n/a</default>
  11.799 +                <description>Equation variable value</description>
  11.800 +            </attribute>
  11.801 +        </attributes>
  11.802 +        <url>http://www.smarty.net/manual/en/language.function.math.php</url>
  11.803 +    </entry>
  11.804 +
  11.805 +    <entry name="popup">
  11.806 +        <description> {popup} is used to create Javascript popup layer/windows.  {popup_init} MUST be called first for this to work. </description>
  11.807 +        <attributes>
  11.808 +            <attribute name="equation">
  11.809 +                <type>text</type>
  11.810 +                <required>yes</required>
  11.811 +                <default>n/a</default>
  11.812 +                <description>the text/html to display in the popup window</description>
  11.813 +            </attribute>
  11.814 +            <attribute name="trigger">
  11.815 +                <type>string</type>
  11.816 +                <required>no</required>
  11.817 +                <default>onMouseOver</default>
  11.818 +                <description>what is used to trigger the popup window. Can be one of onMouseOver or onClick</description>
  11.819 +            </attribute>
  11.820 +            <attribute name="sticky">
  11.821 +                <type>boolean</type>
  11.822 +                <required>no</required>
  11.823 +                <default>false</default>
  11.824 +                <description>makes the popup stick around until closed</description>
  11.825 +            </attribute>
  11.826 +            <attribute name="caption">
  11.827 +                <type>string</type>
  11.828 +                <required>no</required>
  11.829 +                <default>n/a</default>
  11.830 +                <description>sets the caption to title</description>
  11.831 +            </attribute>
  11.832 +            <attribute name="fgcolor">
  11.833 +                <type>string</type>
  11.834 +                <required>no</required>
  11.835 +                <default>n/a</default>
  11.836 +                <description>color of the inside of the popup box</description>
  11.837 +            </attribute>
  11.838 +            <attribute name="bgcolor">
  11.839 +                <type>string</type>
  11.840 +                <required>no</required>
  11.841 +                <default>n/a</default>
  11.842 +                <description>color of the border of the popup box</description>
  11.843 +            </attribute>
  11.844 +            <attribute name="textcolor">
  11.845 +                <type>string</type>
  11.846 +                <required>no</required>
  11.847 +                <default>n/a</default>
  11.848 +                <description>sets the color of the text inside the box</description>
  11.849 +            </attribute>
  11.850 +            <attribute name="capcolor">
  11.851 +                <type>string</type>
  11.852 +                <required>no</required>
  11.853 +                <default>n/a</default>
  11.854 +                <description>sets color of the box's caption</description>
  11.855 +            </attribute>
  11.856 +            <attribute name="closecolor">
  11.857 +                <type>string</type>
  11.858 +                <required>no</required>
  11.859 +                <default>n/a</default>
  11.860 +                <description>sets the color of the close text</description>
  11.861 +            </attribute>
  11.862 +            <attribute name="textfont">
  11.863 +                <type>string</type>
  11.864 +                <required>no</required>
  11.865 +                <default>n/a</default>
  11.866 +                <description>sets the font to be used by the main text</description>
  11.867 +            </attribute>
  11.868 +            <attribute name="captionfont">
  11.869 +                <type>string</type>
  11.870 +                <required>no</required>
  11.871 +                <default>n/a</default>
  11.872 +                <description>sets the font of the caption</description>
  11.873 +            </attribute>
  11.874 +            <attribute name="closefont">
  11.875 +                <type>string</type>
  11.876 +                <required>no</required>
  11.877 +                <default>n/a</default>
  11.878 +                <description>sets the font for the "Close" text</description>
  11.879 +            </attribute>
  11.880 +            <attribute name="textsize">
  11.881 +                <type>string</type>
  11.882 +                <required>no</required>
  11.883 +                <default>n/a</default>
  11.884 +                <description>sets the size of the main text's font</description>
  11.885 +            </attribute>
  11.886 +            <attribute name="captionsize">
  11.887 +                <type>string</type>
  11.888 +                <required>no</required>
  11.889 +                <default>n/a</default>
  11.890 +                <description>sets the size of the caption's font</description>
  11.891 +            </attribute>
  11.892 +            <attribute name="closesize">
  11.893 +                <type>string</type>
  11.894 +                <required>no</required>
  11.895 +                <default>n/a</default>
  11.896 +                <description>sets the size of the "Close" text's font</description>
  11.897 +            </attribute>
  11.898 +            <attribute name="width">
  11.899 +                <type>integer</type>
  11.900 +                <required>no</required>
  11.901 +                <default>n/a</default>
  11.902 +                <description>sets the width of the box</description>
  11.903 +            </attribute>
  11.904 +            <attribute name="height">
  11.905 +                <type>integer</type>
  11.906 +                <required>no</required>
  11.907 +                <default>n/a</default>
  11.908 +                <description>sets the height of the box</description>
  11.909 +            </attribute>
  11.910 +            <attribute name="left">
  11.911 +                <type>boolean</type>
  11.912 +                <required>no</required>
  11.913 +                <default>false</default>
  11.914 +                <description>makes the popups go to the left of the mouse</description>
  11.915 +            </attribute>
  11.916 +            <attribute name="right">
  11.917 +                <type>boolean</type>
  11.918 +                <required>no</required>
  11.919 +                <default>false</default>
  11.920 +                <description>makes the popups go to the right of the mouse</description>
  11.921 +            </attribute>
  11.922 +            <attribute name="center">
  11.923 +                <type>boolean</type>
  11.924 +                <required>no</required>
  11.925 +                <default>false</default>
  11.926 +                <description>makes the popups go to the center of the mouse</description>
  11.927 +            </attribute>
  11.928 +            <attribute name="above">
  11.929 +                <type>boolean</type>
  11.930 +                <required>no</required>
  11.931 +                <default>false</default>
  11.932 +                <description>makes the popups go above the mouse. NOTE: only possible when height has been set</description>
  11.933 +            </attribute>
  11.934 +            <attribute name="below">
  11.935 +                <type>boolean</type>
  11.936 +                <required>no</required>
  11.937 +                <default>false</default>
  11.938 +                <description>makes the popups go below the mouse</description>
  11.939 +            </attribute>
  11.940 +            <attribute name="border">
  11.941 +                <type>integer</type>
  11.942 +                <required>no</required>
  11.943 +                <default>n/a</default>
  11.944 +                <description>makes the border of the popups thicker or thinner</description>
  11.945 +            </attribute>
  11.946 +            <attribute name="offsetx">
  11.947 +                <type>integer</type>
  11.948 +                <required>no</required>
  11.949 +                <default>n/a</default>
  11.950 +                <description>how far away from the pointer the popup will show up, horizontally</description>
  11.951 +            </attribute>
  11.952 +            <attribute name="offsety">
  11.953 +                <type>integer</type>
  11.954 +                <required>no</required>
  11.955 +                <default>n/a</default>
  11.956 +                <description>how far away from the pointer the popup will show up, vertically</description>
  11.957 +            </attribute>
  11.958 +            <attribute name="fgbackground">
  11.959 +                <type>url to image</type>
  11.960 +                <required>no</required>
  11.961 +                <default>n/a</default>
  11.962 +                <description>defines a picture to use instead of color for the inside of the popup.</description>
  11.963 +            </attribute>
  11.964 +            <attribute name="bgbackground">
  11.965 +                <type>url to image</type>
  11.966 +                <required>no</required>
  11.967 +                <default>n/a</default>
  11.968 +                <description>defines a picture to use instead of color for the border of the popup. NOTE: You will want to set bgcolor to "" or the color will show as well. NOTE: When having a Close link, Netscape will re-render the table cells, making things look incorrect</description>
  11.969 +            </attribute>
  11.970 +            <attribute name="closetext">
  11.971 +                <type>string</type>
  11.972 +                <required>no</required>
  11.973 +                <default>n/a</default>
  11.974 +                <description>sets the "Close" text to something else</description>
  11.975 +            </attribute>
  11.976 +            <attribute name="noclose">
  11.977 +                <type>boolean</type>
  11.978 +                <required>no</required>
  11.979 +                <default>n/a</default>
  11.980 +                <description>does not display the "Close" text on stickies with a caption</description>
  11.981 +            </attribute>
  11.982 +            <attribute name="status">
  11.983 +                <type>string</type>
  11.984 +                <required>no</required>
  11.985 +                <default>n/a</default>
  11.986 +                <description>sets the text in the browsers status bar</description>
  11.987 +            </attribute>
  11.988 +            <attribute name="autostatus">
  11.989 +                <type>boolean</type>
  11.990 +                <required>no</required>
  11.991 +                <default>n/a</default>
  11.992 +                <description>sets the status bar's text to the popup's text. NOTE: overrides status setting</description>
  11.993 +            </attribute>
  11.994 +            <attribute name="autostatuscap">
  11.995 +                <type>string</type>
  11.996 +                <required>no</required>
  11.997 +                <default>n/a</default>
  11.998 +                <description>sets the status bar's text to the caption's text. NOTE: overrides status and autostatus settings</description>
  11.999 +            </attribute>
 11.1000 +            <attribute name="inarray">
 11.1001 +                <type>integer</type>
 11.1002 +                <required>no</required>
 11.1003 +                <default>n/a</default>
 11.1004 +                <description>tells overLib to read text from this index in the ol_text array, located in overlib.js. This parameter can be used instead of text</description>
 11.1005 +            </attribute>
 11.1006 +            <attribute name="caparray">
 11.1007 +                <type>integer</type>
 11.1008 +                <required>no</required>
 11.1009 +                <default>n/a</default>
 11.1010 +                <description>tells overLib to read the caption from this index in the ol_caps array</description>
 11.1011 +            </attribute>
 11.1012 +            <attribute name="capicon">
 11.1013 +                <type>url</type>
 11.1014 +                <required>no</required>
 11.1015 +                <default>n/a</default>
 11.1016 +                <description>displays the image given before the popup caption</description>
 11.1017 +            </attribute>
 11.1018 +            <attribute name="snapx">
 11.1019 +                <type>integer</type>
 11.1020 +                <required>no</required>
 11.1021 +                <default>n/a</default>
 11.1022 +                <description>snaps the popup to an even position in a horizontal grid</description>
 11.1023 +            </attribute>
 11.1024 +            <attribute name="snapy">
 11.1025 +                <type>integer</type>
 11.1026 +                <required>no</required>
 11.1027 +                <default>n/a</default>
 11.1028 +                <description>snaps the popup to an even position in a vertical grid</description>
 11.1029 +            </attribute>
 11.1030 +            <attribute name="fixx">
 11.1031 +                <type>integer</type>
 11.1032 +                <required>no</required>
 11.1033 +                <default>n/a</default>
 11.1034 +                <description>locks the popups horizontal position Note: overrides all other horizontal placement</description>
 11.1035 +            </attribute>
 11.1036 +            <attribute name="fixy">
 11.1037 +                <type>integer</type>
 11.1038 +                <required>no</required>
 11.1039 +                <default>n/a</default>
 11.1040 +                <description>locks the popups vertical position Note: overrides all other vertical placement</description>
 11.1041 +            </attribute>
 11.1042 +            <attribute name="background">
 11.1043 +                <type>url</type>
 11.1044 +                <required>no</required>
 11.1045 +                <default>n/a</default>
 11.1046 +                <description>sets image to be used instead of table box background</description>
 11.1047 +            </attribute>
 11.1048 +            <attribute name="padx">
 11.1049 +                <type>integer,integer</type>
 11.1050 +                <required>no</required>
 11.1051 +                <default>n/a</default>
 11.1052 +                <description>pads the background image with horizontal whitespace for text placement. Note: this is a two parameter command</description>
 11.1053 +            </attribute>
 11.1054 +            <attribute name="pady">
 11.1055 +                <type>integer,integer</type>
 11.1056 +                <required>no</required>
 11.1057 +                <default>n/a</default>
 11.1058 +                <description>pads the background image with vertical whitespace for text placement. Note: this is a two parameter command</description>
 11.1059 +            </attribute>
 11.1060 +            <attribute name="fullhtml">
 11.1061 +                <type>boolean</type>
 11.1062 +                <required>no</required>
 11.1063 +                <default>n/a</default>
 11.1064 +                <description>allows you to control the html over a background picture completely. The html code is expected in the "text"  attribute</description>
 11.1065 +            </attribute>
 11.1066 +            <attribute name="frame">
 11.1067 +                <type>string</type>
 11.1068 +                <required>no</required>
 11.1069 +                <default>n/a</default>
 11.1070 +                <description>controls popups in a different frame. See the overlib page for more info on this function</description>
 11.1071 +            </attribute>
 11.1072 +            <attribute name="function">
 11.1073 +                <type>string</type>
 11.1074 +                <required>no</required>
 11.1075 +                <default>n/a</default>
 11.1076 +                <description>calls the specified javascript function and takes the return value as the text that should be displayed in the popup window</description>
 11.1077 +            </attribute>
 11.1078 +            <attribute name="delay">
 11.1079 +                <type>integer</type>
 11.1080 +                <required>no</required>
 11.1081 +                <default>n/a</default>
 11.1082 +                <description>makes that popup behave like a tooltip. It will popup only after this delay in milliseconds</description>
 11.1083 +            </attribute>
 11.1084 +            <attribute name="hauto">
 11.1085 +                <type>boolean</type>
 11.1086 +                <required>no</required>
 11.1087 +                <default>n/a</default>
 11.1088 +                <description>automatically determine if the popup should be to the left or right of the mouse.</description>
 11.1089 +            </attribute>
 11.1090 +            <attribute name="vauto">
 11.1091 +                <type>boolean</type>
 11.1092 +                <required>no</required>
 11.1093 +                <default>n/a</default>
 11.1094 +                <description>automatically determine if the popup should be above or below the mouse.</description>
 11.1095 +            </attribute>
 11.1096 +        </attributes>
 11.1097 +        <url>http://www.smarty.net/manual/en/language.function.popup.php</url>
 11.1098 +    </entry>
 11.1099 +    
 11.1100 +    <entry name="popup_init">
 11.1101 +        <description> {popup}  is an integration of overLib, a library used for popup windows. These are used for context sensitive information, such as help windows or tooltips.&lt;ul&gt;&lt;li&gt;{popup_init} must be called only once, preferably within the &lt;head&gt; tag within any page you plan on using the {popup} function.&lt;/li&gt;&lt;li&gt;The path is relative to the executing script or a fully qualified domain path, ie not the relative to the template.&lt;/li&gt;&lt;li&gt;overLib is written and maintained by Erik Bosrup, and the homepage/download is at http://www.bosrup.com/web/overlib/.&lt;/li&gt;&lt;/ul&gt;</description>
 11.1102 +        <url>http://www.smarty.net/manual/en/language.function.popup.init.php</url>
 11.1103 +    </entry>
 11.1104 +
 11.1105 +    <entry name="textformat">
 11.1106 +        <description>  {textformat} is a block function  used to format text. It basically cleans up spaces and special characters, and formats paragraphs by wrapping at a boundary and indenting lines.&lt;br&gt;&lt;br&gt;You can set the parameters explicitly, or use a preset style. Currently "email" is the only available style.  </description>
 11.1107 +        <attributes>
 11.1108 +            <attribute name="style">
 11.1109 +                <type>string</type>
 11.1110 +                <required>no</required>
 11.1111 +                <default>n/a</default>
 11.1112 +                <description>Preset style</description>
 11.1113 +            </attribute>
 11.1114 +            <attribute name="indent">
 11.1115 +                <type>number</type>
 11.1116 +                <required>no</required>
 11.1117 +                <default>0</default>
 11.1118 +                <description>The number of chars to indent every line</description>
 11.1119 +            </attribute>
 11.1120 +            <attribute name="indent_first">
 11.1121 +                <type>number</type>
 11.1122 +                <required>no</required>
 11.1123 +                <default>0</default>
 11.1124 +                <description>The number of chars to indent the first line</description>
 11.1125 +            </attribute>
 11.1126 +            <attribute name="indent_char">
 11.1127 +                <type>string</type>
 11.1128 +                <required>yes</required>
 11.1129 +                <default>(single space)</default>
 11.1130 +                <description>The character (or string of chars) to indent with</description>
 11.1131 +            </attribute>
 11.1132 +            <attribute name="wrap">
 11.1133 +                <type>number</type>
 11.1134 +                <required>no</required>
 11.1135 +                <default>80</default>
 11.1136 +                <description>How many characters to wrap each line to</description>
 11.1137 +            </attribute>
 11.1138 +            <attribute name="wrap_char">
 11.1139 +                <type>string</type>
 11.1140 +                <required>no</required>
 11.1141 +                <default>\n</default>
 11.1142 +                <description>The character (or string of chars) to break each line with</description>
 11.1143 +            </attribute>
 11.1144 +            <attribute name="wrap_cut">
 11.1145 +                <type>boolean</type>
 11.1146 +                <required>no</required>
 11.1147 +                <default>false</default>
 11.1148 +                <description>If TRUE, wrap will break the line at the exact character instead of at a word boundary</description>
 11.1149 +            </attribute>
 11.1150 +            <attribute name="assign">
 11.1151 +                <type>string</type>
 11.1152 +                <required>no</required>
 11.1153 +                <default>n/a</default>
 11.1154 +                <description>The template variable the output will be assigned to</description>
 11.1155 +            </attribute>
 11.1156 +        </attributes>
 11.1157 +        <url>http://www.smarty.net/manual/en/language.function.textformat.php</url>
 11.1158 +    </entry>
 11.1159 +
 11.1160 +</entries>