summaryrefslogtreecommitdiffstats
path: root/user_guide/libraries/calendar.html
diff options
context:
space:
mode:
authoradmin <devnull@localhost>2006-10-31 01:36:32 +0100
committeradmin <devnull@localhost>2006-10-31 01:36:32 +0100
commitb93464db656fe017fe434b0fc917921ded88a12c (patch)
tree1ed24c1542b206a424e0b88e08f64a7932e31826 /user_guide/libraries/calendar.html
parent784add749c806c52327615d47b8c6fabe2bd3438 (diff)
Diffstat (limited to 'user_guide/libraries/calendar.html')
-rw-r--r--user_guide/libraries/calendar.html64
1 files changed, 30 insertions, 34 deletions
diff --git a/user_guide/libraries/calendar.html b/user_guide/libraries/calendar.html
index 03035170d..ff61701aa 100644
--- a/user_guide/libraries/calendar.html
+++ b/user_guide/libraries/calendar.html
@@ -119,19 +119,18 @@ how data passed to your cells is handled so you can pass different types of info
<h2>Setting Display Preferences</h2>
-<p>There are seven preferences you can set to control various aspects of the calendar. Preferences are set using an initialization
-function similar to other classes. Here is an example:
+<p>There are seven preferences you can set to control various aspects of the calendar. Preferences are set by passing an
+array of preferences in the second parameter of the loading function. Here is an example:</p>
-<code>$this->load->library('calendar');<br />
-<br />
+<code>
$prefs = array (<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'start_day'&nbsp;&nbsp;&nbsp; => 'saturday',<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'month_type'&nbsp;&nbsp; => 'long',<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'day_type'&nbsp;&nbsp;&nbsp;&nbsp; => 'short'<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
<br />
-$this->calendar->initialize($prefs);<br />
+$this->load->library('calendar', $prefs);<br />
<br />
echo $this->calendar->generate();</code>
@@ -166,6 +165,30 @@ regarding preferences below.</p>
+<h2>Showing Next/Previous Month Links</h2>
+
+<p>To allow your calendar to dynamically increment/decrement via the next/previous links requires that you set up your calendar
+code similar to this example:</p>
+
+
+<code>$this->load->library('calendar');<br />
+<br />
+$prefs = array (<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'show_next_prev'&nbsp;&nbsp;=> TRUE,<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'next_prev_url'&nbsp;&nbsp; => 'http://www.your-site.com/index.php/calendar/show/'<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
+<br />
+echo $this->calendar->generate(<var>$this->uri->segment(3)</var>, <var>$this->uri->segment(4)</var>, $prefs);</code>
+
+<p>You'll notice a few things about the above example:</p>
+
+<ul>
+<li>You must set the "show_next_prev" to TRUE.</li>
+<li>You must supply the URL to the controller containing your calendar in the "next_prev_url" preference.</li>
+<li>You must supply the "year" and "month" to the calendar generating function via the URI segments where they appear (Note: The calendar class automatically adds the year/month to the base URL you provide.).</li>
+</ul>
+
+
<h2>Creating a Calendar Template</h2>
@@ -173,7 +196,7 @@ regarding preferences below.</p>
calendar will be placed within a pair of pseudo-variables as shown here:</p>
-<code>$this->load->library('calendar');<br /><br />
+<code>
$prefs['template'] = '<br /><br />
&nbsp;&nbsp;&nbsp;<dfn>{table_open}</dfn><var>&lt;table border="0" cellpadding="0" cellspacing="0"></var><dfn>{/table_open}</dfn><br />
<br />
@@ -206,39 +229,12 @@ $prefs['template'] = '<br /><br />
&nbsp;&nbsp;&nbsp;<dfn>{table_close}</dfn><var>&lt;/table></var><dfn>{/table_close}</dfn><br />
';<br />
<br />
-$this->calendar->initialize($prefs);<br />
+$this->load->library('calendar', $prefs);<br />
<br />
echo $this->calendar->generate();</code>
-<h2>Showing Next/Previous Month Links</h2>
-
-<p>To allow your calendar to dynamically increment/decrement via the next/previous links requires that you set up your calendar
-code similar to this example:</p>
-
-
-<code>$this->load->library('calendar');<br />
-<br />
-$prefs = array (<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'show_next_prev'&nbsp;&nbsp;=> TRUE,<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'next_prev_url'&nbsp;&nbsp; => 'http://www.your-site.com/index.php/calendar/show/'<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-<br />
-$this->calendar->initialize($prefs);<br />
-<br />
-echo $this->calendar->generate(<var>$this->uri->segment(3)</var>, <var>$this->uri->segment(4)</var>);</code>
-
-<p>You'll notice a few things about the above example:</p>
-
-<ul>
-<li>You must set the "show_next_prev" to TRUE.</li>
-<li>You must supply the URL to the controller containing your calendar in the "next_prev_url" preference.</li>
-<li>You must supply the "year" and "month" to the calendar generating function via the URI segments where they appear (Note: The calendar class automatically adds the year/month to the base URL you provide.).</li>
-</ul>
-
-
-
</div>
<!-- END CONTENT -->