module_template.html 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  5. <head>
  6. <title>Reference</title>
  7. <link rel="stylesheet" href="../ldoc.css" type="text/css" />
  8. </head>
  9. <body>
  10. <div id="container">
  11. <div id="product">
  12. <div id="product_logo"></div>
  13. <div id="product_name"><big><b></b></big></div>
  14. <div id="product_description"></div>
  15. </div> <!-- id="product" -->
  16. <div id="main">
  17. <!-- Menu -->
  18. <div id="navigation">
  19. <br/>
  20. <h1>modpol</h1>
  21. <ul>
  22. <li><a href="../index.html">Index</a></li>
  23. </ul>
  24. <h2>Contents</h2>
  25. <ul>
  26. <li><a href="#Functions">Functions</a></li>
  27. <li><a href="#Tables">Tables</a></li>
  28. <li><a href="#Fields">Fields</a></li>
  29. </ul>
  30. <h2>Basic Functions</h2>
  31. <ul class="nowrap">
  32. <li><a href="../modules/modpol.interactions.html">modpol.interactions</a></li>
  33. <li><a href="../modules/modpol.orgs.base.html">modpol.orgs.base</a></li>
  34. <li><a href="../modules/modpol.orgs.process.html">modpol.orgs.process</a></li>
  35. <li><a href="../modules/modpol.util.misc.html">modpol.util.misc</a></li>
  36. <li><a href="../modules/modpol_minetest.api.html">modpol_minetest.api</a></li>
  37. </ul>
  38. <h2>Core Modules</h2>
  39. <ul class="nowrap">
  40. <li><a href="../modules/add_child_org_consent.html">add_child_org_consent</a></li>
  41. <li><a href="../modules/change_modules.html">change_modules</a></li>
  42. <li><a href="../modules/consent.html">consent</a></li>
  43. <li><a href="../modules/join_org.html">join_org</a></li>
  44. <li><a href="../modules/join_org_consent.html">join_org_consent</a></li>
  45. <li><a href="../modules/leave_org.html">leave_org</a></li>
  46. <li><a href="../modules/message_org.html">message_org</a></li>
  47. <li><a href="../modules/remove_child_consent.html">remove_child_consent</a></li>
  48. <li><a href="../modules/remove_member_consent.html">remove_member_consent</a></li>
  49. <li><a href="../modules/remove_org.html">remove_org</a></li>
  50. <li><a href="../modules/remove_org_consent.html">remove_org_consent</a></li>
  51. <li><a href="../modules/rename_org_consent.html">rename_org_consent</a></li>
  52. <li><a href="../modules/module_template.html">module_template</a></li>
  53. </ul>
  54. <h2>Minetest Modules</h2>
  55. <ul class="nowrap">
  56. <li><a href="../modules/priv_to_org.html">priv_to_org</a></li>
  57. </ul>
  58. </div>
  59. <div id="content">
  60. <h1>Module <code>module_template</code></h1>
  61. <p>Template for module writers</p>
  62. <p></p>
  63. <h2><a href="#Functions">Functions</a></h2>
  64. <table class="function_list">
  65. <tr>
  66. <td class="name" nowrap><a href="#initiate">initiate (result)</a></td>
  67. <td class="summary">(Required): Initiate function
  68. Modules have access to the following instance variables:
  69. <li><code>self.org</code> (the org the module was called in),</li>
  70. <li><code>self.initiator</code> (the user that callced the module),</li>
  71. <li><code>self.id</code> (the process id of the module instance)</li></td>
  72. </tr>
  73. </table>
  74. <h2><a href="#Tables">Tables</a></h2>
  75. <table class="function_list">
  76. <tr>
  77. <td class="name" nowrap><a href="#data">data</a></td>
  78. <td class="summary">(Required) Data for module
  79. Variables that module uses during the course of a process.</td>
  80. </tr>
  81. <tr>
  82. <td class="name" nowrap><a href="#config">config</a></td>
  83. <td class="summary">(Required): Config for module
  84. Defines the input parameters to the module initiate function.</td>
  85. </tr>
  86. </table>
  87. <h2><a href="#Fields">Fields</a></h2>
  88. <table class="function_list">
  89. <tr>
  90. <td class="name" nowrap><a href="#modpol.modules.module_template">modpol.modules.module_template</a></td>
  91. <td class="summary">(Required) Add to module table</td>
  92. </tr>
  93. </table>
  94. <br/>
  95. <br/>
  96. <h2 class="section-header "><a name="Functions"></a>Functions</h2>
  97. <dl class="function">
  98. <dt>
  99. <a name = "initiate"></a>
  100. <strong>initiate (result)</strong>
  101. </dt>
  102. <dd>
  103. (Required): Initiate function
  104. Modules have access to the following instance variables:
  105. <li><code>self.org</code> (the org the module was called in),</li>
  106. <li><code>self.initiator</code> (the user that callced the module),</li>
  107. <li><code>self.id</code> (the process id of the module instance)</li>
  108. <h3>Parameters:</h3>
  109. <ul>
  110. <li><span class="parameter">result</span>
  111. (optional) Callback if this module is embedded in other modules
  112. </li>
  113. </ul>
  114. </dd>
  115. </dl>
  116. <h2 class="section-header "><a name="Tables"></a>Tables</h2>
  117. <dl class="function">
  118. <dt>
  119. <a name = "data"></a>
  120. <strong>data</strong>
  121. </dt>
  122. <dd>
  123. (Required) Data for module
  124. Variables that module uses during the course of a process.
  125. Can be blank
  126. </dd>
  127. <dt>
  128. <a name = "config"></a>
  129. <strong>config</strong>
  130. </dt>
  131. <dd>
  132. (Required): Config for module
  133. Defines the input parameters to the module initiate function.
  134. Can be blank
  135. When calling a module from within another module,
  136. variables not defined in config will be ignored.
  137. Default values set in config can be overridden
  138. <h3>Fields:</h3>
  139. <ul>
  140. <li><span class="parameter">field_1</span>
  141. ex: votes_required, default = 5
  142. </li>
  143. <li><span class="parameter">field_2</span>
  144. ex: voting_type, default = "majority"
  145. </li>
  146. </ul>
  147. </dd>
  148. </dl>
  149. <h2 class="section-header "><a name="Fields"></a>Fields</h2>
  150. <dl class="function">
  151. <dt>
  152. <a name = "modpol.modules.module_template"></a>
  153. <strong>modpol.modules.module_template</strong>
  154. </dt>
  155. <dd>
  156. (Required) Add to module table
  157. </dd>
  158. </dl>
  159. </div> <!-- id="content" -->
  160. </div> <!-- id="main" -->
  161. <div id="about">
  162. <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
  163. <i style="float:right;">Last updated 2022-01-20 10:54:01 </i>
  164. </div> <!-- id="about" -->
  165. </div> <!-- id="container" -->
  166. </body>
  167. </html>