<?xml version="1.0" encoding="UTF-8"  standalone="yes" ?>
<rss version="2.0">
	<channel>
		<title>社群: Web Programming - 文件區(Module Dev.)</title>
		<description>台灣數位學習數位教學平台 RSS feed provider</description>
		<language>zh-tw</language>
		<link>http://lms.xms.com.tw/board.php?courseID=100&amp;f=doclist&amp;folderID=1242</link>
	<item>
		<title>Creating a module configuration (settings) page</title>
		<link>http://lms.xms.com.tw/board.php?courseID=100&amp;f=doc&amp;cid=5781</link>
		<description>http://drupal.org/node/206761&amp;nbsp;
&amp;nbsp;
1. Create the configuration function
&amp;nbsp;
function onthisdate_admin() {&amp;nbsp; $form = array();&amp;nbsp; $form[&#039;onthisdate_maxdisp&#039;] = array(&amp;nbsp;&amp;nbsp;&amp;nbsp; &#039;#type&#039; =&amp;gt; &#039;textfield&#039;,&amp;nbsp;&amp;nbsp;&amp;nbsp; &#039;#title&#039; =&amp;gt; t(&#039;Maximum number of links&#039;),&amp;nbsp;&amp;nbsp;&amp;nbsp; &#039;#default_value&#039; =&amp;gt; variable_get(&#039;onthisdate_maxdisp&#039;, 3),&amp;nbsp;&amp;nbsp;&amp;nbsp; &#039;#size&#039; =&amp;gt; 2,&amp;nbsp;&amp;nbsp;&amp;nbsp; &#039;#maxlength&#039; =&amp;gt; 2,&amp;nbsp;&amp;nbsp;&amp;nbsp; &#039;#description&#039; =&amp;gt; t(&quot;The maximum number of links to display in the block.&quot;),&amp;nbsp;&amp;nbsp;&amp;nbsp; &#039;#required&#039; =&amp;gt; TRUE,&amp;nbsp; );&amp;nbsp; return system_settings_form($form);}
&amp;nbsp;
&amp;nbsp;
2. define a URL by hook_menu
&amp;nbsp;
function onthisdate_menu() {&amp;nbsp; $items = array();&amp;nbsp; $items[&#039;admin/settings/onthisdate&#039;] = array(&amp;nbsp;&amp;nbsp;&amp;nbsp; &#039;title&#039; =&amp;gt; t(&#039;On this date module settings&#039;),&amp;nbsp;&amp;nbsp;&amp;nbsp; &#039;description&#039; =&amp;gt; t(&#039;Description of your On this date settings page&#039;),&amp;nbsp;&amp;nbsp;&amp;nbsp; &#039;page callback&#039; =&amp;gt; &#039;drupal_get_form&#039;,&amp;nbsp;&amp;nbsp;&amp;nbsp; &#039;page arguments&#039; =&amp;gt; array(&#039;onthisdate_admin&#039;),&amp;nbsp;&amp;nbsp;&amp;nbsp; &#039;access arguments&#039; =&amp;gt; array(&#039;access administration pages&#039;),&amp;nbsp;&amp;nbsp;&amp;nbsp; &#039;type&#039; =&amp;gt; MENU_NORMAL_ITEM,&amp;nbsp;&amp;nbsp; );&amp;nbsp; return $items;}
** clear the menu cache to&amp;nbsp;recognize the new URL (Administer &amp;gt;&amp;gt; Site Configuration &amp;gt;&amp;gt; Performance)
&amp;nbsp;
&amp;nbsp;
3. Validate the user input (a &quot;_validate&quot; suffix)
&amp;nbsp;
function onthisdate_admin_validate($form, &amp;amp;$form_state) {&amp;nbsp; $maxdisp = $form_state[&#039;values&#039;][&#039;onthisdate_maxdisp&#039;];&amp;nbsp; if (!is_numeric($maxdisp)) {...}
}
&amp;nbsp;
&amp;nbsp;
&amp;nbsp;
&amp;nbsp; </description>
		<pubDate>Sun, 08 May 2011 23:30:27 +0800</pubDate>
	</item>
	<item>
		<title>onthisdate_block(&#039;view&#039;) - Generating the block content</title>
		<link>http://lms.xms.com.tw/board.php?courseID=100&amp;f=doc&amp;cid=5780</link>
		<description>http://drupal.org/node/206759
&amp;nbsp;
function onthisdate_block($op = &quot;list&quot;, $delta = 0) {
&amp;nbsp; if ($op == &quot;view&quot;) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$block[&quot;subject&quot;] = t(&quot;Subject of On This Date&quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp; $block[&quot;subject&quot;] = t(&quot;Content of OnThisDate&quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp; return $block;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } </description>
		<pubDate>Sun, 08 May 2011 22:49:46 +0800</pubDate>
	</item>
	<item>
		<title>onthisdate_block(&#039;list&#039;) - Declaring block content</title>
		<link>http://lms.xms.com.tw/board.php?courseID=100&amp;f=doc&amp;cid=5779</link>
		<description>http://drupal.org/node/206758
&amp;nbsp;
function onthisdate_block($op = &#039;list&#039;, $delta = 0, $edit = array()) {&amp;nbsp; &amp;nbsp; if ($op == &quot;list&quot;) { // admin/block&amp;nbsp;&amp;nbsp;&amp;nbsp; $block = array();&amp;nbsp;&amp;nbsp;&amp;nbsp; $block[0][&quot;info&quot;] = t(&#039;On This Date&#039;);&amp;nbsp;&amp;nbsp;&amp;nbsp; return $block;&amp;nbsp; } } </description>
		<pubDate>Sun, 08 May 2011 22:38:59 +0800</pubDate>
	</item>
	<item>
		<title>Hooks</title>
		<link>http://lms.xms.com.tw/board.php?courseID=100&amp;f=doc&amp;cid=5778</link>
		<description>http://api.drupal.org/api/drupal/includes--module.inc/group/hooks/6
&amp;nbsp;
Allow modules to interact with the Drupal core.
Drupal&#039;s module system is based on the concept of &quot;hooks&quot;. A hook is named moduleName_hookName </description>
		<pubDate>Sun, 08 May 2011 22:27:47 +0800</pubDate>
	</item>
	<item>
		<title>onthisdate_perm() - Specifying the available permissions</title>
		<link>http://lms.xms.com.tw/board.php?courseID=100&amp;f=doc&amp;cid=5777</link>
		<description>http://drupal.org/node/206757
&amp;nbsp;
define&amp;nbsp;module permissions&amp;nbsp;(Administer&amp;nbsp;/ User management / Permissions page)
function onthisdate_perm() {&amp;nbsp; return array(&#039;access onthisdate content&#039;);} </description>
		<pubDate>Sun, 08 May 2011 22:18:55 +0800</pubDate>
	</item>
	<item>
		<title>onthisdate_help() - Help Hook</title>
		<link>http://lms.xms.com.tw/board.php?courseID=100&amp;f=doc&amp;cid=5774</link>
		<description>http://drupal.org/node/206756
&amp;nbsp;
function onthisdate_help($path, $arg) {&amp;nbsp; $output = &#039;&#039;;&amp;nbsp; //declare your output variable&amp;nbsp; switch ($path) {&amp;nbsp;&amp;nbsp;&amp;nbsp; case &quot;admin/help#onthisdate&quot;:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $output = &#039;&amp;lt;p&amp;gt;&#039;.&amp;nbsp; t(&quot;Displays links to nodes created on this date&quot;) .&#039;&amp;lt;/p&amp;gt;&#039;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&amp;nbsp; }&amp;nbsp; return $output;} </description>
		<pubDate>Sun, 08 May 2011 20:10:29 +0800</pubDate>
	</item>
	<item>
		<title>onthisdate.info</title>
		<link>http://lms.xms.com.tw/board.php?courseID=100&amp;f=doc&amp;cid=5773</link>
		<description>http://drupal.org/node/206756
&amp;nbsp;
name = On this datedescription = A block module that lists links to content created one week ago.core = 6.x
dependencies, package (optional) </description>
		<pubDate>Sun, 08 May 2011 19:57:29 +0800</pubDate>
	</item>
	<item>
		<title>Name your module and create a folder</title>
		<link>http://lms.xms.com.tw/board.php?courseID=100&amp;f=doc&amp;cid=5772</link>
		<description>http://drupal.org/node/206754
&amp;nbsp;
1. name: &amp;nbsp; onthisdate
2. folder: sites/all/modules/onthisdate&amp;nbsp;(the preferred place for non-core modules)
3. file: &amp;nbsp; onthisdate.module </description>
		<pubDate>Sun, 08 May 2011 19:53:04 +0800</pubDate>
	</item>
	</channel>
	</rss>
