OSDN Git Service

Merge branch 'skinnable-master'
[nucleus-jp/nucleus-next.git] / nucleus / documentation / devdocs / plugins.html
index c299b6d..59d8ef6 100644 (file)
@@ -1,7 +1,7 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
 <head>
-       <!-- $Id: plugins.html 1545 2011-06-28 21:31:37Z ftruscot $ -->
+       <!-- $Id: plugins.html 1721 2012-03-31 10:18:25Z sakamocchi $ -->
        <title>Nucleus - Plugin API</title>
        <link rel="stylesheet" type="text/css" href="styles/manual.css" />
        <style type="text/css">
@@ -2190,23 +2190,23 @@ refuse to install the plugin if a dependency is missing.</p>
 <h1>Internationalizing Your Plugin <a name="internationalization" href="#top" class="toplink"><img src="../icon-up.gif" width="15" height="15" alt="back to top" /></a></h1>
 
 <p>Internationalization of a plugin allows your plugin to be easily used by people all over the world, people who do not 
-speak the same language as you do. It requires a little additional work for you, but makes translating the output of your plugin 
+use the same language as you do. It requires a little additional work for you, but makes translating the output of your plugin 
 as easy as translating a few phrases in a text file. Below is a description of the standard method suggested for use by Nucleus plugins. 
 Thanks to Andy Matsubara for the instructions.</p>
 
 <ol>
        <li><strong>Develop your plugin</strong>
 
-At first, it is easier to develop it in your language. Use of language files is recommended after the plugin becomes stable.</li>
+At first, it is easier to develop it in your language. Use of translation files is recommended after the plugin becomes stable.</li>
        <li><strong>Create plugin directory</strong>
 
 If your plugin name is NP_AbcDef, the plugin directory name is abcdef (always lower case).</li>
-       <li><strong>Create language files</strong>
+       <li><strong>Create translation files</strong>
 
-Create the language files in the directory of your plugin. The name of the language file must be the same as that of the Nucleus language file name. For example, english.php is for English and default use. japanese-utf8.php for Japanese(UTF-Cool,japanese-euc.php for Japanese(EUC-JP).</li>
+Create the translation files in the directory of your plugin. The name of the language file must be the same as that of the Nucleus translation file name. For example, english.php is for English and default use. japanese-utf8.php for Japanese(UTF-Cool,japanese-euc.php for Japanese(EUC-JP).</li>
        <li><strong>Define strings</strong>
 
-Define strings like below in the language file:
+Define strings like below in the translation file:
 
 <pre class="example"><code>&lt;?php
 define('_ABCDEF_MESSAGENAME',                  'actual strings in the language');
@@ -2216,13 +2216,13 @@ define('_ABCDEF_MESSAGENAME',                  'actual strings in the language')
 You have to define them for all static strings in your plugin. As defined name is used globally in the environment, it is recommended to have a prefix derived from the plugin name(in this case _ABCDEF).</li>
        <li><strong>Replace static strings</strong>
 
-Replace static strings in your plugin with the defined names so they will change according to the language file.</li>
+Replace static strings in your plugin with the defined names so they will change according to the translation file.</li>
        <li><strong>Create init method</strong>
 
 Make the init method in the plugin like below
 
 <pre class="example"><code>   function init() {
-      // include language file for this plugin
+      // include translation file for this plugin
       $language = preg_replace( '#[\\|/]#', '', getLanguageName());
       if (file_exists($this->getDirectory().$language.'.php'))
          include_once($this->getDirectory().$language.'.php');
@@ -2230,8 +2230,8 @@ Make the init method in the plugin like below
          include_once($this->getDirectory().'english.php');
    }</code></pre>
 </li>
-This logic is same as Nucleus\92 language file setting.
-       <li><strong>Add language files</strong>
+This logic is same as Nucleus' translation file setting.
+       <li><strong>Add translation files</strong>
 
 As English is the default language, it is recommended to have at least the English version.    </li>
 </ol>
@@ -2336,40 +2336,40 @@ and global variables described below:</p>
                <td>Returns the full system path where the extra files for the plugin are stored (if there are no such files, this information makes no sense). The result is something like ".../nucleus/plugins/plugname/"</td>
        </tr>
        <tr>
-               <td><code>createItemLink($itemid, $extra = '')</code></td>
-               <td>Global function</td>
+               <td><code>Link::create_item_link($itemid, $extra = '')</code></td>
+               <td>Public function</td>
                <td><code>$itemid</code> Integer. ID of item being linked.<br />
                        <code>$extra</code> Associative Array. Containing key-value pairs corresponding to additional parameters-values that should appear in the link.
                </td>
                <td>Returns the full URL, in scheme chosen by user, of item indicated by <code>$itemid</code></td>
        </tr>
        <tr>
-               <td><code>createMemberLink($memberid, $extra = '')</code></td>
-               <td>Global function</td>
+               <td><code>Link::create_member_link($memberid, $extra = '')</code></td>
+               <td>Public function</td>
                <td><code>$memberid</code> Integer. ID of member being linked.<br />
                        <code>$extra</code> Associative Array. Containing key-value pairs corresponding to additional parameters-values that should appear in the link.
                </td>
                <td>Returns the full URL, in scheme chosen by user, of member page indicated by <code>$memberid</code></td>
        </tr>
        <tr>
-               <td><code>createCategoryLink($catid, $extra = '')</code></td>
-               <td>Global function</td>
+               <td><code>Link::create_category_link($catid, $extra = '')</code></td>
+               <td>Public function</td>
                <td><code>$catid</code> Integer. ID of category being linked.<br />
                        <code>$extra</code> Associative Array. Containing key-value pairs corresponding to additional parameters-values that should appear in the link.
                </td>
                <td>Returns the full URL, in scheme chosen by user, of category index page indicated by <code>$catid</code></td>
        </tr>
        <tr>
-               <td><code>createArchiveListLink($blogid = '', $extra = '')</code></td>
-               <td>Global function</td>
+               <td><code>Link::create_archivelist_link($blogid = '', $extra = '')</code></td>
+               <td>Public function</td>
                <td><code>$blogid</code> Integer. ID of blog whose archivelist is being linked.<br />
                        <code>$extra</code> Associative Array. Containing key-value pairs corresponding to additional parameters-values that should appear in the link.
                </td>
                <td>Returns the full URL, in scheme chosen by user, of archivelist page indicated by <code>$blogid</code></td>
        </tr>
        <tr>
-               <td><code>createArchiveLink($blogid, $archive, $extra = '')</code></td>
-               <td>Global function</td>
+               <td><code>Link::create_archive_link($blogid, $archive, $extra = '')</code></td>
+               <td>Public function</td>
                <td><code>$blogid</code> Integer. ID of blog whose archive is being linked.<br />
                        <code>$archive</code> String. Valid archive parameter for date (year-month) being linked.<br />
                        <code>$extra</code> Associative Array. Containing key-value pairs corresponding to additional parameters-values that should appear in the link.
@@ -2377,8 +2377,8 @@ and global variables described below:</p>
                <td>Returns the full URL, in scheme chosen by user, of archive page indicated by <code>$blogid</code> and <code>$archive</code></td>
        </tr>
        <tr>
-               <td><code>createBlogidLink($blogid, $extra = '')</code></td>
-               <td>Global function</td>
+               <td><code>Link::create_blogid_link($blogid, $extra = '')</code></td>
+               <td>Public function</td>
                <td><code>$blogid</code> Integer. ID of blog being linked.<br />
                        <code>$extra</code> Associative Array. Containing key-value pairs corresponding to additional parameters-values that should appear in the link.
                </td>
@@ -2412,7 +2412,7 @@ $couples = array(
                                'bar'=>'Minnie')
                        );
 foreach ($couples as $values) {
-       echo TEMPLATE::fill($mytemplate,$values);
+       echo Template::fill($mytemplate,$values);
 }</code></pre>
        Now the skinvar for our plugin <code>&lt;%TemplateTest%&gt;</code> will output three lines like this:
        <pre class="example"><code>&lt;li&gt;Ricky loves Lucy&lt;/li&gt;
@@ -2461,7 +2461,7 @@ foreach ($couples as $values) {
                                'bar'=>'Minnie')
                        );
        foreach ($couples as $values) {
-               echo TEMPLATE::fill($template['templatetest_body'],$values);
+               echo Template::fill($template['templatetest_body'],$values);
        }       
 }</code></pre>
        Here, the user needs to go to the template he wants to use and enter the formatting he desires into the TemplateTest Body field.